aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/TileEntity.cpp
diff options
context:
space:
mode:
authorqwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com>2026-03-05 17:17:45 -0600
committerGitHub <noreply@github.com>2026-03-05 17:17:45 -0600
commit0666959d312dc74903f55d1071488a90239330f1 (patch)
tree5c6886f7ec65a7828bc6e34a469514e418bcf78b /Minecraft.World/TileEntity.cpp
parent9370cbc7d878df1615d8ce76bc459e8b414d0f19 (diff)
parenteed770b121aa4ce38f002db042d0137c24c6d344 (diff)
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.World/TileEntity.cpp')
-rw-r--r--Minecraft.World/TileEntity.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/Minecraft.World/TileEntity.cpp b/Minecraft.World/TileEntity.cpp
index ded0c665..1eb9cab2 100644
--- a/Minecraft.World/TileEntity.cpp
+++ b/Minecraft.World/TileEntity.cpp
@@ -78,8 +78,8 @@ void TileEntity::load(CompoundTag *tag)
void TileEntity::save(CompoundTag *tag)
{
- AUTO_VAR(it, classIdMap.find( this->GetType() ));
- if ( it == classIdMap.end() )
+ auto it = classIdMap.find(this->GetType());
+ if ( it == classIdMap.end() )
{
// TODO 4J Stu - Some sort of exception handling
//throw new RuntimeException(this->getClass() + " is missing a mapping! This is a bug!");
@@ -98,17 +98,9 @@ void TileEntity::tick()
shared_ptr<TileEntity> TileEntity::loadStatic(CompoundTag *tag)
{
shared_ptr<TileEntity> entity = nullptr;
-
- //try
- //{
- AUTO_VAR(it, idCreateMap.find(tag->getString(L"id")));
- if (it != idCreateMap.end() ) entity = shared_ptr<TileEntity>(it->second());
- //}
- //catch (Exception e)
- //{
- // TODO 4J Stu - Exception handling?
- // e->printStackTrace();
- //}
+ auto it = idCreateMap.find(tag->getString(L"id"));
+ if (it != idCreateMap.end())
+ entity = shared_ptr<TileEntity>(it->second());
if (entity != NULL)
{
entity->load(tag);