Search in sources :

Example 66 with DimletKey

use of mcjty.rftoolsdim.dimensions.dimlets.DimletKey in project RFToolsDimensions by McJty.

the class KnownDimlet method addInformation.

@SideOnly(Side.CLIENT)
@Override
public void addInformation(ItemStack itemStack, World player, List<String> list, ITooltipFlag showExtended) {
    super.addInformation(itemStack, player, list, showExtended);
    DimletKey key = KnownDimletConfiguration.getDimletKey(itemStack);
    Settings settings = KnownDimletConfiguration.getSettings(key);
    if (showExtended.isAdvanced()) {
        list.add(TextFormatting.GOLD + "Key: " + key.getId());
    }
    if (settings == null) {
        list.add(TextFormatting.WHITE + "Dimlet " + key.getType().dimletType.getName() + "." + key.getId());
        list.add(TextFormatting.RED + "This dimlet is blacklisted!");
        return;
    }
    list.add(TextFormatting.BLUE + "Rarity: " + settings.getRarity() + (KnownDimletConfiguration.isCraftable(key) ? " (craftable)" : ""));
    list.add(TextFormatting.YELLOW + "Create cost: " + settings.getCreateCost() + " RF/tick");
    int maintainCost = settings.getMaintainCost();
    if (maintainCost < 0) {
        list.add(TextFormatting.YELLOW + "Maintain cost: " + maintainCost + "% RF/tick");
    } else {
        list.add(TextFormatting.YELLOW + "Maintain cost: " + maintainCost + " RF/tick");
    }
    list.add(TextFormatting.YELLOW + "Tick cost: " + settings.getTickCost() + " ticks");
    if (KnownDimletConfiguration.isSeedDimlet(key)) {
        NBTTagCompound tagCompound = itemStack.getTagCompound();
        if (tagCompound != null && tagCompound.getLong("forcedSeed") != 0) {
            long forcedSeed = tagCompound.getLong("forcedSeed");
            boolean locked = tagCompound.getBoolean("locked");
            list.add(TextFormatting.BLUE + "Forced seed: " + forcedSeed + (locked ? " [LOCKED]" : ""));
        } else {
            list.add(TextFormatting.BLUE + "Right click to copy seed from dimension.");
            list.add(TextFormatting.BLUE + "Shift-Right click to lock copied seed.");
        }
    }
    if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
        for (String info : key.getType().dimletType.getInformation()) {
            list.add(TextFormatting.WHITE + info);
        }
    // @todo
    // List<String> extra = KnownDimletConfiguration.idToExtraInformation.get(entry.getKey());
    // if (extra != null) {
    // for (String info : extra) {
    // list.add(TextFormatting.YELLOW + info);
    // }
    // }
    } else {
        list.add(TextFormatting.WHITE + RFToolsDim.SHIFT_MESSAGE);
    }
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) DimletKey(mcjty.rftoolsdim.dimensions.dimlets.DimletKey) Settings(mcjty.rftoolsdim.config.Settings) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

DimletKey (mcjty.rftoolsdim.dimensions.dimlets.DimletKey)66 ArrayList (java.util.ArrayList)21 Settings (mcjty.rftoolsdim.config.Settings)16 ItemStack (net.minecraft.item.ItemStack)16 List (java.util.List)15 DimletType (mcjty.rftoolsdim.dimensions.dimlets.types.DimletType)14 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)11 Block (net.minecraft.block.Block)10 IBlockState (net.minecraft.block.state.IBlockState)6 TerrainType (mcjty.rftoolsdim.dimensions.types.TerrainType)5 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)5 DimensionDescriptor (mcjty.rftoolsdim.dimensions.description.DimensionDescriptor)4 HashMap (java.util.HashMap)3 IDimletType (mcjty.rftoolsdim.dimensions.dimlets.types.IDimletType)3 ControllerType (mcjty.rftoolsdim.dimensions.types.ControllerType)3 FeatureType (mcjty.rftoolsdim.dimensions.types.FeatureType)3 ResourceLocation (net.minecraft.util.ResourceLocation)3 Pair (org.apache.commons.lang3.tuple.Pair)3 LinkedHashSet (java.util.LinkedHashSet)2 Map (java.util.Map)2