I am trying to make a mod with rifts, which are vaguely like Thaumcraft's aura nodes. One block which will interact with the rifts is a destabilizer, which will allow multiblock-like crafting. This block should draw a sphere of particles above itself when powered, but when it is unpowered, just a tiny ball at the center, and drop some items, depending on the area around it. Currently, I am testing this with the fire particle when unpowered. Any code that is commented out I have tried both with and without in every combination. No particles are displayed.
package zane49er.VolkiharEchoes.features;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class Destabilizer extends Block {
public Destabilizer(String registryName) {
super(Material.PISTON);
setRegistryName(registryName);
setUnlocalizedName(getRegistryName().toString());
setHardness(3.0f);
}
//@Override
@SideOnly(Side.CLIENT)
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
//if(!worldIn.isBlockPowered(pos)){
worldIn.spawnParticle(EnumParticleTypes.FLAME, (double)pos.getX(), (double)pos.getY()+5, (double)pos.getZ(), 0, 0, 0, new int[0]);
//}
}
//@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand) {
//if(!worldIn.isBlockPowered(pos)){
worldIn.spawnParticle(EnumParticleTypes.FLAME, (double)pos.getX(), (double)pos.getY()+5, (double)pos.getZ(), 0, 0, 0, new int[0]);
//}
}
}
It seems that the randomDisplayTick is never being called.
Also, I want to make the (fullbright) rifts change color based on their contents, but that's a future problem...
Finally, creative tabs are not being created, and I don't understand why.