-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix Primordial Cradle consuming Tetra tools
- Loading branch information
1 parent
67383e4
commit 9ee49e4
Showing
5 changed files
with
72 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
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
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
27 changes: 27 additions & 0 deletions
27
src/main/java/com/github/elenterius/biomancy/integration/tetra/TetraCompat.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,27 @@ | ||
package com.github.elenterius.biomancy.integration.tetra; | ||
|
||
import net.minecraft.world.item.Item; | ||
import se.mickelus.tetra.items.modular.IModularItem; | ||
import se.mickelus.tetra.properties.IToolProvider; | ||
|
||
import java.util.function.Consumer; | ||
|
||
public final class TetraCompat { | ||
private TetraCompat() {} | ||
|
||
public static void init(Consumer<TetraHelper> helperSetter) { | ||
helperSetter.accept(new TetraCompat.TetraHelperImpl()); | ||
} | ||
|
||
public static void onPostSetup() { | ||
//TODO: register Dragon Sinew as Primordial Cradle tribute | ||
} | ||
|
||
static final class TetraHelperImpl implements TetraHelper { | ||
@Override | ||
public boolean isToolOrModularItem(Item item) { | ||
return item instanceof IModularItem || item instanceof IToolProvider; | ||
} | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/com/github/elenterius/biomancy/integration/tetra/TetraHelper.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,18 @@ | ||
package com.github.elenterius.biomancy.integration.tetra; | ||
|
||
import net.minecraft.world.item.Item; | ||
|
||
public sealed interface TetraHelper permits TetraCompat.TetraHelperImpl, TetraHelper.EmptyTetraHelper { | ||
|
||
TetraHelper EMPTY = new TetraHelper.EmptyTetraHelper(); | ||
|
||
boolean isToolOrModularItem(Item item); | ||
|
||
final class EmptyTetraHelper implements TetraHelper { | ||
@Override | ||
public boolean isToolOrModularItem(Item item) { | ||
return false; | ||
} | ||
} | ||
|
||
} |