Search in sources :

Example 1 with EnumRocketType

use of micdoodle8.mods.galacticraft.api.entity.IRocketType.EnumRocketType in project Galacticraft by micdoodle8.

the class ItemTier1Rocket method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer player, List<String> tooltip, boolean b) {
    EnumRocketType type = EnumRocketType.values()[par1ItemStack.getItemDamage()];
    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")) {
        EntityTier1Rocket rocket = new EntityTier1Rocket(FMLClientHandler.instance().getWorldClient(), 0, 0, 0, EnumRocketType.values()[par1ItemStack.getItemDamage()]);
        tooltip.add(GCCoreUtil.translate("gui.message.fuel.name") + ": " + par1ItemStack.getTagCompound().getInteger("RocketFuel") + " / " + rocket.fuelTank.getCapacity());
    }
}
Also used : EnumRocketType(micdoodle8.mods.galacticraft.api.entity.IRocketType.EnumRocketType) EntityTier1Rocket(micdoodle8.mods.galacticraft.core.entities.EntityTier1Rocket) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with EnumRocketType

use of micdoodle8.mods.galacticraft.api.entity.IRocketType.EnumRocketType in project Galacticraft by micdoodle8.

the class ItemTier3Rocket 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")) {
        EntityTier3Rocket rocket = new EntityTier3Rocket(FMLClientHandler.instance().getWorldClient(), 0, 0, 0, EnumRocketType.values()[par1ItemStack.getItemDamage()]);
        tooltip.add(GCCoreUtil.translate("gui.message.fuel.name") + ": " + par1ItemStack.getTagCompound().getInteger("RocketFuel") + " / " + rocket.fuelTank.getCapacity());
    }
}
Also used : EnumRocketType(micdoodle8.mods.galacticraft.api.entity.IRocketType.EnumRocketType) EntityTier3Rocket(micdoodle8.mods.galacticraft.planets.asteroids.entities.EntityTier3Rocket) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 3 with EnumRocketType

use of micdoodle8.mods.galacticraft.api.entity.IRocketType.EnumRocketType 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)

Aggregations

EnumRocketType (micdoodle8.mods.galacticraft.api.entity.IRocketType.EnumRocketType)3 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)3 EntityAutoRocket (micdoodle8.mods.galacticraft.api.prefab.entity.EntityAutoRocket)1 EntityTier1Rocket (micdoodle8.mods.galacticraft.core.entities.EntityTier1Rocket)1 EntityTier3Rocket (micdoodle8.mods.galacticraft.planets.asteroids.entities.EntityTier3Rocket)1 EntityCargoRocket (micdoodle8.mods.galacticraft.planets.mars.entities.EntityCargoRocket)1 EntityTier2Rocket (micdoodle8.mods.galacticraft.planets.mars.entities.EntityTier2Rocket)1