forked from BynBang/OpenPrestige
fixes
This commit is contained in:
1 parent
83aea53e57
commit
aa4f6b6ddc
842 files changed
+47284
-91563
No files matched your search
@@ -2,8 +2,8 @@ package dev.zprestige.prestige.mixin;
|
||||
|
||||
import com.mojang.blaze3d.buffers.Std140Builder;
|
||||
import dev.zprestige.prestige.client.Prestige;
|
||||
import dev.zprestige.prestige.event.FloatColorEvent;
|
||||
import dev.zprestige.prestige.util.ClientUtil;
|
||||
import dev.zprestige.prestige.event.FogEvent;
|
||||
import dev.zprestige.prestige.util.HookBridge;
|
||||
import java.awt.Color;
|
||||
import java.nio.ByteBuffer;
|
||||
import net.lenni0451.classtransform.InjectionCallback;
|
||||
@@ -23,7 +23,7 @@ public class FogRendererMixin {
|
||||
target = {@CTarget("HEAD")},
|
||||
cancellable = true
|
||||
)
|
||||
private void a(
|
||||
private void overrideFogBufferAtApplyFogHead(
|
||||
ByteBuffer buffer,
|
||||
int bufPos,
|
||||
Vector4f fogColor,
|
||||
@@ -35,24 +35,24 @@ public class FogRendererMixin {
|
||||
float cloudEnd,
|
||||
InjectionCallback ci
|
||||
) {
|
||||
if (ClientUtil.h(Prestige.eventBus, FloatColorEvent.class)) {
|
||||
FloatColorEvent event = ClientUtil.i(0.0F, 0.0F, Color.WHITE);
|
||||
if (ClientUtil.j(event)) {
|
||||
Vector4f color = ClientUtil.o(
|
||||
ClientUtil.k(event).getRed() / 255.0F,
|
||||
ClientUtil.l(event).getGreen() / 255.0F,
|
||||
ClientUtil.m(event).getBlue() / 255.0F,
|
||||
ClientUtil.n(event).getAlpha() / 255.0F
|
||||
if (HookBridge.hasFogBufferListeners(Prestige.eventBus, FogEvent.class)) {
|
||||
FogEvent event = HookBridge.createFogBufferEvent(0.0F, 0.0F, Color.WHITE);
|
||||
if (HookBridge.postFogBufferEvent(event)) {
|
||||
Vector4f color = HookBridge.createFogBufferColor(
|
||||
HookBridge.getFogColorForRed(event).getRed() / 255.0F,
|
||||
HookBridge.getFogColorForGreen(event).getGreen() / 255.0F,
|
||||
HookBridge.getFogColorForBlue(event).getBlue() / 255.0F,
|
||||
HookBridge.getFogColorForAlpha(event).getAlpha() / 255.0F
|
||||
);
|
||||
Float skyOv = ClientUtil.p(event);
|
||||
Float skyOv = HookBridge.getFogSkyEndOverride(event);
|
||||
float effectiveSkyEnd = skyOv == null ? skyEnd : skyOv;
|
||||
buffer.position(bufPos);
|
||||
Std140Builder.intoBuffer(buffer)
|
||||
.putVec4(color)
|
||||
.putFloat(ClientUtil.q(event))
|
||||
.putFloat(ClientUtil.r(event))
|
||||
.putFloat(ClientUtil.s(event))
|
||||
.putFloat(ClientUtil.t(event))
|
||||
.putFloat(HookBridge.getFogEnvironmentalStart(event))
|
||||
.putFloat(HookBridge.getFogEnvironmentalEnd(event))
|
||||
.putFloat(HookBridge.getFogRenderDistanceStart(event))
|
||||
.putFloat(HookBridge.getFogRenderDistanceEnd(event))
|
||||
.putFloat(effectiveSkyEnd)
|
||||
.putFloat(cloudEnd);
|
||||
ci.cancel();
|
||||
@@ -65,12 +65,12 @@ public class FogRendererMixin {
|
||||
target = {@CTarget("TAIL")},
|
||||
cancellable = true
|
||||
)
|
||||
private void b(Camera camera, int viewDistance, RenderTickCounter tickCounter, float tickProgress, ClientWorld world, InjectionCallback ci) {
|
||||
if (ClientUtil.u(Prestige.eventBus, FloatColorEvent.class)) {
|
||||
FloatColorEvent event = ClientUtil.v(0.0F, 0.0F, Color.WHITE);
|
||||
if (ClientUtil.w(event)) {
|
||||
Color c = ClientUtil.x(event);
|
||||
ci.setReturnValue(ClientUtil.y(c.getRed() / 255.0F, c.getGreen() / 255.0F, c.getBlue() / 255.0F, c.getAlpha() / 255.0F));
|
||||
private void overrideFogColorAtApplyFogTail(Camera camera, int viewDistance, RenderTickCounter tickCounter, float tickProgress, ClientWorld world, InjectionCallback ci) {
|
||||
if (HookBridge.hasFogColorListeners(Prestige.eventBus, FogEvent.class)) {
|
||||
FogEvent event = HookBridge.createFogColorEvent(0.0F, 0.0F, Color.WHITE);
|
||||
if (HookBridge.postFogColorEvent(event)) {
|
||||
Color fogColor = HookBridge.getFogColor(event);
|
||||
ci.setReturnValue(HookBridge.createFogColorVector(fogColor.getRed() / 255.0F, fogColor.getGreen() / 255.0F, fogColor.getBlue() / 255.0F, fogColor.getAlpha() / 255.0F));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user