generated from NeoForgeMDKs/MDK-1.21-ModDevGradle
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
34 changed files
with
798 additions
and
229 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,7 @@ | ||
|
||
Installation information | ||
======= | ||
# 稗田阿求的书卷 Hieda no Akyuu no Makimono | ||
|
||
This template repository can be directly cloned to get you started with a new | ||
mod. Simply create a new repository cloned from this one, by following the | ||
instructions provided by [GitHub](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template). | ||
这是稗茗奉月居创作的用于纪念稗田阿求的模组 | ||
|
||
Once you have your clone, simply open the repository in the IDE of your choice. The usual recommendation for an IDE is either IntelliJ IDEA or Eclipse. | ||
|
||
If at any point you are missing libraries in your IDE, or you've run into problems you can | ||
run `gradlew --refresh-dependencies` to refresh the local cache. `gradlew clean` to reset everything | ||
{this does not affect your code} and then start the process again. | ||
|
||
Mapping Names: | ||
============ | ||
By default, the MDK is configured to use the official mapping names from Mojang for methods and fields | ||
in the Minecraft codebase. These names are covered by a specific license. All modders should be aware of this | ||
license. For the latest license text, refer to the mapping file itself, or the reference copy here: | ||
https://github.com/NeoForged/NeoForm/blob/main/Mojang.md | ||
|
||
Additional Resources: | ||
========== | ||
Community Documentation: https://docs.neoforged.net/ | ||
NeoForged Discord: https://discord.neoforged.net/ | ||
保留所有权利 | ||
All rights reserved |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/Config.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,35 @@ | ||
package org.hiedacamellia.hiedanoakyuunomakimono; | ||
|
||
import net.neoforged.bus.api.SubscribeEvent; | ||
import net.neoforged.fml.common.EventBusSubscriber; | ||
import net.neoforged.fml.event.config.ModConfigEvent; | ||
import net.neoforged.neoforge.common.ModConfigSpec; | ||
|
||
// An example config class. This is not required, but it's a good idea to have one to keep your config organized. | ||
// Demonstrates how to use Neo's config APIs | ||
@EventBusSubscriber(modid = HiedanoAkyuunoMakimono.MODID, bus = EventBusSubscriber.Bus.MOD) | ||
public class Config | ||
{ | ||
private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder(); | ||
|
||
private static final ModConfigSpec.BooleanValue DEBUG = BUILDER | ||
.comment("Set to true to enable debug info") | ||
.comment("设置为true以启用调试信息") | ||
.define("debug", true); | ||
|
||
|
||
static final ModConfigSpec SPEC = BUILDER.build(); | ||
|
||
public static boolean debug; | ||
|
||
public static void setDebug(boolean debug){ | ||
DEBUG.set(debug); | ||
} | ||
|
||
|
||
@SubscribeEvent | ||
static void onLoad(final ModConfigEvent event) | ||
{ | ||
debug = DEBUG.get(); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/HiedanoAkyuunoMakimono.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,36 @@ | ||
package org.hiedacamellia.hiedanoakyuunomakimono; | ||
|
||
|
||
import net.neoforged.bus.api.IEventBus; | ||
import net.neoforged.fml.ModContainer; | ||
import net.neoforged.fml.common.Mod; | ||
import net.neoforged.fml.config.ModConfig; | ||
import org.hiedacamellia.hiedanoakyuunomakimono.core.data.Data; | ||
import org.hiedacamellia.hiedanoakyuunomakimono.registers.*; | ||
|
||
@Mod(HiedanoAkyuunoMakimono.MODID) | ||
public class HiedanoAkyuunoMakimono { | ||
public static final String MODID = "hiedanoakyuunomakimono"; | ||
|
||
public HiedanoAkyuunoMakimono(IEventBus modEventBus, ModContainer modContainer) | ||
{ | ||
modEventBus.addListener(Data::onGatherData); | ||
|
||
HAMBlock.BLOCKS.register(modEventBus); | ||
HAMBlockItem.ITEMS.register(modEventBus); | ||
HAMItem.ITEMS.register(modEventBus); | ||
HAMTab.TABS.register(modEventBus); | ||
HAMAttachment.ATTACHMENTS.register(modEventBus); | ||
HAMDataComponent.DATA_COMPONENTS.register(modEventBus); | ||
HAMEffect.EFFECTS.register(modEventBus); | ||
HAMMenu.MENUS.register(modEventBus); | ||
HAMRicipe.RECIPE_TYPES.register(modEventBus); | ||
HAMRicipeSerializer.RECIPE_SERIALIZERS.register(modEventBus); | ||
HAMBlockEntity.BLOCK_ENTITIES.register(modEventBus); | ||
|
||
// NeoForge.EVENT_BUS.register(this); | ||
|
||
|
||
modContainer.registerConfig(ModConfig.Type.COMMON, Config.SPEC); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/org/hiedacamellia/hiedanoakyuunomakimono/core/data/Data.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 org.hiedacamellia.hiedanoakyuunomakimono.core.data; | ||
|
||
import net.neoforged.neoforge.data.event.GatherDataEvent; | ||
import org.hiedacamellia.hiedanoakyuunomakimono.core.data.lang.ChineseLanguageProvider; | ||
import org.hiedacamellia.hiedanoakyuunomakimono.core.data.lang.ClassicalChineseLanguageProvider; | ||
import org.hiedacamellia.hiedanoakyuunomakimono.core.data.lang.EnglishLanguageProvider; | ||
import org.hiedacamellia.hiedanoakyuunomakimono.core.data.provider.ModelProvider; | ||
import org.hiedacamellia.hiedanoakyuunomakimono.core.data.provider.StateProvider; | ||
import org.hiedacamellia.hiedanoakyuunomakimono.core.data.provider.WGRecipeProvider; | ||
|
||
public class Data { | ||
public static void onGatherData(GatherDataEvent event) { | ||
var gen = event.getGenerator(); | ||
var packOutput = gen.getPackOutput(); | ||
var helper = event.getExistingFileHelper(); | ||
gen.addProvider(event.includeClient(), new EnglishLanguageProvider(packOutput)); | ||
gen.addProvider(event.includeClient(), new ChineseLanguageProvider(packOutput)); | ||
gen.addProvider(event.includeClient(), new ClassicalChineseLanguageProvider(packOutput)); | ||
gen.addProvider(event.includeClient(), new ModelProvider(packOutput, helper)); | ||
gen.addProvider(event.includeClient(), new StateProvider(packOutput, helper)); | ||
gen.addProvider(event.includeServer(), new WGRecipeProvider(packOutput, event.getLookupProvider())); | ||
} | ||
} |
Oops, something went wrong.