From 546a0fce41df1e386c5d55a22700a07174ca9a70 Mon Sep 17 00:00:00 2001 From: LexManos Date: Mon, 20 Feb 2012 23:42:26 -0800 Subject: [PATCH] Exposed getters for NetServerHandler.playerEntity and NetworkManager.netHandler --- .../net/minecraft/src/NetworkManager.java.patch | 15 +++++++++++++++ .../net/minecraft/src/NetServerHandler.java.patch | 7 ++++++- .../net/minecraft/src/NetworkManager.java.patch | 15 +++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/forge/patches/minecraft/net/minecraft/src/NetworkManager.java.patch b/forge/patches/minecraft/net/minecraft/src/NetworkManager.java.patch index 11c6db027..f163583a7 100644 --- a/forge/patches/minecraft/net/minecraft/src/NetworkManager.java.patch +++ b/forge/patches/minecraft/net/minecraft/src/NetworkManager.java.patch @@ -17,3 +17,18 @@ } public void processReadPackets() +@@ -293,4 +296,14 @@ + { + return networkmanager.writeThread; + } ++ ++ /** ++ * Retrieves the current associated network handler. ++ * Added so modders dont have to use reflection. ++ * @return The current registered Network Handler ++ */ ++ public NetHandler getNetHandler() ++ { ++ return netHandler; ++ } + } diff --git a/forge/patches/minecraft_server/net/minecraft/src/NetServerHandler.java.patch b/forge/patches/minecraft_server/net/minecraft/src/NetServerHandler.java.patch index 89ae125d2..51e67a58d 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/NetServerHandler.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/NetServerHandler.java.patch @@ -34,11 +34,16 @@ { playerEntity.itemInWorldManager.activeBlockOrUseItem(playerEntity, worldserver, itemstack, i, j, k, l); } -@@ -764,4 +770,44 @@ +@@ -764,4 +770,49 @@ { return true; } + ++ public EntityPlayerMP getPlayerEntity() ++ { ++ return playerEntity; ++ } ++ + @Override + public void handleCustomPayload(Packet250CustomPayload pkt) + { diff --git a/forge/patches/minecraft_server/net/minecraft/src/NetworkManager.java.patch b/forge/patches/minecraft_server/net/minecraft/src/NetworkManager.java.patch index 6ac292da1..2ce6f1bfc 100644 --- a/forge/patches/minecraft_server/net/minecraft/src/NetworkManager.java.patch +++ b/forge/patches/minecraft_server/net/minecraft/src/NetworkManager.java.patch @@ -19,3 +19,18 @@ } public void processReadPackets() +@@ -313,4 +318,14 @@ + { + return networkmanager.writeThread; + } ++ ++ /** ++ * Retrieves the current associated network handler. ++ * Added so modders dont have to use reflection. ++ * @return The current registered Network Handler ++ */ ++ public NetHandler getNetHandler() ++ { ++ return netHandler; ++ } + }