diff options
author | Nassim Jahnke <[email protected]> | 2023-03-14 18:11:24 +0100 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2023-03-14 18:11:24 +0100 |
commit | 2ed604cf725820344878b0d49117bd5ef31463bc (patch) | |
tree | 701daae297f65de2ae3b2cc233047e7903adcb51 /patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch | |
parent | 155aa36d89b260ef5841615899299756b5983c0a (diff) | |
download | Paper-2ed604cf725820344878b0d49117bd5ef31463bc.tar.gz Paper-2ed604cf725820344878b0d49117bd5ef31463bc.zip |
Start working on 1.19.4
Diffstat (limited to 'patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch')
-rw-r--r-- | patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch b/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch deleted file mode 100644 index 251501fad1..0000000000 --- a/patches/server/0083-Add-PlayerUseUnknownEntityEvent.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jedediah Smith <[email protected]> -Date: Sat, 2 Apr 2016 05:09:16 -0400 -Subject: [PATCH] Add PlayerUseUnknownEntityEvent - -== AT == -public net.minecraft.network.protocol.game.ServerboundInteractPacket$ActionType - -diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundInteractPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundInteractPacket.java -index a5d57cc862036012d83b090bb1b3ccf4115a88b3..21068f766b75c414d5818073b7dca083d8ff4409 100644 ---- a/src/main/java/net/minecraft/network/protocol/game/ServerboundInteractPacket.java -+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundInteractPacket.java -@@ -10,8 +10,8 @@ import net.minecraft.world.entity.Entity; - import net.minecraft.world.phys.Vec3; - - public class ServerboundInteractPacket implements Packet<ServerGamePacketListener> { -- private final int entityId; -- private final ServerboundInteractPacket.Action action; -+ private final int entityId; public final int getEntityId() { return this.entityId; } // Paper - add accessor -+ private final ServerboundInteractPacket.Action action; public final ServerboundInteractPacket.ActionType getActionType() { return this.action.getType(); } // Paper - add accessor - private final boolean usingSecondaryAction; - static final ServerboundInteractPacket.Action ATTACK_ACTION = new ServerboundInteractPacket.Action() { - @Override -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index f49a8a0f56bc3dd9e8a33cfefefed414e56153fd..8bed76ec7692a75f12e724a36f3dd9050760b7ea 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2525,8 +2525,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - }); - } - } -+ // Paper start - fire event -+ else { -+ packet.dispatch(new net.minecraft.network.protocol.game.ServerboundInteractPacket.Handler() { -+ @Override -+ public void onInteraction(net.minecraft.world.InteractionHand hand) { -+ ServerGamePacketListenerImpl.this.callPlayerUseUnknownEntityEvent(packet, hand); -+ } -+ -+ @Override -+ public void onInteraction(net.minecraft.world.InteractionHand hand, net.minecraft.world.phys.Vec3 pos) { -+ ServerGamePacketListenerImpl.this.callPlayerUseUnknownEntityEvent(packet, hand); -+ } -+ -+ @Override -+ public void onAttack() { -+ ServerGamePacketListenerImpl.this.callPlayerUseUnknownEntityEvent(packet, net.minecraft.world.InteractionHand.MAIN_HAND); -+ } -+ }); -+ } -+ -+ } - -+ private void callPlayerUseUnknownEntityEvent(ServerboundInteractPacket packet, InteractionHand hand) { -+ this.cserver.getPluginManager().callEvent(new com.destroystokyo.paper.event.player.PlayerUseUnknownEntityEvent( -+ this.getCraftPlayer(), -+ packet.getEntityId(), -+ packet.getActionType() == ServerboundInteractPacket.ActionType.ATTACK, -+ hand == InteractionHand.MAIN_HAND ? EquipmentSlot.HAND : EquipmentSlot.OFF_HAND -+ )); - } -+ // Paper end - - @Override - public void handleClientCommand(ServerboundClientCommandPacket packet) { |