Compare commits

...

3 commits

Author SHA1 Message Date
Flanks255
768b677e41 even moar refactoring. 2022-06-05 16:02:36 -05:00
Flanks255
35bf265618 moar refactoring. 2022-06-05 15:36:27 -05:00
Flanks255
123b5b1810 some cleaning, refactoring, and starting work on the coffee machine. 2022-06-05 15:30:25 -05:00
37 changed files with 79 additions and 161 deletions

View file

@ -1,7 +1,6 @@
package de.ellpeck.actuallyadditions.mod; package de.ellpeck.actuallyadditions.mod;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.fml.RegistryObject;

View file

@ -122,7 +122,7 @@ public class BlockAtomicReconstructor extends FullyDirectionalBlock.Container im
AssetUtil.renderStackToGui(slot, resolution.getGuiScaledWidth() / 2 + 15, resolution.getGuiScaledHeight() / 2 - 19, 1F); AssetUtil.renderStackToGui(slot, resolution.getGuiScaledWidth() / 2 + 15, resolution.getGuiScaledHeight() / 2 - 19, 1F);
} }
minecraft.font.drawShadow(matrices, strg.plainCopy().withStyle(TextFormatting.YELLOW).withStyle(TextFormatting.ITALIC).getString(), resolution.getGuiScaledWidth() / 2 + 35, resolution.getGuiScaledHeight() / 2f - 15, StringUtil.DECIMAL_COLOR_WHITE); minecraft.font.drawShadow(matrices, strg.plainCopy().withStyle(TextFormatting.YELLOW).withStyle(TextFormatting.ITALIC).getString(), resolution.getGuiScaledWidth() / 2 + 35, resolution.getGuiScaledHeight() / 2f - 15, 0xFFFFFF);
} }
} }

View file

@ -47,9 +47,14 @@ public class BlockCoffeeMachine extends DirectionalBlock.Container {
return super.use(state, world, pos, player, hand, hit); return super.use(state, world, pos, player, hand, hit);
} }
@Override
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable @Nullable
//@Override @Override
public TileEntity newBlockEntity(IBlockReader worldIn) { public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new TileEntityCoffeeMachine(); return new TileEntityCoffeeMachine();
} }

View file

@ -182,7 +182,7 @@ public class BlockLaserRelay extends FullyDirectionalBlock.Container implements
TileEntityLaserRelay relay = (TileEntityLaserRelay) tile; TileEntityLaserRelay relay = (TileEntityLaserRelay) tile;
String strg = relay.getExtraDisplayString(); String strg = relay.getExtraDisplayString();
minecraft.font.drawShadow(matrices, strg, resolution.getGuiScaledWidth() / 2f + 5, resolution.getGuiScaledHeight() / 2f + 5, StringUtil.DECIMAL_COLOR_WHITE); minecraft.font.drawShadow(matrices, strg, resolution.getGuiScaledWidth() / 2f + 5, resolution.getGuiScaledHeight() / 2f + 5, 0xFFFFFF);
String expl; String expl;
if (compass) { if (compass) {
@ -191,7 +191,7 @@ public class BlockLaserRelay extends FullyDirectionalBlock.Container implements
expl = TextFormatting.GRAY.toString() + TextFormatting.ITALIC + StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".laserRelay.mode.noCompasss", StringUtil.localize(CommonConfig.Other.relayConfigureItem.getDescriptionId() + ".name")); expl = TextFormatting.GRAY.toString() + TextFormatting.ITALIC + StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".laserRelay.mode.noCompasss", StringUtil.localize(CommonConfig.Other.relayConfigureItem.getDescriptionId() + ".name"));
} }
StringUtil.drawSplitString(minecraft.font, expl, resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 15, Integer.MAX_VALUE, StringUtil.DECIMAL_COLOR_WHITE, true); StringUtil.drawSplitString(minecraft.font, expl, resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 15, Integer.MAX_VALUE, 0xFFFFFF, true);
} }
} }
} }

View file

@ -26,6 +26,7 @@ import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
@ -53,9 +54,9 @@ public class BlockLavaFactoryController extends DirectionalBlock.Container imple
if (factory != null) { if (factory != null) {
int state = factory.isMultiblock(); int state = factory.isMultiblock();
if (state == TileEntityLavaFactoryController.NOT_MULTI) { if (state == TileEntityLavaFactoryController.NOT_MULTI) {
StringUtil.drawSplitString(minecraft.font, StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".factory.notPart.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 5, 200, StringUtil.DECIMAL_COLOR_WHITE, true); StringUtil.drawSplitString(minecraft.font, StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".factory.notPart.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 5, 200, 0xFFFFFF, true);
} else if (state == TileEntityLavaFactoryController.HAS_AIR || state == TileEntityLavaFactoryController.HAS_LAVA) { } else if (state == TileEntityLavaFactoryController.HAS_AIR || state == TileEntityLavaFactoryController.HAS_LAVA) {
StringUtil.drawSplitString(minecraft.font, StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".factory.works.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 5, 200, StringUtil.DECIMAL_COLOR_WHITE, true); StringUtil.drawSplitString(minecraft.font, StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".factory.works.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 5, 200, 0xFFFFFF, true);
} }
} }
} }

View file

@ -127,22 +127,22 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
if (tile != null) { if (tile != null) {
if (tile instanceof IPhantomTile) { if (tile instanceof IPhantomTile) {
IPhantomTile phantom = (IPhantomTile) tile; IPhantomTile phantom = (IPhantomTile) tile;
minecraft.font.drawShadow(matrices, TextFormatting.GOLD + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".blockPhantomRange.desc") + ": " + phantom.getRange(), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 40, StringUtil.DECIMAL_COLOR_WHITE); minecraft.font.drawShadow(matrices, TextFormatting.GOLD + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".blockPhantomRange.desc") + ": " + phantom.getRange(), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 40, TextFormatting.WHITE.getColor());
if (phantom.hasBoundPosition()) { if (phantom.hasBoundPosition()) {
int distance = MathHelper.ceil(new Vector3d(pos.getX(), pos.getY(), pos.getZ()).distanceTo(new Vector3d(phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ()))); int distance = MathHelper.ceil(new Vector3d(pos.getX(), pos.getY(), pos.getZ()).distanceTo(new Vector3d(phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ())));
BlockState state = minecraft.level.getBlockState(phantom.getBoundPosition()); BlockState state = minecraft.level.getBlockState(phantom.getBoundPosition());
Block block = state.getBlock(); Block block = state.getBlock();
Item item = Item.byBlock(block); Item item = Item.byBlock(block);
String name = item.getName(new ItemStack(block)).getString(); String name = item.getName(new ItemStack(block)).getString();
StringUtil.drawSplitString(minecraft.font, StringUtil.localizeFormatted("tooltip." + ActuallyAdditions.MODID + ".phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 30, 200, StringUtil.DECIMAL_COLOR_WHITE, true); StringUtil.drawSplitString(minecraft.font, StringUtil.localizeFormatted("tooltip." + ActuallyAdditions.MODID + ".phantom.blockInfo.desc", name, phantom.getBoundPosition().getX(), phantom.getBoundPosition().getY(), phantom.getBoundPosition().getZ(), distance), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 - 30, 200, 0xFFFFFF, true);
if (phantom.isBoundThingInRange()) { if (phantom.isBoundThingInRange()) {
StringUtil.drawSplitString(minecraft.font, TextFormatting.DARK_GREEN + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".phantom.connectedRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, StringUtil.DECIMAL_COLOR_WHITE, true); StringUtil.drawSplitString(minecraft.font, TextFormatting.DARK_GREEN + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".phantom.connectedRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
} else { } else {
StringUtil.drawSplitString(minecraft.font, TextFormatting.DARK_RED + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".phantom.connectedNoRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, StringUtil.DECIMAL_COLOR_WHITE, true); StringUtil.drawSplitString(minecraft.font, TextFormatting.DARK_RED + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".phantom.connectedNoRange.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, 200, 0xFFFFFF, true);
} }
} else { } else {
minecraft.font.drawShadow(matrices, TextFormatting.RED + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".phantom.notConnected.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, StringUtil.DECIMAL_COLOR_WHITE); minecraft.font.drawShadow(matrices, TextFormatting.RED + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".phantom.notConnected.desc"), resolution.getGuiScaledWidth() / 2 + 5, resolution.getGuiScaledHeight() / 2 + 25, TextFormatting.WHITE.getColor());
} }
} }
} }

View file

@ -73,8 +73,8 @@ public class BlockPlayerInterface extends BlockContainerBase implements IHudDisp
String name = face.playerName == null String name = face.playerName == null
? "Unknown" ? "Unknown"
: face.playerName; : face.playerName;
minecraft.font.drawShadow(matrices, "Bound to: " + TextFormatting.RED + name, resolution.getGuiScaledWidth() / 2f + 5, resolution.getGuiScaledHeight() / 2f + 5, StringUtil.DECIMAL_COLOR_WHITE); minecraft.font.drawShadow(matrices, "Bound to: " + TextFormatting.RED + name, resolution.getGuiScaledWidth() / 2f + 5, resolution.getGuiScaledHeight() / 2f + 5, 0xFFFFFF);
minecraft.font.drawShadow(matrices, "UUID: " + TextFormatting.DARK_GREEN + face.connectedPlayer, resolution.getGuiScaledWidth() / 2f + 5, resolution.getGuiScaledHeight() / 2f + 15, StringUtil.DECIMAL_COLOR_WHITE); minecraft.font.drawShadow(matrices, "UUID: " + TextFormatting.DARK_GREEN + face.connectedPlayer, resolution.getGuiScaledWidth() / 2f + 5, resolution.getGuiScaledHeight() / 2f + 15, 0xFFFFFF);
} }
} }
} }

View file

@ -27,6 +27,7 @@ import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockReader; import net.minecraft.world.IBlockReader;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
@ -63,7 +64,7 @@ public class BlockVerticalDigger extends DirectionalBlock.Container implements I
: miner.checkY == -1 : miner.checkY == -1
? "Calculating positions..." ? "Calculating positions..."
: "Mining at " + (miner.getBlockPos().getX() + miner.checkX) + ", " + miner.checkY + ", " + (miner.getBlockPos().getZ() + miner.checkZ) + "."; : "Mining at " + (miner.getBlockPos().getX() + miner.checkX) + ", " + miner.checkY + ", " + (miner.getBlockPos().getZ() + miner.checkZ) + ".";
minecraft.font.drawShadow(matrices, info, resolution.getGuiScaledWidth() / 2f + 5, resolution.getGuiScaledHeight() / 2f - 20, StringUtil.DECIMAL_COLOR_WHITE); minecraft.font.drawShadow(matrices, info, resolution.getGuiScaledWidth() / 2f + 5, resolution.getGuiScaledHeight() / 2f - 20, 0xFFFFFF);
} }
} }

View file

@ -194,7 +194,7 @@ public class ClientEvents {
String strg = String.format("%s: %s", StringUtil.localize("info." + ActuallyAdditions.MODID + ".redstoneMode"), TextFormatting.DARK_RED + StringUtil.localize("info." + ActuallyAdditions.MODID + ".redstoneMode." + (base.isPulseMode String strg = String.format("%s: %s", StringUtil.localize("info." + ActuallyAdditions.MODID + ".redstoneMode"), TextFormatting.DARK_RED + StringUtil.localize("info." + ActuallyAdditions.MODID + ".redstoneMode." + (base.isPulseMode
? "pulse" ? "pulse"
: "deactivation")) + TextFormatting.RESET); : "deactivation")) + TextFormatting.RESET);
font.drawShadow(event.getMatrixStack(), strg, event.getWindow().getGuiScaledWidth() / 2f + 5, event.getWindow().getGuiScaledHeight() / 2f + 5, StringUtil.DECIMAL_COLOR_WHITE); font.drawShadow(event.getMatrixStack(), strg, event.getWindow().getGuiScaledWidth() / 2f + 5, event.getWindow().getGuiScaledHeight() / 2f + 5, 0xFFFFFF);
String expl; String expl;
if (StackUtil.isValid(stack) && stack.getItem() == CommonConfig.Other.redstoneConfigureItem.asItem()) { if (StackUtil.isValid(stack) && stack.getItem() == CommonConfig.Other.redstoneConfigureItem.asItem()) {
@ -202,7 +202,7 @@ public class ClientEvents {
} else { } else {
expl = TextFormatting.GRAY.toString() + TextFormatting.ITALIC + StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".redstoneMode.invalidItem", StringUtil.localize(CommonConfig.Other.redstoneConfigureItem.asItem().getDescriptionId())); expl = TextFormatting.GRAY.toString() + TextFormatting.ITALIC + StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".redstoneMode.invalidItem", StringUtil.localize(CommonConfig.Other.redstoneConfigureItem.asItem().getDescriptionId()));
} }
font.drawShadow(event.getMatrixStack(), expl, event.getWindow().getGuiScaledWidth() / 2f + 5, event.getWindow().getGuiScaledHeight() / 2f + 15, StringUtil.DECIMAL_COLOR_WHITE); font.drawShadow(event.getMatrixStack(), expl, event.getWindow().getGuiScaledWidth() / 2f + 5, event.getWindow().getGuiScaledHeight() / 2f + 15, 0xFFFFFF);
} }
} }

View file

@ -36,4 +36,12 @@ public abstract class AAScreen<T extends Container> extends ContainerScreen<T> {
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) { public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
font.draw(matrices, this.title, titleLabelX, titleLabelY, 0xFFFFFF); font.draw(matrices, this.title, titleLabelX, titleLabelY, 0xFFFFFF);
} }
@Override
protected void init() {
super.init();
titleLabelX = (int) (imageWidth / 2.0f - font.width(title) / 2.0f);
titleLabelY = -10;
}
} }

View file

@ -116,7 +116,7 @@ public class FluidDisplay extends AbstractGui {
} }
if (this.drawTextNextTo) { if (this.drawTextNextTo) {
mc.font.draw(matrices, new StringTextComponent(this.getOverlayText()), barX + 25, barY + 78, StringUtil.DECIMAL_COLOR_WHITE); mc.font.draw(matrices, new StringTextComponent(this.getOverlayText()), barX + 25, barY + 78, 0xFFFFFF);
} }
} }

View file

@ -47,11 +47,6 @@ public class GuiBioReactor extends AAScreen<ContainerBioReactor> {
//this.energy.render(mouseX, mouseY); //this.energy.render(mouseX, mouseY);
} }
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.tile);
}
@Override @Override
public void renderBg(MatrixStack matrices, float partialTicks, int x, int y) { public void renderBg(MatrixStack matrices, float partialTicks, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -40,8 +40,6 @@ public class GuiBreaker extends AAScreen<ContainerBreaker> {
@Override @Override
public void init(Minecraft pMinecraft, int pWidth, int pHeight) { public void init(Minecraft pMinecraft, int pWidth, int pHeight) {
super.init(pMinecraft, pWidth, pHeight); super.init(pMinecraft, pWidth, pHeight);
titleLabelX = (int) (imageWidth / 2.0f - font.width(title) / 2.0f);
titleLabelY = -10;
} }
@Override @Override

View file

@ -43,9 +43,6 @@ public class GuiCanolaPress extends AAScreen<ContainerCanolaPress> {
super.init(); super.init();
this.energy = new EnergyDisplay(this.leftPos + 42, this.topPos + 5, this.press.storage); this.energy = new EnergyDisplay(this.leftPos + 42, this.topPos + 5, this.press.storage);
this.fluid = new FluidDisplay(this.leftPos + 116, this.topPos + 5, this.press.tank); this.fluid = new FluidDisplay(this.leftPos + 116, this.topPos + 5, this.press.tank);
titleLabelX = (int) (imageWidth / 2.0f - font.width(title) / 2.0f);
titleLabelY = -10;
} }
@Override @Override

View file

@ -43,8 +43,6 @@ public class GuiCoalGenerator extends AAScreen<ContainerCoalGenerator> {
public void init() { public void init() {
super.init(); super.init();
this.energy = new EnergyDisplay(this.leftPos + 42, this.topPos + 5, this.generator.storage); this.energy = new EnergyDisplay(this.leftPos + 42, this.topPos + 5, this.generator.storage);
titleLabelX = (int) (imageWidth / 2.0f - font.width(title) / 2.0f);
titleLabelY = -10;
} }
@Override @Override

View file

@ -14,16 +14,24 @@ import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.systems.RenderSystem;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoffeeMachine; import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoffeeMachine;
import de.ellpeck.actuallyadditions.mod.network.PacketHandlerHelper;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.*;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory; import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.gui.GuiUtils;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Collections;
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public class GuiCoffeeMachine extends AAScreen<ContainerCoffeeMachine> { public class GuiCoffeeMachine extends AAScreen<ContainerCoffeeMachine> {
@ -45,20 +53,22 @@ public class GuiCoffeeMachine extends AAScreen<ContainerCoffeeMachine> {
public void init() { public void init() {
super.init(); super.init();
// Button buttonOkay = new Button(this.leftPos + 60, this.topPos + 11, 58, 20, StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.ok")); this.addButton(new Button(this.leftPos + 60, this.topPos + 11, 58, 20, new TranslationTextComponent("info.actuallyadditions.gui.ok"),
// this.addButton(buttonOkay); (b) -> PacketHandlerHelper.sendButtonPacket(this.machine, 0)));
//
// this.energy = new EnergyDisplay(this.leftPos + 16, this.topPos + 5, this.machine.storage); this.energy = new EnergyDisplay(this.leftPos + 16, this.topPos + 5, this.machine.storage);
// this.fluid = new FluidDisplay(this.leftPos - 30, this.topPos + 1, this.machine.tank, true, false); this.fluid = new FluidDisplay(this.leftPos - 30, this.topPos + 1, this.machine.tank, true, false);
} }
@Override @Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) { public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f); super.render(matrices, x, y, f);
Minecraft mc = Minecraft.getInstance();
String text2 = this.machine.coffeeCacheAmount + "/" + TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT + " " + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.coffee"); TextComponent text = new TranslationTextComponent("info.actuallyadditions.gui.coffee_amount", this.machine.coffeeCacheAmount, TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT);
if (x >= this.leftPos + 40 && y >= this.topPos + 25 && x <= this.leftPos + 49 && y <= this.topPos + 56) { if (x >= this.leftPos + 40 && y >= this.topPos + 25 && x <= this.leftPos + 49 && y <= this.topPos + 56) {
//this.drawHoveringText(Collections.singletonList(text2), x, y); GuiUtils.drawHoveringText(matrices, Collections.singletonList(text), x, y, mc.getWindow().getWidth(), mc.getWindow().getWidth(), -1, font);
} }
this.energy.render(matrices, x, y); this.energy.render(matrices, x, y);
@ -66,12 +76,7 @@ public class GuiCoffeeMachine extends AAScreen<ContainerCoffeeMachine> {
} }
@Override @Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) { public void renderBg(@Nonnull MatrixStack matrices, float f, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.machine);
}
@Override
public void renderBg(MatrixStack matrices, float f, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.getMinecraft().getTextureManager().bind(AssetUtil.GUI_INVENTORY_LOCATION); this.getMinecraft().getTextureManager().bind(AssetUtil.GUI_INVENTORY_LOCATION);
@ -96,9 +101,4 @@ public class GuiCoffeeMachine extends AAScreen<ContainerCoffeeMachine> {
this.energy.draw(matrices); this.energy.draw(matrices);
this.fluid.draw(matrices); this.fluid.draw(matrices);
} }
// @Override
// public void actionPerformed(Button button) {
// PacketHandlerHelper.sendButtonPacket(this.machine, button.id);
// }
} }

View file

@ -46,15 +46,9 @@ public class GuiDirectionalBreaker extends AAScreen<ContainerDirectionalBreaker>
@Override @Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) { public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f); super.render(matrices, x, y, f);
this.energy.render(matrices, x, y); this.energy.render(matrices, x, y);
} }
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.breaker);
}
@Override @Override
public void renderBg(MatrixStack matrices, float f, int x, int y) { public void renderBg(MatrixStack matrices, float f, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -49,11 +49,6 @@ public class GuiEnergizer extends AAScreen<ContainerEnergizer> {
this.energy.render(matrices, x, y); this.energy.render(matrices, x, y);
} }
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.energizer);
}
@Override @Override
public void renderBg(MatrixStack matrices, float f, int x, int y) { public void renderBg(MatrixStack matrices, float f, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -50,11 +50,6 @@ public class GuiEnervator extends AAScreen<ContainerEnervator> {
this.energy.render(matrices, x, y); this.energy.render(matrices, x, y);
} }
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.enervator);
}
@Override @Override
public void renderBg(MatrixStack matrices, float f, int x, int y) { public void renderBg(MatrixStack matrices, float f, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -44,9 +44,6 @@ public class GuiFarmer extends AAScreen<ContainerFarmer> {
super.init(); super.init();
this.energy = new EnergyDisplay(this.leftPos + 33, this.topPos + 6, this.farmer.storage); this.energy = new EnergyDisplay(this.leftPos + 33, this.topPos + 6, this.farmer.storage);
titleLabelX = (int) (imageWidth / 2.0f - font.width(title) / 2.0f);
titleLabelY = -10;
} }
@Override @Override

View file

@ -51,11 +51,6 @@ public class GuiFeeder extends AAScreen<ContainerFeeder> {
} }
} }
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.tileFeeder);
}
@Override @Override
public void renderBg(MatrixStack matrices, float f, int x, int y) { public void renderBg(MatrixStack matrices, float f, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -51,9 +51,6 @@ public class GuiFermentingBarrel extends AAScreen<ContainerFermentingBarrel> {
super.init(); super.init();
this.input = new FluidDisplay(this.leftPos + 60, this.topPos + 5, this.press.tanks.inputTank); this.input = new FluidDisplay(this.leftPos + 60, this.topPos + 5, this.press.tanks.inputTank);
this.output = new FluidDisplay(this.leftPos + 98, this.topPos + 5, this.press.tanks.outputTank); this.output = new FluidDisplay(this.leftPos + 98, this.topPos + 5, this.press.tanks.outputTank);
titleLabelX = (int) (imageWidth / 2.0f - font.width(title) / 2.0f);
titleLabelY = -10;
} }
@Override @Override

View file

@ -49,8 +49,6 @@ public class GuiFluidCollector extends AAScreen<ContainerFluidCollector> {
public void init() { public void init() {
super.init(); super.init();
this.fluid = new FluidDisplay(this.leftPos + 67, this.topPos + 5, this.collector.tank); this.fluid = new FluidDisplay(this.leftPos + 67, this.topPos + 5, this.collector.tank);
titleLabelX = (int) (imageWidth / 2.0f - font.width(title) / 2.0f);
titleLabelY = -10;
} }
@Override @Override

View file

@ -65,8 +65,6 @@ public class GuiFurnaceDouble extends AAScreen<ContainerFurnaceDouble> {
public void init() { public void init() {
super.init(); super.init();
this.energy = new EnergyDisplay(this.leftPos + 27, this.topPos + 5, this.tileFurnace.storage); this.energy = new EnergyDisplay(this.leftPos + 27, this.topPos + 5, this.tileFurnace.storage);
titleLabelX = (int) (imageWidth / 2.0f - font.width(title) / 2.0f);
titleLabelY = -10;
this.buttonAutoSplit = new Buttons.SmallerButton(this.leftPos, this.topPos, new StringTextComponent("S"), (button) -> PacketHandlerHelper.sendButtonPacket(this.tileFurnace, 0)); this.buttonAutoSplit = new Buttons.SmallerButton(this.leftPos, this.topPos, new StringTextComponent("S"), (button) -> PacketHandlerHelper.sendButtonPacket(this.tileFurnace, 0));
buttonAutoSplit.setFGColor(this.tileFurnace.isAutoSplit ? TextFormatting.DARK_GREEN.getColor() : TextFormatting.RED.getColor()); buttonAutoSplit.setFGColor(this.tileFurnace.isAutoSplit ? TextFormatting.DARK_GREEN.getColor() : TextFormatting.RED.getColor());
this.addButton(this.buttonAutoSplit); this.addButton(this.buttonAutoSplit);

View file

@ -92,8 +92,8 @@ public class GuiLaserRelayItemWhitelist extends AAScreen<ContainerLaserRelayItem
String s1 = StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.inbound"); String s1 = StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.inbound");
String s2 = StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.outbound"); String s2 = StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.outbound");
this.font.draw(matrices, s1, 46 - this.font.width(s1) / 2, 80, StringUtil.DECIMAL_COLOR_GRAY_TEXT); this.font.draw(matrices, s1, 46 - this.font.width(s1) / 2, 80, 0x404040);
this.font.draw(matrices, s2, 131 - this.font.width(s2) / 2, 80, StringUtil.DECIMAL_COLOR_GRAY_TEXT); this.font.draw(matrices, s2, 131 - this.font.width(s2) / 2, 80, 0x404040);
} }
@Override @Override

View file

@ -50,12 +50,6 @@ public class GuiMiner extends AAScreen<ContainerMiner> {
// }); // });
// this.addButton(buttonReset); // this.addButton(buttonReset);
} }
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.miner);
}
@Override @Override
public void renderBg(MatrixStack matrices, float f, int x, int y) { public void renderBg(MatrixStack matrices, float f, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@ -69,7 +63,7 @@ public class GuiMiner extends AAScreen<ContainerMiner> {
String mining = this.miner.onlyMineOres String mining = this.miner.onlyMineOres
? "Only Mining Ores" ? "Only Mining Ores"
: "Mining Everything"; : "Mining Everything";
this.font.draw(matrices, mining, this.leftPos + this.imageWidth / 2 - this.font.width(mining) / 2, this.topPos + 8, StringUtil.DECIMAL_COLOR_GRAY_TEXT); this.font.draw(matrices, mining, this.leftPos + this.imageWidth / 2 - this.font.width(mining) / 2, this.topPos + 8, 0x404040);
} }
// @Override // @Override

View file

@ -47,8 +47,6 @@ public class GuiOilGenerator extends AAScreen<ContainerOilGenerator> {
super.init(); super.init();
this.energy = new EnergyDisplay(this.leftPos + 42, this.topPos + 5, this.generator.storage); this.energy = new EnergyDisplay(this.leftPos + 42, this.topPos + 5, this.generator.storage);
this.fluid = new FluidDisplay(this.leftPos + 116, this.topPos + 5, this.generator.tank); this.fluid = new FluidDisplay(this.leftPos + 116, this.topPos + 5, this.generator.tank);
titleLabelX = (int) (imageWidth / 2.0f - font.width(title) / 2.0f);
titleLabelY = -10;
} }
@Override @Override

View file

@ -78,12 +78,6 @@ public class GuiPhantomPlacer extends AAScreen<ContainerPhantomPlacer> {
// private String getSide() { // private String getSide() {
// return GuiInputter.SIDES[this.placer.side + 1]; // return GuiInputter.SIDES[this.placer.side + 1];
// } // }
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.placer);
}
@Override @Override
public void renderBg(MatrixStack matrices, float f, int x, int y) { public void renderBg(MatrixStack matrices, float f, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -60,11 +60,6 @@ public class GuiRangedCollector extends AAScreen<ContainerRangedCollector> {
this.filter.tick(); this.filter.tick();
} }
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.collector);
}
@Override @Override
public void renderBg(MatrixStack matrices, float f, int x, int y) { public void renderBg(MatrixStack matrices, float f, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);

View file

@ -72,11 +72,6 @@ public class GuiXPSolidifier extends AAScreen<ContainerXPSolidifier> {
// this.addButton(buttonAll); // this.addButton(buttonAll);
} }
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.solidifier);
}
@Override @Override
public void renderBg(MatrixStack matrices, float f, int x, int y) { public void renderBg(MatrixStack matrices, float f, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@ -87,7 +82,7 @@ public class GuiXPSolidifier extends AAScreen<ContainerXPSolidifier> {
this.getMinecraft().getTextureManager().bind(RES_LOC); this.getMinecraft().getTextureManager().bind(RES_LOC);
this.blit(matrices, this.leftPos, this.topPos, 0, 0, 176, 93); this.blit(matrices, this.leftPos, this.topPos, 0, 0, 176, 93);
drawCenteredString(matrices, this.font, Integer.toString(this.solidifier.amount), this.leftPos + 88, this.topPos + 30, StringUtil.DECIMAL_COLOR_WHITE); drawCenteredString(matrices, this.font, Integer.toString(this.solidifier.amount), this.leftPos + 88, this.topPos + 30, 0xFFFFFF);
} }
// @Override // @Override

View file

@ -10,7 +10,6 @@
package de.ellpeck.actuallyadditions.mod.items.metalists; package de.ellpeck.actuallyadditions.mod.items.metalists;
import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.item.Rarity; import net.minecraft.item.Rarity;
@Deprecated @Deprecated
@ -21,7 +20,7 @@ public enum TheDusts {
DIAMOND("diamond", 292003, Rarity.RARE), DIAMOND("diamond", 292003, Rarity.RARE),
EMERALD("emerald", 4319527, Rarity.EPIC), EMERALD("emerald", 4319527, Rarity.EPIC),
LAPIS("lapis", 1849791, Rarity.UNCOMMON), LAPIS("lapis", 1849791, Rarity.UNCOMMON),
QUARTZ("quartz", StringUtil.DECIMAL_COLOR_WHITE, Rarity.UNCOMMON), QUARTZ("quartz", 0xFFFFFF, Rarity.UNCOMMON),
COAL("coal", 0, Rarity.UNCOMMON), COAL("coal", 0, Rarity.UNCOMMON),
QUARTZ_BLACK("quartz_black", 18, Rarity.RARE); QUARTZ_BLACK("quartz_black", 18, Rarity.RARE);

View file

@ -158,6 +158,7 @@ public abstract class TileEntityBase extends TileEntity implements ITickableTile
// return !oldState.getBlock().isAssociatedBlock(newState.getBlock()); // return !oldState.getBlock().isAssociatedBlock(newState.getBlock());
// } // }
@Deprecated
public String getNameForTranslation() { public String getNameForTranslation() {
return "removeme";// "container." + ActuallyAdditions.MODID + "." + this.name + ".name"; return "removeme";// "container." + ActuallyAdditions.MODID + "." + this.name + ".name";
} }

View file

@ -33,10 +33,12 @@ import net.minecraft.util.Direction;
import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundCategory;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.energy.IEnergyStorage; import net.minecraftforge.energy.IEnergyStorage;
import net.minecraftforge.fluids.FluidAttributes;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fluids.capability.templates.FluidTank; import net.minecraftforge.fluids.capability.templates.FluidTank;
@ -58,7 +60,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
public final CustomEnergyStorage storage = new CustomEnergyStorage(300000, 250, 0); public final CustomEnergyStorage storage = new CustomEnergyStorage(300000, 250, 0);
public final LazyOptional<IEnergyStorage> lazyEnergy = LazyOptional.of(() -> this.storage); public final LazyOptional<IEnergyStorage> lazyEnergy = LazyOptional.of(() -> this.storage);
public final FluidTank tank = new FluidTank(4 * Util.BUCKET) { public final FluidTank tank = new FluidTank(4 * FluidAttributes.BUCKET_VOLUME) {
@Nonnull @Nonnull
@Override @Override
public FluidStack drain(int maxDrain, FluidAction action) { public FluidStack drain(int maxDrain, FluidAction action) {
@ -242,7 +244,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
@Override @Override
public ITextComponent getDisplayName() { public ITextComponent getDisplayName() {
return StringTextComponent.EMPTY; return new TranslationTextComponent("container.actuallyadditions.coffeeMachine");
} }
@Nullable @Nullable

View file

@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.update;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
@ -45,11 +46,11 @@ public class UpdateChecker {
if (Minecraft.getInstance().player != null) { if (Minecraft.getInstance().player != null) {
PlayerEntity player = Minecraft.getInstance().player; PlayerEntity player = Minecraft.getInstance().player;
if (UpdateChecker.checkFailed) { if (UpdateChecker.checkFailed) {
player.displayClientMessage(ITextComponent.Serializer.fromJson(StringUtil.localize("info." + ActuallyAdditions.MODID + ".update.failed")), false); player.displayClientMessage(ITextComponent.Serializer.fromJson(I18n.get("info." + ActuallyAdditions.MODID + ".update.failed")), false);
} else if (UpdateChecker.needsUpdateNotify) { } else if (UpdateChecker.needsUpdateNotify) {
player.displayClientMessage(ITextComponent.Serializer.fromJson(StringUtil.localize("info." + ActuallyAdditions.MODID + ".update.generic")), false); player.displayClientMessage(ITextComponent.Serializer.fromJson(I18n.get("info." + ActuallyAdditions.MODID + ".update.generic")), false);
player.displayClientMessage(ITextComponent.Serializer.fromJson(StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".update.versionCompare", ActuallyAdditions.VERSION, UpdateChecker.updateVersionString)), false); player.displayClientMessage(ITextComponent.Serializer.fromJson(I18n.get("info." + ActuallyAdditions.MODID + ".update.versionCompare", ActuallyAdditions.VERSION, UpdateChecker.updateVersionString)), false);
player.displayClientMessage(ITextComponent.Serializer.fromJson(StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".update.buttons", UpdateChecker.CHANGELOG_LINK, UpdateChecker.DOWNLOAD_LINK)), false); player.displayClientMessage(ITextComponent.Serializer.fromJson(I18n.get("info." + ActuallyAdditions.MODID + ".update.buttons", UpdateChecker.CHANGELOG_LINK, UpdateChecker.DOWNLOAD_LINK)), false);
} }
if (threadFinished) { if (threadFinished) {
MinecraftForge.EVENT_BUS.unregister(this); MinecraftForge.EVENT_BUS.unregister(this);

View file

@ -62,7 +62,7 @@ public final class AssetUtil {
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public static void displayNameString(MatrixStack matrices, FontRenderer font, int xSize, int yPositionOfMachineText, String text) { public static void displayNameString(MatrixStack matrices, FontRenderer font, int xSize, int yPositionOfMachineText, String text) {
font.draw(matrices, text, xSize / 2f - font.width(text) / 2f, yPositionOfMachineText, StringUtil.DECIMAL_COLOR_WHITE); font.draw(matrices, text, xSize / 2f - font.width(text) / 2f, yPositionOfMachineText, 0xFFFFFF);
} }
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)

View file

@ -20,18 +20,12 @@ import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.ForgeI18n; import net.minecraftforge.fml.ForgeI18n;
@Deprecated
public final class StringUtil { public final class StringUtil {
public static final int DECIMAL_COLOR_WHITE = 16777215;
public static final int DECIMAL_COLOR_GRAY_TEXT = 4210752;
public static final String BUGGED_ITEM_NAME = ActuallyAdditions.MODID + ".lolWutHowUDoDis";
//TODO: Remove
static LanguageMap cancerino;
/** /**
* Localizes a given String * Localizes a given String
*/ */
@Deprecated
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public static String localize(String text) { public static String localize(String text) {
return I18n.get(text); return I18n.get(text);
@ -45,12 +39,6 @@ public final class StringUtil {
return I18n.get(text, replace); return I18n.get(text, replace);
} }
@SuppressWarnings("deprecation")
//TODO: delete this shit and move ItemPotionRing's getItemStackDisplayName into getUnlocalizedName
public static String localizeIllegallyOnTheServerDontUseMePls(String langKey) {
return I18n.get(langKey);
}
// TODO: Move to official // TODO: Move to official
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public static void drawSplitString(FontRenderer renderer, String strg, int x, int y, int width, int color, boolean shadow) { public static void drawSplitString(FontRenderer renderer, String strg, int x, int y, int width, int color, boolean shadow) {
@ -81,25 +69,4 @@ public final class StringUtil {
font.draw(matrices, text, x, y, color); font.draw(matrices, text, x, y, color);
matrices.popPose(); matrices.popPose();
} }
// static void setupLangMap() {
// try {
// Method m = LanguageMap.class.getDeclaredMethod("inject", LanguageMap.class, InputStream.class);
// m.setAccessible(true);
// m.invoke(null, cancerino = new LanguageMap(), ActuallyAdditions.class.getResourceAsStream("/assets/actuallyadditions/lang/en_us.json"));
// } catch (Exception e) {
// e.printStackTrace();
// throw new RuntimeException("Actually Additions failed to access LanguageMap.inject. Report this!");
// }
// }
// TODO: This might be wrong
public static String badTranslate(String someUnlocAAItemName) {
// if (cancerino == null) {
// cancerino = new LanguageMap();
// setupLangMap();
// }
// return cancerino.translateKey("item.actuallyadditions." + someUnlocAAItemName + ".name");
return ForgeI18n.parseFormat("item.actuallyadditions." + someUnlocAAItemName + ".name");
}
} }

View file

@ -89,11 +89,11 @@
"item.banner.actuallyadditionsDrill.orange": "Orange Drill Pattern", "item.banner.actuallyadditionsDrill.orange": "Orange Drill Pattern",
"item.banner.actuallyadditionsDrill.white": "White Drill Pattern", "item.banner.actuallyadditionsDrill.white": "White Drill Pattern",
"_comment": "Damage Sources", "_comment": "Damage Sources",
"death.actuallyadditions.atomicReconstructor.1": "%s got atomically reconstructed.", "death.actuallyadditions.atomicreconstructor.1": "%s got atomically reconstructed.",
"death.actuallyadditions.atomicReconstructor.2": "The Atomic Reconstructor caught %s in its sight.", "death.actuallyadditions.atomicreconstructor.2": "The Atomic Reconstructor caught %s in its sight.",
"death.actuallyadditions.atomicReconstructor.3": "Atomically reconstructing people like %s doesn't appear to work.", "death.actuallyadditions.atomicreconstructor.3": "Atomically reconstructing people like %s doesn't appear to work.",
"death.actuallyadditions.atomicReconstructor.4": "%s shouldn't have ate that Reconstructor!", "death.actuallyadditions.atomicreconstructor.4": "%s shouldn't have ate that Reconstructor!",
"death.actuallyadditions.atomicReconstructor.5": "%s should have used some re-construction foam.", "death.actuallyadditions.atomicreconstructor.5": "%s should have used some re-construction foam.",
"_comment": "Blocks", "_comment": "Blocks",
"block.actuallyadditions.compost": "Compost", "block.actuallyadditions.compost": "Compost",
"block.actuallyadditions.ore_black_quartz": "Black Quartz Ore", "block.actuallyadditions.ore_black_quartz": "Black Quartz Ore",
@ -544,14 +544,15 @@
"info.actuallyadditions.gui.inbound": "INBOUND", "info.actuallyadditions.gui.inbound": "INBOUND",
"info.actuallyadditions.gui.outbound": "OUTBOUND", "info.actuallyadditions.gui.outbound": "OUTBOUND",
"info.actuallyadditions.gui.coffee": "Coffee", "info.actuallyadditions.gui.coffee": "Coffee",
"info.actuallyadditions.gui.coffee_amount": "%d/%d Coffee",
"info.actuallyadditions.gui.ok": "Ok", "info.actuallyadditions.gui.ok": "Ok",
"info.actuallyadditions.gui.the": "the", "info.actuallyadditions.gui.the": "the",
"info.actuallyadditions.gui.smart": "Smart Whitelist", "info.actuallyadditions.gui.smart": "Smart Whitelist",
"info.actuallyadditions.gui.smartInfo": "When pressing this, all items from inventories adjacent to this relay will be added to this part of the white- or blacklist. Adding Item Filters to the list before will cause them to also be filled.", "info.actuallyadditions.gui.smartInfo": "When pressing this, all items from inventories adjacent to this relay will be added to this part of the white- or blacklist. Adding Item Filters to the list before will cause them to also be filled.",
"info.actuallyadditions.inputter.info.1": "This is the first Slot in the connected Inventory to <p> at.", "info.actuallyadditions.inputter.info.1": "This is the first Slot in the connected Inventory to <p> at.",
"info.actuallyadditions.inputter.info.2": "This is the slot after the last Slot in the connected Inventory to <p> at. What that means: If you, for example, write 2 in the field to the left and 5 in this one, it will <p> at Slot 2, 3, and 4.", "info.actuallyadditions.inputter.info.2": "This is the slot after the last Slot in the connected Inventory to <p> at. What that means: If you, for example, write 2 in the field to the left and 5 in this one, it will <p> at Slot 2, 3, and 4.",
"info.actuallyadditions.noLens": "No Lens", "info.actuallyadditions.nolens": "No Lens",
"info.actuallyadditions.noItem": "No Items in Buffer", "info.actuallyadditions.noitem": "No Items in Buffer",
"info.actuallyadditions.booklet.manualName.1.1": "Actually Additions", "info.actuallyadditions.booklet.manualName.1.1": "Actually Additions",
"info.actuallyadditions.booklet.manualName.1.2": "Actual Additions", "info.actuallyadditions.booklet.manualName.1.2": "Actual Additions",
"info.actuallyadditions.booklet.manualName.1.3": "Actually Addiction", "info.actuallyadditions.booklet.manualName.1.3": "Actually Addiction",