aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ItemEntity.cpp
diff options
context:
space:
mode:
authorvoid_17 <61356189+void2012@users.noreply.github.com>2026-03-06 02:11:18 +0700
committerGitHub <noreply@github.com>2026-03-06 02:11:18 +0700
commit55231bb8d3e1a4e2752ac3d444c4287eb0ca4e8b (patch)
tree953c537a5c66e328e9f4ab29626cf738112d53c0 /Minecraft.World/ItemEntity.cpp
parent7d6658fe5b3095f35093701b5ab669ffc291e875 (diff)
Remove AUTO_VAR macro and _toString function (#592)
Diffstat (limited to 'Minecraft.World/ItemEntity.cpp')
-rw-r--r--Minecraft.World/ItemEntity.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Minecraft.World/ItemEntity.cpp b/Minecraft.World/ItemEntity.cpp
index e6bdffa5..66d271f7 100644
--- a/Minecraft.World/ItemEntity.cpp
+++ b/Minecraft.World/ItemEntity.cpp
@@ -72,7 +72,7 @@ void ItemEntity::defineSynchedData()
void ItemEntity::tick()
{
Entity::tick();
-
+
if (throwTime > 0) throwTime--;
xo = x;
yo = y;
@@ -80,7 +80,7 @@ void ItemEntity::tick()
yd -= 0.04f;
noPhysics = checkInTile(x, (bb->y0 + bb->y1) / 2, z);
-
+
// 4J - added parameter here so that these don't care about colliding with other entities
move(xd, yd, zd, true);
@@ -133,11 +133,11 @@ void ItemEntity::tick()
}
void ItemEntity::mergeWithNeighbours()
-{
+{
vector<shared_ptr<Entity> > *neighbours = level->getEntitiesOfClass(typeid(*this), bb->grow(0.5, 0, 0.5));
- for(AUTO_VAR(it, neighbours->begin()); it != neighbours->end(); ++it)
+ for(auto& neighbour : *neighbours)
{
- shared_ptr<ItemEntity> entity = dynamic_pointer_cast<ItemEntity>(*it);
+ shared_ptr<ItemEntity> entity = dynamic_pointer_cast<ItemEntity>(neighbour);
merge(entity);
}
delete neighbours;
@@ -189,7 +189,7 @@ bool ItemEntity::hurt(DamageSource *source, float damage)
// 4J - added next line: found whilst debugging an issue with item entities getting into a bad state when being created by a cactus, since entities insides cactuses get hurt
// and therefore depending on the timing of things they could get removed from the client when they weren't supposed to be. Are there really any cases were we would want
// an itemEntity to be locally hurt?
- if (level->isClientSide ) return false;
+ if (level->isClientSide ) return false;
if (isInvulnerable()) return false;
if (getItem() != NULL && getItem()->id == Item::netherStar_Id && source->isExplosion()) return false;
@@ -253,7 +253,7 @@ void ItemEntity::playerTouch(shared_ptr<Player> player)
}
#endif
}
- if (item->id == Item::blazeRod_Id)
+ if (item->id == Item::blazeRod_Id)
player->awardStat(GenericStats::blazeRod(), GenericStats::param_blazeRod());
playSound(eSoundType_RANDOM_POP, 0.2f, ((random->nextFloat() - random->nextFloat()) * 0.7f + 1.0f) * 2.0f);