-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev/1.21' of https://github.com/KessokuTeaTime/Kessoku-Lib
- Loading branch information
Showing
35 changed files
with
913 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
group = "band.kessoku.lib.command" | ||
version = libs.versions.mod.get() + "+common." + libs.versions.minecraft.get() | ||
|
||
base { | ||
archivesName = rootProject.name + "-command_api" | ||
} | ||
|
||
architectury { | ||
common(["fabric", "neoforge"]) | ||
} | ||
|
||
dependencies { | ||
modImplementation libs.fabric.loader | ||
implementation(project(":base-common")) | ||
implementation(project(":event-base-common")) | ||
} |
5 changes: 5 additions & 0 deletions
5
command-common/src/main/java/band/kessoku/lib/command/KessokuCommand.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,5 @@ | ||
package band.kessoku.lib.command; | ||
|
||
public class KessokuCommand { | ||
public static final String MOD_ID = "kessoku_command"; | ||
} |
10 changes: 7 additions & 3 deletions
10
...event/events/command/CommandRegister.java → ...mand/api/events/CommandRegistryEvent.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
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,56 @@ | ||
plugins { | ||
id 'com.github.johnrengelman.shadow' | ||
} | ||
|
||
group = "band.kessoku.lib.command" | ||
version = libs.versions.mod.get() + "+fabric." + libs.versions.minecraft.get() | ||
|
||
base { | ||
archivesName = rootProject.name + "-command_api" | ||
} | ||
|
||
architectury { | ||
platformSetupLoomIde() | ||
fabric() | ||
} | ||
|
||
configurations { | ||
common { | ||
canBeResolved = true | ||
canBeConsumed = false | ||
} | ||
compileClasspath.extendsFrom common | ||
runtimeClasspath.extendsFrom common | ||
developmentFabric.extendsFrom common | ||
shadowBundle { | ||
canBeResolved = true | ||
canBeConsumed = false | ||
} | ||
} | ||
|
||
dependencies { | ||
modImplementation libs.fabric.loader | ||
modImplementation libs.fabric.api | ||
|
||
implementation(project(":event-base-common")) | ||
|
||
common(project(path: ':command-common', configuration: 'namedElements')) { transitive false } | ||
shadowBundle project(path: ':command-common', configuration: 'transformProductionFabric') | ||
} | ||
|
||
processResources { | ||
inputs.property 'version', project.version | ||
|
||
filesMatching('fabric.mod.json') { | ||
expand version: project.version | ||
} | ||
} | ||
|
||
shadowJar { | ||
configurations = [project.configurations.shadowBundle] | ||
archiveClassifier = 'dev-shadow' | ||
} | ||
|
||
remapJar { | ||
input.set shadowJar.archiveFile | ||
} |
11 changes: 11 additions & 0 deletions
11
command-fabric/src/main/java/band/kessoku/lib/command/KessokuCommandEntrypoint.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,11 @@ | ||
package band.kessoku.lib.command; | ||
|
||
import band.kessoku.lib.command.impl.KessokuCommandImpl; | ||
import net.fabricmc.api.ModInitializer; | ||
|
||
public class KessokuCommandEntrypoint implements ModInitializer { | ||
@Override | ||
public void onInitialize() { | ||
KessokuCommandImpl.registerCommonEvents(); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
command-fabric/src/main/java/band/kessoku/lib/command/impl/KessokuCommandImpl.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,12 @@ | ||
package band.kessoku.lib.command.impl; | ||
|
||
import band.kessoku.lib.command.api.events.CommandRegistryEvent; | ||
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; | ||
|
||
public class KessokuCommandImpl { | ||
public static void registerCommonEvents() { | ||
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> { | ||
CommandRegistryEvent.EVENT.invoker().register(dispatcher, registryAccess, environment); | ||
}); | ||
} | ||
} |
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,31 @@ | ||
{ | ||
"schemaVersion": 1, | ||
"id": "kessoku_command", | ||
"version": "${version}", | ||
"name": "Kessoku Command API", | ||
"description": "About command registries.", | ||
"authors": [ | ||
"Kessoku Tea Time" | ||
], | ||
"contact": { | ||
"homepage": "https://modrinth.com/mod/kessoku-lib", | ||
"sources": "https://github.com/KessokuTeaTime/KessokuLib", | ||
"issues": "https://github.com/KessokuTeaTime/KessokuLib/issues" | ||
}, | ||
"license": "LGPL-3.0-only", | ||
"icon": "icon.png", | ||
"environment": "*", | ||
"depends": { | ||
"fabricloader": ">=0.16.0", | ||
"minecraft": "1.21", | ||
"java": ">=21", | ||
"fabric-api": "*" | ||
}, | ||
"custom": { | ||
"modmenu": { | ||
"badges": [ | ||
"library" | ||
] | ||
} | ||
} | ||
} |
Empty file.
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,60 @@ | ||
plugins { | ||
id 'com.github.johnrengelman.shadow' | ||
} | ||
|
||
group = "band.kessoku.lib.command" | ||
version = libs.versions.mod.get() + "+neoforge." + libs.versions.minecraft.get() | ||
|
||
base { | ||
archivesName = rootProject.name + "-command_api" | ||
} | ||
|
||
architectury { | ||
platformSetupLoomIde() | ||
neoForge() | ||
} | ||
|
||
repositories { | ||
maven { url "https://maven.neoforged.net/releases/" } | ||
} | ||
|
||
configurations { | ||
common { | ||
canBeResolved = true | ||
canBeConsumed = false | ||
} | ||
compileClasspath.extendsFrom common | ||
runtimeClasspath.extendsFrom common | ||
developmentNeoForge.extendsFrom common | ||
shadowBundle { | ||
canBeResolved = true | ||
canBeConsumed = false | ||
} | ||
} | ||
|
||
dependencies { | ||
neoForge libs.neo | ||
|
||
implementation(project(":event-base-common")) | ||
implementation(project(":event-base-neo")) | ||
|
||
common(project(path: ':command-common', configuration: 'namedElements')) { transitive false } | ||
shadowBundle project(path: ':command-common', configuration: 'transformProductionNeoForge') | ||
} | ||
|
||
processResources { | ||
inputs.property 'version', project.version | ||
|
||
filesMatching('META-INF/neoforge.mods.toml') { | ||
expand version: project.version | ||
} | ||
} | ||
|
||
shadowJar { | ||
configurations = [project.configurations.shadowBundle] | ||
archiveClassifier = 'dev-shadow' | ||
} | ||
|
||
remapJar { | ||
input.set shadowJar.archiveFile | ||
} |
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 @@ | ||
loom.platform=neoforge |
15 changes: 15 additions & 0 deletions
15
command-neo/src/main/java/band/kessoku/lib/command/KessokuCommandEntrypoint.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,15 @@ | ||
package band.kessoku.lib.command; | ||
|
||
import band.kessoku.lib.command.impl.KessokuCommandImpl; | ||
import net.neoforged.bus.api.IEventBus; | ||
import net.neoforged.fml.common.Mod; | ||
import net.neoforged.neoforge.common.NeoForge; | ||
|
||
@Mod(KessokuCommand.MOD_ID) | ||
public class KessokuCommandEntrypoint { | ||
public KessokuCommandEntrypoint(IEventBus modEventBus) { | ||
var forgeEventBus = NeoForge.EVENT_BUS; | ||
|
||
KessokuCommandImpl.registerCommonEvents(forgeEventBus); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
command-neo/src/main/java/band/kessoku/lib/command/impl/KessokuCommandImpl.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,14 @@ | ||
package band.kessoku.lib.command.impl; | ||
|
||
import band.kessoku.lib.command.api.events.CommandRegistryEvent; | ||
import band.kessoku.lib.event.util.NeoEventUtils; | ||
import net.neoforged.bus.api.IEventBus; | ||
import net.neoforged.neoforge.event.RegisterCommandsEvent; | ||
|
||
public class KessokuCommandImpl { | ||
public static void registerCommonEvents(IEventBus forgeEventBus) { | ||
NeoEventUtils.registerEvent(forgeEventBus, RegisterCommandsEvent.class, event -> { | ||
CommandRegistryEvent.EVENT.invoker().register(event.getDispatcher(), event.getBuildContext(), event.getCommandSelection()); | ||
}); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
command-neo/src/main/resources/META-INF/neoforge.mods.toml
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,29 @@ | ||
modLoader = "javafml" | ||
loaderVersion = "[4,)" | ||
license = "LGPL-3.0-only" | ||
issueTrackerURL = "https://github.com/KessokuTeaTime/KessokuLib/issues" | ||
|
||
[[mods]] | ||
modId = "kessoku_command" | ||
version = "${version}" | ||
displayName = "Kessoku Command API" | ||
description = ''' | ||
About command registries. | ||
''' | ||
logoFile = "icon.png" | ||
authors = "Kessoku Tea Time" | ||
displayURL = "https://modrinth.com/mod/kessoku-lib" | ||
|
||
[[dependencies.kessoku-event-base]] | ||
modId = "neoforge" | ||
type = "required" | ||
versionRange = "[21.0,)" | ||
ordering = "NONE" | ||
side = "BOTH" | ||
|
||
[[dependencies.kessoku-event-base]] | ||
modId = "minecraft" | ||
type = "required" | ||
versionRange = "[1.21,)" | ||
ordering = "NONE" | ||
side = "BOTH" |
18 changes: 0 additions & 18 deletions
18
...ase-common/src/main/java/band/kessoku/lib/event/events/brewing/BrewingRecipeRegister.java
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
...ase-common/src/main/java/band/kessoku/lib/event/events/command/ClientCommandRegister.java
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
event-base-neo/src/main/java/band/kessoku/lib/event/KessokuEventBaseEntrypoint.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,4 @@ | ||
package band.kessoku.lib.event; | ||
|
||
public class KessokuEventBaseEntrypoint { | ||
} |
13 changes: 13 additions & 0 deletions
13
event-base-neo/src/main/java/band/kessoku/lib/event/util/NeoEventUtils.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 band.kessoku.lib.event.util; | ||
|
||
import net.neoforged.bus.api.Event; | ||
import net.neoforged.bus.api.EventPriority; | ||
import net.neoforged.bus.api.IEventBus; | ||
|
||
import java.util.function.Consumer; | ||
|
||
public class NeoEventUtils { | ||
public static <T extends Event> void registerEvent(IEventBus eventBus, Class<T> eventClass, Consumer<T> consumer) { | ||
eventBus.addListener(EventPriority.HIGHEST, eventClass, consumer); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
group = "band.kessoku.lib.event" | ||
version = libs.versions.mod.get() + "+common." + libs.versions.minecraft.get() | ||
|
||
base { | ||
archivesName = rootProject.name + "-lifecycle-events" | ||
} | ||
|
||
architectury { | ||
common(["fabric", "neoforge"]) | ||
} | ||
|
||
dependencies { | ||
modImplementation libs.fabric.loader | ||
implementation(project(":base-common")) | ||
implementation(project(":event-base-common")) | ||
} |
5 changes: 5 additions & 0 deletions
5
...events-common/src/main/java/band/kessoku/lib/events/lifecycle/KessokuLifecycleEvents.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,5 @@ | ||
package band.kessoku.lib.events.lifecycle; | ||
|
||
public class KessokuLifecycleEvents { | ||
public static final String MOD_ID = "kessoku_lifecycle_events"; | ||
} |
Oops, something went wrong.