mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-26 23:12:58 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7db1a4efa8 | ||
|
|
29d8fed2a3 |
No files matched your search
@@ -3,9 +3,9 @@ name: Build and test
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master, main ]
|
branches: [ master, main, release/** ]
|
||||||
push:
|
push:
|
||||||
branches: [ master, main ]
|
branches: [ master, main, release/** ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package binnie.core.machines;
|
package binnie.core.machines;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
@@ -24,4 +27,13 @@ public class ItemMachine extends ItemBlock {
|
|||||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||||
return associatedBlock.getMachineName(itemstack.getItemDamage());
|
return associatedBlock.getMachineName(itemstack.getItemDamage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||||
|
super.addInformation(stack, player, tooltip, advanced);
|
||||||
|
final MachinePackage pkg = associatedBlock.getPackage(stack.getItemDamage());
|
||||||
|
if (pkg != null) {
|
||||||
|
pkg.addTooltip(tooltip);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package binnie.core.machines;
|
package binnie.core.machines;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
import binnie.core.util.I18N;
|
import binnie.core.util.I18N;
|
||||||
@@ -71,4 +73,6 @@ public abstract class MachinePackage {
|
|||||||
public String getInformation() {
|
public String getInformation() {
|
||||||
return I18N.localise(group.getMod().getModID() + ".machine." + group.getShortUID() + "." + getUID() + ".info");
|
return I18N.localise(group.getMod().getModID() + ".machine." + group.getShortUID() + "." + getUID() + ".info");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addTooltip(List<String> tooltip) {}
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,19 @@
|
|||||||
package binnie.core.machines.storage;
|
package binnie.core.machines.storage;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
import binnie.core.BinnieCore;
|
import binnie.core.BinnieCore;
|
||||||
|
import binnie.core.gui.BinnieCoreGUI;
|
||||||
import binnie.core.machines.IMachineType;
|
import binnie.core.machines.IMachineType;
|
||||||
import binnie.core.machines.Machine;
|
import binnie.core.machines.Machine;
|
||||||
import binnie.core.machines.MachinePackage;
|
import binnie.core.machines.MachinePackage;
|
||||||
import binnie.core.machines.TileEntityMachine;
|
import binnie.core.machines.TileEntityMachine;
|
||||||
import binnie.core.resource.BinnieResource;
|
import binnie.core.resource.BinnieResource;
|
||||||
import binnie.core.resource.IBinnieTexture;
|
import binnie.core.resource.IBinnieTexture;
|
||||||
|
import binnie.core.util.I18N;
|
||||||
|
|
||||||
enum Compartment implements IMachineType {
|
enum Compartment implements IMachineType {
|
||||||
|
|
||||||
@@ -37,11 +41,36 @@ enum Compartment implements IMachineType {
|
|||||||
|
|
||||||
public abstract static class PackageCompartment extends MachinePackage {
|
public abstract static class PackageCompartment extends MachinePackage {
|
||||||
|
|
||||||
private final BinnieResource renderTexture;
|
static final int ROWS_PER_TAB = 5;
|
||||||
|
|
||||||
protected PackageCompartment(String uid, IBinnieTexture renderTexture) {
|
private final BinnieResource renderTexture;
|
||||||
|
private final int tabs;
|
||||||
|
private final int slotsPerTab;
|
||||||
|
|
||||||
|
protected PackageCompartment(String uid, IBinnieTexture renderTexture, int tabs, int slotsPerTab) {
|
||||||
super(uid, false);
|
super(uid, false);
|
||||||
this.renderTexture = renderTexture.getTexture();
|
this.renderTexture = renderTexture.getTexture();
|
||||||
|
this.tabs = tabs;
|
||||||
|
this.slotsPerTab = slotsPerTab;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createMachine(Machine machine) {
|
||||||
|
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
||||||
|
new ComponentCompartmentInventory(machine, tabs, slotsPerTab);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addTooltip(List<String> tooltip) {
|
||||||
|
final int slotsPerRow = slotsPerTab / ROWS_PER_TAB;
|
||||||
|
final int slotsTotal = this.tabs * slotsPerTab;
|
||||||
|
tooltip.add(
|
||||||
|
I18N.localise(
|
||||||
|
"binniecore.machine.storage.tooltip.size",
|
||||||
|
slotsPerRow,
|
||||||
|
ROWS_PER_TAB,
|
||||||
|
this.tabs,
|
||||||
|
slotsTotal));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package binnie.core.machines.storage;
|
package binnie.core.machines.storage;
|
||||||
|
|
||||||
import binnie.core.gui.BinnieCoreGUI;
|
|
||||||
import binnie.core.machines.Machine;
|
|
||||||
import binnie.core.texture.BinnieCoreTexture;
|
import binnie.core.texture.BinnieCoreTexture;
|
||||||
|
|
||||||
public class StandardCompartment {
|
public class StandardCompartment {
|
||||||
@@ -9,84 +7,42 @@ public class StandardCompartment {
|
|||||||
public static class PackageCompartment extends Compartment.PackageCompartment {
|
public static class PackageCompartment extends Compartment.PackageCompartment {
|
||||||
|
|
||||||
public PackageCompartment() {
|
public PackageCompartment() {
|
||||||
super("compartment", BinnieCoreTexture.Compartment);
|
super("compartment", BinnieCoreTexture.Compartment, 4, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void createMachine(Machine machine) {
|
|
||||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
|
||||||
new ComponentCompartmentInventory(machine, 4, 25);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PackageCompartmentCopper extends Compartment.PackageCompartment {
|
public static class PackageCompartmentCopper extends Compartment.PackageCompartment {
|
||||||
|
|
||||||
public PackageCompartmentCopper() {
|
public PackageCompartmentCopper() {
|
||||||
super("compartmentCopper", BinnieCoreTexture.CompartmentCopper);
|
super("compartmentCopper", BinnieCoreTexture.CompartmentCopper, 6, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void createMachine(Machine machine) {
|
|
||||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
|
||||||
new ComponentCompartmentInventory(machine, 6, 25);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PackageCompartmentBronze extends Compartment.PackageCompartment {
|
public static class PackageCompartmentBronze extends Compartment.PackageCompartment {
|
||||||
|
|
||||||
public PackageCompartmentBronze() {
|
public PackageCompartmentBronze() {
|
||||||
super("compartmentBronze", BinnieCoreTexture.CompartmentBronze);
|
super("compartmentBronze", BinnieCoreTexture.CompartmentBronze, 8, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void createMachine(Machine machine) {
|
|
||||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
|
||||||
new ComponentCompartmentInventory(machine, 8, 25);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PackageCompartmentIron extends Compartment.PackageCompartment {
|
public static class PackageCompartmentIron extends Compartment.PackageCompartment {
|
||||||
|
|
||||||
public PackageCompartmentIron() {
|
public PackageCompartmentIron() {
|
||||||
super("compartmentIron", BinnieCoreTexture.CompartmentIron);
|
super("compartmentIron", BinnieCoreTexture.CompartmentIron, 4, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void createMachine(Machine machine) {
|
|
||||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
|
||||||
new ComponentCompartmentInventory(machine, 4, 50);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PackageCompartmentGold extends Compartment.PackageCompartment {
|
public static class PackageCompartmentGold extends Compartment.PackageCompartment {
|
||||||
|
|
||||||
public PackageCompartmentGold() {
|
public PackageCompartmentGold() {
|
||||||
super("compartmentGold", BinnieCoreTexture.CompartmentGold);
|
super("compartmentGold", BinnieCoreTexture.CompartmentGold, 6, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void createMachine(Machine machine) {
|
|
||||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
|
||||||
new ComponentCompartmentInventory(machine, 6, 50);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PackageCompartmentDiamond extends Compartment.PackageCompartment {
|
public static class PackageCompartmentDiamond extends Compartment.PackageCompartment {
|
||||||
|
|
||||||
public PackageCompartmentDiamond() {
|
public PackageCompartmentDiamond() {
|
||||||
super("compartmentDiamond", BinnieCoreTexture.CompartmentDiamond);
|
super("compartmentDiamond", BinnieCoreTexture.CompartmentDiamond, 8, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void createMachine(Machine machine) {
|
|
||||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
|
||||||
new ComponentCompartmentInventory(machine, 8, 50);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,7 +104,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
|||||||
tabs2 = new Integer[] { 4, 5, 6, 7 };
|
tabs2 = new Integer[] { 4, 5, 6, 7 };
|
||||||
}
|
}
|
||||||
boolean doubleTabbed = tabs2.length > 0;
|
boolean doubleTabbed = tabs2.length > 0;
|
||||||
int compartmentPageWidth = 16 + 18 * inv.getPageSize() / 5;
|
int compartmentPageWidth = 16 + 18 * inv.getPageSize() / Compartment.PackageCompartment.ROWS_PER_TAB;
|
||||||
int compartmentPageHeight = 106;
|
int compartmentPageHeight = 106;
|
||||||
int compartmentWidth = compartmentPageWidth + (doubleTabbed ? 48 : 24);
|
int compartmentWidth = compartmentPageWidth + (doubleTabbed ? 48 : 24);
|
||||||
|
|
||||||
@@ -193,8 +193,12 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
|||||||
slotsIDs[k] = i++;
|
slotsIDs[k] = i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
new ControlSlotArray(thisPage, 8, 8, inv.getPageSize() / 5, 5)
|
new ControlSlotArray(
|
||||||
.create(actions, InventoryType.Machine, slotsIDs);
|
thisPage,
|
||||||
|
8,
|
||||||
|
8,
|
||||||
|
inv.getPageSize() / Compartment.PackageCompartment.ROWS_PER_TAB,
|
||||||
|
Compartment.PackageCompartment.ROWS_PER_TAB).create(actions, InventoryType.Machine, slotsIDs);
|
||||||
}
|
}
|
||||||
MessageCraftGUI.sendToServer(actions);
|
MessageCraftGUI.sendToServer(actions);
|
||||||
x += compartmentPageWidth;
|
x += compartmentPageWidth;
|
||||||
|
|||||||
@@ -282,6 +282,7 @@ binniecore.machine.storage.tab.properties=Tab Properties
|
|||||||
binniecore.machine.storage.tab.properties.desc=The label, color and icon of the Tab can be altered here. Clicking on the icon with a held item will change it
|
binniecore.machine.storage.tab.properties.desc=The label, color and icon of the Tab can be altered here. Clicking on the icon with a held item will change it
|
||||||
binniecore.machine.storage.tab.name=Tab Name:
|
binniecore.machine.storage.tab.name=Tab Name:
|
||||||
binniecore.machine.storage.tab.icon=Tab Icon:
|
binniecore.machine.storage.tab.icon=Tab Icon:
|
||||||
|
binniecore.machine.storage.tooltip.size=Inventory %s*%s*%s - %s Slots
|
||||||
binniecore.machine.storage.tooltip.icon=Icon for Current Tab
|
binniecore.machine.storage.tooltip.icon=Icon for Current Tab
|
||||||
binniecore.machine.storage.tooltip.icon.desc=Click here with an item to change
|
binniecore.machine.storage.tooltip.icon.desc=Click here with an item to change
|
||||||
binniecore.machine.storage.tab.color=Color:
|
binniecore.machine.storage.tab.color=Color:
|
||||||
|
|||||||
Reference in new issue
Block a user