Skip to content

Commit

Permalink
updated to 1.20.5/6
Browse files Browse the repository at this point in the history
  • Loading branch information
Nettakrim committed Jun 18, 2024
1 parent 1cad813 commit dcda59a
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 40 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.1-SNAPSHOT'
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
}

Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx4G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.2
loader_version=0.15.1
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.3
loader_version=0.15.11

# Mod Properties
mod_version = 1.0.10-mc1.20.2
mod_version = 1.0.11-mc1.20.5+
maven_group = com.nettakrim.spyglass_astronomy
archives_base_name = spyglass_astronomy

# Dependencies
fabric_version=0.91.2+1.20.4
fabric_version=0.100.0+1.20.6
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 5 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,10 +32,10 @@
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ private static String getCurrentWorldOrServerName() {
ServerInfo serverInfo = SpyglassAstronomyClient.client.getCurrentServerEntry();
if (serverInfo != null) {
if (serverInfo.isRealm()) {
return "realms";
return serverInfo.name;
}
return serverInfo.address.replace(':', '_');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraft.client.render.VertexFormat;

import net.minecraft.client.render.BackgroundRenderer;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.MathHelper;
Expand Down Expand Up @@ -200,8 +199,8 @@ private void updateDrawingConstellation() {
drawingConstellationsBuffer.upload(drawingConstellationsBufferBuilder.end());
}

public void Render(MatrixStack matrices, Matrix4f projectionMatrix, float tickDelta, Camera camera, boolean bl, Runnable runnable) {
starVisibility = starsAlwaysVisible ? 1 : SpyglassAstronomyClient.world.method_23787(tickDelta) * (1.0f - SpyglassAstronomyClient.world.getRainGradient(tickDelta));
public void Render(MatrixStack matrices, Matrix4f projectionMatrix, float tickDelta) {
starVisibility = starsAlwaysVisible ? 1 : SpyglassAstronomyClient.world.getStarBrightness(tickDelta) * (1.0f - SpyglassAstronomyClient.world.getRainGradient(tickDelta));
if (starVisibility > 0) {
matrices.pop();
matrices.push();
Expand Down Expand Up @@ -238,8 +237,6 @@ public void Render(MatrixStack matrices, Matrix4f projectionMatrix, float tickDe
planetsBuffer.draw(matrices.peek().getPositionMatrix(), projectionMatrix, GameRenderer.getPositionColorProgram());
VertexBuffer.unbind();
}

runnable.run();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static String getMessageText(CommandContext<FabricClientCommandSource> co
public static String getMessageText(CommandContext<FabricClientCommandSource> context, String name) {
//a lot of digging through #SayCommand to make a MessageArgumentType that works clientside
MessageFormat messageFormat = context.getArgument(name, MessageFormat.class);
return messageFormat.getContents();
return messageFormat.contents();
}

public static Text getClickHere(String actionKey, String command, boolean run, Object... formatting) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
import net.minecraft.util.Identifier;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(InGameHud.class)
public class InGameHudMixin {
@Unique
private static final Identifier CONSTELLATION_SPYGLASS_SCOPE = new Identifier(SpyglassAstronomyClient.MODID,"textures/constellation_spyglass_scope.png");
private static final Identifier STAR_SPYGLASS_SCOPE = new Identifier(SpyglassAstronomyClient.MODID,"textures/star_spyglass_scope.png");
@Unique
private static final Identifier STAR_SPYGLASS_SCOPE = new Identifier(SpyglassAstronomyClient.MODID,"textures/star_spyglass_scope.png");

@Redirect(method = "renderSpyglassOverlay",at = @At(value = "INVOKE",target = "Lnet/minecraft/client/gui/DrawContext;drawTexture(Lnet/minecraft/util/Identifier;IIIFFIIII)V"))
public void swapTexture(DrawContext instance, Identifier texture, int x, int y, int z, float u, float v, int width, int height, int textureWidth, int textureHeight){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.nettakrim.spyglass_astronomy.SpyglassAstronomyClient;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
import net.minecraft.client.world.ClientWorld;

import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -18,8 +19,8 @@ private void saveSpace(CallbackInfo ci) {
SpyglassAstronomyClient.ready = false;
}

@Inject(method = "joinWorld(Lnet/minecraft/client/world/ClientWorld;)V", at = @At("RETURN"))
private void loadSpace(ClientWorld world, CallbackInfo ci) {
@Inject(method = "joinWorld", at = @At("TAIL"))
private void loadSpace(ClientWorld world, DownloadingTerrainScreen.WorldEntryReason worldEntryReason, CallbackInfo ci) {
SpyglassAstronomyClient.loadSpace(world, true);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.nettakrim.spyglass_astronomy.mixin;

import com.llamalad7.mixinextras.injector.WrapWithCondition;
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.nettakrim.spyglass_astronomy.SpyglassAstronomyClient;

import net.minecraft.client.Mouse;
Expand Down Expand Up @@ -46,10 +46,9 @@ private boolean onMouseScroll(PlayerInventory inventory, double scroll){
method = "updateMouse",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/tutorial/TutorialManager;onUpdateMouse(DD)V",
ordinal = 0
target = "Lnet/minecraft/client/tutorial/TutorialManager;onUpdateMouse(DD)V"
),
ordinal = 2
ordinal = 1
)
private double changeXSensitivity(double d) {
ClientPlayerEntity player = SpyglassAstronomyClient.client.player;
Expand All @@ -71,10 +70,9 @@ private double changeXSensitivity(double d) {
method = "updateMouse",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/tutorial/TutorialManager;onUpdateMouse(DD)V",
ordinal = 0
target = "Lnet/minecraft/client/tutorial/TutorialManager;onUpdateMouse(DD)V"
),
ordinal = 3
ordinal = 2
)
private double changeYSensitivity(double d) {
return d * sensitivityScale;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.nettakrim.spyglass_astronomy.mixin;

import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.llamalad7.mixinextras.sugar.Local;
import com.nettakrim.spyglass_astronomy.SpaceRenderingManager;
import com.nettakrim.spyglass_astronomy.SpyglassAstronomyClient;

Expand All @@ -12,7 +14,6 @@

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -21,22 +22,20 @@
public class WorldRendererMixin {
@Shadow private int ticks;

@Redirect(
method = "renderSky(Lnet/minecraft/client/util/math/MatrixStack;Lorg/joml/Matrix4f;FLnet/minecraft/client/render/Camera;ZLjava/lang/Runnable;)V",
@WrapWithCondition(
method = "renderSky(Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;FLnet/minecraft/client/render/Camera;ZLjava/lang/Runnable;)V",
at = @At(value = "INVOKE", ordinal = 1, target="Lnet/minecraft/client/gl/VertexBuffer;draw(Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lnet/minecraft/client/gl/ShaderProgram;)V")
)
private void stopStarRender(VertexBuffer buffer, Matrix4f positionMatrix, Matrix4f projectionMatrix, ShaderProgram positionShader) {
if (SpaceRenderingManager.oldStarsVisible) {
buffer.draw(positionMatrix, projectionMatrix, positionShader);
}
private boolean stopStarRender(VertexBuffer buffer, Matrix4f positionMatrix, Matrix4f projectionMatrix, ShaderProgram positionShader) {
return SpaceRenderingManager.oldStarsVisible;
}

@Inject(
method = "renderSky(Lnet/minecraft/client/util/math/MatrixStack;Lorg/joml/Matrix4f;FLnet/minecraft/client/render/Camera;ZLjava/lang/Runnable;)V",
method = "renderSky(Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;FLnet/minecraft/client/render/Camera;ZLjava/lang/Runnable;)V",
at = @At(value = "INVOKE", ordinal = 4, target="Lcom/mojang/blaze3d/systems/RenderSystem;setShaderColor(FFFF)V")
)
public void renderSky(MatrixStack matrices, Matrix4f projectionMatrix, float tickDelta, Camera camera, boolean bl, Runnable runnable, CallbackInfo ci) {
SpyglassAstronomyClient.spaceRenderingManager.Render(matrices, projectionMatrix, tickDelta, camera, bl, runnable);
public void renderSky(Matrix4f matrix4f, Matrix4f projectionMatrix, float tickDelta, Camera camera, boolean thickFog, Runnable fogCallback, CallbackInfo ci, @Local MatrixStack matrices) {
SpyglassAstronomyClient.spaceRenderingManager.Render(matrices, projectionMatrix, tickDelta);
}

@Inject(at = @At("HEAD"), method = "tick")
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"depends": {
"fabricloader": ">=0.14.21",
"fabric": "*",
"minecraft": "~1.20",
"minecraft": ">=1.20.5",
"java": ">=17"
},
"suggests": {
Expand Down

0 comments on commit dcda59a

Please sign in to comment.