Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Mixin for reusable lens inventories
Browse files Browse the repository at this point in the history
InventoryAdapter getInventory->getFabric
  • Loading branch information
Faithcaio committed Dec 1, 2017
1 parent 815c155 commit 7579b75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public Inventory getChild(int index) {
}
Inventory child = this.children.get(index);
if (child == null) {
child = this.getRootLens().getChildren().get(index).getAdapter(this.getInventory(), this);
child = this.getRootLens().getChildren().get(index).getAdapter(this.getFabric(), this);
this.children.set(index, child);
}
return child;
Expand All @@ -134,15 +134,15 @@ public <T extends Inventory> Iterable<T> slots() {

@Intrinsic
public void inventory$clear() {
this.getInventory().clear();
this.getFabric().clear();
}

public Lens<IInventory, ItemStack> getRootLens() {
this.init();
return this.lens;
}

public Fabric<IInventory> getInventory() {
public Fabric<IInventory> getFabric() {
this.init();
return ((Fabric) this.fabric);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public Inventory getChild(int index) {
}
Inventory child = this.children.get(index);
if (child == null) {
child = this.getRootLens().getChildren().get(index).getAdapter(this.getInventory(), this);
child = this.getRootLens().getChildren().get(index).getAdapter(this.getFabric(), this);
this.children.set(index, child);
}
return child;
Expand All @@ -134,15 +134,15 @@ public <T extends Inventory> Iterable<T> slots() {

@Intrinsic
public void inventory$clear() {
this.getInventory().clear();
this.getFabric().clear();
}

public Lens<IInventory, ItemStack> getRootLens() {
this.init();
return this.lens;
}

public Fabric<IInventory> getInventory() {
public Fabric<IInventory> getFabric() {
this.init();
return ((Fabric) this.fabric);
}
Expand Down

0 comments on commit 7579b75

Please sign in to comment.