summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2017-09-08 15:39:40 +0200
committerLogicParrot <LogicParrot@users.noreply.github.com>2017-09-08 15:39:40 +0200
commit9ab5627a393a0b178f13fbba2c39463cfe0675b8 (patch)
tree1f89501893f02a6e711e5a31868a8acdb4ca7de5 /src/Entities/Player.cpp
parentd (diff)
parentShutdown connection when disconnect packet sent (#3999) (diff)
downloadcuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.gz
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.bz2
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.lz
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.xz
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.tar.zst
cuberite-9ab5627a393a0b178f13fbba2c39463cfe0675b8.zip
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r--src/Entities/Player.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 4189841b8..7aef38b93 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -2203,7 +2203,7 @@ bool cPlayer::LoadFromFile(const AString & a_FileName, cWorldPtr & a_World)
// Load the player stats.
// We use the default world name (like bukkit) because stats are shared between dimensions / worlds.
- cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats);
+ cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetDataPath(), GetName(), GetUUID().ToLongString(), &m_Stats);
StatSerializer.Load();
LOGD("Player %s was read from file \"%s\", spawning at {%.2f, %.2f, %.2f} in world \"%s\"",
@@ -2301,7 +2301,7 @@ bool cPlayer::SaveToDisk()
// Save the player stats.
// We use the default world name (like bukkit) because stats are shared between dimensions / worlds.
- cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetName(), GetName(), &m_Stats);
+ cStatSerializer StatSerializer(cRoot::Get()->GetDefaultWorld()->GetDataPath(), GetName(), GetUUID().ToLongString(), &m_Stats);
if (!StatSerializer.Save())
{
LOGWARNING("Could not save stats for player %s", GetName().c_str());
@@ -2352,23 +2352,6 @@ void cPlayer::UseEquippedItem(int a_Amount)
-void cPlayer::TickBurning(cChunk & a_Chunk)
-{
- // Don't burn in creative or spectator and stop burning in creative if necessary
- if (!IsGameModeCreative() && !IsGameModeSpectator())
- {
- super::TickBurning(a_Chunk);
- }
- else if (IsOnFire())
- {
- m_TicksLeftBurning = 0;
- OnFinishedBurning();
- }
-}
-
-
-
-
void cPlayer::HandleFood(void)
{
@@ -3018,4 +3001,3 @@ float cPlayer::GetPlayerRelativeBlockHardness(BLOCKTYPE a_Block)
// LOGD("blockHardness: %f, digSpeed: %f, canHarvestBlockDivisor: %f\n", blockHardness, digSpeed, canHarvestBlockDivisor);
return (blockHardness < 0) ? 0 : ((digSpeed / blockHardness) / canHarvestBlockDivisor);
}
-