Time speed fix

This commit is contained in:
paulevsGitch 2020-10-07 00:17:38 +03:00
parent c4fbfbf236
commit eb71045d34

View file

@ -61,6 +61,9 @@ public class WorldRendererMixin {
@Shadow @Shadow
private ClientWorld world; private ClientWorld world;
@Shadow
private int ticks;
@Inject(method = "<init>*", at = @At("TAIL")) @Inject(method = "<init>*", at = @At("TAIL"))
private void onInit(MinecraftClient client, BufferBuilderStorage bufferBuilders, CallbackInfo info) { private void onInit(MinecraftClient client, BufferBuilderStorage bufferBuilders, CallbackInfo info) {
initStars(); initStars();
@ -76,8 +79,8 @@ public class WorldRendererMixin {
@Inject(method = "renderSky", at = @At("HEAD"), cancellable = true) @Inject(method = "renderSky", at = @At("HEAD"), cancellable = true)
private void renderBetterEndSky(MatrixStack matrices, float tickDelta, CallbackInfo info) { private void renderBetterEndSky(MatrixStack matrices, float tickDelta, CallbackInfo info) {
if (client.world.getSkyProperties().getSkyType() == SkyProperties.SkyType.END) { if (client.world.getSkyProperties().getSkyType() == SkyProperties.SkyType.END) {
time += tickDelta * 0.001F; time = (ticks % 360000) * 0.001F;
if (time > 360) time -= 360; //if (time > 360) time -= 360;
BackgroundRenderer.setFogBlack(); BackgroundRenderer.setFogBlack();