mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-18 11:19:24 +00:00
Particle stuff
This commit is contained in:
1 parent
9feaf8b24c
commit
22d9f9155f
2 files changed
+3
-26
No files matched your search
@@ -11,11 +11,8 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
|
||||
public class ItemSalis extends Item
|
||||
{
|
||||
@@ -72,7 +69,6 @@ public class ItemSalis extends Item
|
||||
world.getWorldInfo().setRainTime(world.isRaining() ? 24000 : 0);
|
||||
world.getWorldInfo().setRaining(!world.isRaining());
|
||||
player.playSound("thaumcraft:wind", 0.3F, 1.0F + world.rand.nextFloat() * 0.5F);
|
||||
throwParticles(world, player, 7);
|
||||
player.inventory.decrStackSize(player.inventory.currentItem, 1);
|
||||
return stack;
|
||||
}
|
||||
@@ -81,29 +77,10 @@ public class ItemSalis extends Item
|
||||
{
|
||||
world.setWorldTime(world.isDaytime() ? 14000 : 24000);
|
||||
player.playSound("thaumcraft:wind", 0.3F, 1.0F + world.rand.nextFloat() * 0.5F);
|
||||
throwParticles(world, player, 6);
|
||||
player.inventory.decrStackSize(player.inventory.currentItem, 1);
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void throwParticles (World world, EntityPlayer player, int colour)
|
||||
{
|
||||
for (int a = 0; a < 15; a++)
|
||||
{
|
||||
FXSparkle fx = new FXSparkle(world, player.posX + (world.rand.nextDouble() - world.rand.nextDouble()) * 0.2D,
|
||||
player.boundingBox.minY + 1.25D + (world.rand.nextDouble() - world.rand.nextDouble()) * 0.2D,
|
||||
player.posZ + (world.rand.nextDouble() - world.rand.nextDouble()) * 0.2D, 1.75F, colour,
|
||||
3 + world.rand.nextInt(3));
|
||||
Vec3 look = player.getLookVec();
|
||||
fx.motionX += (look.xCoord * 0.5D) + (world.rand.nextGaussian() * 0.05D);
|
||||
fx.motionY += (look.yCoord * 0.5D) + (world.rand.nextGaussian() * 0.05D);
|
||||
fx.motionZ += (look.zCoord * 0.5D) + (world.rand.nextGaussian() * 0.05D);
|
||||
fx.setGravity(0.5F);
|
||||
ParticleEngine.instance.addEffect(world, fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,9 +181,9 @@ public class ItemVoidwalkerBoots extends ItemArmor
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void particles (World world, EntityPlayer player)
|
||||
{
|
||||
FXWispEG fx = new FXWispEG(world, (double) (player.posX + ( (Math.random() - Math.random()) * 0.5F)),
|
||||
(double) (player.boundingBox.minY + .05F + ( (Math.random() - Math.random()) * 0.1F)),
|
||||
(double) (player.posZ + ( (Math.random() - Math.random()) * 0.5F)), player);
|
||||
FXWispEG fx = new FXWispEG(world, player.posX + (Math.random() - Math.random()) * 0.5D,
|
||||
player.boundingBox.minY + 0.05D + (Math.random() - Math.random()) * 0.1D,
|
||||
player.posZ + (Math.random() - Math.random()) * 0.5D, player);
|
||||
ParticleEngine.instance.addEffect(world, fx);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user