mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
27 lines
1.1 KiB
Diff
27 lines
1.1 KiB
Diff
From 5b5853427a302ae7143cac5f1c043f1b1a74776c 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 49fb1c8fa..e0c7c5587 100644
|
|
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
@@ -2336,6 +2336,13 @@ public class PlayerConnection implements ServerPlayerConnection, TickablePacketL
|
|
if (this.player.isImmobile()) return; // CraftBukkit
|
|
final WorldServer worldserver = this.player.getLevel();
|
|
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.40.0
|
|
|