From 0648cb49c8fafd6f554504992e05974fd0c7190f Mon Sep 17 00:00:00 2001 From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com> Date: Sat, 5 Aug 2023 03:07:45 +0200 Subject: [PATCH] Patch cleanup --- .../0025-Vanilla-end-portal-teleportation.patch | 4 ++-- patches/server/0043-Async-path-processing.patch | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/patches/server/0025-Vanilla-end-portal-teleportation.patch b/patches/server/0025-Vanilla-end-portal-teleportation.patch index 0124a3d..0d94aa3 100644 --- a/patches/server/0025-Vanilla-end-portal-teleportation.patch +++ b/patches/server/0025-Vanilla-end-portal-teleportation.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Vanilla end portal teleportation diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index b971f35b69a930dddcf603207f524dc95e09f0fd..aaf8c22d43eb0414c5bfc58fa68f585304763b44 100644 +index b971f35b69a930dddcf603207f524dc95e09f0fd..03895d35c02ff9422aaa0177eb0aa40e03fdc925 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -4029,12 +4029,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -44,7 +44,7 @@ index b971f35b69a930dddcf603207f524dc95e09f0fd..aaf8c22d43eb0414c5bfc58fa68f5853 passengerTree.root.placeInAsync( originWorld, destination, Entity.TELEPORT_FLAG_LOAD_CHUNK | (takePassengers ? Entity.TELEPORT_FLAG_TELEPORT_PASSENGERS : 0L), - passengerTree, teleportComplete -+ passengerTree, tpComplete ++ passengerTree, tpComplete // Kaiiju - vanilla end teleportation ); }); diff --git a/patches/server/0043-Async-path-processing.patch b/patches/server/0043-Async-path-processing.patch index 3f56a73..a12df88 100644 --- a/patches/server/0043-Async-path-processing.patch +++ b/patches/server/0043-Async-path-processing.patch @@ -338,15 +338,16 @@ index 0000000000000000000000000000000000000000..6b91852238f80d236fc44f766b115267 +} diff --git a/src/main/java/dev/kaiijumc/kaiiju/path/AsyncPathProcessor.java b/src/main/java/dev/kaiijumc/kaiiju/path/AsyncPathProcessor.java new file mode 100644 -index 0000000000000000000000000000000000000000..8ac99ae5f0c0fc8a471be293c9033c04ec644780 +index 0000000000000000000000000000000000000000..2a54fa6d733cb5d406fd218161448197515be7fb --- /dev/null +++ b/src/main/java/dev/kaiijumc/kaiiju/path/AsyncPathProcessor.java -@@ -0,0 +1,52 @@ +@@ -0,0 +1,53 @@ +package dev.kaiijumc.kaiiju.path; + +import com.google.common.util.concurrent.ThreadFactoryBuilder; + -+import dev.kaiijumc.kaiiju.KaiijuConfig;import net.minecraft.world.level.pathfinder.Path; ++import dev.kaiijumc.kaiiju.KaiijuConfig; ++import net.minecraft.world.level.pathfinder.Path; +import net.minecraft.world.entity.Entity; + +import org.jetbrains.annotations.NotNull; @@ -1141,16 +1142,17 @@ index 97b763431bc5015448ee7a26a340635a932c950b..48109aebe34cbdfac3eceffb1c20aa84 @Override protected float distance(Node a, Node b) { diff --git a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java -index b51155ad12515b2d0dd0f202580b9f455c114d9a..358233cb35860adad86c01872c65ec6f165ba594 100644 +index b51155ad12515b2d0dd0f202580b9f455c114d9a..48c59e3ddd2fca3357a0b816630ae606bbfbb059 100644 --- a/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ShulkerBoxBlock.java -@@ -242,8 +242,13 @@ public class ShulkerBoxBlock extends BaseEntityBlock { +@@ -242,8 +242,14 @@ public class ShulkerBoxBlock extends BaseEntityBlock { @Override public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { + try { // Kaiiju - async pathfinding - lol i hate that BlockEntity blockEntity = world.getBlockEntity(pos); return blockEntity instanceof ShulkerBoxBlockEntity ? Shapes.create(((ShulkerBoxBlockEntity)blockEntity).getBoundingBox(state)) : Shapes.block(); ++ // Kaiiju start - async pathfinding - workaround + } catch (NullPointerException e) { + return Shapes.block(); + }