This commit is contained in:
gnembon committed 2020-11-25 19:21:56 -04:00
1 parent 8a95db6400
commit 3aee1a7f7f
3 files changed
+8 -11

No files matched your search

+2 -2
View File
@@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use
# or better: https://modmuss50.me/fabric.html
minecraft_version=20w46a
yarn_mappings=20w46a+build.20
minecraft_version=20w48a
yarn_mappings=20w48a+build.1
loader_version=0.10.8
# Mod Properties
@@ -26,7 +26,6 @@ public abstract class ServerPlayerEntityMixin implements ServerPlayerEntityInter
MinecraftServer minecraftServer_1,
ServerWorld serverWorld_1,
GameProfile gameProfile_1,
ServerPlayerInteractionManager serverPlayerInteractionManager_1,
CallbackInfo ci)
{
this.actionPack = new EntityPlayerActionPack((ServerPlayerEntity) (Object) this);
@@ -32,7 +32,6 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
{
//prolly half of that crap is not necessary, but it works
ServerWorld worldIn = server.getWorld(dimensionId);
ServerPlayerInteractionManager interactionManagerIn = new ServerPlayerInteractionManager(worldIn);
GameProfile gameprofile = server.getUserCache().findByName(username);
if (gameprofile == null)
{
@@ -42,14 +41,14 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
{
gameprofile = SkullBlockEntity.loadProperties(gameprofile);
}
EntityPlayerMPFake instance = new EntityPlayerMPFake(server, worldIn, gameprofile, interactionManagerIn, false);
EntityPlayerMPFake instance = new EntityPlayerMPFake(server, worldIn, gameprofile, false);
instance.fixStartingPosition = () -> instance.refreshPositionAndAngles(d0, d1, d2, (float) yaw, (float) pitch);
server.getPlayerManager().onPlayerConnect(new NetworkManagerFake(NetworkSide.SERVERBOUND), instance);
instance.teleport(worldIn, d0, d1, d2, (float)yaw, (float)pitch);
instance.setHealth(20.0F);
instance.unsetRemoved();
instance.stepHeight = 0.6F;
interactionManagerIn.setGameMode(gamemode);
instance.interactionManager.setGameMode(gamemode);
server.getPlayerManager().sendToDimension(new EntitySetHeadYawS2CPacket(instance, (byte) (instance.headYaw * 256 / 360)), dimensionId);//instance.dimension);
server.getPlayerManager().sendToDimension(new EntityPositionS2CPacket(instance), dimensionId);//instance.dimension);
instance.getServerWorld().getChunkManager().updateCameraPosition(instance);
@@ -62,14 +61,13 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
player.getServer().getPlayerManager().remove(player);
player.networkHandler.disconnect(new TranslatableText("multiplayer.disconnect.duplicate_login"));
ServerWorld worldIn = player.getServerWorld();//.getWorld(player.dimension);
ServerPlayerInteractionManager interactionManagerIn = new ServerPlayerInteractionManager(worldIn);
GameProfile gameprofile = player.getGameProfile();
EntityPlayerMPFake playerShadow = new EntityPlayerMPFake(server, worldIn, gameprofile, interactionManagerIn, true);
EntityPlayerMPFake playerShadow = new EntityPlayerMPFake(server, worldIn, gameprofile, true);
server.getPlayerManager().onPlayerConnect(new NetworkManagerFake(NetworkSide.SERVERBOUND), playerShadow);
playerShadow.setHealth(player.getHealth());
playerShadow.networkHandler.requestTeleport(player.getX(), player.getY(), player.getZ(), player.yaw, player.pitch);
interactionManagerIn.setGameMode(player.interactionManager.getGameMode());
playerShadow.interactionManager.setGameMode(player.interactionManager.getGameMode());
((ServerPlayerEntityInterface) playerShadow).getActionPack().copyFrom(((ServerPlayerEntityInterface) player).getActionPack());
playerShadow.stepHeight = 0.6F;
playerShadow.dataTracker.set(PLAYER_MODEL_PARTS, player.getDataTracker().get(PLAYER_MODEL_PARTS));
@@ -81,9 +79,9 @@ public class EntityPlayerMPFake extends ServerPlayerEntity
return playerShadow;
}
private EntityPlayerMPFake(MinecraftServer server, ServerWorld worldIn, GameProfile profile, ServerPlayerInteractionManager interactionManagerIn, boolean shadow)
private EntityPlayerMPFake(MinecraftServer server, ServerWorld worldIn, GameProfile profile, boolean shadow)
{
super(server, worldIn, profile, interactionManagerIn);
super(server, worldIn, profile);
isAShadow = shadow;
}