-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90a4c8e
commit af3b99e
Showing
7 changed files
with
36 additions
and
7 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
23 changes: 23 additions & 0 deletions
23
src/main/java/limonblaze/originsclasses/common/apoli/condition/item/ToolActionCondition.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,23 @@ | ||
package limonblaze.originsclasses.common.apoli.condition.item; | ||
|
||
import com.mojang.serialization.Codec; | ||
import io.github.edwinmindcraft.apoli.api.configuration.FieldConfiguration; | ||
import io.github.edwinmindcraft.apoli.api.power.factory.ItemCondition; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraftforge.common.ToolAction; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
public class ToolActionCondition extends ItemCondition<FieldConfiguration<String>> { | ||
|
||
public ToolActionCondition() { | ||
super(FieldConfiguration.codec(Codec.STRING, "tool_action")); | ||
} | ||
|
||
@Override | ||
protected boolean check(FieldConfiguration<String> configuration, @Nonnull Level level, ItemStack stack) { | ||
return stack.canPerformAction(ToolAction.get(configuration.value())); | ||
} | ||
|
||
} |
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
6 changes: 5 additions & 1 deletion
6
src/main/resources/data/origins_classes/powers/tree_felling.json
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"type": "origins_classes:lumberjack" | ||
"type": "origins_classes:lumberjack", | ||
"item_condition": { | ||
"type": "origins_classes:tool_action", | ||
"tool_action": "axe_dig" | ||
} | ||
} |