Search in sources :

Example 6 with EntityCargoRocket

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

the class ItemTier2Rocket method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> tooltip, boolean b) {
    EnumRocketType type;
    if (par1ItemStack.getItemDamage() < 10) {
        type = EnumRocketType.values()[par1ItemStack.getItemDamage()];
    } else {
        type = EnumRocketType.values()[par1ItemStack.getItemDamage() - 10];
    }
    if (!type.getTooltip().isEmpty()) {
        tooltip.add(type.getTooltip());
    }
    if (type.getPreFueled()) {
        tooltip.add(EnumColor.RED + "\u00a7o" + GCCoreUtil.translate("gui.creative_only.desc"));
    }
    if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("RocketFuel")) {
        EntityAutoRocket rocket;
        if (par1ItemStack.getItemDamage() < 10) {
            rocket = new EntityTier2Rocket(FMLClientHandler.instance().getWorldClient(), 0, 0, 0, EnumRocketType.values()[par1ItemStack.getItemDamage()]);
        } else {
            rocket = new EntityCargoRocket(FMLClientHandler.instance().getWorldClient(), 0, 0, 0, EnumRocketType.values()[par1ItemStack.getItemDamage() - 10]);
        }
        tooltip.add(GCCoreUtil.translate("gui.message.fuel.name") + ": " + par1ItemStack.getTagCompound().getInteger("RocketFuel") + " / " + rocket.fuelTank.getCapacity());
    }
    if (par1ItemStack.getItemDamage() >= 10) {
        tooltip.add(EnumColor.AQUA + GCCoreUtil.translate("gui.requires_controller.desc"));
    }
}
Also used : EntityCargoRocket(micdoodle8.mods.galacticraft.planets.mars.entities.EntityCargoRocket) EnumRocketType(micdoodle8.mods.galacticraft.api.entity.IRocketType.EnumRocketType) EntityAutoRocket(micdoodle8.mods.galacticraft.api.prefab.entity.EntityAutoRocket) EntityTier2Rocket(micdoodle8.mods.galacticraft.planets.mars.entities.EntityTier2Rocket) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 7 with EntityCargoRocket

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

the class MarsUtil method openCargoRocketInventory.

public static void openCargoRocketInventory(EntityPlayerMP player, EntityCargoRocket rocket) {
    player.getNextWindowId();
    player.closeContainer();
    int windowId = player.currentWindowId;
    GalacticraftCore.packetPipeline.sendTo(new PacketSimpleMars(EnumSimplePacketMars.C_OPEN_CUSTOM_GUI, GCCoreUtil.getDimensionID(player.worldObj), new Object[] { windowId, 1, rocket.getEntityId() }), player);
    player.openContainer = new ContainerRocketInventory(player.inventory, rocket, rocket.rocketType, player);
    player.openContainer.windowId = windowId;
    player.openContainer.onCraftGuiOpened(player);
}
Also used : ContainerRocketInventory(micdoodle8.mods.galacticraft.core.inventory.ContainerRocketInventory) PacketSimpleMars(micdoodle8.mods.galacticraft.planets.mars.network.PacketSimpleMars)

Aggregations

EntityCargoRocket (micdoodle8.mods.galacticraft.planets.mars.entities.EntityCargoRocket)4 Entity (net.minecraft.entity.Entity)4 EntityAutoRocket (micdoodle8.mods.galacticraft.api.prefab.entity.EntityAutoRocket)2 EntitySlimeling (micdoodle8.mods.galacticraft.planets.mars.entities.EntitySlimeling)2 EntityTier2Rocket (micdoodle8.mods.galacticraft.planets.mars.entities.EntityTier2Rocket)2 TileEntityLaunchController (micdoodle8.mods.galacticraft.planets.mars.tile.TileEntityLaunchController)2 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)2 TileEntity (net.minecraft.tileentity.TileEntity)2 BlockPos (net.minecraft.util.BlockPos)2 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)2 EnumRocketType (micdoodle8.mods.galacticraft.api.entity.IRocketType.EnumRocketType)1 IWorldTransferCallback (micdoodle8.mods.galacticraft.api.entity.IWorldTransferCallback)1 EntitySpaceshipBase (micdoodle8.mods.galacticraft.api.prefab.entity.EntitySpaceshipBase)1 EntityTieredRocket (micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket)1 Vector3 (micdoodle8.mods.galacticraft.api.vector.Vector3)1 IGalacticraftWorldProvider (micdoodle8.mods.galacticraft.api.world.IGalacticraftWorldProvider)1 WorldProviderSpaceStation (micdoodle8.mods.galacticraft.core.dimension.WorldProviderSpaceStation)1 EntityCelestialFake (micdoodle8.mods.galacticraft.core.entities.EntityCelestialFake)1 GCPlayerStats (micdoodle8.mods.galacticraft.core.entities.player.GCPlayerStats)1 EventWakePlayer (micdoodle8.mods.galacticraft.core.event.EventWakePlayer)1