YOUR TAKING TOO LONG

This commit is contained in:
Boblet 2026-07-16 09:21:33 +02:00
parent 348505f3d2
commit cefcd7dee5
2 changed files with 43 additions and 42 deletions

View File

@ -13,14 +13,15 @@ import com.hbm.items.machine.ItemRBMKPellet;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.FMLLaunchHandler;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.command.WrongUsageException; import net.minecraft.command.WrongUsageException;
import net.minecraft.command.PlayerNotFoundException; import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.command.ICommandSender; import net.minecraft.command.ICommandSender;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.client.ClientCommandHandler;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.command.CommandBase; import net.minecraft.command.CommandBase;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -28,8 +29,13 @@ import net.minecraft.init.Items;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
// horribly written command so you can render more than fucking guns without having to decompile the JAR // horribly written command so you can render more than fucking guns without having to decompile the JAR
@SideOnly(Side.CLIENT) // make it clientside so bobcat would not come after me
public class CommandWikiRender extends CommandBase { public class CommandWikiRender extends CommandBase {
public static void register() {
if(FMLLaunchHandler.side() != Side.CLIENT) return;
ClientCommandHandler.instance.registerCommand(new CommandWikiRender());
}
@Override @Override
public String getCommandName() { public String getCommandName() {
return "ntmwikirender"; return "ntmwikirender";
@ -37,10 +43,8 @@ public class CommandWikiRender extends CommandBase {
@Override @Override
public String getCommandUsage(ICommandSender sender) { public String getCommandUsage(ICommandSender sender) {
return String.format(Locale.US, return String.format(Locale.US, "%s/%s <type> %s- Render screenshots of a selected item type (e.g ItemGunBaseNT). Intended for developers and wiki editors only.", EnumChatFormatting.GREEN,
"%s/%s <type> %s- Render screenshots of a selected item type (e.g ItemGunBaseNT). Intended for developers and wiki editors only.", getCommandName(), EnumChatFormatting.LIGHT_PURPLE);
EnumChatFormatting.GREEN, getCommandName(), EnumChatFormatting.LIGHT_PURPLE
);
} }
@Override @Override
@ -55,28 +59,24 @@ public class CommandWikiRender extends CommandBase {
MainRegistry.logger.info("Taking a screenshot of " + args[0]); MainRegistry.logger.info("Taking a screenshot of " + args[0]);
List<Item> ignoredItems = Arrays.asList( List<Item> ignoredItems = Arrays.asList(ModItems.achievement_icon, Items.spawn_egg, Item.getItemFromBlock(Blocks.mob_spawner));
ModItems.achievement_icon,
Items.spawn_egg,
Item.getItemFromBlock(Blocks.mob_spawner)
);
List<Class<? extends Item>> collapsedClasses = Arrays.asList( List<Class<? extends Item>> collapsedClasses = Arrays.asList(ItemRBMKPellet.class, ItemDepletedFuel.class, ItemFluidDuct.class);
ItemRBMKPellet.class,
ItemDepletedFuel.class,
ItemFluidDuct.class
);
String prefix = args[0]; String prefix = args[0];
int slotScale = 16; int slotScale = 16;
boolean ignoreNonNTM = true; boolean ignoreNonNTM = true;
List<ItemStack> stacks = new ArrayList<ItemStack>(); List<ItemStack> stacks = new ArrayList<ItemStack>();
for (Object reg : Item.itemRegistry) { for(Object reg : Item.itemRegistry) {
Item item = (Item) reg; Item item = (Item) reg;
if(ignoreNonNTM && !Item.itemRegistry.getNameForObject(item).startsWith("hbm:")) continue; if(ignoreNonNTM && !Item.itemRegistry.getNameForObject(item).startsWith("hbm:"))
if(ignoredItems.contains(item)) continue; continue;
if(!item.getClass().getSimpleName().equalsIgnoreCase(args[0]) && (net.minecraft.block.Block.getBlockFromItem(item) == null || !net.minecraft.block.Block.getBlockFromItem(item).getClass().getSimpleName().equalsIgnoreCase(args[0]))) continue; if(ignoredItems.contains(item))
continue;
if(!item.getClass().getSimpleName().equalsIgnoreCase(args[0])
&& (net.minecraft.block.Block.getBlockFromItem(item) == null || !net.minecraft.block.Block.getBlockFromItem(item).getClass().getSimpleName().equalsIgnoreCase(args[0])))
continue;
if(collapsedClasses.contains(item.getClass())) { if(collapsedClasses.contains(item.getClass())) {
stacks.add(new ItemStack(item)); stacks.add(new ItemStack(item));
} else { } else {

View File

@ -606,6 +606,7 @@ public class MainRegistry {
Compat.handleRailcraftNonsense(); Compat.handleRailcraftNonsense();
SuicideThreadDump.register(); SuicideThreadDump.register();
CommandReloadClient.register(); CommandReloadClient.register();
CommandWikiRender.register();
//ExplosionTests.runTest(); //ExplosionTests.runTest();
} }