diff --git a/build.gradle b/build.gradle index 6fa43f7..ecd9c82 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id "fabric-loom" version "1.2-SNAPSHOT" + id "fabric-loom" version "1.3-SNAPSHOT" id "maven-publish" id "com.matthewprenger.cursegradle" version "1.4.0" id "com.modrinth.minotaur" version "2.+" @@ -111,7 +111,7 @@ java { jar { from("LICENSE") { - rename { "${it}_${project.archivesBaseName}"} + rename { "${it}_${project.base.archivesName.get()}"} } } diff --git a/gradle.properties b/gradle.properties index 08d9a0f..73ab39a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,8 +5,8 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop minecraft_version=1.20.1 - yarn_mappings=1.20.1+build.2 - loader_version=0.14.21 + yarn_mappings=1.20.1+build.10 + loader_version=0.14.22 # Mod Properties mod_version=2.4.1+1.20 @@ -15,7 +15,7 @@ org.gradle.parallel=true archives_base_name=reinforced-shulker-boxes # Dependencies - fabric_version=0.83.1+1.20.1 + fabric_version=0.87.0+1.20.1 reinforced_core_version=3.1.2+1.20 reinforced_chests_version=2.4.2+1.20 quick_shulker_version=1.4.0-1.20 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cb..033e24c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 37aef8d..62f495d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cb..fcb6fca 100755 --- a/gradlew +++ b/gradlew @@ -130,10 +130,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. diff --git a/src/main/java/atonkish/reinfshulker/ReinforcedShulkerBoxesMod.java b/src/main/java/atonkish/reinfshulker/ReinforcedShulkerBoxesMod.java index 5c61f53..b7b8956 100644 --- a/src/main/java/atonkish/reinfshulker/ReinforcedShulkerBoxesMod.java +++ b/src/main/java/atonkish/reinfshulker/ReinforcedShulkerBoxesMod.java @@ -76,7 +76,7 @@ private static void initializeReinforcedShulkerBoxes() { materialSettings.getBlockSettings()); for (DyeColor color : DyeColor.values()) { ReinforcedShulkerBoxesRegistry.registerMaterialDyeColorBlock(MOD_ID, material, color, - materialSettings.getBlockSettings()); + materialSettings.getColorBlockSettings(color)); } ReinforcedShulkerBoxesRegistry.registerMaterialBlockEntityType(MOD_ID, material); diff --git a/src/main/java/atonkish/reinfshulker/util/ReinforcingMaterialSettings.java b/src/main/java/atonkish/reinfshulker/util/ReinforcingMaterialSettings.java index a66159f..fd922b1 100644 --- a/src/main/java/atonkish/reinfshulker/util/ReinforcingMaterialSettings.java +++ b/src/main/java/atonkish/reinfshulker/util/ReinforcingMaterialSettings.java @@ -4,12 +4,16 @@ import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; +import net.minecraft.block.Blocks; +import net.minecraft.block.MapColor; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.ShulkerBoxBlockEntity; import net.minecraft.block.enums.Instrument; +import net.minecraft.block.piston.PistonBehavior; import net.minecraft.item.Item; import net.minecraft.item.Items; import net.minecraft.sound.BlockSoundGroup; +import net.minecraft.util.DyeColor; import atonkish.reinfcore.api.ReinforcedCoreRegistry; import atonkish.reinfcore.util.ReinforcingMaterial; @@ -20,33 +24,33 @@ public enum ReinforcingMaterialSettings { .create() .strength(2.0F, 6.0F) .sounds(BlockSoundGroup.COPPER), - new Item.Settings().maxCount(1)), + new Item.Settings()), IRON(ReinforcedCoreRegistry.registerReinforcingMaterial("iron", 54, Items.IRON_INGOT), FabricBlockSettings .create() .instrument(Instrument.IRON_XYLOPHONE) .strength(2.0F, 6.0F) .sounds(BlockSoundGroup.METAL), - new Item.Settings().maxCount(1)), + new Item.Settings()), GOLD(ReinforcedCoreRegistry.registerReinforcingMaterial("gold", 81, Items.GOLD_INGOT), FabricBlockSettings .create() .instrument(Instrument.BELL) .strength(2.0F, 6.0F) .sounds(BlockSoundGroup.METAL), - new Item.Settings().maxCount(1)), + new Item.Settings()), DIAMOND(ReinforcedCoreRegistry.registerReinforcingMaterial("diamond", 108, Items.DIAMOND), FabricBlockSettings .create() .strength(2.0F, 6.0F) .sounds(BlockSoundGroup.METAL), - new Item.Settings().maxCount(1)), + new Item.Settings()), NETHERITE(ReinforcedCoreRegistry.registerReinforcingMaterial("netherite", 108, Items.NETHERITE_INGOT), FabricBlockSettings .create() .strength(2.0F, 1200.0F) .sounds(BlockSoundGroup.NETHERITE), - new Item.Settings().maxCount(1).fireproof()); + new Item.Settings().fireproof()); private final ReinforcingMaterial material; private final Block.Settings blockSettings; @@ -58,16 +62,16 @@ private ReinforcingMaterialSettings(ReinforcingMaterial material, Block.Settings BlockEntity blockEntity = world.getBlockEntity(pos); if (!(blockEntity instanceof ShulkerBoxBlockEntity)) { return true; - } else { - ShulkerBoxBlockEntity shulkerBoxBlockEntity = (ShulkerBoxBlockEntity) blockEntity; - return shulkerBoxBlockEntity.suffocates(); } + ShulkerBoxBlockEntity shulkerBoxBlockEntity = (ShulkerBoxBlockEntity) blockEntity; + return shulkerBoxBlockEntity.suffocates(); }; this.material = material; - this.blockSettings = blockSettings.dynamicBounds().nonOpaque() - .suffocates(contextPredicate).blockVision(contextPredicate); - this.itemSettings = itemSettings; + this.blockSettings = blockSettings.solid().dynamicBounds().nonOpaque() + .suffocates(contextPredicate).blockVision(contextPredicate) + .pistonBehavior(PistonBehavior.DESTROY).solidBlock(Blocks::always); + this.itemSettings = itemSettings.maxCount(1); } public ReinforcingMaterial getMaterial() { @@ -75,7 +79,16 @@ public ReinforcingMaterial getMaterial() { } public Block.Settings getBlockSettings() { - return this.blockSettings; + return this.blockSettings.mapColor(MapColor.PURPLE); + } + + public Block.Settings getColorBlockSettings(DyeColor color) { + MapColor mapColor = switch (color) { + case PURPLE -> MapColor.TERRACOTTA_PURPLE; + default -> color.getMapColor(); + }; + + return this.blockSettings.mapColor(mapColor); } public Item.Settings getItemSettings() {