mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
20 lines
1.1 KiB
Diff
20 lines
1.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Fri, 30 Jul 2021 03:42:00 -0500
|
|
Subject: [PATCH] Fix #533 crash exploit
|
|
|
|
This fixes an exploit where a player can drop a map item with an invalid id to crash the server
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
index e90193b303ecafc1073d22ff0e145a6fef42c4ce..c11f7a76576710b751a09d0a916017f732b09003 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
|
@@ -808,6 +808,7 @@ public abstract class Player extends LivingEntity {
|
|
// Paper start - remove player from map on drop
|
|
if (stack.getItem() == Items.FILLED_MAP) {
|
|
MapItemSavedData worldmap = MapItem.getSavedData(stack, this.level);
|
|
+ if (worldmap != null) // Purpur - fix #533
|
|
worldmap.tickCarriedBy(this, stack);
|
|
}
|
|
// Paper end
|