2023-06-12 19:41:07 +10:00
|
|
|
From 0801f5ecfb01aed2daf98970f185f6922b64ea66 Mon Sep 17 00:00:00 2001
|
2014-04-12 14:18:37 +10:00
|
|
|
From: md_5 <md_5@live.com.au>
|
|
|
|
Date: Fri, 28 Jun 2013 19:52:54 +1000
|
|
|
|
Subject: [PATCH] Disallow Interaction With Self
|
|
|
|
|
|
|
|
|
2021-03-16 09:00:00 +11:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
2023-06-12 19:41:07 +10:00
|
|
|
index 6840588be..c81033f4c 100644
|
2021-03-16 09:00:00 +11:00
|
|
|
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
2023-06-12 19:41:07 +10:00
|
|
|
@@ -2346,6 +2346,13 @@ public class PlayerConnection implements ServerPlayerConnection, TickablePacketL
|
2021-11-22 09:00:00 +11:00
|
|
|
if (this.player.isImmobile()) return; // CraftBukkit
|
2023-06-08 01:30:00 +10:00
|
|
|
final WorldServer worldserver = this.player.serverLevel();
|
2021-11-22 09:00:00 +11:00
|
|
|
final Entity entity = packetplayinuseentity.getTarget(worldserver);
|
2014-04-12 14:18:37 +10:00
|
|
|
+ // Spigot Start
|
2015-05-09 21:23:26 +01:00
|
|
|
+ if ( entity == player && !player.isSpectator() )
|
2014-04-12 14:18:37 +10:00
|
|
|
+ {
|
|
|
|
+ disconnect( "Cannot interact with self!" );
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Spigot End
|
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
this.player.resetLastActionTime();
|
|
|
|
this.player.setShiftKeyDown(packetplayinuseentity.isUsingSecondaryAction());
|
2014-04-12 14:18:37 +10:00
|
|
|
--
|
2023-05-11 07:10:33 +10:00
|
|
|
2.40.1
|
2014-04-12 14:18:37 +10:00
|
|
|
|