Skip to content

Commit 32db281

Browse files
Update to 1.20.5
1 parent f8d280a commit 32db281

File tree

15 files changed

+149
-122
lines changed

15 files changed

+149
-122
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Skyblock Mod 1.10.2 for 1.20.5
2+
3+
Support for 1.20.5
4+
5+
16
## Skyblock Mod 1.10.1 for 1.20.4
27

38
Improve Skyblocker compatibility

build.gradle

+15-20
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
plugins {
2-
id 'fabric-loom' version '1.5-SNAPSHOT'
2+
id 'fabric-loom' version '1.6-SNAPSHOT'
33
id 'maven-publish'
44
id "me.modmuss50.mod-publish-plugin" version "0.5.1"
55
}
66

7-
sourceCompatibility = JavaVersion.VERSION_17
8-
targetCompatibility = JavaVersion.VERSION_17
9-
10-
// Add minecraft version to the build jar name
11-
archivesBaseName = project.archives_base_name + '-' + project.minecraft_version
127
version = project.mod_version
138
group = project.maven_group
149

10+
base {
11+
archivesName = project.archives_base_name + '-' + project.minecraft_version
12+
}
13+
1514
loom {
1615
accessWidenerPath = file("src/main/resources/skyblockmod.accesswidener")
1716
}
@@ -38,16 +37,12 @@ dependencies {
3837
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
3938
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
4039

41-
// Fabric API.
40+
// Fabric API
4241
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
4342

4443
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
4544

46-
modCompileOnly "maven.modrinth:skyblocker-liap:v${project.skyblocker_version}+${project.minecraft_version}"
47-
48-
include modImplementation("com.github.0x3C50:Renderer:${project.renderer_version}") {
49-
exclude group: "io.github.ladysnake" exclude module: "satin"
50-
}
45+
modCompileOnly "maven.modrinth:skyblocker-liap:${project.skyblocker_version}"
5146

5247
include modImplementation("org.eclipse.jgit:org.eclipse.jgit:${project.jgit_version}")
5348

@@ -70,27 +65,29 @@ processResources {
7065
}
7166

7267
tasks.withType(JavaCompile).configureEach {
73-
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
74-
it.options.release = 17
68+
it.options.release = 21
7569
}
7670

7771
java {
7872
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
7973
// if it is present.
8074
// If you remove this line, sources will not be generated.
8175
withSourcesJar()
76+
77+
sourceCompatibility = JavaVersion.VERSION_21
78+
targetCompatibility = JavaVersion.VERSION_21
8279
}
8380

8481
jar {
8582
from("LICENSE") {
86-
rename { "${it}_${project.archivesBaseName}"}
83+
rename { "${it}_${project.base.archivesName.get()}"}
8784
}
8885
}
8986

9087
// configure the maven publication
9188
publishing {
9289
publications {
93-
mavenJava(MavenPublication) {
90+
create("mavenJava", MavenPublication) {
9491
from components.java
9592
}
9693
}
@@ -115,15 +112,13 @@ publishMods {
115112
projectId = "658094"
116113
projectSlug = "skyblockmod" // Required for discord webhook
117114
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
118-
minecraftVersions.add("1.20.3")
119-
minecraftVersions.add("1.20.4")
115+
minecraftVersions.add("1.20.5")
120116
requires("fabric-api")
121117
}
122118
modrinth {
123119
projectId = "GTIrlvJk"
124120
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
125-
minecraftVersions.add("1.20.3")
126-
minecraftVersions.add("1.20.4")
121+
minecraftVersions.add("1.20.5")
127122
}
128123
github {
129124
repository = "kevinthegreat1/SkyblockMod-Fabric"

gradle.properties

+7-8
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@ org.gradle.jvmargs = -Xmx1G
33

44
# Fabric Properties
55
# check these on https://fabricmc.net/versions.html
6-
minecraft_version = 1.20.4
7-
yarn_mappings = 1.20.4+build.3
8-
loader_version = 0.15.3
6+
minecraft_version = 1.20.5
7+
yarn_mappings = 1.20.5+build.1
8+
loader_version = 0.15.10
99

1010
# Mod Properties
11-
mod_version = 1.10.1
11+
mod_version = 1.10.2
1212
maven_group = com.kevinthegreat.skyblockmod
1313
archives_base_name = skyblock-mod
1414

1515
# Dependencies
16-
fabric_version = 0.92.0+1.20.4
17-
modmenu_version = 9.0.0
18-
skyblocker_version = 1.20.2
16+
fabric_version = 0.97.8+1.20.5
17+
modmenu_version = 10.0.0-beta.1
18+
skyblocker_version = v1.20.2+1.20.4
1919
jgit_version = 6.8.0.202311291450-r
20-
renderer_version = master-SNAPSHOT
2120
## Apache Commons Math (https://mvnrepository.com/artifact/org.apache.commons/commons-math3)
2221
commons_math_version = 3.6.1

gradle/wrapper/gradle-wrapper.jar

-18.2 KB
Binary file not shown.
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

+13-9
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
8788

8889
# Use the maximum available, or set MAX_FD != -1 to use that value.
8990
MAX_FD=maximum
@@ -130,26 +131,29 @@ location of your Java installation."
130131
fi
131132
else
132133
JAVACMD=java
133-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134+
if ! command -v java >/dev/null 2>&1
135+
then
136+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134137
135138
Please set the JAVA_HOME variable in your environment to match the
136139
location of your Java installation."
140+
fi
137141
fi
138142

139143
# Increase the maximum file descriptors if we can.
140144
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
141145
case $MAX_FD in #(
142146
max*)
143147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
144-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
145149
MAX_FD=$( ulimit -H -n ) ||
146150
warn "Could not query maximum file descriptor limit"
147151
esac
148152
case $MAX_FD in #(
149153
'' | soft) :;; #(
150154
*)
151155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
152-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
153157
ulimit -n "$MAX_FD" ||
154158
warn "Could not set maximum file descriptor limit to $MAX_FD"
155159
esac
@@ -198,11 +202,11 @@ fi
198202
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
199203
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
200204

201-
# Collect all arguments for the java command;
202-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
203-
# shell script including quotes and variable substitutions, so put them in
204-
# double quotes to make sure that they get re-expanded; and
205-
# * put everything else in single quotes, so that it's not re-expanded.
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
206210

207211
set -- \
208212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

gradlew.bat

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

src/main/java/com/kevinthegreat/skyblockmod/SkyblockMod.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
2020
import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents;
2121
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
22-
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
2322
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
2423
import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents;
2524
import net.fabricmc.loader.api.FabricLoader;
@@ -81,7 +80,7 @@ private void registerEvents() {
8180
ClientTickEvents.END_CLIENT_TICK.register(this::tick);
8281
WorldRenderEvents.AFTER_TRANSLUCENT.register(fairySouls::render);
8382
mythologicalRitual.init();
84-
HudRenderCallback.EVENT.register(dungeonMap::render);
83+
dungeonMap.init();
8584
ClientReceiveMessageEvents.ALLOW_GAME.register(this::onChatMessage);
8685
ClientReceiveMessageEvents.GAME_CANCELED.register(this::onChatMessage);
8786
ScreenEvents.AFTER_INIT.register(experiments::start);

src/main/java/com/kevinthegreat/skyblockmod/dungeons/DungeonMap.java

+42-23
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,57 @@
22

33
import com.kevinthegreat.skyblockmod.SkyblockMod;
44
import com.kevinthegreat.skyblockmod.option.SkyblockModOptions;
5+
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
6+
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
57
import net.minecraft.client.MinecraftClient;
68
import net.minecraft.client.gui.DrawContext;
9+
import net.minecraft.client.render.LightmapTextureManager;
710
import net.minecraft.client.render.VertexConsumerProvider;
11+
import net.minecraft.client.util.math.MatrixStack;
12+
import net.minecraft.component.DataComponentTypes;
13+
import net.minecraft.component.type.MapIdComponent;
814
import net.minecraft.item.FilledMapItem;
915
import net.minecraft.item.ItemStack;
1016
import net.minecraft.item.Items;
1117
import net.minecraft.item.map.MapState;
1218

13-
//from skyfabric
1419
public class DungeonMap {
15-
public void render(DrawContext context, float tickDelta) {
20+
private final MapIdComponent DEFAULT_MAP_ID_COMPONENT = new MapIdComponent(1024);
21+
private MapIdComponent cachedMapIdComponent = null;
22+
23+
public void init() {
24+
HudRenderCallback.EVENT.register((context, tickDelta) -> render(context));
25+
ClientPlayConnectionEvents.JOIN.register((handler, sender, client) -> reset());
26+
}
27+
28+
private void render(DrawContext context) {
1629
SkyblockModOptions options = SkyblockMod.skyblockMod.options;
17-
if (options.dungeonMap.getValue() && SkyblockMod.skyblockMod.info.catacombs) {
18-
MinecraftClient minecraftClient = MinecraftClient.getInstance();
19-
if (minecraftClient == null || minecraftClient.player == null || minecraftClient.world == null) {
20-
return;
21-
}
22-
ItemStack itemStack = minecraftClient.player.getInventory().main.get(8);
23-
if (!itemStack.isOf(Items.FILLED_MAP)) {
24-
return;
25-
}
26-
MapState mapState = FilledMapItem.getMapState(FilledMapItem.getMapId(itemStack), minecraftClient.world);
27-
if (mapState == null) {
28-
return;
29-
}
30-
VertexConsumerProvider.Immediate vertices = minecraftClient.getBufferBuilders().getEffectVertexConsumers();
31-
context.getMatrices().push();
32-
context.getMatrices().translate(options.dungeonMapX.getValue(), options.dungeonMapY.getValue(), 0);
33-
context.getMatrices().scale(options.dungeonMapScale.getValue().floatValue(), options.dungeonMapScale.getValue().floatValue(), 0);
34-
minecraftClient.gameRenderer.getMapRenderer().draw(context.getMatrices(), vertices, FilledMapItem.getMapId(itemStack), mapState, false, 15728880);
35-
vertices.draw();
36-
context.getMatrices().pop();
37-
}
30+
if (!options.dungeonMap.getValue() || !SkyblockMod.skyblockMod.info.catacombs) return;
31+
32+
MinecraftClient client = MinecraftClient.getInstance();
33+
if (client.player == null || client.world == null) return;
34+
35+
MapIdComponent mapId = getMapIdComponent(client.player.getInventory().main.get(8));
36+
MapState state = FilledMapItem.getMapState(mapId, client.world);
37+
if (state == null) return;
38+
39+
MatrixStack matrices = context.getMatrices();
40+
float scaling = options.dungeonMapScale.getValue().floatValue();
41+
VertexConsumerProvider.Immediate vertices = client.getBufferBuilders().getEffectVertexConsumers();
42+
43+
matrices.push();
44+
matrices.translate(options.dungeonMapX.getValue(), options.dungeonMapY.getValue(), 0);
45+
matrices.scale(scaling, scaling, 0f);
46+
client.gameRenderer.getMapRenderer().draw(matrices, vertices, mapId, state, false, LightmapTextureManager.MAX_LIGHT_COORDINATE);
47+
vertices.draw();
48+
matrices.pop();
49+
}
50+
51+
public MapIdComponent getMapIdComponent(ItemStack stack) {
52+
return stack.isOf(Items.FILLED_MAP) && stack.contains(DataComponentTypes.MAP_ID) ? (cachedMapIdComponent = stack.get(DataComponentTypes.MAP_ID)) : cachedMapIdComponent != null ? cachedMapIdComponent : DEFAULT_MAP_ID_COMPONENT;
53+
}
54+
55+
private void reset() {
56+
cachedMapIdComponent = null;
3857
}
3958
}

0 commit comments

Comments
 (0)