Skip to content

Commit

Permalink
fix possible leak of secret; merge previous 1.21.X fixes; update mdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Sonic2423 committed Dec 19, 2024
1 parent 395a164 commit eea5db1
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 9 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
org.gradle.jvmargs=-Xmx1G
#org.gradle.jvmargs=
org.gradle.daemon=false
org.gradle.debug=false

Expand All @@ -16,7 +16,7 @@ minecraft_version=1.20.4
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.20.4]
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=20.4.235
neo_version=20.4.237
# The Neo version range can use any version of Neo as bounds
neo_version_range=[20.4,)
# The loader version range can only use the major version of FML as bounds
Expand All @@ -32,7 +32,7 @@ mod_name=NeoForwarding
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GNU GPLv3
# The mod version. See https://semver.org/
mod_version=1.1.1
mod_version=1.3.0
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
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,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 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 @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# 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
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
2 changes: 2 additions & 0 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
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ pluginManagement {
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.9.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class NeoForwarding {
// FML will recognize some parameter types like IEventBus or ModContainer and pass them in automatically.
public NeoForwarding(IEventBus modEventBus) {
// Register our mod's ModConfigSpec so that FML can create and load the config file for us
ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, Config.SPEC);
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.SPEC, "neoforwarding-server.toml");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.neoforge.registries.RegistryManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -32,7 +33,7 @@ private static <A extends ArgumentType<?>, T extends ArgumentTypeInfo.Template<A
ResourceLocation key = BuiltInRegistries.COMMAND_ARGUMENT_TYPE.getKey(pArgumentInfo);
int id = BuiltInRegistries.COMMAND_ARGUMENT_TYPE.getId(pArgumentInfo);

if (key == null || key.getNamespace().equals("brigadier") || (key.getNamespace().equals("minecraft") && !key.getPath().equals("test_argument") && !key.getPath().equals("test_class"))) {
if (key == null || neoforwarding$isVanillaRegistry(key)) {
return;
}

Expand All @@ -55,5 +56,11 @@ private static <A extends ArgumentType<?>, T extends ArgumentTypeInfo.Template<A
pBuffer.writeVarInt(extraData.readableBytes());
pBuffer.writeBytes(extraData);
}

@Unique
private static boolean neoforwarding$isVanillaRegistry(ResourceLocation location) {
// Checks if the registry name is contained within the static view of VanillaRegistries
return RegistryManager.getVanillaRegistryKeys().contains(location);
}
}

0 comments on commit eea5db1

Please sign in to comment.