mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-11-27 07:05:39 +00:00
25 lines
1.3 KiB
Diff
25 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Video <videogamesm12@gmail.com>
|
|
Date: Fri, 19 Aug 2022 00:49:38 -0600
|
|
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
|
|
index f88918b7c15b72f4cb1dd313734f550432fd5858..684c7e3cf58fc3a9cd69b8bbf8c722180bfba62b 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
|
@@ -279,6 +279,13 @@ public abstract class HangingEntity extends Entity {
|
|
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 {
|