Fix PersistentState
Different Minion UUID Add CustomThing Bugfixes
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package io.github.skippyall.minions.mixins;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.world.PlayerSaveHandler;
|
||||
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.util.Optional;
|
||||
|
||||
@Mixin(PlayerSaveHandler.class)
|
||||
public class Debug2Mixin {
|
||||
@Inject(method = "method_55788", at = @At("HEAD"))
|
||||
public void debug(PlayerEntity playerEntity, NbtCompound nbt, CallbackInfoReturnable<NbtCompound> cir) {
|
||||
System.out.println("loadPlayerData " + playerEntity.getNameForScoreboard());
|
||||
}
|
||||
|
||||
@Inject(method = "loadPlayerData(Lnet/minecraft/entity/player/PlayerEntity;Ljava/lang/String;)Ljava/util/Optional;", at = @At("RETURN"))
|
||||
public void debug(PlayerEntity player, String extension, CallbackInfoReturnable<Optional<NbtCompound>> cir) {
|
||||
System.out.println(cir.getReturnValue().isEmpty() + player.getUuidAsString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package io.github.skippyall.minions.mixins;
|
||||
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import io.github.skippyall.minions.fakeplayer.MinionFakePlayer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
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;
|
||||
|
||||
//@Mixin(SectionedEntityCache.class)
|
||||
@Mixin(Entity.class)
|
||||
public class DebugMixin {
|
||||
/*@Inject(method = "forEachInBox", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/ChunkSectionPos;asLong(III)J", shift = At.Shift.BEFORE, ordinal = 0))
|
||||
private void debug(Box box, LazyIterationConsumer<EntityTrackingSection<?>> consumer, CallbackInfo ci) {
|
||||
System.out.println("call");
|
||||
}*/
|
||||
@Inject(method = "readNbt", at = @At("HEAD"))
|
||||
public void debug(NbtCompound nbt, CallbackInfo ci) {
|
||||
if ((Object) this instanceof MinionFakePlayer) {
|
||||
System.out.println("readNBT");
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "setPos", at = @At("HEAD"))
|
||||
public void debug(double x, double y, double z, CallbackInfo ci) {
|
||||
if ((Object) this instanceof MinionFakePlayer) {
|
||||
System.out.println("Set Minion Pos to " + x + " " + y + " " + z);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package io.github.skippyall.minions.mixins;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Mixin(value = GameProfile.class, remap = false)
|
||||
public interface GameProfileMixin{
|
||||
@Mutable
|
||||
@Accessor("id")
|
||||
void setId(UUID id);
|
||||
}
|
||||
@@ -14,6 +14,8 @@ import net.minecraft.server.network.ConnectedClientData;
|
||||
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.text.Text;
|
||||
import org.apache.logging.log4j.core.jmx.Server;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
Reference in New Issue
Block a user