use of micdoodle8.mods.galacticraft.planets.mars.entities.EntityCargoRocket 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"));
}
}
use of micdoodle8.mods.galacticraft.planets.mars.entities.EntityCargoRocket in project Galacticraft by micdoodle8.
the class MarsUtil method openCargoRocketInventory.
public static void openCargoRocketInventory(EntityPlayerMP player, EntityCargoRocket rocket) {
player.getNextWindowId();
player.closeContainer();
int windowId = player.currentWindowId;
GalacticraftCore.packetPipeline.sendTo(new PacketSimpleMars(EnumSimplePacketMars.C_OPEN_CUSTOM_GUI, GCCoreUtil.getDimensionID(player.worldObj), new Object[] { windowId, 1, rocket.getEntityId() }), player);
player.openContainer = new ContainerRocketInventory(player.inventory, rocket, rocket.rocketType, player);
player.openContainer.windowId = windowId;
player.openContainer.onCraftGuiOpened(player);
}
Aggregations