@Override public void onUpdate(PossessivePlayer possessivePlayer, EntityPlayer player) { EntitySnowman possessing = (EntitySnowman) possessivePlayer.getPossessing(); if (player.onGround) { EnchantmentFrostWalker.freezeNearby(player, player.worldObj, player.getPosition(), 2); for (int i = 0; i < 4; ++i) { int x = MathHelper.floor_double(player.posX + (i % 2 * 2 - 1) * 0.25F); int y = MathHelper.floor_double(player.posY); int z = MathHelper.floor_double(player.posZ + (i / 2 % 2 * 2 - 1) * 0.25F); BlockPos pos = new BlockPos(x, y, z); IBlockState state = player.worldObj.getBlockState(pos); if (state.getMaterial() == Material.AIR && Blocks.SNOW_LAYER.canPlaceBlockAt(player.worldObj, pos)) { player.worldObj.setBlockState(pos, Blocks.SNOW_LAYER.getDefaultState()); } } } }
protected void frostWalk(BlockPos pos) { int i = EnchantmentHelper.getMaxEnchantmentLevel(Enchantments.FROST_WALKER, this); if (i > 0) { EnchantmentFrostWalker.freezeNearby(this, this.world, pos, i); } }
protected void frostWalk(BlockPos pos) { int i = EnchantmentHelper.getMaxEnchantmentLevel(Enchantments.FROST_WALKER, this); if (i > 0) { EnchantmentFrostWalker.freezeNearby(this, this.worldObj, pos, i); } }
@Override public void tick(EntityLivingBase entityLiving) { EnchantmentFrostWalker.freezeNearby(entityLiving, entityLiving.world, entityLiving.getPosition(), 1); }