start 1.10.2

This commit is contained in:
marcin212 committed 2016-10-20 04:32:47 +02:00
1 parent f969f63b66
commit 6a7c4bf67d
826 files changed
+60550 -63758

No files matched your search

@@ -1,71 +1,67 @@
//
// Decompiled by Procyon v0.5.30
//
package binnie.craftgui.minecraft.control;
import java.util.Iterator;
import binnie.craftgui.controls.core.Control;
import binnie.craftgui.core.IWidget;
import binnie.craftgui.minecraft.InventoryType;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import binnie.craftgui.core.IWidget;
import java.util.Iterator;
import java.util.List;
import binnie.craftgui.controls.core.Control;
public class ControlSlotArray extends Control implements Iterable<ControlSlot>
{
private int rows;
private int columns;
private List<ControlSlot> slots;
public class ControlSlotArray extends Control implements Iterable<ControlSlot> {
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<ControlSlot>();
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<ControlSlot>();
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();
}
}