Fix breakage with other mods that have special fall out of world handling (DimDoors)
This commit is contained in:
parent
ceba8d7585
commit
e1a7913222
1 changed files with 3 additions and 2 deletions
|
@ -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());
|
||||
|
|
Reference in a new issue