Search in sources :

Example 1 with EntityLandingBalloons

use of micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons in project Galacticraft by micdoodle8.

the class MarsUtil method openParachestInventory.

public static void openParachestInventory(EntityPlayerMP player, EntityLandingBalloons landerInv) {
    player.getNextWindowId();
    player.closeContainer();
    int windowId = player.currentWindowId;
    GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_OPEN_PARACHEST_GUI, GCCoreUtil.getDimensionID(player.world), new Object[] { windowId, 1, landerInv.getEntityId() }), player);
    player.openContainer = new ContainerParaChest(player.inventory, landerInv, player);
    player.openContainer.windowId = windowId;
    player.openContainer.addListener(player);
}
Also used : PacketSimple(micdoodle8.mods.galacticraft.core.network.PacketSimple) ContainerParaChest(micdoodle8.mods.galacticraft.core.inventory.ContainerParaChest)

Example 2 with EntityLandingBalloons

use of micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons in project Galacticraft by micdoodle8.

the class TeleportTypeMars 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;
            }
            EntityLandingBalloons lander = new EntityLandingBalloons(player);
            if (!newWorld.isRemote) {
                boolean previous = CompatibilityManager.forceLoadChunks((WorldServer) newWorld);
                lander.forceSpawn = true;
                newWorld.spawnEntity(lander);
                CompatibilityManager.forceLoadChunksEnd((WorldServer) newWorld, previous);
            }
            stats.setTeleportCooldown(10);
        }
    }
}
Also used : GCPlayerStats(micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats) EntityLandingBalloons(micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons)

Aggregations

GCPlayerStats (micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats)1 ContainerParaChest (micdoodle8.mods.galacticraft.core.inventory.ContainerParaChest)1 PacketSimple (micdoodle8.mods.galacticraft.core.network.PacketSimple)1 EntityLandingBalloons (micdoodle8.mods.galacticraft.planets.mars.entities.EntityLandingBalloons)1