summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Sheep.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-03-15 03:28:18 +0100
committerGitHub <noreply@github.com>2021-03-15 03:28:18 +0100
commit45591cbe7bef4c54c241a286ece07bc4ade4489e (patch)
treea6b2b8a7e8c2d2986612e70cd904f5446b82e2d6 /src/Mobs/Sheep.cpp
parentFixed some death messages showing up even when they are disabled. (#5153) (diff)
downloadcuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar
cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar.gz
cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar.bz2
cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar.lz
cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar.xz
cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar.zst
cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Sheep.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Mobs/Sheep.cpp b/src/Mobs/Sheep.cpp
index e208420db..0a3f68e96 100644
--- a/src/Mobs/Sheep.cpp
+++ b/src/Mobs/Sheep.cpp
@@ -113,11 +113,11 @@ void cSheep::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
if (m_TimeToStopEating == 0)
{
- if (m_World->GetBlock(PosX, PosY, PosZ) == E_BLOCK_GRASS) // Make sure grass hasn't been destroyed in the meantime
+ if (m_World->GetBlock({ PosX, PosY, PosZ }) == E_BLOCK_GRASS) // Make sure grass hasn't been destroyed in the meantime
{
// The sheep ate the grass so we change it to dirt
- m_World->SetBlock(PosX, PosY, PosZ, E_BLOCK_DIRT, 0);
- GetWorld()->BroadcastSoundParticleEffect(EffectID::PARTICLE_BLOCK_BREAK, {PosX, PosY, PosZ}, E_BLOCK_GRASS);
+ m_World->SetBlock({ PosX, PosY, PosZ }, E_BLOCK_DIRT, 0);
+ GetWorld()->BroadcastSoundParticleEffect(EffectID::PARTICLE_BLOCK_BREAK, { PosX, PosY, PosZ }, E_BLOCK_GRASS);
m_IsSheared = false;
m_World->BroadcastEntityMetadata(*this);
}
@@ -127,7 +127,7 @@ void cSheep::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
if (GetRandomProvider().RandBool(1.0 / 600.0))
{
- if (m_World->GetBlock(PosX, PosY, PosZ) == E_BLOCK_GRASS)
+ if (m_World->GetBlock({ PosX, PosY, PosZ }) == E_BLOCK_GRASS)
{
m_World->BroadcastEntityStatus(*this, esSheepEating);
m_TimeToStopEating = 40;