Updated to 1.19.3

This commit is contained in:
mdo992 2023-01-02 12:46:50 -08:00 committed by Harry Zhou
parent 7897716386
commit 4038122b94
11 changed files with 83 additions and 38 deletions

45
.gitignore vendored
View file

@ -1,5 +1,40 @@
.gradle # gradle
.idea
gradle .gradle/
run build/
build out/
classes/
# eclipse
*.launch
# idea
.idea/
*.iml
*.ipr
*.iws
# vscode
.settings/
.vscode/
bin/
.classpath
.project
# macos
*.DS_Store
# fabric
run/
# java
hs_err_*.log
replay_*.log
*.hprof
*.jfr

View file

@ -1,5 +1,6 @@
plugins { plugins {
id 'fabric-loom' version '0.11-SNAPSHOT' id 'fabric-loom' version '1.0-SNAPSHOT'
id 'maven-publish'
} }
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_17
@ -55,3 +56,20 @@ jar {
rename { "${it}_${project.archivesBaseName}"} rename { "${it}_${project.archivesBaseName}"}
} }
} }
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}

View file

@ -1,10 +1,11 @@
# Done to increase the memory available to gradle. # Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version=1.19.2 minecraft_version=1.19.3
yarn_mappings=1.19.2+build.28 yarn_mappings=1.19.3+build.5
loader_version=0.14.12 loader_version=0.14.12
# Mod Properties # Mod Properties
@ -14,4 +15,4 @@ org.gradle.jvmargs=-Xmx1G
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.72.0+1.19.2 fabric_version=0.71.0+1.19.3

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View file

@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View file

@ -12,7 +12,7 @@ public class FakePlayerEntity extends OtherClientPlayerEntity {
ClientWorld world = SongPlayer.MC.world; ClientWorld world = SongPlayer.MC.world;
public FakePlayerEntity() { public FakePlayerEntity() {
super(SongPlayer.MC.world, SongPlayer.MC.player.getGameProfile(), SongPlayer.MC.player.getPublicKey()); super(SongPlayer.MC.world, SongPlayer.MC.player.getGameProfile());
copyStagePosAndPlayerLook(); copyStagePosAndPlayerLook();

View file

@ -1,8 +1,10 @@
package com.github.hhhzzzsss.songplayer.mixin; package com.github.hhhzzzsss.songplayer.mixin;
import com.github.hhhzzzsss.songplayer.CommandProcessor;
import com.github.hhhzzzsss.songplayer.playing.SongHandler; import com.github.hhhzzzsss.songplayer.playing.SongHandler;
import com.github.hhhzzzsss.songplayer.playing.Stage; import com.github.hhhzzzsss.songplayer.playing.Stage;
import net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
@ -37,6 +39,14 @@ public class ClientPlayNetworkHandlerMixin {
ci.cancel(); ci.cancel();
} }
} }
@Inject(at = @At("HEAD"), method = "sendChatMessage(Ljava/lang/String;)V", cancellable=true)
private void onSendChatMessage(String content, CallbackInfo ci) {
boolean isCommand = CommandProcessor.processChatMessage(content);
if (isCommand) {
ci.cancel();
}
}
@Inject(at = @At("TAIL"), method = "onGameJoin(Lnet/minecraft/network/packet/s2c/play/GameJoinS2CPacket;)V") @Inject(at = @At("TAIL"), method = "onGameJoin(Lnet/minecraft/network/packet/s2c/play/GameJoinS2CPacket;)V")
public void onOnGameJoin(GameJoinS2CPacket packet, CallbackInfo ci) { public void onOnGameJoin(GameJoinS2CPacket packet, CallbackInfo ci) {

View file

@ -1,24 +0,0 @@
package com.github.hhhzzzsss.songplayer.mixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import com.github.hhhzzzsss.songplayer.CommandProcessor;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.text.Text;
import javax.annotation.Nullable;
@Mixin(ClientPlayerEntity.class)
public class ClientPlayerEntityMixin {
@Inject(at = @At("HEAD"), method = "sendChatMessage(Ljava/lang/String;Lnet/minecraft/text/Text;)V", cancellable=true)
private void onSendChatMessage(String message, @Nullable Text preview, CallbackInfo ci) {
boolean isCommand = CommandProcessor.processChatMessage(message);
if (isCommand) {
ci.cancel();
}
}
}

View file

@ -278,7 +278,7 @@ public class SongHandler {
} }
private void checkCommandCache() { private void checkCommandCache() {
if (cachedCommand != null && System.currentTimeMillis() >= lastCommandTime + 1500) { if (cachedCommand != null && System.currentTimeMillis() >= lastCommandTime + 1500) {
SongPlayer.MC.player.sendCommand(cachedCommand); SongPlayer.MC.getNetworkHandler().sendCommand(cachedCommand);
cachedCommand = null; cachedCommand = null;
lastCommandTime = System.currentTimeMillis(); lastCommandTime = System.currentTimeMillis();
} }

View file

@ -26,9 +26,9 @@
], ],
"depends": { "depends": {
"fabricloader": ">=0.14.6", "fabricloader": ">=0.14.11",
"fabric": "*", "fabric": "*",
"minecraft": "~1.19", "minecraft": "~1.19.3",
"java": ">=17" "java": ">=17"
}, },
"suggests": { "suggests": {

View file

@ -6,7 +6,6 @@
"mixins": [ "mixins": [
], ],
"client": [ "client": [
"ClientPlayerEntityMixin",
"ClientPlayNetworkHandlerMixin", "ClientPlayNetworkHandlerMixin",
"ChatInputSuggestorMixin", "ChatInputSuggestorMixin",
"InGameHudMixin", "InGameHudMixin",