mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-15 01:25:04 +00:00
Merge pull request #56 from asdflj/levelmaintainer
update level maintainer
This commit is contained in:
18 files changed
+480
-97
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package com.glodblock.github.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
public class FCGuiLineField extends FCGuiTextField {
|
||||
private final int _xPos;
|
||||
private final int _yPos;
|
||||
private final int _width;
|
||||
private final FontRenderer _fontRender;
|
||||
|
||||
public FCGuiLineField(FontRenderer fontRenderer, int xPos, int yPos, int width) {
|
||||
this(fontRenderer, xPos, yPos, width, 5);
|
||||
}
|
||||
|
||||
public FCGuiLineField(FontRenderer fontRenderer, int xPos, int yPos, int width, int height) {
|
||||
super(fontRenderer, xPos, yPos, width, height);
|
||||
this._xPos = xPos;
|
||||
this._yPos = yPos;
|
||||
this._width = width;
|
||||
this._fontRender = fontRenderer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawTextBox() {
|
||||
if (this.getVisible()) {
|
||||
drawRect(this._xPos, this._yPos, this.xPosition + this.width, this.yPosition + this.height, getColor());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,11 +46,11 @@ public class FCGuiTextField extends GuiTextField {
|
||||
public void drawTextBox() {
|
||||
super.drawTextBox();
|
||||
if (this.getBorder() > 0 && this.getVisible()) {
|
||||
GuiTextField.drawRect(
|
||||
this._xPos - this.getBorder(),
|
||||
this._yPos - this.getBorder(),
|
||||
this._width - 2 * PADDING - this._fontRender.getCharWidth('_') + this.getBorder(),
|
||||
this._height - 2 * PADDING + this.getBorder(),
|
||||
drawRect(
|
||||
this._xPos - getBorder(),
|
||||
this._yPos - getBorder(),
|
||||
this.xPosition + this.width + getBorder(),
|
||||
this.yPosition + this.height + getBorder(),
|
||||
this.getColor());
|
||||
}
|
||||
}
|
||||
@@ -109,6 +109,10 @@ public class FCGuiTextField extends GuiTextField {
|
||||
tooltip = t;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return tooltip;
|
||||
}
|
||||
|
||||
public class TooltipProvider implements ITooltip {
|
||||
@Override
|
||||
public String getMessage() {
|
||||
|
||||
@@ -20,11 +20,16 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
private boolean halfSize = false;
|
||||
private String fillVar;
|
||||
private String currentValue;
|
||||
private final boolean background;
|
||||
private static final String prefix = NameConst.TT_KEY;
|
||||
|
||||
public GuiFCImgButton(final int x, final int y, final String idx, final String val) {
|
||||
super(0, 0, 16, "");
|
||||
this(x, y, idx, val, true);
|
||||
}
|
||||
|
||||
public GuiFCImgButton(final int x, final int y, final String idx, final String val, boolean background) {
|
||||
super(0, 0, 16, "");
|
||||
this.background = background;
|
||||
this.buttonSetting = idx;
|
||||
this.currentValue = val;
|
||||
this.xPosition = x;
|
||||
@@ -198,14 +203,15 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
|
||||
final int uv_y = (int) Math.floor(iconIndex / 3.0);
|
||||
final int uv_x = iconIndex - uv_y * 3;
|
||||
|
||||
this.drawTexturedModalRect(
|
||||
0,
|
||||
0,
|
||||
Math.round(32F * 16F / 3F),
|
||||
Math.round(32F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F));
|
||||
if (this.background) {
|
||||
this.drawTexturedModalRect(
|
||||
0,
|
||||
0,
|
||||
Math.round(32F * 16F / 3F),
|
||||
Math.round(32F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F));
|
||||
}
|
||||
this.drawTexturedModalRect(
|
||||
0,
|
||||
0,
|
||||
@@ -234,14 +240,15 @@ public class GuiFCImgButton extends GuiButton implements ITooltip {
|
||||
|
||||
final int uv_y = (int) Math.floor(iconIndex / 3.0);
|
||||
final int uv_x = iconIndex - uv_y * 3;
|
||||
|
||||
this.drawTexturedModalRect(
|
||||
0,
|
||||
0,
|
||||
Math.round(32F * 16F / 3F),
|
||||
Math.round(32F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F));
|
||||
if (this.background) {
|
||||
this.drawTexturedModalRect(
|
||||
0,
|
||||
0,
|
||||
Math.round(32F * 16F / 3F),
|
||||
Math.round(32F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F),
|
||||
Math.round(16F * 16F / 3F));
|
||||
}
|
||||
this.drawTexturedModalRect(
|
||||
0,
|
||||
0,
|
||||
|
||||
@@ -9,6 +9,7 @@ import appeng.core.sync.packets.PacketNEIDragClick;
|
||||
import codechicken.nei.VisiblityData;
|
||||
import codechicken.nei.api.INEIGuiHandler;
|
||||
import codechicken.nei.api.TaggedInventoryArea;
|
||||
import cofh.core.render.CoFHFontRenderer;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.ContainerLevelMaintainer;
|
||||
import com.glodblock.github.common.tile.TileLevelMaintainer;
|
||||
@@ -16,18 +17,19 @@ import com.glodblock.github.inventory.gui.MouseRegionManager;
|
||||
import com.glodblock.github.inventory.slot.SlotSingleItem;
|
||||
import com.glodblock.github.network.CPacketLevelMaintainer;
|
||||
import com.glodblock.github.util.Ae2ReflectClient;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import java.awt.*;
|
||||
import java.util.Collections;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
@@ -41,6 +43,9 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
private final AppEngRenderItem stackSizeRenderer = Ae2ReflectClient.getStackSizeRenderer(this);
|
||||
private TileLevelMaintainer tile;
|
||||
private FCGuiTextField input;
|
||||
private int lastWorkingTick;
|
||||
private final int interval = 20;
|
||||
private final CoFHFontRenderer render;
|
||||
|
||||
public GuiLevelMaintainer(InventoryPlayer ipl, TileLevelMaintainer tile) {
|
||||
super(new ContainerLevelMaintainer(ipl, tile));
|
||||
@@ -48,56 +53,74 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
this.xSize = 195;
|
||||
this.ySize = 214;
|
||||
this.tile = tile;
|
||||
this.render = new CoFHFontRenderer(
|
||||
Minecraft.getMinecraft().gameSettings,
|
||||
TEX_BG,
|
||||
Minecraft.getMinecraft().getTextureManager(),
|
||||
true);
|
||||
}
|
||||
|
||||
public void postUpdate(List<IAEItemStack> list) {
|
||||
for (Slot slot : this.cont.getRequestSlots()) {
|
||||
if (!slot.getHasStack()) {
|
||||
component[slot.getSlotIndex()].setState(TileLevelMaintainer.State.Nothing);
|
||||
}
|
||||
}
|
||||
for (IAEItemStack is : list) {
|
||||
long size = is.getItemStack().getTagCompound().getLong("Batch");
|
||||
int i = is.getItemStack().getTagCompound().getInteger("Index");
|
||||
boolean isEnable = is.getItemStack().getTagCompound().getBoolean("Enable");
|
||||
NBTTagCompound data = is.getItemStack().getTagCompound();
|
||||
long size = data.getLong("Batch");
|
||||
int i = data.getInteger("Index");
|
||||
boolean isEnable = data.getBoolean("Enable");
|
||||
TileLevelMaintainer.State state = TileLevelMaintainer.State.values()[data.getInteger("State")];
|
||||
component[i].getQty().textField.setText(String.valueOf(is.getStackSize()));
|
||||
component[i].getBatch().textField.setText(String.valueOf(size));
|
||||
component[i].setEnable(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
public void drawScreen(final int mouseX, final int mouseY, final float btn) {
|
||||
super.drawScreen(mouseX, mouseY, btn);
|
||||
if (ModAndClassUtil.isSearchBar) {
|
||||
for (Component com : this.component) {
|
||||
handleTooltip(mouseX, mouseY, com.getQty().textField.new TooltipProvider());
|
||||
handleTooltip(mouseX, mouseY, com.getBatch().textField.new TooltipProvider());
|
||||
}
|
||||
component[i].setState(state);
|
||||
}
|
||||
}
|
||||
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
lastWorkingTick = MinecraftServer.getServer().getTickCounter();
|
||||
for (int i = 0; i < TileLevelMaintainer.REQ_COUNT; i++) {
|
||||
component[i] = new Component(
|
||||
new Widget(
|
||||
new FCGuiTextField(this.fontRendererObj, guiLeft + 37, guiTop + 21 + 20 * i, 52, 16),
|
||||
new GuiFCImgButton(guiLeft + 37 + 47, guiTop + 20 + 20 * i, "SUBMIT", "SUBMIT"),
|
||||
I18n.format(NameConst.TT_REQUEST_SIZE),
|
||||
new FCGuiTextField(this.fontRendererObj, guiLeft + 46, guiTop + 19 + 19 * i, 52, 14),
|
||||
NameConst.TT_LEVEL_MAINTAINER_REQUEST_SIZE,
|
||||
i,
|
||||
"TileLevelMaintainer.Quantity"),
|
||||
new Widget(
|
||||
new FCGuiTextField(this.fontRendererObj, guiLeft + 100, guiTop + 21 + 20 * i, 52, 16),
|
||||
new GuiFCImgButton(guiLeft + 100 + 47, guiTop + 20 + 20 * i, "SUBMIT", "SUBMIT"),
|
||||
I18n.format(NameConst.TT_BATCH_SIZE),
|
||||
new FCGuiTextField(this.fontRendererObj, guiLeft + 100, guiTop + 19 + 19 * i, 52, 14),
|
||||
NameConst.TT_LEVEL_MAINTAINER_BATCH_SIZE,
|
||||
i,
|
||||
"TileLevelMaintainer.Batch"),
|
||||
new GuiFCImgButton(guiLeft + 4, guiTop + 23 + 20 * i, "ENABLE", "ENABLE"),
|
||||
new GuiFCImgButton(guiLeft + 4, guiTop + 23 + 20 * i, "DISABLE", "DISABLE"),
|
||||
new GuiFCImgButton(guiLeft + 105 + 47, guiTop + 17 + 19 * i, "SUBMIT", "SUBMIT", false),
|
||||
new GuiFCImgButton(guiLeft + 9, guiTop + 20 + 19 * i, "ENABLE", "ENABLE", false),
|
||||
new GuiFCImgButton(guiLeft + 9, guiTop + 20 + 19 * i, "DISABLE", "DISABLE", false),
|
||||
new FCGuiLineField(fontRendererObj, guiLeft + 47, guiTop + 33 + 19 * i, 125),
|
||||
this.buttonList);
|
||||
}
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketLevelMaintainer("TileLevelMaintainer.refresh"));
|
||||
}
|
||||
|
||||
public void drawScreen(final int mouseX, final int mouseY, final float btn) {
|
||||
super.drawScreen(mouseX, mouseY, btn);
|
||||
for (Component com : this.component) {
|
||||
handleTooltip(mouseX, mouseY, com.getQty().textField.new TooltipProvider());
|
||||
handleTooltip(mouseX, mouseY, com.getBatch().textField.new TooltipProvider());
|
||||
handleTooltip(mouseX, mouseY, com.getLine().new TooltipProvider());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
mc.getTextureManager().bindTexture(TEX_BG);
|
||||
drawTexturedModalRect(offsetX, offsetY, 0, 0, 176, ySize);
|
||||
int tick = MinecraftServer.getServer().getTickCounter();
|
||||
if (tick > lastWorkingTick + interval && this.input == null) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketLevelMaintainer("TileLevelMaintainer.refresh"));
|
||||
lastWorkingTick = MinecraftServer.getServer().getTickCounter();
|
||||
}
|
||||
for (int i = 0; i < TileLevelMaintainer.REQ_COUNT; i++) {
|
||||
this.component[i].draw();
|
||||
}
|
||||
@@ -105,7 +128,7 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
|
||||
@Override
|
||||
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
fontRendererObj.drawString(getGuiDisplayName(I18n.format(NameConst.GUI_LEVEL_MAINTAINER)), 8, 6, 0x404040);
|
||||
fontRendererObj.drawString(getGuiDisplayName(NameConst.i18n(NameConst.GUI_LEVEL_MAINTAINER)), 8, 6, 0x404040);
|
||||
mouseRegions.render(mouseX, mouseY);
|
||||
}
|
||||
|
||||
@@ -253,25 +276,30 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
|
||||
private class Component {
|
||||
public boolean isEnable = true;
|
||||
private Widget qty;
|
||||
private Widget batch;
|
||||
private GuiFCImgButton disable;
|
||||
private GuiFCImgButton enable;
|
||||
private final Widget qty;
|
||||
private final Widget batch;
|
||||
private final GuiFCImgButton disable;
|
||||
private final GuiFCImgButton enable;
|
||||
private final GuiFCImgButton submit;
|
||||
private final FCGuiLineField line;
|
||||
private TileLevelMaintainer.State state;
|
||||
|
||||
public Component(
|
||||
Widget qtyInput,
|
||||
Widget batchInput,
|
||||
GuiFCImgButton submitBtn,
|
||||
GuiFCImgButton enableBtn,
|
||||
GuiFCImgButton disableBtn,
|
||||
FCGuiLineField line,
|
||||
List buttonList) {
|
||||
this.qty = qtyInput;
|
||||
this.batch = batchInput;
|
||||
this.enable = enableBtn;
|
||||
this.disable = disableBtn;
|
||||
this.enable.setHalfSize(true);
|
||||
this.disable.setHalfSize(true);
|
||||
buttonList.add(this.qty.button);
|
||||
buttonList.add(this.batch.button);
|
||||
this.submit = submitBtn;
|
||||
this.line = line;
|
||||
this.state = TileLevelMaintainer.State.Nothing;
|
||||
buttonList.add(this.submit);
|
||||
buttonList.add(this.enable);
|
||||
buttonList.add(this.disable);
|
||||
}
|
||||
@@ -303,20 +331,20 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
}
|
||||
|
||||
protected boolean sendToServer(GuiButton btn) {
|
||||
if (this.getQty().button == btn) {
|
||||
return this.send(this.getQty());
|
||||
}
|
||||
if (this.getBatch().button == btn) {
|
||||
return this.send(this.getBatch());
|
||||
}
|
||||
if (this.enable == btn) {
|
||||
boolean didSomething = false;
|
||||
if (this.submit == btn) {
|
||||
if (this.send(this.getQty())) this.send(this.getBatch());
|
||||
didSomething = true;
|
||||
} else if (this.enable == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketLevelMaintainer("TileLevelMaintainer.Enable", this.getIndex()));
|
||||
didSomething = true;
|
||||
} else if (this.disable == btn) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketLevelMaintainer("TileLevelMaintainer.Disable", this.getIndex()));
|
||||
didSomething = true;
|
||||
}
|
||||
return false;
|
||||
return didSomething;
|
||||
}
|
||||
|
||||
public FCGuiTextField isMouseIn(final int xCoord, final int yCoord) {
|
||||
@@ -333,9 +361,50 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
return this.batch;
|
||||
}
|
||||
|
||||
public FCGuiLineField getLine() {
|
||||
return this.line;
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
this.getQty().draw();
|
||||
this.getBatch().draw();
|
||||
ArrayList<String> message = new ArrayList<String>();
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_TITLE) + "\n");
|
||||
switch (this.state) {
|
||||
case Idling:
|
||||
this.line.setColor(0xFF55FF55);
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_IDLE));
|
||||
break;
|
||||
case Crafting:
|
||||
this.line.setColor(0xFFFFFF55);
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_LINK));
|
||||
break;
|
||||
case Exporting:
|
||||
this.line.setColor(0xFFAA00AA);
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT));
|
||||
break;
|
||||
default:
|
||||
this.line.setColor(0);
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_CURRENT)
|
||||
+ NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_NONE));
|
||||
}
|
||||
message.add("");
|
||||
if (isShiftKeyDown()) {
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_IDLE));
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_IDLE_DESC) + "\n");
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_LINK));
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_LINK_DESC) + "\n");
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT));
|
||||
message.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_EXPORT_DESC) + "\n");
|
||||
} else {
|
||||
message.add(NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE));
|
||||
}
|
||||
this.line.setMessage(
|
||||
render.wrapFormattedStringToWidth(String.join("\n", message), (int) Math.floor(xSize * 0.8)));
|
||||
this.line.drawTextBox();
|
||||
if (this.isEnable) {
|
||||
this.enable.visible = true;
|
||||
this.disable.visible = false;
|
||||
@@ -344,33 +413,39 @@ public class GuiLevelMaintainer extends AEBaseGui implements INEIGuiHandler {
|
||||
this.disable.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void setState(TileLevelMaintainer.State state) {
|
||||
this.state = state;
|
||||
}
|
||||
}
|
||||
|
||||
private class Widget {
|
||||
public final int idx;
|
||||
public final String action;
|
||||
private FCGuiTextField textField;
|
||||
private GuiFCImgButton button;
|
||||
private final FCGuiTextField textField;
|
||||
private final String tooltip;
|
||||
|
||||
public Widget(FCGuiTextField textField, GuiFCImgButton button, String tooltip, int idx, String action) {
|
||||
public Widget(FCGuiTextField textField, String tooltip, int idx, String action) {
|
||||
this.textField = textField;
|
||||
this.textField.setMessage(tooltip);
|
||||
this.textField.setEnableBackgroundDrawing(false);
|
||||
this.textField.setText("0");
|
||||
this.textField.setMaxStringLength(10); // it's enough to useful
|
||||
this.button = button;
|
||||
this.idx = idx;
|
||||
this.action = action;
|
||||
this.tooltip = tooltip;
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
if (isShiftKeyDown()) {
|
||||
this.setTooltip(render.wrapFormattedStringToWidth(NameConst.i18n(this.tooltip), xSize / 2));
|
||||
} else {
|
||||
this.setTooltip(render.wrapFormattedStringToWidth(
|
||||
NameConst.i18n(this.tooltip, "\n", false) + "\n" + NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE),
|
||||
(int) Math.floor(xSize * 0.8)));
|
||||
}
|
||||
this.textField.drawTextBox();
|
||||
}
|
||||
|
||||
public GuiFCImgButton btn() {
|
||||
return this.button;
|
||||
}
|
||||
|
||||
public void setTooltip(String message) {
|
||||
this.textField.setMessage(message);
|
||||
}
|
||||
|
||||
+2
-2
@@ -18,11 +18,11 @@ public class ContainerLevelMaintainer extends AEBaseContainer {
|
||||
this.tile = tile;
|
||||
AeItemStackHandler request = new AeItemStackHandler(tile.getRequestSlots());
|
||||
for (int y = 0; y < TileLevelMaintainer.REQ_COUNT; y++) {
|
||||
FakeSlot slot = new FakeSlot(request, y, 17, 19 + y * 20);
|
||||
FakeSlot slot = new FakeSlot(request, y, 27, 20 + y * 19);
|
||||
addSlotToContainer(slot);
|
||||
requestSlots[y] = slot;
|
||||
}
|
||||
bindPlayerInventory(ipl, 0, 132);
|
||||
bindPlayerInventory(ipl, 0, 130);
|
||||
}
|
||||
|
||||
public TileLevelMaintainer getTile() {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import appeng.util.Platform;
|
||||
import com.glodblock.github.client.render.RenderBlockFluidBuffer;
|
||||
import com.glodblock.github.common.item.FCBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidBuffer;
|
||||
import com.glodblock.github.crossmod.waila.Tooltip;
|
||||
@@ -12,6 +14,7 @@ import com.glodblock.github.util.Util;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -52,7 +55,7 @@ public class BlockFluidBuffer extends FCBaseBlock {
|
||||
}
|
||||
|
||||
public BlockFluidBuffer register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_FLUID_BUFFER);
|
||||
GameRegistry.registerBlock(this, FCBaseItemBlock.class, NameConst.BLOCK_FLUID_BUFFER);
|
||||
GameRegistry.registerTileEntity(TileFluidBuffer.class, NameConst.BLOCK_FLUID_BUFFER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
@@ -71,4 +74,19 @@ public class BlockFluidBuffer extends FCBaseBlock {
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
if (isShiftKeyDown()) {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_FLUID_BUFFER_DESC));
|
||||
} else {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,17 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import com.glodblock.github.common.item.FCBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidDiscretizer;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BlockFluidDiscretizer extends FCBaseBlock {
|
||||
@@ -18,7 +24,7 @@ public class BlockFluidDiscretizer extends FCBaseBlock {
|
||||
}
|
||||
|
||||
public BlockFluidDiscretizer register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_FLUID_DISCRETIZER);
|
||||
GameRegistry.registerBlock(this, FCBaseItemBlock.class, NameConst.BLOCK_FLUID_DISCRETIZER);
|
||||
GameRegistry.registerTileEntity(TileFluidDiscretizer.class, NameConst.BLOCK_FLUID_DISCRETIZER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
@@ -31,4 +37,20 @@ public class BlockFluidDiscretizer extends FCBaseBlock {
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
|
||||
if (isShiftKeyDown()) {
|
||||
toolTip.addAll(this.listFormattedStringToWidth(NameConst.i18n(NameConst.TT_FLUID_DISCRETIZER_DESC)));
|
||||
} else {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import com.glodblock.github.common.item.FCBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileFluidPacketDecoder;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
@@ -8,6 +10,9 @@ import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -45,7 +50,7 @@ public class BlockFluidPacketDecoder extends FCBaseBlock {
|
||||
}
|
||||
|
||||
public BlockFluidPacketDecoder register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_FLUID_PACKET_DECODER);
|
||||
GameRegistry.registerBlock(this, FCBaseItemBlock.class, NameConst.BLOCK_FLUID_PACKET_DECODER);
|
||||
GameRegistry.registerTileEntity(TileFluidPacketDecoder.class, NameConst.BLOCK_FLUID_PACKET_DECODER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
@@ -58,4 +63,19 @@ public class BlockFluidPacketDecoder extends FCBaseBlock {
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
if (isShiftKeyDown()) {
|
||||
toolTip.addAll(this.listFormattedStringToWidth(NameConst.i18n(NameConst.TT_FLUID_PACKET_DECODER_DESC)));
|
||||
} else {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import static net.minecraft.client.gui.GuiScreen.isCtrlKeyDown;
|
||||
import static net.minecraft.client.gui.GuiScreen.isShiftKeyDown;
|
||||
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import appeng.util.Platform;
|
||||
import com.glodblock.github.client.render.RenderBlockLevelMaintainer;
|
||||
import com.glodblock.github.common.item.FCBaseItemBlock;
|
||||
import com.glodblock.github.common.tabs.FluidCraftingTabs;
|
||||
import com.glodblock.github.common.tile.TileLevelMaintainer;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
@@ -14,6 +17,7 @@ import com.glodblock.github.util.Util;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -31,7 +35,7 @@ public class BlockLevelMaintainer extends FCBaseBlock {
|
||||
}
|
||||
|
||||
public BlockLevelMaintainer register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_LEVEL_MAINTAINER);
|
||||
GameRegistry.registerBlock(this, FCBaseItemBlock.class, NameConst.BLOCK_LEVEL_MAINTAINER);
|
||||
GameRegistry.registerTileEntity(TileLevelMaintainer.class, NameConst.BLOCK_LEVEL_MAINTAINER);
|
||||
setCreativeTab(FluidCraftingTabs.INSTANCE);
|
||||
return this;
|
||||
@@ -75,4 +79,21 @@ public class BlockLevelMaintainer extends FCBaseBlock {
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
if (isShiftKeyDown() && isCtrlKeyDown()) {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_WHO_AM_I));
|
||||
} else if (isShiftKeyDown()) {
|
||||
toolTip.addAll(this.listFormattedStringToWidth(NameConst.i18n(NameConst.TT_LEVEL_MAINTAINER_DESC)));
|
||||
} else {
|
||||
toolTip.add(NameConst.i18n(NameConst.TT_SHIFT_FOR_MORE));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,14 @@ package com.glodblock.github.common.block;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class FCBaseBlock extends AEBaseTileBlock {
|
||||
@@ -32,4 +38,21 @@ public class FCBaseBlock extends AEBaseTileBlock {
|
||||
public void setFeature(final EnumSet<AEFeature> f) {
|
||||
super.setFeature(f);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
final boolean advancedToolTips) {}
|
||||
|
||||
protected final List listFormattedStringToWidth(String str) {
|
||||
return Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(str, 150);
|
||||
}
|
||||
|
||||
public void addCheckedInformation(
|
||||
ItemStack itemStack, EntityPlayer player, List<String> toolTip, boolean advancedToolTips) {
|
||||
this.addInformation(itemStack, player, toolTip, advancedToolTips);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.glodblock.github.common.item;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import com.glodblock.github.common.block.FCBaseBlock;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class FCBaseItemBlock extends AEBaseItemBlock {
|
||||
private final FCBaseBlock blockType;
|
||||
|
||||
public FCBaseItemBlock(Block id) {
|
||||
super(id);
|
||||
blockType = (FCBaseBlock) id;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addCheckedInformation(
|
||||
final ItemStack itemStack,
|
||||
final EntityPlayer player,
|
||||
final List<String> toolTip,
|
||||
final boolean advancedToolTips) {
|
||||
blockType.addCheckedInformation(itemStack, player, toolTip, advancedToolTips);
|
||||
super.addCheckedInformation(itemStack, player, toolTip, advancedToolTips);
|
||||
}
|
||||
}
|
||||
@@ -69,6 +69,15 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
return ImmutableSet.copyOf(new NonNullArrayIterator<ICraftingLink>(this.requests.getLinks()));
|
||||
}
|
||||
|
||||
private IAEItemStack setState(ICraftingLink link, IAEItemStack items) {
|
||||
if (items != null) {
|
||||
requests.setState(link, State.Exporting);
|
||||
} else {
|
||||
requests.setState(link, State.Crafting);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectCraftedItems(ICraftingLink link, IAEItemStack items, Actionable mode) {
|
||||
try {
|
||||
@@ -84,19 +93,21 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
.injectItems(ItemFluidDrop.getAeFluidStack(items), mode, this.source);
|
||||
if (notInserted != null) {
|
||||
items.setStackSize(notInserted.getStackSize());
|
||||
return items;
|
||||
return setState(link, items);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return this.getProxy().getStorage().getItemInventory().injectItems(items, mode, this.source);
|
||||
return setState(
|
||||
link,
|
||||
this.getProxy().getStorage().getItemInventory().injectItems(items, mode, this.source));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (GridAccessException e) {
|
||||
AELog.debug(e);
|
||||
}
|
||||
return items;
|
||||
return setState(link, items);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,6 +146,7 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
IAEItemStack is = requests.getRequestQtyStack(i);
|
||||
if (is != null && requests.getBatchSize(i) > 0) {
|
||||
IAEItemStack craftItem = requests.getCraftItem(i);
|
||||
if (this.requests.isDone(i)) this.requests.setState(i, State.Idling);
|
||||
if (cg.canEmitFor(craftItem)
|
||||
|| cg.isRequesting(craftItem)
|
||||
|| (inv.findPrecise(is) != null
|
||||
@@ -145,13 +157,15 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
if (jobTask == null) {
|
||||
requests.getJobs()[i] = cg.beginCraftingJob(getWorldObj(), grid, this.source, craftItem, null);
|
||||
} else if (jobTask.isDone()) {
|
||||
requests.setState(i, State.Idling);
|
||||
try {
|
||||
ICraftingJob job = jobTask.get();
|
||||
if (job != null) {
|
||||
ICraftingLink link = cg.submitJob(job, this, null, false, this.source);
|
||||
didSomething = true;
|
||||
requests.jobs[i] = null;
|
||||
if (link != null) {
|
||||
didSomething = true;
|
||||
requests.setState(i, State.Crafting);
|
||||
requests.getLinks()[i] = link;
|
||||
}
|
||||
}
|
||||
@@ -227,6 +241,7 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
this.requests.getLinks()[i] = null;
|
||||
} else {
|
||||
this.requests.getLinks()[i] = AEApi.instance().storage().loadCraftingLink(link, this);
|
||||
if (!this.requests.isDone(i)) this.requests.setState(i, State.Crafting);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@@ -294,19 +309,26 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
} catch (final GridAccessException ignored) {
|
||||
|
||||
}
|
||||
|
||||
if (newState != this.isPowered) {
|
||||
this.isPowered = newState;
|
||||
this.markForUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public enum State {
|
||||
Nothing,
|
||||
Idling,
|
||||
Crafting,
|
||||
Exporting
|
||||
}
|
||||
|
||||
public static class InventoryRequest {
|
||||
private final AeStackInventoryImpl<IAEItemStack> requestStacks;
|
||||
private final AeStackInventoryImpl<IAEItemStack> requestBatches;
|
||||
private final AeStackInventoryImpl<IAEItemStack> requestQtys;
|
||||
private final Future<ICraftingJob>[] jobs;
|
||||
private final ICraftingLink[] links;
|
||||
private final State[] state = new State[REQ_COUNT];
|
||||
|
||||
public InventoryRequest(TileLevelMaintainer tile) {
|
||||
this.requestStacks = new AeStackInventoryImpl<>(StorageChannel.ITEMS, REQ_COUNT, tile);
|
||||
@@ -330,6 +352,30 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
}
|
||||
}
|
||||
|
||||
public State getState(int idx) {
|
||||
IAEItemStack ias = this.getRequestStacks().getStack(idx);
|
||||
if (ias == null) {
|
||||
return State.Nothing;
|
||||
} else {
|
||||
return this.state[idx] == null ? State.Idling : this.state[idx];
|
||||
}
|
||||
}
|
||||
|
||||
public void setState(ICraftingLink link, State state) {
|
||||
int i = 0;
|
||||
for (ICraftingLink link1 : this.getLinks()) {
|
||||
if (link == link1) {
|
||||
this.setState(i, state);
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public void setState(int idx, State state) {
|
||||
this.state[idx] = state;
|
||||
}
|
||||
|
||||
public boolean isEnable(int idx) {
|
||||
IAEItemStack ias = this.getRequestBatches().getStack(idx);
|
||||
if (ias != null) {
|
||||
|
||||
@@ -46,12 +46,13 @@ public class CPacketLevelMaintainer implements IMessage {
|
||||
this.size = size.isEmpty() ? 0 : Long.parseLong(size);
|
||||
}
|
||||
|
||||
public static IAEItemStack setTag(IAEItemStack ias, long batch, int slotIndex, boolean enable) {
|
||||
public static IAEItemStack setTag(IAEItemStack ias, long batch, int slotIndex, boolean enable, int state) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
ItemStack is = ias.getItemStack();
|
||||
data.setLong("Batch", batch);
|
||||
data.setLong("Index", slotIndex);
|
||||
data.setBoolean("Enable", enable);
|
||||
data.setInteger("State", state);
|
||||
is.setTagCompound(data);
|
||||
IAEItemStack iaeItemStack = AEItemStack.create(is);
|
||||
iaeItemStack.setStackSize(ias.getStackSize());
|
||||
@@ -90,9 +91,14 @@ public class CPacketLevelMaintainer implements IMessage {
|
||||
if (is1 != null) {
|
||||
NBTTagCompound data;
|
||||
data = is1.getItemStack().getTagCompound();
|
||||
piu.appendItem(setTag(is, is1.getStackSize(), i, data.getBoolean("Enable")));
|
||||
piu.appendItem(setTag(
|
||||
is,
|
||||
is1.getStackSize(),
|
||||
i,
|
||||
data.getBoolean("Enable"),
|
||||
cca.getTile().requests.getState(i).ordinal()));
|
||||
} else {
|
||||
piu.appendItem(setTag(is, 0, i, true));
|
||||
piu.appendItem(setTag(is, 0, i, true, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import java.util.ArrayList;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class NameConst {
|
||||
|
||||
@@ -33,8 +36,27 @@ public class NameConst {
|
||||
public static final String TT_ENCODE_PATTERN = TT_KEY + "encode_pattern";
|
||||
public static final String TT_EMPTY = TT_KEY + "empty";
|
||||
public static final String TT_DUMP_TANK = TT_KEY + "dump_tank";
|
||||
public static final String TT_REQUEST_SIZE = TT_KEY + "request_size";
|
||||
public static final String TT_BATCH_SIZE = TT_KEY + "batch_size";
|
||||
public static final String TT_SHIFT_FOR_MORE = TT_KEY + "shift_for_more";
|
||||
public static final String TT_FLUID_BUFFER = TT_KEY + "fluid_buffer.";
|
||||
public static final String TT_FLUID_PACKET_DECODER = TT_KEY + "fluid_packet_decoder.";
|
||||
public static final String TT_FLUID_PACKET_DECODER_DESC = TT_FLUID_PACKET_DECODER + "desc";
|
||||
public static final String TT_FLUID_BUFFER_DESC = TT_FLUID_BUFFER + "desc";
|
||||
public static final String TT_FLUID_DISCRETIZER = TT_KEY + "discretizer.";
|
||||
public static final String TT_FLUID_DISCRETIZER_DESC = TT_FLUID_DISCRETIZER + "desc";
|
||||
public static final String TT_LEVEL_MAINTAINER = TT_KEY + "level_maintainer.";
|
||||
public static final String TT_LEVEL_MAINTAINER_DESC = TT_LEVEL_MAINTAINER + "desc";
|
||||
public static final String TT_LEVEL_MAINTAINER_WHO_AM_I = TT_LEVEL_MAINTAINER + "Who_Am_I";
|
||||
public static final String TT_LEVEL_MAINTAINER_TITLE = TT_LEVEL_MAINTAINER + "title";
|
||||
public static final String TT_LEVEL_MAINTAINER_CURRENT = TT_LEVEL_MAINTAINER + "current";
|
||||
public static final String TT_LEVEL_MAINTAINER_NONE = TT_LEVEL_MAINTAINER + "none";
|
||||
public static final String TT_LEVEL_MAINTAINER_REQUEST_SIZE = TT_LEVEL_MAINTAINER + "request_size";
|
||||
public static final String TT_LEVEL_MAINTAINER_BATCH_SIZE = TT_LEVEL_MAINTAINER + "batch_size";
|
||||
public static final String TT_LEVEL_MAINTAINER_IDLE = TT_LEVEL_MAINTAINER + "idle";
|
||||
public static final String TT_LEVEL_MAINTAINER_IDLE_DESC = TT_LEVEL_MAINTAINER + "idle_desc";
|
||||
public static final String TT_LEVEL_MAINTAINER_LINK = TT_LEVEL_MAINTAINER + "link";
|
||||
public static final String TT_LEVEL_MAINTAINER_LINK_DESC = TT_LEVEL_MAINTAINER + "link_desc";
|
||||
public static final String TT_LEVEL_MAINTAINER_EXPORT = TT_LEVEL_MAINTAINER + "export";
|
||||
public static final String TT_LEVEL_MAINTAINER_EXPORT_DESC = TT_LEVEL_MAINTAINER + "export_desc";
|
||||
public static final String TT_CELL_CONTENTS = TT_KEY + "cell_contents";
|
||||
|
||||
public static final String WAILA_KEY = FluidCraft.MODID + ".waila.";
|
||||
@@ -56,4 +78,28 @@ public class NameConst {
|
||||
public static final String GUI_OC_PATTERN_EDITOR = GUI_KEY + BLOCK_OC_PATTERN_EDITOR;
|
||||
public static final String GUI_FLUID_IMPORT = GUI_KEY + ITEM_PART_FLUID_IMPORT;
|
||||
public static final String GUI_FLUID_EXPORT = GUI_KEY + ITEM_PART_FLUID_EXPORT;
|
||||
|
||||
public static String i18n(String t, String delimiter, boolean hint) {
|
||||
if (!hint) {
|
||||
return I18n.format(t);
|
||||
}
|
||||
ArrayList<String> arr = new ArrayList<>();
|
||||
arr.add(I18n.format(t));
|
||||
if (!StatCollector.translateToLocal(t + ".hint").equals(t + ".hint")) {
|
||||
arr.add(I18n.format(t + ".hint"));
|
||||
}
|
||||
return String.join(delimiter, arr);
|
||||
}
|
||||
|
||||
public static String i18n(String t) {
|
||||
return i18n(t, "\n", true);
|
||||
}
|
||||
|
||||
public static String i18n(String t, boolean warp) {
|
||||
if (warp) {
|
||||
return i18n(t);
|
||||
} else {
|
||||
return i18n(t, "", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user