aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/EnderCrystal.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-04 03:56:03 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-04 03:56:03 -0600
commit42aec6dac53dffa6afe072560a7e1d4986112538 (patch)
tree0836426857391df1b6a83f6368a183f83ec9b104 /Minecraft.World/EnderCrystal.cpp
parentc9d58eeac7c72f0b3038e084667b4d89a6249fce (diff)
parentef9b6fd500dfabd9463267b0dd9e29577eea8a2b (diff)
Merge branch 'main' into pr/win64-world-saves
# Conflicts: # Minecraft.Client/MinecraftServer.cpp # README.md
Diffstat (limited to 'Minecraft.World/EnderCrystal.cpp')
-rw-r--r--Minecraft.World/EnderCrystal.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Minecraft.World/EnderCrystal.cpp b/Minecraft.World/EnderCrystal.cpp
index 719e9d96..78e00419 100644
--- a/Minecraft.World/EnderCrystal.cpp
+++ b/Minecraft.World/EnderCrystal.cpp
@@ -63,7 +63,7 @@ void EnderCrystal::tick()
int zt = Mth::floor(z);
if (level->getTile(xt, yt, zt) != Tile::fire_Id)
{
- level->setTile(xt, yt, zt, Tile::fire_Id);
+ level->setTileAndUpdate(xt, yt, zt, Tile::fire_Id);
}
}
}
@@ -88,12 +88,12 @@ bool EnderCrystal::isPickable()
return true;
}
-bool EnderCrystal::hurt(DamageSource *source, int damage)
+bool EnderCrystal::hurt(DamageSource *source, float damage)
{
- // 4J-PB - if the owner of the source is the enderdragon, then ignore it (where the dragon's fireball hits an endercrystal)
- shared_ptr<EnderDragon> sourceIsDragon = dynamic_pointer_cast<EnderDragon>(source->getEntity());
+ if (isInvulnerable()) return false;
- if(sourceIsDragon!=NULL)
+ // 4J-PB - if the owner of the source is the enderdragon, then ignore it (where the dragon's fireball hits an endercrystal)
+ if ( source->getEntity() != NULL && source->getEntity()->instanceof(eTYPE_ENDERDRAGON) )
{
return false;
}