Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class NeutralizationBlock extends Block
- {
- public NeutralizationBlock()
- {
- super(Material.IRON);
- this.setUnlocalizedName("neutralBlock");
- this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
- this.setResistance(5.0F);
- this.setHardness(5.0F);
- this.setLightLevel(0.5F);
- this.setHarvestLevel("pickaxe", 1);
- }
- /**
- * This method will check whether or not the block has been collied with vertically. If so, it will remove all of
- * the potion effects the player has.
- */
- @Override
- public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entity)
- {
- if (!(entity instanceof EntityPlayer))
- {
- return;
- }
- EntityPlayer player = (EntityPlayer) entity;
- if (!player.isCollidedVertically)
- {
- return;
- }
- else
- {
- player.clearActivePotions();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement