crwdns156021:0crwdne156021:0
crwdns156023:0crwdne156023:0
crwdns156025:0crwdne156025:0
Note
crwdns156027:0crwdne156027:0
// Basic indexed Inventory
public static Inventory buildIndexedInventory(int capacity) {
return Inventory.builder().slots(capacity).completeStructure().plugin(this.pluginContainer).build();
}
// Basic grid Inventory
public static Inventory buildIndexedInventory(int x, int y) {
return Inventory.builder().grid(x, y).completeStructure().plugin(this.pluginContainer).build();
}
// Combined inventories
public static Inventory buildIndexedInventory(Inventory base, int additionalCapacity) {
return Inventory.builder().inventory(base).slots(additionalCapacity).completeStructure().plugin(this.pluginContainer).build();
}
// Inventory with carrier and identity
public static Inventory buildIndexedInventory(int capacity) {
return Inventory.builder().slots(capacity).completeStructure()
.plugin(this.pluginContainer)
.identity(uuid)
.carrier(carrier)
.build();
}
crwdns156029:0crwdne156029:0
crwdns156031:0crwdne156031:0
// Simple 3x3 inventory - looks like a Dropper
public ViewableInventory simpleThreeByThree() {
return ViewableInventory.builder().type(ContainerTypes.GENERIC_3X3).completeStructure().plugin(this.plugin).build();
}
// To replicate vanilla behaviour of an inventory. e.g. anvil provide no structure
public ViewableInventory vanillaAnvil() {
return ViewableInventory.builder().type(ContainerTypes.ANVIL).completeStructure().plugin(this.plugin).build();
}
// Chest 9x3 View of 3 other 3x3 inventories
public ViewableInventory threeByThreeByThree() {
Inventory i1 = Inventory.builder().grid(3, 3).completeStructure().plugin(this.pluginContainer).build();
Inventory i2 = Inventory.builder().grid(3, 3).completeStructure().plugin(this.pluginContainer).build();
Inventory i3 = Inventory.builder().grid(3, 3).completeStructure().plugin(this.pluginContainer).build();
return ViewableInventory.builder().type(ContainerTypes.GENERIC_9X3)
.grid(i1.slots(), Vector2i.from(3, 3), Vector2i.from(0, 0))
.grid(i2.slots(), Vector2i.from(3, 3), Vector2i.from(3, 0))
.grid(i3.slots(), Vector2i.from(3, 3), Vector2i.from(6, 0))
.completeStructure().plugin(this.plugin).build();
}