fix fading with sodium
This commit is contained in:
+1
-1
Submodule coreSubProjects updated: 71e6b9b58e...cb3e42fac4
@@ -66,6 +66,13 @@ import java.util.concurrent.AbstractExecutorService;
|
|||||||
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
|
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_21_11
|
||||||
|
#else
|
||||||
|
import net.fabricmc.fabric.api.client.rendering.v1.level.LevelRenderContext;
|
||||||
|
import net.fabricmc.fabric.api.client.rendering.v1.level.LevelRenderEvents;
|
||||||
|
import net.fabricmc.fabric.api.client.rendering.v1.level.LevelTerrainRenderContext;
|
||||||
|
#endif
|
||||||
|
|
||||||
import com.mojang.blaze3d.platform.InputConstants;
|
import com.mojang.blaze3d.platform.InputConstants;
|
||||||
|
|
||||||
import net.minecraft.client.multiplayer.ClientLevel;
|
import net.minecraft.client.multiplayer.ClientLevel;
|
||||||
@@ -91,6 +98,7 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
|
|||||||
private static final MinecraftClientWrapper MC = MinecraftClientWrapper.INSTANCE;
|
private static final MinecraftClientWrapper MC = MinecraftClientWrapper.INSTANCE;
|
||||||
private static final AbstractPluginPacketSender PACKET_SENDER = (AbstractPluginPacketSender) SingletonInjector.INSTANCE.get(IPluginPacketSender.class);
|
private static final AbstractPluginPacketSender PACKET_SENDER = (AbstractPluginPacketSender) SingletonInjector.INSTANCE.get(IPluginPacketSender.class);
|
||||||
|
|
||||||
|
@Deprecated // just use the static reference
|
||||||
private static final ClientApi clientApi = ClientApi.INSTANCE;
|
private static final ClientApi clientApi = ClientApi.INSTANCE;
|
||||||
|
|
||||||
HashSet<Integer> previouslyPressKeyCodes = new HashSet<>();
|
HashSet<Integer> previouslyPressKeyCodes = new HashSet<>();
|
||||||
@@ -108,17 +116,10 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//========================//
|
|
||||||
// register mod accessors //
|
|
||||||
//========================//
|
|
||||||
|
|
||||||
SodiumAccessor sodiumAccessor = (SodiumAccessor) ModAccessorInjector.INSTANCE.get(ISodiumAccessor.class);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//==============//
|
//==============//
|
||||||
// chunk events //
|
// chunk events //
|
||||||
//==============//
|
//==============//
|
||||||
|
//region
|
||||||
|
|
||||||
// ClientChunkLoadEvent
|
// ClientChunkLoadEvent
|
||||||
ClientChunkEvents.CHUNK_LOAD.register((level, chunk) ->
|
ClientChunkEvents.CHUNK_LOAD.register((level, chunk) ->
|
||||||
@@ -214,12 +215,14 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
|
|||||||
return InteractionResult.PASS;
|
return InteractionResult.PASS;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//==============//
|
//==============//
|
||||||
// render event //
|
// render event //
|
||||||
//==============//
|
//==============//
|
||||||
|
//region
|
||||||
|
|
||||||
#if MC_VER < MC_1_21_9
|
#if MC_VER < MC_1_21_9
|
||||||
WorldRenderEvents.AFTER_SETUP.register((renderContext) ->
|
WorldRenderEvents.AFTER_SETUP.register((renderContext) ->
|
||||||
@@ -298,6 +301,27 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
|
|||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MC_VER <= MC_1_21_11
|
||||||
|
#else
|
||||||
|
LevelRenderEvents.AFTER_TRANSLUCENT_TERRAIN.register((LevelRenderContext levelRenderContext) ->
|
||||||
|
{
|
||||||
|
ClientApi.INSTANCE.renderFadeTransparent();
|
||||||
|
});
|
||||||
|
|
||||||
|
LevelRenderEvents.AFTER_OPAQUE_TERRAIN.register((LevelTerrainRenderContext levelTerrainRenderContext) ->
|
||||||
|
{
|
||||||
|
ClientApi.INSTANCE.renderFadeOpaque();
|
||||||
|
});
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//=================//
|
||||||
|
// keyboard events //
|
||||||
|
//=================//
|
||||||
|
//region
|
||||||
|
|
||||||
// Debug keyboard event
|
// Debug keyboard event
|
||||||
// FIXME: Use better hooks so it doesn't trigger key press events in text boxes
|
// FIXME: Use better hooks so it doesn't trigger key press events in text boxes
|
||||||
@@ -309,11 +333,14 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//==================//
|
//==================//
|
||||||
// networking event //
|
// networking event //
|
||||||
//==================//
|
//==================//
|
||||||
|
//region
|
||||||
|
|
||||||
#if MC_VER < MC_1_20_6
|
#if MC_VER < MC_1_20_6
|
||||||
ClientPlayNetworking.registerGlobalReceiver(AbstractPluginPacketSender.WRAPPER_PACKET_RESOURCE, (client, handler, buffer, packetSender) ->
|
ClientPlayNetworking.registerGlobalReceiver(AbstractPluginPacketSender.WRAPPER_PACKET_RESOURCE, (client, handler, buffer, packetSender) ->
|
||||||
@@ -345,6 +372,11 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
|
|||||||
ClientApi.INSTANCE.pluginMessageReceived(payload.message());
|
ClientApi.INSTANCE.pluginMessageReceived(payload.message());
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onKeyInput()
|
public void onKeyInput()
|
||||||
|
|||||||
-12
@@ -105,22 +105,10 @@ public class MixinChunkSectionsToRender
|
|||||||
}
|
}
|
||||||
else if (chunkSectionLayerGroup == ChunkSectionLayerGroup.OPAQUE)
|
else if (chunkSectionLayerGroup == ChunkSectionLayerGroup.OPAQUE)
|
||||||
{
|
{
|
||||||
ClientApi.INSTANCE.renderFadeTransparent();
|
|
||||||
ClientApi.INSTANCE.renderLods();
|
ClientApi.INSTANCE.renderLods();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(at = @At("RETURN"), method = "renderGroup", order = 800)
|
|
||||||
private void renderDeferredLayerReturn(ChunkSectionLayerGroup chunkSectionLayerGroup, GpuSampler gpuSampler, CallbackInfo ci)
|
|
||||||
{
|
|
||||||
ClientApi.RENDER_STATE.canRenderOrThrow();
|
|
||||||
|
|
||||||
if (chunkSectionLayerGroup == ChunkSectionLayerGroup.TRANSLUCENT)
|
|
||||||
{
|
|
||||||
ClientApi.INSTANCE.renderFadeOpaque();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user