mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 01:39:52 +03:00
36 lines
1.8 KiB
Diff
36 lines
1.8 KiB
Diff
--- ../src-base/minecraft/net/minecraft/item/ItemFishingRod.java
|
|
+++ ../src-work/minecraft/net/minecraft/item/ItemFishingRod.java
|
|
@@ -16,6 +16,7 @@
|
|
import net.minecraft.world.World;
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
+import org.bukkit.event.player.PlayerFishEvent;
|
|
|
|
public class ItemFishingRod extends Item
|
|
{
|
|
@@ -74,7 +75,7 @@
|
|
}
|
|
else
|
|
{
|
|
- 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));
|
|
+ // 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)); // CraftBukkit - moved down
|
|
|
|
if (!worldIn.isRemote)
|
|
{
|
|
@@ -93,6 +94,15 @@
|
|
entityfishhook.setLuck(k);
|
|
}
|
|
|
|
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) playerIn.getBukkitEntity(), null, (org.bukkit.entity.Fish) entityfishhook.getBukkitEntity(), PlayerFishEvent.State.FISHING);
|
|
+ worldIn.getServer().getPluginManager().callEvent(playerFishEvent);
|
|
+
|
|
+ if (playerFishEvent.isCancelled()) {
|
|
+ playerIn.fishEntity = null;
|
|
+ return new ActionResult<>(EnumActionResult.PASS, itemstack);
|
|
+ }
|
|
+ worldIn.playSound(null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
|
+
|
|
worldIn.spawnEntity(entityfishhook);
|
|
}
|
|
|