mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 12:42:53 +00:00
Refactoring some Gui Classes
This commit is contained in:
1 parent
2b54db9342
commit
065d795622
46 files changed
+204
-202
No files matched your search
@@ -11,17 +11,17 @@ import binnie.core.resource.IBinnieTexture;
|
||||
import binnie.core.resource.ResourceType;
|
||||
|
||||
public enum ExtraBeeTexture implements IBinnieTexture {
|
||||
AlvearyMutator(ResourceType.Tile, "alveary/AlvearyMutator"),
|
||||
AlvearyNovaBlock(ResourceType.Tile, "alveary/AlvearyNovaBlock"),
|
||||
AlvearyFrame(ResourceType.Tile, "alveary/AlvearyFrame"),
|
||||
AlvearyLighting(ResourceType.Tile, "alveary/AlvearyLighting"),
|
||||
AlvearyRainShield(ResourceType.Tile, "alveary/AlvearyRainShield"),
|
||||
AlvearyStimulator(ResourceType.Tile, "alveary/AlvearyStimulator"),
|
||||
AlvearyHatchery(ResourceType.Tile, "alveary/AlvearyHatchery"),
|
||||
AlvearyMutator(ResourceType.TILE, "alveary/AlvearyMutator"),
|
||||
AlvearyNovaBlock(ResourceType.TILE, "alveary/AlvearyNovaBlock"),
|
||||
AlvearyFrame(ResourceType.TILE, "alveary/AlvearyFrame"),
|
||||
AlvearyLighting(ResourceType.TILE, "alveary/AlvearyLighting"),
|
||||
AlvearyRainShield(ResourceType.TILE, "alveary/AlvearyRainShield"),
|
||||
AlvearyStimulator(ResourceType.TILE, "alveary/AlvearyStimulator"),
|
||||
AlvearyHatchery(ResourceType.TILE, "alveary/AlvearyHatchery"),
|
||||
FX(ResourceType.FX, "fx"),
|
||||
GUIProgress(ResourceType.GUI, "processes"),
|
||||
GUIProgress2(ResourceType.GUI, "processes2"),
|
||||
AlvearyTransmission(ResourceType.Tile, "alveary/AlvearyTransmission");
|
||||
AlvearyTransmission(ResourceType.TILE, "alveary/AlvearyTransmission");
|
||||
|
||||
private final String texture;
|
||||
private final ResourceType type;
|
||||
|
||||
@@ -369,7 +369,7 @@ public class ContainerCraftGUI extends Container {
|
||||
public void setMouseOverSlot(final Slot slot) {
|
||||
if (slot.slotNumber != this.mousedOverSlotNumber) {
|
||||
this.mousedOverSlotNumber = slot.slotNumber;
|
||||
ControlSlot.highlighting.get(EnumHighlighting.ShiftClick).clear();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.SHIFT_CLICK).clear();
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setShort("slot", (short) slot.slotNumber);
|
||||
this.window.sendClientAction("mouse-over-slot", nbt);
|
||||
@@ -399,9 +399,9 @@ public class ContainerCraftGUI extends Container {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void onRecieveShiftClickHighlights(final EntityPlayer player, final NBTTagCompound data) {
|
||||
ControlSlot.highlighting.get(EnumHighlighting.ShiftClick).clear();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.SHIFT_CLICK).clear();
|
||||
for (final int slotnumber : data.getIntArray("slots")) {
|
||||
ControlSlot.highlighting.get(EnumHighlighting.ShiftClick).add(slotnumber);
|
||||
ControlSlot.highlighting.get(EnumHighlighting.SHIFT_CLICK).add(slotnumber);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Help).clear();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.HELP).clear();
|
||||
ControlSlot.shiftClickActive = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,8 +53,8 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
public final void onUpdateClient() {
|
||||
this.errorState = this.getError();
|
||||
this.type = Window.get(this).getContainer().getErrorType();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Error).clear();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Warning).clear();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.ERROR).clear();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.WARNING).clear();
|
||||
ControlLiquidTank.tankError.clear();
|
||||
ControlEnergyBar.isError = false;
|
||||
if (!this.isMouseOver() || this.errorState == null) {
|
||||
@@ -71,9 +71,9 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
}
|
||||
if (id >= 0) {
|
||||
if (this.type == 0) {
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Error).add(id);
|
||||
ControlSlot.highlighting.get(EnumHighlighting.ERROR).add(id);
|
||||
} else {
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Warning).add(id);
|
||||
ControlSlot.highlighting.get(EnumHighlighting.WARNING).add(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
boolean highlighted = false;
|
||||
for (final Map.Entry<EnumHighlighting, List<Integer>> highlight : ControlSlot.highlighting.entrySet()) {
|
||||
if (highlight.getKey() == EnumHighlighting.ShiftClick && !ControlSlot.shiftClickActive) {
|
||||
if (highlight.getKey() == EnumHighlighting.SHIFT_CLICK && !ControlSlot.shiftClickActive) {
|
||||
continue;
|
||||
}
|
||||
if (highlighted || !highlight.getValue().contains(this.slot.slotNumber)) {
|
||||
@@ -102,7 +102,11 @@ public class ControlSlot extends ControlSlotBase {
|
||||
}
|
||||
highlighted = true;
|
||||
final int c = -1442840576 + Math.min(highlight.getKey().getColour(), 16777215);
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.disableDepth();
|
||||
RenderUtil.drawGradientRect(new Area(1, 1, 16, 16), c, c);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.enableDepth();
|
||||
}
|
||||
if (!highlighted && this.getTopParent().getMousedOverWidget() == this) {
|
||||
GuiCraftGUI gui = Window.get(this).getGui();
|
||||
@@ -123,7 +127,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
public void onRenderOverlay() {
|
||||
boolean highlighted = false;
|
||||
for (final Map.Entry<EnumHighlighting, List<Integer>> highlight : ControlSlot.highlighting.entrySet()) {
|
||||
if (highlight.getKey() == EnumHighlighting.ShiftClick && !ControlSlot.shiftClickActive) {
|
||||
if (highlight.getKey() == EnumHighlighting.SHIFT_CLICK && !ControlSlot.shiftClickActive) {
|
||||
continue;
|
||||
}
|
||||
if (highlighted || !highlight.getValue().contains(this.slot.slotNumber)) {
|
||||
@@ -151,7 +155,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
}
|
||||
if (Window.get(this).getGui().isHelpMode() && this.isMouseOver()) {
|
||||
for (final ControlSlot slot2 : this.getControlSlots()) {
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Help).add(slot2.slot.slotNumber);
|
||||
ControlSlot.highlighting.get(EnumHighlighting.HELP).add(slot2.slot.slotNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,23 +4,23 @@ import binnie.core.gui.Tooltip;
|
||||
import binnie.core.gui.minecraft.MinecraftTooltip;
|
||||
|
||||
public enum EnumHighlighting {
|
||||
Error,
|
||||
Warning,
|
||||
Help,
|
||||
ShiftClick;
|
||||
ERROR,
|
||||
WARNING,
|
||||
HELP,
|
||||
SHIFT_CLICK;
|
||||
|
||||
int getColour() {
|
||||
switch (this) {
|
||||
case Error: {
|
||||
case ERROR: {
|
||||
return MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
|
||||
}
|
||||
case Help: {
|
||||
case HELP: {
|
||||
return MinecraftTooltip.getOutline(Tooltip.Type.HELP);
|
||||
}
|
||||
case ShiftClick: {
|
||||
case SHIFT_CLICK: {
|
||||
return 16776960;
|
||||
}
|
||||
case Warning: {
|
||||
case WARNING: {
|
||||
return MinecraftTooltip.getOutline(MinecraftTooltip.Type.Warning);
|
||||
}
|
||||
default: {
|
||||
|
||||
@@ -37,11 +37,11 @@ public class ManagerResource {
|
||||
}
|
||||
|
||||
public BinnieSprite getItemSprite(final AbstractMod mod, final String iconFile) {
|
||||
return new BinnieSprite(mod, ResourceType.Item, iconFile);
|
||||
return new BinnieSprite(mod, ResourceType.ITEM, iconFile);
|
||||
}
|
||||
|
||||
public BinnieSprite getItemSprite(final String mod, final String iconFile) {
|
||||
return new BinnieSprite(mod, ResourceType.Item, iconFile);
|
||||
return new BinnieSprite(mod, ResourceType.ITEM, iconFile);
|
||||
}
|
||||
|
||||
public BinnieSprite getBlockSprite(final AbstractMod mod, final String iconFile) {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package binnie.core.resource;
|
||||
|
||||
public enum ResourceType {
|
||||
Item("items"),
|
||||
ITEM("items"),
|
||||
Block("blocks"),
|
||||
Tile("tile"),
|
||||
TILE("tile"),
|
||||
GUI("gui"),
|
||||
FX("fx"),
|
||||
Entity("entities");
|
||||
ENTITY("entities");
|
||||
|
||||
String name;
|
||||
|
||||
|
||||
@@ -12,12 +12,12 @@ import binnie.core.resource.IBinnieTexture;
|
||||
import binnie.core.resource.ResourceType;
|
||||
|
||||
public enum BinnieCoreTexture implements IBinnieTexture {
|
||||
COMPARTMENT(ResourceType.Tile, "compartment"),
|
||||
COMPARTMENT_IRON(ResourceType.Tile, "compartment_iron"),
|
||||
COMPARTMENT_DIAMOND(ResourceType.Tile, "compartment_diamond"),
|
||||
COMPARTMENT_COPPER(ResourceType.Tile, "compartment_copper"),
|
||||
COMPARTMENT_GOLD(ResourceType.Tile, "compartment_gold"),
|
||||
COMPARTMENT_BRONZE(ResourceType.Tile, "compartment_bronze"),
|
||||
COMPARTMENT(ResourceType.TILE, "compartment"),
|
||||
COMPARTMENT_IRON(ResourceType.TILE, "compartment_iron"),
|
||||
COMPARTMENT_DIAMOND(ResourceType.TILE, "compartment_diamond"),
|
||||
COMPARTMENT_COPPER(ResourceType.TILE, "compartment_copper"),
|
||||
COMPARTMENT_GOLD(ResourceType.TILE, "compartment_gold"),
|
||||
COMPARTMENT_BRONZE(ResourceType.TILE, "compartment_bronze"),
|
||||
GUI_BREEDING(ResourceType.GUI, "breeding"),
|
||||
GUI_ANALYST(ResourceType.GUI, "guianalyst"),
|
||||
GUI_PUNNETT(ResourceType.GUI, "punnett");
|
||||
|
||||
@@ -12,17 +12,17 @@ import binnie.core.resource.ResourceType;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
|
||||
public enum ExtraTreeTexture implements IBinnieTexture {
|
||||
Gui(ResourceType.GUI, "gui"),
|
||||
Nursery(ResourceType.Tile, "Nursery"),
|
||||
Carpenter(ResourceType.Tile, "extratrees/carpenter_"),
|
||||
Paneler(ResourceType.Tile, "extratrees/paneler_"),
|
||||
Tileworker(ResourceType.Tile, "extratrees/tileworker_"),
|
||||
Incubator(ResourceType.Tile, "extratrees/incubator_"),
|
||||
Lumbermill(ResourceType.Tile, "extratrees/sawmill_"),
|
||||
Press(ResourceType.Tile, "extratrees/press_"),
|
||||
Distillery(ResourceType.Tile, "extratrees/distillery_"),
|
||||
Brewery(ResourceType.Tile, "extratrees/brewery_"),
|
||||
Infuser(ResourceType.Tile, "extratrees/infuser_");
|
||||
GUI(ResourceType.GUI, "gui"),
|
||||
NURSERY(ResourceType.TILE, "Nursery"),
|
||||
CARPENTER(ResourceType.TILE, "extratrees/carpenter_"),
|
||||
PANELER(ResourceType.TILE, "extratrees/paneler_"),
|
||||
TILEWORKER(ResourceType.TILE, "extratrees/tileworker_"),
|
||||
INCUBATOR(ResourceType.TILE, "extratrees/incubator_"),
|
||||
LUMBERMILL(ResourceType.TILE, "extratrees/sawmill_"),
|
||||
PRESS(ResourceType.TILE, "extratrees/press_"),
|
||||
DISTILLERY(ResourceType.TILE, "extratrees/distillery_"),
|
||||
BREWERY(ResourceType.TILE, "extratrees/brewery_"),
|
||||
INFUSER(ResourceType.TILE, "extratrees/infuser_");
|
||||
|
||||
private final String texture;
|
||||
private final ResourceType type;
|
||||
|
||||
@@ -10,30 +10,30 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.gui.minecraft.Window;
|
||||
import binnie.extratrees.gui.WindowSetSquare;
|
||||
import binnie.extratrees.gui.database.WindowArboristDatabase;
|
||||
import binnie.extratrees.gui.machines.WindowBrewery;
|
||||
import binnie.extratrees.gui.machines.WindowDesigner;
|
||||
import binnie.extratrees.gui.machines.WindowDistillery;
|
||||
import binnie.extratrees.gui.machines.WindowLepidopteristDatabase;
|
||||
import binnie.extratrees.gui.machines.WindowLumbermill;
|
||||
import binnie.extratrees.gui.machines.WindowPress;
|
||||
import binnie.extratrees.gui.machines.WindowSetSquare;
|
||||
import binnie.extratrees.gui.database.WindowLepidopteristDatabase;
|
||||
import binnie.extratrees.kitchen.craftgui.WindowBottleRack;
|
||||
import binnie.extratrees.machines.brewery.WindowBrewery;
|
||||
import binnie.extratrees.machines.designer.WindowDesigner;
|
||||
import binnie.extratrees.machines.distillery.WindowDistillery;
|
||||
import binnie.extratrees.machines.fruitpress.WindowPress;
|
||||
import binnie.extratrees.machines.lumbermill.WindowLumbermill;
|
||||
|
||||
public enum ExtraTreesGUID implements IBinnieGUID {
|
||||
Database,
|
||||
Woodworker,
|
||||
Lumbermill,
|
||||
DatabaseNEI,
|
||||
Incubator,
|
||||
MothDatabase,
|
||||
MothDatabaseNEI,
|
||||
Press,
|
||||
Brewery,
|
||||
Distillery,
|
||||
KitchenBottleRack,
|
||||
Infuser,
|
||||
SetSquare;
|
||||
DATABASE,
|
||||
WOODWORKER,
|
||||
LUMBERMILL,
|
||||
DATABASE_NEI,
|
||||
INCUBATOR,
|
||||
MOTH_DATABASE,
|
||||
MOTH_DATABASE_NEI,
|
||||
PRESS,
|
||||
BREWERY,
|
||||
DISTILLERY,
|
||||
KITCHEN_BOTTLE_RACK,
|
||||
INFUSER,
|
||||
SET_SQUARE;
|
||||
|
||||
@Override
|
||||
public Window getWindow(final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side) {
|
||||
@@ -44,41 +44,41 @@ public enum ExtraTreesGUID implements IBinnieGUID {
|
||||
object = (IInventory) tileEntity;
|
||||
}
|
||||
switch (this) {
|
||||
case Database:
|
||||
case DatabaseNEI: {
|
||||
window = WindowArboristDatabase.create(player, side, this != ExtraTreesGUID.Database);
|
||||
case DATABASE:
|
||||
case DATABASE_NEI: {
|
||||
window = WindowArboristDatabase.create(player, side, this != ExtraTreesGUID.DATABASE);
|
||||
break;
|
||||
}
|
||||
case Woodworker: {
|
||||
case WOODWORKER: {
|
||||
window = WindowDesigner.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case Lumbermill: {
|
||||
case LUMBERMILL: {
|
||||
window = WindowLumbermill.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case KitchenBottleRack: {
|
||||
case KITCHEN_BOTTLE_RACK: {
|
||||
window = WindowBottleRack.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case Press: {
|
||||
case PRESS: {
|
||||
window = WindowPress.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case Brewery: {
|
||||
case BREWERY: {
|
||||
window = WindowBrewery.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case Distillery: {
|
||||
case DISTILLERY: {
|
||||
window = WindowDistillery.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case MothDatabase:
|
||||
case MothDatabaseNEI: {
|
||||
window = WindowLepidopteristDatabase.create(player, side, this != ExtraTreesGUID.MothDatabase);
|
||||
case MOTH_DATABASE:
|
||||
case MOTH_DATABASE_NEI: {
|
||||
window = WindowLepidopteristDatabase.create(player, side, this != ExtraTreesGUID.MOTH_DATABASE);
|
||||
break;
|
||||
}
|
||||
case SetSquare: {
|
||||
case SET_SQUARE: {
|
||||
window = WindowSetSquare.create(player, world, x, y, z, side);
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.gui;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.gui.database;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
@@ -35,7 +35,6 @@ import binnie.core.gui.geometry.Point;
|
||||
import binnie.core.gui.geometry.TextJustification;
|
||||
import binnie.core.gui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.gui.machines.ControlBlockIconDisplay;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class PageSpeciesTreeGenome extends PageSpecies {
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.gui.database;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
@@ -18,7 +18,6 @@ import binnie.core.gui.database.PageSpeciesResultant;
|
||||
import binnie.core.gui.database.WindowAbstractDatabase;
|
||||
import binnie.core.gui.minecraft.Window;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.gui.database.PageSpeciesImage;
|
||||
|
||||
public class WindowLepidopteristDatabase extends WindowAbstractDatabase {
|
||||
public WindowLepidopteristDatabase(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
@@ -1,9 +0,0 @@
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@FieldsAreNonnullByDefault
|
||||
package binnie.extratrees.gui.machines;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import binnie.core.util.FieldsAreNonnullByDefault;
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
+2
-2
@@ -25,8 +25,8 @@ import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeCategory;
|
||||
|
||||
public class DistilleryRecipeCategory extends BlankRecipeCategory<DistilleryRecipeWrapper> {
|
||||
private static final Texture DISTILLERY_BASE = new StandardTexture(43, 0, 58, 60, ExtraTreeTexture.Gui);
|
||||
private static final Texture LIQUID_FLOW = new StandardTexture(101, 0, 38, 60, ExtraTreeTexture.Gui);
|
||||
private static final Texture DISTILLERY_BASE = new StandardTexture(43, 0, 58, 60, ExtraTreeTexture.GUI);
|
||||
private static final Texture LIQUID_FLOW = new StandardTexture(101, 0, 38, 60, ExtraTreeTexture.GUI);
|
||||
|
||||
private final ITickTimer progress;
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import binnie.core.gui.CraftGUI;
|
||||
import binnie.core.gui.geometry.Point;
|
||||
import binnie.extratrees.gui.machines.ControlDistilleryProgress;
|
||||
import binnie.extratrees.machines.distillery.ControlDistilleryProgress;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
|
||||
|
||||
@@ -60,9 +60,9 @@ public class ItemArboristDatabase extends Item implements IItemModelRegister {
|
||||
ItemStack itemStack = player.getHeldItem(hand);
|
||||
final ExtraTreesGUID id;
|
||||
if (isMaster(itemStack)) {
|
||||
id = ExtraTreesGUID.DatabaseNEI;
|
||||
id = ExtraTreesGUID.DATABASE_NEI;
|
||||
} else {
|
||||
id = ExtraTreesGUID.Database;
|
||||
id = ExtraTreesGUID.DATABASE;
|
||||
}
|
||||
|
||||
ExtraTrees.proxy.openGui(id, player, player.getPosition());
|
||||
|
||||
@@ -60,9 +60,9 @@ public class ItemMothDatabase extends Item implements IItemModelRegister {
|
||||
ItemStack itemStack = player.getHeldItem(hand);
|
||||
final ExtraTreesGUID id;
|
||||
if (isMaster(itemStack)) {
|
||||
id = ExtraTreesGUID.MothDatabaseNEI;
|
||||
id = ExtraTreesGUID.MOTH_DATABASE_NEI;
|
||||
} else {
|
||||
id = ExtraTreesGUID.MothDatabase;
|
||||
id = ExtraTreesGUID.MOTH_DATABASE;
|
||||
}
|
||||
|
||||
ExtraTrees.proxy.openGui(id, player, player.getPosition());
|
||||
|
||||
@@ -10,12 +10,12 @@ import binnie.extratrees.machines.ExtraTreeMachine;
|
||||
public class BottleRack {
|
||||
public static class PackageBottleRack extends KitchenMachine.PackageKitchenMachine implements IMachineInformation {
|
||||
public PackageBottleRack() {
|
||||
super("bottleRack", ExtraTreeTexture.Lumbermill);
|
||||
super("bottleRack", ExtraTreeTexture.LUMBERMILL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.KitchenBottleRack);
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.KITCHEN_BOTTLE_RACK);
|
||||
final ComponentTankContainer inventory = new ComponentTankContainer(machine);
|
||||
for (int x = 0; x < 36; ++x) {
|
||||
inventory.addTank(x, "input", 1000);
|
||||
|
||||
@@ -25,12 +25,12 @@ public class BreweryMachine extends ExtraTreeMachine.PackageExtraTreeMachine imp
|
||||
public static final int[] SLOTS_INVENTORY = new int[]{5, 6, 7, 8, 9, 10, 11, 12, 13};
|
||||
|
||||
public BreweryMachine() {
|
||||
super("brewery", ExtraTreeTexture.Brewery, true);
|
||||
super("brewery", ExtraTreeTexture.BREWERY, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.Brewery);
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.BREWERY);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
|
||||
inventory.addSlotArray(SLOT_RECIPE_GRAINS, "grain");
|
||||
|
||||
+3
-5
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.brewery;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -22,12 +22,10 @@ import binnie.core.gui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.util.ItemStackSet;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.brewery.BreweryLogic;
|
||||
import binnie.extratrees.machines.brewery.BreweryRecipes;
|
||||
|
||||
public class ControlBreweryProgress extends ControlProgressBase {
|
||||
static Texture Brewery = new StandardTexture(0, 69, 34, 39, ExtraTreeTexture.Gui);
|
||||
static Texture BreweryOverlay = new StandardTexture(34, 69, 34, 39, ExtraTreeTexture.Gui);
|
||||
static Texture Brewery = new StandardTexture(0, 69, 34, 39, ExtraTreeTexture.GUI);
|
||||
static Texture BreweryOverlay = new StandardTexture(34, 69, 34, 39, ExtraTreeTexture.GUI);
|
||||
|
||||
protected ControlBreweryProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 34, 39);
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.brewery;
|
||||
|
||||
import binnie.core.gui.IWidget;
|
||||
import binnie.core.gui.minecraft.Dialog;
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.brewery;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -18,7 +18,6 @@ import binnie.core.gui.minecraft.control.ControlSlot;
|
||||
import binnie.core.gui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.brewery.BreweryMachine;
|
||||
|
||||
public class WindowBrewery extends Window {
|
||||
public WindowBrewery(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.designer;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.designer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -33,7 +33,6 @@ import binnie.extratrees.api.CarpentryManager;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.api.IDesignCategory;
|
||||
import binnie.extratrees.carpentry.EnumDesign;
|
||||
import binnie.extratrees.machines.designer.ComponentDesignerRecipe;
|
||||
|
||||
public class ControlTileSelect extends Control implements IControlValue<IDesign>, IControlScrollable {
|
||||
IDesign value;
|
||||
@@ -17,11 +17,11 @@ import binnie.extratrees.carpentry.ModuleCarpentry;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
|
||||
public enum DesignerType {
|
||||
Woodworker("woodworker", ExtraTreeTexture.Carpenter),
|
||||
Panelworker("panelworker", ExtraTreeTexture.Paneler),
|
||||
GlassWorker("glassworker", ExtraTreeTexture.Paneler),
|
||||
Woodworker("woodworker", ExtraTreeTexture.CARPENTER),
|
||||
Panelworker("panelworker", ExtraTreeTexture.PANELER),
|
||||
GlassWorker("glassworker", ExtraTreeTexture.PANELER),
|
||||
// TODO why is this the Paneler texture?
|
||||
Tileworker("tileworker", ExtraTreeTexture.Tileworker);
|
||||
Tileworker("tileworker", ExtraTreeTexture.TILEWORKER);
|
||||
|
||||
public String name;
|
||||
public IBinnieTexture texture;
|
||||
|
||||
@@ -16,7 +16,7 @@ public abstract class PackageDesigner extends ExtraTreeMachine.PackageExtraTreeM
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.Woodworker);
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.WOODWORKER);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(Designer.BEESWAX_SLOT, "polish").setValidator(new SlotValidatorBeeswax(this.type));
|
||||
inventory.addSlot(Designer.DESIGN_SLOT_1, "wood").setValidator(new SlotValidatorPlanks(this.type));
|
||||
|
||||
+1
-4
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.designer;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -26,9 +26,6 @@ import binnie.core.gui.window.Panel;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.designer.ComponentDesignerRecipe;
|
||||
import binnie.extratrees.machines.designer.Designer;
|
||||
import binnie.extratrees.machines.designer.DesignerType;
|
||||
|
||||
public class WindowDesigner extends Window {
|
||||
ControlTextEdit textEdit;
|
||||
+5
-6
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.distillery;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -21,13 +21,12 @@ import binnie.core.gui.resource.Texture;
|
||||
import binnie.core.gui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.distillery.DistilleryLogic;
|
||||
|
||||
public class ControlDistilleryProgress extends ControlProgressBase {
|
||||
public static final Texture DISTILLERY_BASE = new StandardTexture(43, 0, 58, 66, ExtraTreeTexture.Gui);
|
||||
public static final Texture DISTILLERY_OVERLAY = new StandardTexture(139, 0, 18, 66, ExtraTreeTexture.Gui);
|
||||
public static final Texture LIQUID_FLOW = new StandardTexture(101, 0, 38, 66, ExtraTreeTexture.Gui);
|
||||
public static final Texture OUTPUT = new StandardTexture(68, 66, 17, 7, ExtraTreeTexture.Gui);
|
||||
public static final Texture DISTILLERY_BASE = new StandardTexture(43, 0, 58, 66, ExtraTreeTexture.GUI);
|
||||
public static final Texture DISTILLERY_OVERLAY = new StandardTexture(139, 0, 18, 66, ExtraTreeTexture.GUI);
|
||||
public static final Texture LIQUID_FLOW = new StandardTexture(101, 0, 38, 66, ExtraTreeTexture.GUI);
|
||||
public static final Texture OUTPUT = new StandardTexture(68, 66, 17, 7, ExtraTreeTexture.GUI);
|
||||
|
||||
protected ControlDistilleryProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 58, 66);
|
||||
@@ -19,12 +19,12 @@ public class DistilleryMachine extends ExtraTreeMachine.PackageExtraTreeMachine
|
||||
public static final int TANK_OUTPUT = 1;
|
||||
|
||||
public DistilleryMachine() {
|
||||
super("distillery", ExtraTreeTexture.Distillery, true);
|
||||
super("distillery", ExtraTreeTexture.DISTILLERY, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.Distillery);
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.DISTILLERY);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
final ComponentTankContainer tanks = new ComponentTankContainer(machine);
|
||||
|
||||
|
||||
@@ -14,12 +14,13 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class DistilleryRecipes {
|
||||
private static final int LEVELS = 3;
|
||||
private static final List<Map<Fluid, Pair<FluidStack, FluidStack>>> recipes = new ArrayList<>();
|
||||
|
||||
static {
|
||||
recipes.add(new HashMap<>());
|
||||
recipes.add(new HashMap<>());
|
||||
recipes.add(new HashMap<>());
|
||||
for(int i = 0;i < LEVELS;i++) {
|
||||
recipes.add(new HashMap<>());
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -35,7 +36,7 @@ public class DistilleryRecipes {
|
||||
}
|
||||
|
||||
public static boolean isValidInputLiquid(final FluidStack fluid) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int i = 0; i < LEVELS; ++i) {
|
||||
Map<Fluid, Pair<FluidStack, FluidStack>> recipesForLevel = recipes.get(i);
|
||||
Pair<FluidStack, FluidStack> recipe = recipesForLevel.get(fluid.getFluid());
|
||||
if (recipe.getKey().isFluidEqual(fluid)) {
|
||||
@@ -46,7 +47,7 @@ public class DistilleryRecipes {
|
||||
}
|
||||
|
||||
public static boolean isValidOutputLiquid(final FluidStack fluid) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int i = 0; i < LEVELS; ++i) {
|
||||
Map<Fluid, Pair<FluidStack, FluidStack>> recipesForLevel = recipes.get(i);
|
||||
for (final Pair<FluidStack, FluidStack> recipe : recipesForLevel.values()) {
|
||||
if (recipe.getValue().isFluidEqual(fluid)) {
|
||||
|
||||
+1
-3
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.distillery;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -17,8 +17,6 @@ import binnie.core.gui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.core.gui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.distillery.DistilleryLogic;
|
||||
import binnie.extratrees.machines.distillery.DistilleryMachine;
|
||||
|
||||
public class WindowDistillery extends Window {
|
||||
public WindowDistillery(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
+3
-5
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.fruitpress;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -23,12 +23,10 @@ import binnie.core.gui.renderer.RenderUtil;
|
||||
import binnie.core.gui.resource.Texture;
|
||||
import binnie.core.gui.resource.minecraft.StandardTexture;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressMachine;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressRecipes;
|
||||
|
||||
public class ControlFruitPressProgress extends ControlProgressBase {
|
||||
private static final Texture PressTexture = new StandardTexture(6, 0, 24, 52, ExtraTreeTexture.Gui);
|
||||
private static final Texture PressSlot = new StandardTexture(9, 52, 34, 17, ExtraTreeTexture.Gui);
|
||||
private static final Texture PressTexture = new StandardTexture(6, 0, 24, 52, ExtraTreeTexture.GUI);
|
||||
private static final Texture PressSlot = new StandardTexture(9, 52, 34, 17, ExtraTreeTexture.GUI);
|
||||
|
||||
protected ControlFruitPressProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 37, 69);
|
||||
@@ -21,12 +21,12 @@ public class FruitPressMachine extends ExtraTreeMachine.PackageExtraTreeMachine
|
||||
public static final int TANK_OUTPUT_CAPACITY = 5000;
|
||||
|
||||
public FruitPressMachine() {
|
||||
super("press", ExtraTreeTexture.Press, true);
|
||||
super("press", ExtraTreeTexture.PRESS, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.Press);
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.PRESS);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
final InventorySlot input = inventory.addSlot(SLOT_FRUIT, "input");
|
||||
input.setValidator(new SlotValidatorSqueezable());
|
||||
|
||||
+1
-3
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.fruitpress;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -20,8 +20,6 @@ import binnie.core.gui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.gui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressLogic;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressMachine;
|
||||
|
||||
public class WindowPress extends Window {
|
||||
public WindowPress(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
@@ -16,12 +16,12 @@ import binnie.extratrees.machines.ExtraTreeMachine;
|
||||
|
||||
public class InfuserMachine extends ExtraTreeMachine.PackageExtraTreeMachine implements IMachineInformation {
|
||||
public InfuserMachine() {
|
||||
super("infuser", ExtraTreeTexture.Infuser, true);
|
||||
super("infuser", ExtraTreeTexture.INFUSER, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.Infuser);
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.INFUSER);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
final ComponentTankContainer tanks = new ComponentTankContainer(machine);
|
||||
|
||||
|
||||
+29
-8
@@ -1,7 +1,13 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.lumbermill;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemModelMesher;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -17,16 +23,15 @@ import binnie.core.gui.geometry.Point;
|
||||
import binnie.core.gui.minecraft.MinecraftGUI;
|
||||
import binnie.core.gui.minecraft.Window;
|
||||
import binnie.core.gui.minecraft.control.ControlProgressBase;
|
||||
import binnie.core.gui.renderer.RenderUtil;
|
||||
import binnie.core.gui.resource.Texture;
|
||||
import binnie.core.gui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.gui.window.Panel;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillMachine;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillRecipes;
|
||||
|
||||
public class ControlLumbermillProgress extends ControlProgressBase {
|
||||
static Texture Saw = new StandardTexture(0, 0, 6, 32, ExtraTreeTexture.Gui);
|
||||
static Texture Saw2 = new StandardTexture(2, 0, 4, 32, ExtraTreeTexture.Gui);
|
||||
static final Texture SAW = new StandardTexture(0, 0, 6, 32, ExtraTreeTexture.GUI);
|
||||
static final Texture SAW_2 = new StandardTexture(2, 0, 4, 32, ExtraTreeTexture.GUI);
|
||||
float oldProgress;
|
||||
float animation;
|
||||
|
||||
@@ -51,7 +56,7 @@ public class ControlLumbermillProgress extends ControlProgressBase {
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
GlStateManager.disableLighting();
|
||||
final int sawX = (int) (63 * this.progress);
|
||||
CraftGUI.RENDER.texture(ControlLumbermillProgress.Saw, new Point(sawX, -8 + Math.round(6 * (float) Math.sin(this.animation))));
|
||||
CraftGUI.RENDER.texture(ControlLumbermillProgress.SAW, new Point(sawX, -8 + Math.round(6 * (float) Math.sin(this.animation))));
|
||||
final ItemStack item = Window.get(this).getInventory().getStackInSlot(LumbermillMachine.SLOT_LOG);
|
||||
if (item.isEmpty()) {
|
||||
return;
|
||||
@@ -66,8 +71,10 @@ public class ControlLumbermillProgress extends ControlProgressBase {
|
||||
}
|
||||
//TODO RENDERING
|
||||
//final IIcon icon = block.getIcon(2, item.getItemDamage());
|
||||
TextureAtlasSprite icon = getWoodSprite(item);
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
//CraftGUI.Render.iconBlock(new IPoint(1 + i * 16, 1), icon);
|
||||
RenderUtil.drawSprite(new Point(1 + i * 16, 1), icon);
|
||||
}
|
||||
final ItemStack result = LumbermillRecipes.getPlankProduct(item);
|
||||
if (result == null) {
|
||||
@@ -81,15 +88,29 @@ public class ControlLumbermillProgress extends ControlProgressBase {
|
||||
return;
|
||||
}
|
||||
//final IIcon icon2 = block2.getIcon(2, result.getItemDamage());
|
||||
TextureAtlasSprite sprite = getWoodSprite(result);
|
||||
final Point size = this.getSize();
|
||||
final Point pos = this.getAbsolutePosition();
|
||||
CraftGUI.RENDER.limitArea(new Area(pos.add(Point.ZERO), new Point(Math.round(this.progress * 64) + 2, 18)), guiWidth, guiHeight);
|
||||
GL11.glEnable(GL11.GL_SCISSOR_TEST);
|
||||
for (int j = 0; j < 4; ++j) {
|
||||
//TODO RENDERING
|
||||
//CraftGUI.Render.iconBlock(new IPoint(1 + j * 16, 1), icon2);
|
||||
RenderUtil.drawSprite(new Point(1 + j * 16, 1), sprite);
|
||||
}
|
||||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||
CraftGUI.RENDER.texture(ControlLumbermillProgress.Saw2, new Point(sawX + 2, -8 + Math.round(6 * (float) Math.sin(this.animation))));
|
||||
CraftGUI.RENDER.texture(ControlLumbermillProgress.SAW, new Point(sawX, -8 + Math.round(6 * (float) Math.sin(this.animation))));
|
||||
CraftGUI.RENDER.texture(ControlLumbermillProgress.SAW_2, new Point(sawX + 2, -8 + Math.round(6 * (float) Math.sin(this.animation))));
|
||||
}
|
||||
|
||||
private TextureAtlasSprite getWoodSprite(ItemStack stack){
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
|
||||
ItemModelMesher modelMesher = renderItem.getItemModelMesher();
|
||||
IBakedModel model = modelMesher.getItemModel(stack);
|
||||
TextureAtlasSprite sprite = model.getParticleTexture();
|
||||
if(sprite == mc.getTextureMapBlocks().getMissingSprite()){
|
||||
return getWoodSprite(new ItemStack(Blocks.LOG));
|
||||
}
|
||||
return sprite;
|
||||
}
|
||||
}
|
||||
@@ -25,12 +25,12 @@ public class LumbermillMachine extends ExtraTreeMachine.PackageExtraTreeMachine
|
||||
public static final int TANK_WATER_CAPACITY = 10000;
|
||||
|
||||
public LumbermillMachine() {
|
||||
super("lumbermill", ExtraTreeTexture.Lumbermill, true);
|
||||
super("lumbermill", ExtraTreeTexture.LUMBERMILL, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.Lumbermill);
|
||||
new ExtraTreeMachine.ComponentExtraTreeGUI(machine, ExtraTreesGUID.LUMBERMILL);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
|
||||
InventorySlot slotLog = inventory.addSlot(SLOT_LOG, "input");
|
||||
|
||||
@@ -59,25 +59,27 @@ public class LumbermillRecipes {
|
||||
|
||||
List<IWoodType> registeredWoodTypes = TreeManager.woodAccess.getRegisteredWoodTypes();
|
||||
for (IWoodType woodType : registeredWoodTypes) {
|
||||
ItemStack logStack = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.LOG, false);
|
||||
ItemStack logCopy = logStack.copy();
|
||||
logCopy.setCount(1);
|
||||
for(boolean fireproof : new boolean[]{true, false}) {
|
||||
ItemStack logStack = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.LOG, fireproof);
|
||||
ItemStack logCopy = logStack.copy();
|
||||
logCopy.setCount(1);
|
||||
|
||||
fakeCraftingInventory.clear();
|
||||
fakeCraftingInventory.setInventorySlotContents(0, logCopy);
|
||||
fakeCraftingInventory.clear();
|
||||
fakeCraftingInventory.setInventorySlotContents(0, logCopy);
|
||||
|
||||
try {
|
||||
ItemStack recipeOutput = craftingManager.findMatchingRecipe(fakeCraftingInventory, FakeCraftingWorld.getInstance());
|
||||
if (!recipeOutput.isEmpty()) {
|
||||
if (OreDictionaryUtil.hasOreId(recipeOutput, plankOreId)) {
|
||||
Item logItem = logCopy.getItem();
|
||||
ItemStack outputCopy = recipeOutput.copy();
|
||||
outputCopy.setCount((int) Math.ceil(outputCopy.getCount() * 1.5f)); // turns stack of 4 up to 6
|
||||
recipes.put(logItem, Pair.of(logCopy, outputCopy));
|
||||
try {
|
||||
ItemStack recipeOutput = craftingManager.findMatchingRecipe(fakeCraftingInventory, FakeCraftingWorld.getInstance());
|
||||
if (!recipeOutput.isEmpty()) {
|
||||
if (OreDictionaryUtil.hasOreId(recipeOutput, plankOreId)) {
|
||||
Item logItem = logCopy.getItem();
|
||||
ItemStack outputCopy = recipeOutput.copy();
|
||||
outputCopy.setCount((int) Math.ceil(outputCopy.getCount() * 1.5f)); // turns stack of 4 up to 6
|
||||
recipes.put(logItem, Pair.of(logCopy, outputCopy));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException ignored) {
|
||||
} catch (RuntimeException ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
package binnie.extratrees.gui.machines;
|
||||
package binnie.extratrees.machines.lumbermill;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -17,7 +17,6 @@ import binnie.core.gui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.gui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillMachine;
|
||||
|
||||
public class WindowLumbermill extends Window {
|
||||
public WindowLumbermill(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
@@ -26,7 +26,7 @@ public class MachineRendererNursery {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(x + 0.5, y, z + 0.5);
|
||||
GlStateManager.scale(0.05, 0.05, 0.05);
|
||||
BinnieCore.getBinnieProxy().bindTexture(new BinnieResource(ExtraTrees.instance, ResourceType.Tile, "test.png"));
|
||||
BinnieCore.getBinnieProxy().bindTexture(new BinnieResource(ExtraTrees.instance, ResourceType.TILE, "test.png"));
|
||||
//this.casinoMachine.renderAll();
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public class Nursery {
|
||||
|
||||
public static class PackageNursery extends ExtraTreeMachine.PackageExtraTreeMachine {
|
||||
public PackageNursery() {
|
||||
super("nursery", ExtraTreeTexture.Nursery, false);
|
||||
super("nursery", ExtraTreeTexture.NURSERY, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,22 +13,22 @@ import binnie.core.resource.ResourceType;
|
||||
import binnie.genetics.Genetics;
|
||||
|
||||
public enum GeneticsTexture implements IBinnieTexture {
|
||||
GENETIC_MACHINE(ResourceType.Tile, "GeneticMachine"),
|
||||
GENEPOOL(ResourceType.Tile, "genepool"),
|
||||
INCUBATOR(ResourceType.Tile, "incubator"),
|
||||
GENETIC_MACHINE(ResourceType.TILE, "GeneticMachine"),
|
||||
GENEPOOL(ResourceType.TILE, "genepool"),
|
||||
INCUBATOR(ResourceType.TILE, "incubator"),
|
||||
GUI_PROCESS(ResourceType.GUI, "process"),
|
||||
GUI_PROCESS_2(ResourceType.GUI, "process2"),
|
||||
GUI_PROCESS_3(ResourceType.GUI, "process3"),
|
||||
ISOLATOR(ResourceType.Tile, "isolator"),
|
||||
SEQUENCER(ResourceType.Tile, "sequencer"),
|
||||
POLYMERISER(ResourceType.Tile, "polymeriser"),
|
||||
INOCULATOR(ResourceType.Tile, "inoculator"),
|
||||
ANALYSER(ResourceType.Tile, "analyser"),
|
||||
MACHINE_GLOW(ResourceType.Tile, "MachineGlow"),
|
||||
GENE_BANK(ResourceType.Tile, "GeneBank"),
|
||||
LAB_MACHINE(ResourceType.Tile, "lab_machine"),
|
||||
ACCLIMATISER(ResourceType.Tile, "acclimatiser"),
|
||||
SPLICER(ResourceType.Tile, "splicer");
|
||||
ISOLATOR(ResourceType.TILE, "isolator"),
|
||||
SEQUENCER(ResourceType.TILE, "sequencer"),
|
||||
POLYMERISER(ResourceType.TILE, "polymeriser"),
|
||||
INOCULATOR(ResourceType.TILE, "inoculator"),
|
||||
ANALYSER(ResourceType.TILE, "analyser"),
|
||||
MACHINE_GLOW(ResourceType.TILE, "MachineGlow"),
|
||||
GENE_BANK(ResourceType.TILE, "GeneBank"),
|
||||
LAB_MACHINE(ResourceType.TILE, "lab_machine"),
|
||||
ACCLIMATISER(ResourceType.TILE, "acclimatiser"),
|
||||
SPLICER(ResourceType.TILE, "splicer");
|
||||
|
||||
public static BinnieSprite dnaIcon = Binnie.RESOURCE.getItemSprite(Genetics.instance, "dna");
|
||||
|
||||
|
||||
@@ -33,11 +33,11 @@ genetics.errors.press.no.fruit.desc=No Fruit
|
||||
extratrees.machine.machine.lumbermill=Lumbermill
|
||||
extratrees.machine.machine.lumbermill.info=The Lumbermill converts logs into planks at an increased rate, and produces byproducts such as sawdust and bark.
|
||||
extratrees.machine.machine.lumbermill.tooltips.logs=Logs
|
||||
genetics.errors.lumbermill.insufficient.water=Not enough water
|
||||
genetics.errors.lumbermill.no.wood.desc=No Wood
|
||||
genetics.errors.lumbermill.space.bark.desc=No room for new bark
|
||||
genetics.errors.lumbermill.space.saw_dust.desc=No room for new sawdust
|
||||
genetics.errors.lumbermill.space.planks.desc=No room for new planks
|
||||
extratrees.errors.lumbermill.insufficient.water.desc=Not enough water
|
||||
extratrees.errors.lumbermill.no.wood.desc=No Wood
|
||||
extratrees.errors.lumbermill.space.bark.desc=No room for new bark
|
||||
extratrees.errors.lumbermill.space.saw_dust.desc=No room for new sawdust
|
||||
extratrees.errors.lumbermill.space.planks.desc=No room for new planks
|
||||
|
||||
extratrees.machine.machine.nursery=Nursery
|
||||
|
||||
|
||||
Reference in new issue
Block a user