diff --git a/MODSRC/vazkii/botania/api/mana/IManaCollector.java b/MODSRC/vazkii/botania/api/mana/IManaCollector.java index 7f154df63..e0164f0cc 100644 --- a/MODSRC/vazkii/botania/api/mana/IManaCollector.java +++ b/MODSRC/vazkii/botania/api/mana/IManaCollector.java @@ -11,6 +11,8 @@ */ package vazkii.botania.api.mana; +import vazkii.botania.api.internal.IManaBurst; + /** * Any TileEntity that implements this is considered a mana collector, by * which nearby generating flowers will pump mana into it.

@@ -25,5 +27,12 @@ public interface IManaCollector extends IManaReceiver { * Called every tick on the client case the player is holding a Wand of the Forest. */ public void onClientDisplayTick(); + + /** + * Get the multiplier of mana to input into the block, 1.0 is the original amount of mana + * in the burst. 0.9, for example, is 90%, so 10% of the mana in the burst will get + * dissipated. + */ + public float getManaYieldMultiplier(IManaBurst burst); } diff --git a/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java b/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java index 8d66306dc..f6b00aee9 100644 --- a/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java +++ b/MODSRC/vazkii/botania/common/block/tile/TileSpreader.java @@ -29,6 +29,7 @@ import net.minecraftforge.common.ForgeDirection; import org.lwjgl.opengl.GL11; +import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.mana.BurstProperties; import vazkii.botania.api.mana.ILens; import vazkii.botania.api.mana.IManaCollector; @@ -324,6 +325,11 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector burst.getCollidedTile(false); } } + + @Override + public float getManaYieldMultiplier(IManaBurst burst) { + return burst.getMana() < 16 ? 0F : 0.95F; + } @Override public int getSizeInventory() { diff --git a/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java b/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java index 6d6ad1929..9707ce697 100644 --- a/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java +++ b/MODSRC/vazkii/botania/common/entity/EntityManaBurst.java @@ -31,6 +31,7 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.mana.ILens; +import vazkii.botania.api.mana.IManaCollector; import vazkii.botania.api.mana.IManaReceiver; import vazkii.botania.common.Botania; import vazkii.botania.common.block.tile.TileSpreader; @@ -319,7 +320,11 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst { if(tile == null || tile.xCoord != coords.posX || tile.yCoord != coords.posY || tile.zCoord != coords.posZ) { if(!fake && !noParticles && !worldObj.isRemote && tile != null && tile instanceof IManaReceiver && ((IManaReceiver) tile).canRecieveManaFromBursts()) { - ((IManaReceiver) tile).recieveMana(getMana()); + int mana = getMana(); + if(tile instanceof IManaCollector) + mana *= ((IManaCollector) tile).getManaYieldMultiplier(this); + + ((IManaReceiver) tile).recieveMana(mana); PacketDispatcher.sendPacketToAllInDimension(tile.getDescriptionPacket(), worldObj.provider.dimensionId); }