From 615fbe3f88220b3a93b9b359ba8758043815e96d Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 29 Jan 2020 21:19:00 +0100 Subject: [PATCH] made the projectile generator not waste additional aura --- .../naturesaura/blocks/BlockProjectileGenerator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java index d5615d55..b8c2f273 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockProjectileGenerator.java @@ -61,8 +61,10 @@ public class BlockProjectileGenerator extends BlockContainerImpl implements ITES if (!generator.canGenerateRightNow(35, amount)) return; - BlockPos spot = IAuraChunk.getLowestSpot(entity.world, pos, 35, pos); - IAuraChunk.getAuraChunk(entity.world, spot).storeAura(spot, amount); + while (amount > 0) { + BlockPos spot = IAuraChunk.getLowestSpot(entity.world, pos, 35, pos); + amount -= IAuraChunk.getAuraChunk(entity.world, spot).storeAura(spot, amount); + } PacketHandler.sendToAllAround(entity.world, pos, 32, new PacketParticles((float) entity.getPosX(), (float) entity.getPosY(), (float) entity.getPosZ(), PacketParticles.Type.PROJECTILE_GEN, pos.getX(), pos.getY(), pos.getZ()));