Skip to content

Commit

Permalink
Merge pull request #3 from GTNewHorizons/feature/baubles
Browse files Browse the repository at this point in the history
allow pulling items equipped in baubles
  • Loading branch information
Dream-Master authored May 17, 2024
2 parents 25f317a + ee0ba30 commit 52f9e1e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ dependencies {
transitive = false
}
implementation("com.github.GTNewHorizons:Railcraft:9.15.8:dev")

implementation("com.github.GTNewHorizons:Baubles:1.0.3:dev")
implementation("com.github.GTNewHorizons:BloodMagic:1.6.0:dev")

// for convenience of debug
runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev")
runtimeOnlyNonPublishable("com.github.GTNewHorizons:waila:1.7.3:dev")
Expand Down
30 changes: 30 additions & 0 deletions src/main/java/net/glease/structurecompat/CompatBaubles.java
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();
}
});
}
}

0 comments on commit 52f9e1e

Please sign in to comment.