mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-22 21:19:46 +00:00
Implemented the Wisp FX and added it to the mana pool.
This commit is contained in:
1 parent
8bed44adff
commit
ff72fe5230
4 files changed
+21
-7
No files matched your search
@@ -17,6 +17,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.api.LexiconEntry;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.fx.FXSparkle;
|
||||
import vazkii.botania.client.fx.FXWisp;
|
||||
import vazkii.botania.client.gui.GuiLexicon;
|
||||
import vazkii.botania.client.gui.GuiLexiconEntry;
|
||||
import vazkii.botania.client.gui.GuiLexiconIndex;
|
||||
@@ -73,4 +74,11 @@ public class ClientProxy extends CommonProxy {
|
||||
FXSparkle sparkle = new FXSparkle(world, x, y, z, size, r, g, b, m);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(sparkle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float gravity) {
|
||||
FXWisp wisp = new FXWisp(world, x, y, z, size, r, g, b);
|
||||
wisp.motionY = -gravity;
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(wisp);
|
||||
}
|
||||
}
|
||||
@@ -36,17 +36,15 @@ public class FXWisp extends EntityFX
|
||||
|
||||
}
|
||||
|
||||
public FXWisp(World world, double d, double d1, double d2, float f, float red, float green, float blue)
|
||||
public FXWisp(World world, double d, double d1, double d2, float size, float red, float green, float blue)
|
||||
{
|
||||
super(world, d, d1, d2, 0.0D, 0.0D, 0.0D);
|
||||
if(red == 0.0F) red = 1.0F;
|
||||
|
||||
particleRed = red;
|
||||
particleGreen = green;
|
||||
particleBlue = blue;
|
||||
particleGravity=0;
|
||||
motionX=motionY=motionZ=0;
|
||||
particleScale *= f;
|
||||
particleScale *= size;
|
||||
moteParticleScale = particleScale;
|
||||
particleMaxAge = (int)(36D / (Math.random() * 0.3D + 0.7D));
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@ public class TilePool extends TileSimpleInventory implements IManaPool {
|
||||
added = true;
|
||||
}
|
||||
if(worldObj.isRemote) {
|
||||
double particleChance = 1F - ((double) getCurrentMana() / (double) MAX_MANA);
|
||||
double particleChance = 1F - ((double) getCurrentMana() / (double) MAX_MANA) * 0.25;
|
||||
Color color = new Color(0x00C6FF);
|
||||
if(Math.random() > particleChance)
|
||||
Botania.proxy.sparkleFX(worldObj, xCoord + 0.3 + Math.random() * 0.5, yCoord + 0.6 + Math.random() * 0.25, zCoord + Math.random(), (float) color.getRed() / 255F, (float) color.getGreen() / 255F, (float) color.getBlue() / 255F, (float) Math.random(), 5);
|
||||
Botania.proxy.wispFX(worldObj, xCoord + 0.3 + Math.random() * 0.5, yCoord + 0.6 + Math.random() * 0.25, zCoord + Math.random(), (float) color.getRed() / 255F, (float) color.getGreen() / 255F, (float) color.getBlue() / 255F, (float) Math.random() / 3F, (float) -Math.random() / 25F);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class TilePool extends TileSimpleInventory implements IManaPool {
|
||||
if(!worldObj.isRemote) {
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
writeCustomNBT(nbttagcompound);
|
||||
nbttagcompound.setInteger(TAG_KNOWN_MANA, mana);
|
||||
nbttagcompound.setInteger(TAG_KNOWN_MANA, getCurrentMana());
|
||||
PacketDispatcher.sendPacketToPlayer(new Packet132TileEntityData(xCoord, yCoord, zCoord, -999, nbttagcompound), (Player) player);
|
||||
}
|
||||
worldObj.playSoundAtEntity(player, "random.orb", 1F, 1F);
|
||||
|
||||
@@ -65,5 +65,13 @@ public class CommonProxy {
|
||||
public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size) {
|
||||
wispFX(world, x, y, z, r, g, b, size, 0F);
|
||||
}
|
||||
|
||||
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float gravity) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user