diff --git a/src/main/java/com/zontreck/commands/CommandRegistry.java b/src/main/java/com/zontreck/commands/CommandRegistry.java index 05dfacd..c681839 100644 --- a/src/main/java/com/zontreck/commands/CommandRegistry.java +++ b/src/main/java/com/zontreck/commands/CommandRegistry.java @@ -5,15 +5,20 @@ import com.zontreck.commands.homes.HomeCommand; import com.zontreck.commands.homes.HomesCommand; import com.zontreck.commands.homes.SetHomeCommand; import com.zontreck.commands.items.ShareItemInChatCommand; -import com.zontreck.commands.items.TIABDebug; import com.zontreck.commands.spawn.SetSpawnCommand; import com.zontreck.commands.spawn.SpawnCommand; -import com.zontreck.commands.teleport.*; -import net.minecraftforge.event.RegisterCommandsEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.common.Mod; +import com.zontreck.commands.teleport.TPACommand; +import com.zontreck.commands.teleport.TPAHereCommand; +import com.zontreck.commands.teleport.TPAcceptCommand; +import com.zontreck.commands.teleport.TPCancelCommand; +import com.zontreck.commands.teleport.TPDenyCommand; -@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE) +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; +import net.neoforged.fml.common.EventBusSubscriber.Bus; +import net.neoforged.neoforge.event.RegisterCommandsEvent; + +@EventBusSubscriber(bus = Bus.GAME) public class CommandRegistry { @SubscribeEvent diff --git a/src/main/java/com/zontreck/commands/homes/DelHomeCommand.java b/src/main/java/com/zontreck/commands/homes/DelHomeCommand.java index 5daf5eb..79f880c 100644 --- a/src/main/java/com/zontreck/commands/homes/DelHomeCommand.java +++ b/src/main/java/com/zontreck/commands/homes/DelHomeCommand.java @@ -7,10 +7,11 @@ import com.zontreck.Messages; import com.zontreck.events.CommandExecutionEvent; import com.zontreck.libzontreck.profiles.Profile; import com.zontreck.libzontreck.util.ChatHelpers; + import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.server.level.ServerPlayer; -import net.minecraftforge.common.MinecraftForge; +import net.neoforged.neoforge.common.NeoForge; public class DelHomeCommand { public static void register(CommandDispatcher dispatcher) @@ -34,10 +35,11 @@ public class DelHomeCommand { { var exec = new CommandExecutionEvent(ctx.getPlayer(), "rmhome"); - if(MinecraftForge.EVENT_BUS.post(exec)) + if(NeoForge.EVENT_BUS.post(exec)) { return 0; } + // Request homes // String homeName = ""; // CommandSourceStack ctx = ctx2.getSource(); diff --git a/src/main/java/com/zontreck/events/CommandExecutionEvent.java b/src/main/java/com/zontreck/events/CommandExecutionEvent.java index 8ce4a0d..22f3028 100644 --- a/src/main/java/com/zontreck/events/CommandExecutionEvent.java +++ b/src/main/java/com/zontreck/events/CommandExecutionEvent.java @@ -1,13 +1,11 @@ package com.zontreck.events; -import net.minecraft.world.entity.player.Player; -import net.minecraftforge.eventbus.api.Cancelable; -import net.minecraftforge.eventbus.api.Event; - import java.util.UUID; +import net.minecraft.world.entity.player.Player; +import net.neoforged.bus.api.Event; + -@Cancelable public class CommandExecutionEvent extends Event { public UUID playerID; diff --git a/src/main/java/com/zontreck/events/HomeCreatedEvent.java b/src/main/java/com/zontreck/events/HomeCreatedEvent.java index 38aabc7..6592b33 100644 --- a/src/main/java/com/zontreck/events/HomeCreatedEvent.java +++ b/src/main/java/com/zontreck/events/HomeCreatedEvent.java @@ -2,13 +2,12 @@ package com.zontreck.events; import com.zontreck.homes.Home; -import net.minecraftforge.eventbus.api.Cancelable; -import net.minecraftforge.eventbus.api.Event; + +import net.neoforged.bus.api.Event; /** * This event may be cancelled if the home is in a invalid location, like in the middle of a claim they have no rights to */ -@Cancelable public class HomeCreatedEvent extends Event { public Home home; diff --git a/src/main/java/com/zontreck/events/HomeDeletedEvent.java b/src/main/java/com/zontreck/events/HomeDeletedEvent.java index e91bdfb..707048a 100644 --- a/src/main/java/com/zontreck/events/HomeDeletedEvent.java +++ b/src/main/java/com/zontreck/events/HomeDeletedEvent.java @@ -2,7 +2,8 @@ package com.zontreck.events; import com.zontreck.homes.Home; -import net.minecraftforge.eventbus.api.Event; + +import net.neoforged.bus.api.Event; /** * This event cannot be cancelled. diff --git a/src/main/java/com/zontreck/events/TeleportEvent.java b/src/main/java/com/zontreck/events/TeleportEvent.java index a7ee188..bd3417c 100644 --- a/src/main/java/com/zontreck/events/TeleportEvent.java +++ b/src/main/java/com/zontreck/events/TeleportEvent.java @@ -1,10 +1,9 @@ package com.zontreck.events; import com.zontreck.util.TeleportContainer; -import net.minecraftforge.eventbus.api.Cancelable; -import net.minecraftforge.eventbus.api.Event; -@Cancelable +import net.neoforged.bus.api.Event; + public class TeleportEvent extends Event {