Decrease teleport cooldown for non-living entities (#671)
This commit is contained in:
parent
599ff5ab67
commit
e8d2c523e4
|
@ -3,6 +3,7 @@ package WayofTime.bloodmagic.ritual.portal;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityList;
|
import net.minecraft.entity.EntityList;
|
||||||
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
@ -157,14 +158,13 @@ public class Teleports
|
||||||
teleportedEntity.forceSpawn = true;
|
teleportedEntity.forceSpawn = true;
|
||||||
newWorldServer.spawnEntityInWorld(teleportedEntity);
|
newWorldServer.spawnEntityInWorld(teleportedEntity);
|
||||||
teleportedEntity.setWorld(newWorldServer);
|
teleportedEntity.setWorld(newWorldServer);
|
||||||
teleportedEntity.timeUntilPortal = 150;
|
teleportedEntity.timeUntilPortal = teleportedEntity instanceof EntityPlayer ? 150 : 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
oldWorldServer.resetUpdateEntityTick();
|
oldWorldServer.resetUpdateEntityTick();
|
||||||
newWorldServer.resetUpdateEntityTick();
|
newWorldServer.resetUpdateEntityTick();
|
||||||
}
|
}
|
||||||
entity.timeUntilPortal = 150;
|
entity.timeUntilPortal = entity instanceof EntityLiving ? 150 : 20;
|
||||||
|
|
||||||
newWorldServer.playSoundEffect(x, y, z, "mob.endermen.portal", 1.0F, 1.0F);
|
newWorldServer.playSoundEffect(x, y, z, "mob.endermen.portal", 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue