mirror of
https://github.com/FabricMC/fabric.git
synced 2025-09-06 19:36:26 +00:00
Update command registration API to reflect 1.19 vanilla changes (#2227)
* Update command registration API to reflect vanilla changes * Allow module versions in impl+mixin packages * Use v2 module, keeping v1 for server commands at least * update, address review Co-authored-by: modmuss50 <modmuss50@gmail.com>
This commit is contained in:
@@ -6,7 +6,7 @@ moduleDependencies(project, [
|
||||
])
|
||||
|
||||
dependencies {
|
||||
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'namedElements')
|
||||
testmodImplementation project(path: ':fabric-command-api-v2', configuration: 'namedElements')
|
||||
testmodImplementation project(path: ':fabric-networking-api-v1', configuration: 'namedElements')
|
||||
testmodImplementation project(path: ':fabric-registry-sync-v0', configuration: 'namedElements')
|
||||
testmodImplementation project(path: ':fabric-rendering-v1', configuration: 'namedElements')
|
||||
|
@@ -40,7 +40,7 @@ import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
||||
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
|
||||
import net.fabricmc.fabric.api.entity.event.v1.EntityElytraEvents;
|
||||
import net.fabricmc.fabric.api.entity.event.v1.EntitySleepEvents;
|
||||
import net.fabricmc.fabric.api.entity.event.v1.ServerEntityCombatEvents;
|
||||
@@ -169,7 +169,7 @@ public final class EntityEventTests implements ModInitializer {
|
||||
return wakeUpPos;
|
||||
});
|
||||
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> {
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> {
|
||||
dispatcher.register(CommandManager.literal("addsleeptestwools").executes(context -> {
|
||||
addSleepWools(context.getSource().getPlayer());
|
||||
return 0;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"depends": {
|
||||
"fabric-entity-events-v1": "*",
|
||||
"fabric-command-api-v1": "*",
|
||||
"fabric-command-api-v2": "*",
|
||||
"fabric-registry-sync-v0": "*"
|
||||
},
|
||||
"entrypoints": {
|
||||
|
Reference in New Issue
Block a user