mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
fix a patch catboy asked me to
This commit is contained in:
parent
9ce19f0321
commit
96f62ca759
41
Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch
Normal file
41
Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jedediah Smith <jedediah@silencegreys.com>
|
||||
Date: Sat, 2 Apr 2016 05:09:16 -0400
|
||||
Subject: [PATCH] Add PlayerUseUnknownEntityEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
|
||||
index 77440ac81..8711462e1 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
|
||||
@@ -0,0 +0,0 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class PacketPlayInUseEntity implements Packet<PacketListenerPlayIn> {
|
||||
|
||||
- private int a;
|
||||
+ private int a; public int getEntityId() { return this.a; } // Paper - add accessor
|
||||
private PacketPlayInUseEntity.EnumEntityUseAction action;
|
||||
private Vec3D c;
|
||||
private EnumHand d;
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 2cc277e4f..b1f483990 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
}
|
||||
}
|
||||
}
|
||||
+ // Paper start - fire event
|
||||
+ else {
|
||||
+ this.server.getPluginManager().callEvent(new com.destroystokyo.paper.event.player.PlayerUseUnknownEntityEvent(
|
||||
+ this.getPlayer(),
|
||||
+ packetplayinuseentity.getEntityId(),
|
||||
+ packetplayinuseentity.b() == PacketPlayInUseEntity.EnumEntityUseAction.ATTACK,
|
||||
+ packetplayinuseentity.c() == EnumHand.MAIN_HAND ? EquipmentSlot.HAND : EquipmentSlot.OFF_HAND
|
||||
+ ));
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
}
|
||||
|
||||
--
|
Loading…
Reference in New Issue
Block a user