#1107: Add getHand() to all relevant events
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
--- a/net/minecraft/world/item/ItemFishingRod.java
|
||||
+++ b/net/minecraft/world/item/ItemFishingRod.java
|
||||
@@ -11,6 +11,8 @@
|
||||
@@ -11,6 +11,11 @@
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
|
||||
+import org.bukkit.event.player.PlayerFishEvent; // CraftBukkit
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.player.PlayerFishEvent;
|
||||
+import org.bukkit.craftbukkit.CraftEquipmentSlot;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class ItemFishingRod extends Item implements ItemVanishable {
|
||||
|
||||
public ItemFishingRod(Item.Info item_info) {
|
||||
@@ -33,12 +35,23 @@
|
||||
@@ -33,12 +38,23 @@
|
||||
world.playSound((EntityHuman) null, entityhuman.getX(), entityhuman.getY(), entityhuman.getZ(), SoundEffects.FISHING_BOBBER_RETRIEVE, SoundCategory.NEUTRAL, 1.0F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F));
|
||||
entityhuman.gameEvent(GameEvent.ITEM_INTERACT_FINISH);
|
||||
} else {
|
||||
@@ -22,7 +25,7 @@
|
||||
- world.addFreshEntity(new EntityFishingHook(entityhuman, world, j, i));
|
||||
+ // CraftBukkit start
|
||||
+ EntityFishingHook entityfishinghook = new EntityFishingHook(entityhuman, world, j, i);
|
||||
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), null, (org.bukkit.entity.FishHook) entityfishinghook.getBukkitEntity(), PlayerFishEvent.State.FISHING);
|
||||
+ PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), null, (org.bukkit.entity.FishHook) entityfishinghook.getBukkitEntity(), CraftEquipmentSlot.getHand(enumhand), PlayerFishEvent.State.FISHING);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(playerFishEvent);
|
||||
+
|
||||
+ if (playerFishEvent.isCancelled()) {
|
||||
|
||||
Reference in New Issue
Block a user