use of org.spongepowered.common.item.inventory.lens.impl.fabric.IInventoryFabric in project SpongeCommon by SpongePowered.
the class InventoryUtil method toSpongeInventory.
public static CraftingGridInventory toSpongeInventory(InventoryCrafting inv) {
IInventoryFabric fabric = new IInventoryFabric(inv);
CraftingGridInventoryLens lens = new CraftingGridInventoryLensImpl(0, inv.getWidth(), inv.getHeight(), inv.getWidth(), SlotLensImpl::new);
return new CraftingGridInventoryAdapter(fabric, lens);
}
use of org.spongepowered.common.item.inventory.lens.impl.fabric.IInventoryFabric in project SpongeCommon by SpongePowered.
the class MixinEntityMinecartHopper method onConstructed.
@Inject(method = "<init>*", at = @At("RETURN"))
public void onConstructed(CallbackInfo ci) {
this.fabric = new IInventoryFabric(this);
this.slots = new SlotCollection.Builder().add(5).build();
this.lens = new OrderedInventoryLensImpl(0, 5, 1, this.slots);
}
use of org.spongepowered.common.item.inventory.lens.impl.fabric.IInventoryFabric in project SpongeCommon by SpongePowered.
the class MixinInventoryCrafting method onConstructed.
@Inject(method = "<init>", at = @At("RETURN"))
public void onConstructed(CallbackInfo ci) {
this.fabric = new IInventoryFabric(this);
this.slots = new SlotCollection.Builder().add(this.stackList.size()).build();
this.lens = rootLens(fabric, ((InventoryAdapter) this));
}
use of org.spongepowered.common.item.inventory.lens.impl.fabric.IInventoryFabric in project SpongeCommon by SpongePowered.
the class MixinEntityMinecartChest method onConstructed.
@Inject(method = "<init>*", at = @At("RETURN"))
public void onConstructed(CallbackInfo ci) {
this.fabric = new IInventoryFabric(this);
this.slots = new SlotCollection.Builder().add(27).build();
this.lens = new GridInventoryLensImpl(0, 9, 3, 9, this.slots);
}
use of org.spongepowered.common.item.inventory.lens.impl.fabric.IInventoryFabric in project SpongeCommon by SpongePowered.
the class MixinEntityVillager method onConstructed.
@Inject(method = "<init>", at = @At("RETURN"))
public void onConstructed(CallbackInfo ci) {
this.fabric = new IInventoryFabric(this.villagerInventory);
this.slots = new SlotCollection.Builder().add(8).build();
this.lens = new OrderedInventoryLensImpl(0, 8, 1, this.slots);
}
Aggregations