Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onUsingTick(ItemStack stack, EntityPlayer player, int count)
- {
- int duration = this.getMaxItemUseDuration(stack) - count;
- if (player.inventory.hasItem(TFItems.energonCrystalPiece) || player.capabilities.isCreativeMode)
- {
- if (duration > 1 && duration < 80)
- {
- Random rand = new Random();
- double cos = Math.cos(player.rotationYaw * Math.PI / 180.0f);
- double sin = Math.sin(player.rotationYaw * Math.PI / 180.0f);
- double motionX = -sin * 0.5;
- double motionZ = cos * 0.5;
- for (int i = 0; i < 20; i++)
- {
- float randFloatX = rand.nextFloat() / 4;
- if(rand.nextInt(2) == 0)
- {
- randFloatX = -randFloatX;
- }
- float randFloatY = rand.nextFloat() / 4;
- if(rand.nextInt(2) == 0)
- {
- randFloatY = -randFloatY;
- }
- float randFloatZ = rand.nextFloat() / 4;
- if(rand.nextInt(2) == 0)
- {
- randFloatZ = -randFloatZ;
- }
- player.worldObj.spawnParticle("flame", (motionX * 2) + player.posX + randFloatX, player.posY + randFloatY, (motionZ * 2) + player.posZ + randFloatZ, motionX + rand.nextFloat() / 4, randFloatY, motionZ + randFloatZ / 4);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement