-
Notifications
You must be signed in to change notification settings - Fork 40
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
cfc1427
commit 5e78e1e
Showing
6 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
common/src/main/java/dev/dubhe/anvilcraft/api/event/recipe/RecipeReloadEvent.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,8 @@ | ||
package dev.dubhe.anvilcraft.api.event.recipe; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public class RecipeReloadEvent { | ||
public RecipeReloadEvent() {} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
common/src/main/java/dev/dubhe/anvilcraft/integration/kubejs/evnet/AnvilEvents.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,13 @@ | ||
package dev.dubhe.anvilcraft.integration.kubejs.evnet; | ||
|
||
import dev.latvian.mods.kubejs.event.EventGroup; | ||
import dev.latvian.mods.kubejs.event.EventHandler; | ||
|
||
/** | ||
* kubeJs的铁砧工艺事件 | ||
*/ | ||
public interface AnvilEvents { | ||
EventGroup GROUP = EventGroup.of("AnvilEvents"); | ||
EventHandler LOAD_ANVIL_CRAFTING_RECIPES = | ||
GROUP.server("load_anvil_crafting_recipes", () -> LoadAnvilCraftingRecipeEvent.class); | ||
} |
16 changes: 16 additions & 0 deletions
16
...main/java/dev/dubhe/anvilcraft/integration/kubejs/evnet/LoadAnvilCraftingRecipeEvent.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 dev.dubhe.anvilcraft.integration.kubejs.evnet; | ||
|
||
import dev.dubhe.anvilcraft.api.recipe.AnvilRecipeManager; | ||
import dev.dubhe.anvilcraft.data.recipe.anvil.AnvilRecipe; | ||
import dev.latvian.mods.kubejs.event.EventJS; | ||
|
||
public class LoadAnvilCraftingRecipeEvent extends EventJS { | ||
public static final String ID = "anvil.recipe.load"; | ||
|
||
|
||
public LoadAnvilCraftingRecipeEvent() {} | ||
|
||
public void register(AnvilRecipe anvilRecipe) { | ||
AnvilRecipeManager.externalRecipeList.add(anvilRecipe); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
.../main/java/dev/dubhe/anvilcraft/integration/kubejs/listner/RecipeReloadEventListener.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,13 @@ | ||
package dev.dubhe.anvilcraft.integration.kubejs.listner; | ||
|
||
import dev.dubhe.anvilcraft.api.event.SubscribeEvent; | ||
import dev.dubhe.anvilcraft.api.event.recipe.RecipeReloadEvent; | ||
import dev.dubhe.anvilcraft.integration.kubejs.evnet.AnvilEvents; | ||
import dev.dubhe.anvilcraft.integration.kubejs.evnet.LoadAnvilCraftingRecipeEvent; | ||
|
||
public class RecipeReloadEventListener { | ||
@SubscribeEvent | ||
public void onReload(RecipeReloadEvent recipeReloadEvent) { | ||
AnvilEvents.LOAD_ANVIL_CRAFTING_RECIPES.post(new LoadAnvilCraftingRecipeEvent()); | ||
} | ||
} |