From 87619335570a1cb9a869c451bb141d05dd927dc5 Mon Sep 17 00:00:00 2001 From: Craig Date: Mon, 18 Dec 2023 18:17:43 +0000 Subject: [PATCH] - Fixed the game breaking itself over Maven dates?? - Bulkhead Doors can no longer be used to nuke walls --- build.gradle | 18 ++++---- .../common/block/door/BulkHeadDoorBlock.java | 15 ++++--- .../registry/DeferredRegistry.java | 5 +-- .../resources/tardis_refined.accesswidener | 1 - fabric/build.gradle | 43 ++++++++++--------- forge/build.gradle | 8 ++-- .../3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 | 4 +- gradle.properties | 2 +- 8 files changed, 50 insertions(+), 46 deletions(-) diff --git a/build.gradle b/build.gradle index c8025e699..863856a66 100644 --- a/build.gradle +++ b/build.gradle @@ -20,19 +20,21 @@ subprojects { minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" mappings loom.layered() { officialMojangMappings() - // parchment("org.parchmentmc.data:parchment-${rootProject.mappings}") + // parchment("org.parchmentmc.data:parchment-${rootProject.mappings}") } implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2' } } -def getTimestamp() { - def timestamp = java.time.Instant.now() - def formatter = java.time.format.DateTimeFormatter.ofPattern("dd_MM_yy_HHmm") - return "[" + timestamp.atZone(java.time.ZoneId.systemDefault()).format(formatter) + "]" +def gitHash = { -> + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-parse', '--short', 'HEAD' + standardOutput = stdout + } + return stdout.toString().trim() } - def gitBranch() { def branch = "" def proc = "git rev-parse --abbrev-ref HEAD".execute() @@ -48,7 +50,7 @@ allprojects { apply plugin: "maven-publish" archivesBaseName = rootProject.jar_name - version = "${rootProject.minecraft_version}-${rootProject.mod_version}-${getTimestamp()}-${gitBranch()}" + version = "${rootProject.minecraft_version}-${rootProject.mod_version}-${gitHash()}-${gitBranch()}" group = rootProject.maven_group repositories { @@ -78,4 +80,4 @@ allprojects { java { withSourcesJar() } -} +} \ No newline at end of file diff --git a/common/src/main/java/whocraft/tardis_refined/common/block/door/BulkHeadDoorBlock.java b/common/src/main/java/whocraft/tardis_refined/common/block/door/BulkHeadDoorBlock.java index 72876d926..a6b6bbc0d 100644 --- a/common/src/main/java/whocraft/tardis_refined/common/block/door/BulkHeadDoorBlock.java +++ b/common/src/main/java/whocraft/tardis_refined/common/block/door/BulkHeadDoorBlock.java @@ -3,6 +3,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.level.BlockGetter; @@ -30,7 +31,7 @@ public class BulkHeadDoorBlock extends BaseEntityBlock { public static final BooleanProperty LOCKED = BooleanProperty.create("locked"); public BulkHeadDoorBlock(Properties properties) { - super(properties.sound(SoundType.ANVIL).offsetType(OffsetType.XZ)); + super(properties.sound(SoundType.ANVIL)); this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(OPEN, false).setValue(LOCKED, true)); } @@ -66,8 +67,6 @@ public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { public void onPlace(BlockState blockState, Level level, BlockPos blockPos, BlockState blockState2, boolean bl) { super.onPlace(blockState, level, blockPos, blockState2, bl); - if(!canSurvive(blockState, level, blockPos)) return; - if (blockState.getValue(OPEN)) { changeBlockStates(level, blockPos, blockState, Blocks.AIR.defaultBlockState()); } else { @@ -76,13 +75,17 @@ public void onPlace(BlockState blockState, Level level, BlockPos blockPos, Block } + @Override + public void playerDestroy(Level level, Player player, BlockPos blockPos, BlockState blockState, @Nullable BlockEntity blockEntity, ItemStack itemStack) { + super.playerDestroy(level, player, blockPos, blockState, blockEntity, itemStack); + destroy(level, blockPos, blockState); + } + @Override public void destroy(LevelAccessor levelAccessor, BlockPos blockPos, BlockState blockState) { super.destroy(levelAccessor, blockPos, blockState); - if(blockState.is(this) && canSurvive(blockState, levelAccessor, blockPos)) { - changeBlockStates((Level) levelAccessor, blockPos, blockState, Blocks.AIR.defaultBlockState()); - } + changeBlockStates((Level) levelAccessor, blockPos, blockState, Blocks.AIR.defaultBlockState()); } private void changeBlockStates(Level level, BlockPos blockPos, BlockState blockState, BlockState blockToSet) { diff --git a/common/src/main/java/whocraft/tardis_refined/registry/DeferredRegistry.java b/common/src/main/java/whocraft/tardis_refined/registry/DeferredRegistry.java index 4cd392f16..157ad065f 100644 --- a/common/src/main/java/whocraft/tardis_refined/registry/DeferredRegistry.java +++ b/common/src/main/java/whocraft/tardis_refined/registry/DeferredRegistry.java @@ -2,11 +2,10 @@ import com.mojang.serialization.Codec; import dev.architectury.injectables.annotations.ExpectPlatform; -import net.minecraft.core.Holder; import net.minecraft.core.Registry; import net.minecraft.resources.ResourceKey; +import whocraft.tardis_refined.TardisRefined; -import java.util.Collection; import java.util.function.Supplier; /** Abstraction of a Registry handler based off the design patterns of Forge's DeferredRegister. */ @@ -32,7 +31,7 @@ public abstract class DeferredRegistry { */ @ExpectPlatform public static DeferredRegistry create(String modid, ResourceKey> resourceKey) { - throw new AssertionError(); + throw new RuntimeException(TardisRefined.PLATFORM_ERROR); } /** Gets the underlying Codec for the registry object type, if defined. Currently unused and untested, but added for completeness*/ diff --git a/common/src/main/resources/tardis_refined.accesswidener b/common/src/main/resources/tardis_refined.accesswidener index 6f74019eb..173383525 100644 --- a/common/src/main/resources/tardis_refined.accesswidener +++ b/common/src/main/resources/tardis_refined.accesswidener @@ -11,4 +11,3 @@ accessible method net/minecraft/server/MinecraftServer wrapRunnable (Ljava/lang/ accessible field net/minecraft/server/level/ServerLevel dragonFight Lnet/minecraft/world/level/dimension/end/EndDragonFight; accessible method net/minecraft/client/particle/SuspendedParticle (Lnet/minecraft/client/multiplayer/ClientLevel;Lnet/minecraft/client/particle/SpriteSet;DDDDDD)V accessible field net/minecraft/client/particle/Particle gravity F -accessible field net/minecraft/client/resources/sounds/AbstractSoundInstance sound Lnet/minecraft/client/resources/sounds/Sound; \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index 69bcf0476..1a6f09e67 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -86,24 +86,24 @@ dependencies { modImplementation ("com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:v4.0.3-mc1.20.2") modImplementation ("com.github.iPortalTeam.ImmersivePortalsMod:build:v4.0.3-mc1.20.2") - /* // If working on Immersive Portals, change modCompileOnlyApi to modImplementation for the following two entries, this will enable Immersive Portals in Dev - modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:${rootProject.immersive_portals_version}") { - exclude(group: "net.fabricmc.fabric-api") - transitive(false) - } - modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:${rootProject.immersive_portals_version}") { - exclude(group: "net.fabricmc.fabric-api") - transitive(false) - } - //Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions - modCompileOnlyApi("com.github.LlamaLad7:MixinExtras:${rootProject.mixin_extras_version}") { - exclude(group: "net.fabricmc.fabric-api") - transitive(false) - } - //Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions - modCompileOnlyApi("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_fabric_version}") { - exclude(group: "net.fabricmc.fabric-api") - }*/ + /* // If working on Immersive Portals, change modCompileOnlyApi to modImplementation for the following two entries, this will enable Immersive Portals in Dev + modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:${rootProject.immersive_portals_version}") { + exclude(group: "net.fabricmc.fabric-api") + transitive(false) + } + modCompileOnlyApi("com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:${rootProject.immersive_portals_version}") { + exclude(group: "net.fabricmc.fabric-api") + transitive(false) + } + //Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions + modCompileOnlyApi("com.github.LlamaLad7:MixinExtras:${rootProject.mixin_extras_version}") { + exclude(group: "net.fabricmc.fabric-api") + transitive(false) + } + //Immersive Portals Dependency, not listed on their repo but required for 1.19+ versions + modCompileOnlyApi("me.shedaniel.cloth:cloth-config-fabric:${rootProject.cloth_config_fabric_version}") { + exclude(group: "net.fabricmc.fabric-api") + }*/ // Immersive Portals End @@ -182,11 +182,12 @@ publishing { repositories { maven { - url = project.findProperty("maven_repo_url") ?: "https://maven.craig.software/repository/whocraft/" + url = project.findProperty("maven_repo_url") ?: "http://craig.software:8081/repository/whocraft/" credentials { - username = project.findProperty("MAVEN_REPO_USERNAME") ?: System.getenv("MAVEN_REPO_USERNAME") ?: "" - password = project.findProperty("MAVEN_REPO_PASSWORD") ?: System.getenv("MAVEN_REPO_PASSWORD") ?: "" + username = System.getenv("MAVEN_REPO_USERNAME") + password = System.getenv("MAVEN_REPO_PASSWORD") } + allowInsecureProtocol = true } } } \ No newline at end of file diff --git a/forge/build.gradle b/forge/build.gradle index 347a92cfa..7930ea50d 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -155,13 +155,13 @@ publishing { repositories { maven { - url = project.findProperty("maven_repo_url") ?: "https://maven.craig.software/repository/whocraft/" + url = project.findProperty("maven_repo_url") ?: "http://craig.software:8081/repository/whocraft/" credentials { - username = project.findProperty("MAVEN_REPO_USERNAME") ?: System.getenv("MAVEN_REPO_USERNAME") ?: "" - password = project.findProperty("MAVEN_REPO_PASSWORD") ?: System.getenv("MAVEN_REPO_PASSWORD") ?: "" + username = System.getenv("MAVEN_REPO_USERNAME") + password = System.getenv("MAVEN_REPO_PASSWORD") } + allowInsecureProtocol = true } } } - diff --git a/forge/src/generated/resources/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 b/forge/src/generated/resources/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 index a509a0ec2..306031f8f 100644 --- a/forge/src/generated/resources/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 +++ b/forge/src/generated/resources/.cache/3fcdc37ad136e2a9e4d043224d2db5bc1dee2659 @@ -1,4 +1,4 @@ -// 1.20.2 2023-12-10T20:38:52.4743381 Shell Patterns +// 1.20.2 2023-12-18T17:52:51.3188952 Shell Patterns 24c3b07d5ebcb921f1a4014c0c7b7ce1db66d291 data/tardis_refined/tardis_refined/patterns/shell/big_ben.json c023593375b56bf2ba50df33b355f0f99d062227 data/tardis_refined/tardis_refined/patterns/shell/briefcase.json 0c683f48298e8e97709fa8f659a659440e35dc61 data/tardis_refined/tardis_refined/patterns/shell/castle.json @@ -12,7 +12,7 @@ a033e392d5ce58b74e9dd2561b2a3012b49525d2 data/tardis_refined/tardis_refined/patt 9636dacb9cae8d3d893a7f9bfca195631397973b data/tardis_refined/tardis_refined/patterns/shell/nuka.json bb9b537f1b29c2414d9284828094163a425bcd70 data/tardis_refined/tardis_refined/patterns/shell/pagoda.json 9acf33da121ce7c83457b3d85c0a92d5ba511efd data/tardis_refined/tardis_refined/patterns/shell/phone_booth.json -67d26906e3655e7f9f08a906b56b225f71248726 data/tardis_refined/tardis_refined/patterns/shell/police_box.json +d137e095ef4d32650e62dc8cba9a8abdb6634ef2 data/tardis_refined/tardis_refined/patterns/shell/police_box.json ba4b42fe3655f24a4263e59b614b0644229730a8 data/tardis_refined/tardis_refined/patterns/shell/portaloo.json fdc997718013ffac35fe5192e0fbf32b60323720 data/tardis_refined/tardis_refined/patterns/shell/present.json 23066a16183502e0751e16f152356bde64f17045 data/tardis_refined/tardis_refined/patterns/shell/vending.json diff --git a/gradle.properties b/gradle.properties index 76079c5eb..dd898c5f4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.jvmargs=-Xmx4G ##Mod Building and Metadata -jar_name=TARDIS Refined +jar_name=tardis_refined mod_name=TARDIS Refined mod_id=tardis_refined maven_group=whocraft