2019-06-14 04:27:40 +02:00
|
|
|
From d24c31b6a1b4263c4d50cf971287d737211ab17c Mon Sep 17 00:00:00 2001
|
2016-04-03 03:10:38 +02:00
|
|
|
From: Jedediah Smith <jedediah@silencegreys.com>
|
|
|
|
Date: Sat, 2 Apr 2016 05:08:36 -0400
|
|
|
|
Subject: [PATCH] Add PlayerUseUnknownEntityEvent
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java
|
|
|
|
new file mode 100644
|
2019-06-06 17:36:57 +02:00
|
|
|
index 000000000..09cfdf48e
|
2016-04-03 03:10:38 +02:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java
|
2019-03-20 01:28:15 +01:00
|
|
|
@@ -0,0 +1,46 @@
|
2016-04-03 03:10:38 +02:00
|
|
|
+package com.destroystokyo.paper.event.player;
|
|
|
|
+
|
|
|
|
+import org.bukkit.entity.Player;
|
|
|
|
+import org.bukkit.event.HandlerList;
|
|
|
|
+import org.bukkit.event.player.PlayerEvent;
|
|
|
|
+import org.bukkit.inventory.EquipmentSlot;
|
2019-03-20 01:28:15 +01:00
|
|
|
+import org.jetbrains.annotations.NotNull;
|
2016-04-03 03:10:38 +02:00
|
|
|
+
|
|
|
|
+public class PlayerUseUnknownEntityEvent extends PlayerEvent {
|
|
|
|
+
|
|
|
|
+ private static final HandlerList handlers = new HandlerList();
|
|
|
|
+ private final int entityId;
|
|
|
|
+ private final boolean attack;
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull private final EquipmentSlot hand;
|
2016-04-03 03:10:38 +02:00
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public PlayerUseUnknownEntityEvent(@NotNull Player who, int entityId, boolean attack, @NotNull EquipmentSlot hand) {
|
2016-04-03 03:10:38 +02:00
|
|
|
+ super(who);
|
|
|
|
+ this.entityId = entityId;
|
|
|
|
+ this.attack = attack;
|
|
|
|
+ this.hand = hand;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public int getEntityId() {
|
|
|
|
+ return this.entityId;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isAttack() {
|
|
|
|
+ return this.attack;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
2016-04-03 03:10:38 +02:00
|
|
|
+ public EquipmentSlot getHand() {
|
|
|
|
+ return this.hand;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
2016-04-03 03:10:38 +02:00
|
|
|
+ @Override
|
|
|
|
+ public HandlerList getHandlers() {
|
|
|
|
+ return handlers;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
2016-04-03 03:10:38 +02:00
|
|
|
+ public static HandlerList getHandlerList() {
|
|
|
|
+ return handlers;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
--
|
2019-03-20 01:28:15 +01:00
|
|
|
2.21.0
|
2016-04-03 03:10:38 +02:00
|
|
|
|