Compare commits

...

12 Commits

Author SHA1 Message Date
HbmMods
296d8a1d1f
Merge pull request #3010 from TheVitya2127/gui
GUIs Fix or am I a Fucking Perfectionist
2026-07-16 09:37:09 +02:00
Boblet
cefcd7dee5 YOUR TAKING TOO LONG 2026-07-16 09:21:33 +02:00
HbmMods
348505f3d2
Merge pull request #3017 from iamnotmega/master
Add /ntmwikirender command to render screenshots of items and blocks
2026-07-16 09:19:47 +02:00
NotMega
3af3d8d39c
actually a fix for once??? no way 2026-07-16 10:07:30 +03:00
NotMega
425e317640
damn forge 2026-07-15 16:22:14 +03:00
NotMega
8b3a17b60c
glungus 2026-07-15 16:11:39 +03:00
NotMega
17ed5e4b6d
somebody said i should dip my balls in sulfuric acid 2026-07-15 15:46:57 +03:00
NotMega
f533005bd6
Merge branch 'HbmMods:master' into master 2026-07-15 15:23:28 +03:00
NotMega
981d49dffc
now were thinking with wiki 2026-07-15 10:24:45 +03:00
TheVitya2127
747c827486 Bob, Yes, Bob 2026-07-15 01:52:19 +04:00
TheVitya2127
f11c95e444
Merge branch 'HbmMods:master' into gui 2026-07-15 01:50:35 +04:00
TheVitya2127
33a416a011 Its a FUCKING HELL for Perfectionists 2026-07-14 01:00:13 +04:00
20 changed files with 104 additions and 12 deletions

View File

@ -0,0 +1,90 @@
package com.hbm.commands;
import java.util.ArrayList;
import java.util.Locale;
import java.util.List;
import java.util.Arrays;
import com.hbm.inventory.gui.GUIScreenWikiRender;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemDepletedFuel;
import com.hbm.items.machine.ItemFluidDuct;
import com.hbm.items.machine.ItemRBMKPellet;
import com.hbm.main.MainRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.FMLLaunchHandler;
import cpw.mods.fml.relauncher.Side;
import net.minecraft.command.WrongUsageException;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.client.ClientCommandHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.command.CommandBase;
import net.minecraft.item.Item;
import net.minecraft.init.Items;
import net.minecraft.init.Blocks;
// horribly written command so you can render more than fucking guns without having to decompile the JAR
public class CommandWikiRender extends CommandBase {
public static void register() {
if(FMLLaunchHandler.side() != Side.CLIENT) return;
ClientCommandHandler.instance.registerCommand(new CommandWikiRender());
}
@Override
public String getCommandName() {
return "ntmwikirender";
}
@Override
public String getCommandUsage(ICommandSender sender) {
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,
getCommandName(), EnumChatFormatting.LIGHT_PURPLE);
}
@Override
public void processCommand(ICommandSender sender, String[] args) {
if(!(sender instanceof EntityPlayer)) {
throw new PlayerNotFoundException();
}
if(args.length == 0) {
throw new WrongUsageException(getCommandUsage(sender), new Object[0]);
}
MainRegistry.logger.info("Taking a screenshot of " + args[0]);
List<Item> ignoredItems = Arrays.asList(ModItems.achievement_icon, Items.spawn_egg, Item.getItemFromBlock(Blocks.mob_spawner));
List<Class<? extends Item>> collapsedClasses = Arrays.asList(ItemRBMKPellet.class, ItemDepletedFuel.class, ItemFluidDuct.class);
String prefix = args[0];
int slotScale = 16;
boolean ignoreNonNTM = true;
List<ItemStack> stacks = new ArrayList<ItemStack>();
for(Object reg : Item.itemRegistry) {
Item item = (Item) reg;
if(ignoreNonNTM && !Item.itemRegistry.getNameForObject(item).startsWith("hbm:"))
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())) {
stacks.add(new ItemStack(item));
} else {
item.getSubItems(item, null, stacks);
}
}
Minecraft.getMinecraft().thePlayer.closeScreen();
FMLCommonHandler.instance().showGuiScreen(new GUIScreenWikiRender(stacks.toArray(new ItemStack[0]), prefix, "wiki-block-renders-256", slotScale));
}
}

View File

@ -44,7 +44,7 @@ public class GUICrystallizer extends GuiInfoContainer {
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.acidomatic.hasCustomInventoryName() ? this.acidomatic.getInventoryName() : I18n.format(this.acidomatic.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(name, 70 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}

View File

@ -47,7 +47,7 @@ public class GUIMachineCyclotron extends GuiInfoContainer {
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.cyclotron.hasCustomInventoryName() ? this.cyclotron.getInventoryName() : I18n.format(this.cyclotron.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(name, 79 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 15, this.ySize - 96 + 2, 4210752);
}

View File

@ -12,7 +12,7 @@ import net.minecraft.util.ResourceLocation;
public class GUIMachineEPress extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_epress.png");
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_electric_press.png");
private TileEntityMachineEPress press;
public GUIMachineEPress(InventoryPlayer invPlayer, TileEntityMachineEPress tedf) {
@ -34,7 +34,7 @@ public class GUIMachineEPress extends GuiInfoContainer {
protected void drawGuiContainerForegroundLayer( int i, int j) {
String name = this.press.hasCustomInventoryName() ? this.press.getInventoryName() : I18n.format(this.press.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(name, 89 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}

View File

@ -15,7 +15,7 @@ import com.hbm.util.i18n.I18nUtil;
public class GUIMachineElectricFurnace extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/GUIElectricFurnace.png");
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_electric_furnace.png");
private TileEntityMachineElectricFurnace furnace;
public GUIMachineElectricFurnace(InventoryPlayer invPlayer, TileEntityMachineElectricFurnace furnace) {
@ -43,7 +43,7 @@ public class GUIMachineElectricFurnace extends GuiInfoContainer {
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.furnace.hasCustomInventoryName() ? this.furnace.getInventoryName() : I18n.format(this.furnace.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(name, 70 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
@ -74,7 +74,7 @@ public class GUIMachineElectricFurnace extends GuiInfoContainer {
int p = furnace.getProgressScaled(28);
drawTexturedModalRect(guiLeft + 43, guiTop + 36, 176, 0, p, 12);
this.drawInfoPanel(guiLeft + 116, guiTop + 20, 8, 8, 8);
this.drawInfoPanel(guiLeft + 115, guiTop + 19, 8, 8, 8);
}
}

View File

@ -14,7 +14,7 @@ import net.minecraft.util.ResourceLocation;
public class GUIMachinePress extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_press.png");
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_press.png");
private TileEntityMachinePress press;
public GUIMachinePress(InventoryPlayer invPlayer, TileEntityMachinePress tedf) {
@ -48,7 +48,7 @@ public class GUIMachinePress extends GuiInfoContainer {
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(press.burnTime >= 20) {
this.drawTexturedModalRect(guiLeft + 27, guiTop + 36, 0, 214, 14, 14);
this.drawTexturedModalRect(guiLeft + 26, guiTop + 36, 0, 214, 14, 14);
}
int k = (int) (press.renderPress * 16 / press.maxPress);

View File

@ -52,7 +52,7 @@ public class GUIMachineRTG extends GuiInfoContainer {
protected void drawGuiContainerForegroundLayer( int i, int j) {
String name = this.rtg.hasCustomInventoryName() ? this.rtg.getInventoryName() : I18n.format(this.rtg.getInventoryName());
this.fontRendererObj.drawString(name, 13 ,7, 10925486);
this.fontRendererObj.drawString(name, 60 - this.fontRendererObj.getStringWidth(name) / 2, 7, 10925486);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}

View File

@ -13,7 +13,7 @@ import net.minecraft.util.ResourceLocation;
public class GUIMachineShredder extends GuiInfoContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_shredder.png");
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_shredder.png");
private TileEntityMachineShredder diFurnace;
public GUIMachineShredder(InventoryPlayer invPlayer, TileEntityMachineShredder tedf) {
@ -45,7 +45,7 @@ public class GUIMachineShredder extends GuiInfoContainer {
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(name, 106 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}

View File

@ -606,6 +606,7 @@ public class MainRegistry {
Compat.handleRailcraftNonsense();
SuicideThreadDump.register();
CommandReloadClient.register();
CommandWikiRender.register();
//ExplosionTests.runTest();
}
@ -667,6 +668,7 @@ public class MainRegistry {
event.registerServerCommand(new CommandReloadServer());
event.registerServerCommand(new CommandLocate());
event.registerServerCommand(new CommandCustomize());
event.registerServerCommand(new CommandWikiRender()); // TODO: make this shitfuck be clientside
event.registerServerCommand(new CommandReapNetworks());
ArcFurnaceRecipes.registerFurnaceSmeltables(); // because we have to wait for other mods to take their merry ass time to register recipes
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 24 KiB