Update to 1.21.3

This commit is contained in:
2025-06-14 20:29:35 +02:00
parent 67f979a051
commit d7c9759d27
5 changed files with 13 additions and 4 deletions

View File

@ -15,6 +15,7 @@ dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}
loom {

View File

@ -4,9 +4,14 @@ org.gradle.parallel=true
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.8
loader_version=0.16.10
loader_version=0.16.14
loom_version=1.10-SNAPSHOT
# Fabric API
fabric_version=0.119.3+1.21.4
# Mod Properties
mod_version = 2.2.0

View File

@ -20,10 +20,12 @@
package de.steamwar.advancedscripts;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
public class AdvancedScripts implements ClientModInitializer {
@Override
public void onInitializeClient() {
PayloadTypeRegistry.playC2S().register(KeyAction.ID, KeyAction.CODEC);
}
}

View File

@ -20,9 +20,9 @@
package de.steamwar.advancedscripts.mixin;
import de.steamwar.advancedscripts.KeyAction;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.minecraft.client.Keyboard;
import net.minecraft.client.MinecraftClient;
import net.minecraft.network.packet.c2s.common.CustomPayloadC2SPacket;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@ -34,7 +34,7 @@ public class KeyboardMixin {
public void sendKeyPress(long window, int key, int scancode, int action, int modifiers, CallbackInfo ci) {
MinecraftClient client = ((Keyboard) (Object)this).client;
if(client.currentScreen == null && action != 2) {
client.getNetworkHandler().sendPacket(new CustomPayloadC2SPacket(new KeyAction(key, (byte) action, modifiers)));
ClientPlayNetworking.send(new KeyAction(key, (byte) action, modifiers));
}
}
}

View File

@ -23,7 +23,8 @@
"depends": {
"fabricloader": ">=0.14.11",
"minecraft": ">=1.20.6",
"java": ">=21"
"java": ">=21",
"fabric-api": "*"
},
"accessWidener" : "advancedscripts.accesswidener"
}