use of micdoodle8.mods.galacticraft.planets.venus.entities.EntityEntryPodVenus in project Galacticraft by micdoodle8.
the class TeleportTypeVenus 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) {
EntityEntryPodVenus entryPod = new EntityEntryPodVenus(player);
boolean previous = CompatibilityManager.forceLoadChunks((WorldServer) newWorld);
entryPod.forceSpawn = true;
newWorld.spawnEntity(entryPod);
CompatibilityManager.forceLoadChunksEnd((WorldServer) newWorld, previous);
}
stats.setTeleportCooldown(10);
}
}
}
Aggregations