From 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a Mon Sep 17 00:00:00 2001 From: Loki Rautio Date: Sat, 7 Mar 2026 21:12:22 -0600 Subject: Revert "Project modernization (#630)" This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817. --- Minecraft.World/Ocelot.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Minecraft.World/Ocelot.cpp') diff --git a/Minecraft.World/Ocelot.cpp b/Minecraft.World/Ocelot.cpp index 75c6e0f0..50285682 100644 --- a/Minecraft.World/Ocelot.cpp +++ b/Minecraft.World/Ocelot.cpp @@ -57,7 +57,7 @@ void Ocelot::defineSynchedData() { TamableAnimal::defineSynchedData(); - entityData->define(DATA_TYPE_ID, static_cast(0)); + entityData->define(DATA_TYPE_ID, (byte) 0); } void Ocelot::serverAiMobStep() @@ -199,7 +199,7 @@ bool Ocelot::mobInteract(shared_ptr player) } else { - if (temptGoal->isRunning() && item != nullptr && item->id == Item::fish_raw_Id && player->distanceToSqr(shared_from_this()) < 3 * 3) + if (temptGoal->isRunning() && item != NULL && item->id == Item::fish_raw_Id && player->distanceToSqr(shared_from_this()) < 3 * 3) { // 4J-PB - don't lose the fish in creative mode if (!player->abilities.instabuild) item->count--; @@ -240,7 +240,7 @@ shared_ptr Ocelot::getBreedOffspring(shared_ptr target) // 4J - added limit to number of animals that can be bred if( level->canCreateMore( GetType(), Level::eSpawnType_Breed) ) { - shared_ptr offspring = std::make_shared(level); + shared_ptr offspring = shared_ptr( new Ocelot(level) ); if (isTame()) { offspring->setOwnerUUID(getOwnerUUID()); @@ -257,7 +257,7 @@ shared_ptr Ocelot::getBreedOffspring(shared_ptr target) bool Ocelot::isFood(shared_ptr itemInstance) { - return itemInstance != nullptr && itemInstance->id == Item::fish_raw_Id; + return itemInstance != NULL && itemInstance->id == Item::fish_raw_Id; } bool Ocelot::canMate(shared_ptr animal) @@ -266,7 +266,7 @@ bool Ocelot::canMate(shared_ptr animal) if (!isTame()) return false; shared_ptr partner = dynamic_pointer_cast(animal); - if (partner == nullptr) return false; + if (partner == NULL) return false; if (!partner->isTame()) return false; return isInLove() && partner->isInLove(); @@ -279,7 +279,7 @@ int Ocelot::getCatType() void Ocelot::setCatType(int type) { - entityData->set(DATA_TYPE_ID, static_cast(type)); + entityData->set(DATA_TYPE_ID, (byte) type); } bool Ocelot::canSpawn() @@ -339,7 +339,7 @@ MobGroupData *Ocelot::finalizeMobSpawn(MobGroupData *groupData, int extraData /* { for (int kitten = 0; kitten < 2; kitten++) { - shared_ptr ocelot = std::make_shared(level); + shared_ptr ocelot = shared_ptr( new Ocelot(level) ); ocelot->moveTo(x, y, z, yRot, 0); ocelot->setAge(-20 * 60 * 20); level->addEntity(ocelot); @@ -351,7 +351,7 @@ MobGroupData *Ocelot::finalizeMobSpawn(MobGroupData *groupData, int extraData /* void Ocelot::setSittingOnTile(bool val) { byte current = entityData->getByte(DATA_FLAGS_ID); - entityData->set(DATA_FLAGS_ID, val ? static_cast(current | 0x02) : static_cast(current & ~0x02) ); + entityData->set(DATA_FLAGS_ID, val ? (byte) (current | 0x02) : (byte) (current & ~0x02) ); } bool Ocelot::isSittingOnTile() -- cgit v1.2.3