2022-08-23 02:37:27 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2023-07-01 20:21:13 +00:00
|
|
|
From: Video <videogamesm12@gmail.com>
|
|
|
|
Date: Fri, 19 Aug 2022 00:49:38 -0600
|
2022-08-23 02:37:27 +00:00
|
|
|
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
|
2024-04-16 05:12:25 +00:00
|
|
|
index eaad15a4d201356c34c1a09c7fbe5c35f76a2176..e166411e05287d97ea7c9d35b19d4ae3106401c3 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
|
2024-02-24 22:32:31 +00:00
|
|
|
@@ -280,6 +280,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
|
2023-06-09 04:04:37 +00:00
|
|
|
+ if (level().isLoadedAndInBounds(blockposition))
|
2022-08-23 02:37:27 +00:00
|
|
|
+ {
|
|
|
|
+ this.pos = blockposition;
|
|
|
|
+ }
|
|
|
|
+ // Scissors end
|
|
|
|
+
|
|
|
|
if (!blockposition.closerThan(this.blockPosition(), 16.0D)) {
|
|
|
|
HangingEntity.LOGGER.error("Hanging entity at invalid position: {}", blockposition);
|
|
|
|
} else {
|