use of micdoodle8.mods.galacticraft.planets.asteroids.entities.EntityEntryPod in project Galacticraft by micdoodle8.
the class TeleportTypeAsteroids method onSpaceDimensionChanged.
@Override
public void onSpaceDimensionChanged(World newWorld, EntityPlayerMP player, boolean ridingAutoRocket) {
if (!ridingAutoRocket && player != null) {
GCPlayerStats stats = GCPlayerStats.get(player);
if (stats.getTeleportCooldown() <= 0) {
if (player.capabilities.isFlying) {
player.capabilities.isFlying = false;
}
if (!newWorld.isRemote) {
EntityEntryPod entryPod = new EntityEntryPod(player);
boolean previous = CompatibilityManager.forceLoadChunks((WorldServer) newWorld);
entryPod.forceSpawn = true;
newWorld.spawnEntity(entryPod);
CompatibilityManager.forceLoadChunksEnd((WorldServer) newWorld, previous);
}
stats.setTeleportCooldown(10);
}
}
}
Aggregations