mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-04-13 09:32:09 +00:00
27 lines
1.1 KiB
Diff
27 lines
1.1 KiB
Diff
From 5c8e3bccc9d00b4c40fefa9f24baf9c8a736e2ca Mon Sep 17 00:00:00 2001
|
|
From: md_5 <md_5@live.com.au>
|
|
Date: Fri, 28 Jun 2013 19:52:54 +1000
|
|
Subject: [PATCH] Disallow Interaction With Self
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
index 403ce225d7..23a15db7e1 100644
|
|
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
@@ -2221,6 +2221,13 @@ public class PlayerConnection extends ServerCommonPacketListenerImpl implements
|
|
if (this.player.isImmobile()) return; // CraftBukkit
|
|
final WorldServer worldserver = this.player.serverLevel();
|
|
final Entity entity = packetplayinuseentity.getTarget(worldserver);
|
|
+ // Spigot Start
|
|
+ if ( entity == player && !player.isSpectator() )
|
|
+ {
|
|
+ disconnect( "Cannot interact with self!" );
|
|
+ return;
|
|
+ }
|
|
+ // Spigot End
|
|
|
|
this.player.resetLastActionTime();
|
|
this.player.setShiftKeyDown(packetplayinuseentity.isUsingSecondaryAction());
|
|
--
|
|
2.42.0
|
|
|