-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added compatibility with orpheus' orpheus lyre
Improved api-stuff to allow modification of drop rules after drop rules has been handled, based on the entire inventory component
- Loading branch information
Showing
12 changed files
with
126 additions
and
5 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
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
2 changes: 1 addition & 1 deletion
2
...igd/compat/CommonProtectionApiCompat.java → ...CompatMods/CommonProtectionApiCompat.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
20 changes: 20 additions & 0 deletions
20
src/main/java/com/b1n_ry/yigd/compat/miscCompatMods/OrpheusCompat.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,20 @@ | ||
package com.b1n_ry.yigd.compat.miscCompatMods; | ||
|
||
import com.b1n_ry.yigd.events.AdjustDropRuleEvent; | ||
import com.b1n_ry.yigd.util.DropRule; | ||
import com.ecarrascon.orpheus.Orpheus; | ||
import com.ecarrascon.orpheus.registry.ItemsRegistry; | ||
|
||
public class OrpheusCompat { | ||
public static void init() { | ||
AdjustDropRuleEvent.EVENT.register((inventory, context) -> { | ||
String orpheusLyrePower = Orpheus.CONFIG_VALUES.getOrpheusLyrePower(); | ||
|
||
if (!orpheusLyrePower.equals("keep") && !orpheusLyrePower.equals("both")) return; | ||
|
||
if (inventory.containsAny(stack -> stack.isOf(ItemsRegistry.ORPHEUS_LYRE.get()), s -> true, i -> true)) { | ||
inventory.setDropRules(stack -> true, s -> true, i -> true, DropRule.KEEP); | ||
} | ||
}); | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/b1n_ry/yigd/events/AdjustDropRuleEvent.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,16 @@ | ||
package com.b1n_ry.yigd.events; | ||
|
||
import com.b1n_ry.yigd.components.InventoryComponent; | ||
import com.b1n_ry.yigd.data.DeathContext; | ||
import net.fabricmc.fabric.api.event.Event; | ||
import net.fabricmc.fabric.api.event.EventFactory; | ||
|
||
public interface AdjustDropRuleEvent { | ||
Event<AdjustDropRuleEvent> EVENT = EventFactory.createArrayBacked(AdjustDropRuleEvent.class, events -> (inventory, context) -> { | ||
for (AdjustDropRuleEvent event : events) { | ||
event.adjustDropRule(inventory, context); | ||
} | ||
}); | ||
|
||
void adjustDropRule(InventoryComponent inventoryComponent, DeathContext context); | ||
} |
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