mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 08:00:02 +03:00
33 lines
2.1 KiB
Diff
33 lines
2.1 KiB
Diff
--- ../src-base/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java
|
|
+++ ../src-work/minecraft/net/minecraft/enchantment/EnchantmentFrostWalker.java
|
|
@@ -1,5 +1,8 @@
|
|
package net.minecraft.enchantment;
|
|
|
|
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
|
|
+import org.bukkit.event.block.EntityBlockFormEvent;
|
|
+
|
|
import net.minecraft.block.BlockLiquid;
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraft.block.state.IBlockState;
|
|
@@ -62,8 +65,18 @@
|
|
|
|
if (iblockstate1.getMaterial() == Material.WATER && ((Integer)iblockstate1.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.canBlockBePlaced(Blocks.FROSTED_ICE, blockpos$mutableblockpos1, false, EnumFacing.DOWN, (Entity)null, (ItemStack)null))
|
|
{
|
|
- worldIn.setBlockState(blockpos$mutableblockpos1, Blocks.FROSTED_ICE.getDefaultState());
|
|
- worldIn.scheduleUpdate(blockpos$mutableblockpos1.toImmutable(), Blocks.FROSTED_ICE, MathHelper.getRandomIntegerInRange(living.getRNG(), 60, 120));
|
|
+ // CraftBukkit Start - Call EntityBlockFormEvent for Frost Walker
|
|
+ org.bukkit.block.BlockState blockState = worldIn.getWorld().getBlockAt(blockpos$mutableblockpos1.getX(), blockpos$mutableblockpos1.getY(), blockpos$mutableblockpos1.getZ()).getState();
|
|
+ blockState.setType(CraftMagicNumbers.getMaterial(Blocks.FROSTED_ICE));
|
|
+
|
|
+ EntityBlockFormEvent event = new EntityBlockFormEvent(living.getBukkitEntity(), blockState.getBlock(), blockState);
|
|
+ worldIn.getServer().getPluginManager().callEvent(event);
|
|
+
|
|
+ if (!event.isCancelled()) {
|
|
+ blockState.update(true);
|
|
+ worldIn.scheduleUpdate(blockpos$mutableblockpos1.toImmutable(), Blocks.FROSTED_ICE, MathHelper.getRandomIntegerInRange(living.getRNG(), 60, 120));
|
|
+ }
|
|
+ // CraftBukkit End
|
|
}
|
|
}
|
|
}
|