Files
CatServer/patches/net/minecraft/enchantment/EnchantmentFrostWalker.java.patch
2019-02-24 22:29:41 +08:00

31 lines
2.4 KiB
Diff

--- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java
+++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java
@@ -15,7 +15,7 @@
public class EnchantmentFrostWalker extends Enchantment
{
- public EnchantmentFrostWalker(Enchantment.Rarity rarityIn, EntityEquipmentSlot... slots)
+ public EnchantmentFrostWalker(Rarity rarityIn, EntityEquipmentSlot... slots)
{
super(rarityIn, EnumEnchantmentType.ARMOR_FEET, slots);
this.setName("frostWalker");
@@ -59,10 +59,15 @@
{
IBlockState iblockstate1 = worldIn.getBlockState(blockpos$mutableblockpos1);
- if (iblockstate1.getMaterial() == Material.WATER && ((Integer)iblockstate1.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.mayPlace(Blocks.FROSTED_ICE, blockpos$mutableblockpos1, false, EnumFacing.DOWN, (Entity)null))
+ if (iblockstate1.getMaterial() == Material.WATER && (iblockstate1.getBlock() == Blocks.WATER || iblockstate1.getBlock() == Blocks.FLOWING_WATER) && ((Integer)iblockstate1.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.mayPlace(Blocks.FROSTED_ICE, blockpos$mutableblockpos1, false, EnumFacing.DOWN, (Entity)null))
{
- worldIn.setBlockState(blockpos$mutableblockpos1, Blocks.FROSTED_ICE.getDefaultState());
- worldIn.scheduleUpdate(blockpos$mutableblockpos1.toImmutable(), Blocks.FROSTED_ICE, MathHelper.getInt(living.getRNG(), 60, 120));
+ // CraftBukkit Start - Call EntityBlockFormEvent for Frost Walker
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(worldIn, blockpos$mutableblockpos1, Blocks.FROSTED_ICE.getDefaultState(), living)) {
+ worldIn.scheduleUpdate(blockpos$mutableblockpos1.toImmutable(), Blocks.FROSTED_ICE, MathHelper.getInt(living.getRNG(), 60, 120));
+ }
+ // CraftBukkit End
+ // worldIn.setBlockState(blockpos$mutableblockpos1, Blocks.FROSTED_ICE.getDefaultState());
+ // worldIn.scheduleUpdate(blockpos$mutableblockpos1.toImmutable(), Blocks.FROSTED_ICE, MathHelper.getInt(living.getRNG(), 60, 120));
}
}
}