Skip to content

Commit

Permalink
Use the correct event to register the AE2 commands, fixing use after …
Browse files Browse the repository at this point in the history
…reload.
  • Loading branch information
shartte committed Dec 19, 2024
1 parent 18d5e7c commit b6c4fe3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/java/appeng/core/AppEngBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@
import java.util.Collection;
import java.util.Collections;

import com.mojang.brigadier.CommandDispatcher;

import org.jetbrains.annotations.Nullable;

import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
Expand All @@ -39,10 +36,10 @@
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegisterCommandsEvent;
import net.minecraftforge.event.RegisterGameTestsEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.server.ServerAboutToStartEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.event.server.ServerStoppedEvent;
import net.minecraftforge.event.server.ServerStoppingEvent;
import net.minecraftforge.eventbus.api.Event;
Expand Down Expand Up @@ -210,9 +207,8 @@ public void registerKeyTypes() {
AEKeyTypes.register(AEKeyType.fluids());
}

public void registerCommands(ServerStartingEvent evt) {
CommandDispatcher<CommandSourceStack> dispatcher = evt.getServer().getCommands().getDispatcher();
new AECommand().register(dispatcher);
public void registerCommands(RegisterCommandsEvent evt) {
new AECommand().register(evt.getDispatcher());
}

public void registerSounds(IForgeRegistry<SoundEvent> registry) {
Expand Down

0 comments on commit b6c4fe3

Please sign in to comment.