From 173fdbfb2d8bc37ba78eb36c63540812a0dac9c0 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 14 Mar 2016 20:23:31 -0700 Subject: [PATCH] Make Blood Lights more visible when holding Sigil (#340) Spawns some extra particles to make it more noticeable --- .../WayofTime/bloodmagic/block/BlockBloodLight.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockBloodLight.java b/src/main/java/WayofTime/bloodmagic/block/BlockBloodLight.java index 14caf1e2..f59f8706 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockBloodLight.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockBloodLight.java @@ -3,9 +3,12 @@ package WayofTime.bloodmagic.block; import java.util.List; import java.util.Random; +import WayofTime.bloodmagic.registry.ModItems; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; @@ -67,9 +70,16 @@ public class BlockBloodLight extends Block @SideOnly(Side.CLIENT) public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { + EntityPlayerSP playerSP = Minecraft.getMinecraft().thePlayer; + if (rand.nextInt(3) != 0) { worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0); + if (playerSP.getHeldItem() != null && playerSP.getHeldItem().getItem() == ModItems.sigilBloodLight) { + worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0); + worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0); + worldIn.spawnParticle(EnumParticleTypes.REDSTONE, pos.getX() + 0.5D + rand.nextGaussian() / 8, pos.getY() + 0.5D, pos.getZ() + 0.5D + rand.nextGaussian() / 8, 0, 0, 0, 0); + } } }