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));
}
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;
}
Aggregations