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 0a5ff45f5e9f71449cf25f28fa01f93dac245c3b 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 8cdeb6d7f..b7bc2dc30 100644
|
|
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
@@ -2238,6 +2238,13 @@ public class PlayerConnection implements ServerPlayerConnection, PacketListenerP
|
|
if (this.player.isImmobile()) return; // CraftBukkit
|
|
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.25.1
|
|
|