Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.21.1 #436

Merged
merged 21 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: openjdk:17-jdk-slim
- image: openjdk:21-jdk-slim
resource_class: large

working_directory: ~/repo
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
Expand All @@ -18,16 +18,16 @@ jobs:
restore-keys: |
caches-
- name: JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
- name: Gradle
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v3
- name: Build
run: ./gradlew --no-daemon build
- name: Upload-Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: jar
path: build/libs/Galaxy.jar
Expand All @@ -45,22 +45,22 @@ jobs:
shell: bash
run: echo IMAGE_TAG=$([ "$GITHUB_REF" = "refs/heads/master" ] && echo "latest" || ([ "$GITHUB_EVENT_NAME" = 'pull_request' ] && echo pr-${{github.event.pull_request.number}} || echo ${GITHUB_REF##*/})) >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: jar
path: docker/mods/Galaxy.jar
- name: login
if: env.USERNAME != '' && env.PASSWORD != ''
uses: azure/docker-login@v1
uses: docker/login-action@v3
with:
login-server: harbor.k8s.oktw.one
registry: harbor.k8s.oktw.one
username: ${{ secrets.OKTW_HARBOR_USERNAME }}
password: ${{ secrets.OKTW_HARBOR_PASSWORD }}
- name: build cache
Expand Down
30 changes: 16 additions & 14 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
// "maven-publish"
kotlin("jvm") version "1.9.22"
id("fabric-loom") version "1.4-SNAPSHOT"
kotlin("jvm") version "2.0.10"
id("fabric-loom") version "1.7-SNAPSHOT"
}

val version = "0.0.1"
val group = "one.oktw"

val fabricVersion = "0.92.0+1.20.4"
val galaxyLibVersion = "9a964eaf"
val fabricVersion = "0.102.1+1.21.1"
val galaxyLibVersion = "7376fcdf"

repositories {
mavenCentral()
Expand All @@ -22,15 +24,15 @@ base {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

tasks.withType<KotlinCompile> {
kotlinOptions {
apiVersion = "1.7"
languageVersion = "1.7"
jvmTarget = "17"
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
apiVersion = KotlinVersion.KOTLIN_2_0
languageVersion = KotlinVersion.KOTLIN_2_0
jvmTarget = JvmTarget.JVM_21
}
}

Expand All @@ -40,9 +42,9 @@ loom {

dependencies {
// Core
minecraft(group = "com.mojang", name = "minecraft", version = "1.20.4")
mappings(group = "net.fabricmc", name = "yarn", version = "1.20.4+build.3", classifier = "v2")
modImplementation(group = "net.fabricmc", name = "fabric-loader", version = "0.15.3")
minecraft(group = "com.mojang", name = "minecraft", version = "1.21.1")
mappings(group = "net.fabricmc", name = "yarn", version = "1.21.1+build.3", classifier = "v2")
modImplementation(group = "net.fabricmc", name = "fabric-loader", version = "0.15.11")

// fabric api
modImplementation(group = "net.fabricmc.fabric-api", name = "fabric-api", version = fabricVersion) {
Expand Down
2 changes: 1 addition & 1 deletion docker
Submodule docker updated 1 files
+8 −12 Dockerfile
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.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
27 changes: 17 additions & 10 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -83,7 +85,9 @@ 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 -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,26 +134,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 +205,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
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,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 +59,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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* OKTW Galaxy Project
* Copyright (C) 2018-2022
* Copyright (C) 2018-2024
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
Expand All @@ -18,8 +18,9 @@

package one.oktw.galaxy.mixin.accessor;

import com.mojang.serialization.DynamicOps;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtElement;
import net.minecraft.registry.RegistryOps;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.poi.PointOfInterestSet;
import net.minecraft.world.storage.SerializingRegionBasedStorage;
Expand All @@ -40,5 +41,5 @@ public interface SerializingRegionBasedStorageAccessor {
CompletableFuture<Optional<NbtCompound>> callLoadNbt(ChunkPos pos);

@Invoker
<T> void callUpdate(ChunkPos pos, DynamicOps<T> dynamicOps, @Nullable T data);
void callUpdate(ChunkPos pos, RegistryOps<NbtElement> ops, @Nullable NbtCompound nbt);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* OKTW Galaxy Project
* Copyright (C) 2018-2023
* Copyright (C) 2018-2024
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
Expand All @@ -19,13 +19,13 @@
package one.oktw.galaxy.mixin.accessor;

import net.minecraft.server.world.ChunkHolder;
import net.minecraft.server.world.ThreadedAnvilChunkStorage;
import net.minecraft.server.world.ServerChunkLoadingManager;
import net.minecraft.util.math.ChunkPos;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

@Mixin(ThreadedAnvilChunkStorage.class)
public interface ThreadedAnvilChunkStorageAccessor {
@Mixin(ServerChunkLoadingManager.class)
public interface ServerChunkLoadingManagerAccessor {
@Invoker
Iterable<ChunkHolder> callEntryIterator();

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* OKTW Galaxy Project
* Copyright (C) 2018-2023
* Copyright (C) 2018-2024
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
Expand All @@ -19,10 +19,12 @@
package one.oktw.galaxy.mixin.recipe;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
import com.google.gson.JsonElement;
import net.minecraft.recipe.RecipeEntry;
import net.minecraft.recipe.RecipeManager;
import net.minecraft.recipe.RecipeType;
import net.minecraft.registry.RegistryOps;
import net.minecraft.resource.ResourceManager;
import net.minecraft.util.Identifier;
import net.minecraft.util.profiler.Profiler;
Expand All @@ -38,8 +40,8 @@
@Mixin(RecipeManager.class)
public class MixinCustomRecipe_RecipeManager implements CustomRecipeManager {
@Inject(method = "apply(Ljava/util/Map;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;)V", at = @At(value = "INVOKE", target = "Ljava/util/Map;entrySet()Ljava/util/Set;", ordinal = 0), locals = LocalCapture.CAPTURE_FAILSOFT)
private void recipeLoad(Map<Identifier, JsonElement> map, ResourceManager resourceManager, Profiler profiler, CallbackInfo ci, Map<RecipeType<?>, ImmutableMap.Builder<Identifier, RecipeEntry<?>>> map2, ImmutableMap.Builder<Identifier, RecipeEntry<?>> builder) {
customRecipes.forEach((i, v) -> map2.computeIfAbsent(i, k -> ImmutableMap.builder()).putAll(v));
customRecipes.forEach((i, v) -> builder.putAll(v));
private void recipeLoad(Map<Identifier, JsonElement> map, ResourceManager resourceManager, Profiler profiler, CallbackInfo ci, ImmutableMultimap.Builder<RecipeType<?>, RecipeEntry<?>> builder, ImmutableMap.Builder<Identifier, RecipeEntry<?>> builder2, RegistryOps<JsonElement> registryOps) {
customRecipes.forEach((type, recipeEntryHashMap) -> builder.putAll(type, recipeEntryHashMap.values()));
customRecipes.forEach((type, recipeEntryHashMap) -> builder2.putAll(recipeEntryHashMap));
}
}
Loading