diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/SkyIslandDimension.cpp | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/SkyIslandDimension.cpp')
| -rw-r--r-- | Minecraft.World/SkyIslandDimension.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/Minecraft.World/SkyIslandDimension.cpp b/Minecraft.World/SkyIslandDimension.cpp new file mode 100644 index 00000000..0746c92c --- /dev/null +++ b/Minecraft.World/SkyIslandDimension.cpp @@ -0,0 +1,63 @@ +#include "stdafx.h" +#include "SkyIslandDimension.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.biome.h" +#include "net.minecraft.world.level.tile.h" +#include "net.minecraft.world.level.levelgen.h" + +void SkyIslandDimension::init() +{ + biomeSource = new FixedBiomeSource(Biome::sky, 0.5f, 0); + id = 1; +} + +ChunkSource *SkyIslandDimension::createRandomLevelSource() const +{ + return new SkyIslandRandomLevelSource(level, level->getSeed()); +} + +float SkyIslandDimension::getTimeOfDay(__int64 time, float a) const +{ + return 0.0f; +} + +float *SkyIslandDimension::getSunriseColor(float td, float a) +{ + return NULL; +} + +Vec3 *SkyIslandDimension::getFogColor(float td, float a) const +{ + int fogColor = 0x8080a0; + float br = Mth::cos(td * PI * 2) * 2 + 0.5f; + if (br < 0.0f) br = 0.0f; + if (br > 1.0f) br = 1.0f; + + float r = ((fogColor >> 16) & 0xff) / 255.0f; + float g = ((fogColor >> 8) & 0xff) / 255.0f; + float b = ((fogColor) & 0xff) / 255.0f; + r *= br * 0.94f + 0.06f; + g *= br * 0.94f + 0.06f; + b *= br * 0.91f + 0.09f; + + return Vec3::newTemp(r, g, b); +} + +bool SkyIslandDimension::hasGround() +{ + return false; +} + +float SkyIslandDimension::getCloudHeight() +{ + return 8; +} + +bool SkyIslandDimension::isValidSpawn(int x, int z) const +{ + int topTile = level->getTopTile(x, z); + + if (topTile == 0) return false; + + return Tile::tiles[topTile]->material->blocksMotion(); +}
\ No newline at end of file |
