use of stevekung.mods.moreplanets.module.planets.diona.entity.EntityTier4Rocket in project MorePlanets by SteveKunG.
the class ItemTier4Rocket method addDescription.
@Override
@SideOnly(Side.CLIENT)
protected void addDescription(ItemStack itemStack, List<String> list) {
EntityTier4Rocket rocket = new EntityTier4Rocket(Minecraft.getMinecraft().world, 0, 0, 0, CachedEnumUtil.valuesRocketCached()[itemStack.getItemDamage()]);
list.add(GCCoreUtil.translate("gui.message.fuel.name") + ": " + itemStack.getTagCompound().getInteger("RocketFuel") + " / " + rocket.fuelTank.getCapacity());
}
use of stevekung.mods.moreplanets.module.planets.diona.entity.EntityTier4Rocket in project MorePlanets by SteveKunG.
the class ItemTier4Rocket method spawnRocket.
@Override
protected void spawnRocket(ItemStack itemStack, World world, EntityPlayer player, float centerX, float centerY, float centerZ) {
EntityTier4Rocket rocket = new EntityTier4Rocket(world, centerX, centerY, centerZ, CachedEnumUtil.valuesRocketCached()[itemStack.getItemDamage()]);
rocket.rotationYaw += 45;
rocket.setPosition(rocket.posX, rocket.posY + rocket.getOnPadYOffset(), rocket.posZ);
world.spawnEntity(rocket);
if (itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey("RocketFuel")) {
rocket.fuelTank.fill(new FluidStack(GCFluids.fluidFuel, itemStack.getTagCompound().getInteger("RocketFuel")), true);
}
if (!player.capabilities.isCreativeMode) {
itemStack.shrink(1);
if (itemStack.isEmpty()) {
itemStack = ItemStack.EMPTY;
}
}
if (rocket.getType().getPreFueled()) {
rocket.fuelTank.fill(new FluidStack(GCFluids.fluidFuel, rocket.getMaxFuel()), true);
}
}
Aggregations