mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 11:59:11 +00:00
Localization and refactoring (#77)
* Some refactoring for bee production * Code cleanup * Code cleanup * Added some localization * Fix wrong dropped class * Added some localization * Added some localization * Added some localization * Fix wrong import
This commit is contained in:
1 parent
68bbe7710c
commit
1ea7b62e5f
157 files changed
+3240
-5045
No files matched your search
@@ -21,8 +21,8 @@ import java.util.List;
|
||||
|
||||
public abstract class AbstractMod implements IPacketProvider, IInitializable {
|
||||
private SimpleNetworkWrapper wrapper;
|
||||
private LinkedHashSet<Field> fields;
|
||||
protected List<IInitializable> modules;
|
||||
private final LinkedHashSet<Field> fields;
|
||||
protected final List<IInitializable> modules;
|
||||
|
||||
public AbstractMod() {
|
||||
fields = new LinkedHashSet<>();
|
||||
|
||||
@@ -27,8 +27,7 @@ public class BlockMetadata extends BlockContainer implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
// TODO fix deprecated usage
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@@ -121,8 +120,7 @@ public class BlockMetadata extends BlockContainer implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
// TODO fix deprecated usage
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -22,9 +22,9 @@ import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.extrabees.gui.punnett.ExtraBeeGUITexture;
|
||||
import binnie.extrabees.gui.ExtraBeeGUITexture;
|
||||
import binnie.genetics.gui.ControlChromosome;
|
||||
import binnie.genetics.machine.Analyser;
|
||||
import binnie.genetics.machine.analyser.Analyser;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.core.craftgui.controls.button;
|
||||
package binnie.core.craftgui.controls;
|
||||
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -1,10 +0,0 @@
|
||||
package binnie.core.craftgui.controls;
|
||||
|
||||
// TODO unused interface?
|
||||
public interface IControlSelection<T> {
|
||||
T getSelectedValue();
|
||||
|
||||
void setSelectedValue(T p0);
|
||||
|
||||
boolean isSelected(IControlSelectionOption<T> p0);
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package binnie.core.craftgui.controls.button;
|
||||
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import binnie.core.craftgui.events.EventMouse;
|
||||
import binnie.core.craftgui.events.EventValueChanged;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
// TODO unused class?
|
||||
public class ControlEnumButton<T> extends ControlButton implements IControlValue<T> {
|
||||
public static String eventEnumChanged = "eventEnumButtonChanged";
|
||||
private T currentSelection;
|
||||
private List<T> enumConstants;
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return currentSelection.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseClick(EventMouse.Down event) {
|
||||
int index = enumConstants.indexOf(currentSelection);
|
||||
if (index < enumConstants.size() - 1) {
|
||||
index++;
|
||||
} else {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
T newEnum = enumConstants.get(index);
|
||||
setValue(newEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(T selection) {
|
||||
if (currentSelection != selection) {
|
||||
currentSelection = selection;
|
||||
callEvent(new EventValueChanged<Object>(this, getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
public ControlEnumButton(IWidget parent, float x, float y, float width, float height, T[] values) {
|
||||
super(parent, x, y, width, height, "");
|
||||
enumConstants = new ArrayList<T>();
|
||||
Collections.addAll(enumConstants, values);
|
||||
if (values.length > 0) {
|
||||
currentSelection = values[0];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public T getValue() {
|
||||
return currentSelection;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package binnie.core.craftgui.controls.button;
|
||||
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.events.EventMouse;
|
||||
import binnie.core.craftgui.events.EventToggleButtonClicked;
|
||||
|
||||
// TODO unused class?
|
||||
public class ControlToggleButton extends ControlButton {
|
||||
boolean toggled;
|
||||
|
||||
@Override
|
||||
public void onMouseClick(EventMouse.Down event) {
|
||||
callEvent(new EventToggleButtonClicked(this, toggled));
|
||||
}
|
||||
|
||||
public ControlToggleButton(IWidget parent, int x, int y, int width, int height) {
|
||||
super(parent, x, y, width, height);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package binnie.core.craftgui.controls.core;
|
||||
|
||||
// TODO unused interface?
|
||||
public interface IControlIndexed {
|
||||
int getIndex();
|
||||
|
||||
void setIndex(int index);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package binnie.core.craftgui.database;
|
||||
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
// TODO unused class?
|
||||
public class PageBreederStats extends Control {
|
||||
String player;
|
||||
|
||||
public PageBreederStats(IWidget parent, int w, int h, String player) {
|
||||
super(parent, 0.0f, 0.0f, w, h);
|
||||
this.player = player;
|
||||
ControlText pageBranchOverview_branchName = new ControlTextCentered(this, 8.0f, EnumChatFormatting.UNDERLINE + "§tats" + EnumChatFormatting.RESET);
|
||||
BreedingSystem system = ((WindowAbstractDatabase) getSuperParent()).getBreedingSystem();
|
||||
}
|
||||
}
|
||||
@@ -31,17 +31,4 @@ public abstract class EventKey extends Event {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO unused class?
|
||||
public static class Up extends EventKey {
|
||||
public Up(IWidget origin, char character, int key) {
|
||||
super(origin, character, key);
|
||||
}
|
||||
|
||||
public abstract static class Handler extends EventHandler<Up> {
|
||||
public Handler() {
|
||||
super(Up.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,8 +44,7 @@ import net.minecraft.world.World;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Deque;
|
||||
|
||||
public abstract class Window extends TopLevelWidget implements INetwork.RecieveGuiNBT
|
||||
{
|
||||
public abstract class Window extends TopLevelWidget implements INetwork.RecieveGuiNBT {
|
||||
private GuiCraftGUI gui;
|
||||
private ContainerCraftGUI container;
|
||||
private WindowInventory windowInventory;
|
||||
@@ -76,7 +75,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
if (widget.hasAttribute(WidgetAttribute.BlockTooltip)) {
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,7 +96,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
if (widget.hasAttribute(WidgetAttribute.BlockTooltip)) {
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,32 +120,36 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
}
|
||||
|
||||
public Window(float width, float height, EntityPlayer player, IInventory inventory, Side side) {
|
||||
this.side = side;
|
||||
titleButtonLeft = 8.0f;
|
||||
titleButtonRight = 8.0f;
|
||||
bgText1 = null;
|
||||
bgText2 = null;
|
||||
hasBeenInitialised = false;
|
||||
this.side = Side.CLIENT;
|
||||
this.side = side;
|
||||
setInventories(player, inventory);
|
||||
container = new ContainerCraftGUI(this);
|
||||
windowInventory = new WindowInventory(this);
|
||||
if (side == Side.SERVER) {
|
||||
return;
|
||||
}
|
||||
|
||||
setSize(new IPoint(width, height));
|
||||
gui = new GuiCraftGUI(this);
|
||||
for (EnumHighlighting h : EnumHighlighting.values()) {
|
||||
ControlSlot.highlighting.put(h, new ArrayList<Integer>());
|
||||
ControlSlot.highlighting.put(h, new ArrayList<>());
|
||||
}
|
||||
(CraftGUI.Render = new Renderer(gui)).stylesheet(StyleSheetManager.getDefault());
|
||||
|
||||
CraftGUI.Render = new Renderer(gui);
|
||||
CraftGUI.Render.stylesheet(StyleSheetManager.getDefault());
|
||||
titleButtonLeft = -14.0f;
|
||||
|
||||
if (showHelpButton()) {
|
||||
new ControlHelp(this, titleButtonLeft += 22.0f, 8.0f);
|
||||
}
|
||||
if (showInfoButton() != null) {
|
||||
new ControlInfo(this, titleButtonLeft += 22.0f, 8.0f, showInfoButton());
|
||||
}
|
||||
|
||||
addSelfEventHandler(new EventWidget.ChangeSize.Handler() {
|
||||
@Override
|
||||
public void onEvent(EventWidget.ChangeSize event) {
|
||||
@@ -163,7 +164,8 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
(this.title = new ControlTextCentered(this, 12.0f, title)).setColor(4210752);
|
||||
this.title = new ControlTextCentered(this, 12.0f, title);
|
||||
this.title.setColor(0x404040);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -183,10 +185,12 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
if (hasBeenInitialised) {
|
||||
return;
|
||||
}
|
||||
|
||||
bgText1 = new StandardTexture(0, 0, 256, 256, getBackgroundTextureFile(1));
|
||||
if (getSize().x() > 256.0f) {
|
||||
bgText2 = new StandardTexture(0, 0, 256, 256, getBackgroundTextureFile(2));
|
||||
}
|
||||
|
||||
if (!BinnieCore.proxy.checkTexture(bgText1.getTexture())) {
|
||||
bgText1 = null;
|
||||
bgText2 = null;
|
||||
@@ -198,11 +202,12 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
public abstract void initialiseClient();
|
||||
|
||||
public void initialiseServer() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.colour(16777215);
|
||||
CraftGUI.Render.colour(0xffffff);
|
||||
if (getBackground1() != null) {
|
||||
CraftGUI.Render.texture(getBackground1(), IPoint.ZERO);
|
||||
}
|
||||
@@ -267,9 +272,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
return BinnieCore.proxy.getWorld();
|
||||
}
|
||||
|
||||
public void onInventoryUpdate() {
|
||||
}
|
||||
|
||||
public void sendClientAction(String name, NBTTagCompound action) {
|
||||
action.setString("type", name);
|
||||
MessageCraftGUI packet = new MessageCraftGUI(action);
|
||||
@@ -282,19 +284,20 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
float w = w();
|
||||
float titleButtonRight = this.titleButtonRight + 16.0f;
|
||||
this.titleButtonRight = titleButtonRight;
|
||||
ControlUser controlUser = new ControlUser(this, w - titleButtonRight, 8.0f, nbt.getString("username"));
|
||||
new ControlUser(this, w - titleButtonRight, 8.0f, nbt.getString("username"));
|
||||
this.titleButtonRight += 6.0f;
|
||||
}
|
||||
if (side == Side.CLIENT && name.equals("power-system")) {
|
||||
float w2 = w();
|
||||
float titleButtonRight2 = titleButtonRight + 16.0f;
|
||||
titleButtonRight = titleButtonRight2;
|
||||
ControlPowerSystem controlPowerSystem = new ControlPowerSystem(this, w2 - titleButtonRight2, 8.0f, PowerSystem.get(nbt.getByte("system")));
|
||||
new ControlPowerSystem(this, w2 - titleButtonRight2, 8.0f, PowerSystem.get(nbt.getByte("system")));
|
||||
titleButtonRight += 6.0f;
|
||||
}
|
||||
}
|
||||
|
||||
public void onWindowInventoryChanged() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public Texture getBackground1() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.craftgui.minecraft.control;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -7,6 +8,7 @@ import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public class ControlHelp extends Control implements ITooltip {
|
||||
public ControlHelp(IWidget parent, float x, float y) {
|
||||
@@ -22,10 +24,10 @@ public class ControlHelp extends Control implements ITooltip {
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.Help);
|
||||
tooltip.add("Help");
|
||||
tooltip.add("To activate help tooltips,");
|
||||
tooltip.add("hold down the tab key and");
|
||||
tooltip.add("mouse over controls.");
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.help"));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.help.0"));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.help.1"));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.help.2"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.craftgui.minecraft.control;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -7,6 +8,7 @@ import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public class ControlInfo extends Control implements ITooltip {
|
||||
private String info;
|
||||
@@ -25,7 +27,7 @@ public class ControlInfo extends Control implements ITooltip {
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.Information);
|
||||
tooltip.add("Info");
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.info"));
|
||||
tooltip.add(info);
|
||||
tooltip.setMaxWidth(200);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import binnie.core.machines.inventory.MachineSide;
|
||||
import binnie.core.machines.inventory.TankSlot;
|
||||
import binnie.core.machines.power.ITankMachine;
|
||||
import binnie.core.machines.power.TankInfo;
|
||||
import binnie.core.util.I18N;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -89,7 +90,6 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
if (isTankValid()) {
|
||||
float height = horizontal ? 16.0f : 58.0f;
|
||||
int squaled = (int) (height * (getTank().getAmount() / getTank().getCapacity()));
|
||||
int yPos = (int) height + 1;
|
||||
Fluid fluid = getTank().liquid.getFluid();
|
||||
int hex = fluid.getColor(getTank().liquid);
|
||||
int r = (hex & 0xFF0000) >> 16;
|
||||
@@ -144,25 +144,32 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
|
||||
TankSlot slot = getTankSlot();
|
||||
tooltip.add(slot.getName());
|
||||
tooltip.add("Capacity: " + getTankCapacity() + " mB");
|
||||
tooltip.add("Insert Side: " + MachineSide.asString(slot.getInputSides()));
|
||||
tooltip.add("Extract Side: " + MachineSide.asString(slot.getOutputSides()));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.capacity", getTankCapacity()));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.insertSide", MachineSide.asString(slot.getInputSides())));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.extractSide", MachineSide.asString(slot.getOutputSides())));
|
||||
|
||||
if (slot.isReadOnly()) {
|
||||
tooltip.add("Output Only Tank");
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.outputOnlyTank"));
|
||||
}
|
||||
|
||||
if (slot.getValidator() == null) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.acceptsAny"));
|
||||
} else {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.accepts", slot.getValidator().getTooltip()));
|
||||
}
|
||||
tooltip.add("Accepts: " + ((slot.getValidator() == null) ? "Any Item" : slot.getValidator().getTooltip()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (isTankValid()) {
|
||||
int percentage = (int) (100.0 * getTank().getAmount() / getTankCapacity());
|
||||
tooltip.add(getTank().getName());
|
||||
tooltip.add(percentage + "% full");
|
||||
tooltip.add((int) getTank().getAmount() + " mB");
|
||||
if (!isTankValid()) {
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.empty"));
|
||||
return;
|
||||
}
|
||||
tooltip.add("Empty");
|
||||
|
||||
int percentage = (int) (100.0 * getTank().getAmount() / getTankCapacity());
|
||||
tooltip.add(getTank().getName());
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.full", percentage));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.tank.amount", (int) getTank().getAmount()));
|
||||
}
|
||||
|
||||
private TankSlot getTankSlot() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.craftgui.minecraft.control;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -8,6 +9,7 @@ import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.core.machines.power.PowerSystem;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public class ControlPowerSystem extends Control implements ITooltip {
|
||||
private PowerSystem system;
|
||||
@@ -26,8 +28,8 @@ public class ControlPowerSystem extends Control implements ITooltip {
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.Power);
|
||||
tooltip.add("Power Supply");
|
||||
tooltip.add("Powered by " + system.getUnitName());
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.powerSupply"));
|
||||
tooltip.add(I18N.localise(BinnieCore.instance, "gui.tooltip.poweredBy", system.getUnitName()));
|
||||
tooltip.setMaxWidth(200);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package binnie.core.craftgui.minecraft.render;
|
||||
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.resource.IBinnieTexture;
|
||||
|
||||
// TODO unused class?
|
||||
public class MinecraftTexture {
|
||||
protected IArea textureArea;
|
||||
protected IBinnieTexture texture;
|
||||
|
||||
public MinecraftTexture() {
|
||||
textureArea = new IArea(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package binnie.core.craftgui.minecraft.render;
|
||||
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.minecraft.GuiCraftGUI;
|
||||
|
||||
// TODO unused class?
|
||||
public abstract class RenderCommand {
|
||||
protected IWidget widget;
|
||||
|
||||
public RenderCommand(IWidget widget) {
|
||||
this.widget = widget;
|
||||
}
|
||||
|
||||
public abstract void render(GuiCraftGUI p0);
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
package binnie.core.genetics;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IClassification;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
// TODO unused interface?
|
||||
interface IBreedingMessage {
|
||||
String getTitle();
|
||||
|
||||
String getBody();
|
||||
|
||||
ItemStack getIcon();
|
||||
|
||||
class MessageSpeciesDiscovered implements IBreedingMessage {
|
||||
IAlleleSpecies species;
|
||||
ItemStack stack;
|
||||
|
||||
public MessageSpeciesDiscovered(IAlleleSpecies species) {
|
||||
this.species = species;
|
||||
ISpeciesRoot root = null;
|
||||
for (ISpeciesRoot sRoot : AlleleManager.alleleRegistry.getSpeciesRoot().values()) {
|
||||
if (sRoot.getKaryotype()[0].getAlleleClass().isInstance(species)) {
|
||||
root = sRoot;
|
||||
}
|
||||
}
|
||||
if (root != null) {
|
||||
stack = root.getMemberStack(root.templateAsIndividual(root.getTemplate(species.getUID())), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return I18N.localise(BinnieCore.instance, "gui.breedingmessage.species");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBody() {
|
||||
return species.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getIcon() {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
||||
class BranchDiscovered implements IBreedingMessage {
|
||||
IAlleleSpecies species;
|
||||
IClassification classification;
|
||||
ItemStack stack;
|
||||
|
||||
public BranchDiscovered(IAlleleSpecies species, IClassification classification) {
|
||||
this.species = species;
|
||||
this.classification = classification;
|
||||
ISpeciesRoot root = null;
|
||||
for (ISpeciesRoot sRoot : AlleleManager.alleleRegistry.getSpeciesRoot().values()) {
|
||||
if (sRoot.getKaryotype()[0].getAlleleClass().isInstance(species)) {
|
||||
root = sRoot;
|
||||
}
|
||||
}
|
||||
if (root != null) {
|
||||
stack = root.getMemberStack(root.templateAsIndividual(root.getTemplate(species.getUID())), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return I18N.localise(BinnieCore.instance, "gui.breedingmessage.branch");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBody() {
|
||||
return classification.getScientific();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getIcon() {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
||||
class EpithetGained implements IBreedingMessage {
|
||||
String epithet;
|
||||
ItemStack stack;
|
||||
|
||||
public EpithetGained(String epithet, ISpeciesRoot root) {
|
||||
this.epithet = epithet;
|
||||
stack = root.getMemberStack(root.templateAsIndividual(root.getDefaultTemplate()), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return I18N.localise(BinnieCore.instance, "gui.breedingmessage.epithet");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBody() {
|
||||
return epithet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getIcon() {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.api.lepidopterology.IButterflyRoot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -67,11 +66,6 @@ public class ManagerGenetics extends ManagerBase {
|
||||
refreshData();
|
||||
}
|
||||
|
||||
// TODO unused method?
|
||||
public boolean isSpeciesDiscovered(IAlleleSpecies species, World world, boolean nei) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public ITreeRoot getTreeRoot() {
|
||||
return (ITreeRoot) AlleleManager.alleleRegistry.getSpeciesRoot("rootTrees");
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package binnie.core.genetics;
|
||||
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.lepidopterology.IButterfly;
|
||||
import forestry.api.lepidopterology.IButterflyNursery;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
// TODO unused class?
|
||||
public class VirtualMothHousing extends VirtualHousing implements IButterflyNursery {
|
||||
public VirtualMothHousing(EntityPlayer player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IButterfly getCaterpillar() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIndividual getNanny() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCaterpillar(IButterfly butterfly) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNurse(IButterfly butterfly) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.core.liquid;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
class BinnieFluid extends Fluid {
|
||||
protected IFluidType fluidType;
|
||||
@@ -8,8 +9,7 @@ class BinnieFluid extends Fluid {
|
||||
private String name;
|
||||
|
||||
@Override
|
||||
// TODO fix deprecated usage
|
||||
public String getLocalizedName() {
|
||||
public String getLocalizedName(FluidStack stack) {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.component.IInteraction;
|
||||
import binnie.core.machines.component.IRender;
|
||||
import binnie.core.machines.network.INetwork;
|
||||
import binnie.core.machines.power.ITankMachine;
|
||||
import binnie.core.network.BinnieCorePacketID;
|
||||
import binnie.core.network.INetworkedEntity;
|
||||
import binnie.core.network.packet.MessageTileNBT;
|
||||
@@ -114,13 +113,6 @@ public class Machine implements INetworkedEntity, INBTTagable, INetwork.TilePack
|
||||
return tile;
|
||||
}
|
||||
|
||||
public void sendPacket() {
|
||||
if (!BinnieCore.proxy.isSimulating(getTileEntity().getWorldObj())) {
|
||||
return;
|
||||
}
|
||||
BinnieCore.proxy.sendNetworkEntityPacket((INetworkedEntity) getTileEntity());
|
||||
}
|
||||
|
||||
public Side getSide() {
|
||||
return BinnieCore.proxy.isSimulating(getTileEntity().getWorldObj()) ? Side.SERVER : Side.CLIENT;
|
||||
}
|
||||
@@ -178,10 +170,6 @@ public class Machine implements INetworkedEntity, INBTTagable, INetwork.TilePack
|
||||
return getInterface(IInventory.class);
|
||||
}
|
||||
|
||||
public ITankMachine getTankContainer() {
|
||||
return getInterface(ITankMachine.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
for (MachineComponent component : getComponents()) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
// TODO unused class?
|
||||
// Hmm. It's used class
|
||||
public class RendererMachine extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
||||
RenderBlocks blockRenderer;
|
||||
|
||||
|
||||
@@ -72,15 +72,6 @@ public abstract class BaseSlot<T> implements INBTTagable, IValidator<T> {
|
||||
forbidExtraction();
|
||||
}
|
||||
|
||||
// TODO unusing method?
|
||||
public void setInputSides(EnumSet<ForgeDirection> sides) {
|
||||
for (ForgeDirection side : EnumSet.complementOf(sides)) {
|
||||
if (side != ForgeDirection.UNKNOWN) {
|
||||
access.setInsert(side, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setOutputSides(EnumSet<ForgeDirection> sides) {
|
||||
for (ForgeDirection side : EnumSet.complementOf(sides)) {
|
||||
if (side != ForgeDirection.UNKNOWN) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.core.machines.power;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.core.INBTTagable;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@@ -49,10 +51,6 @@ public class ErrorState implements INBTTagable {
|
||||
return progress;
|
||||
}
|
||||
|
||||
public void setIsProgress() {
|
||||
progress = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
name = nbt.getString("name");
|
||||
@@ -109,13 +107,13 @@ public class ErrorState implements INBTTagable {
|
||||
}
|
||||
|
||||
public NoItem(String desc, int[] slots) {
|
||||
super("No Item", desc, slots);
|
||||
super(I18N.localise(BinnieCore.instance, "machine.error.noItem"), desc, slots);
|
||||
}
|
||||
}
|
||||
|
||||
public static class InvalidItem extends Item {
|
||||
public InvalidItem(String desc, int slot) {
|
||||
this("Invalid Item", desc, slot);
|
||||
this(I18N.localise(BinnieCore.instance, "machine.error.invalidItem"), desc, slot);
|
||||
}
|
||||
|
||||
public InvalidItem(String name, String desc, int slot) {
|
||||
@@ -125,31 +123,28 @@ public class ErrorState implements INBTTagable {
|
||||
|
||||
public static class NoSpace extends Item {
|
||||
public NoSpace(String desc, int[] slots) {
|
||||
super("No Space", desc, slots);
|
||||
super(I18N.localise(BinnieCore.instance, "machine.error.noSpace"), desc, slots);
|
||||
}
|
||||
}
|
||||
|
||||
public static class InsufficientPower extends ErrorState {
|
||||
public InsufficientPower() {
|
||||
super("Insufficient Power", "Not enough power to operate");
|
||||
super(
|
||||
I18N.localise(BinnieCore.instance, "machine.error.insufficientPower.title"),
|
||||
I18N.localise(BinnieCore.instance, "machine.error.insufficientPower.desc")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static class TankSpace extends Tank {
|
||||
public TankSpace(String desc, int tank) {
|
||||
super("Tank Full", desc, new int[]{tank});
|
||||
super(I18N.localise(BinnieCore.instance, "machine.error.tankFull"), desc, new int[]{tank});
|
||||
}
|
||||
}
|
||||
|
||||
public static class InsufficientLiquid extends Tank {
|
||||
public InsufficientLiquid(String desc, int tank) {
|
||||
super("Insufficient Liquid", desc, new int[]{tank});
|
||||
}
|
||||
}
|
||||
|
||||
public static class InvalidRecipe extends Item {
|
||||
public InvalidRecipe(String string, int[] slots) {
|
||||
super("Invalid Recipe", string, slots);
|
||||
super(I18N.localise(BinnieCore.instance, "machine.error.insufficientLiquid"), desc, new int[]{tank});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.ControlCheckbox;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextEdit;
|
||||
import binnie.core.craftgui.controls.button.ControlButton;
|
||||
import binnie.core.craftgui.controls.ControlButton;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.controls.page.ControlPage;
|
||||
import binnie.core.craftgui.controls.page.ControlPages;
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
package binnie.core.machines.storage;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.genetics.craftgui.WindowMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
// TODO unused class?
|
||||
public class WindowTest extends WindowMachine {
|
||||
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
|
||||
return new WindowCompartment(player, inventory, side);
|
||||
}
|
||||
|
||||
public WindowTest(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(320, 240, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return "Test";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return BinnieCore.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getName() {
|
||||
return "Test";
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package binnie.core.multiblock;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
// TODO unused class?
|
||||
public class BlockMultiblockMachine extends BlockContainer {
|
||||
public BlockMultiblockMachine(String blockName) {
|
||||
super(Material.iron);
|
||||
setHardness(1.5f);
|
||||
setBlockName(blockName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int metadata) {
|
||||
return new TileEntityMultiblockMachine();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||
return new TileEntityMultiblockMachine();
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package binnie.core.multiblock;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
class TileEntityMultiblockMachine extends TileEntity {
|
||||
private boolean inStructure;
|
||||
private int tileX;
|
||||
private int tileY;
|
||||
private int tileZ;
|
||||
|
||||
boolean inStructure() {
|
||||
return inStructure;
|
||||
}
|
||||
|
||||
public Machine getMachine() {
|
||||
return getMasterMachine();
|
||||
}
|
||||
|
||||
private Machine getMasterMachine() {
|
||||
if (!inStructure) {
|
||||
return null;
|
||||
}
|
||||
|
||||
TileEntity tile = worldObj.getTileEntity(xCoord + tileX, yCoord + tileY, zCoord + tileZ);
|
||||
if (tile instanceof TileEntityMachine) {
|
||||
return ((TileEntityMachine) tile).getMachine();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -18,11 +18,6 @@ public class BinnieResource {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
// TODO unused method?
|
||||
public String getFullPath() {
|
||||
return "/assets/" + mod + "/textures/" + type.toString() + "/" + path;
|
||||
}
|
||||
|
||||
public ResourceLocation getResourceLocation() {
|
||||
return new ResourceLocation(mod, "textures/" + type.toString() + "/" + path);
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package binnie.core.texture;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
// TODO unused class?
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class TextureManager
|
||||
{
|
||||
static List<Icon> textures = new ArrayList<>();
|
||||
|
||||
public static void init() {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package binnie.core.triggers;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
// TODO unusing class?
|
||||
public class TriggerInventory {
|
||||
private static Boolean isSlotEmpty(IInventory inventory, int slot) {
|
||||
return inventory.getStackInSlot(slot) != null;
|
||||
}
|
||||
}
|
||||
@@ -14,16 +14,16 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
class TriggerProvider implements ITriggerProvider {
|
||||
static TriggerProvider instance = new TriggerProvider();
|
||||
public static List<BinnieTrigger> triggers = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public Collection<ITriggerExternal> getExternalTriggers(ForgeDirection side, TileEntity tile) {
|
||||
LinkedList<TriggerData> list = new LinkedList<TriggerData>();
|
||||
LinkedList<ITriggerExternal> triggerData = new LinkedList<ITriggerExternal>();
|
||||
LinkedList<TriggerData> list = new LinkedList<>();
|
||||
LinkedList<ITriggerExternal> triggerData = new LinkedList<>();
|
||||
if (tile instanceof IBuildcraft.TriggerProvider) {
|
||||
((IBuildcraft.TriggerProvider) tile).getTriggers(list);
|
||||
}
|
||||
|
||||
for (TriggerData data : list) {
|
||||
if (data.getKey() != null && data.getKey().getUniqueTag() != null) {
|
||||
triggerData.add(data.getKey());
|
||||
@@ -32,21 +32,6 @@ class TriggerProvider implements ITriggerProvider {
|
||||
return triggerData;
|
||||
}
|
||||
|
||||
// TODO unusing method?
|
||||
public static boolean isTriggerActive(ITriggerExternal trigger, TileEntity tile) {
|
||||
LinkedList<TriggerData> list = new LinkedList<TriggerData>();
|
||||
LinkedList<ITriggerExternal> triggerData = new LinkedList<ITriggerExternal>();
|
||||
if (tile instanceof IBuildcraft.TriggerProvider) {
|
||||
((IBuildcraft.TriggerProvider) tile).getTriggers(list);
|
||||
}
|
||||
for (TriggerData data : list) {
|
||||
if (data.getKey() == trigger) {
|
||||
return data.getValue();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ITriggerInternal> getInternalTriggers(IStatementContainer container) {
|
||||
return new ArrayList<>();
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
package binnie.core.triggers;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.power.IProcess;
|
||||
|
||||
// TODO unusing class?
|
||||
public class TriggerWorking {
|
||||
public static TriggerData isNotWorking(Object inventory) {
|
||||
IProcess process = Machine.getInterface(IProcess.class, inventory);
|
||||
boolean b = false;
|
||||
if (process != null) {
|
||||
b = (process.canWork() != null && process.canProgress() != null);
|
||||
}
|
||||
return new TriggerData(BinnieTrigger.triggerIsNotWorking, b);
|
||||
}
|
||||
|
||||
public static TriggerData isWorking(Object inventory) {
|
||||
IProcess process = Machine.getInterface(IProcess.class, inventory);
|
||||
boolean b = false;
|
||||
if (process != null) {
|
||||
b = (process.canWork() == null && process.canProgress() == null);
|
||||
}
|
||||
return new TriggerData(BinnieTrigger.triggerIsWorking, b);
|
||||
}
|
||||
|
||||
public static TriggerData canWork(Object inventory) {
|
||||
IProcess process = Machine.getInterface(IProcess.class, inventory);
|
||||
boolean b = false;
|
||||
if (process != null) {
|
||||
b = (process.canWork() == null);
|
||||
}
|
||||
return new TriggerData(BinnieTrigger.triggerCanWork, b);
|
||||
}
|
||||
|
||||
public static TriggerData cannotWork(Object inventory) {
|
||||
IProcess process = Machine.getInterface(IProcess.class, inventory);
|
||||
boolean b = false;
|
||||
if (process != null) {
|
||||
b = (process.canWork() != null);
|
||||
}
|
||||
return new TriggerData(BinnieTrigger.triggerCannotWork, b);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user