IClientManaHandler and some Mana Void polish.

This commit is contained in:
Vasco Lavos committed 2014-07-02 17:34:49 +01:00
1 parent 48165da3f2
commit d61ba4b85f
3 files changed
+29 -4

No files matched your search

@@ -0,0 +1,21 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [Jul 2, 2014, 5:26:02 PM (GMT)]
*/
package vazkii.botania.api.mana;
/**
* A TileEntity that implements this will get it's recieveMana call
* called on both client and server. If this is not implemented
* the call will only occur on the server.
*/
public interface IClientManaHandler extends IManaReceiver {
}
@@ -11,10 +11,11 @@
*/
package vazkii.botania.common.block.tile.mana;
import vazkii.botania.api.mana.IManaReceiver;
import vazkii.botania.api.mana.IClientManaHandler;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.tile.TileMod;
public class TileManaVoid extends TileMod implements IManaReceiver {
public class TileManaVoid extends TileMod implements IClientManaHandler {
@Override
public boolean canUpdate() {
@@ -33,7 +34,9 @@ public class TileManaVoid extends TileMod implements IManaReceiver {
@Override
public void recieveMana(int mana) {
// All your mana is belong to the void
if(mana > 0)
for(int i = 0; i < 10; i++)
Botania.proxy.sparkleFX(getWorldObj(), xCoord + Math.random(), yCoord + Math.random(), zCoord + Math.random(), 0.2F, 0.2F, 0.2F, 0.7F + 0.5F * (float) Math.random(), 5);
}
@Override
@@ -33,6 +33,7 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import vazkii.botania.api.internal.IManaBurst;
import vazkii.botania.api.mana.IClientManaHandler;
import vazkii.botania.api.mana.ILensEffect;
import vazkii.botania.api.mana.IManaCollector;
import vazkii.botania.api.mana.IManaCollisionGhost;
@@ -505,7 +506,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
collidedTile = tile;
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()) {
if(!fake && !noParticles && (!worldObj.isRemote || tile instanceof IClientManaHandler) && tile != null && tile instanceof IManaReceiver && ((IManaReceiver) tile).canRecieveManaFromBursts()) {
int mana = getMana();
if(tile instanceof IManaCollector)
mana *= ((IManaCollector) tile).getManaYieldMultiplier(this);