diff --git a/Minecraft.Client/ArrowRenderer.cpp b/Minecraft.Client/ArrowRenderer.cpp index ac59f062..cc7140ef 100644 --- a/Minecraft.Client/ArrowRenderer.cpp +++ b/Minecraft.Client/ArrowRenderer.cpp @@ -4,6 +4,8 @@ #include "../Minecraft.World/Mth.h" ResourceLocation ArrowRenderer::ARROW_LOCATION = ResourceLocation(TN_ITEM_ARROWS); +ResourceLocation ArrowRenderer::SPECTRAL_ARROW_LOCATION = ResourceLocation(TN_ITEM_SPECTRAL_ARROW); +ResourceLocation ArrowRenderer::TIPPED_ARROW_LOCATION = ResourceLocation(TN_ITEM_TIPPED_ARROW); void ArrowRenderer::render(shared_ptr _arrow, double x, double y, double z, float rot, float a) { @@ -89,5 +91,11 @@ void ArrowRenderer::render(shared_ptr _arrow, double x, double y, double ResourceLocation *ArrowRenderer::getTextureLocation(shared_ptr mob) { + shared_ptr arrow = dynamic_pointer_cast(mob); + if (arrow != nullptr) + { + if (arrow->getArrowType() == Arrow::TYPE_SPECTRAL) return &SPECTRAL_ARROW_LOCATION; + if (arrow->getArrowType() == Arrow::TYPE_TIPPED) return &TIPPED_ARROW_LOCATION; + } return &ARROW_LOCATION; } \ No newline at end of file diff --git a/Minecraft.Client/ArrowRenderer.h b/Minecraft.Client/ArrowRenderer.h index 95867f5e..ace99d20 100644 --- a/Minecraft.Client/ArrowRenderer.h +++ b/Minecraft.Client/ArrowRenderer.h @@ -5,6 +5,8 @@ class ArrowRenderer : public EntityRenderer { private: static ResourceLocation ARROW_LOCATION; + static ResourceLocation SPECTRAL_ARROW_LOCATION; + static ResourceLocation TIPPED_ARROW_LOCATION; public: virtual void render(shared_ptr _arrow, double x, double y, double z, float rot, float a); diff --git a/Minecraft.Client/BoatModel.cpp b/Minecraft.Client/BoatModel.cpp index 5a55e7e8..d8b534b8 100644 --- a/Minecraft.Client/BoatModel.cpp +++ b/Minecraft.Client/BoatModel.cpp @@ -1,51 +1,107 @@ #include "stdafx.h" #include "BoatModel.h" +#include "../Minecraft.World/Boat.h" +#include "../Minecraft.World/Mth.h" + +static float clampedLerp(float from, float to, float t) +{ + if (t < 0.0f) return from; + if (t > 1.0f) return to; + return from + (to - from) * t; +} + +ModelPart *BoatModel::makePaddle(bool isLeft) +{ + ModelPart *paddle = new ModelPart(this, 62, isLeft ? 0 : 20); + paddle->setTexSize(128, 64); + paddle->addBox(-1.0f, 0.0f, -5.0f, 2, 2, 18); + paddle->addBox(isLeft ? -1.001f : 0.001f, -3.0f, 8.0f, 1, 6, 7); + return paddle; +} BoatModel::BoatModel() : Model() { - cubes[0] = new ModelPart(this, 0, 8); - cubes[1] = new ModelPart(this, 0, 0); - cubes[2] = new ModelPart(this, 0, 0); - cubes[3] = new ModelPart(this, 0, 0); - cubes[4] = new ModelPart(this, 0, 0); + texWidth = 128; + texHeight = 64; - int w = 24; - int d = 6; - int h = 20; - int yOff = 4; + bottom = new ModelPart(this, 0, 0); + back = new ModelPart(this, 0, 19); + front = new ModelPart(this, 0, 27); + right = new ModelPart(this, 0, 35); + left = new ModelPart(this, 0, 43); - cubes[0]->addBox(static_cast(-w / 2), static_cast(-h / 2 + 2), -3, w, h - 4, 4, 0); - cubes[0]->setPos(0, static_cast(0 + yOff), 0); - - cubes[1]->addBox(static_cast(-w / 2 + 2), static_cast(-d - 1), -1, w - 4, d, 2, 0); - cubes[1]->setPos(static_cast(-w / 2 + 1), static_cast(0 + yOff), 0); - - cubes[2]->addBox(static_cast(-w / 2 + 2), static_cast(-d - 1), -1, w - 4, d, 2, 0); - cubes[2]->setPos(static_cast(+w / 2 - 1), static_cast(0 + yOff), 0); - - cubes[3]->addBox(static_cast(-w / 2 + 2), static_cast(-d - 1), -1, w - 4, d, 2, 0); - cubes[3]->setPos(0, static_cast(0 + yOff), static_cast(-h / 2 + 1)); - - cubes[4]->addBox(static_cast(-w / 2 + 2), static_cast(-d - 1), -1, w - 4, d, 2, 0); - cubes[4]->setPos(0, static_cast(0 + yOff), static_cast(+h / 2 - 1)); - - cubes[0]->xRot = PI / 2; - cubes[1]->yRot = PI / 2 * 3; - cubes[2]->yRot = PI / 2 * 1; - cubes[3]->yRot = PI / 2 * 2; + bottom->addBox(-14.0f, -9.0f, -3.0f, 28, 16, 3, 0.0f); + bottom->setPos(0.0f, 3.0f, 1.0f); + back->addBox(-13.0f, -7.0f, -1.0f, 18, 6, 2, 0.0f); + back->setPos(-15.0f, 4.0f, 4.0f); + front->addBox(-8.0f, -7.0f, -1.0f, 16, 6, 2, 0.0f); + front->setPos(15.0f, 4.0f, 0.0f); + right->addBox(-14.0f, -7.0f, -1.0f, 28, 6, 2, 0.0f); + right->setPos(0.0f, 4.0f, -9.0f); + left->addBox(-14.0f, -7.0f, -1.0f, 28, 6, 2, 0.0f); + left->setPos(0.0f, 4.0f, 9.0f); + + bottom->xRot = PI / 2; + back->yRot = PI / 2 * 3; + front->yRot = PI / 2; + right->yRot = PI; + + paddleLeft = makePaddle(true); + paddleLeft->setPos(3.0f, -5.0f, 9.0f); + paddleRight = makePaddle(false); + paddleRight->setPos(3.0f, -5.0f, -9.0f); + paddleRight->yRot = PI; + paddleLeft->zRot = PI / 16; + paddleRight->zRot = PI / 16; + + waterPatch = new ModelPart(this, 0, 0); + waterPatch->setTexSize(128, 64); + waterPatch->addBox(-14.0f, -9.0f, -3.0f, 28, 16, 3, 0.0f); + waterPatch->setPos(0.0f, -3.0f, 1.0f); + waterPatch->xRot = PI / 2; // 4J added - compile now to avoid random performance hit first time cubes are rendered - cubes[0]->compile(1.0f/16.0f); - cubes[1]->compile(1.0f/16.0f); - cubes[2]->compile(1.0f/16.0f); - cubes[3]->compile(1.0f/16.0f); - cubes[4]->compile(1.0f/16.0f); + bottom->compile(1.0f / 16.0f); + back->compile(1.0f / 16.0f); + front->compile(1.0f / 16.0f); + right->compile(1.0f / 16.0f); + left->compile(1.0f / 16.0f); + paddleLeft->compile(1.0f / 16.0f); + paddleRight->compile(1.0f / 16.0f); + waterPatch->compile(1.0f / 16.0f); +} + +void BoatModel::animatePaddle(ModelPart *paddle, float rowingTime, int side, float scale, bool usecompiled) +{ + paddle->xRot = clampedLerp(-PI / 3, -PI / 12, (Mth::sin(-rowingTime) + 1.0f) / 2.0f); + paddle->yRot = clampedLerp(-PI / 4, PI / 4, (Mth::sin(-rowingTime + 1.0f) + 1.0f) / 2.0f); + if (side == 1) + { + paddle->yRot = PI - paddle->yRot; + } + paddle->render(scale, usecompiled); } void BoatModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) { - for (int i = 0; i < 5; i++) - { - cubes[i]->render(scale, usecompiled); - } -} \ No newline at end of file + glRotatef(90.0f, 0.0f, 1.0f, 0.0f); + + bottom->render(scale, usecompiled); + back->render(scale, usecompiled); + front->render(scale, usecompiled); + right->render(scale, usecompiled); + left->render(scale, usecompiled); + + shared_ptr boat = dynamic_pointer_cast(entity); + float a = time; + animatePaddle(paddleLeft, boat != nullptr ? boat->getRowingTime(0, a) : 0.0f, 0, scale, usecompiled); + animatePaddle(paddleRight, boat != nullptr ? boat->getRowingTime(1, a) : 0.0f, 1, scale, usecompiled); +} + +void BoatModel::renderWaterPatch(float scale, bool usecompiled) +{ + glRotatef(90.0f, 0.0f, 1.0f, 0.0f); + glColorMask(false, false, false, false); + waterPatch->render(scale, usecompiled); + glColorMask(true, true, true, true); +} diff --git a/Minecraft.Client/BoatModel.h b/Minecraft.Client/BoatModel.h index 4298b643..12dbfd95 100644 --- a/Minecraft.Client/BoatModel.h +++ b/Minecraft.Client/BoatModel.h @@ -5,7 +5,20 @@ class BoatModel : public Model { public: - ModelPart *cubes[5]; - BoatModel(); - virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); -}; \ No newline at end of file + ModelPart *bottom; + ModelPart *back; + ModelPart *front; + ModelPart *right; + ModelPart *left; + ModelPart *paddleLeft; + ModelPart *paddleRight; + ModelPart *waterPatch; + + BoatModel(); + virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); + void renderWaterPatch(float scale, bool usecompiled); + +private: + ModelPart *makePaddle(bool isLeft); + void animatePaddle(ModelPart *paddle, float rowingTime, int side, float scale, bool usecompiled); +}; diff --git a/Minecraft.Client/BoatRenderer.cpp b/Minecraft.Client/BoatRenderer.cpp index a3eec3c0..8bc1adc8 100644 --- a/Minecraft.Client/BoatRenderer.cpp +++ b/Minecraft.Client/BoatRenderer.cpp @@ -4,7 +4,17 @@ #include "../Minecraft.World/net.minecraft.world.entity.item.h" #include "../Minecraft.World/Mth.h" -ResourceLocation BoatRenderer::BOAT_LOCATION = ResourceLocation(TN_ITEM_BOAT); +ResourceLocation BoatRenderer::BOAT_LOCATIONS[6] = +{ + ResourceLocation(TN_ITEM_BOAT_OAK), + ResourceLocation(TN_ITEM_BOAT_SPRUCE), + ResourceLocation(TN_ITEM_BOAT_BIRCH), + ResourceLocation(TN_ITEM_BOAT_JUNGLE), + ResourceLocation(TN_ITEM_BOAT_ACACIA), + ResourceLocation(TN_ITEM_BOAT_DARKOAK), +}; + +bool BoatRenderer::s_secondPass = false; BoatRenderer::BoatRenderer() : EntityRenderer() { @@ -18,9 +28,20 @@ void BoatRenderer::render(shared_ptr _boat, double x, double y, double z // do some casting around instead shared_ptr boat = dynamic_pointer_cast(_boat); - glPushMatrix(); + const float hullOffset = 0.375f - boat->heightOffset; + if (s_secondPass) + { + glPushMatrix(); + glTranslatef(static_cast(x), static_cast(y) + hullOffset, static_cast(z)); + glRotatef(180-rot, 0, 1, 0); + glScalef(-1, -1, 1); + static_cast(model)->renderWaterPatch(1 / 16.0f, true); + glPopMatrix(); + return; + } - glTranslatef(static_cast(x), static_cast(y), static_cast(z)); + glPushMatrix(); + glTranslatef(static_cast(x), static_cast(y) + hullOffset, static_cast(z)); glRotatef(180-rot, 0, 1, 0); float hurt = boat->getHurtTime() - a; @@ -31,17 +52,20 @@ void BoatRenderer::render(shared_ptr _boat, double x, double y, double z glRotatef(Mth::sin(hurt)*hurt*dmg/10*boat->getHurtDir(), 1, 0, 0); } - float ss = 12/16.0f; - glScalef(ss, ss, ss); - glScalef(1/ss, 1/ss, 1/ss); - bindTexture(boat); glScalef(-1, -1, 1); - model->render(boat, 0, 0, -0.1f, 0, 0, 1 / 16.0f, true); + model->render(boat, a, 0, -0.1f, 0, 0, 1 / 16.0f, true); glPopMatrix(); } ResourceLocation *BoatRenderer::getTextureLocation(shared_ptr mob) { - return &BOAT_LOCATION; -} \ No newline at end of file + shared_ptr boat = dynamic_pointer_cast(mob); + return &BOAT_LOCATIONS[boat != nullptr ? boat->getType() : 0]; +} + +void BoatRenderer::postRender(shared_ptr entity, double x, double y, double z, float rot, float a, bool bRenderPlayerShadow) +{ + if (s_secondPass) return; + EntityRenderer::postRender(entity, x, y, z, rot, a, bRenderPlayerShadow); +} diff --git a/Minecraft.Client/BoatRenderer.h b/Minecraft.Client/BoatRenderer.h index 9396b477..1d4938cc 100644 --- a/Minecraft.Client/BoatRenderer.h +++ b/Minecraft.Client/BoatRenderer.h @@ -4,13 +4,16 @@ class BoatRenderer : public EntityRenderer { private: - static ResourceLocation BOAT_LOCATION; + static ResourceLocation BOAT_LOCATIONS[6]; protected: Model *model; public: BoatRenderer(); + static bool s_secondPass; + virtual void render(shared_ptr boat, double x, double y, double z, float rot, float a); virtual ResourceLocation *getTextureLocation(shared_ptr mob); -}; \ No newline at end of file + virtual void postRender(shared_ptr entity, double x, double y, double z, float rot, float a, bool bRenderPlayerShadow); +}; diff --git a/Minecraft.Client/CMakeLists.txt b/Minecraft.Client/CMakeLists.txt index a5e22f1d..e8f0c38c 100644 --- a/Minecraft.Client/CMakeLists.txt +++ b/Minecraft.Client/CMakeLists.txt @@ -112,6 +112,15 @@ set(ASSET_FOLDER_PAIRS ) setup_asset_folder_copy(Minecraft.Client "${ASSET_FOLDER_PAIRS}") +set(SDL3_RUNTIME_DLL "${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/sdl/lib/x64/SDL3.dll") +if(EXISTS "${SDL3_RUNTIME_DLL}") + add_custom_command(TARGET Minecraft.Client POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${SDL3_RUNTIME_DLL}" "$" + COMMENT "Copying SDL3.dll into build folder..." + VERBATIM + ) +endif() + if(PLATFORM_NAME STREQUAL "Windows64") file(GLOB_RECURSE PANORAMA_XML_ASSETS CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}Media/**/panorama.xml" diff --git a/Minecraft.Client/ClientConnection.cpp b/Minecraft.Client/ClientConnection.cpp index 8ef643a6..86fad3ac 100644 --- a/Minecraft.Client/ClientConnection.cpp +++ b/Minecraft.Client/ClientConnection.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "../Minecraft.World/MoveVehiclePacket.h" #include "ClientConnection.h" #include "MultiPlayerLevel.h" #include "MultiPlayerLocalPlayer.h" @@ -381,7 +382,7 @@ void ClientConnection::handleLogin(shared_ptr packet) Level *dimensionLevel = minecraft->getLevel( packet->dimension ); if( dimensionLevel == nullptr ) { - level = new MultiPlayerLevel(this, new LevelSettings(packet->seed, GameType::byId(packet->gameType), false, packet->m_isHardcore, packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale), packet->dimension, packet->difficulty); + level = new MultiPlayerLevel(this, new LevelSettings(packet->seed, GameType::byId(packet->gameType), false, packet->m_isHardcore, packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale, packet->m_modernEnd), packet->dimension, packet->difficulty); // 4J Stu - We want to share the SavedDataStorage between levels int otherDimensionId = packet->dimension == 0 ? -1 : 0; @@ -451,7 +452,7 @@ void ClientConnection::handleLogin(shared_ptr packet) activeLevel = minecraft->getLevel(otherDimensionId); } - MultiPlayerLevel *dimensionLevel = new MultiPlayerLevel(this, new LevelSettings(packet->seed, GameType::byId(packet->gameType), false, packet->m_isHardcore, packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale), packet->dimension, packet->difficulty); + MultiPlayerLevel *dimensionLevel = new MultiPlayerLevel(this, new LevelSettings(packet->seed, GameType::byId(packet->gameType), false, packet->m_isHardcore, packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale, packet->m_modernEnd), packet->dimension, packet->difficulty); dimensionLevel->savedDataStorage = activeLevel->savedDataStorage; @@ -625,6 +626,13 @@ void ClientConnection::handleAddEntity(shared_ptr packet) case AddEntityPacket::BOAT: e = std::make_shared(level, x, y, z); break; + case AddEntityPacket::AREA_EFFECT_CLOUD: + e = std::make_shared(level, x, y, z); + break; + case AddEntityPacket::SHULKER_BULLET: + e = std::make_shared(level, x, y, z, packet->xa / 8000.0, packet->ya / 8000.0, packet->za / 8000.0); + packet->data = 0; + break; case AddEntityPacket::PRIMED_TNT: e = std::make_shared(level, x, y, z, std::shared_ptr()); break; @@ -2056,6 +2064,8 @@ void ClientConnection::handleChat(shared_ptr packet) // flag that a message is a death message bool bIsDeathMessage = (packet->m_messageType>=ChatPacket::e_ChatDeathInFire) && (packet->m_messageType<=ChatPacket::e_ChatDeathIndirectMagicItem); + if( bIsDeathMessage ) minecraft->gui->setLastDeathMessage(m_userIndex, message); + if( displayOnGui ) minecraft->gui->addMessage(message, m_userIndex, bIsDeathMessage); if (!displayOnGui && !message.empty()) minecraft->gui->setActionBarMessage(message); @@ -2669,6 +2679,17 @@ void ClientConnection::handleSetSpawn(shared_ptr packet) } +void ClientConnection::handleMoveVehicle(shared_ptr packet) +{ + shared_ptr player = Minecraft::GetInstance()->localplayers[m_userIndex]; + if (player == nullptr || player->riding == nullptr || !player->riding->instanceof(eTYPE_BOAT)) return; + shared_ptr boat = dynamic_pointer_cast(player->riding); + if (boat == nullptr || !boat->isLocallyDriven()) return; + boat->absMoveTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot); + boat->xd = boat->yd = boat->zd = 0; + send(std::make_shared(boat->x, boat->y, boat->z, boat->yRot, boat->xRot)); +} + void ClientConnection::handleEntityLinkPacket(shared_ptr packet) { shared_ptr sourceEntity = getEntity(packet->sourceId); @@ -2992,7 +3013,7 @@ void ClientConnection::handleRespawn(shared_ptr packet) MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->getLevel( packet->dimension ); if( dimensionLevel == nullptr ) { - dimensionLevel = new MultiPlayerLevel(this, new LevelSettings(packet->mapSeed, packet->playerGameType, false, packet->m_isHardcore, packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale), packet->dimension, packet->difficulty); + dimensionLevel = new MultiPlayerLevel(this, new LevelSettings(packet->mapSeed, packet->playerGameType, false, packet->m_isHardcore, packet->m_newSeaLevel, packet->m_pLevelType, packet->m_xzSize, packet->m_hellScale, packet->m_modernEnd), packet->dimension, packet->difficulty); // 4J Stu - We want to shared the savedDataStorage between both levels //if( dimensionLevel->savedDataStorage != nullptr ) @@ -3502,6 +3523,10 @@ void ClientConnection::handleTileEntityData(shared_ptr pac { dynamic_pointer_cast(te)->load(packet->tag); } + else if (packet->type == TileEntityDataPacket::TYPE_END_GATEWAY && dynamic_pointer_cast(te) != nullptr) + { + dynamic_pointer_cast(te)->load(packet->tag); + } } } } diff --git a/Minecraft.Client/ClientConnection.h b/Minecraft.Client/ClientConnection.h index 4e60b7d4..32d32dc1 100644 --- a/Minecraft.Client/ClientConnection.h +++ b/Minecraft.Client/ClientConnection.h @@ -108,6 +108,7 @@ public: virtual void handleSetTime(shared_ptr packet); virtual void handleSetSpawn(shared_ptr packet); virtual void handleEntityLinkPacket(shared_ptr packet); + virtual void handleMoveVehicle(shared_ptr packet); virtual void handleEntityEvent(shared_ptr packet); private: shared_ptr getEntity(int entityId); diff --git a/Minecraft.Client/Common/App_enums.h b/Minecraft.Client/Common/App_enums.h index 77a324a6..0982ec16 100644 --- a/Minecraft.Client/Common/App_enums.h +++ b/Minecraft.Client/Common/App_enums.h @@ -413,6 +413,10 @@ enum eMinecraftColour eMinecraftColour_Effect_HealthBoost, eMinecraftColour_Effect_Absoprtion, eMinecraftColour_Effect_Saturation, + eMinecraftColour_Effect_Glowing, + eMinecraftColour_Effect_Levitation, + eMinecraftColour_Effect_Luck, + eMinecraftColour_Effect_BadLuck, eMinecraftColour_Potion_BaseColour, @@ -572,6 +576,15 @@ enum eMinecraftColour eMinecraftColour_Mob_PolarBear_Colour1, eMinecraftColour_Mob_PolarBear_Colour2, + eMinecraftColour_Mob_SkeletonHorse_Colour1, + eMinecraftColour_Mob_SkeletonHorse_Colour2, + eMinecraftColour_Mob_Stray_Colour1, + eMinecraftColour_Mob_Stray_Colour2, + eMinecraftColour_Mob_Husk_Colour1, + eMinecraftColour_Mob_Husk_Colour2, + eMinecraftColour_Mob_Shulker_Colour1, + eMinecraftColour_Mob_Shulker_Colour2, + eMinecraftColour_Mob_Shulker_Shell, eMinecraftColour_COUNT, }; diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index dccf0787..031d3906 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -352,18 +352,13 @@ void SoundEngine::updateMiniAudio() ///////////////////////////////////////////// inline void SoundEngine::getGameModeMusicID(Minecraft* pMinecraft, unsigned int i) { - if (pMinecraft == nullptr || i > std::size(pMinecraft->localplayers)) return; - - const auto& localPlayer = pMinecraft->localplayers[i]; - if (localPlayer != nullptr && localPlayer->abilities.instabuild && localPlayer->abilities.mayfly) { - m_musicID = getMusicID(eMusicType_Creative); - } - // TODO(3UR): this is a part of minigames also in the future other minigame ids will need to be handled for now TU30 only checks for BATTLE - //else if (pMinecraft->GetCustomGameMode() && CustomGameModeInst::GetId() == EMiniGameId::BATTLE) // @3UR: thanks https://github.com/GRAnimated/MinecraftLCE/blob/6947670d152582457bfe02bd909ee30a7ab7eb55/src/Minecraft.World/net/minecraft/world/level/gamemode/minigames/EMiniGameId.h#L3 - // m_musicID = getMusicID(eMusicType_Battle); - else { - m_musicID = getMusicID(eMusicType_Overworld); - } + if (pMinecraft->localplayers[i] != nullptr && pMinecraft->localplayers[i]->abilities.instabuild && pMinecraft->localplayers[i]->abilities.mayfly) + m_musicID = getMusicID(eMusicType_Creative); + // TODO(3UR): this is a part of minigames also in the future other minigame ids will need to be handled for now TU30 only checks for BATTLE + //else if (pMinecraft->GetCustomGameMode() && CustomGameModeInst::GetId() == EMiniGameId::BATTLE) // @3UR: thanks https://github.com/GRAnimated/MinecraftLCE/blob/6947670d152582457bfe02bd909ee30a7ab7eb55/src/Minecraft.World/net/minecraft/world/level/gamemode/minigames/EMiniGameId.h#L3 + // m_musicID = getMusicID(eMusicType_Battle); + else + m_musicID = getMusicID(eMusicType_Overworld); } ///////////////////////////////////////////// diff --git a/Minecraft.Client/Common/Audio/SoundNames.cpp b/Minecraft.Client/Common/Audio/SoundNames.cpp index b142e85d..b25112e6 100644 --- a/Minecraft.Client/Common/Audio/SoundNames.cpp +++ b/Minecraft.Client/Common/Audio/SoundNames.cpp @@ -336,6 +336,47 @@ const WCHAR *ConsoleSoundEngine::wchSoundNames[eSoundType_MAX]= // painting sounds L"entity.painting.place", //eSoundType_ENTITY_PAINTING_PLACE, L"entity.painting.break", //eSoundType_ENTITY_PAINTING_BREAK, + + L"entity.shulker.ambient", + L"entity.shulker.close", + L"entity.shulker.death", + L"entity.shulker.hurt", + L"entity.shulker.hurt_closed", + L"entity.shulker.open", + L"entity.shulker.shoot", + L"entity.shulker_bullet.hit", + + L"entity.stray.idle", + L"entity.stray.hurt", + L"entity.stray.death", + L"entity.stray.step", + L"entity.husk.idle", + L"entity.husk.hurt", + L"entity.husk.death", + L"entity.husk.step", + L"block.chorus_flower.grow", + L"block.chorus_flower.death", + L"item.bottle.fill", + L"item.bottle.fill_dragonbreath", + L"block.wooden_door.open", + L"block.wooden_door.close", + L"block.iron_door.open", + L"block.iron_door.close", + L"block.wooden_trapdoor.open", + L"block.wooden_trapdoor.close", + L"block.iron_trapdoor.open", + L"block.iron_trapdoor.close", + L"block.fence_gate.open", + L"block.fence_gate.close", + L"block.enchantment_table.enchant", + L"block.waterlily.place", + L"item.bucket.empty", + L"item.bucket.empty_lava", + L"item.bucket.fill", + L"item.bucket.fill_lava", + L"item.hoe.till", + L"entity.boat.paddle_water", + L"entity.boat.paddle_land", }; diff --git a/Minecraft.Client/Common/Colours/ColourTable.cpp b/Minecraft.Client/Common/Colours/ColourTable.cpp index 7cbd849a..e6a99889 100644 --- a/Minecraft.Client/Common/Colours/ColourTable.cpp +++ b/Minecraft.Client/Common/Colours/ColourTable.cpp @@ -214,6 +214,10 @@ const wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] = L"Effect_HealthBoost", L"Effect_Absorption", L"Effect_Saturation", + L"Effect_Glowing", + L"Effect_Levitation", + L"Effect_Luck", + L"Effect_BadLuck", L"Potion_BaseColour", @@ -346,6 +350,15 @@ const wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] = L"Color_RenamedItemTitle", L"Mob_PolarBear_Colour1", L"Mob_PolarBear_Colour2", + L"Mob_SkeletonHorse_Colour1", + L"Mob_SkeletonHorse_Colour2", + L"Mob_Stray_Colour1", + L"Mob_Stray_Colour2", + L"Mob_Husk_Colour1", + L"Mob_Husk_Colour2", + L"Mob_Shulker_Colour1", + L"Mob_Shulker_Colour2", + L"Mob_Shulker_Shell", }; void ColourTable::staticCtor() diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 40310d75..3c4a0c2f 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -212,6 +212,7 @@ CMinecraftApp::CMinecraftApp() m_dwRequiredTexturePackID=0; m_bResetNether=false; + m_bResetEnd=false; m_seedOverride = 0; m_hasSeedOverride = false; @@ -9127,6 +9128,8 @@ wstring CMinecraftApp::getEntityName(eINSTANCEOF type) return app.GetString(IDS_ENDERMAN); case eTYPE_SILVERFISH: return app.GetString(IDS_SILVERFISH); + case eTYPE_SHULKER: + return app.GetString(IDS_SHULKER); case eTYPE_CAVESPIDER: return app.GetString(IDS_CAVE_SPIDER); case eTYPE_GHAST: diff --git a/Minecraft.Client/Common/Consoles_App.h b/Minecraft.Client/Common/Consoles_App.h index 840a882b..806dbd3e 100644 --- a/Minecraft.Client/Common/Consoles_App.h +++ b/Minecraft.Client/Common/Consoles_App.h @@ -742,6 +742,8 @@ public: void SetResetNether(bool bResetNether) {m_bResetNether=bResetNether;} bool GetResetNether() {return m_bResetNether;} + void SetResetEnd(bool bResetEnd) {m_bResetEnd=bResetEnd;} + bool GetResetEnd() {return m_bResetEnd;} bool CanRecordStatsAndAchievements(); // World seed from png image @@ -910,6 +912,7 @@ private: bool m_bResetNether; + bool m_bResetEnd; DWORD m_dwRequiredTexturePackID; #ifdef _XBOX_ONE vector m_vTMSPPData; diff --git a/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu1080.swf index 10c097dd..ad092f1c 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu1080.swf and b/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu480.swf b/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu480.swf index 1faa7a04..35dda994 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu480.swf and b/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu480.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu720.swf b/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu720.swf index c9e323dc..cddc9ce8 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu720.swf and b/Minecraft.Client/Common/Media/MediaWindows64/DeathMenu720.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/DeathMenuSplit1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/DeathMenuSplit1080.swf index b9aba4c0..78816c36 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/DeathMenuSplit1080.swf and b/Minecraft.Client/Common/Media/MediaWindows64/DeathMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/DeathMenuSplit720.swf b/Minecraft.Client/Common/Media/MediaWindows64/DeathMenuSplit720.swf index fd912891..6aa7373c 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/DeathMenuSplit720.swf and b/Minecraft.Client/Common/Media/MediaWindows64/DeathMenuSplit720.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu1080.swf b/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu1080.swf index 07d81207..aab3a49d 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu1080.swf and b/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu480.swf b/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu480.swf index 666f1127..6cc68b1a 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu480.swf and b/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu480.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu720.swf b/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu720.swf index e77beb4e..5862b2a1 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu720.swf and b/Minecraft.Client/Common/Media/MediaWindows64/LaunchMoreOptionsMenu720.swf differ diff --git a/Minecraft.Client/Common/Potion_Macros.h b/Minecraft.Client/Common/Potion_Macros.h index 165ba95f..9a13e5cb 100644 --- a/Minecraft.Client/Common/Potion_Macros.h +++ b/Minecraft.Client/Common/Potion_Macros.h @@ -16,6 +16,7 @@ #define MASK_INSTANTDAMAGE 0x200C #define MASK_WATERBREATHING 0x200F #define MASK_JUMPBOOST 0x200B +#define MASK_LUCK 0x2007 // note from fireblade: good luck here // if youre adding a new potion, i genuinely hope you know what youre doing @@ -49,6 +50,7 @@ #define MACRO_POTION_IS_INVISIBILITY(aux) ((aux & 0x200F) == MASK_INVISIBILITY) #define MACRO_POTION_IS_WATERBREATHING(aux) ((aux & 0x200F) == MASK_WATERBREATHING) #define MACRO_POTION_IS_JUMPBOOST(aux) ((aux & 0x200F) == MASK_JUMPBOOST) +#define MACRO_POTION_IS_LUCK(aux) ((aux & 0x200F) == MASK_LUCK) #define MACRO_POTION_IS_SPLASH(aux) ((aux & MASK_SPLASH) == MASK_SPLASH) #define MACRO_POTION_IS_BOTTLE(aux) ((aux & MASK_SPLASH) == 0) diff --git a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp index 02e7c0fe..ba638346 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp @@ -738,11 +738,11 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() { int iMissing = pRecipeIngredientsRequired[i].iIngValA[j]-iTotalCount; int iGridIndex=0; - while(iMissing!=0) + while(iMissing!=0 && iGridIndex<9) { // need to check if there is an aux val and match that if(((pRecipeIngredientsRequired[i].uiGridA[iGridIndex]&0x00FFFFFF)==pRecipeIngredientsRequired[i].iIngIDA[j]) && - ((pRecipeIngredientsRequired[i].iIngAuxValA[j]==Recipes::ANY_AUX_VALUE) ||(pRecipeIngredientsRequired[i].iIngAuxValA[j]== ((pRecipeIngredientsRequired[i].uiGridA[iGridIndex]&0xFF000000)>>24))) ) + ((pRecipeIngredientsRequired[i].iIngAuxValA[j]==Recipes::ANY_AUX_VALUE) ||((pRecipeIngredientsRequired[i].iIngAuxValA[j]&0xFF)== ((pRecipeIngredientsRequired[i].uiGridA[iGridIndex]&0xFF000000)>>24))) ) { // this grid entry is the ingredient we don't have enough of pRecipeIngredientsRequired[i].usBitmaskMissingGridIngredients[getPad()]|=1<>24; + for (int k = 0; k < pRecipeIngredientsRequired[iRecipy].iIngC; k++) + { + int fullAux = pRecipeIngredientsRequired[iRecipy].iIngAuxValA[k]; + if (pRecipeIngredientsRequired[iRecipy].iIngIDA[k] == id && fullAux != Recipes::ANY_AUX_VALUE && (fullAux & 0xFF) == iAuxVal) + { + iAuxVal = fullAux; + break; + } + } // 4J Stu - For clocks and compasses we set the aux value to a special one that signals we should use a default texture // rather than the dynamic one for the player diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp index ebd0c149..acbd1aea 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -12,6 +12,7 @@ #include "../../../Minecraft.World/net.minecraft.world.item.enchantment.h" #include "../../../Minecraft.World/net.minecraft.world.entity.h" #include "../../../Minecraft.World/net.minecraft.world.entity.animal.h" +#include "../../../Minecraft.World/Skeleton.h" #include "../../../Minecraft.World/JavaMath.h" // 4J JEV - Images for each tab. @@ -175,6 +176,8 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Tile::bone_block_Id) ITEM_AUX(Tile::quartz_block_Id,QuartzBlockTile::TYPE_CHISELED) ITEM_AUX(Tile::quartz_block_Id,QuartzBlockTile::TYPE_LINES_Y) + ITEM(Tile::purpur_block_Id) + ITEM(Tile::purpur_pillar_Id) ITEM(Tile::trapdoor_Id) ITEM(Tile::iron_trapdoor_Id) @@ -218,6 +221,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM_AUX(Tile::stone_slab_Id,StoneSlabTile::NETHERBRICK_SLAB) ITEM_AUX(Tile::stone_slab_Id,StoneSlabTile::QUARTZ_SLAB) ITEM_AUX(Tile::stone_slab2_Id ,StoneSlabTile2::RED_SANDSTONE_SLAB) + ITEM(Tile::purpur_slab_Id) ITEM(Tile::oak_stairs_Id) ITEM(Tile::birch_stairs_Id) ITEM(Tile::spruce_stairs_Id) @@ -231,6 +235,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Tile::sandstone_stairs_Id) ITEM(Tile::stairs_red_sandstone) ITEM(Tile::quartz_stairs_Id) + ITEM(Tile::purpur_stairs_Id) ITEM(Tile::hardened_clay_Id) ITEM_AUX(Tile::stained_hardened_clay_Id,14) // Red @@ -257,6 +262,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM_AUX(Item::skull_Id,SkullTileEntity::TYPE_ZOMBIE) ITEM_AUX(Item::skull_Id,SkullTileEntity::TYPE_CHAR) ITEM_AUX(Item::skull_Id,SkullTileEntity::TYPE_CREEPER) + ITEM_AUX(Item::skull_Id,SkullTileEntity::TYPE_DRAGON) ITEM_AUX(Tile::sponge_Id, 0) // dry sponge ITEM_AUX(Tile::sponge_Id, 1) // wet sponge ITEM(Tile::melon_block_Id) @@ -311,6 +317,9 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Tile::bookshelf_Id) ITEM(Item::flower_pot_Id) ITEM(Tile::hay_block_Id) + ITEM(Tile::chorus_flower_Id) + ITEM(Tile::chorus_plant_Id) + ITEM(Tile::end_rod_Id) ITEM_AUX(Tile::standing_banner_Id, 14) // Red ITEM_AUX(Tile::standing_banner_Id, 1) // Orange ITEM_AUX(Tile::standing_banner_Id, 4) // Yellow @@ -456,6 +465,11 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::tnt_minecart_Id) ITEM(Item::saddle_Id) ITEM(Item::boat_Id) + ITEM(Item::spruce_boat_Id) + ITEM(Item::birch_boat_Id) + ITEM(Item::jungle_boat_Id) + ITEM(Item::acacia_boat_Id) + ITEM(Item::dark_oak_boat_Id) ITEM(Item::elytra_Id) // Miscellaneous @@ -487,6 +501,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::eye_of_ender_Id) ITEM(Item::name_tag_Id) ITEM(Item::nether_star_Id) + ITEM(Item::end_crystal_Id) ITEM_AUX(Item::spawn_egg_Id, 50); // Creeper ITEM_AUX(Item::spawn_egg_Id, 51); // Skeleton ITEM_AUX(Item::spawn_egg_Id, 52); // Spider @@ -501,8 +516,11 @@ void IUIScene_CreativeMenu::staticCtor() ITEM_AUX(Item::spawn_egg_Id, 62); // Magma Cube ITEM_AUX(Item::spawn_egg_Id, 65); // Bat ITEM_AUX(Item::spawn_egg_Id, 66); // Witch + ITEM_AUX(Item::spawn_egg_Id, 51 | ((Skeleton::TYPE_STRAY + 1) << 12)); + ITEM_AUX(Item::spawn_egg_Id, 54 | (1 << 12)); ITEM_AUX(Item::spawn_egg_Id, 67); // Endermite + ITEM_AUX(Item::spawn_egg_Id, 69); ITEM_AUX(Item::spawn_egg_Id, 68); // Guardian ITEM_AUX(Item::spawn_egg_Id, 4); // Elder Guardian ITEM_AUX(Item::spawn_egg_Id, 90); // Pig @@ -517,6 +535,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM_AUX(Item::spawn_egg_Id, 100 | ((EntityHorse::TYPE_DONKEY + 1) << 12) ); // Donkey ITEM_AUX(Item::spawn_egg_Id, 100 | ((EntityHorse::TYPE_MULE + 1) << 12)); // Mule + ITEM_AUX(Item::spawn_egg_Id, 100 | ((EntityHorse::TYPE_SKELETON + 1) << 12)); ITEM_AUX(Item::spawn_egg_Id, 120); // Villager ITEM_AUX(Item::spawn_egg_Id, 101); // Rabbit Brown ITEM_AUX(Item::spawn_egg_Id, 107); // Polar Bear @@ -543,7 +562,6 @@ void IUIScene_CreativeMenu::staticCtor() DEF(eCreativeInventory_ArtToolsMisc) if(app.DebugSettingsOn()) { - ITEM_AUX(Item::spawn_egg_Id, 100 | ((EntityHorse::TYPE_SKELETON + 1) << 12)); // Skeleton ITEM_AUX(Item::spawn_egg_Id, 100 | ((EntityHorse::TYPE_UNDEAD + 1) << 12)); // Zombie ITEM_AUX(Item::spawn_egg_Id, 98 | ((Ocelot::TYPE_BLACK + 1) << 12)); ITEM_AUX(Item::spawn_egg_Id, 98 | ((Ocelot::TYPE_RED + 1) << 12)); @@ -591,6 +609,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::pumpkin_pie_Id) ITEM(Item::beetroot_Id) ITEM(Item::beetroot_soup_Id) + ITEM(Item::chorus_fruit_Id) // Tools, Armour and Weapons (Complete) DEF(eCreativeInventory_ToolsArmourWeapons) @@ -689,6 +708,38 @@ void IUIScene_CreativeMenu::staticCtor() #endif // Materials + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_NIGHTVISION)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INVISIBILITY)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_JUMPBOOST)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_FIRE_RESISTANCE)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SPEED)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SLOWNESS)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WATERBREATHING)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTHEALTH)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTDAMAGE)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_POISON)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_REGENERATION)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_STRENGTH)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WEAKNESS)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_LUCK)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_NIGHTVISION)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_INVISIBILITY)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_JUMPBOOST)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_FIRE_RESISTANCE)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SPEED)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SLOWNESS)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WATERBREATHING)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_POISON)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_REGENERATION)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_STRENGTH)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WEAKNESS)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_JUMPBOOST)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_SPEED)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTHEALTH)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTDAMAGE)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_POISON)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_REGENERATION)) + ITEM_AUX(Item::tipped_arrow_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_STRENGTH)) DEF(eCreativeInventory_Materials) ITEM(Item::coal_Id) ITEM_AUX(Item::coal_Id,1) @@ -724,6 +775,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::blaze_rod_Id) ITEM(Item::gold_nugget_Id) ITEM(Item::netherwart_seeds_Id) + ITEM(Item::chorus_fruit_popped_Id) ITEM_AUX(Item::dye_Id,1) // Red ITEM_AUX(Item::dye_Id,14) // Orange ITEM_AUX(Item::dye_Id,11) // Yellow @@ -741,11 +793,9 @@ void IUIScene_CreativeMenu::staticCtor() ITEM_AUX(Item::dye_Id,2) // Green ITEM_AUX(Item::dye_Id,3) // Brown - // Brewing (TODO) DEF(eCreativeInventory_Brewing) ITEM(Item::experience_bottle_Id) - - // 4J Stu - Anything else added here also needs to be added to the key handler below + ITEM(Item::dragon_breath_Id) ITEM(Item::ghast_tear_Id) ITEM(Item::fermented_spider_eye_Id) ITEM(Item::blaze_powder_Id) @@ -753,138 +803,115 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::speckled_melon_block_Id) ITEM(Item::rabbit_foot_Id) ITEM(Item::glass_bottle_Id) - ITEM_AUX(Item::potion_Id,0) // Water bottle - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_TYPE_AWKWARD)) // Awkward Potion - DEF(eCreativeInventory_Potions_Basic) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_REGENERATION)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SPEED)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_FIRE_RESISTANCE)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_POISON)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTHEALTH)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WEAKNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_STRENGTH)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SLOWNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTDAMAGE)) - // tu31 potions - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WATERBREATHING)) + ITEM_AUX(Item::potion_Id,0) // Water bottle + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_TYPE_AWKWARD)) // Awkward Potion + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_NIGHTVISION)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INVISIBILITY)) ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_JUMPBOOST)) - // end of tu31 potions - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_REGENERATION)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_SPEED)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_FIRE_RESISTANCE)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_POISON)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_INSTANTHEALTH)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_WEAKNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_STRENGTH)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_SLOWNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_INSTANTDAMAGE)) - // tu31 potions - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_WATERBREATHING)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_JUMPBOOST)) - // end of tu31 potions - - DEF(eCreativeInventory_Potions_Level2) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_REGENERATION)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_SPEED)) ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_FIRE_RESISTANCE)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_POISON)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTHEALTH)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_NIGHTVISION)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INVISIBILITY)) - - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WEAKNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_STRENGTH)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SPEED)) ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SLOWNESS)) - // tu31 potions - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_WATERBREATHING)) // i have no idea why water breathing had a level 2 version in the creative menu - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_JUMPBOOST)) - // end of tu31 potions - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTDAMAGE)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_REGENERATION)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_SPEED)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WATERBREATHING)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTHEALTH)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTDAMAGE)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_POISON)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_REGENERATION)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_STRENGTH)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WEAKNESS)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_LUCK)) + ITEM_AUX(Item::potion_Id,MASK_SPLASH) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_NIGHTVISION)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_INVISIBILITY)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_JUMPBOOST)) ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_FIRE_RESISTANCE)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_POISON)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTHEALTH)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_NIGHTVISION)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INVISIBILITY)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_WEAKNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_STRENGTH)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_SPEED)) ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_SLOWNESS)) - // tu31 potions - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_WATERBREATHING)) // i have no idea why water breathing had a level 2 version in the creative menu - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_JUMPBOOST)) - // end of tu31 potions - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTDAMAGE)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_WATERBREATHING)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_INSTANTHEALTH)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_INSTANTDAMAGE)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_POISON)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_REGENERATION)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_STRENGTH)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_WEAKNESS)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_LUCK)) + ITEM_AUX(Item::lingering_potion_Id,0) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_NIGHTVISION)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INVISIBILITY)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_JUMPBOOST)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_FIRE_RESISTANCE)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SPEED)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SLOWNESS)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WATERBREATHING)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTHEALTH)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTDAMAGE)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_POISON)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_REGENERATION)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_STRENGTH)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WEAKNESS)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_LUCK)) DEF(eCreativeInventory_Potions_Extended) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_REGENERATION)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SPEED)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_FIRE_RESISTANCE)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_POISON)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTHEALTH)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_NIGHTVISION)) // 4J- Moved here as there isn't a weak variant of this potion. - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INVISIBILITY)) // 4J- Moved here as there isn't a weak variant of this potion. - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WEAKNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_STRENGTH)) - // tu31 potions - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WATERBREATHING)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_NIGHTVISION)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_INVISIBILITY)) ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_JUMPBOOST)) - // end of tu31 potions - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SLOWNESS)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTDAMAGE)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_REGENERATION)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_SPEED)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_FIRE_RESISTANCE)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_POISON)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTHEALTH)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_NIGHTVISION)) // 4J- Moved here as there isn't a weak variant of this potion. - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, 0, MASK_INVISIBILITY)) // 4J- Moved here as there isn't a weak variant of this potion. - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_WEAKNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_STRENGTH)) - // tu31 potions - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_WATERBREATHING)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_FIRE_RESISTANCE)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SPEED)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SLOWNESS)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WATERBREATHING)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_POISON)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_REGENERATION)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_STRENGTH)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WEAKNESS)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_NIGHTVISION)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_INVISIBILITY)) ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_JUMPBOOST)) - // end of tu31 potions - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_SLOWNESS)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTDAMAGE)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_FIRE_RESISTANCE)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_SPEED)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_SLOWNESS)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_WATERBREATHING)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_POISON)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_REGENERATION)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_STRENGTH)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_WEAKNESS)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_NIGHTVISION)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_INVISIBILITY)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_JUMPBOOST)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_FIRE_RESISTANCE)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SPEED)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SLOWNESS)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WATERBREATHING)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_POISON)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_REGENERATION)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_STRENGTH)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WEAKNESS)) + + DEF(eCreativeInventory_Potions_Level2) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_JUMPBOOST)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_SPEED)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTHEALTH)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTDAMAGE)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_POISON)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_REGENERATION)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_STRENGTH)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_JUMPBOOST)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_SPEED)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTHEALTH)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTDAMAGE)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_POISON)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_REGENERATION)) + ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_STRENGTH)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_JUMPBOOST)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_SPEED)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTHEALTH)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTDAMAGE)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_POISON)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_REGENERATION)) + ITEM_AUX(Item::lingering_potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_STRENGTH)) DEF(eCreativeInventory_Potions_Level2_Extended) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_REGENERATION)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_SPEED)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_FIRE_RESISTANCE)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_POISON)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTHEALTH)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_NIGHTVISION)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_INVISIBILITY)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_NIGHTVISION)) // 4J- Moved here as there isn't a weak variant of this potion. - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_INVISIBILITY)) // 4J- Moved here as there isn't a weak variant of this potion. - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WEAKNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_STRENGTH)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SLOWNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTDAMAGE)) - // tu31 potions - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_WATERBREATHING)) // i have - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2EXTENDED, MASK_JUMPBOOST)) - // end of tu31 potions - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_REGENERATION)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_SPEED)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_FIRE_RESISTANCE)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_POISON)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTHEALTH)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_NIGHTVISION)) - //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_INVISIBILITY)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_NIGHTVISION)) // 4J- Moved here as there isn't a weak variant of this potion. - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_INVISIBILITY)) // 4J- Moved here as there isn't a weak variant of this potion. - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_WEAKNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_STRENGTH)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_EXTENDED, MASK_SLOWNESS)) - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2, MASK_INSTANTDAMAGE)) - // tu31 potions - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_WATERBREATHING)) // i have no idea why water breathing had a level 2 version in the creative menu - ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(MASK_SPLASH, MASK_LEVEL2EXTENDED, MASK_JUMPBOOST)) - // end of tu31 potions + DEF(eCreativeInventory_Potions_TU46) if (specs == nullptr) { specs = new TabSpec * [eCreativeInventoryTab_COUNT]; @@ -914,13 +941,13 @@ void IUIScene_CreativeMenu::staticCtor() ECreative_Inventory_Groups toolsGroup[] = { eCreativeInventory_ToolsArmourWeapons }; specs[eCreativeInventoryTab_ToolsWeaponsArmor] = new TabSpec(L"Tools", IDS_GROUPNAME_TOOLS_WEAPONS_ARMOR, 1, toolsGroup); - ECreative_Inventory_Groups brewingGroup[] = { eCreativeInventory_Brewing, eCreativeInventory_Potions_Level2_Extended, eCreativeInventory_Potions_Extended, eCreativeInventory_Potions_Level2, eCreativeInventory_Potions_Basic }; + ECreative_Inventory_Groups brewingGroup[] = { eCreativeInventory_Brewing, eCreativeInventory_Potions_Basic, eCreativeInventory_Potions_Extended, eCreativeInventory_Potions_Level2 }; // Just use the text LT - the graphic doesn't fit in splitscreen either // In 480p there's not enough room for the LT button, so use text instead //if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen()) { - specs[eCreativeInventoryTab_Brewing] = new TabSpec(L"Brewing", IDS_GROUPNAME_POTIONS_480, 5, brewingGroup); + specs[eCreativeInventoryTab_Brewing] = new TabSpec(L"Brewing", IDS_GROUPNAME_POTIONS_480, 4, brewingGroup); } // else // { diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h index 855e5198..55778b00 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h @@ -38,6 +38,7 @@ public: eCreativeInventory_Potions_Level2, eCreativeInventory_Potions_Extended, eCreativeInventory_Potions_Level2_Extended, + eCreativeInventory_Potions_TU46, eCreativeInventory_Misc, eCreativeInventory_ArtToolsDecorations, eCreativeInventory_ArtToolsMisc, diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 978d3a82..0a332ead 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -7,6 +7,7 @@ #include "../../Lighting.h" #include "../../LocalPlayer.h" +#include "../../MultiPlayerLocalPlayer.h" #include "../../ItemRenderer.h" #include "../../../Minecraft.World/net.minecraft.world.item.h" #include "UIScene_BookAndQuillMenu.h" @@ -1051,7 +1052,9 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt RenderManager.StateSetBlendEnable(true); RenderManager.StateSetBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); RenderManager.StateSetBlendFactor(0xffffffff); + if (getSceneType() == eUIScene_HUD && item->getItem() != nullptr) m_pItemRenderer->m_guiIconOverride = item->getItem()->GetOverrideCountIcon(item, pMinecraft->player); m_pItemRenderer->renderAndDecorateItem(pMinecraft->font, pMinecraft->textures, item, x, y,scaleX,scaleY,fAlpha,isFoil,false, !usingCommandBuffer); + m_pItemRenderer->m_guiIconOverride = nullptr; PIXEndNamedEvent(); if (pop > 0) diff --git a/Minecraft.Client/Common/UI/UIScene_DeathMenu.cpp b/Minecraft.Client/Common/UI/UIScene_DeathMenu.cpp index 1613078f..b88b0ab6 100644 --- a/Minecraft.Client/Common/UI/UIScene_DeathMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DeathMenu.cpp @@ -4,6 +4,7 @@ #include "IUIScene_PauseMenu.h" #include "../../Minecraft.h" +#include "../../Gui.h" #include "../../MultiPlayerLocalPlayer.h" #include "../../MultiPlayerLevel.h" #include "../../MinecraftServer.h" @@ -19,6 +20,11 @@ UIScene_DeathMenu::UIScene_DeathMenu(int iPad, void *initData, UILayer *parentLa m_labelTitle.setLabel(app.GetString(IDS_YOU_DIED)); + if (Minecraft::GetInstance() != nullptr && Minecraft::GetInstance()->gui != nullptr) + { + m_labelDeathMessage.setLabel(Minecraft::GetInstance()->gui->getLastDeathMessage(iPad)); + } + // 4J Added: In hardcore mode, disable respawn and show hardcore death message Minecraft *pMC = Minecraft::GetInstance(); bool isHardcore = false; diff --git a/Minecraft.Client/Common/UI/UIScene_DeathMenu.h b/Minecraft.Client/Common/UI/UIScene_DeathMenu.h index 7285e413..d8fc0663 100644 --- a/Minecraft.Client/Common/UI/UIScene_DeathMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_DeathMenu.h @@ -15,10 +15,12 @@ private: UIControl_Button m_buttonRespawn, m_buttonExitGame; UIControl_Label m_labelTitle; + UIControl_Label m_labelDeathMessage; UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) UI_MAP_ELEMENT( m_buttonRespawn, "Respawn") UI_MAP_ELEMENT( m_buttonExitGame, "ExitGame") UI_MAP_ELEMENT( m_labelTitle, "Title") + UI_MAP_ELEMENT( m_labelDeathMessage, "DeathMessage") UI_END_MAP_ELEMENTS_AND_NAMES() public: UIScene_DeathMenu(int iPad, void *initData, UILayer *parentLayer); diff --git a/Minecraft.Client/Common/UI/UIScene_HUD.cpp b/Minecraft.Client/Common/UI/UIScene_HUD.cpp index 0102ea75..4a079159 100644 --- a/Minecraft.Client/Common/UI/UIScene_HUD.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HUD.cpp @@ -14,6 +14,8 @@ UIScene_HUD::UIScene_HUD(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) { m_bSplitscreen = false; + m_crosshairHidden = false; + for (int i = 0; i < 3; i++) m_crosshairWasVisible[i] = true; // Setup all the Iggy references we need for this scene initialiseMovie(); @@ -987,3 +989,22 @@ void UIScene_HUD::handleGameTick() updateFrameTick(); } } + +void UIScene_HUD::updateCrosshairVisibility(bool thirdPerson) +{ + if (thirdPerson == m_crosshairHidden) return; + + for (int i = 0; i < 3; i++) + { + if (thirdPerson) + { + m_crosshairWasVisible[i] = m_crosshair[i].getVisible(); + m_crosshair[i].setVisible(false); + } + else + { + m_crosshair[i].setVisible(m_crosshairWasVisible[i]); + } + } + m_crosshairHidden = thirdPerson; +} diff --git a/Minecraft.Client/Common/UI/UIScene_HUD.h b/Minecraft.Client/Common/UI/UIScene_HUD.h index 87dc34b0..98068afd 100644 --- a/Minecraft.Client/Common/UI/UIScene_HUD.h +++ b/Minecraft.Client/Common/UI/UIScene_HUD.h @@ -14,6 +14,9 @@ protected: UIControl_HTMLLabel m_labelChatText[CHAT_LINES_COUNT]; UIControl_Label m_labelJukebox; UIControl m_controlLabelBackground[CHAT_LINES_COUNT]; + UIControl m_crosshair[3]; + bool m_crosshairHidden; + bool m_crosshairWasVisible[3]; UIControl_Label m_labelDisplayName; IggyName m_funcLoadHud, m_funcSetExpBarProgress, m_funcSetPlayerLevel, m_funcSetActiveSlot; @@ -50,6 +53,9 @@ protected: UI_MAP_ELEMENT(m_controlLabelBackground[9],"Label10Background") UI_MAP_ELEMENT(m_labelJukebox,"Jukebox") + UI_MAP_ELEMENT(m_crosshair[0],"CrosshairSmall") + UI_MAP_ELEMENT(m_crosshair[1],"CrosshairNormal") + UI_MAP_ELEMENT(m_crosshair[2],"CrosshairLarge") UI_MAP_ELEMENT(m_labelDisplayName,"LabelGamertag") @@ -97,6 +103,7 @@ public: UIScene_HUD(int iPad, void *initData, UILayer *parentLayer); virtual void tick(); + void updateCrosshairVisibility(bool thirdPerson); virtual void updateSafeZone(); diff --git a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp index 3e022f68..3a0b9f51 100644 --- a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp @@ -92,6 +92,7 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini m_checkboxes[eLaunchCheckbox_TNT].init(app.GetString(IDS_TNT_EXPLODES),eLaunchCheckbox_TNT,m_params->bTNT); m_checkboxes[eLaunchCheckbox_HostPrivileges].init(app.GetString(IDS_HOST_PRIVILEGES),eLaunchCheckbox_HostPrivileges,m_params->bHostPrivileges); m_checkboxes[eLaunchCheckbox_ResetNether].init(app.GetString(IDS_RESET_NETHER),eLaunchCheckbox_ResetNether,m_params->bResetNether); + m_checkboxes[eLaunchCheckbox_ResetEnd].init(app.GetString(IDS_RESET_END),eLaunchCheckbox_ResetEnd,m_params->bResetEnd); m_checkboxes[eLaunchCheckbox_Structures].init(app.GetString(IDS_GENERATE_STRUCTURES),eLaunchCheckbox_Structures,m_params->bStructures); m_checkboxes[eLaunchCheckbox_FlatWorld].init(app.GetString(IDS_SUPERFLAT_WORLD),eLaunchCheckbox_FlatWorld,m_params->bFlatWorld); m_checkboxes[eLaunchCheckbox_BonusChest].init(app.GetString(IDS_BONUS_CHEST),eLaunchCheckbox_BonusChest,m_params->bBonusChest); @@ -431,6 +432,9 @@ void UIScene_LaunchMoreOptionsMenu::handleCheckboxToggled(F64 controlId, bool se case eLaunchCheckbox_ResetNether: m_params->bResetNether = selected; break; + case eLaunchCheckbox_ResetEnd: + m_params->bResetEnd = selected; + break; case eLaunchCheckbox_Structures: m_params->bStructures = selected; break; @@ -503,6 +507,9 @@ void UIScene_LaunchMoreOptionsMenu::handleFocusChange(F64 controlId, F64 childId case eLaunchCheckbox_ResetNether: stringId = IDS_GAMEOPTION_RESET_NETHER; break; + case eLaunchCheckbox_ResetEnd: + stringId = IDS_GAMEOPTION_RESET_END; + break; case eLaunchCheckbox_Structures: stringId = IDS_GAMEOPTION_STRUCTURES; break; diff --git a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h index 4c099c80..ba475357 100644 --- a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h @@ -20,6 +20,7 @@ private: eLaunchCheckbox_TNT, eLaunchCheckbox_HostPrivileges, eLaunchCheckbox_ResetNether, + eLaunchCheckbox_ResetEnd, eLaunchCheckbox_Structures, eLaunchCheckbox_FlatWorld, eLaunchCheckbox_BonusChest, @@ -105,6 +106,7 @@ private: UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_FlatWorld], "CheckboxFlatWorld") UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_ResetNether], "CheckboxResetNether") + UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_ResetEnd], "CheckboxResetEnd") UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_DisableSaving], "CheckboxDisableSaving") UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_TrustSystem], "CheckboxTrustSystem") diff --git a/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp index 92a6be29..44c6e225 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp @@ -1003,7 +1003,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() } else { - LaunchGame(); + ConfirmResetEndOrLaunch(); } } @@ -1290,13 +1290,13 @@ int UIScene_LoadMenu::CheckResetNetherReturned(void *pParam,int iPad,C4JStorage: if(result==C4JStorage::EMessage_ResultDecline) { // continue and reset the nether - pClass->LaunchGame(); + pClass->ConfirmResetEndOrLaunch(); } else if(result==C4JStorage::EMessage_ResultAccept) { // turn off the reset nether and continue pClass->m_MoreOptionsParams.bResetNether=FALSE; - pClass->LaunchGame(); + pClass->ConfirmResetEndOrLaunch(); } else { @@ -1742,6 +1742,7 @@ void UIScene_LoadMenu::StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocal // flag if the user wants to reset the Nether to force a Fortress with netherwart etc. app.SetResetNether((pClass->m_MoreOptionsParams.bResetNether==TRUE)?true:false); + app.SetResetEnd(pClass->m_MoreOptionsParams.bResetEnd); // clear out the app's terrain features list app.ClearTerrainFeaturePosition(); @@ -1791,7 +1792,7 @@ void UIScene_LoadMenu::checkStateAndStartGame() } else { - LaunchGame(); + ConfirmResetEndOrLaunch(); } } @@ -1976,3 +1977,39 @@ int UIScene_LoadMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EM // return 0; // } #endif + +void UIScene_LoadMenu::ConfirmResetEndOrLaunch() +{ + if(m_MoreOptionsParams.bResetEnd) + { + UINT uiIDA[2]; + uiIDA[0]=IDS_DONT_RESET_END; + uiIDA[1]=IDS_RESET_END; + + ui.RequestAlertMessage(IDS_RESETEND_TITLE, IDS_RESETEND_TEXT, uiIDA, 2, m_iPad,&UIScene_LoadMenu::CheckResetEndReturned,this); + } + else + { + LaunchGame(); + } +} + +int UIScene_LoadMenu::CheckResetEndReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) +{ + UIScene_LoadMenu* pClass = static_cast(pParam); + + if(result==C4JStorage::EMessage_ResultDecline) + { + pClass->LaunchGame(); + } + else if(result==C4JStorage::EMessage_ResultAccept) + { + pClass->m_MoreOptionsParams.bResetEnd=false; + pClass->LaunchGame(); + } + else + { + pClass->m_bIgnoreInput=false; + } + return 0; +} diff --git a/Minecraft.Client/Common/UI/UIScene_LoadMenu.h b/Minecraft.Client/Common/UI/UIScene_LoadMenu.h index 5d2fdb8a..2c69c969 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_LoadMenu.h @@ -118,6 +118,8 @@ private: static int LoadDataComplete(void *pParam); static int LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes); static int CheckResetNetherReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); + static int CheckResetEndReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); + void ConfirmResetEndOrLaunch(); static int DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static int DeleteSaveDataReturned(void *pParam,bool bSuccess); static int MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result); diff --git a/Minecraft.Client/Common/UI/UIStructs.h b/Minecraft.Client/Common/UI/UIStructs.h index 2f01c3e2..11d3f070 100644 --- a/Minecraft.Client/Common/UI/UIStructs.h +++ b/Minecraft.Client/Common/UI/UIStructs.h @@ -355,6 +355,7 @@ typedef struct _LaunchMoreOptionsMenuInitData bool bHostPrivileges; bool bResetNether; + bool bResetEnd; bool bMobGriefing; bool bKeepInventory; diff --git a/Minecraft.Client/Common/res/1_2_2/item/boat/boat_acacia.png b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_acacia.png new file mode 100644 index 00000000..14f32c54 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_acacia.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/item/boat/boat_birch.png b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_birch.png new file mode 100644 index 00000000..4b41cf97 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_birch.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/item/boat/boat_darkoak.png b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_darkoak.png new file mode 100644 index 00000000..ad59eb1d Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_darkoak.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/item/boat/boat_jungle.png b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_jungle.png new file mode 100644 index 00000000..e0a0811c Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_jungle.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/item/boat/boat_oak.png b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_oak.png new file mode 100644 index 00000000..4542c9dd Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_oak.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/item/boat/boat_spruce.png b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_spruce.png new file mode 100644 index 00000000..12cd9d89 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/item/boat/boat_spruce.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/item/spectral_arrow.png b/Minecraft.Client/Common/res/1_2_2/item/spectral_arrow.png new file mode 100644 index 00000000..7a7a527c Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/item/spectral_arrow.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/item/tipped_arrow.png b/Minecraft.Client/Common/res/1_2_2/item/tipped_arrow.png new file mode 100644 index 00000000..7f677b58 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/item/tipped_arrow.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/shulker/endergolem.png b/Minecraft.Client/Common/res/1_2_2/mob/shulker/endergolem.png new file mode 100644 index 00000000..4ce75478 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/shulker/endergolem.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/shulker/spark.png b/Minecraft.Client/Common/res/1_2_2/mob/shulker/spark.png new file mode 100644 index 00000000..f1e51aea Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/shulker/spark.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/skeleton/stray.png b/Minecraft.Client/Common/res/1_2_2/mob/skeleton/stray.png new file mode 100644 index 00000000..afde19c6 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/skeleton/stray.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/skeleton/stray_overlay.png b/Minecraft.Client/Common/res/1_2_2/mob/skeleton/stray_overlay.png new file mode 100644 index 00000000..d608a4be Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/skeleton/stray_overlay.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/zombie/husk.png b/Minecraft.Client/Common/res/1_2_2/mob/zombie/husk.png new file mode 100644 index 00000000..95b79f9e Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/zombie/husk.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_butcher.png b/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_butcher.png new file mode 100644 index 00000000..a792f676 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_butcher.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_farmer.png b/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_farmer.png new file mode 100644 index 00000000..a827b858 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_farmer.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_librarian.png b/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_librarian.png new file mode 100644 index 00000000..7e3e259f Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_librarian.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_priest.png b/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_priest.png new file mode 100644 index 00000000..9ead2742 Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_priest.png differ diff --git a/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_smith.png b/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_smith.png new file mode 100644 index 00000000..e60ef1ba Binary files /dev/null and b/Minecraft.Client/Common/res/1_2_2/mob/zombie_villager/zombie_smith.png differ diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml b/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml index c0d89fb8..d066d9c5 100644 --- a/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml +++ b/Minecraft.Client/Common/res/TitleUpdate/res/colours.xml @@ -232,6 +232,10 @@ if __name__=="__main__": notecolors() + + + + @@ -293,6 +297,15 @@ if __name__=="__main__": notecolors() + + + + + + + + + diff --git a/Minecraft.Client/Common/res/TitleUpdate/res/particles.png b/Minecraft.Client/Common/res/TitleUpdate/res/particles.png index aed54da5..e37cd4eb 100644 Binary files a/Minecraft.Client/Common/res/TitleUpdate/res/particles.png and b/Minecraft.Client/Common/res/TitleUpdate/res/particles.png differ diff --git a/Minecraft.Client/DragonHeadModel.cpp b/Minecraft.Client/DragonHeadModel.cpp new file mode 100644 index 00000000..49240fc9 --- /dev/null +++ b/Minecraft.Client/DragonHeadModel.cpp @@ -0,0 +1,44 @@ +#include "stdafx.h" +#include "DragonHeadModel.h" +#include "../Minecraft.World/Mth.h" + +DragonHeadModel::DragonHeadModel() : Model() +{ + texWidth = 256; + texHeight = 256; + + setMapTex(L"head.upperhead", 112, 30); + setMapTex(L"head.upperlip", 176, 44); + setMapTex(L"jaw.jaw", 176, 65); + setMapTex(L"head.scale", 0, 0); + setMapTex(L"head.nostril", 112, 0); + + head = new ModelPart(this, L"head"); + head->addBox(L"upperlip", -6, -1, -24, 12, 5, 16); + head->addBox(L"upperhead", -8, -8, -10, 16, 16, 16); + head->bMirror = true; + head->addBox(L"scale", -5, -12, -4, 2, 4, 6); + head->addBox(L"nostril", -5, -3, -22, 2, 2, 4); + head->bMirror = false; + head->addBox(L"scale", 3, -12, -4, 2, 4, 6); + head->addBox(L"nostril", 3, -3, -22, 2, 2, 4); + + jaw = new ModelPart(this, L"jaw"); + jaw->setPos(0, 4, -8); + jaw->addBox(L"jaw", -6, 0, -16, 12, 4, 16); + head->addChild(jaw); + + head->compile(1.0f / 16.0f); + jaw->compile(1.0f / 16.0f); +} + +void DragonHeadModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +{ + jaw->xRot = (Mth::sin(time * PI * 0.2f) + 1.0f) * 0.2f; + head->yRot = yRot * PI / 180.0f; + head->xRot = xRot * PI / 180.0f; + + glTranslatef(0.0f, -0.374375f, 0.0f); + glScalef(0.75f, 0.75f, 0.75f); + head->render(scale, usecompiled); +} diff --git a/Minecraft.Client/DragonHeadModel.h b/Minecraft.Client/DragonHeadModel.h new file mode 100644 index 00000000..97e2e779 --- /dev/null +++ b/Minecraft.Client/DragonHeadModel.h @@ -0,0 +1,13 @@ +#pragma once +#include "Model.h" +#include "ModelPart.h" + +class DragonHeadModel : public Model +{ +public: + ModelPart *head; + ModelPart *jaw; + + DragonHeadModel(); + virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); +}; diff --git a/Minecraft.Client/EndRodParticle.cpp b/Minecraft.Client/EndRodParticle.cpp new file mode 100644 index 00000000..cb92b485 --- /dev/null +++ b/Minecraft.Client/EndRodParticle.cpp @@ -0,0 +1,63 @@ +#include "stdafx.h" +#include "EndRodParticle.h" +#include "../Minecraft.World/Level.h" + +EndRodParticle::EndRodParticle(Level *level, double x, double y, double z, double xa, double ya, double za) : Particle(level, x, y, z) +{ + xd = xa; + yd = ya; + zd = za; + size *= 0.75f; + lifetime = 60 + random->nextInt(12); + noPhysics = true; + + fadeR = 0xf2 / 255.0f; + fadeG = 0xde / 255.0f; + fadeB = 0xc9 / 255.0f; + + setMiscTex(BASE_TEX + FRAME_COUNT - 1); +} + +AABB *EndRodParticle::getCollideBox() +{ + return nullptr; +} + +bool EndRodParticle::isPushable() +{ + return false; +} + +void EndRodParticle::tick() +{ + xo = x; + yo = y; + zo = z; + + if (age++ >= lifetime) remove(); + if (age > lifetime / 2) + { + setAlpha(1.0f - ((static_cast(age) - lifetime / 2) / static_cast(lifetime))); + rCol = rCol + (fadeR - rCol) * .2f; + gCol = gCol + (fadeG - gCol) * .2f; + bCol = bCol + (fadeB - bCol) * .2f; + } + + setMiscTex(BASE_TEX + (FRAME_COUNT - 1 - age * FRAME_COUNT / lifetime)); + + yd -= 0.0005; + move(xd, yd, zd, true); + xd *= 0.91f; + yd *= 0.91f; + zd *= 0.91f; +} + +int EndRodParticle::getLightColor(float a) +{ + return SharedConstants::FULLBRIGHT_LIGHTVALUE; +} + +float EndRodParticle::getBrightness(float a) +{ + return 1.0f; +} diff --git a/Minecraft.Client/EndRodParticle.h b/Minecraft.Client/EndRodParticle.h new file mode 100644 index 00000000..eeab4d72 --- /dev/null +++ b/Minecraft.Client/EndRodParticle.h @@ -0,0 +1,24 @@ +#pragma once +#include "Particle.h" + +class EndRodParticle : public Particle +{ +public: + virtual eINSTANCEOF GetType() { return eType_ENDRODPARTICLE; } + +private: + static const int BASE_TEX = 11 * 16; + static const int FRAME_COUNT = 8; + + float fadeR; + float fadeG; + float fadeB; + +public: + EndRodParticle(Level *level, double x, double y, double z, double xa, double ya, double za); + virtual AABB *getCollideBox(); + virtual bool isPushable(); + virtual void tick(); + virtual int getLightColor(float a); + virtual float getBrightness(float a); +}; diff --git a/Minecraft.Client/EnderCrystalModel.cpp b/Minecraft.Client/EnderCrystalModel.cpp index fde03cd8..14260b3e 100644 --- a/Minecraft.Client/EnderCrystalModel.cpp +++ b/Minecraft.Client/EnderCrystalModel.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "EnderCrystalModel.h" +#include "../Minecraft.World/EnderCrystal.h" @@ -26,7 +27,8 @@ void EnderCrystalModel::render(shared_ptr entity, float time, float r, f glPushMatrix(); glScalef(2, 2, 2); glTranslatef(0, -0.5f, 0); - base->render(scale,usecompiled); + shared_ptr crystal = dynamic_pointer_cast(entity); + if (crystal == nullptr || crystal->showsBottom()) base->render(scale,usecompiled); glRotatef(r, 0, 1, 0); glTranslatef(0, 0.8f + bob, 0); glRotatef(60, 0.7071f, 0, 0.7071f); diff --git a/Minecraft.Client/EnderCrystalRenderer.cpp b/Minecraft.Client/EnderCrystalRenderer.cpp index 7ab01477..b36fda79 100644 --- a/Minecraft.Client/EnderCrystalRenderer.cpp +++ b/Minecraft.Client/EnderCrystalRenderer.cpp @@ -2,8 +2,11 @@ #include "EnderCrystalModel.h" #include "../Minecraft.World/net.minecraft.world.entity.boss.enderdragon.h" #include "EnderCrystalRenderer.h" +#include "Tesselator.h" +#include "Lighting.h" ResourceLocation EnderCrystalRenderer::ENDER_CRYSTAL_LOCATION = ResourceLocation(TN_MOB_ENDERDRAGON_ENDERCRYSTAL); +ResourceLocation EnderCrystalRenderer::BEAM_LOCATION = ResourceLocation(TN_MOB_ENDERDRAGON_BEAM); EnderCrystalRenderer::EnderCrystalRenderer() { @@ -32,9 +35,62 @@ void EnderCrystalRenderer::render(shared_ptr _crystal, double x, double model->render(crystal, 0, tt * 3, hh * 0.2f, 0, 0, 1 / 16.0f, true); glPopMatrix(); + + if (crystal->hasBeamTarget()) renderBeam(crystal, x, y, z, a); } ResourceLocation *EnderCrystalRenderer::getTextureLocation(shared_ptr mob) { return &ENDER_CRYSTAL_LOCATION; -} \ No newline at end of file +} +void EnderCrystalRenderer::renderBeam(shared_ptr crystal, double x, double y, double z, float a) +{ + float tt = crystal->time + a; + float hh = sin(tt * 0.2f) / 2 + 0.5f; + hh = (hh * hh + hh) * 0.2f; + + double cx = crystal->xo + (crystal->x - crystal->xo) * a; + double cy = crystal->yo + (crystal->y - crystal->yo) * a; + double cz = crystal->zo + (crystal->z - crystal->zo) * a; + float xd = static_cast(crystal->getBeamTargetX() + 0.5 - cx); + float yd = static_cast(crystal->getBeamTargetY() + 0.5 - (cy + hh + 1)); + float zd = static_cast(crystal->getBeamTargetZ() + 0.5 - cz); + + float sdd = sqrt(xd * xd + zd * zd); + float dd = sqrt(xd * xd + yd * yd + zd * zd); + + glColor4f(1, 1, 1, 1); + glPushMatrix(); + glTranslatef(static_cast(x), static_cast(y) + hh + 1, static_cast(z)); + glRotatef(static_cast(-atan2(zd, xd)) * 180.0f / PI - 90.0f, 0, 1, 0); + glRotatef(static_cast(-atan2(sdd, yd)) * 180.0f / PI - 90.0f, 1, 0, 0); + + Tesselator *t = Tesselator::getInstance(); + Lighting::turnOff(); + glDisable(GL_CULL_FACE); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA); + bindTexture(&BEAM_LOCATION); + glShadeModel(GL_SMOOTH); + + float v0 = 0 - (crystal->tickCount + a) * 0.005f; + float v1 = dd / 32.0f - (crystal->tickCount + a) * 0.005f; + + t->begin(GL_TRIANGLE_STRIP); + int steps = 8; + for (int i = 0; i <= steps; i++) + { + float s = sin(i % steps * PI * 2 / steps) * 0.75f; + float c = cos(i % steps * PI * 2 / steps) * 0.75f; + float u = i % steps * 1.0f / steps; + t->vertexUV(s * 0.2f, c * 0.2f, 0, u, v1); + t->vertexUV(s, c, dd, u, v0); + } + t->end(); + + glEnable(GL_CULL_FACE); + glShadeModel(GL_FLAT); + glDisable(GL_BLEND); + glPopMatrix(); + Lighting::turnOn(); +} diff --git a/Minecraft.Client/EnderCrystalRenderer.h b/Minecraft.Client/EnderCrystalRenderer.h index 76e3b171..4b9ab943 100644 --- a/Minecraft.Client/EnderCrystalRenderer.h +++ b/Minecraft.Client/EnderCrystalRenderer.h @@ -2,6 +2,7 @@ #include "EntityRenderer.h" class Model; +class EnderCrystal; class EnderCrystalRenderer : public EntityRenderer { @@ -9,6 +10,9 @@ private: int currentModel; Model *model; static ResourceLocation ENDER_CRYSTAL_LOCATION; + static ResourceLocation BEAM_LOCATION; + + void renderBeam(shared_ptr crystal, double x, double y, double z, float a); public: EnderCrystalRenderer(); diff --git a/Minecraft.Client/EntityRenderDispatcher.cpp b/Minecraft.Client/EntityRenderDispatcher.cpp index 43db7d3c..3c7eb4fe 100644 --- a/Minecraft.Client/EntityRenderDispatcher.cpp +++ b/Minecraft.Client/EntityRenderDispatcher.cpp @@ -87,6 +87,8 @@ #include "ArmorStandRenderer.h" #include "EndermiteRenderer.h" +#include "ShulkerRenderer.h" +#include "ShulkerBulletRenderer.h" #include "GuardianRenderer.h" #include "GuardianModel.h" #include "MobRenderer.h" @@ -148,6 +150,7 @@ EntityRenderDispatcher::EntityRenderDispatcher() renderers[eTYPE_ENTITY] = new DefaultRenderer(); + renderers[eTYPE_AREA_EFFECT_CLOUD] = new DefaultRenderer(); renderers[eTYPE_PAINTING] = new PaintingRenderer(); renderers[eTYPE_ITEM_FRAME] = new ItemFrameRenderer(); renderers[eTYPE_LEASHFENCEKNOT] = new LeashKnotRenderer(); @@ -185,6 +188,8 @@ EntityRenderDispatcher::EntityRenderDispatcher() renderers[eTYPE_ARMORSTAND] = new ArmorStandRenderer(); renderers[eTYPE_ENDERMITE] = new EndermiteRenderer(); + renderers[eTYPE_SHULKER] = new ShulkerRenderer(); + renderers[eTYPE_SHULKER_BULLET] = new ShulkerBulletRenderer(); glDisable(GL_LIGHTING); for( auto& it : renderers ) diff --git a/Minecraft.Client/EntityRenderer.cpp b/Minecraft.Client/EntityRenderer.cpp index 4900d5c0..c3d71bb0 100644 --- a/Minecraft.Client/EntityRenderer.cpp +++ b/Minecraft.Client/EntityRenderer.cpp @@ -36,8 +36,17 @@ void EntityRenderer::bindTexture(shared_ptr entity) bindTexture(getTextureLocation(entity)); } +bool EntityRenderer::solidColourPass = false; +bool EntityRenderer::skipPostRender = false; + void EntityRenderer::bindTexture(ResourceLocation *location) { + if (solidColourPass) + { + glDisable(GL_TEXTURE_2D); + entityRenderDispatcher->textures->clearLastBoundId(); + return; + } entityRenderDispatcher->textures->bindTexture(location); } @@ -50,6 +59,13 @@ bool EntityRenderer::bindTexture(const wstring& urlTexture, int backupTexture) //int id = t->loadHttpTexture(urlTexture, backupTexture); int id = t->loadMemTexture(urlTexture, backupTexture); + if (solidColourPass && id >= 0) + { + glDisable(GL_TEXTURE_2D); + t->clearLastBoundId(); + return true; + } + if (id >= 0) { glBindTexture(GL_TEXTURE_2D, id); @@ -384,6 +400,7 @@ void EntityRenderer::init(EntityRenderDispatcher *entityRenderDispatcher) void EntityRenderer::postRender(shared_ptr entity, double x, double y, double z, float rot, float a, bool bRenderPlayerShadow) { + if (solidColourPass || skipPostRender) return; if( !entityRenderDispatcher->isGuiRender ) // 4J - added, don't render shadow in gui as it uses its own blending, and we have globally enabled blending for interface opacity { if (bRenderPlayerShadow && entityRenderDispatcher->options->fancyGraphics && shadowRadius > 0 && !entity->isInvisible()) diff --git a/Minecraft.Client/EntityRenderer.h b/Minecraft.Client/EntityRenderer.h index c91f807c..02482485 100644 --- a/Minecraft.Client/EntityRenderer.h +++ b/Minecraft.Client/EntityRenderer.h @@ -43,6 +43,8 @@ protected: public: EntityRenderer(); // 4J - added + static bool solidColourPass; + static bool skipPostRender; virtual ~EntityRenderer(); public: virtual void render(shared_ptr entity, double x, double y, double z, float rot, float a) = 0; diff --git a/Minecraft.Client/EntityTracker.cpp b/Minecraft.Client/EntityTracker.cpp index c20bf0ba..6ee853e0 100644 --- a/Minecraft.Client/EntityTracker.cpp +++ b/Minecraft.Client/EntityTracker.cpp @@ -55,6 +55,8 @@ void EntityTracker::addEntity(shared_ptr e) else if (e->instanceof(eTYPE_EYEOFENDERSIGNAL)) addEntity(e, 16 * 4, 4, true); else if (e->instanceof(eTYPE_THROWNEGG)) addEntity(e, 16 * 4, 10, true); else if (e->instanceof(eTYPE_THROWNPOTION)) addEntity(e, 16 * 4, 10, true); + else if (e->instanceof(eTYPE_AREA_EFFECT_CLOUD)) addEntity(e, 16 * 10, 10, false); + else if (e->instanceof(eTYPE_SHULKER_BULLET)) addEntity(e, 16 * 5, 3, true); else if (e->instanceof(eTYPE_THROWNEXPBOTTLE)) addEntity(e, 16 * 4, 10, true); else if (e->instanceof(eTYPE_FIREWORKS_ROCKET)) addEntity(e, 16 * 4, 10, true); else if (e->instanceof(eTYPE_ITEMENTITY)) addEntity(e, 16 * 4, 20, true); diff --git a/Minecraft.Client/FallingDustParticle.cpp b/Minecraft.Client/FallingDustParticle.cpp new file mode 100644 index 00000000..679ae271 --- /dev/null +++ b/Minecraft.Client/FallingDustParticle.cpp @@ -0,0 +1,38 @@ +#include "stdafx.h" +#include "FallingDustParticle.h" +#include "../Minecraft.World/Level.h" +#include "../Minecraft.World/Mth.h" + +FallingDustParticle::FallingDustParticle(Level *level, double x, double y, double z, float r, float g, float b) : Particle(level, x, y, z) +{ + xd = 0; + yd = 0; + zd = 0; + rCol = r; + gCol = g; + bCol = b; + size *= 0.75f; + size *= 0.9f; + baseSize = size; + lifetime = static_cast(floor(32.0f / (random->nextFloat() * 0.8f + 0.2f) * 0.9f)); + setMiscTex(7); +} + +void FallingDustParticle::render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2) +{ + size = baseSize * Mth::clamp((age + a) / lifetime * 32.0f, 0.0f, 1.0f); + Particle::render(t, a, xa, ya, za, xa2, za2); +} + +void FallingDustParticle::tick() +{ + xo = x; + yo = y; + zo = z; + if (age++ >= lifetime) remove(); + + setMiscTex(7 - age * 8 / lifetime); + move(xd, yd, zd); + yd -= 0.003; + if (yd < -0.14) yd = -0.14; +} diff --git a/Minecraft.Client/FallingDustParticle.h b/Minecraft.Client/FallingDustParticle.h new file mode 100644 index 00000000..f8fa61bc --- /dev/null +++ b/Minecraft.Client/FallingDustParticle.h @@ -0,0 +1,16 @@ +#pragma once +#include "Particle.h" + +class FallingDustParticle : public Particle +{ +public: + virtual eINSTANCEOF GetType() { return eType_FALLINGDUSTPARTICLE; } + +private: + float baseSize; + +public: + FallingDustParticle(Level *level, double x, double y, double z, float r, float g, float b); + virtual void tick(); + virtual void render(Tesselator *t, float a, float xa, float ya, float za, float xa2, float za2); +}; diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 97438126..3d2ecb95 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -1932,3 +1932,20 @@ void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, int64 glEnable(GL_TEXTURE_2D); } + +void Gui::setLastDeathMessage(int iPad, const wstring &message) +{ + if (iPad >= 0 && iPad < XUSER_MAX_COUNT) + { + m_lastDeathMessage[iPad] = message; + } + else + { + for (int i = 0; i < XUSER_MAX_COUNT; i++) m_lastDeathMessage[i] = message; + } +} + +wstring Gui::getLastDeathMessage(int iPad) +{ + return (iPad >= 0 && iPad < XUSER_MAX_COUNT) ? m_lastDeathMessage[iPad] : L""; +} diff --git a/Minecraft.Client/Gui.h b/Minecraft.Client/Gui.h index 527b0237..c4996401 100644 --- a/Minecraft.Client/Gui.h +++ b/Minecraft.Client/Gui.h @@ -56,6 +56,11 @@ public: void tick(); void clearMessages(int iPad=-1); void addMessage(const wstring& string, int iPad,bool bIsDeathMessage=false); + void setLastDeathMessage(int iPad, const wstring &message); + wstring getLastDeathMessage(int iPad); +private: + wstring m_lastDeathMessage[XUSER_MAX_COUNT]; +public: void setNowPlaying(const wstring& string); void displayClientMessage(int messageId, int iPad); diff --git a/Minecraft.Client/ItemRenderer.cpp b/Minecraft.Client/ItemRenderer.cpp index 843c9fd9..fb953ad5 100644 --- a/Minecraft.Client/ItemRenderer.cpp +++ b/Minecraft.Client/ItemRenderer.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "../Minecraft.World/SkullTileEntity.h" #include "ItemRenderer.h" #include "TileRenderer.h" #include "EntityRenderDispatcher.h" @@ -393,7 +394,7 @@ void ItemRenderer::renderGuiItem(Font *font, Textures *textures, shared_ptrid; int itemAuxValue = item->getAuxValue(); - Icon *itemIcon = item->getIcon(); + Icon *itemIcon = m_guiIconOverride != nullptr ? m_guiIconOverride : item->getIcon(); if (dynamic_cast(item->getItem()) != nullptr && SkullTileRenderer::instance != nullptr) { @@ -407,8 +408,15 @@ void ItemRenderer::renderGuiItem(Font *font, Textures *textures, shared_ptrrenderSkull(-0.5f, 0.0f, -0.5f, Facing::UP, 0.0f, itemAuxValue, extra); glPopMatrix(); return; diff --git a/Minecraft.Client/ItemRenderer.h b/Minecraft.Client/ItemRenderer.h index 687b2491..f5683ac2 100644 --- a/Minecraft.Client/ItemRenderer.h +++ b/Minecraft.Client/ItemRenderer.h @@ -13,6 +13,7 @@ private: Random *random; bool m_bItemFrame; public: + Icon *m_guiIconOverride = nullptr; bool setColor; float blitOffset; diff --git a/Minecraft.Client/ItemSpriteRenderer.cpp b/Minecraft.Client/ItemSpriteRenderer.cpp index 728b9235..2031cd1c 100644 --- a/Minecraft.Client/ItemSpriteRenderer.cpp +++ b/Minecraft.Client/ItemSpriteRenderer.cpp @@ -22,6 +22,12 @@ void ItemSpriteRenderer::render(shared_ptr e, double x, double y, double { // the icon is already cached in the item object, so there should not be any performance impact by not caching it here Icon *icon = sourceItem->getIcon(sourceItemAuxValue); + bool lingering = false; + if (e->instanceof(eTYPE_THROWNPOTION) && dynamic_pointer_cast(e)->isLingering()) + { + icon = Item::lingering_potion->getIcon(0); + lingering = true; + } if (icon == nullptr) { return; @@ -35,7 +41,7 @@ void ItemSpriteRenderer::render(shared_ptr e, double x, double y, double bindTexture(e); Tesselator *t = Tesselator::getInstance(); - if (icon == PotionItem::getTexture(PotionItem::THROWABLE_ICON) ) + if (lingering || icon == PotionItem::getTexture(PotionItem::THROWABLE_ICON) ) { int col = PotionBrewing::getColorValue((dynamic_pointer_cast(e) )->getPotionValue(), false); diff --git a/Minecraft.Client/LevelRenderer.cpp b/Minecraft.Client/LevelRenderer.cpp index 953f6d77..67832b0f 100644 --- a/Minecraft.Client/LevelRenderer.cpp +++ b/Minecraft.Client/LevelRenderer.cpp @@ -5,6 +5,7 @@ #include "Tesselator.h" #include "Chunk.h" #include "EntityRenderDispatcher.h" +#include "BoatRenderer.h" #include "TileEntityRenderDispatcher.h" #include "DistanceChunkSorter.h" #include "DirtyChunkSorter.h" @@ -40,6 +41,8 @@ #include "DripParticle.h" #include "EchantmentTableParticle.h" #include "DragonBreathParticle.h" +#include "EndRodParticle.h" +#include "FallingDustParticle.h" #include "FireworksParticles.h" #include "Lighting.h" #include "Options.h" @@ -583,6 +586,8 @@ void LevelRenderer::renderEntities(Vec3 *cam, Culler *culler, float a) mc->gameRenderer->turnOnLightLayer(a); // 4J - brought forward from 1.8.2 vector > entities = level[playerIndex]->getAllEntities(); + vector > glowingEntities; + vector > secondPassBoats; totalEntities = static_cast(entities.size()); for (auto& entity : level[playerIndex]->globalEntities) @@ -621,9 +626,53 @@ void LevelRenderer::renderEntities(Vec3 *cam, Culler *culler, float a) } renderedEntities++; EntityRenderDispatcher::instance->render(entity, a); + if (entity->isGlowing()) glowingEntities.push_back(entity); + if (entity->instanceof(eTYPE_BOAT)) secondPassBoats.push_back(entity); } } + if (!secondPassBoats.empty()) + { + BoatRenderer::s_secondPass = true; + for (auto& boat : secondPassBoats) EntityRenderDispatcher::instance->render(boat, a); + BoatRenderer::s_secondPass = false; + } + + if (!glowingEntities.empty()) + { + const float rimScale = 1.08f; + + EntityRenderer::solidColourPass = true; + glDisable(GL_DEPTH_TEST); + glDepthMask(false); + glDisable(GL_LIGHTING); + for (auto& entity : glowingEntities) + { + float cx = static_cast(entity->xOld + (entity->x - entity->xOld) * a - EntityRenderDispatcher::xOff); + float cy = static_cast(entity->yOld + (entity->y - entity->yOld) * a - EntityRenderDispatcher::yOff) + entity->bbHeight * 0.5f; + float cz = static_cast(entity->zOld + (entity->z - entity->zOld) * a - EntityRenderDispatcher::zOff); + glPushMatrix(); + glTranslatef(cx, cy, cz); + glScalef(rimScale, rimScale, rimScale); + glTranslatef(-cx, -cy, -cz); + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + EntityRenderDispatcher::instance->render(entity, a); + glPopMatrix(); + } + EntityRenderer::solidColourPass = false; + glEnable(GL_DEPTH_TEST); + glDepthMask(true); + glDepthFunc(GL_LEQUAL); + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + + EntityRenderer::skipPostRender = true; + for (auto& entity : glowingEntities) + { + EntityRenderDispatcher::instance->render(entity, a); + } + EntityRenderer::skipPostRender = false; + } + Lighting::turnOn(); // 4J - have restructed this so that the tile entities are stored within a hashmap by chunk/dimension index. The index // is calculated in the same way as the global flags. @@ -3172,6 +3221,12 @@ shared_ptr LevelRenderer::addParticleInternal(ePARTICLE_TYPE eParticle case eParticleType_dragonbreath: particle = std::make_shared(lev, x, y, z, xa, ya, za); break; + case eParticleType_endRod: + particle = std::make_shared(lev, x, y, z, xa, ya, za); + break; + case eParticleType_fallingDust: + particle = std::make_shared(lev, x, y, z, static_cast(xa), static_cast(ya), static_cast(za)); + break; case eParticleType_barrier: particle = std::make_shared(lev, x, y, z, xa, ya, za); break; @@ -3500,6 +3555,37 @@ void LevelRenderer::levelEvent(shared_ptr source, int type, int x, int y level[playerIndex]->playLocalSound(x + 0.5, y + 0.5, z + 0.5, eSoundType_RANDOM_GLASS, 1, level[playerIndex]->random->nextFloat() * 0.1f + 0.9f, false); } break; + case LevelEvent::SOUND_PORTAL_TRAVEL: + mc->soundEngine->playUI(eSoundType_PORTAL_TRAVEL, 1.0f, random->nextFloat() * 0.4f + 0.8f); + break; + case LevelEvent::SOUND_OPEN_WOODEN_DOOR: + case LevelEvent::SOUND_CLOSE_WOODEN_DOOR: + case LevelEvent::SOUND_OPEN_IRON_DOOR: + case LevelEvent::SOUND_CLOSE_IRON_DOOR: + case LevelEvent::SOUND_OPEN_WOODEN_TRAP_DOOR: + case LevelEvent::SOUND_CLOSE_WOODEN_TRAP_DOOR: + case LevelEvent::SOUND_OPEN_IRON_TRAP_DOOR: + case LevelEvent::SOUND_CLOSE_IRON_TRAP_DOOR: + case LevelEvent::SOUND_OPEN_FENCE_GATE: + case LevelEvent::SOUND_CLOSE_FENCE_GATE: + { + int sound = eSoundType_BLOCK_WOODEN_DOOR_OPEN + (type - LevelEvent::SOUND_OPEN_WOODEN_DOOR); + level[playerIndex]->playLocalSound(x + 0.5, y + 0.5, z + 0.5, sound, 1.0f, random->nextFloat() * 0.1f + 0.9f, false); + } + break; + case LevelEvent::SOUND_CHORUS_GROW: + level[playerIndex]->playLocalSound(x, y, z, eSoundType_BLOCK_CHORUS_FLOWER_GROW, 1.0f, 1.0f, false); + break; + case LevelEvent::SOUND_CHORUS_DEATH: + level[playerIndex]->playLocalSound(x, y, z, eSoundType_BLOCK_CHORUS_FLOWER_DEATH, 1.0f, 1.0f, false); + break; + case LevelEvent::ANIMATION_END_GATEWAY_SPAWN: + level[playerIndex]->addParticle(eParticleType_hugeexplosion, x + 0.5, y + 0.5, z + 0.5, 0, 0, 0); + level[playerIndex]->playLocalSound(x + 0.5, y + 0.5, z + 0.5, eSoundType_RANDOM_EXPLODE, 10.0f, ((random->nextFloat() - random->nextFloat()) * 0.2f + 1.0f) * 0.7f, false); + break; + case LevelEvent::ANIMATION_DRAGON_SUMMON_ROAR: + level[playerIndex]->playLocalSound(x + 0.5, y + 0.5, z + 0.5, eSoundType_MOB_ENDERDRAGON_GROWL, 64.0f, random->nextFloat() * 0.3f + 0.8f, false); + break; case LevelEvent::ENDERDRAGON_FIREBALL_SPLASH: { double xp = x; diff --git a/Minecraft.Client/LocalPlayer.cpp b/Minecraft.Client/LocalPlayer.cpp index 7bef68cf..d42d02ce 100644 --- a/Minecraft.Client/LocalPlayer.cpp +++ b/Minecraft.Client/LocalPlayer.cpp @@ -599,8 +599,6 @@ void LocalPlayer::changeDimension(int i) else { awardStat(GenericStats::theEnd(), GenericStats::param_theEnd()); - - minecraft->soundEngine->playUI(eSoundType_PORTAL_TRAVEL, 1, random->nextFloat() * 0.4f + 0.8f); } } } diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 23344189..751b321f 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -2636,7 +2636,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) break; case Item::bow_Id: // draw or release - if ( player->abilities.instabuild || player->inventory->hasResource(Item::arrow_Id) ) + if ( player->abilities.instabuild || BowItem::hasAmmo(player) ) { if (player->isUsingItem()) *piUse=IDS_TOOLTIPS_RELEASE_BOW; else *piUse=IDS_TOOLTIPS_DRAW_BOW; @@ -3479,6 +3479,17 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) } break; + case eTYPE_SNOWMAN: + { + shared_ptr snowMan = dynamic_pointer_cast(hitResult->entity); + if (snowMan != nullptr && heldItemId == Item::shears_Id && snowMan->hasPumpkin()) + { + *piUse=IDS_TOOLTIPS_SHEAR; + } + *piAction=IDS_TOOLTIPS_HIT; + } + break; + case eTYPE_ZOMBIE: { shared_ptr zomb = dynamic_pointer_cast(hitResult->entity); diff --git a/Minecraft.Client/MultiPlayerLevel.cpp b/Minecraft.Client/MultiPlayerLevel.cpp index 709756be..d002866a 100644 --- a/Minecraft.Client/MultiPlayerLevel.cpp +++ b/Minecraft.Client/MultiPlayerLevel.cpp @@ -864,9 +864,9 @@ void MultiPlayerLevel::removeAllPendingEntityRemovals() if (e->riding != nullptr) { - if (e->riding->removed || e->riding->rider.lock() != e) + if (e->riding->removed || !e->riding->hasRider(e)) { - e->riding->rider = weak_ptr(); + e->riding->removeRider(e); e->riding = nullptr; } else diff --git a/Minecraft.Client/MultiPlayerLocalPlayer.cpp b/Minecraft.Client/MultiPlayerLocalPlayer.cpp index 74f44054..655f2cec 100644 --- a/Minecraft.Client/MultiPlayerLocalPlayer.cpp +++ b/Minecraft.Client/MultiPlayerLocalPlayer.cpp @@ -13,6 +13,7 @@ #include "../Minecraft.World/net.minecraft.world.effect.h" #include "../Minecraft.World/LevelData.h" #include "../Minecraft.World/net.minecraft.world.entity.item.h" +#include "../Minecraft.World/MoveVehiclePacket.h" #include "Input.h" #include "LevelRenderer.h" @@ -79,6 +80,8 @@ void MultiplayerLocalPlayer::tick() { connection->send(std::make_shared(yRot, xRot, onGround, abilities.flying || isElytraFlying())); connection->send(std::make_shared(xxa, yya, input->jumping, input->sneaking)); + shared_ptr boat = riding->instanceof(eTYPE_BOAT) ? dynamic_pointer_cast(riding) : nullptr; + if (boat != nullptr && boat->isLocallyDriven()) connection->send(std::make_shared(boat->x, boat->y, boat->z, boat->yRot, boat->xRot)); } else { diff --git a/Minecraft.Client/PlayerConnection.cpp b/Minecraft.Client/PlayerConnection.cpp index 6e8c9605..e8715dd2 100644 --- a/Minecraft.Client/PlayerConnection.cpp +++ b/Minecraft.Client/PlayerConnection.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "../Minecraft.World/MoveVehiclePacket.h" #include "PlayerConnection.h" #include "ServerPlayer.h" #include "ServerLevel.h" @@ -242,6 +243,24 @@ void PlayerConnection::handlePlayerInput(shared_ptr packet) player->setPlayerInput(packet->getXxa(), packet->getYya(), packet->isJumping(), packet->isSneaking()); } +void PlayerConnection::handleMoveVehicle(shared_ptr packet) +{ + shared_ptr vehicle = player->riding; + if (vehicle == nullptr || !vehicle->instanceof(eTYPE_BOAT) || vehicle->rider.lock() != player) return; + + double dx = packet->x - vehicle->x; + double dy = packet->y - vehicle->y; + double dz = packet->z - vehicle->z; + if (dx * dx + dy * dy + dz * dz - (vehicle->xd * vehicle->xd + vehicle->yd * vehicle->yd + vehicle->zd * vehicle->zd) > 100.0) + { + send(std::make_shared(vehicle->x, vehicle->y, vehicle->z, vehicle->yRot, vehicle->xRot)); + return; + } + + vehicle->absMoveTo(packet->x, packet->y, packet->z, packet->yRot, packet->xRot); + vehicle->positionRider(player); +} + void PlayerConnection::handleMovePlayer(shared_ptr packet) { ServerLevel *level = server->getLevel(player->dimension); @@ -267,7 +286,7 @@ void PlayerConnection::handleMovePlayer(shared_ptr packet) float yRotT = player->yRot; float xRotT = player->xRot; - player->riding->positionRider(); + player->riding->positionRider(player); double xt = player->x; double yt = player->y; double zt = player->z; @@ -283,7 +302,7 @@ void PlayerConnection::handleMovePlayer(shared_ptr packet) player->doTick(false); player->ySlideOffset = 0; player->absMoveTo(xt, yt, zt, yRotT, xRotT); - if (player->riding != nullptr) player->riding->positionRider(); + if (player->riding != nullptr) player->riding->positionRider(player); server->getPlayers()->move(player); // player may have been kicked off the mount during the tick, so diff --git a/Minecraft.Client/PlayerConnection.h b/Minecraft.Client/PlayerConnection.h index 796499c3..2ea1d36e 100644 --- a/Minecraft.Client/PlayerConnection.h +++ b/Minecraft.Client/PlayerConnection.h @@ -60,6 +60,7 @@ private: public: virtual void handlePlayerInput(shared_ptr packet); + virtual void handleMoveVehicle(shared_ptr packet); virtual void handleMovePlayer(shared_ptr packet); void teleport(double x, double y, double z, float yRot, float xRot, bool sendPacket = true); // 4J Added sendPacket param virtual void handlePlayerAction(shared_ptr packet); diff --git a/Minecraft.Client/PlayerList.cpp b/Minecraft.Client/PlayerList.cpp index 83c37c7e..9139235f 100644 --- a/Minecraft.Client/PlayerList.cpp +++ b/Minecraft.Client/PlayerList.cpp @@ -317,7 +317,8 @@ bool PlayerList::placeNewPlayer(Connection *connection, shared_ptr player->getAllPlayerGamePrivileges(), level->getLevelData()->getXZSize(), level->getLevelData()->getHellScale(), - level->getLevelData()->isHardcore())); + level->getLevelData()->isHardcore(), + level->getLevelData()->isModernEnd())); playerConnection->send(std::make_shared(spawnPos->x, spawnPos->y, spawnPos->z)); playerConnection->send(std::make_shared(&player->abilities)); playerConnection->send(std::make_shared(player->inventory->selected)); @@ -350,7 +351,7 @@ bool PlayerList::placeNewPlayer(Connection *connection, shared_ptr playerConnection->send(std::make_shared(level->getGameTime(), level->getDayTime(), level->getGameRules()->getBoolean(GameRules::RULE_DAYLIGHT))); auto activeEffects = player->getActiveEffects(); - for(MobEffectInstance *effect : *player->getActiveEffects()) + for(MobEffectInstance *effect : activeEffects) { playerConnection->send(std::make_shared(player->entityId, effect)); } @@ -926,7 +927,7 @@ shared_ptr PlayerList::respawn(shared_ptr serverPlay player->connection->send( std::make_shared( static_cast(player->dimension), player->level->getSeed(), player->level->getMaxBuildHeight(), player->gameMode->getGameModeForPlayer(), level->difficulty, level->getLevelData()->getGenerator(), - player->level->useNewSeaLevel(), player->entityId, level->getLevelData()->getXZSize(), level->getLevelData()->getHellScale(), level->getLevelData()->isHardcore() ) ); + player->level->useNewSeaLevel(), player->entityId, level->getLevelData()->getXZSize(), level->getLevelData()->getHellScale(), level->getLevelData()->isHardcore(), level->getLevelData()->isModernEnd() ) ); player->connection->teleport(player->x, player->y, player->z, player->yRot, player->xRot); player->connection->send( std::make_shared( player->experienceProgress, player->totalExperience, player->experienceLevel) ); @@ -1045,7 +1046,7 @@ void PlayerList::toggleDimension(shared_ptr player, int targetDime player->connection->send(std::make_shared(static_cast(player->dimension), newLevel->getSeed(), newLevel->getMaxBuildHeight(), player->gameMode->getGameModeForPlayer(), newLevel->difficulty, newLevel->getLevelData()->getGenerator(), - newLevel->useNewSeaLevel(), player->entityId, newLevel->getLevelData()->getXZSize(), newLevel->getLevelData()->getHellScale(), newLevel->getLevelData()->isHardcore())); + newLevel->useNewSeaLevel(), player->entityId, newLevel->getLevelData()->getXZSize(), newLevel->getLevelData()->getHellScale(), newLevel->getLevelData()->isHardcore(), newLevel->getLevelData()->isModernEnd())); oldLevel->removeEntityImmediately(player); player->removed = false; diff --git a/Minecraft.Client/PreStitchedTextureMap.cpp b/Minecraft.Client/PreStitchedTextureMap.cpp index c2922c10..f2d2424d 100644 --- a/Minecraft.Client/PreStitchedTextureMap.cpp +++ b/Minecraft.Client/PreStitchedTextureMap.cpp @@ -582,6 +582,19 @@ void PreStitchedTextureMap::loadUVs() ADD_ICON(13, 13, L"prismarineShard"); ADD_ICON(0, 15, L"elytra"); ADD_ICON(1, 15, L"broken_elytra"); + ADD_ICON(2, 15, L"chorus_fruit"); + ADD_ICON(3, 15, L"chorus_fruit_popped"); + ADD_ICON(2, 6, L"end_crystal"); + ADD_ICON(9, 1, L"spectral_arrow"); + ADD_ICON(10, 1, L"tipped_arrow_base"); + ADD_ICON(10, 2, L"dragon_breath"); + ADD_ICON(11, 1, L"tipped_arrow_head"); + ADD_ICON(11, 2, L"potion_bottle_lingering"); + ADD_ICON(13, 8, L"acacia_boat"); + ADD_ICON(13, 9, L"birch_boat"); + ADD_ICON(13, 10, L"dark_oak_boat"); + ADD_ICON(13, 11, L"jungle_boat"); + ADD_ICON(13, 12, L"spruce_boat"); ADD_ICON_WITH_NAME(14, 7, L"compassP0", L"compass") // 4J Added ADD_ICON_WITH_NAME(14, 8, L"compassP1", L"compass") // 4J Added @@ -1085,6 +1098,14 @@ void PreStitchedTextureMap::loadUVs() ADD_ICON(26, 1, L"bone_block_top"); ADD_ICON(26, 0, L"bone_block_side"); + ADD_ICON(24, 5, L"purpur_block"); + ADD_ICON(24, 6, L"purpur_pillar"); + ADD_ICON(24, 7, L"purpur_pillar_top"); + ADD_ICON(24, 8, L"end_rod"); + ADD_ICON(23, 5, L"chorus_flower"); + ADD_ICON(23, 6, L"chorus_flower_dead"); + ADD_ICON(23, 7, L"chorus_flower_plant"); + ADD_ICON(25, 0, L"beetroots_stage_0"); ADD_ICON(25, 1, L"beetroots_stage_1"); ADD_ICON(25, 2, L"beetroots_stage_2"); diff --git a/Minecraft.Client/ServerLevel.cpp b/Minecraft.Client/ServerLevel.cpp index 1ba6a85a..5665a787 100644 --- a/Minecraft.Client/ServerLevel.cpp +++ b/Minecraft.Client/ServerLevel.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "ServerLevel.h" +#include "../Minecraft.World/EndDragonFight.h" #include #include "MinecraftServer.h" @@ -214,6 +215,9 @@ void ServerLevel::tick() dimension->biomeSource->update(); + EndDragonFight *dragonFight = EndDragonFight::get(this); + if (dragonFight != nullptr) dragonFight->tick(); + if (allPlayersAreSleeping()) { if (getGameRules()->getBoolean(GameRules::RULE_DAYLIGHT)) diff --git a/Minecraft.Client/ServerPlayer.cpp b/Minecraft.Client/ServerPlayer.cpp index 1da68599..be5c1227 100644 --- a/Minecraft.Client/ServerPlayer.cpp +++ b/Minecraft.Client/ServerPlayer.cpp @@ -13,6 +13,7 @@ #include "../Minecraft.World/SoundTypes.h" #include "../Minecraft.World/net.minecraft.network.packet.h" +#include "../Minecraft.World/LevelEvent.h" #include "../Minecraft.World/net.minecraft.world.damagesource.h" #include "../Minecraft.World/net.minecraft.world.inventory.h" #include "../Minecraft.World/net.minecraft.world.level.h" @@ -1108,14 +1109,8 @@ void ServerPlayer::changeDimension(int i) // 4J: Removed on the advice of the mighty King of Achievments (JV) // awardStat(GenericStats::portal(), GenericStats::param_portal()); } - // play the travel whoosh right before the actual dimension swap - Minecraft *mc = Minecraft::GetInstance(); - if (mc != nullptr && mc->soundEngine != nullptr) - { - mc->soundEngine->playUI(eSoundType_PORTAL_TRAVEL, 1, 1.0f); - } - server->getPlayers()->toggleDimension( dynamic_pointer_cast(shared_from_this()), i); + connection->send(std::make_shared(LevelEvent::SOUND_PORTAL_TRAVEL, 0, 0, 0, 0, false)); #if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD) if (portalDestModified) { diff --git a/Minecraft.Client/ShulkerBulletRenderer.cpp b/Minecraft.Client/ShulkerBulletRenderer.cpp new file mode 100644 index 00000000..2f336eae --- /dev/null +++ b/Minecraft.Client/ShulkerBulletRenderer.cpp @@ -0,0 +1,72 @@ +#include "stdafx.h" +#include "ShulkerBulletRenderer.h" +#include "Model.h" +#include "ModelPart.h" +#include "../Minecraft.World/ShulkerBullet.h" +#include "../Minecraft.World/Mth.h" + +ResourceLocation ShulkerBulletRenderer::SPARK_LOCATION = ResourceLocation(TN_MOB_SHULKER_SPARK); + +namespace +{ + class ShulkerBulletModel : public Model + { + public: + ShulkerBulletModel() { texWidth = 64; texHeight = 32; } + }; + + float rotlerp(float from, float to, float a) + { + float diff = to - from; + while (diff < -180.0f) diff += 360.0f; + while (diff >= 180.0f) diff -= 360.0f; + return from + a * diff; + } +} + +ShulkerBulletRenderer::ShulkerBulletRenderer() : EntityRenderer() +{ + bulletModel = new ShulkerBulletModel(); + bulletPart = new ModelPart(bulletModel, 0, 0); + bulletPart->addBox(-4.0f, -4.0f, -1.0f, 8, 8, 2); + bulletPart->texOffs(0, 10)->addBox(-1.0f, -4.0f, -4.0f, 2, 8, 8); + bulletPart->texOffs(20, 0)->addBox(-4.0f, -1.0f, -4.0f, 8, 2, 8); + bulletPart->setPos(0.0f, 0.0f, 0.0f); + bulletPart->compile(1.0f / 32.0f); +} + +void ShulkerBulletRenderer::render(shared_ptr entity, double x, double y, double z, float rot, float a) +{ + float yRot = rotlerp(entity->yRotO, entity->yRot, a); + float xRot = entity->xRotO + (entity->xRot - entity->xRotO) * a; + float t = entity->tickCount + a; + + glPushMatrix(); + glTranslatef(static_cast(x), static_cast(y) + 0.15f, static_cast(z)); + glRotatef(Mth::sin(t * 0.1f) * 180.0f, 0.0f, 1.0f, 0.0f); + glRotatef(Mth::cos(t * 0.1f) * 180.0f, 1.0f, 0.0f, 0.0f); + glRotatef(Mth::sin(t * 0.15f) * 360.0f, 0.0f, 0.0f, 1.0f); + glEnable(GL_RESCALE_NORMAL); + glScalef(-1.0f, -1.0f, 1.0f); + + bulletPart->yRot = yRot * PI / 180.0f; + bulletPart->xRot = xRot * PI / 180.0f; + + bindTexture(entity); + bulletPart->render(1.0f / 32.0f, true); + + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4f(1.0f, 1.0f, 1.0f, 0.5f); + glScalef(1.5f, 1.5f, 1.5f); + bulletPart->render(1.0f / 32.0f, true); + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + glDisable(GL_BLEND); + glDisable(GL_RESCALE_NORMAL); + glPopMatrix(); +} + +ResourceLocation *ShulkerBulletRenderer::getTextureLocation(shared_ptr mob) +{ + return &SPARK_LOCATION; +} diff --git a/Minecraft.Client/ShulkerBulletRenderer.h b/Minecraft.Client/ShulkerBulletRenderer.h new file mode 100644 index 00000000..2ede803c --- /dev/null +++ b/Minecraft.Client/ShulkerBulletRenderer.h @@ -0,0 +1,19 @@ +#pragma once +#include "EntityRenderer.h" + +class Model; +class ModelPart; + +class ShulkerBulletRenderer : public EntityRenderer +{ +private: + static ResourceLocation SPARK_LOCATION; + Model *bulletModel; + ModelPart *bulletPart; + +public: + ShulkerBulletRenderer(); + + virtual void render(shared_ptr entity, double x, double y, double z, float rot, float a); + virtual ResourceLocation *getTextureLocation(shared_ptr mob); +}; diff --git a/Minecraft.Client/ShulkerModel.cpp b/Minecraft.Client/ShulkerModel.cpp new file mode 100644 index 00000000..18c90706 --- /dev/null +++ b/Minecraft.Client/ShulkerModel.cpp @@ -0,0 +1,75 @@ +#include "stdafx.h" +#include "ShulkerModel.h" +#include "../Minecraft.World/Shulker.h" +#include "../Minecraft.World/Mth.h" +#include "Minecraft.h" +#include "Common/Colours/ColourTable.h" + +ShulkerModel::ShulkerModel() : Model() +{ + texWidth = 64; + texHeight = 128; + mainPass = false; + + lid = new ModelPart(this, 0, 0); + lid->addBox(-8.0f, -16.0f, -8.0f, 16, 12, 16, 0.01f); + lid->setPos(0.0f, 24.0f, 0.0f); + + base = new ModelPart(this, 0, 28); + base->addBox(-8.0f, -8.0f, -8.0f, 16, 8, 16); + base->setPos(0.0f, 24.0f, 0.0f); + + head = new ModelPart(this, 0, 116); + head->addBox(-3.0f, 0.0f, -3.0f, 6, 6, 6); + head->setPos(0.0f, 12.0f, 0.0f); + + lid->compile(1.0f / 16.0f); + base->compile(1.0f / 16.0f); + head->compile(1.0f / 16.0f); +} + +void ShulkerModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr entity, unsigned int uiBitmaskOverrideAnim) +{ + shared_ptr shulker = dynamic_pointer_cast(entity); + if (shulker == nullptr) return; + + float a = bob - static_cast(shulker->tickCount); + float peek = shulker->getClientPeekAmount(a); + float peekAngle = (peek + 0.5f) * PI; + float lidTwist = Mth::sin(peekAngle) - 1.0f; + float wobble = peekAngle > PI ? Mth::sin(bob * 0.1f) * 0.7f : 0.0f; + + lid->setPos(0.0f, 16.0f + Mth::sin(peekAngle) * 8.0f + wobble, 0.0f); + lid->yRot = peek > 0.3f ? lidTwist * lidTwist * lidTwist * lidTwist * PI * 0.125f : 0.0f; + + head->xRot = xRot * PI / 180.0f; + head->yRot = yRot * PI / 180.0f; +} + +void ShulkerModel::render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) +{ + setupAnim(time, r, bob, yRot, xRot, scale, entity); + + if (!mainPass) + { + base->render(scale, usecompiled); + lid->render(scale, usecompiled); + return; + } + + const unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor(eMinecraftColour_Mob_Shulker_Shell); + glColor3f(((colour >> 16) & 0xff) / 255.0f, ((colour >> 8) & 0xff) / 255.0f, (colour & 0xff) / 255.0f); + base->render(scale, usecompiled); + lid->render(scale, usecompiled); + glColor3f(1.0f, 1.0f, 1.0f); + + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glTranslatef(0.0f, 0.5f, 0.0f); + glMatrixMode(GL_MODELVIEW); + base->render(scale, usecompiled); + lid->render(scale, usecompiled); + glMatrixMode(GL_TEXTURE); + glLoadIdentity(); + glMatrixMode(GL_MODELVIEW); +} diff --git a/Minecraft.Client/ShulkerModel.h b/Minecraft.Client/ShulkerModel.h new file mode 100644 index 00000000..94253bd5 --- /dev/null +++ b/Minecraft.Client/ShulkerModel.h @@ -0,0 +1,17 @@ +#pragma once +#include "Model.h" +#include "ModelPart.h" + +class ShulkerModel : public Model +{ +public: + ModelPart *lid; + ModelPart *base; + ModelPart *head; + + bool mainPass; + + ShulkerModel(); + virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr entity, unsigned int uiBitmaskOverrideAnim = 0); + virtual void render(shared_ptr entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled); +}; diff --git a/Minecraft.Client/ShulkerRenderer.cpp b/Minecraft.Client/ShulkerRenderer.cpp new file mode 100644 index 00000000..1f211783 --- /dev/null +++ b/Minecraft.Client/ShulkerRenderer.cpp @@ -0,0 +1,127 @@ +#include "stdafx.h" +#include "ShulkerRenderer.h" +#include "ShulkerModel.h" +#include "../Minecraft.World/Shulker.h" +#include "../Minecraft.World/Facing.h" + +ResourceLocation ShulkerRenderer::SHULKER_LOCATION = ResourceLocation(TN_MOB_SHULKER); + +ShulkerRenderer::ShulkerRenderer() : MobRenderer(new ShulkerModel(), 0.0f) +{ + shulkerModel = static_cast(resModel); +} + +void ShulkerRenderer::render(shared_ptr _mob, double x, double y, double z, float rot, float a) +{ + shared_ptr shulker = dynamic_pointer_cast(_mob); + int interpolation = shulker->getClientSideTeleportInterpolation(); + if (interpolation > 0 && shulker->hasOldAttachPosition()) + { + double progress = (interpolation - a) / 6.0; + progress *= progress; + x -= (shulker->getAttachX() - shulker->getOldAttachX()) * progress; + y -= (shulker->getAttachY() - shulker->getOldAttachY()) * progress; + z -= (shulker->getAttachZ() - shulker->getOldAttachZ()) * progress; + } + MobRenderer::render(_mob, x, y, z, rot, a); +} + +ResourceLocation *ShulkerRenderer::getTextureLocation(shared_ptr mob) +{ + return &SHULKER_LOCATION; +} + +void ShulkerRenderer::setupRotations(shared_ptr mob, float bob, float bodyRot, float a) +{ + MobRenderer::setupRotations(mob, bob, bodyRot, a); + + switch (dynamic_pointer_cast(mob)->getAttachFace()) + { + case Facing::EAST: + glTranslatef(0.5f, 0.5f, 0.0f); + glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + glRotatef(90.0f, 0.0f, 0.0f, 1.0f); + break; + case Facing::WEST: + glTranslatef(-0.5f, 0.5f, 0.0f); + glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + glRotatef(-90.0f, 0.0f, 0.0f, 1.0f); + break; + case Facing::NORTH: + glTranslatef(0.0f, 0.5f, -0.5f); + glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + break; + case Facing::SOUTH: + glTranslatef(0.0f, 0.5f, 0.5f); + glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + glRotatef(180.0f, 0.0f, 0.0f, 1.0f); + break; + case Facing::UP: + glTranslatef(0.0f, 1.0f, 0.0f); + glRotatef(180.0f, 1.0f, 0.0f, 0.0f); + break; + default: + break; + } +} + +void ShulkerRenderer::scale(shared_ptr mob, float a) +{ + glScalef(0.999f, 0.999f, 0.999f); +} + +void ShulkerRenderer::additionalRendering(shared_ptr mob, float a) +{ + MobRenderer::additionalRendering(mob, a); + + shared_ptr shulker = dynamic_pointer_cast(mob); + if (shulker == nullptr || shulker->isInvisible()) return; + + glPushMatrix(); + switch (shulker->getAttachFace()) + { + case Facing::EAST: + glRotatef(90.0f, 0.0f, 0.0f, 1.0f); + glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + glTranslatef(1.0f, -1.0f, 0.0f); + glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + break; + case Facing::WEST: + glRotatef(-90.0f, 0.0f, 0.0f, 1.0f); + glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + glTranslatef(-1.0f, -1.0f, 0.0f); + glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + break; + case Facing::NORTH: + glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + glTranslatef(0.0f, -1.0f, -1.0f); + break; + case Facing::SOUTH: + glRotatef(180.0f, 0.0f, 0.0f, 1.0f); + glRotatef(90.0f, 1.0f, 0.0f, 0.0f); + glTranslatef(0.0f, -1.0f, 1.0f); + break; + case Facing::UP: + glRotatef(180.0f, 1.0f, 0.0f, 0.0f); + glTranslatef(0.0f, -2.0f, 0.0f); + break; + default: + break; + } + + float headRot = mob->yHeadRotO + (mob->yHeadRot - mob->yHeadRotO) * a; + float bodyRot = mob->yBodyRotO + (mob->yBodyRot - mob->yBodyRotO) * a; + float headPitch = mob->xRotO + (mob->xRot - mob->xRotO) * a; + shulkerModel->head->yRot = (headRot - bodyRot) * PI / 180.0f; + shulkerModel->head->xRot = headPitch * PI / 180.0f; + bindTexture(&SHULKER_LOCATION); + shulkerModel->head->render(1.0f / 16.0f, true); + glPopMatrix(); +} + +void ShulkerRenderer::renderModel(shared_ptr mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale) +{ + shulkerModel->mainPass = !EntityRenderer::solidColourPass; + MobRenderer::renderModel(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale); + shulkerModel->mainPass = false; +} diff --git a/Minecraft.Client/ShulkerRenderer.h b/Minecraft.Client/ShulkerRenderer.h new file mode 100644 index 00000000..55eee9d8 --- /dev/null +++ b/Minecraft.Client/ShulkerRenderer.h @@ -0,0 +1,23 @@ +#pragma once +#include "MobRenderer.h" + +class ShulkerModel; + +class ShulkerRenderer : public MobRenderer +{ +private: + static ResourceLocation SHULKER_LOCATION; + ShulkerModel *shulkerModel; + +public: + ShulkerRenderer(); + + virtual void render(shared_ptr _mob, double x, double y, double z, float rot, float a); + virtual ResourceLocation *getTextureLocation(shared_ptr mob); + +protected: + virtual void setupRotations(shared_ptr mob, float bob, float bodyRot, float a); + virtual void scale(shared_ptr mob, float a); + virtual void additionalRendering(shared_ptr mob, float a); + virtual void renderModel(shared_ptr mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale); +}; diff --git a/Minecraft.Client/SkeletonModel.cpp b/Minecraft.Client/SkeletonModel.cpp index b8d3103d..19f563a3 100644 --- a/Minecraft.Client/SkeletonModel.cpp +++ b/Minecraft.Client/SkeletonModel.cpp @@ -2,6 +2,7 @@ #include "SkeletonModel.h" #include "../Minecraft.World/Mth.h" #include "../Minecraft.World/net.minecraft.world.entity.monster.h" +#include "../Minecraft.World/net.minecraft.world.item.h" #include "ModelPart.h" void SkeletonModel::_init(float g) @@ -44,12 +45,21 @@ SkeletonModel::SkeletonModel(float g) : ZombieModel(g, 0, 64, 32) void SkeletonModel::prepareMobModel(shared_ptr mob, float time, float r, float a) { ZombieModel::prepareMobModel(mob, time, r, a); - - bowAndArrow = dynamic_pointer_cast(mob)->getSkeletonType() == Skeleton::TYPE_WITHER; } void SkeletonModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr entity, unsigned int uiBitmaskOverrideAnim) { - bowAndArrow=true; - ZombieModel::setupAnim(time, r, bob, yRot, xRot, scale, entity, uiBitmaskOverrideAnim); + shared_ptr skeleton = dynamic_pointer_cast(entity); + shared_ptr carried = skeleton != nullptr ? skeleton->getCarriedItem() : nullptr; + bool holdingBow = carried != nullptr && carried->id == Item::bow_Id; + bool aggressive = skeleton != nullptr && skeleton->isAggressive(); + bowAndArrow = holdingBow && aggressive; + if (aggressive && !holdingBow) + { + ZombieModel::setupAnim(time, r, bob, yRot, xRot, scale, entity, uiBitmaskOverrideAnim); + } + else + { + HumanoidModel::setupAnim(time, r, bob, yRot, xRot, scale, entity, uiBitmaskOverrideAnim); + } } \ No newline at end of file diff --git a/Minecraft.Client/SkeletonRenderer.cpp b/Minecraft.Client/SkeletonRenderer.cpp index 56682ddf..8246534a 100644 --- a/Minecraft.Client/SkeletonRenderer.cpp +++ b/Minecraft.Client/SkeletonRenderer.cpp @@ -5,9 +5,12 @@ ResourceLocation SkeletonRenderer::SKELETON_LOCATION = ResourceLocation(TN_MOB_SKELETON); ResourceLocation SkeletonRenderer::WITHER_SKELETON_LOCATION = ResourceLocation(TN_MOB_WITHER_SKELETON); +ResourceLocation SkeletonRenderer::STRAY_LOCATION = ResourceLocation(TN_MOB_STRAY); +ResourceLocation SkeletonRenderer::STRAY_CLOTHES_LOCATION = ResourceLocation(TN_MOB_STRAY_OVERLAY); SkeletonRenderer::SkeletonRenderer() : HumanoidMobRenderer(new SkeletonModel(), .5f) { + strayClothesModel = new SkeletonModel(0.25f); } void SkeletonRenderer::scale(shared_ptr mob, float a) @@ -31,5 +34,28 @@ ResourceLocation *SkeletonRenderer::getTextureLocation(shared_ptr entity { return &WITHER_SKELETON_LOCATION; } + if (skeleton->getSkeletonType() == Skeleton::TYPE_STRAY) + { + return &STRAY_LOCATION; + } return &SKELETON_LOCATION; -} \ No newline at end of file +} +void SkeletonRenderer::renderModel(shared_ptr mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale) +{ + HumanoidMobRenderer::renderModel(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale); + + shared_ptr skeleton = dynamic_pointer_cast(mob); + if (skeleton == nullptr || skeleton->getSkeletonType() != Skeleton::TYPE_STRAY || mob->isInvisible()) return; + + HumanoidModel *body = static_cast(resModel); + strayClothesModel->attackTime = body->attackTime; + strayClothesModel->riding = body->riding; + strayClothesModel->young = body->young; + strayClothesModel->holdingLeftHand = body->holdingLeftHand; + strayClothesModel->holdingRightHand = body->holdingRightHand; + strayClothesModel->sneaking = body->sneaking; + strayClothesModel->bowAndArrow = body->bowAndArrow; + + bindTexture(&STRAY_CLOTHES_LOCATION); + strayClothesModel->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true); +} diff --git a/Minecraft.Client/SkeletonRenderer.h b/Minecraft.Client/SkeletonRenderer.h index ca996878..02f6c70e 100644 --- a/Minecraft.Client/SkeletonRenderer.h +++ b/Minecraft.Client/SkeletonRenderer.h @@ -1,11 +1,17 @@ #pragma once #include "HumanoidMobRenderer.h" +class SkeletonModel; + class SkeletonRenderer : public HumanoidMobRenderer { private: static ResourceLocation SKELETON_LOCATION; static ResourceLocation WITHER_SKELETON_LOCATION; + static ResourceLocation STRAY_LOCATION; + static ResourceLocation STRAY_CLOTHES_LOCATION; + + SkeletonModel *strayClothesModel; public: SkeletonRenderer(); @@ -14,4 +20,5 @@ protected: virtual void scale(shared_ptr mob, float a); void translateWeaponItem(); virtual ResourceLocation *getTextureLocation(shared_ptr entity); -}; \ No newline at end of file + virtual void renderModel(shared_ptr mob, float wp, float ws, float bob, float headRotMinusBodyRot, float headRotx, float scale); +}; diff --git a/Minecraft.Client/SkullTileRenderer.cpp b/Minecraft.Client/SkullTileRenderer.cpp index 5c998657..ab0b694e 100644 --- a/Minecraft.Client/SkullTileRenderer.cpp +++ b/Minecraft.Client/SkullTileRenderer.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "SkullTileRenderer.h" #include "SkeletonHeadModel.h" +#include "DragonHeadModel.h" #include "PlayerRenderer.h" #include "../Minecraft.World/SkullTileEntity.h" #include "../Minecraft.World/net.minecraft.h" @@ -12,23 +13,26 @@ ResourceLocation SkullTileRenderer::SKELETON_LOCATION = ResourceLocation(TN_MOB_ ResourceLocation SkullTileRenderer::WITHER_SKELETON_LOCATION = ResourceLocation(TN_MOB_WITHER_SKELETON); ResourceLocation SkullTileRenderer::ZOMBIE_LOCATION = ResourceLocation(TN_MOB_ZOMBIE); ResourceLocation SkullTileRenderer::CREEPER_LOCATION = ResourceLocation(TN_MOB_CREEPER); +ResourceLocation SkullTileRenderer::DRAGON_LOCATION = ResourceLocation(TN_MOB_ENDERDRAGON); SkullTileRenderer::SkullTileRenderer() { skeletonModel = new SkeletonHeadModel(0, 0, 64, 32); zombieModel = new SkeletonHeadModel(0, 0, 64, 32); + dragonModel = new DragonHeadModel(); } SkullTileRenderer::~SkullTileRenderer() { delete skeletonModel; delete zombieModel; + delete dragonModel; } void SkullTileRenderer::render(shared_ptr _skull, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) { shared_ptr skull = dynamic_pointer_cast(_skull); - renderSkull(static_cast(x), static_cast(y), static_cast(z), skull->getData() & SkullTile::PLACEMENT_MASK, skull->getRotation() * 360 / 16.0f, skull->getSkullType(), skull->getExtraType()); + renderSkull(static_cast(x), static_cast(y), static_cast(z), skull->getData() & SkullTile::PLACEMENT_MASK, skull->getRotation() * 360 / 16.0f, skull->getSkullType(), skull->getExtraType(), skull->getMouthAnimation(a)); } void SkullTileRenderer::init(TileEntityRenderDispatcher *tileEntityRenderDispatcher) @@ -37,7 +41,7 @@ void SkullTileRenderer::init(TileEntityRenderDispatcher *tileEntityRenderDispatc instance = this; } -void SkullTileRenderer::renderSkull(float x, float y, float z, int face, float rot, int type, const wstring &extra) +void SkullTileRenderer::renderSkull(float x, float y, float z, int face, float rot, int type, const wstring &extra, float mouthAnimation) { Model *model = skeletonModel; @@ -60,6 +64,10 @@ void SkullTileRenderer::renderSkull(float x, float y, float z, int face, float r case SkullTileEntity::TYPE_CREEPER: bindTexture(&CREEPER_LOCATION); break; + case SkullTileEntity::TYPE_DRAGON: + bindTexture(&DRAGON_LOCATION); + model = dragonModel; + break; case SkullTileEntity::TYPE_SKELETON: default: bindTexture(&SKELETON_LOCATION); @@ -102,7 +110,7 @@ void SkullTileRenderer::renderSkull(float x, float y, float z, int face, float r glEnable(GL_ALPHA_TEST); - model->render(nullptr, 0, 0, 0, rot, 0, scale,true); + model->render(nullptr, mouthAnimation, 0, 0, rot, 0, scale,true); glPopMatrix(); } diff --git a/Minecraft.Client/SkullTileRenderer.h b/Minecraft.Client/SkullTileRenderer.h index ea509b8b..da0d2a9c 100644 --- a/Minecraft.Client/SkullTileRenderer.h +++ b/Minecraft.Client/SkullTileRenderer.h @@ -3,6 +3,7 @@ #include "TileEntityRenderer.h" class SkeletonHeadModel; +class DragonHeadModel; class SkullTileRenderer : public TileEntityRenderer { @@ -14,10 +15,12 @@ private: static ResourceLocation WITHER_SKELETON_LOCATION; static ResourceLocation ZOMBIE_LOCATION; static ResourceLocation CREEPER_LOCATION; + static ResourceLocation DRAGON_LOCATION; // note: this head fits most mobs, just change texture SkeletonHeadModel *skeletonModel; SkeletonHeadModel *zombieModel; + DragonHeadModel *dragonModel; public: SkullTileRenderer(); @@ -25,5 +28,5 @@ public: void render(shared_ptr skull, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled = true); void init(TileEntityRenderDispatcher *tileEntityRenderDispatcher); - void renderSkull(float x, float y, float z, int face, float rot, int type, const wstring &extra); + void renderSkull(float x, float y, float z, int face, float rot, int type, const wstring &extra, float mouthAnimation = 0.0f); }; diff --git a/Minecraft.Client/SnowManRenderer.cpp b/Minecraft.Client/SnowManRenderer.cpp index 77787119..2bc871a3 100644 --- a/Minecraft.Client/SnowManRenderer.cpp +++ b/Minecraft.Client/SnowManRenderer.cpp @@ -23,7 +23,7 @@ void SnowManRenderer::additionalRendering(shared_ptr _mob, float a MobRenderer::additionalRendering(mob, a); shared_ptr headGear = std::make_shared(Tile::pumpkin, 1); - if (headGear != nullptr && headGear->getItem()->id < 256) + if (mob != nullptr && mob->hasPumpkin() && headGear != nullptr && headGear->getItem()->id < 256) { glPushMatrix(); model->head->translateTo(1 / 16.0f); diff --git a/Minecraft.Client/TakeAnimationParticle.cpp b/Minecraft.Client/TakeAnimationParticle.cpp index a33d7904..1d138ed0 100644 --- a/Minecraft.Client/TakeAnimationParticle.cpp +++ b/Minecraft.Client/TakeAnimationParticle.cpp @@ -14,7 +14,7 @@ TakeAnimationParticle::TakeAnimationParticle(Level *level, shared_ptr it this->item = item; this->target = target; - lifeTime = 3; + lifeTime = lifetime; this->yOffs = yOffs; } diff --git a/Minecraft.Client/Textures.cpp b/Minecraft.Client/Textures.cpp index 31fb714d..24c88b1a 100644 --- a/Minecraft.Client/Textures.cpp +++ b/Minecraft.Client/Textures.cpp @@ -197,6 +197,25 @@ const wchar_t *Textures::preLoaded[TN_COUNT] = L"mob/bear/polarbear", L"mob/banner/banner_base", + L"item/spectral_arrow", + L"item/tipped_arrow", + L"item/boat/boat_oak", + L"item/boat/boat_spruce", + L"item/boat/boat_birch", + L"item/boat/boat_jungle", + L"item/boat/boat_acacia", + L"item/boat/boat_darkoak", + L"mob/skeleton/stray", + L"mob/skeleton/stray_overlay", + L"mob/zombie/husk", + L"mob/shulker/endergolem", + L"mob/shulker/spark", + L"mob/zombie_villager/zombie_farmer", + L"mob/zombie_villager/zombie_librarian", + L"mob/zombie_villager/zombie_priest", + L"mob/zombie_villager/zombie_smith", + L"mob/zombie_villager/zombie_butcher", + #ifdef _LARGE_WORLDS L"misc/additionalmapicons", #endif diff --git a/Minecraft.Client/Textures.h b/Minecraft.Client/Textures.h index 6b2fb973..385e439a 100644 --- a/Minecraft.Client/Textures.h +++ b/Minecraft.Client/Textures.h @@ -183,6 +183,25 @@ typedef enum _TEXTURE_NAME TN_MOB_POLARBEAR, TN_MOB_BANNER_BANNER_BASE, + TN_ITEM_SPECTRAL_ARROW, + TN_ITEM_TIPPED_ARROW, + TN_ITEM_BOAT_OAK, + TN_ITEM_BOAT_SPRUCE, + TN_ITEM_BOAT_BIRCH, + TN_ITEM_BOAT_JUNGLE, + TN_ITEM_BOAT_ACACIA, + TN_ITEM_BOAT_DARKOAK, + TN_MOB_STRAY, + TN_MOB_STRAY_OVERLAY, + TN_MOB_HUSK, + TN_MOB_SHULKER, + TN_MOB_SHULKER_SPARK, + TN_MOB_ZOMBIE_VILLAGER_FARMER, + TN_MOB_ZOMBIE_VILLAGER_LIBRARIAN, + TN_MOB_ZOMBIE_VILLAGER_PRIEST, + TN_MOB_ZOMBIE_VILLAGER_SMITH, + TN_MOB_ZOMBIE_VILLAGER_BUTCHER, + #ifdef _LARGE_WORLDS TN_MISC_ADDITIONALMAPICONS, #endif diff --git a/Minecraft.Client/TheEndGatewayRenderer.cpp b/Minecraft.Client/TheEndGatewayRenderer.cpp new file mode 100644 index 00000000..b0d273ea --- /dev/null +++ b/Minecraft.Client/TheEndGatewayRenderer.cpp @@ -0,0 +1,226 @@ +#include "stdafx.h" +#include "../Minecraft.World/Random.h" +#include "../Minecraft.World/net.minecraft.world.level.h" +#include "../Minecraft.World/net.minecraft.world.level.tile.entity.h" +#include "../Minecraft.World/FloatBuffer.h" +#include "../Minecraft.World/Facing.h" +#include "Tesselator.h" +#include "TileEntityRenderDispatcher.h" +#include "TheEndGatewayRenderer.h" + +ResourceLocation TheEndGatewayRenderer::END_SKY_LOCATION = ResourceLocation(TN_MISC_TUNNEL); +ResourceLocation TheEndGatewayRenderer::END_PORTAL_LOCATION = ResourceLocation(TN_MISC_PARTICLEFIELD); +ResourceLocation TheEndGatewayRenderer::BEAM_LOCATION = ResourceLocation(TN_MISC_BEACON_BEAM); +int TheEndGatewayRenderer::RANDOM_SEED = 31100; +Random TheEndGatewayRenderer::RANDOM = Random(RANDOM_SEED); + +TheEndGatewayRenderer::TheEndGatewayRenderer() +{ + lb = MemoryTracker::createFloatBuffer(16); + modelView = MemoryTracker::createFloatBuffer(16); + projection = MemoryTracker::createFloatBuffer(16); +} + +FloatBuffer *TheEndGatewayRenderer::getBuffer(float a, float b, float c, float d) +{ + lb->clear(); + lb->put(a)->put(b)->put(c)->put(d); + lb->flip(); + return lb; +} + +int TheEndGatewayRenderer::getPasses(double distanceSqr) +{ + int passes; + if (distanceSqr > 36864.0) passes = 1; + else if (distanceSqr > 25600.0) passes = 3; + else if (distanceSqr > 16384.0) passes = 5; + else if (distanceSqr > 9216.0) passes = 7; + else if (distanceSqr > 4096.0) passes = 9; + else if (distanceSqr > 1024.0) passes = 11; + else if (distanceSqr > 576.0) passes = 13; + else if (distanceSqr > 256.0) passes = 14; + else passes = 15; + return passes + 1; +} + +void TheEndGatewayRenderer::renderBeam(double x, double y, double z, float a, double height, float r, float g, float b) +{ + if (height == 0) return; + + Level *level = tileEntityRenderDispatcher->level; + float tt = (level != nullptr ? static_cast(level->getGameTime()) : 0.0f) + a; + float texVOff = -tt * 0.2f - floor(-tt * 0.1f); + + bindTexture(&BEAM_LOCATION); + glDisable(GL_CULL_FACE); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); + glDepthMask(false); + + double y0 = y + 0.5; + double y1 = y + 0.5 + height; + double v0 = texVOff; + double v1 = fabs(height) * (0.5 / 0.15) + texVOff; + double rot = tt * 0.025 * -1.5; + + double ax = 0.5 + cos(rot + PI * 0.75) * 0.15, az = 0.5 + sin(rot + PI * 0.75) * 0.15; + double bx = 0.5 + cos(rot + PI * 0.25) * 0.15, bz = 0.5 + sin(rot + PI * 0.25) * 0.15; + double cx = 0.5 + cos(rot + PI * 1.25) * 0.15, cz = 0.5 + sin(rot + PI * 1.25) * 0.15; + double dx = 0.5 + cos(rot + PI * 1.75) * 0.15, dz = 0.5 + sin(rot + PI * 1.75) * 0.15; + + Tesselator *t = Tesselator::getInstance(); + t->begin(); + t->color(r, g, b, 1.0f); + t->vertexUV(x + ax, y1, z + az, 1.0, v1); t->vertexUV(x + ax, y0, z + az, 1.0, v0); t->vertexUV(x + bx, y0, z + bz, 0.0, v0); t->vertexUV(x + bx, y1, z + bz, 0.0, v1); + t->vertexUV(x + dx, y1, z + dz, 1.0, v1); t->vertexUV(x + dx, y0, z + dz, 1.0, v0); t->vertexUV(x + cx, y0, z + cz, 0.0, v0); t->vertexUV(x + cx, y1, z + cz, 0.0, v1); + t->vertexUV(x + bx, y1, z + bz, 1.0, v1); t->vertexUV(x + bx, y0, z + bz, 1.0, v0); t->vertexUV(x + dx, y0, z + dz, 0.0, v0); t->vertexUV(x + dx, y1, z + dz, 0.0, v1); + t->vertexUV(x + cx, y1, z + cz, 1.0, v1); t->vertexUV(x + cx, y0, z + cz, 1.0, v0); t->vertexUV(x + ax, y0, z + az, 0.0, v0); t->vertexUV(x + ax, y1, z + az, 0.0, v1); + t->end(); + + glDepthMask(true); + glDisable(GL_BLEND); + glEnable(GL_CULL_FACE); +} + +void TheEndGatewayRenderer::render(shared_ptr _gateway, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled) +{ + shared_ptr gateway = dynamic_pointer_cast(_gateway); + if (gateway == nullptr) return; + + glDisable(GL_FOG); + glDisable(GL_LIGHTING); + + if (gateway->isSpawning() || gateway->isCoolingDown()) + { + float percent = gateway->isSpawning() ? gateway->getSpawnPercent(a) : gateway->getCooldownPercent(a); + double beamLength = gateway->isSpawning() ? 256.0 - y : 25.0; + percent = Mth::sin(percent * PI); + double beamHeight = floor(percent * beamLength); + float r = gateway->isSpawning() ? 0.70f : 0.48f; + float g = gateway->isSpawning() ? 0.33f : 0.20f; + float b = gateway->isSpawning() ? 0.82f : 0.66f; + renderBeam(x, y, z, a, beamHeight, r, g, b); + renderBeam(x, y, z, a, -beamHeight, r, g, b); + } + + RANDOM.setSeed(RANDOM_SEED); + + glGetFloat(GL_MODELVIEW_MATRIX, modelView); + glGetFloat(GL_PROJECTION_MATRIX, projection); + + int passes = getPasses(x * x + y * y + z * z); + for (int i = 0; i < passes; i++) + { + float brightness = 2.0f / static_cast(18 - i); + if (i == 0) + { + bindTexture(&END_SKY_LOCATION); + brightness = 0.15f; + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + else + { + bindTexture(&END_PORTAL_LOCATION); + if (i == 1) + { + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE); + } + } + + glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); + glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); + glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); + glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + glTexGen(GL_S, GL_EYE_PLANE, getBuffer(1, 0, 0, 0)); + glTexGen(GL_T, GL_EYE_PLANE, getBuffer(0, 1, 0, 0)); + glTexGen(GL_R, GL_EYE_PLANE, getBuffer(0, 0, 1, 0)); + glTexGen(GL_Q, GL_OBJECT_PLANE, getBuffer(0, 0, 0, 1)); + glEnable(GL_TEXTURE_GEN_S); + glEnable(GL_TEXTURE_GEN_T); + glEnable(GL_TEXTURE_GEN_R); + glEnable(GL_TEXTURE_GEN_Q); + + glMatrixMode(GL_TEXTURE); + glPushMatrix(); + glLoadIdentity(); + glTranslatef(0.5f, 0.5f, 0.0f); + glScalef(0.5f, 0.5f, 1.0f); + float layer = static_cast(i + 1); + float timeFraction = static_cast(System::currentTimeMillis() % 800000) / 800000.0f; + glTranslatef(17.0f / layer, (2.0f + layer / 1.5f) * timeFraction, 0.0f); + glRotatef((layer * layer * 4321.0f + layer * 9.0f) * 2.0f, 0.0f, 0.0f, 1.0f); + glScalef(4.5f - layer / 4.0f, 4.5f - layer / 4.0f, 1.0f); + glMultMatrixf(projection->_getDataPointer()); + glMultMatrixf(modelView->_getDataPointer()); + + Tesselator *t = Tesselator::getInstance(); + t->useProjectedTexture(true); + t->begin(); + + float r = RANDOM.nextFloat() * 0.5f + 0.1f; + float g = RANDOM.nextFloat() * 0.5f + 0.4f; + float b = RANDOM.nextFloat() * 0.5f + 0.5f; + if (i == 0) r = g = b = 1.0f; + t->color(r * brightness, g * brightness, b * brightness, 1.0f); + + if (gateway->shouldRenderFace(Facing::SOUTH)) + { + t->vertex(x, y, z + 1); + t->vertex(x + 1, y, z + 1); + t->vertex(x + 1, y + 1, z + 1); + t->vertex(x, y + 1, z + 1); + } + if (gateway->shouldRenderFace(Facing::NORTH)) + { + t->vertex(x, y + 1, z); + t->vertex(x + 1, y + 1, z); + t->vertex(x + 1, y, z); + t->vertex(x, y, z); + } + if (gateway->shouldRenderFace(Facing::EAST)) + { + t->vertex(x + 1, y + 1, z); + t->vertex(x + 1, y + 1, z + 1); + t->vertex(x + 1, y, z + 1); + t->vertex(x + 1, y, z); + } + if (gateway->shouldRenderFace(Facing::WEST)) + { + t->vertex(x, y, z); + t->vertex(x, y, z + 1); + t->vertex(x, y + 1, z + 1); + t->vertex(x, y + 1, z); + } + if (gateway->shouldRenderFace(Facing::DOWN)) + { + t->vertex(x, y, z); + t->vertex(x + 1, y, z); + t->vertex(x + 1, y, z + 1); + t->vertex(x, y, z + 1); + } + if (gateway->shouldRenderFace(Facing::UP)) + { + t->vertex(x, y + 1, z + 1); + t->vertex(x + 1, y + 1, z + 1); + t->vertex(x + 1, y + 1, z); + t->vertex(x, y + 1, z); + } + + t->end(); + t->useProjectedTexture(false); + + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + } + + glDisable(GL_BLEND); + glDisable(GL_TEXTURE_GEN_S); + glDisable(GL_TEXTURE_GEN_T); + glDisable(GL_TEXTURE_GEN_R); + glDisable(GL_TEXTURE_GEN_Q); + glEnable(GL_LIGHTING); + glEnable(GL_FOG); +} diff --git a/Minecraft.Client/TheEndGatewayRenderer.h b/Minecraft.Client/TheEndGatewayRenderer.h new file mode 100644 index 00000000..5401e85e --- /dev/null +++ b/Minecraft.Client/TheEndGatewayRenderer.h @@ -0,0 +1,26 @@ +#pragma once + +#include "TileEntityRenderer.h" + +class TheEndGatewayRenderer : public TileEntityRenderer +{ +private: + static ResourceLocation END_SKY_LOCATION; + static ResourceLocation END_PORTAL_LOCATION; + static ResourceLocation BEAM_LOCATION; + static int RANDOM_SEED; + static Random RANDOM; + + FloatBuffer *lb; + FloatBuffer *modelView; + FloatBuffer *projection; + +public: + TheEndGatewayRenderer(); + virtual void render(shared_ptr _gateway, double x, double y, double z, float a, bool setColor, float alpha = 1.0f, bool useCompiled = true); + +private: + FloatBuffer *getBuffer(float a, float b, float c, float d); + static int getPasses(double distanceSqr); + void renderBeam(double x, double y, double z, float a, double height, float r, float g, float b); +}; diff --git a/Minecraft.Client/TileEntityRenderDispatcher.cpp b/Minecraft.Client/TileEntityRenderDispatcher.cpp index 6b182a11..c8adaa0d 100644 --- a/Minecraft.Client/TileEntityRenderDispatcher.cpp +++ b/Minecraft.Client/TileEntityRenderDispatcher.cpp @@ -11,6 +11,7 @@ #include "ChestRenderer.h" #include "EnchantTableRenderer.h" #include "TheEndPortalRenderer.h" +#include "TheEndGatewayRenderer.h" #include "SkullTileRenderer.h" #include "EnderChestRenderer.h" #include "BeaconRenderer.h" @@ -46,6 +47,7 @@ TileEntityRenderDispatcher::TileEntityRenderDispatcher() renderers[eTYPE_ENDERCHESTTILEENTITY] = new EnderChestRenderer(); renderers[eTYPE_ENCHANTMENTTABLEENTITY] = new EnchantTableRenderer(); renderers[eTYPE_THEENDPORTALTILEENTITY] = new TheEndPortalRenderer(); + renderers[eTYPE_THEENDGATEWAYTILEENTITY] = new TheEndGatewayRenderer(); renderers[eTYPE_SKULLTILEENTITY] = new SkullTileRenderer(); renderers[eTYPE_FURNACETILEENTITY] = nullptr; renderers[eTYPE_BEACONTILEENTITY] = new BeaconRenderer(); diff --git a/Minecraft.Client/TileRenderer.cpp b/Minecraft.Client/TileRenderer.cpp index 468e3473..f08541ee 100644 --- a/Minecraft.Client/TileRenderer.cpp +++ b/Minecraft.Client/TileRenderer.cpp @@ -428,6 +428,15 @@ bool TileRenderer::tesselateInWorld( Tile* tt, int x, int y, int z, int forceDat case Tile::SHAPE_THIN_PANE: retVal = tesselateThinPaneInWorld(tt, x, y, z); break; + case Tile::SHAPE_END_ROD: + retVal = tesselateEndRodInWorld(tt, x, y, z); + break; + case Tile::SHAPE_CHORUS_PLANT: + retVal = tesselateChorusPlantInWorld(tt, x, y, z); + break; + case Tile::SHAPE_CHORUS_FLOWER: + retVal = tesselateChorusFlowerInWorld(tt, x, y, z); + break; case Tile::SHAPE_VINE: retVal = tesselateVineInWorld( tt, x, y, z ); break; @@ -8595,6 +8604,25 @@ void TileRenderer::renderTile( Tile* tile, int data, float brightness, float fAl } setShape( 0, 0, 0, 1, 1, 1 ); } + else if (shape == Tile::SHAPE_END_ROD) + { + glTranslatef(-0.5f, -0.5f, -0.5f); + tesselateEndRod(tile, Facing::UP, 0, 0, 0, true); + glTranslatef(0.5f, 0.5f, 0.5f); + setShape(0, 0, 0, 1, 1, 1); + } + else if (shape == Tile::SHAPE_CHORUS_PLANT || shape == Tile::SHAPE_CHORUS_FLOWER) + { + const float a = 2 / 16.0f; + const float b = 14 / 16.0f; + renderInventoryBox(tile, data, a, 0, a, b, b, b); + renderInventoryBox(tile, data, a, b, a, b, 1, b); + renderInventoryBox(tile, data, a, a, 0, b, b, a); + renderInventoryBox(tile, data, a, a, b, b, b, 1); + renderInventoryBox(tile, data, b, a, a, 1, b, b); + renderInventoryBox(tile, data, 0, a, a, a, b, b); + setShape(0, 0, 0, 1, 1, 1); + } else if (shape == Tile::SHAPE_FENCE_GATE) { for (int i = 0; i < 3; i++) @@ -8851,6 +8879,9 @@ bool TileRenderer::canRender( int renderShape ) if ( renderShape == Tile::SHAPE_ANVIL) return true; if (renderShape == Tile::SHAPE_THIN_PANE) return true; if (renderShape == Tile::SHAPE_WATER) return true; + if (renderShape == Tile::SHAPE_END_ROD) return true; + if (renderShape == Tile::SHAPE_CHORUS_PLANT) return true; + if (renderShape == Tile::SHAPE_CHORUS_FLOWER) return true; return false; } @@ -8886,3 +8917,239 @@ Icon *TileRenderer::getTextureOrMissing(Icon *icon) return icon; } + + +namespace +{ + void rotateForFacing(int facing, float &x, float &y, float &z) + { + float ox = x, oy = y, oz = z; + switch (facing) + { + case Facing::DOWN: x = ox; y = -oy; z = -oz; break; + case Facing::NORTH: x = ox; y = oz; z = -oy; break; + case Facing::SOUTH: x = ox; y = -oz; z = oy; break; + case Facing::WEST: x = -oy; y = ox; z = oz; break; + case Facing::EAST: x = oy; y = -ox; z = oz; break; + default: break; + } + } + + struct EndRodQuadVertex + { + float x, y, z, u, v; + }; + + void emitEndRodFace(Tesselator *t, int facing, float ox, float oy, float oz, const EndRodQuadVertex *verts, + float nx, float ny, float nz, bool inventory) + { + rotateForFacing(facing, nx, ny, nz); + if (inventory) + { + t->begin(); + t->normal(nx, ny, nz); + } + else + { + float br = 1.0f; + if (ny < -0.5f) br = 0.5f; + else if (nz > 0.5f || nz < -0.5f) br = 0.8f; + else if (nx > 0.5f || nx < -0.5f) br = 0.6f; + t->color(br, br, br); + } + for (int i = 0; i < 4; i++) + { + float x = verts[i].x - 0.5f; + float y = verts[i].y - 0.5f; + float z = verts[i].z - 0.5f; + rotateForFacing(facing, x, y, z); + t->vertexUV(ox + x + 0.5f, oy + y + 0.5f, oz + z + 0.5f, verts[i].u, verts[i].v); + } + if (inventory) + { + t->end(); + } + } + + void emitEndRodBox(Tesselator *t, Icon *tex, int facing, float ox, float oy, float oz, + float px0, float py0, float pz0, float px1, float py1, float pz1, + float su0, float sv0, float su1, float sv1, float cu0, float cv0, float cu1, float cv1, bool inventory) + { + float x0 = px0 / 16.0f, y0 = py0 / 16.0f, z0 = pz0 / 16.0f; + float x1 = px1 / 16.0f, y1 = py1 / 16.0f, z1 = pz1 / 16.0f; + + const float inset = 0.05f; + float u0 = tex->getU(su0 + inset, true), u1 = tex->getU(su1 - inset, true); + float vt = tex->getV(sv0 + inset, true), vb = tex->getV(sv1 - inset, true); + float cU0 = tex->getU(cu0 + inset, true), cU1 = tex->getU(cu1 - inset, true); + float cV0 = tex->getV(cv0 + inset, true), cV1 = tex->getV(cv1 - inset, true); + + const EndRodQuadVertex up[4] = { {x1, y1, z1, cU1, cV1}, {x1, y1, z0, cU1, cV0}, {x0, y1, z0, cU0, cV0}, {x0, y1, z1, cU0, cV1} }; + const EndRodQuadVertex down[4] = { {x0, y0, z1, cU0, cV1}, {x0, y0, z0, cU0, cV0}, {x1, y0, z0, cU1, cV0}, {x1, y0, z1, cU1, cV1} }; + const EndRodQuadVertex north[4] = { {x0, y1, z0, u1, vt}, {x1, y1, z0, u0, vt}, {x1, y0, z0, u0, vb}, {x0, y0, z0, u1, vb} }; + const EndRodQuadVertex south[4] = { {x0, y1, z1, u0, vt}, {x0, y0, z1, u0, vb}, {x1, y0, z1, u1, vb}, {x1, y1, z1, u1, vt} }; + const EndRodQuadVertex west[4] = { {x0, y1, z1, u1, vt}, {x0, y1, z0, u0, vt}, {x0, y0, z0, u0, vb}, {x0, y0, z1, u1, vb} }; + const EndRodQuadVertex east[4] = { {x1, y0, z1, u0, vb}, {x1, y0, z0, u1, vb}, {x1, y1, z0, u1, vt}, {x1, y1, z1, u0, vt} }; + + emitEndRodFace(t, facing, ox, oy, oz, up, 0, 1, 0, inventory); + emitEndRodFace(t, facing, ox, oy, oz, down, 0, -1, 0, inventory); + emitEndRodFace(t, facing, ox, oy, oz, north, 0, 0, -1, inventory); + emitEndRodFace(t, facing, ox, oy, oz, south, 0, 0, 1, inventory); + emitEndRodFace(t, facing, ox, oy, oz, west, -1, 0, 0, inventory); + emitEndRodFace(t, facing, ox, oy, oz, east, 1, 0, 0, inventory); + } +} + +void TileRenderer::tesselateEndRod(Tile *tt, int data, float x, float y, float z, bool inventory) +{ + Tesselator *t = Tesselator::getInstance(); + Icon *tex = getTexture(tt, Facing::DOWN, data); + if (hasFixedTexture()) tex = fixedTexture; + + int facing = EndRodTile::getFacing(data); + + emitEndRodBox(t, tex, facing, x, y, z, 7, 1, 7, 9, 16, 9, 0, 0, 2, 15, 2, 0, 4, 2, inventory); + emitEndRodBox(t, tex, facing, x, y, z, 6, 0, 6, 10, 1, 10, 2, 6, 6, 7, 2, 2, 6, 6, inventory); +} + +bool TileRenderer::tesselateEndRodInWorld(Tile *tt, int x, int y, int z) +{ + Tesselator *t = Tesselator::getInstance(); + t->tex2(getLightColor(tt, level, x, y, z)); + t->color(1.0f, 1.0f, 1.0f); + tesselateEndRod(tt, level->getData(x, y, z), static_cast(x), static_cast(y), static_cast(z), false); + return true; +} + +bool TileRenderer::tesselateSubBoxInWorld(Tile *tt, int x, int y, int z, float x0, float y0, float z0, float x1, float y1, float z1, int excludeFaces) +{ + tt->setShape(x0, y0, z0, x1, y1, z1); + setShape(x0, y0, z0, x1, y1, z1); + + int faceFlags = 0x3f; + if (!noCulling) + { + faceFlags = 0; + faceFlags |= tt->shouldRenderFace(level, x, y - 1, z, 0) ? 0x01 : 0; + faceFlags |= tt->shouldRenderFace(level, x, y + 1, z, 1) ? 0x02 : 0; + faceFlags |= tt->shouldRenderFace(level, x, y, z - 1, 2) ? 0x04 : 0; + faceFlags |= tt->shouldRenderFace(level, x, y, z + 1, 3) ? 0x08 : 0; + faceFlags |= tt->shouldRenderFace(level, x - 1, y, z, 4) ? 0x10 : 0; + faceFlags |= tt->shouldRenderFace(level, x + 1, y, z, 5) ? 0x20 : 0; + } + faceFlags &= ~excludeFaces; + if (faceFlags == 0) return false; + + return tesselateBlockInWorld(tt, x, y, z, faceFlags); +} + +bool TileRenderer::tesselateChorusPlantInWorld(Tile *tt, int x, int y, int z) +{ + ChorusPlantTile *plant = static_cast(tt); + const float a = 4 / 16.0f; + const float b = 12 / 16.0f; + + bool down = plant->connectsTo(level, x, y, z, Facing::DOWN); + bool up = plant->connectsTo(level, x, y, z, Facing::UP); + bool north = plant->connectsTo(level, x, y, z, Facing::NORTH); + bool south = plant->connectsTo(level, x, y, z, Facing::SOUTH); + bool west = plant->connectsTo(level, x, y, z, Facing::WEST); + bool east = plant->connectsTo(level, x, y, z, Facing::EAST); + + bool changed = tesselateSubBoxInWorld(tt, x, y, z, a, down ? 0 : a, a, b, up ? 1 : b, b, 0); + if (north) changed |= tesselateSubBoxInWorld(tt, x, y, z, a, a, 0, b, b, a, 0); + if (south) changed |= tesselateSubBoxInWorld(tt, x, y, z, a, a, b, b, b, 1, 0); + if (east) changed |= tesselateSubBoxInWorld(tt, x, y, z, b, a, a, 1, b, b, 0); + if (west) changed |= tesselateSubBoxInWorld(tt, x, y, z, 0, a, a, a, b, b, 0); + + int64_t seed = static_cast(x * y + y) * z + z; + Random random(seed); + int variantGate = random.nextInt(5); + int northNodule = random.nextInt(3); + int southNodule = random.nextInt(3); + int eastNodule = random.nextInt(3); + int westNodule = random.nextInt(3); + if (variantGate > 1) + { + const float p = 1 / 16.0f; + if (!north) + { + if (northNodule == 1) changed |= tesselateSubBoxInWorld(tt, x, y, z, 5 * p, 5 * p, 2 * p, 11 * p, 11 * p, 4 * p, 0); + else changed |= tesselateSubBoxInWorld(tt, x, y, z, 4 * p, 4 * p, 3 * p, 12 * p, 12 * p, 4 * p, 0); + } + if (!south) + { + if (southNodule == 1) changed |= tesselateSubBoxInWorld(tt, x, y, z, 5 * p, 5 * p, 12 * p, 11 * p, 11 * p, 14 * p, 0); + else changed |= tesselateSubBoxInWorld(tt, x, y, z, 4 * p, 4 * p, 12 * p, 12 * p, 12 * p, 13 * p, 0); + } + if (!east) + { + if (eastNodule == 1) changed |= tesselateSubBoxInWorld(tt, x, y, z, 12 * p, 5 * p, 5 * p, 14 * p, 11 * p, 11 * p, 0); + else changed |= tesselateSubBoxInWorld(tt, x, y, z, 12 * p, 4 * p, 4 * p, 13 * p, 12 * p, 12 * p, 0); + } + if (!west) + { + if (westNodule == 1) changed |= tesselateSubBoxInWorld(tt, x, y, z, 2 * p, 5 * p, 5 * p, 4 * p, 11 * p, 11 * p, 0); + else changed |= tesselateSubBoxInWorld(tt, x, y, z, 3 * p, 4 * p, 4 * p, 4 * p, 12 * p, 12 * p, 0); + } + } + + tt->updateShape(level, x, y, z); + setShape(0, 0, 0, 1, 1, 1); + return changed; +} + +bool TileRenderer::tesselateChorusFlowerInWorld(Tile *tt, int x, int y, int z) +{ + const float a = 2 / 16.0f; + const float b = 14 / 16.0f; + + bool changed = tesselateSubBoxInWorld(tt, x, y, z, a, 0, a, b, b, b, 0); + changed |= tesselateSubBoxInWorld(tt, x, y, z, a, b, a, b, 1, b, 0x01); + changed |= tesselateSubBoxInWorld(tt, x, y, z, a, a, 0, b, b, a, 0x08); + changed |= tesselateSubBoxInWorld(tt, x, y, z, a, a, b, b, b, 1, 0x04); + changed |= tesselateSubBoxInWorld(tt, x, y, z, b, a, a, 1, b, b, 0x10); + changed |= tesselateSubBoxInWorld(tt, x, y, z, 0, a, a, a, b, b, 0x20); + + tt->updateShape(level, x, y, z); + setShape(0, 0, 0, 1, 1, 1); + return changed; +} + +void TileRenderer::renderInventoryBox(Tile *tile, int data, float x0, float y0, float z0, float x1, float y1, float z1) +{ + Tesselator *t = Tesselator::getInstance(); + setShape(x0, y0, z0, x1, y1, z1); + + glTranslatef(-0.5f, -0.5f, -0.5f); + t->begin(); + t->normal(0, -1, 0); + renderFaceDown(tile, 0, 0, 0, getTexture(tile, 0, data)); + t->end(); + + t->begin(); + t->normal(0, 1, 0); + renderFaceUp(tile, 0, 0, 0, getTexture(tile, 1, data)); + t->end(); + + t->begin(); + t->normal(0, 0, -1); + renderNorth(tile, 0, 0, 0, getTexture(tile, 2, data)); + t->end(); + + t->begin(); + t->normal(0, 0, 1); + renderSouth(tile, 0, 0, 0, getTexture(tile, 3, data)); + t->end(); + + t->begin(); + t->normal(-1, 0, 0); + renderWest(tile, 0, 0, 0, getTexture(tile, 4, data)); + t->end(); + + t->begin(); + t->normal(1, 0, 0); + renderEast(tile, 0, 0, 0, getTexture(tile, 5, data)); + t->end(); + glTranslatef(0.5f, 0.5f, 0.5f); +} diff --git a/Minecraft.Client/TileRenderer.h b/Minecraft.Client/TileRenderer.h index 5d2c53c6..353302ff 100644 --- a/Minecraft.Client/TileRenderer.h +++ b/Minecraft.Client/TileRenderer.h @@ -143,6 +143,12 @@ private: bool tesselateLadderInWorld( Tile* tt, int x, int y, int z ); bool tesselateVineInWorld( Tile* tt, int x, int y, int z ); bool tesselateThinPaneInWorld(Tile *tt, int x, int y, int z); + bool tesselateEndRodInWorld(Tile *tt, int x, int y, int z); + void tesselateEndRod(Tile *tt, int data, float x, float y, float z, bool inventory); + bool tesselateChorusPlantInWorld(Tile *tt, int x, int y, int z); + bool tesselateChorusFlowerInWorld(Tile *tt, int x, int y, int z); + bool tesselateSubBoxInWorld(Tile *tt, int x, int y, int z, float x0, float y0, float z0, float x1, float y1, float z1, int excludeFaces); + void renderInventoryBox(Tile *tile, int data, float x0, float y0, float z0, float x1, float y1, float z1); bool tesselateThinFenceInWorld( ThinFenceTile* tt, int x, int y, int z ); bool tesselateCrossInWorld( Tile* tt, int x, int y, int z ); bool tesselateStemInWorld( Tile* _tt, int x, int y, int z ); diff --git a/Minecraft.Client/TrackedEntity.cpp b/Minecraft.Client/TrackedEntity.cpp index 5bd13ce0..e0638aca 100644 --- a/Minecraft.Client/TrackedEntity.cpp +++ b/Minecraft.Client/TrackedEntity.cpp @@ -732,6 +732,14 @@ shared_ptr TrackedEntity::getAddEntityPacket() { return std::make_shared(e, AddEntityPacket::BOAT, yRotp, xRotp, xp, yp, zp); } + else if (e->instanceof(eTYPE_AREA_EFFECT_CLOUD)) + { + return std::make_shared(e, AddEntityPacket::AREA_EFFECT_CLOUD, yRotp, xRotp, xp, yp, zp); + } + else if (e->instanceof(eTYPE_SHULKER_BULLET)) + { + return std::make_shared(e, AddEntityPacket::SHULKER_BULLET, e->entityId, yRotp, xRotp, xp, yp, zp); + } else if (e->instanceof(eTYPE_ENDERDRAGON)) { yHeadRotp = Mth::floor(e->getYHeadRot() * 256 / 360); @@ -758,7 +766,7 @@ shared_ptr TrackedEntity::getAddEntityPacket() } else if (e->instanceof(eTYPE_THROWNPOTION)) { - return std::make_shared(e, AddEntityPacket::THROWN_POTION, ((dynamic_pointer_cast(e))->getPotionValue()), yRotp, xRotp, xp, yp, zp); + return std::make_shared(e, AddEntityPacket::THROWN_POTION, (dynamic_pointer_cast(e)->getPotionValue() | (dynamic_pointer_cast(e)->isLingering() ? ThrownPotion::LINGERING_FLAG : 0)), yRotp, xRotp, xp, yp, zp); } else if (e->instanceof(eTYPE_THROWNEXPBOTTLE)) { diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 97eaadcc..a3d9d86f 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -1507,6 +1507,7 @@ void CleanupDevice() if( g_pRenderTargetView ) g_pRenderTargetView->Release(); if( g_pSwapChain ) g_pSwapChain->Release(); if( g_pImmediateContext ) g_pImmediateContext->Release(); + if( g_pAdapter ) g_pAdapter->Release(); if( g_pd3dDevice ) g_pd3dDevice->Release(); } diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/death1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/death1.ogg new file mode 100644 index 00000000..d1fe5d4c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/death1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/death2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/death2.ogg new file mode 100644 index 00000000..cbfbc5e2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/death2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/death3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/death3.ogg new file mode 100644 index 00000000..fc09904c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/death3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow1.ogg new file mode 100644 index 00000000..5c306d45 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow2.ogg new file mode 100644 index 00000000..9810512d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow3.ogg new file mode 100644 index 00000000..b034bbc9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow4.ogg new file mode 100644 index 00000000..c93a610c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/chorus_flower/grow4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/enchantment_table/enchant1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/enchantment_table/enchant1.ogg new file mode 100644 index 00000000..51300ed9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/enchantment_table/enchant1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/enchantment_table/enchant2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/enchantment_table/enchant2.ogg new file mode 100644 index 00000000..4a0b48b0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/enchantment_table/enchant2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/enchantment_table/enchant3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/enchantment_table/enchant3.ogg new file mode 100644 index 00000000..d5afb8eb Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/enchantment_table/enchant3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/close1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/close1.ogg new file mode 100644 index 00000000..e63575d6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/close1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/close2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/close2.ogg new file mode 100644 index 00000000..d4034d3e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/close2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/open1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/open1.ogg new file mode 100644 index 00000000..a7306787 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/open1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/open2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/open2.ogg new file mode 100644 index 00000000..dc200292 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/fence_gate/open2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close1.ogg new file mode 100644 index 00000000..bf280ce8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close2.ogg new file mode 100644 index 00000000..fbad7fa5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close3.ogg new file mode 100644 index 00000000..41644d7b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close4.ogg new file mode 100644 index 00000000..a04571e8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/close4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open1.ogg new file mode 100644 index 00000000..10274ab0 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open2.ogg new file mode 100644 index 00000000..8d3fe1bf Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open3.ogg new file mode 100644 index 00000000..a6f0dbbe Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open4.ogg new file mode 100644 index 00000000..d2d5f9f4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_door/open4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close1.ogg new file mode 100644 index 00000000..a0e4a2ee Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close2.ogg new file mode 100644 index 00000000..826aa8fd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close3.ogg new file mode 100644 index 00000000..aad7714a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close4.ogg new file mode 100644 index 00000000..3cedadae Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/close4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open1.ogg new file mode 100644 index 00000000..b06764f7 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open2.ogg new file mode 100644 index 00000000..488ba6f4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open3.ogg new file mode 100644 index 00000000..026dd694 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open4.ogg new file mode 100644 index 00000000..7542f367 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/iron_trapdoor/open4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place1.ogg new file mode 100644 index 00000000..a46aac21 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place2.ogg new file mode 100644 index 00000000..27a6649e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place3.ogg new file mode 100644 index 00000000..eefcb4c1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place4.ogg new file mode 100644 index 00000000..1b19fd4f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/waterlily/place4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close2.ogg new file mode 100644 index 00000000..554f6495 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close3.ogg new file mode 100644 index 00000000..75997a7c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close4.ogg new file mode 100644 index 00000000..49b6948f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close5.ogg new file mode 100644 index 00000000..5f31f3bc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close6.ogg new file mode 100644 index 00000000..2b924462 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/close6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/open2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/open2.ogg new file mode 100644 index 00000000..ffd6ed4f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/open2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/open3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/open3.ogg new file mode 100644 index 00000000..ec6876a5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/open3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/open4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/open4.ogg new file mode 100644 index 00000000..988b211e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_door/open4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/close1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/close1.ogg new file mode 100644 index 00000000..8fcf4eda Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/close1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/close2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/close2.ogg new file mode 100644 index 00000000..b30c82fc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/close2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/close3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/close3.ogg new file mode 100644 index 00000000..ed12ea9e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/close3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open1.ogg new file mode 100644 index 00000000..214b77b6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open2.ogg new file mode 100644 index 00000000..4d96aaab Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open3.ogg new file mode 100644 index 00000000..36336994 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open4.ogg new file mode 100644 index 00000000..3c5ac112 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open5.ogg new file mode 100644 index 00000000..30ce485f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/block/wooden_trapdoor/open5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land1.ogg new file mode 100644 index 00000000..400a4851 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land2.ogg new file mode 100644 index 00000000..f64b85dd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land3.ogg new file mode 100644 index 00000000..6fa943dd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land4.ogg new file mode 100644 index 00000000..dcd694f6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land5.ogg new file mode 100644 index 00000000..cc812507 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land6.ogg new file mode 100644 index 00000000..9c47db19 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_land6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water1.ogg new file mode 100644 index 00000000..a4987807 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water2.ogg new file mode 100644 index 00000000..0531c320 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water3.ogg new file mode 100644 index 00000000..8bff0018 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water4.ogg new file mode 100644 index 00000000..6bc91445 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water5.ogg new file mode 100644 index 00000000..048ca92f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water6.ogg new file mode 100644 index 00000000..828f4fe8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water7.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water7.ogg new file mode 100644 index 00000000..4f945f89 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water7.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water8.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water8.ogg new file mode 100644 index 00000000..c6c2af5d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/boat/paddle_water8.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/convert1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/convert1.ogg new file mode 100644 index 00000000..a73f5a31 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/convert1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/convert2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/convert2.ogg new file mode 100644 index 00000000..2a9a776b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/convert2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/death1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/death1.ogg new file mode 100644 index 00000000..dd80e921 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/death1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/death2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/death2.ogg new file mode 100644 index 00000000..00ec018e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/death2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/hurt1.ogg new file mode 100644 index 00000000..08f927f3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/hurt2.ogg new file mode 100644 index 00000000..788c5307 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/idle1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/idle1.ogg new file mode 100644 index 00000000..d680d73c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/idle1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/idle2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/idle2.ogg new file mode 100644 index 00000000..4f71ee90 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/idle2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/idle3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/idle3.ogg new file mode 100644 index 00000000..61c5d6c4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/idle3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step1.ogg new file mode 100644 index 00000000..c21134ea Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step2.ogg new file mode 100644 index 00000000..1fd6ac76 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step3.ogg new file mode 100644 index 00000000..3d57d6a6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step4.ogg new file mode 100644 index 00000000..c107ecf5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step5.ogg new file mode 100644 index 00000000..15006482 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/husk/step5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient1.ogg new file mode 100644 index 00000000..b7d83ab6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient2.ogg new file mode 100644 index 00000000..c75f380a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient3.ogg new file mode 100644 index 00000000..fdeb6ad6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient4.ogg new file mode 100644 index 00000000..d056eadf Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient5.ogg new file mode 100644 index 00000000..844ae330 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient6.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient6.ogg new file mode 100644 index 00000000..ebfa2732 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient6.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient7.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient7.ogg new file mode 100644 index 00000000..af0496b9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/ambient7.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close1.ogg new file mode 100644 index 00000000..366e90a3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close2.ogg new file mode 100644 index 00000000..1be56109 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close3.ogg new file mode 100644 index 00000000..697f50a3 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close4.ogg new file mode 100644 index 00000000..307d250f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close5.ogg new file mode 100644 index 00000000..e1b79ae4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/close5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death1.ogg new file mode 100644 index 00000000..0f59e40b Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death2.ogg new file mode 100644 index 00000000..bd9212c5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death3.ogg new file mode 100644 index 00000000..8ed35baa Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death4.ogg new file mode 100644 index 00000000..fa4528f8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/death4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit1.ogg new file mode 100644 index 00000000..8bb51169 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit2.ogg new file mode 100644 index 00000000..68ca8690 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit3.ogg new file mode 100644 index 00000000..3b108964 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit4.ogg new file mode 100644 index 00000000..fcf2f8b1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt1.ogg new file mode 100644 index 00000000..1aa28c9d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt2.ogg new file mode 100644 index 00000000..8eed472f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt3.ogg new file mode 100644 index 00000000..b38015e5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt4.ogg new file mode 100644 index 00000000..c89ed796 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed1.ogg new file mode 100644 index 00000000..138bf252 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed2.ogg new file mode 100644 index 00000000..30363154 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed3.ogg new file mode 100644 index 00000000..f83919d6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed4.ogg new file mode 100644 index 00000000..da743b11 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed5.ogg new file mode 100644 index 00000000..5c0ba8db Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/hurt_closed5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open1.ogg new file mode 100644 index 00000000..5334f5d5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open2.ogg new file mode 100644 index 00000000..bb3818e5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open3.ogg new file mode 100644 index 00000000..cf285ac4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open4.ogg new file mode 100644 index 00000000..87626edc Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open5.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open5.ogg new file mode 100644 index 00000000..7955c4e5 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/open5.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot1.ogg new file mode 100644 index 00000000..bef63d50 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot2.ogg new file mode 100644 index 00000000..29619b47 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot3.ogg new file mode 100644 index 00000000..878bb721 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot4.ogg new file mode 100644 index 00000000..c2b9ae4e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker/shoot4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit1.ogg new file mode 100644 index 00000000..53f68215 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit2.ogg new file mode 100644 index 00000000..d8b997fd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit3.ogg new file mode 100644 index 00000000..18bf3f04 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit4.ogg new file mode 100644 index 00000000..b1dda2f9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/shulker_bullet/hit4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/death1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/death1.ogg new file mode 100644 index 00000000..93e003f6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/death1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/death2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/death2.ogg new file mode 100644 index 00000000..ed4d4c74 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/death2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt1.ogg new file mode 100644 index 00000000..ea652846 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt2.ogg new file mode 100644 index 00000000..7bff1958 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt3.ogg new file mode 100644 index 00000000..f37ae488 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt4.ogg new file mode 100644 index 00000000..60119d8c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/hurt4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle1.ogg new file mode 100644 index 00000000..3511f59c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle2.ogg new file mode 100644 index 00000000..3e31ec35 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle3.ogg new file mode 100644 index 00000000..7b41054e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle4.ogg new file mode 100644 index 00000000..5e0f2cc6 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/idle4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step1.ogg new file mode 100644 index 00000000..4fadd723 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step2.ogg new file mode 100644 index 00000000..908a0761 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step3.ogg new file mode 100644 index 00000000..1c512e40 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step4.ogg new file mode 100644 index 00000000..68a96ae9 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/entity/stray/step4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/empty1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/empty1.ogg new file mode 100644 index 00000000..a035a844 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/empty1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/empty2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/empty2.ogg new file mode 100644 index 00000000..b7f706c1 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/empty2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill1.ogg new file mode 100644 index 00000000..fa9ca582 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill2.ogg new file mode 100644 index 00000000..eae57644 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill3.ogg new file mode 100644 index 00000000..616301e8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill4.ogg new file mode 100644 index 00000000..63b8446e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill4.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill_dragonbreath1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill_dragonbreath1.ogg new file mode 100644 index 00000000..88bcd809 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill_dragonbreath1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill_dragonbreath2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill_dragonbreath2.ogg new file mode 100644 index 00000000..bc2b192f Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bottle/fill_dragonbreath2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty1.ogg new file mode 100644 index 00000000..1f1d22d8 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty2.ogg new file mode 100644 index 00000000..af3065ce Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty3.ogg new file mode 100644 index 00000000..80e66858 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty_lava1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty_lava1.ogg new file mode 100644 index 00000000..e5cb68bd Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty_lava1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty_lava2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty_lava2.ogg new file mode 100644 index 00000000..80d47e64 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty_lava2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty_lava3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty_lava3.ogg new file mode 100644 index 00000000..ac767429 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/empty_lava3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill1.ogg new file mode 100644 index 00000000..7793882d Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill2.ogg new file mode 100644 index 00000000..e27549b4 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill3.ogg new file mode 100644 index 00000000..83f5a766 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill_lava1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill_lava1.ogg new file mode 100644 index 00000000..c4b15d6e Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill_lava1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill_lava2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill_lava2.ogg new file mode 100644 index 00000000..69d4f737 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill_lava2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill_lava3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill_lava3.ogg new file mode 100644 index 00000000..db06ff53 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/bucket/fill_lava3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till1.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till1.ogg new file mode 100644 index 00000000..6f3d6dd2 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till1.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till2.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till2.ogg new file mode 100644 index 00000000..67ac3e68 Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till2.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till3.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till3.ogg new file mode 100644 index 00000000..710b357c Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till3.ogg differ diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till4.ogg b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till4.ogg new file mode 100644 index 00000000..6f14869a Binary files /dev/null and b/Minecraft.Client/Windows64Media/Sound/Minecraft/item/hoe/till4.ogg differ diff --git a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml index 6ab2ae0b..ce586dc5 100644 --- a/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml +++ b/Minecraft.Client/Windows64Media/loc/stringsGeneric.xml @@ -2578,7 +2578,7 @@ Can also be used for low-level lighting. - Boat + Oak Boat @@ -2952,6 +2952,9 @@ Can also be used for low-level lighting. Creeper Head + + Dragon Head + Nether Star @@ -8087,6 +8090,10 @@ Would you like to install the mash-up pack or texture pack now? Attack Damage + + Armor + + Sharpness @@ -9546,6 +9553,58 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc Elytra + End Rod + A light source that can be placed facing in any direction. + End Gateway + Appears on the main island of The End after the Ender Dragon is defeated. Leads to the outer islands. + Reset The End + Don't Reset The End + Reset The End + Are you sure you want to reset The End in this savegame? It will be re-generated with the outer islands, end cities and a new Ender Dragon. You will lose anything you have built in The End! + When enabled, The End will be re-generated with the new outer islands, end gateways and end cities. This is useful for older saves made before The End update. + Chorus Plant + Grows on End Stone in the outer islands of The End. Drops Chorus Fruit when broken. + Chorus Flower + Plant on End Stone to grow a Chorus Plant. + Purpur Block + A decorative block found in End Cities. Crafted from Popped Chorus Fruit. + Purpur Pillar + A decorative pillar crafted from Purpur Slabs. + Purpur Stairs + Purpur Slab + Chorus Fruit + Restores 2{*ICON_SHANK_01*}. Eating it teleports you to a random nearby location. Can be smelted into Popped Chorus Fruit. + Popped Chorus Fruit + Used to craft Purpur Blocks and End Rods. + Glowing + of Glowing + Levitation + of Levitation + Luck + of Luck + Bad Luck + of Bad Luck + Makes the affected player luckier when fishing. + End Crystal + Can be placed on Obsidian or Bedrock. Placing four around the exit portal in The End summons the Ender Dragon again. + Dragon's Breath + Collected in a Glass Bottle from the Ender Dragon's breath attack. Brew into Splash Potions to make Lingering Potions. + Spectral Arrow + Makes whatever it hits glow, so it can be seen through walls. + Tipped Arrow + Arrow {*postfix*} + Gives whatever it hits the effect of the potion it was tipped in. + {*splash*}Lingering {*prefix*}Potion {*postfix*} + Lingering Water Bottle + Spruce Boat + Birch Boat + Jungle Boat + Acacia Boat + Dark Oak Boat + Stray + Husk + Shulker + Dirt Path Beetroot End Stone Bricks diff --git a/Minecraft.Client/ZombieRenderer.cpp b/Minecraft.Client/ZombieRenderer.cpp index 289ad7aa..803accc8 100644 --- a/Minecraft.Client/ZombieRenderer.cpp +++ b/Minecraft.Client/ZombieRenderer.cpp @@ -7,6 +7,15 @@ ResourceLocation ZombieRenderer::ZOMBIE_PIGMAN_LOCATION(TN_MOB_PIGZOMBIE); ResourceLocation ZombieRenderer::ZOMBIE_LOCATION(TN_MOB_ZOMBIE); ResourceLocation ZombieRenderer::ZOMBIE_VILLAGER_LOCATION(TN_MOB_ZOMBIE_VILLAGER); +ResourceLocation ZombieRenderer::HUSK_LOCATION(TN_MOB_HUSK); +ResourceLocation ZombieRenderer::ZOMBIE_VILLAGER_PROFESSION_LOCATIONS[5] = +{ + ResourceLocation(TN_MOB_ZOMBIE_VILLAGER_FARMER), + ResourceLocation(TN_MOB_ZOMBIE_VILLAGER_LIBRARIAN), + ResourceLocation(TN_MOB_ZOMBIE_VILLAGER_PRIEST), + ResourceLocation(TN_MOB_ZOMBIE_VILLAGER_SMITH), + ResourceLocation(TN_MOB_ZOMBIE_VILLAGER_BUTCHER), +}; ZombieRenderer::ZombieRenderer() : HumanoidMobRenderer(new ZombieModel(), .5f, 1.0f) { @@ -64,8 +73,14 @@ ResourceLocation *ZombieRenderer::getTextureLocation(shared_ptr entity) if (mob->isVillager()) { + int profession = mob->getProfession(); + if (profession >= 0 && profession < 5) return &ZOMBIE_VILLAGER_PROFESSION_LOCATIONS[profession]; return &ZOMBIE_VILLAGER_LOCATION; } + if (mob->isHusk()) + { + return &HUSK_LOCATION; + } return &ZOMBIE_LOCATION; } @@ -110,4 +125,14 @@ void ZombieRenderer::setupRotations(shared_ptr _mob, float bob, fl bodyRot += static_cast(cos(mob->tickCount * 3.25) * PI * .25f); } HumanoidMobRenderer::setupRotations(mob, bob, bodyRot, a); -} \ No newline at end of file +} +void ZombieRenderer::scale(shared_ptr _mob, float a) +{ + HumanoidMobRenderer::scale(_mob, a); + + shared_ptr mob = dynamic_pointer_cast(_mob); + if (mob != nullptr && mob->isHusk()) + { + glScalef(1.0625f, 1.0625f, 1.0625f); + } +} diff --git a/Minecraft.Client/ZombieRenderer.h b/Minecraft.Client/ZombieRenderer.h index c8f110b1..e9c1514f 100644 --- a/Minecraft.Client/ZombieRenderer.h +++ b/Minecraft.Client/ZombieRenderer.h @@ -10,6 +10,8 @@ private: static ResourceLocation ZOMBIE_PIGMAN_LOCATION; static ResourceLocation ZOMBIE_LOCATION; static ResourceLocation ZOMBIE_VILLAGER_LOCATION; + static ResourceLocation HUSK_LOCATION; + static ResourceLocation ZOMBIE_VILLAGER_PROFESSION_LOCATIONS[5]; HumanoidModel *defaultModel; VillagerZombieModel *villagerModel; @@ -42,4 +44,5 @@ private: protected: virtual void setupRotations(shared_ptr _mob, float bob, float bodyRot, float a); + virtual void scale(shared_ptr mob, float a); }; \ No newline at end of file diff --git a/Minecraft.Client/cmake/sources/Common.cmake b/Minecraft.Client/cmake/sources/Common.cmake index 7e695c0c..ad780588 100644 --- a/Minecraft.Client/cmake/sources/Common.cmake +++ b/Minecraft.Client/cmake/sources/Common.cmake @@ -594,6 +594,8 @@ set(_MINECRAFT_CLIENT_COMMON_NET_MINECRAFT_CLIENT_MODEL "${CMAKE_CURRENT_SOURCE_DIR}/SignModel.h" "${CMAKE_CURRENT_SOURCE_DIR}/SilverfishModel.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/SilverfishModel.h" + "${CMAKE_CURRENT_SOURCE_DIR}/DragonHeadModel.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/DragonHeadModel.h" "${CMAKE_CURRENT_SOURCE_DIR}/SkeletonHeadModel.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/SkeletonHeadModel.h" "${CMAKE_CURRENT_SOURCE_DIR}/SkeletonModel.cpp" @@ -694,6 +696,10 @@ set(_MINECRAFT_CLIENT_COMMON_NET_MINECRAFT_CLIENT_PARTICLE "${CMAKE_CURRENT_SOURCE_DIR}/CritParticle2.h" "${CMAKE_CURRENT_SOURCE_DIR}/DragonBreathParticle.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/DragonBreathParticle.h" + "${CMAKE_CURRENT_SOURCE_DIR}/EndRodParticle.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/FallingDustParticle.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/FallingDustParticle.h" + "${CMAKE_CURRENT_SOURCE_DIR}/EndRodParticle.h" "${CMAKE_CURRENT_SOURCE_DIR}/DripParticle.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/DripParticle.h" "${CMAKE_CURRENT_SOURCE_DIR}/EchantmentTableParticle.cpp" @@ -933,6 +939,12 @@ set(_MINECRAFT_CLIENT_COMMON_NET_MINECRAFT_CLIENT_RENDERER_ENTITY "${CMAKE_CURRENT_SOURCE_DIR}/ArmorStandRenderer.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/EndermiteRenderer.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/EndermiteRenderer.h" + "${CMAKE_CURRENT_SOURCE_DIR}/ShulkerModel.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/ShulkerModel.h" + "${CMAKE_CURRENT_SOURCE_DIR}/ShulkerRenderer.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/ShulkerRenderer.h" + "${CMAKE_CURRENT_SOURCE_DIR}/ShulkerBulletRenderer.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/ShulkerBulletRenderer.h" "${CMAKE_CURRENT_SOURCE_DIR}/GuardianRenderer.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/GuardianRenderer.h" ) @@ -991,6 +1003,8 @@ set(_MINECRAFT_CLIENT_COMMON_NET_MINECRAFT_CLIENT_RENDERER_TILEENTITY "${CMAKE_CURRENT_SOURCE_DIR}/SignRenderer.h" "${CMAKE_CURRENT_SOURCE_DIR}/SkullTileRenderer.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/SkullTileRenderer.h" + "${CMAKE_CURRENT_SOURCE_DIR}/TheEndGatewayRenderer.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/TheEndGatewayRenderer.h" "${CMAKE_CURRENT_SOURCE_DIR}/TheEndPortalRenderer.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/TheEndPortalRenderer.h" "${CMAKE_CURRENT_SOURCE_DIR}/TileEntityRenderDispatcher.cpp" diff --git a/Minecraft.Server.FourKit/Event/Player/PlayerTeleportEvent.cs b/Minecraft.Server.FourKit/Event/Player/PlayerTeleportEvent.cs index ce453c4f..268517b2 100644 --- a/Minecraft.Server.FourKit/Event/Player/PlayerTeleportEvent.cs +++ b/Minecraft.Server.FourKit/Event/Player/PlayerTeleportEvent.cs @@ -24,6 +24,7 @@ public class PlayerTeleportEvent : PlayerMoveEvent END_PORTAL, /// Indicates the teleportation was caused by an event not covered by this enum. UNKNOWN, + CHORUS_FRUIT, } private readonly TeleportCause _cause; diff --git a/Minecraft.Server.FourKit/FourKitHost.Events.cs b/Minecraft.Server.FourKit/FourKitHost.Events.cs index f6c6ef25..0a4aedde 100644 --- a/Minecraft.Server.FourKit/FourKitHost.Events.cs +++ b/Minecraft.Server.FourKit/FourKitHost.Events.cs @@ -1007,7 +1007,7 @@ public static partial class FourKitHost var toWorld = FourKit.getWorld(toDimId); var from = new Location(fromWorld, fromX, fromY, fromZ); var to = new Location(toWorld, toX, toY, toZ); - var teleportCause = cause >= 0 && cause <= (int)PlayerTeleportEvent.TeleportCause.UNKNOWN + var teleportCause = cause >= 0 && cause <= (int)PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT ? (PlayerTeleportEvent.TeleportCause)cause : PlayerTeleportEvent.TeleportCause.UNKNOWN; @@ -1047,7 +1047,7 @@ public static partial class FourKitHost var toWorld = FourKit.getWorld(toDimId); var from = new Location(fromWorld, fromX, fromY, fromZ); var to = new Location(toWorld, toX, toY, toZ); - var teleportCause = cause >= 0 && cause <= (int)PlayerTeleportEvent.TeleportCause.UNKNOWN + var teleportCause = cause >= 0 && cause <= (int)PlayerTeleportEvent.TeleportCause.CHORUS_FRUIT ? (PlayerTeleportEvent.TeleportCause)cause : PlayerTeleportEvent.TeleportCause.UNKNOWN; diff --git a/Minecraft.Server.FourKit/Material.cs b/Minecraft.Server.FourKit/Material.cs index b9480672..4bfbaf98 100644 --- a/Minecraft.Server.FourKit/Material.cs +++ b/Minecraft.Server.FourKit/Material.cs @@ -199,6 +199,14 @@ public enum Material JUNGLE_DOOR = 195, ACACIA_DOOR = 196, DARK_OAK_DOOR = 197, + END_ROD = 198, + CHORUS_PLANT = 199, + CHORUS_FLOWER = 200, + PURPUR_BLOCK = 201, + PURPUR_PILLAR = 202, + PURPUR_STAIRS = 203, + PURPUR_DOUBLE_SLAB = 204, + PURPUR_SLAB = 205, // items @@ -373,6 +381,18 @@ public enum Material JUNGLE_DOOR_ITEM = 429, ACACIA_DOOR_ITEM = 430, DARK_OAK_DOOR_ITEM = 431, + CHORUS_FRUIT = 432, + END_CRYSTAL = 426, + CHORUS_FRUIT_POPPED = 433, + DRAGONS_BREATH = 437, + SPECTRAL_ARROW = 439, + TIPPED_ARROW = 440, + LINGERING_POTION = 441, + BOAT_SPRUCE = 444, + BOAT_BIRCH = 445, + BOAT_JUNGLE = 446, + BOAT_ACACIA = 447, + BOAT_DARK_OAK = 448, GOLD_RECORD = 2256, GREEN_RECORD = 2257, RECORD_3 = 2258, diff --git a/Minecraft.Server/cmake/sources/Common.cmake b/Minecraft.Server/cmake/sources/Common.cmake index 375aad5e..63d2a76c 100644 --- a/Minecraft.Server/cmake/sources/Common.cmake +++ b/Minecraft.Server/cmake/sources/Common.cmake @@ -297,6 +297,8 @@ set(_MINECRAFT_SERVER_COMMON_ROOT "${_MS_SRC}/../Minecraft.Client/DispenserBootstrap.cpp" "${_MS_SRC}/../Minecraft.Client/DistanceChunkSorter.cpp" "${_MS_SRC}/../Minecraft.Client/DragonBreathParticle.cpp" + "${_MS_SRC}/../Minecraft.Client/EndRodParticle.cpp" + "${_MS_SRC}/../Minecraft.Client/FallingDustParticle.cpp" "${_MS_SRC}/../Minecraft.Client/DragonModel.cpp" "${_MS_SRC}/../Minecraft.Client/DripParticle.cpp" "${_MS_SRC}/../Minecraft.Client/EchantmentTableParticle.cpp" @@ -311,6 +313,9 @@ set(_MINECRAFT_SERVER_COMMON_ROOT "${_MS_SRC}/../Minecraft.Client/EndermanRenderer.cpp" "${_MS_SRC}/../Minecraft.Client/EndermiteModel.cpp" "${_MS_SRC}/../Minecraft.Client/EndermiteRenderer.cpp" + "${_MS_SRC}/../Minecraft.Client/ShulkerModel.cpp" + "${_MS_SRC}/../Minecraft.Client/ShulkerRenderer.cpp" + "${_MS_SRC}/../Minecraft.Client/ShulkerBulletRenderer.cpp" "${_MS_SRC}/../Minecraft.Client/EntityRenderDispatcher.cpp" "${_MS_SRC}/../Minecraft.Client/EntityRenderer.cpp" "${_MS_SRC}/../Minecraft.Client/EntityTileRenderer.cpp" @@ -445,6 +450,7 @@ set(_MINECRAFT_SERVER_COMMON_ROOT "${_MS_SRC}/../Minecraft.Client/SilverfishModel.cpp" "${_MS_SRC}/../Minecraft.Client/SilverfishRenderer.cpp" "${_MS_SRC}/../Minecraft.Client/SimpleIcon.cpp" + "${_MS_SRC}/../Minecraft.Client/DragonHeadModel.cpp" "${_MS_SRC}/../Minecraft.Client/SkeletonHeadModel.cpp" "${_MS_SRC}/../Minecraft.Client/SkeletonModel.cpp" "${_MS_SRC}/../Minecraft.Client/SkeletonRenderer.cpp" @@ -487,6 +493,7 @@ set(_MINECRAFT_SERVER_COMMON_ROOT "${_MS_SRC}/../Minecraft.Client/TexturePack.cpp" "${_MS_SRC}/../Minecraft.Client/TexturePackRepository.cpp" "${_MS_SRC}/../Minecraft.Client/Textures.cpp" + "${_MS_SRC}/../Minecraft.Client/TheEndGatewayRenderer.cpp" "${_MS_SRC}/../Minecraft.Client/TheEndPortalRenderer.cpp" "${_MS_SRC}/../Minecraft.Client/TileEntityRenderDispatcher.cpp" "${_MS_SRC}/../Minecraft.Client/TileEntityRenderer.cpp" diff --git a/Minecraft.World/AddEntityPacket.h b/Minecraft.World/AddEntityPacket.h index d40a8437..512cd7ce 100644 --- a/Minecraft.World/AddEntityPacket.h +++ b/Minecraft.World/AddEntityPacket.h @@ -8,6 +8,7 @@ class AddEntityPacket : public Packet, public enable_shared_from_thisdefineSynchedData(); + + potionValue = 0; + fixedColor = false; + durationOnUse = 0; + radiusOnUse = 0.0f; + radiusPerTick = 0.0f; + duration = 600; + waitTime = 20; + reapplicationDelay = 20; + noPhysics = true; + fireImmune = true; + setRadius(3.0f); +} + +AreaEffectCloud::AreaEffectCloud(Level *level) : Entity(level) +{ + _init(); +} + +AreaEffectCloud::AreaEffectCloud(Level *level, double x, double y, double z) : Entity(level) +{ + _init(); + setPos(x, y, z); +} + +AreaEffectCloud::~AreaEffectCloud() +{ + for (auto &effect : extraEffects) + { + delete effect; + } +} + +void AreaEffectCloud::defineSynchedData() +{ + entityData->define(DATA_RADIUS, 0.5f); + entityData->define(DATA_COLOR, 0); + entityData->define(DATA_WAITING, static_cast(0)); + entityData->define(DATA_PARTICLE, static_cast(eParticleType_mobSpell)); + entityData->define(DATA_PARTICLE_RATE, 0); +} + +void AreaEffectCloud::setRadius(float radius) +{ + double ox = x; + double oy = y; + double oz = z; + setSize(radius * 2.0f, 0.5f); + setPos(ox, oy, oz); + if (level != nullptr && !level->isClientSide) + { + entityData->set(DATA_RADIUS, radius); + } +} + +float AreaEffectCloud::getRadius() +{ + return entityData->getFloat(DATA_RADIUS); +} + +bool AreaEffectCloud::isWaiting() +{ + return entityData->getByte(DATA_WAITING) != 0; +} + +void AreaEffectCloud::setWaiting(bool waiting) +{ + entityData->set(DATA_WAITING, static_cast(waiting ? 1 : 0)); +} + +int AreaEffectCloud::getColor() +{ + return entityData->getInteger(DATA_COLOR); +} + +void AreaEffectCloud::setFixedColor(int color) +{ + fixedColor = true; + entityData->set(DATA_COLOR, color); +} + +ePARTICLE_TYPE AreaEffectCloud::getParticle() +{ + return static_cast(entityData->getInteger(DATA_PARTICLE)); +} + +void AreaEffectCloud::setParticle(ePARTICLE_TYPE particle) +{ + entityData->set(DATA_PARTICLE, static_cast(particle)); +} + +void AreaEffectCloud::setParticleSpawnRateOnTick(int rate) +{ + entityData->set(DATA_PARTICLE_RATE, rate); +} + +void AreaEffectCloud::setPotionValue(int potionValue) +{ + this->potionValue = potionValue; + if (!fixedColor) updateColor(); +} + +void AreaEffectCloud::addEffect(MobEffectInstance *effect) +{ + extraEffects.push_back(effect); + if (!fixedColor) updateColor(); +} + +void AreaEffectCloud::updateColor() +{ + vector all; + vector *potionEffects = PotionBrewing::getEffects(potionValue, false); + if (potionEffects != nullptr) + { + all.insert(all.end(), potionEffects->begin(), potionEffects->end()); + } + all.insert(all.end(), extraEffects.begin(), extraEffects.end()); + + entityData->set(DATA_COLOR, all.empty() ? 0 : PotionBrewing::getColorValue(&all)); + + if (potionEffects != nullptr) + { + for (auto &effect : *potionEffects) delete effect; + delete potionEffects; + } +} + +void AreaEffectCloud::setOwner(shared_ptr owner) +{ + this->owner = owner; +} + +shared_ptr AreaEffectCloud::getOwner() +{ + return owner.lock(); +} + +void AreaEffectCloud::tick() +{ + Entity::tick(); + + bool waiting = isWaiting(); + float radius = getRadius(); + + if (level->isClientSide) + { + if (fabs(bbWidth - radius * 2.0f) > 0.001f) + { + setSize(radius * 2.0f, 0.5f); + setPos(x, y, z); + } + generateParticles(); + return; + } + + if (tickCount >= waitTime + duration) + { + remove(); + return; + } + + bool shouldWait = tickCount < waitTime; + if (waiting != shouldWait) setWaiting(shouldWait); + if (shouldWait) return; + + if (radiusPerTick != 0.0f) + { + radius += radiusPerTick; + if (radius < 0.5f) + { + remove(); + return; + } + setRadius(radius); + } + + applyMobEffects(); +} + +void AreaEffectCloud::applyMobEffects() +{ + if (tickCount % 5 != 0) return; + + for (auto it = reapplicationDelayMap.begin(); it != reapplicationDelayMap.end();) + { + if (tickCount >= it->second) it = reapplicationDelayMap.erase(it); + else ++it; + } + + vector effects; + vector *potionEffects = PotionBrewing::getEffects(potionValue, false); + if (potionEffects != nullptr) + { + for (auto &effect : *potionEffects) + { + effects.push_back(new MobEffectInstance(effect->getId(), effect->getDuration() / 4, effect->getAmplifier())); + delete effect; + } + delete potionEffects; + } + for (auto &effect : extraEffects) + { + effects.push_back(new MobEffectInstance(effect)); + } + + if (effects.empty()) + { + reapplicationDelayMap.clear(); + return; + } + + float radius = getRadius(); + vector > *nearby = level->getEntitiesOfClass(typeid(LivingEntity), bb); + if (nearby != nullptr) + { + for (auto &it : *nearby) + { + shared_ptr target = dynamic_pointer_cast(it); + if (target == nullptr || reapplicationDelayMap.find(target->entityId) != reapplicationDelayMap.end()) continue; + + double dx = target->x - x; + double dz = target->z - z; + if (dx * dx + dz * dz > radius * radius) continue; + + reapplicationDelayMap[target->entityId] = tickCount + reapplicationDelay; + + for (auto &effect : effects) + { + MobEffect *mobEffect = MobEffect::effects[effect->getId()]; + if (mobEffect == nullptr) continue; + if (mobEffect->isInstantenous()) + { + mobEffect->applyInstantenousEffect(getOwner(), target, effect->getAmplifier(), 0.5); + } + else + { + target->addEffect(new MobEffectInstance(effect)); + } + } + + if (radiusOnUse != 0.0f) + { + radius += radiusOnUse; + if (radius < 0.5f) + { + remove(); + break; + } + setRadius(radius); + } + + if (durationOnUse != 0) + { + duration += durationOnUse; + if (duration < 1) + { + remove(); + break; + } + } + } + delete nearby; + } + + for (auto &effect : effects) delete effect; +} + +void AreaEffectCloud::generateParticles() +{ + float radius = getRadius(); + ePARTICLE_TYPE particle = getParticle(); + bool spell = particle == eParticleType_mobSpell; + int color = getColor(); + + int count; + if (isWaiting()) + { + if (!random->nextBoolean()) return; + count = 2; + radius = 0.2f; + } + else + { + int rate = entityData->getInteger(DATA_PARTICLE_RATE); + count = rate >= 1 ? rate : static_cast(PI * radius * radius); + } + + for (int i = 0; i < count; ++i) + { + float angle = random->nextFloat() * PI * 2.0f; + float dist = sqrt(random->nextFloat()) * radius; + double px = x + cos(angle) * dist; + double pz = z + sin(angle) * dist; + + if (spell) + { + int c = (isWaiting() && random->nextBoolean()) ? 0xffffff : color; + level->addParticle(eParticleType_mobSpell, px, y, pz, + ((c >> 16) & 0xff) / 255.0f, ((c >> 8) & 0xff) / 255.0f, (c & 0xff) / 255.0f); + } + else if (isWaiting()) + { + level->addParticle(particle, px, y, pz, 0, 0, 0); + } + else + { + level->addParticle(particle, px, y, pz, (0.5 - random->nextDouble()) * 0.15, 0.01, (0.5 - random->nextDouble()) * 0.15); + } + } +} + +int AreaEffectCloud::getPistonPushReaction() +{ + return Material::PUSH_BLOCK; +} + +void AreaEffectCloud::addAdditonalSaveData(CompoundTag *tag) +{ + tag->putInt(L"Age", tickCount); + tag->putInt(L"Duration", duration); + tag->putInt(L"WaitTime", waitTime); + tag->putInt(L"ReapplicationDelay", reapplicationDelay); + tag->putInt(L"DurationOnUse", durationOnUse); + tag->putFloat(L"RadiusOnUse", radiusOnUse); + tag->putFloat(L"RadiusPerTick", radiusPerTick); + tag->putFloat(L"Radius", getRadius()); + tag->putInt(L"Particle", static_cast(getParticle())); + tag->putInt(L"PotionValue", potionValue); + if (fixedColor) tag->putInt(L"Color", getColor()); + + if (!extraEffects.empty()) + { + ListTag *list = new ListTag(); + for (auto &effect : extraEffects) + { + list->add(effect->save(new CompoundTag())); + } + tag->put(L"Effects", list); + } +} + +void AreaEffectCloud::readAdditionalSaveData(CompoundTag *tag) +{ + tickCount = tag->getInt(L"Age"); + duration = tag->getInt(L"Duration"); + waitTime = tag->getInt(L"WaitTime"); + reapplicationDelay = tag->getInt(L"ReapplicationDelay"); + durationOnUse = tag->getInt(L"DurationOnUse"); + radiusOnUse = tag->getFloat(L"RadiusOnUse"); + radiusPerTick = tag->getFloat(L"RadiusPerTick"); + setRadius(tag->getFloat(L"Radius")); + if (tag->contains(L"Particle")) setParticle(static_cast(tag->getInt(L"Particle"))); + if (tag->contains(L"Color")) setFixedColor(tag->getInt(L"Color")); + setPotionValue(tag->getInt(L"PotionValue")); + + if (tag->contains(L"Effects")) + { + ListTag *list = (ListTag *) tag->getList(L"Effects"); + for (int i = 0; i < list->size(); i++) + { + MobEffectInstance *effect = MobEffectInstance::load(list->get(i)); + if (effect != nullptr) addEffect(effect); + } + } +} diff --git a/Minecraft.World/AreaEffectCloud.h b/Minecraft.World/AreaEffectCloud.h new file mode 100644 index 00000000..837022af --- /dev/null +++ b/Minecraft.World/AreaEffectCloud.h @@ -0,0 +1,76 @@ +#pragma once +using namespace std; + +#include "Entity.h" +#include "ParticleTypes.h" + +class LivingEntity; +class MobEffectInstance; +class CompoundTag; + +class AreaEffectCloud : public Entity +{ +public: + eINSTANCEOF GetType() { return eTYPE_AREA_EFFECT_CLOUD; } + static Entity *create(Level *level) { return new AreaEffectCloud(level); } + +private: + static const int DATA_RADIUS = 8; + static const int DATA_COLOR = 9; + static const int DATA_WAITING = 10; + static const int DATA_PARTICLE = 11; + static const int DATA_PARTICLE_RATE = 12; + + int potionValue; + vector extraEffects; + unordered_map reapplicationDelayMap; + int duration; + int waitTime; + int reapplicationDelay; + bool fixedColor; + int durationOnUse; + float radiusOnUse; + float radiusPerTick; + weak_ptr owner; + + void _init(); + void updateColor(); + void applyMobEffects(); + void generateParticles(); + +protected: + virtual void defineSynchedData(); + virtual void readAdditionalSaveData(CompoundTag *tag); + virtual void addAdditonalSaveData(CompoundTag *tag); + +public: + AreaEffectCloud(Level *level); + AreaEffectCloud(Level *level, double x, double y, double z); + virtual ~AreaEffectCloud(); + + virtual void tick(); + virtual int getPistonPushReaction(); + + void setRadius(float radius); + float getRadius(); + bool isWaiting(); + void setWaiting(bool waiting); + int getColor(); + void setFixedColor(int color); + ePARTICLE_TYPE getParticle(); + void setParticle(ePARTICLE_TYPE particle); + void setParticleSpawnRateOnTick(int rate); + + void setPotionValue(int potionValue); + int getPotionValue() { return potionValue; } + void addEffect(MobEffectInstance *effect); + + int getDuration() { return duration; } + void setDuration(int duration) { this->duration = duration; } + void setDurationOnUse(int duration) { durationOnUse = duration; } + void setRadiusOnUse(float radius) { radiusOnUse = radius; } + void setRadiusPerTick(float radius) { radiusPerTick = radius; } + void setWaitTime(int waitTime) { this->waitTime = waitTime; } + void setOwner(shared_ptr owner); + shared_ptr getOwner(); +}; diff --git a/Minecraft.World/ArmorItem.cpp b/Minecraft.World/ArmorItem.cpp index e92c6695..fcdc0256 100644 --- a/Minecraft.World/ArmorItem.cpp +++ b/Minecraft.World/ArmorItem.cpp @@ -5,6 +5,7 @@ #include "net.minecraft.world.level.tile.h" #include "net.minecraft.world.entity.player.h" #include "net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.ai.attributes.h" #include "net.minecraft.world.phys.h" #include "net.minecraft.world.level.h" #include "com.mojang.nbt.h" @@ -135,6 +136,13 @@ int ArmorItem::getUseDuration(shared_ptr itemInstance) return 1; } +attrAttrModMap *ArmorItem::getDefaultAttributeModifiers() +{ + attrAttrModMap *result = Item::getDefaultAttributeModifiers(); + result->insert(attrAttrModMap::value_type(eAttributeId_GENERIC_ARMOR, new AttributeModifier(eModifierId_ITEM_ARMOR, defense, AttributeModifier::OPERATION_ADDITION))); + return result; +} + shared_ptr ArmorItem::use(shared_ptr instance, Level* level, shared_ptr player) { /*ByteArrayOutputStream baos; DataOutputStream dos(&baos); @@ -148,17 +156,17 @@ shared_ptr ArmorItem::use(shared_ptr instance, Level int material = Item::items[instance->id]->getMaterial(); int lo, hi; switch (material) { - case Item::eMaterial_cloth: lo = 194; hi = 199; break; - case Item::eMaterial_chain: lo = 200; hi = 205; break; - case Item::eMaterial_iron: lo = 206; hi = 211; break; - case Item::eMaterial_gold: lo = 212; hi = 217; break; - case Item::eMaterial_diamond: lo = 218; hi = 223; break; - default: lo = 224; hi = 229; break; + case Item::eMaterial_cloth: lo = eSoundType_ITEM_ARMOR_equipLeather1; hi = eSoundType_ITEM_ARMOR_equipLeather6; break; + case Item::eMaterial_chain: lo = eSoundType_ITEM_ARMOR_equipChain1; hi = eSoundType_ITEM_ARMOR_equipChain6; break; + case Item::eMaterial_iron: lo = eSoundType_ITEM_ARMOR_equipIron1; hi = eSoundType_ITEM_ARMOR_equipIron6; break; + case Item::eMaterial_gold: lo = eSoundType_ITEM_ARMOR_equipGold1; hi = eSoundType_ITEM_ARMOR_equipGold6; break; + case Item::eMaterial_diamond: lo = eSoundType_ITEM_ARMOR_equipDiamond1; hi = eSoundType_ITEM_ARMOR_equipDiamond6; break; + default: lo = eSoundType_ITEM_ARMOR_equipGeneric1; hi = eSoundType_ITEM_ARMOR_equipGeneric6; break; } std::mt19937 rng(std::random_device{}()); std::uniform_int_distribution dist(lo, hi); - player->playSound(dist(rng), 0.5f, 1.0f); + player->playSound(dist(rng), 1.0f, 1.0f); // Return the (now empty) instance return instance; diff --git a/Minecraft.World/ArmorItem.h b/Minecraft.World/ArmorItem.h index 90b69e6b..dddd5c14 100644 --- a/Minecraft.World/ArmorItem.h +++ b/Minecraft.World/ArmorItem.h @@ -89,6 +89,7 @@ public: virtual shared_ptr use(shared_ptr instance, Level* level, shared_ptr player); virtual int getUseDuration(shared_ptr itemInstance); + virtual attrAttrModMap *getDefaultAttributeModifiers(); static Icon *getEmptyIcon(int slot); }; \ No newline at end of file diff --git a/Minecraft.World/Arrow.cpp b/Minecraft.World/Arrow.cpp index 1f26bada..73cb1f07 100644 --- a/Minecraft.World/Arrow.cpp +++ b/Minecraft.World/Arrow.cpp @@ -12,6 +12,9 @@ #include "../Minecraft.Client/PlayerConnection.h" #include "com.mojang.nbt.h" #include "Arrow.h" +#include "net.minecraft.world.effect.h" +#include "net.minecraft.world.item.alchemy.h" +#include "MobEffectInstance.h" // 4J : WESTY : Added for other award, kill creeper with arrow. #include "net.minecraft.world.entity.monster.h" @@ -44,6 +47,10 @@ void Arrow::_init() life = 0; baseDamage = ARROW_BASE_DAMAGE; + inGroundTime = 0; + customEffectId = -1; + customEffectDuration = 0; + customEffectAmplifier = 0; knockback = 0; } @@ -124,6 +131,8 @@ Arrow::Arrow(Level *level, shared_ptr mob, float power) : Entity( void Arrow::defineSynchedData() { entityData->define(ID_FLAGS, static_cast(0)); + entityData->define(ID_ARROW_TYPE, static_cast(TYPE_NORMAL)); + entityData->define(ID_POTION, 0); } @@ -182,6 +191,25 @@ void Arrow::tick() { Entity::tick(); + if (level->isClientSide) + { + int arrowType = getArrowType(); + if (arrowType == TYPE_SPECTRAL && !inGround) + { + level->addParticle(eParticleType_instantSpell, x, y, z, 0, 0, 0); + } + else if (arrowType == TYPE_TIPPED) + { + int col = PotionBrewing::getColorValue(getPotionValue(), false); + int count = inGround ? ((inGroundTime++ % 5) == 0 ? 1 : 0) : 2; + for (int i = 0; i < count; i++) + { + level->addParticle(eParticleType_mobSpell, x + (random->nextDouble() - 0.5) * bbWidth, y + random->nextDouble() * bbHeight, z + (random->nextDouble() - 0.5) * bbWidth, + ((col >> 16) & 0xff) / 255.0, ((col >> 8) & 0xff) / 255.0, (col & 0xff) / 255.0); + } + } + } + if (xRotO == 0 && yRotO == 0) { @@ -325,6 +353,7 @@ void Arrow::tick() if (!level->isClientSide) { mob->setArrowCount(mob->getArrowCount() + 1); + applyArrowEffects(mob); } if (knockback > 0) { @@ -469,6 +498,14 @@ void Arrow::addAdditonalSaveData(CompoundTag *tag) tag->putByte(L"inGround", static_cast(inGround ? 1 : 0)); tag->putByte(L"pickup", static_cast(pickup)); tag->putDouble(L"damage", baseDamage); + tag->putByte(L"ArrowType", static_cast(getArrowType())); + tag->putInt(L"Potion", getPotionValue()); + if (customEffectId >= 0) + { + tag->putInt(L"CustomEffect", customEffectId); + tag->putInt(L"CustomEffectDuration", customEffectDuration); + tag->putInt(L"CustomEffectAmplifier", customEffectAmplifier); + } } void Arrow::readAdditionalSaveData(CompoundTag *tag) @@ -484,6 +521,11 @@ void Arrow::readAdditionalSaveData(CompoundTag *tag) { baseDamage = tag->getDouble(L"damage"); } + if (tag->contains(L"ArrowType")) + { + setArrowType(tag->getByte(L"ArrowType"), tag->getInt(L"Potion")); + if (tag->contains(L"CustomEffect")) setCustomEffect(tag->getInt(L"CustomEffect"), tag->getInt(L"CustomEffectDuration"), tag->getInt(L"CustomEffectAmplifier")); + } if (tag->contains(L"pickup")) { @@ -503,7 +545,7 @@ void Arrow::playerTouch(shared_ptr player) if (pickup == PICKUP_ALLOWED) { - if (!player->inventory->add(std::make_shared(Item::arrow, 1))) + if (!player->inventory->add(getPickupItem())) { bRemove = false; } @@ -565,3 +607,96 @@ bool Arrow::isCritArrow() byte flags = entityData->getByte(ID_FLAGS); return (flags & FLAG_CRIT) != 0; } + +void Arrow::setArrowType(int type, int potionValue) +{ + entityData->set(ID_ARROW_TYPE, static_cast(type)); + entityData->set(ID_POTION, type == TYPE_TIPPED ? potionValue : 0); +} + +int Arrow::getArrowType() +{ + return entityData->getByte(ID_ARROW_TYPE); +} + +int Arrow::getPotionValue() +{ + return entityData->getInteger(ID_POTION); +} + +bool Arrow::isArrowItem(int itemId) +{ + return itemId == Item::arrow_Id || itemId == Item::spectral_arrow_Id || itemId == Item::tipped_arrow_Id; +} + +void Arrow::setFromItem(shared_ptr item) +{ + if (item == nullptr || item->id == Item::arrow_Id) + { + setArrowType(TYPE_NORMAL); + } + else if (item->id == Item::spectral_arrow_Id) + { + setArrowType(TYPE_SPECTRAL); + } + else if (item->id == Item::tipped_arrow_Id) + { + setArrowType(TYPE_TIPPED, item->getAuxValue()); + } +} + +shared_ptr Arrow::getPickupItem() +{ + switch (getArrowType()) + { + case TYPE_SPECTRAL: + return std::make_shared(Item::spectral_arrow, 1); + case TYPE_TIPPED: + return std::make_shared(Item::tipped_arrow_Id, 1, getPotionValue()); + default: + return std::make_shared(Item::arrow, 1); + } +} + +void Arrow::applyArrowEffects(shared_ptr mob) +{ + int arrowType = getArrowType(); + if (arrowType == TYPE_SPECTRAL) + { + mob->addEffect(new MobEffectInstance(MobEffect::glowing->id, SPECTRAL_GLOW_DURATION, 0)); + } + else if (arrowType == TYPE_TIPPED) + { + if (customEffectId >= 0) + { + mob->addEffect(new MobEffectInstance(customEffectId, customEffectDuration, customEffectAmplifier)); + return; + } + vector *effects = PotionBrewing::getEffects(getPotionValue(), false); + if (effects == nullptr) return; + for (auto &effect : *effects) + { + MobEffect *mobEffect = MobEffect::effects[effect->getId()]; + if (mobEffect != nullptr) + { + if (mobEffect->isInstantenous()) + { + mobEffect->applyInstantenousEffect(dynamic_pointer_cast(owner), mob, effect->getAmplifier(), 1.0); + } + else + { + mob->addEffect(new MobEffectInstance(effect->getId(), max(effect->getDuration() / 8, 1), effect->getAmplifier())); + } + } + delete effect; + } + delete effects; + } +} + +void Arrow::setCustomEffect(int effectId, int duration, int amplifier) +{ + customEffectId = effectId; + customEffectDuration = duration; + customEffectAmplifier = amplifier; +} diff --git a/Minecraft.World/Arrow.h b/Minecraft.World/Arrow.h index 9cfa2f84..b414c990 100644 --- a/Minecraft.World/Arrow.h +++ b/Minecraft.World/Arrow.h @@ -25,6 +25,8 @@ public: private: static const int ID_FLAGS = 16; static const int FLAG_CRIT = 1; + static const int ID_ARROW_TYPE = 17; + static const int ID_POTION = 18; private: int xTile; @@ -81,4 +83,24 @@ public: virtual bool isAttackable(); void setCritArrow(bool critArrow); bool isCritArrow(); + + static const int TYPE_NORMAL = 0; + static const int TYPE_SPECTRAL = 1; + static const int TYPE_TIPPED = 2; + static const int SPECTRAL_GLOW_DURATION = 200; + + void setArrowType(int type, int potionValue = 0); + int getArrowType(); + int getPotionValue(); + void setFromItem(shared_ptr item); + shared_ptr getPickupItem(); + static bool isArrowItem(int itemId); + void setCustomEffect(int effectId, int duration, int amplifier); + +private: + void applyArrowEffects(shared_ptr mob); + int inGroundTime; + int customEffectId; + int customEffectDuration; + int customEffectAmplifier; }; \ No newline at end of file diff --git a/Minecraft.World/AttackDamageMobEffect.cpp b/Minecraft.World/AttackDamageMobEffect.cpp index 00ab0f95..e1e604e3 100644 --- a/Minecraft.World/AttackDamageMobEffect.cpp +++ b/Minecraft.World/AttackDamageMobEffect.cpp @@ -10,10 +10,10 @@ double AttackDamageMobEffect::getAttributeModifierValue(int amplifier, Attribute { if (id == MobEffect::weakness->id) { - return -0.5f * (amplifier + 1); + return -4.0 * (amplifier + 1); } else { - return 1.3 * (amplifier + 1); + return 3.0 * (amplifier + 1); } } \ No newline at end of file diff --git a/Minecraft.World/Attribute.cpp b/Minecraft.World/Attribute.cpp index 7c280862..cc0c5257 100644 --- a/Minecraft.World/Attribute.cpp +++ b/Minecraft.World/Attribute.cpp @@ -10,6 +10,7 @@ const int Attribute::AttributeNames [] = IDS_ATTRIBUTE_NAME_GENERIC_ATTACKDAMAGE, IDS_ATTRIBUTE_NAME_HORSE_JUMPSTRENGTH, IDS_ATTRIBUTE_NAME_ZOMBIE_SPAWNREINFORCEMENTS, + IDS_ATTRIBUTE_NAME_GENERIC_ARMOR, }; int Attribute::getName(eATTRIBUTE_ID id) diff --git a/Minecraft.World/Attribute.h b/Minecraft.World/Attribute.h index 1fb5246b..9027b5be 100644 --- a/Minecraft.World/Attribute.h +++ b/Minecraft.World/Attribute.h @@ -15,6 +15,7 @@ enum eATTRIBUTE_ID // 1.8+ // New attributes go here + eAttributeId_GENERIC_ARMOR, eAttributeId_COUNT }; diff --git a/Minecraft.World/AttributeModifier.h b/Minecraft.World/AttributeModifier.h index c67fda1d..9ae1c488 100644 --- a/Minecraft.World/AttributeModifier.h +++ b/Minecraft.World/AttributeModifier.h @@ -33,6 +33,8 @@ enum eMODIFIER_ID eModifierId_POTION_MOVESLOWDOWN, eModifierId_POTION_WEAKNESS, + eModifierId_ITEM_ARMOR, + eModifierId_COUNT, }; diff --git a/Minecraft.World/BaseRailTile.cpp b/Minecraft.World/BaseRailTile.cpp index bcafc7d0..b385eef3 100644 --- a/Minecraft.World/BaseRailTile.cpp +++ b/Minecraft.World/BaseRailTile.cpp @@ -421,9 +421,10 @@ HitResult *BaseRailTile::clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec void BaseRailTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param { int data = level->getData(x, y, z); + if (usesDataBit) data &= RAIL_DIRECTION_MASK; if (data >= 2 && data <= 5) { - setShape(0, 0, 0, 1, 2 / 16.0f + 0.5f, 1); + setShape(0, 0, 0, 1, 0.5f, 1); } else { setShape(0, 0, 0, 1, 2 / 16.0f, 1); diff --git a/Minecraft.World/BeaconTileEntity.cpp b/Minecraft.World/BeaconTileEntity.cpp index 5207fe28..03288656 100644 --- a/Minecraft.World/BeaconTileEntity.cpp +++ b/Minecraft.World/BeaconTileEntity.cpp @@ -71,6 +71,7 @@ void BeaconTileEntity::applyEffects() { double range = (levels * 10) + 10; + int duration = (9 + levels * 2) * SharedConstants::TICKS_PER_SECOND; int baseAmp = 0; if (levels >= 4 && primaryPower == secondaryPower) { @@ -86,7 +87,7 @@ void BeaconTileEntity::applyEffects() { shared_ptr player = dynamic_pointer_cast(it); if ( player ) - player->addEffect(new MobEffectInstance(primaryPower, SharedConstants::TICKS_PER_SECOND * 9, baseAmp, true)); + player->addEffect(new MobEffectInstance(primaryPower, duration, baseAmp, true)); } if (levels >= 4 && primaryPower != secondaryPower && secondaryPower > 0) @@ -95,7 +96,7 @@ void BeaconTileEntity::applyEffects() { shared_ptr player = dynamic_pointer_cast(it); if ( player ) - player->addEffect(new MobEffectInstance(secondaryPower, SharedConstants::TICKS_PER_SECOND * 9, 0, true)); + player->addEffect(new MobEffectInstance(secondaryPower, duration, 0, true)); } } delete players; diff --git a/Minecraft.World/BeetrootTile.cpp b/Minecraft.World/BeetrootTile.cpp index 6095591d..f90c4485 100644 --- a/Minecraft.World/BeetrootTile.cpp +++ b/Minecraft.World/BeetrootTile.cpp @@ -86,3 +86,10 @@ void BeetrootTile::registerIcons(IconRegister *iconRegister) icons[i] = iconRegister->registerIcon(getIconName() + L"_stage_" + std::to_wstring(i)); } } + +float BeetrootTile::getShapeHeight(int age) +{ + if (age < 0) age = 0; + if (age > 3) age = 3; + return (age + 1) * 2 / 16.0f; +} diff --git a/Minecraft.World/BeetrootTile.h b/Minecraft.World/BeetrootTile.h index 6a8e201d..605cd0e5 100644 --- a/Minecraft.World/BeetrootTile.h +++ b/Minecraft.World/BeetrootTile.h @@ -23,4 +23,5 @@ public: int getResource(int data, Random *random, int playerBonusLevel); void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonus); void registerIcons(IconRegister *iconRegister); + virtual float getShapeHeight(int age); }; diff --git a/Minecraft.World/BlockStateDecoder.cpp b/Minecraft.World/BlockStateDecoder.cpp index 0c6e081b..850c3df3 100644 --- a/Minecraft.World/BlockStateDecoder.cpp +++ b/Minecraft.World/BlockStateDecoder.cpp @@ -447,6 +447,11 @@ static std::wstring slabTypeToString(int tileId, int type) return (type == StoneSlabTile2::RED_SANDSTONE_SLAB) ? L"red_sandstone" : L"unknown"; } + if (tileId == Tile::purpur_slab_Id || tileId == Tile::purpur_double_slab_Id) + { + return L"purpur"; + } + static const std::wstring typeNames[] = { L"stone", L"sandstone", L"wood", L"cobblestone", L"brick", L"stone_brick", L"nether_brick", L"quartz" @@ -460,7 +465,7 @@ static std::wstring slabPropsToString(int tileId, int composite) bool top = (composite & HalfSlabTile::TOP_SLOT_BIT) != 0; std::wstringstream ss; ss << L"type: " << slabTypeToString(tileId, type); - if (tileId == Tile::wooden_slab_Id || tileId == Tile::stone_slab_Id || tileId == Tile::stone_slab2_Id) + if (tileId == Tile::wooden_slab_Id || tileId == Tile::stone_slab_Id || tileId == Tile::stone_slab2_Id || tileId == Tile::purpur_slab_Id) { ss << L"\n"; ss << L"half: " << (top ? L"top" : L"bottom"); @@ -678,6 +683,7 @@ static bool registerStairDecoder() registerDecoder(Tile::acacia_stairs_Id, fn); registerDecoder(Tile::dark_oak_stairs_Id, fn); registerDecoder(Tile::red_sandstone_stairs_Id, fn); + registerDecoder(Tile::purpur_stairs_Id, fn); return true; } @@ -735,6 +741,8 @@ static bool registerPlantDecoders() registerDecoder(Tile::wooden_slab_Id, [](int composite)->std::wstring { return slabPropsToString(Tile::wooden_slab_Id, composite); }); registerDecoder(Tile::double_stone_slab2_Id, [](int composite)->std::wstring { return slabPropsToString(Tile::double_stone_slab2_Id, composite); }); registerDecoder(Tile::stone_slab2_Id, [](int composite)->std::wstring { return slabPropsToString(Tile::stone_slab2_Id, composite); }); + registerDecoder(Tile::purpur_double_slab_Id, [](int composite)->std::wstring { return slabPropsToString(Tile::purpur_double_slab_Id, composite); }); + registerDecoder(Tile::purpur_slab_Id, [](int composite)->std::wstring { return slabPropsToString(Tile::purpur_slab_Id, composite); }); registerDecoder(Tile::trapdoor_Id, [](int composite)->std::wstring { return trapDoorPropsToString(composite); }); registerDecoder(Tile::iron_trapdoor_Id, [](int composite)->std::wstring { return trapDoorPropsToString(composite); }); registerDecoder(Tile::tripwire_Id, [](int composite)->std::wstring { return tripWirePropsToString(composite); }); diff --git a/Minecraft.World/Boat.cpp b/Minecraft.World/Boat.cpp index faaca25d..5f7f5636 100644 --- a/Minecraft.World/Boat.cpp +++ b/Minecraft.World/Boat.cpp @@ -2,31 +2,39 @@ #include "com.mojang.nbt.h" #include "net.minecraft.world.entity.h" #include "net.minecraft.world.entity.player.h" +#include "net.minecraft.world.entity.monster.h" #include "net.minecraft.world.item.h" #include "net.minecraft.world.level.h" #include "net.minecraft.world.level.material.h" #include "net.minecraft.world.level.tile.h" #include "net.minecraft.world.phys.h" #include "net.minecraft.world.damagesource.h" +#include "SoundTypes.h" #include "Boat.h" -const double Boat::MAX_SPEED = 0.35; -const double Boat::MAX_COLLISION_SPEED = MAX_SPEED * 0.75; -const double Boat::MIN_ACCELERATION = 0.07; -const double Boat::MAX_ACCELERATION = 0.35; // 4J - added for common ctor code void Boat::_init() { + paddlePositions[0] = paddlePositions[1] = 0.0f; doLerp = true; - acceleration = MIN_ACCELERATION; lSteps = 0; lx = ly = lz = lyr = lxr = 0.0; lxd = lyd = lzd = 0.0; + secondRider = weak_ptr(); + status = IN_WATER; + invFriction = 0.0f; + outOfControlTicks = 0; + deltaRotation = 0.0f; + waterLevel = 0.0; + lastYd = 0.0; + rockPhase = 0.0; + inputLeft = inputRight = inputUp = inputDown = false; + blocksBuilding = true; - setSize(1.5f, 0.6f); + setSize(1.375f, 0.6625f); heightOffset = (bbHeight / 2.0f) + 0.2f; // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that @@ -34,15 +42,11 @@ void Boat::_init() this->defineSynchedData(); } - - Boat::Boat(Level *level) : Entity( level ) { - _init(); } - bool Boat::makeStepSound() { return false; @@ -53,11 +57,14 @@ void Boat::defineSynchedData() entityData->define(DATA_ID_HURT, 0); entityData->define(DATA_ID_HURTDIR, 1); entityData->define(DATA_ID_DAMAGE, 0.0f); + entityData->define(DATA_ID_TYPE, OAK); + entityData->define(DATA_ID_PADDLE_LEFT, static_cast(0)); + entityData->define(DATA_ID_PADDLE_RIGHT, static_cast(0)); } - AABB *Boat::getCollideAgainstBox(shared_ptr entity) { + if (entity == nullptr || !entity->isPushable() || hasRider(entity) || entity->riding.get() == this) return nullptr; return entity->bb; } @@ -93,6 +100,9 @@ double Boat::getRideHeight() bool Boat::hurt(DamageSource *source, float hurtDamage) { if (isInvulnerable()) return false; + + if (source != nullptr && dynamic_cast(source) != nullptr && hasRider(source->getEntity())) return false; + if (level->isClientSide || removed) return true; // 4J-JEV: Fix for #88212, @@ -113,7 +123,7 @@ bool Boat::hurt(DamageSource *source, float hurtDamage) // 4J Stu - If someone is riding in this, then it can tick multiple times which causes the damage to // decrease too quickly. So just make the damage a bit higher to start with for similar behaviour // to an unridden one. Only do this change if the riding player is attacking it. - if( rider.lock() != nullptr && rider.lock() == source->getEntity() ) hurtDamage += 1; + if (hasRider(source->getEntity())) hurtDamage += 1; setDamage(getDamage() + hurtDamage * 10); markHurt(); @@ -124,8 +134,8 @@ bool Boat::hurt(DamageSource *source, float hurtDamage) if (creativePlayer || getDamage() > 20 * 2) { - if (rider.lock() != nullptr) rider.lock()->ride( shared_from_this() ); - if (!creativePlayer) spawnAtLocation(Item::boat_Id, 1, 0); + ejectPassengers(); + if (!creativePlayer) spawnAtLocation(getDropItemId(), 1, 0); remove(); } return true; @@ -143,29 +153,17 @@ bool Boat::isPickable() return !removed; } +bool Boat::isLocallyDriven() +{ + shared_ptr driver = rider.lock(); + return level->isClientSide && driver != nullptr && driver->instanceof(eTYPE_LOCALPLAYER); +} void Boat::lerpTo(double x, double y, double z, float yRot, float xRot, int steps) { - if (doLerp) - { - lSteps = steps +5; - } - else - { - double xdiff = x - this->x; - double ydiff = y - this->y; - double zdiff = z - this->z; - double diff = xdiff * xdiff + ydiff * ydiff + zdiff * zdiff; + if (isLocallyDriven()) return; - if (diff > 1) - { - lSteps = 3; - } - else - { - return; - } - } + lSteps = steps + 5; lx = x; ly = y; @@ -180,17 +178,262 @@ void Boat::lerpTo(double x, double y, double z, float yRot, float xRot, int step void Boat::lerpMotion(double xd, double yd, double zd) { + if (isLocallyDriven()) return; lxd = this->xd = xd; lyd = this->yd = yd; lzd = this->zd = zd; } + +float Boat::getWaterFill(Level *level, int x, int y, int z) +{ + if (level->getMaterial(x, y, z) != Material::water) return 0.0f; + if (level->getMaterial(x, y + 1, z) == Material::water) return 1.0f; + return 1.0f - LiquidTile::getHeight(level->getData(x, y, z)); +} + +Boat::EStatus Boat::isUnderwater() +{ + double surfaceY = bb->y1 + 0.001; + int minX = Mth::floor(bb->x0); + int maxX = Mth::ceil(static_cast(bb->x1)); + int minY = Mth::floor(bb->y1); + int maxY = Mth::ceil(static_cast(surfaceY)); + int minZ = Mth::floor(bb->z0); + int maxZ = Mth::ceil(static_cast(bb->z1)); + bool underWater = false; + + for (int xx = minX; xx < maxX; ++xx) + { + for (int yy = minY; yy < maxY; ++yy) + { + for (int zz = minZ; zz < maxZ; ++zz) + { + if (level->getMaterial(xx, yy, zz) != Material::water) continue; + int data = level->getData(xx, yy, zz); + if (surfaceY < yy + 1 - LiquidTile::getHeight(data)) + { + if (data != 0) return UNDER_FLOWING_WATER; + underWater = true; + } + } + } + } + + return underWater ? UNDER_WATER : IN_AIR; +} + +bool Boat::checkInWater() +{ + int minX = Mth::floor(bb->x0); + int maxX = Mth::ceil(static_cast(bb->x1)); + int minY = Mth::floor(bb->y0); + int maxY = Mth::ceil(static_cast(bb->y0 + 0.001)); + int minZ = Mth::floor(bb->z0); + int maxZ = Mth::ceil(static_cast(bb->z1)); + bool inWater = false; + waterLevel = -DBL_MAX; + + for (int xx = minX; xx < maxX; ++xx) + { + for (int yy = minY; yy < maxY; ++yy) + { + for (int zz = minZ; zz < maxZ; ++zz) + { + if (level->getMaterial(xx, yy, zz) != Material::water) continue; + double height = yy + 1 - LiquidTile::getHeight(level->getData(xx, yy, zz)); + waterLevel = max(height, waterLevel); + inWater |= bb->y0 < height; + } + } + } + + return inWater; +} + +float Boat::getGroundFriction() +{ + AABB *box = AABB::newTemp(bb->x0, bb->y0 - 0.001, bb->z0, bb->x1, bb->y0, bb->z1); + int minX = Mth::floor(box->x0) - 1; + int maxX = Mth::ceil(static_cast(box->x1)) + 1; + int minY = Mth::floor(box->y0) - 1; + int maxY = Mth::ceil(static_cast(box->y1)) + 1; + int minZ = Mth::floor(box->z0) - 1; + int maxZ = Mth::ceil(static_cast(box->z1)) + 1; + AABBList collisions; + float friction = 0.0f; + int count = 0; + + for (int xx = minX; xx < maxX; ++xx) + { + for (int zz = minZ; zz < maxZ; ++zz) + { + int edges = (xx != minX && xx != maxX - 1 ? 0 : 1) + (zz != minZ && zz != maxZ - 1 ? 0 : 1); + if (edges == 2) continue; + for (int yy = minY; yy < maxY; ++yy) + { + if (edges > 0 && (yy == minY || yy == maxY - 1)) continue; + int t = level->getTile(xx, yy, zz); + if (t <= 0 || Tile::tiles[t] == nullptr) continue; + Tile::tiles[t]->addAABBs(level, xx, yy, zz, box, &collisions, shared_from_this()); + if (!collisions.empty()) + { + friction += Tile::tiles[t]->friction; + ++count; + } + collisions.clear(); + } + } + } + + return count == 0 ? 0.0f : friction / count; +} + +Boat::EStatus Boat::getStatus() +{ + EStatus underwaterStatus = isUnderwater(); + if (underwaterStatus != IN_AIR) + { + waterLevel = bb->y1; + return underwaterStatus; + } + if (checkInWater()) return IN_WATER; + if (getGroundFriction() > 0.0f) return ON_LAND; + return IN_AIR; +} + +float Boat::getWaterLevelAbove() +{ + int minY = Mth::floor(bb->y1); + int maxY = Mth::ceil(static_cast(bb->y1 - lastYd)); + int minX = Mth::floor(bb->x0); + int maxX = Mth::ceil(static_cast(bb->x1)); + int minZ = Mth::floor(bb->z0); + int maxZ = Mth::ceil(static_cast(bb->z1)); + + for (int yy = minY; yy < maxY; ++yy) + { + float height = 0.0f; + bool open = true; + for (int xx = minX; xx < maxX && open; ++xx) + { + for (int zz = minZ; zz < maxZ; ++zz) + { + height = max(height, getWaterFill(level, xx, yy, zz)); + if (height >= 1.0f) + { + open = false; + break; + } + } + } + if (open && height < 1.0f) return yy + height; + } + + return maxY + 1.0f; +} + + +void Boat::floatBoat() +{ + double momentum = sqrt(xd * xd + zd * zd) * 30.0 + 1.0; + if (level->random->nextInt(30) == 0) momentum *= 10.0; + rockPhase += 0.05 * momentum; + + double buoyancy = 0.0; + double rock = 0.0; + const double buoyancyOffset = 0.1; + bool floating = false; + + int px = Mth::floor(x); + int py = Mth::floor(bb->y0); + int pz = Mth::floor(z); + Material *material = level->getMaterial(px, py, pz); + Material *materialAbove = level->getMaterial(px, py + 1, pz); + + if (material == Material::water && materialAbove == Material::air) + { + buoyancy = (1.0 - (bb->y0 - py)) * 0.9 + buoyancyOffset; + rock = (sin(rockPhase) + 1.0) * 0.035; + outOfControlTicks = 0; + invFriction = 0.9f; + floating = true; + } + else if (material == Material::water && materialAbove == Material::water) + { + buoyancy = 1.0; + invFriction = 0.9f; + ++outOfControlTicks; + } + else if (material == Material::air || material == Material::topSnow) + { + invFriction = 1.0f; + if (onGround) + { + int below = level->getTile(px, py - 1, pz); + if (below > 0 && Tile::tiles[below] != nullptr) invFriction = Tile::tiles[below]->friction; + } + else if (level->getMaterial(px, py - 1, pz) == Material::water) + { + invFriction = 0.9f; + } + } + + xd *= invFriction; + zd *= invFriction; + deltaRotation *= invFriction; + + if (floating) + { + double bottom = getWaterLevelAbove() - bbHeight + 0.2 + sin(rockPhase) * 0.035; + move(0, bottom - bb->y0, 0); + yd = 0.0; + return; + } + + yd = (yd - 0.04) * 0.98; + if (buoyancy > 0.0) + { + yd = min(yd * 0.7 + 0.05, (buoyancy - rock - buoyancyOffset) * 0.15); + } +} + +void Boat::controlBoat() +{ + if (rider.lock() == nullptr) return; + + float acceleration = 0.0f; + if (inputLeft) deltaRotation += -1.0f; + if (inputRight) deltaRotation += 1.0f; + if (inputRight != inputLeft && !inputUp && !inputDown) acceleration += 0.005f; + + yRot += deltaRotation; + if (inputUp) acceleration += 0.04f; + if (inputDown) acceleration -= 0.005f; + + xd += Mth::sin(-yRot * PI / 180) * acceleration; + zd += Mth::cos(yRot * PI / 180) * acceleration; + if (!level->isClientSide) setPaddleState((inputRight && !inputLeft) || inputUp, (inputLeft && !inputRight) || inputUp); +} + +void Boat::setPaddleState(bool left, bool right) +{ + entityData->set(DATA_ID_PADDLE_LEFT, static_cast(left ? 1 : 0)); + entityData->set(DATA_ID_PADDLE_RIGHT, static_cast(right ? 1 : 0)); +} + +bool Boat::getPaddleState(int side) +{ + return entityData->getByte(side == 0 ? DATA_ID_PADDLE_LEFT : DATA_ID_PADDLE_RIGHT) != 0 && rider.lock() != nullptr; +} + void Boat::tick() { - Entity::tick(); - - + status = getStatus(); + if (status == UNDER_WATER || status == UNDER_FLOWING_WATER) ++outOfControlTicks; + else outOfControlTicks = 0; + if (!level->isClientSide && outOfControlTicks >= 60) ejectPassengers(); if (getHurtTime() > 0) setHurtTime(getHurtTime() - 1); if (getDamage() > 0) setDamage(getDamage() - 1); @@ -198,224 +441,157 @@ void Boat::tick() yo = y; zo = z; - // Check how much of the boat is in water - int steps = 5; - double waterPercentage = 0; - for (int i = 0; i < steps; i++) + Entity::tick(); + + const float paddleStroke = PI / 8.0f; + const float paddleSplash = PI / 4.0f; + const float paddleCycle = PI * 2.0f; + for (int side = 0; side < 2; ++side) { - double y0 = bb->y0 + (bb->y1 - bb->y0) * (i + 0) / steps + 1.5f / 16.0f; - double y1 = bb->y0 + (bb->y1 - bb->y0) * (i + 1) / steps + 1.5f / 16.0f; - AABB *bb2 = AABB::newTemp(bb->x0, y0, bb->z0, bb->x1, y1, bb->z1); - if (level->containsLiquid(bb2, Material::water)) + if (getPaddleState(side)) { - waterPercentage += 1.0 / steps; + if (!level->isClientSide && fmod(paddlePositions[side], paddleCycle) <= paddleSplash && fmod(paddlePositions[side] + paddleStroke, paddleCycle) >= paddleSplash) + { + int sound = -1; + if (status == ON_LAND) sound = eSoundType_ENTITY_BOAT_PADDLE_LAND; + else if (status != IN_AIR) sound = eSoundType_ENTITY_BOAT_PADDLE_WATER; + if (sound >= 0) + { + double viewX = -Mth::sin(yRot * PI / 180); + double viewZ = Mth::cos(yRot * PI / 180); + double xOffset = side == 1 ? -viewZ : viewZ; + double zOffset = side == 1 ? viewX : -viewX; + level->playSound(x + xOffset, y, z + zOffset, sound, 1.0f, 0.8f + 0.4f * random->nextFloat()); + } + } + paddlePositions[side] += paddleStroke; + } + else + { + paddlePositions[side] = 0.0f; } } - // Create particles - double lastSpeed = sqrt(xd * xd + zd * zd); - if (lastSpeed > MAX_COLLISION_SPEED && waterPercentage > 0) - { - createSplash(lastSpeed); - } - - // Interpolation - if (level->isClientSide && doLerp) + bool predicting = isLocallyDriven(); + if (level->isClientSide && !predicting) { if (lSteps > 0) { double xt = x + (lx - x) / lSteps; double yt = y + (ly - y) / lSteps; double zt = z + (lz - z) / lSteps; - double yrd = Mth::wrapDegrees(lyr - yRot); - - yRot += (float) ( (yrd) / lSteps ); - xRot += (float) ( (lxr - xRot) / lSteps ); - + yRot += static_cast(yrd / lSteps); + xRot += static_cast((lxr - xRot) / lSteps); lSteps--; setPos(xt, yt, zt); setRot(yRot, xRot); } - else - { - // Original - //double xt = x + xd; - //double yt = y + yd; - //double zt = z + zd; - //this->setPos(xt, yt, zt); - - // 4J Stu - Fix for various boat bugs, ensure that we check collision on client-side movement - move(xd,yd,zd); - - if (onGround) - { - xd *= 0.5f; - yd *= 0.5f; - zd *= 0.5f; - } - xd *= 0.99f; - yd *= 0.95f; - zd *= 0.99f; - } return; } - // Bob in water & gravity - if (waterPercentage < 1.0) + shared_ptr driver = rider.lock(); + shared_ptr player = driver != nullptr ? dynamic_pointer_cast(driver) : nullptr; + if (player != nullptr) { - double bob = waterPercentage * 2.0 - 1.0; - yd += 0.04f * bob; + inputLeft = player->xxa > 0.1f; + inputRight = player->xxa < -0.1f; + inputUp = player->yya > 0.1f; + inputDown = player->yya < -0.1f; } else { - if (yd < 0.0) - { - yd /= 2.0; - } - yd += 0.007f; + inputLeft = inputRight = inputUp = inputDown = false; + if (!level->isClientSide) setPaddleState(false, false); } - // Rider controls - if ( rider.lock() != nullptr && rider.lock()->instanceof(eTYPE_LIVINGENTITY) ) + if (player != nullptr && !level->isClientSide) { - shared_ptr livingRider = dynamic_pointer_cast(rider.lock()); - double forward = livingRider->yya; - - if (forward != 0) - { - double riderXd = -sin(livingRider->yRot * PI / 180); - double riderZd = cos(livingRider->yRot * PI / 180); - double currentSpeed = sqrt(xd * xd + zd * zd); - float moveFactor = (float)forward; - if (forward < 0) moveFactor *= 0.5f; // Move slower backwards - xd += riderXd * acceleration * 0.05f * moveFactor; - zd += riderZd * acceleration * 0.05f * moveFactor; - } - } - - double curSpeed = sqrt(xd * xd + zd * zd); - double maxSpeed = MAX_SPEED; - - if (curSpeed > maxSpeed) - { - double ratio = maxSpeed / curSpeed; - - xd *= ratio; - zd *= ratio; - curSpeed = maxSpeed; - } - - if (curSpeed > lastSpeed && acceleration < MAX_ACCELERATION) - { - acceleration += (MAX_ACCELERATION - acceleration) / 35; - if (acceleration > MAX_ACCELERATION) acceleration = MAX_ACCELERATION; + setPaddleState((inputRight && !inputLeft) || inputUp, (inputLeft && !inputRight) || inputUp); + xd = yd = zd = 0; } else { - acceleration -= (acceleration - MIN_ACCELERATION) / 35; - if (acceleration < MIN_ACCELERATION) acceleration = MIN_ACCELERATION; + floatBoat(); + controlBoat(); + move(xd, yd, zd); + setRot(yRot, 0); } - // Slow on ground - if (onGround) - { - xd *= 0.5f; - yd *= 0.5f; - zd *= 0.5f; - } - move(xd, yd, zd); - - // Break boat on high speed collision - float breakThreshold = (rider.lock() != nullptr) ? 0.35f : 0.20f; - if ((horizontalCollision && lastSpeed > 0.20)) - { - if (!level->isClientSide && !removed) - { - - remove(); - for (int i = 0; i < 3; i++) - { - spawnAtLocation(Tile::planks_Id, 1, 0); - } - for (int i = 0; i < 2; i++) - { - spawnAtLocation(Item::stick->id, 1, 0); - } - - - - } - } - else - { - xd *= 0.99f; - yd *= 0.95f; - zd *= 0.99f; - } - - xRot = 0; - double yRotT = yRot; - double xDiff = xo - x; - double zDiff = zo - z; - if (xDiff * xDiff + zDiff * zDiff > 0.001) - { - yRotT = (float) (atan2(zDiff, xDiff) * 180 / PI); - } - - double rotDiff = Mth::wrapDegrees(yRotT - yRot); - - if (rotDiff > 20) rotDiff = 20; - if (rotDiff < -20) rotDiff = -20; - - yRot += (float) rotDiff; - setRot(yRot, xRot); - - // Server code after this - if(level->isClientSide) return; - - vector > *entities = level->getEntities(shared_from_this(), bb->grow(0.2f, 0, 0.2f)); - if (entities && !entities->empty()) - { - auto riderPtr = rider.lock(); - for ( auto& e : *entities ) - { - if (e != riderPtr && e->isPushable() && e->GetType() == eTYPE_BOAT) - { - e->push(shared_from_this()); - } - } - } + if (level->isClientSide) return; for (int i = 0; i < 4; i++) { int xx = Mth::floor(x + ((i % 2) - 0.5) * 0.8); int zz = Mth::floor(z + ((i / 2) - 0.5) * 0.8); - for (int j = 0; j < 2; j++) { - int yy = Mth::floor(y) + j; - int tile = level->getTile(xx, yy, zz); - - if (tile == Tile::snow_layer_Id) - { - level->removeTile(xx, yy, zz); - } - else if (tile == Tile::waterlily_Id) - { - level->destroyTile(xx, yy, zz, true); - } + int yy = Mth::floor(bb->y0) + j; + if (level->getTile(xx, yy, zz) == Tile::waterlily_Id) level->destroyTile(xx, yy, zz, true); } - } - if (rider.lock() != nullptr) + vector > *entities = level->getEntities(shared_from_this(), bb->grow(0.2f, -0.01f, 0.2f)); + if (entities != nullptr) { - if (rider.lock()->removed) rider = weak_ptr(); + for (auto &e : *entities) + { + if (e == nullptr || hasRider(e) || e->riding != nullptr && e->riding.get() == this) continue; + if (!e->isPushable()) continue; + + if (canAddPassenger() && e->riding == nullptr && e->rider.lock() == nullptr && e->instanceof(eTYPE_LIVINGENTITY) + && !e->instanceof(eTYPE_WATERANIMAL) && !e->instanceof(eTYPE_PLAYER)) + { + e->ride(shared_from_this()); + } + else + { + push(e); + } + } } } -void Boat::createSplash(double particleStrengh) { +void Boat::push(shared_ptr e) +{ + if (e->instanceof(eTYPE_BOAT)) + { + if (e->bb->y0 < bb->y1) Entity::push(e); + } + else if (e->bb->y0 <= bb->y0) + { + Entity::push(e); + } +} + +void Boat::checkFallDamage(double ya, bool onGround) +{ + lastYd = yd; + if (riding != nullptr) return; + + if (onGround) + { + if (fallDistance > 3.0f && status == ON_LAND) + { + causeFallDamage(fallDistance); + if (!level->isClientSide && !removed) + { + ejectPassengers(); + remove(); + for (int i = 0; i < 3; i++) spawnAtLocation(Tile::planks_Id, 1, getType()); + for (int i = 0; i < 2; i++) spawnAtLocation(Item::stick->id, 1, 0); + } + } + fallDistance = 0.0f; + } + else if (level->getMaterial(Mth::floor(x), Mth::floor(bb->y0) - 1, Mth::floor(z)) != Material::water && ya < 0.0) + { + fallDistance -= static_cast(ya); + } +} + +void Boat::createSplash(double particleStrengh) +{ double xa = cos(yRot * PI / 180); double za = sin(yRot * PI / 180); @@ -439,26 +615,142 @@ void Boat::createSplash(double particleStrengh) { } } -void Boat::positionRider() -{ - if (rider.lock() == nullptr) return; - double xa = cos(yRot * PI / 180) * 0.4; - double za = sin(yRot * PI / 180) * 0.4; - // We minus 0.4 to ensure that the player is not hovering above the boat. - rider.lock()->setPos(x + xa, y + getRideHeight() + rider.lock()->getRidingHeight()-0.4, z + za); +bool Boat::hasRider(shared_ptr e) +{ + return e != nullptr && (rider.lock() == e || secondRider.lock() == e); } +void Boat::addRider(shared_ptr e) +{ + if (hasRider(e)) return; + shared_ptr driver = rider.lock(); + if (driver != nullptr && e->instanceof(eTYPE_PLAYER) && !driver->instanceof(eTYPE_PLAYER) && secondRider.lock() == nullptr) + { + secondRider = driver; + rider = e; + return; + } + if (rider.lock() == nullptr) rider = e; + else secondRider = e; + + shared_ptr front = rider.lock(); + shared_ptr back = secondRider.lock(); + if (front != nullptr && back != nullptr && !front->instanceof(eTYPE_PLAYER) && !back->instanceof(eTYPE_PLAYER) && back->entityId < front->entityId) + { + rider = back; + secondRider = front; + } +} + +void Boat::removeRider(shared_ptr e) +{ + if (e == nullptr || rider.lock() == e || rider.lock() == nullptr) + { + rider = secondRider; + secondRider = weak_ptr(); + } + else if (secondRider.lock() == e) + { + secondRider = weak_ptr(); + } +} + +shared_ptr Boat::getExtraRider() +{ + return secondRider.lock(); +} + +int Boat::getPassengerCount() +{ + return (rider.lock() != nullptr ? 1 : 0) + (secondRider.lock() != nullptr ? 1 : 0); +} + +bool Boat::canAddPassenger() +{ + return getPassengerCount() < 2; +} + +void Boat::ejectPassengers() +{ + shared_ptr second = secondRider.lock(); + if (second != nullptr && second->riding.get() == this) second->ride(nullptr); + shared_ptr first = rider.lock(); + if (first != nullptr && first->riding.get() == this) first->ride(nullptr); + rider = weak_ptr(); + secondRider = weak_ptr(); +} + +void Boat::clampRotation(shared_ptr passenger) +{ + shared_ptr living = dynamic_pointer_cast(passenger); + if (living != nullptr) living->yBodyRot = yRot; + float relativeYRot = Mth::wrapDegrees(passenger->yRot - yRot); + float clampedYRot = Mth::clamp(relativeYRot, -105.0f, 105.0f); + passenger->yRotO += clampedYRot - relativeYRot; + passenger->yRot += clampedYRot - relativeYRot; + if (living != nullptr) living->setYHeadRot(passenger->yRot); +} + +void Boat::positionRider() +{ + positionRider(rider.lock()); +} + +void Boat::positionRider(shared_ptr passenger) +{ + if (passenger == nullptr || !hasRider(passenger)) return; + + float offset = 0.0f; + bool twoAboard = getPassengerCount() > 1; + if (twoAboard) + { + offset = (rider.lock() == passenger) ? 0.2f : -0.6f; + if (passenger->instanceof(eTYPE_ANIMAL)) offset += 0.2f; + } + + double seatX = -Mth::sin(yRot * PI / 180) * offset; + double seatZ = Mth::cos(yRot * PI / 180) * offset; + double feet = bb->y0 - 0.3 + (getSeatOffset(passenger) + 0.35); + passenger->setPos(x + seatX, feet + passenger->heightOffset - passenger->ySlideOffset, z + seatZ); + + bool isPlayer = passenger->instanceof(eTYPE_PLAYER); + if (level->isClientSide == isPlayer) + { + float turn = Mth::wrapDegrees(yRot - yRotO); + passenger->yRot += turn; + shared_ptr living = dynamic_pointer_cast(passenger); + if (living != nullptr) living->setYHeadRot(living->yHeadRot + turn); + clampRotation(passenger); + + if (twoAboard && living != nullptr && passenger->instanceof(eTYPE_ANIMAL)) + { + int facing = (passenger->entityId & 1) == 0 ? 90 : 270; + living->yBodyRot += facing; + living->setYHeadRot(living->yHeadRot + facing); + } + } +} void Boat::addAdditonalSaveData(CompoundTag *base) { + static const wchar_t *TYPE_NAMES[TYPE_COUNT] = { L"oak", L"spruce", L"birch", L"jungle", L"acacia", L"dark_oak" }; + base->putString(L"Type", TYPE_NAMES[getType()]); } void Boat::readAdditionalSaveData(CompoundTag *base) { + static const wchar_t *TYPE_NAMES[TYPE_COUNT] = { L"oak", L"spruce", L"birch", L"jungle", L"acacia", L"dark_oak" }; + if (base->contains(L"Type")) + { + wstring name = base->getString(L"Type"); + for (int i = 0; i < TYPE_COUNT; i++) + { + if (name == TYPE_NAMES[i]) setType(i); + } + } } - float Boat::getShadowHeightOffs() { return 0; @@ -471,22 +763,22 @@ wstring Boat::getName() bool Boat::interact(shared_ptr player) { - if ( (rider.lock() != nullptr) && rider.lock()->instanceof(eTYPE_PLAYER) && (rider.lock() != player) ) return true; if (!level->isClientSide) { - bool isRiding = (rider.lock() == player); - - if (isRiding) - { - - player->xd = 0; - player->yd = 0; - player->zd = 0; - } - // 4J HEG - Fixed issue with player not being able to dismount boat (issue #4446) - player->ride(isRiding ? nullptr : shared_from_this()); - } - return true; + if (hasRider(player)) + { + // 4J HEG - Fixed issue with player not being able to dismount boat (issue #4446) + player->xd = 0; + player->yd = 0; + player->zd = 0; + player->ride(nullptr); + } + else if (!player->isSneaking() && canAddPassenger() && outOfControlTicks < 60) + { + player->ride(shared_from_this()); + } + } + return true; } void Boat::setDamage(float damage) @@ -529,3 +821,63 @@ void Boat::setDoLerp(bool doLerp) this->doLerp = doLerp; } +void Boat::setType(int type) +{ + if (type < 0 || type >= TYPE_COUNT) type = OAK; + entityData->set(DATA_ID_TYPE, type); +} + +int Boat::getType() +{ + int type = entityData->getInteger(DATA_ID_TYPE); + return (type < 0 || type >= TYPE_COUNT) ? OAK : type; +} + +int Boat::getItemIdForType(int type) +{ + switch (type) + { + case SPRUCE: return Item::spruce_boat_Id; + case BIRCH: return Item::birch_boat_Id; + case JUNGLE: return Item::jungle_boat_Id; + case ACACIA: return Item::acacia_boat_Id; + case DARK_OAK: return Item::dark_oak_boat_Id; + default: return Item::boat_Id; + } +} + +int Boat::getDropItemId() +{ + return getItemIdForType(getType()); +} + +float Boat::getRowingTime(int side, float a) +{ + if (!getPaddleState(side)) return 0.0f; + float from = paddlePositions[side] - PI / 8.0f; + return from + (paddlePositions[side] - from) * Mth::clamp(a, 0.0f, 1.0f); +} + +double Boat::getSeatOffset(shared_ptr passenger) +{ + if (passenger->instanceof(eTYPE_PLAYER)) return -0.35; + if (passenger->instanceof(eTYPE_ZOMBIE)) + { + shared_ptr zombie = dynamic_pointer_cast(passenger); + return (zombie != nullptr && zombie->isBaby()) ? 0.0 : -0.45; + } + if (passenger->instanceof(eTYPE_SKELETON)) return -0.3; + if (passenger->instanceof(eTYPE_ANIMAL)) return 0.14; + if (passenger->instanceof(eTYPE_SILVERFISH) || passenger->instanceof(eTYPE_ENDERMITE)) return 0.1; + if (passenger->instanceof(eTYPE_SHULKER)) return 0.3; + if (passenger->instanceof(eTYPE_ARMORSTAND)) return 0.1; + return 0.0; +} + +int Boat::getLightColor(float a) +{ + int xTile = Mth::floor(x); + int zTile = Mth::floor(z); + if (!level->hasChunkAt(xTile, 0, zTile)) return 0; + return level->getLightColor(xTile, Mth::floor(bb->y0 + bbHeight * 0.85), zTile, 0); +} diff --git a/Minecraft.World/Boat.h b/Minecraft.World/Boat.h index 5e28be2d..2ac93025 100644 --- a/Minecraft.World/Boat.h +++ b/Minecraft.World/Boat.h @@ -24,13 +24,11 @@ private: static const int DATA_ID_HURT = 17; static const int DATA_ID_HURTDIR = 18; static const int DATA_ID_DAMAGE = 19; - static const double MAX_SPEED; - static const double MAX_COLLISION_SPEED; - static const double MIN_ACCELERATION; - static const double MAX_ACCELERATION; + static const int DATA_ID_TYPE = 20; + static const int DATA_ID_PADDLE_LEFT = 21; + static const int DATA_ID_PADDLE_RIGHT = 22; bool doLerp; - double acceleration; public: Boat(Level *level); @@ -62,6 +60,16 @@ public: virtual void tick(); void createSplash(double particleStrengh); virtual void positionRider(); + virtual void positionRider(shared_ptr passenger); + virtual bool hasRider(shared_ptr e); + virtual void addRider(shared_ptr e); + virtual void removeRider(shared_ptr e); + virtual shared_ptr getExtraRider(); + int getPassengerCount(); + bool canAddPassenger(); + void ejectPassengers(); + virtual void checkFallDamage(double ya, bool onGround); + virtual void push(shared_ptr e); protected: virtual void addAdditonalSaveData(CompoundTag *base); @@ -69,6 +77,7 @@ protected: public: virtual float getShadowHeightOffs(); + virtual int getLightColor(float a); wstring getName(); virtual bool interact(shared_ptr player); @@ -79,6 +88,51 @@ public: virtual void setHurtDir(int hurtDir); virtual int getHurtDir(); + static const int OAK = 0; + static const int SPRUCE = 1; + static const int BIRCH = 2; + static const int JUNGLE = 3; + static const int ACACIA = 4; + static const int DARK_OAK = 5; + static const int TYPE_COUNT = 6; + + void setType(int type); + int getType(); + int getDropItemId(); + static int getItemIdForType(int type); + + float getRowingTime(int side, float a); +private: + float paddlePositions[2]; + + enum EStatus { IN_WATER, UNDER_WATER, UNDER_FLOWING_WATER, ON_LAND, IN_AIR }; + weak_ptr secondRider; + EStatus status; + float invFriction; + int outOfControlTicks; + float deltaRotation; + double waterLevel; + double lastYd; + double rockPhase; + bool inputLeft, inputRight, inputUp, inputDown; + + static float getWaterFill(Level *level, int x, int y, int z); + EStatus isUnderwater(); + bool checkInWater(); + float getGroundFriction(); + EStatus getStatus(); + float getWaterLevelAbove(); + void floatBoat(); + void controlBoat(); + void setPaddleState(bool left, bool right); + void clampRotation(shared_ptr passenger); + static double getSeatOffset(shared_ptr passenger); +public: + bool getPaddleState(int side); + bool isLocallyDriven(); +private: +public: + bool getDoLerp(); void setDoLerp(bool doLerp); }; diff --git a/Minecraft.World/BoatItem.cpp b/Minecraft.World/BoatItem.cpp index 5ae7f744..8c4fed58 100644 --- a/Minecraft.World/BoatItem.cpp +++ b/Minecraft.World/BoatItem.cpp @@ -7,7 +7,7 @@ #include "ItemInstance.h" #include "BoatItem.h" -BoatItem::BoatItem(int id) : Item( id ) +BoatItem::BoatItem(int id, int boatType) : Item( id ), boatType(boatType) { maxStackSize = 1; } @@ -108,6 +108,7 @@ shared_ptr BoatItem::use(shared_ptr itemInstance, Le if( level->countInstanceOf(eTYPE_BOAT, true) < Level::MAX_XBOX_BOATS ) // 4J - added limit { shared_ptr boat = std::make_shared(level, xt + 0.5f, yt + 1.0f, zt + 0.5f); + boat->setType(boatType); boat->yRot = ((Mth::floor(player->yRot * 4.0F / 360.0F + 0.5) & 0x3) - 1) * 90; if (!level->getCubes(boat, boat->bb->grow(-.1, -.1, -.1))->empty()) { diff --git a/Minecraft.World/BoatItem.h b/Minecraft.World/BoatItem.h index dc78e896..84e273a4 100644 --- a/Minecraft.World/BoatItem.h +++ b/Minecraft.World/BoatItem.h @@ -9,7 +9,9 @@ class BoatItem : public Item { public: - BoatItem(int id); + BoatItem(int id, int boatType = 0); + + int boatType; virtual bool TestUse(shared_ptr itemInstance, Level *level, shared_ptr player); virtual shared_ptr use(shared_ptr itemInstance, Level *level, shared_ptr player); diff --git a/Minecraft.World/BottleItem.cpp b/Minecraft.World/BottleItem.cpp index 3e526b2a..07cb6bff 100644 --- a/Minecraft.World/BottleItem.cpp +++ b/Minecraft.World/BottleItem.cpp @@ -1,10 +1,12 @@ #include "stdafx.h" +#include "SoundTypes.h" #include "net.minecraft.world.phys.h" #include "net.minecraft.world.entity.player.h" #include "net.minecraft.world.level.h" #include "net.minecraft.world.level.material.h" #include "net.minecraft.world.item.h" #include "BottleItem.h" +#include "AreaEffectCloud.h" BottleItem::BottleItem(int id) : Item(id) { @@ -17,6 +19,37 @@ Icon *BottleItem::getIcon(int auxValue) shared_ptr BottleItem::use(shared_ptr itemInstance, Level *level, shared_ptr player) { + vector > *clouds = level->getEntitiesOfClass(typeid(AreaEffectCloud), player->bb->grow(2, 2, 2)); + if (clouds != nullptr) + { + shared_ptr breath = nullptr; + for (auto& it : *clouds) + { + shared_ptr cloud = dynamic_pointer_cast(it); + if (cloud != nullptr && !cloud->removed && cloud->getParticle() == eParticleType_dragonbreath) + { + breath = cloud; + break; + } + } + delete clouds; + if (breath != nullptr) + { + breath->setRadius(breath->getRadius() - 0.5f); + level->playSound(player->x, player->y, player->z, eSoundType_ITEM_BOTTLE_FILL_DRAGONBREATH, 1.0f, 1.0f); + itemInstance->count--; + if (itemInstance->count <= 0) + { + return std::make_shared(Item::dragon_breath); + } + if (!player->inventory->add(std::make_shared(Item::dragon_breath))) + { + player->drop(std::make_shared(Item::dragon_breath_Id, 1, 0)); + } + return itemInstance; + } + } + HitResult *hr = getPlayerPOVHitResult(level, player, true); if (hr == nullptr) return itemInstance; @@ -25,18 +58,20 @@ shared_ptr BottleItem::use(shared_ptr itemInstance, int xt = hr->x; int yt = hr->y; int zt = hr->z; + int face = hr->f; delete hr; if (!level->mayInteract(player, xt, yt, zt, 0)) { return itemInstance; } - if (!player->mayUseItemAt(xt, yt, zt, hr->f, itemInstance)) + if (!player->mayUseItemAt(xt, yt, zt, face, itemInstance)) { return itemInstance; } if (level->getMaterial(xt, yt, zt) == Material::water) { + level->playSound(player->x, player->y, player->z, eSoundType_ITEM_BOTTLE_FILL, 1.0f, 1.0f); itemInstance->count--; if (itemInstance->count <= 0) { @@ -62,6 +97,19 @@ shared_ptr BottleItem::use(shared_ptr itemInstance, // 4J-PB - added to allow tooltips bool BottleItem::TestUse(shared_ptr itemInstance, Level *level, shared_ptr player) { + vector > *clouds = level->getEntitiesOfClass(typeid(AreaEffectCloud), player->bb->grow(2, 2, 2)); + if (clouds != nullptr) + { + bool nearBreath = false; + for (auto& it : *clouds) + { + shared_ptr cloud = dynamic_pointer_cast(it); + if (cloud != nullptr && !cloud->removed && cloud->getParticle() == eParticleType_dragonbreath) nearBreath = true; + } + delete clouds; + if (nearBreath) return true; + } + HitResult *hr = getPlayerPOVHitResult(level, player, true); if (hr == nullptr) return false; @@ -70,13 +118,14 @@ bool BottleItem::TestUse(shared_ptr itemInstance, Level *level, sh int xt = hr->x; int yt = hr->y; int zt = hr->z; + int face = hr->f; delete hr; if (!level->mayInteract(player, xt, yt, zt, 0)) { return false; } - if (!player->mayUseItemAt(xt, yt, zt, hr->f, itemInstance)) + if (!player->mayUseItemAt(xt, yt, zt, face, itemInstance)) { return false; } diff --git a/Minecraft.World/BowItem.cpp b/Minecraft.World/BowItem.cpp index a2d34b89..a32bdd5f 100644 --- a/Minecraft.World/BowItem.cpp +++ b/Minecraft.World/BowItem.cpp @@ -22,8 +22,11 @@ void BowItem::releaseUsing(shared_ptr itemInstance, Level *level, { bool infiniteArrows = player->abilities.instabuild || EnchantmentHelper::getEnchantmentLevel(Enchantment::arrowInfinite->id, itemInstance) > 0; - if (infiniteArrows || player->inventory->hasResource(Item::arrow_Id)) + int ammoSlot = findAmmoSlot(player); + if (player->abilities.instabuild || ammoSlot >= 0) { + shared_ptr ammo = ammoSlot >= 0 ? player->inventory->items[ammoSlot] : nullptr; + if (ammo != nullptr && ammo->id != Item::arrow_Id && !player->abilities.instabuild) infiniteArrows = false; int timeHeld = getUseDuration(itemInstance) - durationLeft; float pow = timeHeld / static_cast(MAX_DRAW_DURATION); pow = ((pow * pow) + pow * 2) / 3; @@ -31,6 +34,7 @@ void BowItem::releaseUsing(shared_ptr itemInstance, Level *level, if (pow > 1) pow = 1; shared_ptr arrow = std::make_shared(level, player, pow * 2.0f); + arrow->setFromItem(ammo); if (pow == 1) arrow->setCritArrow(true); int damageBonus = EnchantmentHelper::getEnchantmentLevel(Enchantment::arrowBonus->id, itemInstance); if (damageBonus > 0) @@ -56,7 +60,7 @@ void BowItem::releaseUsing(shared_ptr itemInstance, Level *level, } else { - player->inventory->removeResource(Item::arrow_Id); + if (--player->inventory->items[ammoSlot]->count <= 0) player->inventory->items[ammoSlot] = nullptr; } if (!level->isClientSide) level->addEntity(arrow); } @@ -79,7 +83,7 @@ UseAnim BowItem::getUseAnimation(shared_ptr itemInstance) shared_ptr BowItem::use(shared_ptr instance, Level *level, shared_ptr player) { - if (player->abilities.instabuild || player->inventory->hasResource(Item::arrow_Id)) + if (player->abilities.instabuild || hasAmmo(player)) { player->startUsingItem(instance, getUseDuration(instance)); } @@ -106,4 +110,38 @@ void BowItem::registerIcons(IconRegister *iconRegister) Icon *BowItem::getDrawnIcon(int amount) { return icons[amount]; -} \ No newline at end of file +} +int BowItem::findAmmoSlot(shared_ptr player) +{ + Inventory *inventory = player->inventory.get(); + int selected = inventory->selected; + if (selected >= 0 && selected < static_cast(inventory->items.length) && inventory->items[selected] != nullptr && Arrow::isArrowItem(inventory->items[selected]->id)) + { + return selected; + } + for (unsigned int i = 0; i < inventory->items.length; i++) + { + if (inventory->items[i] != nullptr && Arrow::isArrowItem(inventory->items[i]->id)) + { + return i; + } + } + return -1; +} + +bool BowItem::hasAmmo(shared_ptr player) +{ + return findAmmoSlot(player) >= 0; +} + +Icon *BowItem::GetOverrideCountIcon(shared_ptr itemInstance, shared_ptr player) +{ + if (player != nullptr && player->getUseItem() == itemInstance) + { + int ticksUsingItem = player->getTicksUsingItem(); + if (ticksUsingItem >= MAX_DRAW_DURATION - 2) return getDrawnIcon(2); + if (ticksUsingItem > MAX_DRAW_DURATION * 2 / 3) return getDrawnIcon(1); + if (ticksUsingItem > 0) return getDrawnIcon(0); + } + return Item::GetOverrideCountIcon(itemInstance, player); +} diff --git a/Minecraft.World/BowItem.h b/Minecraft.World/BowItem.h index b4eba111..3d3cfbc0 100644 --- a/Minecraft.World/BowItem.h +++ b/Minecraft.World/BowItem.h @@ -11,6 +11,9 @@ public: static const wstring TEXTURE_PULL[]; static const int MAX_DRAW_DURATION = 20 * 1; + static int findAmmoSlot(shared_ptr player); + static bool hasAmmo(shared_ptr player); + private: static const int BOW_ICONS_COUNT = 3; Icon **icons; @@ -28,4 +31,5 @@ public: //@Override void registerIcons(IconRegister *iconRegister); Icon *getDrawnIcon(int amount); + virtual Icon *GetOverrideCountIcon(shared_ptr itemInstance, shared_ptr player); }; \ No newline at end of file diff --git a/Minecraft.World/BrewingStandTileEntity.cpp b/Minecraft.World/BrewingStandTileEntity.cpp index 0e7d2972..9515220e 100644 --- a/Minecraft.World/BrewingStandTileEntity.cpp +++ b/Minecraft.World/BrewingStandTileEntity.cpp @@ -101,6 +101,14 @@ bool BrewingStandTileEntity::isBrewable() return false; } shared_ptr ingredient = items[INGREDIENT_SLOT]; + if (ingredient->id == Item::dragon_breath_Id) + { + for (int dest = 0; dest < 3; dest++) + { + if (items[dest] != nullptr && items[dest]->id == Item::potion_Id && PotionItem::isThrowable(items[dest]->getAuxValue())) return true; + } + return false; + } if (PotionBrewing::SIMPLIFIED_BREWING) { if (!Item::items[ingredient->id]->hasPotionBrewingFormula()) @@ -195,7 +203,18 @@ void BrewingStandTileEntity::doBrew() shared_ptr ingredient = items[INGREDIENT_SLOT]; - if (PotionBrewing::SIMPLIFIED_BREWING) + if (ingredient->id == Item::dragon_breath_Id) + { + for (int dest = 0; dest < 3; dest++) + { + if (items[dest] != nullptr && items[dest]->id == Item::potion_Id && PotionItem::isThrowable(items[dest]->getAuxValue())) + { + int brew = NORMALISE_POTION_AUXVAL(items[dest]->getAuxValue()) & ~PotionBrewing::THROWABLE_MASK; + items[dest] = std::make_shared(Item::lingering_potion_Id, 1, brew); + } + } + } + else if (PotionBrewing::SIMPLIFIED_BREWING) { for (int dest = 0; dest < 3; dest++) { @@ -271,6 +290,7 @@ void BrewingStandTileEntity::doBrew() items[INGREDIENT_SLOT] = nullptr; } } + } int BrewingStandTileEntity::applyIngredient(int currentBrew, shared_ptr ingredient) @@ -491,4 +511,4 @@ shared_ptr BrewingStandTileEntity::clone() } } return result; -} \ No newline at end of file +} diff --git a/Minecraft.World/BucketItem.cpp b/Minecraft.World/BucketItem.cpp index 6af2831c..7f3ff00e 100644 --- a/Minecraft.World/BucketItem.cpp +++ b/Minecraft.World/BucketItem.cpp @@ -133,6 +133,7 @@ shared_ptr BucketItem::use(shared_ptr itemInstance, if (level->getMaterial(xt, yt, zt) == Material::water && level->getData(xt, yt, zt) == 0) { level->removeTile(xt, yt, zt); + player->playSound(eSoundType_ITEM_BUCKET_FILL, 1.0f, 1.0f); delete hr; if (player->abilities.instabuild) { @@ -161,6 +162,7 @@ shared_ptr BucketItem::use(shared_ptr itemInstance, ); level->removeTile(xt, yt, zt); + player->playSound(eSoundType_ITEM_BUCKET_FILL_LAVA, 1.0f, 1.0f); delete hr; if (player->abilities.instabuild) { @@ -233,6 +235,7 @@ bool BucketItem::emptyBucket(Level *level, int xt, int yt, int zt) level->destroyTile(xt, yt, zt, true); } level->setTileAndData(xt, yt, zt, content, 0, Tile::UPDATE_ALL); + level->playSound(xt + 0.5f, yt + 0.5f, zt + 0.5f, content == Tile::flowing_lava_Id ? eSoundType_ITEM_BUCKET_EMPTY_LAVA : eSoundType_ITEM_BUCKET_EMPTY, 1.0f, 1.0f); } return true; diff --git a/Minecraft.World/CarrotTile.cpp b/Minecraft.World/CarrotTile.cpp index a59cbd71..7ea0bbcb 100644 --- a/Minecraft.World/CarrotTile.cpp +++ b/Minecraft.World/CarrotTile.cpp @@ -39,4 +39,10 @@ void CarrotTile::registerIcons(IconRegister *iconRegister) { icons[i] = iconRegister->registerIcon(getIconName() + L"_stage_" + std::to_wstring(i)); } -} \ No newline at end of file +} +float CarrotTile::getShapeHeight(int age) +{ + if (age < 0) age = 0; + if (age > 7) age = 7; + return (age + 2) / 16.0f; +} diff --git a/Minecraft.World/CarrotTile.h b/Minecraft.World/CarrotTile.h index 82c1c02b..a063f2b8 100644 --- a/Minecraft.World/CarrotTile.h +++ b/Minecraft.World/CarrotTile.h @@ -18,4 +18,5 @@ protected: public: void registerIcons(IconRegister *iconRegister); + virtual float getShapeHeight(int age); }; \ No newline at end of file diff --git a/Minecraft.World/ChorusFlowerTile.cpp b/Minecraft.World/ChorusFlowerTile.cpp new file mode 100644 index 00000000..425de80c --- /dev/null +++ b/Minecraft.World/ChorusFlowerTile.cpp @@ -0,0 +1,261 @@ +#include "stdafx.h" +#include "LevelEvent.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.item.h" +#include "net.minecraft.world.entity.player.h" +#include "IconRegister.h" +#include "Facing.h" +#include "ChorusFlowerTile.h" + +ChorusFlowerTile::ChorusFlowerTile(int id) : Tile(id, Material::plant, false) +{ + iconDead = nullptr; + iconPlant = nullptr; + setLightBlock(0); + setTicking(true); +} + +bool ChorusFlowerTile::allNeighborsEmpty(Level *level, int x, int y, int z, int excludedFace) +{ + for (int face = Facing::NORTH; face <= Facing::EAST; ++face) + { + if (face != excludedFace && !level->isEmptyTile(x + Facing::STEP_X[face], y, z + Facing::STEP_Z[face])) + { + return false; + } + } + return true; +} + +void ChorusFlowerTile::placeGrownFlower(Level *level, int x, int y, int z, int age) +{ + level->setTileAndData(x, y, z, id, age, Tile::UPDATE_CLIENTS); + level->levelEvent(LevelEvent::SOUND_CHORUS_GROW, x, y, z, 0); +} + +void ChorusFlowerTile::placeDeadFlower(Level *level, int x, int y, int z) +{ + level->setTileAndData(x, y, z, id, DEAD_AGE, Tile::UPDATE_CLIENTS); + level->levelEvent(LevelEvent::SOUND_CHORUS_DEATH, x, y, z, 0); +} + +void ChorusFlowerTile::tick(Level *level, int x, int y, int z, Random *random) +{ + if (!canSurvive(level, x, y, z)) + { + level->destroyTile(x, y, z, true); + return; + } + + if (!level->isEmptyTile(x, y + 1, z) || y + 1 >= Level::maxBuildHeight) return; + + int age = level->getData(x, y, z); + if (isDead(age)) return; + + bool growUp = false; + bool rooted = false; + int below = level->getTile(x, y - 1, z); + if (below == Tile::end_stone_Id) + { + growUp = true; + } + else if (below == Tile::chorus_plant_Id) + { + int stemHeight = 1; + for (int i = 0; i < 4; ++i) + { + int support = level->getTile(x, y - (stemHeight + 1), z); + if (support == Tile::chorus_plant_Id) + { + ++stemHeight; + } + else + { + if (support == Tile::end_stone_Id) rooted = true; + break; + } + } + + int limit = rooted ? 5 : 4; + if (stemHeight < 2 || random->nextInt(limit) >= stemHeight) + { + growUp = true; + } + } + else if (below == 0) + { + growUp = true; + } + + if (growUp && allNeighborsEmpty(level, x, y + 1, z, -1) && level->isEmptyTile(x, y + 2, z)) + { + level->setTileAndData(x, y, z, Tile::chorus_plant_Id, 0, Tile::UPDATE_CLIENTS); + placeGrownFlower(level, x, y + 1, z, age); + } + else if (age < 4) + { + int branches = random->nextInt(4); + if (rooted) ++branches; + bool grew = false; + for (int i = 0; i < branches; ++i) + { + int face = Facing::NORTH + random->nextInt(4); + int bx = x + Facing::STEP_X[face]; + int bz = z + Facing::STEP_Z[face]; + if (level->isEmptyTile(bx, y, bz) && level->isEmptyTile(bx, y - 1, bz) + && allNeighborsEmpty(level, bx, y, bz, Facing::OPPOSITE_FACING[face])) + { + placeGrownFlower(level, bx, y, bz, age + 1); + grew = true; + } + } + if (grew) + { + level->setTileAndData(x, y, z, Tile::chorus_plant_Id, 0, Tile::UPDATE_CLIENTS); + } + else + { + placeDeadFlower(level, x, y, z); + } + } + else if (age == 4) + { + placeDeadFlower(level, x, y, z); + } +} + +bool ChorusFlowerTile::isSolidRender(bool isServerLevel) +{ + return false; +} + +bool ChorusFlowerTile::isCubeShaped() +{ + return false; +} + +int ChorusFlowerTile::getRenderShape() +{ + return Tile::SHAPE_CHORUS_FLOWER; +} + +int ChorusFlowerTile::getResource(int data, Random *random, int playerBonusLevel) +{ + return 0; +} + +bool ChorusFlowerTile::mayPlace(Level *level, int x, int y, int z) +{ + return Tile::mayPlace(level, x, y, z) && canSurvive(level, x, y, z); +} + +void ChorusFlowerTile::neighborChanged(Level *level, int x, int y, int z, int type) +{ + if (!canSurvive(level, x, y, z)) + { + level->addToTickNextTick(x, y, z, id, 1); + } +} + +bool ChorusFlowerTile::canSurvive(Level *level, int x, int y, int z) +{ + int below = level->getTile(x, y - 1, z); + if (below == Tile::chorus_plant_Id || below == Tile::end_stone_Id) + { + return true; + } + if (below == 0) + { + int plants = 0; + for (int face = Facing::NORTH; face <= Facing::EAST; ++face) + { + int t = level->getTile(x + Facing::STEP_X[face], y, z + Facing::STEP_Z[face]); + if (t == Tile::chorus_plant_Id) + { + ++plants; + } + else if (t != 0) + { + return false; + } + } + return plants == 1; + } + return false; +} + +void ChorusFlowerTile::playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data) +{ + Tile::playerDestroy(level, player, x, y, z, data); + popResource(level, x, y, z, std::make_shared(id, 1, 0)); +} + +int ChorusFlowerTile::getSpawnResourcesAuxValue(int data) +{ + return 0; +} + +bool ChorusFlowerTile::isSilkTouchable() +{ + return false; +} + +Icon *ChorusFlowerTile::getTexture(int face, int data) +{ + if (face == Facing::DOWN) return iconPlant; + return isDead(data) ? iconDead : icon; +} + +void ChorusFlowerTile::registerIcons(IconRegister *iconRegister) +{ + icon = iconRegister->registerIcon(L"chorus_flower"); + iconDead = iconRegister->registerIcon(L"chorus_flower_dead"); + iconPlant = iconRegister->registerIcon(L"chorus_flower_plant"); +} + +void ChorusFlowerTile::growTreeRecursive(Level *level, int x, int y, int z, Random *random, int originX, int originZ, int radius, int depth) +{ + int height = random->nextInt(4) + 1; + if (depth == 0) ++height; + + for (int i = 0; i < height; ++i) + { + if (!allNeighborsEmpty(level, x, y + i + 1, z, -1)) + { + return; + } + level->setTileAndData(x, y + i + 1, z, Tile::chorus_plant_Id, 0, Tile::UPDATE_CLIENTS); + } + + bool grew = false; + if (depth < 4) + { + int branches = random->nextInt(4); + if (depth == 0) ++branches; + for (int i = 0; i < branches; ++i) + { + int face = Facing::NORTH + random->nextInt(4); + int bx = x + Facing::STEP_X[face]; + int by = y + height; + int bz = z + Facing::STEP_Z[face]; + if (abs(bx - originX) < radius && abs(bz - originZ) < radius && level->isEmptyTile(bx, by, bz) + && level->isEmptyTile(bx, by - 1, bz) && allNeighborsEmpty(level, bx, by, bz, Facing::OPPOSITE_FACING[face])) + { + grew = true; + level->setTileAndData(bx, by, bz, Tile::chorus_plant_Id, 0, Tile::UPDATE_CLIENTS); + growTreeRecursive(level, bx, by, bz, random, originX, originZ, radius, depth + 1); + } + } + } + + if (!grew) + { + level->setTileAndData(x, y + height, z, Tile::chorus_flower_Id, DEAD_AGE, Tile::UPDATE_CLIENTS); + } +} + +void ChorusFlowerTile::generatePlant(Level *level, int x, int y, int z, Random *random, int radius) +{ + level->setTileAndData(x, y, z, Tile::chorus_plant_Id, 0, Tile::UPDATE_CLIENTS); + growTreeRecursive(level, x, y, z, random, x, z, radius, 0); +} diff --git a/Minecraft.World/ChorusFlowerTile.h b/Minecraft.World/ChorusFlowerTile.h new file mode 100644 index 00000000..d016a0c5 --- /dev/null +++ b/Minecraft.World/ChorusFlowerTile.h @@ -0,0 +1,43 @@ +#pragma once +#include "Tile.h" + +class Random; + +class ChorusFlowerTile : public Tile +{ + friend class Tile; + friend class ChunkRebuildData; +protected: + ChorusFlowerTile(int id); +public: + static const int DEAD_AGE = 5; + +private: + Icon *iconDead; + Icon *iconPlant; + + static bool allNeighborsEmpty(Level *level, int x, int y, int z, int excludedFace); + void placeGrownFlower(Level *level, int x, int y, int z, int age); + void placeDeadFlower(Level *level, int x, int y, int z); + static void growTreeRecursive(Level *level, int x, int y, int z, Random *random, int originX, int originZ, int radius, int depth); + +public: + static bool isDead(int age) { return age >= DEAD_AGE; } + static void generatePlant(Level *level, int x, int y, int z, Random *random, int radius); + + virtual void tick(Level *level, int x, int y, int z, Random *random); + virtual bool isSolidRender(bool isServerLevel = false); + virtual bool isCubeShaped(); + virtual int getRenderShape(); + virtual int getResource(int data, Random *random, int playerBonusLevel); + virtual bool mayPlace(Level *level, int x, int y, int z); + virtual void neighborChanged(Level *level, int x, int y, int z, int type); + virtual bool canSurvive(Level *level, int x, int y, int z); + virtual void playerDestroy(Level *level, shared_ptr player, int x, int y, int z, int data); + virtual int getSpawnResourcesAuxValue(int data); + virtual Icon *getTexture(int face, int data); + virtual void registerIcons(IconRegister *iconRegister); + +protected: + virtual bool isSilkTouchable(); +}; diff --git a/Minecraft.World/ChorusFruitItem.cpp b/Minecraft.World/ChorusFruitItem.cpp new file mode 100644 index 00000000..0f77ff3e --- /dev/null +++ b/Minecraft.World/ChorusFruitItem.cpp @@ -0,0 +1,101 @@ +#include "stdafx.h" +#include "net.minecraft.world.entity.player.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.phys.h" +#include "net.minecraft.h" +#include "ItemInstance.h" +#include "ChorusFruitItem.h" +#include "SoundTypes.h" +#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD) +#include "../Minecraft.Server/FourKitBridge.h" +#endif + +ChorusFruitItem::ChorusFruitItem(int id, int nutrition, float saturationMod) + : FoodItem(id, nutrition, saturationMod, false) +{ +} + +bool ChorusFruitItem::randomTeleport(Level *level, shared_ptr player, double xx, double yy, double zz) +{ + double xo = player->x; + double yo = player->y; + double zo = player->z; + + int xt = Mth::floor(xx); + int yt = Mth::floor(yy); + int zt = Mth::floor(zz); + if (!level->hasChunkAt(xt, yt, zt)) return false; + + bool landed = false; + while (!landed && yt > 0) + { + int t = level->getTile(xt, yt - 1, zt); + if (t == 0 || !Tile::tiles[t]->material->blocksMotion()) + { + yy--; + yt--; + } + else + { + landed = true; + } + } + if (!landed) return false; + + player->setPos(xx, yy, zz); + bool ok = level->getCubes(player, player->bb)->empty() && !level->containsAnyLiquid(player->bb); + player->setPos(xo, yo, zo); + if (!ok) return false; + +#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD) + { + double outX, outY, outZ; + bool cancelled = FourKitBridge::FirePlayerTeleport( + player->entityId, + xo, yo, zo, player->dimension, + xx, yy, zz, player->dimension, + 6, + &outX, &outY, &outZ); + if (cancelled) return false; + xx = outX; + yy = outY; + zz = outZ; + } +#endif + + player->teleportTo(xx, yy, zz); + player->fallDistance = 0; + level->playSound(xo, yo, zo, eSoundType_MOB_ENDERMEN_PORTAL, 1, 1); + player->playSound(eSoundType_MOB_ENDERMEN_PORTAL, 1, 1); + return true; +} + +shared_ptr ChorusFruitItem::useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player) +{ + shared_ptr result = FoodItem::useTimeDepleted(instance, level, player); + + if (!level->isClientSide) + { + for (int attempt = 0; attempt < 16; ++attempt) + { + double x = player->x + (player->getRandom()->nextDouble() - 0.5) * 16.0; + double y = player->y + (player->getRandom()->nextInt(16) - 8); + if (y < 0.0) y = 0.0; + if (y > Level::maxBuildHeight - 1) y = Level::maxBuildHeight - 1; + double z = player->z + (player->getRandom()->nextDouble() - 0.5) * 16.0; + + if (player->isRiding()) + { + player->ride(nullptr); + } + + if (randomTeleport(level, player, x, y, z)) + { + break; + } + } + } + + return result; +} diff --git a/Minecraft.World/ChorusFruitItem.h b/Minecraft.World/ChorusFruitItem.h new file mode 100644 index 00000000..31afcd91 --- /dev/null +++ b/Minecraft.World/ChorusFruitItem.h @@ -0,0 +1,14 @@ +#pragma once + +#include "FoodItem.h" + +class ChorusFruitItem : public FoodItem +{ +public: + ChorusFruitItem(int id, int nutrition, float saturationMod); + + virtual shared_ptr useTimeDepleted(shared_ptr instance, Level *level, shared_ptr player); + +private: + static bool randomTeleport(Level *level, shared_ptr player, double x, double y, double z); +}; diff --git a/Minecraft.World/ChorusPlantTile.cpp b/Minecraft.World/ChorusPlantTile.cpp new file mode 100644 index 00000000..400ef69c --- /dev/null +++ b/Minecraft.World/ChorusPlantTile.cpp @@ -0,0 +1,156 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.phys.h" +#include "net.minecraft.world.item.h" +#include "Facing.h" +#include "ChorusPlantTile.h" + +const float ChorusPlantTile::CORE_MIN = 3.0f / 16.0f; +const float ChorusPlantTile::CORE_MAX = 13.0f / 16.0f; + +ChorusPlantTile::ChorusPlantTile(int id) : Tile(id, Material::plant, false) +{ + setLightBlock(0); + updateDefaultShape(); +} + +bool ChorusPlantTile::connectsTo(LevelSource *level, int x, int y, int z, int face) +{ + int t = level->getTile(x + Facing::STEP_X[face], y + Facing::STEP_Y[face], z + Facing::STEP_Z[face]); + if (t == id || t == Tile::chorus_flower_Id) return true; + return face == Facing::DOWN && t == Tile::end_stone_Id; +} + +void ChorusPlantTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +{ + float x0 = connectsTo(level, x, y, z, Facing::WEST) ? 0.0f : CORE_MIN; + float y0 = connectsTo(level, x, y, z, Facing::DOWN) ? 0.0f : CORE_MIN; + float z0 = connectsTo(level, x, y, z, Facing::NORTH) ? 0.0f : CORE_MIN; + float x1 = connectsTo(level, x, y, z, Facing::EAST) ? 1.0f : CORE_MAX; + float y1 = connectsTo(level, x, y, z, Facing::UP) ? 1.0f : CORE_MAX; + float z1 = connectsTo(level, x, y, z, Facing::SOUTH) ? 1.0f : CORE_MAX; + setShape(x0, y0, z0, x1, y1, z1); +} + +void ChorusPlantTile::updateDefaultShape() +{ + setShape(CORE_MIN, CORE_MIN, CORE_MIN, CORE_MAX, CORE_MAX, CORE_MAX); +} + +void ChorusPlantTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +{ + const float a = CORE_MIN; + const float b = CORE_MAX; + + setShape(a, a, a, b, b, b); + Tile::addAABBs(level, x, y, z, box, boxes, source); + if (connectsTo(level, x, y, z, Facing::WEST)) + { + setShape(0.0f, a, a, a, b, b); + Tile::addAABBs(level, x, y, z, box, boxes, source); + } + if (connectsTo(level, x, y, z, Facing::EAST)) + { + setShape(b, a, a, 1.0f, b, b); + Tile::addAABBs(level, x, y, z, box, boxes, source); + } + if (connectsTo(level, x, y, z, Facing::UP)) + { + setShape(a, b, a, b, 1.0f, b); + Tile::addAABBs(level, x, y, z, box, boxes, source); + } + if (connectsTo(level, x, y, z, Facing::DOWN)) + { + setShape(a, 0.0f, a, b, a, b); + Tile::addAABBs(level, x, y, z, box, boxes, source); + } + if (connectsTo(level, x, y, z, Facing::NORTH)) + { + setShape(a, a, 0.0f, b, b, a); + Tile::addAABBs(level, x, y, z, box, boxes, source); + } + if (connectsTo(level, x, y, z, Facing::SOUTH)) + { + setShape(a, a, b, b, b, 1.0f); + Tile::addAABBs(level, x, y, z, box, boxes, source); + } + updateShape(level, x, y, z); +} + +bool ChorusPlantTile::isSolidRender(bool isServerLevel) +{ + return false; +} + +bool ChorusPlantTile::isCubeShaped() +{ + return false; +} + +int ChorusPlantTile::getRenderShape() +{ + return Tile::SHAPE_CHORUS_PLANT; +} + +bool ChorusPlantTile::isPathfindable(LevelSource *level, int x, int y, int z) +{ + return false; +} + +void ChorusPlantTile::tick(Level *level, int x, int y, int z, Random *random) +{ + if (!canSurvive(level, x, y, z)) + { + level->destroyTile(x, y, z, true); + } +} + +int ChorusPlantTile::getResource(int data, Random *random, int playerBonusLevel) +{ + return Item::chorus_fruit_Id; +} + +int ChorusPlantTile::getResourceCount(Random *random) +{ + return random->nextInt(2); +} + +bool ChorusPlantTile::mayPlace(Level *level, int x, int y, int z) +{ + return Tile::mayPlace(level, x, y, z) && canSurvive(level, x, y, z); +} + +void ChorusPlantTile::neighborChanged(Level *level, int x, int y, int z, int type) +{ + if (!canSurvive(level, x, y, z)) + { + level->addToTickNextTick(x, y, z, id, 1); + } +} + +bool ChorusPlantTile::canSurvive(Level *level, int x, int y, int z) +{ + bool aboveEmpty = level->isEmptyTile(x, y + 1, z); + bool belowEmpty = level->isEmptyTile(x, y - 1, z); + + for (int face = Facing::NORTH; face <= Facing::EAST; ++face) + { + int sx = x + Facing::STEP_X[face]; + int sz = z + Facing::STEP_Z[face]; + if (level->getTile(sx, y, sz) == id) + { + if (!aboveEmpty && !belowEmpty) + { + return false; + } + int below = level->getTile(sx, y - 1, sz); + if (below == id || below == Tile::end_stone_Id) + { + return true; + } + } + } + + int below = level->getTile(x, y - 1, z); + return below == id || below == Tile::end_stone_Id; +} diff --git a/Minecraft.World/ChorusPlantTile.h b/Minecraft.World/ChorusPlantTile.h new file mode 100644 index 00000000..c533f051 --- /dev/null +++ b/Minecraft.World/ChorusPlantTile.h @@ -0,0 +1,31 @@ +#pragma once +#include "Tile.h" + +class Random; + +class ChorusPlantTile : public Tile +{ + friend class Tile; + friend class ChunkRebuildData; +protected: + ChorusPlantTile(int id); +public: + static const float CORE_MIN; + static const float CORE_MAX; + + bool connectsTo(LevelSource *level, int x, int y, int z, int face); + + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); + virtual void updateDefaultShape(); + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + virtual bool isSolidRender(bool isServerLevel = false); + virtual bool isCubeShaped(); + virtual int getRenderShape(); + virtual bool isPathfindable(LevelSource *level, int x, int y, int z); + virtual void tick(Level *level, int x, int y, int z, Random *random); + virtual int getResource(int data, Random *random, int playerBonusLevel); + virtual int getResourceCount(Random *random); + virtual bool mayPlace(Level *level, int x, int y, int z); + virtual void neighborChanged(Level *level, int x, int y, int z, int type); + virtual bool canSurvive(Level *level, int x, int y, int z); +}; diff --git a/Minecraft.World/ChunkSource.h b/Minecraft.World/ChunkSource.h index 37b0ecc3..4fe880cc 100644 --- a/Minecraft.World/ChunkSource.h +++ b/Minecraft.World/ChunkSource.h @@ -44,7 +44,8 @@ class TilePos; #define END_LEVEL_SCALE 3 // 4J Stu - Fix the size of the end for all platforms // 54 / 3 = 18 -#define END_LEVEL_MAX_WIDTH 18 +#define END_LEVEL_MAX_WIDTH 64 +#define END_LEVEL_MODERN_WIDTH 64 #define END_LEVEL_MIN_WIDTH 18 //#define END_LEVEL_MAX_WIDTH (LEVEL_MAX_WIDTH / END_LEVEL_SCALE) diff --git a/Minecraft.World/Class.h b/Minecraft.World/Class.h index ffca35e7..4557e309 100644 --- a/Minecraft.World/Class.h +++ b/Minecraft.World/Class.h @@ -175,6 +175,7 @@ enum eINSTANCEOF eTYPE_ENDERMITE = eTYPE_MONSTER | eTYPE_VALID_IN_SPAWNER_FLAG | 0x10, eTYPE_ELDER_GUARDIAN = eTYPE_MONSTER | eTYPE_VALID_IN_SPAWNER_FLAG | 0x11, + eTYPE_SHULKER = eTYPE_MONSTER | eTYPE_VALID_IN_SPAWNER_FLAG | 0x12, eTYPE_AMBIENT = eTYPE_MOB | BIT_AMBIENT_MOB, @@ -251,6 +252,8 @@ enum eINSTANCEOF eTYPE_MULTIENTITY_MOB_PART = (eTYPE_OTHER_ENTITIES + 12), eTYPE_NETHER_SPHERE = (eTYPE_OTHER_ENTITIES + 13), eTYPE_ENDER_CRYSTAL = (eTYPE_OTHER_ENTITIES + 14), + eTYPE_SHULKER_BULLET = (eTYPE_OTHER_ENTITIES + 16) | eTYPE_PROJECTILE, + eTYPE_AREA_EFFECT_CLOUD = (eTYPE_OTHER_ENTITIES + 15), // === PARTICLES === // @@ -298,6 +301,9 @@ enum eINSTANCEOF //TU 31 eType_WAKEPARTICLE, + eType_ENDRODPARTICLE, + eType_FALLINGDUSTPARTICLE, + // === Tile Entities === // eTYPE_TILEENTITY = BIT_TILE_ENTITY, @@ -321,6 +327,7 @@ enum eINSTANCEOF eTYPE_HOPPERTILEENTITY = eTYPE_TILEENTITY | 0x11, eTYPE_BANNERTILEENTITY = eTYPE_TILEENTITY | 0x12, eTYPE_FLOWERPOTTILEENTITY = eTYPE_TILEENTITY | 0x13, + eTYPE_THEENDGATEWAYTILEENTITY = eTYPE_TILEENTITY | 0x14, eTYPE_DISPENSERTILEENTITY = eTYPE_TILEENTITY | BIT_DISPENSERTILEENTITY, eTYPE_DROPPERTILEENTITY = eTYPE_DISPENSERTILEENTITY | 0x1, @@ -497,7 +504,10 @@ public: classes->push_back( SUBCLASS(eTYPE_MULTIENTITY_MOB_PART )->addParent( eTYPE_ENTITY ) ); classes->push_back( SUBCLASS(eTYPE_NETHER_SPHERE )->addParent( eTYPE_ENTITY ) ); classes->push_back( SUBCLASS(eTYPE_ENDER_CRYSTAL )->addParent( eTYPE_ENTITY ) ); + classes->push_back( SUBCLASS(eTYPE_AREA_EFFECT_CLOUD )->addParent( eTYPE_ENTITY ) ); + classes->push_back( SUBCLASS(eTYPE_SHULKER_BULLET )->addParent( eTYPE_ENTITY )->addParent( eTYPE_PROJECTILE ) ); classes->push_back( SUBCLASS(eTYPE_ENDERMITE )->addParent( eTYPE_MONSTER)->addParent(eTYPE_VALID_IN_SPAWNER_FLAG ) ); + classes->push_back( SUBCLASS(eTYPE_SHULKER )->addParent( eTYPE_MONSTER)->addParent(eTYPE_VALID_IN_SPAWNER_FLAG ) ); classes->push_back( SUBCLASS(eType_BREAKINGITEMPARTICLE)->addParent(eTYPE_ENTITY) ); classes->push_back( SUBCLASS(eType_BUBBLEPARTICLE)->addParent(eTYPE_ENTITY) ); classes->push_back( SUBCLASS(eType_EXPLODEPARTICLE)->addParent(eTYPE_ENTITY) ); @@ -512,6 +522,8 @@ public: classes->push_back( SUBCLASS(eType_SNOWSHOVELPARTICLE)->addParent(eTYPE_ENTITY) ); classes->push_back( SUBCLASS(eType_SPLASHPARTICLE)->addParent(eTYPE_ENTITY) ); classes->push_back( SUBCLASS(eType_WAKEPARTICLE)->addParent(eTYPE_ENTITY) ); + classes->push_back( SUBCLASS(eType_ENDRODPARTICLE)->addParent(eTYPE_ENTITY) ); + classes->push_back( SUBCLASS(eType_FALLINGDUSTPARTICLE)->addParent(eTYPE_ENTITY) ); classes->push_back( SUBCLASS(eType_TAKEANIMATIONPARTICLE)->addParent(eTYPE_ENTITY) ); classes->push_back( SUBCLASS(eType_TERRAINPARTICLE)->addParent(eTYPE_ENTITY) ); classes->push_back( SUBCLASS(eType_WATERDROPPARTICLE)->addParent(eTYPE_ENTITY) ); @@ -550,6 +562,7 @@ public: classes->push_back( SUBCLASS(eTYPE_HOPPERTILEENTITY )->addParent( eTYPE_TILEENTITY ) ); classes->push_back( SUBCLASS(eTYPE_BANNERTILEENTITY )->addParent( eTYPE_TILEENTITY ) ); classes->push_back( SUBCLASS(eTYPE_FLOWERPOTTILEENTITY )->addParent( eTYPE_TILEENTITY ) ); + classes->push_back( SUBCLASS(eTYPE_THEENDGATEWAYTILEENTITY )->addParent( eTYPE_TILEENTITY ) ); classes->push_back( SUBCLASS(eTYPE_DISPENSERTILEENTITY )->addParent( eTYPE_TILEENTITY ) ); classes->push_back( SUBCLASS(eTYPE_DROPPERTILEENTITY )->addParent( eTYPE_DISPENSERTILEENTITY ) ); diff --git a/Minecraft.World/ConsoleSaveFileConverter.cpp b/Minecraft.World/ConsoleSaveFileConverter.cpp index f7d8d0ee..cc4602a6 100644 --- a/Minecraft.World/ConsoleSaveFileConverter.cpp +++ b/Minecraft.World/ConsoleSaveFileConverter.cpp @@ -229,9 +229,9 @@ void ConsoleSaveFileConverter::ConvertSave(ConsoleSaveFile *sourceSave, ConsoleS // End { app.DebugPrintf("Processing the end\n"); - int halfXZSize = END_LEVEL_MAX_WIDTH / 2; + int halfXZSize = END_LEVEL_MIN_WIDTH / 2; - int progressTarget = (END_LEVEL_MAX_WIDTH) * (END_LEVEL_MAX_WIDTH); + int progressTarget = (END_LEVEL_MIN_WIDTH) * (END_LEVEL_MIN_WIDTH); int currentProgress = 0; if(progress) progress->progressStagePercentage((currentProgress*100)/progressTarget); diff --git a/Minecraft.World/CropTile.cpp b/Minecraft.World/CropTile.cpp index 1c84cc0b..a8408462 100644 --- a/Minecraft.World/CropTile.cpp +++ b/Minecraft.World/CropTile.cpp @@ -203,4 +203,16 @@ void CropTile::registerIcons(IconRegister *iconRegister) { icons[i] = iconRegister->registerIcon(L"crops_" + std::to_wstring(i)); } -} \ No newline at end of file +} +void CropTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +{ + int age = forceData >= 0 ? forceData : level->getData(x, y, z); + setShape(0, 0, 0, 1, getShapeHeight(age), 1); +} + +float CropTile::getShapeHeight(int age) +{ + if (age < 0) age = 0; + if (age > 7) age = 7; + return (age + 1) / 8.0f; +} diff --git a/Minecraft.World/CropTile.h b/Minecraft.World/CropTile.h index 3fbde034..a18ca10e 100644 --- a/Minecraft.World/CropTile.h +++ b/Minecraft.World/CropTile.h @@ -19,6 +19,8 @@ protected: public: // 4J Added override virtual void updateDefaultShape(); + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); + virtual float getShapeHeight(int age); virtual void createBlockStateDefinition() override; virtual int defaultBlockState() override; virtual int convertBlockStateToLegacyData(BlockState *state) override; diff --git a/Minecraft.World/DerivedLevelData.cpp b/Minecraft.World/DerivedLevelData.cpp index b7bd441c..d1ade07d 100644 --- a/Minecraft.World/DerivedLevelData.cpp +++ b/Minecraft.World/DerivedLevelData.cpp @@ -225,3 +225,20 @@ int DerivedLevelData::getHellScale() { return wrapped->getHellScale(); } + +bool DerivedLevelData::isModernEnd() +{ + return wrapped->isModernEnd(); +} + +void DerivedLevelData::setModernEnd(bool modernEnd) +{ + wrapped->setModernEnd(modernEnd); +} + +bool DerivedLevelData::isEndDragonKilled() { return wrapped->isEndDragonKilled(); } +void DerivedLevelData::setEndDragonKilled(bool killed) { wrapped->setEndDragonKilled(killed); } +bool DerivedLevelData::isEndPreviouslyKilled() { return wrapped->isEndPreviouslyKilled(); } +void DerivedLevelData::setEndPreviouslyKilled(bool killed) { wrapped->setEndPreviouslyKilled(killed); } +bool DerivedLevelData::isEndGatewaySpawned() { return wrapped->isEndGatewaySpawned(); } +void DerivedLevelData::setEndGatewaySpawned(bool spawned) { wrapped->setEndGatewaySpawned(spawned); } diff --git a/Minecraft.World/DerivedLevelData.h b/Minecraft.World/DerivedLevelData.h index 306f12dd..550d3dc5 100644 --- a/Minecraft.World/DerivedLevelData.h +++ b/Minecraft.World/DerivedLevelData.h @@ -54,6 +54,14 @@ public: void setGameType(GameType *gameType); bool isHardcore(); void setHardcore(bool hardcore); + bool isModernEnd(); + void setModernEnd(bool modernEnd); + bool isEndDragonKilled(); + void setEndDragonKilled(bool killed); + bool isEndPreviouslyKilled(); + void setEndPreviouslyKilled(bool killed); + bool isEndGatewaySpawned(); + void setEndGatewaySpawned(bool spawned); LevelType *getGenerator(); void setGenerator(LevelType *generator); bool getAllowCommands(); diff --git a/Minecraft.World/Dimension.cpp b/Minecraft.World/Dimension.cpp index 82567c30..97532251 100644 --- a/Minecraft.World/Dimension.cpp +++ b/Minecraft.World/Dimension.cpp @@ -253,3 +253,10 @@ int Dimension::getXZSize() { return level->getLevelData()->getXZSize(); } + +bool Dimension::isOutsideWorldEdge(int x, int z) +{ + int maxxz = ( getXZSize() * 16 ) / 2; + int minxz = -maxxz; + return ( x < minxz ) || ( x >= maxxz ) || ( z < minxz ) || ( z >= maxxz ); +} diff --git a/Minecraft.World/Dimension.h b/Minecraft.World/Dimension.h index ca040e21..d5f1041d 100644 --- a/Minecraft.World/Dimension.h +++ b/Minecraft.World/Dimension.h @@ -62,4 +62,5 @@ public: // 4J Added virtual int getXZSize(); + virtual bool isOutsideWorldEdge(int x, int z); }; diff --git a/Minecraft.World/DirectoryLevelStorage.cpp b/Minecraft.World/DirectoryLevelStorage.cpp index 142f7359..e2aabbfe 100644 --- a/Minecraft.World/DirectoryLevelStorage.cpp +++ b/Minecraft.World/DirectoryLevelStorage.cpp @@ -561,7 +561,16 @@ void DirectoryLevelStorage::flushSaveFile(bool autosave) // 4J Added void DirectoryLevelStorage::resetNetherPlayerPositions() { - if(app.GetResetNether()) + if(app.GetResetNether()) resetPlayerPositionsInDimension(LevelData::DIMENSION_NETHER); +} + +void DirectoryLevelStorage::resetEndPlayerPositions() +{ + if(app.GetResetEnd()) resetPlayerPositionsInDimension(LevelData::DIMENSION_END); +} + +void DirectoryLevelStorage::resetPlayerPositionsInDimension(int dimension) +{ { #if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) vector *playerFiles = m_saveFile->getValidPlayerDatFiles(); @@ -579,7 +588,7 @@ void DirectoryLevelStorage::resetNetherPlayerPositions() { // If the player is in the nether, set their y position above the top of the nether // This will force the player to be spawned in a valid position in the overworld when they are loaded - if(tag->contains(L"Dimension") && tag->getInt(L"Dimension") == LevelData::DIMENSION_NETHER && tag->contains(L"Pos")) + if(tag->contains(L"Dimension") && tag->getInt(L"Dimension") == dimension && tag->contains(L"Pos")) { ListTag *pos = (ListTag *) tag->getList(L"Pos"); pos->get(1)->data = DBL_MAX; diff --git a/Minecraft.World/DirectoryLevelStorage.h b/Minecraft.World/DirectoryLevelStorage.h index 6d305ba3..78d66a5c 100644 --- a/Minecraft.World/DirectoryLevelStorage.h +++ b/Minecraft.World/DirectoryLevelStorage.h @@ -136,6 +136,8 @@ public: virtual void deleteMapFilesForPlayer(shared_ptr player); virtual void saveAllCachedData(); void resetNetherPlayerPositions(); // 4J Added + void resetEndPlayerPositions(); + void resetPlayerPositionsInDimension(int dimension); static wstring getPlayerDir() { return sc_szPlayerDir; } private: diff --git a/Minecraft.World/DoorItem.cpp b/Minecraft.World/DoorItem.cpp index 8171ecc1..0ff17cbc 100644 --- a/Minecraft.World/DoorItem.cpp +++ b/Minecraft.World/DoorItem.cpp @@ -44,13 +44,19 @@ bool DoorItem::useOn(shared_ptr instance, shared_ptr playe player->awardStat(GenericStats::blocksPlaced(tile->id),GenericStats::param_blocksPlaced(tile->id,instance->getAuxValue(),1)); int dir = Mth::floor(((player->yRot + 180) * 4) / 360 - 0.5) & 3; - place(level, x, y, z, dir, tile); + + int stepX = (dir == 0) ? 1 : (dir == 2) ? -1 : 0; + int stepZ = (dir == 1) ? 1 : (dir == 3) ? -1 : 0; + bool hingeRight = (stepX < 0 && clickZ < 0.5f) || (stepX > 0 && clickZ > 0.5f) || (stepZ < 0 && clickX > 0.5f) || (stepZ > 0 && clickX < 0.5f); + place(level, x, y, z, dir, tile, hingeRight); + + level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, tile->soundType->getPlaceSound(), (tile->soundType->getVolume() + 1) / 2, tile->soundType->getPitch() * 0.8f); instance->count--; return true; } -void DoorItem::place(Level *level, int x, int y, int z, int dir, Tile *tile) +void DoorItem::place(Level *level, int x, int y, int z, int dir, Tile *tile, bool hingeRight) { int xra = 0; @@ -67,9 +73,9 @@ void DoorItem::place(Level *level, int x, int y, int z, int dir, Tile *tile) bool doorLeft = (level->getTile(x - xra, y, z - zra) == tile->id) || (level->getTile(x - xra, y + 1, z - zra) == tile->id); bool doorRight = (level->getTile(x + xra, y, z + zra) == tile->id) || (level->getTile(x + xra, y + 1, z + zra) == tile->id); - bool flip = false; - if (doorLeft && !doorRight) flip = true; - else if (solidRight > solidLeft) flip = true; + bool flip = hingeRight; + if ((doorLeft && !doorRight) || solidRight > solidLeft) flip = true; + else if ((doorRight && !doorLeft) || solidRight < solidLeft) flip = false; level->setTileAndData(x, y, z, tile->id, dir, Tile::UPDATE_CLIENTS); level->setTileAndData(x, y + 1, z, tile->id, 8 | (flip ? 1 : 0), Tile::UPDATE_CLIENTS); diff --git a/Minecraft.World/DoorItem.h b/Minecraft.World/DoorItem.h index 836cfe91..7099930f 100644 --- a/Minecraft.World/DoorItem.h +++ b/Minecraft.World/DoorItem.h @@ -17,6 +17,6 @@ public: DoorItem(int id, Material *material, const wstring& doorType); virtual bool useOn(shared_ptr instance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly=false); - static void place(Level *level, int x, int y, int z, int dir, Tile *tile); + static void place(Level *level, int x, int y, int z, int dir, Tile *tile, bool hingeRight = false); }; \ No newline at end of file diff --git a/Minecraft.World/DoorTile.cpp b/Minecraft.World/DoorTile.cpp index 31540b5b..8644056c 100644 --- a/Minecraft.World/DoorTile.cpp +++ b/Minecraft.World/DoorTile.cpp @@ -191,7 +191,8 @@ bool DoorTile::use(Level *level, int x, int y, int z, shared_ptr player, // 4J - added - just do enough to play the sound if (material != Material::metal) { - level->levelEvent(player, LevelEvent::SOUND_OPEN_DOOR, x, y, z, 0); + bool willOpen = (getCompositeData(level, x, y, z) & C_OPEN_MASK) == 0; + level->levelEvent(player, getToggleSound(willOpen), x, y, z, 0); } return false; } @@ -201,6 +202,7 @@ bool DoorTile::use(Level *level, int x, int y, int z, shared_ptr player, int compositeData = getCompositeData(level, x, y, z); int lowerData = compositeData & C_LOWER_DATA_MASK; lowerData ^= 4; + bool nowOpen = (compositeData & C_OPEN_MASK) == 0; if ((compositeData & C_IS_UPPER_MASK) == 0) { level->setData(x, y, z, lowerData, Tile::UPDATE_CLIENTS); @@ -212,7 +214,7 @@ bool DoorTile::use(Level *level, int x, int y, int z, shared_ptr player, level->setTilesDirty(x, y - 1, z, x, y, z); } - level->levelEvent(player, LevelEvent::SOUND_OPEN_DOOR, x, y, z, 0); + level->levelEvent(player, getToggleSound(nowOpen), x, y, z, 0); return true; } @@ -235,7 +237,7 @@ void DoorTile::setOpen(Level *level, int x, int y, int z, bool shouldOpen) level->setTilesDirty(x, y - 1, z, x, y, z); } - level->levelEvent(nullptr, LevelEvent::SOUND_OPEN_DOOR, x, y, z, 0); + level->levelEvent(nullptr, getToggleSound(shouldOpen), x, y, z, 0); } void DoorTile::neighborChanged(Level *level, int x, int y, int z, int type) @@ -417,13 +419,14 @@ bool DoorTile::use(Level *level, const BlockPos &pos, Tile::BlockState *state, s if (soundOnly) { if (material != Material::metal) - level->levelEvent(player, LevelEvent::SOUND_OPEN_DOOR, pos.getX(), pos.getY(), pos.getZ(), 0); + level->levelEvent(player, getToggleSound((getCompositeData(level, pos.getX(), pos.getY(), pos.getZ()) & C_OPEN_MASK) == 0), pos.getX(), pos.getY(), pos.getZ(), 0); return false; } if (material == Material::metal) return true; int composite = state ? state->value : getCompositeData(level, pos.getX(), pos.getY(), pos.getZ()); + bool nowOpen = (composite & C_OPEN_MASK) == 0; int lowerData = composite & C_LOWER_DATA_MASK; lowerData ^= 4; @@ -435,6 +438,11 @@ bool DoorTile::use(Level *level, const BlockPos &pos, Tile::BlockState *state, s level->setTilesDirty(pos.getX(), pos.getY() - 1, pos.getZ(), pos.getX(), pos.getY(), pos.getZ()); } - level->levelEvent(player, LevelEvent::SOUND_OPEN_DOOR, pos.getX(), pos.getY(), pos.getZ(), 0); + level->levelEvent(player, getToggleSound(nowOpen), pos.getX(), pos.getY(), pos.getZ(), 0); return true; -} \ No newline at end of file +} +int DoorTile::getToggleSound(bool open) +{ + if (material == Material::metal) return open ? LevelEvent::SOUND_OPEN_IRON_DOOR : LevelEvent::SOUND_CLOSE_IRON_DOOR; + return open ? LevelEvent::SOUND_OPEN_WOODEN_DOOR : LevelEvent::SOUND_CLOSE_WOODEN_DOOR; +} diff --git a/Minecraft.World/DoorTile.h b/Minecraft.World/DoorTile.h index a532e5cd..0b1e3850 100644 --- a/Minecraft.World/DoorTile.h +++ b/Minecraft.World/DoorTile.h @@ -53,6 +53,7 @@ public: virtual bool TestUse(); virtual bool use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly = false); // 4J added soundOnly param void setOpen(Level *level, int x, int y, int z, bool shouldOpen); + int getToggleSound(bool open); virtual void neighborChanged(Level *level, int x, int y, int z, int type); virtual int getResource(int data, Random *random, int playerBonusLevel); virtual HitResult *clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b); diff --git a/Minecraft.World/DragonFireball.cpp b/Minecraft.World/DragonFireball.cpp index 348bc53e..f135c0c6 100644 --- a/Minecraft.World/DragonFireball.cpp +++ b/Minecraft.World/DragonFireball.cpp @@ -6,6 +6,9 @@ #include "net.minecraft.world.level.h" #include "JavaMath.h" #include "DragonFireball.h" +#include "AreaEffectCloud.h" +#include "MobEffectInstance.h" +#include "net.minecraft.world.effect.h" @@ -29,33 +32,34 @@ DragonFireball::DragonFireball(Level *level, double x, double y, double z, doubl void DragonFireball::onHit(HitResult *res) { - if (!level->isClientSide) + if (!level->isClientSide && (res->entity == nullptr || res->entity != owner)) { + shared_ptr cloud = std::make_shared(level, x, y, z); + cloud->setOwner(owner); + cloud->setParticle(eParticleType_dragonbreath); + cloud->setRadius(3.0f); + cloud->setParticleSpawnRateOnTick(10); + cloud->setDuration(200); + cloud->setRadiusPerTick((7.0f - cloud->getRadius()) / static_cast(cloud->getDuration())); + cloud->addEffect(new MobEffectInstance(MobEffect::harm->id, 1, 1)); + AABB *aoe = bb->grow(SPLASH_RANGE, SPLASH_RANGE / 2, SPLASH_RANGE); vector > *entitiesOfClass = level->getEntitiesOfClass(typeid(LivingEntity), aoe); - if ( entitiesOfClass ) + if (entitiesOfClass != nullptr) { - if (!entitiesOfClass->empty()) + for (auto& it : *entitiesOfClass) { - for (auto& it : *entitiesOfClass) + if (distanceToSqr(it) < SPLASH_RANGE_SQ) { - shared_ptr e = dynamic_pointer_cast(it); - double dist = distanceToSqr(e); - if (dist < SPLASH_RANGE_SQ) - { - double scale = 1.0 - (sqrt(dist) / SPLASH_RANGE); - if (e == res->entity) - { - scale = 1; - } - e->hurt(DamageSource::dragonbreath, 8 * scale); - } + cloud->setPos(it->x, it->y, it->z); + break; } } delete entitiesOfClass; } - level->levelEvent(LevelEvent::ENDERDRAGON_FIREBALL_SPLASH, static_cast(Math::round(x)), static_cast(Math::round(y)), static_cast(Math::round(z)), 0); + level->levelEvent(LevelEvent::ENDERDRAGON_FIREBALL_SPLASH, static_cast(Math::round(x)), static_cast(Math::round(y)), static_cast(Math::round(z)), 0); + level->addEntity(cloud); remove(); } } diff --git a/Minecraft.World/ElytraItem.cpp b/Minecraft.World/ElytraItem.cpp index 42452048..a0869a3e 100644 --- a/Minecraft.World/ElytraItem.cpp +++ b/Minecraft.World/ElytraItem.cpp @@ -26,7 +26,7 @@ bool ElytraItem::TestUse(shared_ptr instance, Level* level, shared shared_ptr ElytraItem::use(shared_ptr instance, Level* level, shared_ptr player) { // Play cloth armor equip sound (range 194–199) - player->playSound(194, 0.5f, 1.0f); + player->playSound(eSoundType_ITEM_ARMOR_equipLeather1 + random->nextInt(6), 1.0f, 1.0f); return instance; } diff --git a/Minecraft.World/EnchantmentMenu.cpp b/Minecraft.World/EnchantmentMenu.cpp index 0e23b458..e2217be3 100644 --- a/Minecraft.World/EnchantmentMenu.cpp +++ b/Minecraft.World/EnchantmentMenu.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "SoundTypes.h" #include "net.minecraft.world.entity.player.h" #include "net.minecraft.world.inventory.h" #include "net.minecraft.world.level.h" @@ -287,6 +288,7 @@ bool EnchantmentMenu::clickMenuButton(shared_ptr player, int i) delete newEnchantment; cachedEnchantments[i] = nullptr; slotsChanged(1);// Removed enchantSlots parameter as the function can reference it directly + level->playSound(x + 0.5, y + 0.5, z + 0.5, eSoundType_BLOCK_ENCHANTMENT_TABLE_ENCHANT, 1.0f, level->random->nextFloat() * 0.1f + 0.9f); } } if (!player->abilities.instabuild) lapisSlot->removeItem(1, i+1); diff --git a/Minecraft.World/EndCityFeature.cpp b/Minecraft.World/EndCityFeature.cpp new file mode 100644 index 00000000..a55eb613 --- /dev/null +++ b/Minecraft.World/EndCityFeature.cpp @@ -0,0 +1,87 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.biome.h" +#include "EndCityFeature.h" +#include "EndCityPieces.h" +#include "BoundingBox.h" +#include "TheEndDimension.h" +#include "TheEndLevelRandomLevelSource.h" + +EndCityFeature::EndCityFeature(TheEndLevelRandomLevelSource *source) : StructureFeature() +{ + this->source = source; +} + +wstring EndCityFeature::getFeatureName() +{ + return L"EndCity"; +} + +bool EndCityFeature::isFeatureChunk(int x, int z, bool bIsSuperflat) +{ + return TheEndDimension::isOuterAreaCentre(x, z); +} + +StructureStart *EndCityFeature::createStructureStart(int x, int z) +{ + return new EndCityStart(level, source, random, x, z); +} + +int EndCityFeature::getYPositionForFeature(int chunkX, int chunkZ, TheEndLevelRandomLevelSource *source) +{ + Random random(chunkX + chunkZ * 10387313); + int rotation = random.nextInt(4); + + unsigned int blocksSize = Level::genDepth * 16 * 16; + byteArray blocks = byteArray(blocksSize); + memset(blocks.data, 0, blocksSize); + BiomeArray biomes; + source->prepareHeights(chunkX, chunkZ, blocks, biomes); + + int xOffset = 5; + int zOffset = 5; + if (rotation == EndCityPieces::ROT_CLOCKWISE_90) xOffset = -5; + else if (rotation == EndCityPieces::ROT_CLOCKWISE_180) { xOffset = -5; zOffset = -5; } + else if (rotation == EndCityPieces::ROT_COUNTERCLOCKWISE_90) zOffset = -5; + + const int columns[4][2] = { { 7, 7 }, { 7, 7 + zOffset }, { 7 + xOffset, 7 }, { 7 + xOffset, 7 + zOffset } }; + int lowest = Level::genDepth; + for (int i = 0; i < 4; i++) + { + int top = 0; + for (int y = Level::genDepth - 1; y > 0; y--) + { + int offs = (columns[i][0] << Level::genDepthBitsPlusFour) | (columns[i][1] << Level::genDepthBits) | y; + if (blocks[offs] != 0) + { + top = y; + break; + } + } + if (top < lowest) lowest = top; + } + + delete [] blocks.data; + delete [] biomes.data; + return lowest; +} + +EndCityFeature::EndCityStart::EndCityStart() +{ +} + +EndCityFeature::EndCityStart::EndCityStart(Level *level, TheEndLevelRandomLevelSource *source, Random *random, int chunkX, int chunkZ) : StructureStart(chunkX, chunkZ) +{ + int rotation = random->nextInt(4); + int y = getYPositionForFeature(chunkX, chunkZ, source); + + if (y < 10) + { + boundingBox = new BoundingBox(chunkX * 16, 0, chunkZ * 16, chunkX * 16, 0, chunkZ * 16); + return; + } + + EndCityPieces::Builder builder(pieces, random); + builder.startHouseTower(chunkX * 16 + 8, y, chunkZ * 16 + 8, rotation); + calculateBoundingBox(); +} diff --git a/Minecraft.World/EndCityFeature.h b/Minecraft.World/EndCityFeature.h new file mode 100644 index 00000000..694a94cf --- /dev/null +++ b/Minecraft.World/EndCityFeature.h @@ -0,0 +1,34 @@ +#pragma once + +#include "StructureFeature.h" +#include "StructureStart.h" + +class TheEndLevelRandomLevelSource; + +class EndCityFeature : public StructureFeature +{ +private: + TheEndLevelRandomLevelSource *source; + +public: + EndCityFeature(TheEndLevelRandomLevelSource *source); + + wstring getFeatureName(); + + static int getYPositionForFeature(int chunkX, int chunkZ, TheEndLevelRandomLevelSource *source); + +protected: + virtual bool isFeatureChunk(int x, int z, bool bIsSuperflat = false); + virtual StructureStart *createStructureStart(int x, int z); + +public: + class EndCityStart : public StructureStart + { + public: + static StructureStart *Create() { return new EndCityStart(); } + virtual EStructureStart GetType() { return eStructureStart_EndCity; } + + EndCityStart(); + EndCityStart(Level *level, TheEndLevelRandomLevelSource *source, Random *random, int chunkX, int chunkZ); + }; +}; diff --git a/Minecraft.World/EndCityPieces.cpp b/Minecraft.World/EndCityPieces.cpp new file mode 100644 index 00000000..5541eddd --- /dev/null +++ b/Minecraft.World/EndCityPieces.cpp @@ -0,0 +1,480 @@ +#include "stdafx.h" +#include "com.mojang.nbt.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.level.tile.entity.h" +#include "net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.item.h" +#include "net.minecraft.world.item.h" +#include "EndCityPieces.h" +#include "BoundingBox.h" +#include "Shulker.h" +#include "ItemFrame.h" +#include "WeighedTreasure.h" +#include "LootTableManager.h" +#include "Direction.h" +#include "Facing.h" + +static const int TOWER_BRIDGES[4][4] = +{ + { EndCityPieces::ROT_NONE, 1, -1, 0 }, + { EndCityPieces::ROT_CLOCKWISE_90, 6, -1, 1 }, + { EndCityPieces::ROT_COUNTERCLOCKWISE_90, 0, -1, 5 }, + { EndCityPieces::ROT_CLOCKWISE_180, 5, -1, 6 }, +}; + +static const int FAT_TOWER_BRIDGES[4][4] = +{ + { EndCityPieces::ROT_NONE, 4, -1, 0 }, + { EndCityPieces::ROT_CLOCKWISE_90, 12, -1, 4 }, + { EndCityPieces::ROT_COUNTERCLOCKWISE_90, 0, -1, 8 }, + { EndCityPieces::ROT_CLOCKWISE_180, 8, -1, 12 }, +}; + +static const int POTION_HEALING_II = 8229; + +void EndCityPieces::transform(int rotation, int x, int z, int &outX, int &outZ) +{ + switch (rotation) + { + case ROT_CLOCKWISE_90: outX = -z; outZ = x; break; + case ROT_CLOCKWISE_180: outX = -x; outZ = -z; break; + case ROT_COUNTERCLOCKWISE_90: outX = z; outZ = -x; break; + default: outX = x; outZ = z; break; + } +} + +static const int CLOCKWISE_FACINGS[4] = { Facing::NORTH, Facing::EAST, Facing::SOUTH, Facing::WEST }; + +static int rotateFacing(int facing, int rotation) +{ + for (int i = 0; i < 4; i++) + { + if (CLOCKWISE_FACINGS[i] == facing) return CLOCKWISE_FACINGS[(i + rotation) & 3]; + } + return facing; +} + +static int rotateDirection(int dir, int rotation) +{ + return (dir + rotation) & 3; +} + + +EndCityPieces::EndCityPiece::EndCityPiece() : StructurePiece(0) +{ + templateType = 0; + templateX = templateY = templateZ = 0; + rotation = ROT_NONE; + overwrite = false; +} + +EndCityPieces::EndCityPiece::EndCityPiece(int templateType, int x, int y, int z, int rotation, bool overwrite) : StructurePiece(0) +{ + this->templateType = templateType; + templateX = x; + templateY = y; + templateZ = z; + this->rotation = rotation; + this->overwrite = overwrite; + calculateBoundingBox(); +} + +void EndCityPieces::EndCityPiece::calculateBoundingBox() +{ + const EndCityTemplates::Template &t = EndCityTemplates::TEMPLATES[templateType]; + bool turned = rotation == ROT_CLOCKWISE_90 || rotation == ROT_COUNTERCLOCKWISE_90; + int sx = turned ? t.sizeZ : t.sizeX; + int sz = turned ? t.sizeX : t.sizeZ; + + int ox = 0, oz = 0; + if (rotation == ROT_CLOCKWISE_90) ox = -sx; + else if (rotation == ROT_COUNTERCLOCKWISE_90) oz = -sz; + else if (rotation == ROT_CLOCKWISE_180) { ox = -sx; oz = -sz; } + + delete boundingBox; + boundingBox = new BoundingBox(templateX + ox, templateY, templateZ + oz, templateX + ox + sx, templateY + t.sizeY - 1, templateZ + oz + sz); +} + +void EndCityPieces::EndCityPiece::moveBy(int dx, int dy, int dz) +{ + templateX += dx; + templateY += dy; + templateZ += dz; + boundingBox->move(dx, dy, dz); +} + +void EndCityPieces::EndCityPiece::addAdditonalSaveData(CompoundTag *tag) +{ + tag->putInt(L"Template", templateType); + tag->putInt(L"TX", templateX); + tag->putInt(L"TY", templateY); + tag->putInt(L"TZ", templateZ); + tag->putInt(L"Rot", rotation); + tag->putBoolean(L"OW", overwrite); +} + +void EndCityPieces::EndCityPiece::readAdditonalSaveData(CompoundTag *tag) +{ + templateType = tag->getInt(L"Template"); + templateX = tag->getInt(L"TX"); + templateY = tag->getInt(L"TY"); + templateZ = tag->getInt(L"TZ"); + rotation = tag->getInt(L"Rot"); + overwrite = tag->getBoolean(L"OW"); + calculateBoundingBox(); +} + +int EndCityPieces::EndCityPiece::rotateData(int id, int data) +{ + if (rotation == ROT_NONE) return data; + + if (id == Tile::purpur_stairs_Id) + { + static const int STAIR_TO_FACING[4] = { Facing::EAST, Facing::WEST, Facing::SOUTH, Facing::NORTH }; + int facing = rotateFacing(STAIR_TO_FACING[data & 3], rotation); + int dir = 0; + for (int i = 0; i < 4; i++) + { + if (STAIR_TO_FACING[i] == facing) dir = i; + } + return (data & 4) | dir; + } + if (id == Tile::purpur_pillar_Id) + { + int axis = data & 0xC; + if ((rotation & 1) && (axis == 4 || axis == 8)) axis ^= 0xC; + return (data & ~0xC) | axis; + } + if (id == Tile::end_rod_Id || id == Tile::ladder_Id || id == Tile::chest_Id || id == Tile::ender_chest_Id || id == 177 || id == Tile::skull_Id) + { + int facing = data & 7; + if (facing >= 2 && facing <= 5) return (data & ~7) | rotateFacing(facing, rotation); + } + return data; +} + +bool EndCityPieces::EndCityPiece::postProcess(Level *level, Random *random, BoundingBox *chunkBB) +{ + const EndCityTemplates::Template &t = EndCityTemplates::TEMPLATES[templateType]; + + for (int i = 0; i < t.blockCount; i++) + { + const EndCityTemplates::Block &b = t.blocks[i]; + int id = b.id; + int data = b.data; + + if (id == 0 && !overwrite) continue; + + int tx, tz; + transform(rotation, b.x, b.z, tx, tz); + int wx = templateX + tx; + int wy = templateY + b.y; + int wz = templateZ + tz; + if (!chunkBB->isInside(wx, wy, wz)) continue; + + data = rotateData(id, data); + + bool wallBanner = id == 177; + if (wallBanner) id = Tile::standing_banner_Id; + + level->setTileAndData(wx, wy, wz, id, data, Tile::UPDATE_CLIENTS); + + if (wallBanner) + { + shared_ptr banner = dynamic_pointer_cast(level->getTileEntity(wx, wy, wz)); + if (banner != nullptr) banner->setIsWall(true); + } + } + + for (int i = 0; i < t.extraCount; i++) + { + handleExtra(level, random, chunkBB, t.extras[i]); + } + return true; +} + +void EndCityPieces::EndCityPiece::handleExtra(Level *level, Random *random, BoundingBox *chunkBB, const EndCityTemplates::Extra &extra) +{ + int tx, tz; + transform(rotation, extra.x, extra.z, tx, tz); + int x = templateX + tx; + int y = templateY + extra.y; + int z = templateZ + tz; + if (!chunkBB->isInside(x, y, z)) return; + + switch (extra.kind) + { + case EndCityTemplates::EXTRA_CHEST_LOOT: + { + shared_ptr chest = dynamic_pointer_cast(level->getTileEntity(x, y - 1, z)); + if (chest != nullptr) + { + WeighedTreasure::addChestItems(random, + LootTableManager::Get().ResolveDrops("chests/end_city_treasure", false, 0, + [random](int bound) { return random->nextInt(bound); }), + chest); + } + } + break; + + case EndCityTemplates::EXTRA_SENTRY: + { + shared_ptr shulker = std::make_shared(level); + shulker->moveTo(x + 0.5, y, z + 0.5, 0, 0); + shulker->setAttachPosition(x, y, z); + level->addEntity(shulker); + } + break; + + case EndCityTemplates::EXTRA_ELYTRA: + { + int dir = rotateDirection(Direction::SOUTH, rotation); + int wallX = x - Direction::STEP_X[dir]; + int wallZ = z - Direction::STEP_Z[dir]; + shared_ptr frame = std::make_shared(level, wallX, y, wallZ, dir); + frame->setItem(std::make_shared(Item::elytra)); + level->addEntity(frame); + } + break; + + case EndCityTemplates::EXTRA_BANNER: + { + shared_ptr banner = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + if (banner != nullptr) + { + banner->setBaseColor(extra.arg); + banner->clearPatterns(); + banner->addPattern(L"tt", 0); + banner->addPattern(L"bt", 0); + } + } + break; + + case EndCityTemplates::EXTRA_SKULL: + { + shared_ptr skull = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + if (skull != nullptr) skull->setSkullType(extra.arg, L""); + } + break; + + case EndCityTemplates::EXTRA_HEALING_POTIONS: + { + shared_ptr stand = dynamic_pointer_cast(level->getTileEntity(x, y, z)); + if (stand != nullptr) + { + stand->setItem(0, std::make_shared(Item::potion, 1, POTION_HEALING_II)); + stand->setItem(2, std::make_shared(Item::potion, 1, POTION_HEALING_II)); + } + } + break; + + default: + break; + } +} + + +EndCityPieces::Builder::Builder(list &pieces, Random *random) : pieces(pieces) +{ + this->random = random; + for (int i = 0; i < 8; i++) houseGenerated[i] = false; + shipGenerated = false; +} + +EndCityPieces::EndCityPiece *EndCityPieces::Builder::add(list &into, EndCityPiece *piece) +{ + into.push_back(piece); + return piece; +} + +EndCityPieces::EndCityPiece *EndCityPieces::Builder::addPiece(EndCityPiece *previous, int ox, int oy, int oz, int templateType, int rotation, bool overwrite) +{ + EndCityPiece *piece = new EndCityPiece(templateType, previous->templateX, previous->templateY, previous->templateZ, rotation, overwrite); + int tx, tz; + transform(previous->rotation, ox, oz, tx, tz); + piece->moveBy(tx, oy, tz); + return piece; +} + +void EndCityPieces::Builder::startHouseTower(int x, int y, int z, int rotation) +{ + EndCityPiece *piece = add(pieces, new EndCityPiece(EndCityTemplates::BASE_FLOOR, x, y, z, rotation, true)); + piece = add(pieces, addPiece(piece, -1, 0, -1, EndCityTemplates::SECOND_FLOOR, rotation, false)); + piece = add(pieces, addPiece(piece, -1, 4, -1, EndCityTemplates::THIRD_FLOOR, rotation, false)); + piece = add(pieces, addPiece(piece, -1, 8, -1, EndCityTemplates::THIRD_ROOF, rotation, true)); + recursiveChildren(SECTION_TOWER, 1, piece, 0, 0, 0, pieces); +} + +bool EndCityPieces::Builder::recursiveChildren(ESection section, int genDepth, EndCityPiece *previous, int ox, int oy, int oz, list &into) +{ + if (genDepth > 8) return false; + + list children; + if (!generate(section, genDepth, previous, ox, oy, oz, children)) + { + for (auto &child : children) delete child; + return false; + } + + int tag = random->nextInt(); + for (auto &child : children) + { + static_cast(child)->setGenDepth(tag); + StructurePiece *collision = StructurePiece::findCollisionPiece(&into, child->getBoundingBox()); + if (collision != nullptr && collision->getGenDepth() != previous->getGenDepth()) + { + for (auto &c : children) delete c; + return false; + } + } + + into.insert(into.end(), children.begin(), children.end()); + return true; +} + +bool EndCityPieces::Builder::generate(ESection section, int genDepth, EndCityPiece *previous, int ox, int oy, int oz, list &out) +{ + switch (section) + { + case SECTION_HOUSE: return generateHouse(genDepth, previous, ox, oy, oz, out); + case SECTION_TOWER: return generateTower(genDepth, previous, out); + case SECTION_TOWER_BRIDGE: return generateTowerBridge(genDepth, previous, out); + case SECTION_FAT_TOWER: return generateFatTower(genDepth, previous, out); + } + return false; +} + +bool EndCityPieces::Builder::generateHouse(int genDepth, EndCityPiece *previous, int ox, int oy, int oz, list &out) +{ + if (genDepth > 8) return false; + + int rotation = previous->rotation; + EndCityPiece *piece = add(out, addPiece(previous, ox, oy, oz, EndCityTemplates::BASE_FLOOR, rotation, true)); + int roof = random->nextInt(3); + if (!houseGenerated[genDepth]) + { + houseGenerated[genDepth] = true; + roof = 2; + } + + if (roof == 0) + { + add(out, addPiece(piece, -1, 4, -1, EndCityTemplates::BASE_ROOF, rotation, true)); + } + else if (roof == 1) + { + piece = add(out, addPiece(piece, -1, 0, -1, EndCityTemplates::SECOND_FLOOR_2, rotation, false)); + piece = add(out, addPiece(piece, -1, 8, -1, EndCityTemplates::SECOND_ROOF, rotation, false)); + recursiveChildren(SECTION_TOWER, genDepth + 1, piece, 0, 0, 0, out); + } + else + { + piece = add(out, addPiece(piece, -1, 0, -1, EndCityTemplates::SECOND_FLOOR_2, rotation, false)); + piece = add(out, addPiece(piece, -1, 4, -1, EndCityTemplates::THIRD_FLOOR_C, rotation, false)); + piece = add(out, addPiece(piece, -1, 8, -1, EndCityTemplates::THIRD_ROOF, rotation, true)); + recursiveChildren(SECTION_TOWER, genDepth + 1, piece, 0, 0, 0, out); + } + return true; +} + +bool EndCityPieces::Builder::generateTower(int genDepth, EndCityPiece *previous, list &out) +{ + int rotation = previous->rotation; + EndCityPiece *piece = add(out, addPiece(previous, 4, -3, 4, EndCityTemplates::TOWER_BASE, rotation, true)); + piece = add(out, addPiece(piece, 0, 7, 0, EndCityTemplates::TOWER_PIECE, rotation, true)); + EndCityPiece *bridgePiece = random->nextInt(3) == 0 ? piece : nullptr; + int extraFloors = random->nextInt(3); + for (int i = 0; i < extraFloors + 1; i++) + { + piece = add(out, addPiece(piece, 0, 4, 0, EndCityTemplates::TOWER_PIECE, rotation, true)); + if (i < extraFloors && random->nextInt(10) > 2) bridgePiece = piece; + } + if (genDepth == 1 && bridgePiece == nullptr) bridgePiece = piece; + + if (bridgePiece == nullptr) + { + if (genDepth == 7) + { + add(out, addPiece(piece, -1, 4, -1, EndCityTemplates::TOWER_TOP, rotation, true)); + return true; + } + return recursiveChildren(SECTION_FAT_TOWER, genDepth + 1, piece, 0, 0, 0, out); + } + + double bridgeWeight = 3 - genDepth > 0 ? static_cast(3 - genDepth) : 0.0; + double remaining = 4.0; + for (int i = 0; i < 4; i++) + { + if (random->nextFloat() < bridgeWeight / remaining || random->nextInt(10) > 2) + { + EndCityPiece *bridge = add(out, addPiece(bridgePiece, TOWER_BRIDGES[i][1], TOWER_BRIDGES[i][2], TOWER_BRIDGES[i][3], + EndCityTemplates::BRIDGE_END, rotate(rotation, TOWER_BRIDGES[i][0]), true)); + if (recursiveChildren(SECTION_TOWER_BRIDGE, genDepth + 1, bridge, 0, 0, 0, out)) bridgeWeight -= 1.0; + } + remaining -= 1.0; + } + add(out, addPiece(piece, -1, 4, -1, EndCityTemplates::TOWER_TOP, rotation, true)); + return true; +} + +bool EndCityPieces::Builder::generateTowerBridge(int genDepth, EndCityPiece *previous, list &out) +{ + int rotation = previous->rotation; + int count = random->nextInt(4) + 1; + EndCityPiece *piece = add(out, addPiece(previous, 0, 0, -4, EndCityTemplates::BRIDGE_PIECE, rotation, true)); + piece->setGenDepth(-1); + int y = 0; + for (int i = 0; i < count; i++) + { + if (random->nextBoolean()) + { + piece = add(out, addPiece(piece, 0, y, -4, EndCityTemplates::BRIDGE_PIECE, rotation, true)); + y = 0; + } + else + { + if (random->nextBoolean()) + piece = add(out, addPiece(piece, 0, y, -4, EndCityTemplates::BRIDGE_STEEP_STAIRS, rotation, true)); + else + piece = add(out, addPiece(piece, 0, y, -8, EndCityTemplates::BRIDGE_GENTLE_STAIRS, rotation, true)); + y = 4; + } + } + + if (!shipGenerated) + { + add(out, addPiece(piece, random->nextInt(8) - 8, y, -48, EndCityTemplates::SHIP, rotation, true)); + shipGenerated = true; + } + else if (!recursiveChildren(SECTION_HOUSE, genDepth + 1, piece, -3, y + 1, -11, out)) + { + return false; + } + + piece = add(out, addPiece(piece, 4, y, 0, EndCityTemplates::BRIDGE_END, rotate(rotation, ROT_CLOCKWISE_180), true)); + piece->setGenDepth(-1); + return true; +} + +bool EndCityPieces::Builder::generateFatTower(int genDepth, EndCityPiece *previous, list &out) +{ + int rotation = previous->rotation; + EndCityPiece *piece = add(out, addPiece(previous, -3, 4, -3, EndCityTemplates::FAT_TOWER_BASE, rotation, true)); + piece = add(out, addPiece(piece, 0, 4, 0, EndCityTemplates::FAT_TOWER_MIDDLE, rotation, true)); + for (int floor = 0; floor < 2; floor++) + { + piece = add(out, addPiece(piece, 0, 8, 0, EndCityTemplates::FAT_TOWER_MIDDLE, rotation, true)); + for (int i = 0; i < 4; i++) + { + if (random->nextInt(10) > 2) + { + EndCityPiece *bridge = add(out, addPiece(piece, FAT_TOWER_BRIDGES[i][1], FAT_TOWER_BRIDGES[i][2], FAT_TOWER_BRIDGES[i][3], + EndCityTemplates::BRIDGE_END, rotate(rotation, FAT_TOWER_BRIDGES[i][0]), true)); + recursiveChildren(SECTION_TOWER_BRIDGE, genDepth + 1, bridge, 0, 0, 0, out); + } + } + } + add(out, addPiece(piece, -2, 8, -2, EndCityTemplates::FAT_TOWER_TOP, rotation, true)); + return true; +} diff --git a/Minecraft.World/EndCityPieces.h b/Minecraft.World/EndCityPieces.h new file mode 100644 index 00000000..d6457df3 --- /dev/null +++ b/Minecraft.World/EndCityPieces.h @@ -0,0 +1,72 @@ +#pragma once +#include "StructurePiece.h" +#include "EndCityTemplates.h" + +class EndCityPieces +{ +public: + enum ERotation + { + ROT_NONE, + ROT_CLOCKWISE_90, + ROT_CLOCKWISE_180, + ROT_COUNTERCLOCKWISE_90, + }; + + static int rotate(int rotation, int by) { return (rotation + by) & 3; } + static void transform(int rotation, int x, int z, int &outX, int &outZ); + + class EndCityPiece : public StructurePiece + { + public: + virtual EStructurePiece GetType() { return eStructurePiece_EndCityPiece; } + static StructurePiece *Create() { return new EndCityPiece(); } + + int templateType; + int templateX, templateY, templateZ; + int rotation; + bool overwrite; + + EndCityPiece(); + EndCityPiece(int templateType, int x, int y, int z, int rotation, bool overwrite); + + void moveBy(int dx, int dy, int dz); + void setGenDepth(int depth) { genDepth = depth; } + + virtual bool postProcess(Level *level, Random *random, BoundingBox *chunkBB); + + protected: + virtual void addAdditonalSaveData(CompoundTag *tag); + virtual void readAdditonalSaveData(CompoundTag *tag); + + private: + void calculateBoundingBox(); + void handleExtra(Level *level, Random *random, BoundingBox *chunkBB, const EndCityTemplates::Extra &extra); + int rotateData(int id, int data); + }; + + class Builder + { + public: + Builder(list &pieces, Random *random); + void startHouseTower(int x, int y, int z, int rotation); + + private: + enum ESection { SECTION_HOUSE, SECTION_TOWER, SECTION_TOWER_BRIDGE, SECTION_FAT_TOWER }; + + list &pieces; + Random *random; + bool houseGenerated[8]; + bool shipGenerated; + + EndCityPiece *add(list &into, EndCityPiece *piece); + EndCityPiece *addPiece(EndCityPiece *previous, int ox, int oy, int oz, int templateType, int rotation, bool overwrite); + bool recursiveChildren(ESection section, int genDepth, EndCityPiece *previous, int ox, int oy, int oz, list &into); + bool generate(ESection section, int genDepth, EndCityPiece *previous, int ox, int oy, int oz, list &out); + + bool generateHouse(int genDepth, EndCityPiece *previous, int ox, int oy, int oz, list &out); + bool generateTower(int genDepth, EndCityPiece *previous, list &out); + bool generateTowerBridge(int genDepth, EndCityPiece *previous, list &out); + bool generateFatTower(int genDepth, EndCityPiece *previous, list &out); + }; +}; diff --git a/Minecraft.World/EndCityTemplates.cpp b/Minecraft.World/EndCityTemplates.cpp new file mode 100644 index 00000000..5e30fd21 --- /dev/null +++ b/Minecraft.World/EndCityTemplates.cpp @@ -0,0 +1,1568 @@ +#include "stdafx.h" +#include "EndCityTemplates.h" + +static const EndCityTemplates::Block s_base_floor_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{7,0,0,0,0},{8,0,0,0,0},{9,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0}, + {6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,0,0},{5,2,0,0,0},{6,2,0,0,0},{7,2,0,0,0},{8,2,0,0,0},{9,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0}, + {2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0},{6,3,0,0,0},{7,3,0,0,0},{8,3,0,0,0},{9,3,0,0,0},{0,0,1,0,0},{1,0,1,201,0},{2,0,1,201,0},{3,0,1,201,0},{4,0,1,201,0},{5,0,1,201,0},{6,0,1,201,0},{7,0,1,201,0}, + {8,0,1,201,0},{9,0,1,0,0},{0,1,1,0,0},{1,1,1,202,0},{2,1,1,206,0},{3,1,1,206,0},{4,1,1,206,0},{5,1,1,206,0},{6,1,1,206,0},{7,1,1,206,0},{8,1,1,202,0},{9,1,1,0,0},{0,2,1,0,0},{1,2,1,202,0},{2,2,1,206,0},{4,2,1,206,0}, + {5,2,1,206,0},{7,2,1,206,0},{8,2,1,202,0},{9,2,1,0,0},{0,3,1,0,0},{1,3,1,202,0},{2,3,1,206,0},{4,3,1,206,0},{5,3,1,206,0},{7,3,1,206,0},{8,3,1,202,0},{9,3,1,0,0},{0,0,2,0,0},{1,0,2,201,0},{2,0,2,201,0},{3,0,2,201,0}, + {4,0,2,201,0},{5,0,2,201,0},{6,0,2,201,0},{7,0,2,201,0},{8,0,2,201,0},{9,0,2,0,0},{0,1,2,0,0},{1,1,2,206,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{5,1,2,0,0},{6,1,2,0,0},{7,1,2,0,0},{8,1,2,206,0},{9,1,2,0,0}, + {0,2,2,0,0},{1,2,2,206,0},{2,2,2,0,0},{3,2,2,0,0},{4,2,2,0,0},{5,2,2,0,0},{6,2,2,0,0},{7,2,2,0,0},{8,2,2,206,0},{9,2,2,0,0},{0,3,2,0,0},{1,3,2,206,0},{2,3,2,0,0},{3,3,2,0,0},{4,3,2,0,0},{5,3,2,0,0}, + {6,3,2,0,0},{7,3,2,0,0},{8,3,2,206,0},{9,3,2,0,0},{0,0,3,0,0},{1,0,3,201,0},{2,0,3,201,0},{3,0,3,201,0},{4,0,3,201,0},{5,0,3,201,0},{6,0,3,201,0},{7,0,3,201,0},{8,0,3,201,0},{9,0,3,0,0},{0,1,3,0,0},{1,1,3,206,0}, + {2,1,3,0,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0},{8,1,3,206,0},{9,1,3,0,0},{0,2,3,0,0},{2,2,3,0,0},{3,2,3,0,0},{4,2,3,0,0},{5,2,3,0,0},{6,2,3,0,0},{7,2,3,0,0},{9,2,3,0,0}, + {0,3,3,0,0},{2,3,3,0,0},{3,3,3,0,0},{4,3,3,0,0},{5,3,3,0,0},{6,3,3,0,0},{7,3,3,0,0},{9,3,3,0,0},{0,0,4,0,0},{1,0,4,201,0},{2,0,4,201,0},{3,0,4,201,0},{4,0,4,201,0},{5,0,4,201,0},{6,0,4,201,0},{7,0,4,201,0}, + {8,0,4,201,0},{9,0,4,0,0},{0,1,4,0,0},{1,1,4,206,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0},{7,1,4,0,0},{8,1,4,206,0},{9,1,4,0,0},{0,2,4,0,0},{1,2,4,206,0},{2,2,4,0,0},{3,2,4,0,0}, + {4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0},{7,2,4,0,0},{8,2,4,206,0},{9,2,4,0,0},{0,3,4,0,0},{1,3,4,206,0},{2,3,4,0,0},{3,3,4,0,0},{4,3,4,0,0},{5,3,4,0,0},{6,3,4,0,0},{7,3,4,0,0},{8,3,4,206,0},{9,3,4,0,0}, + {0,0,5,0,0},{1,0,5,201,0},{2,0,5,201,0},{3,0,5,201,0},{4,0,5,201,0},{5,0,5,201,0},{6,0,5,201,0},{7,0,5,201,0},{8,0,5,201,0},{9,0,5,0,0},{0,1,5,0,0},{1,1,5,206,0},{2,1,5,0,0},{3,1,5,0,0},{4,1,5,0,0},{5,1,5,0,0}, + {6,1,5,0,0},{7,1,5,0,0},{8,1,5,206,0},{9,1,5,0,0},{0,2,5,0,0},{1,2,5,206,0},{2,2,5,0,0},{3,2,5,0,0},{4,2,5,0,0},{5,2,5,0,0},{6,2,5,0,0},{7,2,5,0,0},{8,2,5,206,0},{9,2,5,0,0},{0,3,5,0,0},{1,3,5,206,0}, + {2,3,5,0,0},{3,3,5,0,0},{4,3,5,0,0},{5,3,5,0,0},{6,3,5,0,0},{7,3,5,0,0},{8,3,5,206,0},{9,3,5,0,0},{0,0,6,0,0},{1,0,6,201,0},{2,0,6,201,0},{3,0,6,201,0},{4,0,6,201,0},{5,0,6,201,0},{6,0,6,201,0},{7,0,6,201,0}, + {8,0,6,201,0},{9,0,6,0,0},{0,1,6,0,0},{1,1,6,206,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{7,1,6,0,0},{8,1,6,206,0},{9,1,6,0,0},{0,2,6,0,0},{2,2,6,0,0},{3,2,6,0,0},{4,2,6,0,0}, + {5,2,6,0,0},{6,2,6,0,0},{7,2,6,0,0},{9,2,6,0,0},{0,3,6,0,0},{2,3,6,0,0},{3,3,6,0,0},{4,3,6,0,0},{5,3,6,0,0},{6,3,6,0,0},{7,3,6,0,0},{9,3,6,0,0},{0,0,7,0,0},{1,0,7,201,0},{2,0,7,201,0},{3,0,7,201,0}, + {4,0,7,201,0},{5,0,7,201,0},{6,0,7,201,0},{7,0,7,201,0},{8,0,7,201,0},{9,0,7,0,0},{0,1,7,0,0},{1,1,7,206,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{6,1,7,0,0},{7,1,7,0,0},{8,1,7,206,0},{9,1,7,0,0}, + {0,2,7,0,0},{1,2,7,206,0},{2,2,7,0,0},{3,2,7,0,0},{4,2,7,0,0},{5,2,7,0,0},{6,2,7,0,0},{7,2,7,0,0},{8,2,7,206,0},{9,2,7,0,0},{0,3,7,0,0},{1,3,7,206,0},{2,3,7,0,0},{3,3,7,0,0},{4,3,7,0,0},{5,3,7,0,0}, + {6,3,7,0,0},{7,3,7,0,0},{8,3,7,206,0},{9,3,7,0,0},{0,0,8,0,0},{1,0,8,201,0},{2,0,8,201,0},{3,0,8,201,0},{4,0,8,201,0},{5,0,8,201,0},{6,0,8,201,0},{7,0,8,201,0},{8,0,8,201,0},{9,0,8,0,0},{0,1,8,0,0},{1,1,8,202,0}, + {2,1,8,206,0},{3,1,8,206,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,206,0},{7,1,8,206,0},{8,1,8,202,0},{9,1,8,0,0},{0,2,8,0,0},{1,2,8,202,0},{2,2,8,206,0},{3,2,8,206,0},{4,2,8,0,0},{5,2,8,0,0},{6,2,8,206,0},{7,2,8,206,0}, + {8,2,8,202,0},{9,2,8,0,0},{0,3,8,0,0},{1,3,8,202,0},{2,3,8,206,0},{3,3,8,206,0},{4,3,8,0,0},{5,3,8,0,0},{6,3,8,206,0},{7,3,8,206,0},{8,3,8,202,0},{9,3,8,0,0},{0,0,9,0,0},{1,0,9,0,0},{3,0,9,201,0},{4,0,9,201,0}, + {5,0,9,201,0},{6,0,9,201,0},{8,0,9,0,0},{9,0,9,0,0},{0,1,9,0,0},{1,1,9,0,0},{2,1,9,0,0},{3,1,9,0,0},{4,1,9,0,0},{5,1,9,0,0},{6,1,9,0,0},{7,1,9,0,0},{8,1,9,0,0},{9,1,9,0,0},{0,2,9,0,0},{1,2,9,0,0}, + {2,2,9,0,0},{4,2,9,0,0},{5,2,9,0,0},{7,2,9,0,0},{8,2,9,0,0},{9,2,9,0,0},{0,3,9,0,0},{1,3,9,0,0},{2,3,9,0,0},{3,3,9,0,0},{4,3,9,0,0},{5,3,9,0,0},{6,3,9,0,0},{7,3,9,0,0},{8,3,9,0,0},{9,3,9,0,0}, + {3,2,1,95,2},{6,2,1,95,2},{3,3,1,95,2},{6,3,1,95,2},{1,2,3,95,2},{8,2,3,95,2},{1,3,3,95,2},{8,3,3,95,2},{1,2,6,95,2},{8,2,6,95,2},{1,3,6,95,2},{8,3,6,95,2},{2,0,9,203,3},{7,0,9,203,3}, +}; +static const EndCityTemplates::Extra s_base_floor_extras[] = { + {3,2,9,EndCityTemplates::EXTRA_SENTRY,0},{6,2,9,EndCityTemplates::EXTRA_SENTRY,0}, +}; + +static const EndCityTemplates::Block s_base_roof_blocks[] = { + {0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{1,0,1,201,0},{2,0,1,201,0},{3,0,1,201,0},{4,0,1,201,0}, + {5,0,1,201,0},{6,0,1,201,0},{7,0,1,201,0},{8,0,1,201,0},{9,0,1,201,0},{10,0,1,201,0},{0,1,1,0,0},{2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0},{7,1,1,0,0},{8,1,1,0,0},{9,1,1,0,0},{11,1,1,0,0}, + {1,0,2,201,0},{2,0,2,201,0},{3,0,2,201,0},{4,0,2,201,0},{5,0,2,201,0},{6,0,2,201,0},{7,0,2,201,0},{8,0,2,201,0},{9,0,2,201,0},{10,0,2,201,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{5,1,2,0,0}, + {6,1,2,0,0},{7,1,2,0,0},{8,1,2,0,0},{9,1,2,0,0},{10,1,2,0,0},{11,1,2,0,0},{1,0,3,201,0},{2,0,3,201,0},{3,0,3,201,0},{4,0,3,201,0},{5,0,3,201,0},{6,0,3,201,0},{7,0,3,201,0},{8,0,3,201,0},{9,0,3,201,0},{10,0,3,201,0}, + {0,1,3,0,0},{1,1,3,0,0},{2,1,3,0,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0},{8,1,3,0,0},{9,1,3,0,0},{10,1,3,0,0},{11,1,3,0,0},{1,0,4,201,0},{2,0,4,201,0},{3,0,4,201,0},{4,0,4,201,0}, + {5,0,4,201,0},{6,0,4,201,0},{7,0,4,201,0},{8,0,4,201,0},{9,0,4,201,0},{10,0,4,201,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0},{7,1,4,0,0},{8,1,4,0,0},{9,1,4,0,0}, + {10,1,4,0,0},{11,1,4,0,0},{1,0,5,201,0},{2,0,5,201,0},{3,0,5,201,0},{4,0,5,201,0},{5,0,5,201,0},{6,0,5,201,0},{7,0,5,201,0},{8,0,5,201,0},{9,0,5,201,0},{10,0,5,201,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,0,0},{3,1,5,0,0}, + {4,1,5,0,0},{5,1,5,0,0},{6,1,5,0,0},{7,1,5,0,0},{8,1,5,0,0},{9,1,5,0,0},{10,1,5,0,0},{11,1,5,0,0},{1,0,6,201,0},{2,0,6,201,0},{3,0,6,201,0},{4,0,6,201,0},{5,0,6,201,0},{6,0,6,201,0},{7,0,6,201,0},{8,0,6,201,0}, + {9,0,6,201,0},{10,0,6,201,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{7,1,6,0,0},{8,1,6,0,0},{9,1,6,0,0},{10,1,6,0,0},{11,1,6,0,0},{1,0,7,201,0},{2,0,7,201,0}, + {3,0,7,201,0},{4,0,7,201,0},{5,0,7,201,0},{6,0,7,201,0},{7,0,7,201,0},{8,0,7,201,0},{9,0,7,201,0},{10,0,7,201,0},{0,1,7,0,0},{1,1,7,0,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{6,1,7,0,0},{7,1,7,0,0}, + {8,1,7,0,0},{9,1,7,0,0},{10,1,7,0,0},{11,1,7,0,0},{1,0,8,201,0},{2,0,8,201,0},{3,0,8,201,0},{4,0,8,201,0},{5,0,8,201,0},{6,0,8,201,0},{7,0,8,201,0},{8,0,8,201,0},{9,0,8,201,0},{10,0,8,201,0},{0,1,8,0,0},{1,1,8,0,0}, + {2,1,8,0,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,0,0},{7,1,8,0,0},{8,1,8,0,0},{9,1,8,0,0},{10,1,8,0,0},{11,1,8,0,0},{1,0,9,201,0},{2,0,9,201,0},{3,0,9,201,0},{4,0,9,201,0},{5,0,9,201,0},{6,0,9,201,0}, + {7,0,9,201,0},{8,0,9,201,0},{9,0,9,201,0},{10,0,9,201,0},{0,1,9,0,0},{1,1,9,0,0},{2,1,9,0,0},{3,1,9,0,0},{4,1,9,0,0},{5,1,9,0,0},{6,1,9,0,0},{7,1,9,0,0},{8,1,9,0,0},{9,1,9,0,0},{10,1,9,0,0},{11,1,9,0,0}, + {1,0,10,201,0},{2,0,10,201,0},{3,0,10,201,0},{4,0,10,201,0},{5,0,10,201,0},{6,0,10,201,0},{7,0,10,201,0},{8,0,10,201,0},{9,0,10,201,0},{10,0,10,201,0},{0,1,10,0,0},{2,1,10,0,0},{3,1,10,0,0},{4,1,10,0,0},{5,1,10,0,0},{6,1,10,0,0}, + {7,1,10,0,0},{8,1,10,0,0},{9,1,10,0,0},{11,1,10,0,0},{0,1,11,0,0},{1,1,11,0,0},{2,1,11,0,0},{3,1,11,0,0},{4,1,11,0,0},{5,1,11,0,0},{6,1,11,0,0},{7,1,11,0,0},{8,1,11,0,0},{9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0}, + {0,0,0,203,4},{1,0,0,203,6},{2,0,0,203,2},{3,0,0,203,2},{4,0,0,203,6},{5,0,0,203,2},{6,0,0,203,2},{7,0,0,203,6},{8,0,0,203,2},{9,0,0,203,2},{10,0,0,203,6},{11,0,0,203,6},{0,0,1,203,4},{11,0,1,203,5},{1,1,1,198,1},{10,1,1,198,1}, + {0,0,2,203,0},{11,0,2,203,1},{0,0,3,203,0},{11,0,3,203,1},{0,0,4,203,4},{11,0,4,203,5},{0,0,5,203,0},{11,0,5,203,1},{0,0,6,203,0},{11,0,6,203,1},{0,0,7,203,4},{11,0,7,203,5},{0,0,8,203,0},{11,0,8,203,1},{0,0,9,203,0},{11,0,9,203,1}, + {0,0,10,203,4},{11,0,10,203,5},{1,1,10,198,1},{10,1,10,198,1},{0,0,11,203,7},{1,0,11,203,7},{2,0,11,203,3},{3,0,11,203,3},{4,0,11,203,7},{5,0,11,203,3},{6,0,11,203,3},{7,0,11,203,7},{8,0,11,203,3},{9,0,11,203,3},{10,0,11,203,7},{11,0,11,203,5}, +}; + +static const EndCityTemplates::Block s_bridge_end_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,202,8},{3,0,0,0,0},{4,0,0,0,0},{0,1,0,201,0},{4,1,0,201,0},{0,2,0,201,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,201,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{0,4,0,0,0}, + {1,4,0,0,0},{2,4,0,0,0},{3,4,0,0,0},{4,4,0,0,0},{0,5,0,0,0},{1,5,0,0,0},{2,5,0,0,0},{3,5,0,0,0},{4,5,0,0,0},{0,0,1,0,0},{1,0,1,201,0},{2,0,1,201,0},{3,0,1,201,0},{4,0,1,0,0},{0,1,1,201,0},{1,1,1,201,0}, + {2,1,1,201,0},{3,1,1,201,0},{4,1,1,201,0},{0,2,1,201,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0},{4,2,1,201,0},{0,3,1,201,0},{1,3,1,0,0},{2,3,1,0,0},{3,3,1,0,0},{4,3,1,201,0},{0,4,1,201,0},{2,4,1,0,0},{4,4,1,201,0}, + {1,5,1,201,0},{2,5,1,201,0},{3,5,1,201,0},{1,1,0,203,2},{2,1,0,203,2},{3,1,0,203,2},{0,3,0,198,1},{4,3,0,198,1},{1,4,1,205,8},{3,4,1,205,8},{0,5,1,205,0},{4,5,1,205,0}, +}; + +static const EndCityTemplates::Block s_bridge_gentle_stairs_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,0,0},{0,3,0,0,0}, + {1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{0,4,0,0,0},{1,4,0,0,0},{2,4,0,202,8},{3,4,0,0,0},{4,4,0,0,0},{0,5,0,201,0},{1,5,0,201,0},{2,5,0,201,0},{3,5,0,201,0},{4,5,0,201,0},{0,6,0,201,0},{1,6,0,0,0}, + {2,6,0,0,0},{3,6,0,0,0},{4,6,0,201,0},{0,0,1,0,0},{1,0,1,0,0},{2,0,1,0,0},{3,0,1,0,0},{4,0,1,0,0},{0,1,1,0,0},{1,1,1,0,0},{2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0}, + {3,2,1,0,0},{4,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,0,0},{3,3,1,0,0},{4,3,1,0,0},{1,4,1,201,0},{2,4,1,201,0},{3,4,1,201,0},{0,5,1,201,0},{4,5,1,201,0},{1,6,1,0,0},{2,6,1,0,0},{3,6,1,0,0},{0,0,2,0,0}, + {1,0,2,0,0},{2,0,2,0,0},{3,0,2,0,0},{4,0,2,0,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{0,2,2,0,0},{1,2,2,0,0},{2,2,2,0,0},{3,2,2,0,0},{4,2,2,0,0},{0,3,2,0,0},{1,3,2,0,0}, + {2,3,2,0,0},{3,3,2,0,0},{4,3,2,0,0},{0,4,2,201,0},{1,4,2,201,0},{2,4,2,201,0},{3,4,2,201,0},{4,4,2,201,0},{1,5,2,0,0},{2,5,2,0,0},{3,5,2,0,0},{0,6,2,0,0},{1,6,2,0,0},{2,6,2,0,0},{3,6,2,0,0},{4,6,2,0,0}, + {0,0,3,0,0},{1,0,3,0,0},{2,0,3,0,0},{3,0,3,0,0},{4,0,3,0,0},{0,1,3,0,0},{1,1,3,0,0},{2,1,3,0,0},{3,1,3,0,0},{4,1,3,0,0},{0,2,3,0,0},{1,2,3,0,0},{2,2,3,0,0},{3,2,3,0,0},{4,2,3,0,0},{1,3,3,201,0}, + {2,3,3,201,0},{3,3,3,201,0},{0,4,3,201,0},{4,4,3,201,0},{1,5,3,0,0},{2,5,3,0,0},{3,5,3,0,0},{0,6,3,0,0},{1,6,3,0,0},{2,6,3,0,0},{3,6,3,0,0},{4,6,3,0,0},{0,0,4,0,0},{1,0,4,0,0},{2,0,4,0,0},{3,0,4,0,0}, + {4,0,4,0,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{0,2,4,0,0},{1,2,4,0,0},{2,2,4,0,0},{3,2,4,0,0},{4,2,4,0,0},{0,3,4,201,0},{1,3,4,201,0},{2,3,4,201,0},{3,3,4,201,0},{4,3,4,201,0}, + {1,4,4,0,0},{2,4,4,0,0},{3,4,4,0,0},{0,5,4,0,0},{1,5,4,0,0},{2,5,4,0,0},{3,5,4,0,0},{4,5,4,0,0},{0,6,4,0,0},{1,6,4,0,0},{2,6,4,0,0},{3,6,4,0,0},{4,6,4,0,0},{0,0,5,0,0},{1,0,5,0,0},{2,0,5,0,0}, + {3,0,5,0,0},{4,0,5,0,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,0,0},{3,1,5,0,0},{4,1,5,0,0},{1,2,5,201,0},{2,2,5,201,0},{3,2,5,201,0},{0,3,5,201,0},{4,3,5,201,0},{1,4,5,0,0},{2,4,5,0,0},{3,4,5,0,0},{0,5,5,0,0}, + {1,5,5,0,0},{2,5,5,0,0},{3,5,5,0,0},{4,5,5,0,0},{0,6,5,0,0},{1,6,5,0,0},{2,6,5,0,0},{3,6,5,0,0},{4,6,5,0,0},{0,0,6,0,0},{1,0,6,0,0},{2,0,6,0,0},{3,0,6,0,0},{4,0,6,0,0},{0,1,6,0,0},{1,1,6,0,0}, + {2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{0,2,6,201,0},{1,2,6,201,0},{2,2,6,201,0},{3,2,6,201,0},{4,2,6,201,0},{1,3,6,0,0},{2,3,6,0,0},{3,3,6,0,0},{0,4,6,0,0},{1,4,6,0,0},{2,4,6,0,0},{3,4,6,0,0},{4,4,6,0,0}, + {0,5,6,0,0},{1,5,6,0,0},{2,5,6,0,0},{3,5,6,0,0},{4,5,6,0,0},{0,6,6,0,0},{1,6,6,0,0},{2,6,6,0,0},{3,6,6,0,0},{4,6,6,0,0},{0,0,7,0,0},{1,0,7,0,0},{2,0,7,202,8},{3,0,7,0,0},{4,0,7,0,0},{1,1,7,201,0}, + {2,1,7,201,0},{3,1,7,201,0},{0,2,7,201,0},{4,2,7,201,0},{1,3,7,0,0},{2,3,7,0,0},{3,3,7,0,0},{0,4,7,0,0},{1,4,7,0,0},{2,4,7,0,0},{3,4,7,0,0},{4,4,7,0,0},{0,5,7,0,0},{1,5,7,0,0},{2,5,7,0,0},{3,5,7,0,0}, + {4,5,7,0,0},{0,6,7,0,0},{1,6,7,0,0},{2,6,7,0,0},{3,6,7,0,0},{4,6,7,0,0},{0,4,1,203,4},{4,4,1,203,5},{1,5,1,205,0},{2,5,1,205,0},{3,5,1,205,0},{0,6,1,203,0},{4,6,1,203,1},{0,5,2,203,0},{4,5,2,203,1},{0,3,3,203,4}, + {4,3,3,203,5},{1,4,3,205,0},{2,4,3,205,0},{3,4,3,205,0},{0,5,3,203,0},{4,5,3,203,1},{0,4,4,203,0},{4,4,4,203,1},{0,2,5,203,4},{4,2,5,203,5},{1,3,5,205,0},{2,3,5,205,0},{3,3,5,205,0},{0,4,5,203,0},{4,4,5,203,1},{0,3,6,203,0}, + {4,3,6,203,1},{0,1,7,203,4},{4,1,7,203,5},{1,2,7,205,0},{2,2,7,205,0},{3,2,7,205,0},{0,3,7,203,0},{4,3,7,203,1}, +}; + +static const EndCityTemplates::Block s_bridge_piece_blocks[] = { + {0,0,0,0,0},{2,0,0,202,8},{4,0,0,0,0},{1,1,0,201,0},{2,1,0,201,0},{3,1,0,201,0},{0,2,0,201,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,201,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0}, + {0,4,0,0,0},{1,4,0,0,0},{2,4,0,0,0},{3,4,0,0,0},{4,4,0,0,0},{0,5,0,0,0},{1,5,0,0,0},{2,5,0,0,0},{3,5,0,0,0},{4,5,0,0,0},{0,0,1,0,0},{1,0,1,0,0},{2,0,1,202,8},{3,0,1,0,0},{4,0,1,0,0},{0,1,1,201,0}, + {1,1,1,201,0},{2,1,1,201,0},{3,1,1,201,0},{4,1,1,201,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,0,0},{3,3,1,0,0},{4,3,1,0,0},{0,4,1,0,0},{1,4,1,0,0},{2,4,1,0,0},{3,4,1,0,0}, + {4,4,1,0,0},{0,5,1,0,0},{1,5,1,0,0},{2,5,1,0,0},{3,5,1,0,0},{4,5,1,0,0},{0,0,2,0,0},{1,0,2,0,0},{2,0,2,202,8},{3,0,2,0,0},{4,0,2,0,0},{0,1,2,201,0},{1,1,2,201,0},{2,1,2,201,0},{3,1,2,201,0},{4,1,2,201,0}, + {1,2,2,0,0},{2,2,2,0,0},{3,2,2,0,0},{0,3,2,0,0},{1,3,2,0,0},{2,3,2,0,0},{3,3,2,0,0},{4,3,2,0,0},{0,4,2,0,0},{1,4,2,0,0},{2,4,2,0,0},{3,4,2,0,0},{4,4,2,0,0},{0,5,2,0,0},{1,5,2,0,0},{2,5,2,0,0}, + {3,5,2,0,0},{4,5,2,0,0},{0,0,3,0,0},{1,0,3,0,0},{2,0,3,202,8},{3,0,3,0,0},{4,0,3,0,0},{0,1,3,201,0},{1,1,3,201,0},{2,1,3,201,0},{3,1,3,201,0},{4,1,3,201,0},{1,2,3,0,0},{2,2,3,0,0},{3,2,3,0,0},{0,3,3,0,0}, + {1,3,3,0,0},{2,3,3,0,0},{3,3,3,0,0},{4,3,3,0,0},{0,4,3,0,0},{1,4,3,0,0},{2,4,3,0,0},{3,4,3,0,0},{4,4,3,0,0},{0,5,3,0,0},{1,5,3,0,0},{2,5,3,0,0},{3,5,3,0,0},{4,5,3,0,0},{1,0,0,203,4},{3,0,0,203,5}, + {0,1,0,203,4},{4,1,0,203,5},{0,2,1,203,0},{4,2,1,203,1},{0,2,2,203,0},{4,2,2,203,1},{0,2,3,203,0},{4,2,3,203,1}, +}; + +static const EndCityTemplates::Block s_bridge_steep_stairs_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,0,0},{0,3,0,0,0}, + {1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{0,4,0,0,0},{2,4,0,202,8},{4,4,0,0,0},{0,5,0,201,0},{4,5,0,201,0},{0,6,0,201,0},{1,6,0,0,0},{2,6,0,0,0},{3,6,0,0,0},{4,6,0,201,0},{0,0,1,0,0},{1,0,1,0,0}, + {2,0,1,0,0},{3,0,1,0,0},{4,0,1,0,0},{0,1,1,0,0},{1,1,1,0,0},{2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0},{4,2,1,0,0},{0,3,1,0,0},{2,3,1,201,0},{4,3,1,0,0}, + {0,4,1,201,0},{4,4,1,201,0},{1,5,1,0,0},{2,5,1,0,0},{3,5,1,0,0},{0,6,1,0,0},{1,6,1,0,0},{2,6,1,0,0},{3,6,1,0,0},{4,6,1,0,0},{0,0,2,0,0},{1,0,2,0,0},{2,0,2,0,0},{3,0,2,0,0},{4,0,2,0,0},{0,1,2,0,0}, + {1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{0,2,2,0,0},{2,2,2,201,0},{4,2,2,0,0},{0,3,2,201,0},{4,3,2,201,0},{1,4,2,0,0},{2,4,2,0,0},{3,4,2,0,0},{0,5,2,0,0},{1,5,2,0,0},{2,5,2,0,0},{3,5,2,0,0}, + {4,5,2,0,0},{0,6,2,0,0},{1,6,2,0,0},{2,6,2,0,0},{3,6,2,0,0},{4,6,2,0,0},{0,0,3,0,0},{1,0,3,0,0},{2,0,3,202,8},{3,0,3,0,0},{4,0,3,0,0},{0,1,3,0,0},{1,1,3,201,0},{2,1,3,201,0},{3,1,3,201,0},{4,1,3,0,0}, + {0,2,3,201,0},{4,2,3,201,0},{1,3,3,0,0},{2,3,3,0,0},{3,3,3,0,0},{0,4,3,0,0},{1,4,3,0,0},{2,4,3,0,0},{3,4,3,0,0},{4,4,3,0,0},{0,5,3,0,0},{1,5,3,0,0},{2,5,3,0,0},{3,5,3,0,0},{4,5,3,0,0},{0,6,3,0,0}, + {1,6,3,0,0},{2,6,3,0,0},{3,6,3,0,0},{4,6,3,0,0},{1,4,0,203,4},{3,4,0,203,5},{1,5,0,203,3},{2,5,0,203,3},{3,5,0,203,3},{1,3,1,203,4},{3,3,1,203,5},{1,4,1,203,3},{2,4,1,203,3},{3,4,1,203,3},{0,5,1,203,0},{4,5,1,203,1}, + {1,2,2,203,4},{3,2,2,203,5},{1,3,2,203,3},{2,3,2,203,3},{3,3,2,203,3},{0,4,2,203,0},{4,4,2,203,1},{1,2,3,203,3},{2,2,3,203,3},{3,2,3,203,3},{0,3,3,203,0},{4,3,3,203,1}, +}; + +static const EndCityTemplates::Block s_fat_tower_base_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{7,0,0,0,0},{8,0,0,0,0},{9,0,0,0,0},{10,0,0,0,0},{11,0,0,0,0},{12,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0}, + {3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{12,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,0,0},{5,2,0,0,0}, + {7,2,0,0,0},{8,2,0,0,0},{9,2,0,0,0},{10,2,0,0,0},{11,2,0,0,0},{12,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0},{6,3,0,0,0},{7,3,0,0,0},{8,3,0,0,0},{9,3,0,0,0}, + {10,3,0,0,0},{11,3,0,0,0},{12,3,0,0,0},{0,0,1,0,0},{1,0,1,0,0},{2,0,1,0,0},{3,0,1,0,0},{4,0,1,0,0},{5,0,1,201,0},{6,0,1,201,0},{7,0,1,201,0},{8,0,1,0,0},{9,0,1,0,0},{10,0,1,0,0},{11,0,1,0,0},{12,0,1,0,0}, + {0,1,1,0,0},{1,1,1,0,0},{2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,202,0},{6,1,1,202,0},{7,1,1,202,0},{8,1,1,0,0},{9,1,1,0,0},{10,1,1,0,0},{11,1,1,0,0},{12,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0}, + {3,2,1,0,0},{4,2,1,0,0},{5,2,1,202,0},{6,2,1,202,8},{7,2,1,202,0},{8,2,1,0,0},{9,2,1,0,0},{10,2,1,0,0},{11,2,1,0,0},{12,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,0,0},{3,3,1,0,0},{4,3,1,0,0},{5,3,1,202,0}, + {6,3,1,202,0},{7,3,1,202,0},{8,3,1,0,0},{9,3,1,0,0},{10,3,1,0,0},{11,3,1,0,0},{12,3,1,0,0},{0,0,2,0,0},{1,0,2,0,0},{2,0,2,0,0},{3,0,2,201,0},{4,0,2,201,0},{5,0,2,201,0},{6,0,2,201,0},{7,0,2,201,0},{8,0,2,201,0}, + {9,0,2,201,0},{10,0,2,0,0},{11,0,2,0,0},{12,0,2,0,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,202,0},{4,1,2,202,0},{5,1,2,0,0},{6,1,2,0,0},{7,1,2,0,0},{8,1,2,202,0},{9,1,2,202,0},{10,1,2,0,0},{11,1,2,0,0}, + {12,1,2,0,0},{0,2,2,0,0},{1,2,2,0,0},{2,2,2,0,0},{3,2,2,202,0},{4,2,2,202,0},{5,2,2,0,0},{6,2,2,0,0},{7,2,2,0,0},{8,2,2,202,0},{9,2,2,202,0},{10,2,2,0,0},{11,2,2,0,0},{12,2,2,0,0},{0,3,2,0,0},{1,3,2,0,0}, + {2,3,2,0,0},{3,3,2,202,0},{4,3,2,202,0},{5,3,2,0,0},{6,3,2,0,0},{7,3,2,0,0},{8,3,2,202,0},{9,3,2,202,0},{10,3,2,0,0},{11,3,2,0,0},{12,3,2,0,0},{0,0,3,0,0},{1,0,3,0,0},{2,0,3,201,0},{3,0,3,201,0},{4,0,3,201,0}, + {5,0,3,201,0},{6,0,3,201,0},{7,0,3,201,0},{8,0,3,201,0},{9,0,3,201,0},{10,0,3,201,0},{11,0,3,0,0},{12,0,3,0,0},{0,1,3,0,0},{1,1,3,0,0},{2,1,3,202,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0}, + {8,1,3,0,0},{9,1,3,0,0},{10,1,3,202,0},{11,1,3,0,0},{12,1,3,0,0},{0,2,3,0,0},{1,2,3,0,0},{2,2,3,202,0},{3,2,3,0,0},{4,2,3,0,0},{5,2,3,0,0},{6,2,3,0,0},{7,2,3,0,0},{8,2,3,0,0},{9,2,3,0,0},{10,2,3,202,0}, + {11,2,3,0,0},{12,2,3,0,0},{0,3,3,0,0},{1,3,3,0,0},{2,3,3,202,0},{3,3,3,0,0},{5,3,3,0,0},{6,3,3,0,0},{7,3,3,0,0},{8,3,3,0,0},{9,3,3,0,0},{10,3,3,202,0},{11,3,3,0,0},{12,3,3,0,0},{0,0,4,0,0},{1,0,4,0,0}, + {2,0,4,201,0},{3,0,4,201,0},{4,0,4,201,0},{5,0,4,201,0},{6,0,4,201,0},{7,0,4,201,0},{8,0,4,201,0},{9,0,4,201,0},{10,0,4,201,0},{11,0,4,0,0},{12,0,4,0,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,202,0},{3,1,4,0,0},{4,1,4,0,0}, + {5,1,4,0,0},{6,1,4,0,0},{7,1,4,0,0},{8,1,4,0,0},{9,1,4,0,0},{10,1,4,202,0},{11,1,4,0,0},{12,1,4,0,0},{0,2,4,0,0},{1,2,4,0,0},{2,2,4,202,0},{4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0},{7,2,4,0,0},{8,2,4,0,0}, + {9,2,4,0,0},{10,2,4,202,0},{11,2,4,0,0},{12,2,4,0,0},{0,3,4,0,0},{1,3,4,0,0},{2,3,4,202,0},{3,3,4,0,0},{4,3,4,0,0},{5,3,4,0,0},{6,3,4,0,0},{7,3,4,0,0},{8,3,4,0,0},{9,3,4,0,0},{10,3,4,202,0},{11,3,4,0,0}, + {12,3,4,0,0},{0,0,5,0,0},{1,0,5,201,0},{2,0,5,201,0},{3,0,5,201,0},{4,0,5,201,0},{5,0,5,0,0},{6,0,5,0,0},{7,0,5,0,0},{8,0,5,201,0},{9,0,5,201,0},{10,0,5,201,0},{11,0,5,201,0},{12,0,5,0,0},{0,1,5,0,0},{1,1,5,202,0}, + {3,1,5,0,0},{4,1,5,0,0},{5,1,5,0,0},{6,1,5,0,0},{7,1,5,0,0},{8,1,5,0,0},{9,1,5,0,0},{10,1,5,0,0},{11,1,5,202,0},{12,1,5,0,0},{0,2,5,0,0},{1,2,5,202,0},{2,2,5,0,0},{3,2,5,0,0},{4,2,5,0,0},{5,2,5,0,0}, + {6,2,5,0,0},{7,2,5,0,0},{8,2,5,0,0},{9,2,5,0,0},{10,2,5,0,0},{11,2,5,202,0},{12,2,5,0,0},{0,3,5,0,0},{1,3,5,202,0},{2,3,5,0,0},{3,3,5,0,0},{4,3,5,0,0},{5,3,5,0,0},{6,3,5,0,0},{7,3,5,0,0},{8,3,5,0,0}, + {9,3,5,0,0},{10,3,5,0,0},{11,3,5,202,0},{12,3,5,0,0},{0,0,6,0,0},{1,0,6,201,0},{2,0,6,201,0},{3,0,6,201,0},{4,0,6,201,0},{5,0,6,0,0},{6,0,6,0,0},{7,0,6,0,0},{8,0,6,201,0},{9,0,6,201,0},{10,0,6,201,0},{11,0,6,201,0}, + {12,0,6,0,0},{0,1,6,0,0},{1,1,6,202,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{7,1,6,0,0},{8,1,6,0,0},{9,1,6,0,0},{10,1,6,0,0},{11,1,6,202,0},{12,1,6,0,0},{1,2,6,202,4},{2,2,6,0,0}, + {3,2,6,0,0},{4,2,6,0,0},{5,2,6,0,0},{6,2,6,0,0},{7,2,6,0,0},{8,2,6,0,0},{9,2,6,0,0},{10,2,6,0,0},{11,2,6,202,4},{0,3,6,0,0},{1,3,6,202,0},{2,3,6,0,0},{3,3,6,0,0},{4,3,6,0,0},{5,3,6,0,0},{6,3,6,0,0}, + {7,3,6,0,0},{8,3,6,0,0},{9,3,6,0,0},{10,3,6,0,0},{11,3,6,202,0},{12,3,6,0,0},{0,0,7,0,0},{1,0,7,201,0},{2,0,7,201,0},{3,0,7,201,0},{4,0,7,201,0},{5,0,7,0,0},{7,0,7,0,0},{8,0,7,201,0},{9,0,7,201,0},{10,0,7,201,0}, + {11,0,7,201,0},{12,0,7,0,0},{0,1,7,0,0},{1,1,7,202,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{6,1,7,0,0},{7,1,7,0,0},{8,1,7,0,0},{9,1,7,0,0},{11,1,7,202,0},{12,1,7,0,0},{0,2,7,0,0},{1,2,7,202,0}, + {2,2,7,0,0},{3,2,7,0,0},{4,2,7,0,0},{5,2,7,0,0},{6,2,7,0,0},{7,2,7,0,0},{8,2,7,0,0},{9,2,7,0,0},{10,2,7,0,0},{11,2,7,202,0},{12,2,7,0,0},{0,3,7,0,0},{1,3,7,202,0},{2,3,7,0,0},{3,3,7,0,0},{4,3,7,0,0}, + {5,3,7,0,0},{6,3,7,0,0},{7,3,7,0,0},{8,3,7,0,0},{9,3,7,0,0},{10,3,7,0,0},{11,3,7,202,0},{12,3,7,0,0},{0,0,8,0,0},{1,0,8,0,0},{2,0,8,201,0},{3,0,8,201,0},{4,0,8,201,0},{5,0,8,201,0},{6,0,8,201,0},{7,0,8,201,0}, + {8,0,8,201,0},{9,0,8,201,0},{10,0,8,201,0},{11,0,8,0,0},{12,0,8,0,0},{0,1,8,0,0},{1,1,8,0,0},{2,1,8,202,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,0,0},{7,1,8,0,0},{8,1,8,0,0},{9,1,8,0,0},{10,1,8,202,0}, + {11,1,8,0,0},{12,1,8,0,0},{0,2,8,0,0},{1,2,8,0,0},{2,2,8,202,0},{3,2,8,0,0},{4,2,8,0,0},{5,2,8,0,0},{6,2,8,0,0},{7,2,8,0,0},{8,2,8,0,0},{10,2,8,202,0},{11,2,8,0,0},{12,2,8,0,0},{0,3,8,0,0},{1,3,8,0,0}, + {2,3,8,202,0},{3,3,8,0,0},{4,3,8,0,0},{5,3,8,0,0},{6,3,8,0,0},{7,3,8,0,0},{8,3,8,0,0},{9,3,8,0,0},{10,3,8,202,0},{11,3,8,0,0},{12,3,8,0,0},{0,0,9,0,0},{1,0,9,0,0},{2,0,9,201,0},{3,0,9,201,0},{4,0,9,201,0}, + {5,0,9,201,0},{6,0,9,201,0},{7,0,9,201,0},{8,0,9,201,0},{9,0,9,201,0},{10,0,9,201,0},{11,0,9,0,0},{12,0,9,0,0},{0,1,9,0,0},{1,1,9,0,0},{2,1,9,202,0},{3,1,9,0,0},{4,1,9,0,0},{5,1,9,0,0},{6,1,9,0,0},{7,1,9,0,0}, + {8,1,9,0,0},{9,1,9,0,0},{10,1,9,202,0},{11,1,9,0,0},{12,1,9,0,0},{0,2,9,0,0},{1,2,9,0,0},{2,2,9,202,0},{3,2,9,0,0},{4,2,9,0,0},{5,2,9,0,0},{6,2,9,0,0},{7,2,9,0,0},{8,2,9,0,0},{9,2,9,0,0},{10,2,9,202,0}, + {11,2,9,0,0},{12,2,9,0,0},{0,3,9,0,0},{1,3,9,0,0},{2,3,9,202,0},{3,3,9,0,0},{4,3,9,0,0},{5,3,9,0,0},{6,3,9,0,0},{7,3,9,0,0},{9,3,9,0,0},{10,3,9,202,0},{11,3,9,0,0},{12,3,9,0,0},{0,0,10,0,0},{1,0,10,0,0}, + {2,0,10,0,0},{3,0,10,201,0},{4,0,10,201,0},{5,0,10,201,0},{6,0,10,201,0},{7,0,10,201,0},{8,0,10,201,0},{9,0,10,201,0},{10,0,10,0,0},{11,0,10,0,0},{12,0,10,0,0},{0,1,10,0,0},{1,1,10,0,0},{2,1,10,0,0},{3,1,10,202,0},{4,1,10,202,0}, + {5,1,10,0,0},{6,1,10,0,0},{7,1,10,0,0},{8,1,10,202,0},{9,1,10,202,0},{10,1,10,0,0},{11,1,10,0,0},{12,1,10,0,0},{0,2,10,0,0},{1,2,10,0,0},{2,2,10,0,0},{3,2,10,202,0},{4,2,10,202,0},{5,2,10,0,0},{6,2,10,0,0},{7,2,10,0,0}, + {8,2,10,202,0},{9,2,10,202,0},{10,2,10,0,0},{11,2,10,0,0},{12,2,10,0,0},{0,3,10,0,0},{1,3,10,0,0},{2,3,10,0,0},{3,3,10,202,0},{4,3,10,202,0},{5,3,10,0,0},{6,3,10,0,0},{7,3,10,0,0},{8,3,10,202,0},{9,3,10,202,0},{10,3,10,0,0}, + {11,3,10,0,0},{12,3,10,0,0},{0,0,11,0,0},{1,0,11,0,0},{2,0,11,0,0},{3,0,11,0,0},{4,0,11,0,0},{5,0,11,201,0},{6,0,11,201,0},{7,0,11,201,0},{8,0,11,0,0},{9,0,11,0,0},{10,0,11,0,0},{11,0,11,0,0},{12,0,11,0,0},{0,1,11,0,0}, + {1,1,11,0,0},{2,1,11,0,0},{3,1,11,0,0},{4,1,11,0,0},{5,1,11,202,0},{6,1,11,202,0},{7,1,11,202,0},{8,1,11,0,0},{9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0},{12,1,11,0,0},{0,2,11,0,0},{1,2,11,0,0},{2,2,11,0,0},{3,2,11,0,0}, + {4,2,11,0,0},{5,2,11,202,0},{6,2,11,202,8},{7,2,11,202,0},{8,2,11,0,0},{9,2,11,0,0},{10,2,11,0,0},{11,2,11,0,0},{12,2,11,0,0},{0,3,11,0,0},{1,3,11,0,0},{2,3,11,0,0},{3,3,11,0,0},{4,3,11,0,0},{5,3,11,202,0},{6,3,11,202,0}, + {7,3,11,202,0},{8,3,11,0,0},{9,3,11,0,0},{10,3,11,0,0},{11,3,11,0,0},{12,3,11,0,0},{0,0,12,0,0},{1,0,12,0,0},{2,0,12,0,0},{3,0,12,0,0},{4,0,12,0,0},{5,0,12,0,0},{6,0,12,0,0},{7,0,12,0,0},{8,0,12,0,0},{9,0,12,0,0}, + {10,0,12,0,0},{11,0,12,0,0},{12,0,12,0,0},{0,1,12,0,0},{1,1,12,0,0},{2,1,12,0,0},{3,1,12,0,0},{4,1,12,0,0},{5,1,12,0,0},{6,1,12,0,0},{7,1,12,0,0},{8,1,12,0,0},{9,1,12,0,0},{10,1,12,0,0},{11,1,12,0,0},{12,1,12,0,0}, + {0,2,12,0,0},{1,2,12,0,0},{2,2,12,0,0},{3,2,12,0,0},{4,2,12,0,0},{5,2,12,0,0},{7,2,12,0,0},{8,2,12,0,0},{9,2,12,0,0},{10,2,12,0,0},{11,2,12,0,0},{12,2,12,0,0},{0,3,12,0,0},{1,3,12,0,0},{2,3,12,0,0},{3,3,12,0,0}, + {4,3,12,0,0},{5,3,12,0,0},{6,3,12,0,0},{7,3,12,0,0},{8,3,12,0,0},{9,3,12,0,0},{10,3,12,0,0},{11,3,12,0,0},{12,3,12,0,0},{6,2,0,203,6},{4,3,3,198,3},{3,2,4,198,5},{2,1,5,205,0},{0,2,6,203,4},{12,2,6,203,5},{6,0,7,205,0}, + {10,1,7,205,0},{9,2,8,198,4},{8,3,9,198,2},{6,2,12,203,7}, +}; + +static const EndCityTemplates::Block s_fat_tower_middle_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{7,0,0,0,0},{8,0,0,0,0},{9,0,0,0,0},{10,0,0,0,0},{11,0,0,0,0},{12,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0}, + {3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{12,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,0,0},{5,2,0,0,0}, + {7,2,0,0,0},{8,2,0,0,0},{9,2,0,0,0},{10,2,0,0,0},{11,2,0,0,0},{12,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0},{6,3,0,0,0},{7,3,0,0,0},{8,3,0,0,0},{9,3,0,0,0}, + {10,3,0,0,0},{11,3,0,0,0},{12,3,0,0,0},{0,4,0,0,0},{1,4,0,0,0},{2,4,0,0,0},{3,4,0,0,0},{4,4,0,0,0},{5,4,0,0,0},{6,4,0,0,0},{7,4,0,0,0},{8,4,0,0,0},{9,4,0,0,0},{10,4,0,0,0},{11,4,0,0,0},{12,4,0,0,0}, + {0,5,0,0,0},{1,5,0,0,0},{2,5,0,0,0},{3,5,0,0,0},{4,5,0,0,0},{5,5,0,0,0},{6,5,0,0,0},{7,5,0,0,0},{8,5,0,0,0},{9,5,0,0,0},{10,5,0,0,0},{11,5,0,0,0},{12,5,0,0,0},{0,6,0,0,0},{1,6,0,0,0},{2,6,0,0,0}, + {3,6,0,0,0},{4,6,0,0,0},{5,6,0,0,0},{7,6,0,0,0},{8,6,0,0,0},{9,6,0,0,0},{10,6,0,0,0},{11,6,0,0,0},{12,6,0,0,0},{0,7,0,0,0},{1,7,0,0,0},{2,7,0,0,0},{3,7,0,0,0},{4,7,0,0,0},{5,7,0,0,0},{6,7,0,202,8}, + {7,7,0,0,0},{8,7,0,0,0},{9,7,0,0,0},{10,7,0,0,0},{11,7,0,0,0},{12,7,0,0,0},{0,0,1,0,0},{1,0,1,0,0},{2,0,1,0,0},{3,0,1,0,0},{4,0,1,0,0},{5,0,1,201,0},{6,0,1,201,0},{7,0,1,201,0},{8,0,1,0,0},{9,0,1,0,0}, + {10,0,1,0,0},{11,0,1,0,0},{12,0,1,0,0},{0,1,1,0,0},{1,1,1,0,0},{2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,202,0},{6,1,1,202,0},{7,1,1,202,0},{8,1,1,0,0},{9,1,1,0,0},{10,1,1,0,0},{11,1,1,0,0},{12,1,1,0,0}, + {0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0},{4,2,1,0,0},{5,2,1,202,0},{6,2,1,202,8},{7,2,1,202,0},{8,2,1,0,0},{9,2,1,0,0},{10,2,1,0,0},{11,2,1,0,0},{12,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,0,0}, + {3,3,1,0,0},{4,3,1,0,0},{5,3,1,202,0},{6,3,1,202,0},{7,3,1,202,0},{8,3,1,0,0},{9,3,1,0,0},{10,3,1,0,0},{11,3,1,0,0},{12,3,1,0,0},{0,4,1,0,0},{1,4,1,0,0},{2,4,1,0,0},{3,4,1,0,0},{4,4,1,0,0},{5,4,1,201,0}, + {6,4,1,201,0},{7,4,1,201,0},{8,4,1,0,0},{9,4,1,0,0},{10,4,1,0,0},{11,4,1,0,0},{12,4,1,0,0},{0,5,1,0,0},{1,5,1,0,0},{2,5,1,0,0},{3,5,1,0,0},{4,5,1,0,0},{5,5,1,202,0},{6,5,1,202,0},{7,5,1,202,0},{8,5,1,0,0}, + {9,5,1,0,0},{10,5,1,0,0},{11,5,1,0,0},{12,5,1,0,0},{0,6,1,0,0},{1,6,1,0,0},{2,6,1,0,0},{3,6,1,0,0},{4,6,1,0,0},{5,6,1,202,0},{6,6,1,202,8},{7,6,1,202,0},{8,6,1,0,0},{9,6,1,0,0},{10,6,1,0,0},{11,6,1,0,0}, + {12,6,1,0,0},{0,7,1,0,0},{1,7,1,0,0},{2,7,1,0,0},{3,7,1,0,0},{4,7,1,0,0},{5,7,1,201,0},{6,7,1,201,0},{7,7,1,201,0},{8,7,1,0,0},{9,7,1,0,0},{10,7,1,0,0},{11,7,1,0,0},{12,7,1,0,0},{0,0,2,0,0},{1,0,2,0,0}, + {2,0,2,0,0},{3,0,2,201,0},{4,0,2,201,0},{6,0,2,0,0},{7,0,2,0,0},{8,0,2,201,0},{9,0,2,201,0},{10,0,2,0,0},{11,0,2,0,0},{12,0,2,0,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,202,0},{4,1,2,202,0},{5,1,2,0,0}, + {6,1,2,0,0},{8,1,2,202,0},{9,1,2,202,0},{10,1,2,0,0},{11,1,2,0,0},{12,1,2,0,0},{0,2,2,0,0},{1,2,2,0,0},{2,2,2,0,0},{3,2,2,202,0},{4,2,2,202,0},{5,2,2,0,0},{6,2,2,0,0},{7,2,2,0,0},{8,2,2,202,0},{9,2,2,202,0}, + {10,2,2,0,0},{11,2,2,0,0},{12,2,2,0,0},{0,3,2,0,0},{1,3,2,0,0},{2,3,2,0,0},{3,3,2,202,0},{4,3,2,202,0},{5,3,2,0,0},{6,3,2,0,0},{7,3,2,0,0},{8,3,2,202,0},{9,3,2,202,0},{10,3,2,0,0},{11,3,2,0,0},{12,3,2,0,0}, + {0,4,2,0,0},{1,4,2,0,0},{2,4,2,0,0},{3,4,2,201,0},{4,4,2,201,0},{5,4,2,0,0},{6,4,2,0,0},{7,4,2,0,0},{8,4,2,201,0},{9,4,2,201,0},{10,4,2,0,0},{11,4,2,0,0},{12,4,2,0,0},{0,5,2,0,0},{1,5,2,0,0},{2,5,2,0,0}, + {3,5,2,202,0},{4,5,2,202,0},{5,5,2,0,0},{6,5,2,0,0},{7,5,2,0,0},{8,5,2,202,0},{9,5,2,202,0},{10,5,2,0,0},{11,5,2,0,0},{12,5,2,0,0},{0,6,2,0,0},{1,6,2,0,0},{2,6,2,0,0},{3,6,2,202,0},{4,6,2,202,0},{5,6,2,0,0}, + {7,6,2,0,0},{8,6,2,202,0},{9,6,2,202,0},{10,6,2,0,0},{11,6,2,0,0},{12,6,2,0,0},{0,7,2,0,0},{1,7,2,0,0},{2,7,2,0,0},{3,7,2,202,0},{4,7,2,202,0},{5,7,2,0,0},{6,7,2,0,0},{7,7,2,0,0},{8,7,2,202,0},{9,7,2,202,0}, + {10,7,2,0,0},{11,7,2,0,0},{12,7,2,0,0},{0,0,3,0,0},{1,0,3,0,0},{2,0,3,201,0},{3,0,3,0,0},{4,0,3,0,0},{5,0,3,0,0},{6,0,3,0,0},{7,0,3,0,0},{8,0,3,0,0},{9,0,3,0,0},{10,0,3,201,0},{11,0,3,0,0},{12,0,3,0,0}, + {0,1,3,0,0},{1,1,3,0,0},{2,1,3,202,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0},{8,1,3,0,0},{9,1,3,0,0},{10,1,3,202,0},{11,1,3,0,0},{12,1,3,0,0},{0,2,3,0,0},{1,2,3,0,0},{2,2,3,202,0}, + {3,2,3,0,0},{4,2,3,0,0},{5,2,3,0,0},{6,2,3,0,0},{7,2,3,0,0},{9,2,3,0,0},{10,2,3,202,0},{11,2,3,0,0},{12,2,3,0,0},{0,3,3,0,0},{1,3,3,0,0},{2,3,3,202,0},{3,3,3,0,0},{4,3,3,0,0},{5,3,3,0,0},{6,3,3,0,0}, + {7,3,3,0,0},{8,3,3,0,0},{9,3,3,0,0},{10,3,3,202,0},{11,3,3,0,0},{12,3,3,0,0},{0,4,3,0,0},{1,4,3,0,0},{2,4,3,201,0},{3,4,3,0,0},{4,4,3,0,0},{5,4,3,0,0},{6,4,3,0,0},{7,4,3,0,0},{8,4,3,0,0},{9,4,3,0,0}, + {10,4,3,201,0},{11,4,3,0,0},{12,4,3,0,0},{0,5,3,0,0},{1,5,3,0,0},{2,5,3,202,0},{3,5,3,0,0},{4,5,3,0,0},{5,5,3,0,0},{6,5,3,0,0},{7,5,3,0,0},{8,5,3,0,0},{9,5,3,0,0},{10,5,3,202,0},{11,5,3,0,0},{12,5,3,0,0}, + {0,6,3,0,0},{1,6,3,0,0},{2,6,3,202,0},{3,6,3,0,0},{4,6,3,0,0},{5,6,3,0,0},{6,6,3,0,0},{7,6,3,0,0},{8,6,3,0,0},{9,6,3,0,0},{10,6,3,202,0},{11,6,3,0,0},{12,6,3,0,0},{0,7,3,0,0},{1,7,3,0,0},{2,7,3,202,0}, + {3,7,3,0,0},{5,7,3,0,0},{6,7,3,0,0},{7,7,3,0,0},{8,7,3,0,0},{9,7,3,0,0},{10,7,3,202,0},{11,7,3,0,0},{12,7,3,0,0},{0,0,4,0,0},{1,0,4,0,0},{2,0,4,201,0},{3,0,4,0,0},{4,0,4,0,0},{5,0,4,0,0},{6,0,4,0,0}, + {7,0,4,0,0},{8,0,4,0,0},{9,0,4,0,0},{10,0,4,201,0},{11,0,4,0,0},{12,0,4,0,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,202,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0},{7,1,4,0,0},{8,1,4,0,0},{9,1,4,0,0}, + {10,1,4,202,0},{11,1,4,0,0},{12,1,4,0,0},{0,2,4,0,0},{1,2,4,0,0},{2,2,4,202,0},{3,2,4,0,0},{4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0},{7,2,4,0,0},{8,2,4,0,0},{9,2,4,0,0},{10,2,4,202,0},{11,2,4,0,0},{12,2,4,0,0}, + {0,3,4,0,0},{1,3,4,0,0},{2,3,4,202,0},{3,3,4,0,0},{4,3,4,0,0},{5,3,4,0,0},{6,3,4,0,0},{7,3,4,0,0},{8,3,4,0,0},{10,3,4,202,0},{11,3,4,0,0},{12,3,4,0,0},{0,4,4,0,0},{1,4,4,0,0},{2,4,4,201,0},{3,4,4,0,0}, + {4,4,4,0,0},{5,4,4,0,0},{6,4,4,0,0},{7,4,4,0,0},{8,4,4,0,0},{9,4,4,0,0},{10,4,4,201,0},{11,4,4,0,0},{12,4,4,0,0},{0,5,4,0,0},{1,5,4,0,0},{2,5,4,202,0},{3,5,4,0,0},{4,5,4,0,0},{5,5,4,0,0},{6,5,4,0,0}, + {7,5,4,0,0},{8,5,4,0,0},{9,5,4,0,0},{10,5,4,202,0},{11,5,4,0,0},{12,5,4,0,0},{0,6,4,0,0},{1,6,4,0,0},{2,6,4,202,0},{4,6,4,0,0},{5,6,4,0,0},{6,6,4,0,0},{7,6,4,0,0},{8,6,4,0,0},{9,6,4,0,0},{10,6,4,202,0}, + {11,6,4,0,0},{12,6,4,0,0},{0,7,4,0,0},{1,7,4,0,0},{2,7,4,202,0},{3,7,4,0,0},{4,7,4,0,0},{5,7,4,0,0},{6,7,4,0,0},{7,7,4,0,0},{8,7,4,0,0},{9,7,4,0,0},{10,7,4,202,0},{11,7,4,0,0},{12,7,4,0,0},{0,0,5,0,0}, + {1,0,5,201,0},{2,0,5,0,0},{3,0,5,0,0},{4,0,5,0,0},{5,0,5,0,0},{6,0,5,0,0},{7,0,5,0,0},{8,0,5,0,0},{9,0,5,0,0},{10,0,5,0,0},{11,0,5,201,0},{12,0,5,0,0},{0,1,5,0,0},{1,1,5,202,0},{2,1,5,0,0},{3,1,5,0,0}, + {4,1,5,0,0},{5,1,5,0,0},{6,1,5,0,0},{7,1,5,0,0},{8,1,5,0,0},{9,1,5,0,0},{10,1,5,0,0},{11,1,5,202,0},{12,1,5,0,0},{0,2,5,0,0},{1,2,5,202,0},{2,2,5,0,0},{3,2,5,0,0},{4,2,5,0,0},{5,2,5,0,0},{6,2,5,0,0}, + {7,2,5,0,0},{8,2,5,0,0},{9,2,5,0,0},{10,2,5,0,0},{11,2,5,202,0},{12,2,5,0,0},{0,3,5,0,0},{1,3,5,202,0},{2,3,5,0,0},{3,3,5,0,0},{4,3,5,0,0},{5,3,5,0,0},{6,3,5,0,0},{7,3,5,0,0},{8,3,5,0,0},{9,3,5,0,0}, + {10,3,5,0,0},{11,3,5,202,0},{12,3,5,0,0},{0,4,5,0,0},{1,4,5,201,0},{2,4,5,0,0},{3,4,5,0,0},{4,4,5,0,0},{5,4,5,0,0},{6,4,5,0,0},{7,4,5,0,0},{8,4,5,0,0},{9,4,5,0,0},{11,4,5,201,0},{12,4,5,0,0},{0,5,5,0,0}, + {1,5,5,202,0},{3,5,5,0,0},{4,5,5,0,0},{5,5,5,0,0},{6,5,5,0,0},{7,5,5,0,0},{8,5,5,0,0},{9,5,5,0,0},{10,5,5,0,0},{11,5,5,202,0},{12,5,5,0,0},{0,6,5,0,0},{1,6,5,202,0},{2,6,5,0,0},{3,6,5,0,0},{4,6,5,0,0}, + {5,6,5,0,0},{6,6,5,0,0},{7,6,5,0,0},{8,6,5,0,0},{9,6,5,0,0},{10,6,5,0,0},{11,6,5,202,0},{12,6,5,0,0},{0,7,5,0,0},{1,7,5,201,0},{2,7,5,0,0},{3,7,5,0,0},{4,7,5,0,0},{5,7,5,0,0},{6,7,5,0,0},{7,7,5,0,0}, + {8,7,5,0,0},{9,7,5,0,0},{10,7,5,0,0},{11,7,5,202,0},{12,7,5,0,0},{0,0,6,0,0},{1,0,6,201,0},{2,0,6,0,0},{3,0,6,0,0},{4,0,6,0,0},{5,0,6,0,0},{6,0,6,0,0},{7,0,6,0,0},{8,0,6,0,0},{9,0,6,0,0},{10,0,6,0,0}, + {11,0,6,201,0},{12,0,6,0,0},{0,1,6,0,0},{1,1,6,202,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{7,1,6,0,0},{8,1,6,0,0},{9,1,6,0,0},{10,1,6,0,0},{11,1,6,202,0},{12,1,6,0,0},{1,2,6,202,4}, + {3,2,6,0,0},{4,2,6,0,0},{5,2,6,0,0},{6,2,6,0,0},{7,2,6,0,0},{8,2,6,0,0},{9,2,6,0,0},{11,2,6,202,4},{0,3,6,0,0},{1,3,6,202,0},{2,3,6,0,0},{3,3,6,0,0},{4,3,6,0,0},{5,3,6,0,0},{6,3,6,0,0},{7,3,6,0,0}, + {8,3,6,0,0},{9,3,6,0,0},{10,3,6,0,0},{11,3,6,202,0},{12,3,6,0,0},{0,4,6,0,0},{1,4,6,201,0},{2,4,6,0,0},{3,4,6,0,0},{4,4,6,0,0},{5,4,6,0,0},{6,4,6,0,0},{7,4,6,0,0},{8,4,6,0,0},{9,4,6,0,0},{10,4,6,0,0}, + {11,4,6,201,0},{12,4,6,0,0},{0,5,6,0,0},{1,5,6,202,0},{2,5,6,0,0},{3,5,6,0,0},{4,5,6,0,0},{5,5,6,0,0},{6,5,6,0,0},{7,5,6,0,0},{8,5,6,0,0},{9,5,6,0,0},{10,5,6,0,0},{11,5,6,202,0},{12,5,6,0,0},{1,6,6,202,4}, + {2,6,6,0,0},{3,6,6,0,0},{4,6,6,0,0},{5,6,6,0,0},{6,6,6,0,0},{7,6,6,0,0},{8,6,6,0,0},{9,6,6,0,0},{10,6,6,0,0},{11,6,6,202,4},{0,7,6,202,4},{1,7,6,201,0},{2,7,6,0,0},{3,7,6,0,0},{4,7,6,0,0},{5,7,6,0,0}, + {6,7,6,0,0},{7,7,6,0,0},{8,7,6,0,0},{9,7,6,0,0},{10,7,6,0,0},{11,7,6,202,0},{12,7,6,0,0},{0,0,7,0,0},{1,0,7,201,0},{2,0,7,0,0},{3,0,7,0,0},{4,0,7,0,0},{5,0,7,0,0},{6,0,7,0,0},{7,0,7,0,0},{8,0,7,0,0}, + {9,0,7,0,0},{10,0,7,0,0},{11,0,7,201,0},{12,0,7,0,0},{0,1,7,0,0},{1,1,7,202,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{6,1,7,0,0},{7,1,7,0,0},{8,1,7,0,0},{9,1,7,0,0},{10,1,7,0,0},{11,1,7,202,0}, + {12,1,7,0,0},{0,2,7,0,0},{1,2,7,202,0},{2,2,7,0,0},{3,2,7,0,0},{4,2,7,0,0},{5,2,7,0,0},{6,2,7,0,0},{7,2,7,0,0},{8,2,7,0,0},{9,2,7,0,0},{10,2,7,0,0},{11,2,7,202,0},{12,2,7,0,0},{0,3,7,0,0},{1,3,7,202,0}, + {2,3,7,0,0},{3,3,7,0,0},{4,3,7,0,0},{5,3,7,0,0},{6,3,7,0,0},{7,3,7,0,0},{8,3,7,0,0},{9,3,7,0,0},{10,3,7,0,0},{11,3,7,202,0},{12,3,7,0,0},{0,4,7,0,0},{1,4,7,201,0},{3,4,7,0,0},{4,4,7,0,0},{5,4,7,0,0}, + {6,4,7,0,0},{7,4,7,0,0},{8,4,7,0,0},{9,4,7,0,0},{10,4,7,0,0},{11,4,7,201,0},{12,4,7,0,0},{0,5,7,0,0},{1,5,7,202,0},{2,5,7,0,0},{3,5,7,0,0},{4,5,7,0,0},{5,5,7,0,0},{6,5,7,0,0},{7,5,7,0,0},{8,5,7,0,0}, + {9,5,7,0,0},{11,5,7,202,0},{12,5,7,0,0},{0,6,7,0,0},{1,6,7,202,0},{2,6,7,0,0},{3,6,7,0,0},{4,6,7,0,0},{5,6,7,0,0},{6,6,7,0,0},{7,6,7,0,0},{8,6,7,0,0},{9,6,7,0,0},{10,6,7,0,0},{11,6,7,202,0},{12,6,7,0,0}, + {0,7,7,0,0},{1,7,7,201,0},{2,7,7,0,0},{3,7,7,0,0},{4,7,7,0,0},{5,7,7,0,0},{6,7,7,0,0},{7,7,7,0,0},{8,7,7,0,0},{9,7,7,0,0},{10,7,7,0,0},{11,7,7,202,0},{12,7,7,0,0},{0,0,8,0,0},{1,0,8,0,0},{2,0,8,201,0}, + {3,0,8,0,0},{4,0,8,0,0},{5,0,8,0,0},{6,0,8,0,0},{7,0,8,0,0},{8,0,8,0,0},{9,0,8,0,0},{10,0,8,201,0},{11,0,8,0,0},{12,0,8,0,0},{0,1,8,0,0},{1,1,8,0,0},{2,1,8,202,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0}, + {6,1,8,0,0},{7,1,8,0,0},{8,1,8,0,0},{9,1,8,0,0},{10,1,8,202,0},{11,1,8,0,0},{12,1,8,0,0},{0,2,8,0,0},{1,2,8,0,0},{2,2,8,202,0},{3,2,8,0,0},{4,2,8,0,0},{5,2,8,0,0},{6,2,8,0,0},{7,2,8,0,0},{8,2,8,0,0}, + {9,2,8,0,0},{10,2,8,202,0},{11,2,8,0,0},{12,2,8,0,0},{0,3,8,0,0},{1,3,8,0,0},{2,3,8,202,0},{4,3,8,0,0},{5,3,8,0,0},{6,3,8,0,0},{7,3,8,0,0},{8,3,8,0,0},{9,3,8,0,0},{10,3,8,202,0},{11,3,8,0,0},{12,3,8,0,0}, + {0,4,8,0,0},{1,4,8,0,0},{2,4,8,201,0},{3,4,8,0,0},{4,4,8,0,0},{5,4,8,0,0},{6,4,8,0,0},{7,4,8,0,0},{8,4,8,0,0},{9,4,8,0,0},{10,4,8,201,0},{11,4,8,0,0},{12,4,8,0,0},{0,5,8,0,0},{1,5,8,0,0},{2,5,8,202,0}, + {3,5,8,0,0},{4,5,8,0,0},{5,5,8,0,0},{6,5,8,0,0},{7,5,8,0,0},{8,5,8,0,0},{9,5,8,0,0},{10,5,8,202,0},{11,5,8,0,0},{12,5,8,0,0},{0,6,8,0,0},{1,6,8,0,0},{2,6,8,202,0},{3,6,8,0,0},{4,6,8,0,0},{5,6,8,0,0}, + {6,6,8,0,0},{7,6,8,0,0},{8,6,8,0,0},{10,6,8,202,0},{11,6,8,0,0},{12,6,8,0,0},{0,7,8,0,0},{1,7,8,0,0},{2,7,8,202,0},{3,7,8,0,0},{4,7,8,0,0},{5,7,8,0,0},{6,7,8,0,0},{7,7,8,0,0},{8,7,8,0,0},{9,7,8,0,0}, + {10,7,8,202,0},{11,7,8,0,0},{12,7,8,0,0},{0,0,9,0,0},{1,0,9,0,0},{2,0,9,201,0},{3,0,9,0,0},{4,0,9,0,0},{5,0,9,0,0},{6,0,9,0,0},{7,0,9,0,0},{8,0,9,0,0},{9,0,9,0,0},{10,0,9,201,0},{11,0,9,0,0},{12,0,9,0,0}, + {0,1,9,0,0},{1,1,9,0,0},{2,1,9,202,0},{3,1,9,0,0},{4,1,9,0,0},{5,1,9,0,0},{6,1,9,0,0},{7,1,9,0,0},{8,1,9,0,0},{9,1,9,0,0},{10,1,9,202,0},{11,1,9,0,0},{12,1,9,0,0},{0,2,9,0,0},{1,2,9,0,0},{2,2,9,202,0}, + {3,2,9,0,0},{5,2,9,0,0},{6,2,9,0,0},{7,2,9,0,0},{8,2,9,0,0},{9,2,9,0,0},{10,2,9,202,0},{11,2,9,0,0},{12,2,9,0,0},{0,3,9,0,0},{1,3,9,0,0},{2,3,9,202,0},{3,3,9,0,0},{4,3,9,0,0},{5,3,9,0,0},{6,3,9,0,0}, + {7,3,9,0,0},{8,3,9,0,0},{9,3,9,0,0},{10,3,9,202,0},{11,3,9,0,0},{12,3,9,0,0},{0,4,9,0,0},{1,4,9,0,0},{2,4,9,201,0},{3,4,9,0,0},{4,4,9,0,0},{5,4,9,0,0},{6,4,9,0,0},{7,4,9,0,0},{8,4,9,0,0},{9,4,9,0,0}, + {10,4,9,201,0},{11,4,9,0,0},{12,4,9,0,0},{0,5,9,0,0},{1,5,9,0,0},{2,5,9,202,0},{3,5,9,0,0},{4,5,9,0,0},{5,5,9,0,0},{6,5,9,0,0},{7,5,9,0,0},{8,5,9,0,0},{9,5,9,0,0},{10,5,9,202,0},{11,5,9,0,0},{12,5,9,0,0}, + {0,6,9,0,0},{1,6,9,0,0},{2,6,9,202,0},{3,6,9,0,0},{4,6,9,0,0},{5,6,9,0,0},{6,6,9,0,0},{7,6,9,0,0},{8,6,9,0,0},{9,6,9,0,0},{10,6,9,202,0},{11,6,9,0,0},{12,6,9,0,0},{0,7,9,0,0},{1,7,9,0,0},{2,7,9,202,0}, + {3,7,9,0,0},{4,7,9,0,0},{5,7,9,0,0},{6,7,9,0,0},{7,7,9,0,0},{9,7,9,0,0},{10,7,9,202,0},{11,7,9,0,0},{12,7,9,0,0},{0,0,10,0,0},{1,0,10,0,0},{2,0,10,0,0},{3,0,10,201,0},{4,0,10,201,0},{5,0,10,0,0},{6,0,10,0,0}, + {8,0,10,201,0},{9,0,10,201,0},{10,0,10,0,0},{11,0,10,0,0},{12,0,10,0,0},{0,1,10,0,0},{1,1,10,0,0},{2,1,10,0,0},{3,1,10,202,0},{4,1,10,202,0},{6,1,10,0,0},{7,1,10,0,0},{8,1,10,202,0},{9,1,10,202,0},{10,1,10,0,0},{11,1,10,0,0}, + {12,1,10,0,0},{0,2,10,0,0},{1,2,10,0,0},{2,2,10,0,0},{3,2,10,202,0},{4,2,10,202,0},{5,2,10,0,0},{6,2,10,0,0},{7,2,10,0,0},{8,2,10,202,0},{9,2,10,202,0},{10,2,10,0,0},{11,2,10,0,0},{12,2,10,0,0},{0,3,10,0,0},{1,3,10,0,0}, + {2,3,10,0,0},{3,3,10,202,0},{4,3,10,202,0},{5,3,10,0,0},{6,3,10,0,0},{7,3,10,0,0},{8,3,10,202,0},{9,3,10,202,0},{10,3,10,0,0},{11,3,10,0,0},{12,3,10,0,0},{0,4,10,0,0},{1,4,10,0,0},{2,4,10,0,0},{3,4,10,201,0},{4,4,10,201,0}, + {5,4,10,0,0},{6,4,10,0,0},{7,4,10,0,0},{8,4,10,201,0},{9,4,10,201,0},{10,4,10,0,0},{11,4,10,0,0},{12,4,10,0,0},{0,5,10,0,0},{1,5,10,0,0},{2,5,10,0,0},{3,5,10,202,0},{4,5,10,202,0},{5,5,10,0,0},{6,5,10,0,0},{7,5,10,0,0}, + {8,5,10,202,0},{9,5,10,202,0},{10,5,10,0,0},{11,5,10,0,0},{12,5,10,0,0},{0,6,10,0,0},{1,6,10,0,0},{2,6,10,0,0},{3,6,10,202,0},{4,6,10,202,0},{5,6,10,0,0},{7,6,10,0,0},{8,6,10,202,0},{9,6,10,202,0},{10,6,10,0,0},{11,6,10,0,0}, + {12,6,10,0,0},{0,7,10,0,0},{1,7,10,0,0},{2,7,10,0,0},{3,7,10,202,0},{4,7,10,202,0},{5,7,10,0,0},{6,7,10,0,0},{7,7,10,0,0},{8,7,10,202,0},{9,7,10,202,0},{10,7,10,0,0},{11,7,10,0,0},{12,7,10,0,0},{0,0,11,0,0},{1,0,11,0,0}, + {2,0,11,0,0},{3,0,11,0,0},{4,0,11,0,0},{5,0,11,201,0},{6,0,11,201,0},{7,0,11,201,0},{8,0,11,0,0},{9,0,11,0,0},{10,0,11,0,0},{11,0,11,0,0},{12,0,11,0,0},{0,1,11,0,0},{1,1,11,0,0},{2,1,11,0,0},{3,1,11,0,0},{4,1,11,0,0}, + {5,1,11,202,0},{6,1,11,202,0},{7,1,11,202,0},{8,1,11,0,0},{9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0},{12,1,11,0,0},{0,2,11,0,0},{1,2,11,0,0},{2,2,11,0,0},{3,2,11,0,0},{4,2,11,0,0},{5,2,11,202,0},{6,2,11,202,8},{7,2,11,202,0}, + {8,2,11,0,0},{9,2,11,0,0},{10,2,11,0,0},{11,2,11,0,0},{12,2,11,0,0},{0,3,11,0,0},{1,3,11,0,0},{2,3,11,0,0},{3,3,11,0,0},{4,3,11,0,0},{5,3,11,202,0},{6,3,11,202,0},{7,3,11,202,0},{8,3,11,0,0},{9,3,11,0,0},{10,3,11,0,0}, + {11,3,11,0,0},{12,3,11,0,0},{0,4,11,0,0},{1,4,11,0,0},{2,4,11,0,0},{3,4,11,0,0},{4,4,11,0,0},{5,4,11,201,0},{6,4,11,201,0},{7,4,11,201,0},{8,4,11,0,0},{9,4,11,0,0},{10,4,11,0,0},{11,4,11,0,0},{12,4,11,0,0},{0,5,11,0,0}, + {1,5,11,0,0},{2,5,11,0,0},{3,5,11,0,0},{4,5,11,0,0},{5,5,11,202,0},{6,5,11,202,0},{7,5,11,202,0},{8,5,11,0,0},{9,5,11,0,0},{10,5,11,0,0},{11,5,11,0,0},{12,5,11,0,0},{0,6,11,0,0},{1,6,11,0,0},{2,6,11,0,0},{3,6,11,0,0}, + {4,6,11,0,0},{5,6,11,202,0},{6,6,11,202,8},{7,6,11,202,0},{8,6,11,0,0},{9,6,11,0,0},{10,6,11,0,0},{11,6,11,0,0},{12,6,11,0,0},{0,7,11,0,0},{1,7,11,0,0},{2,7,11,0,0},{3,7,11,0,0},{4,7,11,0,0},{5,7,11,202,0},{6,7,11,202,0}, + {7,7,11,202,0},{8,7,11,0,0},{9,7,11,0,0},{10,7,11,0,0},{11,7,11,0,0},{12,7,11,0,0},{0,0,12,0,0},{1,0,12,0,0},{2,0,12,0,0},{3,0,12,0,0},{4,0,12,0,0},{5,0,12,0,0},{6,0,12,0,0},{7,0,12,0,0},{8,0,12,0,0},{9,0,12,0,0}, + {10,0,12,0,0},{11,0,12,0,0},{12,0,12,0,0},{0,1,12,0,0},{1,1,12,0,0},{2,1,12,0,0},{3,1,12,0,0},{4,1,12,0,0},{5,1,12,0,0},{6,1,12,0,0},{7,1,12,0,0},{8,1,12,0,0},{9,1,12,0,0},{10,1,12,0,0},{11,1,12,0,0},{12,1,12,0,0}, + {0,2,12,0,0},{1,2,12,0,0},{2,2,12,0,0},{3,2,12,0,0},{4,2,12,0,0},{5,2,12,0,0},{7,2,12,0,0},{8,2,12,0,0},{9,2,12,0,0},{10,2,12,0,0},{11,2,12,0,0},{12,2,12,0,0},{0,3,12,0,0},{1,3,12,0,0},{2,3,12,0,0},{3,3,12,0,0}, + {4,3,12,0,0},{5,3,12,0,0},{6,3,12,0,0},{7,3,12,0,0},{8,3,12,0,0},{9,3,12,0,0},{10,3,12,0,0},{11,3,12,0,0},{12,3,12,0,0},{0,4,12,0,0},{1,4,12,0,0},{2,4,12,0,0},{3,4,12,0,0},{4,4,12,0,0},{5,4,12,0,0},{6,4,12,0,0}, + {7,4,12,0,0},{8,4,12,0,0},{9,4,12,0,0},{10,4,12,0,0},{11,4,12,0,0},{12,4,12,0,0},{0,5,12,0,0},{1,5,12,0,0},{2,5,12,0,0},{3,5,12,0,0},{4,5,12,0,0},{5,5,12,0,0},{6,5,12,0,0},{7,5,12,0,0},{8,5,12,0,0},{9,5,12,0,0}, + {10,5,12,0,0},{11,5,12,0,0},{12,5,12,0,0},{0,6,12,0,0},{1,6,12,0,0},{2,6,12,0,0},{3,6,12,0,0},{4,6,12,0,0},{5,6,12,0,0},{7,6,12,0,0},{8,6,12,0,0},{9,6,12,0,0},{10,6,12,0,0},{11,6,12,0,0},{12,6,12,0,0},{0,7,12,0,0}, + {1,7,12,0,0},{2,7,12,0,0},{3,7,12,0,0},{4,7,12,0,0},{5,7,12,0,0},{6,7,12,0,0},{7,7,12,0,0},{8,7,12,0,0},{9,7,12,0,0},{10,7,12,0,0},{11,7,12,0,0},{12,7,12,0,0},{6,2,0,203,6},{6,6,0,203,6},{5,0,2,205,0},{7,1,2,205,0}, + {8,2,3,198,3},{4,7,3,198,3},{9,3,4,198,4},{3,6,4,198,5},{10,4,5,205,0},{2,5,5,205,0},{0,2,6,203,4},{12,2,6,203,5},{0,6,6,203,4},{12,6,6,203,5},{2,4,7,205,0},{10,5,7,205,0},{3,3,8,198,5},{9,6,8,198,4},{4,2,9,198,2},{8,7,9,198,2}, + {7,0,10,205,0},{5,1,10,205,0},{6,2,12,203,7},{6,6,12,203,7}, +}; +static const EndCityTemplates::Extra s_fat_tower_middle_extras[] = { + {6,6,2,EndCityTemplates::EXTRA_SENTRY,0},{2,2,6,EndCityTemplates::EXTRA_SENTRY,0},{10,2,6,EndCityTemplates::EXTRA_SENTRY,0},{6,6,10,EndCityTemplates::EXTRA_SENTRY,0}, +}; + +static const EndCityTemplates::Block s_fat_tower_top_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{7,0,0,0,0},{8,0,0,0,0},{9,0,0,0,0},{10,0,0,0,0},{11,0,0,0,0},{12,0,0,0,0},{13,0,0,0,0},{14,0,0,0,0},{15,0,0,0,0}, + {16,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{12,1,0,0,0},{13,1,0,0,0},{14,1,0,0,0}, + {15,1,0,0,0},{16,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,0,0},{5,2,0,0,0},{6,2,0,0,0},{7,2,0,0,0},{8,2,0,0,0},{9,2,0,0,0},{10,2,0,0,0},{11,2,0,0,0},{12,2,0,0,0},{13,2,0,0,0}, + {14,2,0,0,0},{15,2,0,0,0},{16,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0},{6,3,0,0,0},{7,3,0,0,0},{8,3,0,0,0},{9,3,0,0,0},{10,3,0,0,0},{11,3,0,0,0},{12,3,0,0,0}, + {13,3,0,0,0},{14,3,0,0,0},{15,3,0,0,0},{16,3,0,0,0},{0,5,0,0,0},{1,5,0,0,0},{2,5,0,0,0},{3,5,0,0,0},{4,5,0,0,0},{5,5,0,0,0},{6,5,0,0,0},{7,5,0,0,0},{8,5,0,0,0},{9,5,0,0,0},{10,5,0,0,0},{11,5,0,0,0}, + {12,5,0,0,0},{13,5,0,0,0},{14,5,0,0,0},{15,5,0,0,0},{16,5,0,0,0},{0,0,1,0,0},{16,0,1,0,0},{0,1,1,0,0},{2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0},{7,1,1,0,0},{8,1,1,0,0},{9,1,1,0,0}, + {10,1,1,0,0},{11,1,1,0,0},{12,1,1,0,0},{13,1,1,0,0},{14,1,1,0,0},{16,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0},{4,2,1,0,0},{5,2,1,0,0},{6,2,1,0,0},{7,2,1,0,0},{8,2,1,0,0},{9,2,1,0,0}, + {10,2,1,0,0},{11,2,1,0,0},{12,2,1,0,0},{13,2,1,0,0},{14,2,1,0,0},{15,2,1,0,0},{16,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,0,0},{3,3,1,0,0},{4,3,1,0,0},{5,3,1,0,0},{6,3,1,0,0},{7,3,1,0,0},{8,3,1,0,0}, + {9,3,1,0,0},{10,3,1,0,0},{11,3,1,0,0},{12,3,1,0,0},{13,3,1,0,0},{14,3,1,0,0},{15,3,1,0,0},{16,3,1,0,0},{1,4,1,201,0},{2,4,1,201,0},{3,4,1,201,0},{4,4,1,201,0},{5,4,1,201,0},{6,4,1,201,0},{7,4,1,201,0},{8,4,1,201,0}, + {9,4,1,201,0},{10,4,1,201,0},{11,4,1,201,0},{12,4,1,201,0},{13,4,1,201,0},{14,4,1,201,0},{15,4,1,201,0},{0,5,1,0,0},{1,5,1,0,0},{2,5,1,0,0},{3,5,1,0,0},{4,5,1,0,0},{5,5,1,0,0},{6,5,1,0,0},{7,5,1,0,0},{8,5,1,0,0}, + {9,5,1,0,0},{10,5,1,0,0},{11,5,1,0,0},{12,5,1,0,0},{13,5,1,0,0},{14,5,1,0,0},{15,5,1,0,0},{16,5,1,0,0},{0,0,2,0,0},{2,0,2,201,0},{3,0,2,201,0},{4,0,2,201,0},{5,0,2,201,0},{6,0,2,201,0},{7,0,2,201,0},{8,0,2,201,0}, + {9,0,2,201,0},{10,0,2,201,0},{11,0,2,201,0},{12,0,2,201,0},{13,0,2,201,0},{14,0,2,201,0},{16,0,2,0,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,202,0},{3,1,2,206,0},{4,1,2,206,0},{5,1,2,206,0},{6,1,2,206,0},{7,1,2,206,0},{8,1,2,206,0}, + {9,1,2,206,0},{10,1,2,206,0},{11,1,2,206,0},{12,1,2,206,0},{13,1,2,206,0},{14,1,2,202,0},{15,1,2,0,0},{16,1,2,0,0},{0,2,2,0,0},{1,2,2,0,0},{2,2,2,202,0},{3,2,2,206,0},{5,2,2,206,0},{6,2,2,206,0},{8,2,2,206,0},{9,2,2,206,0}, + {10,2,2,206,0},{11,2,2,206,0},{12,2,2,206,0},{13,2,2,206,0},{14,2,2,202,0},{15,2,2,0,0},{16,2,2,0,0},{0,3,2,0,0},{1,3,2,0,0},{2,3,2,202,0},{3,3,2,206,0},{5,3,2,206,0},{6,3,2,206,0},{8,3,2,206,0},{9,3,2,206,0},{10,3,2,206,0}, + {11,3,2,206,0},{12,3,2,206,0},{13,3,2,206,0},{14,3,2,202,0},{15,3,2,0,0},{16,3,2,0,0},{1,4,2,201,0},{2,4,2,201,0},{3,4,2,201,0},{4,4,2,201,0},{5,4,2,201,0},{6,4,2,201,0},{7,4,2,201,0},{8,4,2,201,0},{9,4,2,201,0},{10,4,2,201,0}, + {11,4,2,201,0},{12,4,2,201,0},{13,4,2,201,0},{14,4,2,201,0},{15,4,2,201,0},{0,5,2,0,0},{1,5,2,0,0},{2,5,2,0,0},{3,5,2,0,0},{4,5,2,0,0},{5,5,2,0,0},{6,5,2,0,0},{12,5,2,0,0},{13,5,2,0,0},{14,5,2,0,0},{15,5,2,0,0}, + {16,5,2,0,0},{0,0,3,0,0},{2,0,3,201,0},{3,0,3,201,0},{4,0,3,201,0},{5,0,3,201,0},{6,0,3,201,0},{7,0,3,201,0},{8,0,3,201,0},{9,0,3,201,0},{10,0,3,201,0},{11,0,3,201,0},{12,0,3,201,0},{13,0,3,201,0},{14,0,3,201,0},{16,0,3,0,0}, + {0,1,3,0,0},{1,1,3,0,0},{2,1,3,206,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{8,1,3,201,0},{10,1,3,0,0},{11,1,3,0,0},{12,1,3,0,0},{13,1,3,0,0},{14,1,3,206,0},{15,1,3,0,0},{16,1,3,0,0},{0,2,3,0,0}, + {1,2,3,0,0},{2,2,3,206,0},{3,2,3,0,0},{4,2,3,0,0},{5,2,3,0,0},{6,2,3,0,0},{7,2,3,0,0},{8,2,3,0,0},{10,2,3,201,0},{12,2,3,0,0},{13,2,3,0,0},{14,2,3,206,0},{15,2,3,0,0},{16,2,3,0,0},{0,3,3,0,0},{1,3,3,0,0}, + {2,3,3,206,0},{3,3,3,0,0},{4,3,3,0,0},{5,3,3,0,0},{6,3,3,0,0},{7,3,3,0,0},{8,3,3,0,0},{9,3,3,0,0},{10,3,3,0,0},{12,3,3,201,0},{14,3,3,206,0},{15,3,3,0,0},{16,3,3,0,0},{1,4,3,201,0},{2,4,3,201,0},{3,4,3,201,0}, + {4,4,3,201,0},{5,4,3,201,0},{6,4,3,201,0},{7,4,3,201,0},{8,4,3,0,0},{9,4,3,0,0},{10,4,3,0,0},{11,4,3,0,0},{12,4,3,0,0},{14,4,3,201,0},{15,4,3,201,0},{0,5,3,0,0},{1,5,3,0,0},{2,5,3,0,0},{3,5,3,0,0},{4,5,3,0,0}, + {5,5,3,0,0},{6,5,3,0,0},{8,5,3,0,0},{9,5,3,0,0},{10,5,3,0,0},{11,5,3,0,0},{12,5,3,0,0},{13,5,3,0,0},{14,5,3,0,0},{15,5,3,0,0},{16,5,3,0,0},{0,0,4,0,0},{2,0,4,201,0},{3,0,4,201,0},{4,0,4,201,0},{5,0,4,201,0}, + {6,0,4,201,0},{8,0,4,0,0},{9,0,4,201,0},{10,0,4,201,0},{11,0,4,201,0},{12,0,4,201,0},{13,0,4,201,0},{14,0,4,201,0},{16,0,4,0,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,206,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0}, + {7,1,4,0,0},{8,1,4,0,0},{9,1,4,0,0},{10,1,4,0,0},{11,1,4,0,0},{12,1,4,0,0},{13,1,4,0,0},{14,1,4,206,0},{15,1,4,0,0},{16,1,4,0,0},{0,2,4,0,0},{1,2,4,0,0},{3,2,4,0,0},{4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0}, + {7,2,4,0,0},{8,2,4,0,0},{9,2,4,0,0},{10,2,4,0,0},{11,2,4,0,0},{12,2,4,0,0},{13,2,4,0,0},{14,2,4,206,0},{15,2,4,0,0},{16,2,4,0,0},{0,3,4,0,0},{1,3,4,0,0},{3,3,4,0,0},{4,3,4,0,0},{5,3,4,0,0},{6,3,4,0,0}, + {7,3,4,0,0},{8,3,4,0,0},{9,3,4,0,0},{10,3,4,0,0},{11,3,4,0,0},{12,3,4,0,0},{13,3,4,0,0},{14,3,4,206,0},{15,3,4,0,0},{16,3,4,0,0},{1,4,4,201,0},{2,4,4,201,0},{3,4,4,201,0},{4,4,4,201,0},{5,4,4,201,0},{6,4,4,201,0}, + {7,4,4,201,0},{8,4,4,201,0},{9,4,4,201,0},{10,4,4,201,0},{11,4,4,201,0},{12,4,4,201,0},{13,4,4,201,0},{14,4,4,201,0},{15,4,4,201,0},{0,5,4,0,0},{1,5,4,0,0},{2,5,4,0,0},{3,5,4,0,0},{4,5,4,0,0},{5,5,4,0,0},{6,5,4,0,0}, + {12,5,4,0,0},{13,5,4,0,0},{14,5,4,0,0},{15,5,4,0,0},{16,5,4,0,0},{0,0,5,0,0},{2,0,5,201,0},{3,0,5,201,0},{4,0,5,201,0},{5,0,5,0,0},{6,0,5,0,0},{7,0,5,0,0},{8,0,5,0,0},{9,0,5,201,0},{10,0,5,201,0},{11,0,5,201,0}, + {12,0,5,201,0},{13,0,5,201,0},{14,0,5,201,0},{16,0,5,0,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,206,0},{3,1,5,0,0},{4,1,5,0,0},{5,1,5,0,0},{6,1,5,0,0},{7,1,5,0,0},{8,1,5,0,0},{9,1,5,0,0},{10,1,5,0,0},{11,1,5,0,0}, + {12,1,5,0,0},{13,1,5,0,0},{14,1,5,206,0},{15,1,5,0,0},{16,1,5,0,0},{0,2,5,0,0},{1,2,5,0,0},{2,2,5,206,0},{3,2,5,0,0},{4,2,5,0,0},{5,2,5,0,0},{6,2,5,0,0},{7,2,5,0,0},{8,2,5,0,0},{9,2,5,0,0},{10,2,5,0,0}, + {11,2,5,0,0},{12,2,5,0,0},{13,2,5,0,0},{14,2,5,206,0},{15,2,5,0,0},{16,2,5,0,0},{0,3,5,0,0},{1,3,5,0,0},{2,3,5,206,0},{3,3,5,0,0},{4,3,5,0,0},{5,3,5,0,0},{6,3,5,0,0},{7,3,5,0,0},{8,3,5,0,0},{9,3,5,0,0}, + {10,3,5,0,0},{11,3,5,0,0},{12,3,5,0,0},{13,3,5,0,0},{14,3,5,206,0},{15,3,5,0,0},{16,3,5,0,0},{1,4,5,201,0},{2,4,5,201,0},{3,4,5,201,0},{4,4,5,201,0},{5,4,5,201,0},{6,4,5,201,0},{7,4,5,201,0},{8,4,5,201,0},{9,4,5,201,0}, + {10,4,5,201,0},{11,4,5,201,0},{12,4,5,201,0},{13,4,5,201,0},{14,4,5,201,0},{15,4,5,201,0},{0,5,5,0,0},{1,5,5,0,0},{2,5,5,0,0},{3,5,5,0,0},{4,5,5,0,0},{5,5,5,0,0},{6,5,5,0,0},{7,5,5,0,0},{8,5,5,0,0},{9,5,5,0,0}, + {10,5,5,0,0},{11,5,5,0,0},{12,5,5,0,0},{13,5,5,0,0},{14,5,5,0,0},{15,5,5,0,0},{16,5,5,0,0},{0,0,6,0,0},{2,0,6,201,0},{3,0,6,201,0},{4,0,6,201,0},{5,0,6,0,0},{6,0,6,0,0},{7,0,6,0,0},{8,0,6,0,0},{9,0,6,201,0}, + {10,0,6,201,0},{11,0,6,201,0},{12,0,6,201,0},{13,0,6,201,0},{14,0,6,201,0},{16,0,6,0,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,206,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{7,1,6,0,0},{8,1,6,0,0},{9,1,6,0,0}, + {10,1,6,0,0},{11,1,6,0,0},{12,1,6,0,0},{13,1,6,0,0},{14,1,6,206,0},{15,1,6,0,0},{16,1,6,0,0},{0,2,6,0,0},{1,2,6,0,0},{2,2,6,206,0},{3,2,6,0,0},{4,2,6,0,0},{5,2,6,0,0},{6,2,6,0,0},{7,2,6,0,0},{8,2,6,0,0}, + {9,2,6,0,0},{10,2,6,0,0},{11,2,6,0,0},{12,2,6,0,0},{13,2,6,0,0},{14,2,6,206,0},{15,2,6,0,0},{16,2,6,0,0},{0,3,6,0,0},{1,3,6,0,0},{2,3,6,206,0},{3,3,6,0,0},{4,3,6,0,0},{5,3,6,0,0},{6,3,6,0,0},{7,3,6,0,0}, + {8,3,6,0,0},{9,3,6,0,0},{10,3,6,0,0},{11,3,6,0,0},{12,3,6,0,0},{13,3,6,0,0},{14,3,6,206,0},{15,3,6,0,0},{16,3,6,0,0},{1,4,6,201,0},{2,4,6,201,0},{3,4,6,201,0},{4,4,6,201,0},{5,4,6,201,0},{6,4,6,201,0},{7,4,6,201,0}, + {8,4,6,201,0},{9,4,6,201,0},{10,4,6,201,0},{11,4,6,201,0},{12,4,6,201,0},{13,4,6,201,0},{14,4,6,201,0},{15,4,6,201,0},{0,5,6,0,0},{1,5,6,0,0},{2,5,6,0,0},{3,5,6,0,0},{4,5,6,0,0},{5,5,6,0,0},{6,5,6,0,0},{7,5,6,0,0}, + {8,5,6,0,0},{9,5,6,0,0},{10,5,6,0,0},{11,5,6,0,0},{12,5,6,0,0},{13,5,6,0,0},{14,5,6,0,0},{15,5,6,0,0},{16,5,6,0,0},{0,0,7,0,0},{2,0,7,201,0},{3,0,7,201,0},{4,0,7,0,0},{5,0,7,0,0},{6,0,7,0,0},{7,0,7,0,0}, + {8,0,7,0,0},{9,0,7,201,0},{10,0,7,201,0},{11,0,7,201,0},{12,0,7,201,0},{13,0,7,201,0},{14,0,7,201,0},{16,0,7,0,0},{0,1,7,0,0},{1,1,7,0,0},{2,1,7,206,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{6,1,7,0,0},{7,1,7,0,0}, + {8,1,7,0,0},{9,1,7,202,0},{10,1,7,0,0},{11,1,7,0,0},{12,1,7,0,0},{13,1,7,0,0},{14,1,7,206,0},{15,1,7,0,0},{16,1,7,0,0},{0,2,7,0,0},{1,2,7,0,0},{3,2,7,0,0},{4,2,7,0,0},{5,2,7,0,0},{6,2,7,0,0},{7,2,7,0,0}, + {8,2,7,0,0},{9,2,7,202,0},{10,2,7,0,0},{11,2,7,0,0},{12,2,7,0,0},{13,2,7,0,0},{15,2,7,0,0},{16,2,7,0,0},{0,3,7,0,0},{1,3,7,0,0},{3,3,7,0,0},{4,3,7,0,0},{5,3,7,0,0},{6,3,7,0,0},{7,3,7,0,0},{8,3,7,0,0}, + {9,3,7,202,0},{10,3,7,0,0},{11,3,7,0,0},{12,3,7,0,0},{13,3,7,0,0},{15,3,7,0,0},{16,3,7,0,0},{1,4,7,201,0},{2,4,7,201,0},{3,4,7,201,0},{4,4,7,201,0},{5,4,7,201,0},{6,4,7,201,0},{7,4,7,201,0},{8,4,7,201,0},{9,4,7,201,0}, + {10,4,7,201,0},{11,4,7,201,0},{12,4,7,201,0},{13,4,7,201,0},{14,4,7,201,0},{15,4,7,201,0},{0,5,7,0,0},{1,5,7,0,0},{2,5,7,0,0},{3,5,7,0,0},{4,5,7,0,0},{5,5,7,0,0},{6,5,7,0,0},{7,5,7,0,0},{8,5,7,0,0},{9,5,7,0,0}, + {10,5,7,0,0},{11,5,7,0,0},{12,5,7,0,0},{13,5,7,0,0},{14,5,7,0,0},{15,5,7,0,0},{16,5,7,0,0},{0,0,8,0,0},{2,0,8,201,0},{3,0,8,201,0},{4,0,8,0,0},{5,0,8,0,0},{6,0,8,0,0},{7,0,8,0,0},{8,0,8,0,0},{9,0,8,0,0}, + {10,0,8,0,0},{11,0,8,0,0},{12,0,8,0,0},{13,0,8,201,0},{14,0,8,201,0},{16,0,8,0,0},{0,1,8,0,0},{1,1,8,0,0},{2,1,8,206,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,0,0},{7,1,8,0,0},{8,1,8,0,0},{9,1,8,0,0}, + {10,1,8,0,0},{11,1,8,0,0},{12,1,8,0,0},{13,1,8,0,0},{14,1,8,206,0},{15,1,8,0,0},{16,1,8,0,0},{0,2,8,0,0},{1,2,8,0,0},{2,2,8,206,0},{3,2,8,0,0},{4,2,8,0,0},{5,2,8,0,0},{6,2,8,0,0},{7,2,8,0,0},{8,2,8,0,0}, + {9,2,8,0,0},{10,2,8,0,0},{11,2,8,0,0},{12,2,8,0,0},{13,2,8,0,0},{14,2,8,206,0},{15,2,8,0,0},{16,2,8,0,0},{0,3,8,0,0},{1,3,8,0,0},{2,3,8,206,0},{3,3,8,0,0},{4,3,8,0,0},{5,3,8,0,0},{6,3,8,0,0},{7,3,8,0,0}, + {8,3,8,0,0},{9,3,8,0,0},{10,3,8,0,0},{11,3,8,0,0},{12,3,8,0,0},{13,3,8,0,0},{14,3,8,206,0},{15,3,8,0,0},{16,3,8,0,0},{1,4,8,201,0},{2,4,8,201,0},{3,4,8,201,0},{4,4,8,201,0},{5,4,8,201,0},{6,4,8,201,0},{7,4,8,201,0}, + {8,4,8,201,0},{9,4,8,201,0},{10,4,8,201,0},{11,4,8,201,0},{12,4,8,201,0},{13,4,8,201,0},{14,4,8,201,0},{15,4,8,201,0},{0,5,8,0,0},{1,5,8,0,0},{2,5,8,0,0},{3,5,8,0,0},{4,5,8,0,0},{5,5,8,0,0},{6,5,8,0,0},{7,5,8,0,0}, + {8,5,8,0,0},{9,5,8,0,0},{10,5,8,0,0},{11,5,8,0,0},{12,5,8,0,0},{13,5,8,0,0},{14,5,8,0,0},{15,5,8,0,0},{16,5,8,0,0},{0,0,9,0,0},{2,0,9,201,0},{3,0,9,201,0},{4,0,9,201,0},{5,0,9,201,0},{6,0,9,201,0},{7,0,9,201,0}, + {8,0,9,0,0},{9,0,9,0,0},{10,0,9,0,0},{11,0,9,0,0},{12,0,9,0,0},{13,0,9,201,0},{14,0,9,201,0},{16,0,9,0,0},{0,1,9,0,0},{1,1,9,0,0},{2,1,9,206,0},{3,1,9,0,0},{4,1,9,0,0},{5,1,9,0,0},{6,1,9,0,0},{7,1,9,202,0}, + {8,1,9,0,0},{9,1,9,0,0},{10,1,9,0,0},{11,1,9,0,0},{12,1,9,0,0},{13,1,9,0,0},{14,1,9,206,0},{15,1,9,0,0},{16,1,9,0,0},{0,2,9,0,0},{1,2,9,0,0},{3,2,9,0,0},{4,2,9,0,0},{5,2,9,0,0},{6,2,9,0,0},{7,2,9,202,0}, + {8,2,9,0,0},{9,2,9,0,0},{10,2,9,0,0},{11,2,9,0,0},{12,2,9,0,0},{13,2,9,0,0},{15,2,9,0,0},{16,2,9,0,0},{0,3,9,0,0},{1,3,9,0,0},{3,3,9,0,0},{4,3,9,0,0},{5,3,9,0,0},{6,3,9,0,0},{7,3,9,202,0},{8,3,9,0,0}, + {9,3,9,0,0},{10,3,9,0,0},{11,3,9,0,0},{12,3,9,0,0},{13,3,9,0,0},{15,3,9,0,0},{16,3,9,0,0},{1,4,9,201,0},{2,4,9,201,0},{3,4,9,201,0},{4,4,9,201,0},{5,4,9,201,0},{6,4,9,201,0},{7,4,9,201,0},{8,4,9,201,0},{9,4,9,201,0}, + {10,4,9,201,0},{11,4,9,201,0},{12,4,9,201,0},{13,4,9,201,0},{14,4,9,201,0},{15,4,9,201,0},{0,5,9,0,0},{1,5,9,0,0},{2,5,9,0,0},{3,5,9,0,0},{4,5,9,0,0},{5,5,9,0,0},{6,5,9,0,0},{7,5,9,0,0},{8,5,9,0,0},{9,5,9,0,0}, + {10,5,9,0,0},{11,5,9,0,0},{12,5,9,0,0},{13,5,9,0,0},{14,5,9,0,0},{15,5,9,0,0},{16,5,9,0,0},{0,0,10,0,0},{2,0,10,201,0},{3,0,10,201,0},{4,0,10,201,0},{5,0,10,201,0},{6,0,10,201,0},{7,0,10,201,0},{8,0,10,0,0},{9,0,10,0,0}, + {10,0,10,0,0},{11,0,10,0,0},{12,0,10,201,0},{13,0,10,201,0},{14,0,10,201,0},{16,0,10,0,0},{0,1,10,0,0},{1,1,10,0,0},{2,1,10,206,0},{3,1,10,0,0},{4,1,10,0,0},{5,1,10,0,0},{6,1,10,0,0},{7,1,10,0,0},{8,1,10,0,0},{9,1,10,0,0}, + {10,1,10,0,0},{11,1,10,0,0},{12,1,10,0,0},{13,1,10,0,0},{14,1,10,206,0},{15,1,10,0,0},{16,1,10,0,0},{0,2,10,0,0},{1,2,10,0,0},{2,2,10,206,0},{3,2,10,0,0},{4,2,10,0,0},{5,2,10,0,0},{6,2,10,0,0},{7,2,10,0,0},{8,2,10,0,0}, + {9,2,10,0,0},{10,2,10,0,0},{11,2,10,0,0},{12,2,10,0,0},{13,2,10,0,0},{14,2,10,206,0},{15,2,10,0,0},{16,2,10,0,0},{0,3,10,0,0},{1,3,10,0,0},{2,3,10,206,0},{3,3,10,0,0},{4,3,10,0,0},{5,3,10,0,0},{6,3,10,0,0},{7,3,10,0,0}, + {8,3,10,0,0},{9,3,10,0,0},{10,3,10,0,0},{11,3,10,0,0},{12,3,10,0,0},{13,3,10,0,0},{14,3,10,206,0},{15,3,10,0,0},{16,3,10,0,0},{1,4,10,201,0},{2,4,10,201,0},{3,4,10,201,0},{4,4,10,201,0},{5,4,10,201,0},{6,4,10,201,0},{7,4,10,201,0}, + {8,4,10,201,0},{9,4,10,201,0},{10,4,10,201,0},{11,4,10,201,0},{12,4,10,201,0},{13,4,10,201,0},{14,4,10,201,0},{15,4,10,201,0},{0,5,10,0,0},{1,5,10,0,0},{2,5,10,0,0},{3,5,10,0,0},{4,5,10,0,0},{5,5,10,0,0},{6,5,10,0,0},{7,5,10,0,0}, + {8,5,10,0,0},{9,5,10,0,0},{10,5,10,0,0},{11,5,10,0,0},{12,5,10,0,0},{13,5,10,0,0},{14,5,10,0,0},{15,5,10,0,0},{16,5,10,0,0},{0,0,11,0,0},{2,0,11,201,0},{3,0,11,201,0},{4,0,11,201,0},{5,0,11,201,0},{6,0,11,201,0},{7,0,11,201,0}, + {8,0,11,0,0},{9,0,11,0,0},{10,0,11,0,0},{11,0,11,0,0},{12,0,11,201,0},{13,0,11,201,0},{14,0,11,201,0},{16,0,11,0,0},{0,1,11,0,0},{1,1,11,0,0},{2,1,11,206,0},{4,1,11,0,0},{5,1,11,0,0},{6,1,11,0,0},{7,1,11,0,0},{8,1,11,0,0}, + {9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0},{12,1,11,0,0},{13,1,11,0,0},{14,1,11,206,0},{15,1,11,0,0},{16,1,11,0,0},{0,2,11,0,0},{1,2,11,0,0},{2,2,11,206,0},{4,2,11,0,0},{5,2,11,0,0},{6,2,11,0,0},{7,2,11,0,0},{8,2,11,0,0}, + {9,2,11,0,0},{10,2,11,0,0},{11,2,11,0,0},{12,2,11,0,0},{13,2,11,0,0},{14,2,11,206,0},{15,2,11,0,0},{16,2,11,0,0},{0,3,11,0,0},{1,3,11,0,0},{2,3,11,206,0},{3,3,11,0,0},{4,3,11,0,0},{5,3,11,0,0},{6,3,11,0,0},{7,3,11,0,0}, + {8,3,11,0,0},{9,3,11,0,0},{10,3,11,0,0},{11,3,11,0,0},{12,3,11,0,0},{13,3,11,0,0},{14,3,11,206,0},{15,3,11,0,0},{16,3,11,0,0},{1,4,11,201,0},{2,4,11,201,0},{3,4,11,201,0},{4,4,11,201,0},{5,4,11,201,0},{6,4,11,201,0},{7,4,11,201,0}, + {8,4,11,201,0},{9,4,11,201,0},{10,4,11,201,0},{11,4,11,201,0},{12,4,11,201,0},{13,4,11,201,0},{14,4,11,201,0},{15,4,11,201,0},{0,5,11,0,0},{1,5,11,0,0},{2,5,11,0,0},{3,5,11,0,0},{4,5,11,0,0},{5,5,11,0,0},{6,5,11,0,0},{7,5,11,0,0}, + {8,5,11,0,0},{9,5,11,0,0},{10,5,11,0,0},{11,5,11,0,0},{12,5,11,0,0},{13,5,11,0,0},{14,5,11,0,0},{15,5,11,0,0},{16,5,11,0,0},{0,0,12,0,0},{2,0,12,201,0},{3,0,12,201,0},{4,0,12,201,0},{5,0,12,201,0},{6,0,12,201,0},{7,0,12,201,0}, + {8,0,12,0,0},{10,0,12,201,0},{11,0,12,201,0},{12,0,12,201,0},{13,0,12,201,0},{14,0,12,201,0},{16,0,12,0,0},{0,1,12,0,0},{1,1,12,0,0},{2,1,12,206,0},{3,1,12,0,0},{4,1,12,0,0},{5,1,12,0,0},{6,1,12,0,0},{7,1,12,0,0},{8,1,12,0,0}, + {9,1,12,0,0},{10,1,12,0,0},{11,1,12,0,0},{12,1,12,0,0},{13,1,12,0,0},{14,1,12,206,0},{15,1,12,0,0},{16,1,12,0,0},{0,2,12,0,0},{1,2,12,0,0},{3,2,12,0,0},{4,2,12,0,0},{5,2,12,0,0},{6,2,12,0,0},{7,2,12,0,0},{8,2,12,0,0}, + {9,2,12,0,0},{10,2,12,0,0},{11,2,12,0,0},{12,2,12,0,0},{13,2,12,0,0},{15,2,12,0,0},{16,2,12,0,0},{0,3,12,0,0},{1,3,12,0,0},{3,3,12,0,0},{4,3,12,0,0},{5,3,12,0,0},{6,3,12,0,0},{7,3,12,0,0},{8,3,12,0,0},{9,3,12,0,0}, + {10,3,12,0,0},{11,3,12,0,0},{12,3,12,0,0},{13,3,12,0,0},{15,3,12,0,0},{16,3,12,0,0},{1,4,12,201,0},{2,4,12,201,0},{3,4,12,201,0},{4,4,12,201,0},{5,4,12,201,0},{6,4,12,201,0},{7,4,12,201,0},{8,4,12,201,0},{9,4,12,201,0},{10,4,12,201,0}, + {11,4,12,201,0},{12,4,12,201,0},{13,4,12,201,0},{14,4,12,201,0},{15,4,12,201,0},{0,5,12,0,0},{1,5,12,0,0},{2,5,12,0,0},{3,5,12,0,0},{4,5,12,0,0},{5,5,12,0,0},{6,5,12,0,0},{7,5,12,0,0},{8,5,12,0,0},{9,5,12,0,0},{10,5,12,0,0}, + {11,5,12,0,0},{12,5,12,0,0},{13,5,12,0,0},{14,5,12,0,0},{15,5,12,0,0},{16,5,12,0,0},{0,0,13,0,0},{2,0,13,201,0},{3,0,13,201,0},{4,0,13,201,0},{5,0,13,201,0},{6,0,13,201,0},{7,0,13,201,0},{8,0,13,201,0},{9,0,13,201,0},{10,0,13,201,0}, + {11,0,13,201,0},{12,0,13,201,0},{13,0,13,201,0},{14,0,13,201,0},{16,0,13,0,0},{0,1,13,0,0},{1,1,13,0,0},{2,1,13,206,0},{3,1,13,0,0},{4,1,13,0,0},{6,1,13,0,0},{7,1,13,0,0},{8,1,13,0,0},{9,1,13,0,0},{10,1,13,0,0},{11,1,13,0,0}, + {12,1,13,0,0},{13,1,13,0,0},{14,1,13,206,0},{15,1,13,0,0},{16,1,13,0,0},{0,2,13,0,0},{1,2,13,0,0},{2,2,13,206,0},{3,2,13,0,0},{4,2,13,0,0},{6,2,13,0,0},{7,2,13,0,0},{8,2,13,0,0},{9,2,13,0,0},{10,2,13,0,0},{11,2,13,0,0}, + {12,2,13,0,0},{13,2,13,0,0},{14,2,13,206,0},{15,2,13,0,0},{16,2,13,0,0},{0,3,13,0,0},{1,3,13,0,0},{2,3,13,206,0},{3,3,13,0,0},{4,3,13,0,0},{5,3,13,0,0},{6,3,13,0,0},{7,3,13,0,0},{8,3,13,0,0},{9,3,13,0,0},{10,3,13,0,0}, + {11,3,13,0,0},{12,3,13,0,0},{13,3,13,0,0},{14,3,13,206,0},{15,3,13,0,0},{16,3,13,0,0},{1,4,13,201,0},{2,4,13,201,0},{3,4,13,201,0},{4,4,13,201,0},{5,4,13,201,0},{6,4,13,201,0},{7,4,13,201,0},{8,4,13,201,0},{9,4,13,201,0},{10,4,13,201,0}, + {11,4,13,201,0},{12,4,13,201,0},{13,4,13,201,0},{14,4,13,201,0},{15,4,13,201,0},{0,5,13,0,0},{1,5,13,0,0},{2,5,13,0,0},{3,5,13,0,0},{4,5,13,0,0},{5,5,13,0,0},{6,5,13,0,0},{7,5,13,0,0},{8,5,13,0,0},{9,5,13,0,0},{10,5,13,0,0}, + {11,5,13,0,0},{12,5,13,0,0},{13,5,13,0,0},{14,5,13,0,0},{15,5,13,0,0},{16,5,13,0,0},{0,0,14,0,0},{2,0,14,201,0},{3,0,14,201,0},{4,0,14,201,0},{5,0,14,201,0},{6,0,14,201,0},{7,0,14,201,0},{8,0,14,201,0},{9,0,14,201,0},{10,0,14,201,0}, + {11,0,14,201,0},{12,0,14,201,0},{13,0,14,201,0},{14,0,14,201,0},{16,0,14,0,0},{0,1,14,0,0},{1,1,14,0,0},{2,1,14,202,0},{3,1,14,206,0},{4,1,14,206,0},{5,1,14,206,0},{6,1,14,206,0},{7,1,14,206,0},{8,1,14,206,0},{9,1,14,206,0},{10,1,14,206,0}, + {11,1,14,206,0},{12,1,14,206,0},{13,1,14,206,0},{14,1,14,202,0},{15,1,14,0,0},{16,1,14,0,0},{0,2,14,0,0},{1,2,14,0,0},{2,2,14,202,0},{3,2,14,206,0},{5,2,14,206,0},{6,2,14,206,0},{8,2,14,206,0},{10,2,14,206,0},{11,2,14,206,0},{13,2,14,206,0}, + {14,2,14,202,0},{15,2,14,0,0},{16,2,14,0,0},{0,3,14,0,0},{1,3,14,0,0},{2,3,14,202,0},{3,3,14,206,0},{5,3,14,206,0},{6,3,14,206,0},{8,3,14,206,0},{10,3,14,206,0},{11,3,14,206,0},{13,3,14,206,0},{14,3,14,202,0},{15,3,14,0,0},{16,3,14,0,0}, + {1,4,14,201,0},{2,4,14,201,0},{3,4,14,201,0},{4,4,14,201,0},{5,4,14,201,0},{6,4,14,201,0},{7,4,14,201,0},{8,4,14,201,0},{9,4,14,201,0},{10,4,14,201,0},{11,4,14,201,0},{12,4,14,201,0},{13,4,14,201,0},{14,4,14,201,0},{15,4,14,201,0},{0,5,14,0,0}, + {1,5,14,0,0},{2,5,14,0,0},{3,5,14,0,0},{4,5,14,0,0},{5,5,14,0,0},{6,5,14,0,0},{7,5,14,0,0},{8,5,14,0,0},{9,5,14,0,0},{10,5,14,0,0},{11,5,14,0,0},{12,5,14,0,0},{13,5,14,0,0},{14,5,14,0,0},{15,5,14,0,0},{16,5,14,0,0}, + {0,0,15,0,0},{16,0,15,0,0},{0,1,15,0,0},{2,1,15,0,0},{3,1,15,0,0},{4,1,15,0,0},{5,1,15,0,0},{6,1,15,0,0},{7,1,15,0,0},{8,1,15,0,0},{9,1,15,0,0},{10,1,15,0,0},{11,1,15,0,0},{12,1,15,0,0},{13,1,15,0,0},{14,1,15,0,0}, + {16,1,15,0,0},{0,2,15,0,0},{1,2,15,0,0},{2,2,15,0,0},{3,2,15,0,0},{4,2,15,0,0},{5,2,15,0,0},{6,2,15,0,0},{7,2,15,0,0},{8,2,15,0,0},{9,2,15,0,0},{10,2,15,0,0},{11,2,15,0,0},{12,2,15,0,0},{13,2,15,0,0},{14,2,15,0,0}, + {15,2,15,0,0},{16,2,15,0,0},{0,3,15,0,0},{1,3,15,0,0},{2,3,15,0,0},{3,3,15,0,0},{4,3,15,0,0},{5,3,15,0,0},{6,3,15,0,0},{7,3,15,0,0},{8,3,15,0,0},{9,3,15,0,0},{10,3,15,0,0},{11,3,15,0,0},{12,3,15,0,0},{13,3,15,0,0}, + {14,3,15,0,0},{15,3,15,0,0},{16,3,15,0,0},{1,4,15,201,0},{2,4,15,201,0},{3,4,15,201,0},{4,4,15,201,0},{5,4,15,201,0},{6,4,15,201,0},{7,4,15,201,0},{8,4,15,201,0},{9,4,15,201,0},{10,4,15,201,0},{11,4,15,201,0},{12,4,15,201,0},{13,4,15,201,0}, + {14,4,15,201,0},{15,4,15,201,0},{0,5,15,0,0},{1,5,15,0,0},{2,5,15,0,0},{3,5,15,0,0},{4,5,15,0,0},{5,5,15,0,0},{6,5,15,0,0},{7,5,15,0,0},{8,5,15,0,0},{9,5,15,0,0},{10,5,15,0,0},{11,5,15,0,0},{12,5,15,0,0},{13,5,15,0,0}, + {14,5,15,0,0},{15,5,15,0,0},{16,5,15,0,0},{0,0,16,0,0},{1,0,16,0,0},{2,0,16,0,0},{3,0,16,0,0},{4,0,16,0,0},{5,0,16,0,0},{6,0,16,0,0},{7,0,16,0,0},{8,0,16,0,0},{9,0,16,0,0},{10,0,16,0,0},{11,0,16,0,0},{12,0,16,0,0}, + {13,0,16,0,0},{14,0,16,0,0},{15,0,16,0,0},{16,0,16,0,0},{0,1,16,0,0},{1,1,16,0,0},{2,1,16,0,0},{3,1,16,0,0},{4,1,16,0,0},{5,1,16,0,0},{6,1,16,0,0},{7,1,16,0,0},{8,1,16,0,0},{9,1,16,0,0},{10,1,16,0,0},{11,1,16,0,0}, + {12,1,16,0,0},{13,1,16,0,0},{14,1,16,0,0},{15,1,16,0,0},{16,1,16,0,0},{0,2,16,0,0},{1,2,16,0,0},{2,2,16,0,0},{3,2,16,0,0},{4,2,16,0,0},{5,2,16,0,0},{6,2,16,0,0},{7,2,16,0,0},{8,2,16,0,0},{9,2,16,0,0},{10,2,16,0,0}, + {11,2,16,0,0},{12,2,16,0,0},{13,2,16,0,0},{14,2,16,0,0},{15,2,16,0,0},{16,2,16,0,0},{0,3,16,0,0},{1,3,16,0,0},{2,3,16,0,0},{3,3,16,0,0},{4,3,16,0,0},{5,3,16,0,0},{6,3,16,0,0},{7,3,16,0,0},{8,3,16,0,0},{9,3,16,0,0}, + {10,3,16,0,0},{11,3,16,0,0},{12,3,16,0,0},{13,3,16,0,0},{14,3,16,0,0},{15,3,16,0,0},{16,3,16,0,0},{0,5,16,0,0},{1,5,16,0,0},{2,5,16,0,0},{3,5,16,0,0},{4,5,16,0,0},{5,5,16,0,0},{6,5,16,0,0},{7,5,16,0,0},{8,5,16,0,0}, + {9,5,16,0,0},{10,5,16,0,0},{11,5,16,0,0},{12,5,16,0,0},{13,5,16,0,0},{14,5,16,0,0},{15,5,16,0,0},{16,5,16,0,0},{3,1,11,54,5},{5,1,13,54,2},{0,4,0,203,4},{1,4,0,203,6},{2,4,0,203,2},{3,4,0,203,2},{4,4,0,203,6},{5,4,0,203,6}, + {6,4,0,203,2},{7,4,0,203,2},{8,4,0,203,6},{9,4,0,203,2},{10,4,0,203,2},{11,4,0,203,6},{12,4,0,203,6},{13,4,0,203,2},{14,4,0,203,2},{15,4,0,203,6},{16,4,0,203,6},{1,0,1,203,4},{2,0,1,203,6},{3,0,1,203,2},{4,0,1,203,2},{5,0,1,203,6}, + {6,0,1,203,6},{7,0,1,203,2},{8,0,1,203,2},{9,0,1,203,2},{10,0,1,203,6},{11,0,1,203,6},{12,0,1,203,2},{13,0,1,203,2},{14,0,1,203,6},{15,0,1,203,6},{1,1,1,198,1},{15,1,1,198,1},{0,4,1,203,4},{16,4,1,203,5},{1,0,2,203,4},{15,0,2,203,5}, + {4,2,2,95,2},{7,2,2,95,2},{4,3,2,95,2},{7,3,2,95,2},{0,4,2,203,0},{16,4,2,203,1},{7,5,2,203,0},{8,5,2,203,2},{9,5,2,203,2},{10,5,2,203,2},{11,5,2,203,2},{1,0,3,203,0},{15,0,3,203,1},{7,1,3,205,0},{9,1,3,205,8},{9,2,3,205,0}, + {11,2,3,205,8},{11,3,3,205,0},{13,3,3,205,8},{0,4,3,203,0},{13,4,3,205,0},{16,4,3,203,1},{7,5,3,203,0},{1,0,4,203,0},{7,0,4,205,0},{15,0,4,203,1},{2,2,4,95,2},{2,3,4,95,2},{0,4,4,203,4},{16,4,4,203,5},{7,5,4,203,0},{8,5,4,203,3}, + {9,5,4,203,3},{10,5,4,203,3},{11,5,4,203,3},{1,0,5,203,4},{15,0,5,203,5},{0,4,5,203,4},{16,4,5,203,5},{1,0,6,203,4},{15,0,6,203,5},{0,4,6,203,0},{16,4,6,203,1},{1,0,7,203,0},{15,0,7,203,1},{2,2,7,95,2},{14,2,7,95,2},{2,3,7,95,2}, + {14,3,7,95,2},{0,4,7,203,0},{16,4,7,203,1},{1,0,8,203,0},{15,0,8,203,1},{0,4,8,203,4},{16,4,8,203,5},{1,0,9,203,0},{15,0,9,203,1},{2,2,9,95,2},{14,2,9,95,2},{2,3,9,95,2},{14,3,9,95,2},{0,4,9,203,0},{16,4,9,203,1},{1,0,10,203,4}, + {15,0,10,203,5},{0,4,10,203,0},{16,4,10,203,1},{1,0,11,203,4},{15,0,11,203,5},{0,4,11,203,4},{16,4,11,203,5},{1,0,12,203,0},{9,0,12,205,0},{15,0,12,203,1},{2,2,12,95,2},{14,2,12,95,2},{2,3,12,95,2},{14,3,12,95,2},{0,4,12,203,4},{16,4,12,203,5}, + {1,0,13,203,0},{15,0,13,203,1},{0,4,13,203,0},{16,4,13,203,1},{1,0,14,203,4},{15,0,14,203,5},{4,2,14,95,2},{7,2,14,95,2},{9,2,14,95,2},{12,2,14,95,2},{4,3,14,95,2},{7,3,14,95,2},{9,3,14,95,2},{12,3,14,95,2},{0,4,14,203,0},{16,4,14,203,1}, + {1,0,15,203,7},{2,0,15,203,7},{3,0,15,203,3},{4,0,15,203,3},{5,0,15,203,7},{6,0,15,203,7},{7,0,15,203,3},{8,0,15,203,3},{9,0,15,203,3},{10,0,15,203,7},{11,0,15,203,7},{12,0,15,203,3},{13,0,15,203,3},{14,0,15,203,7},{15,0,15,203,5},{1,1,15,198,1}, + {15,1,15,198,1},{0,4,15,203,4},{16,4,15,203,5},{0,4,16,203,7},{1,4,16,203,7},{2,4,16,203,3},{3,4,16,203,3},{4,4,16,203,7},{5,4,16,203,7},{6,4,16,203,3},{7,4,16,203,3},{8,4,16,203,7},{9,4,16,203,3},{10,4,16,203,3},{11,4,16,203,7},{12,4,16,203,7}, + {13,4,16,203,3},{14,4,16,203,3},{15,4,16,203,7},{16,4,16,203,5}, +}; +static const EndCityTemplates::Extra s_fat_tower_top_extras[] = { + {3,2,11,EndCityTemplates::EXTRA_CHEST_LOOT,0},{5,2,13,EndCityTemplates::EXTRA_CHEST_LOOT,0}, +}; + +static const EndCityTemplates::Block s_second_floor_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{7,0,0,0,0},{8,0,0,0,0},{9,0,0,0,0},{10,0,0,0,0},{11,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0}, + {4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,0,0},{5,2,0,0,0},{6,2,0,0,0},{7,2,0,0,0}, + {8,2,0,0,0},{9,2,0,0,0},{10,2,0,0,0},{11,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0},{6,3,0,0,0},{7,3,0,0,0},{8,3,0,0,0},{9,3,0,0,0},{10,3,0,0,0},{11,3,0,0,0}, + {1,5,0,0,0},{2,5,0,0,0},{3,5,0,0,0},{4,5,0,0,0},{5,5,0,0,0},{6,5,0,0,0},{7,5,0,0,0},{8,5,0,0,0},{9,5,0,0,0},{10,5,0,0,0},{0,6,0,0,0},{1,6,0,0,0},{2,6,0,0,0},{3,6,0,0,0},{4,6,0,0,0},{5,6,0,0,0}, + {6,6,0,0,0},{7,6,0,0,0},{8,6,0,0,0},{9,6,0,0,0},{10,6,0,0,0},{11,6,0,0,0},{0,7,0,0,0},{1,7,0,0,0},{2,7,0,0,0},{3,7,0,0,0},{4,7,0,0,0},{5,7,0,0,0},{6,7,0,0,0},{7,7,0,0,0},{8,7,0,0,0},{9,7,0,0,0}, + {10,7,0,0,0},{11,7,0,0,0},{0,0,1,0,0},{1,0,1,0,0},{2,0,1,0,0},{3,0,1,0,0},{4,0,1,0,0},{5,0,1,0,0},{6,0,1,0,0},{7,0,1,0,0},{8,0,1,0,0},{9,0,1,0,0},{10,0,1,0,0},{11,0,1,0,0},{0,1,1,0,0},{1,1,1,0,0}, + {2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0},{7,1,1,0,0},{8,1,1,0,0},{9,1,1,0,0},{10,1,1,0,0},{11,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0},{4,2,1,0,0},{5,2,1,0,0}, + {6,2,1,0,0},{7,2,1,0,0},{8,2,1,0,0},{9,2,1,0,0},{10,2,1,0,0},{11,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,0,0},{3,3,1,0,0},{4,3,1,0,0},{5,3,1,0,0},{6,3,1,0,0},{7,3,1,0,0},{8,3,1,0,0},{9,3,1,0,0}, + {10,3,1,0,0},{11,3,1,0,0},{1,4,1,201,0},{2,4,1,201,0},{3,4,1,201,0},{4,4,1,201,0},{5,4,1,201,0},{6,4,1,201,0},{7,4,1,201,0},{8,4,1,201,0},{9,4,1,201,0},{10,4,1,201,0},{0,5,1,0,0},{1,5,1,202,0},{2,5,1,206,0},{3,5,1,206,0}, + {4,5,1,206,0},{5,5,1,206,0},{6,5,1,206,0},{7,5,1,206,0},{8,5,1,206,0},{9,5,1,206,0},{10,5,1,202,0},{11,5,1,0,0},{0,6,1,0,0},{1,6,1,202,0},{2,6,1,206,0},{4,6,1,206,0},{5,6,1,206,0},{6,6,1,206,0},{7,6,1,206,0},{9,6,1,206,0}, + {10,6,1,202,0},{11,6,1,0,0},{0,7,1,0,0},{1,7,1,202,0},{2,7,1,206,0},{4,7,1,206,0},{5,7,1,206,0},{6,7,1,206,0},{7,7,1,206,0},{9,7,1,206,0},{10,7,1,202,0},{11,7,1,0,0},{0,0,2,0,0},{1,0,2,0,0},{2,0,2,0,0},{3,0,2,0,0}, + {4,0,2,0,0},{5,0,2,0,0},{6,0,2,0,0},{7,0,2,0,0},{8,0,2,0,0},{9,0,2,0,0},{10,0,2,0,0},{11,0,2,0,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{5,1,2,0,0},{6,1,2,0,0},{7,1,2,0,0}, + {8,1,2,0,0},{9,1,2,0,0},{10,1,2,0,0},{11,1,2,0,0},{0,2,2,0,0},{1,2,2,0,0},{2,2,2,0,0},{3,2,2,0,0},{4,2,2,206,0},{5,2,2,0,0},{6,2,2,0,0},{7,2,2,206,0},{8,2,2,0,0},{9,2,2,0,0},{10,2,2,0,0},{11,2,2,0,0}, + {0,3,2,0,0},{1,3,2,0,0},{2,3,2,0,0},{3,3,2,0,0},{4,3,2,206,0},{5,3,2,0,0},{6,3,2,0,0},{7,3,2,206,0},{8,3,2,0,0},{9,3,2,0,0},{10,3,2,0,0},{11,3,2,0,0},{1,4,2,201,0},{2,4,2,201,0},{3,4,2,201,0},{4,4,2,201,0}, + {5,4,2,201,0},{6,4,2,201,0},{7,4,2,201,0},{8,4,2,201,0},{9,4,2,201,0},{10,4,2,201,0},{0,5,2,0,0},{1,5,2,206,0},{2,5,2,0,0},{3,5,2,0,0},{4,5,2,0,0},{5,5,2,0,0},{6,5,2,0,0},{7,5,2,0,0},{8,5,2,0,0},{9,5,2,0,0}, + {10,5,2,206,0},{11,5,2,0,0},{0,6,2,0,0},{1,6,2,206,0},{2,6,2,0,0},{3,6,2,0,0},{4,6,2,0,0},{5,6,2,0,0},{6,6,2,0,0},{7,6,2,0,0},{8,6,2,0,0},{9,6,2,0,0},{10,6,2,206,0},{11,6,2,0,0},{0,7,2,0,0},{1,7,2,206,0}, + {2,7,2,0,0},{3,7,2,0,0},{4,7,2,0,0},{5,7,2,0,0},{6,7,2,0,0},{7,7,2,0,0},{8,7,2,0,0},{9,7,2,0,0},{10,7,2,206,0},{11,7,2,0,0},{0,0,3,0,0},{1,0,3,0,0},{2,0,3,0,0},{3,0,3,0,0},{4,0,3,0,0},{5,0,3,0,0}, + {6,0,3,0,0},{7,0,3,0,0},{8,0,3,0,0},{9,0,3,0,0},{10,0,3,0,0},{11,0,3,0,0},{0,1,3,0,0},{1,1,3,0,0},{2,1,3,0,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0},{9,1,3,0,0},{10,1,3,0,0}, + {11,1,3,0,0},{0,2,3,0,0},{1,2,3,0,0},{2,2,3,0,0},{3,2,3,0,0},{4,2,3,0,0},{5,2,3,0,0},{7,2,3,201,0},{9,2,3,0,0},{10,2,3,0,0},{11,2,3,0,0},{0,3,3,0,0},{1,3,3,0,0},{2,3,3,0,0},{3,3,3,0,0},{5,3,3,201,0}, + {7,3,3,0,0},{8,3,3,0,0},{9,3,3,0,0},{10,3,3,0,0},{11,3,3,0,0},{1,4,3,201,0},{2,4,3,201,0},{3,4,3,201,0},{5,4,3,0,0},{6,4,3,0,0},{7,4,3,0,0},{8,4,3,0,0},{9,4,3,201,0},{10,4,3,201,0},{0,5,3,0,0},{1,5,3,206,0}, + {2,5,3,0,0},{3,5,3,0,0},{4,5,3,0,0},{5,5,3,0,0},{6,5,3,0,0},{7,5,3,0,0},{8,5,3,0,0},{9,5,3,0,0},{10,5,3,206,0},{11,5,3,0,0},{0,6,3,0,0},{2,6,3,0,0},{3,6,3,0,0},{4,6,3,0,0},{5,6,3,0,0},{6,6,3,0,0}, + {7,6,3,0,0},{8,6,3,0,0},{9,6,3,0,0},{11,6,3,0,0},{0,7,3,0,0},{2,7,3,0,0},{3,7,3,0,0},{4,7,3,0,0},{5,7,3,0,0},{6,7,3,0,0},{7,7,3,0,0},{8,7,3,0,0},{9,7,3,0,0},{11,7,3,0,0},{0,0,4,0,0},{1,0,4,0,0}, + {2,0,4,0,0},{3,0,4,0,0},{4,0,4,0,0},{5,0,4,0,0},{6,0,4,0,0},{7,0,4,0,0},{8,0,4,0,0},{9,0,4,0,0},{10,0,4,0,0},{11,0,4,0,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0}, + {6,1,4,0,0},{7,1,4,0,0},{8,1,4,201,0},{9,1,4,0,0},{10,1,4,0,0},{11,1,4,0,0},{0,2,4,0,0},{1,2,4,0,0},{2,2,4,0,0},{3,2,4,0,0},{4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0},{7,2,4,0,0},{8,2,4,0,0},{9,2,4,0,0}, + {10,2,4,0,0},{11,2,4,0,0},{0,3,4,0,0},{1,3,4,0,0},{2,3,4,0,0},{3,3,4,0,0},{4,3,4,0,0},{5,3,4,0,0},{6,3,4,0,0},{7,3,4,0,0},{8,3,4,0,0},{9,3,4,0,0},{10,3,4,0,0},{11,3,4,0,0},{1,4,4,201,0},{2,4,4,201,0}, + {3,4,4,201,0},{4,4,4,201,0},{5,4,4,201,0},{6,4,4,201,0},{7,4,4,201,0},{8,4,4,0,0},{9,4,4,201,0},{10,4,4,201,0},{0,5,4,0,0},{1,5,4,206,0},{2,5,4,0,0},{3,5,4,0,0},{4,5,4,0,0},{5,5,4,0,0},{6,5,4,0,0},{7,5,4,0,0}, + {8,5,4,0,0},{9,5,4,0,0},{10,5,4,206,0},{11,5,4,0,0},{0,6,4,0,0},{1,6,4,206,0},{2,6,4,0,0},{3,6,4,0,0},{4,6,4,0,0},{5,6,4,0,0},{6,6,4,0,0},{7,6,4,0,0},{8,6,4,0,0},{9,6,4,0,0},{10,6,4,206,0},{11,6,4,0,0}, + {0,7,4,0,0},{1,7,4,206,0},{2,7,4,0,0},{3,7,4,0,0},{4,7,4,0,0},{5,7,4,0,0},{6,7,4,0,0},{7,7,4,0,0},{8,7,4,0,0},{9,7,4,0,0},{10,7,4,206,0},{11,7,4,0,0},{0,0,5,0,0},{1,0,5,0,0},{2,0,5,0,0},{3,0,5,0,0}, + {4,0,5,0,0},{5,0,5,0,0},{6,0,5,0,0},{7,0,5,0,0},{8,0,5,0,0},{9,0,5,0,0},{10,0,5,0,0},{11,0,5,0,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,0,0},{3,1,5,0,0},{4,1,5,0,0},{5,1,5,0,0},{6,1,5,0,0},{7,1,5,0,0}, + {9,1,5,0,0},{10,1,5,0,0},{11,1,5,0,0},{0,2,5,0,0},{1,2,5,0,0},{2,2,5,0,0},{3,2,5,0,0},{4,2,5,0,0},{5,2,5,0,0},{6,2,5,0,0},{7,2,5,0,0},{8,2,5,0,0},{9,2,5,0,0},{10,2,5,0,0},{11,2,5,0,0},{0,3,5,0,0}, + {1,3,5,0,0},{2,3,5,0,0},{3,3,5,0,0},{4,3,5,0,0},{5,3,5,0,0},{6,3,5,0,0},{7,3,5,0,0},{8,3,5,0,0},{9,3,5,0,0},{10,3,5,0,0},{11,3,5,0,0},{1,4,5,201,0},{2,4,5,201,0},{3,4,5,201,0},{4,4,5,201,0},{5,4,5,201,0}, + {6,4,5,201,0},{7,4,5,201,0},{8,4,5,0,0},{9,4,5,201,0},{10,4,5,201,0},{0,5,5,0,0},{1,5,5,206,0},{2,5,5,0,0},{3,5,5,0,0},{4,5,5,0,0},{5,5,5,0,0},{6,5,5,0,0},{7,5,5,0,0},{8,5,5,0,0},{9,5,5,0,0},{10,5,5,206,0}, + {11,5,5,0,0},{0,6,5,0,0},{1,6,5,206,0},{2,6,5,0,0},{3,6,5,0,0},{4,6,5,0,0},{5,6,5,0,0},{6,6,5,0,0},{7,6,5,0,0},{8,6,5,0,0},{9,6,5,0,0},{10,6,5,206,0},{11,6,5,0,0},{0,7,5,0,0},{1,7,5,206,0},{2,7,5,0,0}, + {3,7,5,0,0},{4,7,5,0,0},{5,7,5,0,0},{6,7,5,0,0},{7,7,5,0,0},{8,7,5,0,0},{9,7,5,0,0},{10,7,5,206,0},{11,7,5,0,0},{0,0,6,0,0},{1,0,6,0,0},{2,0,6,0,0},{3,0,6,0,0},{4,0,6,0,0},{5,0,6,0,0},{6,0,6,0,0}, + {7,0,6,0,0},{8,0,6,0,0},{9,0,6,0,0},{10,0,6,0,0},{11,0,6,0,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{7,1,6,0,0},{8,1,6,0,0},{9,1,6,0,0},{10,1,6,0,0}, + {11,1,6,0,0},{0,2,6,0,0},{1,2,6,0,0},{2,2,6,0,0},{3,2,6,0,0},{4,2,6,0,0},{5,2,6,0,0},{6,2,6,0,0},{7,2,6,0,0},{8,2,6,0,0},{9,2,6,0,0},{10,2,6,0,0},{11,2,6,0,0},{0,3,6,0,0},{1,3,6,0,0},{2,3,6,0,0}, + {3,3,6,0,0},{4,3,6,0,0},{5,3,6,0,0},{6,3,6,0,0},{7,3,6,0,0},{8,3,6,0,0},{9,3,6,0,0},{10,3,6,0,0},{11,3,6,0,0},{1,4,6,201,0},{2,4,6,201,0},{3,4,6,201,0},{4,4,6,201,0},{5,4,6,201,0},{6,4,6,201,0},{7,4,6,201,0}, + {8,4,6,0,0},{9,4,6,201,0},{10,4,6,201,0},{0,5,6,0,0},{1,5,6,206,0},{2,5,6,0,0},{3,5,6,0,0},{4,5,6,0,0},{5,5,6,0,0},{6,5,6,0,0},{7,5,6,0,0},{8,5,6,0,0},{9,5,6,0,0},{10,5,6,206,0},{11,5,6,0,0},{0,6,6,0,0}, + {1,6,6,206,0},{2,6,6,0,0},{3,6,6,0,0},{4,6,6,0,0},{5,6,6,0,0},{6,6,6,0,0},{7,6,6,0,0},{8,6,6,0,0},{9,6,6,0,0},{10,6,6,206,0},{11,6,6,0,0},{0,7,6,0,0},{1,7,6,206,0},{2,7,6,0,0},{3,7,6,0,0},{4,7,6,0,0}, + {5,7,6,0,0},{6,7,6,0,0},{7,7,6,0,0},{8,7,6,0,0},{9,7,6,0,0},{10,7,6,206,0},{11,7,6,0,0},{0,0,7,0,0},{1,0,7,0,0},{2,0,7,0,0},{3,0,7,0,0},{4,0,7,0,0},{5,0,7,0,0},{6,0,7,0,0},{7,0,7,0,0},{8,0,7,0,0}, + {9,0,7,0,0},{10,0,7,0,0},{11,0,7,0,0},{0,1,7,0,0},{1,1,7,0,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{6,1,7,0,0},{7,1,7,0,0},{8,1,7,0,0},{9,1,7,0,0},{10,1,7,0,0},{11,1,7,0,0},{0,2,7,0,0}, + {1,2,7,0,0},{2,2,7,0,0},{3,2,7,0,0},{4,2,7,0,0},{5,2,7,0,0},{6,2,7,0,0},{7,2,7,0,0},{8,2,7,0,0},{9,2,7,0,0},{10,2,7,0,0},{11,2,7,0,0},{0,3,7,0,0},{1,3,7,0,0},{2,3,7,0,0},{3,3,7,0,0},{4,3,7,0,0}, + {5,3,7,0,0},{6,3,7,0,0},{7,3,7,0,0},{8,3,7,0,0},{9,3,7,0,0},{10,3,7,0,0},{11,3,7,0,0},{1,4,7,201,0},{2,4,7,201,0},{3,4,7,201,0},{4,4,7,201,0},{5,4,7,201,0},{6,4,7,201,0},{7,4,7,201,0},{8,4,7,201,0},{9,4,7,201,0}, + {10,4,7,201,0},{0,5,7,0,0},{1,5,7,206,0},{2,5,7,0,0},{3,5,7,0,0},{4,5,7,0,0},{5,5,7,0,0},{6,5,7,0,0},{7,5,7,0,0},{8,5,7,0,0},{9,5,7,0,0},{10,5,7,206,0},{11,5,7,0,0},{0,6,7,0,0},{1,6,7,206,0},{2,6,7,0,0}, + {3,6,7,0,0},{4,6,7,0,0},{5,6,7,0,0},{6,6,7,0,0},{7,6,7,0,0},{8,6,7,0,0},{9,6,7,0,0},{10,6,7,206,0},{11,6,7,0,0},{0,7,7,0,0},{1,7,7,206,0},{2,7,7,0,0},{3,7,7,0,0},{4,7,7,0,0},{5,7,7,0,0},{6,7,7,0,0}, + {7,7,7,0,0},{8,7,7,0,0},{9,7,7,0,0},{10,7,7,206,0},{11,7,7,0,0},{0,0,8,0,0},{1,0,8,0,0},{2,0,8,0,0},{3,0,8,0,0},{4,0,8,0,0},{5,0,8,0,0},{6,0,8,0,0},{7,0,8,0,0},{8,0,8,0,0},{9,0,8,0,0},{10,0,8,0,0}, + {11,0,8,0,0},{0,1,8,0,0},{1,1,8,0,0},{2,1,8,0,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,0,0},{7,1,8,0,0},{8,1,8,0,0},{9,1,8,0,0},{10,1,8,0,0},{11,1,8,0,0},{0,2,8,0,0},{1,2,8,0,0},{2,2,8,0,0}, + {3,2,8,0,0},{4,2,8,0,0},{5,2,8,0,0},{6,2,8,0,0},{7,2,8,0,0},{8,2,8,0,0},{9,2,8,0,0},{10,2,8,0,0},{11,2,8,0,0},{0,3,8,0,0},{1,3,8,0,0},{2,3,8,0,0},{3,3,8,0,0},{4,3,8,0,0},{5,3,8,0,0},{6,3,8,0,0}, + {7,3,8,0,0},{8,3,8,0,0},{9,3,8,0,0},{10,3,8,0,0},{11,3,8,0,0},{1,4,8,201,0},{2,4,8,201,0},{3,4,8,201,0},{4,4,8,201,0},{5,4,8,201,0},{6,4,8,201,0},{7,4,8,201,0},{8,4,8,201,0},{9,4,8,201,0},{10,4,8,201,0},{0,5,8,0,0}, + {1,5,8,206,0},{2,5,8,0,0},{3,5,8,0,0},{4,5,8,0,0},{5,5,8,0,0},{6,5,8,0,0},{7,5,8,0,0},{8,5,8,0,0},{9,5,8,0,0},{10,5,8,206,0},{11,5,8,0,0},{0,6,8,0,0},{2,6,8,0,0},{3,6,8,0,0},{4,6,8,0,0},{5,6,8,0,0}, + {6,6,8,0,0},{7,6,8,0,0},{8,6,8,0,0},{9,6,8,0,0},{11,6,8,0,0},{0,7,8,0,0},{2,7,8,0,0},{3,7,8,0,0},{4,7,8,0,0},{5,7,8,0,0},{6,7,8,0,0},{7,7,8,0,0},{8,7,8,0,0},{9,7,8,0,0},{11,7,8,0,0},{0,0,9,0,0}, + {1,0,9,0,0},{2,0,9,0,0},{3,0,9,0,0},{4,0,9,0,0},{5,0,9,0,0},{6,0,9,0,0},{7,0,9,0,0},{8,0,9,0,0},{9,0,9,0,0},{10,0,9,0,0},{11,0,9,0,0},{0,1,9,0,0},{1,1,9,0,0},{2,1,9,0,0},{3,1,9,0,0},{4,1,9,0,0}, + {5,1,9,0,0},{6,1,9,0,0},{7,1,9,0,0},{8,1,9,0,0},{9,1,9,0,0},{10,1,9,0,0},{11,1,9,0,0},{0,2,9,0,0},{1,2,9,0,0},{2,2,9,0,0},{3,2,9,0,0},{4,2,9,0,0},{5,2,9,0,0},{6,2,9,0,0},{7,2,9,0,0},{8,2,9,0,0}, + {9,2,9,0,0},{10,2,9,0,0},{11,2,9,0,0},{0,3,9,0,0},{1,3,9,0,0},{2,3,9,0,0},{3,3,9,0,0},{4,3,9,0,0},{5,3,9,0,0},{6,3,9,0,0},{7,3,9,0,0},{8,3,9,0,0},{9,3,9,0,0},{10,3,9,0,0},{11,3,9,0,0},{1,4,9,201,0}, + {2,4,9,201,0},{3,4,9,201,0},{4,4,9,201,0},{5,4,9,201,0},{6,4,9,201,0},{7,4,9,201,0},{8,4,9,201,0},{9,4,9,201,0},{10,4,9,201,0},{0,5,9,0,0},{1,5,9,206,0},{2,5,9,0,0},{3,5,9,0,0},{4,5,9,0,0},{5,5,9,0,0},{6,5,9,0,0}, + {7,5,9,0,0},{8,5,9,0,0},{9,5,9,0,0},{10,5,9,206,0},{11,5,9,0,0},{0,6,9,0,0},{1,6,9,206,0},{2,6,9,0,0},{3,6,9,0,0},{4,6,9,0,0},{5,6,9,0,0},{6,6,9,0,0},{7,6,9,0,0},{8,6,9,0,0},{9,6,9,0,0},{10,6,9,206,0}, + {11,6,9,0,0},{0,7,9,0,0},{1,7,9,206,0},{2,7,9,0,0},{3,7,9,0,0},{4,7,9,0,0},{5,7,9,0,0},{6,7,9,0,0},{7,7,9,0,0},{8,7,9,0,0},{9,7,9,0,0},{10,7,9,206,0},{11,7,9,0,0},{0,0,10,0,0},{1,0,10,0,0},{2,0,10,0,0}, + {3,0,10,0,0},{4,0,10,0,0},{5,0,10,0,0},{6,0,10,0,0},{7,0,10,0,0},{8,0,10,0,0},{9,0,10,0,0},{10,0,10,0,0},{11,0,10,0,0},{0,1,10,0,0},{1,1,10,0,0},{2,1,10,0,0},{3,1,10,0,0},{4,1,10,0,0},{5,1,10,0,0},{6,1,10,0,0}, + {7,1,10,0,0},{8,1,10,0,0},{9,1,10,0,0},{10,1,10,0,0},{11,1,10,0,0},{0,2,10,0,0},{1,2,10,0,0},{2,2,10,0,0},{3,2,10,0,0},{4,2,10,0,0},{5,2,10,0,0},{6,2,10,0,0},{7,2,10,0,0},{8,2,10,0,0},{9,2,10,0,0},{10,2,10,0,0}, + {11,2,10,0,0},{0,3,10,0,0},{1,3,10,0,0},{2,3,10,0,0},{3,3,10,0,0},{4,3,10,0,0},{5,3,10,0,0},{6,3,10,0,0},{7,3,10,0,0},{8,3,10,0,0},{9,3,10,0,0},{10,3,10,0,0},{11,3,10,0,0},{1,4,10,201,0},{2,4,10,201,0},{3,4,10,201,0}, + {4,4,10,201,0},{5,4,10,201,0},{6,4,10,201,0},{7,4,10,201,0},{8,4,10,201,0},{9,4,10,201,0},{10,4,10,201,0},{0,5,10,0,0},{1,5,10,202,0},{2,5,10,206,0},{3,5,10,206,0},{4,5,10,206,0},{5,5,10,206,0},{6,5,10,206,0},{7,5,10,206,0},{8,5,10,206,0}, + {9,5,10,206,0},{10,5,10,202,0},{11,5,10,0,0},{0,6,10,0,0},{1,6,10,202,0},{2,6,10,206,0},{4,6,10,206,0},{5,6,10,206,0},{6,6,10,206,0},{7,6,10,206,0},{9,6,10,206,0},{10,6,10,202,0},{11,6,10,0,0},{0,7,10,0,0},{1,7,10,202,0},{2,7,10,206,0}, + {4,7,10,206,0},{5,7,10,206,0},{6,7,10,206,0},{7,7,10,206,0},{9,7,10,206,0},{10,7,10,202,0},{11,7,10,0,0},{0,0,11,0,0},{1,0,11,0,0},{2,0,11,0,0},{3,0,11,0,0},{4,0,11,0,0},{5,0,11,0,0},{6,0,11,0,0},{7,0,11,0,0},{8,0,11,0,0}, + {9,0,11,0,0},{10,0,11,0,0},{11,0,11,0,0},{0,1,11,0,0},{1,1,11,0,0},{2,1,11,0,0},{3,1,11,0,0},{4,1,11,0,0},{5,1,11,0,0},{6,1,11,0,0},{7,1,11,0,0},{8,1,11,0,0},{9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0},{0,2,11,0,0}, + {1,2,11,0,0},{2,2,11,0,0},{3,2,11,0,0},{4,2,11,0,0},{5,2,11,0,0},{6,2,11,0,0},{7,2,11,0,0},{8,2,11,0,0},{9,2,11,0,0},{10,2,11,0,0},{11,2,11,0,0},{0,3,11,0,0},{1,3,11,0,0},{2,3,11,0,0},{3,3,11,0,0},{4,3,11,0,0}, + {5,3,11,0,0},{6,3,11,0,0},{7,3,11,0,0},{8,3,11,0,0},{9,3,11,0,0},{10,3,11,0,0},{11,3,11,0,0},{1,5,11,0,0},{2,5,11,0,0},{3,5,11,0,0},{4,5,11,0,0},{5,5,11,0,0},{6,5,11,0,0},{7,5,11,0,0},{8,5,11,0,0},{9,5,11,0,0}, + {10,5,11,0,0},{0,6,11,0,0},{1,6,11,0,0},{2,6,11,0,0},{3,6,11,0,0},{4,6,11,0,0},{5,6,11,0,0},{6,6,11,0,0},{7,6,11,0,0},{8,6,11,0,0},{9,6,11,0,0},{10,6,11,0,0},{11,6,11,0,0},{0,7,11,0,0},{1,7,11,0,0},{2,7,11,0,0}, + {3,7,11,0,0},{4,7,11,0,0},{5,7,11,0,0},{6,7,11,0,0},{7,7,11,0,0},{8,7,11,0,0},{9,7,11,0,0},{10,7,11,0,0},{11,7,11,0,0},{0,4,0,203,4},{1,4,0,203,6},{2,4,0,203,2},{3,4,0,203,6},{4,4,0,203,6},{5,4,0,203,2},{6,4,0,203,2}, + {7,4,0,203,6},{8,4,0,203,6},{9,4,0,203,2},{10,4,0,203,6},{11,4,0,203,6},{0,5,0,198,1},{11,5,0,198,1},{0,4,1,203,4},{11,4,1,203,5},{3,6,1,95,2},{8,6,1,95,2},{3,7,1,95,2},{8,7,1,95,2},{0,4,2,203,0},{11,4,2,203,1},{8,1,3,205,8}, + {6,2,3,205,8},{8,2,3,205,0},{4,3,3,205,8},{6,3,3,205,0},{0,4,3,203,4},{4,4,3,205,0},{11,4,3,203,5},{1,6,3,95,2},{10,6,3,95,2},{1,7,3,95,2},{10,7,3,95,2},{0,4,4,203,4},{11,4,4,203,5},{8,1,5,205,0},{0,4,5,203,0},{11,4,5,203,1}, + {0,4,6,203,0},{11,4,6,203,1},{0,4,7,203,4},{11,4,7,203,5},{0,4,8,203,4},{11,4,8,203,5},{1,6,8,95,2},{10,6,8,95,2},{1,7,8,95,2},{10,7,8,95,2},{0,4,9,203,0},{11,4,9,203,1},{0,4,10,203,4},{11,4,10,203,5},{3,6,10,95,2},{8,6,10,95,2}, + {3,7,10,95,2},{8,7,10,95,2},{0,4,11,203,7},{1,4,11,203,7},{2,4,11,203,3},{3,4,11,203,7},{4,4,11,203,7},{5,4,11,203,3},{6,4,11,203,3},{7,4,11,203,7},{8,4,11,203,7},{9,4,11,203,3},{10,4,11,203,7},{11,4,11,203,5},{0,5,11,198,1},{11,5,11,198,1}, +}; + +static const EndCityTemplates::Block s_second_floor_2_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{7,0,0,0,0},{8,0,0,0,0},{9,0,0,0,0},{10,0,0,0,0},{11,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0}, + {4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,0,0},{5,2,0,0,0},{6,2,0,0,0},{7,2,0,0,0}, + {8,2,0,0,0},{9,2,0,0,0},{10,2,0,0,0},{11,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0},{6,3,0,0,0},{7,3,0,0,0},{8,3,0,0,0},{9,3,0,0,0},{10,3,0,0,0},{11,3,0,0,0}, + {1,5,0,0,0},{2,5,0,0,0},{3,5,0,0,0},{4,5,0,0,0},{5,5,0,0,0},{6,5,0,0,0},{7,5,0,0,0},{8,5,0,0,0},{9,5,0,0,0},{10,5,0,0,0},{0,6,0,0,0},{1,6,0,0,0},{2,6,0,0,0},{3,6,0,0,0},{4,6,0,0,0},{5,6,0,0,0}, + {6,6,0,0,0},{7,6,0,0,0},{8,6,0,0,0},{9,6,0,0,0},{10,6,0,0,0},{11,6,0,0,0},{0,7,0,0,0},{1,7,0,0,0},{2,7,0,0,0},{3,7,0,0,0},{4,7,0,0,0},{5,7,0,0,0},{6,7,0,0,0},{7,7,0,0,0},{8,7,0,0,0},{9,7,0,0,0}, + {10,7,0,0,0},{11,7,0,0,0},{0,0,1,0,0},{1,0,1,0,0},{2,0,1,0,0},{3,0,1,0,0},{4,0,1,0,0},{5,0,1,0,0},{6,0,1,0,0},{7,0,1,0,0},{8,0,1,0,0},{9,0,1,0,0},{10,0,1,0,0},{11,0,1,0,0},{0,1,1,0,0},{1,1,1,0,0}, + {2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0},{7,1,1,0,0},{8,1,1,0,0},{9,1,1,0,0},{10,1,1,0,0},{11,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0},{4,2,1,0,0},{5,2,1,0,0}, + {6,2,1,0,0},{7,2,1,0,0},{8,2,1,0,0},{9,2,1,0,0},{10,2,1,0,0},{11,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,0,0},{3,3,1,0,0},{4,3,1,0,0},{5,3,1,0,0},{6,3,1,0,0},{7,3,1,0,0},{8,3,1,0,0},{9,3,1,0,0}, + {10,3,1,0,0},{11,3,1,0,0},{1,4,1,201,0},{2,4,1,201,0},{3,4,1,201,0},{4,4,1,201,0},{5,4,1,201,0},{6,4,1,201,0},{7,4,1,201,0},{8,4,1,201,0},{9,4,1,201,0},{10,4,1,201,0},{0,5,1,0,0},{1,5,1,202,0},{2,5,1,206,0},{3,5,1,206,0}, + {4,5,1,206,0},{5,5,1,206,0},{6,5,1,206,0},{7,5,1,206,0},{8,5,1,206,0},{9,5,1,206,0},{10,5,1,202,0},{11,5,1,0,0},{0,6,1,0,0},{1,6,1,202,0},{2,6,1,206,0},{4,6,1,206,0},{5,6,1,206,0},{6,6,1,206,0},{7,6,1,206,0},{9,6,1,206,0}, + {10,6,1,202,0},{11,6,1,0,0},{0,7,1,0,0},{1,7,1,202,0},{2,7,1,206,0},{4,7,1,206,0},{5,7,1,206,0},{6,7,1,206,0},{7,7,1,206,0},{9,7,1,206,0},{10,7,1,202,0},{11,7,1,0,0},{0,0,2,0,0},{1,0,2,0,0},{2,0,2,0,0},{3,0,2,0,0}, + {4,0,2,0,0},{5,0,2,0,0},{6,0,2,0,0},{7,0,2,0,0},{8,0,2,0,0},{9,0,2,0,0},{10,0,2,0,0},{11,0,2,0,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{5,1,2,0,0},{6,1,2,0,0},{7,1,2,0,0}, + {8,1,2,0,0},{9,1,2,0,0},{10,1,2,0,0},{11,1,2,0,0},{0,2,2,0,0},{1,2,2,0,0},{2,2,2,0,0},{3,2,2,0,0},{4,2,2,0,0},{5,2,2,0,0},{6,2,2,0,0},{7,2,2,0,0},{8,2,2,0,0},{9,2,2,0,0},{10,2,2,0,0},{11,2,2,0,0}, + {0,3,2,0,0},{1,3,2,0,0},{2,3,2,0,0},{3,3,2,0,0},{4,3,2,0,0},{5,3,2,0,0},{6,3,2,0,0},{7,3,2,0,0},{8,3,2,0,0},{9,3,2,0,0},{10,3,2,0,0},{11,3,2,0,0},{1,4,2,201,0},{2,4,2,201,0},{3,4,2,201,0},{4,4,2,201,0}, + {5,4,2,201,0},{6,4,2,201,0},{7,4,2,201,0},{8,4,2,201,0},{9,4,2,201,0},{10,4,2,201,0},{0,5,2,0,0},{1,5,2,206,0},{2,5,2,0,0},{3,5,2,0,0},{4,5,2,0,0},{5,5,2,0,0},{6,5,2,0,0},{7,5,2,0,0},{8,5,2,0,0},{9,5,2,0,0}, + {10,5,2,206,0},{11,5,2,0,0},{0,6,2,0,0},{1,6,2,206,0},{2,6,2,0,0},{3,6,2,0,0},{4,6,2,0,0},{5,6,2,0,0},{6,6,2,0,0},{7,6,2,0,0},{8,6,2,0,0},{9,6,2,0,0},{10,6,2,206,0},{11,6,2,0,0},{0,7,2,0,0},{1,7,2,206,0}, + {2,7,2,0,0},{3,7,2,0,0},{4,7,2,0,0},{5,7,2,0,0},{6,7,2,0,0},{7,7,2,0,0},{8,7,2,0,0},{9,7,2,0,0},{10,7,2,206,0},{11,7,2,0,0},{0,0,3,0,0},{1,0,3,0,0},{2,0,3,0,0},{3,0,3,0,0},{4,0,3,0,0},{5,0,3,0,0}, + {6,0,3,0,0},{7,0,3,0,0},{8,0,3,0,0},{9,0,3,0,0},{10,0,3,0,0},{11,0,3,0,0},{0,1,3,0,0},{1,1,3,0,0},{2,1,3,0,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0},{8,1,3,0,0},{9,1,3,0,0}, + {10,1,3,0,0},{11,1,3,0,0},{0,2,3,0,0},{1,2,3,0,0},{2,2,3,0,0},{3,2,3,0,0},{4,2,3,0,0},{5,2,3,0,0},{6,2,3,0,0},{7,2,3,0,0},{8,2,3,0,0},{9,2,3,0,0},{10,2,3,0,0},{11,2,3,0,0},{0,3,3,0,0},{1,3,3,0,0}, + {2,3,3,0,0},{3,3,3,0,0},{4,3,3,0,0},{5,3,3,0,0},{6,3,3,0,0},{7,3,3,0,0},{8,3,3,0,0},{9,3,3,0,0},{10,3,3,0,0},{11,3,3,0,0},{1,4,3,201,0},{2,4,3,201,0},{3,4,3,0,0},{4,4,3,0,0},{5,4,3,0,0},{6,4,3,0,0}, + {7,4,3,0,0},{8,4,3,0,0},{9,4,3,201,0},{10,4,3,201,0},{0,5,3,0,0},{1,5,3,206,0},{2,5,3,0,0},{3,5,3,0,0},{4,5,3,0,0},{5,5,3,0,0},{6,5,3,0,0},{7,5,3,0,0},{8,5,3,0,0},{9,5,3,0,0},{10,5,3,206,0},{11,5,3,0,0}, + {0,6,3,0,0},{2,6,3,0,0},{3,6,3,0,0},{4,6,3,0,0},{5,6,3,0,0},{6,6,3,0,0},{7,6,3,0,0},{8,6,3,0,0},{9,6,3,0,0},{11,6,3,0,0},{0,7,3,0,0},{2,7,3,0,0},{3,7,3,0,0},{4,7,3,0,0},{5,7,3,0,0},{6,7,3,0,0}, + {7,7,3,0,0},{8,7,3,0,0},{9,7,3,0,0},{11,7,3,0,0},{0,0,4,0,0},{1,0,4,0,0},{2,0,4,0,0},{3,0,4,0,0},{4,0,4,0,0},{5,0,4,0,0},{6,0,4,0,0},{7,0,4,0,0},{8,0,4,0,0},{9,0,4,0,0},{10,0,4,0,0},{11,0,4,0,0}, + {0,1,4,0,0},{1,1,4,0,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0},{7,1,4,0,0},{8,1,4,0,0},{9,1,4,0,0},{10,1,4,0,0},{11,1,4,0,0},{0,2,4,0,0},{1,2,4,0,0},{2,2,4,0,0},{3,2,4,0,0}, + {4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0},{7,2,4,0,0},{8,2,4,0,0},{9,2,4,0,0},{10,2,4,0,0},{11,2,4,0,0},{0,3,4,0,0},{1,3,4,0,0},{2,3,4,0,0},{3,3,4,0,0},{4,3,4,0,0},{6,3,4,0,0},{7,3,4,0,0},{8,3,4,0,0}, + {9,3,4,0,0},{10,3,4,0,0},{11,3,4,0,0},{1,4,4,201,0},{2,4,4,201,0},{3,4,4,0,0},{4,4,4,0,0},{5,4,4,0,0},{6,4,4,0,0},{7,4,4,0,0},{8,4,4,0,0},{9,4,4,201,0},{10,4,4,201,0},{0,5,4,0,0},{1,5,4,206,0},{2,5,4,0,0}, + {3,5,4,0,0},{4,5,4,0,0},{5,5,4,0,0},{6,5,4,0,0},{7,5,4,0,0},{8,5,4,0,0},{9,5,4,0,0},{10,5,4,206,0},{11,5,4,0,0},{0,6,4,0,0},{1,6,4,206,0},{2,6,4,0,0},{3,6,4,0,0},{4,6,4,0,0},{5,6,4,0,0},{6,6,4,0,0}, + {7,6,4,0,0},{8,6,4,0,0},{9,6,4,0,0},{10,6,4,206,0},{11,6,4,0,0},{0,7,4,0,0},{1,7,4,206,0},{2,7,4,0,0},{3,7,4,0,0},{4,7,4,0,0},{5,7,4,0,0},{6,7,4,0,0},{7,7,4,0,0},{8,7,4,0,0},{9,7,4,0,0},{10,7,4,206,0}, + {11,7,4,0,0},{0,0,5,0,0},{1,0,5,0,0},{2,0,5,0,0},{3,0,5,0,0},{4,0,5,0,0},{5,0,5,0,0},{6,0,5,0,0},{7,0,5,0,0},{8,0,5,0,0},{9,0,5,0,0},{10,0,5,0,0},{11,0,5,0,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,0,0}, + {3,1,5,0,0},{4,1,5,0,0},{5,1,5,201,0},{6,1,5,201,0},{7,1,5,0,0},{8,1,5,0,0},{9,1,5,0,0},{10,1,5,0,0},{11,1,5,0,0},{0,2,5,0,0},{1,2,5,0,0},{2,2,5,0,0},{3,2,5,0,0},{4,2,5,0,0},{5,2,5,201,0},{8,2,5,0,0}, + {9,2,5,0,0},{10,2,5,0,0},{11,2,5,0,0},{0,3,5,0,0},{1,3,5,0,0},{2,3,5,0,0},{3,3,5,0,0},{4,3,5,0,0},{6,3,5,0,0},{7,3,5,0,0},{8,3,5,0,0},{9,3,5,0,0},{10,3,5,0,0},{11,3,5,0,0},{1,4,5,201,0},{2,4,5,201,0}, + {3,4,5,0,0},{4,4,5,0,0},{5,4,5,0,0},{6,4,5,0,0},{7,4,5,0,0},{8,4,5,0,0},{9,4,5,201,0},{10,4,5,201,0},{0,5,5,0,0},{1,5,5,206,0},{2,5,5,0,0},{3,5,5,0,0},{4,5,5,0,0},{5,5,5,0,0},{6,5,5,0,0},{7,5,5,0,0}, + {8,5,5,0,0},{9,5,5,0,0},{10,5,5,206,0},{11,5,5,0,0},{0,6,5,0,0},{1,6,5,206,0},{2,6,5,0,0},{3,6,5,0,0},{4,6,5,0,0},{5,6,5,0,0},{6,6,5,0,0},{7,6,5,0,0},{8,6,5,0,0},{9,6,5,0,0},{10,6,5,206,0},{11,6,5,0,0}, + {0,7,5,0,0},{1,7,5,206,0},{2,7,5,0,0},{3,7,5,0,0},{4,7,5,0,0},{5,7,5,0,0},{6,7,5,0,0},{7,7,5,0,0},{8,7,5,0,0},{9,7,5,0,0},{10,7,5,206,0},{11,7,5,0,0},{0,0,6,0,0},{1,0,6,0,0},{2,0,6,0,0},{3,0,6,0,0}, + {4,0,6,0,0},{5,0,6,0,0},{6,0,6,0,0},{7,0,6,0,0},{8,0,6,0,0},{9,0,6,0,0},{10,0,6,0,0},{11,0,6,0,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,201,0},{7,1,6,0,0},{8,1,6,0,0}, + {9,1,6,0,0},{10,1,6,0,0},{11,1,6,0,0},{0,2,6,0,0},{1,2,6,0,0},{2,2,6,0,0},{3,2,6,0,0},{4,2,6,0,0},{5,2,6,201,0},{6,2,6,0,0},{7,2,6,0,0},{8,2,6,0,0},{9,2,6,0,0},{10,2,6,0,0},{11,2,6,0,0},{0,3,6,0,0}, + {1,3,6,0,0},{2,3,6,0,0},{3,3,6,0,0},{5,3,6,201,0},{6,3,6,0,0},{7,3,6,0,0},{8,3,6,0,0},{9,3,6,0,0},{10,3,6,0,0},{11,3,6,0,0},{1,4,6,201,0},{2,4,6,201,0},{3,4,6,0,0},{4,4,6,0,0},{9,4,6,201,0},{10,4,6,201,0}, + {0,5,6,0,0},{1,5,6,206,0},{2,5,6,0,0},{3,5,6,0,0},{4,5,6,0,0},{5,5,6,0,0},{6,5,6,0,0},{7,5,6,0,0},{9,5,6,0,0},{10,5,6,206,0},{11,5,6,0,0},{0,6,6,0,0},{1,6,6,206,0},{2,6,6,0,0},{3,6,6,0,0},{4,6,6,0,0}, + {5,6,6,0,0},{6,6,6,0,0},{7,6,6,0,0},{8,6,6,0,0},{9,6,6,0,0},{10,6,6,206,0},{11,6,6,0,0},{0,7,6,0,0},{1,7,6,206,0},{2,7,6,0,0},{3,7,6,0,0},{4,7,6,0,0},{5,7,6,0,0},{6,7,6,0,0},{7,7,6,0,0},{8,7,6,0,0}, + {9,7,6,0,0},{10,7,6,206,0},{11,7,6,0,0},{0,0,7,0,0},{1,0,7,0,0},{2,0,7,0,0},{3,0,7,0,0},{4,0,7,0,0},{5,0,7,0,0},{6,0,7,0,0},{7,0,7,0,0},{8,0,7,0,0},{9,0,7,0,0},{10,0,7,0,0},{11,0,7,0,0},{0,1,7,0,0}, + {1,1,7,0,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{7,1,7,0,0},{8,1,7,0,0},{9,1,7,0,0},{10,1,7,0,0},{11,1,7,0,0},{0,2,7,0,0},{1,2,7,0,0},{2,2,7,0,0},{3,2,7,0,0},{4,2,7,0,0},{5,2,7,0,0}, + {6,2,7,0,0},{7,2,7,0,0},{8,2,7,0,0},{9,2,7,0,0},{10,2,7,0,0},{11,2,7,0,0},{0,3,7,0,0},{1,3,7,0,0},{2,3,7,0,0},{3,3,7,0,0},{4,3,7,0,0},{5,3,7,0,0},{6,3,7,0,0},{7,3,7,0,0},{8,3,7,0,0},{9,3,7,0,0}, + {10,3,7,0,0},{11,3,7,0,0},{1,4,7,201,0},{2,4,7,201,0},{3,4,7,0,0},{4,4,7,0,0},{5,4,7,0,0},{6,4,7,0,0},{7,4,7,0,0},{8,4,7,0,0},{9,4,7,201,0},{10,4,7,201,0},{0,5,7,0,0},{1,5,7,206,0},{2,5,7,0,0},{3,5,7,0,0}, + {4,5,7,0,0},{5,5,7,0,0},{6,5,7,0,0},{7,5,7,0,0},{8,5,7,0,0},{10,5,7,206,0},{11,5,7,0,0},{0,6,7,0,0},{1,6,7,206,0},{2,6,7,0,0},{3,6,7,0,0},{4,6,7,0,0},{5,6,7,0,0},{6,6,7,0,0},{7,6,7,0,0},{8,6,7,0,0}, + {10,6,7,206,0},{11,6,7,0,0},{0,7,7,0,0},{1,7,7,206,0},{2,7,7,0,0},{3,7,7,0,0},{4,7,7,0,0},{5,7,7,0,0},{6,7,7,0,0},{7,7,7,0,0},{10,7,7,206,0},{11,7,7,0,0},{0,0,8,0,0},{1,0,8,0,0},{2,0,8,0,0},{3,0,8,0,0}, + {4,0,8,0,0},{5,0,8,0,0},{6,0,8,0,0},{7,0,8,0,0},{8,0,8,0,0},{9,0,8,0,0},{10,0,8,0,0},{11,0,8,0,0},{0,1,8,0,0},{1,1,8,0,0},{2,1,8,0,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,0,0},{7,1,8,0,0}, + {8,1,8,0,0},{9,1,8,0,0},{10,1,8,0,0},{11,1,8,0,0},{0,2,8,0,0},{1,2,8,0,0},{2,2,8,0,0},{3,2,8,0,0},{4,2,8,0,0},{5,2,8,0,0},{6,2,8,0,0},{7,2,8,0,0},{8,2,8,0,0},{9,2,8,0,0},{10,2,8,0,0},{11,2,8,0,0}, + {0,3,8,0,0},{1,3,8,0,0},{2,3,8,0,0},{3,3,8,0,0},{4,3,8,0,0},{5,3,8,0,0},{6,3,8,0,0},{7,3,8,0,0},{8,3,8,0,0},{9,3,8,0,0},{10,3,8,0,0},{11,3,8,0,0},{1,4,8,201,0},{2,4,8,201,0},{3,4,8,0,0},{4,4,8,0,0}, + {5,4,8,0,0},{6,4,8,0,0},{7,4,8,0,0},{8,4,8,0,0},{9,4,8,201,0},{10,4,8,201,0},{0,5,8,0,0},{1,5,8,206,0},{2,5,8,0,0},{3,5,8,0,0},{4,5,8,0,0},{5,5,8,0,0},{6,5,8,0,0},{7,5,8,0,0},{8,5,8,0,0},{10,5,8,206,0}, + {11,5,8,0,0},{0,6,8,0,0},{2,6,8,0,0},{3,6,8,0,0},{4,6,8,0,0},{5,6,8,0,0},{6,6,8,0,0},{7,6,8,0,0},{8,6,8,0,0},{10,6,8,206,0},{11,6,8,0,0},{0,7,8,0,0},{2,7,8,0,0},{3,7,8,0,0},{4,7,8,0,0},{5,7,8,0,0}, + {6,7,8,0,0},{7,7,8,0,0},{10,7,8,206,0},{11,7,8,0,0},{0,0,9,0,0},{1,0,9,0,0},{2,0,9,0,0},{3,0,9,0,0},{4,0,9,0,0},{5,0,9,0,0},{6,0,9,0,0},{7,0,9,0,0},{8,0,9,0,0},{9,0,9,0,0},{10,0,9,0,0},{11,0,9,0,0}, + {0,1,9,0,0},{1,1,9,0,0},{2,1,9,0,0},{3,1,9,0,0},{4,1,9,0,0},{5,1,9,0,0},{6,1,9,0,0},{7,1,9,0,0},{8,1,9,0,0},{9,1,9,0,0},{10,1,9,0,0},{11,1,9,0,0},{0,2,9,0,0},{1,2,9,0,0},{2,2,9,0,0},{3,2,9,0,0}, + {4,2,9,0,0},{5,2,9,0,0},{6,2,9,0,0},{7,2,9,0,0},{8,2,9,0,0},{9,2,9,0,0},{10,2,9,0,0},{11,2,9,0,0},{0,3,9,0,0},{1,3,9,0,0},{2,3,9,0,0},{3,3,9,0,0},{4,3,9,0,0},{5,3,9,0,0},{6,3,9,0,0},{7,3,9,0,0}, + {8,3,9,0,0},{9,3,9,0,0},{10,3,9,0,0},{11,3,9,0,0},{1,4,9,201,0},{2,4,9,201,0},{3,4,9,201,0},{4,4,9,201,0},{5,4,9,201,0},{6,4,9,201,0},{7,4,9,201,0},{8,4,9,201,0},{9,4,9,201,0},{10,4,9,201,0},{0,5,9,0,0},{1,5,9,206,0}, + {2,5,9,0,0},{3,5,9,0,0},{4,5,9,0,0},{5,5,9,0,0},{6,5,9,0,0},{7,5,9,0,0},{8,5,9,0,0},{9,5,9,0,0},{10,5,9,206,0},{11,5,9,0,0},{0,6,9,0,0},{1,6,9,206,0},{2,6,9,0,0},{3,6,9,0,0},{4,6,9,0,0},{5,6,9,0,0}, + {6,6,9,0,0},{7,6,9,0,0},{8,6,9,0,0},{9,6,9,0,0},{10,6,9,206,0},{11,6,9,0,0},{0,7,9,0,0},{1,7,9,206,0},{2,7,9,0,0},{3,7,9,0,0},{4,7,9,0,0},{5,7,9,0,0},{6,7,9,0,0},{7,7,9,0,0},{8,7,9,0,0},{9,7,9,0,0}, + {10,7,9,206,0},{11,7,9,0,0},{0,0,10,0,0},{1,0,10,0,0},{2,0,10,0,0},{3,0,10,0,0},{4,0,10,0,0},{5,0,10,0,0},{6,0,10,0,0},{7,0,10,0,0},{8,0,10,0,0},{9,0,10,0,0},{10,0,10,0,0},{11,0,10,0,0},{0,1,10,0,0},{1,1,10,0,0}, + {2,1,10,0,0},{3,1,10,0,0},{4,1,10,0,0},{5,1,10,0,0},{6,1,10,0,0},{7,1,10,0,0},{8,1,10,0,0},{9,1,10,0,0},{10,1,10,0,0},{11,1,10,0,0},{0,2,10,0,0},{1,2,10,0,0},{2,2,10,0,0},{3,2,10,0,0},{4,2,10,0,0},{5,2,10,0,0}, + {6,2,10,0,0},{7,2,10,0,0},{8,2,10,0,0},{9,2,10,0,0},{10,2,10,0,0},{11,2,10,0,0},{0,3,10,0,0},{1,3,10,0,0},{2,3,10,0,0},{3,3,10,0,0},{4,3,10,0,0},{5,3,10,0,0},{6,3,10,0,0},{7,3,10,0,0},{8,3,10,0,0},{9,3,10,0,0}, + {10,3,10,0,0},{11,3,10,0,0},{1,4,10,201,0},{2,4,10,201,0},{3,4,10,201,0},{4,4,10,201,0},{5,4,10,201,0},{6,4,10,201,0},{7,4,10,201,0},{8,4,10,201,0},{9,4,10,201,0},{10,4,10,201,0},{0,5,10,0,0},{1,5,10,202,0},{2,5,10,206,0},{3,5,10,206,0}, + {4,5,10,206,0},{5,5,10,206,0},{6,5,10,206,0},{7,5,10,206,0},{8,5,10,206,0},{9,5,10,206,0},{10,5,10,202,0},{11,5,10,0,0},{0,6,10,0,0},{1,6,10,202,0},{2,6,10,206,0},{4,6,10,206,0},{5,6,10,206,0},{6,6,10,206,0},{7,6,10,206,0},{9,6,10,206,0}, + {10,6,10,202,0},{11,6,10,0,0},{0,7,10,0,0},{1,7,10,202,0},{2,7,10,206,0},{4,7,10,206,0},{5,7,10,206,0},{6,7,10,206,0},{7,7,10,206,0},{9,7,10,206,0},{10,7,10,202,0},{11,7,10,0,0},{0,0,11,0,0},{1,0,11,0,0},{2,0,11,0,0},{3,0,11,0,0}, + {4,0,11,0,0},{5,0,11,0,0},{6,0,11,0,0},{7,0,11,0,0},{8,0,11,0,0},{9,0,11,0,0},{10,0,11,0,0},{11,0,11,0,0},{0,1,11,0,0},{1,1,11,0,0},{2,1,11,0,0},{3,1,11,0,0},{4,1,11,0,0},{5,1,11,0,0},{6,1,11,0,0},{7,1,11,0,0}, + {8,1,11,0,0},{9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0},{0,2,11,0,0},{1,2,11,0,0},{2,2,11,0,0},{3,2,11,0,0},{4,2,11,0,0},{5,2,11,0,0},{6,2,11,0,0},{7,2,11,0,0},{8,2,11,0,0},{9,2,11,0,0},{10,2,11,0,0},{11,2,11,0,0}, + {0,3,11,0,0},{1,3,11,0,0},{2,3,11,0,0},{3,3,11,0,0},{4,3,11,0,0},{5,3,11,0,0},{6,3,11,0,0},{7,3,11,0,0},{8,3,11,0,0},{9,3,11,0,0},{10,3,11,0,0},{11,3,11,0,0},{1,5,11,0,0},{2,5,11,0,0},{3,5,11,0,0},{4,5,11,0,0}, + {5,5,11,0,0},{6,5,11,0,0},{7,5,11,0,0},{8,5,11,0,0},{9,5,11,0,0},{10,5,11,0,0},{0,6,11,0,0},{1,6,11,0,0},{2,6,11,0,0},{3,6,11,0,0},{4,6,11,0,0},{5,6,11,0,0},{6,6,11,0,0},{7,6,11,0,0},{8,6,11,0,0},{9,6,11,0,0}, + {10,6,11,0,0},{11,6,11,0,0},{0,7,11,0,0},{1,7,11,0,0},{2,7,11,0,0},{3,7,11,0,0},{4,7,11,0,0},{5,7,11,0,0},{6,7,11,0,0},{7,7,11,0,0},{8,7,11,0,0},{9,7,11,0,0},{10,7,11,0,0},{11,7,11,0,0},{0,4,0,203,4},{1,4,0,203,6}, + {2,4,0,203,2},{3,4,0,203,6},{4,4,0,203,6},{5,4,0,203,2},{6,4,0,203,2},{7,4,0,203,6},{8,4,0,203,6},{9,4,0,203,2},{10,4,0,203,6},{11,4,0,203,6},{0,5,0,198,1},{11,5,0,198,1},{0,4,1,203,4},{11,4,1,203,5},{3,6,1,95,2},{8,6,1,95,2}, + {3,7,1,95,2},{8,7,1,95,2},{0,4,2,203,0},{11,4,2,203,1},{0,4,3,203,4},{11,4,3,203,5},{1,6,3,95,2},{10,6,3,95,2},{1,7,3,95,2},{10,7,3,95,2},{5,3,4,205,0},{0,4,4,203,4},{11,4,4,203,5},{6,2,5,203,1},{7,2,5,205,0},{5,3,5,203,2}, + {0,4,5,203,0},{11,4,5,203,1},{6,1,6,203,3},{4,3,6,205,8},{0,4,6,203,0},{5,4,6,203,0},{6,4,6,205,8},{7,4,6,205,8},{8,4,6,205,8},{11,4,6,203,1},{6,1,7,205,0},{0,4,7,203,4},{11,4,7,203,5},{9,5,7,203,4},{9,6,7,203,0},{8,7,7,205,8}, + {9,7,7,203,4},{0,4,8,203,4},{11,4,8,203,5},{9,5,8,203,4},{1,6,8,95,2},{9,6,8,203,0},{1,7,8,95,2},{8,7,8,205,8},{9,7,8,203,4},{0,4,9,203,0},{11,4,9,203,1},{0,4,10,203,4},{11,4,10,203,5},{3,6,10,95,2},{8,6,10,95,2},{3,7,10,95,2}, + {8,7,10,95,2},{0,4,11,203,7},{1,4,11,203,7},{2,4,11,203,3},{3,4,11,203,7},{4,4,11,203,7},{5,4,11,203,3},{6,4,11,203,3},{7,4,11,203,7},{8,4,11,203,7},{9,4,11,203,3},{10,4,11,203,7},{11,4,11,203,5},{0,5,11,198,1},{11,5,11,198,1}, +}; +static const EndCityTemplates::Extra s_second_floor_2_extras[] = { + {8,5,6,EndCityTemplates::EXTRA_SENTRY,0}, +}; + +static const EndCityTemplates::Block s_second_roof_blocks[] = { + {0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{12,1,0,0,0},{13,1,0,0,0},{1,0,1,201,0},{2,0,1,201,0}, + {3,0,1,201,0},{4,0,1,201,0},{5,0,1,201,0},{6,0,1,201,0},{7,0,1,201,0},{8,0,1,201,0},{9,0,1,201,0},{10,0,1,201,0},{11,0,1,201,0},{12,0,1,201,0},{0,1,1,0,0},{2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0}, + {7,1,1,0,0},{8,1,1,0,0},{9,1,1,0,0},{10,1,1,0,0},{11,1,1,0,0},{13,1,1,0,0},{1,0,2,201,0},{2,0,2,201,0},{3,0,2,201,0},{4,0,2,201,0},{5,0,2,201,0},{6,0,2,201,0},{7,0,2,201,0},{8,0,2,201,0},{9,0,2,201,0},{10,0,2,201,0}, + {11,0,2,201,0},{12,0,2,201,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{5,1,2,0,0},{6,1,2,0,0},{7,1,2,0,0},{8,1,2,0,0},{9,1,2,0,0},{10,1,2,0,0},{11,1,2,0,0},{12,1,2,0,0},{13,1,2,0,0}, + {1,0,3,201,0},{2,0,3,201,0},{3,0,3,201,0},{4,0,3,201,0},{5,0,3,201,0},{6,0,3,201,0},{7,0,3,201,0},{8,0,3,201,0},{9,0,3,201,0},{10,0,3,201,0},{11,0,3,201,0},{12,0,3,201,0},{0,1,3,0,0},{1,1,3,0,0},{2,1,3,0,0},{3,1,3,0,0}, + {4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0},{8,1,3,0,0},{9,1,3,0,0},{10,1,3,0,0},{11,1,3,0,0},{12,1,3,0,0},{13,1,3,0,0},{1,0,4,201,0},{2,0,4,201,0},{3,0,4,201,0},{4,0,4,201,0},{5,0,4,201,0},{6,0,4,201,0}, + {7,0,4,201,0},{8,0,4,201,0},{9,0,4,201,0},{10,0,4,201,0},{11,0,4,201,0},{12,0,4,201,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0},{7,1,4,0,0},{8,1,4,0,0},{9,1,4,0,0}, + {10,1,4,0,0},{11,1,4,0,0},{12,1,4,0,0},{13,1,4,0,0},{1,0,5,201,0},{2,0,5,201,0},{3,0,5,201,0},{4,0,5,201,0},{5,0,5,201,0},{6,0,5,201,0},{7,0,5,201,0},{8,0,5,201,0},{9,0,5,201,0},{10,0,5,201,0},{11,0,5,201,0},{12,0,5,201,0}, + {0,1,5,0,0},{1,1,5,0,0},{2,1,5,0,0},{3,1,5,0,0},{4,1,5,0,0},{5,1,5,0,0},{6,1,5,0,0},{7,1,5,0,0},{8,1,5,0,0},{9,1,5,0,0},{10,1,5,0,0},{11,1,5,0,0},{12,1,5,0,0},{13,1,5,0,0},{1,0,6,201,0},{2,0,6,201,0}, + {3,0,6,201,0},{4,0,6,201,0},{5,0,6,201,0},{6,0,6,201,0},{7,0,6,201,0},{8,0,6,201,0},{9,0,6,201,0},{10,0,6,201,0},{11,0,6,201,0},{12,0,6,201,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0}, + {6,1,6,0,0},{7,1,6,0,0},{8,1,6,0,0},{9,1,6,0,0},{10,1,6,0,0},{11,1,6,0,0},{12,1,6,0,0},{13,1,6,0,0},{1,0,7,201,0},{2,0,7,201,0},{3,0,7,201,0},{4,0,7,201,0},{5,0,7,201,0},{6,0,7,201,0},{7,0,7,201,0},{8,0,7,201,0}, + {9,0,7,201,0},{10,0,7,201,0},{11,0,7,201,0},{12,0,7,201,0},{0,1,7,0,0},{1,1,7,0,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{6,1,7,0,0},{7,1,7,0,0},{8,1,7,0,0},{9,1,7,0,0},{10,1,7,0,0},{11,1,7,0,0}, + {12,1,7,0,0},{13,1,7,0,0},{1,0,8,201,0},{2,0,8,201,0},{3,0,8,201,0},{4,0,8,201,0},{5,0,8,201,0},{6,0,8,201,0},{7,0,8,201,0},{8,0,8,201,0},{9,0,8,201,0},{10,0,8,201,0},{11,0,8,201,0},{12,0,8,201,0},{0,1,8,0,0},{1,1,8,0,0}, + {2,1,8,0,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,0,0},{7,1,8,0,0},{8,1,8,0,0},{9,1,8,0,0},{10,1,8,0,0},{11,1,8,0,0},{12,1,8,0,0},{13,1,8,0,0},{1,0,9,201,0},{2,0,9,201,0},{3,0,9,201,0},{4,0,9,201,0}, + {5,0,9,201,0},{6,0,9,201,0},{7,0,9,201,0},{8,0,9,201,0},{9,0,9,201,0},{10,0,9,201,0},{11,0,9,201,0},{12,0,9,201,0},{0,1,9,0,0},{1,1,9,0,0},{2,1,9,0,0},{3,1,9,0,0},{4,1,9,0,0},{5,1,9,0,0},{6,1,9,0,0},{7,1,9,0,0}, + {8,1,9,0,0},{9,1,9,0,0},{10,1,9,0,0},{11,1,9,0,0},{12,1,9,0,0},{13,1,9,0,0},{1,0,10,201,0},{2,0,10,201,0},{3,0,10,201,0},{4,0,10,201,0},{5,0,10,201,0},{6,0,10,201,0},{7,0,10,201,0},{8,0,10,201,0},{9,0,10,201,0},{10,0,10,201,0}, + {11,0,10,201,0},{12,0,10,201,0},{0,1,10,0,0},{1,1,10,0,0},{2,1,10,0,0},{3,1,10,0,0},{4,1,10,0,0},{5,1,10,0,0},{6,1,10,0,0},{7,1,10,0,0},{8,1,10,0,0},{9,1,10,0,0},{10,1,10,0,0},{11,1,10,0,0},{12,1,10,0,0},{13,1,10,0,0}, + {1,0,11,201,0},{2,0,11,201,0},{3,0,11,201,0},{4,0,11,201,0},{5,0,11,201,0},{6,0,11,201,0},{7,0,11,201,0},{8,0,11,201,0},{9,0,11,201,0},{10,0,11,201,0},{11,0,11,201,0},{12,0,11,201,0},{0,1,11,0,0},{1,1,11,0,0},{2,1,11,0,0},{3,1,11,0,0}, + {4,1,11,0,0},{5,1,11,0,0},{6,1,11,0,0},{7,1,11,0,0},{8,1,11,0,0},{9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0},{12,1,11,0,0},{13,1,11,0,0},{1,0,12,201,0},{2,0,12,201,0},{3,0,12,201,0},{4,0,12,201,0},{5,0,12,201,0},{6,0,12,201,0}, + {7,0,12,201,0},{8,0,12,201,0},{9,0,12,201,0},{10,0,12,201,0},{11,0,12,201,0},{12,0,12,201,0},{0,1,12,0,0},{2,1,12,0,0},{3,1,12,0,0},{4,1,12,0,0},{5,1,12,0,0},{6,1,12,0,0},{7,1,12,0,0},{8,1,12,0,0},{9,1,12,0,0},{10,1,12,0,0}, + {11,1,12,0,0},{13,1,12,0,0},{0,1,13,0,0},{1,1,13,0,0},{2,1,13,0,0},{3,1,13,0,0},{4,1,13,0,0},{5,1,13,0,0},{6,1,13,0,0},{7,1,13,0,0},{8,1,13,0,0},{9,1,13,0,0},{10,1,13,0,0},{11,1,13,0,0},{12,1,13,0,0},{13,1,13,0,0}, + {0,0,0,203,4},{1,0,0,203,6},{2,0,0,203,2},{3,0,0,203,2},{4,0,0,203,6},{5,0,0,203,6},{6,0,0,203,2},{7,0,0,203,2},{8,0,0,203,6},{9,0,0,203,6},{10,0,0,203,2},{11,0,0,203,2},{12,0,0,203,6},{13,0,0,203,6},{0,0,1,203,4},{13,0,1,203,5}, + {1,1,1,198,1},{12,1,1,198,1},{0,0,2,203,0},{13,0,2,203,1},{0,0,3,203,0},{13,0,3,203,1},{0,0,4,203,4},{13,0,4,203,5},{0,0,5,203,4},{13,0,5,203,5},{0,0,6,203,0},{13,0,6,203,1},{0,0,7,203,0},{13,0,7,203,1},{0,0,8,203,4},{13,0,8,203,5}, + {0,0,9,203,4},{13,0,9,203,5},{0,0,10,203,0},{13,0,10,203,1},{0,0,11,203,0},{13,0,11,203,1},{0,0,12,203,4},{13,0,12,203,5},{1,1,12,198,1},{12,1,12,198,1},{0,0,13,203,7},{1,0,13,203,7},{2,0,13,203,3},{3,0,13,203,3},{4,0,13,203,7},{5,0,13,203,7}, + {6,0,13,203,3},{7,0,13,203,3},{8,0,13,203,7},{9,0,13,203,7},{10,0,13,203,3},{11,0,13,203,3},{12,0,13,203,7},{13,0,13,203,5}, +}; + +static const EndCityTemplates::Block s_ship_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{7,0,0,0,0},{8,0,0,0,0},{9,0,0,0,0},{10,0,0,0,0},{11,0,0,0,0},{12,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0}, + {3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{12,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,0,0},{5,2,0,0,0}, + {6,2,0,0,0},{7,2,0,0,0},{8,2,0,0,0},{9,2,0,0,0},{10,2,0,0,0},{11,2,0,0,0},{12,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0},{6,3,0,0,0},{7,3,0,0,0},{8,3,0,0,0}, + {9,3,0,0,0},{10,3,0,0,0},{11,3,0,0,0},{12,3,0,0,0},{0,4,0,0,0},{1,4,0,0,0},{2,4,0,0,0},{3,4,0,0,0},{4,4,0,0,0},{5,4,0,0,0},{6,4,0,0,0},{7,4,0,0,0},{8,4,0,0,0},{9,4,0,0,0},{10,4,0,0,0},{11,4,0,0,0}, + {12,4,0,0,0},{0,5,0,0,0},{1,5,0,0,0},{2,5,0,0,0},{3,5,0,0,0},{4,5,0,0,0},{5,5,0,0,0},{6,5,0,0,0},{7,5,0,0,0},{8,5,0,0,0},{9,5,0,0,0},{10,5,0,0,0},{11,5,0,0,0},{12,5,0,0,0},{0,6,0,0,0},{1,6,0,0,0}, + {2,6,0,0,0},{3,6,0,0,0},{4,6,0,0,0},{5,6,0,0,0},{6,6,0,0,0},{7,6,0,0,0},{8,6,0,0,0},{9,6,0,0,0},{10,6,0,0,0},{11,6,0,0,0},{12,6,0,0,0},{0,7,0,0,0},{1,7,0,0,0},{2,7,0,0,0},{3,7,0,0,0},{4,7,0,0,0}, + {5,7,0,0,0},{6,7,0,0,0},{7,7,0,0,0},{8,7,0,0,0},{9,7,0,0,0},{10,7,0,0,0},{11,7,0,0,0},{12,7,0,0,0},{0,8,0,0,0},{1,8,0,0,0},{2,8,0,0,0},{3,8,0,0,0},{4,8,0,0,0},{5,8,0,0,0},{7,8,0,0,0},{8,8,0,0,0}, + {9,8,0,0,0},{10,8,0,0,0},{11,8,0,0,0},{12,8,0,0,0},{0,9,0,0,0},{1,9,0,0,0},{2,9,0,0,0},{3,9,0,0,0},{4,9,0,0,0},{5,9,0,0,0},{6,9,0,0,0},{7,9,0,0,0},{8,9,0,0,0},{9,9,0,0,0},{10,9,0,0,0},{11,9,0,0,0}, + {12,9,0,0,0},{0,10,0,0,0},{1,10,0,0,0},{2,10,0,0,0},{3,10,0,0,0},{4,10,0,0,0},{5,10,0,0,0},{6,10,0,0,0},{7,10,0,0,0},{8,10,0,0,0},{9,10,0,0,0},{10,10,0,0,0},{11,10,0,0,0},{12,10,0,0,0},{0,11,0,0,0},{1,11,0,0,0}, + {2,11,0,0,0},{3,11,0,0,0},{4,11,0,0,0},{5,11,0,0,0},{6,11,0,0,0},{7,11,0,0,0},{8,11,0,0,0},{9,11,0,0,0},{10,11,0,0,0},{11,11,0,0,0},{12,11,0,0,0},{0,12,0,0,0},{1,12,0,0,0},{2,12,0,0,0},{3,12,0,0,0},{4,12,0,0,0}, + {5,12,0,0,0},{6,12,0,0,0},{7,12,0,0,0},{8,12,0,0,0},{9,12,0,0,0},{10,12,0,0,0},{11,12,0,0,0},{12,12,0,0,0},{0,13,0,0,0},{1,13,0,0,0},{2,13,0,0,0},{3,13,0,0,0},{4,13,0,0,0},{5,13,0,0,0},{6,13,0,0,0},{7,13,0,0,0}, + {8,13,0,0,0},{9,13,0,0,0},{10,13,0,0,0},{11,13,0,0,0},{12,13,0,0,0},{0,14,0,0,0},{1,14,0,0,0},{2,14,0,0,0},{3,14,0,0,0},{4,14,0,0,0},{5,14,0,0,0},{6,14,0,0,0},{7,14,0,0,0},{8,14,0,0,0},{9,14,0,0,0},{10,14,0,0,0}, + {11,14,0,0,0},{12,14,0,0,0},{0,15,0,0,0},{1,15,0,0,0},{2,15,0,0,0},{3,15,0,0,0},{4,15,0,0,0},{5,15,0,0,0},{6,15,0,0,0},{7,15,0,0,0},{8,15,0,0,0},{9,15,0,0,0},{10,15,0,0,0},{11,15,0,0,0},{12,15,0,0,0},{0,16,0,0,0}, + {1,16,0,0,0},{2,16,0,0,0},{3,16,0,0,0},{4,16,0,0,0},{5,16,0,0,0},{6,16,0,0,0},{7,16,0,0,0},{8,16,0,0,0},{9,16,0,0,0},{10,16,0,0,0},{11,16,0,0,0},{12,16,0,0,0},{0,17,0,0,0},{1,17,0,0,0},{2,17,0,0,0},{3,17,0,0,0}, + {4,17,0,0,0},{5,17,0,0,0},{6,17,0,0,0},{7,17,0,0,0},{8,17,0,0,0},{9,17,0,0,0},{10,17,0,0,0},{11,17,0,0,0},{12,17,0,0,0},{0,18,0,0,0},{1,18,0,0,0},{2,18,0,0,0},{3,18,0,0,0},{4,18,0,0,0},{5,18,0,0,0},{6,18,0,0,0}, + {7,18,0,0,0},{8,18,0,0,0},{9,18,0,0,0},{10,18,0,0,0},{11,18,0,0,0},{12,18,0,0,0},{0,19,0,0,0},{1,19,0,0,0},{2,19,0,0,0},{3,19,0,0,0},{4,19,0,0,0},{5,19,0,0,0},{6,19,0,0,0},{7,19,0,0,0},{8,19,0,0,0},{9,19,0,0,0}, + {10,19,0,0,0},{11,19,0,0,0},{12,19,0,0,0},{0,20,0,0,0},{1,20,0,0,0},{2,20,0,0,0},{3,20,0,0,0},{4,20,0,0,0},{5,20,0,0,0},{6,20,0,0,0},{7,20,0,0,0},{8,20,0,0,0},{9,20,0,0,0},{10,20,0,0,0},{11,20,0,0,0},{12,20,0,0,0}, + {0,21,0,0,0},{1,21,0,0,0},{2,21,0,0,0},{3,21,0,0,0},{4,21,0,0,0},{5,21,0,0,0},{6,21,0,0,0},{7,21,0,0,0},{8,21,0,0,0},{9,21,0,0,0},{10,21,0,0,0},{11,21,0,0,0},{12,21,0,0,0},{0,22,0,0,0},{1,22,0,0,0},{2,22,0,0,0}, + {3,22,0,0,0},{4,22,0,0,0},{5,22,0,0,0},{6,22,0,0,0},{7,22,0,0,0},{8,22,0,0,0},{9,22,0,0,0},{10,22,0,0,0},{11,22,0,0,0},{12,22,0,0,0},{0,23,0,0,0},{1,23,0,0,0},{2,23,0,0,0},{3,23,0,0,0},{4,23,0,0,0},{5,23,0,0,0}, + {6,23,0,0,0},{7,23,0,0,0},{8,23,0,0,0},{9,23,0,0,0},{10,23,0,0,0},{11,23,0,0,0},{12,23,0,0,0},{0,0,1,0,0},{1,0,1,0,0},{2,0,1,0,0},{3,0,1,0,0},{4,0,1,0,0},{5,0,1,0,0},{6,0,1,0,0},{7,0,1,0,0},{8,0,1,0,0}, + {9,0,1,0,0},{10,0,1,0,0},{11,0,1,0,0},{12,0,1,0,0},{0,1,1,0,0},{1,1,1,0,0},{2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0},{7,1,1,0,0},{8,1,1,0,0},{9,1,1,0,0},{10,1,1,0,0},{11,1,1,0,0}, + {12,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0},{4,2,1,0,0},{5,2,1,0,0},{6,2,1,0,0},{7,2,1,0,0},{8,2,1,0,0},{9,2,1,0,0},{10,2,1,0,0},{11,2,1,0,0},{12,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0}, + {2,3,1,0,0},{3,3,1,0,0},{4,3,1,0,0},{5,3,1,0,0},{6,3,1,0,0},{7,3,1,0,0},{8,3,1,0,0},{9,3,1,0,0},{10,3,1,0,0},{11,3,1,0,0},{12,3,1,0,0},{0,4,1,0,0},{1,4,1,0,0},{2,4,1,0,0},{3,4,1,0,0},{4,4,1,0,0}, + {5,4,1,0,0},{6,4,1,0,0},{7,4,1,0,0},{8,4,1,0,0},{9,4,1,0,0},{10,4,1,0,0},{11,4,1,0,0},{12,4,1,0,0},{0,5,1,0,0},{1,5,1,0,0},{2,5,1,0,0},{3,5,1,0,0},{4,5,1,0,0},{5,5,1,0,0},{6,5,1,0,0},{7,5,1,0,0}, + {8,5,1,0,0},{9,5,1,0,0},{10,5,1,0,0},{11,5,1,0,0},{12,5,1,0,0},{0,6,1,0,0},{1,6,1,0,0},{2,6,1,0,0},{3,6,1,0,0},{4,6,1,0,0},{5,6,1,0,0},{6,6,1,0,0},{7,6,1,0,0},{8,6,1,0,0},{9,6,1,0,0},{10,6,1,0,0}, + {11,6,1,0,0},{12,6,1,0,0},{0,7,1,0,0},{1,7,1,0,0},{2,7,1,0,0},{3,7,1,0,0},{4,7,1,0,0},{5,7,1,0,0},{6,7,1,202,8},{7,7,1,0,0},{8,7,1,0,0},{9,7,1,0,0},{10,7,1,0,0},{11,7,1,0,0},{12,7,1,0,0},{0,8,1,0,0}, + {1,8,1,0,0},{2,8,1,0,0},{3,8,1,0,0},{4,8,1,0,0},{5,8,1,0,0},{7,8,1,0,0},{8,8,1,0,0},{9,8,1,0,0},{10,8,1,0,0},{11,8,1,0,0},{12,8,1,0,0},{0,9,1,0,0},{1,9,1,0,0},{2,9,1,0,0},{3,9,1,0,0},{4,9,1,0,0}, + {5,9,1,0,0},{6,9,1,0,0},{7,9,1,0,0},{8,9,1,0,0},{9,9,1,0,0},{10,9,1,0,0},{11,9,1,0,0},{12,9,1,0,0},{0,10,1,0,0},{1,10,1,0,0},{2,10,1,0,0},{3,10,1,0,0},{4,10,1,0,0},{5,10,1,0,0},{6,10,1,0,0},{7,10,1,0,0}, + {8,10,1,0,0},{9,10,1,0,0},{10,10,1,0,0},{11,10,1,0,0},{12,10,1,0,0},{0,11,1,0,0},{1,11,1,0,0},{2,11,1,0,0},{3,11,1,0,0},{4,11,1,0,0},{5,11,1,0,0},{6,11,1,0,0},{7,11,1,0,0},{8,11,1,0,0},{9,11,1,0,0},{10,11,1,0,0}, + {11,11,1,0,0},{12,11,1,0,0},{0,12,1,0,0},{1,12,1,0,0},{2,12,1,0,0},{3,12,1,0,0},{4,12,1,0,0},{5,12,1,0,0},{7,12,1,0,0},{8,12,1,0,0},{9,12,1,0,0},{10,12,1,0,0},{11,12,1,0,0},{12,12,1,0,0},{0,13,1,0,0},{1,13,1,0,0}, + {2,13,1,0,0},{3,13,1,0,0},{4,13,1,0,0},{5,13,1,0,0},{6,13,1,0,0},{7,13,1,0,0},{8,13,1,0,0},{9,13,1,0,0},{10,13,1,0,0},{11,13,1,0,0},{12,13,1,0,0},{0,14,1,0,0},{1,14,1,0,0},{2,14,1,0,0},{3,14,1,0,0},{4,14,1,0,0}, + {5,14,1,0,0},{6,14,1,0,0},{7,14,1,0,0},{8,14,1,0,0},{9,14,1,0,0},{10,14,1,0,0},{11,14,1,0,0},{12,14,1,0,0},{0,15,1,0,0},{1,15,1,0,0},{2,15,1,0,0},{3,15,1,0,0},{4,15,1,0,0},{5,15,1,0,0},{6,15,1,0,0},{7,15,1,0,0}, + {8,15,1,0,0},{9,15,1,0,0},{10,15,1,0,0},{11,15,1,0,0},{12,15,1,0,0},{0,16,1,0,0},{1,16,1,0,0},{2,16,1,0,0},{3,16,1,0,0},{4,16,1,0,0},{5,16,1,0,0},{6,16,1,0,0},{7,16,1,0,0},{8,16,1,0,0},{9,16,1,0,0},{10,16,1,0,0}, + {11,16,1,0,0},{12,16,1,0,0},{0,17,1,0,0},{1,17,1,0,0},{2,17,1,0,0},{3,17,1,0,0},{4,17,1,0,0},{5,17,1,0,0},{6,17,1,0,0},{7,17,1,0,0},{8,17,1,0,0},{9,17,1,0,0},{10,17,1,0,0},{11,17,1,0,0},{12,17,1,0,0},{0,18,1,0,0}, + {1,18,1,0,0},{2,18,1,0,0},{3,18,1,0,0},{4,18,1,0,0},{5,18,1,0,0},{6,18,1,0,0},{7,18,1,0,0},{8,18,1,0,0},{9,18,1,0,0},{10,18,1,0,0},{11,18,1,0,0},{12,18,1,0,0},{0,19,1,0,0},{1,19,1,0,0},{2,19,1,0,0},{3,19,1,0,0}, + {4,19,1,0,0},{5,19,1,0,0},{6,19,1,0,0},{7,19,1,0,0},{8,19,1,0,0},{9,19,1,0,0},{10,19,1,0,0},{11,19,1,0,0},{12,19,1,0,0},{0,20,1,0,0},{1,20,1,0,0},{2,20,1,0,0},{3,20,1,0,0},{4,20,1,0,0},{5,20,1,0,0},{6,20,1,0,0}, + {7,20,1,0,0},{8,20,1,0,0},{9,20,1,0,0},{10,20,1,0,0},{11,20,1,0,0},{12,20,1,0,0},{0,21,1,0,0},{1,21,1,0,0},{2,21,1,0,0},{3,21,1,0,0},{4,21,1,0,0},{5,21,1,0,0},{6,21,1,0,0},{7,21,1,0,0},{8,21,1,0,0},{9,21,1,0,0}, + {10,21,1,0,0},{11,21,1,0,0},{12,21,1,0,0},{0,22,1,0,0},{1,22,1,0,0},{2,22,1,0,0},{3,22,1,0,0},{4,22,1,0,0},{5,22,1,0,0},{6,22,1,0,0},{7,22,1,0,0},{8,22,1,0,0},{9,22,1,0,0},{10,22,1,0,0},{11,22,1,0,0},{12,22,1,0,0}, + {0,23,1,0,0},{1,23,1,0,0},{2,23,1,0,0},{3,23,1,0,0},{4,23,1,0,0},{5,23,1,0,0},{6,23,1,0,0},{7,23,1,0,0},{8,23,1,0,0},{9,23,1,0,0},{10,23,1,0,0},{11,23,1,0,0},{12,23,1,0,0},{0,0,2,0,0},{1,0,2,0,0},{2,0,2,0,0}, + {3,0,2,0,0},{4,0,2,0,0},{5,0,2,0,0},{6,0,2,0,0},{7,0,2,0,0},{8,0,2,0,0},{9,0,2,0,0},{10,0,2,0,0},{11,0,2,0,0},{12,0,2,0,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{5,1,2,0,0}, + {6,1,2,0,0},{7,1,2,0,0},{8,1,2,0,0},{9,1,2,0,0},{10,1,2,0,0},{11,1,2,0,0},{12,1,2,0,0},{0,2,2,0,0},{1,2,2,0,0},{2,2,2,0,0},{3,2,2,0,0},{4,2,2,0,0},{5,2,2,0,0},{6,2,2,0,0},{7,2,2,0,0},{8,2,2,0,0}, + {9,2,2,0,0},{10,2,2,0,0},{11,2,2,0,0},{12,2,2,0,0},{0,3,2,0,0},{1,3,2,0,0},{2,3,2,0,0},{3,3,2,0,0},{4,3,2,0,0},{5,3,2,0,0},{6,3,2,0,0},{7,3,2,0,0},{8,3,2,0,0},{9,3,2,0,0},{10,3,2,0,0},{11,3,2,0,0}, + {12,3,2,0,0},{0,4,2,0,0},{1,4,2,0,0},{2,4,2,0,0},{3,4,2,0,0},{4,4,2,0,0},{5,4,2,0,0},{6,4,2,0,0},{7,4,2,0,0},{8,4,2,0,0},{9,4,2,0,0},{10,4,2,0,0},{11,4,2,0,0},{12,4,2,0,0},{0,5,2,0,0},{1,5,2,0,0}, + {2,5,2,0,0},{3,5,2,0,0},{4,5,2,0,0},{5,5,2,0,0},{6,5,2,0,0},{7,5,2,0,0},{8,5,2,0,0},{9,5,2,0,0},{10,5,2,0,0},{11,5,2,0,0},{12,5,2,0,0},{0,6,2,0,0},{1,6,2,0,0},{2,6,2,0,0},{3,6,2,0,0},{4,6,2,0,0}, + {5,6,2,0,0},{6,6,2,0,0},{7,6,2,0,0},{8,6,2,0,0},{9,6,2,0,0},{10,6,2,0,0},{11,6,2,0,0},{12,6,2,0,0},{0,7,2,0,0},{1,7,2,0,0},{2,7,2,0,0},{3,7,2,0,0},{4,7,2,0,0},{5,7,2,0,0},{6,7,2,202,8},{7,7,2,0,0}, + {8,7,2,0,0},{9,7,2,0,0},{10,7,2,0,0},{11,7,2,0,0},{12,7,2,0,0},{0,8,2,0,0},{1,8,2,0,0},{2,8,2,0,0},{3,8,2,0,0},{4,8,2,0,0},{5,8,2,0,0},{6,8,2,0,0},{7,8,2,0,0},{8,8,2,0,0},{9,8,2,0,0},{10,8,2,0,0}, + {11,8,2,0,0},{12,8,2,0,0},{0,9,2,0,0},{1,9,2,0,0},{2,9,2,0,0},{3,9,2,0,0},{4,9,2,0,0},{5,9,2,0,0},{6,9,2,0,0},{7,9,2,0,0},{8,9,2,0,0},{9,9,2,0,0},{10,9,2,0,0},{11,9,2,0,0},{12,9,2,0,0},{0,10,2,0,0}, + {1,10,2,0,0},{2,10,2,0,0},{3,10,2,0,0},{4,10,2,0,0},{5,10,2,0,0},{6,10,2,0,0},{7,10,2,0,0},{8,10,2,0,0},{9,10,2,0,0},{10,10,2,0,0},{11,10,2,0,0},{12,10,2,0,0},{0,11,2,0,0},{1,11,2,0,0},{2,11,2,0,0},{3,11,2,0,0}, + {4,11,2,0,0},{5,11,2,0,0},{6,11,2,0,0},{7,11,2,0,0},{8,11,2,0,0},{9,11,2,0,0},{10,11,2,0,0},{11,11,2,0,0},{12,11,2,0,0},{0,12,2,0,0},{1,12,2,0,0},{2,12,2,0,0},{3,12,2,0,0},{4,12,2,0,0},{5,12,2,0,0},{6,12,2,202,8}, + {7,12,2,0,0},{8,12,2,0,0},{9,12,2,0,0},{10,12,2,0,0},{11,12,2,0,0},{12,12,2,0,0},{0,13,2,0,0},{1,13,2,0,0},{2,13,2,0,0},{3,13,2,0,0},{4,13,2,0,0},{5,13,2,0,0},{6,13,2,0,0},{7,13,2,0,0},{8,13,2,0,0},{9,13,2,0,0}, + {10,13,2,0,0},{11,13,2,0,0},{12,13,2,0,0},{0,14,2,0,0},{1,14,2,0,0},{2,14,2,0,0},{3,14,2,0,0},{4,14,2,0,0},{5,14,2,0,0},{6,14,2,0,0},{7,14,2,0,0},{8,14,2,0,0},{9,14,2,0,0},{10,14,2,0,0},{11,14,2,0,0},{12,14,2,0,0}, + {0,15,2,0,0},{1,15,2,0,0},{2,15,2,0,0},{3,15,2,0,0},{4,15,2,0,0},{5,15,2,0,0},{6,15,2,0,0},{7,15,2,0,0},{8,15,2,0,0},{9,15,2,0,0},{10,15,2,0,0},{11,15,2,0,0},{12,15,2,0,0},{0,16,2,0,0},{1,16,2,0,0},{2,16,2,0,0}, + {3,16,2,0,0},{4,16,2,0,0},{5,16,2,0,0},{6,16,2,0,0},{7,16,2,0,0},{8,16,2,0,0},{9,16,2,0,0},{10,16,2,0,0},{11,16,2,0,0},{12,16,2,0,0},{0,17,2,0,0},{1,17,2,0,0},{2,17,2,0,0},{3,17,2,0,0},{4,17,2,0,0},{5,17,2,0,0}, + {6,17,2,0,0},{7,17,2,0,0},{8,17,2,0,0},{9,17,2,0,0},{10,17,2,0,0},{11,17,2,0,0},{12,17,2,0,0},{0,18,2,0,0},{1,18,2,0,0},{2,18,2,0,0},{3,18,2,0,0},{4,18,2,0,0},{5,18,2,0,0},{6,18,2,0,0},{7,18,2,0,0},{8,18,2,0,0}, + {9,18,2,0,0},{10,18,2,0,0},{11,18,2,0,0},{12,18,2,0,0},{0,19,2,0,0},{1,19,2,0,0},{2,19,2,0,0},{3,19,2,0,0},{4,19,2,0,0},{5,19,2,0,0},{6,19,2,0,0},{7,19,2,0,0},{8,19,2,0,0},{9,19,2,0,0},{10,19,2,0,0},{11,19,2,0,0}, + {12,19,2,0,0},{0,20,2,0,0},{1,20,2,0,0},{2,20,2,0,0},{3,20,2,0,0},{4,20,2,0,0},{5,20,2,0,0},{6,20,2,0,0},{7,20,2,0,0},{8,20,2,0,0},{9,20,2,0,0},{10,20,2,0,0},{11,20,2,0,0},{12,20,2,0,0},{0,21,2,0,0},{1,21,2,0,0}, + {2,21,2,0,0},{3,21,2,0,0},{4,21,2,0,0},{5,21,2,0,0},{6,21,2,0,0},{7,21,2,0,0},{8,21,2,0,0},{9,21,2,0,0},{10,21,2,0,0},{11,21,2,0,0},{12,21,2,0,0},{0,22,2,0,0},{1,22,2,0,0},{2,22,2,0,0},{3,22,2,0,0},{4,22,2,0,0}, + {5,22,2,0,0},{6,22,2,0,0},{7,22,2,0,0},{8,22,2,0,0},{9,22,2,0,0},{10,22,2,0,0},{11,22,2,0,0},{12,22,2,0,0},{0,23,2,0,0},{1,23,2,0,0},{2,23,2,0,0},{3,23,2,0,0},{4,23,2,0,0},{5,23,2,0,0},{6,23,2,0,0},{7,23,2,0,0}, + {8,23,2,0,0},{9,23,2,0,0},{10,23,2,0,0},{11,23,2,0,0},{12,23,2,0,0},{0,0,3,0,0},{1,0,3,0,0},{2,0,3,0,0},{3,0,3,0,0},{4,0,3,0,0},{5,0,3,0,0},{6,0,3,0,0},{7,0,3,0,0},{8,0,3,0,0},{9,0,3,0,0},{10,0,3,0,0}, + {11,0,3,0,0},{12,0,3,0,0},{0,1,3,0,0},{1,1,3,0,0},{2,1,3,0,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0},{8,1,3,0,0},{9,1,3,0,0},{10,1,3,0,0},{11,1,3,0,0},{12,1,3,0,0},{0,2,3,0,0}, + {1,2,3,0,0},{2,2,3,0,0},{3,2,3,0,0},{4,2,3,0,0},{5,2,3,0,0},{6,2,3,0,0},{7,2,3,0,0},{8,2,3,0,0},{9,2,3,0,0},{10,2,3,0,0},{11,2,3,0,0},{12,2,3,0,0},{0,3,3,0,0},{1,3,3,0,0},{2,3,3,0,0},{3,3,3,0,0}, + {4,3,3,0,0},{5,3,3,0,0},{6,3,3,0,0},{7,3,3,0,0},{8,3,3,0,0},{9,3,3,0,0},{10,3,3,0,0},{11,3,3,0,0},{12,3,3,0,0},{0,4,3,0,0},{1,4,3,0,0},{2,4,3,0,0},{3,4,3,0,0},{4,4,3,0,0},{5,4,3,0,0},{6,4,3,0,0}, + {7,4,3,0,0},{8,4,3,0,0},{9,4,3,0,0},{10,4,3,0,0},{11,4,3,0,0},{12,4,3,0,0},{0,5,3,0,0},{1,5,3,0,0},{2,5,3,0,0},{3,5,3,0,0},{4,5,3,0,0},{5,5,3,0,0},{6,5,3,0,0},{7,5,3,0,0},{8,5,3,0,0},{9,5,3,0,0}, + {10,5,3,0,0},{11,5,3,0,0},{12,5,3,0,0},{0,6,3,0,0},{1,6,3,0,0},{2,6,3,0,0},{3,6,3,0,0},{4,6,3,0,0},{5,6,3,0,0},{6,6,3,202,8},{7,6,3,0,0},{8,6,3,0,0},{9,6,3,0,0},{10,6,3,0,0},{11,6,3,0,0},{12,6,3,0,0}, + {0,7,3,0,0},{1,7,3,0,0},{2,7,3,0,0},{3,7,3,0,0},{4,7,3,0,0},{5,7,3,0,0},{6,7,3,202,8},{7,7,3,0,0},{8,7,3,0,0},{9,7,3,0,0},{10,7,3,0,0},{11,7,3,0,0},{12,7,3,0,0},{0,8,3,0,0},{1,8,3,0,0},{2,8,3,0,0}, + {3,8,3,0,0},{4,8,3,0,0},{5,8,3,0,0},{6,8,3,0,0},{7,8,3,0,0},{8,8,3,0,0},{9,8,3,0,0},{10,8,3,0,0},{11,8,3,0,0},{12,8,3,0,0},{0,9,3,0,0},{1,9,3,0,0},{2,9,3,0,0},{3,9,3,0,0},{4,9,3,0,0},{5,9,3,0,0}, + {6,9,3,0,0},{7,9,3,0,0},{8,9,3,0,0},{9,9,3,0,0},{10,9,3,0,0},{11,9,3,0,0},{12,9,3,0,0},{0,10,3,0,0},{1,10,3,0,0},{2,10,3,0,0},{3,10,3,0,0},{4,10,3,0,0},{5,10,3,0,0},{6,10,3,0,0},{7,10,3,0,0},{8,10,3,0,0}, + {9,10,3,0,0},{10,10,3,0,0},{11,10,3,0,0},{12,10,3,0,0},{0,11,3,0,0},{1,11,3,0,0},{2,11,3,0,0},{3,11,3,0,0},{4,11,3,0,0},{5,11,3,0,0},{6,11,3,0,0},{7,11,3,0,0},{8,11,3,0,0},{9,11,3,0,0},{10,11,3,0,0},{11,11,3,0,0}, + {12,11,3,0,0},{0,12,3,0,0},{1,12,3,0,0},{2,12,3,0,0},{3,12,3,0,0},{4,12,3,0,0},{5,12,3,0,0},{6,12,3,202,8},{7,12,3,0,0},{8,12,3,0,0},{9,12,3,0,0},{10,12,3,0,0},{11,12,3,0,0},{12,12,3,0,0},{0,13,3,0,0},{1,13,3,0,0}, + {2,13,3,0,0},{3,13,3,0,0},{4,13,3,0,0},{5,13,3,0,0},{6,13,3,0,0},{7,13,3,0,0},{8,13,3,0,0},{9,13,3,0,0},{10,13,3,0,0},{11,13,3,0,0},{12,13,3,0,0},{0,14,3,0,0},{1,14,3,0,0},{2,14,3,0,0},{3,14,3,0,0},{4,14,3,0,0}, + {5,14,3,0,0},{6,14,3,0,0},{7,14,3,0,0},{8,14,3,0,0},{9,14,3,0,0},{10,14,3,0,0},{11,14,3,0,0},{12,14,3,0,0},{0,15,3,0,0},{1,15,3,0,0},{2,15,3,0,0},{3,15,3,0,0},{4,15,3,0,0},{5,15,3,0,0},{6,15,3,0,0},{7,15,3,0,0}, + {8,15,3,0,0},{9,15,3,0,0},{10,15,3,0,0},{11,15,3,0,0},{12,15,3,0,0},{0,16,3,0,0},{1,16,3,0,0},{2,16,3,0,0},{3,16,3,0,0},{4,16,3,0,0},{5,16,3,0,0},{6,16,3,0,0},{7,16,3,0,0},{8,16,3,0,0},{9,16,3,0,0},{10,16,3,0,0}, + {11,16,3,0,0},{12,16,3,0,0},{0,17,3,0,0},{1,17,3,0,0},{2,17,3,0,0},{3,17,3,0,0},{4,17,3,0,0},{5,17,3,0,0},{6,17,3,0,0},{7,17,3,0,0},{8,17,3,0,0},{9,17,3,0,0},{10,17,3,0,0},{11,17,3,0,0},{12,17,3,0,0},{0,18,3,0,0}, + {1,18,3,0,0},{2,18,3,0,0},{3,18,3,0,0},{4,18,3,0,0},{5,18,3,0,0},{6,18,3,0,0},{7,18,3,0,0},{8,18,3,0,0},{9,18,3,0,0},{10,18,3,0,0},{11,18,3,0,0},{12,18,3,0,0},{0,19,3,0,0},{1,19,3,0,0},{2,19,3,0,0},{3,19,3,0,0}, + {4,19,3,0,0},{5,19,3,0,0},{6,19,3,0,0},{7,19,3,0,0},{8,19,3,0,0},{9,19,3,0,0},{10,19,3,0,0},{11,19,3,0,0},{12,19,3,0,0},{0,20,3,0,0},{1,20,3,0,0},{2,20,3,0,0},{3,20,3,0,0},{4,20,3,0,0},{5,20,3,0,0},{6,20,3,0,0}, + {7,20,3,0,0},{8,20,3,0,0},{9,20,3,0,0},{10,20,3,0,0},{11,20,3,0,0},{12,20,3,0,0},{0,21,3,0,0},{1,21,3,0,0},{2,21,3,0,0},{3,21,3,0,0},{4,21,3,0,0},{5,21,3,0,0},{6,21,3,0,0},{7,21,3,0,0},{8,21,3,0,0},{9,21,3,0,0}, + {10,21,3,0,0},{11,21,3,0,0},{12,21,3,0,0},{0,22,3,0,0},{1,22,3,0,0},{2,22,3,0,0},{3,22,3,0,0},{4,22,3,0,0},{5,22,3,0,0},{6,22,3,0,0},{7,22,3,0,0},{8,22,3,0,0},{9,22,3,0,0},{10,22,3,0,0},{11,22,3,0,0},{12,22,3,0,0}, + {0,23,3,0,0},{1,23,3,0,0},{2,23,3,0,0},{3,23,3,0,0},{4,23,3,0,0},{5,23,3,0,0},{6,23,3,0,0},{7,23,3,0,0},{8,23,3,0,0},{9,23,3,0,0},{10,23,3,0,0},{11,23,3,0,0},{12,23,3,0,0},{0,0,4,0,0},{1,0,4,0,0},{2,0,4,0,0}, + {3,0,4,0,0},{4,0,4,0,0},{5,0,4,0,0},{6,0,4,0,0},{7,0,4,0,0},{8,0,4,0,0},{9,0,4,0,0},{10,0,4,0,0},{11,0,4,0,0},{12,0,4,0,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0}, + {6,1,4,0,0},{7,1,4,0,0},{8,1,4,0,0},{9,1,4,0,0},{10,1,4,0,0},{11,1,4,0,0},{12,1,4,0,0},{0,2,4,0,0},{1,2,4,0,0},{2,2,4,0,0},{3,2,4,0,0},{4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0},{7,2,4,0,0},{8,2,4,0,0}, + {9,2,4,0,0},{10,2,4,0,0},{11,2,4,0,0},{12,2,4,0,0},{0,3,4,0,0},{1,3,4,0,0},{2,3,4,0,0},{3,3,4,0,0},{4,3,4,0,0},{5,3,4,0,0},{6,3,4,0,0},{7,3,4,0,0},{8,3,4,0,0},{9,3,4,0,0},{10,3,4,0,0},{11,3,4,0,0}, + {12,3,4,0,0},{0,4,4,0,0},{1,4,4,0,0},{2,4,4,0,0},{3,4,4,0,0},{4,4,4,0,0},{5,4,4,0,0},{6,4,4,0,0},{7,4,4,0,0},{8,4,4,0,0},{9,4,4,0,0},{10,4,4,0,0},{11,4,4,0,0},{12,4,4,0,0},{0,5,4,0,0},{1,5,4,0,0}, + {2,5,4,0,0},{3,5,4,0,0},{4,5,4,0,0},{5,5,4,0,0},{6,5,4,202,8},{7,5,4,0,0},{8,5,4,0,0},{9,5,4,0,0},{10,5,4,0,0},{11,5,4,0,0},{12,5,4,0,0},{0,6,4,0,0},{1,6,4,0,0},{2,6,4,0,0},{3,6,4,0,0},{4,6,4,0,0}, + {5,6,4,0,0},{6,6,4,202,8},{7,6,4,0,0},{8,6,4,0,0},{9,6,4,0,0},{10,6,4,0,0},{11,6,4,0,0},{12,6,4,0,0},{0,7,4,0,0},{1,7,4,0,0},{2,7,4,0,0},{3,7,4,0,0},{4,7,4,0,0},{5,7,4,0,0},{6,7,4,202,8},{7,7,4,0,0}, + {8,7,4,0,0},{9,7,4,0,0},{10,7,4,0,0},{11,7,4,0,0},{12,7,4,0,0},{0,8,4,0,0},{1,8,4,0,0},{2,8,4,0,0},{3,8,4,0,0},{4,8,4,0,0},{5,8,4,0,0},{6,8,4,201,0},{7,8,4,0,0},{8,8,4,0,0},{9,8,4,0,0},{10,8,4,0,0}, + {11,8,4,0,0},{12,8,4,0,0},{0,9,4,0,0},{1,9,4,0,0},{2,9,4,0,0},{3,9,4,0,0},{4,9,4,0,0},{5,9,4,0,0},{7,9,4,0,0},{8,9,4,0,0},{9,9,4,0,0},{10,9,4,0,0},{11,9,4,0,0},{12,9,4,0,0},{0,10,4,0,0},{1,10,4,0,0}, + {2,10,4,0,0},{3,10,4,0,0},{4,10,4,0,0},{5,10,4,0,0},{6,10,4,0,0},{7,10,4,0,0},{8,10,4,0,0},{9,10,4,0,0},{10,10,4,0,0},{11,10,4,0,0},{12,10,4,0,0},{0,11,4,0,0},{1,11,4,0,0},{2,11,4,0,0},{3,11,4,0,0},{4,11,4,0,0}, + {5,11,4,0,0},{6,11,4,202,8},{7,11,4,0,0},{8,11,4,0,0},{9,11,4,0,0},{10,11,4,0,0},{11,11,4,0,0},{12,11,4,0,0},{0,12,4,0,0},{1,12,4,0,0},{2,12,4,0,0},{3,12,4,0,0},{4,12,4,0,0},{5,12,4,0,0},{7,12,4,0,0},{8,12,4,0,0}, + {9,12,4,0,0},{10,12,4,0,0},{11,12,4,0,0},{12,12,4,0,0},{0,13,4,0,0},{1,13,4,0,0},{2,13,4,0,0},{3,13,4,0,0},{4,13,4,0,0},{5,13,4,0,0},{6,13,4,0,0},{7,13,4,0,0},{8,13,4,0,0},{9,13,4,0,0},{10,13,4,0,0},{11,13,4,0,0}, + {12,13,4,0,0},{0,14,4,0,0},{1,14,4,0,0},{2,14,4,0,0},{3,14,4,0,0},{4,14,4,0,0},{5,14,4,0,0},{6,14,4,0,0},{7,14,4,0,0},{8,14,4,0,0},{9,14,4,0,0},{10,14,4,0,0},{11,14,4,0,0},{12,14,4,0,0},{0,15,4,0,0},{1,15,4,0,0}, + {2,15,4,0,0},{3,15,4,0,0},{4,15,4,0,0},{5,15,4,0,0},{6,15,4,0,0},{7,15,4,0,0},{8,15,4,0,0},{9,15,4,0,0},{10,15,4,0,0},{11,15,4,0,0},{12,15,4,0,0},{0,16,4,0,0},{1,16,4,0,0},{2,16,4,0,0},{3,16,4,0,0},{4,16,4,0,0}, + {5,16,4,0,0},{6,16,4,0,0},{7,16,4,0,0},{8,16,4,0,0},{9,16,4,0,0},{10,16,4,0,0},{11,16,4,0,0},{12,16,4,0,0},{0,17,4,0,0},{1,17,4,0,0},{2,17,4,0,0},{3,17,4,0,0},{4,17,4,0,0},{5,17,4,0,0},{6,17,4,0,0},{7,17,4,0,0}, + {8,17,4,0,0},{9,17,4,0,0},{10,17,4,0,0},{11,17,4,0,0},{12,17,4,0,0},{0,18,4,0,0},{1,18,4,0,0},{2,18,4,0,0},{3,18,4,0,0},{4,18,4,0,0},{5,18,4,0,0},{6,18,4,0,0},{7,18,4,0,0},{8,18,4,0,0},{9,18,4,0,0},{10,18,4,0,0}, + {11,18,4,0,0},{12,18,4,0,0},{0,19,4,0,0},{1,19,4,0,0},{2,19,4,0,0},{3,19,4,0,0},{4,19,4,0,0},{5,19,4,0,0},{6,19,4,0,0},{7,19,4,0,0},{8,19,4,0,0},{9,19,4,0,0},{10,19,4,0,0},{11,19,4,0,0},{12,19,4,0,0},{0,20,4,0,0}, + {1,20,4,0,0},{2,20,4,0,0},{3,20,4,0,0},{4,20,4,0,0},{5,20,4,0,0},{6,20,4,0,0},{7,20,4,0,0},{8,20,4,0,0},{9,20,4,0,0},{10,20,4,0,0},{11,20,4,0,0},{12,20,4,0,0},{0,21,4,0,0},{1,21,4,0,0},{2,21,4,0,0},{3,21,4,0,0}, + {4,21,4,0,0},{5,21,4,0,0},{6,21,4,0,0},{7,21,4,0,0},{8,21,4,0,0},{9,21,4,0,0},{10,21,4,0,0},{11,21,4,0,0},{12,21,4,0,0},{0,22,4,0,0},{1,22,4,0,0},{2,22,4,0,0},{3,22,4,0,0},{4,22,4,0,0},{5,22,4,0,0},{6,22,4,0,0}, + {7,22,4,0,0},{8,22,4,0,0},{9,22,4,0,0},{10,22,4,0,0},{11,22,4,0,0},{12,22,4,0,0},{0,23,4,0,0},{1,23,4,0,0},{2,23,4,0,0},{3,23,4,0,0},{4,23,4,0,0},{5,23,4,0,0},{6,23,4,0,0},{7,23,4,0,0},{8,23,4,0,0},{9,23,4,0,0}, + {10,23,4,0,0},{11,23,4,0,0},{12,23,4,0,0},{0,0,5,0,0},{1,0,5,0,0},{2,0,5,0,0},{3,0,5,0,0},{4,0,5,0,0},{5,0,5,0,0},{6,0,5,0,0},{7,0,5,0,0},{8,0,5,0,0},{9,0,5,0,0},{10,0,5,0,0},{11,0,5,0,0},{12,0,5,0,0}, + {0,1,5,0,0},{1,1,5,0,0},{2,1,5,0,0},{3,1,5,0,0},{4,1,5,0,0},{5,1,5,0,0},{6,1,5,0,0},{7,1,5,0,0},{8,1,5,0,0},{9,1,5,0,0},{10,1,5,0,0},{11,1,5,0,0},{12,1,5,0,0},{0,2,5,0,0},{1,2,5,0,0},{2,2,5,0,0}, + {3,2,5,0,0},{4,2,5,0,0},{5,2,5,0,0},{6,2,5,0,0},{7,2,5,0,0},{8,2,5,0,0},{9,2,5,0,0},{10,2,5,0,0},{11,2,5,0,0},{12,2,5,0,0},{0,3,5,0,0},{1,3,5,0,0},{2,3,5,0,0},{3,3,5,0,0},{4,3,5,0,0},{5,3,5,0,0}, + {6,3,5,202,8},{7,3,5,0,0},{8,3,5,0,0},{9,3,5,0,0},{10,3,5,0,0},{11,3,5,0,0},{12,3,5,0,0},{0,4,5,0,0},{1,4,5,0,0},{2,4,5,0,0},{3,4,5,0,0},{4,4,5,0,0},{5,4,5,0,0},{6,4,5,201,0},{7,4,5,0,0},{8,4,5,0,0}, + {9,4,5,0,0},{10,4,5,0,0},{11,4,5,0,0},{12,4,5,0,0},{0,5,5,0,0},{1,5,5,0,0},{2,5,5,0,0},{3,5,5,0,0},{4,5,5,0,0},{5,5,5,0,0},{6,5,5,202,8},{7,5,5,0,0},{8,5,5,0,0},{9,5,5,0,0},{10,5,5,0,0},{11,5,5,0,0}, + {12,5,5,0,0},{0,6,5,0,0},{1,6,5,0,0},{2,6,5,0,0},{3,6,5,0,0},{4,6,5,0,0},{5,6,5,0,0},{6,6,5,201,0},{7,6,5,0,0},{8,6,5,0,0},{9,6,5,0,0},{10,6,5,0,0},{11,6,5,0,0},{12,6,5,0,0},{0,7,5,0,0},{1,7,5,0,0}, + {2,7,5,0,0},{3,7,5,0,0},{4,7,5,0,0},{5,7,5,201,0},{6,7,5,201,0},{7,7,5,201,0},{8,7,5,0,0},{9,7,5,0,0},{10,7,5,0,0},{11,7,5,0,0},{12,7,5,0,0},{0,8,5,0,0},{1,8,5,0,0},{2,8,5,0,0},{3,8,5,0,0},{4,8,5,0,0}, + {5,8,5,201,0},{6,8,5,0,0},{7,8,5,201,0},{8,8,5,0,0},{9,8,5,0,0},{10,8,5,0,0},{11,8,5,0,0},{12,8,5,0,0},{0,9,5,0,0},{1,9,5,0,0},{2,9,5,0,0},{3,9,5,0,0},{4,9,5,0,0},{5,9,5,0,0},{6,9,5,0,0},{7,9,5,0,0}, + {8,9,5,0,0},{9,9,5,0,0},{10,9,5,0,0},{11,9,5,0,0},{12,9,5,0,0},{0,10,5,0,0},{1,10,5,0,0},{2,10,5,0,0},{3,10,5,0,0},{4,10,5,0,0},{5,10,5,0,0},{6,10,5,0,0},{7,10,5,0,0},{8,10,5,0,0},{9,10,5,0,0},{10,10,5,0,0}, + {11,10,5,0,0},{12,10,5,0,0},{0,11,5,0,0},{1,11,5,0,0},{2,11,5,0,0},{3,11,5,0,0},{4,11,5,0,0},{5,11,5,0,0},{6,11,5,202,8},{7,11,5,0,0},{8,11,5,0,0},{9,11,5,0,0},{10,11,5,0,0},{11,11,5,0,0},{12,11,5,0,0},{0,12,5,0,0}, + {1,12,5,0,0},{2,12,5,0,0},{3,12,5,0,0},{4,12,5,0,0},{5,12,5,0,0},{6,12,5,0,0},{7,12,5,0,0},{8,12,5,0,0},{9,12,5,0,0},{10,12,5,0,0},{11,12,5,0,0},{12,12,5,0,0},{0,13,5,0,0},{1,13,5,0,0},{2,13,5,0,0},{3,13,5,0,0}, + {4,13,5,0,0},{5,13,5,0,0},{6,13,5,0,0},{7,13,5,0,0},{8,13,5,0,0},{9,13,5,0,0},{10,13,5,0,0},{11,13,5,0,0},{12,13,5,0,0},{0,14,5,0,0},{1,14,5,0,0},{2,14,5,0,0},{3,14,5,0,0},{4,14,5,0,0},{5,14,5,0,0},{6,14,5,0,0}, + {7,14,5,0,0},{8,14,5,0,0},{9,14,5,0,0},{10,14,5,0,0},{11,14,5,0,0},{12,14,5,0,0},{0,15,5,0,0},{1,15,5,0,0},{2,15,5,0,0},{3,15,5,0,0},{4,15,5,0,0},{5,15,5,0,0},{6,15,5,0,0},{7,15,5,0,0},{8,15,5,0,0},{9,15,5,0,0}, + {10,15,5,0,0},{11,15,5,0,0},{12,15,5,0,0},{0,16,5,0,0},{1,16,5,0,0},{2,16,5,0,0},{3,16,5,0,0},{4,16,5,0,0},{5,16,5,0,0},{6,16,5,0,0},{7,16,5,0,0},{8,16,5,0,0},{9,16,5,0,0},{10,16,5,0,0},{11,16,5,0,0},{12,16,5,0,0}, + {0,17,5,0,0},{1,17,5,0,0},{2,17,5,0,0},{3,17,5,0,0},{4,17,5,0,0},{5,17,5,0,0},{6,17,5,0,0},{7,17,5,0,0},{8,17,5,0,0},{9,17,5,0,0},{10,17,5,0,0},{11,17,5,0,0},{12,17,5,0,0},{0,18,5,0,0},{1,18,5,0,0},{2,18,5,0,0}, + {3,18,5,0,0},{4,18,5,0,0},{5,18,5,0,0},{6,18,5,0,0},{7,18,5,0,0},{8,18,5,0,0},{9,18,5,0,0},{10,18,5,0,0},{11,18,5,0,0},{12,18,5,0,0},{0,19,5,0,0},{1,19,5,0,0},{2,19,5,0,0},{3,19,5,0,0},{4,19,5,0,0},{5,19,5,0,0}, + {6,19,5,0,0},{7,19,5,0,0},{8,19,5,0,0},{9,19,5,0,0},{10,19,5,0,0},{11,19,5,0,0},{12,19,5,0,0},{0,20,5,0,0},{1,20,5,0,0},{2,20,5,0,0},{3,20,5,0,0},{4,20,5,0,0},{5,20,5,0,0},{6,20,5,0,0},{7,20,5,0,0},{8,20,5,0,0}, + {9,20,5,0,0},{10,20,5,0,0},{11,20,5,0,0},{12,20,5,0,0},{0,21,5,0,0},{1,21,5,0,0},{2,21,5,0,0},{3,21,5,0,0},{4,21,5,0,0},{5,21,5,0,0},{6,21,5,0,0},{7,21,5,0,0},{8,21,5,0,0},{9,21,5,0,0},{10,21,5,0,0},{11,21,5,0,0}, + {12,21,5,0,0},{0,22,5,0,0},{1,22,5,0,0},{2,22,5,0,0},{3,22,5,0,0},{4,22,5,0,0},{5,22,5,0,0},{6,22,5,0,0},{7,22,5,0,0},{8,22,5,0,0},{9,22,5,0,0},{10,22,5,0,0},{11,22,5,0,0},{12,22,5,0,0},{0,23,5,0,0},{1,23,5,0,0}, + {2,23,5,0,0},{3,23,5,0,0},{4,23,5,0,0},{5,23,5,0,0},{6,23,5,0,0},{7,23,5,0,0},{8,23,5,0,0},{9,23,5,0,0},{10,23,5,0,0},{11,23,5,0,0},{12,23,5,0,0},{0,0,6,0,0},{1,0,6,0,0},{2,0,6,0,0},{3,0,6,0,0},{4,0,6,0,0}, + {5,0,6,0,0},{6,0,6,0,0},{7,0,6,0,0},{8,0,6,0,0},{9,0,6,0,0},{10,0,6,0,0},{11,0,6,0,0},{12,0,6,0,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{7,1,6,0,0}, + {8,1,6,0,0},{9,1,6,0,0},{10,1,6,0,0},{11,1,6,0,0},{12,1,6,0,0},{0,2,6,0,0},{1,2,6,0,0},{2,2,6,0,0},{3,2,6,0,0},{4,2,6,0,0},{5,2,6,0,0},{6,2,6,202,8},{7,2,6,0,0},{8,2,6,0,0},{9,2,6,0,0},{10,2,6,0,0}, + {11,2,6,0,0},{12,2,6,0,0},{0,3,6,0,0},{1,3,6,0,0},{2,3,6,0,0},{3,3,6,0,0},{4,3,6,0,0},{5,3,6,0,0},{6,3,6,202,8},{7,3,6,0,0},{8,3,6,0,0},{9,3,6,0,0},{10,3,6,0,0},{11,3,6,0,0},{12,3,6,0,0},{0,4,6,0,0}, + {1,4,6,0,0},{2,4,6,0,0},{3,4,6,0,0},{4,4,6,0,0},{5,4,6,201,0},{6,4,6,201,0},{7,4,6,201,0},{8,4,6,0,0},{9,4,6,0,0},{10,4,6,0,0},{11,4,6,0,0},{12,4,6,0,0},{0,5,6,0,0},{1,5,6,0,0},{2,5,6,0,0},{3,5,6,0,0}, + {4,5,6,0,0},{5,5,6,201,0},{6,5,6,201,0},{7,5,6,201,0},{8,5,6,0,0},{9,5,6,0,0},{10,5,6,0,0},{11,5,6,0,0},{12,5,6,0,0},{0,6,6,0,0},{1,6,6,0,0},{2,6,6,0,0},{3,6,6,0,0},{4,6,6,0,0},{5,6,6,201,0},{7,6,6,201,0}, + {8,6,6,0,0},{9,6,6,0,0},{10,6,6,0,0},{11,6,6,0,0},{12,6,6,0,0},{0,7,6,0,0},{1,7,6,0,0},{2,7,6,0,0},{3,7,6,0,0},{4,7,6,201,0},{5,7,6,201,0},{6,7,6,201,0},{7,7,6,201,0},{8,7,6,201,0},{9,7,6,0,0},{10,7,6,0,0}, + {11,7,6,0,0},{12,7,6,0,0},{0,8,6,0,0},{1,8,6,0,0},{2,8,6,0,0},{3,8,6,0,0},{4,8,6,201,0},{5,8,6,0,0},{6,8,6,0,0},{7,8,6,0,0},{8,8,6,201,0},{9,8,6,0,0},{10,8,6,0,0},{11,8,6,0,0},{12,8,6,0,0},{0,9,6,0,0}, + {1,9,6,0,0},{2,9,6,0,0},{3,9,6,0,0},{4,9,6,0,0},{5,9,6,0,0},{6,9,6,0,0},{7,9,6,0,0},{8,9,6,0,0},{9,9,6,0,0},{10,9,6,0,0},{11,9,6,0,0},{12,9,6,0,0},{0,10,6,0,0},{1,10,6,0,0},{2,10,6,0,0},{3,10,6,0,0}, + {4,10,6,0,0},{5,10,6,0,0},{6,10,6,202,8},{7,10,6,0,0},{8,10,6,0,0},{9,10,6,0,0},{10,10,6,0,0},{11,10,6,0,0},{12,10,6,0,0},{0,11,6,0,0},{1,11,6,0,0},{2,11,6,0,0},{3,11,6,0,0},{4,11,6,0,0},{5,11,6,0,0},{7,11,6,0,0}, + {8,11,6,0,0},{9,11,6,0,0},{10,11,6,0,0},{11,11,6,0,0},{12,11,6,0,0},{0,12,6,0,0},{1,12,6,0,0},{2,12,6,0,0},{3,12,6,0,0},{4,12,6,0,0},{5,12,6,0,0},{6,12,6,0,0},{7,12,6,0,0},{8,12,6,0,0},{9,12,6,0,0},{10,12,6,0,0}, + {11,12,6,0,0},{12,12,6,0,0},{0,13,6,0,0},{1,13,6,0,0},{2,13,6,0,0},{3,13,6,0,0},{4,13,6,0,0},{5,13,6,0,0},{6,13,6,0,0},{7,13,6,0,0},{8,13,6,0,0},{9,13,6,0,0},{10,13,6,0,0},{11,13,6,0,0},{12,13,6,0,0},{0,14,6,0,0}, + {1,14,6,0,0},{2,14,6,0,0},{3,14,6,0,0},{4,14,6,0,0},{5,14,6,0,0},{6,14,6,0,0},{7,14,6,0,0},{8,14,6,0,0},{9,14,6,0,0},{10,14,6,0,0},{11,14,6,0,0},{12,14,6,0,0},{0,15,6,0,0},{1,15,6,0,0},{2,15,6,0,0},{3,15,6,0,0}, + {4,15,6,0,0},{5,15,6,0,0},{6,15,6,0,0},{7,15,6,0,0},{8,15,6,0,0},{9,15,6,0,0},{10,15,6,0,0},{11,15,6,0,0},{12,15,6,0,0},{0,16,6,0,0},{1,16,6,0,0},{2,16,6,0,0},{3,16,6,0,0},{4,16,6,0,0},{5,16,6,0,0},{6,16,6,0,0}, + {7,16,6,0,0},{8,16,6,0,0},{9,16,6,0,0},{10,16,6,0,0},{11,16,6,0,0},{12,16,6,0,0},{0,17,6,0,0},{1,17,6,0,0},{2,17,6,0,0},{3,17,6,0,0},{4,17,6,0,0},{5,17,6,0,0},{6,17,6,0,0},{7,17,6,0,0},{8,17,6,0,0},{9,17,6,0,0}, + {10,17,6,0,0},{11,17,6,0,0},{12,17,6,0,0},{0,18,6,0,0},{1,18,6,0,0},{2,18,6,0,0},{3,18,6,0,0},{4,18,6,0,0},{5,18,6,0,0},{6,18,6,0,0},{7,18,6,0,0},{8,18,6,0,0},{9,18,6,0,0},{10,18,6,0,0},{11,18,6,0,0},{12,18,6,0,0}, + {0,19,6,0,0},{1,19,6,0,0},{2,19,6,0,0},{3,19,6,0,0},{4,19,6,0,0},{5,19,6,0,0},{6,19,6,0,0},{7,19,6,0,0},{8,19,6,0,0},{9,19,6,0,0},{10,19,6,0,0},{11,19,6,0,0},{12,19,6,0,0},{0,20,6,0,0},{1,20,6,0,0},{2,20,6,0,0}, + {3,20,6,0,0},{4,20,6,0,0},{5,20,6,0,0},{6,20,6,0,0},{7,20,6,0,0},{8,20,6,0,0},{9,20,6,0,0},{10,20,6,0,0},{11,20,6,0,0},{12,20,6,0,0},{0,21,6,0,0},{1,21,6,0,0},{2,21,6,0,0},{3,21,6,0,0},{4,21,6,0,0},{5,21,6,0,0}, + {6,21,6,0,0},{7,21,6,0,0},{8,21,6,0,0},{9,21,6,0,0},{10,21,6,0,0},{11,21,6,0,0},{12,21,6,0,0},{0,22,6,0,0},{1,22,6,0,0},{2,22,6,0,0},{3,22,6,0,0},{4,22,6,0,0},{5,22,6,0,0},{6,22,6,0,0},{7,22,6,0,0},{8,22,6,0,0}, + {9,22,6,0,0},{10,22,6,0,0},{11,22,6,0,0},{12,22,6,0,0},{0,23,6,0,0},{1,23,6,0,0},{2,23,6,0,0},{3,23,6,0,0},{4,23,6,0,0},{5,23,6,0,0},{6,23,6,0,0},{7,23,6,0,0},{8,23,6,0,0},{9,23,6,0,0},{10,23,6,0,0},{11,23,6,0,0}, + {12,23,6,0,0},{0,0,7,0,0},{1,0,7,0,0},{2,0,7,0,0},{3,0,7,0,0},{4,0,7,0,0},{5,0,7,0,0},{6,0,7,0,0},{7,0,7,0,0},{8,0,7,0,0},{9,0,7,0,0},{10,0,7,0,0},{11,0,7,0,0},{12,0,7,0,0},{0,1,7,0,0},{1,1,7,0,0}, + {2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{6,1,7,0,0},{7,1,7,0,0},{8,1,7,0,0},{9,1,7,0,0},{10,1,7,0,0},{11,1,7,0,0},{12,1,7,0,0},{0,2,7,0,0},{1,2,7,0,0},{2,2,7,0,0},{3,2,7,0,0},{4,2,7,0,0}, + {5,2,7,0,0},{6,2,7,202,8},{7,2,7,0,0},{8,2,7,0,0},{9,2,7,0,0},{10,2,7,0,0},{11,2,7,0,0},{12,2,7,0,0},{0,3,7,0,0},{1,3,7,0,0},{2,3,7,0,0},{3,3,7,0,0},{4,3,7,0,0},{5,3,7,201,0},{6,3,7,201,0},{7,3,7,201,0}, + {8,3,7,0,0},{9,3,7,0,0},{10,3,7,0,0},{11,3,7,0,0},{12,3,7,0,0},{0,4,7,0,0},{1,4,7,0,0},{2,4,7,0,0},{3,4,7,0,0},{4,4,7,201,0},{6,4,7,0,0},{8,4,7,201,0},{9,4,7,0,0},{10,4,7,0,0},{11,4,7,0,0},{12,4,7,0,0}, + {0,5,7,0,0},{1,5,7,0,0},{2,5,7,0,0},{3,5,7,0,0},{4,5,7,201,0},{8,5,7,201,0},{9,5,7,0,0},{10,5,7,0,0},{11,5,7,0,0},{12,5,7,0,0},{0,6,7,0,0},{1,6,7,0,0},{2,6,7,0,0},{3,6,7,0,0},{4,6,7,201,0},{5,6,7,0,0}, + {6,6,7,0,0},{7,6,7,0,0},{8,6,7,201,0},{9,6,7,0,0},{10,6,7,0,0},{11,6,7,0,0},{12,6,7,0,0},{0,7,7,0,0},{1,7,7,0,0},{2,7,7,0,0},{3,7,7,0,0},{4,7,7,201,0},{5,7,7,201,0},{6,7,7,201,0},{7,7,7,201,0},{8,7,7,201,0}, + {9,7,7,0,0},{10,7,7,0,0},{11,7,7,0,0},{12,7,7,0,0},{0,8,7,0,0},{1,8,7,0,0},{2,8,7,0,0},{3,8,7,0,0},{5,8,7,0,0},{6,8,7,0,0},{7,8,7,0,0},{9,8,7,0,0},{10,8,7,0,0},{11,8,7,0,0},{12,8,7,0,0},{0,9,7,0,0}, + {1,9,7,0,0},{2,9,7,0,0},{3,9,7,0,0},{4,9,7,0,0},{5,9,7,0,0},{6,9,7,0,0},{7,9,7,0,0},{8,9,7,0,0},{9,9,7,0,0},{10,9,7,0,0},{11,9,7,0,0},{12,9,7,0,0},{0,10,7,0,0},{1,10,7,0,0},{2,10,7,0,0},{3,10,7,0,0}, + {4,10,7,0,0},{5,10,7,0,0},{6,10,7,202,8},{7,10,7,0,0},{8,10,7,0,0},{9,10,7,0,0},{10,10,7,0,0},{11,10,7,0,0},{12,10,7,0,0},{0,11,7,0,0},{1,11,7,0,0},{2,11,7,0,0},{3,11,7,0,0},{4,11,7,0,0},{5,11,7,0,0},{6,11,7,0,0}, + {7,11,7,0,0},{8,11,7,0,0},{9,11,7,0,0},{10,11,7,0,0},{11,11,7,0,0},{12,11,7,0,0},{0,12,7,0,0},{1,12,7,0,0},{2,12,7,0,0},{3,12,7,0,0},{4,12,7,0,0},{5,12,7,0,0},{6,12,7,0,0},{7,12,7,0,0},{8,12,7,0,0},{9,12,7,0,0}, + {10,12,7,0,0},{11,12,7,0,0},{12,12,7,0,0},{0,13,7,0,0},{1,13,7,0,0},{2,13,7,0,0},{3,13,7,0,0},{4,13,7,0,0},{5,13,7,0,0},{6,13,7,0,0},{7,13,7,0,0},{8,13,7,0,0},{9,13,7,0,0},{10,13,7,0,0},{11,13,7,0,0},{12,13,7,0,0}, + {0,14,7,0,0},{1,14,7,0,0},{2,14,7,0,0},{3,14,7,0,0},{4,14,7,0,0},{5,14,7,0,0},{6,14,7,0,0},{7,14,7,0,0},{8,14,7,0,0},{9,14,7,0,0},{10,14,7,0,0},{11,14,7,0,0},{12,14,7,0,0},{0,15,7,0,0},{1,15,7,0,0},{2,15,7,0,0}, + {3,15,7,0,0},{4,15,7,0,0},{5,15,7,0,0},{6,15,7,0,0},{7,15,7,0,0},{8,15,7,0,0},{9,15,7,0,0},{10,15,7,0,0},{11,15,7,0,0},{12,15,7,0,0},{0,16,7,0,0},{1,16,7,0,0},{2,16,7,0,0},{3,16,7,0,0},{4,16,7,0,0},{5,16,7,0,0}, + {6,16,7,0,0},{7,16,7,0,0},{8,16,7,0,0},{9,16,7,0,0},{10,16,7,0,0},{11,16,7,0,0},{12,16,7,0,0},{0,17,7,0,0},{1,17,7,0,0},{2,17,7,0,0},{3,17,7,0,0},{4,17,7,0,0},{5,17,7,0,0},{6,17,7,0,0},{7,17,7,0,0},{8,17,7,0,0}, + {9,17,7,0,0},{10,17,7,0,0},{11,17,7,0,0},{12,17,7,0,0},{0,18,7,0,0},{1,18,7,0,0},{2,18,7,0,0},{3,18,7,0,0},{4,18,7,0,0},{5,18,7,0,0},{6,18,7,0,0},{7,18,7,0,0},{8,18,7,0,0},{9,18,7,0,0},{10,18,7,0,0},{11,18,7,0,0}, + {12,18,7,0,0},{0,19,7,0,0},{1,19,7,0,0},{2,19,7,0,0},{3,19,7,0,0},{4,19,7,0,0},{5,19,7,0,0},{6,19,7,0,0},{7,19,7,0,0},{8,19,7,0,0},{9,19,7,0,0},{10,19,7,0,0},{11,19,7,0,0},{12,19,7,0,0},{0,20,7,0,0},{1,20,7,0,0}, + {2,20,7,0,0},{3,20,7,0,0},{4,20,7,0,0},{5,20,7,0,0},{6,20,7,0,0},{7,20,7,0,0},{8,20,7,0,0},{9,20,7,0,0},{10,20,7,0,0},{11,20,7,0,0},{12,20,7,0,0},{0,21,7,0,0},{1,21,7,0,0},{2,21,7,0,0},{3,21,7,0,0},{4,21,7,0,0}, + {5,21,7,0,0},{6,21,7,0,0},{7,21,7,0,0},{8,21,7,0,0},{9,21,7,0,0},{10,21,7,0,0},{11,21,7,0,0},{12,21,7,0,0},{0,22,7,0,0},{1,22,7,0,0},{2,22,7,0,0},{3,22,7,0,0},{4,22,7,0,0},{5,22,7,0,0},{6,22,7,0,0},{7,22,7,0,0}, + {8,22,7,0,0},{9,22,7,0,0},{10,22,7,0,0},{11,22,7,0,0},{12,22,7,0,0},{0,23,7,0,0},{1,23,7,0,0},{2,23,7,0,0},{3,23,7,0,0},{4,23,7,0,0},{5,23,7,0,0},{6,23,7,0,0},{7,23,7,0,0},{8,23,7,0,0},{9,23,7,0,0},{10,23,7,0,0}, + {11,23,7,0,0},{12,23,7,0,0},{0,0,8,0,0},{1,0,8,0,0},{2,0,8,0,0},{3,0,8,0,0},{4,0,8,0,0},{5,0,8,0,0},{6,0,8,0,0},{7,0,8,0,0},{8,0,8,0,0},{9,0,8,0,0},{10,0,8,0,0},{11,0,8,0,0},{12,0,8,0,0},{0,1,8,0,0}, + {1,1,8,0,0},{2,1,8,0,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,202,8},{7,1,8,0,0},{8,1,8,0,0},{9,1,8,0,0},{10,1,8,0,0},{11,1,8,0,0},{12,1,8,0,0},{0,2,8,0,0},{1,2,8,0,0},{2,2,8,0,0},{3,2,8,0,0}, + {4,2,8,0,0},{5,2,8,201,0},{6,2,8,202,8},{7,2,8,201,0},{8,2,8,0,0},{9,2,8,0,0},{10,2,8,0,0},{11,2,8,0,0},{12,2,8,0,0},{0,3,8,0,0},{1,3,8,0,0},{2,3,8,0,0},{3,3,8,0,0},{4,3,8,201,0},{5,3,8,201,0},{6,3,8,201,0}, + {7,3,8,201,0},{8,3,8,201,0},{9,3,8,0,0},{10,3,8,0,0},{11,3,8,0,0},{12,3,8,0,0},{0,4,8,0,0},{1,4,8,0,0},{2,4,8,0,0},{3,4,8,0,0},{4,4,8,201,0},{5,4,8,0,0},{7,4,8,0,0},{8,4,8,201,0},{9,4,8,0,0},{10,4,8,0,0}, + {11,4,8,0,0},{12,4,8,0,0},{0,5,8,0,0},{1,5,8,0,0},{2,5,8,0,0},{3,5,8,0,0},{4,5,8,201,0},{5,5,8,0,0},{6,5,8,0,0},{7,5,8,0,0},{8,5,8,201,0},{9,5,8,0,0},{10,5,8,0,0},{11,5,8,0,0},{12,5,8,0,0},{0,6,8,0,0}, + {1,6,8,0,0},{2,6,8,0,0},{3,6,8,0,0},{4,6,8,201,0},{5,6,8,0,0},{6,6,8,0,0},{7,6,8,0,0},{8,6,8,201,0},{9,6,8,0,0},{10,6,8,0,0},{11,6,8,0,0},{12,6,8,0,0},{0,7,8,0,0},{1,7,8,0,0},{2,7,8,0,0},{3,7,8,201,0}, + {4,7,8,201,0},{5,7,8,201,0},{6,7,8,201,0},{7,7,8,201,0},{8,7,8,201,0},{9,7,8,201,0},{10,7,8,0,0},{11,7,8,0,0},{12,7,8,0,0},{0,8,8,0,0},{1,8,8,0,0},{2,8,8,0,0},{3,8,8,201,0},{5,8,8,0,0},{6,8,8,0,0},{7,8,8,0,0}, + {9,8,8,201,0},{10,8,8,0,0},{11,8,8,0,0},{12,8,8,0,0},{0,9,8,0,0},{1,9,8,0,0},{2,9,8,0,0},{3,9,8,0,0},{4,9,8,0,0},{5,9,8,0,0},{6,9,8,202,8},{7,9,8,0,0},{8,9,8,0,0},{9,9,8,0,0},{10,9,8,0,0},{11,9,8,0,0}, + {12,9,8,0,0},{0,10,8,0,0},{1,10,8,0,0},{2,10,8,0,0},{3,10,8,0,0},{4,10,8,0,0},{5,10,8,0,0},{7,10,8,0,0},{8,10,8,0,0},{9,10,8,0,0},{10,10,8,0,0},{11,10,8,0,0},{12,10,8,0,0},{0,11,8,0,0},{1,11,8,0,0},{2,11,8,0,0}, + {3,11,8,0,0},{4,11,8,0,0},{5,11,8,0,0},{6,11,8,0,0},{7,11,8,0,0},{8,11,8,0,0},{9,11,8,0,0},{10,11,8,0,0},{11,11,8,0,0},{12,11,8,0,0},{0,12,8,0,0},{1,12,8,0,0},{2,12,8,0,0},{3,12,8,0,0},{4,12,8,0,0},{5,12,8,0,0}, + {6,12,8,0,0},{7,12,8,0,0},{8,12,8,0,0},{9,12,8,0,0},{10,12,8,0,0},{11,12,8,0,0},{12,12,8,0,0},{0,13,8,0,0},{1,13,8,0,0},{2,13,8,0,0},{3,13,8,0,0},{4,13,8,0,0},{5,13,8,0,0},{6,13,8,0,0},{7,13,8,0,0},{8,13,8,0,0}, + {9,13,8,0,0},{10,13,8,0,0},{11,13,8,0,0},{12,13,8,0,0},{0,14,8,0,0},{1,14,8,0,0},{2,14,8,0,0},{3,14,8,0,0},{4,14,8,0,0},{5,14,8,0,0},{6,14,8,0,0},{7,14,8,0,0},{8,14,8,0,0},{9,14,8,0,0},{10,14,8,0,0},{11,14,8,0,0}, + {12,14,8,0,0},{0,15,8,0,0},{1,15,8,0,0},{2,15,8,0,0},{3,15,8,0,0},{4,15,8,0,0},{5,15,8,0,0},{6,15,8,0,0},{7,15,8,0,0},{8,15,8,0,0},{9,15,8,0,0},{10,15,8,0,0},{11,15,8,0,0},{12,15,8,0,0},{0,16,8,0,0},{1,16,8,0,0}, + {2,16,8,0,0},{3,16,8,0,0},{4,16,8,0,0},{5,16,8,0,0},{6,16,8,0,0},{7,16,8,0,0},{8,16,8,0,0},{9,16,8,0,0},{10,16,8,0,0},{11,16,8,0,0},{12,16,8,0,0},{0,17,8,0,0},{1,17,8,0,0},{2,17,8,0,0},{3,17,8,0,0},{4,17,8,0,0}, + {5,17,8,0,0},{6,17,8,0,0},{7,17,8,0,0},{8,17,8,0,0},{9,17,8,0,0},{10,17,8,0,0},{11,17,8,0,0},{12,17,8,0,0},{0,18,8,0,0},{1,18,8,0,0},{2,18,8,0,0},{3,18,8,0,0},{4,18,8,0,0},{5,18,8,0,0},{6,18,8,0,0},{7,18,8,0,0}, + {8,18,8,0,0},{9,18,8,0,0},{10,18,8,0,0},{11,18,8,0,0},{12,18,8,0,0},{0,19,8,0,0},{1,19,8,0,0},{2,19,8,0,0},{3,19,8,0,0},{4,19,8,0,0},{5,19,8,0,0},{6,19,8,0,0},{7,19,8,0,0},{8,19,8,0,0},{9,19,8,0,0},{10,19,8,0,0}, + {11,19,8,0,0},{12,19,8,0,0},{0,20,8,0,0},{1,20,8,0,0},{2,20,8,0,0},{3,20,8,0,0},{4,20,8,0,0},{5,20,8,0,0},{6,20,8,0,0},{7,20,8,0,0},{8,20,8,0,0},{9,20,8,0,0},{10,20,8,0,0},{11,20,8,0,0},{12,20,8,0,0},{0,21,8,0,0}, + {1,21,8,0,0},{2,21,8,0,0},{3,21,8,0,0},{4,21,8,0,0},{5,21,8,0,0},{6,21,8,0,0},{7,21,8,0,0},{8,21,8,0,0},{9,21,8,0,0},{10,21,8,0,0},{11,21,8,0,0},{12,21,8,0,0},{0,22,8,0,0},{1,22,8,0,0},{2,22,8,0,0},{3,22,8,0,0}, + {4,22,8,0,0},{5,22,8,0,0},{6,22,8,0,0},{7,22,8,0,0},{8,22,8,0,0},{9,22,8,0,0},{10,22,8,0,0},{11,22,8,0,0},{12,22,8,0,0},{0,23,8,0,0},{1,23,8,0,0},{2,23,8,0,0},{3,23,8,0,0},{4,23,8,0,0},{5,23,8,0,0},{6,23,8,0,0}, + {7,23,8,0,0},{8,23,8,0,0},{9,23,8,0,0},{10,23,8,0,0},{11,23,8,0,0},{12,23,8,0,0},{0,0,9,0,0},{1,0,9,0,0},{2,0,9,0,0},{3,0,9,0,0},{4,0,9,0,0},{5,0,9,0,0},{6,0,9,0,0},{7,0,9,0,0},{8,0,9,0,0},{9,0,9,0,0}, + {10,0,9,0,0},{11,0,9,0,0},{12,0,9,0,0},{0,1,9,0,0},{1,1,9,0,0},{2,1,9,0,0},{3,1,9,0,0},{4,1,9,0,0},{5,1,9,0,0},{6,1,9,202,8},{7,1,9,0,0},{8,1,9,0,0},{9,1,9,0,0},{10,1,9,0,0},{11,1,9,0,0},{12,1,9,0,0}, + {0,2,9,0,0},{1,2,9,0,0},{2,2,9,0,0},{3,2,9,0,0},{4,2,9,0,0},{5,2,9,201,0},{6,2,9,202,8},{7,2,9,201,0},{8,2,9,0,0},{9,2,9,0,0},{10,2,9,0,0},{11,2,9,0,0},{12,2,9,0,0},{0,3,9,0,0},{1,3,9,0,0},{2,3,9,0,0}, + {3,3,9,0,0},{4,3,9,201,0},{5,3,9,0,0},{6,3,9,0,0},{7,3,9,0,0},{8,3,9,201,0},{9,3,9,0,0},{10,3,9,0,0},{11,3,9,0,0},{12,3,9,0,0},{0,4,9,0,0},{1,4,9,0,0},{2,4,9,0,0},{3,4,9,201,0},{4,4,9,0,0},{5,4,9,0,0}, + {6,4,9,0,0},{7,4,9,0,0},{8,4,9,0,0},{9,4,9,201,0},{10,4,9,0,0},{11,4,9,0,0},{12,4,9,0,0},{0,5,9,0,0},{1,5,9,0,0},{2,5,9,0,0},{3,5,9,201,0},{4,5,9,0,0},{5,5,9,0,0},{6,5,9,0,0},{7,5,9,0,0},{8,5,9,0,0}, + {9,5,9,201,0},{10,5,9,0,0},{11,5,9,0,0},{12,5,9,0,0},{0,6,9,0,0},{1,6,9,0,0},{2,6,9,0,0},{3,6,9,201,0},{4,6,9,0,0},{5,6,9,0,0},{6,6,9,0,0},{7,6,9,0,0},{8,6,9,0,0},{9,6,9,201,0},{10,6,9,0,0},{11,6,9,0,0}, + {12,6,9,0,0},{0,7,9,0,0},{1,7,9,0,0},{2,7,9,0,0},{3,7,9,201,0},{4,7,9,201,0},{5,7,9,201,0},{6,7,9,201,0},{7,7,9,201,0},{8,7,9,201,0},{9,7,9,201,0},{10,7,9,0,0},{11,7,9,0,0},{12,7,9,0,0},{0,8,9,0,0},{1,8,9,0,0}, + {2,8,9,0,0},{4,8,9,0,0},{5,8,9,0,0},{6,8,9,0,0},{7,8,9,0,0},{8,8,9,0,0},{10,8,9,0,0},{11,8,9,0,0},{12,8,9,0,0},{0,9,9,0,0},{1,9,9,0,0},{2,9,9,0,0},{3,9,9,0,0},{4,9,9,0,0},{5,9,9,0,0},{6,9,9,202,8}, + {7,9,9,0,0},{8,9,9,0,0},{9,9,9,0,0},{10,9,9,0,0},{11,9,9,0,0},{12,9,9,0,0},{0,10,9,0,0},{1,10,9,0,0},{2,10,9,0,0},{3,10,9,0,0},{4,10,9,0,0},{5,10,9,0,0},{6,10,9,0,0},{7,10,9,0,0},{8,10,9,0,0},{9,10,9,0,0}, + {10,10,9,0,0},{11,10,9,0,0},{12,10,9,0,0},{0,11,9,0,0},{1,11,9,0,0},{2,11,9,0,0},{3,11,9,0,0},{4,11,9,0,0},{5,11,9,0,0},{6,11,9,0,0},{7,11,9,0,0},{8,11,9,0,0},{9,11,9,0,0},{10,11,9,0,0},{11,11,9,0,0},{12,11,9,0,0}, + {0,12,9,0,0},{1,12,9,0,0},{2,12,9,0,0},{3,12,9,0,0},{4,12,9,0,0},{5,12,9,0,0},{6,12,9,0,0},{7,12,9,0,0},{8,12,9,0,0},{9,12,9,0,0},{10,12,9,0,0},{11,12,9,0,0},{12,12,9,0,0},{0,13,9,0,0},{1,13,9,0,0},{2,13,9,0,0}, + {3,13,9,0,0},{4,13,9,0,0},{5,13,9,0,0},{6,13,9,0,0},{7,13,9,0,0},{8,13,9,0,0},{9,13,9,0,0},{10,13,9,0,0},{11,13,9,0,0},{12,13,9,0,0},{0,14,9,0,0},{1,14,9,0,0},{2,14,9,0,0},{3,14,9,0,0},{4,14,9,0,0},{5,14,9,0,0}, + {6,14,9,0,0},{7,14,9,0,0},{8,14,9,0,0},{9,14,9,0,0},{10,14,9,0,0},{11,14,9,0,0},{12,14,9,0,0},{0,15,9,0,0},{1,15,9,0,0},{2,15,9,0,0},{3,15,9,0,0},{4,15,9,0,0},{5,15,9,0,0},{6,15,9,0,0},{7,15,9,0,0},{8,15,9,0,0}, + {9,15,9,0,0},{10,15,9,0,0},{11,15,9,0,0},{12,15,9,0,0},{0,16,9,0,0},{1,16,9,0,0},{2,16,9,0,0},{3,16,9,0,0},{4,16,9,0,0},{5,16,9,0,0},{6,16,9,0,0},{7,16,9,0,0},{8,16,9,0,0},{9,16,9,0,0},{10,16,9,0,0},{11,16,9,0,0}, + {12,16,9,0,0},{0,17,9,0,0},{1,17,9,0,0},{2,17,9,0,0},{3,17,9,0,0},{4,17,9,0,0},{5,17,9,0,0},{6,17,9,0,0},{7,17,9,0,0},{8,17,9,0,0},{9,17,9,0,0},{10,17,9,0,0},{11,17,9,0,0},{12,17,9,0,0},{0,18,9,0,0},{1,18,9,0,0}, + {2,18,9,0,0},{3,18,9,0,0},{4,18,9,0,0},{5,18,9,0,0},{6,18,9,0,0},{7,18,9,0,0},{8,18,9,0,0},{9,18,9,0,0},{10,18,9,0,0},{11,18,9,0,0},{12,18,9,0,0},{0,19,9,0,0},{1,19,9,0,0},{2,19,9,0,0},{3,19,9,0,0},{4,19,9,0,0}, + {5,19,9,0,0},{6,19,9,0,0},{7,19,9,0,0},{8,19,9,0,0},{9,19,9,0,0},{10,19,9,0,0},{11,19,9,0,0},{12,19,9,0,0},{0,20,9,0,0},{1,20,9,0,0},{2,20,9,0,0},{3,20,9,0,0},{4,20,9,0,0},{5,20,9,0,0},{6,20,9,0,0},{7,20,9,0,0}, + {8,20,9,0,0},{9,20,9,0,0},{10,20,9,0,0},{11,20,9,0,0},{12,20,9,0,0},{0,21,9,0,0},{1,21,9,0,0},{2,21,9,0,0},{3,21,9,0,0},{4,21,9,0,0},{5,21,9,0,0},{6,21,9,0,0},{7,21,9,0,0},{8,21,9,0,0},{9,21,9,0,0},{10,21,9,0,0}, + {11,21,9,0,0},{12,21,9,0,0},{0,22,9,0,0},{1,22,9,0,0},{2,22,9,0,0},{3,22,9,0,0},{4,22,9,0,0},{5,22,9,0,0},{6,22,9,0,0},{7,22,9,0,0},{8,22,9,0,0},{9,22,9,0,0},{10,22,9,0,0},{11,22,9,0,0},{12,22,9,0,0},{0,23,9,0,0}, + {1,23,9,0,0},{2,23,9,0,0},{3,23,9,0,0},{4,23,9,0,0},{5,23,9,0,0},{6,23,9,0,0},{7,23,9,0,0},{8,23,9,0,0},{9,23,9,0,0},{10,23,9,0,0},{11,23,9,0,0},{12,23,9,0,0},{0,0,10,0,0},{1,0,10,0,0},{2,0,10,0,0},{3,0,10,0,0}, + {4,0,10,0,0},{5,0,10,0,0},{6,0,10,0,0},{7,0,10,0,0},{8,0,10,0,0},{9,0,10,0,0},{10,0,10,0,0},{11,0,10,0,0},{12,0,10,0,0},{0,1,10,0,0},{1,1,10,0,0},{2,1,10,0,0},{3,1,10,0,0},{4,1,10,0,0},{5,1,10,0,0},{6,1,10,202,8}, + {7,1,10,0,0},{8,1,10,0,0},{9,1,10,0,0},{10,1,10,0,0},{11,1,10,0,0},{12,1,10,0,0},{0,2,10,0,0},{1,2,10,0,0},{2,2,10,0,0},{3,2,10,0,0},{4,2,10,201,0},{5,2,10,201,0},{6,2,10,202,8},{7,2,10,201,0},{8,2,10,201,0},{9,2,10,0,0}, + {10,2,10,0,0},{11,2,10,0,0},{12,2,10,0,0},{0,3,10,0,0},{1,3,10,0,0},{2,3,10,0,0},{3,3,10,201,0},{4,3,10,0,0},{5,3,10,0,0},{6,3,10,0,0},{7,3,10,0,0},{8,3,10,0,0},{9,3,10,201,0},{10,3,10,0,0},{11,3,10,0,0},{12,3,10,0,0}, + {0,4,10,0,0},{1,4,10,0,0},{2,4,10,0,0},{3,4,10,201,0},{4,4,10,0,0},{5,4,10,0,0},{6,4,10,0,0},{7,4,10,0,0},{8,4,10,0,0},{9,4,10,201,0},{10,4,10,0,0},{11,4,10,0,0},{12,4,10,0,0},{0,5,10,0,0},{1,5,10,0,0},{2,5,10,0,0}, + {3,5,10,201,0},{4,5,10,0,0},{5,5,10,0,0},{6,5,10,0,0},{7,5,10,0,0},{8,5,10,0,0},{9,5,10,201,0},{10,5,10,0,0},{11,5,10,0,0},{12,5,10,0,0},{0,6,10,0,0},{1,6,10,0,0},{2,6,10,0,0},{3,6,10,201,0},{4,6,10,0,0},{5,6,10,0,0}, + {6,6,10,0,0},{7,6,10,0,0},{8,6,10,0,0},{9,6,10,201,0},{10,6,10,0,0},{11,6,10,0,0},{12,6,10,0,0},{0,7,10,0,0},{1,7,10,0,0},{2,7,10,201,0},{3,7,10,201,0},{4,7,10,201,0},{5,7,10,201,0},{6,7,10,201,0},{7,7,10,201,0},{8,7,10,201,0}, + {9,7,10,201,0},{10,7,10,201,0},{11,7,10,0,0},{12,7,10,0,0},{0,8,10,0,0},{1,8,10,0,0},{2,8,10,201,0},{4,8,10,0,0},{5,8,10,0,0},{6,8,10,202,8},{7,8,10,0,0},{8,8,10,0,0},{10,8,10,201,0},{11,8,10,0,0},{12,8,10,0,0},{0,9,10,0,0}, + {1,9,10,0,0},{3,9,10,0,0},{4,9,10,0,0},{5,9,10,0,0},{7,9,10,0,0},{8,9,10,0,0},{9,9,10,0,0},{11,9,10,0,0},{12,9,10,0,0},{0,10,10,0,0},{1,10,10,0,0},{2,10,10,0,0},{3,10,10,0,0},{4,10,10,0,0},{5,10,10,0,0},{6,10,10,0,0}, + {7,10,10,0,0},{8,10,10,0,0},{9,10,10,0,0},{10,10,10,0,0},{11,10,10,0,0},{12,10,10,0,0},{0,11,10,0,0},{1,11,10,0,0},{2,11,10,0,0},{3,11,10,0,0},{4,11,10,0,0},{5,11,10,0,0},{6,11,10,0,0},{7,11,10,0,0},{8,11,10,0,0},{9,11,10,0,0}, + {10,11,10,0,0},{11,11,10,0,0},{12,11,10,0,0},{0,12,10,0,0},{1,12,10,0,0},{2,12,10,0,0},{3,12,10,0,0},{4,12,10,0,0},{5,12,10,0,0},{6,12,10,0,0},{7,12,10,0,0},{8,12,10,0,0},{9,12,10,0,0},{10,12,10,0,0},{11,12,10,0,0},{12,12,10,0,0}, + {0,13,10,0,0},{1,13,10,0,0},{2,13,10,0,0},{3,13,10,0,0},{4,13,10,0,0},{5,13,10,0,0},{6,13,10,0,0},{7,13,10,0,0},{8,13,10,0,0},{9,13,10,0,0},{10,13,10,0,0},{11,13,10,0,0},{12,13,10,0,0},{0,14,10,0,0},{1,14,10,0,0},{2,14,10,0,0}, + {3,14,10,0,0},{4,14,10,0,0},{5,14,10,0,0},{6,14,10,0,0},{7,14,10,0,0},{8,14,10,0,0},{9,14,10,0,0},{10,14,10,0,0},{11,14,10,0,0},{12,14,10,0,0},{0,15,10,0,0},{1,15,10,0,0},{2,15,10,0,0},{3,15,10,0,0},{4,15,10,0,0},{5,15,10,0,0}, + {6,15,10,0,0},{7,15,10,0,0},{8,15,10,0,0},{9,15,10,0,0},{10,15,10,0,0},{11,15,10,0,0},{12,15,10,0,0},{0,16,10,0,0},{1,16,10,0,0},{2,16,10,0,0},{3,16,10,0,0},{4,16,10,0,0},{5,16,10,0,0},{6,16,10,0,0},{7,16,10,0,0},{8,16,10,0,0}, + {9,16,10,0,0},{10,16,10,0,0},{11,16,10,0,0},{12,16,10,0,0},{0,17,10,0,0},{1,17,10,0,0},{2,17,10,0,0},{3,17,10,0,0},{4,17,10,0,0},{5,17,10,0,0},{6,17,10,0,0},{7,17,10,0,0},{8,17,10,0,0},{9,17,10,0,0},{10,17,10,0,0},{11,17,10,0,0}, + {12,17,10,0,0},{0,18,10,0,0},{1,18,10,0,0},{2,18,10,0,0},{3,18,10,0,0},{4,18,10,0,0},{5,18,10,0,0},{6,18,10,0,0},{7,18,10,0,0},{8,18,10,0,0},{9,18,10,0,0},{10,18,10,0,0},{11,18,10,0,0},{12,18,10,0,0},{0,19,10,0,0},{1,19,10,0,0}, + {2,19,10,0,0},{3,19,10,0,0},{4,19,10,0,0},{5,19,10,0,0},{6,19,10,0,0},{7,19,10,0,0},{8,19,10,0,0},{9,19,10,0,0},{10,19,10,0,0},{11,19,10,0,0},{12,19,10,0,0},{0,20,10,0,0},{1,20,10,0,0},{2,20,10,0,0},{3,20,10,0,0},{4,20,10,0,0}, + {5,20,10,0,0},{6,20,10,0,0},{7,20,10,0,0},{8,20,10,0,0},{9,20,10,0,0},{10,20,10,0,0},{11,20,10,0,0},{12,20,10,0,0},{0,21,10,0,0},{1,21,10,0,0},{2,21,10,0,0},{3,21,10,0,0},{4,21,10,0,0},{5,21,10,0,0},{6,21,10,0,0},{7,21,10,0,0}, + {8,21,10,0,0},{9,21,10,0,0},{10,21,10,0,0},{11,21,10,0,0},{12,21,10,0,0},{0,22,10,0,0},{1,22,10,0,0},{2,22,10,0,0},{3,22,10,0,0},{4,22,10,0,0},{5,22,10,0,0},{6,22,10,0,0},{7,22,10,0,0},{8,22,10,0,0},{9,22,10,0,0},{10,22,10,0,0}, + {11,22,10,0,0},{12,22,10,0,0},{0,23,10,0,0},{1,23,10,0,0},{2,23,10,0,0},{3,23,10,0,0},{4,23,10,0,0},{5,23,10,0,0},{6,23,10,0,0},{7,23,10,0,0},{8,23,10,0,0},{9,23,10,0,0},{10,23,10,0,0},{11,23,10,0,0},{12,23,10,0,0},{0,0,11,0,0}, + {1,0,11,0,0},{2,0,11,0,0},{3,0,11,0,0},{4,0,11,0,0},{5,0,11,0,0},{6,0,11,202,8},{7,0,11,0,0},{8,0,11,0,0},{9,0,11,0,0},{10,0,11,0,0},{11,0,11,0,0},{12,0,11,0,0},{0,1,11,0,0},{1,1,11,0,0},{2,1,11,0,0},{3,1,11,0,0}, + {4,1,11,0,0},{5,1,11,0,0},{6,1,11,202,8},{7,1,11,0,0},{8,1,11,0,0},{9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0},{12,1,11,0,0},{0,2,11,0,0},{1,2,11,0,0},{2,2,11,0,0},{3,2,11,0,0},{4,2,11,201,0},{5,2,11,201,0},{6,2,11,202,8}, + {7,2,11,201,0},{8,2,11,201,0},{9,2,11,0,0},{10,2,11,0,0},{11,2,11,0,0},{12,2,11,0,0},{0,3,11,0,0},{1,3,11,0,0},{2,3,11,0,0},{3,3,11,201,0},{4,3,11,0,0},{5,3,11,0,0},{6,3,11,0,0},{7,3,11,0,0},{8,3,11,0,0},{9,3,11,201,0}, + {10,3,11,0,0},{11,3,11,0,0},{12,3,11,0,0},{0,4,11,0,0},{1,4,11,0,0},{2,4,11,201,0},{3,4,11,0,0},{4,4,11,0,0},{5,4,11,0,0},{6,4,11,0,0},{7,4,11,0,0},{8,4,11,0,0},{9,4,11,0,0},{10,4,11,201,0},{11,4,11,0,0},{12,4,11,0,0}, + {0,5,11,0,0},{1,5,11,0,0},{2,5,11,201,0},{3,5,11,0,0},{4,5,11,0,0},{5,5,11,0,0},{6,5,11,0,0},{7,5,11,0,0},{8,5,11,0,0},{9,5,11,0,0},{10,5,11,201,0},{11,5,11,0,0},{12,5,11,0,0},{0,6,11,0,0},{1,6,11,0,0},{2,6,11,201,0}, + {3,6,11,0,0},{4,6,11,0,0},{5,6,11,0,0},{6,6,11,0,0},{7,6,11,0,0},{8,6,11,0,0},{9,6,11,0,0},{10,6,11,201,0},{11,6,11,0,0},{12,6,11,0,0},{0,7,11,0,0},{1,7,11,0,0},{2,7,11,201,0},{3,7,11,201,0},{4,7,11,201,0},{5,7,11,201,0}, + {6,7,11,201,0},{7,7,11,201,0},{8,7,11,201,0},{9,7,11,201,0},{10,7,11,201,0},{11,7,11,0,0},{12,7,11,0,0},{0,8,11,0,0},{1,8,11,0,0},{3,8,11,0,0},{4,8,11,0,0},{5,8,11,0,0},{6,8,11,202,8},{7,8,11,0,0},{8,8,11,0,0},{9,8,11,0,0}, + {11,8,11,0,0},{12,8,11,0,0},{0,9,11,0,0},{1,9,11,0,0},{2,9,11,0,0},{3,9,11,0,0},{4,9,11,0,0},{5,9,11,0,0},{6,9,11,0,0},{7,9,11,0,0},{8,9,11,0,0},{9,9,11,0,0},{10,9,11,0,0},{11,9,11,0,0},{12,9,11,0,0},{0,10,11,0,0}, + {1,10,11,0,0},{2,10,11,0,0},{3,10,11,0,0},{4,10,11,0,0},{5,10,11,0,0},{6,10,11,0,0},{7,10,11,0,0},{8,10,11,0,0},{9,10,11,0,0},{10,10,11,0,0},{11,10,11,0,0},{12,10,11,0,0},{0,11,11,0,0},{1,11,11,0,0},{2,11,11,0,0},{3,11,11,0,0}, + {4,11,11,0,0},{5,11,11,0,0},{6,11,11,0,0},{7,11,11,0,0},{8,11,11,0,0},{9,11,11,0,0},{10,11,11,0,0},{11,11,11,0,0},{12,11,11,0,0},{0,12,11,0,0},{1,12,11,0,0},{2,12,11,0,0},{3,12,11,0,0},{4,12,11,0,0},{5,12,11,0,0},{6,12,11,0,0}, + {7,12,11,0,0},{8,12,11,0,0},{9,12,11,0,0},{10,12,11,0,0},{11,12,11,0,0},{12,12,11,0,0},{0,13,11,0,0},{1,13,11,0,0},{2,13,11,0,0},{3,13,11,0,0},{4,13,11,0,0},{5,13,11,0,0},{6,13,11,0,0},{7,13,11,0,0},{8,13,11,0,0},{9,13,11,0,0}, + {10,13,11,0,0},{11,13,11,0,0},{12,13,11,0,0},{0,14,11,0,0},{1,14,11,0,0},{2,14,11,0,0},{3,14,11,0,0},{4,14,11,0,0},{5,14,11,0,0},{6,14,11,0,0},{7,14,11,0,0},{8,14,11,0,0},{9,14,11,0,0},{10,14,11,0,0},{11,14,11,0,0},{12,14,11,0,0}, + {0,15,11,0,0},{1,15,11,0,0},{2,15,11,0,0},{3,15,11,0,0},{4,15,11,0,0},{5,15,11,0,0},{6,15,11,0,0},{7,15,11,0,0},{8,15,11,0,0},{9,15,11,0,0},{10,15,11,0,0},{11,15,11,0,0},{12,15,11,0,0},{0,16,11,0,0},{1,16,11,0,0},{2,16,11,0,0}, + {3,16,11,0,0},{4,16,11,0,0},{5,16,11,0,0},{6,16,11,0,0},{7,16,11,0,0},{8,16,11,0,0},{9,16,11,0,0},{10,16,11,0,0},{11,16,11,0,0},{12,16,11,0,0},{0,17,11,0,0},{1,17,11,0,0},{2,17,11,0,0},{3,17,11,0,0},{4,17,11,0,0},{5,17,11,0,0}, + {6,17,11,0,0},{7,17,11,0,0},{8,17,11,0,0},{9,17,11,0,0},{10,17,11,0,0},{11,17,11,0,0},{12,17,11,0,0},{0,18,11,0,0},{1,18,11,0,0},{2,18,11,0,0},{3,18,11,0,0},{4,18,11,0,0},{5,18,11,0,0},{6,18,11,0,0},{7,18,11,0,0},{8,18,11,0,0}, + {9,18,11,0,0},{10,18,11,0,0},{11,18,11,0,0},{12,18,11,0,0},{0,19,11,0,0},{1,19,11,0,0},{2,19,11,0,0},{3,19,11,0,0},{4,19,11,0,0},{5,19,11,0,0},{6,19,11,0,0},{7,19,11,0,0},{8,19,11,0,0},{9,19,11,0,0},{10,19,11,0,0},{11,19,11,0,0}, + {12,19,11,0,0},{0,20,11,0,0},{1,20,11,0,0},{2,20,11,0,0},{3,20,11,0,0},{4,20,11,0,0},{5,20,11,0,0},{6,20,11,0,0},{7,20,11,0,0},{8,20,11,0,0},{9,20,11,0,0},{10,20,11,0,0},{11,20,11,0,0},{12,20,11,0,0},{0,21,11,0,0},{1,21,11,0,0}, + {2,21,11,0,0},{3,21,11,0,0},{4,21,11,0,0},{5,21,11,0,0},{6,21,11,0,0},{7,21,11,0,0},{8,21,11,0,0},{9,21,11,0,0},{10,21,11,0,0},{11,21,11,0,0},{12,21,11,0,0},{0,22,11,0,0},{1,22,11,0,0},{2,22,11,0,0},{3,22,11,0,0},{4,22,11,0,0}, + {5,22,11,0,0},{6,22,11,0,0},{7,22,11,0,0},{8,22,11,0,0},{9,22,11,0,0},{10,22,11,0,0},{11,22,11,0,0},{12,22,11,0,0},{0,23,11,0,0},{1,23,11,0,0},{2,23,11,0,0},{3,23,11,0,0},{4,23,11,0,0},{5,23,11,0,0},{6,23,11,0,0},{7,23,11,0,0}, + {8,23,11,0,0},{9,23,11,0,0},{10,23,11,0,0},{11,23,11,0,0},{12,23,11,0,0},{0,0,12,0,0},{1,0,12,0,0},{2,0,12,0,0},{3,0,12,0,0},{4,0,12,0,0},{5,0,12,0,0},{6,0,12,202,8},{7,0,12,0,0},{8,0,12,0,0},{9,0,12,0,0},{10,0,12,0,0}, + {11,0,12,0,0},{12,0,12,0,0},{0,1,12,0,0},{1,1,12,0,0},{2,1,12,0,0},{3,1,12,0,0},{4,1,12,0,0},{5,1,12,201,0},{6,1,12,201,0},{7,1,12,201,0},{8,1,12,0,0},{9,1,12,0,0},{10,1,12,0,0},{11,1,12,0,0},{12,1,12,0,0},{0,2,12,0,0}, + {1,2,12,0,0},{2,2,12,0,0},{3,2,12,0,0},{4,2,12,201,0},{5,2,12,49,0},{6,2,12,202,8},{7,2,12,49,0},{8,2,12,201,0},{9,2,12,0,0},{10,2,12,0,0},{11,2,12,0,0},{12,2,12,0,0},{0,3,12,0,0},{1,3,12,0,0},{2,3,12,0,0},{3,3,12,201,0}, + {4,3,12,0,0},{5,3,12,0,0},{6,3,12,0,0},{7,3,12,0,0},{8,3,12,0,0},{9,3,12,201,0},{10,3,12,0,0},{11,3,12,0,0},{12,3,12,0,0},{0,4,12,0,0},{1,4,12,0,0},{2,4,12,201,0},{3,4,12,0,0},{4,4,12,0,0},{5,4,12,0,0},{6,4,12,0,0}, + {7,4,12,0,0},{8,4,12,0,0},{9,4,12,0,0},{10,4,12,201,0},{11,4,12,0,0},{12,4,12,0,0},{0,5,12,0,0},{1,5,12,0,0},{2,5,12,201,0},{3,5,12,0,0},{4,5,12,0,0},{5,5,12,0,0},{6,5,12,0,0},{7,5,12,0,0},{8,5,12,0,0},{9,5,12,0,0}, + {10,5,12,201,0},{11,5,12,0,0},{12,5,12,0,0},{0,6,12,0,0},{1,6,12,0,0},{2,6,12,201,0},{3,6,12,0,0},{4,6,12,0,0},{5,6,12,0,0},{6,6,12,0,0},{7,6,12,0,0},{8,6,12,0,0},{9,6,12,0,0},{10,6,12,201,0},{11,6,12,0,0},{12,6,12,0,0}, + {0,7,12,0,0},{1,7,12,0,0},{2,7,12,201,0},{3,7,12,201,0},{4,7,12,201,0},{5,7,12,201,0},{6,7,12,202,8},{7,7,12,201,0},{8,7,12,201,0},{9,7,12,201,0},{10,7,12,201,0},{11,7,12,0,0},{12,7,12,0,0},{0,8,12,0,0},{1,8,12,0,0},{3,8,12,0,0}, + {4,8,12,0,0},{5,8,12,0,0},{7,8,12,0,0},{8,8,12,0,0},{9,8,12,0,0},{11,8,12,0,0},{12,8,12,0,0},{0,9,12,0,0},{1,9,12,0,0},{2,9,12,0,0},{3,9,12,0,0},{4,9,12,0,0},{5,9,12,0,0},{6,9,12,0,0},{7,9,12,0,0},{8,9,12,0,0}, + {9,9,12,0,0},{10,9,12,0,0},{11,9,12,0,0},{12,9,12,0,0},{0,10,12,0,0},{1,10,12,0,0},{2,10,12,0,0},{3,10,12,0,0},{4,10,12,0,0},{5,10,12,0,0},{6,10,12,0,0},{7,10,12,0,0},{8,10,12,0,0},{9,10,12,0,0},{10,10,12,0,0},{11,10,12,0,0}, + {12,10,12,0,0},{0,11,12,0,0},{1,11,12,0,0},{2,11,12,0,0},{3,11,12,0,0},{4,11,12,0,0},{5,11,12,0,0},{6,11,12,0,0},{7,11,12,0,0},{8,11,12,0,0},{9,11,12,0,0},{10,11,12,0,0},{11,11,12,0,0},{12,11,12,0,0},{0,12,12,0,0},{1,12,12,0,0}, + {2,12,12,0,0},{3,12,12,0,0},{4,12,12,0,0},{5,12,12,0,0},{6,12,12,0,0},{7,12,12,0,0},{8,12,12,0,0},{9,12,12,0,0},{10,12,12,0,0},{11,12,12,0,0},{12,12,12,0,0},{0,13,12,0,0},{1,13,12,0,0},{2,13,12,0,0},{3,13,12,0,0},{4,13,12,0,0}, + {5,13,12,0,0},{6,13,12,0,0},{7,13,12,0,0},{8,13,12,0,0},{9,13,12,0,0},{10,13,12,0,0},{11,13,12,0,0},{12,13,12,0,0},{0,14,12,0,0},{1,14,12,0,0},{2,14,12,0,0},{3,14,12,0,0},{4,14,12,0,0},{5,14,12,0,0},{6,14,12,0,0},{7,14,12,0,0}, + {8,14,12,0,0},{9,14,12,0,0},{10,14,12,0,0},{11,14,12,0,0},{12,14,12,0,0},{0,15,12,0,0},{1,15,12,0,0},{2,15,12,0,0},{3,15,12,0,0},{4,15,12,0,0},{5,15,12,0,0},{6,15,12,0,0},{7,15,12,0,0},{8,15,12,0,0},{9,15,12,0,0},{10,15,12,0,0}, + {11,15,12,0,0},{12,15,12,0,0},{0,16,12,0,0},{1,16,12,0,0},{2,16,12,0,0},{3,16,12,0,0},{4,16,12,0,0},{5,16,12,0,0},{6,16,12,0,0},{7,16,12,0,0},{8,16,12,0,0},{9,16,12,0,0},{10,16,12,0,0},{11,16,12,0,0},{12,16,12,0,0},{0,17,12,0,0}, + {1,17,12,0,0},{2,17,12,0,0},{3,17,12,0,0},{4,17,12,0,0},{5,17,12,0,0},{6,17,12,0,0},{7,17,12,0,0},{8,17,12,0,0},{9,17,12,0,0},{10,17,12,0,0},{11,17,12,0,0},{12,17,12,0,0},{0,18,12,0,0},{1,18,12,0,0},{2,18,12,0,0},{3,18,12,0,0}, + {4,18,12,0,0},{5,18,12,0,0},{6,18,12,0,0},{7,18,12,0,0},{8,18,12,0,0},{9,18,12,0,0},{10,18,12,0,0},{11,18,12,0,0},{12,18,12,0,0},{0,19,12,0,0},{1,19,12,0,0},{2,19,12,0,0},{3,19,12,0,0},{4,19,12,0,0},{5,19,12,0,0},{6,19,12,0,0}, + {7,19,12,0,0},{8,19,12,0,0},{9,19,12,0,0},{10,19,12,0,0},{11,19,12,0,0},{12,19,12,0,0},{0,20,12,0,0},{1,20,12,0,0},{2,20,12,0,0},{3,20,12,0,0},{4,20,12,0,0},{5,20,12,0,0},{6,20,12,0,0},{7,20,12,0,0},{8,20,12,0,0},{9,20,12,0,0}, + {10,20,12,0,0},{11,20,12,0,0},{12,20,12,0,0},{0,21,12,0,0},{1,21,12,0,0},{2,21,12,0,0},{3,21,12,0,0},{9,21,12,0,0},{10,21,12,0,0},{11,21,12,0,0},{12,21,12,0,0},{0,22,12,0,0},{1,22,12,0,0},{2,22,12,0,0},{3,22,12,0,0},{4,22,12,0,0}, + {5,22,12,0,0},{6,22,12,0,0},{7,22,12,0,0},{8,22,12,0,0},{9,22,12,0,0},{10,22,12,0,0},{11,22,12,0,0},{12,22,12,0,0},{0,23,12,0,0},{1,23,12,0,0},{2,23,12,0,0},{3,23,12,0,0},{4,23,12,0,0},{5,23,12,0,0},{6,23,12,0,0},{7,23,12,0,0}, + {8,23,12,0,0},{9,23,12,0,0},{10,23,12,0,0},{11,23,12,0,0},{12,23,12,0,0},{0,0,13,0,0},{1,0,13,0,0},{2,0,13,0,0},{3,0,13,0,0},{4,0,13,0,0},{5,0,13,0,0},{6,0,13,202,8},{7,0,13,0,0},{8,0,13,0,0},{9,0,13,0,0},{10,0,13,0,0}, + {11,0,13,0,0},{12,0,13,0,0},{0,1,13,0,0},{1,1,13,0,0},{2,1,13,0,0},{3,1,13,0,0},{5,1,13,201,0},{6,1,13,201,0},{7,1,13,201,0},{9,1,13,0,0},{10,1,13,0,0},{11,1,13,0,0},{12,1,13,0,0},{0,2,13,0,0},{1,2,13,0,0},{2,2,13,0,0}, + {4,2,13,201,0},{5,2,13,49,0},{6,2,13,202,8},{7,2,13,49,0},{8,2,13,201,0},{10,2,13,0,0},{11,2,13,0,0},{12,2,13,0,0},{0,3,13,0,0},{1,3,13,0,0},{3,3,13,201,0},{4,3,13,0,0},{5,3,13,0,0},{6,3,13,0,0},{7,3,13,0,0},{8,3,13,0,0}, + {9,3,13,201,0},{11,3,13,0,0},{12,3,13,0,0},{0,4,13,0,0},{1,4,13,0,0},{2,4,13,201,0},{3,4,13,0,0},{4,4,13,0,0},{5,4,13,0,0},{6,4,13,0,0},{7,4,13,0,0},{8,4,13,0,0},{9,4,13,0,0},{10,4,13,201,0},{11,4,13,0,0},{12,4,13,0,0}, + {0,5,13,0,0},{2,5,13,201,0},{3,5,13,0,0},{4,5,13,0,0},{5,5,13,0,0},{6,5,13,0,0},{7,5,13,0,0},{8,5,13,0,0},{9,5,13,0,0},{10,5,13,201,0},{12,5,13,0,0},{0,6,13,0,0},{1,6,13,0,0},{2,6,13,0,0},{3,6,13,0,0},{4,6,13,0,0}, + {5,6,13,0,0},{6,6,13,0,0},{7,6,13,0,0},{8,6,13,0,0},{9,6,13,0,0},{10,6,13,0,0},{11,6,13,0,0},{12,6,13,0,0},{0,7,13,0,0},{1,7,13,0,0},{2,7,13,201,0},{3,7,13,201,0},{4,7,13,201,0},{5,7,13,201,0},{7,7,13,201,0},{8,7,13,201,0}, + {9,7,13,201,0},{10,7,13,201,0},{11,7,13,0,0},{12,7,13,0,0},{0,8,13,0,0},{1,8,13,0,0},{2,8,13,201,0},{3,8,13,0,0},{4,8,13,0,0},{5,8,13,0,0},{6,8,13,0,0},{7,8,13,0,0},{8,8,13,0,0},{9,8,13,0,0},{10,8,13,201,0},{11,8,13,0,0}, + {12,8,13,0,0},{0,9,13,0,0},{1,9,13,0,0},{2,9,13,0,0},{3,9,13,0,0},{4,9,13,0,0},{5,9,13,0,0},{6,9,13,0,0},{7,9,13,0,0},{8,9,13,0,0},{9,9,13,0,0},{10,9,13,0,0},{11,9,13,0,0},{12,9,13,0,0},{0,10,13,0,0},{1,10,13,0,0}, + {2,10,13,0,0},{3,10,13,0,0},{4,10,13,0,0},{5,10,13,0,0},{6,10,13,0,0},{7,10,13,0,0},{8,10,13,0,0},{9,10,13,0,0},{10,10,13,0,0},{11,10,13,0,0},{12,10,13,0,0},{0,11,13,0,0},{1,11,13,0,0},{2,11,13,0,0},{3,11,13,0,0},{4,11,13,0,0}, + {5,11,13,0,0},{6,11,13,0,0},{7,11,13,0,0},{8,11,13,0,0},{9,11,13,0,0},{10,11,13,0,0},{11,11,13,0,0},{12,11,13,0,0},{0,12,13,0,0},{1,12,13,0,0},{2,12,13,0,0},{3,12,13,0,0},{4,12,13,0,0},{5,12,13,0,0},{6,12,13,0,0},{7,12,13,0,0}, + {8,12,13,0,0},{9,12,13,0,0},{10,12,13,0,0},{11,12,13,0,0},{12,12,13,0,0},{0,13,13,0,0},{1,13,13,0,0},{2,13,13,0,0},{3,13,13,0,0},{4,13,13,0,0},{5,13,13,0,0},{6,13,13,0,0},{7,13,13,0,0},{8,13,13,0,0},{9,13,13,0,0},{10,13,13,0,0}, + {11,13,13,0,0},{12,13,13,0,0},{0,14,13,0,0},{1,14,13,0,0},{2,14,13,0,0},{3,14,13,0,0},{4,14,13,0,0},{5,14,13,0,0},{6,14,13,0,0},{7,14,13,0,0},{8,14,13,0,0},{9,14,13,0,0},{10,14,13,0,0},{11,14,13,0,0},{12,14,13,0,0},{0,15,13,0,0}, + {1,15,13,0,0},{2,15,13,0,0},{3,15,13,0,0},{4,15,13,0,0},{5,15,13,0,0},{6,15,13,0,0},{7,15,13,0,0},{8,15,13,0,0},{9,15,13,0,0},{10,15,13,0,0},{11,15,13,0,0},{12,15,13,0,0},{0,16,13,0,0},{1,16,13,0,0},{2,16,13,0,0},{3,16,13,0,0}, + {4,16,13,0,0},{5,16,13,0,0},{6,16,13,0,0},{7,16,13,0,0},{8,16,13,0,0},{9,16,13,0,0},{10,16,13,0,0},{11,16,13,0,0},{12,16,13,0,0},{0,17,13,0,0},{1,17,13,0,0},{2,17,13,0,0},{3,17,13,0,0},{4,17,13,0,0},{5,17,13,0,0},{6,17,13,0,0}, + {7,17,13,0,0},{8,17,13,0,0},{9,17,13,0,0},{10,17,13,0,0},{11,17,13,0,0},{12,17,13,0,0},{0,18,13,0,0},{1,18,13,0,0},{2,18,13,0,0},{3,18,13,0,0},{4,18,13,0,0},{5,18,13,0,0},{6,18,13,0,0},{7,18,13,0,0},{8,18,13,0,0},{9,18,13,0,0}, + {10,18,13,0,0},{11,18,13,0,0},{12,18,13,0,0},{0,19,13,0,0},{1,19,13,0,0},{2,19,13,0,0},{3,19,13,0,0},{4,19,13,0,0},{5,19,13,0,0},{6,19,13,0,0},{7,19,13,0,0},{8,19,13,0,0},{9,19,13,0,0},{10,19,13,0,0},{11,19,13,0,0},{12,19,13,0,0}, + {0,20,13,0,0},{1,20,13,0,0},{2,20,13,0,0},{3,20,13,0,0},{4,20,13,0,0},{6,20,13,0,0},{8,20,13,0,0},{9,20,13,0,0},{10,20,13,0,0},{11,20,13,0,0},{12,20,13,0,0},{0,21,13,0,0},{1,21,13,0,0},{2,21,13,0,0},{3,21,13,0,0},{5,21,13,0,0}, + {6,21,13,0,0},{7,21,13,0,0},{9,21,13,0,0},{10,21,13,0,0},{11,21,13,0,0},{12,21,13,0,0},{0,22,13,0,0},{1,22,13,0,0},{2,22,13,0,0},{3,22,13,0,0},{4,22,13,0,0},{5,22,13,0,0},{6,22,13,0,0},{7,22,13,0,0},{8,22,13,0,0},{9,22,13,0,0}, + {10,22,13,0,0},{11,22,13,0,0},{12,22,13,0,0},{0,23,13,0,0},{1,23,13,0,0},{2,23,13,0,0},{3,23,13,0,0},{4,23,13,0,0},{5,23,13,0,0},{6,23,13,0,0},{7,23,13,0,0},{8,23,13,0,0},{9,23,13,0,0},{10,23,13,0,0},{11,23,13,0,0},{12,23,13,0,0}, + {0,0,14,0,0},{1,0,14,0,0},{2,0,14,0,0},{3,0,14,0,0},{4,0,14,0,0},{5,0,14,0,0},{6,0,14,202,8},{7,0,14,0,0},{8,0,14,0,0},{9,0,14,0,0},{10,0,14,0,0},{11,0,14,0,0},{12,0,14,0,0},{0,1,14,0,0},{1,1,14,0,0},{2,1,14,0,0}, + {3,1,14,0,0},{4,1,14,0,0},{5,1,14,201,0},{6,1,14,201,0},{7,1,14,201,0},{8,1,14,0,0},{9,1,14,0,0},{10,1,14,0,0},{11,1,14,0,0},{12,1,14,0,0},{0,2,14,0,0},{1,2,14,0,0},{2,2,14,0,0},{3,2,14,0,0},{4,2,14,201,0},{5,2,14,49,0}, + {6,2,14,202,0},{7,2,14,49,0},{8,2,14,201,0},{9,2,14,0,0},{10,2,14,0,0},{11,2,14,0,0},{12,2,14,0,0},{0,3,14,0,0},{1,3,14,0,0},{2,3,14,0,0},{3,3,14,201,0},{4,3,14,0,0},{5,3,14,0,0},{6,3,14,202,0},{7,3,14,0,0},{8,3,14,0,0}, + {9,3,14,201,0},{10,3,14,0,0},{11,3,14,0,0},{12,3,14,0,0},{0,4,14,0,0},{1,4,14,0,0},{2,4,14,201,0},{3,4,14,0,0},{4,4,14,0,0},{5,4,14,0,0},{6,4,14,202,0},{7,4,14,0,0},{8,4,14,0,0},{9,4,14,0,0},{10,4,14,201,0},{11,4,14,0,0}, + {12,4,14,0,0},{0,5,14,0,0},{1,5,14,0,0},{2,5,14,201,0},{3,5,14,0,0},{4,5,14,0,0},{5,5,14,0,0},{6,5,14,202,0},{7,5,14,0,0},{8,5,14,0,0},{9,5,14,0,0},{10,5,14,201,0},{11,5,14,0,0},{12,5,14,0,0},{0,6,14,0,0},{1,6,14,0,0}, + {2,6,14,201,0},{3,6,14,0,0},{4,6,14,0,0},{5,6,14,0,0},{6,6,14,202,0},{7,6,14,0,0},{8,6,14,0,0},{9,6,14,0,0},{10,6,14,201,0},{11,6,14,0,0},{12,6,14,0,0},{0,7,14,0,0},{1,7,14,0,0},{2,7,14,201,0},{3,7,14,201,0},{4,7,14,201,0}, + {5,7,14,201,0},{6,7,14,202,0},{7,7,14,201,0},{8,7,14,201,0},{9,7,14,201,0},{10,7,14,201,0},{11,7,14,0,0},{12,7,14,0,0},{0,8,14,0,0},{1,8,14,0,0},{3,8,14,0,0},{4,8,14,0,0},{5,8,14,0,0},{6,8,14,202,0},{7,8,14,0,0},{8,8,14,0,0}, + {9,8,14,0,0},{11,8,14,0,0},{12,8,14,0,0},{0,9,14,0,0},{1,9,14,0,0},{2,9,14,0,0},{3,9,14,0,0},{4,9,14,0,0},{5,9,14,0,0},{6,9,14,202,0},{7,9,14,0,0},{8,9,14,0,0},{9,9,14,0,0},{10,9,14,0,0},{11,9,14,0,0},{12,9,14,0,0}, + {0,10,14,0,0},{1,10,14,0,0},{2,10,14,0,0},{3,10,14,0,0},{4,10,14,0,0},{5,10,14,0,0},{6,10,14,202,0},{7,10,14,0,0},{8,10,14,0,0},{9,10,14,0,0},{10,10,14,0,0},{11,10,14,0,0},{12,10,14,0,0},{0,11,14,0,0},{1,11,14,0,0},{2,11,14,0,0}, + {3,11,14,0,0},{4,11,14,0,0},{5,11,14,0,0},{6,11,14,202,0},{7,11,14,0,0},{8,11,14,0,0},{9,11,14,0,0},{10,11,14,0,0},{11,11,14,0,0},{12,11,14,0,0},{0,12,14,0,0},{1,12,14,0,0},{2,12,14,0,0},{3,12,14,0,0},{4,12,14,0,0},{5,12,14,0,0}, + {6,12,14,202,0},{7,12,14,0,0},{8,12,14,0,0},{9,12,14,0,0},{10,12,14,0,0},{11,12,14,0,0},{12,12,14,0,0},{0,13,14,0,0},{1,13,14,0,0},{2,13,14,0,0},{3,13,14,0,0},{4,13,14,0,0},{5,13,14,0,0},{6,13,14,202,0},{7,13,14,0,0},{8,13,14,0,0}, + {9,13,14,0,0},{10,13,14,0,0},{11,13,14,0,0},{12,13,14,0,0},{0,14,14,0,0},{1,14,14,0,0},{2,14,14,0,0},{3,14,14,0,0},{4,14,14,0,0},{5,14,14,0,0},{6,14,14,202,0},{7,14,14,0,0},{8,14,14,0,0},{9,14,14,0,0},{10,14,14,0,0},{11,14,14,0,0}, + {12,14,14,0,0},{0,15,14,0,0},{1,15,14,0,0},{2,15,14,0,0},{3,15,14,0,0},{4,15,14,0,0},{5,15,14,0,0},{6,15,14,202,0},{7,15,14,0,0},{8,15,14,0,0},{9,15,14,0,0},{10,15,14,0,0},{11,15,14,0,0},{12,15,14,0,0},{0,16,14,0,0},{1,16,14,0,0}, + {2,16,14,0,0},{3,16,14,0,0},{4,16,14,0,0},{5,16,14,0,0},{6,16,14,202,0},{7,16,14,0,0},{8,16,14,0,0},{9,16,14,0,0},{10,16,14,0,0},{11,16,14,0,0},{12,16,14,0,0},{0,17,14,0,0},{1,17,14,0,0},{2,17,14,0,0},{3,17,14,0,0},{4,17,14,0,0}, + {5,17,14,0,0},{6,17,14,202,0},{7,17,14,0,0},{8,17,14,0,0},{9,17,14,0,0},{10,17,14,0,0},{11,17,14,0,0},{12,17,14,0,0},{0,18,14,0,0},{1,18,14,0,0},{2,18,14,0,0},{3,18,14,0,0},{4,18,14,0,0},{5,18,14,0,0},{6,18,14,202,0},{7,18,14,0,0}, + {8,18,14,0,0},{9,18,14,0,0},{10,18,14,0,0},{11,18,14,0,0},{12,18,14,0,0},{0,19,14,0,0},{1,19,14,0,0},{2,19,14,0,0},{3,19,14,0,0},{4,19,14,0,0},{5,19,14,0,0},{6,19,14,202,0},{7,19,14,0,0},{8,19,14,0,0},{9,19,14,0,0},{10,19,14,0,0}, + {11,19,14,0,0},{12,19,14,0,0},{0,20,14,0,0},{1,20,14,0,0},{2,20,14,0,0},{3,20,14,0,0},{4,20,14,0,0},{6,20,14,202,0},{8,20,14,0,0},{9,20,14,0,0},{10,20,14,0,0},{11,20,14,0,0},{12,20,14,0,0},{0,21,14,0,0},{1,21,14,0,0},{2,21,14,0,0}, + {3,21,14,0,0},{5,21,14,0,0},{6,21,14,202,0},{7,21,14,0,0},{9,21,14,0,0},{10,21,14,0,0},{11,21,14,0,0},{12,21,14,0,0},{0,22,14,0,0},{1,22,14,0,0},{2,22,14,0,0},{3,22,14,0,0},{4,22,14,0,0},{5,22,14,0,0},{6,22,14,202,0},{7,22,14,0,0}, + {8,22,14,0,0},{9,22,14,0,0},{10,22,14,0,0},{11,22,14,0,0},{12,22,14,0,0},{0,23,14,0,0},{1,23,14,0,0},{2,23,14,0,0},{3,23,14,0,0},{4,23,14,0,0},{5,23,14,0,0},{6,23,14,201,0},{7,23,14,0,0},{8,23,14,0,0},{9,23,14,0,0},{10,23,14,0,0}, + {11,23,14,0,0},{12,23,14,0,0},{0,0,15,0,0},{1,0,15,0,0},{2,0,15,0,0},{3,0,15,0,0},{4,0,15,0,0},{5,0,15,0,0},{6,0,15,202,8},{7,0,15,0,0},{8,0,15,0,0},{9,0,15,0,0},{10,0,15,0,0},{11,0,15,0,0},{12,0,15,0,0},{0,1,15,0,0}, + {1,1,15,0,0},{2,1,15,0,0},{3,1,15,0,0},{4,1,15,0,0},{5,1,15,201,0},{6,1,15,201,0},{7,1,15,201,0},{8,1,15,0,0},{9,1,15,0,0},{10,1,15,0,0},{11,1,15,0,0},{12,1,15,0,0},{0,2,15,0,0},{1,2,15,0,0},{2,2,15,0,0},{3,2,15,0,0}, + {4,2,15,201,0},{5,2,15,49,0},{6,2,15,202,8},{7,2,15,49,0},{8,2,15,201,0},{9,2,15,0,0},{10,2,15,0,0},{11,2,15,0,0},{12,2,15,0,0},{0,3,15,0,0},{1,3,15,0,0},{2,3,15,0,0},{3,3,15,201,0},{4,3,15,0,0},{5,3,15,0,0},{6,3,15,0,0}, + {7,3,15,0,0},{9,3,15,201,0},{10,3,15,0,0},{11,3,15,0,0},{12,3,15,0,0},{0,4,15,0,0},{1,4,15,0,0},{2,4,15,201,0},{3,4,15,0,0},{4,4,15,0,0},{5,4,15,0,0},{6,4,15,0,0},{7,4,15,0,0},{8,4,15,0,0},{9,4,15,0,0},{10,4,15,201,0}, + {11,4,15,0,0},{12,4,15,0,0},{0,5,15,0,0},{1,5,15,0,0},{2,5,15,201,0},{3,5,15,0,0},{4,5,15,0,0},{5,5,15,0,0},{6,5,15,0,0},{7,5,15,0,0},{8,5,15,0,0},{9,5,15,0,0},{10,5,15,201,0},{11,5,15,0,0},{12,5,15,0,0},{0,6,15,0,0}, + {1,6,15,0,0},{2,6,15,201,0},{3,6,15,0,0},{4,6,15,0,0},{5,6,15,0,0},{6,6,15,0,0},{7,6,15,0,0},{8,6,15,0,0},{9,6,15,0,0},{10,6,15,201,0},{11,6,15,0,0},{12,6,15,0,0},{0,7,15,0,0},{1,7,15,0,0},{2,7,15,201,0},{3,7,15,201,0}, + {4,7,15,201,0},{5,7,15,201,0},{6,7,15,201,0},{7,7,15,201,0},{8,7,15,201,0},{9,7,15,201,0},{10,7,15,201,0},{11,7,15,0,0},{12,7,15,0,0},{0,8,15,0,0},{1,8,15,0,0},{3,8,15,0,0},{4,8,15,0,0},{5,8,15,0,0},{7,8,15,0,0},{8,8,15,0,0}, + {9,8,15,0,0},{11,8,15,0,0},{12,8,15,0,0},{0,9,15,0,0},{1,9,15,0,0},{2,9,15,0,0},{3,9,15,0,0},{4,9,15,0,0},{5,9,15,0,0},{7,9,15,0,0},{8,9,15,0,0},{9,9,15,0,0},{10,9,15,0,0},{11,9,15,0,0},{12,9,15,0,0},{0,10,15,0,0}, + {1,10,15,0,0},{2,10,15,0,0},{3,10,15,0,0},{4,10,15,0,0},{5,10,15,0,0},{7,10,15,0,0},{8,10,15,0,0},{9,10,15,0,0},{10,10,15,0,0},{11,10,15,0,0},{12,10,15,0,0},{0,11,15,0,0},{1,11,15,0,0},{2,11,15,0,0},{3,11,15,0,0},{4,11,15,0,0}, + {5,11,15,0,0},{7,11,15,0,0},{8,11,15,0,0},{9,11,15,0,0},{10,11,15,0,0},{11,11,15,0,0},{12,11,15,0,0},{0,12,15,0,0},{1,12,15,0,0},{2,12,15,0,0},{3,12,15,0,0},{4,12,15,0,0},{5,12,15,0,0},{7,12,15,0,0},{8,12,15,0,0},{9,12,15,0,0}, + {10,12,15,0,0},{11,12,15,0,0},{12,12,15,0,0},{0,13,15,0,0},{1,13,15,0,0},{2,13,15,0,0},{3,13,15,0,0},{4,13,15,0,0},{5,13,15,0,0},{7,13,15,0,0},{8,13,15,0,0},{9,13,15,0,0},{10,13,15,0,0},{11,13,15,0,0},{12,13,15,0,0},{0,14,15,0,0}, + {1,14,15,0,0},{2,14,15,0,0},{3,14,15,0,0},{4,14,15,0,0},{5,14,15,0,0},{7,14,15,0,0},{8,14,15,0,0},{9,14,15,0,0},{10,14,15,0,0},{11,14,15,0,0},{12,14,15,0,0},{0,15,15,0,0},{1,15,15,0,0},{2,15,15,0,0},{3,15,15,0,0},{4,15,15,0,0}, + {5,15,15,0,0},{7,15,15,0,0},{8,15,15,0,0},{9,15,15,0,0},{10,15,15,0,0},{11,15,15,0,0},{12,15,15,0,0},{0,16,15,0,0},{1,16,15,0,0},{2,16,15,0,0},{3,16,15,0,0},{4,16,15,0,0},{5,16,15,0,0},{7,16,15,0,0},{8,16,15,0,0},{9,16,15,0,0}, + {10,16,15,0,0},{11,16,15,0,0},{12,16,15,0,0},{0,17,15,0,0},{1,17,15,0,0},{2,17,15,0,0},{3,17,15,0,0},{4,17,15,0,0},{5,17,15,0,0},{7,17,15,0,0},{8,17,15,0,0},{9,17,15,0,0},{10,17,15,0,0},{11,17,15,0,0},{12,17,15,0,0},{0,18,15,0,0}, + {1,18,15,0,0},{2,18,15,0,0},{3,18,15,0,0},{4,18,15,0,0},{5,18,15,0,0},{7,18,15,0,0},{8,18,15,0,0},{9,18,15,0,0},{10,18,15,0,0},{11,18,15,0,0},{12,18,15,0,0},{0,19,15,0,0},{1,19,15,0,0},{2,19,15,0,0},{3,19,15,0,0},{4,19,15,0,0}, + {5,19,15,0,0},{7,19,15,0,0},{8,19,15,0,0},{9,19,15,0,0},{10,19,15,0,0},{11,19,15,0,0},{12,19,15,0,0},{0,20,15,0,0},{1,20,15,0,0},{2,20,15,0,0},{3,20,15,0,0},{4,20,15,0,0},{8,20,15,0,0},{9,20,15,0,0},{10,20,15,0,0},{11,20,15,0,0}, + {12,20,15,0,0},{0,21,15,0,0},{1,21,15,0,0},{2,21,15,0,0},{3,21,15,0,0},{5,21,15,0,0},{7,21,15,0,0},{9,21,15,0,0},{10,21,15,0,0},{11,21,15,0,0},{12,21,15,0,0},{0,22,15,0,0},{1,22,15,0,0},{2,22,15,0,0},{3,22,15,0,0},{4,22,15,0,0}, + {5,22,15,0,0},{6,22,15,0,0},{7,22,15,0,0},{8,22,15,0,0},{9,22,15,0,0},{10,22,15,0,0},{11,22,15,0,0},{12,22,15,0,0},{0,23,15,0,0},{1,23,15,0,0},{2,23,15,0,0},{3,23,15,0,0},{4,23,15,0,0},{5,23,15,0,0},{6,23,15,0,0},{7,23,15,0,0}, + {8,23,15,0,0},{9,23,15,0,0},{10,23,15,0,0},{11,23,15,0,0},{12,23,15,0,0},{0,0,16,0,0},{1,0,16,0,0},{2,0,16,0,0},{3,0,16,0,0},{4,0,16,0,0},{5,0,16,0,0},{6,0,16,202,8},{7,0,16,0,0},{8,0,16,0,0},{9,0,16,0,0},{10,0,16,0,0}, + {11,0,16,0,0},{12,0,16,0,0},{0,1,16,0,0},{1,1,16,0,0},{2,1,16,0,0},{3,1,16,0,0},{4,1,16,0,0},{5,1,16,201,0},{6,1,16,201,0},{7,1,16,201,0},{8,1,16,0,0},{9,1,16,0,0},{10,1,16,0,0},{11,1,16,0,0},{12,1,16,0,0},{0,2,16,0,0}, + {1,2,16,0,0},{2,2,16,0,0},{3,2,16,0,0},{4,2,16,201,0},{5,2,16,49,0},{6,2,16,202,8},{7,2,16,49,0},{8,2,16,201,0},{9,2,16,0,0},{10,2,16,0,0},{11,2,16,0,0},{12,2,16,0,0},{0,3,16,0,0},{1,3,16,0,0},{2,3,16,0,0},{3,3,16,201,0}, + {4,3,16,0,0},{5,3,16,0,0},{6,3,16,0,0},{7,3,16,0,0},{8,3,16,201,0},{9,3,16,201,0},{10,3,16,0,0},{11,3,16,0,0},{12,3,16,0,0},{0,4,16,0,0},{1,4,16,0,0},{2,4,16,201,0},{3,4,16,0,0},{4,4,16,0,0},{5,4,16,0,0},{6,4,16,0,0}, + {7,4,16,0,0},{8,4,16,0,0},{9,4,16,0,0},{10,4,16,201,0},{11,4,16,0,0},{12,4,16,0,0},{0,5,16,0,0},{2,5,16,201,0},{3,5,16,0,0},{4,5,16,0,0},{5,5,16,0,0},{6,5,16,0,0},{7,5,16,0,0},{8,5,16,0,0},{9,5,16,0,0},{10,5,16,201,0}, + {12,5,16,0,0},{0,6,16,0,0},{1,6,16,0,0},{2,6,16,0,0},{3,6,16,0,0},{4,6,16,0,0},{5,6,16,0,0},{6,6,16,0,0},{7,6,16,0,0},{8,6,16,0,0},{9,6,16,0,0},{10,6,16,0,0},{11,6,16,0,0},{12,6,16,0,0},{0,7,16,0,0},{1,7,16,0,0}, + {2,7,16,201,0},{3,7,16,201,0},{4,7,16,201,0},{5,7,16,201,0},{6,7,16,201,0},{7,7,16,201,0},{8,7,16,201,0},{9,7,16,201,0},{10,7,16,201,0},{11,7,16,0,0},{12,7,16,0,0},{0,8,16,0,0},{1,8,16,0,0},{2,8,16,201,0},{3,8,16,0,0},{4,8,16,0,0}, + {5,8,16,0,0},{6,8,16,0,0},{7,8,16,0,0},{8,8,16,0,0},{9,8,16,0,0},{10,8,16,201,0},{11,8,16,0,0},{12,8,16,0,0},{0,9,16,0,0},{1,9,16,0,0},{2,9,16,0,0},{3,9,16,0,0},{4,9,16,0,0},{5,9,16,0,0},{6,9,16,0,0},{7,9,16,0,0}, + {8,9,16,0,0},{9,9,16,0,0},{10,9,16,0,0},{11,9,16,0,0},{12,9,16,0,0},{0,10,16,0,0},{1,10,16,0,0},{2,10,16,0,0},{3,10,16,0,0},{4,10,16,0,0},{5,10,16,0,0},{6,10,16,0,0},{7,10,16,0,0},{8,10,16,0,0},{9,10,16,0,0},{10,10,16,0,0}, + {11,10,16,0,0},{12,10,16,0,0},{0,11,16,0,0},{1,11,16,0,0},{2,11,16,0,0},{3,11,16,0,0},{4,11,16,0,0},{5,11,16,0,0},{6,11,16,0,0},{7,11,16,0,0},{8,11,16,0,0},{9,11,16,0,0},{10,11,16,0,0},{11,11,16,0,0},{12,11,16,0,0},{0,12,16,0,0}, + {1,12,16,0,0},{2,12,16,0,0},{3,12,16,0,0},{4,12,16,0,0},{5,12,16,0,0},{6,12,16,0,0},{7,12,16,0,0},{8,12,16,0,0},{9,12,16,0,0},{10,12,16,0,0},{11,12,16,0,0},{12,12,16,0,0},{0,13,16,0,0},{1,13,16,0,0},{2,13,16,0,0},{3,13,16,0,0}, + {4,13,16,0,0},{5,13,16,0,0},{6,13,16,0,0},{7,13,16,0,0},{8,13,16,0,0},{9,13,16,0,0},{10,13,16,0,0},{11,13,16,0,0},{12,13,16,0,0},{0,14,16,0,0},{1,14,16,0,0},{2,14,16,0,0},{3,14,16,0,0},{4,14,16,0,0},{5,14,16,0,0},{6,14,16,0,0}, + {7,14,16,0,0},{8,14,16,0,0},{9,14,16,0,0},{10,14,16,0,0},{11,14,16,0,0},{12,14,16,0,0},{0,15,16,0,0},{1,15,16,0,0},{2,15,16,0,0},{3,15,16,0,0},{4,15,16,0,0},{5,15,16,0,0},{6,15,16,0,0},{7,15,16,0,0},{8,15,16,0,0},{9,15,16,0,0}, + {10,15,16,0,0},{11,15,16,0,0},{12,15,16,0,0},{0,16,16,0,0},{1,16,16,0,0},{2,16,16,0,0},{3,16,16,0,0},{4,16,16,0,0},{5,16,16,0,0},{6,16,16,0,0},{7,16,16,0,0},{8,16,16,0,0},{9,16,16,0,0},{10,16,16,0,0},{11,16,16,0,0},{12,16,16,0,0}, + {0,17,16,0,0},{1,17,16,0,0},{2,17,16,0,0},{3,17,16,0,0},{4,17,16,0,0},{5,17,16,0,0},{6,17,16,0,0},{7,17,16,0,0},{8,17,16,0,0},{9,17,16,0,0},{10,17,16,0,0},{11,17,16,0,0},{12,17,16,0,0},{0,18,16,0,0},{1,18,16,0,0},{2,18,16,0,0}, + {3,18,16,0,0},{4,18,16,0,0},{5,18,16,0,0},{6,18,16,0,0},{7,18,16,0,0},{8,18,16,0,0},{9,18,16,0,0},{10,18,16,0,0},{11,18,16,0,0},{12,18,16,0,0},{0,19,16,0,0},{1,19,16,0,0},{2,19,16,0,0},{3,19,16,0,0},{4,19,16,0,0},{5,19,16,0,0}, + {6,19,16,0,0},{7,19,16,0,0},{8,19,16,0,0},{9,19,16,0,0},{10,19,16,0,0},{11,19,16,0,0},{12,19,16,0,0},{0,20,16,0,0},{1,20,16,0,0},{2,20,16,0,0},{3,20,16,0,0},{4,20,16,0,0},{5,20,16,0,0},{6,20,16,0,0},{7,20,16,0,0},{8,20,16,0,0}, + {9,20,16,0,0},{10,20,16,0,0},{11,20,16,0,0},{12,20,16,0,0},{0,21,16,0,0},{1,21,16,0,0},{2,21,16,0,0},{3,21,16,0,0},{9,21,16,0,0},{10,21,16,0,0},{11,21,16,0,0},{12,21,16,0,0},{0,22,16,0,0},{1,22,16,0,0},{2,22,16,0,0},{3,22,16,0,0}, + {4,22,16,0,0},{5,22,16,0,0},{6,22,16,0,0},{7,22,16,0,0},{8,22,16,0,0},{9,22,16,0,0},{10,22,16,0,0},{11,22,16,0,0},{12,22,16,0,0},{0,23,16,0,0},{1,23,16,0,0},{2,23,16,0,0},{3,23,16,0,0},{4,23,16,0,0},{5,23,16,0,0},{6,23,16,0,0}, + {7,23,16,0,0},{8,23,16,0,0},{9,23,16,0,0},{10,23,16,0,0},{11,23,16,0,0},{12,23,16,0,0},{0,0,17,0,0},{1,0,17,0,0},{2,0,17,0,0},{3,0,17,0,0},{4,0,17,0,0},{5,0,17,0,0},{6,0,17,202,8},{7,0,17,0,0},{8,0,17,0,0},{9,0,17,0,0}, + {10,0,17,0,0},{11,0,17,0,0},{12,0,17,0,0},{0,1,17,0,0},{1,1,17,0,0},{2,1,17,0,0},{3,1,17,0,0},{5,1,17,201,0},{6,1,17,201,0},{7,1,17,201,0},{9,1,17,0,0},{10,1,17,0,0},{11,1,17,0,0},{12,1,17,0,0},{0,2,17,0,0},{1,2,17,0,0}, + {2,2,17,0,0},{4,2,17,201,0},{5,2,17,49,0},{6,2,17,202,8},{7,2,17,49,0},{8,2,17,201,0},{10,2,17,0,0},{11,2,17,0,0},{12,2,17,0,0},{0,3,17,0,0},{1,3,17,0,0},{3,3,17,201,0},{4,3,17,0,0},{5,3,17,0,0},{6,3,17,0,0},{7,3,17,0,0}, + {8,3,17,201,0},{9,3,17,201,0},{11,3,17,0,0},{12,3,17,0,0},{0,4,17,0,0},{1,4,17,0,0},{2,4,17,201,0},{3,4,17,0,0},{4,4,17,0,0},{5,4,17,0,0},{6,4,17,0,0},{7,4,17,0,0},{8,4,17,0,0},{9,4,17,0,0},{10,4,17,201,0},{11,4,17,0,0}, + {12,4,17,0,0},{0,5,17,0,0},{1,5,17,0,0},{2,5,17,201,0},{3,5,17,0,0},{4,5,17,0,0},{5,5,17,0,0},{6,5,17,0,0},{7,5,17,0,0},{8,5,17,0,0},{9,5,17,0,0},{10,5,17,201,0},{11,5,17,0,0},{12,5,17,0,0},{0,6,17,0,0},{1,6,17,0,0}, + {2,6,17,201,0},{3,6,17,0,0},{4,6,17,0,0},{5,6,17,0,0},{6,6,17,0,0},{7,6,17,0,0},{8,6,17,0,0},{9,6,17,0,0},{10,6,17,201,0},{11,6,17,0,0},{12,6,17,0,0},{0,7,17,0,0},{1,7,17,0,0},{2,7,17,201,0},{3,7,17,201,0},{4,7,17,201,0}, + {5,7,17,201,0},{6,7,17,201,0},{7,7,17,201,0},{8,7,17,201,0},{9,7,17,201,0},{10,7,17,201,0},{11,7,17,0,0},{12,7,17,0,0},{0,8,17,0,0},{1,8,17,0,0},{3,8,17,0,0},{4,8,17,0,0},{5,8,17,0,0},{6,8,17,0,0},{7,8,17,0,0},{8,8,17,0,0}, + {9,8,17,0,0},{11,8,17,0,0},{12,8,17,0,0},{0,9,17,0,0},{1,9,17,0,0},{2,9,17,0,0},{3,9,17,0,0},{4,9,17,0,0},{5,9,17,0,0},{6,9,17,0,0},{7,9,17,0,0},{8,9,17,0,0},{9,9,17,0,0},{10,9,17,0,0},{11,9,17,0,0},{12,9,17,0,0}, + {0,10,17,0,0},{1,10,17,0,0},{2,10,17,0,0},{3,10,17,0,0},{4,10,17,0,0},{5,10,17,0,0},{6,10,17,0,0},{7,10,17,0,0},{8,10,17,0,0},{9,10,17,0,0},{10,10,17,0,0},{11,10,17,0,0},{12,10,17,0,0},{0,11,17,0,0},{1,11,17,0,0},{2,11,17,0,0}, + {3,11,17,0,0},{4,11,17,0,0},{5,11,17,0,0},{6,11,17,0,0},{7,11,17,0,0},{8,11,17,0,0},{9,11,17,0,0},{10,11,17,0,0},{11,11,17,0,0},{12,11,17,0,0},{0,12,17,0,0},{1,12,17,0,0},{2,12,17,0,0},{3,12,17,0,0},{4,12,17,0,0},{5,12,17,0,0}, + {6,12,17,0,0},{7,12,17,0,0},{8,12,17,0,0},{9,12,17,0,0},{10,12,17,0,0},{11,12,17,0,0},{12,12,17,0,0},{0,13,17,0,0},{1,13,17,0,0},{2,13,17,0,0},{3,13,17,0,0},{4,13,17,0,0},{5,13,17,0,0},{6,13,17,0,0},{7,13,17,0,0},{8,13,17,0,0}, + {9,13,17,0,0},{10,13,17,0,0},{11,13,17,0,0},{12,13,17,0,0},{0,14,17,0,0},{1,14,17,0,0},{2,14,17,0,0},{3,14,17,0,0},{4,14,17,0,0},{5,14,17,0,0},{6,14,17,0,0},{7,14,17,0,0},{8,14,17,0,0},{9,14,17,0,0},{10,14,17,0,0},{11,14,17,0,0}, + {12,14,17,0,0},{0,15,17,0,0},{1,15,17,0,0},{2,15,17,0,0},{3,15,17,0,0},{4,15,17,0,0},{5,15,17,0,0},{6,15,17,0,0},{7,15,17,0,0},{8,15,17,0,0},{9,15,17,0,0},{10,15,17,0,0},{11,15,17,0,0},{12,15,17,0,0},{0,16,17,0,0},{1,16,17,0,0}, + {2,16,17,0,0},{3,16,17,0,0},{4,16,17,0,0},{5,16,17,0,0},{6,16,17,0,0},{7,16,17,0,0},{8,16,17,0,0},{9,16,17,0,0},{10,16,17,0,0},{11,16,17,0,0},{12,16,17,0,0},{0,17,17,0,0},{1,17,17,0,0},{2,17,17,0,0},{3,17,17,0,0},{4,17,17,0,0}, + {5,17,17,0,0},{6,17,17,0,0},{7,17,17,0,0},{8,17,17,0,0},{9,17,17,0,0},{10,17,17,0,0},{11,17,17,0,0},{12,17,17,0,0},{0,18,17,0,0},{1,18,17,0,0},{2,18,17,0,0},{3,18,17,0,0},{4,18,17,0,0},{5,18,17,0,0},{6,18,17,0,0},{7,18,17,0,0}, + {8,18,17,0,0},{9,18,17,0,0},{10,18,17,0,0},{11,18,17,0,0},{12,18,17,0,0},{0,19,17,0,0},{1,19,17,0,0},{2,19,17,0,0},{3,19,17,0,0},{4,19,17,0,0},{5,19,17,0,0},{6,19,17,0,0},{7,19,17,0,0},{8,19,17,0,0},{9,19,17,0,0},{10,19,17,0,0}, + {11,19,17,0,0},{12,19,17,0,0},{0,20,17,0,0},{1,20,17,0,0},{2,20,17,0,0},{3,20,17,0,0},{4,20,17,0,0},{5,20,17,0,0},{6,20,17,0,0},{7,20,17,0,0},{8,20,17,0,0},{9,20,17,0,0},{10,20,17,0,0},{11,20,17,0,0},{12,20,17,0,0},{0,21,17,0,0}, + {1,21,17,0,0},{2,21,17,0,0},{3,21,17,0,0},{4,21,17,0,0},{5,21,17,0,0},{6,21,17,0,0},{7,21,17,0,0},{8,21,17,0,0},{9,21,17,0,0},{10,21,17,0,0},{11,21,17,0,0},{12,21,17,0,0},{0,22,17,0,0},{1,22,17,0,0},{2,22,17,0,0},{3,22,17,0,0}, + {4,22,17,0,0},{5,22,17,0,0},{6,22,17,0,0},{7,22,17,0,0},{8,22,17,0,0},{9,22,17,0,0},{10,22,17,0,0},{11,22,17,0,0},{12,22,17,0,0},{0,23,17,0,0},{1,23,17,0,0},{2,23,17,0,0},{3,23,17,0,0},{4,23,17,0,0},{5,23,17,0,0},{6,23,17,0,0}, + {7,23,17,0,0},{8,23,17,0,0},{9,23,17,0,0},{10,23,17,0,0},{11,23,17,0,0},{12,23,17,0,0},{0,0,18,0,0},{1,0,18,0,0},{2,0,18,0,0},{3,0,18,0,0},{4,0,18,0,0},{5,0,18,0,0},{6,0,18,202,8},{7,0,18,0,0},{8,0,18,0,0},{9,0,18,0,0}, + {10,0,18,0,0},{11,0,18,0,0},{12,0,18,0,0},{0,1,18,0,0},{1,1,18,0,0},{2,1,18,0,0},{3,1,18,0,0},{4,1,18,0,0},{5,1,18,201,0},{6,1,18,201,0},{7,1,18,201,0},{8,1,18,0,0},{9,1,18,0,0},{10,1,18,0,0},{11,1,18,0,0},{12,1,18,0,0}, + {0,2,18,0,0},{1,2,18,0,0},{2,2,18,0,0},{3,2,18,0,0},{4,2,18,201,0},{5,2,18,49,0},{6,2,18,202,8},{7,2,18,49,0},{8,2,18,201,0},{9,2,18,0,0},{10,2,18,0,0},{11,2,18,0,0},{12,2,18,0,0},{0,3,18,0,0},{1,3,18,0,0},{2,3,18,0,0}, + {3,3,18,201,0},{4,3,18,0,0},{5,3,18,0,0},{6,3,18,0,0},{7,3,18,0,0},{8,3,18,201,0},{9,3,18,201,0},{10,3,18,0,0},{11,3,18,0,0},{12,3,18,0,0},{0,4,18,0,0},{1,4,18,0,0},{2,4,18,201,0},{3,4,18,0,0},{4,4,18,0,0},{5,4,18,0,0}, + {6,4,18,0,0},{7,4,18,0,0},{8,4,18,0,0},{9,4,18,0,0},{10,4,18,201,0},{11,4,18,0,0},{12,4,18,0,0},{0,5,18,0,0},{1,5,18,0,0},{2,5,18,201,0},{3,5,18,0,0},{4,5,18,0,0},{5,5,18,0,0},{6,5,18,0,0},{7,5,18,0,0},{8,5,18,0,0}, + {9,5,18,0,0},{10,5,18,201,0},{11,5,18,0,0},{12,5,18,0,0},{0,6,18,0,0},{1,6,18,0,0},{2,6,18,201,0},{3,6,18,0,0},{4,6,18,0,0},{5,6,18,0,0},{6,6,18,0,0},{7,6,18,0,0},{8,6,18,0,0},{9,6,18,0,0},{10,6,18,201,0},{11,6,18,0,0}, + {12,6,18,0,0},{0,7,18,0,0},{1,7,18,0,0},{2,7,18,201,0},{3,7,18,201,0},{4,7,18,201,0},{5,7,18,201,0},{6,7,18,201,0},{7,7,18,201,0},{8,7,18,201,0},{9,7,18,201,0},{10,7,18,201,0},{11,7,18,0,0},{12,7,18,0,0},{0,8,18,0,0},{1,8,18,0,0}, + {3,8,18,0,0},{4,8,18,0,0},{5,8,18,0,0},{6,8,18,0,0},{7,8,18,0,0},{8,8,18,0,0},{9,8,18,0,0},{11,8,18,0,0},{12,8,18,0,0},{0,9,18,0,0},{1,9,18,0,0},{2,9,18,0,0},{3,9,18,0,0},{4,9,18,0,0},{5,9,18,0,0},{6,9,18,0,0}, + {7,9,18,0,0},{8,9,18,0,0},{9,9,18,0,0},{10,9,18,0,0},{11,9,18,0,0},{12,9,18,0,0},{0,10,18,0,0},{1,10,18,0,0},{2,10,18,0,0},{3,10,18,0,0},{4,10,18,0,0},{5,10,18,0,0},{6,10,18,0,0},{7,10,18,0,0},{8,10,18,0,0},{9,10,18,0,0}, + {10,10,18,0,0},{11,10,18,0,0},{12,10,18,0,0},{0,11,18,0,0},{1,11,18,0,0},{2,11,18,0,0},{3,11,18,0,0},{4,11,18,0,0},{5,11,18,0,0},{6,11,18,0,0},{7,11,18,0,0},{8,11,18,0,0},{9,11,18,0,0},{10,11,18,0,0},{11,11,18,0,0},{12,11,18,0,0}, + {0,12,18,0,0},{1,12,18,0,0},{2,12,18,0,0},{3,12,18,0,0},{4,12,18,0,0},{5,12,18,0,0},{6,12,18,0,0},{7,12,18,0,0},{8,12,18,0,0},{9,12,18,0,0},{10,12,18,0,0},{11,12,18,0,0},{12,12,18,0,0},{0,13,18,0,0},{1,13,18,0,0},{2,13,18,0,0}, + {3,13,18,0,0},{4,13,18,0,0},{5,13,18,0,0},{6,13,18,0,0},{7,13,18,0,0},{8,13,18,0,0},{9,13,18,0,0},{10,13,18,0,0},{11,13,18,0,0},{12,13,18,0,0},{0,14,18,0,0},{1,14,18,0,0},{2,14,18,0,0},{3,14,18,0,0},{4,14,18,0,0},{5,14,18,0,0}, + {6,14,18,0,0},{7,14,18,0,0},{8,14,18,0,0},{9,14,18,0,0},{10,14,18,0,0},{11,14,18,0,0},{12,14,18,0,0},{0,15,18,0,0},{1,15,18,0,0},{2,15,18,0,0},{3,15,18,0,0},{4,15,18,0,0},{5,15,18,0,0},{6,15,18,0,0},{7,15,18,0,0},{8,15,18,0,0}, + {9,15,18,0,0},{10,15,18,0,0},{11,15,18,0,0},{12,15,18,0,0},{0,16,18,0,0},{1,16,18,0,0},{2,16,18,0,0},{3,16,18,0,0},{4,16,18,0,0},{5,16,18,0,0},{6,16,18,0,0},{7,16,18,0,0},{8,16,18,0,0},{9,16,18,0,0},{10,16,18,0,0},{11,16,18,0,0}, + {12,16,18,0,0},{0,17,18,0,0},{1,17,18,0,0},{2,17,18,0,0},{3,17,18,0,0},{4,17,18,0,0},{5,17,18,0,0},{6,17,18,0,0},{7,17,18,0,0},{8,17,18,0,0},{9,17,18,0,0},{10,17,18,0,0},{11,17,18,0,0},{12,17,18,0,0},{0,18,18,0,0},{1,18,18,0,0}, + {2,18,18,0,0},{3,18,18,0,0},{4,18,18,0,0},{5,18,18,0,0},{6,18,18,0,0},{7,18,18,0,0},{8,18,18,0,0},{9,18,18,0,0},{10,18,18,0,0},{11,18,18,0,0},{12,18,18,0,0},{0,19,18,0,0},{1,19,18,0,0},{2,19,18,0,0},{3,19,18,0,0},{4,19,18,0,0}, + {5,19,18,0,0},{6,19,18,0,0},{7,19,18,0,0},{8,19,18,0,0},{9,19,18,0,0},{10,19,18,0,0},{11,19,18,0,0},{12,19,18,0,0},{0,20,18,0,0},{1,20,18,0,0},{2,20,18,0,0},{3,20,18,0,0},{4,20,18,0,0},{5,20,18,0,0},{6,20,18,0,0},{7,20,18,0,0}, + {8,20,18,0,0},{9,20,18,0,0},{10,20,18,0,0},{11,20,18,0,0},{12,20,18,0,0},{0,21,18,0,0},{1,21,18,0,0},{2,21,18,0,0},{3,21,18,0,0},{4,21,18,0,0},{5,21,18,0,0},{6,21,18,0,0},{7,21,18,0,0},{8,21,18,0,0},{9,21,18,0,0},{10,21,18,0,0}, + {11,21,18,0,0},{12,21,18,0,0},{0,22,18,0,0},{1,22,18,0,0},{2,22,18,0,0},{3,22,18,0,0},{4,22,18,0,0},{5,22,18,0,0},{6,22,18,0,0},{7,22,18,0,0},{8,22,18,0,0},{9,22,18,0,0},{10,22,18,0,0},{11,22,18,0,0},{12,22,18,0,0},{0,23,18,0,0}, + {1,23,18,0,0},{2,23,18,0,0},{3,23,18,0,0},{4,23,18,0,0},{5,23,18,0,0},{6,23,18,0,0},{7,23,18,0,0},{8,23,18,0,0},{9,23,18,0,0},{10,23,18,0,0},{11,23,18,0,0},{12,23,18,0,0},{0,0,19,0,0},{1,0,19,0,0},{2,0,19,0,0},{3,0,19,0,0}, + {4,0,19,0,0},{5,0,19,0,0},{6,0,19,202,8},{7,0,19,0,0},{8,0,19,0,0},{9,0,19,0,0},{10,0,19,0,0},{11,0,19,0,0},{12,0,19,0,0},{0,1,19,0,0},{1,1,19,0,0},{2,1,19,0,0},{3,1,19,0,0},{4,1,19,0,0},{5,1,19,201,0},{6,1,19,201,0}, + {7,1,19,201,0},{8,1,19,0,0},{9,1,19,0,0},{10,1,19,0,0},{11,1,19,0,0},{12,1,19,0,0},{0,2,19,0,0},{1,2,19,0,0},{2,2,19,0,0},{3,2,19,0,0},{4,2,19,201,0},{5,2,19,49,0},{6,2,19,202,8},{7,2,19,49,0},{8,2,19,201,0},{9,2,19,0,0}, + {10,2,19,0,0},{11,2,19,0,0},{12,2,19,0,0},{0,3,19,0,0},{1,3,19,0,0},{2,3,19,0,0},{3,3,19,201,0},{4,3,19,0,0},{5,3,19,0,0},{6,3,19,0,0},{7,3,19,0,0},{8,3,19,201,0},{9,3,19,201,0},{10,3,19,0,0},{11,3,19,0,0},{12,3,19,0,0}, + {0,4,19,0,0},{1,4,19,0,0},{2,4,19,201,0},{3,4,19,0,0},{4,4,19,0,0},{5,4,19,0,0},{6,4,19,0,0},{7,4,19,0,0},{10,4,19,201,0},{11,4,19,0,0},{12,4,19,0,0},{0,5,19,0,0},{1,5,19,0,0},{2,5,19,201,0},{3,5,19,0,0},{4,5,19,0,0}, + {5,5,19,0,0},{6,5,19,0,0},{7,5,19,0,0},{8,5,19,0,0},{9,5,19,0,0},{10,5,19,201,0},{11,5,19,0,0},{12,5,19,0,0},{0,6,19,0,0},{1,6,19,0,0},{2,6,19,201,0},{3,6,19,201,0},{4,6,19,201,0},{5,6,19,201,0},{6,6,19,201,0},{7,6,19,201,0}, + {8,6,19,0,0},{9,6,19,0,0},{10,6,19,201,0},{11,6,19,0,0},{12,6,19,0,0},{0,7,19,0,0},{1,7,19,0,0},{2,7,19,201,0},{3,7,19,201,0},{6,7,19,201,0},{7,7,19,201,0},{8,7,19,0,0},{9,7,19,0,0},{10,7,19,201,0},{11,7,19,0,0},{12,7,19,0,0}, + {0,8,19,0,0},{1,8,19,0,0},{2,8,19,201,0},{3,8,19,0,0},{4,8,19,0,0},{5,8,19,0,0},{6,8,19,0,0},{7,8,19,0,0},{10,8,19,201,0},{11,8,19,0,0},{12,8,19,0,0},{4,9,19,0,0},{5,9,19,0,0},{6,9,19,0,0},{7,9,19,0,0},{8,9,19,0,0}, + {9,9,19,0,0},{10,9,19,0,0},{0,10,19,0,0},{1,10,19,0,0},{2,10,19,0,0},{3,10,19,0,0},{4,10,19,0,0},{5,10,19,0,0},{6,10,19,0,0},{7,10,19,0,0},{8,10,19,0,0},{9,10,19,0,0},{10,10,19,0,0},{11,10,19,0,0},{12,10,19,0,0},{0,11,19,0,0}, + {1,11,19,0,0},{2,11,19,0,0},{3,11,19,0,0},{4,11,19,0,0},{5,11,19,0,0},{6,11,19,0,0},{7,11,19,0,0},{8,11,19,0,0},{9,11,19,0,0},{10,11,19,0,0},{11,11,19,0,0},{12,11,19,0,0},{0,12,19,0,0},{1,12,19,0,0},{2,12,19,0,0},{3,12,19,0,0}, + {4,12,19,0,0},{5,12,19,0,0},{6,12,19,0,0},{7,12,19,0,0},{8,12,19,0,0},{9,12,19,0,0},{10,12,19,0,0},{11,12,19,0,0},{12,12,19,0,0},{0,13,19,0,0},{1,13,19,0,0},{2,13,19,0,0},{3,13,19,0,0},{4,13,19,0,0},{5,13,19,0,0},{6,13,19,0,0}, + {7,13,19,0,0},{8,13,19,0,0},{9,13,19,0,0},{10,13,19,0,0},{11,13,19,0,0},{12,13,19,0,0},{0,14,19,0,0},{1,14,19,0,0},{2,14,19,0,0},{3,14,19,0,0},{4,14,19,0,0},{5,14,19,0,0},{6,14,19,0,0},{7,14,19,0,0},{8,14,19,0,0},{9,14,19,0,0}, + {10,14,19,0,0},{11,14,19,0,0},{12,14,19,0,0},{0,15,19,0,0},{1,15,19,0,0},{2,15,19,0,0},{3,15,19,0,0},{4,15,19,0,0},{5,15,19,0,0},{6,15,19,0,0},{7,15,19,0,0},{8,15,19,0,0},{9,15,19,0,0},{10,15,19,0,0},{11,15,19,0,0},{12,15,19,0,0}, + {0,16,19,0,0},{1,16,19,0,0},{2,16,19,0,0},{3,16,19,0,0},{4,16,19,0,0},{5,16,19,0,0},{6,16,19,0,0},{7,16,19,0,0},{8,16,19,0,0},{9,16,19,0,0},{10,16,19,0,0},{11,16,19,0,0},{12,16,19,0,0},{0,17,19,0,0},{1,17,19,0,0},{2,17,19,0,0}, + {3,17,19,0,0},{4,17,19,0,0},{5,17,19,0,0},{6,17,19,0,0},{7,17,19,0,0},{8,17,19,0,0},{9,17,19,0,0},{10,17,19,0,0},{11,17,19,0,0},{12,17,19,0,0},{0,18,19,0,0},{1,18,19,0,0},{2,18,19,0,0},{3,18,19,0,0},{4,18,19,0,0},{5,18,19,0,0}, + {6,18,19,0,0},{7,18,19,0,0},{8,18,19,0,0},{9,18,19,0,0},{10,18,19,0,0},{11,18,19,0,0},{12,18,19,0,0},{0,19,19,0,0},{1,19,19,0,0},{2,19,19,0,0},{3,19,19,0,0},{4,19,19,0,0},{5,19,19,0,0},{6,19,19,0,0},{7,19,19,0,0},{8,19,19,0,0}, + {9,19,19,0,0},{10,19,19,0,0},{11,19,19,0,0},{12,19,19,0,0},{0,20,19,0,0},{1,20,19,0,0},{2,20,19,0,0},{3,20,19,0,0},{4,20,19,0,0},{5,20,19,0,0},{6,20,19,0,0},{7,20,19,0,0},{8,20,19,0,0},{9,20,19,0,0},{10,20,19,0,0},{11,20,19,0,0}, + {12,20,19,0,0},{0,21,19,0,0},{1,21,19,0,0},{2,21,19,0,0},{3,21,19,0,0},{4,21,19,0,0},{5,21,19,0,0},{6,21,19,0,0},{7,21,19,0,0},{8,21,19,0,0},{9,21,19,0,0},{10,21,19,0,0},{11,21,19,0,0},{12,21,19,0,0},{0,22,19,0,0},{1,22,19,0,0}, + {2,22,19,0,0},{3,22,19,0,0},{4,22,19,0,0},{5,22,19,0,0},{6,22,19,0,0},{7,22,19,0,0},{8,22,19,0,0},{9,22,19,0,0},{10,22,19,0,0},{11,22,19,0,0},{12,22,19,0,0},{0,23,19,0,0},{1,23,19,0,0},{2,23,19,0,0},{3,23,19,0,0},{4,23,19,0,0}, + {5,23,19,0,0},{6,23,19,0,0},{7,23,19,0,0},{8,23,19,0,0},{9,23,19,0,0},{10,23,19,0,0},{11,23,19,0,0},{12,23,19,0,0},{0,0,20,0,0},{1,0,20,0,0},{2,0,20,0,0},{3,0,20,0,0},{4,0,20,0,0},{5,0,20,0,0},{6,0,20,202,8},{7,0,20,0,0}, + {8,0,20,0,0},{9,0,20,0,0},{10,0,20,0,0},{11,0,20,0,0},{12,0,20,0,0},{0,1,20,0,0},{1,1,20,0,0},{2,1,20,0,0},{3,1,20,0,0},{4,1,20,0,0},{5,1,20,201,0},{6,1,20,201,0},{7,1,20,201,0},{8,1,20,0,0},{9,1,20,0,0},{10,1,20,0,0}, + {11,1,20,0,0},{12,1,20,0,0},{0,2,20,0,0},{1,2,20,0,0},{2,2,20,0,0},{3,2,20,0,0},{4,2,20,201,0},{5,2,20,49,0},{6,2,20,202,8},{7,2,20,49,0},{8,2,20,201,0},{9,2,20,0,0},{10,2,20,0,0},{11,2,20,0,0},{12,2,20,0,0},{0,3,20,0,0}, + {1,3,20,0,0},{2,3,20,0,0},{3,3,20,201,0},{4,3,20,0,0},{5,3,20,0,0},{6,3,20,0,0},{7,3,20,0,0},{8,3,20,201,0},{9,3,20,201,0},{10,3,20,0,0},{11,3,20,0,0},{12,3,20,0,0},{0,4,20,0,0},{1,4,20,0,0},{2,4,20,201,0},{3,4,20,0,0}, + {4,4,20,0,0},{5,4,20,0,0},{6,4,20,0,0},{7,4,20,0,0},{8,4,20,201,0},{9,4,20,201,0},{10,4,20,201,0},{11,4,20,0,0},{12,4,20,0,0},{0,5,20,0,0},{2,5,20,201,0},{3,5,20,201,0},{4,5,20,201,0},{5,5,20,201,0},{6,5,20,201,0},{7,5,20,201,0}, + {10,5,20,201,0},{12,5,20,0,0},{0,6,20,0,0},{1,6,20,0,0},{2,6,20,201,0},{3,6,20,201,0},{6,6,20,201,0},{7,6,20,201,0},{8,6,20,0,0},{9,6,20,0,0},{10,6,20,201,0},{11,6,20,0,0},{12,6,20,0,0},{0,7,20,0,0},{1,7,20,0,0},{2,7,20,201,0}, + {3,7,20,201,0},{4,7,20,0,0},{5,7,20,0,0},{6,7,20,201,0},{7,7,20,201,0},{8,7,20,0,0},{9,7,20,0,0},{10,7,20,201,0},{11,7,20,0,0},{12,7,20,0,0},{0,8,20,0,0},{1,8,20,0,0},{2,8,20,201,0},{3,8,20,0,0},{4,8,20,0,0},{5,8,20,0,0}, + {6,8,20,0,0},{7,8,20,0,0},{8,8,20,201,0},{9,8,20,201,0},{10,8,20,201,0},{11,8,20,0,0},{12,8,20,0,0},{1,9,20,201,0},{2,9,20,201,0},{3,9,20,201,0},{4,9,20,0,0},{5,9,20,0,0},{6,9,20,201,0},{7,9,20,201,0},{10,9,20,201,0},{11,9,20,201,0}, + {0,10,20,0,0},{1,10,20,201,0},{3,10,20,201,0},{4,10,20,0,0},{5,10,20,0,0},{6,10,20,201,0},{7,10,20,201,0},{8,10,20,0,0},{9,10,20,0,0},{10,10,20,201,0},{11,10,20,201,0},{12,10,20,0,0},{0,11,20,0,0},{1,11,20,0,0},{2,11,20,0,0},{3,11,20,0,0}, + {4,11,20,0,0},{5,11,20,0,0},{6,11,20,0,0},{7,11,20,0,0},{8,11,20,0,0},{9,11,20,0,0},{10,11,20,0,0},{11,11,20,0,0},{12,11,20,0,0},{0,12,20,0,0},{1,12,20,0,0},{2,12,20,0,0},{3,12,20,0,0},{4,12,20,0,0},{5,12,20,0,0},{6,12,20,0,0}, + {7,12,20,0,0},{8,12,20,0,0},{9,12,20,0,0},{10,12,20,0,0},{11,12,20,0,0},{12,12,20,0,0},{0,13,20,0,0},{1,13,20,0,0},{2,13,20,0,0},{3,13,20,0,0},{4,13,20,0,0},{5,13,20,0,0},{6,13,20,0,0},{7,13,20,0,0},{8,13,20,0,0},{9,13,20,0,0}, + {10,13,20,0,0},{11,13,20,0,0},{12,13,20,0,0},{0,14,20,0,0},{1,14,20,0,0},{2,14,20,0,0},{3,14,20,0,0},{4,14,20,0,0},{5,14,20,0,0},{6,14,20,0,0},{7,14,20,0,0},{8,14,20,0,0},{9,14,20,0,0},{10,14,20,0,0},{11,14,20,0,0},{12,14,20,0,0}, + {0,15,20,0,0},{1,15,20,0,0},{2,15,20,0,0},{3,15,20,0,0},{4,15,20,0,0},{5,15,20,0,0},{6,15,20,0,0},{7,15,20,0,0},{8,15,20,0,0},{9,15,20,0,0},{10,15,20,0,0},{11,15,20,0,0},{12,15,20,0,0},{0,16,20,0,0},{1,16,20,0,0},{2,16,20,0,0}, + {3,16,20,0,0},{4,16,20,0,0},{5,16,20,0,0},{6,16,20,0,0},{7,16,20,0,0},{8,16,20,0,0},{9,16,20,0,0},{10,16,20,0,0},{11,16,20,0,0},{12,16,20,0,0},{0,17,20,0,0},{1,17,20,0,0},{2,17,20,0,0},{3,17,20,0,0},{4,17,20,0,0},{5,17,20,0,0}, + {6,17,20,0,0},{7,17,20,0,0},{8,17,20,0,0},{9,17,20,0,0},{10,17,20,0,0},{11,17,20,0,0},{12,17,20,0,0},{0,18,20,0,0},{1,18,20,0,0},{2,18,20,0,0},{3,18,20,0,0},{4,18,20,0,0},{5,18,20,0,0},{6,18,20,0,0},{7,18,20,0,0},{8,18,20,0,0}, + {9,18,20,0,0},{10,18,20,0,0},{11,18,20,0,0},{12,18,20,0,0},{0,19,20,0,0},{1,19,20,0,0},{2,19,20,0,0},{3,19,20,0,0},{4,19,20,0,0},{5,19,20,0,0},{6,19,20,0,0},{7,19,20,0,0},{8,19,20,0,0},{9,19,20,0,0},{10,19,20,0,0},{11,19,20,0,0}, + {12,19,20,0,0},{0,20,20,0,0},{1,20,20,0,0},{2,20,20,0,0},{3,20,20,0,0},{4,20,20,0,0},{5,20,20,0,0},{6,20,20,0,0},{7,20,20,0,0},{8,20,20,0,0},{9,20,20,0,0},{10,20,20,0,0},{11,20,20,0,0},{12,20,20,0,0},{0,21,20,0,0},{1,21,20,0,0}, + {2,21,20,0,0},{3,21,20,0,0},{4,21,20,0,0},{5,21,20,0,0},{6,21,20,0,0},{7,21,20,0,0},{8,21,20,0,0},{9,21,20,0,0},{10,21,20,0,0},{11,21,20,0,0},{12,21,20,0,0},{0,22,20,0,0},{1,22,20,0,0},{2,22,20,0,0},{3,22,20,0,0},{4,22,20,0,0}, + {5,22,20,0,0},{6,22,20,0,0},{7,22,20,0,0},{8,22,20,0,0},{9,22,20,0,0},{10,22,20,0,0},{11,22,20,0,0},{12,22,20,0,0},{0,23,20,0,0},{1,23,20,0,0},{2,23,20,0,0},{3,23,20,0,0},{4,23,20,0,0},{5,23,20,0,0},{6,23,20,0,0},{7,23,20,0,0}, + {8,23,20,0,0},{9,23,20,0,0},{10,23,20,0,0},{11,23,20,0,0},{12,23,20,0,0},{0,0,21,0,0},{1,0,21,0,0},{2,0,21,0,0},{3,0,21,0,0},{4,0,21,0,0},{5,0,21,0,0},{6,0,21,202,8},{7,0,21,0,0},{8,0,21,0,0},{9,0,21,0,0},{10,0,21,0,0}, + {11,0,21,0,0},{12,0,21,0,0},{0,1,21,0,0},{1,1,21,0,0},{2,1,21,0,0},{3,1,21,0,0},{5,1,21,201,0},{6,1,21,201,0},{7,1,21,201,0},{9,1,21,0,0},{10,1,21,0,0},{11,1,21,0,0},{12,1,21,0,0},{0,2,21,0,0},{1,2,21,0,0},{2,2,21,0,0}, + {4,2,21,201,0},{5,2,21,49,0},{6,2,21,202,8},{7,2,21,49,0},{8,2,21,201,0},{10,2,21,0,0},{11,2,21,0,0},{12,2,21,0,0},{0,3,21,0,0},{1,3,21,0,0},{3,3,21,201,0},{4,3,21,0,0},{5,3,21,0,0},{6,3,21,0,0},{7,3,21,0,0},{8,3,21,201,0}, + {9,3,21,201,0},{11,3,21,0,0},{12,3,21,0,0},{0,4,21,0,0},{1,4,21,0,0},{2,4,21,201,0},{3,4,21,0,0},{4,4,21,0,0},{5,4,21,0,0},{6,4,21,0,0},{7,4,21,0,0},{8,4,21,201,0},{9,4,21,201,0},{10,4,21,201,0},{11,4,21,0,0},{12,4,21,0,0}, + {0,5,21,0,0},{2,5,21,201,0},{3,5,21,201,0},{4,5,21,201,0},{5,5,21,201,0},{6,5,21,201,0},{7,5,21,201,0},{8,5,21,201,0},{9,5,21,201,0},{10,5,21,201,0},{12,5,21,0,0},{0,6,21,0,0},{1,6,21,0,0},{2,6,21,202,0},{3,6,21,201,0},{4,6,21,0,0}, + {5,6,21,0,0},{6,6,21,201,0},{7,6,21,201,0},{8,6,21,0,0},{9,6,21,0,0},{10,6,21,202,0},{11,6,21,0,0},{12,6,21,0,0},{0,7,21,0,0},{1,7,21,0,0},{2,7,21,202,0},{3,7,21,201,0},{4,7,21,0,0},{5,7,21,0,0},{6,7,21,201,0},{7,7,21,201,0}, + {8,7,21,0,0},{9,7,21,0,0},{10,7,21,202,0},{11,7,21,0,0},{12,7,21,0,0},{0,8,21,0,0},{1,8,21,0,0},{2,8,21,202,0},{3,8,21,201,0},{4,8,21,0,0},{5,8,21,0,0},{6,8,21,201,0},{7,8,21,201,0},{10,8,21,202,0},{11,8,21,0,0},{12,8,21,0,0}, + {1,9,21,201,0},{2,9,21,201,0},{3,9,21,201,0},{4,9,21,201,0},{5,9,21,201,0},{6,9,21,201,0},{7,9,21,201,0},{8,9,21,201,0},{9,9,21,201,0},{10,9,21,201,0},{11,9,21,201,0},{0,10,21,0,0},{2,10,21,0,0},{7,10,21,0,0},{8,10,21,0,0},{9,10,21,0,0}, + {10,10,21,0,0},{12,10,21,0,0},{0,11,21,0,0},{1,11,21,0,0},{2,11,21,0,0},{3,11,21,0,0},{4,11,21,0,0},{5,11,21,0,0},{6,11,21,0,0},{7,11,21,0,0},{8,11,21,0,0},{9,11,21,0,0},{10,11,21,0,0},{11,11,21,0,0},{12,11,21,0,0},{0,12,21,0,0}, + {1,12,21,0,0},{2,12,21,0,0},{3,12,21,0,0},{4,12,21,0,0},{5,12,21,0,0},{6,12,21,0,0},{7,12,21,0,0},{8,12,21,0,0},{9,12,21,0,0},{10,12,21,0,0},{11,12,21,0,0},{12,12,21,0,0},{0,13,21,0,0},{1,13,21,0,0},{2,13,21,0,0},{3,13,21,0,0}, + {4,13,21,0,0},{5,13,21,0,0},{6,13,21,0,0},{7,13,21,0,0},{8,13,21,0,0},{9,13,21,0,0},{10,13,21,0,0},{11,13,21,0,0},{12,13,21,0,0},{0,14,21,0,0},{1,14,21,0,0},{2,14,21,0,0},{3,14,21,0,0},{4,14,21,0,0},{5,14,21,0,0},{6,14,21,0,0}, + {7,14,21,0,0},{8,14,21,0,0},{9,14,21,0,0},{10,14,21,0,0},{11,14,21,0,0},{12,14,21,0,0},{0,15,21,0,0},{1,15,21,0,0},{2,15,21,0,0},{3,15,21,0,0},{4,15,21,0,0},{5,15,21,0,0},{6,15,21,0,0},{7,15,21,0,0},{8,15,21,0,0},{9,15,21,0,0}, + {10,15,21,0,0},{11,15,21,0,0},{12,15,21,0,0},{0,16,21,0,0},{1,16,21,0,0},{2,16,21,0,0},{3,16,21,0,0},{4,16,21,0,0},{5,16,21,0,0},{6,16,21,0,0},{7,16,21,0,0},{8,16,21,0,0},{9,16,21,0,0},{10,16,21,0,0},{11,16,21,0,0},{12,16,21,0,0}, + {0,17,21,0,0},{1,17,21,0,0},{2,17,21,0,0},{3,17,21,0,0},{4,17,21,0,0},{5,17,21,0,0},{6,17,21,0,0},{7,17,21,0,0},{8,17,21,0,0},{9,17,21,0,0},{10,17,21,0,0},{11,17,21,0,0},{12,17,21,0,0},{0,18,21,0,0},{1,18,21,0,0},{2,18,21,0,0}, + {3,18,21,0,0},{4,18,21,0,0},{5,18,21,0,0},{6,18,21,0,0},{7,18,21,0,0},{8,18,21,0,0},{9,18,21,0,0},{10,18,21,0,0},{11,18,21,0,0},{12,18,21,0,0},{0,19,21,0,0},{1,19,21,0,0},{2,19,21,0,0},{3,19,21,0,0},{4,19,21,0,0},{5,19,21,0,0}, + {6,19,21,0,0},{7,19,21,0,0},{8,19,21,0,0},{9,19,21,0,0},{10,19,21,0,0},{11,19,21,0,0},{12,19,21,0,0},{0,20,21,0,0},{1,20,21,0,0},{2,20,21,0,0},{3,20,21,0,0},{4,20,21,0,0},{5,20,21,0,0},{6,20,21,0,0},{7,20,21,0,0},{8,20,21,0,0}, + {9,20,21,0,0},{10,20,21,0,0},{11,20,21,0,0},{12,20,21,0,0},{0,21,21,0,0},{1,21,21,0,0},{2,21,21,0,0},{3,21,21,0,0},{4,21,21,0,0},{5,21,21,0,0},{6,21,21,0,0},{7,21,21,0,0},{8,21,21,0,0},{9,21,21,0,0},{10,21,21,0,0},{11,21,21,0,0}, + {12,21,21,0,0},{0,22,21,0,0},{1,22,21,0,0},{2,22,21,0,0},{3,22,21,0,0},{4,22,21,0,0},{5,22,21,0,0},{6,22,21,0,0},{7,22,21,0,0},{8,22,21,0,0},{9,22,21,0,0},{10,22,21,0,0},{11,22,21,0,0},{12,22,21,0,0},{0,23,21,0,0},{1,23,21,0,0}, + {2,23,21,0,0},{3,23,21,0,0},{4,23,21,0,0},{5,23,21,0,0},{6,23,21,0,0},{7,23,21,0,0},{8,23,21,0,0},{9,23,21,0,0},{10,23,21,0,0},{11,23,21,0,0},{12,23,21,0,0},{0,0,22,0,0},{1,0,22,0,0},{2,0,22,0,0},{3,0,22,0,0},{4,0,22,0,0}, + {5,0,22,0,0},{6,0,22,202,8},{7,0,22,0,0},{8,0,22,0,0},{9,0,22,0,0},{10,0,22,0,0},{11,0,22,0,0},{12,0,22,0,0},{0,1,22,0,0},{1,1,22,0,0},{2,1,22,0,0},{3,1,22,0,0},{4,1,22,0,0},{5,1,22,201,0},{6,1,22,201,0},{7,1,22,201,0}, + {8,1,22,0,0},{9,1,22,0,0},{10,1,22,0,0},{11,1,22,0,0},{12,1,22,0,0},{0,2,22,0,0},{1,2,22,0,0},{2,2,22,0,0},{3,2,22,0,0},{4,2,22,201,0},{5,2,22,49,0},{6,2,22,202,8},{7,2,22,49,0},{8,2,22,201,0},{9,2,22,0,0},{10,2,22,0,0}, + {11,2,22,0,0},{12,2,22,0,0},{0,3,22,0,0},{1,3,22,0,0},{2,3,22,0,0},{3,3,22,201,0},{4,3,22,0,0},{5,3,22,0,0},{6,3,22,0,0},{7,3,22,0,0},{8,3,22,201,0},{9,3,22,201,0},{10,3,22,0,0},{11,3,22,0,0},{12,3,22,0,0},{0,4,22,0,0}, + {1,4,22,0,0},{2,4,22,201,0},{3,4,22,0,0},{4,4,22,0,0},{5,4,22,0,0},{6,4,22,0,0},{7,4,22,0,0},{8,4,22,201,0},{9,4,22,201,0},{10,4,22,201,0},{11,4,22,0,0},{12,4,22,0,0},{0,5,22,0,0},{2,5,22,201,0},{3,5,22,201,0},{4,5,22,201,0}, + {5,5,22,201,0},{6,5,22,201,0},{7,5,22,201,0},{8,5,22,201,0},{9,5,22,201,0},{10,5,22,201,0},{12,5,22,0,0},{0,6,22,0,0},{1,6,22,0,0},{2,6,22,206,0},{3,6,22,0,0},{4,6,22,0,0},{5,6,22,0,0},{6,6,22,0,0},{7,6,22,0,0},{8,6,22,0,0}, + {9,6,22,0,0},{10,6,22,206,0},{11,6,22,0,0},{12,6,22,0,0},{0,7,22,0,0},{1,7,22,0,0},{2,7,22,206,0},{3,7,22,0,0},{4,7,22,0,0},{5,7,22,0,0},{6,7,22,0,0},{7,7,22,0,0},{8,7,22,0,0},{9,7,22,0,0},{10,7,22,206,0},{11,7,22,0,0}, + {12,7,22,0,0},{0,8,22,0,0},{1,8,22,0,0},{2,8,22,206,0},{3,8,22,0,0},{4,8,22,0,0},{5,8,22,0,0},{6,8,22,0,0},{7,8,22,0,0},{8,8,22,0,0},{9,8,22,0,0},{10,8,22,206,0},{11,8,22,0,0},{12,8,22,0,0},{1,9,22,201,0},{2,9,22,201,0}, + {3,9,22,201,0},{4,9,22,201,0},{5,9,22,201,0},{6,9,22,201,0},{7,9,22,201,0},{8,9,22,201,0},{9,9,22,201,0},{10,9,22,201,0},{11,9,22,201,0},{0,10,22,0,0},{2,10,22,0,0},{3,10,22,0,0},{4,10,22,202,0},{5,10,22,0,0},{6,10,22,0,0},{7,10,22,0,0}, + {8,10,22,0,0},{9,10,22,0,0},{10,10,22,0,0},{12,10,22,0,0},{0,11,22,0,0},{1,11,22,0,0},{2,11,22,0,0},{3,11,22,0,0},{4,11,22,0,0},{5,11,22,0,0},{6,11,22,0,0},{7,11,22,0,0},{8,11,22,0,0},{9,11,22,0,0},{10,11,22,0,0},{11,11,22,0,0}, + {12,11,22,0,0},{0,12,22,0,0},{1,12,22,0,0},{2,12,22,0,0},{3,12,22,0,0},{4,12,22,0,0},{5,12,22,0,0},{6,12,22,0,0},{7,12,22,0,0},{8,12,22,0,0},{9,12,22,0,0},{10,12,22,0,0},{11,12,22,0,0},{12,12,22,0,0},{0,13,22,0,0},{1,13,22,0,0}, + {2,13,22,0,0},{3,13,22,0,0},{4,13,22,0,0},{5,13,22,0,0},{6,13,22,0,0},{7,13,22,0,0},{8,13,22,0,0},{9,13,22,0,0},{10,13,22,0,0},{11,13,22,0,0},{12,13,22,0,0},{0,14,22,0,0},{1,14,22,0,0},{2,14,22,0,0},{3,14,22,0,0},{4,14,22,0,0}, + {5,14,22,0,0},{6,14,22,0,0},{7,14,22,0,0},{8,14,22,0,0},{9,14,22,0,0},{10,14,22,0,0},{11,14,22,0,0},{12,14,22,0,0},{0,15,22,0,0},{1,15,22,0,0},{2,15,22,0,0},{3,15,22,0,0},{4,15,22,0,0},{5,15,22,0,0},{6,15,22,0,0},{7,15,22,0,0}, + {8,15,22,0,0},{9,15,22,0,0},{10,15,22,0,0},{11,15,22,0,0},{12,15,22,0,0},{0,16,22,0,0},{1,16,22,0,0},{2,16,22,0,0},{3,16,22,0,0},{4,16,22,0,0},{5,16,22,0,0},{6,16,22,0,0},{7,16,22,0,0},{8,16,22,0,0},{9,16,22,0,0},{10,16,22,0,0}, + {11,16,22,0,0},{12,16,22,0,0},{0,17,22,0,0},{1,17,22,0,0},{2,17,22,0,0},{3,17,22,0,0},{4,17,22,0,0},{5,17,22,0,0},{6,17,22,0,0},{7,17,22,0,0},{8,17,22,0,0},{9,17,22,0,0},{10,17,22,0,0},{11,17,22,0,0},{12,17,22,0,0},{0,18,22,0,0}, + {1,18,22,0,0},{2,18,22,0,0},{3,18,22,0,0},{4,18,22,0,0},{5,18,22,0,0},{6,18,22,0,0},{7,18,22,0,0},{8,18,22,0,0},{9,18,22,0,0},{10,18,22,0,0},{11,18,22,0,0},{12,18,22,0,0},{0,19,22,0,0},{1,19,22,0,0},{2,19,22,0,0},{3,19,22,0,0}, + {4,19,22,0,0},{5,19,22,0,0},{6,19,22,0,0},{7,19,22,0,0},{8,19,22,0,0},{9,19,22,0,0},{10,19,22,0,0},{11,19,22,0,0},{12,19,22,0,0},{0,20,22,0,0},{1,20,22,0,0},{2,20,22,0,0},{3,20,22,0,0},{4,20,22,0,0},{5,20,22,0,0},{6,20,22,0,0}, + {7,20,22,0,0},{8,20,22,0,0},{9,20,22,0,0},{10,20,22,0,0},{11,20,22,0,0},{12,20,22,0,0},{0,21,22,0,0},{1,21,22,0,0},{2,21,22,0,0},{3,21,22,0,0},{4,21,22,0,0},{5,21,22,0,0},{6,21,22,0,0},{7,21,22,0,0},{8,21,22,0,0},{9,21,22,0,0}, + {10,21,22,0,0},{11,21,22,0,0},{12,21,22,0,0},{0,22,22,0,0},{1,22,22,0,0},{2,22,22,0,0},{3,22,22,0,0},{4,22,22,0,0},{5,22,22,0,0},{6,22,22,0,0},{7,22,22,0,0},{8,22,22,0,0},{9,22,22,0,0},{10,22,22,0,0},{11,22,22,0,0},{12,22,22,0,0}, + {0,23,22,0,0},{1,23,22,0,0},{2,23,22,0,0},{3,23,22,0,0},{4,23,22,0,0},{5,23,22,0,0},{6,23,22,0,0},{7,23,22,0,0},{8,23,22,0,0},{9,23,22,0,0},{10,23,22,0,0},{11,23,22,0,0},{12,23,22,0,0},{0,0,23,0,0},{1,0,23,0,0},{2,0,23,0,0}, + {3,0,23,0,0},{4,0,23,0,0},{5,0,23,0,0},{6,0,23,202,8},{7,0,23,0,0},{8,0,23,0,0},{9,0,23,0,0},{10,0,23,0,0},{11,0,23,0,0},{12,0,23,0,0},{0,1,23,0,0},{1,1,23,0,0},{2,1,23,0,0},{3,1,23,0,0},{4,1,23,0,0},{5,1,23,201,0}, + {6,1,23,202,8},{7,1,23,201,0},{8,1,23,0,0},{9,1,23,0,0},{10,1,23,0,0},{11,1,23,0,0},{12,1,23,0,0},{0,2,23,0,0},{1,2,23,0,0},{2,2,23,0,0},{3,2,23,0,0},{4,2,23,201,0},{5,2,23,49,0},{6,2,23,202,8},{7,2,23,49,0},{8,2,23,201,0}, + {9,2,23,0,0},{10,2,23,0,0},{11,2,23,0,0},{12,2,23,0,0},{0,3,23,0,0},{1,3,23,0,0},{2,3,23,0,0},{3,3,23,201,0},{4,3,23,0,0},{5,3,23,0,0},{6,3,23,0,0},{7,3,23,0,0},{8,3,23,201,0},{9,3,23,201,0},{10,3,23,0,0},{11,3,23,0,0}, + {12,3,23,0,0},{0,4,23,0,0},{1,4,23,0,0},{2,4,23,201,0},{3,4,23,0,0},{4,4,23,0,0},{5,4,23,0,0},{6,4,23,0,0},{7,4,23,0,0},{8,4,23,201,0},{9,4,23,201,0},{10,4,23,201,0},{11,4,23,0,0},{12,4,23,0,0},{0,5,23,0,0},{2,5,23,201,0}, + {3,5,23,201,0},{4,5,23,201,0},{5,5,23,201,0},{6,5,23,201,0},{7,5,23,201,0},{8,5,23,201,0},{9,5,23,201,0},{10,5,23,201,0},{12,5,23,0,0},{0,6,23,0,0},{1,6,23,0,0},{2,6,23,206,0},{3,6,23,0,0},{4,6,23,0,0},{5,6,23,0,0},{6,6,23,0,0}, + {7,6,23,0,0},{8,6,23,0,0},{9,6,23,0,0},{10,6,23,206,0},{11,6,23,0,0},{12,6,23,0,0},{0,7,23,0,0},{1,7,23,0,0},{3,7,23,0,0},{4,7,23,0,0},{5,7,23,0,0},{6,7,23,0,0},{7,7,23,0,0},{8,7,23,0,0},{9,7,23,0,0},{11,7,23,0,0}, + {12,7,23,0,0},{0,8,23,0,0},{1,8,23,0,0},{2,8,23,206,0},{3,8,23,0,0},{4,8,23,0,0},{5,8,23,0,0},{6,8,23,0,0},{7,8,23,0,0},{8,8,23,0,0},{9,8,23,0,0},{10,8,23,206,0},{11,8,23,0,0},{12,8,23,0,0},{1,9,23,201,0},{2,9,23,201,0}, + {3,9,23,201,0},{4,9,23,201,0},{5,9,23,201,0},{6,9,23,201,0},{7,9,23,201,0},{8,9,23,201,0},{9,9,23,201,0},{10,9,23,201,0},{11,9,23,201,0},{0,10,23,0,0},{2,10,23,0,0},{3,10,23,0,0},{4,10,23,0,0},{5,10,23,0,0},{6,10,23,0,0},{7,10,23,0,0}, + {8,10,23,0,0},{9,10,23,0,0},{10,10,23,0,0},{12,10,23,0,0},{0,11,23,0,0},{1,11,23,0,0},{2,11,23,0,0},{3,11,23,0,0},{4,11,23,0,0},{5,11,23,0,0},{6,11,23,0,0},{7,11,23,0,0},{8,11,23,0,0},{9,11,23,0,0},{10,11,23,0,0},{11,11,23,0,0}, + {12,11,23,0,0},{0,12,23,0,0},{1,12,23,0,0},{2,12,23,0,0},{3,12,23,0,0},{4,12,23,0,0},{5,12,23,0,0},{6,12,23,0,0},{7,12,23,0,0},{8,12,23,0,0},{9,12,23,0,0},{10,12,23,0,0},{11,12,23,0,0},{12,12,23,0,0},{0,13,23,0,0},{1,13,23,0,0}, + {2,13,23,0,0},{3,13,23,0,0},{4,13,23,0,0},{5,13,23,0,0},{6,13,23,0,0},{7,13,23,0,0},{8,13,23,0,0},{9,13,23,0,0},{10,13,23,0,0},{11,13,23,0,0},{12,13,23,0,0},{0,14,23,0,0},{1,14,23,0,0},{2,14,23,0,0},{3,14,23,0,0},{4,14,23,0,0}, + {5,14,23,0,0},{6,14,23,0,0},{7,14,23,0,0},{8,14,23,0,0},{9,14,23,0,0},{10,14,23,0,0},{11,14,23,0,0},{12,14,23,0,0},{0,15,23,0,0},{1,15,23,0,0},{2,15,23,0,0},{3,15,23,0,0},{4,15,23,0,0},{5,15,23,0,0},{6,15,23,0,0},{7,15,23,0,0}, + {8,15,23,0,0},{9,15,23,0,0},{10,15,23,0,0},{11,15,23,0,0},{12,15,23,0,0},{0,16,23,0,0},{1,16,23,0,0},{2,16,23,0,0},{3,16,23,0,0},{4,16,23,0,0},{5,16,23,0,0},{6,16,23,0,0},{7,16,23,0,0},{8,16,23,0,0},{9,16,23,0,0},{10,16,23,0,0}, + {11,16,23,0,0},{12,16,23,0,0},{0,17,23,0,0},{1,17,23,0,0},{2,17,23,0,0},{3,17,23,0,0},{4,17,23,0,0},{5,17,23,0,0},{6,17,23,0,0},{7,17,23,0,0},{8,17,23,0,0},{9,17,23,0,0},{10,17,23,0,0},{11,17,23,0,0},{12,17,23,0,0},{0,18,23,0,0}, + {1,18,23,0,0},{2,18,23,0,0},{3,18,23,0,0},{4,18,23,0,0},{5,18,23,0,0},{6,18,23,0,0},{7,18,23,0,0},{8,18,23,0,0},{9,18,23,0,0},{10,18,23,0,0},{11,18,23,0,0},{12,18,23,0,0},{0,19,23,0,0},{1,19,23,0,0},{2,19,23,0,0},{3,19,23,0,0}, + {4,19,23,0,0},{5,19,23,0,0},{6,19,23,0,0},{7,19,23,0,0},{8,19,23,0,0},{9,19,23,0,0},{10,19,23,0,0},{11,19,23,0,0},{12,19,23,0,0},{0,20,23,0,0},{1,20,23,0,0},{2,20,23,0,0},{3,20,23,0,0},{4,20,23,0,0},{5,20,23,0,0},{6,20,23,0,0}, + {7,20,23,0,0},{8,20,23,0,0},{9,20,23,0,0},{10,20,23,0,0},{11,20,23,0,0},{12,20,23,0,0},{0,21,23,0,0},{1,21,23,0,0},{2,21,23,0,0},{3,21,23,0,0},{4,21,23,0,0},{5,21,23,0,0},{6,21,23,0,0},{7,21,23,0,0},{8,21,23,0,0},{9,21,23,0,0}, + {10,21,23,0,0},{11,21,23,0,0},{12,21,23,0,0},{0,22,23,0,0},{1,22,23,0,0},{2,22,23,0,0},{3,22,23,0,0},{4,22,23,0,0},{5,22,23,0,0},{6,22,23,0,0},{7,22,23,0,0},{8,22,23,0,0},{9,22,23,0,0},{10,22,23,0,0},{11,22,23,0,0},{12,22,23,0,0}, + {0,23,23,0,0},{1,23,23,0,0},{2,23,23,0,0},{3,23,23,0,0},{4,23,23,0,0},{5,23,23,0,0},{6,23,23,0,0},{7,23,23,0,0},{8,23,23,0,0},{9,23,23,0,0},{10,23,23,0,0},{11,23,23,0,0},{12,23,23,0,0},{0,0,24,0,0},{1,0,24,0,0},{2,0,24,0,0}, + {3,0,24,0,0},{4,0,24,0,0},{5,0,24,0,0},{6,0,24,0,0},{7,0,24,0,0},{8,0,24,0,0},{9,0,24,0,0},{10,0,24,0,0},{11,0,24,0,0},{12,0,24,0,0},{0,1,24,0,0},{1,1,24,0,0},{2,1,24,0,0},{3,1,24,0,0},{4,1,24,0,0},{5,1,24,201,0}, + {6,1,24,202,8},{7,1,24,201,0},{8,1,24,0,0},{9,1,24,0,0},{10,1,24,0,0},{11,1,24,0,0},{12,1,24,0,0},{0,2,24,0,0},{1,2,24,0,0},{2,2,24,0,0},{3,2,24,0,0},{4,2,24,201,0},{5,2,24,49,0},{6,2,24,202,8},{7,2,24,49,0},{8,2,24,201,0}, + {9,2,24,0,0},{10,2,24,0,0},{11,2,24,0,0},{12,2,24,0,0},{0,3,24,0,0},{1,3,24,0,0},{2,3,24,0,0},{3,3,24,201,0},{4,3,24,0,0},{5,3,24,0,0},{6,3,24,0,0},{7,3,24,0,0},{8,3,24,201,0},{9,3,24,201,0},{10,3,24,0,0},{11,3,24,0,0}, + {12,3,24,0,0},{0,4,24,0,0},{1,4,24,0,0},{2,4,24,201,0},{3,4,24,0,0},{4,4,24,0,0},{5,4,24,0,0},{6,4,24,0,0},{7,4,24,0,0},{8,4,24,201,0},{9,4,24,201,0},{10,4,24,201,0},{11,4,24,0,0},{12,4,24,0,0},{0,5,24,0,0},{2,5,24,201,0}, + {3,5,24,201,0},{4,5,24,201,0},{5,5,24,201,0},{6,5,24,201,0},{7,5,24,201,0},{8,5,24,201,0},{9,5,24,201,0},{10,5,24,201,0},{12,5,24,0,0},{0,6,24,0,0},{1,6,24,0,0},{2,6,24,206,0},{3,6,24,0,0},{4,6,24,0,0},{5,6,24,0,0},{6,6,24,0,0}, + {7,6,24,0,0},{8,6,24,0,0},{9,6,24,0,0},{10,6,24,206,0},{11,6,24,0,0},{12,6,24,0,0},{0,7,24,0,0},{1,7,24,0,0},{3,7,24,0,0},{4,7,24,0,0},{5,7,24,0,0},{6,7,24,0,0},{7,7,24,0,0},{8,7,24,0,0},{9,7,24,0,0},{11,7,24,0,0}, + {12,7,24,0,0},{0,8,24,0,0},{1,8,24,0,0},{2,8,24,206,0},{3,8,24,0,0},{4,8,24,0,0},{5,8,24,0,0},{6,8,24,0,0},{7,8,24,0,0},{8,8,24,0,0},{9,8,24,0,0},{10,8,24,206,0},{11,8,24,0,0},{12,8,24,0,0},{1,9,24,201,0},{2,9,24,201,0}, + {3,9,24,201,0},{4,9,24,201,0},{5,9,24,201,0},{6,9,24,201,0},{7,9,24,201,0},{8,9,24,201,0},{9,9,24,201,0},{10,9,24,201,0},{11,9,24,201,0},{0,10,24,0,0},{2,10,24,0,0},{3,10,24,0,0},{4,10,24,0,0},{5,10,24,0,0},{6,10,24,0,0},{7,10,24,0,0}, + {8,10,24,0,0},{9,10,24,0,0},{10,10,24,0,0},{12,10,24,0,0},{0,11,24,0,0},{1,11,24,0,0},{2,11,24,0,0},{3,11,24,0,0},{4,11,24,0,0},{5,11,24,0,0},{6,11,24,0,0},{7,11,24,0,0},{8,11,24,0,0},{9,11,24,0,0},{10,11,24,0,0},{11,11,24,0,0}, + {12,11,24,0,0},{0,12,24,0,0},{1,12,24,0,0},{2,12,24,0,0},{3,12,24,0,0},{4,12,24,0,0},{5,12,24,0,0},{6,12,24,0,0},{7,12,24,0,0},{8,12,24,0,0},{9,12,24,0,0},{10,12,24,0,0},{11,12,24,0,0},{12,12,24,0,0},{0,13,24,0,0},{1,13,24,0,0}, + {2,13,24,0,0},{3,13,24,0,0},{4,13,24,0,0},{5,13,24,0,0},{6,13,24,0,0},{7,13,24,0,0},{8,13,24,0,0},{9,13,24,0,0},{10,13,24,0,0},{11,13,24,0,0},{12,13,24,0,0},{0,14,24,0,0},{1,14,24,0,0},{2,14,24,0,0},{3,14,24,0,0},{4,14,24,0,0}, + {5,14,24,0,0},{6,14,24,0,0},{7,14,24,0,0},{8,14,24,0,0},{9,14,24,0,0},{10,14,24,0,0},{11,14,24,0,0},{12,14,24,0,0},{0,15,24,0,0},{1,15,24,0,0},{2,15,24,0,0},{3,15,24,0,0},{4,15,24,0,0},{5,15,24,0,0},{6,15,24,0,0},{7,15,24,0,0}, + {8,15,24,0,0},{9,15,24,0,0},{10,15,24,0,0},{11,15,24,0,0},{12,15,24,0,0},{0,16,24,0,0},{1,16,24,0,0},{2,16,24,0,0},{3,16,24,0,0},{4,16,24,0,0},{5,16,24,0,0},{6,16,24,0,0},{7,16,24,0,0},{8,16,24,0,0},{9,16,24,0,0},{10,16,24,0,0}, + {11,16,24,0,0},{12,16,24,0,0},{0,17,24,0,0},{1,17,24,0,0},{2,17,24,0,0},{3,17,24,0,0},{4,17,24,0,0},{5,17,24,0,0},{6,17,24,0,0},{7,17,24,0,0},{8,17,24,0,0},{9,17,24,0,0},{10,17,24,0,0},{11,17,24,0,0},{12,17,24,0,0},{0,18,24,0,0}, + {1,18,24,0,0},{2,18,24,0,0},{3,18,24,0,0},{4,18,24,0,0},{5,18,24,0,0},{6,18,24,0,0},{7,18,24,0,0},{8,18,24,0,0},{9,18,24,0,0},{10,18,24,0,0},{11,18,24,0,0},{12,18,24,0,0},{0,19,24,0,0},{1,19,24,0,0},{2,19,24,0,0},{3,19,24,0,0}, + {4,19,24,0,0},{5,19,24,0,0},{6,19,24,0,0},{7,19,24,0,0},{8,19,24,0,0},{9,19,24,0,0},{10,19,24,0,0},{11,19,24,0,0},{12,19,24,0,0},{0,20,24,0,0},{1,20,24,0,0},{2,20,24,0,0},{3,20,24,0,0},{4,20,24,0,0},{5,20,24,0,0},{6,20,24,0,0}, + {7,20,24,0,0},{8,20,24,0,0},{9,20,24,0,0},{10,20,24,0,0},{11,20,24,0,0},{12,20,24,0,0},{0,21,24,0,0},{1,21,24,0,0},{2,21,24,0,0},{3,21,24,0,0},{4,21,24,0,0},{5,21,24,0,0},{6,21,24,0,0},{7,21,24,0,0},{8,21,24,0,0},{9,21,24,0,0}, + {10,21,24,0,0},{11,21,24,0,0},{12,21,24,0,0},{0,22,24,0,0},{1,22,24,0,0},{2,22,24,0,0},{3,22,24,0,0},{4,22,24,0,0},{5,22,24,0,0},{6,22,24,0,0},{7,22,24,0,0},{8,22,24,0,0},{9,22,24,0,0},{10,22,24,0,0},{11,22,24,0,0},{12,22,24,0,0}, + {0,23,24,0,0},{1,23,24,0,0},{2,23,24,0,0},{3,23,24,0,0},{4,23,24,0,0},{5,23,24,0,0},{6,23,24,0,0},{7,23,24,0,0},{8,23,24,0,0},{9,23,24,0,0},{10,23,24,0,0},{11,23,24,0,0},{12,23,24,0,0},{0,0,25,0,0},{1,0,25,0,0},{2,0,25,0,0}, + {3,0,25,0,0},{4,0,25,0,0},{5,0,25,0,0},{6,0,25,0,0},{7,0,25,0,0},{8,0,25,0,0},{9,0,25,0,0},{10,0,25,0,0},{11,0,25,0,0},{12,0,25,0,0},{0,1,25,0,0},{1,1,25,0,0},{2,1,25,0,0},{3,1,25,0,0},{4,1,25,0,0},{5,1,25,0,0}, + {6,1,25,0,0},{7,1,25,0,0},{8,1,25,0,0},{9,1,25,0,0},{10,1,25,0,0},{11,1,25,0,0},{12,1,25,0,0},{0,2,25,0,0},{1,2,25,0,0},{2,2,25,0,0},{4,2,25,201,0},{5,2,25,201,0},{6,2,25,202,8},{7,2,25,201,0},{8,2,25,201,0},{10,2,25,0,0}, + {11,2,25,0,0},{12,2,25,0,0},{0,3,25,0,0},{1,3,25,0,0},{3,3,25,201,0},{4,3,25,201,0},{5,3,25,201,0},{6,3,25,201,0},{7,3,25,201,0},{8,3,25,201,0},{9,3,25,201,0},{11,3,25,0,0},{12,3,25,0,0},{0,4,25,0,0},{1,4,25,0,0},{2,4,25,201,0}, + {3,4,25,201,0},{4,4,25,201,0},{5,4,25,201,0},{6,4,25,201,0},{7,4,25,201,0},{8,4,25,201,0},{9,4,25,201,0},{10,4,25,201,0},{11,4,25,0,0},{12,4,25,0,0},{0,5,25,0,0},{2,5,25,201,0},{3,5,25,201,0},{4,5,25,201,0},{5,5,25,201,0},{6,5,25,201,0}, + {7,5,25,201,0},{8,5,25,201,0},{9,5,25,201,0},{10,5,25,201,0},{12,5,25,0,0},{0,6,25,0,0},{1,6,25,0,0},{2,6,25,206,0},{3,6,25,0,0},{4,6,25,0,0},{5,6,25,0,0},{6,6,25,202,0},{7,6,25,0,0},{8,6,25,0,0},{9,6,25,0,0},{10,6,25,206,0}, + {11,6,25,0,0},{12,6,25,0,0},{0,7,25,0,0},{1,7,25,0,0},{2,7,25,206,0},{3,7,25,0,0},{4,7,25,0,0},{5,7,25,0,0},{7,7,25,0,0},{8,7,25,0,0},{9,7,25,0,0},{10,7,25,206,0},{11,7,25,0,0},{12,7,25,0,0},{0,8,25,0,0},{1,8,25,0,0}, + {2,8,25,206,0},{3,8,25,0,0},{4,8,25,0,0},{5,8,25,0,0},{6,8,25,0,0},{7,8,25,0,0},{8,8,25,0,0},{9,8,25,0,0},{10,8,25,206,0},{11,8,25,0,0},{12,8,25,0,0},{1,9,25,201,0},{2,9,25,201,0},{3,9,25,201,0},{4,9,25,201,0},{5,9,25,201,0}, + {6,9,25,201,0},{7,9,25,201,0},{8,9,25,201,0},{9,9,25,201,0},{10,9,25,201,0},{11,9,25,201,0},{0,10,25,0,0},{2,10,25,0,0},{3,10,25,0,0},{4,10,25,0,0},{5,10,25,0,0},{6,10,25,0,0},{7,10,25,0,0},{8,10,25,0,0},{9,10,25,0,0},{10,10,25,0,0}, + {12,10,25,0,0},{0,11,25,0,0},{1,11,25,0,0},{2,11,25,0,0},{3,11,25,0,0},{4,11,25,0,0},{5,11,25,0,0},{6,11,25,0,0},{7,11,25,0,0},{8,11,25,0,0},{9,11,25,0,0},{10,11,25,0,0},{11,11,25,0,0},{12,11,25,0,0},{0,12,25,0,0},{1,12,25,0,0}, + {2,12,25,0,0},{3,12,25,0,0},{4,12,25,0,0},{5,12,25,0,0},{6,12,25,0,0},{7,12,25,0,0},{8,12,25,0,0},{9,12,25,0,0},{10,12,25,0,0},{11,12,25,0,0},{12,12,25,0,0},{0,13,25,0,0},{1,13,25,0,0},{2,13,25,0,0},{3,13,25,0,0},{4,13,25,0,0}, + {5,13,25,0,0},{6,13,25,0,0},{7,13,25,0,0},{8,13,25,0,0},{9,13,25,0,0},{10,13,25,0,0},{11,13,25,0,0},{12,13,25,0,0},{0,14,25,0,0},{1,14,25,0,0},{2,14,25,0,0},{3,14,25,0,0},{4,14,25,0,0},{5,14,25,0,0},{6,14,25,0,0},{7,14,25,0,0}, + {8,14,25,0,0},{9,14,25,0,0},{10,14,25,0,0},{11,14,25,0,0},{12,14,25,0,0},{0,15,25,0,0},{1,15,25,0,0},{2,15,25,0,0},{3,15,25,0,0},{4,15,25,0,0},{5,15,25,0,0},{6,15,25,0,0},{7,15,25,0,0},{8,15,25,0,0},{9,15,25,0,0},{10,15,25,0,0}, + {11,15,25,0,0},{12,15,25,0,0},{0,16,25,0,0},{1,16,25,0,0},{2,16,25,0,0},{3,16,25,0,0},{4,16,25,0,0},{5,16,25,0,0},{6,16,25,0,0},{7,16,25,0,0},{8,16,25,0,0},{9,16,25,0,0},{10,16,25,0,0},{11,16,25,0,0},{12,16,25,0,0},{0,17,25,0,0}, + {1,17,25,0,0},{2,17,25,0,0},{3,17,25,0,0},{4,17,25,0,0},{5,17,25,0,0},{6,17,25,0,0},{7,17,25,0,0},{8,17,25,0,0},{9,17,25,0,0},{10,17,25,0,0},{11,17,25,0,0},{12,17,25,0,0},{0,18,25,0,0},{1,18,25,0,0},{2,18,25,0,0},{3,18,25,0,0}, + {4,18,25,0,0},{5,18,25,0,0},{6,18,25,0,0},{7,18,25,0,0},{8,18,25,0,0},{9,18,25,0,0},{10,18,25,0,0},{11,18,25,0,0},{12,18,25,0,0},{0,19,25,0,0},{1,19,25,0,0},{2,19,25,0,0},{3,19,25,0,0},{4,19,25,0,0},{5,19,25,0,0},{6,19,25,0,0}, + {7,19,25,0,0},{8,19,25,0,0},{9,19,25,0,0},{10,19,25,0,0},{11,19,25,0,0},{12,19,25,0,0},{0,20,25,0,0},{1,20,25,0,0},{2,20,25,0,0},{3,20,25,0,0},{4,20,25,0,0},{5,20,25,0,0},{6,20,25,0,0},{7,20,25,0,0},{8,20,25,0,0},{9,20,25,0,0}, + {10,20,25,0,0},{11,20,25,0,0},{12,20,25,0,0},{0,21,25,0,0},{1,21,25,0,0},{2,21,25,0,0},{3,21,25,0,0},{4,21,25,0,0},{5,21,25,0,0},{6,21,25,0,0},{7,21,25,0,0},{8,21,25,0,0},{9,21,25,0,0},{10,21,25,0,0},{11,21,25,0,0},{12,21,25,0,0}, + {0,22,25,0,0},{1,22,25,0,0},{2,22,25,0,0},{3,22,25,0,0},{4,22,25,0,0},{5,22,25,0,0},{6,22,25,0,0},{7,22,25,0,0},{8,22,25,0,0},{9,22,25,0,0},{10,22,25,0,0},{11,22,25,0,0},{12,22,25,0,0},{0,23,25,0,0},{1,23,25,0,0},{2,23,25,0,0}, + {3,23,25,0,0},{4,23,25,0,0},{5,23,25,0,0},{6,23,25,0,0},{7,23,25,0,0},{8,23,25,0,0},{9,23,25,0,0},{10,23,25,0,0},{11,23,25,0,0},{12,23,25,0,0},{0,0,26,0,0},{1,0,26,0,0},{2,0,26,0,0},{3,0,26,0,0},{4,0,26,0,0},{5,0,26,0,0}, + {6,0,26,0,0},{7,0,26,0,0},{8,0,26,0,0},{9,0,26,0,0},{10,0,26,0,0},{11,0,26,0,0},{12,0,26,0,0},{0,1,26,0,0},{1,1,26,0,0},{2,1,26,0,0},{3,1,26,0,0},{4,1,26,0,0},{5,1,26,0,0},{6,1,26,0,0},{7,1,26,0,0},{8,1,26,0,0}, + {9,1,26,0,0},{10,1,26,0,0},{11,1,26,0,0},{12,1,26,0,0},{0,2,26,0,0},{1,2,26,0,0},{2,2,26,0,0},{3,2,26,0,0},{4,2,26,0,0},{5,2,26,0,0},{6,2,26,0,0},{7,2,26,0,0},{8,2,26,0,0},{9,2,26,0,0},{10,2,26,0,0},{11,2,26,0,0}, + {12,2,26,0,0},{0,3,26,0,0},{1,3,26,0,0},{2,3,26,0,0},{3,3,26,0,0},{4,3,26,0,0},{5,3,26,0,0},{6,3,26,0,0},{7,3,26,0,0},{8,3,26,0,0},{9,3,26,0,0},{10,3,26,0,0},{11,3,26,0,0},{12,3,26,0,0},{0,4,26,0,0},{1,4,26,0,0}, + {3,4,26,0,0},{4,4,26,0,0},{5,4,26,0,0},{7,4,26,0,0},{8,4,26,0,0},{9,4,26,0,0},{11,4,26,0,0},{12,4,26,0,0},{0,5,26,0,0},{2,5,26,201,0},{3,5,26,201,0},{4,5,26,201,0},{5,5,26,201,0},{6,5,26,201,0},{7,5,26,201,0},{8,5,26,201,0}, + {9,5,26,201,0},{10,5,26,201,0},{12,5,26,0,0},{0,6,26,0,0},{1,6,26,0,0},{2,6,26,202,0},{3,6,26,206,0},{4,6,26,206,0},{5,6,26,206,0},{6,6,26,202,0},{7,6,26,206,0},{8,6,26,206,0},{9,6,26,206,0},{10,6,26,202,0},{11,6,26,0,0},{12,6,26,0,0}, + {0,7,26,0,0},{1,7,26,0,0},{2,7,26,202,0},{3,7,26,206,0},{5,7,26,206,0},{6,7,26,202,0},{7,7,26,206,0},{9,7,26,206,0},{10,7,26,202,0},{11,7,26,0,0},{12,7,26,0,0},{0,8,26,0,0},{1,8,26,0,0},{2,8,26,202,0},{3,8,26,206,0},{4,8,26,206,0}, + {5,8,26,206,0},{6,8,26,202,0},{7,8,26,206,0},{8,8,26,206,0},{9,8,26,206,0},{10,8,26,202,0},{11,8,26,0,0},{12,8,26,0,0},{1,9,26,201,0},{2,9,26,201,0},{3,9,26,201,0},{4,9,26,201,0},{5,9,26,201,0},{6,9,26,201,0},{7,9,26,201,0},{8,9,26,201,0}, + {9,9,26,201,0},{10,9,26,201,0},{11,9,26,201,0},{0,10,26,0,0},{2,10,26,0,0},{3,10,26,0,0},{9,10,26,0,0},{10,10,26,0,0},{12,10,26,0,0},{0,11,26,0,0},{1,11,26,0,0},{2,11,26,0,0},{3,11,26,0,0},{4,11,26,0,0},{5,11,26,0,0},{6,11,26,0,0}, + {7,11,26,0,0},{8,11,26,0,0},{9,11,26,0,0},{10,11,26,0,0},{11,11,26,0,0},{12,11,26,0,0},{0,12,26,0,0},{1,12,26,0,0},{2,12,26,0,0},{3,12,26,0,0},{4,12,26,0,0},{5,12,26,0,0},{6,12,26,0,0},{7,12,26,0,0},{8,12,26,0,0},{9,12,26,0,0}, + {10,12,26,0,0},{11,12,26,0,0},{12,12,26,0,0},{0,13,26,0,0},{1,13,26,0,0},{2,13,26,0,0},{3,13,26,0,0},{4,13,26,0,0},{5,13,26,0,0},{6,13,26,0,0},{7,13,26,0,0},{8,13,26,0,0},{9,13,26,0,0},{10,13,26,0,0},{11,13,26,0,0},{12,13,26,0,0}, + {0,14,26,0,0},{1,14,26,0,0},{2,14,26,0,0},{3,14,26,0,0},{4,14,26,0,0},{5,14,26,0,0},{6,14,26,0,0},{7,14,26,0,0},{8,14,26,0,0},{9,14,26,0,0},{10,14,26,0,0},{11,14,26,0,0},{12,14,26,0,0},{0,15,26,0,0},{1,15,26,0,0},{2,15,26,0,0}, + {3,15,26,0,0},{4,15,26,0,0},{5,15,26,0,0},{6,15,26,0,0},{7,15,26,0,0},{8,15,26,0,0},{9,15,26,0,0},{10,15,26,0,0},{11,15,26,0,0},{12,15,26,0,0},{0,16,26,0,0},{1,16,26,0,0},{2,16,26,0,0},{3,16,26,0,0},{4,16,26,0,0},{5,16,26,0,0}, + {6,16,26,0,0},{7,16,26,0,0},{8,16,26,0,0},{9,16,26,0,0},{10,16,26,0,0},{11,16,26,0,0},{12,16,26,0,0},{0,17,26,0,0},{1,17,26,0,0},{2,17,26,0,0},{3,17,26,0,0},{4,17,26,0,0},{5,17,26,0,0},{6,17,26,0,0},{7,17,26,0,0},{8,17,26,0,0}, + {9,17,26,0,0},{10,17,26,0,0},{11,17,26,0,0},{12,17,26,0,0},{0,18,26,0,0},{1,18,26,0,0},{2,18,26,0,0},{3,18,26,0,0},{4,18,26,0,0},{5,18,26,0,0},{6,18,26,0,0},{7,18,26,0,0},{8,18,26,0,0},{9,18,26,0,0},{10,18,26,0,0},{11,18,26,0,0}, + {12,18,26,0,0},{0,19,26,0,0},{1,19,26,0,0},{2,19,26,0,0},{3,19,26,0,0},{4,19,26,0,0},{5,19,26,0,0},{6,19,26,0,0},{7,19,26,0,0},{8,19,26,0,0},{9,19,26,0,0},{10,19,26,0,0},{11,19,26,0,0},{12,19,26,0,0},{0,20,26,0,0},{1,20,26,0,0}, + {2,20,26,0,0},{3,20,26,0,0},{4,20,26,0,0},{5,20,26,0,0},{6,20,26,0,0},{7,20,26,0,0},{8,20,26,0,0},{9,20,26,0,0},{10,20,26,0,0},{11,20,26,0,0},{12,20,26,0,0},{0,21,26,0,0},{1,21,26,0,0},{2,21,26,0,0},{3,21,26,0,0},{4,21,26,0,0}, + {5,21,26,0,0},{6,21,26,0,0},{7,21,26,0,0},{8,21,26,0,0},{9,21,26,0,0},{10,21,26,0,0},{11,21,26,0,0},{12,21,26,0,0},{0,22,26,0,0},{1,22,26,0,0},{2,22,26,0,0},{3,22,26,0,0},{4,22,26,0,0},{5,22,26,0,0},{6,22,26,0,0},{7,22,26,0,0}, + {8,22,26,0,0},{9,22,26,0,0},{10,22,26,0,0},{11,22,26,0,0},{12,22,26,0,0},{0,23,26,0,0},{1,23,26,0,0},{2,23,26,0,0},{3,23,26,0,0},{4,23,26,0,0},{5,23,26,0,0},{6,23,26,0,0},{7,23,26,0,0},{8,23,26,0,0},{9,23,26,0,0},{10,23,26,0,0}, + {11,23,26,0,0},{12,23,26,0,0},{0,0,27,0,0},{1,0,27,0,0},{2,0,27,0,0},{3,0,27,0,0},{4,0,27,0,0},{5,0,27,0,0},{6,0,27,0,0},{7,0,27,0,0},{8,0,27,0,0},{9,0,27,0,0},{10,0,27,0,0},{11,0,27,0,0},{12,0,27,0,0},{0,1,27,0,0}, + {1,1,27,0,0},{2,1,27,0,0},{3,1,27,0,0},{4,1,27,0,0},{5,1,27,0,0},{6,1,27,0,0},{7,1,27,0,0},{8,1,27,0,0},{9,1,27,0,0},{10,1,27,0,0},{11,1,27,0,0},{12,1,27,0,0},{0,2,27,0,0},{1,2,27,0,0},{2,2,27,0,0},{3,2,27,0,0}, + {4,2,27,0,0},{5,2,27,0,0},{6,2,27,0,0},{7,2,27,0,0},{8,2,27,0,0},{9,2,27,0,0},{10,2,27,0,0},{11,2,27,0,0},{12,2,27,0,0},{0,3,27,0,0},{1,3,27,0,0},{2,3,27,0,0},{3,3,27,0,0},{4,3,27,0,0},{5,3,27,0,0},{6,3,27,0,0}, + {7,3,27,0,0},{8,3,27,0,0},{9,3,27,0,0},{10,3,27,0,0},{11,3,27,0,0},{12,3,27,0,0},{0,4,27,0,0},{1,4,27,0,0},{2,4,27,0,0},{3,4,27,0,0},{4,4,27,0,0},{5,4,27,0,0},{6,4,27,0,0},{7,4,27,0,0},{8,4,27,0,0},{9,4,27,0,0}, + {10,4,27,0,0},{11,4,27,0,0},{12,4,27,0,0},{0,5,27,0,0},{12,5,27,0,0},{0,6,27,0,0},{2,6,27,0,0},{3,6,27,0,0},{4,6,27,0,0},{5,6,27,0,0},{6,6,27,0,0},{7,6,27,0,0},{9,6,27,0,0},{10,6,27,0,0},{12,6,27,0,0},{0,7,27,0,0}, + {1,7,27,0,0},{2,7,27,0,0},{3,7,27,0,0},{4,7,27,0,0},{5,7,27,0,0},{6,7,27,0,0},{7,7,27,0,0},{8,7,27,0,0},{9,7,27,0,0},{10,7,27,0,0},{11,7,27,0,0},{12,7,27,0,0},{0,8,27,0,0},{1,8,27,0,0},{2,8,27,0,0},{3,8,27,0,0}, + {4,8,27,0,0},{5,8,27,0,0},{6,8,27,0,0},{7,8,27,0,0},{8,8,27,0,0},{9,8,27,0,0},{10,8,27,0,0},{11,8,27,0,0},{12,8,27,0,0},{1,9,27,201,0},{2,9,27,201,0},{3,9,27,201,0},{4,9,27,201,0},{5,9,27,201,0},{6,9,27,201,0},{7,9,27,201,0}, + {8,9,27,201,0},{9,9,27,201,0},{10,9,27,201,0},{11,9,27,201,0},{0,10,27,0,0},{1,10,27,201,0},{4,10,27,201,0},{8,10,27,201,0},{11,10,27,201,0},{12,10,27,0,0},{0,11,27,0,0},{1,11,27,0,0},{2,11,27,0,0},{3,11,27,0,0},{5,11,27,0,0},{6,11,27,0,0}, + {7,11,27,0,0},{8,11,27,0,0},{9,11,27,0,0},{10,11,27,0,0},{11,11,27,0,0},{12,11,27,0,0},{0,12,27,0,0},{1,12,27,0,0},{2,12,27,0,0},{3,12,27,0,0},{4,12,27,0,0},{5,12,27,0,0},{6,12,27,0,0},{7,12,27,0,0},{8,12,27,0,0},{9,12,27,0,0}, + {10,12,27,0,0},{11,12,27,0,0},{12,12,27,0,0},{0,13,27,0,0},{1,13,27,0,0},{2,13,27,0,0},{3,13,27,0,0},{4,13,27,0,0},{5,13,27,0,0},{6,13,27,0,0},{7,13,27,0,0},{8,13,27,0,0},{9,13,27,0,0},{10,13,27,0,0},{11,13,27,0,0},{12,13,27,0,0}, + {0,14,27,0,0},{1,14,27,0,0},{2,14,27,0,0},{3,14,27,0,0},{4,14,27,0,0},{5,14,27,0,0},{6,14,27,0,0},{7,14,27,0,0},{8,14,27,0,0},{9,14,27,0,0},{10,14,27,0,0},{11,14,27,0,0},{12,14,27,0,0},{0,15,27,0,0},{1,15,27,0,0},{2,15,27,0,0}, + {3,15,27,0,0},{4,15,27,0,0},{5,15,27,0,0},{6,15,27,0,0},{7,15,27,0,0},{8,15,27,0,0},{9,15,27,0,0},{10,15,27,0,0},{11,15,27,0,0},{12,15,27,0,0},{0,16,27,0,0},{1,16,27,0,0},{2,16,27,0,0},{3,16,27,0,0},{4,16,27,0,0},{5,16,27,0,0}, + {6,16,27,0,0},{7,16,27,0,0},{8,16,27,0,0},{9,16,27,0,0},{10,16,27,0,0},{11,16,27,0,0},{12,16,27,0,0},{0,17,27,0,0},{1,17,27,0,0},{2,17,27,0,0},{3,17,27,0,0},{4,17,27,0,0},{5,17,27,0,0},{6,17,27,0,0},{7,17,27,0,0},{8,17,27,0,0}, + {9,17,27,0,0},{10,17,27,0,0},{11,17,27,0,0},{12,17,27,0,0},{0,18,27,0,0},{1,18,27,0,0},{2,18,27,0,0},{3,18,27,0,0},{4,18,27,0,0},{5,18,27,0,0},{6,18,27,0,0},{7,18,27,0,0},{8,18,27,0,0},{9,18,27,0,0},{10,18,27,0,0},{11,18,27,0,0}, + {12,18,27,0,0},{0,19,27,0,0},{1,19,27,0,0},{2,19,27,0,0},{3,19,27,0,0},{4,19,27,0,0},{5,19,27,0,0},{6,19,27,0,0},{7,19,27,0,0},{8,19,27,0,0},{9,19,27,0,0},{10,19,27,0,0},{11,19,27,0,0},{12,19,27,0,0},{0,20,27,0,0},{1,20,27,0,0}, + {2,20,27,0,0},{3,20,27,0,0},{4,20,27,0,0},{5,20,27,0,0},{6,20,27,0,0},{7,20,27,0,0},{8,20,27,0,0},{9,20,27,0,0},{10,20,27,0,0},{11,20,27,0,0},{12,20,27,0,0},{0,21,27,0,0},{1,21,27,0,0},{2,21,27,0,0},{3,21,27,0,0},{4,21,27,0,0}, + {5,21,27,0,0},{6,21,27,0,0},{7,21,27,0,0},{8,21,27,0,0},{9,21,27,0,0},{10,21,27,0,0},{11,21,27,0,0},{12,21,27,0,0},{0,22,27,0,0},{1,22,27,0,0},{2,22,27,0,0},{3,22,27,0,0},{4,22,27,0,0},{5,22,27,0,0},{6,22,27,0,0},{7,22,27,0,0}, + {8,22,27,0,0},{9,22,27,0,0},{10,22,27,0,0},{11,22,27,0,0},{12,22,27,0,0},{0,23,27,0,0},{1,23,27,0,0},{2,23,27,0,0},{3,23,27,0,0},{4,23,27,0,0},{5,23,27,0,0},{6,23,27,0,0},{7,23,27,0,0},{8,23,27,0,0},{9,23,27,0,0},{10,23,27,0,0}, + {11,23,27,0,0},{12,23,27,0,0},{0,0,28,0,0},{1,0,28,0,0},{2,0,28,0,0},{3,0,28,0,0},{4,0,28,0,0},{5,0,28,0,0},{6,0,28,0,0},{7,0,28,0,0},{8,0,28,0,0},{9,0,28,0,0},{10,0,28,0,0},{11,0,28,0,0},{12,0,28,0,0},{0,1,28,0,0}, + {1,1,28,0,0},{2,1,28,0,0},{3,1,28,0,0},{4,1,28,0,0},{5,1,28,0,0},{6,1,28,0,0},{7,1,28,0,0},{8,1,28,0,0},{9,1,28,0,0},{10,1,28,0,0},{11,1,28,0,0},{12,1,28,0,0},{0,2,28,0,0},{1,2,28,0,0},{2,2,28,0,0},{3,2,28,0,0}, + {4,2,28,0,0},{5,2,28,0,0},{6,2,28,0,0},{7,2,28,0,0},{8,2,28,0,0},{9,2,28,0,0},{10,2,28,0,0},{11,2,28,0,0},{12,2,28,0,0},{0,3,28,0,0},{1,3,28,0,0},{2,3,28,0,0},{3,3,28,0,0},{4,3,28,0,0},{5,3,28,0,0},{6,3,28,0,0}, + {7,3,28,0,0},{8,3,28,0,0},{9,3,28,0,0},{10,3,28,0,0},{11,3,28,0,0},{12,3,28,0,0},{0,4,28,0,0},{1,4,28,0,0},{2,4,28,0,0},{3,4,28,0,0},{4,4,28,0,0},{5,4,28,0,0},{6,4,28,0,0},{7,4,28,0,0},{8,4,28,0,0},{9,4,28,0,0}, + {10,4,28,0,0},{11,4,28,0,0},{12,4,28,0,0},{0,5,28,0,0},{1,5,28,0,0},{2,5,28,0,0},{3,5,28,0,0},{4,5,28,0,0},{5,5,28,0,0},{6,5,28,0,0},{7,5,28,0,0},{8,5,28,0,0},{9,5,28,0,0},{10,5,28,0,0},{11,5,28,0,0},{12,5,28,0,0}, + {0,6,28,0,0},{1,6,28,0,0},{2,6,28,0,0},{3,6,28,0,0},{4,6,28,0,0},{5,6,28,0,0},{6,6,28,0,0},{7,6,28,0,0},{8,6,28,0,0},{9,6,28,0,0},{10,6,28,0,0},{11,6,28,0,0},{12,6,28,0,0},{0,7,28,0,0},{1,7,28,0,0},{2,7,28,0,0}, + {3,7,28,0,0},{4,7,28,0,0},{5,7,28,0,0},{6,7,28,0,0},{7,7,28,0,0},{8,7,28,0,0},{9,7,28,0,0},{10,7,28,0,0},{11,7,28,0,0},{12,7,28,0,0},{0,8,28,0,0},{1,8,28,0,0},{2,8,28,0,0},{3,8,28,0,0},{4,8,28,0,0},{5,8,28,0,0}, + {6,8,28,0,0},{7,8,28,0,0},{8,8,28,0,0},{9,8,28,0,0},{10,8,28,0,0},{11,8,28,0,0},{12,8,28,0,0},{0,10,28,0,0},{1,10,28,0,0},{2,10,28,0,0},{3,10,28,0,0},{4,10,28,0,0},{5,10,28,0,0},{6,10,28,0,0},{7,10,28,0,0},{8,10,28,0,0}, + {9,10,28,0,0},{10,10,28,0,0},{11,10,28,0,0},{12,10,28,0,0},{0,11,28,0,0},{1,11,28,0,0},{2,11,28,0,0},{3,11,28,0,0},{4,11,28,0,0},{5,11,28,0,0},{6,11,28,0,0},{7,11,28,0,0},{8,11,28,0,0},{9,11,28,0,0},{10,11,28,0,0},{11,11,28,0,0}, + {12,11,28,0,0},{0,12,28,0,0},{1,12,28,0,0},{2,12,28,0,0},{3,12,28,0,0},{4,12,28,0,0},{5,12,28,0,0},{6,12,28,0,0},{7,12,28,0,0},{8,12,28,0,0},{9,12,28,0,0},{10,12,28,0,0},{11,12,28,0,0},{12,12,28,0,0},{0,13,28,0,0},{1,13,28,0,0}, + {2,13,28,0,0},{3,13,28,0,0},{4,13,28,0,0},{5,13,28,0,0},{6,13,28,0,0},{7,13,28,0,0},{8,13,28,0,0},{9,13,28,0,0},{10,13,28,0,0},{11,13,28,0,0},{12,13,28,0,0},{0,14,28,0,0},{1,14,28,0,0},{2,14,28,0,0},{3,14,28,0,0},{4,14,28,0,0}, + {5,14,28,0,0},{6,14,28,0,0},{7,14,28,0,0},{8,14,28,0,0},{9,14,28,0,0},{10,14,28,0,0},{11,14,28,0,0},{12,14,28,0,0},{0,15,28,0,0},{1,15,28,0,0},{2,15,28,0,0},{3,15,28,0,0},{4,15,28,0,0},{5,15,28,0,0},{6,15,28,0,0},{7,15,28,0,0}, + {8,15,28,0,0},{9,15,28,0,0},{10,15,28,0,0},{11,15,28,0,0},{12,15,28,0,0},{0,16,28,0,0},{1,16,28,0,0},{2,16,28,0,0},{3,16,28,0,0},{4,16,28,0,0},{5,16,28,0,0},{6,16,28,0,0},{7,16,28,0,0},{8,16,28,0,0},{9,16,28,0,0},{10,16,28,0,0}, + {11,16,28,0,0},{12,16,28,0,0},{0,17,28,0,0},{1,17,28,0,0},{2,17,28,0,0},{3,17,28,0,0},{4,17,28,0,0},{5,17,28,0,0},{6,17,28,0,0},{7,17,28,0,0},{8,17,28,0,0},{9,17,28,0,0},{10,17,28,0,0},{11,17,28,0,0},{12,17,28,0,0},{0,18,28,0,0}, + {1,18,28,0,0},{2,18,28,0,0},{3,18,28,0,0},{4,18,28,0,0},{5,18,28,0,0},{6,18,28,0,0},{7,18,28,0,0},{8,18,28,0,0},{9,18,28,0,0},{10,18,28,0,0},{11,18,28,0,0},{12,18,28,0,0},{0,19,28,0,0},{1,19,28,0,0},{2,19,28,0,0},{3,19,28,0,0}, + {4,19,28,0,0},{5,19,28,0,0},{6,19,28,0,0},{7,19,28,0,0},{8,19,28,0,0},{9,19,28,0,0},{10,19,28,0,0},{11,19,28,0,0},{12,19,28,0,0},{0,20,28,0,0},{1,20,28,0,0},{2,20,28,0,0},{3,20,28,0,0},{4,20,28,0,0},{5,20,28,0,0},{6,20,28,0,0}, + {7,20,28,0,0},{8,20,28,0,0},{9,20,28,0,0},{10,20,28,0,0},{11,20,28,0,0},{12,20,28,0,0},{0,21,28,0,0},{1,21,28,0,0},{2,21,28,0,0},{3,21,28,0,0},{4,21,28,0,0},{5,21,28,0,0},{6,21,28,0,0},{7,21,28,0,0},{8,21,28,0,0},{9,21,28,0,0}, + {10,21,28,0,0},{11,21,28,0,0},{12,21,28,0,0},{0,22,28,0,0},{1,22,28,0,0},{2,22,28,0,0},{3,22,28,0,0},{4,22,28,0,0},{5,22,28,0,0},{6,22,28,0,0},{7,22,28,0,0},{8,22,28,0,0},{9,22,28,0,0},{10,22,28,0,0},{11,22,28,0,0},{12,22,28,0,0}, + {0,23,28,0,0},{1,23,28,0,0},{2,23,28,0,0},{3,23,28,0,0},{4,23,28,0,0},{5,23,28,0,0},{6,23,28,0,0},{7,23,28,0,0},{8,23,28,0,0},{9,23,28,0,0},{10,23,28,0,0},{11,23,28,0,0},{12,23,28,0,0},{6,8,0,144,2},{5,4,7,54,3},{7,4,7,54,3}, + {6,7,25,117,5},{6,8,1,203,3},{6,12,1,205,8},{6,9,4,198,1},{6,12,4,203,3},{6,6,6,198,3},{6,11,6,203,3},{4,8,7,203,0},{8,8,7,203,1},{4,8,8,203,2},{8,8,8,203,2},{6,10,8,203,3},{3,8,9,203,0},{9,8,9,203,1},{3,8,10,203,2},{9,8,10,203,2}, + {2,9,10,198,1},{6,9,10,203,3},{10,9,10,198,1},{2,8,11,203,0},{10,8,11,203,1},{2,8,12,203,0},{6,8,12,203,3},{10,8,12,203,1},{4,21,12,203,6},{5,21,12,203,6},{6,21,12,203,6},{7,21,12,203,6},{8,21,12,203,5},{4,1,13,203,4},{8,1,13,203,5},{3,2,13,203,4}, + {9,2,13,203,5},{2,3,13,203,4},{10,3,13,203,5},{1,5,13,203,4},{11,5,13,203,5},{6,7,13,95,2},{5,20,13,205,8},{7,20,13,205,8},{4,21,13,203,4},{8,21,13,203,5},{2,8,14,203,0},{10,8,14,203,1},{5,20,14,205,8},{7,20,14,205,8},{4,21,14,203,4},{8,21,14,203,5}, + {8,3,15,203,2},{2,8,15,203,0},{6,8,15,65,3},{10,8,15,203,1},{6,9,15,65,3},{6,10,15,65,3},{6,11,15,65,3},{6,12,15,65,3},{6,13,15,65,3},{6,14,15,65,3},{6,15,15,65,3},{6,16,15,65,3},{6,17,15,65,3},{6,18,15,65,3},{6,19,15,65,3},{5,20,15,205,8}, + {6,20,15,65,3},{7,20,15,205,8},{4,21,15,203,4},{6,21,15,65,3},{8,21,15,203,5},{1,5,16,203,4},{11,5,16,203,5},{4,21,16,203,4},{5,21,16,203,7},{6,21,16,203,7},{7,21,16,203,7},{8,21,16,203,7},{4,1,17,203,4},{8,1,17,203,5},{3,2,17,203,4},{9,2,17,203,5}, + {2,3,17,203,4},{10,3,17,203,5},{2,8,17,203,0},{10,8,17,203,1},{2,8,18,203,0},{10,8,18,203,1},{8,4,19,203,2},{9,4,19,203,2},{4,7,19,203,3},{5,7,19,203,3},{8,8,19,203,2},{9,8,19,203,2},{0,9,19,203,4},{1,9,19,203,6},{2,9,19,203,6},{3,9,19,203,6}, + {11,9,19,203,6},{12,9,19,203,6},{1,5,20,203,6},{8,5,20,203,2},{9,5,20,203,2},{11,5,20,203,6},{4,6,20,203,3},{5,6,20,203,3},{0,9,20,203,4},{8,9,20,203,2},{9,9,20,203,2},{12,9,20,203,5},{2,10,20,203,2},{4,1,21,203,4},{8,1,21,203,5},{3,2,21,203,4}, + {9,2,21,203,5},{2,3,21,203,4},{10,3,21,203,5},{1,5,21,203,4},{11,5,21,203,5},{8,8,21,203,7},{9,8,21,203,7},{0,9,21,203,0},{12,9,21,203,1},{1,10,21,203,0},{3,10,21,203,1},{4,10,21,203,2},{5,10,21,203,2},{6,10,21,203,0},{11,10,21,203,1},{1,5,22,203,0}, + {11,5,22,203,1},{0,9,22,203,0},{12,9,22,203,1},{1,10,22,203,0},{11,10,22,203,1},{1,5,23,203,4},{11,5,23,203,5},{2,7,23,95,2},{10,7,23,95,2},{0,9,23,203,4},{12,9,23,203,5},{1,10,23,203,0},{11,10,23,203,1},{1,5,24,203,4},{11,5,24,203,5},{2,7,24,95,2}, + {10,7,24,95,2},{0,9,24,203,4},{12,9,24,203,5},{1,10,24,203,0},{11,10,24,203,1},{3,2,25,203,4},{9,2,25,203,5},{2,3,25,203,4},{10,3,25,203,5},{1,5,25,203,0},{11,5,25,203,1},{0,9,25,203,0},{12,9,25,203,1},{1,10,25,203,0},{11,10,25,203,1},{2,4,26,203,7}, + {6,4,26,203,7},{10,4,26,203,7},{1,5,26,203,4},{11,5,26,203,5},{4,7,26,95,2},{8,7,26,95,2},{0,9,26,203,0},{12,9,26,203,1},{1,10,26,203,0},{4,10,26,203,0},{5,10,26,203,2},{6,10,26,203,2},{7,10,26,203,2},{8,10,26,203,1},{11,10,26,203,1},{1,5,27,203,4}, + {2,5,27,203,7},{3,5,27,203,3},{4,5,27,203,7},{5,5,27,203,7},{6,5,27,203,3},{7,5,27,203,7},{8,5,27,203,7},{9,5,27,203,7},{10,5,27,203,7},{11,5,27,203,7},{1,6,27,198,1},{11,6,27,198,1},{0,9,27,203,4},{12,9,27,203,5},{2,10,27,203,3},{3,10,27,203,3}, + {5,10,27,203,3},{6,10,27,203,3},{7,10,27,203,3},{9,10,27,203,3},{10,10,27,203,3},{0,9,28,203,7},{1,9,28,203,7},{2,9,28,203,3},{3,9,28,203,3},{4,9,28,203,7},{5,9,28,203,7},{6,9,28,203,3},{7,9,28,203,7},{8,9,28,203,7},{9,9,28,203,3},{10,9,28,203,3}, + {11,9,28,203,7},{12,9,28,203,5}, +}; +static const EndCityTemplates::Extra s_ship_extras[] = { + {6,8,0,EndCityTemplates::EXTRA_SKULL,5},{5,5,7,EndCityTemplates::EXTRA_CHEST_LOOT,0},{6,5,7,EndCityTemplates::EXTRA_ELYTRA,0},{7,5,7,EndCityTemplates::EXTRA_CHEST_LOOT,0},{6,4,8,EndCityTemplates::EXTRA_SENTRY,0},{6,7,25,EndCityTemplates::EXTRA_HEALING_POTIONS,0},{8,6,27,EndCityTemplates::EXTRA_SENTRY,0},{4,11,27,EndCityTemplates::EXTRA_SENTRY,0}, +}; + +static const EndCityTemplates::Block s_third_floor_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{7,0,0,0,0},{8,0,0,0,0},{9,0,0,0,0},{10,0,0,0,0},{11,0,0,0,0},{12,0,0,0,0},{13,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0}, + {2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{12,1,0,0,0},{13,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0}, + {4,2,0,0,0},{5,2,0,0,0},{6,2,0,0,0},{7,2,0,0,0},{8,2,0,0,0},{9,2,0,0,0},{10,2,0,0,0},{11,2,0,0,0},{12,2,0,0,0},{13,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0}, + {6,3,0,0,0},{7,3,0,0,0},{8,3,0,0,0},{9,3,0,0,0},{10,3,0,0,0},{11,3,0,0,0},{12,3,0,0,0},{13,3,0,0,0},{1,5,0,0,0},{2,5,0,0,0},{3,5,0,0,0},{4,5,0,0,0},{5,5,0,0,0},{6,5,0,0,0},{7,5,0,0,0},{8,5,0,0,0}, + {9,5,0,0,0},{10,5,0,0,0},{11,5,0,0,0},{12,5,0,0,0},{0,6,0,0,0},{1,6,0,0,0},{2,6,0,0,0},{3,6,0,0,0},{4,6,0,0,0},{5,6,0,0,0},{6,6,0,0,0},{7,6,0,0,0},{8,6,0,0,0},{9,6,0,0,0},{10,6,0,0,0},{11,6,0,0,0}, + {12,6,0,0,0},{13,6,0,0,0},{0,7,0,0,0},{1,7,0,0,0},{2,7,0,0,0},{3,7,0,0,0},{4,7,0,0,0},{5,7,0,0,0},{6,7,0,0,0},{7,7,0,0,0},{8,7,0,0,0},{9,7,0,0,0},{10,7,0,0,0},{11,7,0,0,0},{12,7,0,0,0},{13,7,0,0,0}, + {0,0,1,0,0},{1,0,1,0,0},{2,0,1,0,0},{3,0,1,0,0},{4,0,1,0,0},{5,0,1,0,0},{6,0,1,0,0},{7,0,1,0,0},{8,0,1,0,0},{9,0,1,0,0},{10,0,1,0,0},{11,0,1,0,0},{12,0,1,0,0},{13,0,1,0,0},{0,1,1,0,0},{1,1,1,0,0}, + {2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0},{7,1,1,0,0},{8,1,1,0,0},{9,1,1,0,0},{10,1,1,0,0},{11,1,1,0,0},{12,1,1,0,0},{13,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0}, + {4,2,1,0,0},{5,2,1,0,0},{6,2,1,0,0},{7,2,1,0,0},{8,2,1,0,0},{9,2,1,0,0},{10,2,1,0,0},{11,2,1,0,0},{12,2,1,0,0},{13,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,0,0},{3,3,1,0,0},{4,3,1,0,0},{5,3,1,0,0}, + {6,3,1,0,0},{7,3,1,0,0},{8,3,1,0,0},{9,3,1,0,0},{10,3,1,0,0},{11,3,1,0,0},{12,3,1,0,0},{13,3,1,0,0},{1,4,1,201,0},{2,4,1,201,0},{3,4,1,201,0},{4,4,1,201,0},{5,4,1,201,0},{6,4,1,201,0},{7,4,1,201,0},{8,4,1,201,0}, + {9,4,1,201,0},{10,4,1,201,0},{11,4,1,201,0},{12,4,1,201,0},{0,5,1,0,0},{1,5,1,202,0},{2,5,1,206,0},{3,5,1,206,0},{4,5,1,206,0},{5,5,1,206,0},{6,5,1,206,0},{7,5,1,206,0},{8,5,1,206,0},{9,5,1,206,0},{10,5,1,206,0},{11,5,1,206,0}, + {12,5,1,202,0},{13,5,1,0,0},{0,6,1,0,0},{1,6,1,202,0},{2,6,1,206,0},{4,6,1,206,0},{6,6,1,206,0},{7,6,1,206,0},{9,6,1,206,0},{11,6,1,206,0},{12,6,1,202,0},{13,6,1,0,0},{0,7,1,0,0},{1,7,1,202,0},{2,7,1,206,0},{4,7,1,206,0}, + {6,7,1,206,0},{7,7,1,206,0},{9,7,1,206,0},{11,7,1,206,0},{12,7,1,202,0},{13,7,1,0,0},{0,0,2,0,0},{1,0,2,0,0},{2,0,2,0,0},{3,0,2,0,0},{4,0,2,0,0},{5,0,2,0,0},{6,0,2,0,0},{7,0,2,0,0},{8,0,2,0,0},{9,0,2,0,0}, + {10,0,2,0,0},{11,0,2,0,0},{12,0,2,0,0},{13,0,2,0,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{5,1,2,0,0},{6,1,2,0,0},{7,1,2,0,0},{8,1,2,0,0},{9,1,2,0,0},{10,1,2,0,0},{11,1,2,0,0}, + {12,1,2,0,0},{13,1,2,0,0},{0,2,2,0,0},{1,2,2,0,0},{2,2,2,0,0},{3,2,2,0,0},{4,2,2,0,0},{5,2,2,0,0},{6,2,2,0,0},{7,2,2,0,0},{8,2,2,0,0},{9,2,2,0,0},{10,2,2,0,0},{11,2,2,0,0},{12,2,2,0,0},{13,2,2,0,0}, + {0,3,2,0,0},{1,3,2,0,0},{2,3,2,0,0},{3,3,2,0,0},{4,3,2,0,0},{5,3,2,0,0},{6,3,2,0,0},{7,3,2,0,0},{8,3,2,0,0},{9,3,2,0,0},{10,3,2,0,0},{11,3,2,0,0},{12,3,2,0,0},{13,3,2,0,0},{1,4,2,201,0},{2,4,2,201,0}, + {3,4,2,201,0},{4,4,2,201,0},{5,4,2,201,0},{6,4,2,201,0},{7,4,2,201,0},{8,4,2,201,0},{9,4,2,201,0},{10,4,2,201,0},{11,4,2,201,0},{12,4,2,201,0},{0,5,2,0,0},{1,5,2,206,0},{2,5,2,0,0},{3,5,2,0,0},{4,5,2,0,0},{5,5,2,0,0}, + {8,5,2,0,0},{9,5,2,0,0},{10,5,2,0,0},{11,5,2,0,0},{12,5,2,206,0},{13,5,2,0,0},{0,6,2,0,0},{1,6,2,206,0},{2,6,2,0,0},{3,6,2,0,0},{4,6,2,0,0},{5,6,2,0,0},{6,6,2,0,0},{7,6,2,0,0},{8,6,2,0,0},{9,6,2,0,0}, + {10,6,2,0,0},{11,6,2,0,0},{12,6,2,206,0},{13,6,2,0,0},{0,7,2,0,0},{1,7,2,206,0},{2,7,2,0,0},{3,7,2,0,0},{4,7,2,0,0},{5,7,2,0,0},{6,7,2,0,0},{7,7,2,0,0},{8,7,2,0,0},{9,7,2,0,0},{10,7,2,0,0},{11,7,2,0,0}, + {12,7,2,206,0},{13,7,2,0,0},{0,0,3,0,0},{1,0,3,0,0},{2,0,3,0,0},{3,0,3,0,0},{4,0,3,0,0},{5,0,3,0,0},{6,0,3,0,0},{7,0,3,0,0},{8,0,3,0,0},{9,0,3,0,0},{10,0,3,0,0},{11,0,3,0,0},{12,0,3,0,0},{13,0,3,0,0}, + {0,1,3,0,0},{1,1,3,0,0},{2,1,3,0,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0},{8,1,3,0,0},{9,1,3,0,0},{10,1,3,0,0},{11,1,3,0,0},{12,1,3,0,0},{13,1,3,0,0},{0,2,3,0,0},{1,2,3,0,0}, + {2,2,3,0,0},{3,2,3,0,0},{4,2,3,0,0},{5,2,3,0,0},{6,2,3,0,0},{7,2,3,0,0},{8,2,3,0,0},{9,2,3,0,0},{10,2,3,0,0},{11,2,3,0,0},{12,2,3,0,0},{13,2,3,0,0},{0,3,3,0,0},{1,3,3,0,0},{2,3,3,0,0},{3,3,3,0,0}, + {4,3,3,0,0},{5,3,3,0,0},{6,3,3,0,0},{7,3,3,0,0},{8,3,3,0,0},{9,3,3,0,0},{10,3,3,0,0},{11,3,3,0,0},{12,3,3,0,0},{13,3,3,0,0},{1,4,3,201,0},{2,4,3,201,0},{3,4,3,201,0},{4,4,3,201,0},{5,4,3,201,0},{6,4,3,201,0}, + {7,4,3,201,0},{8,4,3,201,0},{9,4,3,201,0},{10,4,3,201,0},{11,4,3,201,0},{12,4,3,201,0},{0,5,3,0,0},{1,5,3,206,0},{2,5,3,0,0},{3,5,3,0,0},{4,5,3,0,0},{5,5,3,0,0},{8,5,3,0,0},{9,5,3,0,0},{10,5,3,0,0},{11,5,3,0,0}, + {12,5,3,206,0},{13,5,3,0,0},{0,6,3,0,0},{2,6,3,0,0},{3,6,3,0,0},{4,6,3,0,0},{5,6,3,0,0},{6,6,3,0,0},{7,6,3,0,0},{8,6,3,0,0},{9,6,3,0,0},{10,6,3,0,0},{11,6,3,0,0},{13,6,3,0,0},{0,7,3,0,0},{2,7,3,0,0}, + {3,7,3,0,0},{4,7,3,0,0},{5,7,3,0,0},{6,7,3,0,0},{7,7,3,0,0},{8,7,3,0,0},{9,7,3,0,0},{10,7,3,0,0},{11,7,3,0,0},{13,7,3,0,0},{0,0,4,0,0},{1,0,4,0,0},{2,0,4,0,0},{3,0,4,0,0},{4,0,4,0,0},{5,0,4,0,0}, + {6,0,4,0,0},{7,0,4,0,0},{8,0,4,0,0},{9,0,4,0,0},{10,0,4,0,0},{11,0,4,0,0},{12,0,4,0,0},{13,0,4,0,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0},{7,1,4,0,0}, + {8,1,4,0,0},{9,1,4,0,0},{10,1,4,0,0},{11,1,4,0,0},{12,1,4,0,0},{13,1,4,0,0},{0,2,4,0,0},{1,2,4,0,0},{2,2,4,0,0},{3,2,4,0,0},{4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0},{7,2,4,0,0},{8,2,4,0,0},{9,2,4,0,0}, + {10,2,4,0,0},{11,2,4,0,0},{12,2,4,0,0},{13,2,4,0,0},{0,3,4,0,0},{1,3,4,0,0},{2,3,4,0,0},{3,3,4,0,0},{4,3,4,0,0},{5,3,4,0,0},{6,3,4,0,0},{7,3,4,0,0},{8,3,4,0,0},{9,3,4,0,0},{10,3,4,0,0},{11,3,4,0,0}, + {12,3,4,0,0},{13,3,4,0,0},{1,4,4,201,0},{2,4,4,201,0},{3,4,4,201,0},{4,4,4,201,0},{5,4,4,201,0},{6,4,4,201,0},{7,4,4,201,0},{8,4,4,201,0},{9,4,4,201,0},{10,4,4,201,0},{11,4,4,201,0},{12,4,4,201,0},{0,5,4,0,0},{1,5,4,206,0}, + {2,5,4,0,0},{3,5,4,0,0},{4,5,4,0,0},{5,5,4,0,0},{8,5,4,0,0},{9,5,4,0,0},{10,5,4,0,0},{11,5,4,0,0},{12,5,4,206,0},{13,5,4,0,0},{0,6,4,0,0},{1,6,4,206,0},{2,6,4,0,0},{3,6,4,0,0},{4,6,4,0,0},{5,6,4,0,0}, + {6,6,4,0,0},{7,6,4,0,0},{8,6,4,0,0},{9,6,4,0,0},{10,6,4,0,0},{11,6,4,0,0},{12,6,4,206,0},{13,6,4,0,0},{0,7,4,0,0},{1,7,4,206,0},{2,7,4,0,0},{3,7,4,0,0},{4,7,4,0,0},{5,7,4,0,0},{6,7,4,0,0},{7,7,4,0,0}, + {8,7,4,0,0},{9,7,4,0,0},{10,7,4,0,0},{11,7,4,0,0},{12,7,4,206,0},{13,7,4,0,0},{0,0,5,0,0},{1,0,5,0,0},{2,0,5,0,0},{3,0,5,0,0},{4,0,5,0,0},{5,0,5,0,0},{6,0,5,0,0},{7,0,5,0,0},{8,0,5,0,0},{9,0,5,0,0}, + {10,0,5,0,0},{11,0,5,0,0},{12,0,5,0,0},{13,0,5,0,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,0,0},{3,1,5,0,0},{4,1,5,0,0},{5,1,5,0,0},{6,1,5,0,0},{7,1,5,0,0},{8,1,5,0,0},{9,1,5,0,0},{10,1,5,0,0},{11,1,5,0,0}, + {12,1,5,0,0},{13,1,5,0,0},{0,2,5,0,0},{1,2,5,0,0},{2,2,5,0,0},{3,2,5,0,0},{4,2,5,0,0},{5,2,5,0,0},{6,2,5,0,0},{7,2,5,0,0},{8,2,5,0,0},{9,2,5,0,0},{10,2,5,0,0},{11,2,5,0,0},{12,2,5,0,0},{13,2,5,0,0}, + {0,3,5,0,0},{1,3,5,0,0},{2,3,5,0,0},{3,3,5,0,0},{4,3,5,0,0},{5,3,5,0,0},{6,3,5,0,0},{7,3,5,0,0},{8,3,5,0,0},{9,3,5,0,0},{10,3,5,0,0},{11,3,5,0,0},{12,3,5,0,0},{13,3,5,0,0},{1,4,5,201,0},{2,4,5,201,0}, + {3,4,5,201,0},{4,4,5,201,0},{5,4,5,201,0},{6,4,5,201,0},{7,4,5,201,0},{8,4,5,201,0},{9,4,5,201,0},{10,4,5,201,0},{11,4,5,201,0},{12,4,5,201,0},{0,5,5,0,0},{1,5,5,206,0},{2,5,5,0,0},{3,5,5,0,0},{4,5,5,0,0},{5,5,5,0,0}, + {8,5,5,0,0},{9,5,5,0,0},{10,5,5,0,0},{11,5,5,0,0},{12,5,5,206,0},{13,5,5,0,0},{0,6,5,0,0},{2,6,5,0,0},{3,6,5,0,0},{4,6,5,0,0},{5,6,5,0,0},{6,6,5,0,0},{7,6,5,0,0},{8,6,5,0,0},{9,6,5,0,0},{10,6,5,0,0}, + {11,6,5,0,0},{13,6,5,0,0},{0,7,5,0,0},{2,7,5,0,0},{3,7,5,0,0},{4,7,5,0,0},{5,7,5,0,0},{6,7,5,0,0},{7,7,5,0,0},{8,7,5,0,0},{9,7,5,0,0},{10,7,5,0,0},{11,7,5,0,0},{13,7,5,0,0},{0,0,6,0,0},{1,0,6,0,0}, + {2,0,6,0,0},{3,0,6,0,0},{4,0,6,0,0},{5,0,6,0,0},{6,0,6,0,0},{7,0,6,0,0},{8,0,6,0,0},{9,0,6,0,0},{10,0,6,0,0},{11,0,6,0,0},{12,0,6,0,0},{13,0,6,0,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,0,0},{3,1,6,0,0}, + {4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{7,1,6,0,0},{8,1,6,0,0},{9,1,6,0,0},{10,1,6,0,0},{11,1,6,0,0},{12,1,6,0,0},{13,1,6,0,0},{0,2,6,0,0},{1,2,6,0,0},{2,2,6,0,0},{3,2,6,0,0},{4,2,6,0,0},{5,2,6,0,0}, + {6,2,6,0,0},{7,2,6,0,0},{8,2,6,0,0},{9,2,6,0,0},{10,2,6,0,0},{11,2,6,0,0},{12,2,6,0,0},{13,2,6,0,0},{0,3,6,0,0},{1,3,6,0,0},{2,3,6,0,0},{3,3,6,0,0},{4,3,6,0,0},{5,3,6,0,0},{6,3,6,0,0},{7,3,6,0,0}, + {8,3,6,0,0},{9,3,6,0,0},{10,3,6,0,0},{11,3,6,0,0},{12,3,6,0,0},{13,3,6,0,0},{1,4,6,201,0},{2,4,6,201,0},{3,4,6,201,0},{4,4,6,201,0},{5,4,6,201,0},{6,4,6,201,0},{7,4,6,201,0},{8,4,6,201,0},{9,4,6,201,0},{10,4,6,201,0}, + {11,4,6,201,0},{12,4,6,201,0},{0,5,6,0,0},{1,5,6,206,0},{2,5,6,0,0},{3,5,6,0,0},{4,5,6,0,0},{5,5,6,0,0},{6,5,6,202,0},{7,5,6,202,0},{8,5,6,0,0},{9,5,6,0,0},{10,5,6,0,0},{11,5,6,0,0},{12,5,6,206,0},{13,5,6,0,0}, + {0,6,6,0,0},{1,6,6,206,0},{2,6,6,0,0},{3,6,6,0,0},{4,6,6,0,0},{5,6,6,0,0},{6,6,6,202,0},{7,6,6,202,0},{8,6,6,0,0},{9,6,6,0,0},{10,6,6,0,0},{11,6,6,0,0},{12,6,6,206,0},{13,6,6,0,0},{0,7,6,0,0},{1,7,6,206,0}, + {2,7,6,0,0},{3,7,6,0,0},{4,7,6,0,0},{5,7,6,0,0},{6,7,6,202,0},{7,7,6,202,0},{8,7,6,0,0},{9,7,6,0,0},{10,7,6,0,0},{11,7,6,0,0},{12,7,6,206,0},{13,7,6,0,0},{0,0,7,0,0},{1,0,7,0,0},{2,0,7,0,0},{3,0,7,0,0}, + {4,0,7,0,0},{5,0,7,0,0},{6,0,7,0,0},{7,0,7,0,0},{8,0,7,0,0},{9,0,7,0,0},{10,0,7,0,0},{11,0,7,0,0},{12,0,7,0,0},{13,0,7,0,0},{0,1,7,0,0},{1,1,7,0,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0}, + {6,1,7,0,0},{7,1,7,0,0},{8,1,7,0,0},{9,1,7,0,0},{10,1,7,0,0},{11,1,7,0,0},{12,1,7,0,0},{13,1,7,0,0},{0,2,7,0,0},{1,2,7,0,0},{2,2,7,0,0},{3,2,7,0,0},{4,2,7,0,0},{5,2,7,0,0},{6,2,7,0,0},{7,2,7,0,0}, + {8,2,7,0,0},{9,2,7,0,0},{10,2,7,0,0},{11,2,7,0,0},{12,2,7,0,0},{13,2,7,0,0},{0,3,7,0,0},{1,3,7,0,0},{2,3,7,0,0},{3,3,7,0,0},{4,3,7,0,0},{5,3,7,0,0},{6,3,7,0,0},{7,3,7,0,0},{8,3,7,0,0},{9,3,7,0,0}, + {10,3,7,0,0},{11,3,7,0,0},{12,3,7,0,0},{13,3,7,0,0},{1,4,7,201,0},{2,4,7,201,0},{3,4,7,201,0},{4,4,7,201,0},{5,4,7,201,0},{6,4,7,201,0},{7,4,7,201,0},{8,4,7,201,0},{9,4,7,201,0},{10,4,7,201,0},{11,4,7,201,0},{12,4,7,201,0}, + {0,5,7,0,0},{1,5,7,206,0},{2,5,7,0,0},{3,5,7,0,0},{4,5,7,0,0},{5,5,7,0,0},{8,5,7,0,0},{9,5,7,0,0},{10,5,7,0,0},{11,5,7,0,0},{12,5,7,206,0},{13,5,7,0,0},{0,6,7,0,0},{1,6,7,206,0},{2,6,7,0,0},{3,6,7,0,0}, + {4,6,7,0,0},{5,6,7,0,0},{6,6,7,0,0},{7,6,7,0,0},{8,6,7,0,0},{9,6,7,0,0},{10,6,7,0,0},{11,6,7,0,0},{12,6,7,206,0},{13,6,7,0,0},{0,7,7,0,0},{1,7,7,206,0},{2,7,7,0,0},{3,7,7,0,0},{4,7,7,0,0},{5,7,7,0,0}, + {6,7,7,0,0},{7,7,7,0,0},{8,7,7,0,0},{9,7,7,0,0},{10,7,7,0,0},{11,7,7,0,0},{12,7,7,206,0},{13,7,7,0,0},{0,0,8,0,0},{1,0,8,0,0},{2,0,8,0,0},{3,0,8,0,0},{4,0,8,0,0},{5,0,8,0,0},{6,0,8,0,0},{7,0,8,0,0}, + {8,0,8,0,0},{9,0,8,0,0},{10,0,8,0,0},{11,0,8,0,0},{12,0,8,0,0},{13,0,8,0,0},{0,1,8,0,0},{1,1,8,0,0},{2,1,8,0,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,0,0},{7,1,8,0,0},{8,1,8,0,0},{9,1,8,0,0}, + {10,1,8,0,0},{11,1,8,0,0},{12,1,8,0,0},{13,1,8,0,0},{0,2,8,0,0},{1,2,8,0,0},{2,2,8,0,0},{3,2,8,0,0},{4,2,8,0,0},{5,2,8,0,0},{6,2,8,0,0},{7,2,8,0,0},{8,2,8,0,0},{9,2,8,0,0},{10,2,8,0,0},{11,2,8,0,0}, + {12,2,8,0,0},{13,2,8,0,0},{0,3,8,0,0},{1,3,8,0,0},{2,3,8,0,0},{3,3,8,0,0},{4,3,8,0,0},{5,3,8,0,0},{6,3,8,0,0},{7,3,8,0,0},{8,3,8,0,0},{9,3,8,0,0},{10,3,8,0,0},{11,3,8,0,0},{12,3,8,0,0},{13,3,8,0,0}, + {1,4,8,201,0},{2,4,8,201,0},{3,4,8,201,0},{4,4,8,201,0},{5,4,8,201,0},{6,4,8,201,0},{7,4,8,201,0},{8,4,8,201,0},{9,4,8,201,0},{10,4,8,201,0},{11,4,8,201,0},{12,4,8,201,0},{0,5,8,0,0},{1,5,8,206,0},{2,5,8,0,0},{3,5,8,0,0}, + {4,5,8,0,0},{5,5,8,0,0},{8,5,8,0,0},{9,5,8,0,0},{10,5,8,0,0},{11,5,8,0,0},{12,5,8,206,0},{13,5,8,0,0},{0,6,8,0,0},{2,6,8,0,0},{3,6,8,0,0},{4,6,8,0,0},{5,6,8,0,0},{6,6,8,0,0},{7,6,8,0,0},{8,6,8,0,0}, + {9,6,8,0,0},{10,6,8,0,0},{11,6,8,0,0},{13,6,8,0,0},{0,7,8,0,0},{2,7,8,0,0},{3,7,8,0,0},{4,7,8,0,0},{5,7,8,0,0},{6,7,8,0,0},{7,7,8,0,0},{8,7,8,0,0},{9,7,8,0,0},{10,7,8,0,0},{11,7,8,0,0},{13,7,8,0,0}, + {0,0,9,0,0},{1,0,9,0,0},{2,0,9,0,0},{3,0,9,0,0},{4,0,9,0,0},{5,0,9,0,0},{6,0,9,0,0},{7,0,9,0,0},{8,0,9,0,0},{9,0,9,0,0},{10,0,9,0,0},{11,0,9,0,0},{12,0,9,0,0},{13,0,9,0,0},{0,1,9,0,0},{1,1,9,0,0}, + {2,1,9,0,0},{3,1,9,0,0},{4,1,9,0,0},{5,1,9,0,0},{6,1,9,0,0},{7,1,9,0,0},{8,1,9,0,0},{9,1,9,0,0},{10,1,9,0,0},{11,1,9,0,0},{12,1,9,0,0},{13,1,9,0,0},{0,2,9,0,0},{1,2,9,0,0},{2,2,9,0,0},{3,2,9,0,0}, + {4,2,9,0,0},{5,2,9,0,0},{6,2,9,0,0},{7,2,9,0,0},{8,2,9,0,0},{9,2,9,0,0},{10,2,9,0,0},{11,2,9,0,0},{12,2,9,0,0},{13,2,9,0,0},{0,3,9,0,0},{1,3,9,0,0},{2,3,9,0,0},{3,3,9,0,0},{4,3,9,0,0},{5,3,9,0,0}, + {6,3,9,0,0},{7,3,9,0,0},{8,3,9,0,0},{9,3,9,0,0},{10,3,9,0,0},{11,3,9,0,0},{12,3,9,0,0},{13,3,9,0,0},{1,4,9,201,0},{2,4,9,201,0},{3,4,9,201,0},{4,4,9,201,0},{5,4,9,201,0},{6,4,9,201,0},{7,4,9,201,0},{8,4,9,201,0}, + {9,4,9,201,0},{10,4,9,201,0},{11,4,9,201,0},{12,4,9,201,0},{0,5,9,0,0},{1,5,9,206,0},{2,5,9,0,0},{3,5,9,0,0},{4,5,9,0,0},{5,5,9,0,0},{6,5,9,0,0},{7,5,9,0,0},{8,5,9,0,0},{9,5,9,0,0},{10,5,9,0,0},{11,5,9,0,0}, + {12,5,9,206,0},{13,5,9,0,0},{0,6,9,0,0},{1,6,9,206,0},{2,6,9,0,0},{3,6,9,0,0},{4,6,9,0,0},{5,6,9,0,0},{6,6,9,0,0},{7,6,9,0,0},{8,6,9,0,0},{9,6,9,0,0},{10,6,9,0,0},{11,6,9,0,0},{12,6,9,206,0},{13,6,9,0,0}, + {0,7,9,0,0},{1,7,9,206,0},{2,7,9,0,0},{3,7,9,0,0},{4,7,9,0,0},{5,7,9,0,0},{6,7,9,0,0},{7,7,9,0,0},{8,7,9,0,0},{9,7,9,0,0},{10,7,9,0,0},{11,7,9,0,0},{12,7,9,206,0},{13,7,9,0,0},{0,0,10,0,0},{1,0,10,0,0}, + {2,0,10,0,0},{3,0,10,0,0},{4,0,10,0,0},{5,0,10,0,0},{6,0,10,0,0},{7,0,10,0,0},{8,0,10,0,0},{9,0,10,0,0},{10,0,10,0,0},{11,0,10,0,0},{12,0,10,0,0},{13,0,10,0,0},{0,1,10,0,0},{1,1,10,0,0},{2,1,10,0,0},{4,1,10,201,0}, + {6,1,10,0,0},{7,1,10,0,0},{8,1,10,0,0},{9,1,10,0,0},{10,1,10,0,0},{11,1,10,0,0},{12,1,10,0,0},{13,1,10,0,0},{0,2,10,0,0},{1,2,10,0,0},{2,2,10,0,0},{3,2,10,0,0},{4,2,10,0,0},{6,2,10,201,0},{8,2,10,0,0},{9,2,10,0,0}, + {10,2,10,0,0},{11,2,10,0,0},{12,2,10,0,0},{13,2,10,0,0},{0,3,10,0,0},{1,3,10,0,0},{2,3,10,0,0},{3,3,10,0,0},{4,3,10,0,0},{5,3,10,0,0},{6,3,10,0,0},{8,3,10,201,0},{10,3,10,0,0},{11,3,10,0,0},{12,3,10,0,0},{13,3,10,0,0}, + {1,4,10,201,0},{2,4,10,201,0},{3,4,10,0,0},{4,4,10,0,0},{5,4,10,0,0},{6,4,10,0,0},{7,4,10,0,0},{8,4,10,0,0},{10,4,10,201,0},{11,4,10,201,0},{12,4,10,201,0},{0,5,10,0,0},{1,5,10,206,0},{2,5,10,0,0},{3,5,10,0,0},{4,5,10,0,0}, + {5,5,10,0,0},{6,5,10,0,0},{7,5,10,0,0},{8,5,10,0,0},{9,5,10,0,0},{10,5,10,0,0},{11,5,10,0,0},{12,5,10,206,0},{13,5,10,0,0},{0,6,10,0,0},{2,6,10,0,0},{3,6,10,0,0},{4,6,10,0,0},{5,6,10,0,0},{6,6,10,0,0},{7,6,10,0,0}, + {8,6,10,0,0},{9,6,10,0,0},{10,6,10,0,0},{11,6,10,0,0},{13,6,10,0,0},{0,7,10,0,0},{2,7,10,0,0},{3,7,10,0,0},{4,7,10,0,0},{5,7,10,0,0},{6,7,10,0,0},{7,7,10,0,0},{8,7,10,0,0},{9,7,10,0,0},{10,7,10,0,0},{11,7,10,0,0}, + {13,7,10,0,0},{0,0,11,0,0},{1,0,11,0,0},{2,0,11,0,0},{3,0,11,0,0},{4,0,11,0,0},{5,0,11,0,0},{6,0,11,0,0},{7,0,11,0,0},{8,0,11,0,0},{9,0,11,0,0},{10,0,11,0,0},{11,0,11,0,0},{12,0,11,0,0},{13,0,11,0,0},{0,1,11,0,0}, + {1,1,11,0,0},{2,1,11,0,0},{3,1,11,0,0},{4,1,11,0,0},{5,1,11,0,0},{6,1,11,0,0},{7,1,11,0,0},{8,1,11,0,0},{9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0},{12,1,11,0,0},{13,1,11,0,0},{0,2,11,0,0},{1,2,11,0,0},{2,2,11,0,0}, + {3,2,11,0,0},{4,2,11,0,0},{5,2,11,0,0},{6,2,11,0,0},{7,2,11,0,0},{8,2,11,0,0},{9,2,11,206,0},{10,2,11,0,0},{11,2,11,0,0},{12,2,11,0,0},{13,2,11,0,0},{0,3,11,0,0},{1,3,11,0,0},{2,3,11,0,0},{3,3,11,0,0},{4,3,11,0,0}, + {5,3,11,0,0},{6,3,11,0,0},{7,3,11,0,0},{8,3,11,0,0},{9,3,11,206,0},{10,3,11,0,0},{11,3,11,0,0},{12,3,11,0,0},{13,3,11,0,0},{1,4,11,201,0},{2,4,11,201,0},{3,4,11,201,0},{4,4,11,201,0},{5,4,11,201,0},{6,4,11,201,0},{7,4,11,201,0}, + {8,4,11,201,0},{9,4,11,201,0},{10,4,11,201,0},{11,4,11,201,0},{12,4,11,201,0},{0,5,11,0,0},{1,5,11,206,0},{2,5,11,0,0},{3,5,11,0,0},{4,5,11,0,0},{5,5,11,0,0},{6,5,11,0,0},{7,5,11,0,0},{8,5,11,0,0},{9,5,11,0,0},{10,5,11,0,0}, + {11,5,11,0,0},{12,5,11,206,0},{13,5,11,0,0},{0,6,11,0,0},{1,6,11,206,0},{2,6,11,0,0},{3,6,11,0,0},{4,6,11,0,0},{5,6,11,0,0},{6,6,11,0,0},{7,6,11,0,0},{8,6,11,0,0},{9,6,11,0,0},{10,6,11,0,0},{11,6,11,0,0},{12,6,11,206,0}, + {13,6,11,0,0},{0,7,11,0,0},{1,7,11,206,0},{2,7,11,0,0},{3,7,11,0,0},{4,7,11,0,0},{5,7,11,0,0},{6,7,11,0,0},{7,7,11,0,0},{8,7,11,0,0},{9,7,11,0,0},{10,7,11,0,0},{11,7,11,0,0},{12,7,11,206,0},{13,7,11,0,0},{0,0,12,0,0}, + {1,0,12,0,0},{2,0,12,0,0},{3,0,12,0,0},{4,0,12,0,0},{5,0,12,0,0},{6,0,12,0,0},{7,0,12,0,0},{8,0,12,0,0},{9,0,12,0,0},{10,0,12,0,0},{11,0,12,0,0},{12,0,12,0,0},{13,0,12,0,0},{0,1,12,0,0},{1,1,12,0,0},{2,1,12,0,0}, + {3,1,12,0,0},{4,1,12,0,0},{5,1,12,0,0},{6,1,12,0,0},{7,1,12,0,0},{8,1,12,0,0},{9,1,12,0,0},{10,1,12,0,0},{11,1,12,0,0},{12,1,12,0,0},{13,1,12,0,0},{0,2,12,0,0},{1,2,12,0,0},{2,2,12,0,0},{3,2,12,0,0},{4,2,12,0,0}, + {5,2,12,0,0},{6,2,12,0,0},{7,2,12,0,0},{8,2,12,0,0},{9,2,12,0,0},{10,2,12,0,0},{11,2,12,0,0},{12,2,12,0,0},{13,2,12,0,0},{0,3,12,0,0},{1,3,12,0,0},{2,3,12,0,0},{3,3,12,0,0},{4,3,12,0,0},{5,3,12,0,0},{6,3,12,0,0}, + {7,3,12,0,0},{8,3,12,0,0},{9,3,12,0,0},{10,3,12,0,0},{11,3,12,0,0},{12,3,12,0,0},{13,3,12,0,0},{1,4,12,201,0},{2,4,12,201,0},{3,4,12,201,0},{4,4,12,201,0},{5,4,12,201,0},{6,4,12,201,0},{7,4,12,201,0},{8,4,12,201,0},{9,4,12,201,0}, + {10,4,12,201,0},{11,4,12,201,0},{12,4,12,201,0},{0,5,12,0,0},{1,5,12,202,0},{2,5,12,206,0},{3,5,12,206,0},{4,5,12,206,0},{5,5,12,206,0},{6,5,12,206,0},{7,5,12,206,0},{8,5,12,206,0},{9,5,12,206,0},{10,5,12,206,0},{11,5,12,206,0},{12,5,12,202,0}, + {13,5,12,0,0},{0,6,12,0,0},{1,6,12,202,0},{2,6,12,206,0},{4,6,12,206,0},{6,6,12,206,0},{7,6,12,206,0},{9,6,12,206,0},{11,6,12,206,0},{12,6,12,202,0},{13,6,12,0,0},{0,7,12,0,0},{1,7,12,202,0},{2,7,12,206,0},{4,7,12,206,0},{6,7,12,206,0}, + {7,7,12,206,0},{9,7,12,206,0},{11,7,12,206,0},{12,7,12,202,0},{13,7,12,0,0},{0,0,13,0,0},{1,0,13,0,0},{2,0,13,0,0},{3,0,13,0,0},{4,0,13,0,0},{5,0,13,0,0},{6,0,13,0,0},{7,0,13,0,0},{8,0,13,0,0},{9,0,13,0,0},{10,0,13,0,0}, + {11,0,13,0,0},{12,0,13,0,0},{13,0,13,0,0},{0,1,13,0,0},{1,1,13,0,0},{2,1,13,0,0},{3,1,13,0,0},{4,1,13,0,0},{5,1,13,0,0},{6,1,13,0,0},{7,1,13,0,0},{8,1,13,0,0},{9,1,13,0,0},{10,1,13,0,0},{11,1,13,0,0},{12,1,13,0,0}, + {13,1,13,0,0},{0,2,13,0,0},{1,2,13,0,0},{2,2,13,0,0},{3,2,13,0,0},{4,2,13,0,0},{5,2,13,0,0},{6,2,13,0,0},{7,2,13,0,0},{8,2,13,0,0},{9,2,13,0,0},{10,2,13,0,0},{11,2,13,0,0},{12,2,13,0,0},{13,2,13,0,0},{0,3,13,0,0}, + {1,3,13,0,0},{2,3,13,0,0},{3,3,13,0,0},{4,3,13,0,0},{5,3,13,0,0},{6,3,13,0,0},{7,3,13,0,0},{8,3,13,0,0},{9,3,13,0,0},{10,3,13,0,0},{11,3,13,0,0},{12,3,13,0,0},{13,3,13,0,0},{1,5,13,0,0},{2,5,13,0,0},{3,5,13,0,0}, + {4,5,13,0,0},{5,5,13,0,0},{6,5,13,0,0},{7,5,13,0,0},{8,5,13,0,0},{9,5,13,0,0},{10,5,13,0,0},{11,5,13,0,0},{12,5,13,0,0},{0,6,13,0,0},{1,6,13,0,0},{2,6,13,0,0},{3,6,13,0,0},{4,6,13,0,0},{5,6,13,0,0},{6,6,13,0,0}, + {7,6,13,0,0},{8,6,13,0,0},{9,6,13,0,0},{10,6,13,0,0},{11,6,13,0,0},{12,6,13,0,0},{13,6,13,0,0},{0,7,13,0,0},{1,7,13,0,0},{2,7,13,0,0},{3,7,13,0,0},{4,7,13,0,0},{5,7,13,0,0},{6,7,13,0,0},{7,7,13,0,0},{8,7,13,0,0}, + {9,7,13,0,0},{10,7,13,0,0},{11,7,13,0,0},{12,7,13,0,0},{13,7,13,0,0},{0,4,0,203,4},{1,4,0,203,6},{2,4,0,203,2},{3,4,0,203,2},{4,4,0,203,6},{5,4,0,203,6},{6,4,0,203,2},{7,4,0,203,2},{8,4,0,203,6},{9,4,0,203,6},{10,4,0,203,2}, + {11,4,0,203,2},{12,4,0,203,6},{13,4,0,203,6},{0,5,0,198,1},{13,5,0,198,1},{0,4,1,203,4},{13,4,1,203,5},{3,6,1,95,2},{5,6,1,95,2},{8,6,1,95,2},{10,6,1,95,2},{3,7,1,95,2},{5,7,1,95,2},{8,7,1,95,2},{10,7,1,95,2},{0,4,2,203,0}, + {13,4,2,203,1},{6,5,2,203,0},{7,5,2,203,1},{0,4,3,203,0},{13,4,3,203,1},{6,5,3,203,0},{7,5,3,203,1},{1,6,3,95,2},{12,6,3,95,2},{1,7,3,95,2},{12,7,3,95,2},{0,4,4,203,4},{13,4,4,203,5},{6,5,4,203,0},{7,5,4,203,1},{0,4,5,203,4}, + {13,4,5,203,5},{6,5,5,203,0},{7,5,5,203,1},{1,6,5,95,2},{12,6,5,95,2},{1,7,5,95,2},{12,7,5,95,2},{0,4,6,203,0},{13,4,6,203,1},{0,4,7,203,0},{13,4,7,203,1},{6,5,7,203,0},{7,5,7,203,1},{0,4,8,203,4},{13,4,8,203,5},{6,5,8,203,3}, + {7,5,8,203,3},{1,6,8,95,2},{12,6,8,95,2},{1,7,8,95,2},{12,7,8,95,2},{0,4,9,203,4},{13,4,9,203,5},{3,1,10,205,0},{5,1,10,205,8},{5,2,10,205,0},{7,2,10,205,8},{7,3,10,205,0},{9,3,10,205,8},{0,4,10,203,0},{9,4,10,205,0},{13,4,10,203,1}, + {1,6,10,95,2},{12,6,10,95,2},{1,7,10,95,2},{12,7,10,95,2},{0,4,11,203,0},{13,4,11,203,1},{0,4,12,203,4},{13,4,12,203,5},{3,6,12,95,2},{5,6,12,95,2},{8,6,12,95,2},{10,6,12,95,2},{3,7,12,95,2},{5,7,12,95,2},{8,7,12,95,2},{10,7,12,95,2}, + {0,4,13,203,7},{1,4,13,203,7},{2,4,13,203,3},{3,4,13,203,3},{4,4,13,203,7},{5,4,13,203,7},{6,4,13,203,3},{7,4,13,203,3},{8,4,13,203,7},{9,4,13,203,7},{10,4,13,203,3},{11,4,13,203,3},{12,4,13,203,7},{13,4,13,203,5},{0,5,13,198,1},{13,5,13,198,1}, +}; + +static const EndCityTemplates::Block s_third_floor_b_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{7,0,0,0,0},{8,0,0,0,0},{9,0,0,0,0},{10,0,0,0,0},{11,0,0,0,0},{12,0,0,0,0},{13,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0}, + {2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{12,1,0,0,0},{13,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0}, + {4,2,0,0,0},{5,2,0,0,0},{6,2,0,0,0},{7,2,0,0,0},{8,2,0,0,0},{9,2,0,0,0},{10,2,0,0,0},{11,2,0,0,0},{12,2,0,0,0},{13,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0}, + {6,3,0,0,0},{7,3,0,0,0},{8,3,0,0,0},{9,3,0,0,0},{10,3,0,0,0},{11,3,0,0,0},{12,3,0,0,0},{13,3,0,0,0},{1,5,0,0,0},{2,5,0,0,0},{3,5,0,0,0},{4,5,0,0,0},{5,5,0,0,0},{6,5,0,0,0},{7,5,0,0,0},{8,5,0,0,0}, + {9,5,0,0,0},{10,5,0,0,0},{11,5,0,0,0},{12,5,0,0,0},{0,6,0,0,0},{1,6,0,0,0},{2,6,0,0,0},{3,6,0,0,0},{4,6,0,0,0},{5,6,0,0,0},{6,6,0,0,0},{7,6,0,0,0},{8,6,0,0,0},{9,6,0,0,0},{10,6,0,0,0},{11,6,0,0,0}, + {12,6,0,0,0},{13,6,0,0,0},{0,7,0,0,0},{1,7,0,0,0},{2,7,0,0,0},{3,7,0,0,0},{4,7,0,0,0},{5,7,0,0,0},{6,7,0,0,0},{7,7,0,0,0},{8,7,0,0,0},{9,7,0,0,0},{10,7,0,0,0},{11,7,0,0,0},{12,7,0,0,0},{13,7,0,0,0}, + {0,0,1,0,0},{1,0,1,0,0},{2,0,1,0,0},{3,0,1,0,0},{4,0,1,0,0},{5,0,1,0,0},{6,0,1,0,0},{7,0,1,0,0},{8,0,1,0,0},{9,0,1,0,0},{10,0,1,0,0},{11,0,1,0,0},{12,0,1,0,0},{13,0,1,0,0},{0,1,1,0,0},{1,1,1,0,0}, + {2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0},{7,1,1,0,0},{8,1,1,0,0},{9,1,1,0,0},{10,1,1,0,0},{11,1,1,0,0},{12,1,1,0,0},{13,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0}, + {4,2,1,0,0},{5,2,1,0,0},{6,2,1,0,0},{7,2,1,0,0},{8,2,1,0,0},{9,2,1,0,0},{10,2,1,0,0},{11,2,1,0,0},{12,2,1,0,0},{13,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,0,0},{3,3,1,0,0},{4,3,1,0,0},{5,3,1,0,0}, + {6,3,1,0,0},{7,3,1,0,0},{8,3,1,0,0},{9,3,1,0,0},{10,3,1,0,0},{11,3,1,0,0},{12,3,1,0,0},{13,3,1,0,0},{1,4,1,201,0},{2,4,1,201,0},{3,4,1,201,0},{4,4,1,201,0},{5,4,1,201,0},{6,4,1,201,0},{7,4,1,201,0},{8,4,1,201,0}, + {9,4,1,201,0},{10,4,1,201,0},{11,4,1,201,0},{12,4,1,201,0},{0,5,1,0,0},{1,5,1,202,0},{2,5,1,206,0},{3,5,1,206,0},{4,5,1,206,0},{5,5,1,206,0},{6,5,1,206,0},{7,5,1,206,0},{8,5,1,206,0},{9,5,1,206,0},{10,5,1,206,0},{11,5,1,206,0}, + {12,5,1,202,0},{13,5,1,0,0},{0,6,1,0,0},{1,6,1,202,0},{2,6,1,206,0},{4,6,1,206,0},{6,6,1,206,0},{7,6,1,206,0},{9,6,1,206,0},{11,6,1,206,0},{12,6,1,202,0},{13,6,1,0,0},{0,7,1,0,0},{1,7,1,202,0},{2,7,1,206,0},{4,7,1,206,0}, + {6,7,1,206,0},{7,7,1,206,0},{9,7,1,206,0},{11,7,1,206,0},{12,7,1,202,0},{13,7,1,0,0},{0,0,2,0,0},{1,0,2,0,0},{2,0,2,0,0},{3,0,2,0,0},{4,0,2,0,0},{5,0,2,0,0},{6,0,2,0,0},{7,0,2,0,0},{8,0,2,0,0},{9,0,2,0,0}, + {10,0,2,0,0},{11,0,2,0,0},{12,0,2,0,0},{13,0,2,0,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{5,1,2,0,0},{6,1,2,0,0},{7,1,2,0,0},{8,1,2,0,0},{9,1,2,0,0},{10,1,2,0,0},{11,1,2,0,0}, + {12,1,2,0,0},{13,1,2,0,0},{0,2,2,0,0},{1,2,2,0,0},{2,2,2,0,0},{3,2,2,0,0},{4,2,2,0,0},{5,2,2,0,0},{6,2,2,0,0},{7,2,2,0,0},{8,2,2,0,0},{9,2,2,0,0},{10,2,2,0,0},{11,2,2,0,0},{12,2,2,0,0},{13,2,2,0,0}, + {0,3,2,0,0},{1,3,2,0,0},{2,3,2,0,0},{3,3,2,0,0},{4,3,2,0,0},{5,3,2,0,0},{6,3,2,0,0},{7,3,2,0,0},{8,3,2,0,0},{9,3,2,0,0},{10,3,2,0,0},{11,3,2,0,0},{12,3,2,0,0},{13,3,2,0,0},{1,4,2,201,0},{2,4,2,201,0}, + {3,4,2,201,0},{4,4,2,201,0},{5,4,2,201,0},{6,4,2,201,0},{7,4,2,201,0},{8,4,2,201,0},{9,4,2,201,0},{10,4,2,201,0},{11,4,2,201,0},{12,4,2,201,0},{0,5,2,0,0},{1,5,2,206,0},{2,5,2,0,0},{3,5,2,0,0},{5,5,2,0,0},{6,5,2,0,0}, + {7,5,2,0,0},{8,5,2,0,0},{10,5,2,0,0},{11,5,2,0,0},{12,5,2,206,0},{13,5,2,0,0},{0,6,2,0,0},{1,6,2,206,0},{2,6,2,0,0},{3,6,2,0,0},{4,6,2,0,0},{5,6,2,0,0},{6,6,2,0,0},{7,6,2,0,0},{8,6,2,0,0},{9,6,2,0,0}, + {10,6,2,0,0},{11,6,2,0,0},{12,6,2,206,0},{13,6,2,0,0},{0,7,2,0,0},{1,7,2,206,0},{2,7,2,0,0},{3,7,2,0,0},{5,7,2,0,0},{6,7,2,0,0},{7,7,2,0,0},{8,7,2,0,0},{10,7,2,0,0},{11,7,2,0,0},{12,7,2,206,0},{13,7,2,0,0}, + {0,0,3,0,0},{1,0,3,0,0},{2,0,3,0,0},{3,0,3,0,0},{4,0,3,0,0},{5,0,3,0,0},{6,0,3,0,0},{7,0,3,0,0},{8,0,3,0,0},{9,0,3,0,0},{10,0,3,0,0},{11,0,3,0,0},{12,0,3,0,0},{13,0,3,0,0},{0,1,3,0,0},{1,1,3,0,0}, + {2,1,3,0,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0},{8,1,3,0,0},{9,1,3,0,0},{10,1,3,0,0},{11,1,3,0,0},{12,1,3,0,0},{13,1,3,0,0},{0,2,3,0,0},{1,2,3,0,0},{2,2,3,0,0},{3,2,3,0,0}, + {4,2,3,0,0},{5,2,3,0,0},{6,2,3,0,0},{7,2,3,0,0},{8,2,3,0,0},{9,2,3,0,0},{10,2,3,0,0},{11,2,3,0,0},{12,2,3,0,0},{13,2,3,0,0},{0,3,3,0,0},{1,3,3,0,0},{2,3,3,0,0},{3,3,3,0,0},{4,3,3,0,0},{5,3,3,0,0}, + {6,3,3,0,0},{7,3,3,0,0},{8,3,3,0,0},{9,3,3,0,0},{10,3,3,0,0},{11,3,3,0,0},{12,3,3,0,0},{13,3,3,0,0},{1,4,3,201,0},{2,4,3,201,0},{4,4,3,0,0},{6,4,3,0,0},{8,4,3,0,0},{10,4,3,0,0},{11,4,3,201,0},{12,4,3,201,0}, + {0,5,3,0,0},{1,5,3,206,0},{2,5,3,0,0},{3,5,3,0,0},{4,5,3,0,0},{5,5,3,0,0},{6,5,3,0,0},{7,5,3,0,0},{8,5,3,0,0},{9,5,3,0,0},{10,5,3,0,0},{11,5,3,0,0},{12,5,3,206,0},{13,5,3,0,0},{0,6,3,0,0},{2,6,3,0,0}, + {3,6,3,0,0},{4,6,3,0,0},{5,6,3,0,0},{6,6,3,0,0},{7,6,3,0,0},{8,6,3,0,0},{9,6,3,0,0},{10,6,3,0,0},{11,6,3,0,0},{13,6,3,0,0},{0,7,3,0,0},{2,7,3,0,0},{3,7,3,0,0},{4,7,3,0,0},{5,7,3,0,0},{6,7,3,0,0}, + {7,7,3,0,0},{8,7,3,0,0},{9,7,3,0,0},{10,7,3,0,0},{11,7,3,0,0},{13,7,3,0,0},{0,0,4,0,0},{1,0,4,0,0},{2,0,4,0,0},{3,0,4,0,0},{4,0,4,0,0},{5,0,4,0,0},{6,0,4,0,0},{7,0,4,0,0},{8,0,4,0,0},{9,0,4,0,0}, + {10,0,4,0,0},{11,0,4,0,0},{12,0,4,0,0},{13,0,4,0,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0},{7,1,4,0,0},{8,1,4,0,0},{9,1,4,0,0},{10,1,4,0,0},{11,1,4,0,0}, + {12,1,4,0,0},{13,1,4,0,0},{0,2,4,0,0},{1,2,4,0,0},{2,2,4,0,0},{3,2,4,0,0},{4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0},{7,2,4,0,0},{8,2,4,0,0},{9,2,4,0,0},{10,2,4,0,0},{11,2,4,0,0},{12,2,4,0,0},{13,2,4,0,0}, + {0,3,4,0,0},{1,3,4,0,0},{2,3,4,0,0},{3,3,4,0,0},{4,3,4,0,0},{5,3,4,0,0},{6,3,4,0,0},{7,3,4,0,0},{9,3,4,0,0},{10,3,4,0,0},{11,3,4,0,0},{12,3,4,0,0},{13,3,4,0,0},{1,4,4,201,0},{2,4,4,201,0},{3,4,4,0,0}, + {5,4,4,0,0},{7,4,4,0,0},{8,4,4,201,0},{9,4,4,0,0},{11,4,4,201,0},{12,4,4,201,0},{0,5,4,0,0},{1,5,4,206,0},{3,5,4,0,0},{4,5,4,0,0},{5,5,4,0,0},{6,5,4,0,0},{7,5,4,0,0},{8,5,4,201,0},{9,5,4,0,0},{10,5,4,0,0}, + {12,5,4,206,0},{13,5,4,0,0},{0,6,4,0,0},{1,6,4,206,0},{2,6,4,0,0},{3,6,4,0,0},{4,6,4,0,0},{5,6,4,0,0},{6,6,4,0,0},{7,6,4,0,0},{8,6,4,201,0},{9,6,4,0,0},{10,6,4,0,0},{11,6,4,0,0},{12,6,4,206,0},{13,6,4,0,0}, + {0,7,4,0,0},{1,7,4,206,0},{3,7,4,0,0},{4,7,4,0,0},{5,7,4,0,0},{6,7,4,0,0},{7,7,4,0,0},{8,7,4,201,0},{9,7,4,0,0},{10,7,4,0,0},{12,7,4,206,0},{13,7,4,0,0},{0,0,5,0,0},{1,0,5,0,0},{2,0,5,0,0},{3,0,5,0,0}, + {4,0,5,0,0},{5,0,5,0,0},{6,0,5,0,0},{7,0,5,0,0},{8,0,5,0,0},{9,0,5,0,0},{10,0,5,0,0},{11,0,5,0,0},{12,0,5,0,0},{13,0,5,0,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,0,0},{3,1,5,0,0},{4,1,5,0,0},{5,1,5,0,0}, + {6,1,5,0,0},{7,1,5,0,0},{8,1,5,0,0},{9,1,5,0,0},{10,1,5,0,0},{11,1,5,0,0},{12,1,5,0,0},{13,1,5,0,0},{0,2,5,0,0},{1,2,5,0,0},{2,2,5,0,0},{3,2,5,0,0},{4,2,5,0,0},{5,2,5,0,0},{6,2,5,0,0},{7,2,5,0,0}, + {8,2,5,0,0},{9,2,5,0,0},{10,2,5,0,0},{11,2,5,0,0},{12,2,5,0,0},{13,2,5,0,0},{0,3,5,0,0},{1,3,5,0,0},{2,3,5,0,0},{3,3,5,0,0},{4,3,5,0,0},{5,3,5,0,0},{6,3,5,0,0},{7,3,5,0,0},{8,3,5,0,0},{9,3,5,0,0}, + {10,3,5,0,0},{11,3,5,0,0},{12,3,5,0,0},{13,3,5,0,0},{1,4,5,201,0},{2,4,5,201,0},{4,4,5,0,0},{6,4,5,0,0},{8,4,5,0,0},{10,4,5,0,0},{11,4,5,201,0},{12,4,5,201,0},{0,5,5,0,0},{1,5,5,206,0},{2,5,5,0,0},{3,5,5,0,0}, + {4,5,5,0,0},{5,5,5,0,0},{6,5,5,0,0},{7,5,5,0,0},{8,5,5,0,0},{9,5,5,0,0},{10,5,5,0,0},{11,5,5,0,0},{12,5,5,206,0},{13,5,5,0,0},{0,6,5,0,0},{2,6,5,0,0},{3,6,5,0,0},{4,6,5,0,0},{5,6,5,0,0},{6,6,5,0,0}, + {7,6,5,0,0},{9,6,5,0,0},{10,6,5,0,0},{11,6,5,0,0},{13,6,5,0,0},{0,7,5,0,0},{2,7,5,0,0},{3,7,5,0,0},{4,7,5,0,0},{5,7,5,0,0},{6,7,5,0,0},{7,7,5,0,0},{8,7,5,0,0},{9,7,5,0,0},{10,7,5,0,0},{11,7,5,0,0}, + {13,7,5,0,0},{0,0,6,0,0},{1,0,6,0,0},{2,0,6,0,0},{3,0,6,0,0},{4,0,6,0,0},{5,0,6,0,0},{6,0,6,0,0},{7,0,6,0,0},{8,0,6,0,0},{9,0,6,0,0},{10,0,6,0,0},{11,0,6,0,0},{12,0,6,0,0},{13,0,6,0,0},{0,1,6,0,0}, + {1,1,6,0,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{7,1,6,0,0},{8,1,6,0,0},{9,1,6,0,0},{10,1,6,0,0},{11,1,6,0,0},{12,1,6,0,0},{13,1,6,0,0},{0,2,6,0,0},{1,2,6,0,0},{2,2,6,0,0}, + {3,2,6,0,0},{4,2,6,0,0},{5,2,6,0,0},{6,2,6,0,0},{7,2,6,0,0},{8,2,6,0,0},{9,2,6,0,0},{10,2,6,0,0},{11,2,6,0,0},{12,2,6,0,0},{13,2,6,0,0},{0,3,6,0,0},{1,3,6,0,0},{2,3,6,0,0},{3,3,6,0,0},{5,3,6,0,0}, + {6,3,6,0,0},{7,3,6,0,0},{8,3,6,0,0},{9,3,6,0,0},{10,3,6,0,0},{11,3,6,0,0},{12,3,6,0,0},{13,3,6,0,0},{1,4,6,201,0},{2,4,6,201,0},{3,4,6,0,0},{4,4,6,201,0},{5,4,6,0,0},{7,4,6,0,0},{9,4,6,0,0},{11,4,6,201,0}, + {12,4,6,201,0},{0,5,6,0,0},{1,5,6,206,0},{2,5,6,0,0},{3,5,6,0,0},{4,5,6,201,0},{5,5,6,0,0},{6,5,6,0,0},{7,5,6,0,0},{8,5,6,0,0},{9,5,6,0,0},{10,5,6,0,0},{11,5,6,0,0},{12,5,6,206,0},{13,5,6,0,0},{0,6,6,0,0}, + {1,6,6,206,0},{2,6,6,0,0},{3,6,6,0,0},{4,6,6,201,0},{6,6,6,0,0},{7,6,6,0,0},{8,6,6,0,0},{9,6,6,0,0},{10,6,6,0,0},{11,6,6,0,0},{12,6,6,206,0},{13,6,6,0,0},{0,7,6,0,0},{1,7,6,206,0},{2,7,6,0,0},{3,7,6,0,0}, + {4,7,6,201,0},{5,7,6,0,0},{6,7,6,0,0},{7,7,6,0,0},{8,7,6,0,0},{9,7,6,0,0},{10,7,6,0,0},{11,7,6,0,0},{12,7,6,206,0},{13,7,6,0,0},{0,0,7,0,0},{1,0,7,0,0},{2,0,7,0,0},{3,0,7,0,0},{4,0,7,0,0},{5,0,7,0,0}, + {6,0,7,0,0},{7,0,7,0,0},{8,0,7,0,0},{9,0,7,0,0},{10,0,7,0,0},{11,0,7,0,0},{12,0,7,0,0},{13,0,7,0,0},{0,1,7,0,0},{1,1,7,0,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{6,1,7,0,0},{7,1,7,0,0}, + {8,1,7,0,0},{9,1,7,0,0},{10,1,7,0,0},{11,1,7,0,0},{12,1,7,0,0},{13,1,7,0,0},{0,2,7,0,0},{1,2,7,0,0},{2,2,7,0,0},{3,2,7,0,0},{4,2,7,0,0},{5,2,7,0,0},{6,2,7,0,0},{7,2,7,0,0},{8,2,7,0,0},{9,2,7,0,0}, + {10,2,7,0,0},{11,2,7,0,0},{12,2,7,0,0},{13,2,7,0,0},{0,3,7,0,0},{1,3,7,0,0},{2,3,7,0,0},{3,3,7,0,0},{4,3,7,0,0},{5,3,7,0,0},{6,3,7,0,0},{7,3,7,0,0},{8,3,7,0,0},{10,3,7,0,0},{11,3,7,0,0},{12,3,7,0,0}, + {13,3,7,0,0},{1,4,7,201,0},{2,4,7,201,0},{4,4,7,0,0},{6,4,7,0,0},{8,4,7,0,0},{9,4,7,201,0},{10,4,7,0,0},{11,4,7,201,0},{12,4,7,201,0},{0,5,7,0,0},{1,5,7,206,0},{2,5,7,0,0},{3,5,7,0,0},{4,5,7,0,0},{5,5,7,0,0}, + {6,5,7,0,0},{7,5,7,0,0},{8,5,7,0,0},{9,5,7,201,0},{10,5,7,0,0},{11,5,7,0,0},{12,5,7,206,0},{13,5,7,0,0},{0,6,7,0,0},{1,6,7,206,0},{2,6,7,0,0},{3,6,7,0,0},{4,6,7,0,0},{5,6,7,0,0},{6,6,7,0,0},{7,6,7,0,0}, + {9,6,7,201,0},{10,6,7,0,0},{11,6,7,0,0},{12,6,7,206,0},{13,6,7,0,0},{0,7,7,0,0},{1,7,7,206,0},{2,7,7,0,0},{3,7,7,0,0},{4,7,7,0,0},{5,7,7,0,0},{6,7,7,0,0},{7,7,7,0,0},{8,7,7,0,0},{9,7,7,201,0},{10,7,7,0,0}, + {11,7,7,0,0},{12,7,7,206,0},{13,7,7,0,0},{0,0,8,0,0},{1,0,8,0,0},{2,0,8,0,0},{3,0,8,0,0},{4,0,8,0,0},{5,0,8,0,0},{6,0,8,0,0},{7,0,8,0,0},{8,0,8,0,0},{9,0,8,0,0},{10,0,8,0,0},{11,0,8,0,0},{12,0,8,0,0}, + {13,0,8,0,0},{0,1,8,0,0},{1,1,8,0,0},{2,1,8,0,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,0,0},{7,1,8,0,0},{8,1,8,0,0},{9,1,8,0,0},{10,1,8,0,0},{11,1,8,0,0},{12,1,8,0,0},{13,1,8,0,0},{0,2,8,0,0}, + {1,2,8,0,0},{2,2,8,0,0},{3,2,8,0,0},{4,2,8,0,0},{5,2,8,0,0},{6,2,8,0,0},{7,2,8,0,0},{8,2,8,0,0},{9,2,8,0,0},{10,2,8,0,0},{11,2,8,0,0},{12,2,8,0,0},{13,2,8,0,0},{0,3,8,0,0},{1,3,8,0,0},{2,3,8,0,0}, + {3,3,8,0,0},{4,3,8,0,0},{5,3,8,0,0},{6,3,8,0,0},{7,3,8,0,0},{8,3,8,0,0},{9,3,8,0,0},{10,3,8,0,0},{11,3,8,0,0},{12,3,8,0,0},{13,3,8,0,0},{1,4,8,201,0},{2,4,8,201,0},{3,4,8,0,0},{5,4,8,0,0},{7,4,8,0,0}, + {9,4,8,0,0},{11,4,8,201,0},{12,4,8,201,0},{0,5,8,0,0},{1,5,8,206,0},{2,5,8,0,0},{3,5,8,0,0},{4,5,8,0,0},{5,5,8,0,0},{6,5,8,0,0},{7,5,8,0,0},{8,5,8,0,0},{9,5,8,0,0},{10,5,8,0,0},{11,5,8,0,0},{12,5,8,206,0}, + {13,5,8,0,0},{0,6,8,0,0},{2,6,8,0,0},{3,6,8,0,0},{4,6,8,0,0},{6,6,8,0,0},{7,6,8,0,0},{8,6,8,0,0},{9,6,8,0,0},{10,6,8,0,0},{11,6,8,0,0},{13,6,8,0,0},{0,7,8,0,0},{2,7,8,0,0},{3,7,8,0,0},{4,7,8,0,0}, + {5,7,8,0,0},{6,7,8,0,0},{7,7,8,0,0},{8,7,8,0,0},{9,7,8,0,0},{10,7,8,0,0},{11,7,8,0,0},{13,7,8,0,0},{0,0,9,0,0},{1,0,9,0,0},{2,0,9,0,0},{3,0,9,0,0},{4,0,9,0,0},{5,0,9,0,0},{6,0,9,0,0},{7,0,9,0,0}, + {8,0,9,0,0},{9,0,9,0,0},{10,0,9,0,0},{11,0,9,0,0},{12,0,9,0,0},{13,0,9,0,0},{0,1,9,0,0},{1,1,9,0,0},{2,1,9,0,0},{3,1,9,0,0},{4,1,9,0,0},{5,1,9,0,0},{6,1,9,0,0},{7,1,9,0,0},{8,1,9,0,0},{9,1,9,0,0}, + {10,1,9,0,0},{11,1,9,0,0},{12,1,9,0,0},{13,1,9,0,0},{0,2,9,0,0},{1,2,9,0,0},{2,2,9,0,0},{3,2,9,0,0},{4,2,9,0,0},{5,2,9,0,0},{6,2,9,0,0},{7,2,9,0,0},{8,2,9,0,0},{9,2,9,0,0},{10,2,9,0,0},{11,2,9,0,0}, + {12,2,9,0,0},{13,2,9,0,0},{0,3,9,0,0},{1,3,9,0,0},{2,3,9,0,0},{3,3,9,0,0},{4,3,9,0,0},{6,3,9,0,0},{7,3,9,0,0},{8,3,9,0,0},{9,3,9,0,0},{10,3,9,0,0},{11,3,9,0,0},{12,3,9,0,0},{13,3,9,0,0},{1,4,9,201,0}, + {2,4,9,201,0},{4,4,9,0,0},{5,4,9,201,0},{6,4,9,0,0},{8,4,9,0,0},{10,4,9,0,0},{11,4,9,201,0},{12,4,9,201,0},{0,5,9,0,0},{1,5,9,206,0},{3,5,9,0,0},{4,5,9,0,0},{5,5,9,201,0},{6,5,9,0,0},{7,5,9,0,0},{8,5,9,0,0}, + {9,5,9,0,0},{10,5,9,0,0},{11,5,9,0,0},{12,5,9,206,0},{13,5,9,0,0},{0,6,9,0,0},{1,6,9,206,0},{2,6,9,0,0},{3,6,9,0,0},{4,6,9,0,0},{5,6,9,201,0},{6,6,9,0,0},{7,6,9,0,0},{8,6,9,0,0},{9,6,9,0,0},{10,6,9,0,0}, + {11,6,9,0,0},{12,6,9,206,0},{13,6,9,0,0},{0,7,9,0,0},{1,7,9,206,0},{3,7,9,0,0},{4,7,9,0,0},{5,7,9,201,0},{6,7,9,0,0},{7,7,9,0,0},{8,7,9,0,0},{9,7,9,0,0},{10,7,9,0,0},{11,7,9,0,0},{12,7,9,206,0},{13,7,9,0,0}, + {0,0,10,0,0},{1,0,10,0,0},{2,0,10,0,0},{3,0,10,0,0},{4,0,10,0,0},{5,0,10,0,0},{6,0,10,0,0},{7,0,10,0,0},{8,0,10,0,0},{9,0,10,0,0},{10,0,10,0,0},{11,0,10,0,0},{12,0,10,0,0},{13,0,10,0,0},{0,1,10,0,0},{1,1,10,0,0}, + {2,1,10,0,0},{3,1,10,0,0},{4,1,10,0,0},{5,1,10,0,0},{6,1,10,0,0},{7,1,10,0,0},{9,1,10,201,0},{10,1,10,201,0},{11,1,10,0,0},{12,1,10,0,0},{13,1,10,0,0},{0,2,10,0,0},{1,2,10,0,0},{2,2,10,0,0},{3,2,10,0,0},{4,2,10,0,0}, + {5,2,10,0,0},{6,2,10,0,0},{7,2,10,0,0},{9,2,10,201,0},{10,2,10,201,0},{11,2,10,206,0},{12,2,10,0,0},{13,2,10,0,0},{0,3,10,0,0},{1,3,10,0,0},{2,3,10,0,0},{3,3,10,0,0},{4,3,10,0,0},{5,3,10,0,0},{6,3,10,0,0},{7,3,10,0,0}, + {8,3,10,0,0},{10,3,10,201,0},{11,3,10,206,0},{12,3,10,0,0},{13,3,10,0,0},{1,4,10,201,0},{2,4,10,201,0},{3,4,10,0,0},{5,4,10,0,0},{7,4,10,0,0},{8,4,10,0,0},{10,4,10,201,0},{11,4,10,201,0},{12,4,10,201,0},{0,5,10,0,0},{1,5,10,206,0}, + {2,5,10,0,0},{3,5,10,0,0},{4,5,10,0,0},{5,5,10,0,0},{6,5,10,0,0},{7,5,10,0,0},{8,5,10,0,0},{9,5,10,0,0},{10,5,10,0,0},{11,5,10,0,0},{12,5,10,206,0},{13,5,10,0,0},{0,6,10,0,0},{2,6,10,0,0},{3,6,10,0,0},{4,6,10,0,0}, + {5,6,10,0,0},{6,6,10,0,0},{7,6,10,0,0},{8,6,10,0,0},{9,6,10,0,0},{10,6,10,0,0},{11,6,10,0,0},{13,6,10,0,0},{0,7,10,0,0},{2,7,10,0,0},{3,7,10,0,0},{4,7,10,0,0},{5,7,10,0,0},{6,7,10,0,0},{7,7,10,0,0},{8,7,10,0,0}, + {9,7,10,0,0},{10,7,10,0,0},{11,7,10,0,0},{13,7,10,0,0},{0,0,11,0,0},{1,0,11,0,0},{2,0,11,0,0},{3,0,11,0,0},{4,0,11,0,0},{5,0,11,0,0},{6,0,11,0,0},{7,0,11,0,0},{8,0,11,0,0},{9,0,11,0,0},{10,0,11,0,0},{11,0,11,0,0}, + {12,0,11,0,0},{13,0,11,0,0},{0,1,11,0,0},{1,1,11,0,0},{2,1,11,0,0},{3,1,11,0,0},{4,1,11,0,0},{5,1,11,0,0},{6,1,11,0,0},{7,1,11,0,0},{8,1,11,0,0},{9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0},{12,1,11,0,0},{13,1,11,0,0}, + {0,2,11,0,0},{1,2,11,0,0},{2,2,11,0,0},{3,2,11,0,0},{4,2,11,0,0},{5,2,11,0,0},{6,2,11,0,0},{7,2,11,0,0},{8,2,11,0,0},{9,2,11,0,0},{10,2,11,0,0},{11,2,11,0,0},{12,2,11,0,0},{13,2,11,0,0},{0,3,11,0,0},{1,3,11,0,0}, + {2,3,11,0,0},{3,3,11,0,0},{4,3,11,0,0},{5,3,11,0,0},{6,3,11,0,0},{7,3,11,0,0},{8,3,11,0,0},{9,3,11,0,0},{10,3,11,0,0},{11,3,11,0,0},{12,3,11,0,0},{13,3,11,0,0},{1,4,11,201,0},{2,4,11,201,0},{3,4,11,201,0},{4,4,11,201,0}, + {5,4,11,201,0},{6,4,11,201,0},{7,4,11,201,0},{8,4,11,201,0},{9,4,11,201,0},{10,4,11,201,0},{11,4,11,201,0},{12,4,11,201,0},{0,5,11,0,0},{1,5,11,206,0},{2,5,11,0,0},{3,5,11,0,0},{5,5,11,0,0},{6,5,11,0,0},{7,5,11,0,0},{8,5,11,0,0}, + {9,5,11,0,0},{10,5,11,0,0},{11,5,11,0,0},{12,5,11,206,0},{13,5,11,0,0},{0,6,11,0,0},{1,6,11,206,0},{2,6,11,0,0},{3,6,11,0,0},{4,6,11,0,0},{5,6,11,0,0},{6,6,11,0,0},{7,6,11,0,0},{8,6,11,0,0},{9,6,11,0,0},{10,6,11,0,0}, + {11,6,11,0,0},{12,6,11,206,0},{13,6,11,0,0},{0,7,11,0,0},{1,7,11,206,0},{2,7,11,0,0},{3,7,11,0,0},{5,7,11,0,0},{6,7,11,0,0},{7,7,11,0,0},{8,7,11,0,0},{9,7,11,0,0},{10,7,11,0,0},{11,7,11,0,0},{12,7,11,206,0},{13,7,11,0,0}, + {0,0,12,0,0},{1,0,12,0,0},{2,0,12,0,0},{3,0,12,0,0},{4,0,12,0,0},{5,0,12,0,0},{6,0,12,0,0},{7,0,12,0,0},{8,0,12,0,0},{9,0,12,0,0},{10,0,12,0,0},{11,0,12,0,0},{12,0,12,0,0},{13,0,12,0,0},{0,1,12,0,0},{1,1,12,0,0}, + {2,1,12,0,0},{3,1,12,0,0},{4,1,12,0,0},{5,1,12,0,0},{6,1,12,0,0},{7,1,12,0,0},{8,1,12,0,0},{9,1,12,0,0},{10,1,12,0,0},{11,1,12,0,0},{12,1,12,0,0},{13,1,12,0,0},{0,2,12,0,0},{1,2,12,0,0},{2,2,12,0,0},{3,2,12,0,0}, + {4,2,12,0,0},{5,2,12,0,0},{6,2,12,0,0},{7,2,12,0,0},{8,2,12,0,0},{9,2,12,0,0},{10,2,12,0,0},{11,2,12,0,0},{12,2,12,0,0},{13,2,12,0,0},{0,3,12,0,0},{1,3,12,0,0},{2,3,12,0,0},{3,3,12,0,0},{4,3,12,0,0},{5,3,12,0,0}, + {6,3,12,0,0},{7,3,12,0,0},{8,3,12,0,0},{9,3,12,0,0},{10,3,12,0,0},{11,3,12,0,0},{12,3,12,0,0},{13,3,12,0,0},{1,4,12,201,0},{2,4,12,201,0},{3,4,12,201,0},{4,4,12,201,0},{5,4,12,201,0},{6,4,12,201,0},{7,4,12,201,0},{8,4,12,201,0}, + {9,4,12,201,0},{10,4,12,201,0},{11,4,12,201,0},{12,4,12,201,0},{0,5,12,0,0},{1,5,12,202,0},{2,5,12,206,0},{3,5,12,206,0},{4,5,12,206,0},{5,5,12,206,0},{6,5,12,206,0},{7,5,12,206,0},{8,5,12,206,0},{9,5,12,206,0},{10,5,12,206,0},{11,5,12,206,0}, + {12,5,12,202,0},{13,5,12,0,0},{0,6,12,0,0},{1,6,12,202,0},{2,6,12,206,0},{4,6,12,206,0},{6,6,12,206,0},{7,6,12,206,0},{9,6,12,206,0},{11,6,12,206,0},{12,6,12,202,0},{13,6,12,0,0},{0,7,12,0,0},{1,7,12,202,0},{2,7,12,206,0},{4,7,12,206,0}, + {6,7,12,206,0},{7,7,12,206,0},{9,7,12,206,0},{11,7,12,206,0},{12,7,12,202,0},{13,7,12,0,0},{0,0,13,0,0},{1,0,13,0,0},{2,0,13,0,0},{3,0,13,0,0},{4,0,13,0,0},{5,0,13,0,0},{6,0,13,0,0},{7,0,13,0,0},{8,0,13,0,0},{9,0,13,0,0}, + {10,0,13,0,0},{11,0,13,0,0},{12,0,13,0,0},{13,0,13,0,0},{0,1,13,0,0},{1,1,13,0,0},{2,1,13,0,0},{3,1,13,0,0},{4,1,13,0,0},{5,1,13,0,0},{6,1,13,0,0},{7,1,13,0,0},{8,1,13,0,0},{9,1,13,0,0},{10,1,13,0,0},{11,1,13,0,0}, + {12,1,13,0,0},{13,1,13,0,0},{0,2,13,0,0},{1,2,13,0,0},{2,2,13,0,0},{3,2,13,0,0},{4,2,13,0,0},{5,2,13,0,0},{6,2,13,0,0},{7,2,13,0,0},{8,2,13,0,0},{9,2,13,0,0},{10,2,13,0,0},{11,2,13,0,0},{12,2,13,0,0},{13,2,13,0,0}, + {0,3,13,0,0},{1,3,13,0,0},{2,3,13,0,0},{3,3,13,0,0},{4,3,13,0,0},{5,3,13,0,0},{6,3,13,0,0},{7,3,13,0,0},{8,3,13,0,0},{9,3,13,0,0},{10,3,13,0,0},{11,3,13,0,0},{12,3,13,0,0},{13,3,13,0,0},{1,5,13,0,0},{2,5,13,0,0}, + {3,5,13,0,0},{4,5,13,0,0},{5,5,13,0,0},{6,5,13,0,0},{7,5,13,0,0},{8,5,13,0,0},{9,5,13,0,0},{10,5,13,0,0},{11,5,13,0,0},{12,5,13,0,0},{0,6,13,0,0},{1,6,13,0,0},{2,6,13,0,0},{3,6,13,0,0},{4,6,13,0,0},{5,6,13,0,0}, + {6,6,13,0,0},{7,6,13,0,0},{8,6,13,0,0},{9,6,13,0,0},{10,6,13,0,0},{11,6,13,0,0},{12,6,13,0,0},{13,6,13,0,0},{0,7,13,0,0},{1,7,13,0,0},{2,7,13,0,0},{3,7,13,0,0},{4,7,13,0,0},{5,7,13,0,0},{6,7,13,0,0},{7,7,13,0,0}, + {8,7,13,0,0},{9,7,13,0,0},{10,7,13,0,0},{11,7,13,0,0},{12,7,13,0,0},{13,7,13,0,0},{0,4,0,203,4},{1,4,0,203,6},{2,4,0,203,2},{3,4,0,203,2},{4,4,0,203,6},{5,4,0,203,6},{6,4,0,203,2},{7,4,0,203,2},{8,4,0,203,6},{9,4,0,203,6}, + {10,4,0,203,2},{11,4,0,203,2},{12,4,0,203,6},{13,4,0,203,6},{0,5,0,198,1},{13,5,0,198,1},{0,4,1,203,4},{13,4,1,203,5},{3,6,1,95,2},{5,6,1,95,2},{8,6,1,95,2},{10,6,1,95,2},{3,7,1,95,2},{5,7,1,95,2},{8,7,1,95,2},{10,7,1,95,2}, + {0,4,2,203,0},{13,4,2,203,1},{4,5,2,203,3},{9,5,2,203,3},{4,7,2,203,7},{9,7,2,203,7},{0,4,3,203,0},{3,4,3,205,8},{5,4,3,205,8},{7,4,3,205,8},{9,4,3,205,8},{13,4,3,203,1},{1,6,3,95,2},{12,6,3,95,2},{1,7,3,95,2},{12,7,3,95,2}, + {8,3,4,198,0},{0,4,4,203,4},{4,4,4,205,8},{6,4,4,205,8},{10,4,4,205,8},{13,4,4,203,5},{2,5,4,203,1},{11,5,4,203,0},{2,7,4,203,5},{11,7,4,203,4},{0,4,5,203,4},{3,4,5,205,8},{5,4,5,205,8},{7,4,5,205,8},{9,4,5,205,8},{13,4,5,203,5}, + {1,6,5,95,2},{12,6,5,95,2},{1,7,5,95,2},{12,7,5,95,2},{4,3,6,198,0},{0,4,6,203,0},{6,4,6,205,8},{8,4,6,205,8},{10,4,6,205,8},{13,4,6,203,1},{9,3,7,198,0},{0,4,7,203,0},{3,4,7,205,8},{5,4,7,205,8},{7,4,7,205,8},{13,4,7,203,1}, + {0,4,8,203,4},{4,4,8,205,8},{6,4,8,205,8},{8,4,8,205,8},{10,4,8,205,8},{13,4,8,203,5},{1,6,8,95,2},{12,6,8,95,2},{1,7,8,95,2},{12,7,8,95,2},{5,3,9,198,0},{0,4,9,203,4},{3,4,9,205,8},{7,4,9,205,8},{9,4,9,205,8},{13,4,9,203,5}, + {2,5,9,203,1},{2,7,9,203,5},{8,1,10,65,4},{8,2,10,65,4},{9,3,10,65,4},{0,4,10,203,0},{4,4,10,205,8},{6,4,10,205,8},{9,4,10,65,4},{13,4,10,203,1},{1,6,10,95,2},{12,6,10,95,2},{1,7,10,95,2},{12,7,10,95,2},{0,4,11,203,0},{13,4,11,203,1}, + {4,5,11,203,2},{4,7,11,203,6},{0,4,12,203,4},{13,4,12,203,5},{3,6,12,95,2},{5,6,12,95,2},{8,6,12,95,2},{10,6,12,95,2},{3,7,12,95,2},{5,7,12,95,2},{8,7,12,95,2},{10,7,12,95,2},{0,4,13,203,7},{1,4,13,203,7},{2,4,13,203,3},{3,4,13,203,3}, + {4,4,13,203,7},{5,4,13,203,7},{6,4,13,203,3},{7,4,13,203,3},{8,4,13,203,7},{9,4,13,203,7},{10,4,13,203,3},{11,4,13,203,3},{12,4,13,203,7},{13,4,13,203,5},{0,5,13,198,1},{13,5,13,198,1}, +}; +static const EndCityTemplates::Extra s_third_floor_b_extras[] = { + {8,6,5,EndCityTemplates::EXTRA_SENTRY,0},{5,6,6,EndCityTemplates::EXTRA_SENTRY,0},{8,6,7,EndCityTemplates::EXTRA_SENTRY,0},{5,6,8,EndCityTemplates::EXTRA_SENTRY,0}, +}; + +static const EndCityTemplates::Block s_third_floor_c_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{7,0,0,0,0},{8,0,0,0,0},{9,0,0,0,0},{10,0,0,0,0},{11,0,0,0,0},{12,0,0,0,0},{13,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0}, + {2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{12,1,0,0,0},{13,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0}, + {4,2,0,0,0},{5,2,0,0,0},{6,2,0,0,0},{7,2,0,0,0},{8,2,0,0,0},{9,2,0,0,0},{10,2,0,0,0},{11,2,0,0,0},{12,2,0,0,0},{13,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0}, + {6,3,0,0,0},{7,3,0,0,0},{8,3,0,0,0},{9,3,0,0,0},{10,3,0,0,0},{11,3,0,0,0},{12,3,0,0,0},{13,3,0,0,0},{1,5,0,0,0},{2,5,0,0,0},{3,5,0,0,0},{4,5,0,0,0},{5,5,0,0,0},{6,5,0,0,0},{7,5,0,0,0},{8,5,0,0,0}, + {9,5,0,0,0},{10,5,0,0,0},{11,5,0,0,0},{12,5,0,0,0},{0,6,0,0,0},{1,6,0,0,0},{2,6,0,0,0},{3,6,0,0,0},{4,6,0,0,0},{5,6,0,0,0},{6,6,0,0,0},{7,6,0,0,0},{8,6,0,0,0},{9,6,0,0,0},{10,6,0,0,0},{11,6,0,0,0}, + {12,6,0,0,0},{13,6,0,0,0},{0,7,0,0,0},{1,7,0,0,0},{2,7,0,0,0},{3,7,0,0,0},{4,7,0,0,0},{5,7,0,0,0},{6,7,0,0,0},{7,7,0,0,0},{8,7,0,0,0},{9,7,0,0,0},{10,7,0,0,0},{11,7,0,0,0},{12,7,0,0,0},{13,7,0,0,0}, + {0,0,1,0,0},{1,0,1,0,0},{2,0,1,0,0},{3,0,1,0,0},{4,0,1,0,0},{5,0,1,0,0},{6,0,1,0,0},{7,0,1,0,0},{8,0,1,0,0},{9,0,1,0,0},{10,0,1,0,0},{11,0,1,0,0},{12,0,1,0,0},{13,0,1,0,0},{0,1,1,0,0},{1,1,1,0,0}, + {2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0},{7,1,1,0,0},{8,1,1,0,0},{9,1,1,0,0},{10,1,1,0,0},{11,1,1,0,0},{12,1,1,0,0},{13,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0}, + {4,2,1,0,0},{5,2,1,0,0},{6,2,1,0,0},{7,2,1,0,0},{8,2,1,0,0},{9,2,1,0,0},{10,2,1,0,0},{11,2,1,0,0},{12,2,1,0,0},{13,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,0,0},{3,3,1,0,0},{4,3,1,0,0},{5,3,1,0,0}, + {6,3,1,0,0},{7,3,1,0,0},{8,3,1,0,0},{9,3,1,0,0},{10,3,1,0,0},{11,3,1,0,0},{12,3,1,0,0},{13,3,1,0,0},{1,4,1,201,0},{2,4,1,201,0},{3,4,1,201,0},{4,4,1,201,0},{5,4,1,201,0},{6,4,1,201,0},{7,4,1,201,0},{8,4,1,201,0}, + {9,4,1,201,0},{10,4,1,201,0},{11,4,1,201,0},{12,4,1,201,0},{0,5,1,0,0},{1,5,1,202,0},{2,5,1,206,0},{3,5,1,206,0},{4,5,1,206,0},{5,5,1,206,0},{6,5,1,206,0},{7,5,1,206,0},{8,5,1,206,0},{9,5,1,206,0},{10,5,1,206,0},{11,5,1,206,0}, + {12,5,1,202,0},{13,5,1,0,0},{0,6,1,0,0},{1,6,1,202,0},{2,6,1,206,0},{4,6,1,206,0},{6,6,1,206,0},{7,6,1,206,0},{9,6,1,206,0},{11,6,1,206,0},{12,6,1,202,0},{13,6,1,0,0},{0,7,1,0,0},{1,7,1,202,0},{2,7,1,206,0},{4,7,1,206,0}, + {6,7,1,206,0},{7,7,1,206,0},{9,7,1,206,0},{11,7,1,206,0},{12,7,1,202,0},{13,7,1,0,0},{0,0,2,0,0},{1,0,2,0,0},{2,0,2,0,0},{3,0,2,0,0},{4,0,2,0,0},{5,0,2,0,0},{6,0,2,0,0},{7,0,2,0,0},{8,0,2,0,0},{9,0,2,0,0}, + {10,0,2,0,0},{11,0,2,0,0},{12,0,2,0,0},{13,0,2,0,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{5,1,2,0,0},{6,1,2,0,0},{7,1,2,0,0},{8,1,2,0,0},{9,1,2,0,0},{10,1,2,0,0},{11,1,2,0,0}, + {12,1,2,0,0},{13,1,2,0,0},{0,2,2,0,0},{1,2,2,0,0},{2,2,2,0,0},{3,2,2,0,0},{4,2,2,0,0},{5,2,2,0,0},{6,2,2,0,0},{7,2,2,0,0},{8,2,2,0,0},{9,2,2,0,0},{10,2,2,0,0},{11,2,2,0,0},{12,2,2,0,0},{13,2,2,0,0}, + {0,3,2,0,0},{1,3,2,0,0},{2,3,2,0,0},{3,3,2,0,0},{4,3,2,0,0},{5,3,2,0,0},{6,3,2,0,0},{7,3,2,0,0},{8,3,2,0,0},{9,3,2,0,0},{10,3,2,0,0},{11,3,2,0,0},{12,3,2,0,0},{13,3,2,0,0},{1,4,2,201,0},{2,4,2,201,0}, + {3,4,2,201,0},{4,4,2,201,0},{5,4,2,201,0},{6,4,2,201,0},{7,4,2,201,0},{8,4,2,201,0},{9,4,2,201,0},{10,4,2,201,0},{11,4,2,201,0},{12,4,2,201,0},{0,5,2,0,0},{1,5,2,206,0},{3,5,2,0,0},{4,5,2,0,0},{5,5,2,0,0},{8,5,2,0,0}, + {9,5,2,0,0},{10,5,2,0,0},{12,5,2,206,0},{13,5,2,0,0},{0,6,2,0,0},{1,6,2,206,0},{2,6,2,0,0},{3,6,2,0,0},{4,6,2,0,0},{5,6,2,0,0},{7,6,2,0,0},{8,6,2,0,0},{9,6,2,0,0},{10,6,2,0,0},{11,6,2,0,0},{12,6,2,206,0}, + {13,6,2,0,0},{0,7,2,0,0},{1,7,2,206,0},{2,7,2,0,0},{3,7,2,0,0},{4,7,2,0,0},{5,7,2,0,0},{6,7,2,0,0},{7,7,2,0,0},{8,7,2,0,0},{9,7,2,0,0},{10,7,2,0,0},{11,7,2,0,0},{12,7,2,206,0},{13,7,2,0,0},{0,0,3,0,0}, + {1,0,3,0,0},{2,0,3,0,0},{3,0,3,0,0},{4,0,3,0,0},{5,0,3,0,0},{6,0,3,0,0},{7,0,3,0,0},{8,0,3,0,0},{9,0,3,0,0},{10,0,3,0,0},{11,0,3,0,0},{12,0,3,0,0},{13,0,3,0,0},{0,1,3,0,0},{1,1,3,0,0},{2,1,3,0,0}, + {3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0},{8,1,3,0,0},{9,1,3,0,0},{10,1,3,0,0},{11,1,3,0,0},{12,1,3,0,0},{13,1,3,0,0},{0,2,3,0,0},{1,2,3,0,0},{2,2,3,0,0},{3,2,3,0,0},{4,2,3,0,0}, + {5,2,3,0,0},{6,2,3,0,0},{7,2,3,0,0},{8,2,3,0,0},{9,2,3,0,0},{10,2,3,0,0},{11,2,3,0,0},{12,2,3,0,0},{13,2,3,0,0},{0,3,3,0,0},{1,3,3,0,0},{2,3,3,0,0},{3,3,3,0,0},{4,3,3,0,0},{5,3,3,0,0},{6,3,3,0,0}, + {7,3,3,0,0},{8,3,3,0,0},{9,3,3,0,0},{10,3,3,0,0},{11,3,3,0,0},{12,3,3,0,0},{13,3,3,0,0},{1,4,3,201,0},{2,4,3,201,0},{3,4,3,0,0},{4,4,3,0,0},{5,4,3,0,0},{6,4,3,201,0},{7,4,3,201,0},{8,4,3,0,0},{9,4,3,0,0}, + {10,4,3,0,0},{11,4,3,201,0},{12,4,3,201,0},{0,5,3,0,0},{1,5,3,206,0},{2,5,3,0,0},{3,5,3,0,0},{4,5,3,0,0},{5,5,3,0,0},{6,5,3,0,0},{7,5,3,0,0},{8,5,3,0,0},{9,5,3,0,0},{10,5,3,0,0},{11,5,3,0,0},{12,5,3,206,0}, + {13,5,3,0,0},{0,6,3,0,0},{2,6,3,0,0},{3,6,3,0,0},{4,6,3,0,0},{5,6,3,0,0},{6,6,3,0,0},{7,6,3,0,0},{8,6,3,0,0},{9,6,3,0,0},{10,6,3,0,0},{11,6,3,0,0},{13,6,3,0,0},{0,7,3,0,0},{2,7,3,0,0},{3,7,3,0,0}, + {4,7,3,0,0},{5,7,3,0,0},{6,7,3,0,0},{7,7,3,0,0},{8,7,3,0,0},{9,7,3,0,0},{10,7,3,0,0},{11,7,3,0,0},{13,7,3,0,0},{0,0,4,0,0},{1,0,4,0,0},{2,0,4,0,0},{3,0,4,0,0},{4,0,4,0,0},{5,0,4,0,0},{6,0,4,0,0}, + {7,0,4,0,0},{8,0,4,0,0},{9,0,4,0,0},{10,0,4,0,0},{11,0,4,0,0},{12,0,4,0,0},{13,0,4,0,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0},{7,1,4,0,0},{8,1,4,0,0}, + {9,1,4,0,0},{10,1,4,0,0},{11,1,4,0,0},{12,1,4,0,0},{13,1,4,0,0},{0,2,4,0,0},{1,2,4,0,0},{2,2,4,0,0},{3,2,4,0,0},{4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0},{7,2,4,0,0},{8,2,4,0,0},{9,2,4,0,0},{10,2,4,0,0}, + {11,2,4,0,0},{12,2,4,0,0},{13,2,4,0,0},{0,3,4,0,0},{1,3,4,0,0},{2,3,4,0,0},{3,3,4,0,0},{4,3,4,0,0},{5,3,4,0,0},{6,3,4,0,0},{7,3,4,0,0},{8,3,4,0,0},{9,3,4,0,0},{10,3,4,0,0},{11,3,4,0,0},{12,3,4,0,0}, + {13,3,4,0,0},{1,4,4,201,0},{2,4,4,201,0},{3,4,4,0,0},{4,4,4,0,0},{5,4,4,0,0},{8,4,4,0,0},{9,4,4,0,0},{10,4,4,0,0},{11,4,4,201,0},{12,4,4,201,0},{0,5,4,0,0},{1,5,4,206,0},{2,5,4,0,0},{3,5,4,0,0},{4,5,4,0,0}, + {5,5,4,0,0},{6,5,4,0,0},{7,5,4,0,0},{8,5,4,0,0},{9,5,4,0,0},{10,5,4,0,0},{11,5,4,0,0},{12,5,4,206,0},{13,5,4,0,0},{0,6,4,0,0},{1,6,4,206,0},{2,6,4,0,0},{3,6,4,0,0},{4,6,4,0,0},{5,6,4,0,0},{6,6,4,0,0}, + {7,6,4,0,0},{8,6,4,0,0},{9,6,4,0,0},{10,6,4,0,0},{11,6,4,0,0},{12,6,4,206,0},{13,6,4,0,0},{0,7,4,0,0},{1,7,4,206,0},{2,7,4,0,0},{3,7,4,0,0},{4,7,4,0,0},{5,7,4,0,0},{6,7,4,0,0},{7,7,4,0,0},{8,7,4,0,0}, + {9,7,4,0,0},{10,7,4,0,0},{11,7,4,0,0},{12,7,4,206,0},{13,7,4,0,0},{0,0,5,0,0},{1,0,5,0,0},{2,0,5,0,0},{3,0,5,0,0},{4,0,5,0,0},{5,0,5,0,0},{6,0,5,0,0},{7,0,5,0,0},{8,0,5,0,0},{9,0,5,0,0},{10,0,5,0,0}, + {11,0,5,0,0},{12,0,5,0,0},{13,0,5,0,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,0,0},{3,1,5,0,0},{4,1,5,0,0},{5,1,5,0,0},{6,1,5,0,0},{7,1,5,0,0},{8,1,5,0,0},{9,1,5,0,0},{10,1,5,0,0},{11,1,5,0,0},{12,1,5,0,0}, + {13,1,5,0,0},{0,2,5,0,0},{1,2,5,0,0},{2,2,5,0,0},{3,2,5,0,0},{4,2,5,0,0},{5,2,5,0,0},{6,2,5,0,0},{7,2,5,0,0},{8,2,5,0,0},{9,2,5,0,0},{10,2,5,0,0},{11,2,5,0,0},{12,2,5,0,0},{13,2,5,0,0},{0,3,5,0,0}, + {1,3,5,0,0},{2,3,5,0,0},{3,3,5,0,0},{4,3,5,0,0},{5,3,5,0,0},{6,3,5,0,0},{7,3,5,0,0},{8,3,5,0,0},{9,3,5,0,0},{10,3,5,0,0},{11,3,5,0,0},{12,3,5,0,0},{13,3,5,0,0},{1,4,5,201,0},{2,4,5,201,0},{3,4,5,0,0}, + {4,4,5,0,0},{5,4,5,0,0},{6,4,5,0,0},{7,4,5,0,0},{8,4,5,0,0},{9,4,5,0,0},{10,4,5,0,0},{11,4,5,201,0},{12,4,5,201,0},{0,5,5,0,0},{1,5,5,206,0},{2,5,5,0,0},{3,5,5,0,0},{4,5,5,0,0},{5,5,5,0,0},{6,5,5,0,0}, + {7,5,5,0,0},{8,5,5,0,0},{9,5,5,0,0},{10,5,5,0,0},{11,5,5,0,0},{12,5,5,206,0},{13,5,5,0,0},{0,6,5,0,0},{2,6,5,0,0},{3,6,5,0,0},{4,6,5,0,0},{5,6,5,0,0},{6,6,5,0,0},{7,6,5,0,0},{8,6,5,0,0},{9,6,5,0,0}, + {10,6,5,0,0},{11,6,5,0,0},{13,6,5,0,0},{0,7,5,0,0},{2,7,5,0,0},{3,7,5,0,0},{4,7,5,0,0},{5,7,5,0,0},{6,7,5,0,0},{7,7,5,0,0},{8,7,5,0,0},{9,7,5,0,0},{10,7,5,0,0},{11,7,5,0,0},{13,7,5,0,0},{0,0,6,0,0}, + {1,0,6,0,0},{2,0,6,0,0},{3,0,6,0,0},{4,0,6,0,0},{5,0,6,0,0},{6,0,6,0,0},{7,0,6,0,0},{8,0,6,0,0},{9,0,6,0,0},{10,0,6,0,0},{11,0,6,0,0},{12,0,6,0,0},{13,0,6,0,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,0,0}, + {3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{7,1,6,0,0},{8,1,6,0,0},{9,1,6,0,0},{10,1,6,0,0},{11,1,6,0,0},{12,1,6,0,0},{13,1,6,0,0},{0,2,6,0,0},{1,2,6,0,0},{2,2,6,0,0},{3,2,6,0,0},{4,2,6,0,0}, + {5,2,6,0,0},{6,2,6,0,0},{7,2,6,0,0},{8,2,6,0,0},{9,2,6,0,0},{10,2,6,0,0},{11,2,6,0,0},{12,2,6,0,0},{13,2,6,0,0},{0,3,6,0,0},{1,3,6,0,0},{2,3,6,0,0},{3,3,6,0,0},{4,3,6,0,0},{5,3,6,0,0},{6,3,6,0,0}, + {7,3,6,0,0},{8,3,6,0,0},{9,3,6,0,0},{10,3,6,0,0},{11,3,6,0,0},{12,3,6,0,0},{13,3,6,0,0},{1,4,6,201,0},{2,4,6,201,0},{3,4,6,0,0},{4,4,6,0,0},{5,4,6,0,0},{6,4,6,0,0},{7,4,6,0,0},{8,4,6,0,0},{9,4,6,0,0}, + {10,4,6,0,0},{11,4,6,201,0},{12,4,6,201,0},{0,5,6,0,0},{1,5,6,206,0},{2,5,6,201,0},{3,5,6,0,0},{4,5,6,0,0},{5,5,6,0,0},{6,5,6,0,0},{7,5,6,0,0},{8,5,6,0,0},{9,5,6,0,0},{10,5,6,0,0},{11,5,6,201,0},{12,5,6,206,0}, + {13,5,6,0,0},{0,6,6,0,0},{1,6,6,206,0},{2,6,6,201,0},{3,6,6,0,0},{4,6,6,0,0},{5,6,6,0,0},{6,6,6,0,0},{7,6,6,0,0},{8,6,6,0,0},{9,6,6,0,0},{10,6,6,0,0},{11,6,6,201,0},{12,6,6,206,0},{13,6,6,0,0},{0,7,6,0,0}, + {1,7,6,206,0},{2,7,6,201,0},{3,7,6,0,0},{4,7,6,0,0},{5,7,6,0,0},{6,7,6,0,0},{7,7,6,0,0},{8,7,6,0,0},{9,7,6,0,0},{10,7,6,0,0},{11,7,6,201,0},{12,7,6,206,0},{13,7,6,0,0},{0,0,7,0,0},{1,0,7,0,0},{2,0,7,0,0}, + {3,0,7,0,0},{4,0,7,0,0},{5,0,7,0,0},{6,0,7,0,0},{7,0,7,0,0},{8,0,7,0,0},{9,0,7,0,0},{10,0,7,0,0},{11,0,7,0,0},{12,0,7,0,0},{13,0,7,0,0},{0,1,7,0,0},{1,1,7,0,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0}, + {5,1,7,0,0},{6,1,7,0,0},{7,1,7,0,0},{8,1,7,0,0},{9,1,7,0,0},{10,1,7,0,0},{11,1,7,0,0},{12,1,7,0,0},{13,1,7,0,0},{0,2,7,0,0},{1,2,7,0,0},{2,2,7,0,0},{3,2,7,0,0},{4,2,7,0,0},{5,2,7,0,0},{6,2,7,0,0}, + {7,2,7,0,0},{8,2,7,0,0},{9,2,7,0,0},{10,2,7,0,0},{11,2,7,0,0},{12,2,7,0,0},{13,2,7,0,0},{0,3,7,0,0},{1,3,7,0,0},{2,3,7,0,0},{3,3,7,0,0},{4,3,7,0,0},{5,3,7,0,0},{6,3,7,0,0},{7,3,7,0,0},{8,3,7,0,0}, + {9,3,7,0,0},{10,3,7,0,0},{11,3,7,0,0},{12,3,7,0,0},{13,3,7,0,0},{1,4,7,201,0},{2,4,7,201,0},{3,4,7,0,0},{4,4,7,0,0},{5,4,7,0,0},{6,4,7,0,0},{7,4,7,0,0},{8,4,7,0,0},{9,4,7,0,0},{10,4,7,0,0},{11,4,7,201,0}, + {12,4,7,201,0},{0,5,7,0,0},{1,5,7,206,0},{2,5,7,0,0},{3,5,7,0,0},{4,5,7,0,0},{5,5,7,0,0},{6,5,7,0,0},{7,5,7,0,0},{8,5,7,0,0},{9,5,7,0,0},{10,5,7,0,0},{11,5,7,0,0},{12,5,7,206,0},{13,5,7,0,0},{0,6,7,0,0}, + {1,6,7,206,0},{2,6,7,0,0},{3,6,7,0,0},{4,6,7,0,0},{5,6,7,0,0},{6,6,7,0,0},{7,6,7,0,0},{8,6,7,0,0},{9,6,7,0,0},{10,6,7,0,0},{11,6,7,0,0},{12,6,7,206,0},{13,6,7,0,0},{0,7,7,0,0},{1,7,7,206,0},{2,7,7,0,0}, + {3,7,7,0,0},{4,7,7,0,0},{5,7,7,0,0},{6,7,7,0,0},{7,7,7,0,0},{8,7,7,0,0},{9,7,7,0,0},{10,7,7,0,0},{11,7,7,0,0},{12,7,7,206,0},{13,7,7,0,0},{0,0,8,0,0},{1,0,8,0,0},{2,0,8,0,0},{3,0,8,0,0},{4,0,8,0,0}, + {5,0,8,0,0},{6,0,8,0,0},{7,0,8,0,0},{8,0,8,0,0},{9,0,8,0,0},{10,0,8,0,0},{11,0,8,0,0},{12,0,8,0,0},{13,0,8,0,0},{0,1,8,0,0},{1,1,8,0,0},{2,1,8,0,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,0,0}, + {7,1,8,0,0},{8,1,8,0,0},{9,1,8,0,0},{10,1,8,0,0},{11,1,8,0,0},{12,1,8,0,0},{13,1,8,0,0},{0,2,8,0,0},{1,2,8,0,0},{2,2,8,0,0},{3,2,8,0,0},{4,2,8,0,0},{5,2,8,0,0},{6,2,8,0,0},{7,2,8,0,0},{8,2,8,0,0}, + {9,2,8,0,0},{10,2,8,0,0},{11,2,8,0,0},{12,2,8,0,0},{13,2,8,0,0},{0,3,8,0,0},{1,3,8,0,0},{2,3,8,0,0},{3,3,8,0,0},{4,3,8,0,0},{5,3,8,0,0},{6,3,8,0,0},{7,3,8,0,0},{8,3,8,0,0},{9,3,8,0,0},{10,3,8,0,0}, + {11,3,8,0,0},{12,3,8,0,0},{13,3,8,0,0},{1,4,8,201,0},{2,4,8,201,0},{3,4,8,0,0},{4,4,8,0,0},{5,4,8,201,0},{6,4,8,201,0},{7,4,8,201,0},{8,4,8,201,0},{9,4,8,0,0},{10,4,8,0,0},{11,4,8,201,0},{12,4,8,201,0},{0,5,8,0,0}, + {1,5,8,206,0},{2,5,8,201,0},{3,5,8,0,0},{4,5,8,0,0},{5,5,8,201,0},{6,5,8,0,0},{7,5,8,0,0},{8,5,8,201,0},{9,5,8,0,0},{10,5,8,0,0},{11,5,8,201,0},{12,5,8,206,0},{13,5,8,0,0},{0,6,8,0,0},{1,6,8,206,0},{2,6,8,201,0}, + {3,6,8,201,0},{4,6,8,201,0},{5,6,8,201,0},{6,6,8,0,0},{7,6,8,0,0},{8,6,8,201,0},{9,6,8,201,0},{10,6,8,201,0},{11,6,8,201,0},{12,6,8,206,0},{13,6,8,0,0},{0,7,8,0,0},{1,7,8,206,0},{2,7,8,201,0},{3,7,8,0,0},{4,7,8,0,0}, + {5,7,8,0,0},{6,7,8,0,0},{7,7,8,0,0},{8,7,8,0,0},{9,7,8,0,0},{10,7,8,0,0},{11,7,8,201,0},{12,7,8,206,0},{13,7,8,0,0},{0,0,9,0,0},{1,0,9,0,0},{2,0,9,0,0},{3,0,9,0,0},{4,0,9,201,0},{5,0,9,201,0},{6,0,9,201,0}, + {7,0,9,0,0},{8,0,9,0,0},{9,0,9,0,0},{10,0,9,0,0},{11,0,9,0,0},{12,0,9,0,0},{13,0,9,0,0},{0,1,9,0,0},{1,1,9,0,0},{2,1,9,0,0},{3,1,9,0,0},{5,1,9,201,0},{6,1,9,201,0},{7,1,9,0,0},{8,1,9,0,0},{9,1,9,0,0}, + {10,1,9,0,0},{11,1,9,0,0},{12,1,9,0,0},{13,1,9,0,0},{0,2,9,0,0},{1,2,9,0,0},{2,2,9,0,0},{3,2,9,0,0},{4,2,9,0,0},{6,2,9,201,0},{7,2,9,0,0},{8,2,9,0,0},{9,2,9,0,0},{10,2,9,0,0},{11,2,9,0,0},{12,2,9,0,0}, + {13,2,9,0,0},{0,3,9,0,0},{1,3,9,0,0},{2,3,9,0,0},{3,3,9,0,0},{4,3,9,0,0},{5,3,9,0,0},{6,3,9,0,0},{7,3,9,0,0},{8,3,9,0,0},{9,3,9,0,0},{10,3,9,0,0},{11,3,9,0,0},{12,3,9,0,0},{13,3,9,0,0},{1,4,9,201,0}, + {2,4,9,201,0},{3,4,9,0,0},{4,4,9,0,0},{5,4,9,0,0},{6,4,9,0,0},{7,4,9,0,0},{8,4,9,0,0},{9,4,9,0,0},{10,4,9,0,0},{11,4,9,201,0},{12,4,9,201,0},{0,5,9,0,0},{1,5,9,206,0},{2,5,9,0,0},{3,5,9,0,0},{4,5,9,0,0}, + {5,5,9,0,0},{6,5,9,0,0},{7,5,9,0,0},{8,5,9,0,0},{9,5,9,0,0},{10,5,9,0,0},{11,5,9,0,0},{12,5,9,206,0},{13,5,9,0,0},{0,6,9,0,0},{1,6,9,206,0},{2,6,9,0,0},{3,6,9,0,0},{4,6,9,0,0},{5,6,9,0,0},{6,6,9,0,0}, + {7,6,9,0,0},{8,6,9,0,0},{9,6,9,0,0},{10,6,9,0,0},{11,6,9,0,0},{12,6,9,206,0},{13,6,9,0,0},{0,7,9,0,0},{1,7,9,206,0},{2,7,9,0,0},{3,7,9,0,0},{4,7,9,0,0},{5,7,9,0,0},{6,7,9,0,0},{7,7,9,0,0},{8,7,9,0,0}, + {9,7,9,0,0},{10,7,9,0,0},{11,7,9,0,0},{12,7,9,206,0},{13,7,9,0,0},{0,0,10,0,0},{1,0,10,0,0},{2,0,10,0,0},{3,0,10,0,0},{4,0,10,0,0},{5,0,10,0,0},{6,0,10,201,0},{7,0,10,201,0},{8,0,10,201,0},{9,0,10,201,0},{10,0,10,0,0}, + {11,0,10,0,0},{12,0,10,0,0},{13,0,10,0,0},{0,1,10,0,0},{1,1,10,0,0},{2,1,10,0,0},{3,1,10,0,0},{4,1,10,0,0},{5,1,10,0,0},{6,1,10,201,0},{7,1,10,201,0},{8,1,10,201,0},{9,1,10,201,0},{10,1,10,0,0},{11,1,10,0,0},{12,1,10,0,0}, + {13,1,10,0,0},{0,2,10,0,0},{1,2,10,0,0},{2,2,10,0,0},{3,2,10,0,0},{4,2,10,0,0},{5,2,10,0,0},{6,2,10,201,0},{7,2,10,201,0},{8,2,10,201,0},{9,2,10,201,0},{10,2,10,0,0},{11,2,10,0,0},{12,2,10,0,0},{13,2,10,0,0},{0,3,10,0,0}, + {1,3,10,0,0},{2,3,10,0,0},{3,3,10,0,0},{4,3,10,0,0},{5,3,10,0,0},{6,3,10,0,0},{7,3,10,0,0},{9,3,10,201,0},{10,3,10,0,0},{11,3,10,0,0},{12,3,10,0,0},{13,3,10,0,0},{1,4,10,201,0},{2,4,10,201,0},{3,4,10,0,0},{4,4,10,0,0}, + {5,4,10,0,0},{6,4,10,0,0},{7,4,10,0,0},{8,4,10,0,0},{10,4,10,201,0},{11,4,10,201,0},{12,4,10,201,0},{0,5,10,0,0},{1,5,10,206,0},{2,5,10,201,0},{3,5,10,0,0},{4,5,10,0,0},{5,5,10,0,0},{6,5,10,0,0},{7,5,10,0,0},{8,5,10,0,0}, + {9,5,10,0,0},{10,5,10,0,0},{11,5,10,201,0},{12,5,10,206,0},{13,5,10,0,0},{0,6,10,0,0},{1,6,10,206,0},{2,6,10,201,0},{3,6,10,0,0},{4,6,10,0,0},{5,6,10,0,0},{6,6,10,0,0},{7,6,10,0,0},{8,6,10,0,0},{9,6,10,0,0},{10,6,10,0,0}, + {11,6,10,201,0},{12,6,10,206,0},{13,6,10,0,0},{0,7,10,0,0},{1,7,10,206,0},{2,7,10,201,0},{3,7,10,0,0},{4,7,10,0,0},{5,7,10,0,0},{6,7,10,0,0},{7,7,10,0,0},{8,7,10,0,0},{9,7,10,0,0},{10,7,10,0,0},{11,7,10,201,0},{12,7,10,206,0}, + {13,7,10,0,0},{0,0,11,0,0},{1,0,11,0,0},{2,0,11,0,0},{3,0,11,0,0},{4,0,11,0,0},{5,0,11,0,0},{6,0,11,0,0},{7,0,11,0,0},{8,0,11,0,0},{9,0,11,0,0},{10,0,11,0,0},{11,0,11,0,0},{12,0,11,0,0},{13,0,11,0,0},{0,1,11,0,0}, + {1,1,11,0,0},{2,1,11,0,0},{3,1,11,0,0},{4,1,11,0,0},{5,1,11,0,0},{6,1,11,0,0},{7,1,11,0,0},{8,1,11,0,0},{9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0},{12,1,11,0,0},{13,1,11,0,0},{0,2,11,0,0},{1,2,11,0,0},{2,2,11,0,0}, + {3,2,11,0,0},{4,2,11,0,0},{5,2,11,0,0},{6,2,11,0,0},{7,2,11,0,0},{8,2,11,0,0},{9,2,11,206,0},{10,2,11,0,0},{11,2,11,0,0},{12,2,11,0,0},{13,2,11,0,0},{0,3,11,0,0},{1,3,11,0,0},{2,3,11,0,0},{3,3,11,0,0},{4,3,11,0,0}, + {5,3,11,0,0},{6,3,11,0,0},{7,3,11,0,0},{8,3,11,0,0},{9,3,11,206,0},{10,3,11,0,0},{11,3,11,0,0},{12,3,11,0,0},{13,3,11,0,0},{1,4,11,201,0},{2,4,11,201,0},{3,4,11,201,0},{4,4,11,201,0},{5,4,11,201,0},{6,4,11,201,0},{7,4,11,201,0}, + {8,4,11,201,0},{9,4,11,201,0},{10,4,11,201,0},{11,4,11,201,0},{12,4,11,201,0},{0,5,11,0,0},{1,5,11,206,0},{2,5,11,0,0},{3,5,11,0,0},{4,5,11,0,0},{5,5,11,0,0},{6,5,11,0,0},{7,5,11,0,0},{8,5,11,0,0},{9,5,11,0,0},{10,5,11,0,0}, + {11,5,11,0,0},{12,5,11,206,0},{13,5,11,0,0},{0,6,11,0,0},{1,6,11,206,0},{2,6,11,0,0},{3,6,11,0,0},{4,6,11,0,0},{5,6,11,0,0},{6,6,11,0,0},{7,6,11,0,0},{8,6,11,0,0},{9,6,11,0,0},{10,6,11,0,0},{11,6,11,0,0},{12,6,11,206,0}, + {13,6,11,0,0},{0,7,11,0,0},{1,7,11,206,0},{2,7,11,0,0},{3,7,11,0,0},{4,7,11,0,0},{5,7,11,0,0},{6,7,11,0,0},{7,7,11,0,0},{8,7,11,0,0},{9,7,11,0,0},{10,7,11,0,0},{11,7,11,0,0},{12,7,11,206,0},{13,7,11,0,0},{0,0,12,0,0}, + {1,0,12,0,0},{2,0,12,0,0},{3,0,12,0,0},{4,0,12,0,0},{5,0,12,0,0},{6,0,12,0,0},{7,0,12,0,0},{8,0,12,0,0},{9,0,12,0,0},{10,0,12,0,0},{11,0,12,0,0},{12,0,12,0,0},{13,0,12,0,0},{0,1,12,0,0},{1,1,12,0,0},{2,1,12,0,0}, + {3,1,12,0,0},{4,1,12,0,0},{5,1,12,0,0},{6,1,12,0,0},{7,1,12,0,0},{8,1,12,0,0},{9,1,12,0,0},{10,1,12,0,0},{11,1,12,0,0},{12,1,12,0,0},{13,1,12,0,0},{0,2,12,0,0},{1,2,12,0,0},{2,2,12,0,0},{3,2,12,0,0},{4,2,12,0,0}, + {5,2,12,0,0},{6,2,12,0,0},{7,2,12,0,0},{8,2,12,0,0},{9,2,12,0,0},{10,2,12,0,0},{11,2,12,0,0},{12,2,12,0,0},{13,2,12,0,0},{0,3,12,0,0},{1,3,12,0,0},{2,3,12,0,0},{3,3,12,0,0},{4,3,12,0,0},{5,3,12,0,0},{6,3,12,0,0}, + {7,3,12,0,0},{8,3,12,0,0},{9,3,12,0,0},{10,3,12,0,0},{11,3,12,0,0},{12,3,12,0,0},{13,3,12,0,0},{1,4,12,201,0},{2,4,12,201,0},{3,4,12,201,0},{4,4,12,201,0},{5,4,12,201,0},{6,4,12,201,0},{7,4,12,201,0},{8,4,12,201,0},{9,4,12,201,0}, + {10,4,12,201,0},{11,4,12,201,0},{12,4,12,201,0},{0,5,12,0,0},{1,5,12,202,0},{2,5,12,206,0},{3,5,12,206,0},{4,5,12,206,0},{5,5,12,206,0},{6,5,12,206,0},{7,5,12,206,0},{8,5,12,206,0},{9,5,12,206,0},{10,5,12,206,0},{11,5,12,206,0},{12,5,12,202,0}, + {13,5,12,0,0},{0,6,12,0,0},{1,6,12,202,0},{2,6,12,206,0},{4,6,12,206,0},{6,6,12,206,0},{7,6,12,206,0},{9,6,12,206,0},{11,6,12,206,0},{12,6,12,202,0},{13,6,12,0,0},{0,7,12,0,0},{1,7,12,202,0},{2,7,12,206,0},{4,7,12,206,0},{6,7,12,206,0}, + {7,7,12,206,0},{9,7,12,206,0},{11,7,12,206,0},{12,7,12,202,0},{13,7,12,0,0},{0,0,13,0,0},{1,0,13,0,0},{2,0,13,0,0},{3,0,13,0,0},{4,0,13,0,0},{5,0,13,0,0},{6,0,13,0,0},{7,0,13,0,0},{8,0,13,0,0},{9,0,13,0,0},{10,0,13,0,0}, + {11,0,13,0,0},{12,0,13,0,0},{13,0,13,0,0},{0,1,13,0,0},{1,1,13,0,0},{2,1,13,0,0},{3,1,13,0,0},{4,1,13,0,0},{5,1,13,0,0},{6,1,13,0,0},{7,1,13,0,0},{8,1,13,0,0},{9,1,13,0,0},{10,1,13,0,0},{11,1,13,0,0},{12,1,13,0,0}, + {13,1,13,0,0},{0,2,13,0,0},{1,2,13,0,0},{2,2,13,0,0},{3,2,13,0,0},{4,2,13,0,0},{5,2,13,0,0},{6,2,13,0,0},{7,2,13,0,0},{8,2,13,0,0},{9,2,13,0,0},{10,2,13,0,0},{11,2,13,0,0},{12,2,13,0,0},{13,2,13,0,0},{0,3,13,0,0}, + {1,3,13,0,0},{2,3,13,0,0},{3,3,13,0,0},{4,3,13,0,0},{5,3,13,0,0},{6,3,13,0,0},{7,3,13,0,0},{8,3,13,0,0},{9,3,13,0,0},{10,3,13,0,0},{11,3,13,0,0},{12,3,13,0,0},{13,3,13,0,0},{1,5,13,0,0},{2,5,13,0,0},{3,5,13,0,0}, + {4,5,13,0,0},{5,5,13,0,0},{6,5,13,0,0},{7,5,13,0,0},{8,5,13,0,0},{9,5,13,0,0},{10,5,13,0,0},{11,5,13,0,0},{12,5,13,0,0},{0,6,13,0,0},{1,6,13,0,0},{2,6,13,0,0},{3,6,13,0,0},{4,6,13,0,0},{5,6,13,0,0},{6,6,13,0,0}, + {7,6,13,0,0},{8,6,13,0,0},{9,6,13,0,0},{10,6,13,0,0},{11,6,13,0,0},{12,6,13,0,0},{13,6,13,0,0},{0,7,13,0,0},{1,7,13,0,0},{2,7,13,0,0},{3,7,13,0,0},{4,7,13,0,0},{5,7,13,0,0},{6,7,13,0,0},{7,7,13,0,0},{8,7,13,0,0}, + {9,7,13,0,0},{10,7,13,0,0},{11,7,13,0,0},{12,7,13,0,0},{13,7,13,0,0},{6,5,2,54,3},{7,5,2,130,3},{0,4,0,203,4},{1,4,0,203,6},{2,4,0,203,2},{3,4,0,203,2},{4,4,0,203,6},{5,4,0,203,6},{6,4,0,203,2},{7,4,0,203,2},{8,4,0,203,6}, + {9,4,0,203,6},{10,4,0,203,2},{11,4,0,203,2},{12,4,0,203,6},{13,4,0,203,6},{0,5,0,198,1},{13,5,0,198,1},{0,4,1,203,4},{13,4,1,203,5},{3,6,1,95,2},{5,6,1,95,2},{8,6,1,95,2},{10,6,1,95,2},{3,7,1,95,2},{5,7,1,95,2},{8,7,1,95,2}, + {10,7,1,95,2},{0,4,2,203,0},{13,4,2,203,1},{0,4,3,203,0},{13,4,3,203,1},{1,6,3,95,2},{12,6,3,95,2},{1,7,3,95,2},{12,7,3,95,2},{0,4,4,203,4},{6,4,4,198,3},{7,4,4,198,3},{13,4,4,203,5},{0,4,5,203,4},{13,4,5,203,5},{1,6,5,95,2}, + {12,6,5,95,2},{1,7,5,95,2},{12,7,5,95,2},{0,4,6,203,0},{13,4,6,203,1},{0,4,7,203,0},{13,4,7,203,1},{0,4,8,203,4},{13,4,8,203,5},{4,1,9,203,0},{5,2,9,203,0},{0,4,9,203,4},{13,4,9,203,5},{8,3,10,203,0},{0,4,10,203,0},{9,4,10,203,0}, + {13,4,10,203,1},{0,4,11,203,0},{13,4,11,203,1},{0,4,12,203,4},{13,4,12,203,5},{3,6,12,95,2},{5,6,12,95,2},{8,6,12,95,2},{10,6,12,95,2},{3,7,12,95,2},{5,7,12,95,2},{8,7,12,95,2},{10,7,12,95,2},{0,4,13,203,7},{1,4,13,203,7},{2,4,13,203,3}, + {3,4,13,203,3},{4,4,13,203,7},{5,4,13,203,7},{6,4,13,203,3},{7,4,13,203,3},{8,4,13,203,7},{9,4,13,203,7},{10,4,13,203,3},{11,4,13,203,3},{12,4,13,203,7},{13,4,13,203,5},{0,5,13,198,1},{13,5,13,198,1}, +}; +static const EndCityTemplates::Extra s_third_floor_c_extras[] = { + {2,5,2,EndCityTemplates::EXTRA_SENTRY,0},{11,5,2,EndCityTemplates::EXTRA_SENTRY,0},{6,6,2,EndCityTemplates::EXTRA_CHEST_LOOT,0}, +}; + +static const EndCityTemplates::Block s_third_roof_blocks[] = { + {0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0},{9,1,0,0,0},{10,1,0,0,0},{11,1,0,0,0},{12,1,0,0,0},{13,1,0,0,0},{14,1,0,0,0},{15,1,0,0,0}, + {1,0,1,201,0},{2,0,1,201,0},{3,0,1,201,0},{4,0,1,201,0},{5,0,1,201,0},{6,0,1,201,0},{7,0,1,201,0},{8,0,1,201,0},{9,0,1,201,0},{10,0,1,201,0},{11,0,1,201,0},{12,0,1,201,0},{13,0,1,201,0},{14,0,1,201,0},{0,1,1,0,0},{2,1,1,0,0}, + {3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0},{7,1,1,0,0},{8,1,1,0,0},{9,1,1,0,0},{10,1,1,0,0},{11,1,1,0,0},{12,1,1,0,0},{13,1,1,0,0},{15,1,1,0,0},{1,0,2,201,0},{2,0,2,201,0},{3,0,2,201,0},{4,0,2,201,0}, + {5,0,2,201,0},{6,0,2,201,0},{7,0,2,201,0},{8,0,2,201,0},{9,0,2,201,0},{10,0,2,201,0},{11,0,2,201,0},{12,0,2,201,0},{13,0,2,201,0},{14,0,2,201,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{5,1,2,0,0}, + {6,1,2,0,0},{7,1,2,0,0},{8,1,2,0,0},{9,1,2,0,0},{10,1,2,0,0},{11,1,2,0,0},{12,1,2,0,0},{13,1,2,0,0},{14,1,2,0,0},{15,1,2,0,0},{1,0,3,201,0},{2,0,3,201,0},{3,0,3,201,0},{4,0,3,201,0},{5,0,3,201,0},{6,0,3,201,0}, + {7,0,3,201,0},{8,0,3,201,0},{9,0,3,201,0},{10,0,3,201,0},{11,0,3,201,0},{12,0,3,201,0},{13,0,3,201,0},{14,0,3,201,0},{0,1,3,0,0},{1,1,3,0,0},{2,1,3,0,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0}, + {8,1,3,0,0},{9,1,3,0,0},{10,1,3,0,0},{11,1,3,0,0},{12,1,3,0,0},{13,1,3,0,0},{14,1,3,0,0},{15,1,3,0,0},{1,0,4,201,0},{2,0,4,201,0},{3,0,4,201,0},{4,0,4,201,0},{5,0,4,201,0},{6,0,4,201,0},{7,0,4,201,0},{8,0,4,201,0}, + {9,0,4,201,0},{10,0,4,201,0},{11,0,4,201,0},{12,0,4,201,0},{13,0,4,201,0},{14,0,4,201,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0},{7,1,4,0,0},{8,1,4,0,0},{9,1,4,0,0}, + {10,1,4,0,0},{11,1,4,0,0},{12,1,4,0,0},{13,1,4,0,0},{14,1,4,0,0},{15,1,4,0,0},{1,0,5,201,0},{2,0,5,201,0},{3,0,5,201,0},{4,0,5,201,0},{5,0,5,201,0},{6,0,5,201,0},{7,0,5,201,0},{8,0,5,201,0},{9,0,5,201,0},{10,0,5,201,0}, + {11,0,5,201,0},{12,0,5,201,0},{13,0,5,201,0},{14,0,5,201,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,0,0},{3,1,5,0,0},{4,1,5,0,0},{5,1,5,0,0},{6,1,5,0,0},{7,1,5,0,0},{8,1,5,0,0},{9,1,5,0,0},{10,1,5,0,0},{11,1,5,0,0}, + {12,1,5,0,0},{13,1,5,0,0},{14,1,5,0,0},{15,1,5,0,0},{1,0,6,201,0},{2,0,6,201,0},{3,0,6,201,0},{4,0,6,201,0},{5,0,6,201,0},{6,0,6,201,0},{7,0,6,201,0},{8,0,6,201,0},{9,0,6,201,0},{10,0,6,201,0},{11,0,6,201,0},{12,0,6,201,0}, + {13,0,6,201,0},{14,0,6,201,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{7,1,6,0,0},{8,1,6,0,0},{9,1,6,0,0},{10,1,6,0,0},{11,1,6,0,0},{12,1,6,0,0},{13,1,6,0,0}, + {14,1,6,0,0},{15,1,6,0,0},{1,0,7,201,0},{2,0,7,201,0},{3,0,7,201,0},{4,0,7,201,0},{5,0,7,201,0},{6,0,7,201,0},{7,0,7,201,0},{8,0,7,201,0},{9,0,7,201,0},{10,0,7,201,0},{11,0,7,201,0},{12,0,7,201,0},{13,0,7,201,0},{14,0,7,201,0}, + {0,1,7,0,0},{1,1,7,0,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{6,1,7,0,0},{7,1,7,0,0},{8,1,7,0,0},{9,1,7,0,0},{10,1,7,0,0},{11,1,7,0,0},{12,1,7,0,0},{13,1,7,0,0},{14,1,7,0,0},{15,1,7,0,0}, + {1,0,8,201,0},{2,0,8,201,0},{3,0,8,201,0},{4,0,8,201,0},{5,0,8,201,0},{6,0,8,201,0},{7,0,8,201,0},{8,0,8,201,0},{9,0,8,201,0},{10,0,8,201,0},{11,0,8,201,0},{12,0,8,201,0},{13,0,8,201,0},{14,0,8,201,0},{0,1,8,0,0},{1,1,8,0,0}, + {2,1,8,0,0},{3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,0,0},{7,1,8,0,0},{8,1,8,0,0},{9,1,8,0,0},{10,1,8,0,0},{11,1,8,0,0},{12,1,8,0,0},{13,1,8,0,0},{14,1,8,0,0},{15,1,8,0,0},{1,0,9,201,0},{2,0,9,201,0}, + {3,0,9,201,0},{4,0,9,201,0},{5,0,9,201,0},{6,0,9,201,0},{7,0,9,201,0},{8,0,9,201,0},{9,0,9,201,0},{10,0,9,201,0},{11,0,9,201,0},{12,0,9,201,0},{13,0,9,201,0},{14,0,9,201,0},{0,1,9,0,0},{1,1,9,0,0},{2,1,9,0,0},{3,1,9,0,0}, + {4,1,9,0,0},{5,1,9,0,0},{6,1,9,0,0},{7,1,9,0,0},{8,1,9,0,0},{9,1,9,0,0},{10,1,9,0,0},{11,1,9,0,0},{12,1,9,0,0},{13,1,9,0,0},{14,1,9,0,0},{15,1,9,0,0},{1,0,10,201,0},{2,0,10,201,0},{3,0,10,201,0},{4,0,10,201,0}, + {5,0,10,201,0},{6,0,10,201,0},{7,0,10,201,0},{8,0,10,201,0},{9,0,10,201,0},{10,0,10,201,0},{11,0,10,201,0},{12,0,10,201,0},{13,0,10,201,0},{14,0,10,201,0},{0,1,10,0,0},{1,1,10,0,0},{2,1,10,0,0},{3,1,10,0,0},{4,1,10,0,0},{5,1,10,0,0}, + {6,1,10,0,0},{7,1,10,0,0},{8,1,10,0,0},{9,1,10,0,0},{10,1,10,0,0},{11,1,10,0,0},{12,1,10,0,0},{13,1,10,0,0},{14,1,10,0,0},{15,1,10,0,0},{1,0,11,201,0},{2,0,11,201,0},{3,0,11,201,0},{4,0,11,201,0},{5,0,11,201,0},{6,0,11,201,0}, + {7,0,11,201,0},{8,0,11,201,0},{9,0,11,201,0},{10,0,11,201,0},{11,0,11,201,0},{12,0,11,201,0},{13,0,11,201,0},{14,0,11,201,0},{0,1,11,0,0},{1,1,11,0,0},{2,1,11,0,0},{3,1,11,0,0},{4,1,11,0,0},{5,1,11,0,0},{6,1,11,0,0},{7,1,11,0,0}, + {8,1,11,0,0},{9,1,11,0,0},{10,1,11,0,0},{11,1,11,0,0},{12,1,11,0,0},{13,1,11,0,0},{14,1,11,0,0},{15,1,11,0,0},{1,0,12,201,0},{2,0,12,201,0},{3,0,12,201,0},{4,0,12,201,0},{5,0,12,201,0},{6,0,12,201,0},{7,0,12,201,0},{8,0,12,201,0}, + {9,0,12,201,0},{10,0,12,201,0},{11,0,12,201,0},{12,0,12,201,0},{13,0,12,201,0},{14,0,12,201,0},{0,1,12,0,0},{1,1,12,0,0},{2,1,12,0,0},{3,1,12,0,0},{4,1,12,0,0},{5,1,12,0,0},{6,1,12,0,0},{7,1,12,0,0},{8,1,12,0,0},{9,1,12,0,0}, + {10,1,12,0,0},{11,1,12,0,0},{12,1,12,0,0},{13,1,12,0,0},{14,1,12,0,0},{15,1,12,0,0},{1,0,13,201,0},{2,0,13,201,0},{3,0,13,201,0},{4,0,13,201,0},{5,0,13,201,0},{6,0,13,201,0},{7,0,13,201,0},{8,0,13,201,0},{9,0,13,201,0},{10,0,13,201,0}, + {11,0,13,201,0},{12,0,13,201,0},{13,0,13,201,0},{14,0,13,201,0},{0,1,13,0,0},{1,1,13,0,0},{2,1,13,0,0},{3,1,13,0,0},{4,1,13,0,0},{5,1,13,0,0},{6,1,13,0,0},{7,1,13,0,0},{8,1,13,0,0},{9,1,13,0,0},{10,1,13,0,0},{11,1,13,0,0}, + {12,1,13,0,0},{13,1,13,0,0},{14,1,13,0,0},{15,1,13,0,0},{1,0,14,201,0},{2,0,14,201,0},{3,0,14,201,0},{4,0,14,201,0},{5,0,14,201,0},{6,0,14,201,0},{7,0,14,201,0},{8,0,14,201,0},{9,0,14,201,0},{10,0,14,201,0},{11,0,14,201,0},{12,0,14,201,0}, + {13,0,14,201,0},{14,0,14,201,0},{0,1,14,0,0},{2,1,14,0,0},{3,1,14,0,0},{4,1,14,0,0},{5,1,14,0,0},{6,1,14,0,0},{7,1,14,0,0},{8,1,14,0,0},{9,1,14,0,0},{10,1,14,0,0},{11,1,14,0,0},{12,1,14,0,0},{13,1,14,0,0},{15,1,14,0,0}, + {0,1,15,0,0},{1,1,15,0,0},{2,1,15,0,0},{3,1,15,0,0},{4,1,15,0,0},{5,1,15,0,0},{6,1,15,0,0},{7,1,15,0,0},{8,1,15,0,0},{9,1,15,0,0},{10,1,15,0,0},{11,1,15,0,0},{12,1,15,0,0},{13,1,15,0,0},{14,1,15,0,0},{15,1,15,0,0}, + {0,0,0,203,4},{1,0,0,203,6},{2,0,0,203,2},{3,0,0,203,2},{4,0,0,203,6},{5,0,0,203,6},{6,0,0,203,2},{7,0,0,203,6},{8,0,0,203,6},{9,0,0,203,2},{10,0,0,203,6},{11,0,0,203,6},{12,0,0,203,2},{13,0,0,203,2},{14,0,0,203,6},{15,0,0,203,5}, + {0,0,1,203,4},{15,0,1,203,5},{1,1,1,198,1},{14,1,1,198,1},{0,0,2,203,0},{15,0,2,203,1},{0,0,3,203,0},{15,0,3,203,1},{0,0,4,203,4},{15,0,4,203,5},{0,0,5,203,4},{15,0,5,203,5},{0,0,6,203,0},{15,0,6,203,1},{0,0,7,203,4},{15,0,7,203,5}, + {0,0,8,203,4},{15,0,8,203,5},{0,0,9,203,0},{15,0,9,203,1},{0,0,10,203,4},{15,0,10,203,5},{0,0,11,203,4},{15,0,11,203,5},{0,0,12,203,0},{15,0,12,203,1},{0,0,13,203,0},{15,0,13,203,1},{0,0,14,203,4},{15,0,14,203,5},{1,1,14,198,1},{14,1,14,198,1}, + {0,0,15,203,4},{1,0,15,203,7},{2,0,15,203,3},{3,0,15,203,3},{4,0,15,203,7},{5,0,15,203,7},{6,0,15,203,3},{7,0,15,203,7},{8,0,15,203,7},{9,0,15,203,3},{10,0,15,203,7},{11,0,15,203,7},{12,0,15,203,3},{13,0,15,203,3},{14,0,15,203,7},{15,0,15,203,7}, +}; + +static const EndCityTemplates::Block s_tower_base_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0}, + {2,2,0,0,0},{3,2,0,0,0},{4,2,0,0,0},{5,2,0,0,0},{6,2,0,0,0},{0,3,0,201,0},{1,3,0,201,0},{2,3,0,201,0},{3,3,0,201,0},{4,3,0,201,0},{5,3,0,201,0},{6,3,0,201,0},{0,4,0,0,0},{1,4,0,0,0},{2,4,0,0,0},{3,4,0,0,0}, + {4,4,0,0,0},{5,4,0,0,0},{6,4,0,0,0},{0,5,0,0,0},{1,5,0,0,0},{2,5,0,0,0},{4,5,0,0,0},{5,5,0,0,0},{6,5,0,0,0},{0,6,0,0,0},{1,6,0,0,0},{2,6,0,0,0},{3,6,0,0,0},{4,6,0,0,0},{5,6,0,0,0},{6,6,0,0,0}, + {0,0,1,0,0},{1,0,1,0,0},{2,0,1,0,0},{3,0,1,0,0},{4,0,1,0,0},{5,0,1,0,0},{6,0,1,0,0},{0,1,1,0,0},{1,1,1,0,0},{2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0}, + {2,2,1,0,0},{3,2,1,0,0},{4,2,1,0,0},{5,2,1,0,0},{6,2,1,0,0},{0,3,1,201,0},{1,3,1,201,0},{2,3,1,201,0},{3,3,1,201,0},{4,3,1,201,0},{5,3,1,201,0},{6,3,1,201,0},{0,4,1,0,0},{1,4,1,0,0},{2,4,1,202,0},{3,4,1,202,0}, + {4,4,1,202,0},{5,4,1,0,0},{6,4,1,0,0},{0,5,1,0,0},{1,5,1,0,0},{2,5,1,202,0},{3,5,1,202,8},{4,5,1,202,0},{5,5,1,0,0},{6,5,1,0,0},{0,6,1,0,0},{1,6,1,0,0},{2,6,1,202,0},{3,6,1,202,0},{4,6,1,202,0},{5,6,1,0,0}, + {6,6,1,0,0},{0,0,2,0,0},{1,0,2,0,0},{2,0,2,0,0},{3,0,2,0,0},{4,0,2,0,0},{5,0,2,0,0},{6,0,2,0,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,0,0},{3,1,2,0,0},{4,1,2,0,0},{5,1,2,0,0},{6,1,2,0,0},{0,2,2,0,0}, + {1,2,2,0,0},{2,2,2,0,0},{3,2,2,0,0},{4,2,2,0,0},{5,2,2,0,0},{6,2,2,0,0},{0,3,2,201,0},{1,3,2,201,0},{2,3,2,0,0},{3,3,2,0,0},{4,3,2,0,0},{5,3,2,201,0},{6,3,2,201,0},{0,4,2,0,0},{1,4,2,202,0},{2,4,2,0,0}, + {4,4,2,0,0},{5,4,2,202,0},{6,4,2,0,0},{0,5,2,0,0},{1,5,2,202,0},{2,5,2,0,0},{3,5,2,0,0},{4,5,2,0,0},{5,5,2,202,0},{6,5,2,0,0},{0,6,2,0,0},{1,6,2,202,0},{2,6,2,0,0},{3,6,2,0,0},{4,6,2,0,0},{5,6,2,202,0}, + {6,6,2,0,0},{0,0,3,0,0},{1,0,3,0,0},{2,0,3,0,0},{3,0,3,0,0},{4,0,3,0,0},{5,0,3,0,0},{6,0,3,0,0},{0,1,3,0,0},{1,1,3,0,0},{2,1,3,0,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{0,2,3,0,0}, + {1,2,3,0,0},{2,2,3,0,0},{3,2,3,0,0},{4,2,3,0,0},{5,2,3,0,0},{6,2,3,0,0},{0,3,3,201,0},{1,3,3,201,0},{3,3,3,0,0},{4,3,3,0,0},{5,3,3,201,0},{6,3,3,201,0},{0,4,3,0,0},{1,4,3,202,0},{2,4,3,0,0},{3,4,3,0,0}, + {4,4,3,0,0},{5,4,3,202,0},{6,4,3,0,0},{1,5,3,202,4},{2,5,3,0,0},{3,5,3,0,0},{5,5,3,202,4},{0,6,3,0,0},{1,6,3,202,0},{2,6,3,0,0},{3,6,3,0,0},{4,6,3,0,0},{5,6,3,202,0},{6,6,3,0,0},{0,0,4,0,0},{1,0,4,0,0}, + {2,0,4,0,0},{4,0,4,0,0},{5,0,4,0,0},{6,0,4,0,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0},{0,2,4,0,0},{1,2,4,0,0},{2,2,4,0,0},{4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0}, + {0,3,4,201,0},{1,3,4,201,0},{2,3,4,0,0},{3,3,4,0,0},{4,3,4,0,0},{5,3,4,201,0},{6,3,4,201,0},{0,4,4,0,0},{1,4,4,202,0},{2,4,4,0,0},{3,4,4,0,0},{4,4,4,0,0},{5,4,4,202,0},{6,4,4,0,0},{0,5,4,0,0},{1,5,4,202,0}, + {2,5,4,0,0},{3,5,4,0,0},{4,5,4,0,0},{5,5,4,202,0},{6,5,4,0,0},{0,6,4,0,0},{1,6,4,202,0},{2,6,4,0,0},{4,6,4,0,0},{5,6,4,202,0},{6,6,4,0,0},{0,0,5,0,0},{1,0,5,0,0},{2,0,5,0,0},{3,0,5,202,0},{4,0,5,0,0}, + {5,0,5,0,0},{6,0,5,0,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,0,0},{3,1,5,202,0},{4,1,5,0,0},{5,1,5,0,0},{6,1,5,0,0},{0,2,5,0,0},{1,2,5,0,0},{2,2,5,0,0},{3,2,5,202,0},{4,2,5,0,0},{5,2,5,0,0},{6,2,5,0,0}, + {0,3,5,201,0},{1,3,5,201,0},{2,3,5,201,0},{3,3,5,201,0},{4,3,5,201,0},{5,3,5,201,0},{6,3,5,201,0},{0,4,5,0,0},{1,4,5,0,0},{2,4,5,202,0},{3,4,5,202,0},{4,4,5,202,0},{5,4,5,0,0},{6,4,5,0,0},{0,5,5,0,0},{1,5,5,0,0}, + {2,5,5,202,0},{3,5,5,202,8},{4,5,5,202,0},{5,5,5,0,0},{6,5,5,0,0},{0,6,5,0,0},{1,6,5,0,0},{2,6,5,202,0},{3,6,5,202,0},{4,6,5,202,0},{5,6,5,0,0},{6,6,5,0,0},{0,0,6,0,0},{1,0,6,0,0},{2,0,6,0,0},{3,0,6,0,0}, + {4,0,6,0,0},{5,0,6,0,0},{6,0,6,0,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{0,2,6,0,0},{1,2,6,0,0},{2,2,6,0,0},{3,2,6,0,0},{4,2,6,0,0},{5,2,6,0,0}, + {6,2,6,0,0},{0,3,6,201,0},{1,3,6,201,0},{2,3,6,201,0},{3,3,6,201,0},{4,3,6,201,0},{5,3,6,201,0},{6,3,6,201,0},{0,4,6,0,0},{1,4,6,0,0},{2,4,6,0,0},{3,4,6,0,0},{4,4,6,0,0},{5,4,6,0,0},{6,4,6,0,0},{0,5,6,0,0}, + {1,5,6,0,0},{2,5,6,0,0},{4,5,6,0,0},{5,5,6,0,0},{6,5,6,0,0},{0,6,6,0,0},{1,6,6,0,0},{2,6,6,0,0},{3,6,6,0,0},{4,6,6,0,0},{5,6,6,0,0},{6,6,6,0,0},{3,5,0,203,6},{3,4,2,205,0},{2,3,3,205,0},{0,5,3,203,4}, + {4,5,3,205,0},{6,5,3,203,5},{3,0,4,65,2},{3,1,4,65,2},{3,2,4,65,2},{3,6,4,205,0},{3,5,6,203,7}, +}; + +static const EndCityTemplates::Block s_tower_floor_blocks[] = { + {0,0,0,0,0},{6,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{4,2,0,0,0},{5,2,0,0,0},{6,2,0,0,0},{0,3,0,0,0}, + {1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0},{6,3,0,0,0},{2,0,1,201,0},{3,0,1,201,0},{4,0,1,201,0},{0,1,1,0,0},{1,1,1,0,0},{2,1,1,202,0},{3,1,1,202,0},{4,1,1,202,0},{5,1,1,0,0},{6,1,1,0,0}, + {0,2,1,0,0},{1,2,1,0,0},{2,2,1,202,0},{3,2,1,202,0},{4,2,1,202,0},{5,2,1,0,0},{6,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,202,0},{3,3,1,202,0},{4,3,1,202,0},{5,3,1,0,0},{6,3,1,0,0},{1,0,2,201,0},{2,0,2,201,0}, + {3,0,2,201,0},{4,0,2,201,0},{5,0,2,201,0},{0,1,2,0,0},{1,1,2,202,0},{2,1,2,0,0},{4,1,2,0,0},{5,1,2,202,0},{6,1,2,0,0},{0,2,2,0,0},{1,2,2,202,0},{2,2,2,0,0},{3,2,2,0,0},{4,2,2,0,0},{5,2,2,202,0},{6,2,2,0,0}, + {0,3,2,0,0},{1,3,2,202,0},{2,3,2,0,0},{3,3,2,0,0},{4,3,2,0,0},{5,3,2,202,0},{6,3,2,0,0},{1,0,3,201,0},{2,0,3,201,0},{3,0,3,201,0},{4,0,3,201,0},{5,0,3,201,0},{0,1,3,0,0},{1,1,3,202,0},{2,1,3,0,0},{3,1,3,0,0}, + {4,1,3,0,0},{5,1,3,202,0},{6,1,3,0,0},{1,2,3,202,0},{2,2,3,0,0},{3,2,3,0,0},{5,2,3,202,0},{0,3,3,0,0},{1,3,3,202,0},{2,3,3,0,0},{3,3,3,0,0},{4,3,3,0,0},{5,3,3,202,0},{6,3,3,0,0},{1,0,4,201,0},{2,0,4,201,0}, + {3,0,4,201,0},{4,0,4,201,0},{5,0,4,201,0},{0,1,4,0,0},{1,1,4,202,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,202,0},{6,1,4,0,0},{0,2,4,0,0},{1,2,4,202,0},{2,2,4,0,0},{3,2,4,0,0},{4,2,4,0,0},{5,2,4,202,0}, + {6,2,4,0,0},{0,3,4,0,0},{1,3,4,202,0},{2,3,4,0,0},{4,3,4,0,0},{5,3,4,202,0},{6,3,4,0,0},{2,0,5,201,0},{3,0,5,201,0},{4,0,5,201,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,202,0},{3,1,5,202,0},{4,1,5,202,0},{5,1,5,0,0}, + {6,1,5,0,0},{0,2,5,0,0},{1,2,5,0,0},{2,2,5,202,0},{3,2,5,202,0},{4,2,5,202,0},{5,2,5,0,0},{6,2,5,0,0},{0,3,5,0,0},{1,3,5,0,0},{2,3,5,202,0},{3,3,5,202,0},{4,3,5,202,0},{5,3,5,0,0},{6,3,5,0,0},{0,0,6,0,0}, + {6,0,6,0,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{0,2,6,0,0},{1,2,6,0,0},{2,2,6,0,0},{4,2,6,0,0},{5,2,6,0,0},{6,2,6,0,0},{0,3,6,0,0},{1,3,6,0,0}, + {2,3,6,0,0},{3,3,6,0,0},{4,3,6,0,0},{5,3,6,0,0},{6,3,6,0,0},{1,0,0,203,4},{2,0,0,203,6},{3,0,0,203,6},{4,0,0,203,6},{5,0,0,203,5},{3,2,0,203,6},{0,0,1,203,6},{1,0,1,203,4},{5,0,1,203,6},{6,0,1,203,6},{0,0,2,203,4}, + {6,0,2,203,5},{3,1,2,205,0},{0,0,3,203,4},{6,0,3,203,5},{0,2,3,203,4},{4,2,3,205,0},{6,2,3,203,5},{0,0,4,203,4},{6,0,4,203,5},{3,3,4,205,0},{0,0,5,203,7},{1,0,5,203,7},{5,0,5,203,5},{6,0,5,203,7},{1,0,6,203,4},{2,0,6,203,7}, + {3,0,6,203,7},{4,0,6,203,7},{5,0,6,203,5},{3,2,6,203,7}, +}; + +static const EndCityTemplates::Block s_tower_piece_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{2,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{6,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{0,2,0,0,0},{1,2,0,0,0}, + {2,2,0,0,0},{4,2,0,0,0},{5,2,0,0,0},{6,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0},{6,3,0,0,0},{0,0,1,0,0},{1,0,1,0,0},{2,0,1,201,0},{3,0,1,201,0},{4,0,1,201,0}, + {5,0,1,0,0},{6,0,1,0,0},{0,1,1,0,0},{1,1,1,0,0},{2,1,1,202,0},{3,1,1,202,0},{4,1,1,202,0},{5,1,1,0,0},{6,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,202,0},{3,2,1,202,8},{4,2,1,202,0},{5,2,1,0,0},{6,2,1,0,0}, + {0,3,1,0,0},{1,3,1,0,0},{2,3,1,202,0},{3,3,1,202,0},{4,3,1,202,0},{5,3,1,0,0},{6,3,1,0,0},{0,0,2,0,0},{1,0,2,201,0},{2,0,2,0,0},{3,0,2,0,0},{4,0,2,0,0},{5,0,2,201,0},{6,0,2,0,0},{0,1,2,0,0},{1,1,2,202,0}, + {2,1,2,0,0},{4,1,2,0,0},{5,1,2,202,0},{6,1,2,0,0},{0,2,2,0,0},{1,2,2,202,0},{2,2,2,0,0},{3,2,2,0,0},{4,2,2,0,0},{5,2,2,202,0},{6,2,2,0,0},{0,3,2,0,0},{1,3,2,202,0},{2,3,2,0,0},{3,3,2,0,0},{4,3,2,0,0}, + {5,3,2,202,0},{6,3,2,0,0},{0,0,3,0,0},{1,0,3,201,0},{3,0,3,0,0},{4,0,3,0,0},{5,0,3,201,0},{6,0,3,0,0},{0,1,3,0,0},{1,1,3,202,0},{2,1,3,0,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,202,0},{6,1,3,0,0},{1,2,3,202,4}, + {2,2,3,0,0},{3,2,3,0,0},{5,2,3,202,4},{0,3,3,0,0},{1,3,3,202,0},{2,3,3,0,0},{3,3,3,0,0},{4,3,3,0,0},{5,3,3,202,0},{6,3,3,0,0},{0,0,4,0,0},{1,0,4,201,0},{2,0,4,0,0},{3,0,4,0,0},{4,0,4,0,0},{5,0,4,201,0}, + {6,0,4,0,0},{0,1,4,0,0},{1,1,4,202,0},{2,1,4,0,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,202,0},{6,1,4,0,0},{0,2,4,0,0},{1,2,4,202,0},{2,2,4,0,0},{3,2,4,0,0},{4,2,4,0,0},{5,2,4,202,0},{6,2,4,0,0},{0,3,4,0,0}, + {1,3,4,202,0},{2,3,4,0,0},{4,3,4,0,0},{5,3,4,202,0},{6,3,4,0,0},{0,0,5,0,0},{1,0,5,0,0},{2,0,5,201,0},{3,0,5,201,0},{4,0,5,201,0},{5,0,5,0,0},{6,0,5,0,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,202,0},{3,1,5,202,0}, + {4,1,5,202,0},{5,1,5,0,0},{6,1,5,0,0},{0,2,5,0,0},{1,2,5,0,0},{2,2,5,202,0},{3,2,5,202,8},{4,2,5,202,0},{5,2,5,0,0},{6,2,5,0,0},{0,3,5,0,0},{1,3,5,0,0},{2,3,5,202,0},{3,3,5,202,0},{4,3,5,202,0},{5,3,5,0,0}, + {6,3,5,0,0},{0,0,6,0,0},{1,0,6,0,0},{2,0,6,0,0},{3,0,6,0,0},{4,0,6,0,0},{5,0,6,0,0},{6,0,6,0,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,0,0},{3,1,6,0,0},{4,1,6,0,0},{5,1,6,0,0},{6,1,6,0,0},{0,2,6,0,0}, + {1,2,6,0,0},{2,2,6,0,0},{4,2,6,0,0},{5,2,6,0,0},{6,2,6,0,0},{0,3,6,0,0},{1,3,6,0,0},{2,3,6,0,0},{3,3,6,0,0},{4,3,6,0,0},{5,3,6,0,0},{6,3,6,0,0},{3,2,0,203,6},{3,1,2,205,0},{2,0,3,205,0},{0,2,3,203,4}, + {4,2,3,205,0},{6,2,3,203,5},{3,3,4,205,0},{3,2,6,203,7}, +}; + +static const EndCityTemplates::Block s_tower_top_blocks[] = { + {0,0,0,0,0},{1,0,0,0,0},{3,0,0,0,0},{4,0,0,0,0},{5,0,0,0,0},{7,0,0,0,0},{8,0,0,0,0},{0,1,0,0,0},{1,1,0,0,0},{2,1,0,0,0},{3,1,0,0,0},{4,1,0,0,0},{5,1,0,0,0},{6,1,0,0,0},{7,1,0,0,0},{8,1,0,0,0}, + {0,2,0,0,0},{1,2,0,0,0},{2,2,0,0,0},{3,2,0,0,0},{4,2,0,0,0},{5,2,0,0,0},{6,2,0,0,0},{7,2,0,0,0},{8,2,0,0,0},{0,3,0,0,0},{1,3,0,0,0},{2,3,0,0,0},{3,3,0,0,0},{4,3,0,0,0},{5,3,0,0,0},{6,3,0,0,0}, + {7,3,0,0,0},{8,3,0,0,0},{0,0,1,0,0},{8,0,1,0,0},{0,1,1,0,0},{2,1,1,0,0},{3,1,1,0,0},{4,1,1,0,0},{5,1,1,0,0},{6,1,1,0,0},{8,1,1,0,0},{0,2,1,0,0},{1,2,1,0,0},{2,2,1,0,0},{3,2,1,0,0},{4,2,1,0,0}, + {5,2,1,0,0},{6,2,1,0,0},{7,2,1,0,0},{8,2,1,0,0},{0,3,1,0,0},{1,3,1,0,0},{2,3,1,0,0},{3,3,1,0,0},{4,3,1,0,0},{5,3,1,0,0},{6,3,1,0,0},{7,3,1,0,0},{8,3,1,0,0},{1,4,1,201,0},{2,4,1,201,0},{3,4,1,201,0}, + {4,4,1,201,0},{5,4,1,201,0},{6,4,1,201,0},{7,4,1,201,0},{2,0,2,201,0},{3,0,2,201,0},{4,0,2,201,0},{5,0,2,201,0},{6,0,2,201,0},{0,1,2,0,0},{1,1,2,0,0},{2,1,2,202,0},{3,1,2,206,0},{4,1,2,206,0},{5,1,2,206,0},{6,1,2,202,0}, + {7,1,2,0,0},{8,1,2,0,0},{0,2,2,0,0},{1,2,2,0,0},{2,2,2,202,0},{3,2,2,206,0},{5,2,2,206,0},{6,2,2,202,0},{7,2,2,0,0},{8,2,2,0,0},{0,3,2,0,0},{1,3,2,0,0},{2,3,2,202,0},{3,3,2,206,0},{5,3,2,206,0},{6,3,2,202,0}, + {7,3,2,0,0},{8,3,2,0,0},{1,4,2,201,0},{2,4,2,201,0},{3,4,2,201,0},{4,4,2,201,0},{5,4,2,201,0},{6,4,2,201,0},{7,4,2,201,0},{0,0,3,0,0},{2,0,3,201,0},{5,0,3,201,0},{6,0,3,201,0},{8,0,3,0,0},{0,1,3,0,0},{1,1,3,0,0}, + {2,1,3,206,0},{3,1,3,0,0},{4,1,3,0,0},{5,1,3,0,0},{6,1,3,0,0},{7,1,3,0,0},{8,1,3,0,0},{0,2,3,0,0},{1,2,3,0,0},{2,2,3,206,0},{3,2,3,0,0},{4,2,3,0,0},{5,2,3,0,0},{6,2,3,0,0},{7,2,3,0,0},{8,2,3,0,0}, + {0,3,3,0,0},{1,3,3,0,0},{2,3,3,206,0},{3,3,3,0,0},{4,3,3,0,0},{5,3,3,0,0},{6,3,3,206,0},{7,3,3,0,0},{8,3,3,0,0},{1,4,3,201,0},{2,4,3,201,0},{3,4,3,201,0},{4,4,3,201,0},{5,4,3,201,0},{6,4,3,201,0},{7,4,3,201,0}, + {0,0,4,0,0},{2,0,4,201,0},{3,0,4,0,0},{4,0,4,0,0},{5,0,4,0,0},{6,0,4,201,0},{8,0,4,0,0},{0,1,4,0,0},{1,1,4,0,0},{2,1,4,206,0},{3,1,4,0,0},{4,1,4,0,0},{5,1,4,0,0},{6,1,4,0,0},{7,1,4,0,0},{8,1,4,0,0}, + {0,2,4,0,0},{1,2,4,0,0},{3,2,4,0,0},{4,2,4,0,0},{5,2,4,0,0},{6,2,4,0,0},{7,2,4,0,0},{8,2,4,0,0},{0,3,4,0,0},{1,3,4,0,0},{3,3,4,0,0},{5,3,4,0,0},{6,3,4,206,0},{7,3,4,0,0},{8,3,4,0,0},{1,4,4,201,0}, + {2,4,4,201,0},{3,4,4,201,0},{4,4,4,201,0},{5,4,4,201,0},{6,4,4,201,0},{7,4,4,201,0},{0,0,5,0,0},{2,0,5,201,0},{3,0,5,0,0},{4,0,5,0,0},{5,0,5,0,0},{6,0,5,201,0},{8,0,5,0,0},{0,1,5,0,0},{1,1,5,0,0},{2,1,5,206,0}, + {3,1,5,0,0},{4,1,5,0,0},{5,1,5,0,0},{6,1,5,206,0},{7,1,5,0,0},{8,1,5,0,0},{0,2,5,0,0},{1,2,5,0,0},{2,2,5,206,0},{3,2,5,0,0},{4,2,5,0,0},{5,2,5,0,0},{6,2,5,206,0},{7,2,5,0,0},{8,2,5,0,0},{0,3,5,0,0}, + {1,3,5,0,0},{2,3,5,206,0},{3,3,5,0,0},{4,3,5,0,0},{5,3,5,0,0},{6,3,5,206,0},{7,3,5,0,0},{8,3,5,0,0},{1,4,5,201,0},{2,4,5,201,0},{3,4,5,201,0},{4,4,5,201,0},{5,4,5,201,0},{6,4,5,201,0},{7,4,5,201,0},{2,0,6,201,0}, + {3,0,6,201,0},{4,0,6,201,0},{5,0,6,201,0},{6,0,6,201,0},{0,1,6,0,0},{1,1,6,0,0},{2,1,6,202,0},{3,1,6,206,0},{4,1,6,206,0},{5,1,6,206,0},{6,1,6,202,0},{7,1,6,0,0},{8,1,6,0,0},{0,2,6,0,0},{1,2,6,0,0},{2,2,6,202,0}, + {3,2,6,206,0},{5,2,6,206,0},{6,2,6,202,0},{7,2,6,0,0},{8,2,6,0,0},{0,3,6,0,0},{1,3,6,0,0},{2,3,6,202,0},{3,3,6,206,0},{5,3,6,206,0},{6,3,6,202,0},{7,3,6,0,0},{8,3,6,0,0},{1,4,6,201,0},{2,4,6,201,0},{3,4,6,201,0}, + {4,4,6,201,0},{5,4,6,201,0},{6,4,6,201,0},{7,4,6,201,0},{0,0,7,0,0},{8,0,7,0,0},{0,1,7,0,0},{2,1,7,0,0},{3,1,7,0,0},{4,1,7,0,0},{5,1,7,0,0},{6,1,7,0,0},{8,1,7,0,0},{0,2,7,0,0},{1,2,7,0,0},{2,2,7,0,0}, + {3,2,7,0,0},{4,2,7,0,0},{5,2,7,0,0},{6,2,7,0,0},{7,2,7,0,0},{8,2,7,0,0},{0,3,7,0,0},{1,3,7,0,0},{2,3,7,0,0},{3,3,7,0,0},{4,3,7,0,0},{5,3,7,0,0},{6,3,7,0,0},{7,3,7,0,0},{8,3,7,0,0},{1,4,7,201,0}, + {2,4,7,201,0},{3,4,7,201,0},{4,4,7,201,0},{5,4,7,201,0},{6,4,7,201,0},{7,4,7,201,0},{0,0,8,0,0},{1,0,8,0,0},{3,0,8,0,0},{4,0,8,0,0},{5,0,8,0,0},{7,0,8,0,0},{8,0,8,0,0},{0,1,8,0,0},{1,1,8,0,0},{2,1,8,0,0}, + {3,1,8,0,0},{4,1,8,0,0},{5,1,8,0,0},{6,1,8,0,0},{7,1,8,0,0},{8,1,8,0,0},{0,2,8,0,0},{1,2,8,0,0},{2,2,8,0,0},{3,2,8,0,0},{4,2,8,0,0},{5,2,8,0,0},{6,2,8,0,0},{7,2,8,0,0},{8,2,8,0,0},{0,3,8,0,0}, + {1,3,8,0,0},{2,3,8,0,0},{3,3,8,0,0},{4,3,8,0,0},{5,3,8,0,0},{6,3,8,0,0},{7,3,8,0,0},{8,3,8,0,0},{2,0,0,177,2},{6,0,0,177,2},{0,0,2,177,4},{8,0,2,177,5},{0,0,6,177,4},{8,0,6,177,5},{2,0,8,177,3},{6,0,8,177,3}, + {0,4,0,203,4},{1,4,0,203,6},{2,4,0,203,2},{3,4,0,203,2},{4,4,0,203,6},{5,4,0,203,2},{6,4,0,203,2},{7,4,0,203,6},{8,4,0,203,6},{1,0,1,203,4},{2,0,1,203,6},{3,0,1,203,2},{4,0,1,203,6},{5,0,1,203,2},{6,0,1,203,6},{7,0,1,203,5}, + {1,1,1,198,1},{7,1,1,198,1},{0,4,1,203,4},{8,4,1,203,5},{1,0,2,203,4},{7,0,2,203,5},{4,2,2,95,2},{4,3,2,95,2},{0,4,2,203,0},{8,4,2,203,1},{1,0,3,203,0},{3,0,3,205,0},{4,0,3,205,0},{7,0,3,203,1},{0,4,3,203,0},{8,4,3,203,1}, + {1,0,4,203,4},{7,0,4,203,5},{2,2,4,95,2},{2,3,4,95,2},{0,4,4,203,4},{8,4,4,203,5},{1,0,5,203,0},{7,0,5,203,1},{0,4,5,203,0},{8,4,5,203,1},{1,0,6,203,4},{7,0,6,203,5},{4,2,6,95,2},{4,3,6,95,2},{0,4,6,203,0},{8,4,6,203,1}, + {1,0,7,203,4},{2,0,7,203,7},{3,0,7,203,3},{4,0,7,203,7},{5,0,7,203,3},{6,0,7,203,7},{7,0,7,203,7},{1,1,7,198,1},{7,1,7,198,1},{0,4,7,203,4},{8,4,7,203,5},{0,4,8,203,7},{1,4,8,203,7},{2,4,8,203,3},{3,4,8,203,3},{4,4,8,203,7}, + {5,4,8,203,3},{6,4,8,203,3},{7,4,8,203,7},{8,4,8,203,5}, +}; +static const EndCityTemplates::Extra s_tower_top_extras[] = { + {2,0,0,EndCityTemplates::EXTRA_BANNER,13},{6,0,0,EndCityTemplates::EXTRA_BANNER,13},{0,0,2,EndCityTemplates::EXTRA_BANNER,13},{8,0,2,EndCityTemplates::EXTRA_BANNER,13},{4,3,4,EndCityTemplates::EXTRA_SENTRY,0},{0,0,6,EndCityTemplates::EXTRA_BANNER,13},{8,0,6,EndCityTemplates::EXTRA_BANNER,13},{2,0,8,EndCityTemplates::EXTRA_BANNER,13},{6,0,8,EndCityTemplates::EXTRA_BANNER,13}, +}; + +const EndCityTemplates::Template EndCityTemplates::TEMPLATES[EndCityTemplates::COUNT] = +{ + { L"base_floor", 10, 4, 10, s_base_floor_blocks, 398, s_base_floor_extras, 2 }, + { L"base_roof", 12, 2, 12, s_base_roof_blocks, 288, nullptr, 0 }, + { L"bridge_end", 5, 6, 2, s_bridge_end_blocks, 60, nullptr, 0 }, + { L"bridge_gentle_stairs", 5, 7, 8, s_bridge_gentle_stairs_blocks, 280, nullptr, 0 }, + { L"bridge_piece", 5, 6, 4, s_bridge_piece_blocks, 120, nullptr, 0 }, + { L"bridge_steep_stairs", 5, 7, 4, s_bridge_steep_stairs_blocks, 140, nullptr, 0 }, + { L"fat_tower_base", 13, 4, 13, s_fat_tower_base_blocks, 676, nullptr, 0 }, + { L"fat_tower_middle", 13, 8, 13, s_fat_tower_middle_blocks, 1348, s_fat_tower_middle_extras, 4 }, + { L"fat_tower_top", 17, 6, 17, s_fat_tower_top_blocks, 1732, s_fat_tower_top_extras, 2 }, + { L"second_floor", 12, 8, 12, s_second_floor_blocks, 1152, nullptr, 0 }, + { L"second_floor_2", 12, 8, 12, s_second_floor_2_blocks, 1151, s_second_floor_2_extras, 1 }, + { L"second_roof", 14, 2, 14, s_second_roof_blocks, 392, nullptr, 0 }, + { L"ship", 13, 24, 29, s_ship_blocks, 9042, s_ship_extras, 8 }, + { L"third_floor", 14, 8, 14, s_third_floor_blocks, 1568, nullptr, 0 }, + { L"third_floor_b", 14, 8, 14, s_third_floor_b_blocks, 1564, s_third_floor_b_extras, 4 }, + { L"third_floor_c", 14, 8, 14, s_third_floor_c_blocks, 1565, s_third_floor_c_extras, 3 }, + { L"third_roof", 16, 2, 16, s_third_roof_blocks, 512, nullptr, 0 }, + { L"tower_base", 7, 7, 7, s_tower_base_blocks, 343, nullptr, 0 }, + { L"tower_floor", 7, 4, 7, s_tower_floor_blocks, 196, nullptr, 0 }, + { L"tower_piece", 7, 4, 7, s_tower_piece_blocks, 196, nullptr, 0 }, + { L"tower_top", 9, 5, 9, s_tower_top_blocks, 404, s_tower_top_extras, 9 }, +}; diff --git a/Minecraft.World/EndCityTemplates.h b/Minecraft.World/EndCityTemplates.h new file mode 100644 index 00000000..bddbd1af --- /dev/null +++ b/Minecraft.World/EndCityTemplates.h @@ -0,0 +1,67 @@ +#pragma once + +class EndCityTemplates +{ +public: + enum ETemplate + { + BASE_FLOOR, + BASE_ROOF, + BRIDGE_END, + BRIDGE_GENTLE_STAIRS, + BRIDGE_PIECE, + BRIDGE_STEEP_STAIRS, + FAT_TOWER_BASE, + FAT_TOWER_MIDDLE, + FAT_TOWER_TOP, + SECOND_FLOOR, + SECOND_FLOOR_2, + SECOND_ROOF, + SHIP, + THIRD_FLOOR, + THIRD_FLOOR_B, + THIRD_FLOOR_C, + THIRD_ROOF, + TOWER_BASE, + TOWER_FLOOR, + TOWER_PIECE, + TOWER_TOP, + COUNT + }; + + enum EExtra + { + EXTRA_CHEST_LOOT, + EXTRA_SENTRY, + EXTRA_ELYTRA, + EXTRA_BANNER, + EXTRA_SKULL, + EXTRA_HEALING_POTIONS, + }; + + struct Block + { + unsigned char x, y, z; + unsigned char id; + unsigned char data; + }; + + struct Extra + { + unsigned char x, y, z; + unsigned char kind; + unsigned char arg; + }; + + struct Template + { + const wchar_t *name; + int sizeX, sizeY, sizeZ; + const Block *blocks; + int blockCount; + const Extra *extras; + int extraCount; + }; + + static const Template TEMPLATES[COUNT]; +}; diff --git a/Minecraft.World/EndCrystalItem.cpp b/Minecraft.World/EndCrystalItem.cpp new file mode 100644 index 00000000..5f29e539 --- /dev/null +++ b/Minecraft.World/EndCrystalItem.cpp @@ -0,0 +1,49 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.entity.player.h" +#include "net.minecraft.world.entity.boss.enderdragon.h" +#include "net.minecraft.world.phys.h" +#include "EndCrystalItem.h" +#include "EndDragonFight.h" + +EndCrystalItem::EndCrystalItem(int id) : Item(id) +{ +} + +static bool isClearForCrystal(Level *level, int x, int y, int z) +{ + int t = level->getTile(x, y, z); + return t == 0 || (Tile::tiles[t] != nullptr && Tile::tiles[t]->material->isReplaceable()); +} + +bool EndCrystalItem::useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly) +{ + int t = level->getTile(x, y, z); + if (t != Tile::obsidian_Id && t != Tile::bedrock_Id) return false; + if (!player->mayUseItemAt(x, y + 1, z, face, itemInstance)) return false; + if (!isClearForCrystal(level, x, y + 1, z) || !isClearForCrystal(level, x, y + 2, z)) return false; + + vector > *entities = level->getEntities(nullptr, AABB::newTemp(x, y + 1, z, x + 1.0, y + 3.0, z + 1.0)); + bool blocked = entities != nullptr && !entities->empty(); + if (blocked) return false; + + if (bTestUseOnOnly) return true; + + if (!level->isClientSide) + { + shared_ptr crystal = std::make_shared(level, x + 0.5, y + 1.0, z + 0.5); + crystal->setShowBottom(false); + level->addEntity(crystal); + EndDragonFight *fight = EndDragonFight::get(level); + if (fight != nullptr) fight->tryRespawn(); + } + + if (!player->abilities.instabuild) itemInstance->count--; + return true; +} + +bool EndCrystalItem::isFoil(shared_ptr itemInstance) +{ + return true; +} diff --git a/Minecraft.World/EndCrystalItem.h b/Minecraft.World/EndCrystalItem.h new file mode 100644 index 00000000..20cbcf9c --- /dev/null +++ b/Minecraft.World/EndCrystalItem.h @@ -0,0 +1,12 @@ +#pragma once + +#include "Item.h" + +class EndCrystalItem : public Item +{ +public: + EndCrystalItem(int id); + + virtual bool useOn(shared_ptr itemInstance, shared_ptr player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly = false); + virtual bool isFoil(shared_ptr itemInstance); +}; diff --git a/Minecraft.World/EndDragonFight.cpp b/Minecraft.World/EndDragonFight.cpp new file mode 100644 index 00000000..36127f21 --- /dev/null +++ b/Minecraft.World/EndDragonFight.cpp @@ -0,0 +1,375 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.level.storage.h" +#include "net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.boss.enderdragon.h" +#include "net.minecraft.world.phys.h" +#include "EndDragonFight.h" +#include "TheEndDimension.h" +#include "TheEndBiomeDecorator.h" +#include "EndGatewayFeature.h" +#include "SpikeFeature.h" +#include "TheEndPortal.h" +#include "SoundTypes.h" +#include "LevelEvent.h" + +EndDragonFight::EndDragonFight(Level *level) +{ + this->level = level; + respawnStage = eRespawn_None; + respawnTime = 0; +} + +EndDragonFight *EndDragonFight::get(Level *level) +{ + if (level == nullptr || level->isClientSide) return nullptr; + TheEndDimension *end = dynamic_cast(level->dimension); + if (end == nullptr || !end->isModernEnd()) return nullptr; + return end->getDragonFight(); +} + +int EndDragonFight::getPortalY() +{ + return level->seaLevel; +} + +void EndDragonFight::spawnExitPortal(Level *level, bool active, bool placeEgg) +{ + int x = 0, z = 0; + int y = level->seaLevel; + int r = 4; + + TheEndPortal::allowAnywhere(true); + for (int yy = y - 1; yy <= y + 32; yy++) + { + for (int xx = x - r; xx <= x + r; xx++) + { + for (int zz = z - r; zz <= z + r; zz++) + { + double xd = xx - x; + double zd = zz - z; + double d = sqrt(xd * xd + zd * zd); + if (d > r - 0.5) continue; + + if (yy < y) + { + if (d <= r - 1 - 0.5) level->setTileAndUpdate(xx, yy, zz, Tile::bedrock_Id); + } + else if (yy > y) + { + if (level->getTile(xx, yy, zz) != Tile::dragon_egg_Id) level->setTileAndUpdate(xx, yy, zz, 0); + } + else if (d > r - 1 - 0.5) + { + level->setTileAndUpdate(xx, yy, zz, Tile::bedrock_Id); + } + else + { + level->setTileAndUpdate(xx, yy, zz, active ? Tile::end_portal_Id : 0); + } + } + } + } + + level->setTileAndUpdate(x, y + 0, z, Tile::bedrock_Id); + level->setTileAndUpdate(x, y + 1, z, Tile::bedrock_Id); + level->setTileAndUpdate(x, y + 2, z, Tile::bedrock_Id); + level->setTileAndUpdate(x - 1, y + 2, z, Tile::torch_Id); + level->setTileAndUpdate(x + 1, y + 2, z, Tile::torch_Id); + level->setTileAndUpdate(x, y + 2, z - 1, Tile::torch_Id); + level->setTileAndUpdate(x, y + 2, z + 1, Tile::torch_Id); + level->setTileAndUpdate(x, y + 3, z, Tile::bedrock_Id); + if (placeEgg) level->setTileAndUpdate(x, y + 4, z, Tile::dragon_egg_Id); + + for (int yy = y - 5; yy < y - 1; yy++) + { + for (int xx = x - (r - 1); xx <= x + (r - 1); xx++) + { + for (int zz = z - (r - 1); zz <= z + (r - 1); zz++) + { + if (level->isEmptyTile(xx, yy, zz)) level->setTileAndUpdate(xx, yy, zz, Tile::end_stone_Id); + } + } + } + TheEndPortal::allowAnywhere(false); +} + +void EndDragonFight::onDragonKilled() +{ + LevelData *data = level->getLevelData(); + spawnExitPortal(level, true, !data->isEndPreviouslyKilled()); + + if (!data->isEndGatewaySpawned()) + { + Random random; + EndGatewayFeature().place(level, &random, GATEWAY_X, GATEWAY_Y, GATEWAY_Z); + level->levelEvent(LevelEvent::ANIMATION_END_GATEWAY_SPAWN, GATEWAY_X, GATEWAY_Y, GATEWAY_Z, 0); + data->setEndGatewaySpawned(true); + } + + data->setEndPreviouslyKilled(true); + data->setEndDragonKilled(true); +} + +void EndDragonFight::findPortalCrystals(vector > &result) +{ + result.clear(); + int y = getPortalY() + 1; + static const int SIDES[4][2] = { { 2, 0 }, { -2, 0 }, { 0, 2 }, { 0, -2 } }; + for (int i = 0; i < 4; i++) + { + int bx = SIDES[i][0]; + int bz = SIDES[i][1]; + double x0 = bx; + double z0 = bz; + vector > *entities = level->getEntitiesOfClass(typeid(EnderCrystal), AABB::newTemp(x0, y, z0, x0 + 1, y + 1, z0 + 1)); + bool found = false; + if (entities != nullptr) + { + for (auto &e : *entities) + { + shared_ptr crystal = dynamic_pointer_cast(e); + if (crystal != nullptr && !crystal->removed) + { + result.push_back(crystal); + found = true; + } + } + delete entities; + } + if (!found) + { + result.clear(); + return; + } + } +} + +void EndDragonFight::tryRespawn() +{ + LevelData *data = level->getLevelData(); + if (!data->isEndDragonKilled() || respawnStage != eRespawn_None) return; + + vector > crystals; + findPortalCrystals(crystals); + if (crystals.size() < 4) return; + + respawnCrystals = crystals; + spawnExitPortal(level, false, false); + setRespawnStage(eRespawn_Start); +} + +void EndDragonFight::onCrystalDestroyed(shared_ptr crystal) +{ + if (respawnStage == eRespawn_None) return; + + bool tracked = false; + for (auto &c : respawnCrystals) + { + if (c == crystal) tracked = true; + } + if (!tracked) return; + + for (auto &c : respawnCrystals) + { + if (c != crystal) c->clearBeamTarget(); + } + respawnCrystals.clear(); + setRespawnStage(eRespawn_None); + resetSpikeCrystals(); + spawnExitPortal(level, true, false); +} + +void EndDragonFight::setRespawnStage(RespawnStage stage) +{ + respawnStage = stage; + respawnTime = 0; +} + +void EndDragonFight::tick() +{ + if (respawnStage != eRespawn_None) + { + tickRespawn(); + respawnTime++; + } +} + +void EndDragonFight::pointCrystalsAt(int x, int y, int z) +{ + for (auto &c : respawnCrystals) + { + if (!c->removed) c->setBeamTarget(x, y, z); + } +} + +void EndDragonFight::growl() +{ + level->levelEvent(LevelEvent::ANIMATION_DRAGON_SUMMON_ROAR, 0, 128, 0, 0); +} + +void EndDragonFight::tickRespawn() +{ + switch (respawnStage) + { + case eRespawn_Start: + pointCrystalsAt(0, 128, 0); + setRespawnStage(eRespawn_PreparingPillars); + break; + + case eRespawn_PreparingPillars: + if (respawnTime < 100) + { + if (respawnTime == 0 || respawnTime == 50 || respawnTime == 51 || respawnTime == 52 || respawnTime >= 95) growl(); + } + else + { + setRespawnStage(eRespawn_SummoningPillars); + } + break; + + case eRespawn_SummoningPillars: + { + int index = respawnTime / 40; + bool target = respawnTime % 40 == 0; + bool rebuild = respawnTime % 40 == 39; + if (index < 8) + { + const TheEndBiomeDecorator::SPIKE &spike = TheEndBiomeDecorator::SpikeValA[index]; + if (target) + { + int top = level->getTopSolidBlock(spike.x, spike.z); + pointCrystalsAt(spike.x, top + 1, spike.z); + } + else if (rebuild) + { + rebuildSpike(index); + } + } + else if (target) + { + setRespawnStage(eRespawn_SummoningDragon); + } + } + break; + + case eRespawn_SummoningDragon: + if (respawnTime < 100) + { + if (respawnTime == 0) pointCrystalsAt(0, 128, 0); + else if (respawnTime < 5 || respawnTime >= 80) growl(); + } + else + { + resetSpikeCrystals(); + for (auto &c : respawnCrystals) + { + if (c->removed) continue; + c->clearBeamTarget(); + level->explode(c, c->x, c->y, c->z, 6.0f, false); + c->remove(); + } + respawnCrystals.clear(); + setRespawnStage(eRespawn_None); + createNewDragon(); + level->getLevelData()->setEndDragonKilled(false); + } + break; + + default: + break; + } +} + +void EndDragonFight::rebuildSpike(int index) +{ + const TheEndBiomeDecorator::SPIKE &spike = TheEndBiomeDecorator::SpikeValA[index]; + + int ground = getPortalY() - 10; + for (int yy = Level::maxBuildHeight - 1; yy > 0; yy--) + { + if (level->getTile(spike.x, yy, spike.z) == Tile::end_stone_Id) + { + ground = yy; + break; + } + } + int r = spike.radius + 2; + for (int yy = ground + 1; yy < Level::maxBuildHeight; yy++) + { + for (int xx = spike.x - r; xx <= spike.x + r; xx++) + { + for (int zz = spike.z - r; zz <= spike.z + r; zz++) + { + int tile = level->getTile(xx, yy, zz); + if (tile == Tile::obsidian_Id || tile == Tile::bedrock_Id || tile == Tile::iron_bars_Id || tile == Tile::fire_Id) + { + level->setTileAndUpdate(xx, yy, zz, 0); + } + } + } + } + + vector > *old = level->getEntitiesOfClass(typeid(EnderCrystal), AABB::newTemp(spike.x - r, ground, spike.z - r, spike.x + r + 1, Level::maxBuildHeight, spike.z + r + 1)); + if (old != nullptr) + { + for (auto &e : *old) + { + bool summoning = false; + for (auto &c : respawnCrystals) + { + if (c == e) summoning = true; + } + if (!summoning) e->remove(); + } + delete old; + } + + int base = TheEndBiomeDecorator::SPIKE_BASE_Y; + int top = base + 12 + index * 3; + level->explode(nullptr, spike.x + 0.5, top, spike.z + 0.5, 5.0f, true); + + Random random; + SpikeFeature feature(Tile::end_stone_Id); + feature.placeWithIndex(level, &random, spike.x, base, spike.z, index, spike.radius); + + vector > *placed = level->getEntitiesOfClass(typeid(EnderCrystal), AABB::newTemp(spike.x - 1, ground, spike.z - 1, spike.x + 2, Level::maxBuildHeight, spike.z + 2)); + if (placed != nullptr) + { + for (auto &e : *placed) + { + shared_ptr crystal = dynamic_pointer_cast(e); + if (crystal == nullptr) continue; + crystal->setInvulnerable(true); + crystal->setBeamTarget(0, 128, 0); + } + delete placed; + } +} + +void EndDragonFight::resetSpikeCrystals() +{ + for (int i = 0; i < 8; i++) + { + const TheEndBiomeDecorator::SPIKE &spike = TheEndBiomeDecorator::SpikeValA[i]; + vector > *entities = level->getEntitiesOfClass(typeid(EnderCrystal), AABB::newTemp(spike.x - 1, 0, spike.z - 1, spike.x + 2, Level::maxBuildHeight, spike.z + 2)); + if (entities == nullptr) continue; + for (auto &e : *entities) + { + shared_ptr crystal = dynamic_pointer_cast(e); + if (crystal == nullptr) continue; + crystal->setInvulnerable(false); + crystal->clearBeamTarget(); + } + delete entities; + } +} + +void EndDragonFight::createNewDragon() +{ + shared_ptr dragon = std::make_shared(level); + dragon->AddParts(); + dragon->moveTo(0, 128, 0, level->random->nextFloat() * 360, 0); + level->addEntity(dragon); +} diff --git a/Minecraft.World/EndDragonFight.h b/Minecraft.World/EndDragonFight.h new file mode 100644 index 00000000..bc5b79c5 --- /dev/null +++ b/Minecraft.World/EndDragonFight.h @@ -0,0 +1,51 @@ +#pragma once + +class Level; +class EnderCrystal; +class EnderDragon; + +class EndDragonFight +{ +public: + static const int GATEWAY_X = 65; + static const int GATEWAY_Y = 75; + static const int GATEWAY_Z = 0; + +private: + enum RespawnStage + { + eRespawn_None, + eRespawn_Start, + eRespawn_PreparingPillars, + eRespawn_SummoningPillars, + eRespawn_SummoningDragon, + }; + + Level *level; + RespawnStage respawnStage; + int respawnTime; + vector > respawnCrystals; + +public: + EndDragonFight(Level *level); + + static EndDragonFight *get(Level *level); + + void tick(); + void onDragonKilled(); + void onCrystalDestroyed(shared_ptr crystal); + void tryRespawn(); + + static void spawnExitPortal(Level *level, bool active, bool placeEgg); + +private: + int getPortalY(); + void findPortalCrystals(vector > &result); + void setRespawnStage(RespawnStage stage); + void tickRespawn(); + void rebuildSpike(int index); + void resetSpikeCrystals(); + void pointCrystalsAt(int x, int y, int z); + void growl(); + void createNewDragon(); +}; diff --git a/Minecraft.World/EndGatewayFeature.cpp b/Minecraft.World/EndGatewayFeature.cpp new file mode 100644 index 00000000..0be013c2 --- /dev/null +++ b/Minecraft.World/EndGatewayFeature.cpp @@ -0,0 +1,30 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "EndGatewayFeature.h" + +bool EndGatewayFeature::place(Level *level, Random *random, int x, int y, int z) +{ + for (int xx = x - 1; xx <= x + 1; xx++) + { + for (int zz = z - 1; zz <= z + 1; zz++) + { + for (int yy = y - 2; yy <= y + 2; yy++) + { + bool atX = xx == x; + bool atY = yy == y; + bool atZ = zz == z; + bool edgeY = abs(yy - y) == 2; + + int tile = Tile::bedrock_Id; + if (atX && atY && atZ) tile = Tile::end_gateway_Id; + else if (atY) tile = 0; + else if (edgeY && atX && atZ) tile = Tile::bedrock_Id; + else if ((!atX && !atZ) || edgeY) tile = 0; + + placeBlock(level, xx, yy, zz, tile, 0); + } + } + } + return true; +} diff --git a/Minecraft.World/EndGatewayFeature.h b/Minecraft.World/EndGatewayFeature.h new file mode 100644 index 00000000..a0293c64 --- /dev/null +++ b/Minecraft.World/EndGatewayFeature.h @@ -0,0 +1,8 @@ +#pragma once +#include "Feature.h" + +class EndGatewayFeature : public Feature +{ +public: + virtual bool place(Level *level, Random *random, int x, int y, int z); +}; diff --git a/Minecraft.World/EndGatewayTile.cpp b/Minecraft.World/EndGatewayTile.cpp new file mode 100644 index 00000000..62900051 --- /dev/null +++ b/Minecraft.World/EndGatewayTile.cpp @@ -0,0 +1,85 @@ +#include "stdafx.h" +#include "EndGatewayTile.h" +#include "TheEndGatewayTileEntity.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.entity.h" +#include "net.minecraft.world.h" + +EndGatewayTile::EndGatewayTile(int id, Material *material) : BaseEntityTile(id, material, isSolidRender()) +{ + setLightEmission(1.0f); +} + +shared_ptr EndGatewayTile::newTileEntity(Level *level) +{ + return std::make_shared(); +} + +bool EndGatewayTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face) +{ + int tile = level->getTile(x, y, z); + return tile != id && !Tile::isSolidBlockingTile(tile); +} + +void EndGatewayTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +{ +} + +bool EndGatewayTile::isSolidRender(bool isServerLevel) +{ + return false; +} + +bool EndGatewayTile::isCubeShaped() +{ + return false; +} + +int EndGatewayTile::getResourceCount(Random *random) +{ + return 0; +} + +void EndGatewayTile::animateTick(Level *level, int xt, int yt, int zt, Random *random) +{ + shared_ptr gateway = dynamic_pointer_cast(level->getTileEntity(xt, yt, zt)); + if (gateway == nullptr) return; + + int amount = gateway->getParticleAmount(); + for (int i = 0; i < amount; i++) + { + double x = xt + random->nextFloat(); + double y = yt + random->nextFloat(); + double z = zt + random->nextFloat(); + double xa = (random->nextFloat() - 0.5) * 0.5; + double ya = (random->nextFloat() - 0.5) * 0.5; + double za = (random->nextFloat() - 0.5) * 0.5; + int sign = random->nextInt(2) * 2 - 1; + if (random->nextBoolean()) + { + z = zt + 0.5 + 0.25 * sign; + za = random->nextFloat() * 2.0f * sign; + } + else + { + x = xt + 0.5 + 0.25 * sign; + xa = random->nextFloat() * 2.0f * sign; + } + level->addParticle(eParticleType_ender, x, y, z, xa, ya, za); + } +} + +int EndGatewayTile::getRenderShape() +{ + return SHAPE_INVISIBLE; +} + +int EndGatewayTile::cloneTileId(Level *level, int x, int y, int z) +{ + return 0; +} + +void EndGatewayTile::registerIcons(IconRegister *iconRegister) +{ + icon = iconRegister->registerIcon(L"portal"); +} diff --git a/Minecraft.World/EndGatewayTile.h b/Minecraft.World/EndGatewayTile.h new file mode 100644 index 00000000..ee649829 --- /dev/null +++ b/Minecraft.World/EndGatewayTile.h @@ -0,0 +1,19 @@ +#pragma once +#include "BaseEntityTile.h" + +class EndGatewayTile : public BaseEntityTile +{ +public: + EndGatewayTile(int id, Material *material); + + virtual shared_ptr newTileEntity(Level *level); + virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face); + virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source); + virtual bool isSolidRender(bool isServerLevel = false); + virtual bool isCubeShaped(); + virtual int getResourceCount(Random *random); + virtual void animateTick(Level *level, int xt, int yt, int zt, Random *random); + virtual int getRenderShape(); + virtual int cloneTileId(Level *level, int x, int y, int z); + void registerIcons(IconRegister *iconRegister); +}; diff --git a/Minecraft.World/EndIslandFeature.cpp b/Minecraft.World/EndIslandFeature.cpp new file mode 100644 index 00000000..0f4b89e9 --- /dev/null +++ b/Minecraft.World/EndIslandFeature.cpp @@ -0,0 +1,23 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "EndIslandFeature.h" + +bool EndIslandFeature::place(Level *level, Random *random, int x, int y, int z) +{ + float radius = static_cast(random->nextInt(3)) + 4.0f; + for (int yy = 0; radius > 0.5f; radius -= static_cast(random->nextInt(2)) + 0.5f, --yy) + { + for (int xx = static_cast(floorf(-radius)); xx <= static_cast(ceilf(radius)); ++xx) + { + for (int zz = static_cast(floorf(-radius)); zz <= static_cast(ceilf(radius)); ++zz) + { + if (static_cast(xx * xx + zz * zz) <= (radius + 1.0f) * (radius + 1.0f)) + { + placeBlock(level, x + xx, y + yy, z + zz, Tile::end_stone_Id, 0); + } + } + } + } + return true; +} diff --git a/Minecraft.World/EndIslandFeature.h b/Minecraft.World/EndIslandFeature.h new file mode 100644 index 00000000..8efe7a23 --- /dev/null +++ b/Minecraft.World/EndIslandFeature.h @@ -0,0 +1,8 @@ +#pragma once +#include "Feature.h" + +class EndIslandFeature : public Feature +{ +public: + virtual bool place(Level *level, Random *random, int x, int y, int z); +}; diff --git a/Minecraft.World/EndRodTile.cpp b/Minecraft.World/EndRodTile.cpp new file mode 100644 index 00000000..52b5e4c6 --- /dev/null +++ b/Minecraft.World/EndRodTile.cpp @@ -0,0 +1,107 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.phys.h" +#include "Facing.h" +#include "EndRodTile.h" + +EndRodTile::EndRodTile(int id) : Tile(id, Material::decoration, false) +{ + setLightBlock(0); + updateDefaultShape(); +} + +void EndRodTile::setShapeForData(int data) +{ + const float a = 6.0f / 16.0f; + const float b = 10.0f / 16.0f; + switch (getFacing(data)) + { + case Facing::WEST: + case Facing::EAST: + setShape(0.0f, a, a, 1.0f, b, b); + break; + case Facing::NORTH: + case Facing::SOUTH: + setShape(a, a, 0.0f, b, b, 1.0f); + break; + default: + setShape(a, 0.0f, a, b, 1.0f, b); + break; + } +} + +AABB *EndRodTile::getAABB(Level *level, int x, int y, int z) +{ + setShapeForData(level->getData(x, y, z)); + return Tile::getAABB(level, x, y, z); +} + +AABB *EndRodTile::getTileAABB(Level *level, int x, int y, int z) +{ + setShapeForData(level->getData(x, y, z)); + return Tile::getTileAABB(level, x, y, z); +} + +void EndRodTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +{ + setShapeForData(forceData >= 0 ? forceData : level->getData(x, y, z)); +} + +void EndRodTile::updateDefaultShape() +{ + setShapeForData(Facing::UP); +} + +bool EndRodTile::isSolidRender(bool isServerLevel) +{ + return false; +} + +bool EndRodTile::isCubeShaped() +{ + return false; +} + +int EndRodTile::getRenderShape() +{ + return Tile::SHAPE_END_ROD; +} + +int EndRodTile::getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue) +{ + int ox = x - Facing::STEP_X[face]; + int oy = y - Facing::STEP_Y[face]; + int oz = z - Facing::STEP_Z[face]; + if (level->getTile(ox, oy, oz) == id && getFacing(level->getData(ox, oy, oz)) == face) + { + return Facing::OPPOSITE_FACING[face]; + } + return face; +} + +void EndRodTile::animateTick(Level *level, int xt, int yt, int zt, Random *random) +{ + int facing = getFacing(level->getData(xt, yt, zt)); + double x = xt + 0.55 - random->nextFloat() * 0.1f; + double y = yt + 0.55 - random->nextFloat() * 0.1f; + double z = zt + 0.55 - random->nextFloat() * 0.1f; + double spread = 0.4f - (random->nextFloat() + random->nextFloat()) * 0.4f; + if (random->nextInt(5) == 0) + { + level->addParticle(eParticleType_endRod, + x + Facing::STEP_X[facing] * spread, + y + Facing::STEP_Y[facing] * spread, + z + Facing::STEP_Z[facing] * spread, + random->nextGaussian() * 0.005, random->nextGaussian() * 0.005, random->nextGaussian() * 0.005); + } +} + +int EndRodTile::getPistonPushReaction() +{ + return Material::PUSH_NORMAL; +} + +int EndRodTile::getSpawnResourcesAuxValue(int data) +{ + return 0; +} diff --git a/Minecraft.World/EndRodTile.h b/Minecraft.World/EndRodTile.h new file mode 100644 index 00000000..58c89fd4 --- /dev/null +++ b/Minecraft.World/EndRodTile.h @@ -0,0 +1,29 @@ +#pragma once +#include "Tile.h" +#include "Facing.h" + +class Random; + +class EndRodTile : public Tile +{ + friend class Tile; + friend class ChunkRebuildData; +protected: + EndRodTile(int id); +public: + static int getFacing(int data) { return (data & 7) > 5 ? Facing::UP : (data & 7); } + + virtual AABB *getAABB(Level *level, int x, int y, int z); + virtual AABB *getTileAABB(Level *level, int x, int y, int z); + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); + virtual void updateDefaultShape(); + using Tile::setShape; + void setShapeForData(int data); + virtual bool isSolidRender(bool isServerLevel = false); + virtual bool isCubeShaped(); + virtual int getRenderShape(); + virtual int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue); + virtual void animateTick(Level *level, int x, int y, int z, Random *random); + virtual int getPistonPushReaction(); + virtual int getSpawnResourcesAuxValue(int data); +}; diff --git a/Minecraft.World/EnderCrystal.cpp b/Minecraft.World/EnderCrystal.cpp index 40a82c3b..86ba9b54 100644 --- a/Minecraft.World/EnderCrystal.cpp +++ b/Minecraft.World/EnderCrystal.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "EndDragonFight.h" #include "net.minecraft.world.level.h" #include "net.minecraft.world.level.tile.h" #include "net.minecraft.world.entity.h" @@ -43,6 +44,10 @@ bool EnderCrystal::makeStepSound() void EnderCrystal::defineSynchedData() { entityData->define(DATA_REMAINING_LIFE, life); + entityData->define(DATA_SHOW_BOTTOM, static_cast(1)); + entityData->define(DATA_BEAM_TARGET_X, 0); + entityData->define(DATA_BEAM_TARGET_Y, -1); + entityData->define(DATA_BEAM_TARGET_Z, 0); } void EnderCrystal::tick() @@ -71,10 +76,25 @@ void EnderCrystal::tick() void EnderCrystal::addAdditonalSaveData(CompoundTag *tag) { + tag->putBoolean(L"ShowBottom", showsBottom()); + if (hasBeamTarget()) + { + CompoundTag *beam = new CompoundTag(); + beam->putInt(L"X", getBeamTargetX()); + beam->putInt(L"Y", getBeamTargetY()); + beam->putInt(L"Z", getBeamTargetZ()); + tag->putCompound(L"BeamTarget", beam); + } } void EnderCrystal::readAdditionalSaveData(CompoundTag *tag) { + if (tag->contains(L"ShowBottom")) setShowBottom(tag->getBoolean(L"ShowBottom")); + if (tag->contains(L"BeamTarget")) + { + CompoundTag *beam = tag->getCompound(L"BeamTarget"); + setBeamTarget(beam->getInt(L"X"), beam->getInt(L"Y"), beam->getInt(L"Z")); + } } @@ -119,8 +139,52 @@ bool EnderCrystal::hurt(DamageSource *source, float damage) break; } } + + EndDragonFight *fight = EndDragonFight::get(level); + if (fight != nullptr) fight->onCrystalDestroyed(dynamic_pointer_cast(shared_from_this())); } } } return true; -} \ No newline at end of file +} +void EnderCrystal::setShowBottom(bool show) +{ + entityData->set(DATA_SHOW_BOTTOM, static_cast(show ? 1 : 0)); +} + +bool EnderCrystal::showsBottom() +{ + return entityData->getByte(DATA_SHOW_BOTTOM) != 0; +} + +void EnderCrystal::setBeamTarget(int x, int y, int z) +{ + entityData->set(DATA_BEAM_TARGET_X, x); + entityData->set(DATA_BEAM_TARGET_Y, y); + entityData->set(DATA_BEAM_TARGET_Z, z); +} + +void EnderCrystal::clearBeamTarget() +{ + entityData->set(DATA_BEAM_TARGET_Y, -1); +} + +bool EnderCrystal::hasBeamTarget() +{ + return getBeamTargetY() >= 0; +} + +int EnderCrystal::getBeamTargetX() +{ + return entityData->getInteger(DATA_BEAM_TARGET_X); +} + +int EnderCrystal::getBeamTargetY() +{ + return entityData->getInteger(DATA_BEAM_TARGET_Y); +} + +int EnderCrystal::getBeamTargetZ() +{ + return entityData->getInteger(DATA_BEAM_TARGET_Z); +} diff --git a/Minecraft.World/EnderCrystal.h b/Minecraft.World/EnderCrystal.h index 15940452..9b4a42a7 100644 --- a/Minecraft.World/EnderCrystal.h +++ b/Minecraft.World/EnderCrystal.h @@ -17,6 +17,10 @@ public: private: static const int DATA_REMAINING_LIFE = 8; + static const int DATA_SHOW_BOTTOM = 9; + static const int DATA_BEAM_TARGET_X = 10; + static const int DATA_BEAM_TARGET_Y = 11; + static const int DATA_BEAM_TARGET_Z = 12; void _init(Level *level); @@ -39,4 +43,14 @@ public: virtual float getShadowHeightOffs(); virtual bool isPickable(); virtual bool hurt(DamageSource *source, float damage); + + void setShowBottom(bool show); + bool showsBottom(); + + void setBeamTarget(int x, int y, int z); + void clearBeamTarget(); + bool hasBeamTarget(); + int getBeamTargetX(); + int getBeamTargetY(); + int getBeamTargetZ(); }; \ No newline at end of file diff --git a/Minecraft.World/EnderDragon.cpp b/Minecraft.World/EnderDragon.cpp index 80eb6e7e..efa0025a 100644 --- a/Minecraft.World/EnderDragon.cpp +++ b/Minecraft.World/EnderDragon.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "EndDragonFight.h" #include "net.minecraft.world.level.h" #include "net.minecraft.world.level.tile.h" #include "net.minecraft.world.entity.h" @@ -1244,7 +1245,9 @@ void EnderDragon::tickDeath() zo = 0; } // 4J-PB changed to center this between the pillars - spawnExitPortal(0,0);//Mth::floor(x), Mth::floor(z)); + EndDragonFight *fight = EndDragonFight::get(level); + if (fight != nullptr) fight->onDragonKilled(); + else spawnExitPortal(0,0);//Mth::floor(x), Mth::floor(z)); remove(); } } diff --git a/Minecraft.World/EnderMan.cpp b/Minecraft.World/EnderMan.cpp index d7bc87c8..035b1097 100644 --- a/Minecraft.World/EnderMan.cpp +++ b/Minecraft.World/EnderMan.cpp @@ -467,4 +467,14 @@ bool EnderMan::isCreepy() void EnderMan::setCreepy(bool creepy) { entityData->set(DATA_CREEPY, static_cast(creepy ? 1 : 0)); -} \ No newline at end of file +} +void EnderMan::dropEquipment(bool byPlayer, int playerBonusLevel) +{ + Monster::dropEquipment(byPlayer, playerBonusLevel); + int tile = getCarryingTile(); + if (tile > 0 && tile < Tile::TILE_NUM_COUNT && Item::items[tile] != nullptr) + { + int data = Item::items[tile]->isStackedByData() ? getCarryingData() : 0; + spawnAtLocation(std::make_shared(tile, 1, data), 0.0f); + } +} diff --git a/Minecraft.World/EnderMan.h b/Minecraft.World/EnderMan.h index 166f2c62..13a0bffb 100644 --- a/Minecraft.World/EnderMan.h +++ b/Minecraft.World/EnderMan.h @@ -54,6 +54,7 @@ protected: virtual int getDeathSound(); virtual int getDeathLoot(); // virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel); + virtual void dropEquipment(bool byPlayer, int playerBonusLevel); public: void setCarryingTile(int carryingTile); diff --git a/Minecraft.World/Entity.cpp b/Minecraft.World/Entity.cpp index f47bf644..eb1c7364 100644 --- a/Minecraft.World/Entity.cpp +++ b/Minecraft.World/Entity.cpp @@ -300,6 +300,7 @@ void Entity::_init(bool useSmallId, Level *level) moveDist = 0.0f; fallDistance = 0; + fallDamageMultiplier = 1.0f; nextStep = 1; @@ -349,6 +350,7 @@ void Entity::_init(bool useSmallId, Level *level) dimension = 0; portalEntranceDir = 0; invulnerable = false; + pendingRideTicks = 0; if( useSmallId ) { uuid = L"ent" + Mth::createInsecureUUID(random); @@ -536,6 +538,30 @@ void Entity::baseTick() riding = nullptr; } + if (pendingRideTicks > 0 && !level->isClientSide) + { + if (riding != nullptr || --pendingRideTicks <= 0) + { + pendingRideTicks = 0; + } + else + { + vector > *nearby = level->getEntities(shared_from_this(), bb->grow(8, 8, 8)); + if (nearby != nullptr) + { + for (auto& e : *nearby) + { + if (e != nullptr && !e->removed && e->uuid == pendingRideUUID && e->instanceof(eTYPE_BOAT) && dynamic_pointer_cast(e)->canAddPassenger()) + { + ride(e); + pendingRideTicks = 0; + break; + } + } + } + } + } + walkDistO = walkDist; xo = x; yo = y; @@ -1075,7 +1101,10 @@ void Entity::checkFallDamage(double ya, bool onGround) { if (fallDistance > 0) { + int landedOn = level->getTile(Mth::floor(x), Mth::floor(y - 0.2f - heightOffset), Mth::floor(z)); + fallDamageMultiplier = (landedOn > 0 && Tile::tiles[landedOn] != nullptr) ? Tile::tiles[landedOn]->getFallDamageMultiplier() : 1.0f; causeFallDamage(fallDistance); + fallDamageMultiplier = 1.0f; fallDistance = 0; } } @@ -1313,7 +1342,7 @@ void Entity::playerTouch(shared_ptr player) void Entity::push(shared_ptr e) { - if (e->rider.lock().get() == this || e->riding.get() == this) return; + if (e->rider.lock().get() == this || e->riding.get() == this || (riding != nullptr && riding == e->riding)) return; double xa = e->x - x; double za = e->z - z; @@ -1451,7 +1480,11 @@ void Entity::saveWithoutId(CompoundTag *entityTag) addAdditonalSaveData(entityTag); - if (riding != nullptr) + if (riding != nullptr && riding->getExtraRider().get() == this) + { + entityTag->putString(L"RidingUUID", riding->uuid); + } + else if (riding != nullptr) { CompoundTag *ridingTag = new CompoundTag(RIDING_TAG); if (riding->saveAsMount(ridingTag)) @@ -1504,6 +1537,12 @@ void Entity::load(CompoundTag *tag) uuid = tag->getString(L"UUID"); } + if (tag->contains(L"RidingUUID")) + { + pendingRideUUID = tag->getString(L"RidingUUID"); + pendingRideTicks = 20 * 10; + } + setPos(x, y, z); setRot(yRot, xRot); @@ -1647,7 +1686,7 @@ void Entity::rideTick() if (riding == nullptr) return; // Sets riders old&new position to it's mount's old&new position (plus the ride y-seperatation). - riding->positionRider(); + riding->positionRider(shared_from_this()); yRideRotA += (riding->yRot - riding->yRotO); xRideRotA += (riding->xRot - riding->xRotO); @@ -1704,6 +1743,8 @@ double Entity::getRideHeight() void Entity::ride(shared_ptr e) { + if (e != nullptr && riding == e && e->hasRider(shared_from_this())) return; + xRideRotA = 0; yRideRotA = 0; @@ -1713,17 +1754,17 @@ void Entity::ride(shared_ptr e) { // 4J Stu - Position should already be updated before the SetEntityLinkPacket comes in if(!level->isClientSide) moveTo(riding->x, riding->bb->y0 + riding->bbHeight, riding->z, yRot, xRot); - riding->rider = weak_ptr(); + riding->removeRider(shared_from_this()); } riding = nullptr; return; } if (riding != nullptr) { - riding->rider = weak_ptr(); + riding->removeRider(shared_from_this()); } riding = e; - e->rider = shared_from_this(); + e->addRider(shared_from_this()); } void Entity::lerpTo(double x, double y, double z, float yRot, float xRot, int steps) @@ -1864,6 +1905,15 @@ void Entity::setInvisible(bool value) setSharedFlag(FLAG_INVISIBLE, value); } +bool Entity::isGlowing() +{ + return false; +} + +void Entity::setGlowing(bool value) +{ +} + bool Entity::isWeakened() { return getSharedFlag(FLAG_EFFECT_WEAKENED); diff --git a/Minecraft.World/Entity.h b/Minecraft.World/Entity.h index 3457f217..2979cb67 100644 --- a/Minecraft.World/Entity.h +++ b/Minecraft.World/Entity.h @@ -93,6 +93,7 @@ public: float walkDist; float moveDist; float fallDistance; + float fallDamageMultiplier; private: int nextStep; @@ -166,6 +167,8 @@ protected: private: bool invulnerable; wstring uuid; + wstring pendingRideUUID; + int pendingRideTicks; protected: // 4J Added so that client side simulations on the host are not affected by zero-lag @@ -332,6 +335,11 @@ public: virtual void rideTick(); virtual void positionRider(); + virtual void positionRider(shared_ptr passenger) { positionRider(); } + virtual bool hasRider(shared_ptr e) { return e != nullptr && rider.lock() == e; } + virtual void addRider(shared_ptr e) { rider = e; } + virtual void removeRider(shared_ptr e) { rider = weak_ptr(); } + virtual shared_ptr getExtraRider() { return nullptr; } virtual double getRidingHeight(); virtual double getRideHeight(); virtual void ride(shared_ptr e); @@ -356,6 +364,8 @@ public: virtual bool isInvisible(); virtual bool isInvisibleTo(shared_ptr plr); virtual void setInvisible(bool value); + virtual bool isGlowing(); + virtual void setGlowing(bool value); virtual bool isUsingItemFlag(); virtual void setUsingItemFlag(bool value); diff --git a/Minecraft.World/EntityIO.cpp b/Minecraft.World/EntityIO.cpp index 80379f5a..ef46d937 100644 --- a/Minecraft.World/EntityIO.cpp +++ b/Minecraft.World/EntityIO.cpp @@ -101,6 +101,7 @@ void EntityIO::staticCtor() eMinecraftColour_Mob_Endermite_Colour2, IDS_ENDERMITE); setId(Guardian::create, eTYPE_GUARDIAN, L"Guardian", 68, eMinecraftColour_Mob_Guardian_Colour1, eMinecraftColour_Mob_Guardian_Colour2, IDS_GUARDIAN); + setId(Shulker::create, eTYPE_SHULKER, L"Shulker", 69, eMinecraftColour_Mob_Shulker_Colour1, eMinecraftColour_Mob_Shulker_Colour2, IDS_SHULKER); setId(Pig::create, eTYPE_PIG, L"Pig", 90, eMinecraftColour_Mob_Pig_Colour1, eMinecraftColour_Mob_Pig_Colour2, IDS_PIG); @@ -133,14 +134,20 @@ void EntityIO::staticCtor() // 4J Added setId(DragonFireball::create, eTYPE_DRAGON_FIREBALL, L"DragonFireball", 1000); + setId(AreaEffectCloud::create, eTYPE_AREA_EFFECT_CLOUD, L"AreaEffectCloud", 3); + setId(ShulkerBullet::create, eTYPE_SHULKER_BULLET, L"ShulkerBullet", 25); + // 4J-PB - moved to allow the eggs to be named and coloured in the Creative Mode menu // 4J Added for custom spawn eggs setId(EntityHorse::create, eTYPE_HORSE, L"EntityHorse", 100 | ((EntityHorse::TYPE_DONKEY + 1) << 12), eMinecraftColour_Mob_Horse_Colour1, eMinecraftColour_Mob_Horse_Colour2, IDS_DONKEY); setId(EntityHorse::create, eTYPE_HORSE, L"EntityHorse", 100 | ((EntityHorse::TYPE_MULE + 1) << 12), eMinecraftColour_Mob_Horse_Colour1, eMinecraftColour_Mob_Horse_Colour2, IDS_MULE); + setId(EntityHorse::create, eTYPE_HORSE, L"EntityHorse", 100 | ((EntityHorse::TYPE_SKELETON + 1) << 12), eMinecraftColour_Mob_SkeletonHorse_Colour1, eMinecraftColour_Mob_SkeletonHorse_Colour2, IDS_SKELETON_HORSE); + setId(Skeleton::create, eTYPE_SKELETON, L"Skeleton", 51 | ((Skeleton::TYPE_STRAY + 1) << 12), eMinecraftColour_Mob_Stray_Colour1, eMinecraftColour_Mob_Stray_Colour2, IDS_STRAY); + setId(Zombie::create, eTYPE_ZOMBIE, L"Zombie", 54 | (1 << 12), eMinecraftColour_Mob_Husk_Colour1, eMinecraftColour_Mob_Husk_Colour2, IDS_HUSK); + #ifndef _CONTENT_PACKAGE - setId(EntityHorse::create, eTYPE_HORSE, L"EntityHorse", 100 | ((EntityHorse::TYPE_SKELETON + 1) << 12), eMinecraftColour_Mob_Horse_Colour1, eMinecraftColour_Mob_Horse_Colour2, IDS_SKELETON_HORSE); setId(EntityHorse::create, eTYPE_HORSE, L"EntityHorse", 100 | ((EntityHorse::TYPE_UNDEAD + 1) << 12), eMinecraftColour_Mob_Horse_Colour1, eMinecraftColour_Mob_Horse_Colour2, IDS_ZOMBIE_HORSE); setId(Ocelot::create, eTYPE_OCELOT, L"Ozelot", 98 | ((Ocelot::TYPE_BLACK + 1) << 12), eMinecraftColour_Mob_Ocelot_Colour1, eMinecraftColour_Mob_Ocelot_Colour2, IDS_OZELOT ); setId(Ocelot::create, eTYPE_OCELOT, L"Ozelot", 98 | ((Ocelot::TYPE_RED + 1) << 12), eMinecraftColour_Mob_Ocelot_Colour1, eMinecraftColour_Mob_Ocelot_Colour2, IDS_OZELOT ); diff --git a/Minecraft.World/EntityTypeMap.cpp b/Minecraft.World/EntityTypeMap.cpp index 450d2f75..3ad6fe74 100644 --- a/Minecraft.World/EntityTypeMap.cpp +++ b/Minecraft.World/EntityTypeMap.cpp @@ -56,6 +56,9 @@ static const unordered_map s_nameToType = { { L"small_fireball", eTYPE_SMALL_FIREBALL }, { L"wither_skull", eTYPE_WITHER_SKULL }, { L"dragon_fireball", eTYPE_DRAGON_FIREBALL }, + { L"area_effect_cloud", eTYPE_AREA_EFFECT_CLOUD }, + { L"shulker", eTYPE_SHULKER }, + { L"shulker_bullet", eTYPE_SHULKER_BULLET }, { L"fireworks_rocket", eTYPE_FIREWORKS_ROCKET }, { L"eyeofender", eTYPE_EYEOFENDERSIGNAL }, // hanging diff --git a/Minecraft.World/FenceGateTile.cpp b/Minecraft.World/FenceGateTile.cpp index 39584442..d6b6ab99 100644 --- a/Minecraft.World/FenceGateTile.cpp +++ b/Minecraft.World/FenceGateTile.cpp @@ -172,7 +172,7 @@ bool FenceGateTile::use(Level *level, int x, int y, int z, shared_ptr pl if (soundOnly) { // 4J - added - just do enough to play the sound - level->levelEvent(player, LevelEvent::SOUND_OPEN_DOOR, x, y, z, 0); // 4J - changed event to pass player rather than nullptr as the source of the event so we can filter the broadcast properly + level->levelEvent(player, isOpen(level->getData(x, y, z)) ? LevelEvent::SOUND_CLOSE_FENCE_GATE : LevelEvent::SOUND_OPEN_FENCE_GATE, x, y, z, 0); // 4J - changed event to pass player rather than nullptr as the source of the event so we can filter the broadcast properly return false; } @@ -192,7 +192,7 @@ bool FenceGateTile::use(Level *level, int x, int y, int z, shared_ptr pl } level->setData(x, y, z, data | OPEN_BIT, Tile::UPDATE_CLIENTS); } - level->levelEvent(player, LevelEvent::SOUND_OPEN_DOOR, x, y, z, 0); + level->levelEvent(player, isOpen(level->getData(x, y, z)) ? LevelEvent::SOUND_OPEN_FENCE_GATE : LevelEvent::SOUND_CLOSE_FENCE_GATE, x, y, z, 0); return true; } @@ -208,12 +208,12 @@ void FenceGateTile::neighborChanged(Level *level, int x, int y, int z, int type) if (signal && !isOpen(data)) { level->setData(x, y, z, data | OPEN_BIT, Tile::UPDATE_CLIENTS); - level->levelEvent(nullptr, LevelEvent::SOUND_OPEN_DOOR, x, y, z, 0); + level->levelEvent(nullptr, LevelEvent::SOUND_OPEN_FENCE_GATE, x, y, z, 0); } else if (!signal && isOpen(data)) { level->setData(x, y, z, data & ~OPEN_BIT, Tile::UPDATE_CLIENTS); - level->levelEvent(nullptr, LevelEvent::SOUND_OPEN_DOOR, x, y, z, 0); + level->levelEvent(nullptr, LevelEvent::SOUND_CLOSE_FENCE_GATE, x, y, z, 0); } } } diff --git a/Minecraft.World/FishingHook.cpp b/Minecraft.World/FishingHook.cpp index 34c700c7..fe4c75da 100644 --- a/Minecraft.World/FishingHook.cpp +++ b/Minecraft.World/FishingHook.cpp @@ -8,6 +8,7 @@ #include "net.minecraft.world.entity.item.h" #include "net.minecraft.world.entity.h" #include "net.minecraft.world.damagesource.h" +#include "net.minecraft.world.effect.h" #include "com.mojang.nbt.h" #include "FishingHook.h" #include "SoundTypes.h" @@ -117,8 +118,10 @@ FishingHook::FishingHook(Level *level, std::shared_ptr mob) : Entity( l void FishingHook::getEnchantLevels() { if (this->owner == nullptr) return; std::shared_ptr fishing_rod = owner->getSelectedItem(); - // TODO; Account for luck effect once implemented. this->luckLevel = EnchantmentHelper::getEnchantmentLevel(65, fishing_rod); // Luck of the sea + if (MobEffectInstance *luck = owner->getEffect(MobEffect::luck)) this->luckLevel += luck->getAmplifier() + 1; + if (MobEffectInstance *unluck = owner->getEffect(MobEffect::unluck)) this->luckLevel -= unluck->getAmplifier() + 1; + if (this->luckLevel < 0) this->luckLevel = 0; this->lureLevel = EnchantmentHelper::getEnchantmentLevel(64, fishing_rod); // Lure } @@ -280,7 +283,7 @@ void FishingHook::tick() for (auto it = objects->begin(); it != objects->end(); it++) { std::shared_ptr e = *it; // objects->at(i); - if (!e->isPickable() || (e == owner && flightTime < 5)) continue; + if ((!e->isPickable() && !e->instanceof(eTYPE_ITEMENTITY)) || (e == owner && flightTime < 5)) continue; float rr = 0.3f; AABB *bb = e->bb->grow(rr, rr, rr); @@ -310,10 +313,8 @@ void FishingHook::tick() // 4J Stu Move fix for : fix for #48587 - CRASH: Code: Gameplay: Hitting another player with the fishing bobber crashes the game. [Fishing pole, line] // Incorrect dynamic_pointer_cast used around the shared_from_this() DamageSource *damageSource = DamageSource::thrown(shared_from_this(), owner); - if (res->entity->hurt(damageSource, 0)) - { - hookedIn = res->entity; - } + res->entity->hurt(damageSource, 0); + hookedIn = res->entity; delete damageSource; } else @@ -611,12 +612,12 @@ int FishingHook::retrieve() double ya = owner->y - y; double za = owner->z - z; - double dist = sqrt(xa * xa + ya * ya + za * za); double speed = 0.1; hookedIn->xd += xa * speed; - hookedIn->yd += ya * speed + sqrt(dist) * 0.08; + hookedIn->yd += ya * speed; hookedIn->zd += za * speed; - dmg = 3; + hookedIn->hurtMarked = true; + dmg = hookedIn->instanceof(eTYPE_ITEMENTITY) ? 3 : 5; } else if (nibble > 0) { diff --git a/Minecraft.World/FurnaceRecipes.cpp b/Minecraft.World/FurnaceRecipes.cpp index afffd8c8..3ea6df60 100644 --- a/Minecraft.World/FurnaceRecipes.cpp +++ b/Minecraft.World/FurnaceRecipes.cpp @@ -22,6 +22,7 @@ FurnaceRecipes::FurnaceRecipes() addFurnaceRecipy(Tile::gold_ore_Id, new ItemInstance(Item::gold_ingot), 1); addFurnaceRecipy(Tile::diamond_ore_Id, new ItemInstance(Item::diamond), 1); addFurnaceRecipy(Tile::sand_Id, new ItemInstance(Tile::glass), .1f); + addFurnaceRecipy(Item::chorus_fruit_Id, new ItemInstance(Item::chorus_fruit_popped), .1f); addFurnaceRecipy(Item::porkchop_Id, new ItemInstance(Item::cooked_porkchop), .35f); addFurnaceRecipy(Item::beef_Id, new ItemInstance(Item::cooked_beef), .35f); addFurnaceRecipy(Item::rabbit_Id, new ItemInstance(Item::cooked_rabbit), .35f); diff --git a/Minecraft.World/GoldenAppleItem.cpp b/Minecraft.World/GoldenAppleItem.cpp index 47e2c21c..25ec54d6 100644 --- a/Minecraft.World/GoldenAppleItem.cpp +++ b/Minecraft.World/GoldenAppleItem.cpp @@ -26,7 +26,7 @@ const Rarity *GoldenAppleItem::getRarity(shared_ptr itemInstance) void GoldenAppleItem::addEatEffect(shared_ptr instance, Level *level, shared_ptr player) { - if (!level->isClientSide) player->addEffect(new MobEffectInstance(MobEffect::absorption->id, 2 * 60 * SharedConstants::TICKS_PER_SECOND, 0)); + if (!level->isClientSide) player->addEffect(new MobEffectInstance(MobEffect::absorption->id, 2 * 60 * SharedConstants::TICKS_PER_SECOND, instance->getAuxValue() > 0 ? 3 : 0)); if (instance->getAuxValue() > 0) { diff --git a/Minecraft.World/GravelTile.cpp b/Minecraft.World/GravelTile.cpp index 86c34962..fc11d764 100644 --- a/Minecraft.World/GravelTile.cpp +++ b/Minecraft.World/GravelTile.cpp @@ -11,4 +11,8 @@ int GravelTile::getResource(int data, Random *random, int playerBonusLevel) if (playerBonusLevel > 3) playerBonusLevel = 3; if (random->nextInt(10 - playerBonusLevel * 3) == 0) return Item::flint->id; return id; -} \ No newline at end of file +} +unsigned int GravelTile::getDustColor(int data) +{ + return 0xff807c7b; +} diff --git a/Minecraft.World/GravelTile.h b/Minecraft.World/GravelTile.h index 0457a9e9..7631f294 100644 --- a/Minecraft.World/GravelTile.h +++ b/Minecraft.World/GravelTile.h @@ -6,6 +6,7 @@ class Random; class GravelTile : public HeavyTile { public: + virtual unsigned int getDustColor(int data); GravelTile(int type); virtual int getResource(int data, Random *random, int playerBonusLevel); }; diff --git a/Minecraft.World/HayBlockTile.h b/Minecraft.World/HayBlockTile.h index 49a7d309..7cf34623 100644 --- a/Minecraft.World/HayBlockTile.h +++ b/Minecraft.World/HayBlockTile.h @@ -14,6 +14,7 @@ public: virtual int convertBlockStateToLegacyData(BlockState *state) override; virtual Tile::BlockState getBlockState(LevelSource *level, int x, int y, int z) override; virtual Tile::BlockState getBlockState(int data); + virtual float getFallDamageMultiplier() { return 0.2f; } protected: Icon *getTypeTexture(int type); diff --git a/Minecraft.World/HeavyTile.cpp b/Minecraft.World/HeavyTile.cpp index cf96f740..6cf4798e 100644 --- a/Minecraft.World/HeavyTile.cpp +++ b/Minecraft.World/HeavyTile.cpp @@ -89,4 +89,20 @@ bool HeavyTile::isFree(Level *level, int x, int y, int z) void HeavyTile::onLand(Level *level, int xt, int yt, int zt, int data) { -} \ No newline at end of file +} +void HeavyTile::animateTick(Level *level, int x, int y, int z, Random *random) +{ + if (random->nextInt(16) != 0) return; + if (!isFree(level, x, y - 1, z)) return; + + unsigned int colour = getDustColor(level->getData(x, y, z)); + float r = ((colour >> 16) & 0xff) / 255.0f; + float g = ((colour >> 8) & 0xff) / 255.0f; + float b = (colour & 0xff) / 255.0f; + level->addParticle(eParticleType_fallingDust, x + random->nextFloat(), y - 0.05, z + random->nextFloat(), r, g, b); +} + +unsigned int HeavyTile::getDustColor(int data) +{ + return 0xff000000; +} diff --git a/Minecraft.World/HeavyTile.h b/Minecraft.World/HeavyTile.h index f68ed162..bb82fcb3 100644 --- a/Minecraft.World/HeavyTile.h +++ b/Minecraft.World/HeavyTile.h @@ -23,4 +23,7 @@ public: virtual int getTickDelay(Level *level); static bool isFree(Level *level, int x, int y, int z); virtual void onLand(Level *level, int xt, int yt, int zt, int data); + + virtual void animateTick(Level *level, int x, int y, int z, Random *random); + virtual unsigned int getDustColor(int data); }; diff --git a/Minecraft.World/HoeItem.cpp b/Minecraft.World/HoeItem.cpp index 5978c10b..b2efb7ce 100644 --- a/Minecraft.World/HoeItem.cpp +++ b/Minecraft.World/HoeItem.cpp @@ -26,7 +26,7 @@ bool HoeItem::useOn(shared_ptr instance, shared_ptr player if(!bTestUseOnOnly) { Tile *tile = Tile::farmland; - level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, tile->soundType->getStepSound(), (tile->soundType->getVolume() + 1) / 2, tile->soundType->getPitch() * 0.8f); + level->playSound(x + 0.5f, y + 0.5f, z + 0.5f, eSoundType_ITEM_HOE_TILL, 1.0f, 1.0f); if (level->isClientSide) return true; level->setTileAndUpdate(x, y, z, tile->id); diff --git a/Minecraft.World/IglooFeature.cpp b/Minecraft.World/IglooFeature.cpp index 3b06347e..c843a015 100644 --- a/Minecraft.World/IglooFeature.cpp +++ b/Minecraft.World/IglooFeature.cpp @@ -202,6 +202,7 @@ void IglooFeature::placeBasement(Level *level, Random *random, int x, int y, int auto zombieVillager = std::make_shared(level); zombieVillager->setVillager(true); + zombieVillager->setProfession(level->random->nextInt(Villager::PROFESSION_MAX)); zombieVillager->setPersistenceRequired(); zombieVillager->moveTo(x - 1 + 0.5, by + 1, rz + 3 + 0.5, 0, 0); level->addEntity(zombieVillager); diff --git a/Minecraft.World/Item.cpp b/Minecraft.World/Item.cpp index aee69209..7d2ab562 100644 --- a/Minecraft.World/Item.cpp +++ b/Minecraft.World/Item.cpp @@ -273,6 +273,18 @@ Item* Item::prismarine_crystal = nullptr; Item* Item::prismarine_shard = nullptr; Item* Item::elytra = nullptr; +Item* Item::chorus_fruit = nullptr; +Item* Item::chorus_fruit_popped = nullptr; +Item* Item::end_crystal = nullptr; +Item* Item::dragon_breath = nullptr; +Item* Item::spectral_arrow = nullptr; +Item* Item::tipped_arrow = nullptr; +PotionItem* Item::lingering_potion = nullptr; +Item* Item::spruce_boat = nullptr; +Item* Item::birch_boat = nullptr; +Item* Item::jungle_boat = nullptr; +Item* Item::acacia_boat = nullptr; +Item* Item::dark_oak_boat = nullptr; Item* Item::beetroot = nullptr; Item* Item::beetroot_seeds = nullptr; @@ -545,6 +557,18 @@ void Item::staticCtor() Item::prismarine_crystal = (new Item(154))->setIconName(L"prismarineCrystal")->setDescriptionId(IDS_ITEM_PRISMARINE_CRYSTAL)->setUseDescriptionId(IDS_ITEM_PRISMARINE_CRYSTAL_DESC); Item::prismarine_shard = (new Item(153))->setIconName(L"prismarineShard")->setDescriptionId(IDS_ITEM_PRISMARINE_SHARD)->setUseDescriptionId(IDS_ITEM_PRISMARINE_SHARD_DESC); Item::elytra = (new ElytraItem())->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_cloth)->setIconName(L"elytra")->setDescriptionId(IDS_ITEM_ELYTRA)->setUseDescriptionId(IDS_ITEM_ELYTRA); + Item::chorus_fruit = static_cast((new ChorusFruitItem(chorus_fruit_Id - 256, 4, FoodConstants::FOOD_SATURATION_LOW))->setIconName(L"chorus_fruit")->setDescriptionId(IDS_ITEM_CHORUS_FRUIT)->setUseDescriptionId(IDS_DESC_ITEM_CHORUS_FRUIT))->setCanAlwaysEat(); + Item::chorus_fruit_popped = (new Item(chorus_fruit_popped_Id - 256))->setBaseItemTypeAndMaterial(eBaseItemType_undefined, eMaterial_purpur)->setIconName(L"chorus_fruit_popped")->setDescriptionId(IDS_ITEM_CHORUS_FRUIT_POPPED)->setUseDescriptionId(IDS_DESC_ITEM_CHORUS_FRUIT_POPPED); + Item::end_crystal = (new EndCrystalItem(end_crystal_Id - 256))->setIconName(L"end_crystal")->setDescriptionId(IDS_ITEM_END_CRYSTAL)->setUseDescriptionId(IDS_DESC_ITEM_END_CRYSTAL); + Item::dragon_breath = (new Item(dragon_breath_Id - 256))->setBaseItemTypeAndMaterial(eBaseItemType_undefined, eMaterial_ender)->setIconName(L"dragon_breath")->setPotionBrewingFormula(PotionBrewing::MOD_GUNPOWDER)->setCraftingRemainingItem(Item::glassBottle)->setDescriptionId(IDS_ITEM_DRAGON_BREATH)->setUseDescriptionId(IDS_DESC_ITEM_DRAGON_BREATH); + Item::spectral_arrow = (new Item(spectral_arrow_Id - 256))->setIconName(L"spectral_arrow")->setBaseItemTypeAndMaterial(eBaseItemType_bow, eMaterial_arrow)->setDescriptionId(IDS_ITEM_SPECTRAL_ARROW)->setUseDescriptionId(IDS_DESC_SPECTRAL_ARROW); + Item::tipped_arrow = (new TippedArrowItem(tipped_arrow_Id - 256))->setIconName(L"tipped_arrow_base")->setBaseItemTypeAndMaterial(eBaseItemType_bow, eMaterial_arrow)->setDescriptionId(IDS_ITEM_TIPPED_ARROW)->setUseDescriptionId(IDS_DESC_TIPPED_ARROW); + Item::lingering_potion = static_cast((new LingeringPotionItem(lingering_potion_Id - 256))->setIconName(L"potion_bottle_lingering")->setDescriptionId(IDS_ITEM_LINGERING_POTION)->setUseDescriptionId(IDS_DESC_POTION)); + Item::spruce_boat = (new BoatItem(spruce_boat_Id - 256, Boat::SPRUCE))->setIconName(L"spruce_boat")->setDescriptionId(IDS_ITEM_BOAT_SPRUCE)->setUseDescriptionId(IDS_DESC_BOAT); + Item::birch_boat = (new BoatItem(birch_boat_Id - 256, Boat::BIRCH))->setIconName(L"birch_boat")->setDescriptionId(IDS_ITEM_BOAT_BIRCH)->setUseDescriptionId(IDS_DESC_BOAT); + Item::jungle_boat = (new BoatItem(jungle_boat_Id - 256, Boat::JUNGLE))->setIconName(L"jungle_boat")->setDescriptionId(IDS_ITEM_BOAT_JUNGLE)->setUseDescriptionId(IDS_DESC_BOAT); + Item::acacia_boat = (new BoatItem(acacia_boat_Id - 256, Boat::ACACIA))->setIconName(L"acacia_boat")->setDescriptionId(IDS_ITEM_BOAT_ACACIA)->setUseDescriptionId(IDS_DESC_BOAT); + Item::dark_oak_boat = (new BoatItem(dark_oak_boat_Id - 256, Boat::DARK_OAK))->setIconName(L"dark_oak_boat")->setDescriptionId(IDS_ITEM_BOAT_DARK_OAK)->setUseDescriptionId(IDS_DESC_BOAT); Item::beetroot = (new FoodItem(178, 1, 0.6f, false))->setIconName(L"beetroot")->setDescriptionId(IDS_BEETROOT)->setUseDescriptionId(IDS_DESC_BEETROOT); Item::beetroot_seeds = (new SeedItem(179, Tile::beetroots_Id, Tile::farmland_Id))->setIconName(L"beetroot_seeds")->setDescriptionId(IDS_BEETROOT_SEEDS)->setUseDescriptionId(IDS_DESC_BEETROOT_SEEDS); @@ -1206,5 +1230,17 @@ const int Item::quartz_Id ; const int Item::beetroot_Id ; const int Item::beetroot_seeds_Id ; const int Item::beetroot_soup_Id ; +const int Item::chorus_fruit_Id; +const int Item::chorus_fruit_popped_Id; +const int Item::end_crystal_Id; +const int Item::dragon_breath_Id; +const int Item::spectral_arrow_Id; +const int Item::tipped_arrow_Id; +const int Item::lingering_potion_Id; +const int Item::spruce_boat_Id; +const int Item::birch_boat_Id; +const int Item::jungle_boat_Id; +const int Item::acacia_boat_Id; +const int Item::dark_oak_boat_Id; #endif diff --git a/Minecraft.World/Item.h b/Minecraft.World/Item.h index 8c1a62ba..6b5e4bcd 100644 --- a/Minecraft.World/Item.h +++ b/Minecraft.World/Item.h @@ -92,7 +92,8 @@ public: eMaterial_bookshelf, eMaterial_wheat, eMaterial_acaciawood, - eMaterial_darkwood + eMaterial_darkwood, + eMaterial_purpur } eMaterial; @@ -438,6 +439,18 @@ public: static Item* prismarine_crystal; static Item* prismarine_shard; static Item* elytra; + static Item* chorus_fruit; + static Item* chorus_fruit_popped; + static Item* end_crystal; + static Item* dragon_breath; + static Item* spectral_arrow; + static Item* tipped_arrow; + static PotionItem* lingering_potion; + static Item* spruce_boat; + static Item* birch_boat; + static Item* jungle_boat; + static Item* acacia_boat; + static Item* dark_oak_boat; static Item* beetroot; static Item* beetroot_seeds; @@ -674,6 +687,18 @@ public: static const int dark_oak_door_Id = 431; + static const int chorus_fruit_Id = 432; + static const int chorus_fruit_popped_Id = 433; + static const int end_crystal_Id = 426; + static const int dragon_breath_Id = 437; + static const int spectral_arrow_Id = 439; + static const int tipped_arrow_Id = 440; + static const int lingering_potion_Id = 441; + static const int spruce_boat_Id = 444; + static const int birch_boat_Id = 445; + static const int jungle_boat_Id = 446; + static const int acacia_boat_Id = 447; + static const int dark_oak_boat_Id = 448; static const int elytra_Id = 443; static const int beetroot_Id = 434; @@ -823,6 +848,7 @@ public: virtual int getEnchantmentValue(); virtual bool hasMultipleSpriteLayers(); virtual Icon *getLayerIcon(int auxValue, int spriteLayer); + virtual Icon *GetOverrideCountIcon(shared_ptr itemInstance, shared_ptr player) { return nullptr; } virtual bool mayBePlacedInAdventureMode(); virtual bool isValidRepairItem(shared_ptr source, shared_ptr repairItem); virtual void registerIcons(IconRegister *iconRegister); diff --git a/Minecraft.World/Level.cpp b/Minecraft.World/Level.cpp index 4563e0db..aecf17e1 100644 --- a/Minecraft.World/Level.cpp +++ b/Minecraft.World/Level.cpp @@ -1777,6 +1777,10 @@ void Level::playerRemoved(shared_ptr e) void Level::removeEntity(shared_ptr e) { + if (e->getExtraRider() != nullptr) + { + e->getExtraRider()->ride(nullptr); + } if (e->rider.lock()) { e->rider.lock()->ride(nullptr); @@ -1875,13 +1879,11 @@ AABBList *Level::getCubes(shared_ptr source, AABB *box, bool noEntities/ int z0 = Mth::floor(box->z0); int z1 = Mth::floor(box->z1 + 1); - int maxxz = ( dimension->getXZSize() * 16 ) / 2; - int minxz = -maxxz; for (int x = x0; x < x1; x++) for (int z = z0; z < z1; z++) { // 4J - If we are outside the map, return solid AABBs (rock is a bit of an arbitrary choice here, just need a correct AABB) - if( blockAtEdge && ( ( x < minxz ) || ( x >= maxxz ) || ( z < minxz ) || ( z >= maxxz ) ) ) + if( blockAtEdge && dimension->isOutsideWorldEdge(x, z) ) { for (int y = y0 - 1; y < y1; y++) { @@ -1940,6 +1942,8 @@ AABBList *Level::getCubes(shared_ptr source, AABB *box, bool noEntities/ vector > *ee = getEntities(source, box->grow(r, r, r)); for (auto& it : *ee) { + if (source != nullptr && (it->riding == source || source->riding == it || (source->riding != nullptr && source->riding == it->riding))) continue; + AABB *collideBox = it->getCollideBox(); if (collideBox != nullptr && collideBox->intersects(box)) { @@ -2331,9 +2335,9 @@ void Level::tickEntities() if (e->riding != nullptr) { - if (e->riding->removed || e->riding->rider.lock() != e) + if (e->riding->removed || !e->riding->hasRider(e)) { - e->riding->rider = weak_ptr(); + e->riding->removeRider(e); e->riding = nullptr; } else @@ -2580,14 +2584,28 @@ void Level::tick(shared_ptr e, bool actual) { if (e->rider.lock()->removed || e->rider.lock()->riding != e) { - e->rider.lock()->riding = nullptr; - e->rider = weak_ptr(); + shared_ptr oldRider = e->rider.lock(); + oldRider->riding = nullptr; + e->removeRider(oldRider); } else { tick(e->rider.lock()); } } + shared_ptr extraRider = e->getExtraRider(); + if (extraRider != nullptr) + { + if (extraRider->removed || extraRider->riding != e) + { + if (extraRider->riding == e) extraRider->riding = nullptr; + e->removeRider(extraRider); + } + else + { + tick(extraRider); + } + } } } diff --git a/Minecraft.World/LevelChunk.cpp b/Minecraft.World/LevelChunk.cpp index 0cb11539..8b9d2530 100644 --- a/Minecraft.World/LevelChunk.cpp +++ b/Minecraft.World/LevelChunk.cpp @@ -1381,9 +1381,8 @@ void LevelChunk::addTileEntity(shared_ptr te) setTileEntity(xx, yy, zz, te); if( loaded ) { - EnterCriticalSection(&level->m_tileEntityListCS); - level->tileEntityList.push_back(te); - LeaveCriticalSection(&level->m_tileEntityListCS); + vector > added(1, te); + level->addAllPendingTileEntities(added); } } diff --git a/Minecraft.World/LevelData.cpp b/Minecraft.World/LevelData.cpp index 0edd2d7e..67044e8e 100644 --- a/Minecraft.World/LevelData.cpp +++ b/Minecraft.World/LevelData.cpp @@ -8,6 +8,10 @@ LevelData::LevelData() { + m_modernEnd = true; + m_endDragonKilled = false; + m_endPreviouslyKilled = false; + m_endGatewaySpawned = false; } LevelData::LevelData(CompoundTag *tag) @@ -76,6 +80,24 @@ LevelData::LevelData(CompoundTag *tag) thunderTime = tag->getInt(L"thunderTime"); thundering = tag->getBoolean(L"thundering"); hardcore = tag->getBoolean(L"hardcore"); + m_modernEnd = tag->contains(L"ModernEnd") ? tag->getBoolean(L"ModernEnd") : false; + if (app.GetResetEnd()) m_modernEnd = true; + m_endDragonKilled = false; + m_endPreviouslyKilled = false; + m_endGatewaySpawned = false; + if (tag->contains(L"DragonFight")) + { + CompoundTag *fight = tag->getCompound(L"DragonFight"); + m_endDragonKilled = fight->getBoolean(L"DragonKilled"); + m_endPreviouslyKilled = fight->getBoolean(L"PreviouslyKilled"); + m_endGatewaySpawned = fight->getBoolean(L"GatewaySpawned"); + } + if (app.GetResetEnd()) + { + m_endDragonKilled = false; + m_endPreviouslyKilled = false; + m_endGatewaySpawned = false; + } if (tag->contains(L"initialized")) { @@ -218,6 +240,10 @@ LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName) this->levelName = levelName; m_pGenerator = levelSettings->getLevelType(); hardcore = levelSettings->isHardcore(); + m_modernEnd = levelSettings->isModernEnd(); + m_endDragonKilled = false; + m_endPreviouslyKilled = false; + m_endGatewaySpawned = false; generatorOptions = levelSettings->getLevelTypeOptions(); allowCommands = levelSettings->getAllowCommands(); @@ -298,6 +324,10 @@ LevelData::LevelData(LevelData *copy) thunderTime = copy->thunderTime; thundering = copy->thundering; hardcore = copy->hardcore; + m_modernEnd = copy->m_modernEnd; + m_endDragonKilled = copy->m_endDragonKilled; + m_endPreviouslyKilled = copy->m_endPreviouslyKilled; + m_endGatewaySpawned = copy->m_endGatewaySpawned; allowCommands = copy->allowCommands; initialized = copy->initialized; newSeaLevel = copy->newSeaLevel; @@ -362,6 +392,14 @@ void LevelData::setTagData(CompoundTag *tag) tag->putInt(L"thunderTime", thunderTime); tag->putBoolean(L"thundering", thundering); tag->putBoolean(L"hardcore", hardcore); + tag->putBoolean(L"ModernEnd", m_modernEnd); + { + CompoundTag *fight = new CompoundTag(); + fight->putBoolean(L"DragonKilled", m_endDragonKilled); + fight->putBoolean(L"PreviouslyKilled", m_endPreviouslyKilled); + fight->putBoolean(L"GatewaySpawned", m_endGatewaySpawned); + tag->putCompound(L"DragonFight", fight); + } tag->putBoolean(L"allowCommands", allowCommands); tag->putBoolean(L"initialized", initialized); // 4J: Game rules are now stored with app game host options @@ -750,3 +788,20 @@ int LevelData::getHellScale() { return m_hellScale; } + +bool LevelData::isModernEnd() +{ + return m_modernEnd; +} + +void LevelData::setModernEnd(bool modernEnd) +{ + m_modernEnd = modernEnd; +} + +bool LevelData::isEndDragonKilled() { return m_endDragonKilled; } +void LevelData::setEndDragonKilled(bool killed) { m_endDragonKilled = killed; } +bool LevelData::isEndPreviouslyKilled() { return m_endPreviouslyKilled; } +void LevelData::setEndPreviouslyKilled(bool killed) { m_endPreviouslyKilled = killed; } +bool LevelData::isEndGatewaySpawned() { return m_endGatewaySpawned; } +void LevelData::setEndGatewaySpawned(bool spawned) { m_endGatewaySpawned = spawned; } diff --git a/Minecraft.World/LevelData.h b/Minecraft.World/LevelData.h index 2f17d827..2b52e144 100644 --- a/Minecraft.World/LevelData.h +++ b/Minecraft.World/LevelData.h @@ -36,6 +36,10 @@ private: GameType *gameType; bool generateMapFeatures; bool hardcore; + bool m_modernEnd; + bool m_endDragonKilled; + bool m_endPreviouslyKilled; + bool m_endGatewaySpawned; bool allowCommands; bool initialized; bool newSeaLevel; // 4J added @@ -142,6 +146,14 @@ public: virtual void setGeneratorOptions(const wstring &options); virtual bool isHardcore(); virtual void setHardcore(bool hardcore); + virtual bool isModernEnd(); + virtual void setModernEnd(bool modernEnd); + virtual bool isEndDragonKilled(); + virtual void setEndDragonKilled(bool killed); + virtual bool isEndPreviouslyKilled(); + virtual void setEndPreviouslyKilled(bool killed); + virtual bool isEndGatewaySpawned(); + virtual void setEndGatewaySpawned(bool spawned); virtual bool getAllowCommands(); virtual void setAllowCommands(bool allowCommands); virtual bool isInitialized(); diff --git a/Minecraft.World/LevelEvent.h b/Minecraft.World/LevelEvent.h index 8bd3fea5..9df3f6fd 100644 --- a/Minecraft.World/LevelEvent.h +++ b/Minecraft.World/LevelEvent.h @@ -28,6 +28,19 @@ public: static const int SOUND_ANVIL_BROKEN = 1020; static const int SOUND_ANVIL_USED = 1021; static const int SOUND_ANVIL_LAND = 1022; + static const int SOUND_PORTAL_TRAVEL = 1032; + static const int SOUND_CHORUS_GROW = 1033; + static const int SOUND_CHORUS_DEATH = 1034; + static const int SOUND_OPEN_WOODEN_DOOR = 1040; + static const int SOUND_CLOSE_WOODEN_DOOR = 1041; + static const int SOUND_OPEN_IRON_DOOR = 1042; + static const int SOUND_CLOSE_IRON_DOOR = 1043; + static const int SOUND_OPEN_WOODEN_TRAP_DOOR = 1044; + static const int SOUND_CLOSE_WOODEN_TRAP_DOOR = 1045; + static const int SOUND_OPEN_IRON_TRAP_DOOR = 1046; + static const int SOUND_CLOSE_IRON_TRAP_DOOR = 1047; + static const int SOUND_OPEN_FENCE_GATE = 1048; + static const int SOUND_CLOSE_FENCE_GATE = 1049; static const int PARTICLES_SHOOT = 2000; static const int PARTICLES_DESTROY_BLOCK = 2001; @@ -36,6 +49,9 @@ public: static const int PARTICLES_MOBTILE_SPAWN = 2004; static const int PARTICLES_PLANT_GROWTH = 2005; + static const int ANIMATION_END_GATEWAY_SPAWN = 3000; + static const int ANIMATION_DRAGON_SUMMON_ROAR = 3001; + //static const int ENDERDRAGON_KILLED = 9000; // 4J Added to signal the the enderdragon was killed static const int ENDERDRAGON_FIREBALL_SPLASH = 9001; static const int END_EGG_TELEPORT = 9002; diff --git a/Minecraft.World/LevelSettings.cpp b/Minecraft.World/LevelSettings.cpp index bf9b6a56..221c77ed 100644 --- a/Minecraft.World/LevelSettings.cpp +++ b/Minecraft.World/LevelSettings.cpp @@ -104,9 +104,10 @@ void LevelSettings::_init(int64_t seed, GameType *gameType, bool generateMapFeat levelTypeOptions = L""; m_xzSize = xzSize; m_hellScale = hellScale; + m_modernEnd = true; } -LevelSettings::LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) : +LevelSettings::LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale, bool modernEnd) : seed(seed), gameType(gameType), hardcore(hardcore), @@ -116,11 +117,13 @@ LevelSettings::LevelSettings(int64_t seed, GameType *gameType, bool generateMapF startingBonusItems(false) { _init(seed, gameType, generateMapFeatures, hardcore, newSeaLevel, levelType, xzSize, hellScale); + m_modernEnd = modernEnd; } LevelSettings::LevelSettings(LevelData *levelData) { _init(levelData->getSeed(), levelData->getGameType(), levelData->isGenerateMapFeatures(), levelData->isHardcore(), levelData->useNewSeaLevel(), levelData->getGenerator(), levelData->getXZSize(), levelData->getHellScale() ); + m_modernEnd = levelData->isModernEnd(); } LevelSettings *LevelSettings::enableStartingBonusItems() @@ -200,4 +203,8 @@ int LevelSettings::getHellScale() wstring LevelSettings::getLevelTypeOptions() { return levelTypeOptions; -} \ No newline at end of file +} +bool LevelSettings::isModernEnd() +{ + return m_modernEnd; +} diff --git a/Minecraft.World/LevelSettings.h b/Minecraft.World/LevelSettings.h index a77f0d7a..4fe3c3d1 100644 --- a/Minecraft.World/LevelSettings.h +++ b/Minecraft.World/LevelSettings.h @@ -50,11 +50,12 @@ private: wstring levelTypeOptions; int m_xzSize; // 4J Added int m_hellScale; + bool m_modernEnd; void _init(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param public: - LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param + LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale, bool modernEnd = true); // 4J Added xzSize and hellScale param LevelSettings(LevelData *levelData); LevelSettings *enableStartingBonusItems(); // 4J - brought forward from 1.3.2 LevelSettings *enableSinglePlayerCommands(); @@ -69,6 +70,7 @@ public: bool useNewSeaLevel(); int getXZSize(); // 4J Added int getHellScale(); // 4J Added + bool isModernEnd(); static GameType *validateGameType(int gameType); wstring getLevelTypeOptions(); }; diff --git a/Minecraft.World/LingeringPotionItem.cpp b/Minecraft.World/LingeringPotionItem.cpp new file mode 100644 index 00000000..53f0f4e1 --- /dev/null +++ b/Minecraft.World/LingeringPotionItem.cpp @@ -0,0 +1,51 @@ +#include "stdafx.h" +#include "net.minecraft.world.item.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.entity.player.h" +#include "net.minecraft.world.entity.projectile.h" +#include "IconRegister.h" +#include "LingeringPotionItem.h" +#include "SoundTypes.h" + +const wstring LingeringPotionItem::LINGERING_ICON = L"potion_bottle_lingering"; + +LingeringPotionItem::LingeringPotionItem(int id) : PotionItem(id) +{ + iconLingering = nullptr; +} + +bool LingeringPotionItem::TestUse(shared_ptr itemInstance, Level *level, shared_ptr player) +{ + return true; +} + +shared_ptr LingeringPotionItem::use(shared_ptr instance, Level *level, shared_ptr player) +{ + if (!player->abilities.instabuild) instance->count--; + level->playEntitySound(player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f)); + if (!level->isClientSide) + { + level->addEntity(std::make_shared(level, player, std::make_shared(id, 1, instance->getAuxValue()))); + } + return instance; +} + +Icon *LingeringPotionItem::getIcon(int auxValue) +{ + return iconLingering; +} + +wstring LingeringPotionItem::getHoverName(shared_ptr itemInstance) +{ + if (itemInstance->getAuxValue() == 0) + { + return app.GetString(IDS_ITEM_LINGERING_WATER_BOTTLE); + } + return PotionItem::getHoverName(itemInstance); +} + +void LingeringPotionItem::registerIcons(IconRegister *iconRegister) +{ + PotionItem::registerIcons(iconRegister); + iconLingering = iconRegister->registerIcon(LINGERING_ICON); +} diff --git a/Minecraft.World/LingeringPotionItem.h b/Minecraft.World/LingeringPotionItem.h new file mode 100644 index 00000000..692cbbc4 --- /dev/null +++ b/Minecraft.World/LingeringPotionItem.h @@ -0,0 +1,23 @@ +#pragma once +#include "PotionItem.h" + +class LingeringPotionItem : public PotionItem +{ +public: + static const wstring LINGERING_ICON; + +private: + Icon *iconLingering; + +public: + LingeringPotionItem(int id); + + virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); + virtual bool TestUse(shared_ptr itemInstance, Level *level, shared_ptr player); + virtual Icon *getIcon(int auxValue); + virtual wstring getHoverName(shared_ptr itemInstance); + virtual void registerIcons(IconRegister *iconRegister); + +protected: + virtual float getTooltipDurationScale() { return 0.25f; } +}; diff --git a/Minecraft.World/LivingEntity.cpp b/Minecraft.World/LivingEntity.cpp index 2d6f1210..5170bd92 100644 --- a/Minecraft.World/LivingEntity.cpp +++ b/Minecraft.World/LivingEntity.cpp @@ -144,6 +144,7 @@ void LivingEntity::defineSynchedData() entityData->define(DATA_EFFECT_AMBIENCE_ID, static_cast(0)); entityData->define(DATA_ARROW_COUNT_ID, static_cast(0)); entityData->define(DATA_HEALTH_ID, 1.0f); + entityData->define(DATA_GLOWING_ID, static_cast(0)); } void LivingEntity::registerAttributes() @@ -589,6 +590,7 @@ void LivingEntity::tickEffects() entityData->set(DATA_EFFECT_COLOR_ID, 0); setInvisible(false); setWeakened(false); + setGlowing(false); } else { @@ -603,6 +605,7 @@ void LivingEntity::tickEffects() entityData->set(DATA_EFFECT_COLOR_ID, colorValue); setInvisible(hasEffect(MobEffect::invisibility->id)); setWeakened(hasEffect(MobEffect::weakness->id)); + setGlowing(hasEffect(MobEffect::glowing->id)); } } effectsDirty = false; @@ -1148,20 +1151,13 @@ bool LivingEntity::onLadder() case Tile::ladder_Id: case Tile::vine_Id: // 4J-PB - TU9 - add climbable vines return true; - case Tile::trapdoor_Id: // hexagonny - add climbable (opened) trapdoors + case Tile::trapdoor_Id: + case Tile::iron_trapdoor_Id: { - if ((level->getData(xt, yt, zt) & 0x4) != 0) - { - switch (level->getTile(xt, yt + 1, zt)) - { - case Tile::ladder_Id: - case Tile::vine_Id: - return false; - default: - return level->getTile(xt, yt - 1, zt) == Tile::ladder_Id; - } - } - break; + int data = level->getData(xt, yt, zt); + if ((data & 0x4) == 0) return false; + if (level->getTile(xt, yt - 1, zt) != Tile::ladder_Id) return false; + return level->getData(xt, yt - 1, zt) == (data & 3) + 2; } default: break; @@ -1185,7 +1181,7 @@ void LivingEntity::causeFallDamage(float distance) MobEffectInstance *jumpBoost = getEffect(MobEffect::jump); float padding = jumpBoost != nullptr ? jumpBoost->getAmplifier() + 1 : 0; - int dmg = static_cast(ceil(distance - 3 - padding)); + int dmg = static_cast(ceil((distance - 3 - padding) * fallDamageMultiplier)); if (dmg > 0) { // 4J - new sounds here brought forward from 1.2.3 @@ -1691,7 +1687,16 @@ void LivingEntity::travel(float xa, float ya) if (!level->isClientSide || (level->hasChunkAt(static_cast(x), 0, static_cast(z)) && level->getChunkAt(static_cast(x), static_cast(z))->loaded)) { - yd -= 0.08; + MobEffectInstance *levitation = getEffect(MobEffect::levitation); + if (levitation != nullptr) + { + yd += (0.05 * (levitation->getAmplifier() + 1) - yd) * 0.2; + fallDistance = 0; + } + else + { + yd -= 0.08; + } } else if (y > 0) { @@ -2246,3 +2251,13 @@ HitResult *LivingEntity::rayTrace(double blockReachDistance, float partialTicks) return this->level->clip(vec3, vec32, false, false); } + +bool LivingEntity::isGlowing() +{ + return entityData->getByte(DATA_GLOWING_ID) != 0; +} + +void LivingEntity::setGlowing(bool value) +{ + entityData->set(DATA_GLOWING_ID, static_cast(value ? 1 : 0)); +} diff --git a/Minecraft.World/LivingEntity.h b/Minecraft.World/LivingEntity.h index f06329da..6eb5b7f5 100644 --- a/Minecraft.World/LivingEntity.h +++ b/Minecraft.World/LivingEntity.h @@ -49,6 +49,7 @@ public: static const int DATA_EFFECT_COLOR_ID = 7; static const int DATA_EFFECT_AMBIENCE_ID = 8; static const int DATA_ARROW_COUNT_ID = 9; + static const int DATA_GLOWING_ID = 5; private: CombatTracker* combatTracker; @@ -203,6 +204,8 @@ public: virtual bool onLadder(); virtual bool isShootable(); virtual bool isAlive(); + virtual bool isGlowing(); + virtual void setGlowing(bool value); virtual void onChangedBlock(BlockPos pos); virtual void causeFallDamage(float distance); virtual void animateHurt(); diff --git a/Minecraft.World/LoginPacket.cpp b/Minecraft.World/LoginPacket.cpp index 1fe74d3c..bcebcf6c 100644 --- a/Minecraft.World/LoginPacket.cpp +++ b/Minecraft.World/LoginPacket.cpp @@ -35,6 +35,7 @@ LoginPacket::LoginPacket() m_xzSize = LEVEL_MAX_WIDTH; m_hellScale = HELL_LEVEL_MAX_SCALE; m_isHardcore = false; + m_modernEnd = false; } // Client -> Server @@ -65,10 +66,11 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID o m_xzSize = LEVEL_MAX_WIDTH; m_hellScale = HELL_LEVEL_MAX_SCALE; m_isHardcore = false; + m_modernEnd = false; } // Server -> Client -LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale, bool isHardcore) +LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale, bool isHardcore, bool modernEnd) { this->userName = userName; this->clientVersion = clientVersion; @@ -95,6 +97,7 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType * m_xzSize = xzSize; m_hellScale = hellScale; m_isHardcore = isHardcore; + m_modernEnd = modernEnd; } void LoginPacket::read(DataInputStream *dis) //throws IOException @@ -110,7 +113,8 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException seed = dis->readLong(); gameType = dis->readInt(); m_isHardcore = (gameType & 0x8) != 0; - gameType = gameType & ~0x8; + m_modernEnd = (gameType & 0x10) != 0; + gameType = gameType & ~0x18; dimension = dis->readByte(); mapHeight = dis->readByte(); maxPlayers = dis->readByte(); @@ -149,7 +153,7 @@ void LoginPacket::write(DataOutputStream *dos) //throws IOException writeUtf(m_pLevelType->getGeneratorName(), dos); } dos->writeLong(seed); - dos->writeInt(m_isHardcore ? (gameType | 0x8) : gameType); + dos->writeInt(gameType | (m_isHardcore ? 0x8 : 0) | (m_modernEnd ? 0x10 : 0)); dos->writeByte(dimension); dos->writeByte(mapHeight); dos->writeByte(maxPlayers); diff --git a/Minecraft.World/LoginPacket.h b/Minecraft.World/LoginPacket.h index e168ef79..360ab577 100644 --- a/Minecraft.World/LoginPacket.h +++ b/Minecraft.World/LoginPacket.h @@ -25,6 +25,7 @@ public: int m_xzSize; // 4J Added int m_hellScale; // 4J Added bool m_isHardcore; // 4J Added - for hardcore mode + bool m_modernEnd; // 1.8.2 int gameType; @@ -32,7 +33,7 @@ public: BYTE maxPlayers; LoginPacket(); - LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale, bool isHardcore = false); // Server -> Client + LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale, bool isHardcore = false, bool modernEnd = false); // Server -> Client LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest); // Client -> Server virtual void read(DataInputStream *dis); diff --git a/Minecraft.World/McRegionLevelStorage.cpp b/Minecraft.World/McRegionLevelStorage.cpp index 7588d51b..27e1ebf2 100644 --- a/Minecraft.World/McRegionLevelStorage.cpp +++ b/Minecraft.World/McRegionLevelStorage.cpp @@ -92,6 +92,34 @@ ChunkStorage *McRegionLevelStorage::createChunkStorage(Dimension *dimension) delete endFiles; } } + + if(app.GetResetEnd()) + { +#ifdef SPLIT_SAVES + vector *endRegionFiles = m_saveFile->getRegionFilesByDimension(2); + if(endRegionFiles!=nullptr) + { + DWORD bytesWritten = 0; + for(auto& endFile : *endRegionFiles) + { + m_saveFile->zeroFile(endFile, endFile->getFileSize(), &bytesWritten); + } + delete endRegionFiles; + } +#else + vector *endRegionFiles = m_saveFile->getFilesWithPrefix(LevelStorage::ENDER_FOLDER); + if(endRegionFiles!=nullptr) + { + for(auto& endFile : *endRegionFiles) + { + m_saveFile->deleteFile(endFile); + } + delete endRegionFiles; + } +#endif + resetEndPlayerPositions(); + } + return new McRegionChunkStorage(m_saveFile, LevelStorage::ENDER_FOLDER); } diff --git a/Minecraft.World/MeleeAttackGoal.cpp b/Minecraft.World/MeleeAttackGoal.cpp index 5b7b0179..c12607e2 100644 --- a/Minecraft.World/MeleeAttackGoal.cpp +++ b/Minecraft.World/MeleeAttackGoal.cpp @@ -91,6 +91,6 @@ void MeleeAttackGoal::tick() if (mob->distanceToSqr(target->x, target->bb->y0, target->z) > meleeRadiusSqr) return; if (attackTime > 0) return; attackTime = 20; - if (mob->getCarriedItem() != nullptr) mob->swing(); + mob->swing(); mob->doHurtTarget(target); } diff --git a/Minecraft.World/Mob.h b/Minecraft.World/Mob.h index 62a9661d..87cb8f6d 100644 --- a/Minecraft.World/Mob.h +++ b/Minecraft.World/Mob.h @@ -141,7 +141,7 @@ protected: public: virtual int getMaxHeadXRot(); -protected: +public: void lookAt(shared_ptr e, float yMax, float xMax); bool isLookingAtAnEntity(); shared_ptr getLookingAt(); diff --git a/Minecraft.World/MobEffect.cpp b/Minecraft.World/MobEffect.cpp index 6ca532a7..f3a79154 100644 --- a/Minecraft.World/MobEffect.cpp +++ b/Minecraft.World/MobEffect.cpp @@ -35,10 +35,10 @@ MobEffect *MobEffect::wither; MobEffect *MobEffect::healthBoost; MobEffect *MobEffect::absorption; MobEffect *MobEffect::saturation; -MobEffect *MobEffect::reserved_24; -MobEffect *MobEffect::reserved_25; -MobEffect *MobEffect::reserved_26; -MobEffect *MobEffect::reserved_27; +MobEffect *MobEffect::glowing; +MobEffect *MobEffect::levitation; +MobEffect *MobEffect::luck; +MobEffect *MobEffect::unluck; MobEffect *MobEffect::reserved_28; MobEffect *MobEffect::reserved_29; MobEffect *MobEffect::reserved_30; @@ -51,7 +51,7 @@ void MobEffect::staticCtor() movementSlowdown = (new MobEffect(2, true, eMinecraftColour_Effect_MovementSlowDown)) ->setDescriptionId(IDS_POTION_MOVESLOWDOWN) ->setPostfixDescriptionId(IDS_POTION_MOVESLOWDOWN_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Slowness)->addAttributeModifier(SharedMonsterAttributes::MOVEMENT_SPEED, eModifierId_POTION_MOVESLOWDOWN, -0.15f, AttributeModifier::OPERATION_MULTIPLY_TOTAL); //->setIcon(1, 0); digSpeed = (new MobEffect(3, false, eMinecraftColour_Effect_DigSpeed)) ->setDescriptionId(IDS_POTION_DIGSPEED) ->setPostfixDescriptionId(IDS_POTION_DIGSPEED_POSTFIX)->setDurationModifier(1.5)->setIcon(MobEffect::e_MobEffectIcon_Haste); //->setIcon(2, 0); digSlowdown = (new MobEffect(4, true, eMinecraftColour_Effect_DigSlowdown)) ->setDescriptionId(IDS_POTION_DIGSLOWDOWN) ->setPostfixDescriptionId(IDS_POTION_DIGSLOWDOWN_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_MiningFatigue); //->setIcon(3, 0); - damageBoost = (new AttackDamageMobEffect(5, false, eMinecraftColour_Effect_DamageBoost)) ->setDescriptionId(IDS_POTION_DAMAGEBOOST) ->setPostfixDescriptionId(IDS_POTION_DAMAGEBOOST_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Strength)->addAttributeModifier(SharedMonsterAttributes::ATTACK_DAMAGE, eModifierId_POTION_DAMAGEBOOST, 3, AttributeModifier::OPERATION_MULTIPLY_TOTAL); //->setIcon(4, 0); + damageBoost = (new AttackDamageMobEffect(5, false, eMinecraftColour_Effect_DamageBoost)) ->setDescriptionId(IDS_POTION_DAMAGEBOOST) ->setPostfixDescriptionId(IDS_POTION_DAMAGEBOOST_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Strength)->addAttributeModifier(SharedMonsterAttributes::ATTACK_DAMAGE, eModifierId_POTION_DAMAGEBOOST, 0, AttributeModifier::OPERATION_ADDITION); //->setIcon(4, 0); heal = (new InstantenousMobEffect(6, false, eMinecraftColour_Effect_Heal)) ->setDescriptionId(IDS_POTION_HEAL) ->setPostfixDescriptionId(IDS_POTION_HEAL_POSTFIX); harm = (new InstantenousMobEffect(7, true, eMinecraftColour_Effect_Harm)) ->setDescriptionId(IDS_POTION_HARM) ->setPostfixDescriptionId(IDS_POTION_HARM_POSTFIX); jump = (new MobEffect(8, false, eMinecraftColour_Effect_Jump)) ->setDescriptionId(IDS_POTION_JUMP) ->setPostfixDescriptionId(IDS_POTION_JUMP_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_JumpBoost); //->setIcon(2, 1); @@ -64,16 +64,16 @@ void MobEffect::staticCtor() blindness = (new MobEffect(15, true, eMinecraftColour_Effect_Blindness)) ->setDescriptionId(IDS_POTION_BLINDNESS) ->setPostfixDescriptionId(IDS_POTION_BLINDNESS_POSTFIX)->setDurationModifier(.25)->setIcon(MobEffect::e_MobEffectIcon_Blindness); //->setIcon(5, 1); nightVision = (new MobEffect(16, false, eMinecraftColour_Effect_NightVision)) ->setDescriptionId(IDS_POTION_NIGHTVISION) ->setPostfixDescriptionId(IDS_POTION_NIGHTVISION_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_NightVision); //->setIcon(4, 1); hunger = (new MobEffect(17, true, eMinecraftColour_Effect_Hunger)) ->setDescriptionId(IDS_POTION_HUNGER) ->setPostfixDescriptionId(IDS_POTION_HUNGER_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Hunger); //->setIcon(1, 1); - weakness = (new AttackDamageMobEffect(18, true, eMinecraftColour_Effect_Weakness)) ->setDescriptionId(IDS_POTION_WEAKNESS) ->setPostfixDescriptionId(IDS_POTION_WEAKNESS_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Weakness)->addAttributeModifier(SharedMonsterAttributes::ATTACK_DAMAGE, eModifierId_POTION_WEAKNESS, 2, AttributeModifier::OPERATION_ADDITION); //->setIcon(5, 0); + weakness = (new AttackDamageMobEffect(18, true, eMinecraftColour_Effect_Weakness)) ->setDescriptionId(IDS_POTION_WEAKNESS) ->setPostfixDescriptionId(IDS_POTION_WEAKNESS_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Weakness)->addAttributeModifier(SharedMonsterAttributes::ATTACK_DAMAGE, eModifierId_POTION_WEAKNESS, 0, AttributeModifier::OPERATION_ADDITION); //->setIcon(5, 0); poison = (new MobEffect(19, true, eMinecraftColour_Effect_Poison)) ->setDescriptionId(IDS_POTION_POISON) ->setPostfixDescriptionId(IDS_POTION_POISON_POSTFIX)->setDurationModifier(.25)->setIcon(MobEffect::e_MobEffectIcon_Poison); //->setIcon(6, 0); wither = (new MobEffect(20, true, eMinecraftColour_Effect_Wither)) ->setDescriptionId(IDS_POTION_WITHER) ->setPostfixDescriptionId(IDS_POTION_WITHER_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Wither)->setDurationModifier(.25); healthBoost = (new HealthBoostMobEffect(21, false, eMinecraftColour_Effect_HealthBoost)) ->setDescriptionId(IDS_POTION_HEALTHBOOST) ->setPostfixDescriptionId(IDS_POTION_HEALTHBOOST_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_HealthBoost)->addAttributeModifier(SharedMonsterAttributes::MAX_HEALTH, eModifierId_POTION_HEALTHBOOST, 4, AttributeModifier::OPERATION_ADDITION); absorption = (new AbsoptionMobEffect(22, false, eMinecraftColour_Effect_Absoprtion)) ->setDescriptionId(IDS_POTION_ABSORPTION) ->setPostfixDescriptionId(IDS_POTION_ABSORPTION_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Absorption); saturation = (new InstantenousMobEffect(23, false, eMinecraftColour_Effect_Saturation)) ->setDescriptionId(IDS_POTION_SATURATION) ->setPostfixDescriptionId(IDS_POTION_SATURATION_POSTFIX); - reserved_24 = nullptr; - reserved_25 = nullptr; - reserved_26 = nullptr; - reserved_27 = nullptr; + glowing = (new MobEffect(24, false, eMinecraftColour_Effect_Glowing)) ->setDescriptionId(IDS_POTION_GLOWING) ->setPostfixDescriptionId(IDS_POTION_GLOWING_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Glowing); + levitation = (new MobEffect(25, true, eMinecraftColour_Effect_Levitation)) ->setDescriptionId(IDS_POTION_LEVITATION) ->setPostfixDescriptionId(IDS_POTION_LEVITATION_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Levitation); + luck = (new MobEffect(26, false, eMinecraftColour_Effect_Luck)) ->setDescriptionId(IDS_POTION_LUCK) ->setPostfixDescriptionId(IDS_POTION_LUCK_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Luck)->setDurationModifier(5.0 / 3.0); + unluck = (new MobEffect(27, true, eMinecraftColour_Effect_BadLuck)) ->setDescriptionId(IDS_POTION_UNLUCK) ->setPostfixDescriptionId(IDS_POTION_UNLUCK_POSTFIX)->setIcon(MobEffect::e_MobEffectIcon_Unluck); reserved_28 = nullptr; reserved_29 = nullptr; reserved_30 = nullptr; diff --git a/Minecraft.World/MobEffect.h b/Minecraft.World/MobEffect.h index 84068452..c937e28b 100644 --- a/Minecraft.World/MobEffect.h +++ b/Minecraft.World/MobEffect.h @@ -33,6 +33,10 @@ public: e_MobEffectIcon_Wither, e_MobEffectIcon_HealthBoost, e_MobEffectIcon_Absorption, + e_MobEffectIcon_Glowing, + e_MobEffectIcon_Levitation, + e_MobEffectIcon_Luck, + e_MobEffectIcon_Unluck, e_MobEffectIcon_COUNT, }; @@ -64,10 +68,10 @@ public: static MobEffect *healthBoost; static MobEffect *absorption; static MobEffect *saturation; - static MobEffect *reserved_24; - static MobEffect *reserved_25; - static MobEffect *reserved_26; - static MobEffect *reserved_27; + static MobEffect *glowing; + static MobEffect *levitation; + static MobEffect *luck; + static MobEffect *unluck; static MobEffect *reserved_28; static MobEffect *reserved_29; static MobEffect *reserved_30; diff --git a/Minecraft.World/Monster.cpp b/Minecraft.World/Monster.cpp index 4b7e79d4..2bb90be8 100644 --- a/Minecraft.World/Monster.cpp +++ b/Minecraft.World/Monster.cpp @@ -125,6 +125,7 @@ void Monster::checkHurtTarget(shared_ptr target, float distance) if (attackTime <= 0 && distance < 2.0f && target->bb->y1 > bb->y0 && target->bb->y0 < bb->y1) { attackTime = 20; + swing(); doHurtTarget(target); } } diff --git a/Minecraft.World/MoveControl.cpp b/Minecraft.World/MoveControl.cpp index d2a529a1..391908ce 100644 --- a/Minecraft.World/MoveControl.cpp +++ b/Minecraft.World/MoveControl.cpp @@ -4,6 +4,9 @@ #include "net.minecraft.world.entity.ai.control.h" #include "net.minecraft.world.entity.monster.h" #include "net.minecraft.world.phys.h" +#include "net.minecraft.world.entity.ai.navigation.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.material.h" #include "MoveControl.h" const float MoveControl::MIN_SPEED = 0.0005f; @@ -19,6 +22,9 @@ MoveControl::MoveControl(Mob *mob) speedModifier = 0.0; _hasWanted = false; + _strafing = false; + strafeForwards = 0; + strafeRight = 0; } bool MoveControl::hasWanted() @@ -40,9 +46,56 @@ void MoveControl::setWantedPosition(double x, double y, double z, double speedMo _hasWanted = true; } +void MoveControl::strafe(float forwards, float right) +{ + strafeForwards = forwards; + strafeRight = right; + speedModifier = 0.25; + _strafing = true; +} + void MoveControl::tick() { mob->setYya(0); + mob->xxa = 0; + + if (_strafing) + { + _strafing = false; + _hasWanted = false; + float speed = static_cast(speedModifier * mob->getAttribute(SharedMonsterAttributes::MOVEMENT_SPEED)->getValue()); + float forwards = strafeForwards; + float right = strafeRight; + float length = Mth::sqrt(right * right + forwards * forwards); + if (length < 1.0f) length = 1.0f; + length = speed / length; + right *= length; + forwards *= length; + float sinYaw = Mth::sin(mob->yRot * PI / 180); + float cosYaw = Mth::cos(mob->yRot * PI / 180); + int tx = Mth::floor(mob->x + right * cosYaw - forwards * sinYaw + mob->xd); + int ty = Mth::floor(mob->y); + int tz = Mth::floor(mob->z + forwards * cosYaw + right * sinYaw + mob->zd); + Level *level = mob->level; + bool blocked = level->getMaterial(tx, ty, tz)->blocksMotion() || !level->getMaterial(tx, ty - 1, tz)->blocksMotion(); + PathNavigation *navigation = mob->getNavigation(); + bool sunlit = navigation != nullptr && navigation->getAvoidSun() && level->isDay() && level->canSeeSky(tx, ty, tz); + if (blocked || sunlit) + { + mob->LivingEntity::setSpeed(0); + if (!mob->hasImpulse) + { + mob->xd = 0; + mob->zd = 0; + } + return; + } + mob->LivingEntity::setSpeed(speed); + mob->setYya(strafeForwards); + mob->xxa = strafeRight; + return; + } + if (!_hasWanted) return; _hasWanted = false; diff --git a/Minecraft.World/MoveControl.h b/Minecraft.World/MoveControl.h index fdc5d65d..df904e7f 100644 --- a/Minecraft.World/MoveControl.h +++ b/Minecraft.World/MoveControl.h @@ -19,6 +19,9 @@ private: double wantedZ; double speedModifier; bool _hasWanted; + bool _strafing; + float strafeForwards; + float strafeRight; public: MoveControl(Mob *mob); @@ -27,6 +30,7 @@ public: double getSpeedModifier(); void setWantedPosition(double x, double y, double z, double speedModifier); void setSpeed(float speed); + void strafe(float forwards, float right); virtual void tick(); private: diff --git a/Minecraft.World/MoveVehiclePacket.cpp b/Minecraft.World/MoveVehiclePacket.cpp new file mode 100644 index 00000000..d626580e --- /dev/null +++ b/Minecraft.World/MoveVehiclePacket.cpp @@ -0,0 +1,47 @@ +#include "stdafx.h" +#include "InputOutputStream.h" +#include "PacketListener.h" +#include "MoveVehiclePacket.h" + +MoveVehiclePacket::MoveVehiclePacket() +{ + x = y = z = 0.0; + yRot = xRot = 0.0f; +} + +MoveVehiclePacket::MoveVehiclePacket(double x, double y, double z, float yRot, float xRot) +{ + this->x = x; + this->y = y; + this->z = z; + this->yRot = yRot; + this->xRot = xRot; +} + +void MoveVehiclePacket::read(DataInputStream *dis) +{ + x = dis->readDouble(); + y = dis->readDouble(); + z = dis->readDouble(); + yRot = dis->readFloat(); + xRot = dis->readFloat(); +} + +void MoveVehiclePacket::write(DataOutputStream *dos) +{ + dos->writeDouble(x); + dos->writeDouble(y); + dos->writeDouble(z); + dos->writeFloat(yRot); + dos->writeFloat(xRot); +} + +void MoveVehiclePacket::handle(PacketListener *listener) +{ + listener->handleMoveVehicle(shared_from_this()); +} + +int MoveVehiclePacket::getEstimatedSize() +{ + return 32; +} diff --git a/Minecraft.World/MoveVehiclePacket.h b/Minecraft.World/MoveVehiclePacket.h new file mode 100644 index 00000000..2ceb9754 --- /dev/null +++ b/Minecraft.World/MoveVehiclePacket.h @@ -0,0 +1,22 @@ +#pragma once +using namespace std; + +#include "Packet.h" + +class MoveVehiclePacket : public Packet, public enable_shared_from_this +{ +public: + double x, y, z; + float yRot, xRot; + + MoveVehiclePacket(); + MoveVehiclePacket(double x, double y, double z, float yRot, float xRot); + + virtual void read(DataInputStream *dis); + virtual void write(DataOutputStream *dos); + virtual void handle(PacketListener *listener); + virtual int getEstimatedSize(); + + static shared_ptr create() { return std::make_shared(); } + virtual int getId() { return 168; } +}; diff --git a/Minecraft.World/NetherWartTile.cpp b/Minecraft.World/NetherWartTile.cpp index ef04fc90..f586b346 100644 --- a/Minecraft.World/NetherWartTile.cpp +++ b/Minecraft.World/NetherWartTile.cpp @@ -146,3 +146,11 @@ void NetherWartTile::registerIcons(IconRegister *iconRegister) icons[i] = iconRegister->registerIcon(getIconName() + L"_stage_" + std::to_wstring(i) ); } } + +void NetherWartTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +{ + int age = forceData >= 0 ? forceData : level->getData(x, y, z); + if (age < 0) age = 0; + if (age > MAX_AGE) age = MAX_AGE; + setShape(0, 0, 0, 1, (5 + age * 3) / 16.0f, 1); +} diff --git a/Minecraft.World/NetherWartTile.h b/Minecraft.World/NetherWartTile.h index d43f272b..507c610e 100644 --- a/Minecraft.World/NetherWartTile.h +++ b/Minecraft.World/NetherWartTile.h @@ -14,6 +14,7 @@ private: public: NetherWartTile(int id); virtual void updateDefaultShape(); // 4J Added override + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); virtual void createBlockStateDefinition() override; virtual int defaultBlockState() override; virtual int convertBlockStateToLegacyData(BlockState *state) override; diff --git a/Minecraft.World/Packet.cpp b/Minecraft.World/Packet.cpp index 8329db1f..8699ee9a 100644 --- a/Minecraft.World/Packet.cpp +++ b/Minecraft.World/Packet.cpp @@ -130,6 +130,7 @@ void Packet::staticCtor() map(165, true, false, false, true, typeid(MoveEntityPacketSmall::PosRot), MoveEntityPacketSmall::PosRot::create); map(166, true, true, false, false, typeid(XZPacket), XZPacket::create); map(167, false, true, false, false, typeid(GameCommandPacket), GameCommandPacket::create); + map(168, true, true, false, false, typeid(MoveVehiclePacket), MoveVehiclePacket::create); map(200, true, false, true, false, typeid(AwardStatPacket), AwardStatPacket::create); map(201, true, true, false, false, typeid(PlayerInfoPacket), PlayerInfoPacket::create); // TODO New for 1.8.2 - Repurposed by 4J diff --git a/Minecraft.World/PacketListener.cpp b/Minecraft.World/PacketListener.cpp index 09fbb052..172106e7 100644 --- a/Minecraft.World/PacketListener.cpp +++ b/Minecraft.World/PacketListener.cpp @@ -249,6 +249,11 @@ void PacketListener::handlePlayerInput(shared_ptr packet) onUnhandledPacket( (shared_ptr ) packet); } +void PacketListener::handleMoveVehicle(shared_ptr packet) +{ + onUnhandledPacket( (shared_ptr ) packet); +} + void PacketListener::handleGameEvent(shared_ptr packet) { onUnhandledPacket( (shared_ptr ) packet); diff --git a/Minecraft.World/PacketListener.h b/Minecraft.World/PacketListener.h index f63b6bc7..9b02bf03 100644 --- a/Minecraft.World/PacketListener.h +++ b/Minecraft.World/PacketListener.h @@ -37,6 +37,7 @@ class MovePlayerPacket; class PlayerActionPacket; class PlayerCommandPacket; class PlayerInputPacket; +class MoveVehiclePacket; class PreLoginPacket; class RemoveEntitiesPacket; class RespawnPacket; @@ -164,6 +165,7 @@ public: virtual void handleAwardStat(shared_ptr packet); virtual void handleEntityActionAtPosition(shared_ptr packet); virtual void handlePlayerInput(shared_ptr packet); + virtual void handleMoveVehicle(shared_ptr packet); virtual void handleGameEvent(shared_ptr packet); virtual void handleAddGlobalEntity(shared_ptr packet); virtual void handleComplexItemData(shared_ptr packet); diff --git a/Minecraft.World/ParticleTypes.h b/Minecraft.World/ParticleTypes.h index 3b3697e2..b2637259 100644 --- a/Minecraft.World/ParticleTypes.h +++ b/Minecraft.World/ParticleTypes.h @@ -43,6 +43,8 @@ enum ePARTICLE_TYPE eParticleType_fireworksspark, eParticleType_mobAppearance, eParticleType_thrownegg, + eParticleType_endRod, + eParticleType_fallingDust, // 4J-JEV: In the java, the particle name was used to sneak parameters in for the Terrain and IconCrack particle constructors. diff --git a/Minecraft.World/PathNavigation.h b/Minecraft.World/PathNavigation.h index 9b68637a..d0d6f91b 100644 --- a/Minecraft.World/PathNavigation.h +++ b/Minecraft.World/PathNavigation.h @@ -33,6 +33,7 @@ public: void setCanPassDoors(bool canPass); bool canOpenDoors(); void setAvoidSun(bool avoidSun); + bool getAvoidSun() { return avoidSun; } void setSpeedModifier(double speedModifier); void setCanFloat(bool canFloat); float getMaxDist(); diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index 515ced02..56754532 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -331,6 +331,8 @@ void Player::tick() LivingEntity::tick(); + updatePlayerSize(); + BlockPos currentBlockPos(Mth::floor(x), Mth::floor(y), Mth::floor(z)); if (currentBlockPos != lastChangedBlockPos) { @@ -653,7 +655,7 @@ void Player::ride(shared_ptr e) if (riding != nullptr) { - riding->rider = weak_ptr(); + riding->removeRider(shared_from_this()); } riding = nullptr; @@ -2648,7 +2650,7 @@ FoodData *Player::getFoodData() bool Player::canEat(bool magicalItem) { - return (magicalItem || foodData.needsFood()) && !abilities.invulnerable && !hasInvulnerablePrivilege(); + return magicalItem || (foodData.needsFood() && !abilities.invulnerable && !hasInvulnerablePrivilege()); } bool Player::isHurt() @@ -3539,4 +3541,18 @@ void Player::SetPlayerNameValidState(bool bState) bool Player::isSpectator() { return false; -} \ No newline at end of file +} +void Player::updatePlayerSize() +{ + if (isSleeping() || isElytraFlying()) return; + + float width = 0.6f; + float height = isSneaking() ? 1.65f : 1.8f; + if (width == bbWidth && height == bbHeight) return; + + AABB *resized = AABB::newTemp(bb->x0, bb->y0, bb->z0, bb->x0 + width, bb->y0 + height, bb->z0 + width); + if (riding != nullptr || level->getCubes(shared_from_this(), resized, true)->empty()) + { + setSize(width, height); + } +} diff --git a/Minecraft.World/Player.h b/Minecraft.World/Player.h index 19bef7bd..454e9f47 100644 --- a/Minecraft.World/Player.h +++ b/Minecraft.World/Player.h @@ -97,6 +97,7 @@ public: public: void startFireworkBoost(shared_ptr firework); bool isElytraFlying(); + void updatePlayerSize(); virtual void setElytraFlying(bool flying); virtual void onElytraKineticDamage(float damage); diff --git a/Minecraft.World/PotatoTile.cpp b/Minecraft.World/PotatoTile.cpp index 77eed3c6..2a6737ea 100644 --- a/Minecraft.World/PotatoTile.cpp +++ b/Minecraft.World/PotatoTile.cpp @@ -57,4 +57,10 @@ void PotatoTile::registerIcons(IconRegister *iconRegister) { icons[i] = iconRegister->registerIcon(getIconName() + L"_stage_" + std::to_wstring(i) ); } -} \ No newline at end of file +} +float PotatoTile::getShapeHeight(int age) +{ + if (age < 0) age = 0; + if (age > 7) age = 7; + return (age + 2) / 16.0f; +} diff --git a/Minecraft.World/PotatoTile.h b/Minecraft.World/PotatoTile.h index 8ce5960a..b143312a 100644 --- a/Minecraft.World/PotatoTile.h +++ b/Minecraft.World/PotatoTile.h @@ -20,4 +20,5 @@ protected: public: void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonus); void registerIcons(IconRegister *iconRegister); + virtual float getShapeHeight(int age); }; \ No newline at end of file diff --git a/Minecraft.World/PotionBrewing.cpp b/Minecraft.World/PotionBrewing.cpp index 7a9a877a..4deff105 100644 --- a/Minecraft.World/PotionBrewing.cpp +++ b/Minecraft.World/PotionBrewing.cpp @@ -118,6 +118,7 @@ void PotionBrewing::staticCtor() potionEffectDuration.insert(intStringMap::value_type( MobEffect::invisibility->getId(), L"!0 & 1 & 2 & 3 & 2+6" )); potionEffectDuration.insert(intStringMap::value_type( MobEffect::jump->getId(), L"0 & 1 & !2 & 3 & 0+6" )); potionEffectDuration.insert(intStringMap::value_type( MobEffect::waterBreathing->getId(), L"0 & 1 & 2 & 3 & 0+6" )); + potionEffectDuration.insert(intStringMap::value_type( MobEffect::luck->getId(), L"0 & 1 & 2 & !3 & 0" )); // glowstone increases amplification potionEffectAmplifier.insert(intStringMap::value_type( MobEffect::movementSpeed->getId(), L"5" )); @@ -601,10 +602,6 @@ vector *PotionBrewing::getEffects(int brew, bool includeDis duration >>= amplifier; duration = static_cast(Math::round((double)duration * effect->getDurationModifier())); - if ((brew & THROWABLE_MASK) != 0) - { - duration = static_cast(Math::round((double)duration * .75 + .5)); - } } if (list == nullptr) diff --git a/Minecraft.World/PotionItem.cpp b/Minecraft.World/PotionItem.cpp index 4c5bcdbe..7d67b3ae 100644 --- a/Minecraft.World/PotionItem.cpp +++ b/Minecraft.World/PotionItem.cpp @@ -291,9 +291,11 @@ void PotionItem::appendHoverText(shared_ptr itemInstance, shared_p } effectString += potencyString; // + I18n.get("potion.potency." + effect.getAmplifier()).trim(); } - if (effect->getDuration() > SharedConstants::TICKS_PER_SECOND) + int shownDuration = static_cast(effect->getDuration() * getTooltipDurationScale()); + if (shownDuration > SharedConstants::TICKS_PER_SECOND) { - effectString += L" (" + MobEffect::formatDuration(effect) + L")"; + MobEffectInstance shown(effect->getId(), shownDuration, effect->getAmplifier()); + effectString += L" (" + MobEffect::formatDuration(&shown) + L")"; } eMinecraftColour color = eMinecraftColour_NOT_SET; @@ -355,6 +357,7 @@ unsigned int PotionItem::getUseDescriptionId(shared_ptr instance) else if( MACRO_POTION_IS_INSTANTDAMAGE(brew)) return IDS_POTION_DESC_HARM; else if( MACRO_POTION_IS_WATERBREATHING(brew)) return IDS_POTION_DESC_WATERBREATHING; else if( MACRO_POTION_IS_JUMPBOOST(brew)) return IDS_POTION_DESC_JUMPBOOST; + else if( MACRO_POTION_IS_LUCK(brew)) return IDS_POTION_DESC_LUCK; return IDS_POTION_DESC_EMPTY; } diff --git a/Minecraft.World/PotionItem.h b/Minecraft.World/PotionItem.h index 4a43505f..7c418ff6 100644 --- a/Minecraft.World/PotionItem.h +++ b/Minecraft.World/PotionItem.h @@ -17,6 +17,7 @@ public: private: unordered_map *> cachedMobEffects; +protected: Icon *iconThrowable; Icon *iconDrinkable; Icon *iconOverlay; @@ -49,6 +50,10 @@ public: void registerIcons(IconRegister *iconRegister); static Icon *getTexture(const wstring &name); +protected: + virtual float getTooltipDurationScale() { return 1.0f; } +public: + // 4J Stu - Based loosely on a function that gets added in java much later on (1.3) static vector > *getUniquePotionValues(); private: diff --git a/Minecraft.World/PurpurPillarTile.cpp b/Minecraft.World/PurpurPillarTile.cpp new file mode 100644 index 00000000..c6dd4a58 --- /dev/null +++ b/Minecraft.World/PurpurPillarTile.cpp @@ -0,0 +1,19 @@ +#include "stdafx.h" +#include "net.minecraft.world.h" +#include "IconRegister.h" +#include "PurpurPillarTile.h" + +PurpurPillarTile::PurpurPillarTile(int id) : RotatedPillarTile(id, Material::stone) +{ +} + +Icon *PurpurPillarTile::getTypeTexture(int type) +{ + return icon; +} + +void PurpurPillarTile::registerIcons(IconRegister *iconRegister) +{ + iconTop = iconRegister->registerIcon(L"purpur_pillar_top"); + icon = iconRegister->registerIcon(L"purpur_pillar"); +} diff --git a/Minecraft.World/PurpurPillarTile.h b/Minecraft.World/PurpurPillarTile.h new file mode 100644 index 00000000..c5191f2a --- /dev/null +++ b/Minecraft.World/PurpurPillarTile.h @@ -0,0 +1,16 @@ +#pragma once + +#include "RotatedPillarTile.h" + +class PurpurPillarTile : public RotatedPillarTile +{ + friend class ChunkRebuildData; +public: + PurpurPillarTile(int id); + +protected: + virtual Icon *getTypeTexture(int type) override; + +public: + virtual void registerIcons(IconRegister *iconRegister) override; +}; diff --git a/Minecraft.World/PurpurSlabTile.cpp b/Minecraft.World/PurpurSlabTile.cpp new file mode 100644 index 00000000..9f5ad6ae --- /dev/null +++ b/Minecraft.World/PurpurSlabTile.cpp @@ -0,0 +1,42 @@ +#include "stdafx.h" +#include "net.minecraft.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.h" +#include "IconRegister.h" +#include "PurpurSlabTile.h" + +PurpurSlabTile::PurpurSlabTile(int id) + : HalfSlabTile(id, Material::stone) +{ +} + +Icon *PurpurSlabTile::getTexture(int face, int data) +{ + return icon; +} + +void PurpurSlabTile::registerIcons(IconRegister *iconRegister) +{ + icon = iconRegister->registerIcon(L"purpur_block"); +} + +int PurpurSlabTile::getResource(int data, Random *random, int playerBonusLevel) +{ + return Tile::purpur_slab_Id; +} + +unsigned int PurpurSlabTile::getDescriptionId(int iData) +{ + return IDS_TILE_PURPUR_SLAB; +} + +int PurpurSlabTile::getAuxName(int auxValue) +{ + return IDS_TILE_PURPUR_SLAB; +} + +shared_ptr PurpurSlabTile::getSilkTouchItemInstance(int data) +{ + return make_shared(Tile::purpur_slab_Id, 2, 0); +} diff --git a/Minecraft.World/PurpurSlabTile.h b/Minecraft.World/PurpurSlabTile.h new file mode 100644 index 00000000..d9d97df6 --- /dev/null +++ b/Minecraft.World/PurpurSlabTile.h @@ -0,0 +1,36 @@ +#pragma once +#include "HalfSlabTile.h" + +class ChunkRebuildData; + +class PurpurSlabTile : public HalfSlabTile +{ + friend class ChunkRebuildData; +public: + PurpurSlabTile(int id); + + virtual int isFullSize() = 0; + + virtual Icon *getTexture(int face, int data) override; + virtual void registerIcons(IconRegister *iconRegister) override; + virtual int getResource(int data, Random *random, int playerBonusLevel) override; + virtual unsigned int getDescriptionId(int iData = -1) override; + virtual int getAuxName(int auxValue) override; + +protected: + virtual shared_ptr getSilkTouchItemInstance(int data) override; +}; + +class HalfPurpurSlabTile : public PurpurSlabTile +{ +public: + HalfPurpurSlabTile(int id) : PurpurSlabTile(id) { DerivedInit(); } + virtual int isFullSize() override { return 0; } +}; + +class FullPurpurSlabTile : public PurpurSlabTile +{ +public: + FullPurpurSlabTile(int id) : PurpurSlabTile(id) { DerivedInit(); } + virtual int isFullSize() override { return 1; } +}; diff --git a/Minecraft.World/RangedBowAttackGoal.cpp b/Minecraft.World/RangedBowAttackGoal.cpp new file mode 100644 index 00000000..58af864f --- /dev/null +++ b/Minecraft.World/RangedBowAttackGoal.cpp @@ -0,0 +1,125 @@ +#include "stdafx.h" +#include "net.minecraft.world.entity.ai.control.h" +#include "net.minecraft.world.entity.ai.navigation.h" +#include "net.minecraft.world.entity.ai.sensing.h" +#include "net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.monster.h" +#include "net.minecraft.world.item.h" +#include "net.minecraft.world.phys.h" +#include "RangedBowAttackGoal.h" + +RangedBowAttackGoal::RangedBowAttackGoal(Skeleton *mob, double speedModifier, int attackInterval, float attackRadius) +{ + this->mob = mob; + this->speedModifier = speedModifier; + this->attackInterval = attackInterval; + attackRadiusSqr = attackRadius * attackRadius; + attackTime = -1; + seeTime = 0; + drawTime = -1; + strafingClockwise = false; + strafingBackwards = false; + strafingTime = -1; + setRequiredControlFlags(Control::MoveControlFlag | Control::LookControlFlag); +} + +void RangedBowAttackGoal::setMinAttackInterval(int attackInterval) +{ + this->attackInterval = attackInterval; +} + +bool RangedBowAttackGoal::isHoldingBow() +{ + shared_ptr item = mob->getCarriedItem(); + return item != nullptr && item->id == Item::bow_Id; +} + +bool RangedBowAttackGoal::canUse() +{ + return mob->getTarget() != nullptr && isHoldingBow(); +} + +bool RangedBowAttackGoal::canContinueToUse() +{ + return (canUse() || !mob->getNavigation()->isDone()) && isHoldingBow(); +} + +void RangedBowAttackGoal::start() +{ + Goal::start(); + mob->setAggressive(true); +} + +void RangedBowAttackGoal::stop() +{ + Goal::stop(); + mob->setAggressive(false); + seeTime = 0; + attackTime = -1; + drawTime = -1; +} + +void RangedBowAttackGoal::tick() +{ + shared_ptr target = mob->getTarget(); + if (target == nullptr) return; + + double distance = mob->distanceToSqr(target->x, target->bb->y0, target->z); + bool canSee = mob->getSensing()->canSee(target); + if (canSee != (seeTime > 0)) seeTime = 0; + + if (canSee) ++seeTime; + else --seeTime; + + if (distance > attackRadiusSqr || seeTime < 20) + { + mob->getNavigation()->moveTo(target, speedModifier); + strafingTime = -1; + } + else + { + mob->getNavigation()->stop(); + ++strafingTime; + } + + if (strafingTime >= 20) + { + if (mob->getRandom()->nextFloat() < 0.3) strafingClockwise = !strafingClockwise; + if (mob->getRandom()->nextFloat() < 0.3) strafingBackwards = !strafingBackwards; + strafingTime = 0; + } + + if (strafingTime > -1) + { + if (distance > attackRadiusSqr * 0.75f) strafingBackwards = false; + else if (distance < attackRadiusSqr * 0.25f) strafingBackwards = true; + + mob->getMoveControl()->strafe(strafingBackwards ? -0.5f : 0.5f, strafingClockwise ? 0.5f : -0.5f); + mob->lookAt(target, 30, 30); + } + else + { + mob->getLookControl()->setLookAt(target, 30, 30); + } + + if (drawTime >= 0) + { + if (!canSee) + { + if (seeTime < -60) drawTime = -1; + } + else if (++drawTime >= BowItem::MAX_DRAW_DURATION) + { + float power = drawTime / static_cast(BowItem::MAX_DRAW_DURATION); + power = (power * power + power * 2) / 3; + if (power > 1) power = 1; + drawTime = -1; + mob->performRangedAttack(target, power); + attackTime = attackInterval; + } + } + else if (--attackTime <= 0 && seeTime >= -60) + { + drawTime = 0; + } +} diff --git a/Minecraft.World/RangedBowAttackGoal.h b/Minecraft.World/RangedBowAttackGoal.h new file mode 100644 index 00000000..bb648f4b --- /dev/null +++ b/Minecraft.World/RangedBowAttackGoal.h @@ -0,0 +1,31 @@ +#pragma once + +#include "Goal.h" + +class Skeleton; + +class RangedBowAttackGoal : public Goal +{ +private: + Skeleton *mob; + double speedModifier; + int attackInterval; + float attackRadiusSqr; + int attackTime; + int seeTime; + int drawTime; + bool strafingClockwise; + bool strafingBackwards; + int strafingTime; + +public: + RangedBowAttackGoal(Skeleton *mob, double speedModifier, int attackInterval, float attackRadius); + + void setMinAttackInterval(int attackInterval); + bool isHoldingBow(); + virtual bool canUse(); + virtual bool canContinueToUse(); + virtual void start(); + virtual void stop(); + virtual void tick(); +}; diff --git a/Minecraft.World/Recipes.cpp b/Minecraft.World/Recipes.cpp index c52f4dd6..80a34a08 100644 --- a/Minecraft.World/Recipes.cpp +++ b/Minecraft.World/Recipes.cpp @@ -535,6 +535,63 @@ addShapedRecipy(new ItemInstance(Tile::red_nether_brick, 1), // L'#', Tile::endStone, L'S'); + addShapedRecipy(new ItemInstance(Tile::purpur_block, 4), + L"sscig", + L"FF", + L"FF", + + L'F', Item::chorus_fruit_popped, + L'S'); + + addShapedRecipy(new ItemInstance(Tile::purpur_pillar, 1), + L"ssctg", + L"#", + L"#", + + L'#', Tile::purpurSlabHalf, + L'S'); + + addShapedRecipy(new ItemInstance(Tile::purpur_stairs, 4), + L"sssctg", + L"# ", + L"## ", + L"###", + + L'#', Tile::purpur_block, + L'S'); + + addShapedRecipy(new ItemInstance(Tile::purpur_stairs, 4), + L"sssctg", + L"# ", + L"## ", + L"###", + + L'#', Tile::purpur_pillar, + L'S'); + + addShapedRecipy(new ItemInstance(Tile::purpurSlabHalf, 6), + L"sctg", + L"###", + + L'#', Tile::purpur_block, + L'S'); + + addShapedRecipy(new ItemInstance(Tile::purpurSlabHalf, 6), + L"sctg", + L"###", + + L'#', Tile::purpur_pillar, + L'S'); + + addShapedRecipy(new ItemInstance((Tile*)Tile::end_rod, 4), + L"sscicig", + L"/", + L"#", + + L'/', Item::blaze_rod, + L'#', Item::chorus_fruit_popped, + L'D'); + addShapedRecipy(new ItemInstance(Tile::nether_wart_block, 1), // L"ssscig", L"###", // @@ -806,13 +863,19 @@ addShapedRecipy(new ItemInstance(Tile::red_nether_brick, 1), // L'A', Tile::hopper, L'B', Item::minecart, L'V'); - addShapedRecipy(new ItemInstance(Item::boat, 1), // - L"ssctg", - L"# #", // - L"###", // + { + Item *boats[] = { Item::boat, Item::spruce_boat, Item::birch_boat, Item::jungle_boat, Item::acacia_boat, Item::dark_oak_boat }; + for (int type = 0; type < 6; type++) + { + addShapedRecipy(new ItemInstance(boats[type], 1), + L"ssczg", + L"# #", + L"###", - L'#', Tile::wood, - L'V'); + L'#', new ItemInstance(Tile::wood, 1, type), + L'V'); + } + } addShapedRecipy(new ItemInstance((Item *)Item::fishing_rod, 1), // L"ssscicig", @@ -868,6 +931,48 @@ addShapedRecipy(new ItemInstance(Tile::red_nether_brick, 1), // L'#', Item::stick, L'T'); + addShapedRecipy(new ItemInstance(Item::spectral_arrow, 2), + L"ssscicig", + L" # ", + L"#X#", + L" # ", + + L'#', Item::glowstone_dust, + L'X', Item::arrow, + L'T'); + + { + static const int tippedArrowPotions[] = + { + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_REGENERATION), MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_REGENERATION), MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_REGENERATION), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SPEED), MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_SPEED), MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SPEED), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_FIRE_RESISTANCE), MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_FIRE_RESISTANCE), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_POISON), MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_POISON), MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_POISON), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTHEALTH), MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTHEALTH), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_NIGHTVISION), MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_NIGHTVISION), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INVISIBILITY), MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_INVISIBILITY), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WEAKNESS), MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WEAKNESS), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_STRENGTH), MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_STRENGTH), MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_STRENGTH), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_SLOWNESS), MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_SLOWNESS), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_INSTANTDAMAGE), MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_INSTANTDAMAGE), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_WATERBREATHING), MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_WATERBREATHING), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_JUMPBOOST), MACRO_MAKEPOTION_AUXVAL(0, MASK_LEVEL2, MASK_JUMPBOOST), MACRO_MAKEPOTION_AUXVAL(0, MASK_EXTENDED, MASK_JUMPBOOST), + MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_LUCK), + }; + for (int i = 0; i < sizeof(tippedArrowPotions) / sizeof(tippedArrowPotions[0]); i++) + { + addShapedRecipy(new ItemInstance(Item::tipped_arrow_Id, 8, tippedArrowPotions[i]), + L"sssciczg", + L"###", + L"#X#", + L"###", + + L'#', Item::arrow, + L'X', new ItemInstance(Item::lingering_potion_Id, 1, tippedArrowPotions[i]), + L'T'); + } + } + pWeaponRecipies->addRecipes(this); addShapedRecipy(new ItemInstance(Item::bucket, 1), // diff --git a/Minecraft.World/RedStoneDustTile.cpp b/Minecraft.World/RedStoneDustTile.cpp index d849d77b..c9a6d5c6 100644 --- a/Minecraft.World/RedStoneDustTile.cpp +++ b/Minecraft.World/RedStoneDustTile.cpp @@ -439,3 +439,25 @@ Icon *RedStoneDustTile::getTexture(const wstring &name) if (name.compare(TEXTURE_LINE_OVERLAY) == 0) return Tile::redStoneDust->iconLineOver; return nullptr; } + +void RedStoneDustTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) +{ + bool w = shouldConnectTo(level, x - 1, y, z, Direction::WEST) || (!level->isSolidBlockingTile(x - 1, y, z) && shouldConnectTo(level, x - 1, y - 1, z, Direction::UNDEFINED)); + bool e = shouldConnectTo(level, x + 1, y, z, Direction::EAST) || (!level->isSolidBlockingTile(x + 1, y, z) && shouldConnectTo(level, x + 1, y - 1, z, Direction::UNDEFINED)); + bool n = shouldConnectTo(level, x, y, z - 1, Direction::NORTH) || (!level->isSolidBlockingTile(x, y, z - 1) && shouldConnectTo(level, x, y - 1, z - 1, Direction::UNDEFINED)); + bool s = shouldConnectTo(level, x, y, z + 1, Direction::SOUTH) || (!level->isSolidBlockingTile(x, y, z + 1) && shouldConnectTo(level, x, y - 1, z + 1, Direction::UNDEFINED)); + if (!level->isSolidBlockingTile(x, y + 1, z)) + { + if (level->isSolidBlockingTile(x - 1, y, z) && shouldConnectTo(level, x - 1, y + 1, z, Direction::UNDEFINED)) w = true; + if (level->isSolidBlockingTile(x + 1, y, z) && shouldConnectTo(level, x + 1, y + 1, z, Direction::UNDEFINED)) e = true; + if (level->isSolidBlockingTile(x, y, z - 1) && shouldConnectTo(level, x, y + 1, z - 1, Direction::UNDEFINED)) n = true; + if (level->isSolidBlockingTile(x, y, z + 1) && shouldConnectTo(level, x, y + 1, z + 1, Direction::UNDEFINED)) s = true; + } + + bool north = n || (s && !n && !e && !w); + bool east = e || (w && !n && !e && !s); + bool south = s || (n && !e && !s && !w); + bool west = w || (e && !n && !s && !w); + + setShape(west ? 0.0f : 3.0f / 16.0f, 0, north ? 0.0f : 3.0f / 16.0f, east ? 1.0f : 13.0f / 16.0f, 1.0f / 16.0f, south ? 1.0f : 13.0f / 16.0f); +} diff --git a/Minecraft.World/RedStoneDustTile.h b/Minecraft.World/RedStoneDustTile.h index edd80a95..6c47bc83 100644 --- a/Minecraft.World/RedStoneDustTile.h +++ b/Minecraft.World/RedStoneDustTile.h @@ -31,6 +31,7 @@ public: virtual Tile::BlockState getBlockState(LevelSource *level, int x, int y, int z) override; virtual Tile::BlockState getBlockState(int data); virtual void updateDefaultShape(); // 4J Added override + virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr forceEntity = shared_ptr()); virtual AABB *getAABB(Level *level, int x, int y, int z); virtual bool isSolidRender(bool isServerLevel = false); virtual bool isCubeShaped(); diff --git a/Minecraft.World/RespawnPacket.cpp b/Minecraft.World/RespawnPacket.cpp index aee7d729..4a11370b 100644 --- a/Minecraft.World/RespawnPacket.cpp +++ b/Minecraft.World/RespawnPacket.cpp @@ -18,9 +18,10 @@ RespawnPacket::RespawnPacket() m_xzSize = LEVEL_MAX_WIDTH; m_hellScale = HELL_LEVEL_MAX_SCALE; m_isHardcore = false; + m_modernEnd = false; } -RespawnPacket::RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale, bool isHardcore) +RespawnPacket::RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale, bool isHardcore, bool modernEnd) { this->dimension = dimension; this->mapSeed = mapSeed; @@ -33,6 +34,7 @@ RespawnPacket::RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, Gam m_xzSize = xzSize; m_hellScale = hellScale; m_isHardcore = isHardcore; + m_modernEnd = modernEnd; app.DebugPrintf("RespawnPacket - Difficulty = %d\n",difficulty); } @@ -47,7 +49,8 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException dimension = dis->readByte(); int rawGameType = dis->readByte(); m_isHardcore = (rawGameType & 0x8) != 0; - playerGameType = GameType::byId(rawGameType & ~0x8); + m_modernEnd = (rawGameType & 0x10) != 0; + playerGameType = GameType::byId(rawGameType & ~0x18); mapHeight = dis->readShort(); wstring typeName = readUtf(dis, 16); m_pLevelType = LevelType::getLevelType(typeName); @@ -70,7 +73,7 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException void RespawnPacket::write(DataOutputStream *dos) //throws IOException { dos->writeByte(dimension); - dos->writeByte(m_isHardcore ? (playerGameType->getId() | 0x8) : playerGameType->getId()); + dos->writeByte(playerGameType->getId() | (m_isHardcore ? 0x8 : 0) | (m_modernEnd ? 0x10 : 0)); dos->writeShort(mapHeight); if (m_pLevelType == nullptr) { diff --git a/Minecraft.World/RespawnPacket.h b/Minecraft.World/RespawnPacket.h index bcc72592..622e0cff 100644 --- a/Minecraft.World/RespawnPacket.h +++ b/Minecraft.World/RespawnPacket.h @@ -20,9 +20,10 @@ public: int m_xzSize; // 4J Added int m_hellScale; // 4J Added bool m_isHardcore; // 4J Added - for hardcore mode + bool m_modernEnd; RespawnPacket(); - RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale, bool isHardcore = false); + RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale, bool isHardcore = false, bool modernEnd = false); virtual void handle(PacketListener *listener); virtual void read(DataInputStream *dis); diff --git a/Minecraft.World/SandTile.cpp b/Minecraft.World/SandTile.cpp index 177af316..1c30a302 100644 --- a/Minecraft.World/SandTile.cpp +++ b/Minecraft.World/SandTile.cpp @@ -32,4 +32,8 @@ void SandTile::registerIcons(IconRegister* iconRegister) { icons[i] = iconRegister->registerIcon(TEXTURE_NAMES[i]); } -} \ No newline at end of file +} +unsigned int SandTile::getDustColor(int data) +{ + return (data & 1) ? 0xffa95821 : 0xffdbd3a0; +} diff --git a/Minecraft.World/SandTile.h b/Minecraft.World/SandTile.h index c9200d15..aefd2ff8 100644 --- a/Minecraft.World/SandTile.h +++ b/Minecraft.World/SandTile.h @@ -4,6 +4,7 @@ class SandTile : public HeavyTile { public: + virtual unsigned int getDustColor(int data); static const int RED_SAND = 1; static const int SAND_NAMES_LENGTH = 2; static const unsigned int SAND_NAMES[SAND_NAMES_LENGTH]; diff --git a/Minecraft.World/Shulker.cpp b/Minecraft.World/Shulker.cpp new file mode 100644 index 00000000..e28e3d96 --- /dev/null +++ b/Minecraft.World/Shulker.cpp @@ -0,0 +1,553 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.phys.h" +#include "net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.player.h" +#include "net.minecraft.world.entity.projectile.h" +#include "net.minecraft.world.entity.ai.attributes.h" +#include "net.minecraft.world.entity.ai.goal.h" +#include "net.minecraft.world.entity.ai.goal.target.h" +#include "net.minecraft.world.entity.ai.control.h" +#include "net.minecraft.world.damagesource.h" +#include "com.mojang.nbt.h" +#include "Facing.h" +#include "SoundTypes.h" +#include "ShulkerBullet.h" +#include "Difficulty.h" +#include "SharedMonsterAttributes.h" +#include "Shulker.h" + + +Shulker::ShulkerAttackGoal::ShulkerAttackGoal(Shulker *shulker) : Goal(), shulker(shulker), attackTime(0) +{ + setRequiredControlFlags(3); +} + +bool Shulker::ShulkerAttackGoal::canUse() +{ + shared_ptr target = shulker->getTarget(); + return target != nullptr && target->isAlive() && shulker->level->difficulty != Difficulty::PEACEFUL; +} + +void Shulker::ShulkerAttackGoal::start() +{ + attackTime = 20; + shulker->setRawPeekAmount(100); +} + +void Shulker::ShulkerAttackGoal::stop() +{ + shulker->setRawPeekAmount(0); +} + +void Shulker::ShulkerAttackGoal::tick() +{ + if (shulker->level->difficulty == Difficulty::PEACEFUL) return; + + --attackTime; + shared_ptr target = shulker->getTarget(); + if (target == nullptr) return; + shulker->getLookControl()->setLookAt(target, 180.0f, 180.0f); + + if (shulker->distanceToSqr(target) < 400.0) + { + if (attackTime <= 0) + { + attackTime = 20 + shulker->getRandom()->nextInt(10) * 20 / 2; + int axis = shulker->getAttachFace() / 2; + shulker->level->addEntity(std::make_shared(shulker->level, dynamic_pointer_cast(shulker->shared_from_this()), target, axis)); + shulker->playSound(eSoundType_ENTITY_SHULKER_SHOOT, 2.0f, (shulker->getRandom()->nextFloat() - shulker->getRandom()->nextFloat()) * 0.2f + 1.0f); + } + } + else + { + shulker->setTarget(nullptr); + } +} + +Shulker::ShulkerPeekGoal::ShulkerPeekGoal(Shulker *shulker) : Goal(), shulker(shulker), peekTime(0) +{ +} + +bool Shulker::ShulkerPeekGoal::canUse() +{ + return shulker->getTarget() == nullptr && shulker->getRandom()->nextInt(40) == 0; +} + +bool Shulker::ShulkerPeekGoal::canContinueToUse() +{ + return shulker->getTarget() == nullptr && peekTime > 0; +} + +void Shulker::ShulkerPeekGoal::start() +{ + peekTime = 20 * (1 + shulker->getRandom()->nextInt(3)); + shulker->setRawPeekAmount(30); +} + +void Shulker::ShulkerPeekGoal::stop() +{ + if (shulker->getTarget() == nullptr) shulker->setRawPeekAmount(0); +} + +void Shulker::ShulkerPeekGoal::tick() +{ + --peekTime; +} + +Shulker::ShulkerNearestAttackGoal::ShulkerNearestAttackGoal(Shulker *shulker) : TargetGoal(shulker, true), shulker(shulker) +{ + setRequiredControlFlags(TargetFlag); +} + +bool Shulker::ShulkerNearestAttackGoal::canUse() +{ + if (shulker->level->difficulty == Difficulty::PEACEFUL) return false; + if (shulker->getRandom()->nextInt(10) != 0) return false; + + double within = getFollowDistance(); + double wx = within, wy = 4.0, wz = within; + int face = shulker->getAttachFace(); + if (face == Facing::WEST || face == Facing::EAST) { wx = 4.0; wy = within; } + else if (face == Facing::NORTH || face == Facing::SOUTH) { wz = 4.0; wy = within; } + + vector > *players = shulker->level->getEntitiesOfClass(typeid(Player), shulker->bb->grow(wx, wy, wz)); + shared_ptr best = nullptr; + double bestDist = 0; + if (players != nullptr) + { + for (auto &it : *players) + { + shared_ptr candidate = dynamic_pointer_cast(it); + if (candidate == nullptr || !canAttack(candidate, false)) continue; + double d = shulker->distanceToSqr(candidate); + if (best == nullptr || d < bestDist) + { + best = candidate; + bestDist = d; + } + } + delete players; + } + target = best; + return best != nullptr; +} + +void Shulker::ShulkerNearestAttackGoal::start() +{ + shulker->setTarget(target.lock()); + TargetGoal::start(); +} + + +Shulker::Shulker(Level *level) : Monster(level) +{ + this->defineSynchedData(); + registerAttributes(); + setHealth(getMaxHealth()); + + oldPeekAmount = 0.0f; + peekAmount = 0.0f; + oldAttachX = oldAttachY = oldAttachZ = 0; + hasOldAttach = false; + clientSideTeleportInterpolation = 0; + + setSize(1.0f, 1.0f); + fireImmune = true; + xpReward = XP_REWARD_MEDIUM; + yRot = yRotO = 180.0f; + yHeadRot = yHeadRotO = 180.0f; + yBodyRot = yBodyRotO = 180.0f; + xRot = xRotO = 0.0f; + + goalSelector.addGoal(1, new LookAtPlayerGoal(this, typeid(Player), 8.0f)); + goalSelector.addGoal(4, new ShulkerAttackGoal(this)); + goalSelector.addGoal(7, new ShulkerPeekGoal(this)); + goalSelector.addGoal(8, new RandomLookAroundGoal(this)); + + targetSelector.addGoal(1, new HurtByTargetGoal(this, true)); + targetSelector.addGoal(2, new ShulkerNearestAttackGoal(this)); +} + +void Shulker::defineSynchedData() +{ + Monster::defineSynchedData(); + entityData->define(DATA_ATTACH_FACE, static_cast(Facing::DOWN)); + entityData->define(DATA_ATTACH_X, NO_ATTACH_POSITION); + entityData->define(DATA_ATTACH_Y, NO_ATTACH_POSITION); + entityData->define(DATA_ATTACH_Z, NO_ATTACH_POSITION); + entityData->define(DATA_PEEK, static_cast(0)); + entityData->define(DATA_COLOR, static_cast(10)); +} + +void Shulker::registerAttributes() +{ + Monster::registerAttributes(); + getAttribute(SharedMonsterAttributes::MAX_HEALTH)->setBaseValue(30); +} + +bool Shulker::useNewAi() +{ + return true; +} + +int Shulker::getAmbientSound() +{ + return eSoundType_ENTITY_SHULKER_AMBIENT; +} + +int Shulker::getHurtSound() +{ + return isClosed() ? eSoundType_ENTITY_SHULKER_HURT_CLOSED : eSoundType_ENTITY_SHULKER_HURT; +} + +int Shulker::getDeathSound() +{ + return eSoundType_ENTITY_SHULKER_DEATH; +} + +bool Shulker::makeStepSound() +{ + return false; +} + +bool Shulker::removeWhenFarAway() +{ + return false; +} + +MobGroupData *Shulker::finalizeMobSpawn(MobGroupData *groupData, int extraData) +{ + yRot = yRotO = 180.0f; + yHeadRot = yHeadRotO = 180.0f; + yBodyRot = yBodyRotO = 180.0f; + return Monster::finalizeMobSpawn(groupData, extraData); +} + +bool Shulker::isSolidAt(int x, int y, int z) +{ + return level->isSolidBlockingTileInLoadedChunk(x, y, z, false); +} + +int Shulker::getAttachFace() +{ + int face = entityData->getByte(DATA_ATTACH_FACE); + return (face < 0 || face > 5) ? Facing::DOWN : face; +} + +void Shulker::setAttachFace(int face) +{ + entityData->set(DATA_ATTACH_FACE, static_cast(face)); +} + +bool Shulker::hasAttachPosition() +{ + return entityData->getInteger(DATA_ATTACH_Y) != NO_ATTACH_POSITION; +} + +int Shulker::getAttachX() { return entityData->getInteger(DATA_ATTACH_X); } +int Shulker::getAttachY() { return entityData->getInteger(DATA_ATTACH_Y); } +int Shulker::getAttachZ() { return entityData->getInteger(DATA_ATTACH_Z); } + +void Shulker::setAttachPosition(int ax, int ay, int az) +{ + entityData->set(DATA_ATTACH_X, ax); + entityData->set(DATA_ATTACH_Y, ay); + entityData->set(DATA_ATTACH_Z, az); +} + +int Shulker::getRawPeekAmount() +{ + return entityData->getByte(DATA_PEEK); +} + +void Shulker::setRawPeekAmount(int amount) +{ + if (!level->isClientSide) + { + int old = getRawPeekAmount(); + if (amount == 0 && old != 0) playSound(eSoundType_ENTITY_SHULKER_CLOSE, 1.0f, 1.0f); + else if (amount != 0 && old == 0) playSound(eSoundType_ENTITY_SHULKER_OPEN, 1.0f, 1.0f); + } + entityData->set(DATA_PEEK, static_cast(amount)); +} + +bool Shulker::isClosed() +{ + return getRawPeekAmount() == 0; +} + +float Shulker::getClientPeekAmount(float a) +{ + return oldPeekAmount + (peekAmount - oldPeekAmount) * a; +} + +int Shulker::getColor() +{ + return entityData->getByte(DATA_COLOR); +} + +bool Shulker::teleportSomewhere() +{ + if (!isAlive()) return true; + + int ox = Mth::floor(x); + int oy = Mth::floor(y); + int oz = Mth::floor(z); + for (int attempt = 0; attempt < 5; ++attempt) + { + int cx = ox + 8 - random->nextInt(17); + int cy = oy + 8 - random->nextInt(17); + int cz = oz + 8 - random->nextInt(17); + if (cy <= 0 || !level->isEmptyTile(cx, cy, cz)) continue; + if (!level->getCubes(shared_from_this(), AABB::newTemp(cx, cy, cz, cx + 1.0, cy + 1.0, cz + 1.0))->empty()) continue; + + for (int face = 0; face < 6; ++face) + { + if (isSolidAt(cx + Facing::STEP_X[face], cy + Facing::STEP_Y[face], cz + Facing::STEP_Z[face])) + { + setAttachFace(face); + setAttachPosition(cx, cy, cz); + setRawPeekAmount(0); + setTarget(nullptr); + playSound(eSoundType_MOB_ENDERMEN_PORTAL, 1.0f, 1.0f); + return true; + } + } + } + return false; +} + +void Shulker::snapToAttachPosition() +{ + x = xo = xOld = getAttachX() + 0.5; + y = yo = yOld = getAttachY(); + z = zo = zOld = getAttachZ() + 0.5; +} + +void Shulker::tick() +{ + PathfinderMob::tick(); + + if (riding == nullptr) + { + yRot = yRotO = 180.0f; + yBodyRot = yBodyRotO = 180.0f; + } + + if (!hasAttachPosition() && !level->isClientSide) + { + setAttachPosition(Mth::floor(x), Mth::floor(y), Mth::floor(z)); + } + + if (riding != nullptr) + { + yBodyRot = yRot = yBodyRotO = riding->yRot; + clientSideTeleportInterpolation = 0; + } + else if (!level->isClientSide && hasAttachPosition()) + { + int ax = getAttachX(); + int ay = getAttachY(); + int az = getAttachZ(); + + int inside = level->getTile(ax, ay, az); + if (inside != 0) + { + if (inside == Tile::piston_extension_Id || inside == Tile::piston_head_Id) + { + int facing = level->getData(ax, ay, az) & 7; + if (facing < 6 && level->isEmptyTile(ax + Facing::STEP_X[facing], ay + Facing::STEP_Y[facing], az + Facing::STEP_Z[facing])) + { + setAttachPosition(ax + Facing::STEP_X[facing], ay + Facing::STEP_Y[facing], az + Facing::STEP_Z[facing]); + } + else + { + teleportSomewhere(); + } + } + else + { + teleportSomewhere(); + } + ax = getAttachX(); ay = getAttachY(); az = getAttachZ(); + } + + int face = getAttachFace(); + if (!isSolidAt(ax + Facing::STEP_X[face], ay + Facing::STEP_Y[face], az + Facing::STEP_Z[face])) + { + bool attached = false; + for (int f = 0; f < 6; ++f) + { + if (isSolidAt(ax + Facing::STEP_X[f], ay + Facing::STEP_Y[f], az + Facing::STEP_Z[f])) + { + setAttachFace(f); + attached = true; + break; + } + } + if (!attached) teleportSomewhere(); + } + + face = getAttachFace(); + int opposite = Facing::OPPOSITE_FACING[face]; + if (isSolidAt(getAttachX() + Facing::STEP_X[opposite], getAttachY() + Facing::STEP_Y[opposite], getAttachZ() + Facing::STEP_Z[opposite])) + { + teleportSomewhere(); + } + } + + float targetPeek = getRawPeekAmount() * 0.01f; + oldPeekAmount = peekAmount; + if (peekAmount > targetPeek) + { + peekAmount = max(peekAmount - 0.05f, targetPeek); + } + else if (peekAmount < targetPeek) + { + peekAmount = min(peekAmount + 0.05f, targetPeek); + } + + if (!hasAttachPosition() || riding != nullptr) return; + + if (level->isClientSide) + { + int ax = getAttachX(), ay = getAttachY(), az = getAttachZ(); + if (!hasOldAttach) + { + oldAttachX = ax; oldAttachY = ay; oldAttachZ = az; + hasOldAttach = true; + } + else if (ax != oldAttachX || ay != oldAttachY || az != oldAttachZ) + { + if (clientSideTeleportInterpolation == 0) clientSideTeleportInterpolation = 6; + if (--clientSideTeleportInterpolation <= 0) + { + oldAttachX = ax; oldAttachY = ay; oldAttachZ = az; + clientSideTeleportInterpolation = 0; + } + } + } + + snapToAttachPosition(); + + double peekOffset = 0.5 - Mth::sin((peekAmount + 0.5f) * PI) * 0.5; + double oldPeekOffset = 0.5 - Mth::sin((oldPeekAmount + 0.5f) * PI) * 0.5; + double pushAmount = peekOffset - oldPeekOffset; + double px = 0.0, py = 0.0, pz = 0.0; + switch (getAttachFace()) + { + case Facing::DOWN: + bb->set(x - 0.5, y, z - 0.5, x + 0.5, y + 1.0 + peekOffset, z + 0.5); + py = pushAmount; + break; + case Facing::UP: + bb->set(x - 0.5, y - peekOffset, z - 0.5, x + 0.5, y + 1.0, z + 0.5); + py = -pushAmount; + break; + case Facing::NORTH: + bb->set(x - 0.5, y, z - 0.5, x + 0.5, y + 1.0, z + 0.5 + peekOffset); + pz = pushAmount; + break; + case Facing::SOUTH: + bb->set(x - 0.5, y, z - 0.5 - peekOffset, x + 0.5, y + 1.0, z + 0.5); + pz = -pushAmount; + break; + case Facing::WEST: + bb->set(x - 0.5, y, z - 0.5, x + 0.5 + peekOffset, y + 1.0, z + 0.5); + px = pushAmount; + break; + case Facing::EAST: + bb->set(x - 0.5 - peekOffset, y, z - 0.5, x + 0.5, y + 1.0, z + 0.5); + px = -pushAmount; + break; + } + + if (pushAmount > 0.0) + { + vector > nearby = *level->getEntities(shared_from_this(), bb); + for (auto &e : nearby) + { + if (!e->instanceof(eTYPE_SHULKER) && !e->noPhysics) + { + e->move(px, py, pz); + } + } + } +} + +void Shulker::aiStep() +{ + Monster::aiStep(); + xd = yd = zd = 0.0; + yBodyRotO = yBodyRot = yRot = 180.0f; +} + +bool Shulker::hurt(DamageSource *source, float dmg) +{ + if (isClosed()) + { + shared_ptr direct = source->getDirectEntity(); + if (direct != nullptr && direct->instanceof(eTYPE_PROJECTILE)) return false; + if (!source->isBypassArmor()) dmg *= 0.2f; + } + + if (!Monster::hurt(source, dmg)) return false; + + if (getHealth() < getMaxHealth() * 0.5f && random->nextInt(4) == 0) + { + teleportSomewhere(); + } + return true; +} + +AABB *Shulker::getCollideBox() +{ + return isAlive() ? bb : nullptr; +} + +bool Shulker::isPushable() +{ + return false; +} + +void Shulker::push(shared_ptr e) +{ +} + +float Shulker::getHeadHeight() +{ + return 0.5f; +} + +int Shulker::getMaxHeadXRot() +{ + return 180; +} + +void Shulker::addAdditonalSaveData(CompoundTag *tag) +{ + Monster::addAdditonalSaveData(tag); + tag->putByte(L"AttachFace", static_cast(getAttachFace())); + tag->putByte(L"Peek", static_cast(getRawPeekAmount())); + tag->putByte(L"Color", static_cast(getColor())); + if (hasAttachPosition()) + { + tag->putInt(L"APX", getAttachX()); + tag->putInt(L"APY", getAttachY()); + tag->putInt(L"APZ", getAttachZ()); + } +} + +void Shulker::readAdditionalSaveData(CompoundTag *tag) +{ + Monster::readAdditionalSaveData(tag); + if (tag->contains(L"AttachFace")) setAttachFace(tag->getByte(L"AttachFace")); + if (tag->contains(L"Peek")) setRawPeekAmount(tag->getByte(L"Peek")); + if (tag->contains(L"Color")) entityData->set(DATA_COLOR, tag->getByte(L"Color")); + if (tag->contains(L"APX")) + { + setAttachPosition(tag->getInt(L"APX"), tag->getInt(L"APY"), tag->getInt(L"APZ")); + } +} diff --git a/Minecraft.World/Shulker.h b/Minecraft.World/Shulker.h new file mode 100644 index 00000000..fb79de3d --- /dev/null +++ b/Minecraft.World/Shulker.h @@ -0,0 +1,117 @@ +#pragma once +using namespace std; + +#include "Monster.h" +#include "Goal.h" +#include "TargetGoal.h" + +class Shulker : public Monster +{ +public: + eINSTANCEOF GetType() { return eTYPE_SHULKER; } + static Entity *create(Level *level) { return new Shulker(level); } + + class ShulkerAttackGoal : public Goal + { + public: + ShulkerAttackGoal(Shulker *shulker); + virtual bool canUse(); + virtual void start(); + virtual void stop(); + virtual void tick(); + private: + Shulker *shulker; + int attackTime; + }; + + class ShulkerPeekGoal : public Goal + { + public: + ShulkerPeekGoal(Shulker *shulker); + virtual bool canUse(); + virtual bool canContinueToUse(); + virtual void start(); + virtual void stop(); + virtual void tick(); + private: + Shulker *shulker; + int peekTime; + }; + + class ShulkerNearestAttackGoal : public TargetGoal + { + public: + ShulkerNearestAttackGoal(Shulker *shulker); + virtual bool canUse(); + virtual void start(); + private: + Shulker *shulker; + weak_ptr target; + }; + +private: + static const int DATA_ATTACH_FACE = 16; + static const int DATA_ATTACH_X = 17; + static const int DATA_ATTACH_Y = 18; + static const int DATA_ATTACH_Z = 19; + static const int DATA_PEEK = 20; + static const int DATA_COLOR = 21; + static const int NO_ATTACH_POSITION = -1000; + + float oldPeekAmount; + float peekAmount; + int oldAttachX, oldAttachY, oldAttachZ; + bool hasOldAttach; + int clientSideTeleportInterpolation; + + bool isSolidAt(int x, int y, int z); + void snapToAttachPosition(); + +protected: + virtual void defineSynchedData(); + virtual void registerAttributes(); + virtual int getAmbientSound(); + virtual int getHurtSound(); + virtual int getDeathSound(); + virtual bool makeStepSound(); + virtual bool removeWhenFarAway(); + +public: + Shulker(Level *level); + + virtual bool useNewAi(); + virtual MobGroupData *finalizeMobSpawn(MobGroupData *groupData, int extraData = 0); + virtual void tick(); + virtual void aiStep(); + virtual bool hurt(DamageSource *source, float dmg); + virtual AABB *getCollideBox(); + virtual bool isPushable(); + virtual void push(shared_ptr e); + virtual float getHeadHeight(); + virtual int getMaxHeadXRot(); + virtual void readAdditionalSaveData(CompoundTag *tag); + virtual void addAdditonalSaveData(CompoundTag *tag); + + bool teleportSomewhere(); + bool isClosed(); + + int getAttachFace(); + void setAttachFace(int face); + bool hasAttachPosition(); + int getAttachX(); + int getAttachY(); + int getAttachZ(); + void setAttachPosition(int x, int y, int z); + + int getRawPeekAmount(); + void setRawPeekAmount(int amount); + float getClientPeekAmount(float a); + + int getClientSideTeleportInterpolation() { return clientSideTeleportInterpolation; } + bool hasOldAttachPosition() { return hasOldAttach; } + int getOldAttachX() { return oldAttachX; } + int getOldAttachY() { return oldAttachY; } + int getOldAttachZ() { return oldAttachZ; } + + int getColor(); +}; diff --git a/Minecraft.World/ShulkerBullet.cpp b/Minecraft.World/ShulkerBullet.cpp new file mode 100644 index 00000000..adcfd56b --- /dev/null +++ b/Minecraft.World/ShulkerBullet.cpp @@ -0,0 +1,312 @@ +#include "stdafx.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.phys.h" +#include "net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.player.h" +#include "net.minecraft.world.effect.h" +#include "net.minecraft.world.damagesource.h" +#include "com.mojang.nbt.h" +#include "MobEffectInstance.h" +#include "SharedConstants.h" +#include "Facing.h" +#include "Difficulty.h" +#include "ShulkerBullet.h" + +void ShulkerBullet::_init() +{ + this->defineSynchedData(); + + moveDirection = -1; + steps = 0; + powerX = powerY = powerZ = 0.0; + setSize(0.3125f, 0.3125f); + noPhysics = true; +} + +ShulkerBullet::ShulkerBullet(Level *level) : Entity(level) +{ + _init(); +} + +ShulkerBullet::ShulkerBullet(Level *level, double x, double y, double z, double xd, double yd, double zd) : Entity(level) +{ + _init(); + moveTo(x, y, z, yRot, xRot); + this->xd = xd; + this->yd = yd; + this->zd = zd; +} + +ShulkerBullet::ShulkerBullet(Level *level, shared_ptr owner, shared_ptr target, int axis) : Entity(level) +{ + _init(); + this->owner = owner; + this->target = target; + moveTo(Mth::floor(owner->x) + 0.5, Mth::floor(owner->y) + 0.5, Mth::floor(owner->z) + 0.5, yRot, xRot); + moveDirection = Facing::UP; + selectNextMoveDirection(axis); +} + +void ShulkerBullet::defineSynchedData() +{ +} + +void ShulkerBullet::selectNextMoveDirection(int axis) +{ + shared_ptr t = target.lock(); + + int destX, destY, destZ; + double heightOffset = 0.5; + if (t == nullptr) + { + destX = Mth::floor(x); + destY = Mth::floor(y) - 1; + destZ = Mth::floor(z); + } + else + { + heightOffset = t->bbHeight * 0.5; + destX = static_cast(t->x); + destY = static_cast(t->y) + static_cast(heightOffset); + destZ = static_cast(t->z); + } + + double targetX = destX + 0.5; + double targetY = destY + heightOffset; + double targetZ = destZ + 0.5; + int direction = -1; + + double cdx = destX + 0.5 - x, cdy = destY + 0.5 - y, cdz = destZ + 0.5 - z; + if (cdx * cdx + cdy * cdy + cdz * cdz >= 4.0) + { + int cx = Mth::floor(x), cy = Mth::floor(y), cz = Mth::floor(z); + vector choices; + if (axis != 2) + { + if (cx < destX && level->isEmptyTile(cx + 1, cy, cz)) choices.push_back(Facing::EAST); + else if (cx > destX && level->isEmptyTile(cx - 1, cy, cz)) choices.push_back(Facing::WEST); + } + if (axis != 0) + { + if (cy < destY && level->isEmptyTile(cx, cy + 1, cz)) choices.push_back(Facing::UP); + else if (cy > destY && level->isEmptyTile(cx, cy - 1, cz)) choices.push_back(Facing::DOWN); + } + if (axis != 1) + { + if (cz < destZ && level->isEmptyTile(cx, cy, cz + 1)) choices.push_back(Facing::SOUTH); + else if (cz > destZ && level->isEmptyTile(cx, cy, cz - 1)) choices.push_back(Facing::NORTH); + } + + direction = random->nextInt(6); + if (choices.empty()) + { + for (int attempts = 5; attempts > 0 && !level->isEmptyTile(cx + Facing::STEP_X[direction], cy + Facing::STEP_Y[direction], cz + Facing::STEP_Z[direction]); --attempts) + { + direction = random->nextInt(6); + } + } + else + { + direction = choices[random->nextInt(static_cast(choices.size()))]; + } + + targetX = x + Facing::STEP_X[direction]; + targetY = y + Facing::STEP_Y[direction]; + targetZ = z + Facing::STEP_Z[direction]; + } + + moveDirection = direction; + double dx = targetX - x; + double dy = targetY - y; + double dz = targetZ - z; + double length = sqrt(dx * dx + dy * dy + dz * dz); + if (length == 0.0) + { + powerX = powerY = powerZ = 0.0; + } + else + { + powerX = dx / length * 0.15; + powerY = dy / length * 0.15; + powerZ = dz / length * 0.15; + } + hasImpulse = true; + steps = 10 + random->nextInt(5) * 10; +} + +void ShulkerBullet::onHit(HitResult *res) +{ + if (res->entity == nullptr) playSound(eSoundType_ENTITY_SHULKER_BULLET_HIT, 1.0f, 1.0f); + if (res->entity != nullptr) + { + shared_ptr shooter = owner.lock(); + DamageSource *source = DamageSource::thrown(shared_from_this(), shooter); + if (res->entity->hurt(source, 4.0f) && res->entity->instanceof(eTYPE_LIVINGENTITY)) + { + dynamic_pointer_cast(res->entity)->addEffect(new MobEffectInstance(MobEffect::levitation->id, LEVITATION_DURATION, 0)); + } + delete source; + } + remove(); +} + +void ShulkerBullet::tick() +{ + if (!level->isClientSide && level->difficulty == Difficulty::PEACEFUL) + { + remove(); + return; + } + + Entity::tick(); + + if (!level->isClientSide) + { + shared_ptr t = target.lock(); + bool tracking = t != nullptr && t->isAlive(); + if (tracking && t->instanceof(eTYPE_PLAYER) && dynamic_pointer_cast(t)->isSpectator()) tracking = false; + + if (tracking) + { + powerX = Mth::clamp(static_cast(powerX * 1.025), -1.0f, 1.0f); + powerY = Mth::clamp(static_cast(powerY * 1.025), -1.0f, 1.0f); + powerZ = Mth::clamp(static_cast(powerZ * 1.025), -1.0f, 1.0f); + xd += (powerX - xd) * 0.2; + yd += (powerY - yd) * 0.2; + zd += (powerZ - zd) * 0.2; + } + else + { + yd -= 0.04; + } + + Vec3 *from = Vec3::newTemp(x, y, z); + Vec3 *to = Vec3::newTemp(x + xd, y + yd, z + zd); + HitResult *res = level->clip(from, to); + from = Vec3::newTemp(x, y, z); + to = Vec3::newTemp(x + xd, y + yd, z + zd); + if (res != nullptr) to = Vec3::newTemp(res->pos->x, res->pos->y, res->pos->z); + + shared_ptr shooter = owner.lock(); + shared_ptr hitEntity = nullptr; + double nearest = 0; + vector > *objects = level->getEntities(shared_from_this(), bb->expand(xd, yd, zd)->grow(1, 1, 1)); + for (size_t i = 0; objects != nullptr && i < objects->size(); i++) + { + shared_ptr e = objects->at(i); + if (!e->isPickable() || e == shooter || e->noPhysics) continue; + AABB *hitBox = e->bb->grow(0.3, 0.3, 0.3); + HitResult *p = hitBox->clip(from, to); + if (p != nullptr) + { + double dd = from->distanceTo(p->pos); + delete p; + if (dd < nearest || nearest == 0) + { + hitEntity = e; + nearest = dd; + } + } + } + if (hitEntity != nullptr) + { + if (res != nullptr) delete res; + res = new HitResult(hitEntity); + } + + if (res != nullptr) + { + onHit(res); + delete res; + } + } + + setPos(x + xd, y + yd, z + zd); + + float sd = static_cast(sqrt(xd * xd + zd * zd)); + yRot = static_cast(atan2(xd, zd) * 180 / PI); + xRot = static_cast(atan2(yd, static_cast(sd)) * 180 / PI); + + if (level->isClientSide) + { + level->addParticle(eParticleType_endRod, x - xd, y - yd + 0.15, z - zd, 0, 0, 0); + } + else + { + shared_ptr t = target.lock(); + if (t != nullptr && !t->removed) + { + if (steps > 0 && --steps == 0) + { + selectNextMoveDirection(moveDirection < 0 ? -1 : moveDirection / 2); + } + + if (moveDirection >= 0) + { + int cx = Mth::floor(x), cy = Mth::floor(y), cz = Mth::floor(z); + int axis = moveDirection / 2; + if (level->isSolidBlockingTileInLoadedChunk(cx + Facing::STEP_X[moveDirection], cy + Facing::STEP_Y[moveDirection], cz + Facing::STEP_Z[moveDirection], false)) + { + selectNextMoveDirection(axis); + } + else if ((axis == 2 && cx == Mth::floor(t->x)) || (axis == 1 && cz == Mth::floor(t->z)) || (axis == 0 && cy == Mth::floor(t->y))) + { + selectNextMoveDirection(axis); + } + } + } + } +} + +bool ShulkerBullet::hurt(DamageSource *source, float damage) +{ + if (!level->isClientSide) + { + playSound(eSoundType_ENTITY_SHULKER_BULLET_HIT, 1.0f, 1.0f); + remove(); + } + return true; +} + +bool ShulkerBullet::isPickable() +{ + return true; +} + +bool ShulkerBullet::isOnFire() +{ + return false; +} + +float ShulkerBullet::getBrightness(float a) +{ + return 1.0f; +} + +int ShulkerBullet::getLightColor(float a) +{ + return SharedConstants::FULLBRIGHT_LIGHTVALUE; +} + +bool ShulkerBullet::shouldRenderAtSqrDistance(double distance) +{ + return distance < 16384.0; +} + +void ShulkerBullet::addAdditonalSaveData(CompoundTag *tag) +{ + tag->putInt(L"Dir", moveDirection); + tag->putInt(L"Steps", steps); + tag->putDouble(L"TXD", powerX); + tag->putDouble(L"TYD", powerY); + tag->putDouble(L"TZD", powerZ); +} + +void ShulkerBullet::readAdditionalSaveData(CompoundTag *tag) +{ + moveDirection = tag->contains(L"Dir") ? tag->getInt(L"Dir") : -1; + steps = tag->getInt(L"Steps"); + powerX = tag->getDouble(L"TXD"); + powerY = tag->getDouble(L"TYD"); + powerZ = tag->getDouble(L"TZD"); +} diff --git a/Minecraft.World/ShulkerBullet.h b/Minecraft.World/ShulkerBullet.h new file mode 100644 index 00000000..b00fd209 --- /dev/null +++ b/Minecraft.World/ShulkerBullet.h @@ -0,0 +1,45 @@ +#pragma once +using namespace std; + +#include "Entity.h" + +class LivingEntity; +class HitResult; + +class ShulkerBullet : public Entity +{ +public: + eINSTANCEOF GetType() { return eTYPE_SHULKER_BULLET; } + static Entity *create(Level *level) { return new ShulkerBullet(level); } + + static const int LEVITATION_DURATION = 200; + +private: + weak_ptr owner; + weak_ptr target; + int moveDirection; + int steps; + double powerX, powerY, powerZ; + + void _init(); + void selectNextMoveDirection(int axis); + void onHit(HitResult *res); + +protected: + virtual void defineSynchedData(); + virtual void readAdditionalSaveData(CompoundTag *tag); + virtual void addAdditonalSaveData(CompoundTag *tag); + +public: + ShulkerBullet(Level *level); + ShulkerBullet(Level *level, double x, double y, double z, double xd, double yd, double zd); + ShulkerBullet(Level *level, shared_ptr owner, shared_ptr target, int axis); + + virtual void tick(); + virtual bool hurt(DamageSource *source, float damage); + virtual bool isPickable(); + virtual bool isOnFire(); + virtual float getBrightness(float a); + virtual int getLightColor(float a); + virtual bool shouldRenderAtSqrDistance(double distance); +}; diff --git a/Minecraft.World/Skeleton.cpp b/Minecraft.World/Skeleton.cpp index 2a73e01a..69d49a36 100644 --- a/Minecraft.World/Skeleton.cpp +++ b/Minecraft.World/Skeleton.cpp @@ -2,6 +2,7 @@ #include "net.minecraft.world.h" #include "net.minecraft.world.level.h" #include "net.minecraft.world.level.dimension.h" +#include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.tile.entity.h" #include "net.minecraft.world.item.h" #include "net.minecraft.world.item.enchantment.h" @@ -30,7 +31,7 @@ Skeleton::Skeleton(Level *level) : Monster( level ) registerAttributes(); setHealth(getMaxHealth()); - bowGoal = new RangedAttackGoal(this, this, 1.0, SharedConstants::TICKS_PER_SECOND * 1, SharedConstants::TICKS_PER_SECOND * 3, 15); + bowGoal = new RangedBowAttackGoal(this, 1.0, SharedConstants::TICKS_PER_SECOND * 1, 15); meleeGoal = new MeleeAttackGoal(this, eTYPE_PLAYER, 1.2, false); goalSelector.addGoal(1, new FloatGoal(this)); @@ -64,6 +65,17 @@ void Skeleton::defineSynchedData() Monster::defineSynchedData(); entityData->define(DATA_TYPE_ID, static_cast(TYPE_DEFAULT)); + entityData->define(DATA_AGGRESSIVE_ID, static_cast(0)); +} + +bool Skeleton::isAggressive() +{ + return entityData->getByte(DATA_AGGRESSIVE_ID) != 0; +} + +void Skeleton::setAggressive(bool aggressive) +{ + entityData->set(DATA_AGGRESSIVE_ID, static_cast(aggressive ? 1 : 0)); } bool Skeleton::useNewAi() @@ -73,22 +85,22 @@ bool Skeleton::useNewAi() int Skeleton::getAmbientSound() { - return eSoundType_MOB_SKELETON_AMBIENT; + return getSkeletonType() == TYPE_STRAY ? eSoundType_ENTITY_STRAY_IDLE : eSoundType_MOB_SKELETON_AMBIENT; } int Skeleton::getHurtSound() { - return eSoundType_MOB_SKELETON_HURT; + return getSkeletonType() == TYPE_STRAY ? eSoundType_ENTITY_STRAY_HURT : eSoundType_MOB_SKELETON_HURT; } int Skeleton::getDeathSound() { - return eSoundType_MOB_SKELETON_DEATH; + return getSkeletonType() == TYPE_STRAY ? eSoundType_ENTITY_STRAY_DEATH : eSoundType_MOB_SKELETON_DEATH; } void Skeleton::playStepSound(int xt, int yt, int zt, int t) { - playSound(eSoundType_MOB_SKELETON_STEP, 0.15f, 1); + playSound(getSkeletonType() == TYPE_STRAY ? eSoundType_ENTITY_STRAY_STEP : eSoundType_MOB_SKELETON_STEP, 0.15f, 1); } bool Skeleton::doHurtTarget(shared_ptr target) @@ -111,10 +123,16 @@ MobType Skeleton::getMobType() void Skeleton::aiStep() { + if (!level->isClientSide) + { + shared_ptr carried = getCarriedItem(); + if (carried == nullptr || carried->id != Item::bow_Id) setAggressive(getTarget() != nullptr); + } + if (level->isDay() && !level->isClientSide) { float br = getBrightness(1); - if (br > 0.5f && random->nextFloat() * 30 < (br - 0.4f) * 2 && level->canSeeSky(Mth::floor(x), static_cast(floor(y + 0.5)), Mth::floor(z))) + if (br > 0.5f && random->nextFloat() * 30 < (br - 0.4f) * 2 && level->canSeeSky(Mth::floor(x), Mth::floor(y + getHeadHeight()), Mth::floor(z))) { bool burn = true; @@ -195,6 +213,14 @@ void Skeleton::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) spawnAtLocation(Item::coal_Id, 1); } } + else if (getSkeletonType() == TYPE_STRAY && wasKilledByPlayer) + { + int count = random->nextInt(2 + playerBonusLevel); + for (int i = 0; i < count; i++) + { + spawnAtLocation(std::make_shared(Item::tipped_arrow_Id, 1, MASK_SLOWNESS), 0); + } + } Monster::dropDeathLoot(wasKilledByPlayer, playerBonusLevel); } @@ -228,10 +254,22 @@ MobGroupData *Skeleton::finalizeMobSpawn(MobGroupData *groupData, int extraData } else { - goalSelector.addGoal(4, bowGoal, false); - + if (extraData == TYPE_STRAY + 1) + { + setSkeletonType(TYPE_STRAY); + } + else if (extraData == 0 && level->dimension->id == 0) + { + Biome *biome = level->getBiome(Mth::floor(x), Mth::floor(z)); + if ((biome == Biome::iceFlats || biome == Biome::iceMountains || biome == Biome::iceSpikes) + && level->canSeeSky(Mth::floor(x), Mth::floor(y), Mth::floor(z)) && random->nextInt(5) != 0) + { + setSkeletonType(TYPE_STRAY); + } + } populateDefaultEquipmentSlots(); populateDefaultEquipmentEnchantments(); + reassessWeaponGoal(); } setCanPickUpLoot(random->nextFloat() < MAX_PICKUP_LOOT_CHANCE * level->getDifficulty(x, y, z)); @@ -257,6 +295,7 @@ void Skeleton::reassessWeaponGoal() if (carried != nullptr && carried->id == Item::bow_Id) { + bowGoal->setMinAttackInterval(level->difficulty == 3 ? 20 : 40); goalSelector.addGoal(4, bowGoal, false); } else @@ -285,6 +324,11 @@ void Skeleton::performRangedAttack(shared_ptr target, float power) { arrow->setOnFire(100); } + if (getSkeletonType() == TYPE_STRAY) + { + arrow->setArrowType(Arrow::TYPE_TIPPED, MASK_SLOWNESS); + arrow->setCustomEffect(MobEffect::movementSlowdown->id, 30 * SharedConstants::TICKS_PER_SECOND, 0); + } playSound(eSoundType_RANDOM_BOW, 1.0f, 1 / (getRandom()->nextFloat() * 0.4f + 0.8f)); level->addEntity(arrow); diff --git a/Minecraft.World/Skeleton.h b/Minecraft.World/Skeleton.h index e2f6594c..0139687b 100644 --- a/Minecraft.World/Skeleton.h +++ b/Minecraft.World/Skeleton.h @@ -4,7 +4,7 @@ using namespace std; #include "Monster.h" #include "RangedAttackMob.h" -class RangedAttackGoal; +class RangedBowAttackGoal; class MeleeAttackGoal; class Skeleton : public Monster, public RangedAttackMob @@ -15,18 +15,22 @@ public: private: static const int DATA_TYPE_ID = 13; + static const int DATA_AGGRESSIVE_ID = 14; public: static const int TYPE_DEFAULT = 0; static const int TYPE_WITHER = 1; + static const int TYPE_STRAY = 2; private: - RangedAttackGoal *bowGoal; + RangedBowAttackGoal *bowGoal; MeleeAttackGoal *meleeGoal; public: Skeleton(Level *level); virtual ~Skeleton(); + bool isAggressive(); + void setAggressive(bool aggressive); protected: virtual void registerAttributes(); diff --git a/Minecraft.World/SkullItem.cpp b/Minecraft.World/SkullItem.cpp index 5b9ae68c..8f3d87ca 100644 --- a/Minecraft.World/SkullItem.cpp +++ b/Minecraft.World/SkullItem.cpp @@ -7,9 +7,9 @@ #include "net.minecraft.world.h" #include "SkullItem.h" -const unsigned int SkullItem::NAMES[SKULL_COUNT] = {IDS_ITEM_SKULL_SKELETON, IDS_ITEM_SKULL_WITHER, IDS_ITEM_SKULL_ZOMBIE, IDS_ITEM_SKULL_CHARACTER, IDS_ITEM_SKULL_CREEPER}; +const unsigned int SkullItem::NAMES[SKULL_COUNT] = {IDS_ITEM_SKULL_SKELETON, IDS_ITEM_SKULL_WITHER, IDS_ITEM_SKULL_ZOMBIE, IDS_ITEM_SKULL_CHARACTER, IDS_ITEM_SKULL_CREEPER, IDS_ITEM_SKULL_DRAGON}; -wstring SkullItem::ICON_NAMES[SKULL_COUNT] = {L"skeleton", L"wither", L"zombie", L"char", L"creeper"}; +wstring SkullItem::ICON_NAMES[SKULL_COUNT] = {L"skeleton", L"wither", L"zombie", L"char", L"creeper", L"creeper"}; SkullItem::SkullItem(int id) : Item(id) { diff --git a/Minecraft.World/SkullItem.h b/Minecraft.World/SkullItem.h index fc23be2f..fc08a5b3 100644 --- a/Minecraft.World/SkullItem.h +++ b/Minecraft.World/SkullItem.h @@ -5,7 +5,7 @@ class SkullItem : public Item { private: - static const int SKULL_COUNT = 5; + static const int SKULL_COUNT = 6; static const unsigned int NAMES[SKULL_COUNT]; diff --git a/Minecraft.World/SkullTileEntity.cpp b/Minecraft.World/SkullTileEntity.cpp index 3937bec4..07c246cc 100644 --- a/Minecraft.World/SkullTileEntity.cpp +++ b/Minecraft.World/SkullTileEntity.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "com.mojang.nbt.h" #include "net.minecraft.network.packet.h" +#include "net.minecraft.world.level.h" #include "SkullTileEntity.h" SkullTileEntity::SkullTileEntity() @@ -8,6 +9,8 @@ SkullTileEntity::SkullTileEntity() skullType = 0; rotation = 0; extraType = L""; + mouthAnimation = 0; + powered = false; } void SkullTileEntity::save(CompoundTag *tag) @@ -69,4 +72,23 @@ shared_ptr SkullTileEntity::clone() result->rotation = rotation; result->extraType = extraType; return result; -} \ No newline at end of file +} +void SkullTileEntity::tick() +{ + if (skullType != TYPE_DRAGON || level == nullptr) return; + + if (level->hasNeighborSignal(x, y, z)) + { + powered = true; + ++mouthAnimation; + } + else + { + powered = false; + } +} + +float SkullTileEntity::getMouthAnimation(float a) +{ + return powered ? static_cast(mouthAnimation) + a : static_cast(mouthAnimation); +} diff --git a/Minecraft.World/SkullTileEntity.h b/Minecraft.World/SkullTileEntity.h index 4b24457b..979c6e4a 100644 --- a/Minecraft.World/SkullTileEntity.h +++ b/Minecraft.World/SkullTileEntity.h @@ -13,11 +13,14 @@ public: static const int TYPE_ZOMBIE = 2; static const int TYPE_CHAR = 3; static const int TYPE_CREEPER = 4; + static const int TYPE_DRAGON = 5; private: int skullType; int rotation; wstring extraType; + int mouthAnimation; + bool powered; public: SkullTileEntity(); @@ -30,6 +33,8 @@ public: int getRotation(); void setRotation(int rot); wstring getExtraType(); + virtual void tick(); + float getMouthAnimation(float a); // 4J Added virtual shared_ptr clone(); diff --git a/Minecraft.World/SnowMan.cpp b/Minecraft.World/SnowMan.cpp index 99ca5df3..4d595b8b 100644 --- a/Minecraft.World/SnowMan.cpp +++ b/Minecraft.World/SnowMan.cpp @@ -12,6 +12,8 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.item.h" #include "SharedConstants.h" +#include "SynchedEntityData.h" +#include "net.minecraft.world.entity.player.h" #include "../Minecraft.Client/Textures.h" #include "SnowMan.h" #include "SoundTypes.h" @@ -42,6 +44,46 @@ bool SnowMan::useNewAi() return true; } +void SnowMan::defineSynchedData() +{ + Golem::defineSynchedData(); + entityData->define(DATA_PUMPKIN_ID, static_cast(16)); +} + +bool SnowMan::hasPumpkin() +{ + return (entityData->getByte(DATA_PUMPKIN_ID) & 16) != 0; +} + +void SnowMan::setPumpkin(bool pumpkin) +{ + byte flags = entityData->getByte(DATA_PUMPKIN_ID); + entityData->set(DATA_PUMPKIN_ID, static_cast(pumpkin ? (flags | 16) : (flags & ~16))); +} + +bool SnowMan::mobInteract(shared_ptr player) +{ + shared_ptr item = player->inventory->getSelected(); + if (item != nullptr && item->id == Item::shears_Id && hasPumpkin() && !level->isClientSide) + { + setPumpkin(false); + item->hurtAndBreak(1, player); + } + return Golem::mobInteract(player); +} + +void SnowMan::addAdditonalSaveData(CompoundTag *tag) +{ + Golem::addAdditonalSaveData(tag); + tag->putBoolean(L"Pumpkin", hasPumpkin()); +} + +void SnowMan::readAdditionalSaveData(CompoundTag *tag) +{ + Golem::readAdditionalSaveData(tag); + if (tag->contains(L"Pumpkin")) setPumpkin(tag->getBoolean(L"Pumpkin")); +} + void SnowMan::registerAttributes() { Golem::registerAttributes(); diff --git a/Minecraft.World/SnowMan.h b/Minecraft.World/SnowMan.h index 756cb142..1d47c3ed 100644 --- a/Minecraft.World/SnowMan.h +++ b/Minecraft.World/SnowMan.h @@ -9,9 +9,21 @@ public: eINSTANCEOF GetType() { return eTYPE_SNOWMAN; } static Entity *create(Level *level) { return new SnowMan(level); } + static const int DATA_PUMPKIN_ID = 16; + public: SnowMan(Level *level); virtual bool useNewAi(); + bool hasPumpkin(); + void setPumpkin(bool pumpkin); + virtual bool mobInteract(shared_ptr player); + virtual void addAdditonalSaveData(CompoundTag *tag); + virtual void readAdditionalSaveData(CompoundTag *tag); + +protected: + virtual void defineSynchedData(); + +public: protected: virtual void registerAttributes(); diff --git a/Minecraft.World/SoundTypes.h b/Minecraft.World/SoundTypes.h index 75d98f73..870d6fd2 100644 --- a/Minecraft.World/SoundTypes.h +++ b/Minecraft.World/SoundTypes.h @@ -324,6 +324,47 @@ enum eSOUND_TYPE eSoundType_ENTITY_PAINTING_PLACE, eSoundType_ENTITY_PAINTING_BREAK, + eSoundType_ENTITY_SHULKER_AMBIENT, + eSoundType_ENTITY_SHULKER_CLOSE, + eSoundType_ENTITY_SHULKER_DEATH, + eSoundType_ENTITY_SHULKER_HURT, + eSoundType_ENTITY_SHULKER_HURT_CLOSED, + eSoundType_ENTITY_SHULKER_OPEN, + eSoundType_ENTITY_SHULKER_SHOOT, + eSoundType_ENTITY_SHULKER_BULLET_HIT, + + eSoundType_ENTITY_STRAY_IDLE, + eSoundType_ENTITY_STRAY_HURT, + eSoundType_ENTITY_STRAY_DEATH, + eSoundType_ENTITY_STRAY_STEP, + eSoundType_ENTITY_HUSK_IDLE, + eSoundType_ENTITY_HUSK_HURT, + eSoundType_ENTITY_HUSK_DEATH, + eSoundType_ENTITY_HUSK_STEP, + eSoundType_BLOCK_CHORUS_FLOWER_GROW, + eSoundType_BLOCK_CHORUS_FLOWER_DEATH, + eSoundType_ITEM_BOTTLE_FILL, + eSoundType_ITEM_BOTTLE_FILL_DRAGONBREATH, + eSoundType_BLOCK_WOODEN_DOOR_OPEN, + eSoundType_BLOCK_WOODEN_DOOR_CLOSE, + eSoundType_BLOCK_IRON_DOOR_OPEN, + eSoundType_BLOCK_IRON_DOOR_CLOSE, + eSoundType_BLOCK_WOODEN_TRAPDOOR_OPEN, + eSoundType_BLOCK_WOODEN_TRAPDOOR_CLOSE, + eSoundType_BLOCK_IRON_TRAPDOOR_OPEN, + eSoundType_BLOCK_IRON_TRAPDOOR_CLOSE, + eSoundType_BLOCK_FENCE_GATE_OPEN, + eSoundType_BLOCK_FENCE_GATE_CLOSE, + eSoundType_BLOCK_ENCHANTMENT_TABLE_ENCHANT, + eSoundType_BLOCK_WATERLILY_PLACE, + eSoundType_ITEM_BUCKET_EMPTY, + eSoundType_ITEM_BUCKET_EMPTY_LAVA, + eSoundType_ITEM_BUCKET_FILL, + eSoundType_ITEM_BUCKET_FILL_LAVA, + eSoundType_ITEM_HOE_TILL, + eSoundType_ENTITY_BOAT_PADDLE_WATER, + eSoundType_ENTITY_BOAT_PADDLE_LAND, + eSoundType_MAX }; diff --git a/Minecraft.World/StructureFeatureIO.cpp b/Minecraft.World/StructureFeatureIO.cpp index b93c7e35..bf150fdb 100644 --- a/Minecraft.World/StructureFeatureIO.cpp +++ b/Minecraft.World/StructureFeatureIO.cpp @@ -1,4 +1,6 @@ #include "stdafx.h" +#include "EndCityFeature.h" +#include "EndCityPieces.h" #include "net.minecraft.world.level.levelgen.structure.h" #include "StructureFeatureIO.h" @@ -28,6 +30,8 @@ void StructureFeatureIO::staticCtor() setStartId(eStructureStart_StrongholdStart, StrongholdFeature::StrongholdStart::Create, L"Stronghold"); setStartId(eStructureStart_ScatteredFeatureStart, RandomScatteredLargeFeature::ScatteredFeatureStart::Create, L"Temple"); setStartId(eStructureStart_Monument, OceanMonumentFeature::MonumentStart::Create, L"Monument"); + setStartId(eStructureStart_EndCity, EndCityFeature::EndCityStart::Create, L"EndCity"); + setPieceId(eStructurePiece_EndCityPiece, EndCityPieces::EndCityPiece::Create, L"ECP"); OceanMonumentPieces::loadStatic(); MineShaftPieces::loadStatic(); diff --git a/Minecraft.World/StructureFeatureIO.h b/Minecraft.World/StructureFeatureIO.h index aeb17b87..35c59f1f 100644 --- a/Minecraft.World/StructureFeatureIO.h +++ b/Minecraft.World/StructureFeatureIO.h @@ -14,6 +14,7 @@ enum EStructureStart eStructureStart_StrongholdStart, eStructureStart_ScatteredFeatureStart, eStructureStart_Monument, + eStructureStart_EndCity, }; enum EStructurePiece @@ -84,6 +85,8 @@ enum EStructurePiece eStructurePiece_DoubleFarmland, eStructurePiece_LightPost, eStructurePiece_VillageStartPiece, + + eStructurePiece_EndCityPiece, }; class StructureFeatureIO diff --git a/Minecraft.World/TheEndBiomeDecorator.cpp b/Minecraft.World/TheEndBiomeDecorator.cpp index f744f700..16c9ff8f 100644 --- a/Minecraft.World/TheEndBiomeDecorator.cpp +++ b/Minecraft.World/TheEndBiomeDecorator.cpp @@ -1,5 +1,6 @@ #include "stdafx.h" #include "TheEndBiomeDecorator.h" +#include "LevelData.h" #include "net.minecraft.world.level.h" #include "net.minecraft.world.level.tile.h" #include "net.minecraft.world.level.levelgen.feature.h" @@ -53,7 +54,8 @@ void TheEndBiomeDecorator::decorate() if((xo == SpikeValA[i].iChunkX) && (zo == SpikeValA[i].iChunkZ)) { // in the right chunk - spikeFeature->placeWithIndex(level, random, SpikeValA[i].x, level->GetHighestY(), SpikeValA[i].z,i,SpikeValA[i].radius); + int spikeBase = (level->getLevelData() != nullptr && level->getLevelData()->isModernEnd()) ? SPIKE_BASE_Y : level->GetHighestY(); + spikeFeature->placeWithIndex(level, random, SpikeValA[i].x, spikeBase, SpikeValA[i].z,i,SpikeValA[i].radius); } } if (xo == 0 && zo == 0) diff --git a/Minecraft.World/TheEndBiomeDecorator.h b/Minecraft.World/TheEndBiomeDecorator.h index b9c790b3..97b68deb 100644 --- a/Minecraft.World/TheEndBiomeDecorator.h +++ b/Minecraft.World/TheEndBiomeDecorator.h @@ -20,5 +20,7 @@ protected: virtual void decorate(); +public: static SPIKE SpikeValA[8]; + static const int SPIKE_BASE_Y = 62; }; \ No newline at end of file diff --git a/Minecraft.World/TheEndDimension.cpp b/Minecraft.World/TheEndDimension.cpp index 59c5292f..f7b1f052 100644 --- a/Minecraft.World/TheEndDimension.cpp +++ b/Minecraft.World/TheEndDimension.cpp @@ -4,11 +4,14 @@ #include "net.minecraft.world.level.levelgen.h" #include "net.minecraft.world.level.h" #include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.level.storage.h" +#include "EndDragonFight.h" #include "../Minecraft.Client/Minecraft.h" #include "../Minecraft.Client/Common/Colours/ColourTable.h" void TheEndDimension::init() { + dragonFight = nullptr; biomeSource = new FixedBiomeSource(Biome::sky, 0.5f, 0); id = 1; hasCeiling = true; @@ -16,7 +19,8 @@ void TheEndDimension::init() ChunkSource *TheEndDimension::createRandomLevelSource() const { - return new TheEndLevelRandomLevelSource(level, level->getSeed()); + if (level != nullptr && level->getLevelData() != nullptr) setWorldSize(level->getLevelData()->getXZSize()); + return new TheEndLevelRandomLevelSource(level, level->getSeed(), isModernEnd()); } float TheEndDimension::getTimeOfDay(int64_t time, float a) const @@ -77,6 +81,7 @@ bool TheEndDimension::isValidSpawn(int x, int z) const Pos *TheEndDimension::getSpawnPos() { + if (isModernEnd()) return new Pos(60, 50, 60); return new Pos(100, 50, 0); } @@ -88,4 +93,74 @@ bool TheEndDimension::isFoggyAt(int x, int z) int TheEndDimension::getSpawnYPosition() { return 50; -} \ No newline at end of file +} + +const int TheEndDimension::AREA_CHUNK_X[TheEndDimension::AREA_MAX] = { 0, 0, 25, 0, -25 }; +const int TheEndDimension::AREA_CHUNK_Z[TheEndDimension::AREA_MAX] = { 0, 25, 0, -25, 0 }; +int TheEndDimension::AREA_COUNT = 2; + +void TheEndDimension::setWorldSize(int overworldXZSize) +{ +#ifdef _LARGE_WORLDS + AREA_COUNT = overworldXZSize >= LEVEL_WIDTH_LARGE ? AREA_MAX : 2; +#else + AREA_COUNT = 2; +#endif +} + +bool TheEndDimension::isOuterAreaCentre(int chunkX, int chunkZ) +{ + for (int i = 1; i < AREA_COUNT; i++) + { + if (chunkX == AREA_CHUNK_X[i] && chunkZ == AREA_CHUNK_Z[i]) return true; + } + return false; +} + +int TheEndDimension::closestArea(int chunkX, int chunkZ) +{ + int closest = 0; + int closestDistance = INT_MAX; + for (int i = 0; i < AREA_COUNT; i++) + { + int distance = max(abs(chunkX - AREA_CHUNK_X[i]), abs(chunkZ - AREA_CHUNK_Z[i])); + if (distance < closestDistance) + { + closest = i; + closestDistance = distance; + } + } + return closest; +} + +bool TheEndDimension::isChunkInArea(int chunkX, int chunkZ) +{ + int area = closestArea(chunkX, chunkZ); + int dx = chunkX - AREA_CHUNK_X[area]; + int dz = chunkZ - AREA_CHUNK_Z[area]; + return dx >= -AREA_HALF_CHUNKS && dx < AREA_HALF_CHUNKS && dz >= -AREA_HALF_CHUNKS && dz < AREA_HALF_CHUNKS; +} + +bool TheEndDimension::isModernEnd() const +{ + return level != nullptr && level->getLevelData() != nullptr && level->getLevelData()->isModernEnd(); +} + +int TheEndDimension::getXZSize() +{ + return isModernEnd() ? END_LEVEL_MODERN_WIDTH : Dimension::getXZSize(); +} + +bool TheEndDimension::isOutsideWorldEdge(int x, int z) +{ + if (!isModernEnd()) return Dimension::isOutsideWorldEdge(x, z); + setWorldSize(level->getLevelData()->getXZSize()); + + return !isChunkInArea(x >> 4, z >> 4) || Dimension::isOutsideWorldEdge(x, z); +} + +EndDragonFight *TheEndDimension::getDragonFight() +{ + if (dragonFight == nullptr) dragonFight = new EndDragonFight(level); + return dragonFight; +} diff --git a/Minecraft.World/TheEndDimension.h b/Minecraft.World/TheEndDimension.h index 268be6f6..584a963a 100644 --- a/Minecraft.World/TheEndDimension.h +++ b/Minecraft.World/TheEndDimension.h @@ -1,6 +1,8 @@ #pragma once #include "Dimension.h" +class EndDragonFight; + class TheEndDimension : public Dimension { public: @@ -17,4 +19,23 @@ public: virtual Pos *getSpawnPos(); virtual int getSpawnYPosition(); virtual bool isFoggyAt(int x, int z); + + static const int AREA_MAX = 5; + static const int AREA_CHUNK_X[AREA_MAX]; + static const int AREA_CHUNK_Z[AREA_MAX]; + static int AREA_COUNT; + static void setWorldSize(int overworldXZSize); + static bool isOuterAreaCentre(int chunkX, int chunkZ); + static const int AREA_HALF_CHUNKS = 6; + + static int closestArea(int chunkX, int chunkZ); + static bool isChunkInArea(int chunkX, int chunkZ); + bool isModernEnd() const; + EndDragonFight *getDragonFight(); + + virtual int getXZSize(); + virtual bool isOutsideWorldEdge(int x, int z); + +private: + EndDragonFight *dragonFight; }; diff --git a/Minecraft.World/TheEndGatewayTileEntity.cpp b/Minecraft.World/TheEndGatewayTileEntity.cpp new file mode 100644 index 00000000..d7c71c78 --- /dev/null +++ b/Minecraft.World/TheEndGatewayTileEntity.cpp @@ -0,0 +1,358 @@ +#include "stdafx.h" +#include "LevelData.h" +#include "com.mojang.nbt.h" +#include "net.minecraft.network.packet.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.chunk.h" +#include "net.minecraft.world.level.dimension.h" +#include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.entity.h" +#include "net.minecraft.world.entity.projectile.h" +#include "net.minecraft.world.phys.h" +#include "TheEndGatewayTileEntity.h" +#include "TheEndDimension.h" +#include "EndGatewayFeature.h" +#include "EndIslandFeature.h" +#include "TileEntityDataPacket.h" +#include "Facing.h" + +TheEndGatewayTileEntity::TheEndGatewayTileEntity() : TileEntity() +{ + age = 0; + teleportCooldown = 0; + hasExit = false; + exitX = exitY = exitZ = 0; + exactTeleport = false; +} + +void TheEndGatewayTileEntity::save(CompoundTag *tag) +{ + TileEntity::save(tag); + tag->putLong(L"Age", age); + if (hasExit) + { + CompoundTag *exit = new CompoundTag(); + exit->putInt(L"X", exitX); + exit->putInt(L"Y", exitY); + exit->putInt(L"Z", exitZ); + tag->putCompound(L"ExitPortal", exit); + } + if (exactTeleport) tag->putBoolean(L"ExactTeleport", true); +} + +void TheEndGatewayTileEntity::load(CompoundTag *tag) +{ + TileEntity::load(tag); + age = tag->getLong(L"Age"); + hasExit = tag->contains(L"ExitPortal"); + if (hasExit) + { + CompoundTag *exit = tag->getCompound(L"ExitPortal"); + exitX = exit->getInt(L"X"); + exitY = exit->getInt(L"Y"); + exitZ = exit->getInt(L"Z"); + } + exactTeleport = tag->getBoolean(L"ExactTeleport"); +} + +double TheEndGatewayTileEntity::getViewDistance() +{ + return 65536.0; +} + +bool TheEndGatewayTileEntity::isSpawning() +{ + return age < SPAWN_TIME; +} + +bool TheEndGatewayTileEntity::isCoolingDown() +{ + return teleportCooldown > 0; +} + +float TheEndGatewayTileEntity::getSpawnPercent(float a) +{ + return Mth::clamp((static_cast(age) + a) / static_cast(SPAWN_TIME), 0.0f, 1.0f); +} + +float TheEndGatewayTileEntity::getCooldownPercent(float a) +{ + return 1.0f - Mth::clamp((static_cast(teleportCooldown) - a) / static_cast(COOLDOWN_TIME), 0.0f, 1.0f); +} + +void TheEndGatewayTileEntity::tick() +{ + bool spawning = isSpawning(); + bool cooling = isCoolingDown(); + age++; + + if (cooling) + { + teleportCooldown--; + } + else if (!level->isClientSide) + { + vector > *entities = level->getEntities(nullptr, AABB::newTemp(x, y, z, x + 1, y + 1, z + 1)); + if (entities != nullptr) + { + for (auto &entity : *entities) + { + if (entity->GetType() == eTYPE_ENDER_CRYSTAL || entity->instanceof(eTYPE_ENDERDRAGON) || entity->GetType() == eTYPE_MULTIENTITY_MOB_PART) continue; + teleportEntity(entity); + break; + } + } + + if (age % ATTENTION_INTERVAL == 0) triggerCooldown(); + } + + if (spawning != isSpawning() || cooling != isCoolingDown()) setChanged(); +} + +void TheEndGatewayTileEntity::triggerCooldown() +{ + if (level->isClientSide) return; + teleportCooldown = COOLDOWN_TIME; + level->tileEvent(x, y, z, Tile::end_gateway_Id, EVENT_COOLDOWN, 0); + setChanged(); +} + +bool TheEndGatewayTileEntity::triggerEvent(int b0, int b1) +{ + if (b0 == EVENT_COOLDOWN) + { + teleportCooldown = COOLDOWN_TIME; + return true; + } + return TileEntity::triggerEvent(b0, b1); +} + +void TheEndGatewayTileEntity::setExitPosition(int x, int y, int z) +{ + hasExit = true; + exitX = x; + exitY = y; + exitZ = z; +} + +void TheEndGatewayTileEntity::teleportEntity(shared_ptr entity) +{ + if (level->isClientSide || isCoolingDown()) return; + + if (entity->instanceof(eTYPE_THROWNENDERPEARL)) + { + shared_ptr owner = dynamic_pointer_cast(entity)->getOwner(); + if (owner != nullptr) + { + teleportEntity(owner); + entity->remove(); + return; + } + } + + teleportCooldown = 100; + if (!hasExit && level->dimension->id == 1) findExitPortal(); + + if (hasExit) + { + if (entity->riding != nullptr) entity->ride(nullptr); + shared_ptr rider = entity->rider.lock(); + if (rider != nullptr) rider->ride(nullptr); + + level->getChunkSource()->create(exitX >> 4, exitZ >> 4); + + int tx = exitX, ty = exitY, tz = exitZ; + if (!exactTeleport) + { + findTallestBlock(level, exitX, exitY, exitZ, 5, false, tx, ty, tz); + ty += 1; + if ((tx == exitX && tz == exitZ) && (ty == exitY || ty == exitY + 1)) + { + level->setTileAndUpdate(exitX, exitY + 1, exitZ, Tile::bedrock_Id); + level->setTileAndUpdate(exitX, exitY + 2, exitZ, Tile::bedrock_Id); + level->setTileAndUpdate(exitX, exitY + 3, exitZ, 0); + level->setTileAndUpdate(exitX, exitY + 4, exitZ, 0); + ty = exitY + 3; + } + } + + double px = tx + 0.5, py = ty, pz = tz + 0.5; + if (entity->instanceof(eTYPE_LIVINGENTITY)) + { + dynamic_pointer_cast(entity)->teleportTo(px, py, pz); + } + else + { + entity->moveTo(px, py, pz, entity->yRot, entity->xRot); + } + entity->fallDistance = 0; + } + + triggerCooldown(); +} + +void TheEndGatewayTileEntity::findTallestBlock(Level *level, int x, int y, int z, int radius, bool allowBedrock, int &outX, int &outY, int &outZ) +{ + bool found = false; + outX = x; + outY = y; + outZ = z; + for (int dx = -radius; dx < radius; dx++) + { + for (int dz = -radius; dz < radius; dz++) + { + if (dx == 0 && dz == 0 && !allowBedrock) continue; + + for (int yy = Level::maxBuildHeight - 1; yy > (found ? outY : 0); yy--) + { + int tile = level->getTile(x + dx, yy, z + dz); + if (Tile::isSolidBlockingTile(tile) && (allowBedrock || tile != Tile::bedrock_Id)) + { + outX = x + dx; + outY = yy; + outZ = z + dz; + found = true; + break; + } + } + } + } +} + +bool TheEndGatewayTileEntity::findValidSpawnInChunk(LevelChunk *chunk, int &outX, int &outY, int &outZ) +{ + bool found = false; + double bestDistance = 0; + int top = chunk->getHighestSectionPosition() + 15; + for (int lx = 1; lx <= 14; lx++) + { + for (int lz = 1; lz <= 14; lz++) + { + for (int yy = 30; yy <= top && yy < Level::maxBuildHeight - 2; yy++) + { + if (chunk->getTile(lx, yy, lz) != Tile::end_stone_Id) continue; + if (Tile::isSolidBlockingTile(chunk->getTile(lx, yy + 1, lz))) continue; + if (Tile::isSolidBlockingTile(chunk->getTile(lx, yy + 2, lz))) continue; + + int wx = chunk->x * 16 + lx; + int wz = chunk->z * 16 + lz; + double distance = (wx + 0.5) * (wx + 0.5) + (yy + 0.5) * (yy + 0.5) + (wz + 0.5) * (wz + 0.5); + if (!found || distance < bestDistance) + { + found = true; + bestDistance = distance; + outX = wx; + outY = yy; + outZ = wz; + } + } + } + } + return found; +} + +void TheEndGatewayTileEntity::findExitPortal() +{ + TheEndDimension *end = dynamic_cast(level->dimension); + if (end == nullptr || !end->isModernEnd()) return; + + int portalNumber = level->getData(x, y, z); + Random random(level->getSeed() + portalNumber); + + TheEndDimension::setWorldSize(level->getLevelData()->getXZSize()); + int area = 1 + portalNumber % (TheEndDimension::AREA_COUNT - 1); + int xOffset = random.nextInt(2) + 3; + if (!random.nextBoolean()) xOffset = -xOffset; + int zOffset = random.nextInt(2) + 3; + if (!random.nextBoolean()) zOffset = -zOffset; + int cx = TheEndDimension::AREA_CHUNK_X[area] + xOffset; + int cz = TheEndDimension::AREA_CHUNK_Z[area] + zOffset; + + LevelChunk *chunk = level->getChunkSource()->create(cx, cz); + + for (int lx = 0; lx < 16; lx++) + { + for (int lz = 0; lz < 16; lz++) + { + for (int yy = 0; yy < Level::maxBuildHeight; yy++) + { + if (chunk->getTile(lx, yy, lz) == Tile::end_gateway_Id) + { + setExitPosition(cx * 16 + lx, yy, cz * 16 + lz); + setChanged(); + return; + } + } + } + } + + int sx, sy, sz; + if (!findValidSpawnInChunk(chunk, sx, sy, sz)) + { + sx = cx * 16 + 8; + sy = 75; + sz = cz * 16 + 8; + Random islandRandom(static_cast(sx) * 31 + sz); + EndIslandFeature().place(level, &islandRandom, sx, sy, sz); + } + + int tx, ty, tz; + findTallestBlock(level, cx * 16 + 8, 0, cz * 16 + 8, 7, true, tx, ty, tz); + setExitPosition(tx, ty + 10, tz); + createExitPortal(exitX, exitY, exitZ); + setChanged(); +} + +void TheEndGatewayTileEntity::createExitPortal(int px, int py, int pz) +{ + Random random; + EndGatewayFeature().place(level, &random, px, py, pz); + + shared_ptr gateway = dynamic_pointer_cast(level->getTileEntity(px, py, pz)); + if (gateway != nullptr) + { + gateway->setExitPosition(x, y, z); + gateway->setChanged(); + } +} + +bool TheEndGatewayTileEntity::shouldRenderFace(int face) +{ + if (level == nullptr) return true; + int nx = x + Facing::STEP_X[face]; + int ny = y + Facing::STEP_Y[face]; + int nz = z + Facing::STEP_Z[face]; + int tile = level->getTile(nx, ny, nz); + return tile != Tile::end_gateway_Id && !Tile::isSolidBlockingTile(tile); +} + +int TheEndGatewayTileEntity::getParticleAmount() +{ + int amount = 0; + for (int face = 0; face < 6; face++) + { + if (shouldRenderFace(face)) amount++; + } + return amount; +} + +shared_ptr TheEndGatewayTileEntity::getUpdatePacket() +{ + CompoundTag *tag = new CompoundTag(); + save(tag); + return std::make_shared(x, y, z, TileEntityDataPacket::TYPE_END_GATEWAY, tag); +} + +shared_ptr TheEndGatewayTileEntity::clone() +{ + shared_ptr result = std::make_shared(); + TileEntity::clone(result); + result->age = age; + result->teleportCooldown = teleportCooldown; + result->hasExit = hasExit; + result->exitX = exitX; + result->exitY = exitY; + result->exitZ = exitZ; + result->exactTeleport = exactTeleport; + return result; +} diff --git a/Minecraft.World/TheEndGatewayTileEntity.h b/Minecraft.World/TheEndGatewayTileEntity.h new file mode 100644 index 00000000..58a4cbd0 --- /dev/null +++ b/Minecraft.World/TheEndGatewayTileEntity.h @@ -0,0 +1,52 @@ +#pragma once +#include "TileEntity.h" + +class Entity; +class LevelChunk; + +class TheEndGatewayTileEntity : public TileEntity +{ +public: + eINSTANCEOF GetType() { return eTYPE_THEENDGATEWAYTILEENTITY; } + static TileEntity *create() { return new TheEndGatewayTileEntity(); } + + static const int SPAWN_TIME = 200; + static const int COOLDOWN_TIME = 40; + static const int ATTENTION_INTERVAL = 2400; + static const int EVENT_COOLDOWN = 1; + +private: + int64_t age; + int teleportCooldown; + bool hasExit; + int exitX, exitY, exitZ; + bool exactTeleport; + +public: + TheEndGatewayTileEntity(); + + virtual void save(CompoundTag *tag); + virtual void load(CompoundTag *tag); + virtual void tick(); + virtual double getViewDistance(); + virtual shared_ptr getUpdatePacket(); + virtual bool triggerEvent(int b0, int b1); + virtual shared_ptr clone(); + + bool isSpawning(); + bool isCoolingDown(); + float getSpawnPercent(float a); + float getCooldownPercent(float a); + int getParticleAmount(); + bool shouldRenderFace(int face); + + void triggerCooldown(); + void teleportEntity(shared_ptr entity); + void setExitPosition(int x, int y, int z); + +private: + void findExitPortal(); + void createExitPortal(int x, int y, int z); + bool findValidSpawnInChunk(LevelChunk *chunk, int &outX, int &outY, int &outZ); + static void findTallestBlock(Level *level, int x, int y, int z, int radius, bool allowBedrock, int &outX, int &outY, int &outZ); +}; diff --git a/Minecraft.World/TheEndLevelRandomLevelSource.cpp b/Minecraft.World/TheEndLevelRandomLevelSource.cpp index aa10d5fd..da73cea6 100644 --- a/Minecraft.World/TheEndLevelRandomLevelSource.cpp +++ b/Minecraft.World/TheEndLevelRandomLevelSource.cpp @@ -8,10 +8,17 @@ #include "net.minecraft.world.level.tile.h" #include "net.minecraft.world.level.storage.h" #include "TheEndLevelRandomLevelSource.h" +#include "TheEndDimension.h" +#include "EndIslandFeature.h" +#include "EndCityFeature.h" +#include "ChorusFlowerTile.h" -TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level *level, int64_t seed) +TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level *level, int64_t seed, bool modernEnd) { - m_XZSize = END_LEVEL_MIN_WIDTH; + this->modernEnd = modernEnd; + m_XZSize = modernEnd ? END_LEVEL_MODERN_WIDTH : END_LEVEL_MIN_WIDTH; + islandFeature = new EndIslandFeature(); + endCityFeature = modernEnd ? new EndCityFeature(this) : nullptr; this->level = level; @@ -34,6 +41,8 @@ TheEndLevelRandomLevelSource::~TheEndLevelRandomLevelSource() delete perlinNoise1; delete scaleNoise; delete depthNoise; + delete islandFeature; + delete endCityFeature; } void TheEndLevelRandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks, BiomeArray biomes) @@ -177,8 +186,12 @@ LevelChunk *TheEndLevelRandomLevelSource::getChunk(int xOffs, int zOffs) // LevelChunk *levelChunk = new LevelChunk(level, blocks, xOffs, zOffs); // 4J moved below level->getBiomeSource()->getBiomeBlock(biomes, xOffs * 16, zOffs * 16, 16, 16, true); - prepareHeights(xOffs, zOffs, blocks, biomes); - buildSurfaces(xOffs, zOffs, blocks, biomes); + if (!modernEnd || TheEndDimension::isChunkInArea(xOffs, zOffs)) + { + prepareHeights(xOffs, zOffs, blocks, biomes); + buildSurfaces(xOffs, zOffs, blocks, biomes); + } + if (endCityFeature != nullptr) endCityFeature->apply(this, level, xOffs, zOffs, blocks); // 4J - this now creates compressed block data from the blocks array passed in, so moved it until after the blocks are actually finalised. We also // now need to free the passed in blocks as the LevelChunk doesn't use the passed in allocation anymore. @@ -234,6 +247,12 @@ doubleArray TheEndLevelRandomLevelSource::getHeights(doubleArray buffer, int x, float doffs = 100 - sqrt(xd * xd + zd * zd) * 8; if (doffs > 80) doffs = 80; if (doffs < -100) doffs = -100; + if (modernEnd) + { + doffs = getIslandHeightValue(x / 2, z / 2, xx, zz); + if (doffs > 80) doffs = 80; + if (doffs < -100) doffs = -100; + } if (depth > 1) depth = 1; depth = depth / 8; depth = 0; @@ -280,6 +299,17 @@ doubleArray TheEndLevelRandomLevelSource::getHeights(doubleArray buffer, int x, } + if (modernEnd) + { + int worldY = (y + yy) * CHUNK_HEIGHT; + double pdx = (x + xx) * CHUNK_WIDTH; + double pdy = worldY - level->seaLevel; + double pdz = (z + zz) * CHUNK_WIDTH; + double fade = (19.0 - sqrt(pdx * pdx + pdy * pdy + pdz * pdz)) / 16.0; + if (fade < 0) fade = 0; + if (fade > 1) fade = 1; + val = fade * (level->seaLevel < worldY + 1 ? -50.0 : 50.0) + (1 - fade) * val; + } buffer[p] = val; p++; } @@ -376,9 +406,38 @@ void TheEndLevelRandomLevelSource::postProcess(ChunkSource *parent, int xt, int int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); + if (endCityFeature != nullptr) endCityFeature->postProcess(level, pprandom, xt, zt); + Biome *biome = level->getBiome(xo + 16, zo + 16); biome->decorate(level, pprandom, xo, zo); // 4J - passing pprandom rather than level->random here to make this consistent with our parallel world generation + if (modernEnd && outerIslandCheck(xt, zt)) + { + if (getIslandHeightValue(xt, zt, 1, 1) < -20.0f && pprandom->nextInt(14) == 0) + { + islandFeature->place(level, pprandom, xo + pprandom->nextInt(16) + 8, pprandom->nextInt(16) + 55, zo + pprandom->nextInt(16) + 8); + if (pprandom->nextInt(4) == 0) + { + islandFeature->place(level, pprandom, xo + pprandom->nextInt(16) + 8, pprandom->nextInt(16) + 55, zo + pprandom->nextInt(16) + 8); + } + } + + if (getIslandHeightValue(xt, zt, 1, 1) > 40.0f) + { + int plants = pprandom->nextInt(5); + for (int i = 0; i < plants; i++) + { + int px = xo + pprandom->nextInt(16) + 8; + int pz = zo + pprandom->nextInt(16) + 8; + int py = level->getHeightmap(px, pz); + if (py > 0 && level->isEmptyTile(px, py, pz) && level->getTile(px, py - 1, pz) == Tile::end_stone_Id) + { + ChorusFlowerTile::generatePlant(level, px, py, pz, pprandom, 8); + } + } + } + } + HeavyTile::instaFall = false; app.processSchematics(parent->getChunk(xt,zt)); @@ -421,4 +480,54 @@ TilePos *TheEndLevelRandomLevelSource::findNearestMapFeature(Level *level, const void TheEndLevelRandomLevelSource::recreateLogicStructuresForChunk(int chunkX, int chunkZ) { -} \ No newline at end of file + if (endCityFeature != nullptr) endCityFeature->apply(this, level, chunkX, chunkZ, byteArray()); +} +double TheEndLevelRandomLevelSource::outerIslandProximity(int chunkX, int chunkZ) +{ + int area = TheEndDimension::closestArea(chunkX, chunkZ); + if (area == 0) return 12.0; + + double xd = chunkX + 0.5 - TheEndDimension::AREA_CHUNK_X[area]; + double zd = chunkZ + 0.5 - TheEndDimension::AREA_CHUNK_Z[area]; + return max(fabs(xd), fabs(zd)); +} + +bool TheEndLevelRandomLevelSource::outerIslandCheck(int chunkX, int chunkZ) +{ + return outerIslandProximity(chunkX, chunkZ) < 3.0; +} + +float TheEndLevelRandomLevelSource::getIslandHeightValue(int chunkX, int chunkZ, int xOffset, int zOffset) +{ + if (TheEndDimension::closestArea(chunkX, chunkZ) == 0) + { + float sampleX = chunkX * 2.0f + xOffset; + float sampleZ = chunkZ * 2.0f + zOffset; + return 100.0f - sqrt(sampleX * sampleX + sampleZ * sampleZ) * 9.0f; + } + + int sampleX = chunkX * 2 + xOffset; + int sampleZ = chunkZ * 2 + zOffset; + float height = 100.0f - sqrt(static_cast(sampleX * sampleX + sampleZ * sampleZ)) * 8.0f; + if (height > 80.0f) height = 80.0f; + if (height < -100.0f) height = -100.0f; + + for (int ox = -4; ox <= 4; ox++) + { + for (int oz = -4; oz <= 4; oz++) + { + int islandX = chunkX + ox; + int islandZ = chunkZ + oz; + if (!outerIslandCheck(islandX, islandZ)) continue; + + float scale = static_cast(static_cast(fabs(static_cast(islandX)) * 3439.0 + fabs(static_cast(islandZ)) * 147.0) % 6 + 18); + int dx = xOffset - ox * 2; + int dz = zOffset - oz * 2; + float islandHeight = 100.0f - sqrt(static_cast(dx * dx + dz * dz)) * scale; + if (islandHeight > 80.0f) islandHeight = 80.0f; + if (islandHeight < -100.0f) islandHeight = -100.0f; + if (islandHeight > height) height = islandHeight; + } + } + return height; +} diff --git a/Minecraft.World/TheEndLevelRandomLevelSource.h b/Minecraft.World/TheEndLevelRandomLevelSource.h index a95a84fa..6789fce9 100644 --- a/Minecraft.World/TheEndLevelRandomLevelSource.h +++ b/Minecraft.World/TheEndLevelRandomLevelSource.h @@ -2,6 +2,8 @@ #include "ChunkSource.h" class PerlinNoise; +class EndIslandFeature; +class EndCityFeature; class TheEndLevelRandomLevelSource : public ChunkSource { @@ -29,8 +31,16 @@ public: private: Level *level; + bool modernEnd; + EndIslandFeature *islandFeature; + EndCityFeature *endCityFeature; + + static double outerIslandProximity(int chunkX, int chunkZ); + static bool outerIslandCheck(int chunkX, int chunkZ); + float getIslandHeightValue(int chunkX, int chunkZ, int xOffset, int zOffset); + public: - TheEndLevelRandomLevelSource(Level *level, int64_t seed); + TheEndLevelRandomLevelSource(Level *level, int64_t seed, bool modernEnd = false); ~TheEndLevelRandomLevelSource(); void prepareHeights(int xOffs, int zOffs, byteArray blocks, BiomeArray biomes); diff --git a/Minecraft.World/TheEndPortal.cpp b/Minecraft.World/TheEndPortal.cpp index c3e5cbf5..c1101085 100644 --- a/Minecraft.World/TheEndPortal.cpp +++ b/Minecraft.World/TheEndPortal.cpp @@ -33,8 +33,7 @@ shared_ptr TheEndPortal::newTileEntity(Level *level) void TheEndPortal::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param { - float r = 1 / 16.0f; - setShape(0, 0, 0, 1, r, 1); + setShape(0, 0, 0, 1, 0.75f, 1); } bool TheEndPortal::shouldRenderFace(LevelSource *level, int x, int y, int z, int face) diff --git a/Minecraft.World/ThinFenceTile.cpp b/Minecraft.World/ThinFenceTile.cpp index e2da300b..42dda1f0 100644 --- a/Minecraft.World/ThinFenceTile.cpp +++ b/Minecraft.World/ThinFenceTile.cpp @@ -50,36 +50,14 @@ void ThinFenceTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBL bool w = attachsTo(level->getTile(x - 1, y, z)); bool e = attachsTo(level->getTile(x + 1, y, z)); - if ((w && e) || (!w && !e && !n && !s)) - { - setShape(0, 0, 7.0f / 16.0f, 1, 1, 9.0f / 16.0f); - Tile::addAABBs(level, x, y, z, box, boxes, source); - } - else if (w && !e) - { - setShape(0, 0, 7.0f / 16.0f, .5f, 1, 9.0f / 16.0f); - Tile::addAABBs(level, x, y, z, box, boxes, source); - } - else if (!w && e) - { - setShape(.5f, 0, 7.0f / 16.0f, 1, 1, 9.0f / 16.0f); - Tile::addAABBs(level, x, y, z, box, boxes, source); - } - if ((n && s) || (!w && !e && !n && !s)) - { - setShape(7.0f / 16.0f, 0, 0, 9.0f / 16.0f, 1, 1); - Tile::addAABBs(level, x, y, z, box, boxes, source); - } - else if (n && !s) - { - setShape(7.0f / 16.0f, 0, 0, 9.0f / 16.0f, 1, .5f); - Tile::addAABBs(level, x, y, z, box, boxes, source); - } - else if (!n && s) - { - setShape(7.0f / 16.0f, 0, .5f, 9.0f / 16.0f, 1, 1); - Tile::addAABBs(level, x, y, z, box, boxes, source); - } + const float lo = 7.0f / 16.0f; + const float hi = 9.0f / 16.0f; + setShape(lo, 0, lo, hi, 1, hi); + Tile::addAABBs(level, x, y, z, box, boxes, source); + if (n) { setShape(lo, 0, 0, hi, 1, hi); Tile::addAABBs(level, x, y, z, box, boxes, source); } + if (s) { setShape(lo, 0, lo, hi, 1, 1); Tile::addAABBs(level, x, y, z, box, boxes, source); } + if (w) { setShape(0, 0, lo, hi, 1, hi); Tile::addAABBs(level, x, y, z, box, boxes, source); } + if (e) { setShape(lo, 0, lo, 1, 1, hi); Tile::addAABBs(level, x, y, z, box, boxes, source); } } void ThinFenceTile::updateDefaultShape() @@ -94,37 +72,15 @@ void ThinFenceTile::updateShape(LevelSource *level, int x, int y, int z, int for float minZ = 7.0f / 16.0f; float maxZ = 9.0f / 16.0f; - bool n = attachsTo(level->getTile(x, y, z - 1)); + bool n = attachsTo(level->getTile(x, y, z - 1)); bool s = attachsTo(level->getTile(x, y, z + 1)); bool w = attachsTo(level->getTile(x - 1, y, z)); bool e = attachsTo(level->getTile(x + 1, y, z)); - if ((w && e) || (!w && !e && !n && !s)) - { - minX = 0; - maxX = 1; - } - else if (w && !e) - { - minX = 0; - } - else if (!w && e) - { - maxX = 1; - } - if ((n && s) || (!w && !e && !n && !s)) - { - minZ = 0; - maxZ = 1; - } - else if (n && !s) - { - minZ = 0; - } - else if (!n && s) - { - maxZ = 1; - } + if (w) minX = 0; + if (e) maxX = 1; + if (n) minZ = 0; + if (s) maxZ = 1; setShape(minX, 0, minZ, maxX, 1, maxZ); } diff --git a/Minecraft.World/ThrownPotion.cpp b/Minecraft.World/ThrownPotion.cpp index 1ec72efa..f69556e2 100644 --- a/Minecraft.World/ThrownPotion.cpp +++ b/Minecraft.World/ThrownPotion.cpp @@ -7,6 +7,7 @@ #include "SharedConstants.h" #include "JavaMath.h" #include "ThrownPotion.h" +#include "AreaEffectCloud.h" @@ -45,7 +46,14 @@ ThrownPotion::ThrownPotion(Level *level, double x, double y, double z, int potio { _init(); - potionItem = std::make_shared(Item::potion, 1, potionValue); + if ((potionValue & LINGERING_FLAG) != 0) + { + potionItem = std::make_shared(Item::lingering_potion, 1, potionValue & ~LINGERING_FLAG); + } + else + { + potionItem = std::make_shared(Item::potion, 1, potionValue); + } } ThrownPotion::ThrownPotion(Level *level, double x, double y, double z, shared_ptr potion) : Throwable(level, x, y, z) @@ -82,11 +90,27 @@ int ThrownPotion::getPotionValue() return potionItem->getAuxValue(); } +bool ThrownPotion::isLingering() +{ + return potionItem != nullptr && potionItem->id == Item::lingering_potion_Id; +} + void ThrownPotion::onHit(HitResult *res) { if (!level->isClientSide) { - vector *mobEffects = Item::potion->getMobEffects(potionItem); + if (isLingering()) + { + shared_ptr cloud = std::make_shared(level, x, y, z); + cloud->setOwner(getOwner()); + cloud->setRadius(3.0f); + cloud->setRadiusOnUse(-0.5f); + cloud->setWaitTime(10); + cloud->setRadiusPerTick(-cloud->getRadius() / cloud->getDuration()); + cloud->setPotionValue(getPotionValue()); + level->addEntity(cloud); + } + vector *mobEffects = isLingering() ? nullptr : Item::potion->getMobEffects(potionItem); if (mobEffects != nullptr && !mobEffects->empty()) { diff --git a/Minecraft.World/ThrownPotion.h b/Minecraft.World/ThrownPotion.h index ec6a14da..4e3169fc 100644 --- a/Minecraft.World/ThrownPotion.h +++ b/Minecraft.World/ThrownPotion.h @@ -12,6 +12,7 @@ public: public: static const double SPLASH_RANGE; + static const int LINGERING_FLAG = 0x10000; private: static const double SPLASH_RANGE_SQ; @@ -35,6 +36,7 @@ protected: public: void setPotionValue(int potionValue); int getPotionValue(); + bool isLingering(); protected: virtual void onHit(HitResult *res); diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp index 1206e8e7..a791ca81 100644 --- a/Minecraft.World/Tile.cpp +++ b/Minecraft.World/Tile.cpp @@ -274,6 +274,15 @@ MagmaTile* Tile::magma = nullptr; Tile* Tile::nether_wart_block = nullptr; Tile* Tile::red_nether_brick = nullptr; BoneBlockTile* Tile::bone_block = nullptr; +EndRodTile* Tile::end_rod = nullptr; +EndGatewayTile* Tile::end_gateway = nullptr; +ChorusPlantTile* Tile::chorus_plant = nullptr; +ChorusFlowerTile* Tile::chorus_flower = nullptr; +Tile* Tile::purpur_block = nullptr; +Tile* Tile::purpur_pillar = nullptr; +Tile* Tile::purpur_stairs = nullptr; +HalfSlabTile* Tile::purpurSlab = nullptr; +HalfSlabTile* Tile::purpurSlabHalf = nullptr; Tile* Tile::barrier = nullptr; TallGrass2* Tile::double_plant = nullptr; @@ -597,6 +606,16 @@ void Tile::staticCtor() Tile::red_nether_brick = (new Tile(red_nether_brick_Id, Material::stone))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_stone)->setDestroyTime(2.0f)->setExplodeable(6)->setSoundType(SOUND_STONE)->setIconName(L"red_nether_brick")->setDescriptionId(IDS_TILE_RED_NETHER_BRICK)->setUseDescriptionId(IDS_DESC_RED_NETHER_BRICK); Tile::bone_block = static_cast((new BoneBlockTile(bone_block_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_stone)->setDestroyTime(1.5f)->setExplodeable(10)->setSoundType(SOUND_STONE)->setIconName(L"bone_block_side")->setDescriptionId(IDS_TILE_BONE_BLOCK)->setUseDescriptionId(IDS_DESC_BONE_BLOCK)->sendTileData()); + Tile::end_rod = static_cast((new EndRodTile(end_rod_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_torch, Item::eMaterial_purpur)->setDestroyTime(0.0f)->setLightEmission(15 / 16.0f)->setSoundType(SOUND_WOOD)->setIconName(L"end_rod")->setDescriptionId(IDS_TILE_END_ROD)->setUseDescriptionId(IDS_DESC_END_ROD)->sendTileData()->disableMipmap()); + Tile::end_gateway = static_cast((new EndGatewayTile(end_gateway_Id, Material::portal))->setDestroyTime(INDESTRUCTIBLE_DESTROY_TIME)->setExplodeable(6000000)->setDescriptionId(IDS_TILE_END_GATEWAY)->setUseDescriptionId(IDS_DESC_END_GATEWAY)); + Tile::chorus_plant = static_cast((new ChorusPlantTile(chorus_plant_Id))->setDestroyTime(0.4f)->setSoundType(SOUND_WOOD)->setIconName(L"chorus_flower_plant")->setDescriptionId(IDS_TILE_CHORUS_PLANT)->setUseDescriptionId(IDS_DESC_CHORUS_PLANT)); + Tile::chorus_flower = static_cast((new ChorusFlowerTile(chorus_flower_Id))->setDestroyTime(0.4f)->setSoundType(SOUND_WOOD)->setIconName(L"chorus_flower")->setDescriptionId(IDS_TILE_CHORUS_FLOWER)->setUseDescriptionId(IDS_DESC_CHORUS_FLOWER)->sendTileData()); + Tile::purpur_block = (new Tile(purpur_block_Id, Material::stone))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_purpur)->setDestroyTime(1.5f)->setExplodeable(10)->setSoundType(SOUND_STONE)->setIconName(L"purpur_block")->setDescriptionId(IDS_TILE_PURPUR_BLOCK)->setUseDescriptionId(IDS_DESC_PURPUR_BLOCK); + Tile::purpur_pillar = (new PurpurPillarTile(purpur_pillar_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_purpur)->setDestroyTime(1.5f)->setExplodeable(10)->setSoundType(SOUND_STONE)->setIconName(L"purpur_pillar")->setDescriptionId(IDS_TILE_PURPUR_PILLAR)->setUseDescriptionId(IDS_DESC_PURPUR_PILLAR)->sendTileData(); + Tile::purpur_stairs = (new StairTile(purpur_stairs_Id, Tile::purpur_block, 0))->setBaseItemTypeAndMaterial(Item::eBaseItemType_stairs, Item::eMaterial_purpur)->setIconName(L"stairsPurpur")->setDescriptionId(IDS_TILE_PURPUR_STAIRS)->sendTileData()->setUseDescriptionId(IDS_DESC_STAIRS); + Tile::purpurSlab = static_cast((new FullPurpurSlabTile(purpur_double_slab_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_slab, Item::eMaterial_purpur)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(SOUND_STONE)->sendTileData()->setIconName(L"purpur_block")->setDescriptionId(IDS_TILE_PURPUR_SLAB)->setUseDescriptionId(IDS_DESC_SLAB)); + Tile::purpurSlabHalf = static_cast((new HalfPurpurSlabTile(purpur_slab_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_halfslab, Item::eMaterial_purpur)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(SOUND_STONE)->sendTileData()->setIconName(L"purpur_block")->setDescriptionId(IDS_TILE_PURPUR_SLAB)->setUseDescriptionId(IDS_DESC_HALFSLAB)); + Tile::daylight_detector_inverted = static_cast((new DaylightDetectorTile(178, true))->setDestroyTime(0.2f)->setSoundType(SOUND_WOOD)->setIconName(L"daylight_detector")->setDescriptionId(IDS_TILE_DAYLIGHT_DETECTOR)->setUseDescriptionId(IDS_DESC_DAYLIGHT_DETECTOR)); Tile::red_sandstone = (new RedSandStoneTile(red_sandstone_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_sand)->setSoundType(Tile::SOUND_STONE)->setDestroyTime(0.8f)->sendTileData()->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_RED_SANDSTONE)->sendTileData(); Tile::stairs_red_sandstone = (new StairTile(red_sandstone_stairs_Id, Tile::red_sandstone, 0))->setBaseItemTypeAndMaterial(Item::eBaseItemType_stairs, Item::eMaterial_sand)->setIconName(L"stairsRedSandstone")->setDescriptionId(IDS_TILE_STAIRS_RED_SANDSTONE)->sendTileData()->setUseDescriptionId(IDS_DESC_STAIRS); @@ -665,6 +684,8 @@ void Tile::staticCtor() Item::items[red_sandstone_Id] = (new MultiTextureTileItem(Tile::red_sandstone_Id - 256, red_sandstone, (int*)RedSandStoneTile::SANDSTONE_NAMES, RedSandStoneTile::SANDSTONE_BLOCK_NAMES))->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_SANDSTONE); Item::items[stone_slab2_Id] = (new StoneSlabTileItem(Tile::stone_slab2_Id - 256, Tile::stoneSlab2Half, Tile::stoneSlab2, false))->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_HALFSLAB); Item::items[double_stone_slab2_Id] = (new StoneSlabTileItem(Tile::double_stone_slab2_Id - 256, Tile::stoneSlab2Half, Tile::stoneSlab2, true))->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_SLAB); + Item::items[purpur_slab_Id] = (new StoneSlabTileItem(Tile::purpur_slab_Id - 256, Tile::purpurSlabHalf, Tile::purpurSlab, false))->setIconName(L"purpur_block")->setDescriptionId(IDS_TILE_PURPUR_SLAB)->setUseDescriptionId(IDS_DESC_HALFSLAB); + Item::items[purpur_double_slab_Id] = (new StoneSlabTileItem(Tile::purpur_double_slab_Id - 256, Tile::purpurSlabHalf, Tile::purpurSlab, true))->setIconName(L"purpur_block")->setDescriptionId(IDS_TILE_PURPUR_SLAB)->setUseDescriptionId(IDS_DESC_SLAB); Item::items[log2_Id] = (new MultiTextureTileItem(Tile::log2_Id - 256, log2, (int*)TreeTile2::TREE_NAMES, TreeTile2::TREE_NAMES_LENGTH))->setIconName(L"log")->setDescriptionId(IDS_TILE_LOG)->setUseDescriptionId(IDS_DESC_LOG); Item::items[sponge_Id] = (new MultiTextureTileItem(Tile::sponge_Id - 256, sponge, (int*)Sponge::SPONGE_NAMES, Sponge::SPONGE_NAMES_LENGTH))->setIconName(L"sponge")->setDescriptionId(IDS_TILE_SPONGE)->setUseDescriptionId(IDS_DESC_SPONGE); @@ -1944,4 +1965,13 @@ const int Tile::magma_block_Id; const int Tile::nether_wart_block_Id; const int Tile::red_nether_brick_Id; const int Tile::bone_block_Id; +const int Tile::end_rod_Id; +const int Tile::end_gateway_Id; +const int Tile::chorus_plant_Id; +const int Tile::chorus_flower_Id; +const int Tile::purpur_block_Id; +const int Tile::purpur_pillar_Id; +const int Tile::purpur_stairs_Id; +const int Tile::purpur_double_slab_Id; +const int Tile::purpur_slab_Id; #endif diff --git a/Minecraft.World/Tile.h b/Minecraft.World/Tile.h index a29d889f..06cc48fe 100644 --- a/Minecraft.World/Tile.h +++ b/Minecraft.World/Tile.h @@ -50,6 +50,10 @@ class BeetrootTile; class MagmaTile; class BoneBlockTile; class BannerTile; +class EndRodTile; +class EndGatewayTile; +class ChorusPlantTile; +class ChorusFlowerTile; class ChunkRebuildData; @@ -207,8 +211,11 @@ public: static const int SHAPE_QUARTZ = 39; static const int SHAPE_THIN_PANE = 40; static const int SHAPE_SLIME = 41; + static const int SHAPE_END_ROD = 42; + static const int SHAPE_CHORUS_PLANT = 43; + static const int SHAPE_CHORUS_FLOWER = 44; - static const int SHAPE_COUNT = 42; + static const int SHAPE_COUNT = 45; static Tile **tiles; @@ -438,18 +445,18 @@ public: static const int jungle_door_Id = 195; static const int acacia_door_Id = 196; static const int dark_oak_door_Id = 197; - //end_rod 198 - //chorus_plant 199 - //chorus_flower 200 - //purpur_block 201 - //purpur_pillar 202 - //purpur_stairs 203 - //purpur_double_slab 204 - //purpur_slab 205 + static const int end_rod_Id = 198; + static const int chorus_plant_Id = 199; + static const int chorus_flower_Id = 200; + static const int purpur_block_Id = 201; + static const int purpur_pillar_Id = 202; + static const int purpur_stairs_Id = 203; + static const int purpur_double_slab_Id = 204; + static const int purpur_slab_Id = 205; static const int end_bricks_Id = 206; static const int beetroots_Id = 207; static const int grass_path_Id = 208; - //end_gateway 209 + static const int end_gateway_Id = 209; static const int frosted_ice_Id = 212; static const int magma_block_Id = 213; static const int nether_wart_block_Id = 214; @@ -676,6 +683,15 @@ public: static Tile* nether_wart_block; static Tile* red_nether_brick; static BoneBlockTile* bone_block; + static EndRodTile* end_rod; + static EndGatewayTile* end_gateway; + static ChorusPlantTile* chorus_plant; + static ChorusFlowerTile* chorus_flower; + static Tile* purpur_block; + static Tile* purpur_pillar; + static Tile* purpur_stairs; + static HalfSlabTile* purpurSlab; + static HalfSlabTile* purpurSlabHalf; static Tile* seaLantern; static Tile* prismarine; @@ -845,6 +861,7 @@ public: virtual int getPistonPushReaction(); virtual float getShadeBrightness(LevelSource *level, int x, int y, int z); // 4J - brought forward from 1.8.2 virtual void fallOn(Level *level, int x, int y, int z, shared_ptr entity, float fallDistance); + virtual float getFallDamageMultiplier() { return 1.0f; } virtual int cloneTileId(Level *level, int x, int y, int z); virtual int cloneTileData(Level *level, int x, int y, int z); virtual void playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player); diff --git a/Minecraft.World/TileEntity.cpp b/Minecraft.World/TileEntity.cpp index 58cb02fe..a8a6ac0e 100644 --- a/Minecraft.World/TileEntity.cpp +++ b/Minecraft.World/TileEntity.cpp @@ -34,6 +34,7 @@ void TileEntity::staticCtor() TileEntity::setId(ComparatorTileEntity::create, eTYPE_COMPARATORTILEENTITY, L"Comparator"); TileEntity::setId(BannerTileEntity::create, eTYPE_BANNERTILEENTITY, L"Banner"); TileEntity::setId(FlowerPotTileEntity::create, eTYPE_FLOWERPOTTILEENTITY, L"FlowerPot"); + TileEntity::setId(TheEndGatewayTileEntity::create, eTYPE_THEENDGATEWAYTILEENTITY, L"EndGateway"); } void TileEntity::setId(tileEntityCreateFn createFn, eINSTANCEOF clas, wstring id) diff --git a/Minecraft.World/TileEntityDataPacket.h b/Minecraft.World/TileEntityDataPacket.h index 284818e2..83bcb755 100644 --- a/Minecraft.World/TileEntityDataPacket.h +++ b/Minecraft.World/TileEntityDataPacket.h @@ -14,6 +14,7 @@ public: static const int TYPE_SKULL = 4; static const int TYPE_BANNER = 5; static const int TYPE_FLOWER_POT = 6; + static const int TYPE_END_GATEWAY = 7; int x, y, z; int type; diff --git a/Minecraft.World/TippedArrowItem.cpp b/Minecraft.World/TippedArrowItem.cpp new file mode 100644 index 00000000..a9274184 --- /dev/null +++ b/Minecraft.World/TippedArrowItem.cpp @@ -0,0 +1,65 @@ +#include "stdafx.h" +#include "net.minecraft.world.item.h" +#include "net.minecraft.world.effect.h" +#include "IconRegister.h" +#include "StringHelpers.h" +#include "TippedArrowItem.h" + +TippedArrowItem::TippedArrowItem(int id) : PotionItem(id) +{ + setMaxStackSize(64); + iconBase = nullptr; +} + +bool TippedArrowItem::TestUse(shared_ptr itemInstance, Level *level, shared_ptr player) +{ + return false; +} + +shared_ptr TippedArrowItem::use(shared_ptr instance, Level *level, shared_ptr player) +{ + return instance; +} + +int TippedArrowItem::getUseDuration(shared_ptr itemInstance) +{ + return 0; +} + +UseAnim TippedArrowItem::getUseAnimation(shared_ptr itemInstance) +{ + return UseAnim_none; +} + +Icon *TippedArrowItem::getIcon(int auxValue) +{ + return iconBase; +} + +wstring TippedArrowItem::getHoverName(shared_ptr itemInstance) +{ + vector *effects = getMobEffects(itemInstance); + if (effects != nullptr && !effects->empty()) + { + wstring name = app.GetString(IDS_ITEM_TIPPED_ARROW_EFFECT); + return replaceAll(name, L"{*postfix*}", app.GetString(effects->at(0)->getPostfixDescriptionId())); + } + return app.GetString(IDS_ITEM_TIPPED_ARROW); +} + +bool TippedArrowItem::isFoil(shared_ptr itemInstance) +{ + return false; +} + +unsigned int TippedArrowItem::getUseDescriptionId(shared_ptr instance) +{ + return IDS_DESC_TIPPED_ARROW; +} + +void TippedArrowItem::registerIcons(IconRegister *iconRegister) +{ + PotionItem::registerIcons(iconRegister); + iconBase = iconRegister->registerIcon(L"tipped_arrow_base"); + iconOverlay = iconRegister->registerIcon(L"tipped_arrow_head"); +} diff --git a/Minecraft.World/TippedArrowItem.h b/Minecraft.World/TippedArrowItem.h new file mode 100644 index 00000000..c8b6113a --- /dev/null +++ b/Minecraft.World/TippedArrowItem.h @@ -0,0 +1,24 @@ +#pragma once +#include "PotionItem.h" + +class TippedArrowItem : public PotionItem +{ +public: + TippedArrowItem(int id); + + virtual shared_ptr use(shared_ptr instance, Level *level, shared_ptr player); + virtual bool TestUse(shared_ptr itemInstance, Level *level, shared_ptr player); + virtual int getUseDuration(shared_ptr itemInstance); + virtual UseAnim getUseAnimation(shared_ptr itemInstance); + virtual Icon *getIcon(int auxValue); + virtual wstring getHoverName(shared_ptr itemInstance); + virtual bool isFoil(shared_ptr itemInstance); + virtual unsigned int getUseDescriptionId(shared_ptr instance); + virtual void registerIcons(IconRegister *iconRegister); + +protected: + virtual float getTooltipDurationScale() { return 0.125f; } + +private: + Icon *iconBase; +}; diff --git a/Minecraft.World/TrapDoorTile.cpp b/Minecraft.World/TrapDoorTile.cpp index 97ea849a..06fecc17 100644 --- a/Minecraft.World/TrapDoorTile.cpp +++ b/Minecraft.World/TrapDoorTile.cpp @@ -135,14 +135,14 @@ bool TrapDoorTile::use(Level *level, int x, int y, int z, shared_ptr pla if (soundOnly) { // 4J - added - just do enough to play the sound - level->levelEvent(player, LevelEvent::SOUND_OPEN_DOOR, x, y, z, 0); + level->levelEvent(player, getToggleSound((level->getData(x, y, z) & 4) == 0), x, y, z, 0); return false; } int dir = level->getData(x, y, z); level->setData(x, y, z, dir ^ 4, Tile::UPDATE_CLIENTS); - level->levelEvent(player, LevelEvent::SOUND_OPEN_DOOR, x, y, z, 0); + level->levelEvent(player, getToggleSound((dir & 4) == 0), x, y, z, 0); return true; } @@ -156,27 +156,13 @@ void TrapDoorTile::setOpen(Level *level, int x, int y, int z, bool shouldOpen) level->setData(x, y, z, dir ^ 4, Tile::UPDATE_CLIENTS); - level->levelEvent(nullptr, LevelEvent::SOUND_OPEN_DOOR, x, y, z, 0); + level->levelEvent(nullptr, getToggleSound(shouldOpen), x, y, z, 0); } void TrapDoorTile::neighborChanged(Level *level, int x, int y, int z, int type) { if (level->isClientSide) return; - int data = level->getData(x, y, z); - int xt = x; - int zt = z; - if ((data & 3) == 0) zt++; - if ((data & 3) == 1) zt--; - if ((data & 3) == 2) xt++; - if ((data & 3) == 3) xt--; - - - if (!attachesTo(level->getTile(xt, y, zt))) - { - level->removeTile(x, y, z); - spawnResources(level, x, y, z, data, 0); - } bool signal = level->hasNeighborSignal(x, y, z); if( signal || ((type > 0 && Tile::tiles[type]->isSignalSource())) ) @@ -206,6 +192,8 @@ int TrapDoorTile::getDir(int dir) int TrapDoorTile::getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue) { int dir = 0; + s_placedVertically = (face == Facing::UP || face == Facing::DOWN); + if (face == Facing::DOWN) dir |= TOP_MASK; if (face == 2) dir = 0; if (face == 3) dir = 1; if (face == 4) dir = 2; @@ -216,14 +204,7 @@ int TrapDoorTile::getPlacedOnFaceDataValue(Level *level, int x, int y, int z, in bool TrapDoorTile::mayPlace(Level *level, int x, int y, int z, int face) { - if (face == 0) return false; - if (face == 1) return false; - if (face == 2) z++; - if (face == 3) z--; - if (face == 4) x++; - if (face == 5) x--; - - return attachesTo(level->getTile(x, y, z)); + return true; } bool TrapDoorTile::isOpen(int data) @@ -240,4 +221,22 @@ bool TrapDoorTile::attachesTo(int id) Tile *tile = Tile::tiles[id]; return tile != nullptr && (tile->material->isSolidBlocking() && tile->isCubeShaped()) || tile == Tile::glowstone || (dynamic_cast(tile) != nullptr) || (dynamic_cast(tile) != nullptr); -} \ No newline at end of file +} +int TrapDoorTile::getToggleSound(bool open) +{ + if (material == Material::metal) return open ? LevelEvent::SOUND_OPEN_IRON_TRAP_DOOR : LevelEvent::SOUND_CLOSE_IRON_TRAP_DOOR; + return open ? LevelEvent::SOUND_OPEN_WOODEN_TRAP_DOOR : LevelEvent::SOUND_CLOSE_WOODEN_TRAP_DOOR; +} + +bool TrapDoorTile::s_placedVertically = false; + +void TrapDoorTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr by, shared_ptr itemInstance) +{ + if (!s_placedVertically || by == nullptr) return; + s_placedVertically = false; + + static const int OPPOSITE_DIR[4] = { 0, 3, 1, 2 }; + int facing = Mth::floor(by->yRot * 4 / 360 + 0.5) & 3; + int data = level->getData(x, y, z); + level->setData(x, y, z, (data & ~3) | OPPOSITE_DIR[facing], Tile::UPDATE_CLIENTS); +} diff --git a/Minecraft.World/TrapDoorTile.h b/Minecraft.World/TrapDoorTile.h index 9629c50a..8f2d8417 100644 --- a/Minecraft.World/TrapDoorTile.h +++ b/Minecraft.World/TrapDoorTile.h @@ -66,6 +66,7 @@ public: public: void setOpen(Level *level, int x, int y, int z, bool shouldOpen); + int getToggleSound(bool open); public: @@ -80,6 +81,8 @@ public: public: int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue); + virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr by, shared_ptr itemInstance); + static bool s_placedVertically; public: bool mayPlace(Level *level, int x, int y, int z, int face); diff --git a/Minecraft.World/VillageFeature.cpp b/Minecraft.World/VillageFeature.cpp index 79f53cd3..74eb9101 100644 --- a/Minecraft.World/VillageFeature.cpp +++ b/Minecraft.World/VillageFeature.cpp @@ -169,14 +169,13 @@ VillageFeature::VillageStart::VillageStart(Level *level, Random *random, int chu bool VillageFeature::VillageStart::isValid() { -// m_iXZSize is in chunks, bounding box is in blocks -const int halfBlocks = (m_iXZSize << 4) / 2; -if ((boundingBox->x0 < -halfBlocks) || (boundingBox->x1 > halfBlocks) || -(boundingBox->z0 < -halfBlocks) || (boundingBox->z1 > halfBlocks)) -{ -valid = false; -} -return valid; + // 4J - PB - Adding a bounds check to ensure a village isn't over the edge of our world - we end up with half houses in that case + // NeoLegacy Note - m_iXZSize is in chunks, bounding box is in blocks + const int halfBlocks = (m_iXZSize << 4) / 2; + if ((boundingBox->x0 < -halfBlocks) || (boundingBox->x1 > halfBlocks) || (boundingBox->z0 < -halfBlocks) || (boundingBox->z1 > halfBlocks)) { + valid = false; + } + return valid; } void VillageFeature::VillageStart::addAdditonalSaveData(CompoundTag *tag) diff --git a/Minecraft.World/Villager.cpp b/Minecraft.World/Villager.cpp index 90ade912..c5ced9b0 100644 --- a/Minecraft.World/Villager.cpp +++ b/Minecraft.World/Villager.cpp @@ -485,7 +485,7 @@ void Villager::addOffers(int addCount) } break; case PROFESSION_PRIEST: - addItemForPurchase(newOffers, Item::eye_of_ender_Id, random, getRecipeChance(.3f)); + addItemForPurchase(newOffers, Item::ender_pearl_Id, random, getRecipeChance(.3f)); addItemForPurchase(newOffers, Item::experience_bottle_Id, random, getRecipeChance(.2f)); addItemForPurchase(newOffers, Item::redstone_Id, random, getRecipeChance(.4f)); addItemForPurchase(newOffers, Tile::glowstone_Id, random, getRecipeChance(.3f)); @@ -602,6 +602,7 @@ void Villager::staticCtor() MIN_MAX_PRICES[Item::cooked_beef_Id] = pair(-7, -5); MIN_MAX_PRICES[Item::cooked_chicken_Id] = pair(-8, -6); MIN_MAX_PRICES[Item::eye_of_ender_Id] = pair(7, 11); + MIN_MAX_PRICES[Item::ender_pearl_Id] = pair(4, 7); MIN_MAX_PRICES[Item::arrow_Id] = pair(-12, -8); } diff --git a/Minecraft.World/VillagerGolem.cpp b/Minecraft.World/VillagerGolem.cpp index c1af828a..804c454f 100644 --- a/Minecraft.World/VillagerGolem.cpp +++ b/Minecraft.World/VillagerGolem.cpp @@ -85,6 +85,7 @@ void VillagerGolem::registerAttributes() getAttribute(SharedMonsterAttributes::MAX_HEALTH)->setBaseValue(100); getAttribute(SharedMonsterAttributes::MOVEMENT_SPEED)->setBaseValue(0.25f); + getAttribute(SharedMonsterAttributes::KNOCKBACK_RESISTANCE)->setBaseValue(1.0); } int VillagerGolem::decreaseAirSupply(int currentSupply) diff --git a/Minecraft.World/WaterLilyTile.cpp b/Minecraft.World/WaterLilyTile.cpp index 1ed239c7..045d4617 100644 --- a/Minecraft.World/WaterLilyTile.cpp +++ b/Minecraft.World/WaterLilyTile.cpp @@ -13,9 +13,7 @@ WaterlilyTile::WaterlilyTile(int id) : Bush(id) // 4J Added override void WaterlilyTile::updateDefaultShape() { - float ss = 0.5f; - float hh = 0.25f / 16.0f; - setShape(0.5f - ss, 0, 0.5f - ss, 0.5f + ss, hh, 0.5f + ss); + setShape(1.0f / 16.0f, 0, 1.0f / 16.0f, 15.0f / 16.0f, 1.5f / 16.0f, 15.0f / 16.0f); } int WaterlilyTile::getRenderShape() diff --git a/Minecraft.World/WaterLilyTileItem.cpp b/Minecraft.World/WaterLilyTileItem.cpp index 978a611f..91249155 100644 --- a/Minecraft.World/WaterLilyTileItem.cpp +++ b/Minecraft.World/WaterLilyTileItem.cpp @@ -1,4 +1,5 @@ #include "stdafx.h" +#include "SoundTypes.h" #include "net.minecraft.world.phys.h" #include "net.minecraft.world.level.h" #include "net.minecraft.world.level.tile.h" @@ -69,6 +70,7 @@ shared_ptr WaterLilyTileItem::use(shared_ptr itemIns if (level->getMaterial(xt, yt, zt) == Material::water && level->getData(xt, yt, zt) == 0 && level->isEmptyTile(xt, yt + 1, zt)) { level->setTileAndUpdate(xt, yt + 1, zt, Tile::waterLily->id); + level->playSound(xt + 0.5, yt + 1.5, zt + 0.5, eSoundType_BLOCK_WATERLILY_PLACE, 1.0f, 1.0f); if (!player->abilities.instabuild) { itemInstance->count--; diff --git a/Minecraft.World/Zombie.cpp b/Minecraft.World/Zombie.cpp index 87e4e173..d84c6f0e 100644 --- a/Minecraft.World/Zombie.cpp +++ b/Minecraft.World/Zombie.cpp @@ -1,6 +1,8 @@ #include "stdafx.h" #include "net.minecraft.world.level.h" #include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.dimension.h" #include "net.minecraft.world.h" #include "net.minecraft.world.item.h" #include "net.minecraft.world.damagesource.h" @@ -73,6 +75,8 @@ void Zombie::defineSynchedData() getEntityData()->define(DATA_BABY_ID, static_cast(0)); getEntityData()->define(DATA_VILLAGER_ID, static_cast(0)); getEntityData()->define(DATA_CONVERTING_ID, static_cast(0)); + getEntityData()->define(DATA_HUSK_ID, static_cast(0)); + getEntityData()->define(DATA_PROFESSION_ID, static_cast(0)); } int Zombie::getArmorValue() @@ -118,12 +122,23 @@ void Zombie::setVillager(bool villager) getEntityData()->set(DATA_VILLAGER_ID, static_cast(villager ? 1 : 0)); } +int Zombie::getProfession() +{ + int profession = getEntityData()->getByte(DATA_PROFESSION_ID); + return profession < 0 ? 0 : profession; +} + +void Zombie::setProfession(int profession) +{ + getEntityData()->set(DATA_PROFESSION_ID, static_cast(profession)); +} + void Zombie::aiStep() { - if (level->isDay() && !level->isClientSide && !isBaby()) + if (level->isDay() && !level->isClientSide && !isBaby() && !isHusk()) { float br = getBrightness(1); - if (br > 0.5f && random->nextFloat() * 30 < (br - 0.4f) * 2 && level->canSeeSky(Mth::floor(x), static_cast(floor(y + 0.5)), Mth::floor(z))) + if (br > 0.5f && random->nextFloat() * 30 < (br - 0.4f) * 2 && level->canSeeSky(Mth::floor(x), Mth::floor(y + getHeadHeight()), Mth::floor(z))) { bool burn = true; @@ -229,6 +244,10 @@ bool Zombie::doHurtTarget(shared_ptr target) { target->setOnFire(2 * level->difficulty); } + if (isHusk() && getCarriedItem() == nullptr && target->instanceof(eTYPE_LIVINGENTITY)) + { + dynamic_pointer_cast(target)->addEffect(new MobEffectInstance(MobEffect::hunger->id, 140 * max(1, static_cast(level->difficulty)), 0)); + } } return result; @@ -242,17 +261,17 @@ void Zombie::updateSize(bool isBaby) int Zombie::getAmbientSound() { - return eSoundType_MOB_ZOMBIE_AMBIENT; + return isHusk() ? eSoundType_ENTITY_HUSK_IDLE : eSoundType_MOB_ZOMBIE_AMBIENT; } int Zombie::getHurtSound() { - return eSoundType_MOB_ZOMBIE_HURT; + return isHusk() ? eSoundType_ENTITY_HUSK_HURT : eSoundType_MOB_ZOMBIE_HURT; } int Zombie::getDeathSound() { - return eSoundType_MOB_ZOMBIE_DEATH; + return isHusk() ? eSoundType_ENTITY_HUSK_DEATH : eSoundType_MOB_ZOMBIE_DEATH; } int Zombie::getDeathLoot() @@ -262,7 +281,7 @@ int Zombie::getDeathLoot() void Zombie::playStepSound(int xt, int yt, int zt, int t) { - playSound(eSoundType_MOB_ZOMBIE_STEP, 0.15f, 1); + playSound(isHusk() ? eSoundType_ENTITY_HUSK_STEP : eSoundType_MOB_ZOMBIE_STEP, 0.15f, 1); } MobType Zombie::getMobType() @@ -310,6 +329,8 @@ void Zombie::addAdditonalSaveData(CompoundTag *tag) if (isBaby()) tag->putBoolean(L"IsBaby", true); if (isVillager()) tag->putBoolean(L"IsVillager", true); + if (isVillager()) tag->putInt(L"Profession", getProfession()); + if (isHusk()) tag->putBoolean(L"IsHusk", true); tag->putInt(L"ConversionTime", isConverting() ? villagerConversionTime : -1); } @@ -319,6 +340,8 @@ void Zombie::readAdditionalSaveData(CompoundTag *tag) if (tag->getBoolean(L"IsBaby")) setBaby(true); if (tag->getBoolean(L"IsVillager")) setVillager(true); + if (tag->contains(L"Profession")) setProfession(tag->getInt(L"Profession")); + if (tag->getBoolean(L"IsHusk")) setHusk(true); if (tag->contains(L"ConversionTime") && tag->getInt(L"ConversionTime") > -1) startConverting(tag->getInt(L"ConversionTime")); } @@ -335,6 +358,7 @@ void Zombie::killed(shared_ptr mob) level->removeEntity(mob); zombie->finalizeMobSpawn(nullptr); zombie->setVillager(true); + zombie->setProfession(dynamic_pointer_cast(mob)->getProfession()); if (mob->isBaby()) zombie->setBaby(true); level->addEntity(zombie); @@ -361,6 +385,20 @@ MobGroupData *Zombie::finalizeMobSpawn(MobGroupData *groupData, int extraData /* if (zombieData->isVillager) { setVillager(true); + setProfession(random->nextInt(Villager::PROFESSION_MAX)); + } + else if (extraData == 1) + { + setHusk(true); + } + else if (extraData == 0 && GetType() == eTYPE_ZOMBIE && level->dimension->id == 0) + { + Biome *biome = level->getBiome(Mth::floor(x), Mth::floor(z)); + if ((biome == Biome::desert || biome == Biome::desertHills || biome == Biome::desertM) + && level->canSeeSky(Mth::floor(x), Mth::floor(y), Mth::floor(z)) && random->nextInt(5) != 0) + { + setHusk(true); + } } if (zombieData->isBaby) @@ -490,6 +528,7 @@ void Zombie::finishConversion() shared_ptr villager = std::make_shared(level); villager->copyPosition(shared_from_this()); villager->finalizeMobSpawn(nullptr); + if (getProfession() < Villager::PROFESSION_MAX) villager->setProfession(getProfession()); villager->setRewardPlayersInVillage(); if (isBaby()) villager->setAge(-20 * 60 * 20); level->removeEntity(shared_from_this()); @@ -532,3 +571,13 @@ Zombie::ZombieGroupData::ZombieGroupData(bool baby, bool villager) isBaby = baby; isVillager = villager; } + +bool Zombie::isHusk() +{ + return getEntityData()->getByte(DATA_HUSK_ID) == static_cast(1); +} + +void Zombie::setHusk(bool husk) +{ + getEntityData()->set(DATA_HUSK_ID, static_cast(husk ? 1 : 0)); +} diff --git a/Minecraft.World/Zombie.h b/Minecraft.World/Zombie.h index f788ea63..543d18f7 100644 --- a/Minecraft.World/Zombie.h +++ b/Minecraft.World/Zombie.h @@ -21,6 +21,8 @@ private: static const int DATA_BABY_ID = 12; static const int DATA_VILLAGER_ID = 13; static const int DATA_CONVERTING_ID = 14; + static const int DATA_HUSK_ID = 15; + static const int DATA_PROFESSION_ID = 16; public: static const float ZOMBIE_LEADER_CHANCE; @@ -56,6 +58,10 @@ public: virtual void setBaby(bool baby); virtual bool isVillager(); virtual void setVillager(bool villager); + int getProfession(); + void setProfession(int profession); + virtual bool isHusk(); + virtual void setHusk(bool husk); virtual void aiStep(); virtual bool hurt(DamageSource *source, float dmg); virtual void tick(); diff --git a/Minecraft.World/cmake/sources/Common.cmake b/Minecraft.World/cmake/sources/Common.cmake index 6d33412c..edf7cc49 100644 --- a/Minecraft.World/cmake/sources/Common.cmake +++ b/Minecraft.World/cmake/sources/Common.cmake @@ -355,6 +355,8 @@ set(_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_NETWORK_PACKET "${CMAKE_CURRENT_SOURCE_DIR}/PlayerInfoPacket.h" "${CMAKE_CURRENT_SOURCE_DIR}/PlayerInputPacket.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/PlayerInputPacket.h" + "${CMAKE_CURRENT_SOURCE_DIR}/MoveVehiclePacket.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/MoveVehiclePacket.h" "${CMAKE_CURRENT_SOURCE_DIR}/PreLoginPacket.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/PreLoginPacket.h" "${CMAKE_CURRENT_SOURCE_DIR}/RemoveEntitiesPacket.cpp" @@ -679,6 +681,8 @@ set(_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_ENTITY_AI_GOAL "${CMAKE_CURRENT_SOURCE_DIR}/RandomStrollGoal.h" "${CMAKE_CURRENT_SOURCE_DIR}/RangedAttackGoal.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/RangedAttackGoal.h" + "${CMAKE_CURRENT_SOURCE_DIR}/RangedBowAttackGoal.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/RangedBowAttackGoal.h" "${CMAKE_CURRENT_SOURCE_DIR}/RestrictOpenDoorGoal.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/RestrictOpenDoorGoal.h" "${CMAKE_CURRENT_SOURCE_DIR}/RestrictSunGoal.cpp" @@ -1085,6 +1089,20 @@ set(_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_ITEM "${CMAKE_CURRENT_SOURCE_DIR}/EggItem.h" "${CMAKE_CURRENT_SOURCE_DIR}/ElytraItem.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/ElytraItem.h" + "${CMAKE_CURRENT_SOURCE_DIR}/ChorusFruitItem.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/ChorusFruitItem.h" + "${CMAKE_CURRENT_SOURCE_DIR}/EndCrystalItem.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/EndCrystalItem.h" + "${CMAKE_CURRENT_SOURCE_DIR}/LingeringPotionItem.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/LingeringPotionItem.h" + "${CMAKE_CURRENT_SOURCE_DIR}/TippedArrowItem.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/TippedArrowItem.h" + "${CMAKE_CURRENT_SOURCE_DIR}/AreaEffectCloud.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/AreaEffectCloud.h" + "${CMAKE_CURRENT_SOURCE_DIR}/Shulker.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/Shulker.h" + "${CMAKE_CURRENT_SOURCE_DIR}/ShulkerBullet.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/ShulkerBullet.h" "${CMAKE_CURRENT_SOURCE_DIR}/EmptyMapItem.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/EmptyMapItem.h" "${CMAKE_CURRENT_SOURCE_DIR}/EnchantedBookItem.cpp" @@ -1498,6 +1516,8 @@ set(_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_LEVEL_LEVELGEN_FEATURE "${CMAKE_CURRENT_SOURCE_DIR}/DeadBushFeature.h" "${CMAKE_CURRENT_SOURCE_DIR}/DesertWellFeature.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/DesertWellFeature.h" + "${CMAKE_CURRENT_SOURCE_DIR}/EndIslandFeature.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/EndIslandFeature.h" "${CMAKE_CURRENT_SOURCE_DIR}/EndPodiumFeature.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/EndPodiumFeature.h" "${CMAKE_CURRENT_SOURCE_DIR}/Feature.cpp" @@ -2063,6 +2083,30 @@ set(_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_LEVEL_TILE "${CMAKE_CURRENT_SOURCE_DIR}/MagmaTile.h" "${CMAKE_CURRENT_SOURCE_DIR}/BoneBlockTile.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/BoneBlockTile.h" + "${CMAKE_CURRENT_SOURCE_DIR}/EndCityFeature.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/EndCityFeature.h" + "${CMAKE_CURRENT_SOURCE_DIR}/EndCityPieces.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/EndCityPieces.h" + "${CMAKE_CURRENT_SOURCE_DIR}/EndCityTemplates.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/EndCityTemplates.h" + "${CMAKE_CURRENT_SOURCE_DIR}/EndDragonFight.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/EndDragonFight.h" + "${CMAKE_CURRENT_SOURCE_DIR}/EndGatewayFeature.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/EndGatewayFeature.h" + "${CMAKE_CURRENT_SOURCE_DIR}/EndGatewayTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/EndGatewayTile.h" + "${CMAKE_CURRENT_SOURCE_DIR}/TheEndGatewayTileEntity.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/TheEndGatewayTileEntity.h" + "${CMAKE_CURRENT_SOURCE_DIR}/EndRodTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/EndRodTile.h" + "${CMAKE_CURRENT_SOURCE_DIR}/ChorusPlantTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/ChorusPlantTile.h" + "${CMAKE_CURRENT_SOURCE_DIR}/ChorusFlowerTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/ChorusFlowerTile.h" + "${CMAKE_CURRENT_SOURCE_DIR}/PurpurPillarTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/PurpurPillarTile.h" + "${CMAKE_CURRENT_SOURCE_DIR}/PurpurSlabTile.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/PurpurSlabTile.h" "${CMAKE_CURRENT_SOURCE_DIR}/BannerTile.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/BannerTile.h" "${CMAKE_CURRENT_SOURCE_DIR}/BannerTileEntity.cpp" diff --git a/Minecraft.World/net.minecraft.network.packet.h b/Minecraft.World/net.minecraft.network.packet.h index c1d52d14..9a7f4fca 100644 --- a/Minecraft.World/net.minecraft.network.packet.h +++ b/Minecraft.World/net.minecraft.network.packet.h @@ -36,6 +36,7 @@ #include "PlayerActionPacket.h" #include "PlayerCommandPacket.h" #include "PlayerInputPacket.h" +#include "MoveVehiclePacket.h" #include "PreLoginPacket.h" #include "RemoveEntitiesPacket.h" #include "RespawnPacket.h" diff --git a/Minecraft.World/net.minecraft.world.entity.ai.goal.h b/Minecraft.World/net.minecraft.world.entity.ai.goal.h index 73273e13..05f5ecc6 100644 --- a/Minecraft.World/net.minecraft.world.entity.ai.goal.h +++ b/Minecraft.World/net.minecraft.world.entity.ai.goal.h @@ -32,6 +32,7 @@ #include "RandomLookAroundGoal.h" #include "RandomStrollGoal.h" #include "RangedAttackGoal.h" +#include "RangedBowAttackGoal.h" #include "RestrictOpenDoorGoal.h" #include "RestrictSunGoal.h" #include "RunAroundLikeCrazyGoal.h" diff --git a/Minecraft.World/net.minecraft.world.entity.h b/Minecraft.World/net.minecraft.world.entity.h index de8c232a..576e9807 100644 --- a/Minecraft.World/net.minecraft.world.entity.h +++ b/Minecraft.World/net.minecraft.world.entity.h @@ -28,6 +28,8 @@ // 1.6.4 #include "LeashFenceKnotEntity.h" + +#include "AreaEffectCloud.h" #include "MobGroupData.h" #include "OwnableEntity.h" #include "EntitySelector.h" diff --git a/Minecraft.World/net.minecraft.world.entity.monster.h b/Minecraft.World/net.minecraft.world.entity.monster.h index dde56293..2ea849e8 100644 --- a/Minecraft.World/net.minecraft.world.entity.monster.h +++ b/Minecraft.World/net.minecraft.world.entity.monster.h @@ -29,3 +29,5 @@ //TU 31 #include "Endermite.h" #include "Guardian.h" + +#include "Shulker.h" diff --git a/Minecraft.World/net.minecraft.world.entity.projectile.h b/Minecraft.World/net.minecraft.world.entity.projectile.h index f871230a..9ee2671a 100644 --- a/Minecraft.World/net.minecraft.world.entity.projectile.h +++ b/Minecraft.World/net.minecraft.world.entity.projectile.h @@ -21,4 +21,5 @@ #include "FireworksRocketEntity.h" #include "LargeFireball.h" #include "Projectile.h" -#include "WitherSkull.h" \ No newline at end of file +#include "WitherSkull.h" +#include "ShulkerBullet.h" diff --git a/Minecraft.World/net.minecraft.world.item.h b/Minecraft.World/net.minecraft.world.item.h index 7055638b..5ad6efff 100644 --- a/Minecraft.World/net.minecraft.world.item.h +++ b/Minecraft.World/net.minecraft.world.item.h @@ -2,6 +2,10 @@ #include "ArmorItem.h" #include "ElytraItem.h" +#include "ChorusFruitItem.h" +#include "EndCrystalItem.h" +#include "LingeringPotionItem.h" +#include "TippedArrowItem.h" #include "BedItem.h" #include "BoatItem.h" #include "BowItem.h" diff --git a/Minecraft.World/net.minecraft.world.level.levelgen.feature.h b/Minecraft.World/net.minecraft.world.level.levelgen.feature.h index 2f61e80e..3a8768b1 100644 --- a/Minecraft.World/net.minecraft.world.level.levelgen.feature.h +++ b/Minecraft.World/net.minecraft.world.level.levelgen.feature.h @@ -32,6 +32,7 @@ #include "BonusChestFeature.h" #include "SpikeFeature.h" #include "EndPodiumFeature.h" +#include "EndIslandFeature.h" #include "SavannaTreeFeature.h" #include "RoofTreeFeature.h" diff --git a/Minecraft.World/net.minecraft.world.level.tile.entity.h b/Minecraft.World/net.minecraft.world.level.tile.entity.h index 8d62567c..bd7a54c5 100644 --- a/Minecraft.World/net.minecraft.world.level.tile.entity.h +++ b/Minecraft.World/net.minecraft.world.level.tile.entity.h @@ -18,6 +18,7 @@ #include "TileEntity.h" #include "PistonMovingPiece.h" #include "TheEndPortalTileEntity.h" +#include "TheEndGatewayTileEntity.h" #include "SkullTileEntity.h" #include "EnderChestTileEntity.h" #include "ItemFrame.h" diff --git a/Minecraft.World/net.minecraft.world.level.tile.h b/Minecraft.World/net.minecraft.world.level.tile.h index a4e7787c..c1839014 100644 --- a/Minecraft.World/net.minecraft.world.level.tile.h +++ b/Minecraft.World/net.minecraft.world.level.tile.h @@ -150,5 +150,11 @@ #include "MagmaTile.h" #include "BoneBlockTile.h" #include "BannerTile.h" +#include "EndRodTile.h" +#include "EndGatewayTile.h" +#include "ChorusPlantTile.h" +#include "ChorusFlowerTile.h" +#include "PurpurPillarTile.h" +#include "PurpurSlabTile.h" diff --git a/cmake/ServerTarget.cmake b/cmake/ServerTarget.cmake index 1ca95de7..2cb364a9 100644 --- a/cmake/ServerTarget.cmake +++ b/cmake/ServerTarget.cmake @@ -95,6 +95,14 @@ function(configure_lce_server_target target) setup_asset_folder_copy(${target} "${_asset_folder_pairs}") #setup_asset_file_copy(${target} "${_asset_files_pairs}") + set(_sdl3_runtime_dll "${CMAKE_SOURCE_DIR}/Minecraft.Client/${PLATFORM_NAME}/4JLibs/sdl/lib/x64/SDL3.dll") + if(EXISTS "${_sdl3_runtime_dll}") + add_custom_command(TARGET ${target} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_sdl3_runtime_dll}" "$" + VERBATIM + ) + endif() + set(_loot_tables_source "${CMAKE_SOURCE_DIR}/Minecraft.Client/Common/Media/MediaWindows64/Structures/loot_tables") set(_loot_tables_dest "$/Common/Media/MediaWindows64/Structures/loot_tables") add_custom_target(AssetLootTablesCopy_${target} ALL diff --git a/tools/AddDeathMessageLabel.java b/tools/AddDeathMessageLabel.java new file mode 100644 index 00000000..f2011ad8 --- /dev/null +++ b/tools/AddDeathMessageLabel.java @@ -0,0 +1,73 @@ +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.tags.*; +import com.jpexs.decompiler.flash.tags.base.*; +import com.jpexs.decompiler.flash.types.*; +import java.io.*; +import java.util.*; + +public class AddDeathMessageLabel { + private static final float SCALE = 0.5f; + + public static void main(String[] args) throws Exception { + if (args.length < 1) { + System.out.println("Usage: AddDeathMessageLabel [output_file]"); + System.exit(1); + } + String inputPath = args[0]; + String outputPath = args.length > 1 ? args[1] : inputPath; + + SWF swf = new SWF(new FileInputStream(inputPath), false); + + PlaceObject3Tag title = null; + Integer respawnY = null; + int maxDepth = 0; + for (Tag tag : swf.getTags()) { + if (tag instanceof PlaceObjectTypeTag) { + PlaceObjectTypeTag po = (PlaceObjectTypeTag) tag; + if ("DeathMessage".equals(po.getInstanceName())) { + System.out.println("DeathMessage already exists in " + inputPath + ", skipping."); + return; + } + if ("Title".equals(po.getInstanceName()) && tag instanceof PlaceObject3Tag) title = (PlaceObject3Tag) tag; + if ("Respawn".equals(po.getInstanceName())) respawnY = po.getMatrix().translateY; + if (po.getDepth() > maxDepth) maxDepth = po.getDepth(); + } + } + if (title == null || respawnY == null) { + System.err.println("ERROR: Title or Respawn not found in " + inputPath); + System.exit(1); + } + + int centreX = (swf.displayRect.Xmax + swf.displayRect.Xmin) / 2; + int titleX = title.matrix.translateX; + int titleY = title.matrix.translateY; + + PlaceObject3Tag label = new PlaceObject3Tag(swf); + label.placeFlagHasClassName = title.placeFlagHasClassName; + label.placeFlagHasName = true; + label.placeFlagHasMatrix = true; + label.placeFlagHasImage = title.placeFlagHasImage; + label.placeFlagHasCharacter = title.placeFlagHasCharacter; + label.placeFlagMove = title.placeFlagMove; + label.className = title.className; + label.characterId = title.characterId; + label.name = "DeathMessage"; + label.depth = maxDepth + 1; + MATRIX m = new MATRIX(title.matrix); + m.hasScale = true; + m.scaleX = title.matrix.scaleX * SCALE; + m.scaleY = title.matrix.scaleY * SCALE; + m.translateX = centreX - Math.round((centreX - titleX) * SCALE); + m.translateY = titleY + Math.round((respawnY - titleY) * 0.4f); + label.matrix = m; + label.setModified(true); + + List tags = swf.getTags().toArrayList(); + swf.addTag(tags.indexOf(title) + 1, label); + + System.out.println(inputPath + ": DeathMessage at " + m.translateX + "," + m.translateY + " depth=" + label.depth); + try (FileOutputStream fos = new FileOutputStream(outputPath)) { + swf.saveTo(fos); + } + } +} diff --git a/tools/AddResetEndCheckbox.java b/tools/AddResetEndCheckbox.java new file mode 100644 index 00000000..a9a292ef --- /dev/null +++ b/tools/AddResetEndCheckbox.java @@ -0,0 +1,84 @@ +import com.jpexs.decompiler.flash.SWF; +import com.jpexs.decompiler.flash.tags.*; +import com.jpexs.decompiler.flash.tags.base.*; +import com.jpexs.decompiler.flash.types.*; +import java.io.*; +import java.util.*; + + +public class AddResetEndCheckbox { + public static void main(String[] args) throws Exception { + if (args.length < 1) { + System.out.println("Usage: AddResetEndCheckbox [output_file]"); + System.exit(1); + } + String inputPath = args[0]; + String outputPath = args.length > 1 ? args[1] : inputPath; + + SWF swf = new SWF(new FileInputStream(inputPath), false); + + DefineSpriteTag worldOptions = null; + PlaceObject3Tag resetNether = null; + for (Tag tag : swf.getTags()) { + if (!(tag instanceof DefineSpriteTag)) continue; + DefineSpriteTag sprite = (DefineSpriteTag) tag; + for (Tag sub : sprite.getTags()) { + if (sub instanceof PlaceObject3Tag) { + PlaceObject3Tag po = (PlaceObject3Tag) sub; + if ("CheckboxResetEnd".equals(po.name)) { + System.out.println("CheckboxResetEnd already exists in " + inputPath + ", skipping."); + return; + } + if ("CheckboxResetNether".equals(po.name)) { + worldOptions = sprite; + resetNether = po; + } + } + } + } + if (resetNether == null) { + System.err.println("ERROR: Could not find CheckboxResetNether in " + inputPath); + System.exit(1); + } + + int maxDepth = 0; + int rowSpacing = 0; + Integer flatY = null, resetY = resetNether.matrix.translateY; + for (Tag sub : worldOptions.getTags()) { + if (sub instanceof PlaceObjectTypeTag) { + PlaceObjectTypeTag po = (PlaceObjectTypeTag) sub; + if (po.getDepth() > maxDepth) maxDepth = po.getDepth(); + if ("CheckboxFlatWorld".equals(po.getInstanceName())) flatY = po.getMatrix().translateY; + } + } + rowSpacing = flatY != null ? Math.abs(resetY - flatY) : 900; + + PlaceObject3Tag resetEnd = new PlaceObject3Tag(swf); + resetEnd.placeFlagHasClassName = resetNether.placeFlagHasClassName; + resetEnd.placeFlagHasName = true; + resetEnd.placeFlagHasMatrix = true; + resetEnd.placeFlagHasImage = resetNether.placeFlagHasImage; + resetEnd.placeFlagHasCharacter = resetNether.placeFlagHasCharacter; + resetEnd.placeFlagMove = resetNether.placeFlagMove; + resetEnd.className = resetNether.className; + resetEnd.characterId = resetNether.characterId; + resetEnd.name = "CheckboxResetEnd"; + resetEnd.depth = maxDepth + 1; + MATRIX m = new MATRIX(resetNether.matrix); + m.translateY += rowSpacing; + resetEnd.matrix = m; + resetEnd.setTimelined(worldOptions); + resetEnd.setModified(true); + + List subTags = worldOptions.getTags().toArrayList(); + int index = subTags.indexOf(resetNether); + worldOptions.addTag(index + 1, resetEnd); + worldOptions.setModified(true); + + System.out.println(inputPath + ": CheckboxResetEnd at Y=" + m.translateY + " depth=" + resetEnd.depth); + + try (FileOutputStream fos = new FileOutputStream(outputPath)) { + swf.saveTo(fos); + } + } +} diff --git a/tools/msscmp_list.ps1 b/tools/msscmp_list.ps1 new file mode 100644 index 00000000..ce8ae0fd --- /dev/null +++ b/tools/msscmp_list.ps1 @@ -0,0 +1,27 @@ +param([string]$Bank, [string]$Filter = '', [string]$OutDir = '') + +$data = [System.IO.File]::ReadAllBytes($Bank) +$text = [System.Text.Encoding]::GetEncoding(28591).GetString($data) +$pattern = 'Minecraft/([A-Za-z0-9_/]+)\x00\*(\d+)\*(\d+)\.binka' + +$seen = @{} +foreach ($m in [regex]::Matches($text, $pattern)) { + $name = $m.Groups[1].Value + if ($Filter -and $name -notlike "*$Filter*") { continue } + if ($seen.ContainsKey($name)) { continue } + $seen[$name] = 1 + $size = [int64]$m.Groups[2].Value + $off = [int64]$m.Groups[3].Value + if ($off + $size -gt $data.Length) { Write-Warning "$name is outside the bank"; continue } + + if ($OutDir) { + $path = Join-Path $OutDir ($name + '.binka') + New-Item -ItemType Directory -Force (Split-Path $path) | Out-Null + $buf = New-Object byte[] $size + [Array]::Copy($data, $off, $buf, 0, $size) + [System.IO.File]::WriteAllBytes($path, $buf) + } + else { + "$name $size $off" + } +} diff --git a/tools/patch_death_message.sh b/tools/patch_death_message.sh new file mode 100644 index 00000000..3b3917d8 --- /dev/null +++ b/tools/patch_death_message.sh @@ -0,0 +1,22 @@ +set -e +TOOLS="$(cd "$(dirname "$0")" && pwd -W)" +MEDIA="$TOOLS/../Minecraft.Client/Common/Media/MediaWindows64" +FFDEC_DIR="${FFDEC_DIR:-C:/Program Files (x86)/FFDec}" +WORK="$TOOLS/.death_message_work" +rm -rf "$WORK" + +javac -cp "$FFDEC_DIR/lib/*" -d "$TOOLS" "$TOOLS/AddDeathMessageLabel.java" + +for name in DeathMenu1080 DeathMenu720 DeathMenu480 DeathMenuSplit1080 DeathMenuSplit720; do + swf="$MEDIA/$name.swf" + out="$WORK/$name" + mkdir -p "$out" + java -cp "$FFDEC_DIR/lib/*;$TOOLS" AddDeathMessageLabel "$swf" "$out/step1.swf" + "$FFDEC_DIR/ffdec-cli.exe" -export script "$out/as" "$out/step1.swf" > /dev/null + doc="$out/as/scripts/fourj/documents/DeathMenu.as" + perl -0pi -e 's/(\n(\s*)public var Title:(\w+);)/$1\n$2\n$2public var DeathMessage:$3;/ or die "Title member not found\n"' "$doc" + "$FFDEC_DIR/ffdec-cli.exe" -importScript "$out/step1.swf" "$swf" "$out/as/scripts" +done + +rm -rf "$WORK" +echo "Done." diff --git a/tools/patch_reset_end.sh b/tools/patch_reset_end.sh new file mode 100644 index 00000000..7643a88f --- /dev/null +++ b/tools/patch_reset_end.sh @@ -0,0 +1,21 @@ +set -e +TOOLS="$(cd "$(dirname "$0")" && pwd -W)" +MEDIA="$TOOLS/../Minecraft.Client/Common/Media/MediaWindows64" +FFDEC_DIR="${FFDEC_DIR:-C:/Program Files (x86)/FFDec}" +WORK="$TOOLS/.reset_end_work" +rm -rf "$WORK" + +javac -cp "$FFDEC_DIR/lib/*" -d "$TOOLS" "$TOOLS/AddResetEndCheckbox.java" + +for res in 1080 720 480; do + swf="$MEDIA/LaunchMoreOptionsMenu$res.swf" + out="$WORK/$res" + mkdir -p "$out" + java -cp "$FFDEC_DIR/lib/*;$TOOLS" AddResetEndCheckbox "$swf" "$out/step1.swf" + "$FFDEC_DIR/ffdec-cli.exe" -export script "$out/as" "$out/step1.swf" > /dev/null + perl "$TOOLS/patch_reset_end_as.pl" "$out/as/scripts" + "$FFDEC_DIR/ffdec-cli.exe" -importScript "$out/step1.swf" "$swf" "$out/as/scripts" +done + +rm -rf "$WORK" +echo "Done." diff --git a/tools/patch_reset_end_as.pl b/tools/patch_reset_end_as.pl new file mode 100644 index 00000000..7e6b70fa --- /dev/null +++ b/tools/patch_reset_end_as.pl @@ -0,0 +1,42 @@ +use strict; +use warnings; +use File::Find; + +my $root = shift or die "usage: patch_reset_end_as.pl \n"; +my ($menu, $world); +find(sub { + $menu = $File::Find::name if $_ eq 'LaunchMoreOptionsMenu.as'; + $world = $File::Find::name if /^WorldOptions_\d+\.as$/; +}, $root); +die "LaunchMoreOptionsMenu.as not found\n" unless $menu; +die "WorldOptions_N.as not found\n" unless $world; + +sub slurp { local $/; open my $f, '<', $_[0] or die "$_[0]: $!"; my $s = <$f>; close $f; $s } +sub spit { open my $f, '>', $_[0] or die "$_[0]: $!"; print $f $_[1]; close $f } + +my $m = slurp($menu); +die "menu already patched\n" if $m =~ /CheckboxResetEnd/; +my $n = 0; + +$n += $m =~ s/(\n(\s*)WorldOptions\.CheckboxResetNether\.visible = WorldOptions\.CheckboxResetNether\.parent && WorldOptions\.visible;)/$1\n$2if(WorldOptions.CheckboxResetEnd)\n$2\{\n$2 WorldOptions.CheckboxResetEnd.visible = WorldOptions.CheckboxResetEnd.parent && WorldOptions.visible;\n$2\}/; + +$n += $m =~ s/(\n(\s*)if\(WorldOptions\.CheckboxResetNether\)\s*\n\s*\{\s*\n\s*WorldOptions\.CheckboxResetNether\.visible = false;\s*\n\s*RemoveObject\("CheckboxResetNether",false\);\s*\n\s*\})/$1\n$2if(WorldOptions.CheckboxResetEnd)\n$2\{\n$2 WorldOptions.CheckboxResetEnd.visible = false;\n$2 RemoveObject("CheckboxResetEnd",false);\n$2\}/; + +$n += $m =~ s/(\n(\s*)WorldOptions\.CheckboxResetNether\.y = _loc3_;)/$1\n$2WorldOptions.CheckboxResetEnd.y = WorldOptions.CheckboxResetNether.y + _loc4_;/; +my $moved = ($m =~ s/= WorldOptions\.CheckboxResetNether\.y \+ _loc4_;/= WorldOptions.CheckboxResetEnd.y + _loc4_;/g); +$m =~ s/WorldOptions\.CheckboxResetEnd\.y = WorldOptions\.CheckboxResetEnd\.y \+ _loc4_;/WorldOptions.CheckboxResetEnd.y = WorldOptions.CheckboxResetNether.y + _loc4_;/; +die "menu patch failed ($n edits, $moved moves)\n" unless $n == 3 && $moved >= 2; +spit($menu, $m); + +my $w = slurp($world); +die "world options already patched\n" if $w =~ /CheckboxResetEnd/; +my $k = 0; +$k += $w =~ s/(\n(\s*)public var CheckboxResetNether:(\w+);)/$1\n$2\n$2public var CheckboxResetEnd:$3;/; +$k += $w =~ s/(CheckboxResetNether\.m_objNavDown = )"CheckboxDisableSaving";/$1"CheckboxResetEnd";/; +$k += $w =~ s/(CheckboxDisableSaving\.m_objNavUp = )"CheckboxResetNether";/$1"CheckboxResetEnd";/; +$k += $w =~ s/(\n(\s*)__setProp_CheckboxResetNether_(\w+)\(\);)/$1\n$2__setProp_CheckboxResetEnd();/; +$k += $w =~ s/(\n(\s*)internal function __setProp_CheckboxResetNether_)/\n$2internal function __setProp_CheckboxResetEnd() : *\n$2\{\n$2 CheckboxResetEnd.m_objNavDown = "CheckboxDisableSaving";\n$2 CheckboxResetEnd.m_objNavLeft = "";\n$2 CheckboxResetEnd.m_objNavRight = "";\n$2 CheckboxResetEnd.m_objNavUp = "CheckboxResetNether";\n$2\}\n$2$1/; +die "world options patch failed ($k edits)\n" unless $k == 5; +spit($world, $w); + +print "patched $menu and $world\n"; diff --git a/tools/structures/endcity/base_floor.nbt b/tools/structures/endcity/base_floor.nbt new file mode 100644 index 00000000..8ba8c3ea Binary files /dev/null and b/tools/structures/endcity/base_floor.nbt differ diff --git a/tools/structures/endcity/base_roof.nbt b/tools/structures/endcity/base_roof.nbt new file mode 100644 index 00000000..b812e6f4 Binary files /dev/null and b/tools/structures/endcity/base_roof.nbt differ diff --git a/tools/structures/endcity/bridge_end.nbt b/tools/structures/endcity/bridge_end.nbt new file mode 100644 index 00000000..e64326a4 Binary files /dev/null and b/tools/structures/endcity/bridge_end.nbt differ diff --git a/tools/structures/endcity/bridge_gentle_stairs.nbt b/tools/structures/endcity/bridge_gentle_stairs.nbt new file mode 100644 index 00000000..b6b851f8 Binary files /dev/null and b/tools/structures/endcity/bridge_gentle_stairs.nbt differ diff --git a/tools/structures/endcity/bridge_piece.nbt b/tools/structures/endcity/bridge_piece.nbt new file mode 100644 index 00000000..9b045ee0 Binary files /dev/null and b/tools/structures/endcity/bridge_piece.nbt differ diff --git a/tools/structures/endcity/bridge_steep_stairs.nbt b/tools/structures/endcity/bridge_steep_stairs.nbt new file mode 100644 index 00000000..25228a96 Binary files /dev/null and b/tools/structures/endcity/bridge_steep_stairs.nbt differ diff --git a/tools/structures/endcity/fat_tower_base.nbt b/tools/structures/endcity/fat_tower_base.nbt new file mode 100644 index 00000000..96330d2a Binary files /dev/null and b/tools/structures/endcity/fat_tower_base.nbt differ diff --git a/tools/structures/endcity/fat_tower_middle.nbt b/tools/structures/endcity/fat_tower_middle.nbt new file mode 100644 index 00000000..3f97253b Binary files /dev/null and b/tools/structures/endcity/fat_tower_middle.nbt differ diff --git a/tools/structures/endcity/fat_tower_top.nbt b/tools/structures/endcity/fat_tower_top.nbt new file mode 100644 index 00000000..9041a9d0 Binary files /dev/null and b/tools/structures/endcity/fat_tower_top.nbt differ diff --git a/tools/structures/endcity/second_floor.nbt b/tools/structures/endcity/second_floor.nbt new file mode 100644 index 00000000..09fb2c86 Binary files /dev/null and b/tools/structures/endcity/second_floor.nbt differ diff --git a/tools/structures/endcity/second_floor_2.nbt b/tools/structures/endcity/second_floor_2.nbt new file mode 100644 index 00000000..aec99d9f Binary files /dev/null and b/tools/structures/endcity/second_floor_2.nbt differ diff --git a/tools/structures/endcity/second_roof.nbt b/tools/structures/endcity/second_roof.nbt new file mode 100644 index 00000000..bcf3d2e2 Binary files /dev/null and b/tools/structures/endcity/second_roof.nbt differ diff --git a/tools/structures/endcity/ship.nbt b/tools/structures/endcity/ship.nbt new file mode 100644 index 00000000..9c73dba3 Binary files /dev/null and b/tools/structures/endcity/ship.nbt differ diff --git a/tools/structures/endcity/third_floor.nbt b/tools/structures/endcity/third_floor.nbt new file mode 100644 index 00000000..f2fabf43 Binary files /dev/null and b/tools/structures/endcity/third_floor.nbt differ diff --git a/tools/structures/endcity/third_floor_b.nbt b/tools/structures/endcity/third_floor_b.nbt new file mode 100644 index 00000000..89908686 Binary files /dev/null and b/tools/structures/endcity/third_floor_b.nbt differ diff --git a/tools/structures/endcity/third_floor_c.nbt b/tools/structures/endcity/third_floor_c.nbt new file mode 100644 index 00000000..195065ea Binary files /dev/null and b/tools/structures/endcity/third_floor_c.nbt differ diff --git a/tools/structures/endcity/third_roof.nbt b/tools/structures/endcity/third_roof.nbt new file mode 100644 index 00000000..5c023816 Binary files /dev/null and b/tools/structures/endcity/third_roof.nbt differ diff --git a/tools/structures/endcity/tower_base.nbt b/tools/structures/endcity/tower_base.nbt new file mode 100644 index 00000000..6e945880 Binary files /dev/null and b/tools/structures/endcity/tower_base.nbt differ diff --git a/tools/structures/endcity/tower_floor.nbt b/tools/structures/endcity/tower_floor.nbt new file mode 100644 index 00000000..ce62231f Binary files /dev/null and b/tools/structures/endcity/tower_floor.nbt differ diff --git a/tools/structures/endcity/tower_piece.nbt b/tools/structures/endcity/tower_piece.nbt new file mode 100644 index 00000000..67422922 Binary files /dev/null and b/tools/structures/endcity/tower_piece.nbt differ diff --git a/tools/structures/endcity/tower_top.nbt b/tools/structures/endcity/tower_top.nbt new file mode 100644 index 00000000..2684fb29 Binary files /dev/null and b/tools/structures/endcity/tower_top.nbt differ diff --git a/tools/structures/endcity_templates.ps1 b/tools/structures/endcity_templates.ps1 new file mode 100644 index 00000000..8fd7938f --- /dev/null +++ b/tools/structures/endcity_templates.ps1 @@ -0,0 +1,77 @@ +$ErrorActionPreference = 'Stop' +$root = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) +. (Join-Path $PSScriptRoot 'nbt.ps1') + +$names = @( + 'base_floor', 'base_roof', 'bridge_end', 'bridge_gentle_stairs', 'bridge_piece', 'bridge_steep_stairs', + 'fat_tower_base', 'fat_tower_middle', 'fat_tower_top', 'second_floor', 'second_floor_2', 'second_roof', + 'ship', 'third_floor', 'third_floor_b', 'third_floor_c', 'third_roof', 'tower_base', 'tower_floor', + 'tower_piece', 'tower_top') + +$out = New-Object System.Text.StringBuilder +[void]$out.AppendLine('// Generated by tools/structures/endcity_templates.ps1 from the Java 1.9 end city') +[void]$out.AppendLine('// templates. Do not edit by hand.') +[void]$out.AppendLine('#include "stdafx.h"') +[void]$out.AppendLine('#include "EndCityTemplates.h"') +[void]$out.AppendLine('') + +$table = @() +foreach ($name in $names) { + $n = Read-Nbt (Join-Path $PSScriptRoot "endcity\$name.nbt") + $size = $n['size'] + $blocks = New-Object System.Collections.Generic.List[string] + $extras = New-Object System.Collections.Generic.List[string] + + foreach ($b in $n['blocks']) { + $p = $b['pos'] + $st = [int]$b['state'] + $id = $st -band 0xFFF + $data = $st -shr 12 + $nbt = $null + if ($b.Contains('nbt')) { $nbt = $b['nbt'] } + + if ($id -eq 255) { + $marker = [string]$nbt['metadata'] + $kind = $null + if ($marker.StartsWith('Chest')) { $kind = 'EXTRA_CHEST_LOOT' } + elseif ($marker.StartsWith('Sentry')) { $kind = 'EXTRA_SENTRY' } + elseif ($marker.StartsWith('Elytra')) { $kind = 'EXTRA_ELYTRA' } + if ($kind) { $extras.Add("{$($p[0]),$($p[1]),$($p[2]),EndCityTemplates::$kind,0}") } + # Like in actual LCE and even in java , structure blocks themselves should never placed. + continue + } + elseif ($nbt -ne $null) { + switch ([string]$nbt['id']) { + 'Banner' { $extras.Add("{$($p[0]),$($p[1]),$($p[2]),EndCityTemplates::EXTRA_BANNER,$($nbt['Base'])}") } + 'Skull' { $extras.Add("{$($p[0]),$($p[1]),$($p[2]),EndCityTemplates::EXTRA_SKULL,$($nbt['SkullType'])}") } + 'Cauldron' { $extras.Add("{$($p[0]),$($p[1]),$($p[2]),EndCityTemplates::EXTRA_HEALING_POTIONS,0}") } + } + } + $blocks.Add("{$($p[0]),$($p[1]),$($p[2]),$id,$data}") + } + + [void]$out.AppendLine("static const EndCityTemplates::Block s_${name}_blocks[] = {") + for ($i = 0; $i -lt $blocks.Count; $i += 16) { + $line = ($blocks.GetRange($i, [Math]::Min(16, $blocks.Count - $i)) -join ',') + [void]$out.AppendLine("`t$line,") + } + [void]$out.AppendLine('};') + $extraRef = 'nullptr, 0' + if ($extras.Count -gt 0) { + [void]$out.AppendLine("static const EndCityTemplates::Extra s_${name}_extras[] = {") + [void]$out.AppendLine("`t" + ($extras -join ',') + ',') + [void]$out.AppendLine('};') + $extraRef = "s_${name}_extras, $($extras.Count)" + } + [void]$out.AppendLine('') + $table += "`t{ L`"$name`", $($size[0]), $($size[1]), $($size[2]), s_${name}_blocks, $($blocks.Count), $extraRef }," +} + +[void]$out.AppendLine('const EndCityTemplates::Template EndCityTemplates::TEMPLATES[EndCityTemplates::COUNT] =') +[void]$out.AppendLine('{') +foreach ($t in $table) { [void]$out.AppendLine($t) } +[void]$out.AppendLine('};') + +$text = $out.ToString() -replace "`r?`n", "`r`n" +[System.IO.File]::WriteAllText((Join-Path $root 'Minecraft.World\EndCityTemplates.cpp'), $text, (New-Object System.Text.UTF8Encoding($false))) +Write-Host "Wrote $($names.Count) templates" diff --git a/tools/structures/nbt.ps1 b/tools/structures/nbt.ps1 new file mode 100644 index 00000000..96b3f209 --- /dev/null +++ b/tools/structures/nbt.ps1 @@ -0,0 +1,37 @@ +Add-Type -AssemblyName System.IO.Compression + +$script:buf = $null +$script:pos = 0 + +function RdU8 { $v = $script:buf[$script:pos]; $script:pos += 1; return [int]$v } +function RdI16 { $v = ([int]$script:buf[$script:pos] -shl 8) -bor $script:buf[$script:pos+1]; $script:pos += 2; if ($v -ge 32768) { $v -= 65536 }; return $v } +function RdI32 { $b = $script:buf; $p = $script:pos; $v = ([int64]$b[$p] -shl 24) -bor ([int64]$b[$p+1] -shl 16) -bor ([int64]$b[$p+2] -shl 8) -bor [int64]$b[$p+3]; $script:pos += 4; if ($v -ge 2147483648) { $v -= 4294967296 }; return [int]$v } +function RdI64 { $hi = RdI32; $lo = RdI32; return ([int64]$hi -shl 32) -bor ([int64]$lo -band 0xFFFFFFFF) } +function RdStr { $n = (RdI16) -band 0xFFFF; $s = [System.Text.Encoding]::UTF8.GetString($script:buf, $script:pos, $n); $script:pos += $n; return $s } + +function RdPayload([int]$type) { + switch ($type) { + 1 { $v = RdU8; if ($v -ge 128) { $v -= 256 }; return $v } + 2 { return RdI16 } + 3 { return RdI32 } + 4 { return RdI64 } + 5 { $i = RdI32; return [BitConverter]::ToSingle([BitConverter]::GetBytes($i), 0) } + 6 { $l = RdI64; return [BitConverter]::Int64BitsToDouble($l) } + 7 { $n = RdI32; $a = New-Object byte[] $n; [Array]::Copy($script:buf, $script:pos, $a, 0, $n); $script:pos += $n; return ,$a } + 8 { return RdStr } + 9 { $et = RdU8; $n = RdI32; $list = New-Object System.Collections.ArrayList; for ($i = 0; $i -lt $n; $i++) { [void]$list.Add((RdPayload $et)) }; return ,$list } + 10 { $h = [ordered]@{}; while ($true) { $t = RdU8; if ($t -eq 0) { break }; $name = RdStr; $h[$name] = RdPayload $t }; return $h } + 11 { $n = RdI32; $a = @(); for ($i = 0; $i -lt $n; $i++) { $a += RdI32 }; return ,$a } + } + throw "bad tag $type" +} + +function Read-Nbt([string]$path) { + $fs = [System.IO.File]::OpenRead($path) + $gz = New-Object System.IO.Compression.GZipStream($fs, [System.IO.Compression.CompressionMode]::Decompress) + $ms = New-Object System.IO.MemoryStream + $gz.CopyTo($ms); $gz.Close(); $fs.Close() + $script:buf = $ms.ToArray(); $script:pos = 0 + $t = RdU8; $null = RdStr + return RdPayload $t +}