From 5f87ba9316e0ec3488683365ecf40047a03ba422 Mon Sep 17 00:00:00 2001 From: Kamil <34790800+Tiviacz1337@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:15:45 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20Traveler's=20Backpack=20?= =?UTF-8?q?item=20group=20icon=20appearing=20without=20fluids=20in=20tank?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../travelersbackpack/init/ModItemGroups.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/tiviacz/travelersbackpack/init/ModItemGroups.java b/src/main/java/com/tiviacz/travelersbackpack/init/ModItemGroups.java index aa29b67a3..53d7bbccc 100644 --- a/src/main/java/com/tiviacz/travelersbackpack/init/ModItemGroups.java +++ b/src/main/java/com/tiviacz/travelersbackpack/init/ModItemGroups.java @@ -32,10 +32,17 @@ public static void registerItemGroup() public static ItemStack createTabStack() { ItemStack stack = new ItemStack(ModItems.STANDARD_TRAVELERS_BACKPACK); - stack.getOrCreateNbt().getCompound(ITravelersBackpackInventory.LEFT_TANK).put("variant", FluidVariant.of(Fluids.WATER).toNbt()); - stack.getOrCreateNbt().getCompound(ITravelersBackpackInventory.LEFT_TANK).putLong("amount", TravelersBackpackConfig.getConfig().backpackSettings.leather.tankCapacity); - stack.getOrCreateNbt().getCompound(ITravelersBackpackInventory.RIGHT_TANK).put("variant", FluidVariant.of(Fluids.LAVA).toNbt()); - stack.getOrCreateNbt().getCompound(ITravelersBackpackInventory.RIGHT_TANK).putLong("amount", TravelersBackpackConfig.getConfig().backpackSettings.leather.tankCapacity); + + NbtCompound leftTank = new NbtCompound(); + leftTank.put("variant", FluidVariant.of(Fluids.WATER).toNbt()); + leftTank.putLong("amount", TravelersBackpackConfig.getConfig().backpackSettings.leather.tankCapacity); + stack.getOrCreateNbt().put(ITravelersBackpackInventory.LEFT_TANK, leftTank); + + NbtCompound rightTank = new NbtCompound(); + rightTank.put("variant", FluidVariant.of(Fluids.LAVA).toNbt()); + rightTank.putLong("amount", TravelersBackpackConfig.getConfig().backpackSettings.leather.tankCapacity); + stack.getOrCreateNbt().put(ITravelersBackpackInventory.RIGHT_TANK, rightTank); + return stack; }