mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Include subitems too, with rules for items like RBMK pellets
Ignore unlocalized items
This commit is contained in:
parent
6c8677f2c7
commit
a259ba716f
@ -57,7 +57,9 @@ public class GUIScreenWikiRender extends GuiScreen {
|
||||
|
||||
try {
|
||||
String slotName = preview[index].getDisplayName().replaceAll("[^\\w ().-]+", "");
|
||||
saveScreenshot(Minecraft.getMinecraft().mcDataDir, "Slot " + slotName + ".png", 2, 2, 32, 32, 0xFF8B8B8B);
|
||||
if(!slotName.endsWith(".name")) {
|
||||
saveScreenshot(Minecraft.getMinecraft().mcDataDir, "Slot " + slotName + ".png", 2, 2, 32, 32, 0xFF8B8B8B);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// Just skip any failures caused by display name or rendering
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.main;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
@ -39,6 +40,9 @@ import com.hbm.items.armor.ArmorFSBPowered;
|
||||
import com.hbm.items.armor.ArmorNo9;
|
||||
import com.hbm.items.armor.ItemArmorMod;
|
||||
import com.hbm.items.armor.JetpackBase;
|
||||
import com.hbm.items.machine.ItemDepletedFuel;
|
||||
import com.hbm.items.machine.ItemFluidDuct;
|
||||
import com.hbm.items.machine.ItemRBMKPellet;
|
||||
import com.hbm.items.weapon.ItemGunBase;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
@ -108,6 +112,7 @@ import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
@ -982,10 +987,32 @@ public class ModEventHandlerClient {
|
||||
|
||||
MainRegistry.logger.info("Taking a screenshot of ALL items, if you did this by mistake: fucking lmao get rekt nerd");
|
||||
|
||||
List<Item> ignoredItems = Arrays.asList(
|
||||
ModItems.assembly_template,
|
||||
ModItems.crucible_template,
|
||||
ModItems.chemistry_template,
|
||||
ModItems.chemistry_icon,
|
||||
ModItems.fluid_icon,
|
||||
ModItems.achievement_icon,
|
||||
Items.spawn_egg,
|
||||
Item.getItemFromBlock(Blocks.mob_spawner)
|
||||
);
|
||||
|
||||
List<Class<? extends Item>> collapsedClasses = Arrays.asList(
|
||||
ItemRBMKPellet.class,
|
||||
ItemDepletedFuel.class,
|
||||
ItemFluidDuct.class
|
||||
);
|
||||
|
||||
List<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
for (Object reg : Item.itemRegistry) {
|
||||
Item item = (Item) reg;
|
||||
stacks.add(new ItemStack(item));
|
||||
if(ignoredItems.contains(item)) continue;
|
||||
if(collapsedClasses.contains(item.getClass())) {
|
||||
stacks.add(new ItemStack(item));
|
||||
} else {
|
||||
item.getSubItems(item, null, stacks);
|
||||
}
|
||||
}
|
||||
|
||||
FMLCommonHandler.instance().showGuiScreen(new GUIScreenWikiRender(stacks.toArray(new ItemStack[0])));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user