2022-08-23 02:37:27 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Telesphoreo <me@telesphoreo.me>
|
|
|
|
Date: Mon, 22 Aug 2022 21:33:37 -0500
|
|
|
|
Subject: [PATCH] Fixes out of bounds HangingEntity crash exploit
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
2023-03-16 03:57:35 +00:00
|
|
|
index f7d031e9a5aa533d78a49ed6147dd47dd0f27f01..68bd4f64e85f26071640b219bb91b868f8e8aded 100644
|
2022-08-23 02:37:27 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
2023-03-16 03:57:35 +00:00
|
|
|
@@ -271,6 +271,13 @@ public abstract class HangingEntity extends Entity {
|
2022-08-23 02:37:27 +00:00
|
|
|
public void readAdditionalSaveData(CompoundTag nbt) {
|
|
|
|
BlockPos blockposition = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ"));
|
|
|
|
|
|
|
|
+ // Scissors start - Fixes exploit where bad TileX, TileY, and TileZ coordinates can crash servers
|
|
|
|
+ if (level.isLoadedAndInBounds(blockposition))
|
|
|
|
+ {
|
|
|
|
+ this.pos = blockposition;
|
|
|
|
+ }
|
|
|
|
+ // Scissors end
|
|
|
|
+
|
|
|
|
if (!blockposition.closerThan(this.blockPosition(), 16.0D)) {
|
|
|
|
HangingEntity.LOGGER.error("Hanging entity at invalid position: {}", blockposition);
|
|
|
|
} else {
|