Fix compilation errors

This commit is contained in:
Telesphoreo 2023-06-08 23:04:37 -05:00
parent cb210eb5a1
commit 7bebfce7df
No known key found for this signature in database
GPG Key ID: 68B745F7F8C2FADA
3 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,7 @@ group=me.totalfreedom.scissors
version=1.20-R0.1-SNAPSHOT
mcVersion=1.20
paperRef=04509f0234dfd4c05be002de1985ab4915c2092c
paperRef=e829a9d8f3a52a4803eaaa96a046c4a4876a262a
org.gradle.caching=true
org.gradle.parallel=true

View File

@ -121,7 +121,7 @@ index 0000000000000000000000000000000000000000..b724baaef8d565e41db1af6393d0890e
+}
diff --git a/src/main/java/me/totalfreedom/scissors/PositionUtility.java b/src/main/java/me/totalfreedom/scissors/PositionUtility.java
new file mode 100644
index 0000000000000000000000000000000000000000..9e33ad84e50c7e2491aa883f905323f3ad2b070c
index 0000000000000000000000000000000000000000..c54535042a7ac12fe46b3b37db8d7b116e9469d5
--- /dev/null
+++ b/src/main/java/me/totalfreedom/scissors/PositionUtility.java
@@ -0,0 +1,83 @@
@ -175,7 +175,7 @@ index 0000000000000000000000000000000000000000..9e33ad84e50c7e2491aa883f905323f3
+
+ public static BlockPos getValidBlockPos(BlockPos blockPos, Entity entity)
+ {
+ final Level level = entity.level;
+ final Level level = entity.level();
+
+ try
+ {

View File

@ -5,7 +5,7 @@ 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 66cf0a6cd1525ecf2615809210a26d55f445d07d..b645a6cc8321c116dbee3990d2bbd83234110f13 100644
index 66cf0a6cd1525ecf2615809210a26d55f445d07d..74fb79d4ea11f88f2c0de65b492a5fecc49684f1 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 {
@ -13,7 +13,7 @@ index 66cf0a6cd1525ecf2615809210a26d55f445d07d..b645a6cc8321c116dbee3990d2bbd832
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))
+ if (level().isLoadedAndInBounds(blockposition))
+ {
+ this.pos = blockposition;
+ }