-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when using Integrated Tunnels with chests
Closes #169
- Loading branch information
1 parent
6ae7fba
commit efdf7be
Showing
2 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...a/org/cyclops/colossalchests/modcompat/InventoryIndexReferenceIndexedInventoryCommon.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.cyclops.colossalchests.modcompat; | ||
|
||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.cyclops.cyclopscore.inventory.IndexedInventoryCommon; | ||
import org.cyclops.cyclopscore.inventory.IndexedSlotlessItemHandlerWrapper; | ||
|
||
import java.util.Map; | ||
import java.util.PrimitiveIterator; | ||
|
||
/** | ||
* @author rubensworks | ||
*/ | ||
public class InventoryIndexReferenceIndexedInventoryCommon implements IndexedSlotlessItemHandlerWrapper.IInventoryIndexReference { | ||
|
||
private final IndexedInventoryCommon inventory; | ||
|
||
public InventoryIndexReferenceIndexedInventoryCommon(IndexedInventoryCommon inventory) { | ||
this.inventory = inventory; | ||
} | ||
|
||
@Override | ||
public int getInventoryReferenceStackLimit() { | ||
return this.inventory.getInventoryReferenceStackLimit(); | ||
} | ||
|
||
@Override | ||
public Map<Item, Int2ObjectMap<ItemStack>> getIndex() { | ||
return this.inventory.getIndex(); | ||
} | ||
|
||
@Override | ||
public PrimitiveIterator.OfInt getEmptySlots() { | ||
return this.inventory.getEmptySlots(); | ||
} | ||
|
||
@Override | ||
public PrimitiveIterator.OfInt getNonEmptySlots() { | ||
return this.inventory.getNonEmptySlots(); | ||
} | ||
} |