This commit is contained in:
gnembon committed 2023-12-18 19:20:26 +01:00
1 parent ab79e76b51
commit d76d013acb
9 files changed
+58 -56

No files matched your search

@@ -22,6 +22,7 @@ import net.minecraft.server.players.GameProfileCache;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.food.FoodData;
import net.minecraft.world.item.ItemStack;
@@ -77,7 +78,7 @@ public class EntityPlayerMPFake extends ServerPlayer
instance.teleportTo(worldIn, pos.x, pos.y, pos.z, (float) yaw, (float) pitch);
instance.setHealth(20.0F);
instance.unsetRemoved();
instance.setMaxUpStep(0.6F);
instance.getAttribute(Attributes.STEP_HEIGHT).setBaseValue(0.6F);
instance.gameMode.changeGameModeForPlayer(gamemode);
server.getPlayerList().broadcastAll(new ClientboundRotateHeadPacket(instance, (byte) (instance.yHeadRot * 256 / 360)), dimensionId);//instance.dimension);
server.getPlayerList().broadcastAll(new ClientboundTeleportEntityPacket(instance), dimensionId);//instance.dimension);
@@ -106,7 +107,8 @@ public class EntityPlayerMPFake extends ServerPlayer
playerShadow.connection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot());
playerShadow.gameMode.changeGameModeForPlayer(player.gameMode.getGameModeForPlayer());
((ServerPlayerInterface) playerShadow).getActionPack().copyFrom(((ServerPlayerInterface) player).getActionPack());
playerShadow.setMaxUpStep(0.6F);
// this might create problems if a player logs back in...
playerShadow.getAttribute(Attributes.STEP_HEIGHT).setBaseValue(0.6F);
playerShadow.entityData.set(DATA_PLAYER_MODE_CUSTOMISATION, player.getEntityData().get(DATA_PLAYER_MODE_CUSTOMISATION));