Use BigDecimal to store player position.

remove-fringelands
mckuhei 2 years ago
parent fd71b03b72
commit 69d65bf991

@ -1020,6 +1020,11 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
this.experience = par1NBTTagCompound.getFloat("XpP");
this.experienceLevel = par1NBTTagCompound.getInteger("XpLevel");
this.experienceTotal = par1NBTTagCompound.getInteger("XpTotal");
if(par1NBTTagCompound.hasKey("PosXBig")) {
this.posXBig = par1NBTTagCompound.getBigDecimal("PosXBig");
this.posXBig = par1NBTTagCompound.getBigDecimal("PosXBig");
setPosition(posXBig, posY, posZBig);
}
if (this.sleeping)
{
@ -1055,6 +1060,8 @@ public abstract class EntityPlayer extends EntityLiving implements ICommandSende
par1NBTTagCompound.setFloat("XpP", this.experience);
par1NBTTagCompound.setInteger("XpLevel", this.experienceLevel);
par1NBTTagCompound.setInteger("XpTotal", this.experienceTotal);
par1NBTTagCompound.setBigDecimal("PosXBig", posXBig);
par1NBTTagCompound.setBigDecimal("PosZBig", posZBig);
if (this.spawnChunk != null)
{

@ -3,6 +3,8 @@ package net.minecraft.src;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.math.BigDecimal;
import org.mcmodule.math.BigInteger;
import java.util.Collection;
import java.util.HashMap;
@ -326,8 +328,17 @@ public class NBTTagCompound extends NBTBase
if(value == null) value = BigInteger.ZERO;
setString(key, value.toString());
}
public void setBigDecimal(String key, BigDecimal value) {
if(value == null) value = BigDecimal.ZERO;
setString(key, value.toString());
}
public BigInteger getBigInteger(String key) {
return new BigInteger(getString(key));
}
public BigDecimal getBigDecimal(String key) {
return new BigDecimal(getString(key));
}
}

@ -74,7 +74,7 @@ public abstract class ServerConfigurationManager
this.sendTimeAndRainingToPlayer(par2EntityPlayerMP, var4);
this.sendPacketToAllPlayers(new Packet3Chat("\u00a7e" + par2EntityPlayerMP.username + " joined the game."));
this.func_72377_c(par2EntityPlayerMP);
var6.setPlayerLocation(par2EntityPlayerMP.posX, par2EntityPlayerMP.posY, par2EntityPlayerMP.posZ, par2EntityPlayerMP.rotationYaw, par2EntityPlayerMP.rotationPitch);
var6.setPlayerLocation(par2EntityPlayerMP.posXBig, par2EntityPlayerMP.posY, par2EntityPlayerMP.posZBig, par2EntityPlayerMP.rotationYaw, par2EntityPlayerMP.rotationPitch);
this.mcServer.getNetworkThread().func_71745_a(var6);
var6.sendPacketToPlayer(new Packet4UpdateTime(var4.getWorldTime()));

Loading…
Cancel
Save