Skip to content

Commit

Permalink
Edge case fixes for dummy slots
Browse files Browse the repository at this point in the history
  • Loading branch information
aromaa committed Nov 23, 2024
1 parent c54c2b5 commit a6eb8a0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ private Slot newDummySlot() {
// Slot definition Impl:
public BuildingStep slotsAtIndizes(List<Slot> source, List<Integer> at) {
Validate.isTrue(source.size() == at.size(), "Source and index list sizes differ");
this.lastSlot = null;
for (int i = 0; i < at.size(); i++) {
Slot slot = source.get(i);
Integer index = at.get(i);
Expand Down Expand Up @@ -215,7 +216,9 @@ public BuildingStep grid(List<Slot> source, Vector2i size, int offset) {
// dummy
@Override
public BuildingStep item(ItemStackLike item) {
this.lastSlot.set(item);
if (this.lastSlot != null) {
this.lastSlot.set(item);
}
return this;
}

Expand Down

0 comments on commit a6eb8a0

Please sign in to comment.