Updated everything
This commit is contained in:
@@ -75,7 +75,7 @@ public class ForgeClientProxy
|
||||
@SubscribeEvent
|
||||
public void worldUnloadEvent(WorldEvent.Unload event)
|
||||
{
|
||||
eventApi.worldUnloadEvent();
|
||||
eventApi.worldUnloadEvent(WorldWrapper.getWorldWrapper(event.getWorld()));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
package com.seibel.lod.forge;
|
||||
|
||||
import com.seibel.lod.common.Config;
|
||||
import com.seibel.lod.common.LodCommonMain;
|
||||
import com.seibel.lod.common.forge.LodForgeMethodCaller;
|
||||
import com.seibel.lod.common.wrappers.config.ConfigGui;
|
||||
@@ -33,17 +32,12 @@ import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.client.model.data.ModelDataMap;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.ExtensionPoint;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
import net.minecraftforge.fml.client.ConfigGuiHandler;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.config.ModConfig;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.loading.FMLEnvironment;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
|
||||
import java.util.List;
|
||||
@@ -53,7 +47,7 @@ import java.util.Random;
|
||||
* Initialize and setup the Mod. <br>
|
||||
* If you are looking for the real start of the mod
|
||||
* check out the ClientProxy.
|
||||
*
|
||||
*
|
||||
* @author James Seibel
|
||||
* @version 11-21-2021
|
||||
*/
|
||||
@@ -61,7 +55,7 @@ import java.util.Random;
|
||||
public class ForgeMain implements LodForgeMethodCaller
|
||||
{
|
||||
public static ForgeClientProxy forgeClientProxy;
|
||||
|
||||
|
||||
private void init(final FMLCommonSetupEvent event)
|
||||
{
|
||||
// make sure the dependencies are set up before the mod needs them
|
||||
@@ -69,33 +63,25 @@ public class ForgeMain implements LodForgeMethodCaller
|
||||
LodCommonMain.startup(this, !FMLLoader.getDist().isClient());
|
||||
ForgeDependencySetup.createInitialBindings();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public ForgeMain()
|
||||
{
|
||||
// Register the methods
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init);
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientStart);
|
||||
|
||||
|
||||
// Register ourselves for server and other game events we are interested in
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
private void onClientStart(final FMLClientSetupEvent event)
|
||||
{
|
||||
ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY,
|
||||
() -> (client, parent) -> Config.getScreen(parent, ""));
|
||||
() -> (client, parent) -> ConfigGui.getScreen(parent, ""));
|
||||
forgeClientProxy = new ForgeClientProxy();
|
||||
MinecraftForge.EVENT_BUS.register(forgeClientProxy);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerStarting(FMLServerStartingEvent event)
|
||||
{
|
||||
// this is called when the server starts
|
||||
}
|
||||
|
||||
private ModelDataMap dataMap = new ModelDataMap.Builder().build();
|
||||
@Override
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.seibel.lod.forge.mixins;
|
||||
|
||||
import com.seibel.lod.common.Config;
|
||||
import com.seibel.lod.common.wrappers.config.ConfigGui;
|
||||
import com.seibel.lod.common.wrappers.config.TexturedButtonWidget;
|
||||
import com.seibel.lod.core.ModInfo;
|
||||
import com.seibel.lod.core.util.SingletonHandler;
|
||||
import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
|
||||
import net.minecraft.client.gui.screens.OptionsScreen;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -32,7 +33,7 @@ public class MixinOptionsScreen extends Screen {
|
||||
|
||||
@Inject(at = @At("HEAD"),method = "init")
|
||||
private void lodconfig$init(CallbackInfo ci) {
|
||||
if (Config.ShowButton)
|
||||
if (SingletonHandler.get(ILodConfigWrapperSingleton.class).client().getOptionsButton())
|
||||
this.addButton(new TexturedButtonWidget(
|
||||
// Where the button is on the screen
|
||||
this.width / 2 - 180, this.height / 6 - 12,
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
package com.seibel.lod.forge.mixins;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Matrix4f;
|
||||
import com.seibel.lod.common.Config;
|
||||
import com.seibel.lod.common.clouds.CloudTexture;
|
||||
import com.seibel.lod.common.clouds.NoiseCloudHandler;
|
||||
import com.seibel.lod.common.wrappers.McObjectConverter;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import org.lwjgl.opengl.GL15;
|
||||
@@ -33,6 +37,23 @@ import com.seibel.lod.core.objects.math.Mat4f;
|
||||
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.*;
|
||||
import net.minecraft.client.CloudStatus;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.renderer.*;
|
||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.spongepowered.asm.mixin.*;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* This class is used to mix in my rendering code
|
||||
* before Minecraft starts rendering blocks.
|
||||
@@ -40,14 +61,19 @@ import net.minecraft.client.renderer.RenderType;
|
||||
* render last event, the LODs would render on top
|
||||
* of the normal terrain.
|
||||
*
|
||||
* This is also the mixin for rendering the clouds
|
||||
*
|
||||
* @author coolGi2007
|
||||
* @author James Seibel
|
||||
* @version 12-29-2021
|
||||
* @version 12-31-2021
|
||||
*/
|
||||
@Mixin(LevelRenderer.class)
|
||||
public class MixinWorldRenderer
|
||||
{
|
||||
// TODO: Fix clouds
|
||||
private static float previousPartialTicks = 0;
|
||||
|
||||
|
||||
@Inject(at = @At("RETURN"), method = "renderSky(Lcom/mojang/blaze3d/vertex/PoseStack;F)V")
|
||||
private void renderSky(PoseStack matrixStackIn, float partialTicks, CallbackInfo callback)
|
||||
{
|
||||
@@ -56,6 +82,7 @@ public class MixinWorldRenderer
|
||||
previousPartialTicks = partialTicks;
|
||||
}
|
||||
|
||||
// HEAD or RETURN
|
||||
@Inject(at = @At("HEAD"), method = "renderChunkLayer(Lnet/minecraft/client/renderer/RenderType;Lcom/mojang/blaze3d/vertex/PoseStack;DDD)V")
|
||||
private void renderChunkLayer(RenderType renderType, PoseStack matrixStackIn, double xIn, double yIn, double zIn, CallbackInfo callback)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
],
|
||||
"client": [
|
||||
"MixinOptionsScreen",
|
||||
"MixinWorldRenderer"
|
||||
"MixinWorldRenderer",
|
||||
"MixinFogRenderer"
|
||||
],
|
||||
"server": []
|
||||
}
|
||||
Reference in New Issue
Block a user