mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-20 20:22:35 +00:00
Move some craftguis
This commit is contained in:
1 parent
fff40b966d
commit
49d80c847e
57 files changed
+114
-99
No files matched your search
@@ -8,6 +8,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -38,10 +39,15 @@ public class BlockStainedDesign extends BlockDesign {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(BlockRenderLayer layer) {
|
||||
return layer == BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getRenderPasses() {
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package binnie.extratrees.core;
|
||||
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowArboristDatabase;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowBrewery;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowDistillery;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowLepidopteristDatabase;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowLumbermill;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowPress;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowSetSquare;
|
||||
import binnie.craftgui.extratrees.dictionary.WindowWoodworker;
|
||||
import binnie.craftgui.extratrees.kitchen.WindowBottleRack;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.extratrees.item.craftgui.WindowArboristDatabase;
|
||||
import binnie.extratrees.item.craftgui.WindowBrewery;
|
||||
import binnie.extratrees.item.craftgui.WindowDistillery;
|
||||
import binnie.extratrees.item.craftgui.WindowLepidopteristDatabase;
|
||||
import binnie.extratrees.item.craftgui.WindowLumbermill;
|
||||
import binnie.extratrees.item.craftgui.WindowPress;
|
||||
import binnie.extratrees.item.craftgui.WindowSetSquare;
|
||||
import binnie.extratrees.item.craftgui.WindowWoodworker;
|
||||
import binnie.extratrees.kitchen.craftgui.WindowBottleRack;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package binnie.extratrees.integration.jei.distillery.brewery;
|
||||
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.extratrees.dictionary.ControlDistilleryProgress;
|
||||
import binnie.extratrees.item.craftgui.ControlDistilleryProgress;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
package binnie.extratrees.item;
|
||||
|
||||
import binnie.extratrees.api.IToolHammer;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemHammer extends Item implements IToolHammer {
|
||||
boolean isDurableHammer;
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerIcons(final IIconRegister register) {
|
||||
// this.itemIcon = ExtraTrees.proxy.getIcon(register, this.isDurableHammer ? "durableHammer" : "carpentryHammer");
|
||||
// }
|
||||
public class ItemHammer extends Item implements IToolHammer, IItemModelRegister {
|
||||
private boolean isDurableHammer;
|
||||
|
||||
public ItemHammer(final boolean durable) {
|
||||
this.isDurableHammer = false;
|
||||
@@ -24,6 +22,12 @@ public class ItemHammer extends Item implements IToolHammer {
|
||||
this.setMaxDamage(durable ? 1562 : 251);
|
||||
setRegistryName(durable ? "durableHammer" : "hammer");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerItemModel(item, 0, isDurableHammer ? "durableHammer" : "carpentryHammer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack i) {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
public class ControlBlockIconDisplay extends Control {
|
||||
TextureAtlasSprite icon;
|
||||
|
||||
public ControlBlockIconDisplay(final IWidget parent, final int x, final int y, final TextureAtlasSprite icon) {
|
||||
super(parent, x, y, 18, 18);
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
RenderUtil.drawSprite(IPoint.ZERO, this.icon);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.util.ItemStackSet;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlProgressBase;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.brewery.BreweryLogic;
|
||||
import binnie.extratrees.machines.brewery.BreweryRecipes;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
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);
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(ControlBreweryProgress.Brewery, IPoint.ZERO);
|
||||
final BreweryLogic logic = Machine.getInterface(BreweryLogic.class, Window.get(this).getInventory());
|
||||
if (logic == null || logic.currentCrafting == null || logic.currentCrafting.inputFluid == null) {
|
||||
return;
|
||||
}
|
||||
final int fermentedHeight = (int) (32.0f * logic.getProgress() / 100.0f);
|
||||
CraftGUI.render.limitArea(new IArea(new IPoint(1, 6).add(this.getAbsolutePosition()), new IPoint(32, 32 - fermentedHeight)), guiWidth, guiHeight);
|
||||
GL11.glEnable(GL11.GL_SCISSOR_TEST);
|
||||
RenderUtil.drawFluid(new IPoint(1, 6), logic.currentCrafting.inputFluid);
|
||||
RenderUtil.drawFluid(new IPoint(17, 6), logic.currentCrafting.inputFluid);
|
||||
RenderUtil.drawFluid(new IPoint(1, 22), logic.currentCrafting.inputFluid);
|
||||
RenderUtil.drawFluid(new IPoint(17, 22), logic.currentCrafting.inputFluid);
|
||||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||
CraftGUI.render.limitArea(new IArea(new IPoint(1, 38 - fermentedHeight).add(this.getAbsolutePosition()), new IPoint(32, fermentedHeight)), guiWidth, guiHeight);
|
||||
GL11.glEnable(GL11.GL_SCISSOR_TEST);
|
||||
RenderUtil.drawFluid(new IPoint(1, 6), BreweryRecipes.getOutput(logic.currentCrafting));
|
||||
RenderUtil.drawFluid(new IPoint(17, 6), BreweryRecipes.getOutput(logic.currentCrafting));
|
||||
RenderUtil.drawFluid(new IPoint(1, 22), BreweryRecipes.getOutput(logic.currentCrafting));
|
||||
RenderUtil.drawFluid(new IPoint(17, 22), BreweryRecipes.getOutput(logic.currentCrafting));
|
||||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||
final ItemStackSet stacks = new ItemStackSet();
|
||||
Collections.addAll(stacks, logic.currentCrafting.inputGrains);
|
||||
stacks.add(logic.currentCrafting.ingredient);
|
||||
int x = 1;
|
||||
int y = 6;
|
||||
for (final ItemStack stack : stacks) {
|
||||
RenderUtil.drawItem(new IPoint(x, y), stack);
|
||||
x += 16;
|
||||
if (x > 18) {
|
||||
x = 1;
|
||||
y += 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
}
|
||||
|
||||
protected ControlBreweryProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 34, 39);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlProgressBase;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.distillery.DistilleryLogic;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
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);
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(DISTILLERY_BASE, IPoint.ZERO);
|
||||
CraftGUI.render.texturePercentage(LIQUID_FLOW, new IArea(18, 0, 38, 66), Position.Left, this.progress);
|
||||
final DistilleryLogic component = Machine.getInterface(DistilleryLogic.class, Window.get(this).getInventory());
|
||||
FluidStack stack = null;
|
||||
if (component != null) {
|
||||
stack = component.currentFluid;
|
||||
}
|
||||
if (stack != null) {
|
||||
for (int y = 0; y < 4; ++y) {
|
||||
RenderUtil.drawFluid(new IPoint(1, 1 + y * 16), stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
DistilleryLogic distilleryLogic = Machine.getInterface(DistilleryLogic.class, Window.get(this).getInventory());
|
||||
if (distilleryLogic != null) {
|
||||
final int level = distilleryLogic.level;
|
||||
GlStateManager.enableAlpha();
|
||||
CraftGUI.render.texture(OUTPUT, new IPoint(47, 14 + level * 15));
|
||||
CraftGUI.render.texture(DISTILLERY_OVERLAY, IPoint.ZERO);
|
||||
}
|
||||
}
|
||||
|
||||
protected ControlDistilleryProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 58, 66);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
int distillationLevel = -1;
|
||||
if (new IArea(45, 8, 19, 11).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) {
|
||||
distillationLevel = 0;
|
||||
} else if (new IArea(45, 23, 19, 11).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) {
|
||||
distillationLevel = 1;
|
||||
} else if (new IArea(45, 38, 19, 11).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) {
|
||||
distillationLevel = 2;
|
||||
}
|
||||
if (distillationLevel >= 0) {
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setByte("i", (byte) distillationLevel);
|
||||
Window.get(ControlDistilleryProgress.this.getWidget()).sendClientAction("still-level", nbt);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlProgressBase;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressMachine;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressRecipes;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class ControlFruitPressProgress extends ControlProgressBase {
|
||||
static Texture PressTexture = new StandardTexture(6, 0, 24, 52, ExtraTreeTexture.Gui);
|
||||
static Texture PressSlot = new StandardTexture(9, 52, 34, 17, ExtraTreeTexture.Gui);
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(ControlFruitPressProgress.PressSlot, new IPoint(3, 52));
|
||||
Slot slotFromInventory = Window.get(this).getContainer().getSlotFromInventory(Window.get(this).getInventory(), FruitPressMachine.SLOT_CURRENT);
|
||||
if (slotFromInventory == null) {
|
||||
return;
|
||||
}
|
||||
final ItemStack input = slotFromInventory.getStack();
|
||||
if (input == null || FruitPressRecipes.getOutput(input) == null) {
|
||||
return;
|
||||
}
|
||||
FluidStack fluid = FruitPressRecipes.getOutput(input);
|
||||
RenderUtil.drawFluid(new IPoint(4, 52), fluid);
|
||||
RenderUtil.drawItem(new IPoint(4, 52), input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(ControlFruitPressProgress.PressTexture, new IPoint(0, Math.round(16 * this.progress)));
|
||||
}
|
||||
|
||||
protected ControlFruitPressProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 37, 69);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
if (event.getButton() == 0) {
|
||||
final NBTTagCompound action = new NBTTagCompound();
|
||||
Window.get(ControlFruitPressProgress.this.getWidget()).sendClientAction("fruitpress-click", action);
|
||||
} else if (event.getButton() == 1) {
|
||||
final NBTTagCompound action = new NBTTagCompound();
|
||||
Window.get(ControlFruitPressProgress.this.getWidget()).sendClientAction("clear-fruit", action);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlProgressBase;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.craftgui.window.Panel;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillMachine;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillRecipes;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ControlLumbermillProgress extends ControlProgressBase {
|
||||
float oldProgress;
|
||||
float animation;
|
||||
static Texture Saw = new StandardTexture(0, 0, 6, 32, ExtraTreeTexture.Gui);
|
||||
static Texture Saw2 = new StandardTexture(2, 0, 4, 32, ExtraTreeTexture.Gui);
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
if (this.oldProgress != this.progress) {
|
||||
this.oldProgress = this.progress;
|
||||
this.animation += 5;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
GlStateManager.disableLighting();
|
||||
final int sawX = (int) (63 * this.progress);
|
||||
CraftGUI.render.texture(ControlLumbermillProgress.Saw, new IPoint(sawX, -8 + Math.round(6 * (float) Math.sin(this.animation))));
|
||||
final ItemStack item = Window.get(this).getInventory().getStackInSlot(LumbermillMachine.SLOT_LOG);
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
GlStateManager.disableLighting();
|
||||
Block block = null;
|
||||
if (item.getItem() instanceof ItemBlock) {
|
||||
block = ((ItemBlock) item.getItem()).getBlock();
|
||||
}
|
||||
if (block == null) {
|
||||
return;
|
||||
}
|
||||
//TODO RENDERING
|
||||
//final IIcon icon = block.getIcon(2, item.getItemDamage());
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
//CraftGUI.Render.iconBlock(new IPoint(1 + i * 16, 1), icon);
|
||||
}
|
||||
final ItemStack result = LumbermillRecipes.getPlankProduct(item);
|
||||
if (result == null) {
|
||||
return;
|
||||
}
|
||||
Block block2 = null;
|
||||
if (item.getItem() instanceof ItemBlock) {
|
||||
block2 = ((ItemBlock) result.getItem()).getBlock();
|
||||
}
|
||||
if (block2 == null) {
|
||||
return;
|
||||
}
|
||||
//final IIcon icon2 = block2.getIcon(2, result.getItemDamage());
|
||||
final IPoint size = this.getSize();
|
||||
final IPoint pos = this.getAbsolutePosition();
|
||||
CraftGUI.render.limitArea(new IArea(pos.add(IPoint.ZERO), new IPoint(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);
|
||||
}
|
||||
GL11.glDisable(GL11.GL_SCISSOR_TEST);
|
||||
CraftGUI.render.texture(ControlLumbermillProgress.Saw2, new IPoint(sawX + 2, -8 + Math.round(6 * (float) Math.sin(this.animation))));
|
||||
}
|
||||
|
||||
protected ControlLumbermillProgress(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 66, 18);
|
||||
this.oldProgress = 0;
|
||||
this.animation = 0;
|
||||
new Panel(this, 0, 0, 66, 18, MinecraftGUI.PanelType.Black);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.component.IComponentRecipe;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class ControlRecipeSlot extends ControlSlotBase {
|
||||
public ControlRecipeSlot(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 50);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
final TileEntity tile = (TileEntity) Window.get(ControlRecipeSlot.this.getWidget()).getInventory();
|
||||
if (tile == null || !(tile instanceof TileEntityMachine)) {
|
||||
return;
|
||||
}
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
Window.get(ControlRecipeSlot.this.getWidget()).sendClientAction("recipe", nbt);
|
||||
}
|
||||
});
|
||||
this.setRotating();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
final IComponentRecipe recipe = Machine.getInterface(IComponentRecipe.class, Window.get(this).getInventory());
|
||||
if (recipe != null && recipe.isRecipe()) {
|
||||
return recipe.getProduct();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.controls.core.IControlValue;
|
||||
import binnie.craftgui.controls.scroll.IControlScrollable;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.ITooltip;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.Tooltip;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
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;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ControlTileSelect extends Control implements IControlValue<IDesign>, IControlScrollable {
|
||||
IDesign value;
|
||||
float shownHeight;
|
||||
|
||||
protected ControlTileSelect(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 102, 20 * (CarpentryManager.carpentryInterface.getSortedDesigns().size() / 4) + 22);
|
||||
this.value = EnumDesign.Blank;
|
||||
this.shownHeight = 92.0f;
|
||||
this.refresh("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPercentageIndex() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPercentageShown() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesign getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void movePercentage(final float percentage) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
final TileEntityMachine tile = (TileEntityMachine) Window.get(this).getInventory();
|
||||
if (tile == null) {
|
||||
return;
|
||||
}
|
||||
final Designer.ComponentWoodworkerRecipe recipe = tile.getMachine().getComponent(Designer.ComponentWoodworkerRecipe.class);
|
||||
this.setValue(recipe.getDesign());
|
||||
}
|
||||
|
||||
public void refresh(final String filterText) {
|
||||
this.deleteAllChildren();
|
||||
int cx = 2;
|
||||
int cy = 2;
|
||||
final Map<IDesignCategory, List<IDesign>> designs = new HashMap<>();
|
||||
for (final IDesignCategory category : CarpentryManager.carpentryInterface.getAllDesignCategories()) {
|
||||
designs.put(category, new ArrayList<>());
|
||||
for (final IDesign tile : category.getDesigns()) {
|
||||
if (Objects.equals(filterText, "") || tile.getName().toLowerCase().contains(filterText)) {
|
||||
designs.get(category).add(tile);
|
||||
}
|
||||
}
|
||||
if (designs.get(category).isEmpty()) {
|
||||
designs.remove(category);
|
||||
}
|
||||
}
|
||||
for (final IDesignCategory category : designs.keySet()) {
|
||||
cx = 2;
|
||||
new ControlText(this, new IPoint(cx, cy + 3), category.getName());
|
||||
cy += 16;
|
||||
for (final IDesign tile : designs.get(category)) {
|
||||
if (cx > 90) {
|
||||
cx = 2;
|
||||
cy += 20;
|
||||
}
|
||||
new ControlTile(this, cx, cy, tile);
|
||||
cx += 20;
|
||||
}
|
||||
cy += 20;
|
||||
}
|
||||
final int height = cy;
|
||||
this.setSize(new IPoint(this.getSize().x(), height));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPercentageIndex(final float index) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final IDesign value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMovementRange() {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
public static class ControlTile extends Control implements IControlValue<IDesign>, ITooltip {
|
||||
IDesign value;
|
||||
|
||||
protected ControlTile(final IWidget parent, final int x, final int y, final IDesign value) {
|
||||
super(parent, x, y, 18, 18);
|
||||
this.setValue(value);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
final TileEntityMachine tile = (TileEntityMachine) Window.get(ControlTile.this.getWidget()).getInventory();
|
||||
if (tile == null) {
|
||||
return;
|
||||
}
|
||||
final Designer.ComponentWoodworkerRecipe recipe = tile.getMachine().getComponent(Designer.ComponentWoodworkerRecipe.class);
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setShort("d", (short) CarpentryManager.carpentryInterface.getDesignIndex(ControlTile.this.getValue()));
|
||||
Window.get(ControlTile.this.getWidget()).sendClientAction("design", nbt);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
tooltip.add(Binnie.LANGUAGE.localise(BinnieCore.instance, "gui.designer.pattern", this.getValue().getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDesign getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, IPoint.ZERO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
final ItemStack image = ((WindowWoodworker) this.getSuperParent()).getDesignerType().getDisplayStack(this.getValue());
|
||||
RenderUtil.drawItem(new IPoint(1, 1), image);
|
||||
if (((IControlValue) this.getParent()).getValue() != this.getValue()) {
|
||||
if (Window.get(this).getMousedOverWidget() == this) {
|
||||
RenderUtil.drawGradientRect(this.getArea().inset(1), 1157627903, 1157627903);
|
||||
} else {
|
||||
RenderUtil.drawGradientRect(this.getArea().inset(1), -1433892728, -1433892728);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final IDesign value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.minecraft.Dialog;
|
||||
|
||||
public class DialogBreweryRecipe extends Dialog {
|
||||
public DialogBreweryRecipe(final IWidget parent, final int w, final int h) {
|
||||
super(parent, w, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialise() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.mod.database.ControlSpeciesBox;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageAbstract;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PageFruit extends PageAbstract<ItemStack> {
|
||||
boolean treesThatBearFruit;
|
||||
|
||||
public PageFruit(final IWidget parent, final DatabaseTab tab, final boolean treesThatBearFruit) {
|
||||
super(parent, tab);
|
||||
this.treesThatBearFruit = treesThatBearFruit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final ItemStack species) {
|
||||
this.deleteAllChildren();
|
||||
final WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(this, new IArea(0, 0, this.size().x(), 24), ExtraTrees.proxy.localise("gui.database.tab.fruit." + (this.treesThatBearFruit ? "natural" : "potential")), TextJustification.MiddleCenter);
|
||||
final Collection<IAlleleSpecies> trees = this.treesThatBearFruit ? ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatBearFruit(species, database.isNEI(), database.getWorld(), database.getUsername()) : ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatCanBearFruit(species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4, 24, this.size().x() - 8, this.size().y() - 4 - 24).setOptions(trees);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageAbstract;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.DoorType;
|
||||
import binnie.extratrees.block.IPlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import binnie.extratrees.block.decor.FenceType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class PagePlanksOverview extends PageAbstract<ItemStack> {
|
||||
public PagePlanksOverview(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final ItemStack species) {
|
||||
this.deleteAllChildren();
|
||||
final WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(this, new IArea(0, 0, this.size().x(), 24), species.getDisplayName(), TextJustification.MiddleCenter);
|
||||
new ControlText(this, new IArea(12, 24, this.size().x() - 24, 24), ExtraTrees.proxy.localise("gui.database.planks.use"), TextJustification.MiddleLeft);
|
||||
final IPlankType type = WoodManager.get(species);
|
||||
int x = 12;
|
||||
if (type != null) {
|
||||
final ItemStack fence = WoodManager.getFence(type, new FenceType(0), 1);
|
||||
final ItemStack gate = WoodManager.getGate(type);
|
||||
final ItemStack door = WoodManager.getDoor(type, DoorType.Standard);
|
||||
if (fence != null) {
|
||||
new ControlItemDisplay(this, x, 48).setItemStack(fence);
|
||||
x += 22;
|
||||
}
|
||||
if (gate != null) {
|
||||
new ControlItemDisplay(this, x, 48).setItemStack(gate);
|
||||
x += 22;
|
||||
}
|
||||
if (door != null) {
|
||||
new ControlItemDisplay(this, x, 48).setItemStack(door);
|
||||
x += 22;
|
||||
}
|
||||
}
|
||||
final ControlText controlDescription = new ControlText(this, new IArea(8, 84, this.getSize().x() - 16, 0), "", TextJustification.MiddleCenter);
|
||||
final ControlText controlSignature = new ControlText(this, new IArea(8, 84, this.getSize().x() - 16, 0), "", TextJustification.BottomRight);
|
||||
String desc = "";
|
||||
if (type != null) {
|
||||
desc = type.getDescription();
|
||||
}
|
||||
String descBody = "§o";
|
||||
String descSig = "";
|
||||
if (desc == null || desc.length() == 0) {
|
||||
descBody += BinnieCore.proxy.localise("gui.database.nodescription");
|
||||
} else {
|
||||
final String[] descStrings = desc.split("\\|");
|
||||
descBody += descStrings[0];
|
||||
for (int i = 1; i < descStrings.length - 1; ++i) {
|
||||
descBody = descBody + " " + descStrings[i];
|
||||
}
|
||||
if (descStrings.length > 1) {
|
||||
descSig += descStrings[descStrings.length - 1];
|
||||
}
|
||||
}
|
||||
controlDescription.setValue(descBody + "§r");
|
||||
controlSignature.setValue(descSig + "§r");
|
||||
final int descHeight = CraftGUI.render.textHeight(controlDescription.getValue(), controlDescription.getSize().x());
|
||||
controlSignature.setPosition(new IPoint(controlSignature.pos().x(), controlDescription.getPosition().y() + descHeight + 10));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.mod.database.ControlSpeciesBox;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageAbstract;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PagePlanksTrees extends PageAbstract<ItemStack> {
|
||||
public PagePlanksTrees(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final ItemStack species) {
|
||||
this.deleteAllChildren();
|
||||
final WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(this, new IArea(0, 0, this.size().x(), 24), species.getDisplayName(), TextJustification.MiddleCenter);
|
||||
final Collection<IAlleleSpecies> trees = ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatMakePlanks(species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4, 24, this.size().x() - 8, this.size().y() - 4 - 24).setOptions(trees);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.craftgui.controls.ControlTextCentered;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.craftgui.mod.database.ControlDatabaseIndividualDisplay;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.EnumDiscoveryState;
|
||||
import binnie.craftgui.mod.database.PageSpecies;
|
||||
import binnie.craftgui.window.Panel;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public class PageSpeciesImage extends PageSpecies {
|
||||
ControlDatabaseIndividualDisplay display;
|
||||
|
||||
public PageSpeciesImage(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
new Panel(this, 7, 25, 130, 120, MinecraftGUI.PanelType.Gray);
|
||||
this.display = new ControlDatabaseIndividualDisplay(this, 12, 25, 120);
|
||||
this.display.hastooltip = false;
|
||||
new ControlTextCentered(this, 8, this.getValue().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
this.display.setSpecies(species, EnumDiscoveryState.Show);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.controls.scroll.ControlScrollableContent;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageSpecies;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PageSpeciesTreeGenome extends PageSpecies {
|
||||
public PageSpeciesTreeGenome(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
this.deleteAllChildren();
|
||||
final IAllele[] template = Binnie.GENETICS.getTreeRoot().getTemplate(species.getUID());
|
||||
if (template == null) {
|
||||
return;
|
||||
}
|
||||
final ITree tree = Binnie.GENETICS.getTreeRoot().templateAsIndividual(template);
|
||||
if (tree == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final ITreeGenome genome = tree.getGenome();
|
||||
final IAlleleTreeSpecies treeSpecies = genome.getPrimary();
|
||||
final ItemStack log = treeSpecies.getWoodProvider().getWoodStack();
|
||||
final int w = 144;
|
||||
final int h = 176;
|
||||
new ControlText(this, new IArea(0, 4, w, 16), this.getValue().toString(), TextJustification.MiddleCenter);
|
||||
final ControlScrollableContent scrollable = new ControlScrollableContent(this, 4, 20, w - 8, h - 8 - 16, 12);
|
||||
final Control contents = new Control(scrollable, 0, 0, w - 8 - 12, h - 8 - 16);
|
||||
final int tw = w - 8 - 12;
|
||||
final int w2 = 65;
|
||||
final int w3 = tw - 50;
|
||||
int y = 0;
|
||||
final int th = 14;
|
||||
final int th2 = 18;
|
||||
final BreedingSystem syst = Binnie.GENETICS.treeBreedingSystem;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.PLANT) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getPlantType().toString(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), BinnieCore.proxy.localise("gui.temperature.short") + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getTemperature().getName(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
//TODO RENDERING
|
||||
//final IIcon leaf = treeSpecies.getLeafIcon(false, false);
|
||||
//IIcon fruit = null;
|
||||
int fruitColour = 16777215;
|
||||
try {
|
||||
//TODO RENDERING
|
||||
//fruit = ForestryAPI.textureManager.getIcon(genome.getFruitProvider().getIconIndex(genome, (IBlockAccess) null, 0, 0, 0, 100, false));
|
||||
fruitColour = genome.getFruitProvider().getColour(genome, null, new BlockPos(0, 0, 0), 100);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
//if (leaf != null) {
|
||||
//new ControlText(contents, new IArea(0, y, w2, th2), ExtraTrees.proxy.localise("gui.database.leaves") + " : ", TextJustification.MiddleRight);
|
||||
//TODO RENDERING
|
||||
//new ControlBlockIconDisplay(contents, w2, y, leaf).setColour(treeSpecies.getLeafColour(false));
|
||||
//if (fruit != null && !treeSpecies.getUID().equals("forestry.treeOak")) {
|
||||
//TODO RENDERING
|
||||
// new ControlBlockIconDisplay(contents, w2, y, fruit).setColour(fruitColour);
|
||||
//}
|
||||
// y += th2;
|
||||
//}
|
||||
// final ItemStack log = (genome.getFruitProvider().getProducts().length
|
||||
// > 0) ? genome.getFruitProvider().getProducts()[0] : null;
|
||||
if (log != null) {
|
||||
new ControlText(contents, new IArea(0, y, w2, th2), ExtraTrees.proxy.localise("gui.database.log") + " : ", TextJustification.MiddleRight);
|
||||
final ControlItemDisplay display = new ControlItemDisplay(contents, w2, y);
|
||||
display.setItemStack(log);
|
||||
display.setTooltip();
|
||||
y += th2;
|
||||
}
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.GROWTH) + " : ", TextJustification.MiddleRight);
|
||||
//new ControlText(contents, new IArea(w2, y, w3, th), genome.getGrowthProvider().getDescription(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.HEIGHT) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getHeight() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.FERTILITY) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
final List<ItemStack> fruits = new ArrayList<>();
|
||||
for (final ItemStack stack : genome.getFruitProvider().getProducts().keySet()) {
|
||||
fruits.add(stack);
|
||||
}
|
||||
if (!fruits.isEmpty()) {
|
||||
new ControlText(contents, new IArea(0, y, w2, th2), syst.getChromosomeShortName(EnumTreeChromosome.FRUITS) + " : ", TextJustification.MiddleRight);
|
||||
for (final ItemStack fruitw : fruits) {
|
||||
final ControlItemDisplay display2 = new ControlItemDisplay(contents, w2, y);
|
||||
display2.setItemStack(fruitw);
|
||||
display2.setTooltip();
|
||||
y += th2;
|
||||
}
|
||||
}
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.YIELD) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getYield() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.SAPPINESS) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getSappiness() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.MATURATION) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getMaturationTime() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.GIRTH) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getGirth() + "x" + genome.getGirth(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
contents.setSize(new IPoint(contents.size().x(), y));
|
||||
scrollable.setScrollableContent(contents);
|
||||
}
|
||||
|
||||
public static String tolerated(final boolean t) {
|
||||
if (t) {
|
||||
return BinnieCore.proxy.localise("gui.tolerated");
|
||||
}
|
||||
return BinnieCore.proxy.localise("gui.nottolerated");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.mod.database.ControlSpeciesBox;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageAbstract;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PageWood extends PageAbstract<ItemStack> {
|
||||
public PageWood(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final ItemStack species) {
|
||||
this.deleteAllChildren();
|
||||
final WindowAbstractDatabase database = Window.get(this);
|
||||
new ControlText(this, new IArea(0, 0, this.size().x(), 24), this.getValue().toString(), TextJustification.MiddleCenter);
|
||||
final Collection<IAlleleSpecies> trees = ((TreeBreedingSystem) database.getBreedingSystem()).getTreesThatHaveWood(species, database.isNEI(), database.getWorld(), database.getUsername());
|
||||
new ControlSpeciesBox(this, 4, 24, this.size().x() - 8, this.size().y() - 4 - 24).setOptions(trees);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
import binnie.craftgui.controls.listbox.ControlListBox;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.mod.database.ControlItemStackOption;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.IDatabaseMode;
|
||||
import binnie.craftgui.mod.database.PageBranchOverview;
|
||||
import binnie.craftgui.mod.database.PageBranchSpecies;
|
||||
import binnie.craftgui.mod.database.PageBreeder;
|
||||
import binnie.craftgui.mod.database.PageSpeciesClassification;
|
||||
import binnie.craftgui.mod.database.PageSpeciesMutations;
|
||||
import binnie.craftgui.mod.database.PageSpeciesOverview;
|
||||
import binnie.craftgui.mod.database.PageSpeciesResultant;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowArboristDatabase extends WindowAbstractDatabase {
|
||||
ControlListBox<ItemStack> selectionBoxFruit;
|
||||
ControlListBox<ItemStack> selectionBoxWood;
|
||||
ControlListBox<ItemStack> selectionBoxPlanks;
|
||||
|
||||
public WindowArboristDatabase(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
super(player, side, nei, Binnie.GENETICS.treeBreedingSystem, 120);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
return new WindowArboristDatabase(player, side, nei);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.overview", 0));
|
||||
new PageSpeciesTreeGenome(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.genome", 0));
|
||||
new PageSpeciesClassification(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.classification", 0));
|
||||
new PageSpeciesResultant(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.resultant", 0));
|
||||
new PageSpeciesMutations(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.further", 0));
|
||||
new PageBranchOverview(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.overview", 0));
|
||||
new PageBranchSpecies(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.species", 0));
|
||||
new PageBreeder(this.getInfoPages(Mode.Breeder), this.getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder", 0));
|
||||
this.createMode(TreeMode.Fruit, new ModeWidgets(TreeMode.Fruit, this) {
|
||||
@Override
|
||||
public void createListBox(final IArea area) {
|
||||
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12) {
|
||||
@Override
|
||||
public IWidget createOption(final ItemStack value, final int y) {
|
||||
return new ControlItemStackOption(this.getContent(), value, y);
|
||||
}
|
||||
}).setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allFruits);
|
||||
}
|
||||
});
|
||||
this.createMode(TreeMode.Wood, new ModeWidgets(TreeMode.Wood, this) {
|
||||
@Override
|
||||
public void createListBox(final IArea area) {
|
||||
(this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12) {
|
||||
@Override
|
||||
public IWidget createOption(final ItemStack value, final int y) {
|
||||
return new ControlItemStackOption(this.getContent(), value, y);
|
||||
}
|
||||
}).setOptions(((TreeBreedingSystem) WindowArboristDatabase.this.getBreedingSystem()).allWoods);
|
||||
}
|
||||
});
|
||||
this.createMode(TreeMode.Planks, new ModeWidgets(TreeMode.Planks, this) {
|
||||
@Override
|
||||
public void createListBox(final IArea area) {
|
||||
this.listBox = new ControlListBox<ItemStack>(this.modePage, area.x(), area.y(), area.w(), area.h(), 12) {
|
||||
@Override
|
||||
public IWidget createOption(final ItemStack value, final int y) {
|
||||
return new ControlItemStackOption(this.getContent(), value, y);
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
new PageFruit(this.getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.natural", 0), true);
|
||||
new PageFruit(this.getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.potential", 0), false);
|
||||
new PageWood(this.getInfoPages(TreeMode.Wood), new DatabaseTab(ExtraTrees.instance, "wood.natural", 0));
|
||||
new PagePlanksOverview(this.getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.overview", 0));
|
||||
new PagePlanksTrees(this.getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.natural", 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "TreeDatabase";
|
||||
}
|
||||
|
||||
enum TreeMode implements IDatabaseMode {
|
||||
Fruit,
|
||||
Wood,
|
||||
Planks;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("gui.database.mode." + this.name().toLowerCase());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.brewery.BreweryMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowBrewery extends Window {
|
||||
public WindowBrewery(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(228, 218, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Brewery";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
new ControlSlotArray(this, 42, 32, 1, 3).create(BreweryMachine.SLOT_RECIPE_GRAINS);
|
||||
new ControlSlot(this, 16, 41).assign(BreweryMachine.SLOT_RECIPE_INPUT);
|
||||
new ControlSlot(this, 105, 77).assign(BreweryMachine.SLOT_YEAST);
|
||||
new ControlLiquidTank(this, 76, 32).setTankID(BreweryMachine.TANK_INPUT);
|
||||
new ControlLiquidTank(this, 162, 32).setTankID(BreweryMachine.TANK_OUTPUT);
|
||||
new ControlEnergyBar(this, 196, 32, 16, 60, Position.Bottom);
|
||||
new ControlBreweryProgress(this, 110, 32);
|
||||
new ControlSlotArray(this, this.getSize().x() / 2 - 81, 104, 9, 1).create(BreweryMachine.SLOTS_INVENTORY);
|
||||
new ControlPlayerInventory(this);
|
||||
new ControlErrorState(this, 133, 79);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowBrewery(player, inventory, side);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.distillery.DistilleryMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowDistillery extends Window {
|
||||
public WindowDistillery(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(224, 192, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Distillery";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
int x = 16;
|
||||
new ControlLiquidTank(this, x, 35).setTankID(DistilleryMachine.TANK_INPUT);
|
||||
x += 34;
|
||||
new ControlDistilleryProgress(this, x, 32);
|
||||
x += 64;
|
||||
new ControlLiquidTank(this, x, 35).setTankID(DistilleryMachine.TANK_OUTPUT);
|
||||
x += 34;
|
||||
new ControlEnergyBar(this, x, 36, 60, 16, Position.Left);
|
||||
new ControlPlayerInventory(this);
|
||||
new ControlErrorState(this, x + 21, 62);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowDistillery(player, inventory, side);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.mod.database.PageBranchOverview;
|
||||
import binnie.craftgui.mod.database.PageBranchSpecies;
|
||||
import binnie.craftgui.mod.database.PageBreeder;
|
||||
import binnie.craftgui.mod.database.PageSpeciesClassification;
|
||||
import binnie.craftgui.mod.database.PageSpeciesMutations;
|
||||
import binnie.craftgui.mod.database.PageSpeciesOverview;
|
||||
import binnie.craftgui.mod.database.PageSpeciesResultant;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowLepidopteristDatabase extends WindowAbstractDatabase {
|
||||
public WindowLepidopteristDatabase(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
super(player, side, nei, Binnie.GENETICS.mothBreedingSystem, 160);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
return new WindowLepidopteristDatabase(player, side, nei);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.overview", 0));
|
||||
new PageSpeciesClassification(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.classification", 0));
|
||||
new PageSpeciesImage(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.specimen", 0));
|
||||
new PageSpeciesResultant(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.resultant", 0));
|
||||
new PageSpeciesMutations(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.further", 0));
|
||||
new PageBranchOverview(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.overview", 0));
|
||||
new PageBranchSpecies(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.species", 0));
|
||||
new PageBreeder(this.getInfoPages(Mode.Breeder), this.getUsername(), new DatabaseTab(ExtraTrees.instance, "butterfly.breeder", 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "MothDatabase";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowLumbermill extends Window {
|
||||
public WindowLumbermill(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(220, 192, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Lumbermill";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
new ControlSlot(this, 42, 43).assign(LumbermillMachine.SLOT_LOG);
|
||||
new ControlSlot(this, 148, 43).assign(LumbermillMachine.SLOT_PLANKS);
|
||||
new ControlSlot(this, 172, 28).assign(LumbermillMachine.SLOT_BARK);
|
||||
new ControlSlot(this, 172, 58).assign(LumbermillMachine.SLOT_SAWDUST);
|
||||
new ControlLumbermillProgress(this, 70, 43);
|
||||
new ControlLiquidTank(this, 16, 32);
|
||||
new ControlEnergyBar(this, 8, 112, 16, 60, Position.Bottom);
|
||||
new ControlPlayerInventory(this);
|
||||
new ControlErrorState(this, 95, 73);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowLumbermill(player, inventory, side);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.power.ErrorState;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.InventoryType;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlLiquidTank;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressLogic;
|
||||
import binnie.extratrees.machines.fruitpress.FruitPressMachine;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowPress extends Window {
|
||||
public WindowPress(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(194, 192, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Press";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
new ControlSlot(this, 24, 52).assign(FruitPressMachine.SLOT_FRUIT);
|
||||
new ControlLiquidTank(this, 99, 32).setTankID(FruitPressMachine.TANK_OUTPUT);
|
||||
new ControlEnergyBar(this, 154, 32, 16, 60, Position.Bottom);
|
||||
new ControlPlayerInventory(this);
|
||||
new ControlErrorState(this, 128, 54);
|
||||
new ControlFruitPressProgress(this, 62, 24);
|
||||
((Window) this.getSuperParent()).getContainer().getOrCreateSlot(InventoryType.Machine, FruitPressMachine.SLOT_CURRENT);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowPress(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recieveGuiNBT(final Side side, final EntityPlayer player, final String name, final NBTTagCompound action) {
|
||||
final FruitPressLogic logic = Machine.getInterface(FruitPressLogic.class, this.getInventory());
|
||||
super.recieveGuiNBT(side, player, name, action);
|
||||
if (side == Side.SERVER && name.equals("fruitpress-click")) {
|
||||
if (logic.canWork() == null && (logic.canProgress() == null || logic.canProgress() instanceof ErrorState.InsufficientPower)) {
|
||||
logic.alterProgress(2.0f);
|
||||
} else if (side == Side.SERVER && name.equals("clear-fruit")) {
|
||||
logic.setProgress(0.0f);
|
||||
this.getInventory().setInventorySlotContents(FruitPressMachine.SLOT_CURRENT, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowSetSquare extends Window {
|
||||
public WindowSetSquare(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(150, 150, player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side) {
|
||||
return new WindowSetSquare(player, null, side);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package binnie.extratrees.item.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.controls.ControlTextEdit;
|
||||
import binnie.craftgui.controls.scroll.ControlScrollableContent;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.events.EventHandler;
|
||||
import binnie.craftgui.events.EventTextEdit;
|
||||
import binnie.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlErrorState;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.window.Panel;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.machines.Designer;
|
||||
import binnie.extratrees.machines.DesignerType;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowWoodworker extends Window {
|
||||
ControlTextEdit textEdit;
|
||||
ControlTileSelect tileSelect;
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
new ControlText(this, new IArea(190, 36, 114, 10), BinnieCore.proxy.localise("gui.design"), TextJustification.TopCenter).setColour(4473924);
|
||||
new Panel(this, 188, 48, 118, 126, MinecraftGUI.PanelType.Gray);
|
||||
this.textEdit = new ControlTextEdit(this, 188, 178, 118, 12);
|
||||
final ControlScrollableContent scroll = new ControlScrollableContent(this, 190, 50, 114, 122, 12);
|
||||
scroll.setScrollableContent(this.tileSelect = new ControlTileSelect(scroll, 0, 0));
|
||||
new ControlPlayerInventory(this).setPosition(new IPoint(14, 96));
|
||||
new ControlErrorState(this, 76, 65);
|
||||
if (this.getInventory() != null) {
|
||||
final ControlSlot slotWood1 = new ControlSlot(this, 22, 34);
|
||||
slotWood1.assign(Designer.design1Slot);
|
||||
final ControlSlot slotWood2 = new ControlSlot(this, 62, 34);
|
||||
slotWood2.assign(Designer.design2Slot);
|
||||
final ControlSlot slotBeeswax = new ControlSlot(this, 42, 64);
|
||||
slotBeeswax.assign(Designer.beeswaxSlot);
|
||||
final ControlRecipeSlot slotFinished = new ControlRecipeSlot(this, 112, 34);
|
||||
}
|
||||
}
|
||||
|
||||
public WindowWoodworker(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(320, 216, player, inventory, side);
|
||||
this.addEventHandler(new EventTextEdit.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventTextEdit event) {
|
||||
WindowWoodworker.this.tileSelect.refresh(event.getValue());
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.DirectChild, this));
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowWoodworker(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "Woodworker";
|
||||
}
|
||||
|
||||
public DesignerType getDesignerType() {
|
||||
return Machine.getInterface(Designer.ComponentWoodworkerRecipe.class, this.getInventory()).getDesignerType();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package binnie.extratrees.kitchen.craftgui;
|
||||
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.minecraft.MinecraftGUI;
|
||||
import binnie.craftgui.window.Panel;
|
||||
|
||||
public class ControlDropDownMenu extends Panel {
|
||||
public boolean stayOpenOnChildClick;
|
||||
|
||||
public ControlDropDownMenu(final IWidget parent, final int x, final int y, final int width, final int height) {
|
||||
super(parent, x, y, width, 2, MinecraftGUI.PanelType.Gray);
|
||||
this.stayOpenOnChildClick = false;
|
||||
this.addAttribute(Attribute.CanFocus);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package binnie.extratrees.kitchen.craftgui;
|
||||
|
||||
import binnie.craftgui.controls.button.ControlButton;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
|
||||
public abstract class ControlDropdownButton extends ControlButton {
|
||||
public ControlDropdownButton(final IWidget parent, final int x, final int y, final int width, final int height, final String text) {
|
||||
super(parent, x, y, width, height, text);
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
ControlDropDownMenu menu = ControlDropdownButton.this.getWidget(ControlDropDownMenu.class);
|
||||
ControlDropdownButton.this.deleteChild(ControlDropdownButton.this.getWidget(ControlDropDownMenu.class));
|
||||
if (ControlDropdownButton.this.getWidget(ControlDropDownMenu.class) == null) {
|
||||
menu = ControlDropdownButton.this.createDropDownMenu();
|
||||
Window.get(ControlDropdownButton.this.getWidget()).setFocusedWidget(menu);
|
||||
} else {
|
||||
ControlDropdownButton.this.deleteChild(ControlDropdownButton.this.getWidget(ControlDropDownMenu.class));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public abstract ControlDropDownMenu createDropDownMenu();
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package binnie.extratrees.kitchen.craftgui;
|
||||
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.ITooltip;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.Tooltip;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
|
||||
public class ControlFluidDisplay extends Control implements ITooltip {
|
||||
FluidStack itemStack;
|
||||
public boolean hastooltip;
|
||||
|
||||
public void setTooltip() {
|
||||
this.hastooltip = true;
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
}
|
||||
|
||||
public ControlFluidDisplay(final IWidget parent, final int x, final int y) {
|
||||
this(parent, x, y, 16);
|
||||
}
|
||||
|
||||
public ControlFluidDisplay(final IWidget parent, final int x, final int y, final FluidStack stack, final boolean tooltip) {
|
||||
this(parent, x, y, 16);
|
||||
this.setItemStack(stack);
|
||||
if (tooltip) {
|
||||
this.setTooltip();
|
||||
}
|
||||
}
|
||||
|
||||
public ControlFluidDisplay(final IWidget parent, final int x, final int y, final int size) {
|
||||
super(parent, x, y, size, size);
|
||||
this.itemStack = null;
|
||||
this.hastooltip = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
if (this.itemStack == null) {
|
||||
return;
|
||||
}
|
||||
final IPoint relativeToWindow = this.getAbsolutePosition().sub(this.getSuperParent().getPosition());
|
||||
if (relativeToWindow.x() > Window.get(this).getSize().x() + 100 || relativeToWindow.y() > Window.get(this).getSize().y() + 100) {
|
||||
return;
|
||||
}
|
||||
if (this.itemStack != null) {
|
||||
final Fluid fluid = this.itemStack.getFluid();
|
||||
final int hex = fluid.getColor(this.itemStack);
|
||||
final int r = (hex & 0xFF0000) >> 16;
|
||||
final int g = (hex & 0xFF00) >> 8;
|
||||
final int b = hex & 0xFF;
|
||||
final ResourceLocation iconRL = this.itemStack.getFluid().getStill();
|
||||
TextureAtlasSprite icon = FMLClientHandler.instance().getClient().getTextureMapBlocks().getAtlasSprite(iconRL.toString());
|
||||
GlStateManager.color(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(770, 771);
|
||||
if (this.getSize().x() != 16) {
|
||||
GlStateManager.pushMatrix();
|
||||
final float scale = this.getSize().x() / 16.0f;
|
||||
GlStateManager.scale(scale, scale, 1.0f);
|
||||
RenderUtil.drawSprite(IPoint.ZERO, icon);
|
||||
GlStateManager.popMatrix();
|
||||
} else {
|
||||
RenderUtil.drawSprite(IPoint.ZERO, icon);
|
||||
}
|
||||
GlStateManager.disableBlend();
|
||||
}
|
||||
}
|
||||
|
||||
public void setItemStack(final FluidStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
if (this.hastooltip && this.itemStack != null) {
|
||||
tooltip.add(this.itemStack.getLocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package binnie.extratrees.kitchen.craftgui;
|
||||
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.ITooltip;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.Tooltip;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.events.EventWidget;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class ControlSlotFluid extends Control implements ITooltip {
|
||||
ControlFluidDisplay itemDisplay;
|
||||
FluidStack fluidStack;
|
||||
|
||||
public ControlSlotFluid(final IWidget parent, final int x, final int y, final FluidStack fluid) {
|
||||
this(parent, x, y, 18, fluid);
|
||||
}
|
||||
|
||||
public ControlSlotFluid(final IWidget parent, final int x, final int y, final int size, final FluidStack fluid) {
|
||||
super(parent, x, y, size, size);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.itemDisplay = new ControlFluidDisplay(this, 1, 1, size - 2);
|
||||
this.fluidStack = fluid;
|
||||
this.addSelfEventHandler(new EventWidget.ChangeSize.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventWidget.ChangeSize event) {
|
||||
if (ControlSlotFluid.this.itemDisplay != null) {
|
||||
ControlSlotFluid.this.itemDisplay.setSize(ControlSlotFluid.this.getSize().sub(new IPoint(2, 2)));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
final int size = (int) this.getSize().x();
|
||||
CraftGUI.render.texture(CraftGUITexture.Slot, this.getArea());
|
||||
if (this.getSuperParent().getMousedOverWidget() == this) {
|
||||
RenderUtil.drawGradientRect(new IArea(new IPoint(1, 1), this.getArea().size().sub(new IPoint(2, 2))), -2130706433, -2130706433);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
this.itemDisplay.setItemStack(this.getFluidStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
final FluidStack item = this.getFluidStack();
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
tooltip.add(item.getFluid().getLocalizedName(item));
|
||||
}
|
||||
|
||||
public FluidStack getFluidStack() {
|
||||
return this.fluidStack;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package binnie.extratrees.kitchen.craftgui;
|
||||
|
||||
import binnie.craftgui.controls.core.IControlValue;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotBase;
|
||||
import binnie.extratrees.alcohol.Glassware;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ControlSlotGlassware extends ControlSlotBase implements IControlValue<Glassware> {
|
||||
Glassware glassware;
|
||||
|
||||
public ControlSlotGlassware(final IWidget parent, final int x, final int y, final Glassware glassware) {
|
||||
super(parent, x, y);
|
||||
this.glassware = glassware;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Glassware getValue() {
|
||||
return this.glassware;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final Glassware value) {
|
||||
this.glassware = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return this.glassware.get(1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package binnie.extratrees.kitchen.craftgui;
|
||||
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class ControlTankSlot extends ControlSlotFluid {
|
||||
int tankID;
|
||||
|
||||
public ControlTankSlot(final IWidget parent, final int x, final int y, final int i) {
|
||||
super(parent, x, y, null);
|
||||
this.tankID = 0;
|
||||
this.tankID = i;
|
||||
this.addSelfEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
if (event.getButton() == 0) {
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setByte("id", (byte) ControlTankSlot.this.tankID);
|
||||
Window.get(ControlTankSlot.this.getWidget()).sendClientAction("tank-click", nbt);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
this.fluidStack = Window.get(this).getContainer().getTankInfo(this.tankID).liquid;
|
||||
final int height = 16 * (((this.fluidStack == null) ? 0 : this.fluidStack.amount) / 1000);
|
||||
this.itemDisplay.setCroppedZone(this.itemDisplay, new IArea(0, 16 - height, 16, 16));
|
||||
super.onUpdateClient();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
super.onRenderBackground(guiWidth, guiHeight);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package binnie.extratrees.kitchen.craftgui;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class WindowBottleRack extends Window {
|
||||
public WindowBottleRack(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(248, 180, player, inventory, side);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowBottleRack(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractMod getMod() {
|
||||
return ExtraTrees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackgroundTextureName() {
|
||||
return "BottleBank";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle(Machine.getMachine(this.getInventory()).getPackage().getDisplayName());
|
||||
for (int i = 0; i < 36; ++i) {
|
||||
final int x = i % 12;
|
||||
final int y = i / 12;
|
||||
new ControlTankSlot(this, 16 + x * 18, 32 + y * 18, i);
|
||||
}
|
||||
new ControlPlayerInventory(this);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user