Search in sources :

Example 1 with EntityTier4Rocket

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());
}
Also used : EntityTier4Rocket(stevekung.mods.moreplanets.module.planets.diona.entity.EntityTier4Rocket) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with EntityTier4Rocket

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);
    }
}
Also used : FluidStack(net.minecraftforge.fluids.FluidStack) EntityTier4Rocket(stevekung.mods.moreplanets.module.planets.diona.entity.EntityTier4Rocket)

Aggregations

EntityTier4Rocket (stevekung.mods.moreplanets.module.planets.diona.entity.EntityTier4Rocket)2 FluidStack (net.minecraftforge.fluids.FluidStack)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1