diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java index a4300dd0..2175573d 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityFlowerGenerator.java @@ -7,7 +7,6 @@ import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketParticleStream; import de.ellpeck.naturesaura.packet.PacketParticles; import net.minecraft.block.Block; -import net.minecraft.block.BlockFlower; import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; @@ -52,10 +51,13 @@ public class TileEntityFlowerGenerator extends TileEntityImpl implements ITickab int addAmount = 200; int toAdd = Math.max(0, addAmount - curr.getValue()); if (toAdd > 0) { - BlockPos auraPos = IAuraChunk.getLowestSpot(this.world, this.pos, 30, this.pos); - if (NaturesAuraAPI.TYPE_OVERWORLD.isPresentInWorld(this.world) && IAuraChunk.getAuraInArea(this.world, auraPos, 30) < 20000) - IAuraChunk.getAuraChunk(this.world, auraPos).storeAura(auraPos, toAdd); - else + if (NaturesAuraAPI.TYPE_OVERWORLD.isPresentInWorld(this.world) && IAuraChunk.getAuraInArea(this.world, this.pos, 35) < 20000) { + int remain = toAdd; + while (remain > 0) { + BlockPos spot = IAuraChunk.getLowestSpot(this.world, this.pos, 30, this.pos); + remain -= IAuraChunk.getAuraChunk(this.world, spot).storeAura(spot, remain); + } + } else toAdd = 0; } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityOakGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityOakGenerator.java index 662f78d6..b5801b06 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityOakGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityOakGenerator.java @@ -20,8 +20,11 @@ public class TileEntityOakGenerator extends TileEntityImpl implements ITickable while (!this.scheduledBigTrees.isEmpty()) { BlockPos pos = this.scheduledBigTrees.remove(); if (this.world.getBlockState(pos).getBlock() instanceof BlockLog) { - BlockPos spot = IAuraChunk.getLowestSpot(this.world, this.pos, 25, this.pos); - IAuraChunk.getAuraChunk(this.world, spot).storeAura(spot, 500); + int toAdd = 500; + while (toAdd > 0) { + BlockPos spot = IAuraChunk.getLowestSpot(this.world, this.pos, 25, this.pos); + toAdd -= IAuraChunk.getAuraChunk(this.world, spot).storeAura(spot, toAdd); + } PacketHandler.sendToAllAround(this.world, this.pos, 32, new PacketParticles( this.pos.getX(), this.pos.getY(), this.pos.getZ(), 12, diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPotionGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPotionGenerator.java index c528c9a9..337aff07 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPotionGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityPotionGenerator.java @@ -47,10 +47,12 @@ public class TileEntityPotionGenerator extends TileEntityImpl implements ITickab boolean foundEmpty = false; for (EnumFacing dir : EnumFacing.HORIZONTALS) { BlockPos offset = this.pos.offset(dir, 12); - BlockPos spot = IAuraChunk.getLowestSpot(this.world, offset, 15, offset); - if (IAuraChunk.getAuraInArea(this.world, spot, 15) < 20000) { - IAuraChunk chunk = IAuraChunk.getAuraChunk(this.world, spot); - chunk.storeAura(spot, toAdd); + if (IAuraChunk.getAuraInArea(this.world, offset, 15) < 20000) { + int remain = toAdd; + while (remain > 0) { + BlockPos spot = IAuraChunk.getLowestSpot(this.world, offset, 15, offset); + remain -= IAuraChunk.getAuraChunk(this.world, spot).storeAura(spot, toAdd); + } foundEmpty = true; toAddTimes--; diff --git a/src/main/java/de/ellpeck/naturesaura/chunk/effect/BalanceEffect.java b/src/main/java/de/ellpeck/naturesaura/chunk/effect/BalanceEffect.java index 5a07375b..382616ae 100644 --- a/src/main/java/de/ellpeck/naturesaura/chunk/effect/BalanceEffect.java +++ b/src/main/java/de/ellpeck/naturesaura/chunk/effect/BalanceEffect.java @@ -29,8 +29,8 @@ public class BalanceEffect implements IDrainSpotEffect { return; IAuraChunk highestChunk = IAuraChunk.getAuraChunk(world, highestPos); int toTransfer = Math.min(25, highestChunk.getDrainSpot(highestPos).intValue()); - highestChunk.drainAura(highestPos, toTransfer); - auraChunk.storeAura(pos, toTransfer); + int stored = auraChunk.storeAura(pos, toTransfer); + highestChunk.drainAura(highestPos, stored); } @Override