ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/util/AssetUtil.java

22 lines
1.1 KiB
Java
Raw Normal View History

2015-03-29 15:29:05 +02:00
package ellpeck.actuallyadditions.util;
2015-04-19 01:50:02 +02:00
import net.minecraft.client.gui.FontRenderer;
2015-03-29 15:29:05 +02:00
import net.minecraft.util.ResourceLocation;
2015-04-19 01:50:02 +02:00
import net.minecraft.util.StatCollector;
2015-03-29 15:29:05 +02:00
public class AssetUtil{
public static final ResourceLocation GUI_INVENTORY_LOCATION = getGuiLocation("guiInventory");
public static ResourceLocation getGuiLocation(String file){
return new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/gui/" + file + ".png");
}
2015-04-19 01:50:02 +02:00
public static void displayNameAndInventoryString(FontRenderer font, int xSize, int yPositionOfInventoryText, int yPositionOfMachineText, String machineName){
String localMachineName = StatCollector.translateToLocal(machineName + ".name");
String inventoryName = StatCollector.translateToLocal("container.inventory");
font.drawString(localMachineName, xSize/2 - font.getStringWidth(localMachineName)/2, yPositionOfMachineText, StringUtil.DECIMAL_COLOR_WHITE);
font.drawString(inventoryName, xSize/2 - font.getStringWidth(inventoryName)/2, yPositionOfInventoryText-1, StringUtil.DECIMAL_COLOR_GRAY_TEXT);
}
2015-03-29 15:29:05 +02:00
}