add shift berry consumption config (#119)

This commit is contained in:
GDCloud authored and GitHub committed 2024-06-26 20:27:04 +02:00
1 parent 63df442eb3
commit 170cde4284
2 files changed
+11 -2

No files matched your search

@@ -215,6 +215,12 @@ public class PHConstruct {
"Always cast TConstruct ingots",
true,
"You will always get a TConstruct item from casting an ingot or block.").getBoolean();
consumeXPBerryStacks = config.get(
"general",
"Allow stackwise consumption",
true,
"Allow stacks of essence berries to be consumed at once when shifting (this does not spawn XP orbs in world).")
.getBoolean();
enableHealthRegen = config.get("Ultra Hardcore Changes", "Passive Health Regen", true).getBoolean(true);
goldAppleRecipe = config.get(
@@ -404,6 +410,8 @@ public class PHConstruct {
public static int seaLevel;
public static boolean tconComesFirst;
public static boolean consumeXPBerryStacks;
// Mobs
public static int naturalSlimeSpawn;
@@ -13,6 +13,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mantle.items.abstracts.CraftingItem;
import tconstruct.library.TConstructRegistry;
import tconstruct.util.config.PHConstruct;
public class OreBerries extends CraftingItem {
@@ -52,7 +53,7 @@ public class OreBerries extends CraftingItem {
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if (stack.getItemDamage() == 5) {
if (!player.isSneaking()) {
if (!PHConstruct.consumeXPBerryStacks || !player.isSneaking()) {
EntityXPOrb entity = new EntityXPOrb(
world,
player.posX,
@@ -61,7 +62,7 @@ public class OreBerries extends CraftingItem {
itemRand.nextInt(14) + 6);
spawnEntity(player.posX, player.posY + 1, player.posZ, entity, world, player);
if (!player.capabilities.isCreativeMode) stack.stackSize--;
} else {
} else if (PHConstruct.consumeXPBerryStacks) {
int xpToAdd = 0;
for (int i = stack.stackSize; i > 0; i--) {
xpToAdd += itemRand.nextInt(14) + 6;