From e1a79132229588065274509c59bcc79c187a7ede Mon Sep 17 00:00:00 2001 From: zontreck Date: Tue, 26 Mar 2024 14:35:10 -0700 Subject: [PATCH] Fix breakage with other mods that have special fall out of world handling (DimDoors) --- src/main/java/dev/zontreck/otemod/events/EventHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/zontreck/otemod/events/EventHandler.java b/src/main/java/dev/zontreck/otemod/events/EventHandler.java index a638576..4438987 100644 --- a/src/main/java/dev/zontreck/otemod/events/EventHandler.java +++ b/src/main/java/dev/zontreck/otemod/events/EventHandler.java @@ -115,10 +115,11 @@ public class EventHandler { @SubscribeEvent public void onPlayerFallOutOfWorld(LivingHurtEvent ev) { - if(ev.getEntity() instanceof Player) + if(ev.getEntity() instanceof Player player) { + ResourceLocation loc = player.level().dimension().location(); - if(ev.getSource().is(DamageTypes.FELL_OUT_OF_WORLD)) + if(ev.getSource().is(DamageTypes.FELL_OUT_OF_WORLD) && (loc.getNamespace().equals(OTEMod.MOD_ID) || loc.getNamespace().equals("minecraft"))) { // Teleport the player to Thresholds WorldPosition pos = new WorldPosition(new Vector3(), ModDimensions.THRESHOLD_DIM());