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);
}
}
Aggregations