From 058a9389b7d58970bf79437eea9f64d36414e7c9 Mon Sep 17 00:00:00 2001 From: sh4dow Date: Wed, 16 Oct 2024 11:31:30 +0200 Subject: [PATCH 1/2] various changes - enchanted soil affects passive generating flowers and Loonium speed, and can be silk touched - Gourmaryllis now generates mana continously (total unchanged) - Gourmaryllis uses the higher of hunger and saturation of the given food - Gourmaryllis can consume stacks of items to run for longer at a time, and doesn't consume other items while "eating" - Pixie ring now provides a pixie chance similar to a single piece of elementium armor (though obviously no armor value) --- .../api/subtile/SubTileGenerating.java | 3 +- .../common/block/BlockEnchantedSoil.java | 2 +- .../subtile/functional/SubTileLoonuim.java | 2 +- .../generating/SubTileGourmaryllis.java | 57 ++++++++++--------- .../item/equipment/bauble/ItemPixieRing.java | 2 +- 5 files changed, 35 insertions(+), 31 deletions(-) diff --git a/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java b/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java index 02f7a23afc..2652c275a6 100644 --- a/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java +++ b/src/main/java/vazkii/botania/api/subtile/SubTileGenerating.java @@ -309,7 +309,8 @@ public void renderHUD(Minecraft mc, ScaledResolution res) { @Override public boolean isOvergrowthAffected() { - return !isPassiveFlower(); + return true; + //return !isPassiveFlower(); } } diff --git a/src/main/java/vazkii/botania/common/block/BlockEnchantedSoil.java b/src/main/java/vazkii/botania/common/block/BlockEnchantedSoil.java index 1c66aca3f7..4a64b6d50b 100644 --- a/src/main/java/vazkii/botania/common/block/BlockEnchantedSoil.java +++ b/src/main/java/vazkii/botania/common/block/BlockEnchantedSoil.java @@ -91,7 +91,7 @@ public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDir @Override protected boolean canSilkHarvest() { - return false; + return true; } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java index ce14cfaed5..b2434278ad 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java @@ -63,7 +63,7 @@ public LexiconEntry getEntry() { @Override public int getMaxMana() { - return COST; + return COST*2; } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java index 5109539e70..584a54ef57 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java @@ -35,41 +35,44 @@ public class SubTileGourmaryllis extends SubTileGenerating { public void onUpdate() { super.onUpdate(); - if(cooldown > 0) - cooldown--; - if(cooldown == 0 && !supertile.getWorldObj().isRemote) { - mana = Math.min(getMaxMana(), mana + storedMana); - storedMana = 0; - sync(); + //if(cooldown > 0) + // cooldown--; + //if(cooldown == 0 && !supertile.getWorldObj().isRemote) { + // mana = Math.min(getMaxMana(), mana + storedMana); + // storedMana = 0; + // sync(); + //} + if (cooldown > 0) { + if (cooldown-- % 10 == 1) + mana = Math.min(getMaxMana(), mana + storedMana); } - int slowdown = getSlowdownFactor(); - + boolean remote = supertile.getWorldObj().isRemote; List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1)); - for(EntityItem item : items) { + for (EntityItem item : items) { ItemStack stack = item.getEntityItem(); - if(stack != null && stack.getItem() instanceof ItemFood && !item.isDead && item.age >= slowdown) { - if(cooldown == 0) { - if(!remote) { - int val = ((ItemFood) stack.getItem()).func_150905_g(stack); - storedMana = val * val * 64; - cooldown = val * 10; + if (stack != null && stack.getItem() instanceof ItemFood && !item.isDead && item.age >= slowdown) { + if (cooldown == 0) { + if (!remote) { + float val = ((ItemFood) stack.getItem()).func_150905_g(stack); + float satMod = ((ItemFood) stack.getItem()).func_150906_h(stack); + if (satMod > 0.5) // use saturation if higher + val *= 2 * satMod; // round down, if not right below integer (x%1>=0.8) + storedMana = (int) (val * 64 + 0.5); // round + cooldown = (int) (val * 10 * stack.stackSize + 0.5); supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.eat", 0.2F, 0.5F + (float) Math.random() * 0.5F); sync(); - } else - for(int i = 0; i < 10; i++) { - float m = 0.2F; - float mx = (float) (Math.random() - 0.5) * m; - float my = (float) (Math.random() - 0.5) * m; - float mz = (float) (Math.random() - 0.5) * m; - supertile.getWorldObj().spawnParticle("iconcrack_" + Item.getIdFromItem(stack.getItem()), item.posX, item.posY, item.posZ, mx, my, mz); - } - + } else for (int i = 0; i < 10; i++) { + float m = 0.2F; + float mx = (float) (Math.random() - 0.5) * m; + float my = (float) (Math.random() - 0.5) * m; + float mz = (float) (Math.random() - 0.5) * m; + supertile.getWorldObj().spawnParticle("iconcrack_" + Item.getIdFromItem(stack.getItem()), item.posX, item.posY, item.posZ, mx, my, mz); + } + if (!remote) + item.setDead(); } - - if(!remote) - item.setDead(); } } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemPixieRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemPixieRing.java index d3055c7d36..58aeb61bab 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemPixieRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemPixieRing.java @@ -28,7 +28,7 @@ public BaubleType getBaubleType(ItemStack arg0) { @Override public float getPixieChance(ItemStack stack) { - return 0.075F; + return 0.15F; } } From bf59e12bb08f5910727dc785a3967861a2af6dad Mon Sep 17 00:00:00 2001 From: sh4dow Date: Wed, 16 Oct 2024 12:16:54 +0200 Subject: [PATCH 2/2] reverted Gourmaryllis item consumption changes --- .../subtile/generating/SubTileGourmaryllis.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java index 584a54ef57..ce03f89a38 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java @@ -43,8 +43,10 @@ public void onUpdate() { // sync(); //} if (cooldown > 0) { - if (cooldown-- % 10 == 1) + if (cooldown-- % 10 == 1) { mana = Math.min(getMaxMana(), mana + storedMana); + sync(); + } } int slowdown = getSlowdownFactor(); @@ -58,9 +60,9 @@ public void onUpdate() { float val = ((ItemFood) stack.getItem()).func_150905_g(stack); float satMod = ((ItemFood) stack.getItem()).func_150906_h(stack); if (satMod > 0.5) // use saturation if higher - val *= 2 * satMod; // round down, if not right below integer (x%1>=0.8) + val *= 2 * satMod; // saturation bars = hunger bars * saturation modifier * 2 storedMana = (int) (val * 64 + 0.5); // round - cooldown = (int) (val * 10 * stack.stackSize + 0.5); + cooldown = (int) (val * 10 + 0.5); supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.eat", 0.2F, 0.5F + (float) Math.random() * 0.5F); sync(); } else for (int i = 0; i < 10; i++) { @@ -70,9 +72,9 @@ public void onUpdate() { float mz = (float) (Math.random() - 0.5) * m; supertile.getWorldObj().spawnParticle("iconcrack_" + Item.getIdFromItem(stack.getItem()), item.posX, item.posY, item.posZ, mx, my, mz); } - if (!remote) - item.setDead(); } + if (!remote) + item.setDead(); } } }