From 2643cdb2bc1a53f153e0f85f1dfe917768ad65b2 Mon Sep 17 00:00:00 2001 From: brandyn Date: Tue, 21 May 2024 18:26:42 +0100 Subject: [PATCH 1/4] disable stacking cfg --- src/main/java/mcp/mobius/betterbarrels/BetterBarrels.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/mcp/mobius/betterbarrels/BetterBarrels.java b/src/main/java/mcp/mobius/betterbarrels/BetterBarrels.java index 8121e73..5d32829 100644 --- a/src/main/java/mcp/mobius/betterbarrels/BetterBarrels.java +++ b/src/main/java/mcp/mobius/betterbarrels/BetterBarrels.java @@ -69,7 +69,7 @@ public static void debug(String msg) { /* CONFIG PARAMS */ private static Configuration config = null; - + public static boolean DisableStacking; public static boolean fullBarrelTexture = true; public static boolean highRezTexture = true; public static boolean showUpgradeSymbols = true; @@ -216,6 +216,8 @@ public void preInit(FMLPreInitializationEvent event) { BlacklistedTileEntiyClassNames, "The Canonical Class-Names of TileEntities that should be ignored when using a Dolly."); + DisableStacking = config.getBoolean("DisableStacking", Configuration.CATEGORY_GENERAL, false, "Disables the ability to collapse and stack the dollies"); + // fullBarrelTexture = config.get(Configuration.CATEGORY_GENERAL, "fullBarrelTexture", // true).getBoolean(true); // highRezTexture = config.get(Configuration.CATEGORY_GENERAL, "highRezTexture", false).getBoolean(false); From 8375f107b505b39263dd171626d8e4707f13bd4b Mon Sep 17 00:00:00 2001 From: brandyn Date: Tue, 21 May 2024 18:27:26 +0100 Subject: [PATCH 2/4] code to disable stacking --- .../common/items/dolly/ItemBarrelMover.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/mcp/mobius/betterbarrels/common/items/dolly/ItemBarrelMover.java b/src/main/java/mcp/mobius/betterbarrels/common/items/dolly/ItemBarrelMover.java index 0d8d58c..9ca2d8a 100644 --- a/src/main/java/mcp/mobius/betterbarrels/common/items/dolly/ItemBarrelMover.java +++ b/src/main/java/mcp/mobius/betterbarrels/common/items/dolly/ItemBarrelMover.java @@ -187,18 +187,25 @@ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, return false; } + @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if (world.isRemote) { return itemStack; } + // Config to enable or disable Dollie + if (BetterBarrels.DisableStacking) { + return itemStack; + } + // This prevents the dolly from folding after sneak right-clicking to place an item. if (itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey(PREVENT_FOLD_TAG_KEY)) { itemStack.getTagCompound().removeTag(PREVENT_FOLD_TAG_KEY); return itemStack; } + if (player.isSneaking() && type == DollyType.NORMAL && (!itemStack.hasTagCompound() || !itemStack.getTagCompound().hasKey("Container"))) { // Diamond dollies can't be folded because they can be damaged. @@ -217,6 +224,8 @@ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer return itemStack; } + + protected boolean placeContainer(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side) { NBTTagCompound nbtStack = stack.getTagCompound(); NBTTagCompound nbtContainerStack = nbtStack.getCompoundTag("Container"); From 104c151ed28c8b885a9904f39672418b6e1aa661 Mon Sep 17 00:00:00 2001 From: brandyn Date: Mon, 27 May 2024 11:43:11 +0100 Subject: [PATCH 3/4] Add files via upload --- src/main/java/mcp/mobius/betterbarrels/BetterBarrels.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/mcp/mobius/betterbarrels/BetterBarrels.java b/src/main/java/mcp/mobius/betterbarrels/BetterBarrels.java index 5d32829..3710c2d 100644 --- a/src/main/java/mcp/mobius/betterbarrels/BetterBarrels.java +++ b/src/main/java/mcp/mobius/betterbarrels/BetterBarrels.java @@ -69,7 +69,7 @@ public static void debug(String msg) { /* CONFIG PARAMS */ private static Configuration config = null; - public static boolean DisableStacking; + public static boolean disableDollyStacking; public static boolean fullBarrelTexture = true; public static boolean highRezTexture = true; public static boolean showUpgradeSymbols = true; @@ -216,7 +216,11 @@ public void preInit(FMLPreInitializationEvent event) { BlacklistedTileEntiyClassNames, "The Canonical Class-Names of TileEntities that should be ignored when using a Dolly."); - DisableStacking = config.getBoolean("DisableStacking", Configuration.CATEGORY_GENERAL, false, "Disables the ability to collapse and stack the dollies"); + disableDollyStacking = config.getBoolean( + "disableDollyStacking", + Configuration.CATEGORY_GENERAL, + false, + "Disables the ability to collapse and stack the dollies"); // fullBarrelTexture = config.get(Configuration.CATEGORY_GENERAL, "fullBarrelTexture", // true).getBoolean(true); From c5135aa3e1e2896fd710cefaa36e552be01d4e28 Mon Sep 17 00:00:00 2001 From: brandyn Date: Mon, 27 May 2024 11:43:54 +0100 Subject: [PATCH 4/4] Add files via upload --- .../betterbarrels/common/items/dolly/ItemBarrelMover.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/mcp/mobius/betterbarrels/common/items/dolly/ItemBarrelMover.java b/src/main/java/mcp/mobius/betterbarrels/common/items/dolly/ItemBarrelMover.java index 9ca2d8a..b2cfb5e 100644 --- a/src/main/java/mcp/mobius/betterbarrels/common/items/dolly/ItemBarrelMover.java +++ b/src/main/java/mcp/mobius/betterbarrels/common/items/dolly/ItemBarrelMover.java @@ -187,7 +187,6 @@ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, return false; } - @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if (world.isRemote) { @@ -195,7 +194,7 @@ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer } // Config to enable or disable Dollie - if (BetterBarrels.DisableStacking) { + if (BetterBarrels.disableDollyStacking) { return itemStack; } @@ -205,7 +204,6 @@ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer return itemStack; } - if (player.isSneaking() && type == DollyType.NORMAL && (!itemStack.hasTagCompound() || !itemStack.getTagCompound().hasKey("Container"))) { // Diamond dollies can't be folded because they can be damaged. @@ -224,8 +222,6 @@ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer return itemStack; } - - protected boolean placeContainer(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side) { NBTTagCompound nbtStack = stack.getTagCompound(); NBTTagCompound nbtContainerStack = nbtStack.getCompoundTag("Container");