use of codechicken.nei.config.ItemPanelDumper in project Galacticraft by micdoodle8.
the class ItemInfo method addIDDumps.
private static void addIDDumps() {
API.addOption(new RegistryDumper<Item>("tools.dump.item") {
@Override
public String[] header() {
return new String[] { "Name", "ID", "Has Block", "Mod", "Class" };
}
@Override
public String[] dump(Item item, int id, String name) {
return new String[] { name, Integer.toString(id), Boolean.toString(Block.getBlockFromItem(item) != Blocks.air), ItemInfo.itemOwners.get(item), item.getClass().getCanonicalName() };
}
@Override
public RegistryNamespaced registry() {
return Item.itemRegistry;
}
});
API.addOption(new RegistryDumper<Block>("tools.dump.block") {
@Override
public String[] header() {
return new String[] { "Name", "ID", "Has Item", "Mod", "Class" };
}
@Override
public String[] dump(Block item, int id, String name) {
return new String[] { name, Integer.toString(id), Boolean.toString(Item.getItemFromBlock(item) != null), ItemInfo.itemOwners.get(item), item.getClass().getCanonicalName() };
}
@Override
public RegistryNamespaced registry() {
return Block.blockRegistry;
}
});
API.addOption(new ArrayDumper<Potion>("tools.dump.potion") {
public String[] header() {
return new String[] { "ID", "Unlocalised name", "Class" };
}
@Override
public String[] dump(Potion potion, int id) {
return new String[] { Integer.toString(id), potion.getName(), potion.getClass().getCanonicalName() };
}
@Override
public Potion[] array() {
return Potion.potionTypes;
}
});
API.addOption(new ArrayDumper<Enchantment>("tools.dump.enchantment") {
public String[] header() {
return new String[] { "ID", "Unlocalised name", "Type", "Min Level", "Max Level", "Class" };
}
@Override
public String[] dump(Enchantment ench, int id) {
return new String[] { Integer.toString(id), ench.getName(), ench.type.toString(), Integer.toString(ench.getMinLevel()), Integer.toString(ench.getMaxLevel()), ench.getClass().getCanonicalName() };
}
@Override
public Enchantment[] array() {
return Enchantment.enchantmentsList;
}
});
API.addOption(new ArrayDumper<BiomeGenBase>("tools.dump.biome") {
@Override
public String[] header() {
return new String[] { "ID", "Name", "Temperature", "Rainfall", "Spawn Chance", "Root Height", "Height Variation", "Types", "Class" };
}
@Override
public String[] dump(BiomeGenBase biome, int id) {
BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(biome);
StringBuilder s_types = new StringBuilder();
for (BiomeDictionary.Type t : types) {
if (s_types.length() > 0) {
s_types.append(", ");
}
s_types.append(t.name());
}
return new String[] { Integer.toString(id), biome.biomeName, Float.toString(biome.getFloatTemperature(BlockPos.ORIGIN)), Float.toString(biome.getFloatRainfall()), Float.toString(biome.getSpawningChance()), Float.toString(biome.minHeight), Float.toString(biome.maxHeight), s_types.toString(), biome.getClass().getCanonicalName() };
}
@Override
public BiomeGenBase[] array() {
return BiomeGenBase.getBiomeGenArray();
}
});
API.addOption(new ItemPanelDumper("tools.dump.itempanel"));
// TODO Fluid registry Dumper.
}
Aggregations