some more stuff idk idk idk
This commit is contained in:
parent
9b7b9cd368
commit
98689d2fa7
3 changed files with 38 additions and 9 deletions
|
@ -0,0 +1,28 @@
|
|||
package land.chipmunk.chipmunkmod.mixin;
|
||||
|
||||
import net.minecraft.nbt.*;
|
||||
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.CallbackInfoReturnable;
|
||||
|
||||
import java.io.DataInput;
|
||||
import java.io.IOException;
|
||||
|
||||
@Mixin(NbtIo.class)
|
||||
public class NbtIoMixin {
|
||||
@Inject(method = "read(Ljava/io/DataInput;ILnet/minecraft/nbt/NbtTagSizeTracker;)Lnet/minecraft/nbt/NbtElement;", at = @At("HEAD"), cancellable = true)
|
||||
private static void read(DataInput input, int depth, NbtTagSizeTracker tracker, CallbackInfoReturnable<NbtElement> cir) {
|
||||
try {
|
||||
byte b = input.readByte();
|
||||
if (b == 0) {
|
||||
cir.setReturnValue(NbtEnd.INSTANCE);
|
||||
}
|
||||
|
||||
NbtString.skip(input);
|
||||
cir.setReturnValue(NbtTypes.byId(b).read(input, depth, tracker));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,18 +3,18 @@ package land.chipmunk.chipmunkmod.mixin;
|
|||
import net.minecraft.util.StringHelper;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(StringHelper.class)
|
||||
public class StringHelperMixin {
|
||||
// totallynotskidded™ from meteor client
|
||||
@ModifyArg(method = "truncateChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/StringHelper;truncate(Ljava/lang/String;IZ)Ljava/lang/String;"))
|
||||
private static int truncateChat(int maxLength) {
|
||||
return Integer.MAX_VALUE;
|
||||
@Inject(method = "truncateChat", at = @At("HEAD"), cancellable = true)
|
||||
private static void truncateChat (String text, CallbackInfoReturnable<String> cir) {
|
||||
cir.setReturnValue(text);
|
||||
}
|
||||
|
||||
@ModifyArg(method = "stripTextFormat", at = @At(value = "INVOKE", target = "Ljava/util/regex/Matcher;replaceAll(Ljava/lang/String;)Ljava/lang/String;"))
|
||||
private static String stripTextFormat (String replacement) {
|
||||
return replacement;
|
||||
@Inject(method = "stripTextFormat", at = @At("HEAD"), cancellable = true)
|
||||
private static void stripTextFormat(String text, CallbackInfoReturnable<String> cir) {
|
||||
cir.setReturnValue(text);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
"MinecraftClientAccessor",
|
||||
"LightmapTextureManagerMixin",
|
||||
"DecoderHandlerMixin",
|
||||
"StringHelperMixin"
|
||||
"StringHelperMixin",
|
||||
"NbtIoMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
Loading…
Reference in a new issue