lots of code

This commit is contained in:
skippyall
2024-04-13 22:04:49 +02:00
commit 60fd7f0891
71 changed files with 3667 additions and 0 deletions
@@ -0,0 +1,37 @@
package io.github.skippyall.minions.mixins;
import com.mojang.authlib.GameProfile;
import io.github.skippyall.minions.fakeplayer.EntityPlayerActionPack;
import io.github.skippyall.minions.fakeplayer.ServerPlayerInterface;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ClientInformation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ServerPlayer.class)
public abstract class ServerPlayerMixin implements ServerPlayerInterface {
@Unique
public EntityPlayerActionPack actionPack;
@Override
public EntityPlayerActionPack getActionPack()
{
return actionPack;
}
@Inject(method = "<init>", at = @At(value = "RETURN"))
private void onServerPlayerEntityContructor(MinecraftServer minecraftServer, ServerLevel serverLevel, GameProfile gameProfile, ClientInformation clientInformation, CallbackInfo ci)
{
this.actionPack = new EntityPlayerActionPack((ServerPlayer) (Object) this);
}
@Inject(method = "tick", at = @At(value = "HEAD"))
private void onTick(CallbackInfo ci)
{
actionPack.onUpdate();
}
}