mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-11-14 19:34:54 -05:00
Create 0041-Fixes-out-of-bounds-HangingEntity-crash-exploit.patch
This commit is contained in:
parent
f6f17d3367
commit
8b85104178
1 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
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
|
||||
index 334a47b5e0d205c57dfcbb17168cbd3f21d15606..0227f4ed153d229747722ab709932741e0998dc1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
@@ -270,6 +270,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 {
|
Loading…
Reference in a new issue