Skip to content

Commit

Permalink
Config option to disable dolly stacking (#32)
Browse files Browse the repository at this point in the history
* disable stacking cfg

* code to disable stacking

* Add files via upload

* Add files via upload
  • Loading branch information
brandyyn authored May 27, 2024
1 parent cda7311 commit b6f6a3b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/mcp/mobius/betterbarrels/BetterBarrels.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static void debug(String msg) {

/* CONFIG PARAMS */
private static Configuration config = null;

public static boolean disableDollyStacking;
public static boolean fullBarrelTexture = true;
public static boolean highRezTexture = true;
public static boolean showUpgradeSymbols = true;
Expand Down Expand Up @@ -216,6 +216,12 @@ public void preInit(FMLPreInitializationEvent event) {
BlacklistedTileEntiyClassNames,
"The Canonical Class-Names of TileEntities that should be ignored when using a Dolly.");

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);
// highRezTexture = config.get(Configuration.CATEGORY_GENERAL, "highRezTexture", false).getBoolean(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer
return itemStack;
}

// Config to enable or disable Dollie
if (BetterBarrels.disableDollyStacking) {
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);
Expand Down

0 comments on commit b6f6a3b

Please sign in to comment.