From a31d7139586e27cb18cf68f1d581be73f38e60d1 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Wed, 23 Mar 2022 18:02:03 +0100 Subject: [PATCH] Sibling in hiding - Removed copper backtanks' helper item from creative tab, fixed its model loading issues --- src/generated/resources/.cache/cache | 1 + .../create/models/item/copper_backtank_placeable.json | 3 +++ src/main/java/com/simibubi/create/AllItems.java | 2 +- .../content/curiosities/armor/CopperBacktankBlock.java | 7 ++++++- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/generated/resources/assets/create/models/item/copper_backtank_placeable.json diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index f113565e7..04f1d9048 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -1619,6 +1619,7 @@ dcb09deae110077bcddf090996b51cc66e9a7de3 assets/create/models/item/cogwheel.json 7717e3b21cff39f497f07687c70c1fa40eaa756d assets/create/models/item/content_observer.json 9dbd63c9e1b09a663fd4b83d76e3ab5967086167 assets/create/models/item/controller_rail.json 10397036fc0bb1e18a767cfd7b19b10d805a83fe assets/create/models/item/copper_backtank.json +3652f8f7b454940050f090ab32d38e04b93e14f8 assets/create/models/item/copper_backtank_placeable.json 759bcb5fe7dfdd628716f9b4ff19a5ab00393381 assets/create/models/item/copper_casing.json 751324b03f657f4166460eb10a64dae47cb97bd4 assets/create/models/item/copper_nugget.json 177dafb51d70c55ec62036332868efed4e01f353 assets/create/models/item/copper_sheet.json diff --git a/src/generated/resources/assets/create/models/item/copper_backtank_placeable.json b/src/generated/resources/assets/create/models/item/copper_backtank_placeable.json new file mode 100644 index 000000000..ff77c281b --- /dev/null +++ b/src/generated/resources/assets/create/models/item/copper_backtank_placeable.json @@ -0,0 +1,3 @@ +{ + "parent": "minecraft:item/barrier" +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllItems.java b/src/main/java/com/simibubi/create/AllItems.java index 03c4a9785..41147d22c 100644 --- a/src/main/java/com/simibubi/create/AllItems.java +++ b/src/main/java/com/simibubi/create/AllItems.java @@ -247,7 +247,7 @@ public class AllItems { // must be registered as of 1.18.2 public static final ItemEntry COPPER_BACKTANK_PLACEABLE = REGISTRATE .item("copper_backtank_placeable", p -> new CopperBacktankBlockItem(AllBlocks.COPPER_BACKTANK.get(), p)) - .model((c, p) -> p.getExistingFile(p.mcLoc("item/barrier"))) + .model((c, p) -> p.withExistingParent(c.getName(), p.mcLoc("item/barrier"))) .register(); public static final ItemEntry diff --git a/src/main/java/com/simibubi/create/content/curiosities/armor/CopperBacktankBlock.java b/src/main/java/com/simibubi/create/content/curiosities/armor/CopperBacktankBlock.java index e2eda105f..a83030faa 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/armor/CopperBacktankBlock.java +++ b/src/main/java/com/simibubi/create/content/curiosities/armor/CopperBacktankBlock.java @@ -12,6 +12,7 @@ import com.simibubi.create.foundation.block.ITE; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; +import net.minecraft.core.NonNullList; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.ListTag; import net.minecraft.network.chat.Component; @@ -23,6 +24,7 @@ import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.context.BlockPlaceContext; import net.minecraft.world.item.enchantment.EnchantmentHelper; @@ -63,7 +65,10 @@ public class CopperBacktankBlock extends HorizontalKineticBlock builder.add(BlockStateProperties.WATERLOGGED); super.createBlockStateDefinition(builder); } - + + @Override + public void fillItemCategory(CreativeModeTab pTab, NonNullList pItems) {} + @Override public boolean hasAnalogOutputSignal(BlockState p_149740_1_) { return true;