mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-17 19:15:24 +00:00
Auto-format spaces to tabs (#2)
This commit is contained in:
1 parent
25be7fd254
commit
5bb4b5d9a5
756 files changed
+49198
-48489
No files matched your search
@@ -10,58 +10,58 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class ControlSlotArray extends Control implements Iterable<ControlSlot> {
|
||||
private int rows;
|
||||
private int columns;
|
||||
private List<ControlSlot> slots;
|
||||
private int rows;
|
||||
private int columns;
|
||||
private List<ControlSlot> slots;
|
||||
|
||||
public ControlSlotArray(final IWidget parent, final int x, final int y, final int columns, final int rows) {
|
||||
super(parent, x, y, columns * 18, rows * 18);
|
||||
this.slots = new ArrayList<>();
|
||||
this.rows = rows;
|
||||
this.columns = columns;
|
||||
for (int row = 0; row < rows; ++row) {
|
||||
for (int column = 0; column < columns; ++column) {
|
||||
this.slots.add(this.createSlot(column * 18, row * 18));
|
||||
}
|
||||
}
|
||||
}
|
||||
public ControlSlotArray(final IWidget parent, final int x, final int y, final int columns, final int rows) {
|
||||
super(parent, x, y, columns * 18, rows * 18);
|
||||
this.slots = new ArrayList<>();
|
||||
this.rows = rows;
|
||||
this.columns = columns;
|
||||
for (int row = 0; row < rows; ++row) {
|
||||
for (int column = 0; column < columns; ++column) {
|
||||
this.slots.add(this.createSlot(column * 18, row * 18));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ControlSlot createSlot(final int x, final int y) {
|
||||
return new ControlSlot(this, x, y);
|
||||
}
|
||||
public ControlSlot createSlot(final int x, final int y) {
|
||||
return new ControlSlot(this, x, y);
|
||||
}
|
||||
|
||||
public void setItemStacks(final ItemStack[] array) {
|
||||
int i = 0;
|
||||
for (final ItemStack item : array) {
|
||||
if (i >= this.slots.size()) {
|
||||
return;
|
||||
}
|
||||
this.slots.get(i).slot.putStack(item);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
public void setItemStacks(final ItemStack[] array) {
|
||||
int i = 0;
|
||||
for (final ItemStack item : array) {
|
||||
if (i >= this.slots.size()) {
|
||||
return;
|
||||
}
|
||||
this.slots.get(i).slot.putStack(item);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
public ControlSlot getControlSlot(final int i) {
|
||||
if (i < 0 || i >= this.slots.size()) {
|
||||
return null;
|
||||
}
|
||||
return this.slots.get(i);
|
||||
}
|
||||
public ControlSlot getControlSlot(final int i) {
|
||||
if (i < 0 || i >= this.slots.size()) {
|
||||
return null;
|
||||
}
|
||||
return this.slots.get(i);
|
||||
}
|
||||
|
||||
public ControlSlotArray create(final int[] index) {
|
||||
return this.create(InventoryType.Machine, index);
|
||||
}
|
||||
public ControlSlotArray create(final int[] index) {
|
||||
return this.create(InventoryType.Machine, index);
|
||||
}
|
||||
|
||||
public ControlSlotArray create(final InventoryType type, final int[] index) {
|
||||
int i = 0;
|
||||
for (final ControlSlot slot : this.slots) {
|
||||
slot.assign(type, index[i++]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
public ControlSlotArray create(final InventoryType type, final int[] index) {
|
||||
int i = 0;
|
||||
for (final ControlSlot slot : this.slots) {
|
||||
slot.assign(type, index[i++]);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<ControlSlot> iterator() {
|
||||
return this.slots.iterator();
|
||||
}
|
||||
@Override
|
||||
public Iterator<ControlSlot> iterator() {
|
||||
return this.slots.iterator();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user