diff options
author | nshah25 <68348722+nshah25@users.noreply.github.com> | 2021-05-03 22:07:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-03 22:07:09 +0200 |
commit | 8be1dd54bb17b3ba3e20960aa3c3f696d09facf7 (patch) | |
tree | 334cf9a2c9f781816f8278c933d66a71bf5c7d88 /src/BlockEntities | |
parent | Style: specify include relativity (#5217) (diff) | |
download | cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar.gz cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar.bz2 cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar.lz cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar.xz cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.tar.zst cuberite-8be1dd54bb17b3ba3e20960aa3c3f696d09facf7.zip |
Diffstat (limited to 'src/BlockEntities')
-rw-r--r-- | src/BlockEntities/BeaconEntity.cpp | 4 | ||||
-rw-r--r-- | src/BlockEntities/BrewingstandEntity.cpp | 2 | ||||
-rw-r--r-- | src/BlockEntities/ChestEntity.cpp | 4 | ||||
-rw-r--r-- | src/BlockEntities/DropSpenserEntity.cpp | 4 | ||||
-rw-r--r-- | src/BlockEntities/EnderChestEntity.cpp | 2 | ||||
-rw-r--r-- | src/BlockEntities/FlowerPotEntity.cpp | 2 | ||||
-rw-r--r-- | src/BlockEntities/FurnaceEntity.cpp | 2 | ||||
-rw-r--r-- | src/BlockEntities/HopperEntity.cpp | 2 | ||||
-rw-r--r-- | src/BlockEntities/JukeboxEntity.cpp | 3 | ||||
-rw-r--r-- | src/BlockEntities/NoteEntity.cpp | 2 |
10 files changed, 14 insertions, 13 deletions
diff --git a/src/BlockEntities/BeaconEntity.cpp b/src/BlockEntities/BeaconEntity.cpp index 6a7916dd1..87d25e57a 100644 --- a/src/BlockEntities/BeaconEntity.cpp +++ b/src/BlockEntities/BeaconEntity.cpp @@ -206,7 +206,7 @@ void cBeaconEntity::UpdateBeacon(void) (std::abs(Distance.z) <= 20) ) { - a_Player.AwardAchievement(Statistic::AchFullBeacon); + a_Player.AwardAchievement(CustomStatistic::AchFullBeacon); } return false; } @@ -313,7 +313,7 @@ bool cBeaconEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) bool cBeaconEntity::UsedBy(cPlayer * a_Player) { - a_Player->GetStatManager().AddValue(Statistic::InteractWithBeacon); + a_Player->GetStatistics().Custom[CustomStatistic::InteractWithBeacon]++; cWindow * Window = GetWindow(); if (Window == nullptr) diff --git a/src/BlockEntities/BrewingstandEntity.cpp b/src/BlockEntities/BrewingstandEntity.cpp index bdac1b327..ff7b49821 100644 --- a/src/BlockEntities/BrewingstandEntity.cpp +++ b/src/BlockEntities/BrewingstandEntity.cpp @@ -145,7 +145,7 @@ bool cBrewingstandEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) bool cBrewingstandEntity::UsedBy(cPlayer * a_Player) { - a_Player->GetStatManager().AddValue(Statistic::InteractWithBrewingstand); + a_Player->GetStatistics().Custom[CustomStatistic::InteractWithBrewingstand]++; cWindow * Window = GetWindow(); if (Window == nullptr) diff --git a/src/BlockEntities/ChestEntity.cpp b/src/BlockEntities/ChestEntity.cpp index c2c31b30a..11146bf46 100644 --- a/src/BlockEntities/ChestEntity.cpp +++ b/src/BlockEntities/ChestEntity.cpp @@ -204,11 +204,11 @@ bool cChestEntity::UsedBy(cPlayer * a_Player) if (m_BlockType == E_BLOCK_CHEST) { - a_Player->GetStatManager().AddValue(Statistic::OpenChest); + a_Player->GetStatistics().Custom[CustomStatistic::OpenChest]++; } else // E_BLOCK_TRAPPED_CHEST { - a_Player->GetStatManager().AddValue(Statistic::TriggerTrappedChest); + a_Player->GetStatistics().Custom[CustomStatistic::TriggerTrappedChest]++; } auto & PrimaryChest = GetPrimaryChest(); diff --git a/src/BlockEntities/DropSpenserEntity.cpp b/src/BlockEntities/DropSpenserEntity.cpp index 814b0c147..b067e1081 100644 --- a/src/BlockEntities/DropSpenserEntity.cpp +++ b/src/BlockEntities/DropSpenserEntity.cpp @@ -163,11 +163,11 @@ bool cDropSpenserEntity::UsedBy(cPlayer * a_Player) { if (m_BlockType == E_BLOCK_DISPENSER) { - a_Player->GetStatManager().AddValue(Statistic::InspectDispenser); + a_Player->GetStatistics().Custom[CustomStatistic::InspectDispenser]++; } else // E_BLOCK_DROPPER { - a_Player->GetStatManager().AddValue(Statistic::InspectDropper); + a_Player->GetStatistics().Custom[CustomStatistic::InspectDropper]++; } cWindow * Window = GetWindow(); diff --git a/src/BlockEntities/EnderChestEntity.cpp b/src/BlockEntities/EnderChestEntity.cpp index efc5dce4f..ba9ca5609 100644 --- a/src/BlockEntities/EnderChestEntity.cpp +++ b/src/BlockEntities/EnderChestEntity.cpp @@ -62,7 +62,7 @@ bool cEnderChestEntity::UsedBy(cPlayer * a_Player) return false; } - a_Player->GetStatManager().AddValue(Statistic::OpenEnderchest); + a_Player->GetStatistics().Custom[CustomStatistic::OpenEnderchest]++; // If the window is not created, open it anew: cWindow * Window = GetWindow(); diff --git a/src/BlockEntities/FlowerPotEntity.cpp b/src/BlockEntities/FlowerPotEntity.cpp index bc936c246..df14acc8e 100644 --- a/src/BlockEntities/FlowerPotEntity.cpp +++ b/src/BlockEntities/FlowerPotEntity.cpp @@ -50,7 +50,7 @@ bool cFlowerPotEntity::UsedBy(cPlayer * a_Player) return false; } - a_Player->GetStatManager().AddValue(Statistic::PotFlower); + a_Player->GetStatistics().Custom[CustomStatistic::PotFlower]++; cItem SelectedItem = a_Player->GetInventory().GetEquippedItem(); if (IsFlower(SelectedItem.m_ItemType, SelectedItem.m_ItemDamage)) diff --git a/src/BlockEntities/FurnaceEntity.cpp b/src/BlockEntities/FurnaceEntity.cpp index d36b19791..8ca539170 100644 --- a/src/BlockEntities/FurnaceEntity.cpp +++ b/src/BlockEntities/FurnaceEntity.cpp @@ -127,7 +127,7 @@ bool cFurnaceEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) bool cFurnaceEntity::UsedBy(cPlayer * a_Player) { - a_Player->GetStatManager().AddValue(Statistic::InteractWithFurnace); + a_Player->GetStatistics().Custom[CustomStatistic::InteractWithFurnace]++; cWindow * Window = GetWindow(); if (Window == nullptr) diff --git a/src/BlockEntities/HopperEntity.cpp b/src/BlockEntities/HopperEntity.cpp index 82e07f6a0..1e5c59c94 100644 --- a/src/BlockEntities/HopperEntity.cpp +++ b/src/BlockEntities/HopperEntity.cpp @@ -113,7 +113,7 @@ void cHopperEntity::SendTo(cClientHandle & a_Client) bool cHopperEntity::UsedBy(cPlayer * a_Player) { - a_Player->GetStatManager().AddValue(Statistic::InspectHopper); + a_Player->GetStatistics().Custom[CustomStatistic::InspectHopper]++; // If the window is not created, open it anew: cWindow * Window = GetWindow(); diff --git a/src/BlockEntities/JukeboxEntity.cpp b/src/BlockEntities/JukeboxEntity.cpp index b99d9d39c..065f9cb46 100644 --- a/src/BlockEntities/JukeboxEntity.cpp +++ b/src/BlockEntities/JukeboxEntity.cpp @@ -65,7 +65,8 @@ bool cJukeboxEntity::UsedBy(cPlayer * a_Player) const cItem & HeldItem = a_Player->GetEquippedItem(); if (PlayRecord(HeldItem.m_ItemType)) { - a_Player->GetStatManager().AddValue(Statistic::PlayRecord); + a_Player->GetStatistics().Custom[CustomStatistic::PlayRecord]++; + if (!a_Player->IsGameModeCreative()) { a_Player->GetInventory().RemoveOneEquippedItem(); diff --git a/src/BlockEntities/NoteEntity.cpp b/src/BlockEntities/NoteEntity.cpp index 419d084b2..b4696f7b1 100644 --- a/src/BlockEntities/NoteEntity.cpp +++ b/src/BlockEntities/NoteEntity.cpp @@ -34,7 +34,7 @@ void cNoteEntity::CopyFrom(const cBlockEntity & a_Src) bool cNoteEntity::UsedBy(cPlayer * a_Player) { - a_Player->GetStatManager().AddValue(Statistic::TuneNoteblock); + a_Player->GetStatistics().Custom[CustomStatistic::TuneNoteblock]++; IncrementNote(); MakeSound(); return true; |