Mana Spreaders now have a 0.95 yield value.

This commit is contained in:
Vasco Lavos committed 2014-03-05 00:03:08 +00:00
1 parent 69a4bfe8e7
commit 73568fa2af
3 files changed
+21 -1

No files matched your search

@@ -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.<br><br>
@@ -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);
}
@@ -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() {
@@ -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);
}