-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from GTNewHorizons/feature/baubles
allow pulling items equipped in baubles
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
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
30 changes: 30 additions & 0 deletions
30
src/main/java/net/glease/structurecompat/CompatBaubles.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,30 @@ | ||
package net.glease.structurecompat; | ||
|
||
import net.minecraft.entity.player.EntityPlayerMP; | ||
import net.minecraft.inventory.IInventory; | ||
|
||
import com.gtnewhorizon.structurelib.util.InventoryIterable; | ||
import com.gtnewhorizon.structurelib.util.InventoryUtility; | ||
|
||
import baubles.api.BaublesApi; | ||
|
||
@Compat("Baubles") | ||
public class CompatBaubles { | ||
|
||
public CompatBaubles() { | ||
InventoryUtility.registerInventoryProvider( | ||
"5001-baubles", | ||
new InventoryUtility.InventoryProvider<InventoryIterable<IInventory>>() { | ||
|
||
@Override | ||
public InventoryIterable<IInventory> getInventory(EntityPlayerMP player) { | ||
return new InventoryIterable<>(BaublesApi.getBaubles(player)); | ||
} | ||
|
||
@Override | ||
public void markDirty(InventoryIterable<IInventory> inv) { | ||
inv.getInventory().markDirty(); | ||
} | ||
}); | ||
} | ||
} |