mirror of
https://github.com/architectury/architectury-api.git
synced 2026-04-01 21:17:45 -05:00
Command registry events and ReloadListenerRegistry
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package me.shedaniel.architectury.event.events;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import me.shedaniel.architectury.event.Event;
|
||||
import me.shedaniel.architectury.event.EventFactory;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
|
||||
public interface CommandRegistrationEvent {
|
||||
Event<CommandRegistrationEvent> EVENT = EventFactory.createLoop(CommandRegistrationEvent.class);
|
||||
|
||||
void register(CommandDispatcher<CommandSourceStack> var1);
|
||||
}
|
||||
@@ -19,10 +19,14 @@ package me.shedaniel.architectury.event.events;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import me.shedaniel.architectury.event.Event;
|
||||
import me.shedaniel.architectury.event.EventFactory;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public interface GuiEvent {
|
||||
Event<RenderHud> RENDER_HUD = EventFactory.createLoop(RenderHud.class);
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
interface RenderHud {
|
||||
void renderHud(PoseStack matrices, float tickDelta);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package me.shedaniel.architectury.registry;
|
||||
|
||||
import me.shedaniel.architectury.ArchitecturyPopulator;
|
||||
import me.shedaniel.architectury.Populatable;
|
||||
import net.minecraft.server.packs.PackType;
|
||||
import net.minecraft.server.packs.resources.PreparableReloadListener;
|
||||
|
||||
public final class ReloadListenerRegistry {
|
||||
private ReloadListenerRegistry() {}
|
||||
|
||||
@Populatable
|
||||
private static final Impl IMPL = null;
|
||||
|
||||
public static void registerReloadListener(PackType type, PreparableReloadListener listener) {
|
||||
IMPL.registerReloadListener(type, listener);
|
||||
}
|
||||
|
||||
public interface Impl {
|
||||
void registerReloadListener(PackType type, PreparableReloadListener listener);
|
||||
}
|
||||
|
||||
static {
|
||||
ArchitecturyPopulator.populate(ReloadListenerRegistry.class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user