diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index e612ac34..953d0366 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -182,7 +182,10 @@ bool UIScene::needsReloaded() const bool shouldUse1080 = SceneShouldUse1080p(moviePath); if(shouldUse1080 && m_loadedResolution != eSceneResolution_1080) - return true; + { + if(app.hasArchiveFile(getMoviePath() + L"1080.swf")) + return true; + } if(!shouldUse1080 && m_loadedResolution == eSceneResolution_1080) return true; } diff --git a/Minecraft.Client/PlayerRenderer.cpp b/Minecraft.Client/PlayerRenderer.cpp index d5ad2eb4..92d5c9b1 100644 --- a/Minecraft.Client/PlayerRenderer.cpp +++ b/Minecraft.Client/PlayerRenderer.cpp @@ -448,7 +448,9 @@ void PlayerRenderer::additionalRendering(shared_ptr _mob, float a) /*boolean loaded = mob->getCloakTexture()->isLoaded(); boolean b1 = !mob->isInvisible(); boolean b2 = !mob->isCapeHidden();*/ - if (bindTexture(mob->customTextureUrl2, L"") && !mob->isInvisible()) + shared_ptr capeChestItem = mob->inventory->armor[LivingEntity::SLOT_CHEST - 1]; + bool wearingElytra = capeChestItem != nullptr && dynamic_cast(capeChestItem->getItem()) != nullptr; + if (!wearingElytra && bindTexture(mob->customTextureUrl2, L"") && !mob->isInvisible()) { glPushMatrix(); glTranslatef(0, 0, 2 / 16.0f); @@ -479,6 +481,13 @@ void PlayerRenderer::additionalRendering(shared_ptr _mob, float a) // 4J Stu - Fix for sprint-flying causing the cape to rotate up by 180 degrees or more float xRot = 6.0f + lean / 2 + flap; + const float kneeRot = 70.0f; + const float maxRot = 90.0f; + if (mob->abilities.flying && xRot > kneeRot) + { + float over = xRot - kneeRot; + xRot = kneeRot + (maxRot - kneeRot) * (over / (over + (maxRot - kneeRot))); + } glRotatef(xRot, 1, 0, 0); glRotatef(lean2 / 2, 0, 0, 1); glRotatef(-lean2 / 2, 0, 1, 0); diff --git a/Minecraft.World/CustomLevelSource.cpp b/Minecraft.World/CustomLevelSource.cpp index 991c1b1e..e4f80602 100644 --- a/Minecraft.World/CustomLevelSource.cpp +++ b/Minecraft.World/CustomLevelSource.cpp @@ -569,7 +569,7 @@ void CustomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) } PIXEndNamedEvent(); - if (true) + if (pprandom->nextInt(64) == 0) { int fx = xo + pprandom->nextInt(16) + 8; int fy = 40 + pprandom->nextInt(10); diff --git a/Minecraft.World/FossilFeature.cpp b/Minecraft.World/FossilFeature.cpp index 1760e847..41aef516 100644 --- a/Minecraft.World/FossilFeature.cpp +++ b/Minecraft.World/FossilFeature.cpp @@ -206,15 +206,26 @@ static const FossilStructure spineStructures[4] = { bool FossilFeature::place(Level *level, Random *random, int x, int y, int z) { bool useSpine = random->nextInt(2) == 0; - bool useCoal = random->nextInt(2) == 0; int variant = random->nextInt(4); const FossilStructure &s = useSpine ? spineStructures[variant] : skullStructures[variant]; int ox = x - s.width / 2; - int oy = y; int oz = z - s.length / 2; + int surface = Level::maxBuildHeight; + for (int dx = 0; dx < s.width; dx++) + for (int dz = 0; dz < s.length; dz++) + { + int h = level->getHeightmap(ox + dx, oz + dz); + if (h > 0 && h < surface) surface = h; + } + if (surface >= Level::maxBuildHeight) + surface = level->getSeaLevel(); + + int oy = surface - 15 - random->nextInt(10); + if (oy < 10) oy = 10; + for (int i = 0; i < s.blockCount; i++) { const FossilBlock &b = s.blocks[i]; @@ -225,7 +236,13 @@ bool FossilFeature::place(Level *level, Random *random, int x, int y, int z) if (by < 1 || by >= Level::maxBuildHeight) continue; - if (useCoal) + if (level->getMaterial(bx, by, bz)->isLiquid()) + continue; + + int roll = random->nextInt(10); + if (roll == 1) + continue; + else if (roll == 0) level->setTileAndData(bx, by, bz, Tile::coal_ore_Id, 0, Tile::UPDATE_CLIENTS); else level->setTileAndData(bx, by, bz, Tile::bone_block_Id, b.data, Tile::UPDATE_CLIENTS); diff --git a/Minecraft.World/HellRandomLevelSource.cpp b/Minecraft.World/HellRandomLevelSource.cpp index a20f5d64..6a5cec0b 100644 --- a/Minecraft.World/HellRandomLevelSource.cpp +++ b/Minecraft.World/HellRandomLevelSource.cpp @@ -491,7 +491,7 @@ void HellRandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) for (int i = 0; i < 4; i++) { int x = xo + pprandom->nextInt(16); - int y = pprandom->nextInt(9) + 27; + int y = pprandom->nextInt(10) + 27; int z = zo + pprandom->nextInt(16); magmaFeature.place(level, pprandom, x, y, z); } diff --git a/Minecraft.World/IglooFeature.cpp b/Minecraft.World/IglooFeature.cpp index f8430da0..3b06347e 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->setPersistenceRequired(); zombieVillager->moveTo(x - 1 + 0.5, by + 1, rz + 3 + 0.5, 0, 0); level->addEntity(zombieVillager); diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index 82af814c..b517ce8c 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -2162,7 +2162,7 @@ void Player::travel(float xa, float ya) m_elytraImpactYd = (float)yd; - if (isElytraFlying() && riding == nullptr) + if (isElytraFlying() && riding == nullptr && !isInWater() && !isInLava()) { double preHorizSpeed = Mth::sqrt(xd * xd + zd * zd); diff --git a/Minecraft.World/RandomLevelSource.cpp b/Minecraft.World/RandomLevelSource.cpp index 287263a6..84a71b6e 100644 --- a/Minecraft.World/RandomLevelSource.cpp +++ b/Minecraft.World/RandomLevelSource.cpp @@ -791,13 +791,24 @@ void RandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) fossil.place(level, pprandom, fx, fy, fz); } - if (pprandom->nextInt(48) == 0) { - int ix = xo + pprandom->nextInt(16) + 8; - int iy = level->maxBuildHeight; - int iz = zo + pprandom->nextInt(16) + 8; - IglooFeature igloo; - igloo.place(level, pprandom, ix, iy, iz); + int rx = xt; + int rz = zt; + if (rx < 0) rx -= 31; + if (rz < 0) rz -= 31; + int regionX = rx / 32; + int regionZ = rz / 32; + Random featureRand(regionX * 341873128712LL + regionZ * 132897987541LL + level->getSeed() + 14357617LL); + int candX = regionX * 32 + featureRand.nextInt(32 - 8); + int candZ = regionZ * 32 + featureRand.nextInt(32 - 8); + if (xt == candX && zt == candZ) + { + int ix = xo + pprandom->nextInt(16) + 8; + int iy = level->maxBuildHeight; + int iz = zo + pprandom->nextInt(16) + 8; + IglooFeature igloo; + igloo.place(level, pprandom, ix, iy, iz); + } } PIXBeginNamedEvent(0,"Biome decorate"); diff --git a/cmake/ServerTarget.cmake b/cmake/ServerTarget.cmake index 8fb7d283..a87cca47 100644 --- a/cmake/ServerTarget.cmake +++ b/cmake/ServerTarget.cmake @@ -116,6 +116,19 @@ function(configure_lce_server_target target) setup_asset_folder_copy(${target} "${_asset_folder_pairs}") #setup_asset_file_copy(${target} "${_asset_files_pairs}") + 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 + COMMAND ${CMAKE_COMMAND} -E make_directory "${_loot_tables_dest}" + COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different + "${_loot_tables_source}" + "${_loot_tables_dest}" + COMMENT "Copying loot table XML assets into server build folder..." + VERBATIM + ) + add_dependencies(${target} AssetLootTablesCopy_${target}) + set_property(TARGET AssetLootTablesCopy_${target} PROPERTY FOLDER "Build") + if(PLATFORM_NAME STREQUAL "Windows64") add_custom_target(AssetLocalizationCopy_${target} ALL COMMAND ${CMAKE_COMMAND}