mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Prevent teleporting dead entities (#2803)
This commit is contained in:
parent
8087b810b4
commit
9079e78a20
2 changed files with 24 additions and 2 deletions
|
@ -11,7 +11,7 @@ index fe2ec79dd..8460aa4f5 100644
|
|||
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class BlockMultiPlaceEvent extends BlockPlaceEvent {
|
||||
private final List<BlockState> states;
|
||||
|
||||
|
||||
+ @Deprecated // Paper
|
||||
public BlockMultiPlaceEvent(@NotNull List<BlockState> states, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild) {
|
||||
- super(states.get(0).getBlock(), states.get(0), clicked, itemInHand, thePlayer, canBuild);
|
||||
|
@ -25,6 +25,6 @@ index fe2ec79dd..8460aa4f5 100644
|
|||
this.states = ImmutableList.copyOf(states);
|
||||
+ //Paper end
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
--
|
|
@ -0,0 +1,22 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Tue, 3 Mar 2020 05:26:40 +0000
|
||||
Subject: [PATCH] Prevent teleporting dead entities
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 108377d76..c6bd62392 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
||||
}
|
||||
|
||||
private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set) {
|
||||
+ if (player.dead) {
|
||||
+ LOGGER.info("Attempt to teleport dead player %s restricted", player.getName());
|
||||
+ return;
|
||||
+ }
|
||||
// CraftBukkit start
|
||||
if (Float.isNaN(f)) {
|
||||
f = 0;
|
||||
--
|
Loading…
Reference in a new issue