From f69f054cc1aeed7537b58908c7cfe28960c1961c Mon Sep 17 00:00:00 2001 From: MehVahdJukaar Date: Wed, 31 Jul 2024 16:28:12 +0200 Subject: [PATCH] done? --- build.properties | 2 +- .../client/event/play/ZFirstClientTick.java | 2 +- .../zeta/client/event/play/ZScreenshot.java | 2 +- .../zeta/event/bus/ForgeZetaEventBus.java | 7 +- ...ntBus.java => StandaloneZetaEventBus.java} | 5 +- .../zeta/util/handler/RecipeCrawlHandler.java | 5 - .../violetmoon/zetaimplforge/ForgeZeta.java | 23 ++- .../zetaimplforge/client/ForgeZetaClient.java | 154 +++++------------- .../zetaimplforge/event/NotAForgeWrapper.java | 9 - .../event/load/ForgeZFirstClientTick.java | 8 + .../event/play/ForgeZScreenshot.java | 7 + .../zetaimplforge/mod/ZetaModClientProxy.java | 6 +- .../zetaimplforge/mod/ZetaModForge.java | 2 +- 13 files changed, 85 insertions(+), 147 deletions(-) rename src/main/java/org/violetmoon/zeta/event/bus/{FabricZetaEventBus.java => StandaloneZetaEventBus.java} (96%) delete mode 100644 src/main/java/org/violetmoon/zetaimplforge/event/NotAForgeWrapper.java create mode 100644 src/main/java/org/violetmoon/zetaimplforge/event/load/ForgeZFirstClientTick.java create mode 100644 src/main/java/org/violetmoon/zetaimplforge/event/play/ForgeZScreenshot.java diff --git a/build.properties b/build.properties index 3375784..e0a2228 100644 --- a/build.properties +++ b/build.properties @@ -5,5 +5,5 @@ mod_name=Zeta mc_version=1.20.1 mapping_channel=official mod_id=zeta -build_number=20 +build_number=20-event dir_output=../Build Output/Zeta/ diff --git a/src/main/java/org/violetmoon/zeta/client/event/play/ZFirstClientTick.java b/src/main/java/org/violetmoon/zeta/client/event/play/ZFirstClientTick.java index e0c09a7..5b67350 100644 --- a/src/main/java/org/violetmoon/zeta/client/event/play/ZFirstClientTick.java +++ b/src/main/java/org/violetmoon/zeta/client/event/play/ZFirstClientTick.java @@ -2,4 +2,4 @@ import org.violetmoon.zeta.event.bus.IZetaLoadEvent; -public class ZFirstClientTick implements IZetaLoadEvent { } +public interface ZFirstClientTick extends IZetaLoadEvent { } diff --git a/src/main/java/org/violetmoon/zeta/client/event/play/ZScreenshot.java b/src/main/java/org/violetmoon/zeta/client/event/play/ZScreenshot.java index 8492d4e..22e6bd7 100644 --- a/src/main/java/org/violetmoon/zeta/client/event/play/ZScreenshot.java +++ b/src/main/java/org/violetmoon/zeta/client/event/play/ZScreenshot.java @@ -2,4 +2,4 @@ import org.violetmoon.zeta.event.bus.IZetaPlayEvent; -public class ZScreenshot implements IZetaPlayEvent { } +public interface ZScreenshot extends IZetaPlayEvent { } diff --git a/src/main/java/org/violetmoon/zeta/event/bus/ForgeZetaEventBus.java b/src/main/java/org/violetmoon/zeta/event/bus/ForgeZetaEventBus.java index 487639d..8bbfced 100644 --- a/src/main/java/org/violetmoon/zeta/event/bus/ForgeZetaEventBus.java +++ b/src/main/java/org/violetmoon/zeta/event/bus/ForgeZetaEventBus.java @@ -9,9 +9,6 @@ import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.violetmoon.zeta.event.load.ZModulesReady; -import org.violetmoon.zetaimplforge.event.NotAForgeWrapper; -import org.violetmoon.zetaimplforge.event.load.ForgeZConfigChange; import java.lang.annotation.Annotation; import java.lang.invoke.MethodHandle; @@ -180,7 +177,7 @@ public void registerSubClassWithGeneric(Class b public void registerSubClass(Class baseZetaEventClass, Class forgeZetaEventClass, @Nullable Function constructor) { - Object old1 = null; + Object old1; Object old2 = null; boolean isNoWrapper = false; if (constructor == null) { @@ -193,7 +190,7 @@ public void registerSubClass(Class baseZetaEven else constructor = findForgeWrapper(forgeZetaEventClass); } if (constructor == null) { - throw new RuntimeException("No forge-Event-wrapping constructor found for Zeta event class " + forgeZetaEventClass); + throw new RuntimeException("No Forge-Event-wrapping constructor found for Zeta event class " + forgeZetaEventClass); } else { old1 = forgeToZetaMap.put(baseZetaEventClass, constructor); } diff --git a/src/main/java/org/violetmoon/zeta/event/bus/FabricZetaEventBus.java b/src/main/java/org/violetmoon/zeta/event/bus/StandaloneZetaEventBus.java similarity index 96% rename from src/main/java/org/violetmoon/zeta/event/bus/FabricZetaEventBus.java rename to src/main/java/org/violetmoon/zeta/event/bus/StandaloneZetaEventBus.java index 47c4f0c..e0d9966 100644 --- a/src/main/java/org/violetmoon/zeta/event/bus/FabricZetaEventBus.java +++ b/src/main/java/org/violetmoon/zeta/event/bus/StandaloneZetaEventBus.java @@ -12,7 +12,6 @@ import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.violetmoon.zeta.Zeta; /** * A polymorphic event bus. Events can be fired under one of their supertypes, allowing a sort of API/impl split of events. @@ -22,7 +21,7 @@ * - registering an anonymous `Consumer` (like Forge's "addListener" method) * Supported Java reflection APIs don't expose this information. Forge can only get at it with a library internally using sun.misc.Unsafe. */ -public class FabricZetaEventBus extends ZetaEventBus { +public class StandaloneZetaEventBus extends ZetaEventBus { private final Map, Listeners> listenerMap = new HashMap<>(); @@ -31,7 +30,7 @@ public class FabricZetaEventBus extends ZetaEventBus { * @param eventRoot The superinterface of all events fired on this bus. * @param logSpam */ - public FabricZetaEventBus(Class subscriberAnnotation, Class eventRoot, @Nullable Logger logSpam) { + public StandaloneZetaEventBus(Class subscriberAnnotation, Class eventRoot, @Nullable Logger logSpam) { super(subscriberAnnotation, eventRoot, logSpam); } diff --git a/src/main/java/org/violetmoon/zeta/util/handler/RecipeCrawlHandler.java b/src/main/java/org/violetmoon/zeta/util/handler/RecipeCrawlHandler.java index 860bb9c..eb41002 100644 --- a/src/main/java/org/violetmoon/zeta/util/handler/RecipeCrawlHandler.java +++ b/src/main/java/org/violetmoon/zeta/util/handler/RecipeCrawlHandler.java @@ -129,11 +129,6 @@ else if (recipe instanceof AbstractCookingRecipe acr) } } - @PlayEvent - public static void a (ZRenderGuiOverlay.ArmorLevel.Pre aa){ - int aaa = 1; - } - @PlayEvent public static void onTick(ZServerTick.Start tick) { synchronized (mutex) { diff --git a/src/main/java/org/violetmoon/zetaimplforge/ForgeZeta.java b/src/main/java/org/violetmoon/zetaimplforge/ForgeZeta.java index 0d23211..7ba7007 100644 --- a/src/main/java/org/violetmoon/zetaimplforge/ForgeZeta.java +++ b/src/main/java/org/violetmoon/zetaimplforge/ForgeZeta.java @@ -18,7 +18,6 @@ import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.ModList; -import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.loading.FMLEnvironment; import net.minecraftforge.registries.RegisterEvent; @@ -27,11 +26,8 @@ import org.violetmoon.zeta.Zeta; import org.violetmoon.zeta.block.ext.BlockExtensionFactory; import org.violetmoon.zeta.capability.ZetaCapabilityManager; -import org.violetmoon.zeta.client.ClientRegistryExtension; -import org.violetmoon.zeta.client.ZetaClient; import org.violetmoon.zeta.client.event.load.*; import org.violetmoon.zeta.client.event.play.*; -import org.violetmoon.zeta.config.ConfigManager; import org.violetmoon.zeta.config.IZetaConfigInternals; import org.violetmoon.zeta.config.SectionDefinition; import org.violetmoon.zeta.event.bus.*; @@ -49,7 +45,6 @@ import org.violetmoon.zetaimplforge.api.ForgeZGatherAdvancementModifiers; import org.violetmoon.zetaimplforge.block.IForgeBlockBlockExtensions; import org.violetmoon.zetaimplforge.capability.ForgeCapabilityManager; -import org.violetmoon.zetaimplforge.client.ForgeZetaClient; import org.violetmoon.zetaimplforge.client.event.load.*; import org.violetmoon.zetaimplforge.client.event.play.*; import org.violetmoon.zetaimplforge.config.ConfigEventDispatcher; @@ -80,8 +75,7 @@ public ForgeZeta(String modid, Logger log) { @Override protected ZetaEventBus createLoadBus() { - if (false) return new FabricZetaEventBus<>(LoadEvent.class, - IZetaLoadEvent.class, log); + //return new StandaloneZetaEventBus<>(LoadEvent.class, IZetaLoadEvent.class, log); var bus = new ForgeZetaEventBus<>(LoadEvent.class, IZetaLoadEvent.class, log, FMLJavaModLoadingContext.get().getModEventBus(), Event.class); @@ -106,6 +100,7 @@ protected ZetaEventBus createLoadBus() { bus.registerSubClass(ZModel.ModifyBakingResult.class, ForgeZModel.ModifyBakingResult.class); bus.registerSubClass(ZRegisterLayerDefinitions.class, ForgeZRegisterLayerDefinitions.class); bus.registerSubClass(ZTooltipComponents.class, ForgeZTooltipComponents.class); + bus.registerSubClass(ZFirstClientTick.class, ForgeZFirstClientTick.class); bus.registerSubClass(ZAddBlockColorHandlers.class, ForgeZAddBlockColorHandlers.class, (Function) inner -> @@ -196,6 +191,20 @@ protected ZetaEventBus createLoadBus() { bus.registerSubClass(ZScreen.Render.class, ForgeZScreen.Render.class); bus.registerSubClass(ZRenderGuiOverlay.ArmorLevel.Pre.class, ForgeZRenderGuiOverlay.ArmorLevel.Pre.class); bus.registerSubClass(ZRenderGuiOverlay.ArmorLevel.Post.class, ForgeZRenderGuiOverlay.ArmorLevel.Post.class); + bus.registerSubClass(ZRenderGuiOverlay.Crosshair.Pre.class, ForgeZRenderGuiOverlay.Crosshair.Post.class); + bus.registerSubClass(ZRenderGuiOverlay.Crosshair.Post.class, ForgeZRenderGuiOverlay.Crosshair.Pre.class); + bus.registerSubClass(ZRenderGuiOverlay.DebugText.Pre.class, ForgeZRenderGuiOverlay.DebugText.Pre.class); + bus.registerSubClass(ZRenderGuiOverlay.DebugText.Post.class, ForgeZRenderGuiOverlay.DebugText.Post.class); + bus.registerSubClass(ZRenderGuiOverlay.Hotbar.Pre.class, ForgeZRenderGuiOverlay.Hotbar.Pre.class); + bus.registerSubClass(ZRenderGuiOverlay.Hotbar.Post.class, ForgeZRenderGuiOverlay.Hotbar.Post.class); + bus.registerSubClass(ZRenderGuiOverlay.PlayerHealth.Pre.class, ForgeZRenderGuiOverlay.PlayerHealth.Pre.class); + bus.registerSubClass(ZRenderGuiOverlay.PlayerHealth.Post.class, ForgeZRenderGuiOverlay.PlayerHealth.Post.class); + bus.registerSubClass(ZRenderGuiOverlay.PotionIcons.Pre.class, ForgeZRenderGuiOverlay.PotionIcons.Pre.class); + bus.registerSubClass(ZRenderGuiOverlay.PotionIcons.Post.class, ForgeZRenderGuiOverlay.PotionIcons.Post.class); + bus.registerSubClass(ZRenderGuiOverlay.ChatPanel.Pre.class, ForgeZRenderGuiOverlay.ChatPanel.Pre.class); + bus.registerSubClass(ZRenderGuiOverlay.ChatPanel.Post.class, ForgeZRenderGuiOverlay.ChatPanel.Post.class); + bus.registerSubClass(ZScreenshot.class, ForgeZScreenshot.class); + //this is ugly. generic events here Zeta zeta = this; diff --git a/src/main/java/org/violetmoon/zetaimplforge/client/ForgeZetaClient.java b/src/main/java/org/violetmoon/zetaimplforge/client/ForgeZetaClient.java index 444206e..a136840 100644 --- a/src/main/java/org/violetmoon/zetaimplforge/client/ForgeZetaClient.java +++ b/src/main/java/org/violetmoon/zetaimplforge/client/ForgeZetaClient.java @@ -1,60 +1,5 @@ package org.violetmoon.zetaimplforge.client; -import net.minecraftforge.client.gui.overlay.NamedGuiOverlay; -import org.jetbrains.annotations.Nullable; -import org.violetmoon.zeta.Zeta; -import org.violetmoon.zeta.client.ClientRegistryExtension; -import org.violetmoon.zeta.client.HumanoidArmorModelGetter; -import org.violetmoon.zeta.client.ZetaClient; -import org.violetmoon.zeta.client.event.load.ZAddBlockColorHandlers; -import org.violetmoon.zeta.client.event.load.ZAddItemColorHandlers; -import org.violetmoon.zeta.client.event.load.ZAddModelLayers; -import org.violetmoon.zeta.client.event.load.ZAddModels; -import org.violetmoon.zeta.client.event.load.ZClientSetup; -import org.violetmoon.zeta.client.event.load.ZKeyMapping; -import org.violetmoon.zeta.client.event.load.ZModel; -import org.violetmoon.zeta.client.event.load.ZRegisterLayerDefinitions; -import org.violetmoon.zeta.client.event.load.ZRegisterReloadListeners; -import org.violetmoon.zeta.client.event.load.ZTooltipComponents; -import org.violetmoon.zeta.client.event.play.ZClientTick; -import org.violetmoon.zeta.client.event.play.ZFirstClientTick; -import org.violetmoon.zeta.client.event.play.ZGatherTooltipComponents; -import org.violetmoon.zeta.client.event.play.ZHighlightBlock; -import org.violetmoon.zeta.client.event.play.ZInput; -import org.violetmoon.zeta.client.event.play.ZInputUpdate; -import org.violetmoon.zeta.client.event.play.ZRenderContainerScreen; -import org.violetmoon.zeta.client.event.play.ZRenderGuiOverlay; -import org.violetmoon.zeta.client.event.play.ZRenderLiving; -import org.violetmoon.zeta.client.event.play.ZRenderPlayer; -import org.violetmoon.zeta.client.event.play.ZRenderTick; -import org.violetmoon.zeta.client.event.play.ZRenderTooltip; -import org.violetmoon.zeta.client.event.play.ZScreen; -import org.violetmoon.zeta.client.event.play.ZScreenshot; -import org.violetmoon.zeta.util.zetalist.ZetaClientList; -import org.violetmoon.zetaimplforge.client.event.load.ForgeZAddBlockColorHandlers; -import org.violetmoon.zetaimplforge.client.event.load.ForgeZAddItemColorHandlers; -import org.violetmoon.zetaimplforge.client.event.load.ForgeZAddModelLayers; -import org.violetmoon.zetaimplforge.client.event.load.ForgeZAddModels; -import org.violetmoon.zetaimplforge.client.event.load.ForgeZClientSetup; -import org.violetmoon.zetaimplforge.client.event.load.ForgeZKeyMapping; -import org.violetmoon.zetaimplforge.client.event.load.ForgeZModel; -import org.violetmoon.zetaimplforge.client.event.load.ForgeZRegisterLayerDefinitions; -import org.violetmoon.zetaimplforge.client.event.load.ForgeZTooltipComponents; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZClientTick; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZGatherTooltipComponents; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZHighlightBlock; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZInput; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZInputUpdate; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZRenderContainerScreen; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZRenderGuiOverlay; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZRenderLiving; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZRenderPlayer; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZRenderTick; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZRenderTooltip; -import org.violetmoon.zetaimplforge.client.event.play.ForgeZScreen; -import org.violetmoon.zetaimplforge.mixin.mixins.client.AccessorBlockColors; -import org.violetmoon.zetaimplforge.mixin.mixins.client.AccessorItemColors; - import net.minecraft.client.Minecraft; import net.minecraft.client.color.block.BlockColor; import net.minecraft.client.color.block.BlockColors; @@ -66,75 +11,58 @@ import net.minecraft.world.item.Item; import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.block.Block; -import net.minecraftforge.client.event.ContainerScreenEvent; -import net.minecraftforge.client.event.EntityRenderersEvent; -import net.minecraftforge.client.event.InputEvent; -import net.minecraftforge.client.event.ModelEvent; -import net.minecraftforge.client.event.MovementInputUpdateEvent; -import net.minecraftforge.client.event.RegisterClientReloadListenersEvent; -import net.minecraftforge.client.event.RegisterClientTooltipComponentFactoriesEvent; -import net.minecraftforge.client.event.RegisterColorHandlersEvent; -import net.minecraftforge.client.event.RegisterKeyMappingsEvent; -import net.minecraftforge.client.event.RenderGuiOverlayEvent; -import net.minecraftforge.client.event.RenderHighlightEvent; -import net.minecraftforge.client.event.RenderLivingEvent; -import net.minecraftforge.client.event.RenderPlayerEvent; -import net.minecraftforge.client.event.RenderTooltipEvent; -import net.minecraftforge.client.event.ScreenEvent; -import net.minecraftforge.client.event.ScreenshotEvent; -import net.minecraftforge.client.gui.overlay.VanillaGuiOverlay; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.TickEvent; -import net.minecraftforge.eventbus.api.EventPriority; -import net.minecraftforge.eventbus.api.IEventBus; -import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.util.thread.EffectiveSide; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.server.ServerLifecycleHooks; +import org.jetbrains.annotations.Nullable; +import org.violetmoon.zeta.Zeta; +import org.violetmoon.zeta.client.ClientRegistryExtension; +import org.violetmoon.zeta.client.HumanoidArmorModelGetter; +import org.violetmoon.zeta.client.ZetaClient; +import org.violetmoon.zetaimplforge.mixin.mixins.client.AccessorBlockColors; +import org.violetmoon.zetaimplforge.mixin.mixins.client.AccessorItemColors; public class ForgeZetaClient extends ZetaClient { - public ForgeZetaClient(Zeta z) { - super(z); - } - - @Override - public @Nullable BlockColor getBlockColor(BlockColors bcs, Block block) { - return ForgeRegistries.BLOCKS.getDelegate(block) - .map(ref -> ((AccessorBlockColors) bcs).zeta$getBlockColors().get(ref)) - .orElse(null); - } + public ForgeZetaClient(Zeta z) { + super(z); + } - @Override - public @Nullable ItemColor getItemColor(ItemColors ics, ItemLike itemlike) { - return ForgeRegistries.ITEMS.getDelegate(itemlike.asItem()) - .map(ref -> ((AccessorItemColors) ics).zeta$getItemColors().get(ref)) - .orElse(null); - } + @Override + public @Nullable BlockColor getBlockColor(BlockColors bcs, Block block) { + return ForgeRegistries.BLOCKS.getDelegate(block) + .map(ref -> ((AccessorBlockColors) bcs).zeta$getBlockColors().get(ref)) + .orElse(null); + } - @Override - public ClientRegistryExtension createClientRegistryExtension() { - return new ForgeClientRegistryExtension(zeta); - } + @Override + public @Nullable ItemColor getItemColor(ItemColors ics, ItemLike itemlike) { + return ForgeRegistries.ITEMS.getDelegate(itemlike.asItem()) + .map(ref -> ((AccessorItemColors) ics).zeta$getItemColors().get(ref)) + .orElse(null); + } - @Override - public void setBlockEntityWithoutLevelRenderer(Item item, BlockEntityWithoutLevelRenderer bewlr) { - ((IZetaForgeItemStuff) item).zeta$setBlockEntityWithoutLevelRenderer(bewlr); - } + @Override + public ClientRegistryExtension createClientRegistryExtension() { + return new ForgeClientRegistryExtension(zeta); + } - @Override - public void setHumanoidArmorModel(Item item, HumanoidArmorModelGetter modelGetter) { - ((IZetaForgeItemStuff) item).zeta$setHumanoidArmorModel(modelGetter); - } + @Override + public void setBlockEntityWithoutLevelRenderer(Item item, BlockEntityWithoutLevelRenderer bewlr) { + ((IZetaForgeItemStuff) item).zeta$setBlockEntityWithoutLevelRenderer(bewlr); + } - @Override - public RegistryAccess hackilyGetCurrentClientLevelRegistryAccess() { - if(EffectiveSide.get().isServer()) - return ServerLifecycleHooks.getCurrentServer().registryAccess(); + @Override + public void setHumanoidArmorModel(Item item, HumanoidArmorModelGetter modelGetter) { + ((IZetaForgeItemStuff) item).zeta$setHumanoidArmorModel(modelGetter); + } - ClientPacketListener conn = Minecraft.getInstance().getConnection(); - return conn == null ? null : conn.registryAccess(); - } + @Override + public RegistryAccess hackilyGetCurrentClientLevelRegistryAccess() { + if (EffectiveSide.get().isServer()) + return ServerLifecycleHooks.getCurrentServer().registryAccess(); + ClientPacketListener conn = Minecraft.getInstance().getConnection(); + return conn == null ? null : conn.registryAccess(); + } } diff --git a/src/main/java/org/violetmoon/zetaimplforge/event/NotAForgeWrapper.java b/src/main/java/org/violetmoon/zetaimplforge/event/NotAForgeWrapper.java deleted file mode 100644 index 249ca03..0000000 --- a/src/main/java/org/violetmoon/zetaimplforge/event/NotAForgeWrapper.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.violetmoon.zetaimplforge.event; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -// Hideous marker interface used to denote Zeta specific events that are NOT supposed to be remapped to forge events -@Retention(RetentionPolicy.RUNTIME) -public @interface NotAForgeWrapper { -} diff --git a/src/main/java/org/violetmoon/zetaimplforge/event/load/ForgeZFirstClientTick.java b/src/main/java/org/violetmoon/zetaimplforge/event/load/ForgeZFirstClientTick.java new file mode 100644 index 0000000..d881ed7 --- /dev/null +++ b/src/main/java/org/violetmoon/zetaimplforge/event/load/ForgeZFirstClientTick.java @@ -0,0 +1,8 @@ +package org.violetmoon.zetaimplforge.event.load; + +import net.minecraftforge.eventbus.api.Event; +import org.violetmoon.zeta.client.event.play.ZFirstClientTick; + +public class ForgeZFirstClientTick extends Event implements ZFirstClientTick { + +} diff --git a/src/main/java/org/violetmoon/zetaimplforge/event/play/ForgeZScreenshot.java b/src/main/java/org/violetmoon/zetaimplforge/event/play/ForgeZScreenshot.java new file mode 100644 index 0000000..65db1bc --- /dev/null +++ b/src/main/java/org/violetmoon/zetaimplforge/event/play/ForgeZScreenshot.java @@ -0,0 +1,7 @@ +package org.violetmoon.zetaimplforge.event.play; + +import net.minecraftforge.eventbus.api.Event; +import org.violetmoon.zeta.client.event.play.ZScreenshot; + +public class ForgeZScreenshot extends Event implements ZScreenshot { +} diff --git a/src/main/java/org/violetmoon/zetaimplforge/mod/ZetaModClientProxy.java b/src/main/java/org/violetmoon/zetaimplforge/mod/ZetaModClientProxy.java index 77399d5..0a8b3c8 100644 --- a/src/main/java/org/violetmoon/zetaimplforge/mod/ZetaModClientProxy.java +++ b/src/main/java/org/violetmoon/zetaimplforge/mod/ZetaModClientProxy.java @@ -5,14 +5,18 @@ import net.minecraftforge.client.gui.overlay.VanillaGuiOverlay; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.TickEvent; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.violetmoon.zeta.Zeta; import org.violetmoon.zeta.client.TopLayerTooltipHandler; import org.violetmoon.zeta.client.event.play.ZFirstClientTick; import org.violetmoon.zeta.client.event.play.ZRenderGuiOverlay; import org.violetmoon.zeta.util.handler.RequiredModTooltipHandler; +import org.violetmoon.zeta.util.handler.ToolInteractionHandler; import org.violetmoon.zeta.util.zetalist.ZetaList; import org.violetmoon.zetaimplforge.client.ForgeZetaClient; import org.violetmoon.zetaimplforge.client.event.play.ForgeZRenderGuiOverlay; +import org.violetmoon.zetaimplforge.event.load.ForgeZFirstClientTick; +import org.violetmoon.zetaimplforge.world.ZetaBiomeModifier; public class ZetaModClientProxy extends ZetaModCommonProxy { @@ -36,7 +40,7 @@ public ZetaModClientProxy(Zeta zeta) { boolean clientTicked = false; public void clientTick(TickEvent.ClientTickEvent e) { if(!clientTicked) { - ZetaList.INSTANCE.fireLoadEvent(new ZFirstClientTick()); + ZetaList.INSTANCE.fireLoadEvent(new ForgeZFirstClientTick()); clientTicked = true; } } diff --git a/src/main/java/org/violetmoon/zetaimplforge/mod/ZetaModForge.java b/src/main/java/org/violetmoon/zetaimplforge/mod/ZetaModForge.java index bda1cd2..64d1c7c 100644 --- a/src/main/java/org/violetmoon/zetaimplforge/mod/ZetaModForge.java +++ b/src/main/java/org/violetmoon/zetaimplforge/mod/ZetaModForge.java @@ -13,11 +13,11 @@ public class ZetaModForge { public ZetaModForge() { ForgeZeta zeta = new ForgeZeta(Zeta.ZETA_ID, LogManager.getLogger(Zeta.ZETA_ID + "-internal")); + ZetaMod.start(zeta); // creates 2 dist specific objects that will handle zeta specific & loader specific events needed for zeta to work DistExecutor.runForDist(() -> () -> new ZetaModClientProxy(zeta), () -> () -> new ZetaModCommonProxy(zeta)); - ZetaMod.start(zeta); }