From dd126df00c03815b11feb7d5ff473ad6bb61f456 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 11 Nov 2018 17:09:26 +0100 Subject: [PATCH] made golden leaves have sparkle particles when they're done Closes #2 --- .../naturesaura/blocks/BlockGoldenLeaves.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldenLeaves.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldenLeaves.java index 5fd62529..3108f0bd 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldenLeaves.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockGoldenLeaves.java @@ -1,6 +1,7 @@ package de.ellpeck.naturesaura.blocks; import de.ellpeck.naturesaura.Helper; +import de.ellpeck.naturesaura.api.NaturesAuraAPI; import de.ellpeck.naturesaura.items.ModItems; import de.ellpeck.naturesaura.reg.*; import net.minecraft.block.BlockLeaves; @@ -62,6 +63,18 @@ public class BlockGoldenLeaves extends BlockLeaves implements } + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) { + if (stateIn.getValue(STAGE) == HIGHEST_STAGE && rand.nextFloat() >= 0.75F) + NaturesAuraAPI.instance().spawnMagicParticle(worldIn, + pos.getX() + rand.nextFloat(), + pos.getY() + rand.nextFloat(), + pos.getZ() + rand.nextFloat(), + 0F, 0F, 0F, + 0xF2FF00, 0.5F + rand.nextFloat(), 50, 0F, false, true); + } + @Override public List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) { NonNullList drops = NonNullList.create();