Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onEntityWalk(World worldIn, BlockPos pos, Entity entityIn)
- {
- if (!entityIn.isImmuneToFire() && entityIn instanceof EntityLivingBase && !EnchantmentHelper.hasFrostWalkerEnchantment((EntityLivingBase)entityIn))
- {
- entityIn.attackEntityFrom(DamageSource.HOT_FLOOR, 1.0F);
- }
- super.onEntityWalk(worldIn, pos, entityIn);
- }
- public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
- {
- BlockPos blockpos = pos.up();
- IBlockState iblockstate = worldIn.getBlockState(blockpos);
- if (iblockstate.getBlock() == Blocks.WATER || iblockstate.getBlock() == Blocks.FLOWING_WATER)
- {
- worldIn.setBlockToAir(blockpos);
- worldIn.playSound((EntityPlayer)null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F);
- if (worldIn instanceof WorldServer)
- {
- ((WorldServer)worldIn).spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.25D, (double)blockpos.getZ() + 0.5D, 8, 0.5D, 0.25D, 0.5D, 0.0D);
- }
- }
- }
- public boolean canEntitySpawn(IBlockState state, Entity entityIn)
- {
- return entityIn.isImmuneToFire();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement