Search in sources :

Example 1 with EntityEntryPodVenus

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);
        }
    }
}
Also used : GCPlayerStats(micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats) EntityEntryPodVenus(micdoodle8.mods.galacticraft.planets.venus.entities.EntityEntryPodVenus)

Aggregations

GCPlayerStats (micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats)1 EntityEntryPodVenus (micdoodle8.mods.galacticraft.planets.venus.entities.EntityEntryPodVenus)1