Skip to content

Commit

Permalink
Update to 1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthegreat1 committed Apr 28, 2024
1 parent f8d280a commit 32db281
Show file tree
Hide file tree
Showing 15 changed files with 149 additions and 122 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Skyblock Mod 1.10.2 for 1.20.5

Support for 1.20.5


## Skyblock Mod 1.10.1 for 1.20.4

Improve Skyblocker compatibility
Expand Down
35 changes: 15 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
id "me.modmuss50.mod-publish-plugin" version "0.5.1"
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

// Add minecraft version to the build jar name
archivesBaseName = project.archives_base_name + '-' + project.minecraft_version
version = project.mod_version
group = project.maven_group

base {
archivesName = project.archives_base_name + '-' + project.minecraft_version
}

loom {
accessWidenerPath = file("src/main/resources/skyblockmod.accesswidener")
}
Expand All @@ -38,16 +37,12 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API.
// Fabric API
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

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

modCompileOnly "maven.modrinth:skyblocker-liap:v${project.skyblocker_version}+${project.minecraft_version}"

include modImplementation("com.github.0x3C50:Renderer:${project.renderer_version}") {
exclude group: "io.github.ladysnake" exclude module: "satin"
}
modCompileOnly "maven.modrinth:skyblocker-liap:${project.skyblocker_version}"

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

Expand All @@ -70,27 +65,29 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
it.options.release = 21
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
rename { "${it}_${project.base.archivesName.get()}"}
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
create("mavenJava", MavenPublication) {
from components.java
}
}
Expand All @@ -115,15 +112,13 @@ publishMods {
projectId = "658094"
projectSlug = "skyblockmod" // Required for discord webhook
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
minecraftVersions.add("1.20.3")
minecraftVersions.add("1.20.4")
minecraftVersions.add("1.20.5")
requires("fabric-api")
}
modrinth {
projectId = "GTIrlvJk"
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
minecraftVersions.add("1.20.3")
minecraftVersions.add("1.20.4")
minecraftVersions.add("1.20.5")
}
github {
repository = "kevinthegreat1/SkyblockMod-Fabric"
Expand Down
15 changes: 7 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ org.gradle.jvmargs = -Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version = 1.20.4
yarn_mappings = 1.20.4+build.3
loader_version = 0.15.3
minecraft_version = 1.20.5
yarn_mappings = 1.20.5+build.1
loader_version = 0.15.10

# Mod Properties
mod_version = 1.10.1
mod_version = 1.10.2
maven_group = com.kevinthegreat.skyblockmod
archives_base_name = skyblock-mod

# Dependencies
fabric_version = 0.92.0+1.20.4
modmenu_version = 9.0.0
skyblocker_version = 1.20.2
fabric_version = 0.97.8+1.20.5
modmenu_version = 10.0.0-beta.1
skyblocker_version = v1.20.2+1.20.4
jgit_version = 6.8.0.202311291450-r
renderer_version = master-SNAPSHOT
## Apache Commons Math (https://mvnrepository.com/artifact/org.apache.commons/commons-math3)
commons_math_version = 3.6.1
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 13 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

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

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

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

goto fail

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

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/kevinthegreat/skyblockmod/SkyblockMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents;
import net.fabricmc.loader.api.FabricLoader;
Expand Down Expand Up @@ -81,7 +80,7 @@ private void registerEvents() {
ClientTickEvents.END_CLIENT_TICK.register(this::tick);
WorldRenderEvents.AFTER_TRANSLUCENT.register(fairySouls::render);
mythologicalRitual.init();
HudRenderCallback.EVENT.register(dungeonMap::render);
dungeonMap.init();
ClientReceiveMessageEvents.ALLOW_GAME.register(this::onChatMessage);
ClientReceiveMessageEvents.GAME_CANCELED.register(this::onChatMessage);
ScreenEvents.AFTER_INIT.register(experiments::start);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,57 @@

import com.kevinthegreat.skyblockmod.SkyblockMod;
import com.kevinthegreat.skyblockmod.option.SkyblockModOptions;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.LightmapTextureManager;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.MapIdComponent;
import net.minecraft.item.FilledMapItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.map.MapState;

//from skyfabric
public class DungeonMap {
public void render(DrawContext context, float tickDelta) {
private final MapIdComponent DEFAULT_MAP_ID_COMPONENT = new MapIdComponent(1024);
private MapIdComponent cachedMapIdComponent = null;

public void init() {
HudRenderCallback.EVENT.register((context, tickDelta) -> render(context));
ClientPlayConnectionEvents.JOIN.register((handler, sender, client) -> reset());
}

private void render(DrawContext context) {
SkyblockModOptions options = SkyblockMod.skyblockMod.options;
if (options.dungeonMap.getValue() && SkyblockMod.skyblockMod.info.catacombs) {
MinecraftClient minecraftClient = MinecraftClient.getInstance();
if (minecraftClient == null || minecraftClient.player == null || minecraftClient.world == null) {
return;
}
ItemStack itemStack = minecraftClient.player.getInventory().main.get(8);
if (!itemStack.isOf(Items.FILLED_MAP)) {
return;
}
MapState mapState = FilledMapItem.getMapState(FilledMapItem.getMapId(itemStack), minecraftClient.world);
if (mapState == null) {
return;
}
VertexConsumerProvider.Immediate vertices = minecraftClient.getBufferBuilders().getEffectVertexConsumers();
context.getMatrices().push();
context.getMatrices().translate(options.dungeonMapX.getValue(), options.dungeonMapY.getValue(), 0);
context.getMatrices().scale(options.dungeonMapScale.getValue().floatValue(), options.dungeonMapScale.getValue().floatValue(), 0);
minecraftClient.gameRenderer.getMapRenderer().draw(context.getMatrices(), vertices, FilledMapItem.getMapId(itemStack), mapState, false, 15728880);
vertices.draw();
context.getMatrices().pop();
}
if (!options.dungeonMap.getValue() || !SkyblockMod.skyblockMod.info.catacombs) return;

MinecraftClient client = MinecraftClient.getInstance();
if (client.player == null || client.world == null) return;

MapIdComponent mapId = getMapIdComponent(client.player.getInventory().main.get(8));
MapState state = FilledMapItem.getMapState(mapId, client.world);
if (state == null) return;

MatrixStack matrices = context.getMatrices();
float scaling = options.dungeonMapScale.getValue().floatValue();
VertexConsumerProvider.Immediate vertices = client.getBufferBuilders().getEffectVertexConsumers();

matrices.push();
matrices.translate(options.dungeonMapX.getValue(), options.dungeonMapY.getValue(), 0);
matrices.scale(scaling, scaling, 0f);
client.gameRenderer.getMapRenderer().draw(matrices, vertices, mapId, state, false, LightmapTextureManager.MAX_LIGHT_COORDINATE);
vertices.draw();
matrices.pop();
}

public MapIdComponent getMapIdComponent(ItemStack stack) {
return stack.isOf(Items.FILLED_MAP) && stack.contains(DataComponentTypes.MAP_ID) ? (cachedMapIdComponent = stack.get(DataComponentTypes.MAP_ID)) : cachedMapIdComponent != null ? cachedMapIdComponent : DEFAULT_MAP_ID_COMPONENT;
}

private void reset() {
cachedMapIdComponent = null;
}
}
Loading

0 comments on commit 32db281

Please sign in to comment.