Search in sources :

Example 6 with EntityTieredRocket

use of micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket in project Galacticraft by micdoodle8.

the class GuiRocketInventory method initGui.

@Override
public void initGui() {
    super.initGui();
    List<String> fuelTankDesc = new ArrayList<String>();
    fuelTankDesc.add(GCCoreUtil.translate("gui.fuel_tank.desc.0"));
    fuelTankDesc.add(GCCoreUtil.translate("gui.fuel_tank.desc.1"));
    this.infoRegions.add(new GuiElementInfoRegion((this.width - this.xSize) / 2 + (((EntityTieredRocket) this.mc.thePlayer.ridingEntity).rocketType.getInventorySpace() == 2 ? 70 : 71), (this.height - this.ySize) / 2 + 6, 36, 40, fuelTankDesc, this.width, this.height, this));
}
Also used : GuiElementInfoRegion(micdoodle8.mods.galacticraft.core.client.gui.element.GuiElementInfoRegion) ArrayList(java.util.ArrayList)

Example 7 with EntityTieredRocket

use of micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket in project Galacticraft by micdoodle8.

the class ItemTier2Rocket method placeRocketOnPad.

public static boolean placeRocketOnPad(ItemStack stack, World world, TileEntity tile, float centerX, float centerY, float centerZ) {
    // Check whether there is already a rocket on the pad
    if (tile instanceof TileEntityLandingPad) {
        if (((TileEntityLandingPad) tile).getDockedEntity() != null) {
            return false;
        }
    } else {
        return false;
    }
    EntityAutoRocket rocket;
    if (stack.getItemDamage() < 10) {
        rocket = new EntityTier2Rocket(world, centerX, centerY, centerZ, EnumRocketType.values()[stack.getItemDamage()]);
    } else {
        rocket = new EntityCargoRocket(world, centerX, centerY, centerZ, EnumRocketType.values()[stack.getItemDamage() - 10]);
    }
    rocket.setPosition(rocket.posX, rocket.posY + rocket.getOnPadYOffset(), rocket.posZ);
    world.spawnEntityInWorld(rocket);
    if (((IRocketType) rocket).getType().getPreFueled()) {
        if (rocket instanceof EntityTieredRocket) {
            ((EntityTieredRocket) rocket).fuelTank.fill(new FluidStack(GCFluids.fluidFuel, rocket.getMaxFuel()), true);
        } else {
            ((EntityCargoRocket) rocket).fuelTank.fill(new FluidStack(GCFluids.fluidFuel, rocket.getMaxFuel()), true);
        }
    } else if (stack.hasTagCompound() && stack.getTagCompound().hasKey("RocketFuel")) {
        rocket.fuelTank.fill(new FluidStack(GCFluids.fluidFuel, stack.getTagCompound().getInteger("RocketFuel")), true);
    }
    return true;
}
Also used : EntityCargoRocket(micdoodle8.mods.galacticraft.planets.mars.entities.EntityCargoRocket) EntityTieredRocket(micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket) FluidStack(net.minecraftforge.fluids.FluidStack) EntityAutoRocket(micdoodle8.mods.galacticraft.api.prefab.entity.EntityAutoRocket) TileEntityLandingPad(micdoodle8.mods.galacticraft.core.tile.TileEntityLandingPad) EntityTier2Rocket(micdoodle8.mods.galacticraft.planets.mars.entities.EntityTier2Rocket)

Aggregations

EntityTieredRocket (micdoodle8.mods.galacticraft.api.prefab.entity.EntityTieredRocket)5 TileEntity (net.minecraft.tileentity.TileEntity)4 ISchematicPage (micdoodle8.mods.galacticraft.api.recipe.ISchematicPage)3 Entity (net.minecraft.entity.Entity)3 EntityAutoRocket (micdoodle8.mods.galacticraft.api.prefab.entity.EntityAutoRocket)2 Vector3 (micdoodle8.mods.galacticraft.api.vector.Vector3)2 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)2 ItemStack (net.minecraft.item.ItemStack)2 GameProfile (com.mojang.authlib.GameProfile)1 Property (com.mojang.authlib.properties.Property)1 IOException (java.io.IOException)1 Field (java.lang.reflect.Field)1 ArrayList (java.util.ArrayList)1 ICameraZoomEntity (micdoodle8.mods.galacticraft.api.entity.ICameraZoomEntity)1 CelestialBody (micdoodle8.mods.galacticraft.api.galaxies.CelestialBody)1 SolarSystem (micdoodle8.mods.galacticraft.api.galaxies.SolarSystem)1 IHoldableItem (micdoodle8.mods.galacticraft.api.item.IHoldableItem)1 IHoldableItemCustom (micdoodle8.mods.galacticraft.api.item.IHoldableItemCustom)1 EntitySpaceshipBase (micdoodle8.mods.galacticraft.api.prefab.entity.EntitySpaceshipBase)1 ISchematicResultPage (micdoodle8.mods.galacticraft.api.recipe.ISchematicResultPage)1