TU19: merge Minecraft.World/Blocks

This commit is contained in:
Tropical
2026-03-21 15:52:50 -05:00
parent f25cd66f4d
commit 9b6046cb83
242 changed files with 8083 additions and 4657 deletions

View File

@@ -16,10 +16,21 @@ EnchantmentTableEntity::EnchantmentTableEntity() {
rot = 0.0f;
oRot = 0.0f;
tRot = 0.0f;
name = L"";
}
EnchantmentTableEntity::~EnchantmentTableEntity() { delete random; }
void EnchantmentTableEntity::save(CompoundTag* base) {
TileEntity::save(base);
if (hasCustomName()) base->putString(L"CustomName", name);
}
void EnchantmentTableEntity::load(CompoundTag* base) {
TileEntity::load(base);
if (base->contains(L"CustomName")) name = base->getString(L"CustomName");
}
void EnchantmentTableEntity::tick() {
TileEntity::tick();
oOpen = open;
@@ -72,6 +83,20 @@ void EnchantmentTableEntity::tick() {
flip = flip + flipA;
}
std::wstring EnchantmentTableEntity::getName() {
return hasCustomName() ? name : app.GetString(IDS_ENCHANT);
}
std::wstring EnchantmentTableEntity::getCustomName() {
return hasCustomName() ? name : L"";
}
bool EnchantmentTableEntity::hasCustomName() { return !name.empty(); }
void EnchantmentTableEntity::setCustomName(const std::wstring& name) {
this->name = name;
}
std::shared_ptr<TileEntity> EnchantmentTableEntity::clone() {
std::shared_ptr<EnchantmentTableEntity> result =
std::shared_ptr<EnchantmentTableEntity>(new EnchantmentTableEntity());