mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 08:00:02 +03:00
37 lines
1.5 KiB
Diff
37 lines
1.5 KiB
Diff
--- ../src-base/minecraft/net/minecraft/item/ItemFishingRod.java
|
|
+++ ../src-work/minecraft/net/minecraft/item/ItemFishingRod.java
|
|
@@ -1,6 +1,9 @@
|
|
package net.minecraft.item;
|
|
|
|
import javax.annotation.Nullable;
|
|
+
|
|
+import org.bukkit.event.player.PlayerFishEvent;
|
|
+
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
@@ -55,11 +58,22 @@
|
|
}
|
|
else
|
|
{
|
|
+ // CraftBukkit start
|
|
+ EntityFishHook hook = new EntityFishHook(worldIn, playerIn);
|
|
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) playerIn.getBukkitEntity(), null, (org.bukkit.entity.Fish) hook.getBukkitEntity(), PlayerFishEvent.State.FISHING);
|
|
+ worldIn.getServer().getPluginManager().callEvent(playerFishEvent);
|
|
+
|
|
+ if (playerFishEvent.isCancelled()) {
|
|
+ playerIn.fishEntity = null;
|
|
+ return new ActionResult(EnumActionResult.PASS, itemStackIn);
|
|
+ }
|
|
+ // CraftBukkit end
|
|
+
|
|
worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
|
|
|
if (!worldIn.isRemote)
|
|
{
|
|
- worldIn.spawnEntityInWorld(new EntityFishHook(worldIn, playerIn));
|
|
+ worldIn.spawnEntityInWorld(hook); // CraftBukkit - moved creation up
|
|
}
|
|
|
|
playerIn.swingArm(hand);
|