reimplement aether stuff from personal repo
@@ -340,4 +340,5 @@ ASALocalRun/
|
||||
# Release folder (thats on my computer - Whisper)
|
||||
x64_Release/
|
||||
|
||||
|
||||
# aether asset stuff
|
||||
Minecraft.Client/Common/res/TitleUpdate/res/aether_temp
|
||||
|
||||
@@ -2493,6 +2493,14 @@ void ClientConnection::handleRespawn(shared_ptr<RespawnPacket> packet)
|
||||
{
|
||||
param->stringId = IDS_PROGRESS_LEAVING_END;
|
||||
}
|
||||
else if( packet->dimension == 2)
|
||||
{
|
||||
param->stringId = IDS_PROGRESS_ENTERING_AETHER;
|
||||
}
|
||||
else if( oldDimension == 2)
|
||||
{
|
||||
param->stringId = IDS_PROGRESS_LEAVING_AETHER;
|
||||
}
|
||||
param->showTooltips = false;
|
||||
param->setFailTimer = false;
|
||||
|
||||
|
||||
@@ -218,6 +218,7 @@ enum eMinecraftColour
|
||||
eMinecraftColour_Foliage_ExtremeHillsEdge,
|
||||
eMinecraftColour_Foliage_Jungle,
|
||||
eMinecraftColour_Foliage_JungleHills,
|
||||
eMinecraftColour_Foliage_Aether,
|
||||
|
||||
eMinecraftColour_Grass_Common,
|
||||
eMinecraftColour_Grass_Ocean,
|
||||
@@ -243,6 +244,7 @@ enum eMinecraftColour
|
||||
eMinecraftColour_Grass_ExtremeHillsEdge,
|
||||
eMinecraftColour_Grass_Jungle,
|
||||
eMinecraftColour_Grass_JungleHills,
|
||||
eMinecraftColour_Grass_Aether,
|
||||
|
||||
eMinecraftColour_Water_Ocean,
|
||||
eMinecraftColour_Water_Plains,
|
||||
@@ -267,6 +269,7 @@ enum eMinecraftColour
|
||||
eMinecraftColour_Water_ExtremeHillsEdge,
|
||||
eMinecraftColour_Water_Jungle,
|
||||
eMinecraftColour_Water_JungleHills,
|
||||
eMinecraftColour_Water_Aether,
|
||||
|
||||
eMinecraftColour_Sky_Ocean,
|
||||
eMinecraftColour_Sky_Plains,
|
||||
@@ -291,6 +294,7 @@ enum eMinecraftColour
|
||||
eMinecraftColour_Sky_ExtremeHillsEdge,
|
||||
eMinecraftColour_Sky_Jungle,
|
||||
eMinecraftColour_Sky_JungleHills,
|
||||
eMinecraftColour_Sky_Aether,
|
||||
|
||||
eMinecraftColour_Tile_RedstoneDust,
|
||||
eMinecraftColour_Tile_RedstoneDustUnlit,
|
||||
|
||||
@@ -35,6 +35,7 @@ wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] =
|
||||
L"Foliage_ExtremeHillsEdge",
|
||||
L"Foliage_Jungle",
|
||||
L"Foliage_JungleHills",
|
||||
L"Foliage_Aether",
|
||||
|
||||
L"Grass_Common",
|
||||
L"Grass_Ocean",
|
||||
@@ -60,6 +61,7 @@ wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] =
|
||||
L"Grass_ExtremeHillsEdge",
|
||||
L"Grass_Jungle",
|
||||
L"Grass_JungleHills",
|
||||
L"Grass_Aether",
|
||||
|
||||
L"Water_Ocean",
|
||||
L"Water_Plains",
|
||||
@@ -84,6 +86,7 @@ wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] =
|
||||
L"Water_ExtremeHillsEdge",
|
||||
L"Water_Jungle",
|
||||
L"Water_JungleHills",
|
||||
L"Water_Aether",
|
||||
|
||||
L"Sky_Ocean",
|
||||
L"Sky_Plains",
|
||||
@@ -108,6 +111,7 @@ wchar_t *ColourTable::ColourTableElements[eMinecraftColour_COUNT] =
|
||||
L"Sky_ExtremeHillsEdge",
|
||||
L"Sky_Jungle",
|
||||
L"Sky_JungleHills",
|
||||
L"Sky_Aether",
|
||||
|
||||
L"Tile_RedstoneDust",
|
||||
L"Tile_RedstoneDustUnlit",
|
||||
|
||||
@@ -3259,7 +3259,7 @@ void CMinecraftApp::HandleXuiActions(void)
|
||||
bool gameStarted = false;
|
||||
for(int i = 0; i < pMinecraft->levels.length; i++)
|
||||
{
|
||||
if (pMinecraft->levels.data[i] != NULL)
|
||||
if (pMinecraft->levels.data[i] != nullptr)
|
||||
{
|
||||
gameStarted = true;
|
||||
break;
|
||||
@@ -4197,6 +4197,107 @@ void CMinecraftApp::loadStringTable()
|
||||
byteArray locFile = m_mediaArchive->getFile(localisationFile);
|
||||
m_stringTable = new StringTable(locFile.data, locFile.length);
|
||||
delete locFile.data;
|
||||
|
||||
// Register Aether strings
|
||||
m_stringTable->registerString(IDS_PROGRESS_ENTERING_AETHER, L"Entering the Aether");
|
||||
m_stringTable->registerString(IDS_PROGRESS_LEAVING_AETHER, L"Leaving the Aether");
|
||||
m_stringTable->registerString(IDS_TILE_AETHER_GRASS, L"Aether Grass");
|
||||
m_stringTable->registerString(IDS_TILE_AETHER_DIRT, L"Aether Dirt");
|
||||
m_stringTable->registerString(IDS_TILE_HOLYSTONE, L"Holystone");
|
||||
m_stringTable->registerString(IDS_TILE_MOSSY_HOLYSTONE, L"Mossy Holystone");
|
||||
m_stringTable->registerString(IDS_TILE_AMBROSIUM_ORE, L"Ambrosium Ore");
|
||||
m_stringTable->registerString(IDS_TILE_ZANITE_ORE, L"Zanite Ore");
|
||||
m_stringTable->registerString(IDS_TILE_GRAVITITE_ORE, L"Gravitite Ore");
|
||||
m_stringTable->registerString(IDS_TILE_SKYROOT_LOG, L"Skyroot Log");
|
||||
m_stringTable->registerString(IDS_TILE_SKYROOT_PLANKS, L"Skyroot Planks");
|
||||
m_stringTable->registerString(IDS_TILE_SKYROOT_LEAVES, L"Skyroot Leaves");
|
||||
m_stringTable->registerString(IDS_TILE_GOLDEN_OAK_LOG, L"Golden Oak Log");
|
||||
m_stringTable->registerString(IDS_TILE_GOLDEN_OAK_LEAVES, L"Golden Oak Leaves");
|
||||
m_stringTable->registerString(IDS_TILE_QUICKSOIL, L"Quicksoil");
|
||||
m_stringTable->registerString(IDS_TILE_QUICKSOIL_GLASS, L"Quicksoil Glass");
|
||||
m_stringTable->registerString(IDS_TILE_AERCLOUD, L"Aercloud");
|
||||
m_stringTable->registerString(IDS_TILE_AEROGEL, L"Aerogel");
|
||||
m_stringTable->registerString(IDS_TILE_ICESTONE, L"Icestone");
|
||||
m_stringTable->registerString(IDS_TILE_AMBROSIUM_TORCH, L"Ambrosium Torch");
|
||||
m_stringTable->registerString(IDS_TILE_SKYROOT_SAPLING, L"Skyroot Sapling");
|
||||
m_stringTable->registerString(IDS_TILE_GOLDEN_OAK_SAPLING, L"Golden Oak Sapling");
|
||||
m_stringTable->registerString(IDS_TILE_PURPLE_FLOWER, L"Purple Flower");
|
||||
m_stringTable->registerString(IDS_TILE_WHITE_FLOWER, L"White Flower");
|
||||
m_stringTable->registerString(IDS_TILE_ANGELIC_STONE, L"Angelic Stone");
|
||||
m_stringTable->registerString(IDS_TILE_LIGHT_ANGELIC_STONE, L"Light Angelic Stone");
|
||||
m_stringTable->registerString(IDS_TILE_CARVED_STONE, L"Carved Stone");
|
||||
m_stringTable->registerString(IDS_TILE_LIGHT_CARVED_STONE, L"Light Carved Stone");
|
||||
m_stringTable->registerString(IDS_TILE_HELLFIRE_STONE, L"Hellfire Stone");
|
||||
m_stringTable->registerString(IDS_TILE_LIGHT_HELLFIRE_STONE, L"Light Hellfire Stone");
|
||||
m_stringTable->registerString(IDS_TILE_PILLAR, L"Pillar");
|
||||
m_stringTable->registerString(IDS_TILE_PILLAR_CARVED, L"Carved Pillar");
|
||||
m_stringTable->registerString(IDS_TILE_ENCHANTER, L"Enchanter");
|
||||
m_stringTable->registerString(IDS_TILE_FREEZER, L"Freezer");
|
||||
m_stringTable->registerString(IDS_TILE_INCUBATOR, L"Incubator");
|
||||
m_stringTable->registerString(IDS_TILE_LIBRARY_LORE, L"Book of Lore");
|
||||
m_stringTable->registerString(IDS_TILE_GOLD_AERCLOUD, L"Gold Aercloud");
|
||||
m_stringTable->registerString(IDS_TILE_BLUE_AERCLOUD, L"Blue Aercloud");
|
||||
|
||||
// Aether Items
|
||||
m_stringTable->registerString(IDS_ITEM_AMBROSIUM_SHARD, L"Ambrosium Shard");
|
||||
m_stringTable->registerString(IDS_ITEM_ZANITE_GEMSTONE, L"Zanite Gemstone");
|
||||
m_stringTable->registerString(IDS_ITEM_FLAMING_GEMSTONE, L"Flaming Gemstone");
|
||||
m_stringTable->registerString(IDS_ITEM_SKYROOT_STICK, L"Skyroot Stick");
|
||||
m_stringTable->registerString(IDS_ITEM_AECHOR_PETAL, L"Aechor Petal");
|
||||
m_stringTable->registerString(IDS_ITEM_GOLDEN_AMBER, L"Golden Amber");
|
||||
m_stringTable->registerString(IDS_ITEM_GUMMIE_SWET, L"Gummie Swet");
|
||||
m_stringTable->registerString(IDS_ITEM_LIFE_SHARD, L"Life Shard");
|
||||
m_stringTable->registerString(IDS_ITEM_REGENERATION_STONE, L"Regeneration Stone");
|
||||
m_stringTable->registerString(IDS_ITEM_MOA_EGG, L"Moa Egg");
|
||||
m_stringTable->registerString(IDS_ITEM_GOLDEN_FEATHER, L"Golden Feather");
|
||||
m_stringTable->registerString(IDS_ITEM_AETHER_KEY, L"Key");
|
||||
m_stringTable->registerString(IDS_ITEM_SKYROOT_BUCKET, L"Skyroot Bucket");
|
||||
m_stringTable->registerString(IDS_ITEM_SKYROOT_BUCKET_WATER, L"Skyroot Water Bucket");
|
||||
m_stringTable->registerString(IDS_ITEM_SKYROOT_BUCKET_MILK, L"Skyroot Milk Bucket");
|
||||
m_stringTable->registerString(IDS_ITEM_SKYROOT_BUCKET_POISON, L"Skyroot Poison Bucket");
|
||||
m_stringTable->registerString(IDS_ITEM_DART_GOLDEN, L"Golden Dart");
|
||||
m_stringTable->registerString(IDS_ITEM_DART_ENCHANTED, L"Enchanted Dart");
|
||||
m_stringTable->registerString(IDS_ITEM_DART_POISON, L"Poison Dart");
|
||||
m_stringTable->registerString(IDS_ITEM_DART_SHOOTER, L"Dart Shooter");
|
||||
m_stringTable->registerString(IDS_ITEM_DART_SHOOTER_ENCHANTED, L"Enchanted Dart Shooter");
|
||||
m_stringTable->registerString(IDS_ITEM_DART_SHOOTER_POISON, L"Poison Dart Shooter");
|
||||
m_stringTable->registerString(IDS_ITEM_CLOUD_PARACHUTE, L"Cloud Parachute");
|
||||
m_stringTable->registerString(IDS_ITEM_CLOUD_STAFF, L"Cloud Staff");
|
||||
m_stringTable->registerString(IDS_ITEM_NATURE_STAFF, L"Nature Staff");
|
||||
m_stringTable->registerString(IDS_ITEM_REPULSION_SHIELD, L"Repulsion Shield");
|
||||
m_stringTable->registerString(IDS_ITEM_LANCE, L"Lance");
|
||||
m_stringTable->registerString(IDS_ITEM_PIG_SLAYER, L"Pig Slayer");
|
||||
m_stringTable->registerString(IDS_ITEM_VAMPIRE_BLADE, L"Vampire Blade");
|
||||
m_stringTable->registerString(IDS_ITEM_LIGHTNING_KNIFE, L"Lightning Knife");
|
||||
m_stringTable->registerString(IDS_ITEM_SWORD_SKYROOT, L"Skyroot Sword");
|
||||
m_stringTable->registerString(IDS_ITEM_SHOVEL_SKYROOT, L"Skyroot Shovel");
|
||||
m_stringTable->registerString(IDS_ITEM_PICKAXE_SKYROOT, L"Skyroot Pickaxe");
|
||||
m_stringTable->registerString(IDS_ITEM_HATCHET_SKYROOT, L"Skyroot Axe");
|
||||
m_stringTable->registerString(IDS_ITEM_SWORD_HOLYSTONE, L"Holystone Sword");
|
||||
m_stringTable->registerString(IDS_ITEM_SHOVEL_HOLYSTONE, L"Holystone Shovel");
|
||||
m_stringTable->registerString(IDS_ITEM_PICKAXE_HOLYSTONE, L"Holystone Pickaxe");
|
||||
m_stringTable->registerString(IDS_ITEM_HATCHET_HOLYSTONE, L"Holystone Axe");
|
||||
m_stringTable->registerString(IDS_ITEM_SWORD_ZANITE, L"Zanite Sword");
|
||||
m_stringTable->registerString(IDS_ITEM_SHOVEL_ZANITE, L"Zanite Shovel");
|
||||
m_stringTable->registerString(IDS_ITEM_PICKAXE_ZANITE, L"Zanite Pickaxe");
|
||||
m_stringTable->registerString(IDS_ITEM_HATCHET_ZANITE, L"Zanite Axe");
|
||||
m_stringTable->registerString(IDS_ITEM_SWORD_GRAVITITE, L"Gravitite Sword");
|
||||
m_stringTable->registerString(IDS_ITEM_SHOVEL_GRAVITITE, L"Gravitite Shovel");
|
||||
m_stringTable->registerString(IDS_ITEM_PICKAXE_GRAVITITE, L"Gravitite Pickaxe");
|
||||
m_stringTable->registerString(IDS_ITEM_HATCHET_GRAVITITE, L"Gravitite Axe");
|
||||
m_stringTable->registerString(IDS_ITEM_PHOENIX_SWORD, L"Phoenix Sword");
|
||||
m_stringTable->registerString(IDS_ITEM_PHOENIX_SHOVEL, L"Phoenix Shovel");
|
||||
m_stringTable->registerString(IDS_ITEM_PHOENIX_PICKAXE, L"Phoenix Pickaxe");
|
||||
m_stringTable->registerString(IDS_ITEM_PHOENIX_AXE, L"Phoenix Axe");
|
||||
m_stringTable->registerString(IDS_ITEM_HELMET_ZANITE, L"Zanite Helmet");
|
||||
m_stringTable->registerString(IDS_ITEM_CHESTPLATE_ZANITE, L"Zanite Chestplate");
|
||||
m_stringTable->registerString(IDS_ITEM_LEGGINGS_ZANITE, L"Zanite Leggings");
|
||||
m_stringTable->registerString(IDS_ITEM_BOOTS_ZANITE, L"Zanite Boots");
|
||||
m_stringTable->registerString(IDS_ITEM_HELMET_GRAVITITE, L"Gravitite Helmet");
|
||||
m_stringTable->registerString(IDS_ITEM_CHESTPLATE_GRAVITITE, L"Gravitite Chestplate");
|
||||
m_stringTable->registerString(IDS_ITEM_LEGGINGS_GRAVITITE, L"Gravitite Leggings");
|
||||
m_stringTable->registerString(IDS_ITEM_BOOTS_GRAVITITE, L"Gravitite Boots");
|
||||
m_stringTable->registerString(IDS_ITEM_GRAVITITE_PLATE, L"Gravitite Plate");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -107,6 +107,44 @@ void IUIScene_CreativeMenu::staticCtor()
|
||||
ITEM(Tile::stairs_sandstone_Id)
|
||||
ITEM(Tile::stairs_quartz_Id)
|
||||
|
||||
// Aether Blocks
|
||||
ITEM(Tile::aetherGrass_Id)
|
||||
ITEM(Tile::aetherDirt_Id)
|
||||
ITEM(Tile::holystone_Id)
|
||||
ITEM(Tile::mossyHolystone_Id)
|
||||
ITEM(Tile::ambrosiumOre_Id)
|
||||
ITEM(Tile::zaniteOre_Id)
|
||||
ITEM(Tile::gravititeOre_Id)
|
||||
ITEM(Tile::skyrootLog_Id)
|
||||
ITEM(Tile::skyrootPlanks_Id)
|
||||
ITEM(Tile::skyrootLeaves_Id)
|
||||
ITEM(Tile::goldenOakLog_Id)
|
||||
ITEM(Tile::goldenOakLeaves_Id)
|
||||
ITEM(Tile::quicksoil_Id)
|
||||
ITEM(Tile::quicksoilGlass_Id)
|
||||
ITEM(Tile::aercloud_Id)
|
||||
ITEM(Tile::goldAercloud_Id)
|
||||
ITEM(Tile::blueAercloud_Id)
|
||||
ITEM(Tile::aerogel_Id)
|
||||
ITEM(Tile::icestone_Id)
|
||||
ITEM(Tile::ambrosiumTorch_Id)
|
||||
ITEM(Tile::skyrootSapling_Id)
|
||||
ITEM(Tile::goldenOakSapling_Id)
|
||||
ITEM(Tile::purpleFlower_Id)
|
||||
ITEM(Tile::whiteFlower_Id)
|
||||
ITEM(Tile::angelicStone_Id)
|
||||
ITEM(Tile::lightAngelicStone_Id)
|
||||
ITEM(Tile::carvedStone_Id)
|
||||
ITEM(Tile::lightCarvedStone_Id)
|
||||
ITEM(Tile::hellfireStone_Id)
|
||||
ITEM(Tile::lightHellfireStone_Id)
|
||||
ITEM(Tile::pillarTop_Id)
|
||||
ITEM(Tile::enchanter_Id)
|
||||
ITEM(Tile::freezer_Id)
|
||||
ITEM(Tile::incubator_Id)
|
||||
ITEM(Tile::libraryLore_Id)
|
||||
ITEM(Tile::pillarCarved_Id)
|
||||
|
||||
|
||||
// Decoration
|
||||
DEF(eCreativeInventory_Decoration)
|
||||
@@ -359,6 +397,52 @@ void IUIScene_CreativeMenu::staticCtor()
|
||||
ITEM(Item::hatchet_diamond_Id)
|
||||
ITEM(Item::hoe_diamond_Id)
|
||||
|
||||
// Aether Tools & Armor
|
||||
ITEM(Item::helmet_zanite_Id)
|
||||
ITEM(Item::chestplate_zanite_Id)
|
||||
ITEM(Item::leggings_zanite_Id)
|
||||
ITEM(Item::boots_zanite_Id)
|
||||
ITEM(Item::sword_skyroot_Id)
|
||||
ITEM(Item::shovel_skyroot_Id)
|
||||
ITEM(Item::pickAxe_skyroot_Id)
|
||||
ITEM(Item::hatchet_skyroot_Id)
|
||||
|
||||
ITEM(Item::helmet_gravitite_Id)
|
||||
ITEM(Item::chestplate_gravitite_Id)
|
||||
ITEM(Item::leggings_gravitite_Id)
|
||||
ITEM(Item::boots_gravitite_Id)
|
||||
ITEM(Item::sword_holystone_Id)
|
||||
ITEM(Item::shovel_holystone_Id)
|
||||
ITEM(Item::pickAxe_holystone_Id)
|
||||
ITEM(Item::hatchet_holystone_Id)
|
||||
|
||||
ITEM(Item::sword_zanite_Id)
|
||||
ITEM(Item::shovel_zanite_Id)
|
||||
ITEM(Item::pickAxe_zanite_Id)
|
||||
ITEM(Item::hatchet_zanite_Id)
|
||||
|
||||
ITEM(Item::sword_gravitite_Id)
|
||||
ITEM(Item::shovel_gravitite_Id)
|
||||
ITEM(Item::pickAxe_gravitite_Id)
|
||||
ITEM(Item::hatchet_gravitite_Id)
|
||||
|
||||
ITEM(Item::phoenixSword_Id)
|
||||
ITEM(Item::phoenixShovel_Id)
|
||||
ITEM(Item::phoenixPickaxe_Id)
|
||||
ITEM(Item::phoenixAxe_Id)
|
||||
|
||||
// Aether Special Weapons
|
||||
ITEM(Item::vampireBlade_Id)
|
||||
ITEM(Item::pigSlayer_Id)
|
||||
ITEM(Item::aetherLance_Id)
|
||||
ITEM(Item::lightningKnife_Id)
|
||||
ITEM(Item::dartShooter_Id)
|
||||
ITEM(Item::dartShooterEnchanted_Id)
|
||||
ITEM(Item::dartShooterPoison_Id)
|
||||
ITEM(Item::repulsionShield_Id)
|
||||
ITEM(Item::cloudStaff_Id)
|
||||
ITEM(Item::natureStaff_Id)
|
||||
|
||||
ITEM(Item::fireball_Id)
|
||||
ITEM(Item::clock_Id)
|
||||
ITEM(Item::shears_Id)
|
||||
@@ -381,6 +465,27 @@ void IUIScene_CreativeMenu::staticCtor()
|
||||
ITEM(Item::ironIngot_Id)
|
||||
ITEM(Item::goldIngot_Id)
|
||||
ITEM(Item::netherQuartz_Id)
|
||||
// Aether Materials
|
||||
ITEM(Item::ambrosiumShard_Id)
|
||||
ITEM(Item::zaniteGemstone_Id)
|
||||
ITEM(Item::flamingGemstone_Id)
|
||||
ITEM(Item::goldenAmber_Id)
|
||||
ITEM(Item::skyrootStick_Id)
|
||||
ITEM(Item::aechorPetal_Id)
|
||||
ITEM(Item::gummieSwet_Id)
|
||||
ITEM(Item::lifeShard_Id)
|
||||
ITEM(Item::regenerationStone_Id)
|
||||
ITEM(Item::moaEgg_Id)
|
||||
ITEM(Item::goldenFeather_Id)
|
||||
ITEM(Item::aetherKey_Id)
|
||||
ITEM(Item::skyrootBucket_Id)
|
||||
ITEM(Item::skyrootBucketWater_Id)
|
||||
ITEM(Item::skyrootBucketMilk_Id)
|
||||
ITEM(Item::skyrootBucketPoison_Id)
|
||||
ITEM(Item::dartGolden_Id)
|
||||
ITEM(Item::dartEnchanted_Id)
|
||||
ITEM(Item::dartPoison_Id)
|
||||
ITEM(Item::cloudParachute_Id)
|
||||
ITEM(Item::brick_Id)
|
||||
ITEM(Item::netherbrick_Id)
|
||||
ITEM(Item::stick_Id)
|
||||
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 659 B |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 10 KiB |
@@ -691,7 +691,7 @@ void GameRenderer::setupCamera(float a, int eye)
|
||||
if(app.GetGameSettings(mc->player->GetXboxPad(),eGameSetting_ViewBob) && !mc->player->abilities.flying && !bNoLegAnim && !bNoBobbingAnim) bobView(a);
|
||||
|
||||
float pt = mc->player->oPortalTime + (mc->player->portalTime - mc->player->oPortalTime) * a;
|
||||
if (pt > 0)
|
||||
if (pt > 0 && !mc->player->inAetherPortalOverlay)
|
||||
{
|
||||
int multiplier = 20;
|
||||
if (mc->player->hasEffect(MobEffect::confusion))
|
||||
|
||||
@@ -235,7 +235,10 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||
float pt = minecraft->player->oPortalTime + (minecraft->player->portalTime - minecraft->player->oPortalTime) * a;
|
||||
if (pt > 0)
|
||||
{
|
||||
renderTp(pt, screenWidth, screenHeight);
|
||||
if (minecraft->player->inAetherPortalOverlay)
|
||||
renderAetherTp(pt, screenWidth, screenHeight);
|
||||
else
|
||||
renderTp(pt, screenWidth, screenHeight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1146,6 +1149,42 @@ void Gui::renderTp(float br, int w, int h)
|
||||
|
||||
}
|
||||
|
||||
void Gui::renderAetherTp(float br, int w, int h)
|
||||
{
|
||||
if (br < 1)
|
||||
{
|
||||
br = br * br;
|
||||
br = br * br;
|
||||
br = br * 0.8f + 0.2f;
|
||||
}
|
||||
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDepthMask(false);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glColor4f(1, 1, 1, br);
|
||||
MemSect(31);
|
||||
minecraft->textures->bindTexture(TN_TERRAIN);
|
||||
MemSect(0);
|
||||
|
||||
Icon *slot = Tile::calmWater->getTexture(Facing::UP);
|
||||
float u0 = slot->getU0();
|
||||
float v0 = slot->getV0();
|
||||
float u1 = slot->getU1();
|
||||
float v1 = slot->getV1();
|
||||
Tesselator *t = Tesselator::getInstance();
|
||||
t->begin();
|
||||
t->vertexUV((float)(0), (float)( h), (float)( -90), (float)( u0), (float)( v1));
|
||||
t->vertexUV((float)(w), (float)( h), (float)( -90), (float)( u1), (float)( v1));
|
||||
t->vertexUV((float)(w), (float)( 0), (float)( -90), (float)( u1), (float)( v0));
|
||||
t->vertexUV((float)(0), (float)( 0), (float)( -90), (float)( u0), (float)( v0));
|
||||
t->end();
|
||||
glDepthMask(true);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glColor4f(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
void Gui::renderSlot(int slot, int x, int y, float a)
|
||||
{
|
||||
shared_ptr<ItemInstance> item = minecraft->player->inventory->items[slot];
|
||||
|
||||
@@ -46,6 +46,7 @@ private:
|
||||
void renderPumpkin(int w, int h);
|
||||
void renderVignette(float br, int w, int h);
|
||||
void renderTp(float br, int w, int h);
|
||||
void renderAetherTp(float br, int w, int h);
|
||||
void renderSlot(int slot, int x, int y, float a);
|
||||
public:
|
||||
void tick();
|
||||
|
||||
@@ -47,9 +47,9 @@ ItemInHandRenderer::ItemInHandRenderer(Minecraft *mc, bool optimisedMinimap)
|
||||
for( int xp = 0; xp < 16; xp++ )
|
||||
{
|
||||
float u = (15-xp) / 256.0f;
|
||||
float v = (15-yp) / 256.0f;
|
||||
float v = (15-yp) / 384.0f; // 4J - items.png is 256x384, V must use height not width
|
||||
u += 0.5f / 256.0f;
|
||||
v += 0.5f / 256.0f;
|
||||
v += 0.5f / 384.0f;
|
||||
float x0 = xp / 16.0f;
|
||||
float x1 = x0 + 1.0f/16.0f;
|
||||
float y0 = yp / 16.0f;
|
||||
|
||||
@@ -238,7 +238,7 @@ void LocalPlayer::aiStep()
|
||||
return;
|
||||
}
|
||||
oPortalTime = portalTime;
|
||||
if (isInsidePortal)
|
||||
if (isInsidePortal || isInsideAetherPortal)
|
||||
{
|
||||
if (!level->isClientSide)
|
||||
{
|
||||
@@ -246,7 +246,9 @@ void LocalPlayer::aiStep()
|
||||
}
|
||||
if (minecraft->screen != NULL) minecraft->setScreen(NULL);
|
||||
|
||||
if (portalTime == 0)
|
||||
inAetherPortalOverlay = isInsideAetherPortal;
|
||||
|
||||
if (portalTime == 0 && !isInsideAetherPortal)
|
||||
{
|
||||
minecraft->soundEngine->playUI(eSoundType_PORTAL_TRIGGER, 1, random->nextFloat() * 0.4f + 0.8f);
|
||||
}
|
||||
@@ -256,6 +258,7 @@ void LocalPlayer::aiStep()
|
||||
portalTime = 1;
|
||||
}
|
||||
isInsidePortal = false;
|
||||
isInsideAetherPortal = false;
|
||||
}
|
||||
else if (hasEffect(MobEffect::confusion) && getEffect(MobEffect::confusion)->getDuration() > (SharedConstants::TICKS_PER_SECOND * 3))
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ Minecraft::Minecraft(Component *mouseComponent, Canvas *parent, MinecraftApplet
|
||||
timer = new Timer(SharedConstants::TICKS_PER_SECOND);
|
||||
oldLevel = NULL; //4J Stu added
|
||||
level = NULL;
|
||||
levels = MultiPlayerLevelArray(3); // 4J Added
|
||||
levels = MultiPlayerLevelArray(4); // 4J Added
|
||||
levelRenderer = NULL;
|
||||
player = nullptr;
|
||||
cameraTargetPlayer = nullptr;
|
||||
@@ -3939,6 +3939,7 @@ MultiPlayerLevel *Minecraft::getLevel(int dimension)
|
||||
{
|
||||
if (dimension == -1) return levels[1];
|
||||
else if(dimension == 1) return levels[2];
|
||||
else if(dimension == 2) return levels[3];
|
||||
else return levels[0];
|
||||
}
|
||||
|
||||
@@ -3960,6 +3961,7 @@ void Minecraft::forceaddLevel(MultiPlayerLevel *level)
|
||||
int dimId = level->dimension->id;
|
||||
if (dimId == -1) levels[1] = level;
|
||||
else if(dimId == 1) levels[2] = level;
|
||||
else if(dimId == 2) levels[3] = level;
|
||||
else levels[0] = level;
|
||||
}
|
||||
|
||||
@@ -4024,6 +4026,12 @@ void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, shared_pt
|
||||
delete levels[2];
|
||||
levels[2] = NULL;
|
||||
}
|
||||
if(levels[3]!=NULL)
|
||||
{
|
||||
levels[3]->savedDataStorage = NULL; // shared with overworld
|
||||
delete levels[3];
|
||||
levels[3] = NULL;
|
||||
}
|
||||
|
||||
// Delete all the player objects
|
||||
for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx)
|
||||
@@ -4065,6 +4073,7 @@ void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, shared_pt
|
||||
int dimId = level->dimension->id;
|
||||
if (dimId == -1) levels[1] = level;
|
||||
else if(dimId == 1) levels[2] = level;
|
||||
else if(dimId == 2) levels[3] = level;
|
||||
else levels[0] = level;
|
||||
|
||||
// If no player has been set, then this is the first level to be set this game, so set up
|
||||
@@ -5008,3 +5017,4 @@ int Minecraft::MustSignInReturnedPSN(void *pParam, int iPad, C4JStorage::EMessag
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
||||
ProgressRenderer *mcprogress = Minecraft::GetInstance()->progressRenderer;
|
||||
|
||||
// 4J TODO - free levels here if there are already some?
|
||||
levels = ServerLevelArray(3);
|
||||
levels = ServerLevelArray(4);
|
||||
|
||||
int gameTypeId = settings->getInt(L"gamemode", app.GetGameHostOption(eGameHostOption_GameType));//LevelSettings::GAMETYPE_SURVIVAL);
|
||||
GameType *gameType = LevelSettings::validateGameType(gameTypeId);
|
||||
@@ -458,6 +458,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
||||
int dimension = 0;
|
||||
if (i == 1) dimension = -1;
|
||||
if (i == 2) dimension = 1;
|
||||
if (i == 3) dimension = 2;
|
||||
if (i == 0)
|
||||
{
|
||||
levels[i] = new ServerLevel(this, storage, name, dimension, levelSettings);
|
||||
@@ -706,6 +707,13 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
||||
|
||||
if( s_bServerHalted || !g_NetworkManager.IsInSession() ) return false;
|
||||
|
||||
if( levels[3]->isNew )
|
||||
{
|
||||
levels[3]->save(true, mcprogress);
|
||||
}
|
||||
|
||||
if( s_bServerHalted || !g_NetworkManager.IsInSession() ) return false;
|
||||
|
||||
// 4J - added - immediately save newly created level, like single player game
|
||||
// 4J Stu - We also want to immediately save the tutorial
|
||||
if ( levels[0]->isNew )
|
||||
@@ -718,7 +726,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
||||
|
||||
if( s_bServerHalted || !g_NetworkManager.IsInSession() ) return false;
|
||||
|
||||
if( levels[0]->isNew || levels[1]->isNew || levels[2]->isNew )
|
||||
if( levels[0]->isNew || levels[1]->isNew || levels[2]->isNew || levels[3]->isNew )
|
||||
{
|
||||
levels[0]->saveToDisc(mcprogress, false);
|
||||
}
|
||||
@@ -1608,6 +1616,7 @@ ServerLevel *MinecraftServer::getLevel(int dimension)
|
||||
{
|
||||
if (dimension == -1) return levels[1];
|
||||
else if (dimension == 1) return levels[2];
|
||||
else if (dimension == 2) return levels[3];
|
||||
else return levels[0];
|
||||
}
|
||||
|
||||
@@ -1616,6 +1625,7 @@ void MinecraftServer::setLevel(int dimension, ServerLevel *level)
|
||||
{
|
||||
if (dimension == -1) levels[1] = level;
|
||||
else if (dimension == 1) levels[2] = level;
|
||||
else if (dimension == 2) levels[3] = level;
|
||||
else levels[0] = level;
|
||||
}
|
||||
|
||||
|
||||
@@ -717,6 +717,16 @@ void PlayerList::toggleDimension(shared_ptr<ServerPlayer> player, int targetDime
|
||||
{
|
||||
player->displayClientMessage(IDS_PLAYER_LEFT_END);
|
||||
}
|
||||
// Aether dimension messages
|
||||
else if(player->dimension != 2 && targetDimension == 2)
|
||||
{
|
||||
// Entering The Aether — reuse a generic progress message
|
||||
player->displayClientMessage(IDS_PLAYER_ENTERED_END); // TODO: Add IDS_PLAYER_ENTERED_AETHER
|
||||
}
|
||||
else if( player->dimension == 2 )
|
||||
{
|
||||
player->displayClientMessage(IDS_PLAYER_LEFT_END); // TODO: Add IDS_PLAYER_LEFT_AETHER
|
||||
}
|
||||
|
||||
player->dimension = targetDimension;
|
||||
|
||||
@@ -750,14 +760,28 @@ void PlayerList::toggleDimension(shared_ptr<ServerPlayer> player, int targetDime
|
||||
}
|
||||
else if (player->dimension == 0)
|
||||
{
|
||||
xt *= scale;
|
||||
zt *= scale;
|
||||
if (lastDimension == -1)
|
||||
{
|
||||
// Coming from Nether — scale up
|
||||
xt *= scale;
|
||||
zt *= scale;
|
||||
}
|
||||
// Coming from Aether or End — keep coordinates as-is (1:1)
|
||||
player->moveTo(xt, player->y, zt, player->yRot, player->xRot);
|
||||
if (player->isAlive())
|
||||
{
|
||||
oldLevel->tick(player, false);
|
||||
}
|
||||
}
|
||||
else if (player->dimension == 2)
|
||||
{
|
||||
// Entering The Aether — 1:1 coordinate mapping with Overworld
|
||||
player->moveTo(xt, player->y, zt, player->yRot, player->xRot);
|
||||
if (player->isAlive())
|
||||
{
|
||||
oldLevel->tick(player, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Pos *p = newLevel->getDimensionSpecificSpawn();
|
||||
@@ -789,7 +813,7 @@ void PlayerList::toggleDimension(shared_ptr<ServerPlayer> player, int targetDime
|
||||
player->moveTo(xt, player->y, zt, player->yRot, player->xRot);
|
||||
newLevel->tick(player, false);
|
||||
newLevel->cache->autoCreate = true;
|
||||
(new PortalForcer())->force(newLevel, player);
|
||||
(new PortalForcer())->force(newLevel, player, lastDimension);
|
||||
newLevel->cache->autoCreate = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ const unsigned int PlayerRenderer::s_nametagColors[MINECRAFT_NET_MAX_PLAYERS] =
|
||||
#endif
|
||||
};
|
||||
|
||||
const wstring PlayerRenderer::MATERIAL_NAMES[5] = { L"cloth", L"chain", L"iron", L"diamond", L"gold" };
|
||||
const wstring PlayerRenderer::MATERIAL_NAMES[7] = { L"cloth", L"chain", L"iron", L"diamond", L"gold", L"zanite_layer", L"gravitite_layer" };
|
||||
|
||||
PlayerRenderer::PlayerRenderer() : MobRenderer( new HumanoidModel(0), 0.5f )
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
static unsigned int getNametagColour(int index);
|
||||
|
||||
private:
|
||||
static const wstring MATERIAL_NAMES[5];
|
||||
static const wstring MATERIAL_NAMES[7];
|
||||
|
||||
protected:
|
||||
virtual int prepareArmor(shared_ptr<Mob> _player, int layer, float a);
|
||||
|
||||
@@ -39,24 +39,25 @@ WeighedTreasureArray ServerLevel::RANDOM_BONUS_ITEMS;
|
||||
|
||||
C4JThread* ServerLevel::m_updateThread = NULL;
|
||||
C4JThread::EventArray* ServerLevel::m_updateTrigger;
|
||||
CRITICAL_SECTION ServerLevel::m_updateCS[3];
|
||||
CRITICAL_SECTION ServerLevel::m_updateCS[4];
|
||||
|
||||
Level *ServerLevel::m_level[3];
|
||||
int ServerLevel::m_updateChunkX[3][LEVEL_CHUNKS_TO_UPDATE_MAX];
|
||||
int ServerLevel::m_updateChunkZ[3][LEVEL_CHUNKS_TO_UPDATE_MAX];
|
||||
int ServerLevel::m_updateChunkCount[3];
|
||||
int ServerLevel::m_updateTileX[3][MAX_UPDATES];
|
||||
int ServerLevel::m_updateTileY[3][MAX_UPDATES];
|
||||
int ServerLevel::m_updateTileZ[3][MAX_UPDATES];
|
||||
int ServerLevel::m_updateTileCount[3];
|
||||
int ServerLevel::m_randValue[3];
|
||||
Level *ServerLevel::m_level[4];
|
||||
int ServerLevel::m_updateChunkX[4][LEVEL_CHUNKS_TO_UPDATE_MAX];
|
||||
int ServerLevel::m_updateChunkZ[4][LEVEL_CHUNKS_TO_UPDATE_MAX];
|
||||
int ServerLevel::m_updateChunkCount[4];
|
||||
int ServerLevel::m_updateTileX[4][MAX_UPDATES];
|
||||
int ServerLevel::m_updateTileY[4][MAX_UPDATES];
|
||||
int ServerLevel::m_updateTileZ[4][MAX_UPDATES];
|
||||
int ServerLevel::m_updateTileCount[4];
|
||||
int ServerLevel::m_randValue[4];
|
||||
|
||||
void ServerLevel::staticCtor()
|
||||
{
|
||||
m_updateTrigger = new C4JThread::EventArray(3);
|
||||
m_updateTrigger = new C4JThread::EventArray(4);
|
||||
InitializeCriticalSection(&m_updateCS[0]);
|
||||
InitializeCriticalSection(&m_updateCS[1]);
|
||||
InitializeCriticalSection(&m_updateCS[2]);
|
||||
InitializeCriticalSection(&m_updateCS[3]);
|
||||
|
||||
m_updateThread = new C4JThread(runUpdate, NULL, "Tile update");
|
||||
m_updateThread->SetProcessor(CPU_CORE_TILE_UPDATE);
|
||||
@@ -232,10 +233,17 @@ void ServerLevel::tick()
|
||||
|
||||
__int64 time = levelData->getTime() + 1;
|
||||
// 4J Stu - Putting this back in, but I have reduced the number of chunks that save when not forced
|
||||
// Stagger saves across dimensions: Overworld(0)=0, Nether(-1)=1, End(1)=2, Aether(2)=3
|
||||
{
|
||||
int saveSlot = 0;
|
||||
if (dimension->id == 0) saveSlot = 0;
|
||||
else if (dimension->id == -1) saveSlot = 1;
|
||||
else if (dimension->id == 1) saveSlot = 2;
|
||||
else if (dimension->id == 2) saveSlot = 3;
|
||||
#ifdef _LARGE_WORLDS
|
||||
if (time % (saveInterval) == (dimension->id + 1))
|
||||
if (time % 4 == saveSlot)
|
||||
#else
|
||||
if (time % (saveInterval) == (dimension->id * dimension->id * (saveInterval/2)))
|
||||
if (time % (saveInterval) == (saveSlot * (saveInterval / 4)))
|
||||
#endif
|
||||
{
|
||||
//app.DebugPrintf("Incremental save\n");
|
||||
@@ -243,6 +251,7 @@ void ServerLevel::tick()
|
||||
save(false, NULL);
|
||||
PIXEndNamedEvent();
|
||||
}
|
||||
}
|
||||
|
||||
// 4J : WESTY : Changed so that time update goes through stats tracking update code.
|
||||
//levelData->setTime(time);
|
||||
@@ -384,6 +393,10 @@ void ServerLevel::tickTiles()
|
||||
{
|
||||
iLev = 2;
|
||||
}
|
||||
else if( dimension->id == 2 )
|
||||
{
|
||||
iLev = 3;
|
||||
}
|
||||
chunksToPoll.clear();
|
||||
|
||||
unsigned int tickCount = 0;
|
||||
@@ -1386,7 +1399,7 @@ int ServerLevel::runUpdate(void* lpParam)
|
||||
// 4J Stu - Grass and Lava ticks currently take up the majority of all tile updates, so I am limiting them
|
||||
int grassTicks = 0;
|
||||
int lavaTicks = 0;
|
||||
for( unsigned int iLev = 0; iLev < 3; ++iLev )
|
||||
for( unsigned int iLev = 0; iLev < 4; ++iLev )
|
||||
{
|
||||
EnterCriticalSection(&m_updateCS[iLev]);
|
||||
for( int i = 0; i < m_updateChunkCount[iLev]; i++ )
|
||||
|
||||
@@ -151,19 +151,19 @@ public:
|
||||
// 4J added
|
||||
static const int MAX_UPDATES = 256;
|
||||
|
||||
// Each of these need to be duplicated for each level in the current game. As we currently only have 2 (over/nether), making this constant
|
||||
static Level *m_level[3];
|
||||
static int m_updateChunkX[3][LEVEL_CHUNKS_TO_UPDATE_MAX];
|
||||
static int m_updateChunkZ[3][LEVEL_CHUNKS_TO_UPDATE_MAX];
|
||||
static int m_updateChunkCount[3];
|
||||
static int m_updateTileX[3][MAX_UPDATES];
|
||||
static int m_updateTileY[3][MAX_UPDATES];
|
||||
static int m_updateTileZ[3][MAX_UPDATES];
|
||||
static int m_updateTileCount[3];
|
||||
static int m_randValue[3];
|
||||
// Each of these need to be duplicated for each level in the current game (over/nether/end/aether)
|
||||
static Level *m_level[4];
|
||||
static int m_updateChunkX[4][LEVEL_CHUNKS_TO_UPDATE_MAX];
|
||||
static int m_updateChunkZ[4][LEVEL_CHUNKS_TO_UPDATE_MAX];
|
||||
static int m_updateChunkCount[4];
|
||||
static int m_updateTileX[4][MAX_UPDATES];
|
||||
static int m_updateTileY[4][MAX_UPDATES];
|
||||
static int m_updateTileZ[4][MAX_UPDATES];
|
||||
static int m_updateTileCount[4];
|
||||
static int m_randValue[4];
|
||||
|
||||
static C4JThread::EventArray* m_updateTrigger;
|
||||
static CRITICAL_SECTION m_updateCS[3];
|
||||
static CRITICAL_SECTION m_updateCS[4];
|
||||
|
||||
static C4JThread* m_updateThread;
|
||||
static int runUpdate(void* lpParam);
|
||||
|
||||
@@ -538,6 +538,37 @@ void ServerPlayer::doTickB(bool ignorePortal)
|
||||
isInsidePortal = false;
|
||||
}
|
||||
}
|
||||
else if (isInsideAetherPortal)
|
||||
{
|
||||
// Aether portal handling — toggles between Overworld (0) and Aether (2)
|
||||
if (containerMenu != inventoryMenu)
|
||||
{
|
||||
closeContainer();
|
||||
}
|
||||
if (riding != NULL)
|
||||
{
|
||||
this->ride(riding);
|
||||
}
|
||||
else
|
||||
{
|
||||
portalTime += 1 / 80.0f;
|
||||
if (portalTime >= 1)
|
||||
{
|
||||
portalTime = 1;
|
||||
changingDimensionDelay = 10;
|
||||
|
||||
int targetDimension = 0;
|
||||
if (dimension == 2) targetDimension = 0;
|
||||
else targetDimension = 2;
|
||||
|
||||
server->getPlayers()->toggleDimension( dynamic_pointer_cast<ServerPlayer>( shared_from_this() ), targetDimension );
|
||||
lastSentExp = -1;
|
||||
lastSentHealth = -1;
|
||||
lastSentFood = -1;
|
||||
}
|
||||
}
|
||||
isInsideAetherPortal = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (portalTime > 0) portalTime -= 1 / 20.0f;
|
||||
|
||||
@@ -166,6 +166,13 @@ LPCWSTR StringTable::getString(int id)
|
||||
return L"";
|
||||
}
|
||||
|
||||
void StringTable::registerString(int id, const wstring &value)
|
||||
{
|
||||
if (id >= (int)m_stringsVec.size())
|
||||
m_stringsVec.resize(id + 1, L"");
|
||||
m_stringsVec[id] = value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ public:
|
||||
|
||||
LPCWSTR getString(const wstring &id);
|
||||
LPCWSTR getString(int id);
|
||||
void registerString(int id, const wstring &value);
|
||||
|
||||
//static LPCWSTR m_wchLocaleCode[LOCALE_COUNT];
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ void Texture::_init(const wstring &name, int mode, int width, int height, int de
|
||||
for(unsigned int level = 1; level < m_iMipLevels; ++level)
|
||||
{
|
||||
int ww = width >> level;
|
||||
int hh = height >> height;
|
||||
int hh = height >> level;
|
||||
|
||||
byteArray tempBytes = byteArray(ww * hh * depth * 4);
|
||||
for (int index = 0; index < tempBytes.length; index++)
|
||||
|
||||
@@ -36,6 +36,42 @@ void User::staticCtor()
|
||||
allowedTiles.push_back(Tile::bookshelf);
|
||||
allowedTiles.push_back(Tile::tnt);
|
||||
allowedTiles.push_back(Tile::obsidian);
|
||||
|
||||
// Aether Blocks
|
||||
allowedTiles.push_back(Tile::aetherGrass);
|
||||
allowedTiles.push_back(Tile::aetherDirt);
|
||||
allowedTiles.push_back(Tile::holystone);
|
||||
allowedTiles.push_back(Tile::mossyHolystone);
|
||||
allowedTiles.push_back(Tile::ambrosiumOre);
|
||||
allowedTiles.push_back(Tile::zaniteOre);
|
||||
allowedTiles.push_back(Tile::gravititeOre);
|
||||
allowedTiles.push_back(Tile::skyrootLog);
|
||||
allowedTiles.push_back(Tile::skyrootPlanks);
|
||||
allowedTiles.push_back(Tile::skyrootLeaves);
|
||||
allowedTiles.push_back(Tile::goldenOakLog);
|
||||
allowedTiles.push_back(Tile::goldenOakLeaves);
|
||||
allowedTiles.push_back(Tile::quicksoil);
|
||||
allowedTiles.push_back(Tile::quicksoilGlass);
|
||||
allowedTiles.push_back(Tile::aercloud);
|
||||
allowedTiles.push_back(Tile::aerogel);
|
||||
allowedTiles.push_back(Tile::icestone);
|
||||
allowedTiles.push_back(Tile::ambrosiumTorch);
|
||||
allowedTiles.push_back(Tile::skyrootSapling);
|
||||
allowedTiles.push_back(Tile::goldenOakSapling);
|
||||
allowedTiles.push_back(Tile::purpleFlower);
|
||||
allowedTiles.push_back(Tile::whiteFlower);
|
||||
allowedTiles.push_back(Tile::angelicStone);
|
||||
allowedTiles.push_back(Tile::lightAngelicStone);
|
||||
allowedTiles.push_back(Tile::carvedStone);
|
||||
allowedTiles.push_back(Tile::lightCarvedStone);
|
||||
allowedTiles.push_back(Tile::hellfireStone);
|
||||
allowedTiles.push_back(Tile::lightHellfireStone);
|
||||
allowedTiles.push_back(Tile::pillarTop);
|
||||
allowedTiles.push_back(Tile::pillarCarved);
|
||||
allowedTiles.push_back(Tile::enchanter);
|
||||
allowedTiles.push_back(Tile::freezer);
|
||||
allowedTiles.push_back(Tile::incubator);
|
||||
allowedTiles.push_back(Tile::libraryLore);
|
||||
}
|
||||
|
||||
User::User(const wstring& name, const wstring& sessionId)
|
||||
|
||||
@@ -1923,4 +1923,104 @@
|
||||
#define IDS_YOU_DIED 1921
|
||||
#define IDS_YOU_HAVE 1922
|
||||
#define IDS_ZOMBIE 1923
|
||||
#define IDS_DLC_MENU_WORLDS 1924
|
||||
#define IDS_PROGRESS_ENTERING_AETHER 1924
|
||||
#define IDS_PROGRESS_LEAVING_AETHER 1925
|
||||
|
||||
// Aether Tile Strings
|
||||
#define IDS_TILE_AETHER_GRASS 1926
|
||||
#define IDS_TILE_AETHER_DIRT 1927
|
||||
#define IDS_TILE_HOLYSTONE 1928
|
||||
#define IDS_TILE_MOSSY_HOLYSTONE 1929
|
||||
#define IDS_TILE_AMBROSIUM_ORE 1930
|
||||
#define IDS_TILE_ZANITE_ORE 1931
|
||||
#define IDS_TILE_GRAVITITE_ORE 1932
|
||||
#define IDS_TILE_SKYROOT_LOG 1933
|
||||
#define IDS_TILE_SKYROOT_PLANKS 1934
|
||||
#define IDS_TILE_SKYROOT_LEAVES 1935
|
||||
#define IDS_TILE_GOLDEN_OAK_LOG 1936
|
||||
#define IDS_TILE_GOLDEN_OAK_LEAVES 1937
|
||||
#define IDS_TILE_QUICKSOIL 1938
|
||||
#define IDS_TILE_QUICKSOIL_GLASS 1939
|
||||
#define IDS_TILE_AERCLOUD 1940
|
||||
#define IDS_TILE_AEROGEL 1941
|
||||
#define IDS_TILE_ICESTONE 1942
|
||||
#define IDS_TILE_AMBROSIUM_TORCH 1943
|
||||
#define IDS_TILE_SKYROOT_SAPLING 1944
|
||||
#define IDS_TILE_GOLDEN_OAK_SAPLING 1945
|
||||
#define IDS_TILE_PURPLE_FLOWER 1946
|
||||
#define IDS_TILE_WHITE_FLOWER 1947
|
||||
#define IDS_TILE_ANGELIC_STONE 1948
|
||||
#define IDS_TILE_LIGHT_ANGELIC_STONE 1949
|
||||
#define IDS_TILE_CARVED_STONE 1950
|
||||
#define IDS_TILE_LIGHT_CARVED_STONE 1951
|
||||
#define IDS_TILE_HELLFIRE_STONE 1952
|
||||
#define IDS_TILE_LIGHT_HELLFIRE_STONE 1953
|
||||
#define IDS_TILE_PILLAR 1954
|
||||
#define IDS_TILE_PILLAR_CARVED 1955
|
||||
#define IDS_TILE_ENCHANTER 1956
|
||||
#define IDS_TILE_FREEZER 1957
|
||||
#define IDS_TILE_INCUBATOR 1958
|
||||
#define IDS_TILE_LIBRARY_LORE 1959
|
||||
#define IDS_TILE_GOLD_AERCLOUD 1960
|
||||
#define IDS_TILE_BLUE_AERCLOUD 1961
|
||||
|
||||
// Aether Item Strings
|
||||
#define IDS_ITEM_AMBROSIUM_SHARD 1962
|
||||
#define IDS_ITEM_ZANITE_GEMSTONE 1963
|
||||
#define IDS_ITEM_FLAMING_GEMSTONE 1964
|
||||
#define IDS_ITEM_SKYROOT_STICK 1965
|
||||
#define IDS_ITEM_AECHOR_PETAL 1966
|
||||
#define IDS_ITEM_GOLDEN_AMBER 1967
|
||||
#define IDS_ITEM_GUMMIE_SWET 1968
|
||||
#define IDS_ITEM_LIFE_SHARD 1969
|
||||
#define IDS_ITEM_REGENERATION_STONE 1970
|
||||
#define IDS_ITEM_MOA_EGG 1971
|
||||
#define IDS_ITEM_GOLDEN_FEATHER 1972
|
||||
#define IDS_ITEM_AETHER_KEY 1973
|
||||
#define IDS_ITEM_SKYROOT_BUCKET 1974
|
||||
#define IDS_ITEM_SKYROOT_BUCKET_WATER 1975
|
||||
#define IDS_ITEM_SKYROOT_BUCKET_MILK 1976
|
||||
#define IDS_ITEM_SKYROOT_BUCKET_POISON 1977
|
||||
#define IDS_ITEM_DART_GOLDEN 1978
|
||||
#define IDS_ITEM_DART_ENCHANTED 1979
|
||||
#define IDS_ITEM_DART_POISON 1980
|
||||
#define IDS_ITEM_DART_SHOOTER 1981
|
||||
#define IDS_ITEM_DART_SHOOTER_ENCHANTED 1982
|
||||
#define IDS_ITEM_DART_SHOOTER_POISON 1983
|
||||
#define IDS_ITEM_CLOUD_PARACHUTE 1984
|
||||
#define IDS_ITEM_CLOUD_STAFF 1985
|
||||
#define IDS_ITEM_NATURE_STAFF 1986
|
||||
#define IDS_ITEM_REPULSION_SHIELD 1987
|
||||
#define IDS_ITEM_LANCE 1988
|
||||
#define IDS_ITEM_PIG_SLAYER 1989
|
||||
#define IDS_ITEM_VAMPIRE_BLADE 1990
|
||||
#define IDS_ITEM_LIGHTNING_KNIFE 1991
|
||||
#define IDS_ITEM_SWORD_SKYROOT 1992
|
||||
#define IDS_ITEM_SHOVEL_SKYROOT 1993
|
||||
#define IDS_ITEM_PICKAXE_SKYROOT 1994
|
||||
#define IDS_ITEM_HATCHET_SKYROOT 1995
|
||||
#define IDS_ITEM_SWORD_HOLYSTONE 1996
|
||||
#define IDS_ITEM_SHOVEL_HOLYSTONE 1997
|
||||
#define IDS_ITEM_PICKAXE_HOLYSTONE 1998
|
||||
#define IDS_ITEM_HATCHET_HOLYSTONE 1999
|
||||
#define IDS_ITEM_SWORD_ZANITE 2000
|
||||
#define IDS_ITEM_SHOVEL_ZANITE 2001
|
||||
#define IDS_ITEM_PICKAXE_ZANITE 2002
|
||||
#define IDS_ITEM_HATCHET_ZANITE 2003
|
||||
#define IDS_ITEM_SWORD_GRAVITITE 2004
|
||||
#define IDS_ITEM_SHOVEL_GRAVITITE 2005
|
||||
#define IDS_ITEM_PICKAXE_GRAVITITE 2006
|
||||
#define IDS_ITEM_HATCHET_GRAVITITE 2007
|
||||
#define IDS_ITEM_PHOENIX_SWORD 2008
|
||||
#define IDS_ITEM_PHOENIX_SHOVEL 2009
|
||||
#define IDS_ITEM_PHOENIX_PICKAXE 2010
|
||||
#define IDS_ITEM_PHOENIX_AXE 2011
|
||||
#define IDS_ITEM_HELMET_ZANITE 2012
|
||||
#define IDS_ITEM_CHESTPLATE_ZANITE 2013
|
||||
#define IDS_ITEM_LEGGINGS_ZANITE 2014
|
||||
#define IDS_ITEM_BOOTS_ZANITE 2015
|
||||
#define IDS_ITEM_HELMET_GRAVITITE 2016
|
||||
#define IDS_ITEM_CHESTPLATE_GRAVITITE 2017
|
||||
#define IDS_ITEM_LEGGINGS_GRAVITITE 2018
|
||||
#define IDS_ITEM_BOOTS_GRAVITITE 2019
|
||||
#define IDS_ITEM_GRAVITITE_PLATE 2020
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
#include "stdafx.h"
|
||||
#include "AercloudTile.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.phys.h"
|
||||
#include "net.minecraft.world.h"
|
||||
|
||||
AercloudTile::AercloudTile(int id) : HalfTransparentTile(id, L"Aercloud", Material::cloth, false)
|
||||
{
|
||||
}
|
||||
|
||||
AABB *AercloudTile::getAABB(Level *level, int x, int y, int z)
|
||||
{
|
||||
// Entities sink about 75% into the cloud (4/16 remaining)
|
||||
float r = 12 / 16.0f;
|
||||
return AABB::newTemp(x, y, z, x + 1, y + 1 - r, z + 1);
|
||||
}
|
||||
|
||||
void AercloudTile::fallOn(Level *level, int x, int y, int z, shared_ptr<Entity> entity, float fallDistance)
|
||||
{
|
||||
// Slow the entity's fall instead of bouncing
|
||||
entity->fallDistance = 0;
|
||||
if (entity->yd < 0)
|
||||
{
|
||||
entity->yd *= 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
void AercloudTile::entityInside(Level *level, int x, int y, int z, shared_ptr<Entity> entity)
|
||||
{
|
||||
// Slow horizontal movement like soul sand
|
||||
entity->xd *= 0.4;
|
||||
entity->zd *= 0.4;
|
||||
|
||||
// Slow falling speed for a floaty, airy feel
|
||||
if (entity->yd < 0)
|
||||
{
|
||||
entity->yd *= 0.5;
|
||||
entity->fallDistance = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool AercloudTile::isSolidRender(bool isServerLevel)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include "HalfTransparentTile.h"
|
||||
|
||||
class AercloudTile : public HalfTransparentTile
|
||||
{
|
||||
friend class Tile;
|
||||
protected:
|
||||
AercloudTile(int id);
|
||||
|
||||
public:
|
||||
virtual AABB *getAABB(Level *level, int x, int y, int z);
|
||||
virtual void fallOn(Level *level, int x, int y, int z, shared_ptr<Entity> entity, float fallDistance);
|
||||
virtual void entityInside(Level *level, int x, int y, int z, shared_ptr<Entity> entity);
|
||||
virtual bool isSolidRender(bool isServerLevel = false);
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
#include "stdafx.h"
|
||||
#include "AetherBiome.h"
|
||||
#include "AetherBiomeDecorator.h"
|
||||
#include "net.minecraft.world.entity.monster.h"
|
||||
#include "net.minecraft.world.level.tile.h"
|
||||
#include "net.minecraft.world.level.levelgen.feature.h"
|
||||
|
||||
AetherBiome::AetherBiome(int id) : Biome(id)
|
||||
{
|
||||
// Clear all mob spawning lists
|
||||
enemies.clear();
|
||||
friendlies.clear();
|
||||
friendlies_chicken.clear();
|
||||
friendlies_wolf.clear();
|
||||
waterFriendlies.clear();
|
||||
|
||||
// Aether surface blocks
|
||||
topMaterial = (byte) Tile::aetherGrass_Id;
|
||||
material = (byte) Tile::aetherDirt_Id;
|
||||
|
||||
// Use custom decorator
|
||||
delete decorator;
|
||||
decorator = new AetherBiomeDecorator(this);
|
||||
}
|
||||
|
||||
Feature *AetherBiome::getTreeFeature(Random *random)
|
||||
{
|
||||
// 10% chance for golden oak, 90% for skyroot
|
||||
if (random->nextInt(10) == 0)
|
||||
{
|
||||
return new GoldenOakTreeFeature(false);
|
||||
}
|
||||
return new SkyrootTreeFeature(false);
|
||||
}
|
||||
|
||||
Feature *AetherBiome::getGrassFeature(Random *random)
|
||||
{
|
||||
// Regular tall grass (type 1) — will be colored by biome grass color
|
||||
return new TallGrassFeature(Tile::tallgrass_Id, 1);
|
||||
}
|
||||
|
||||
int AetherBiome::getGrassColor()
|
||||
{
|
||||
return 0x8ab69a;
|
||||
}
|
||||
|
||||
int AetherBiome::getFolageColor()
|
||||
{
|
||||
return 0x8ab69a;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
#include "Biome.h"
|
||||
|
||||
class AetherBiome : public Biome
|
||||
{
|
||||
public:
|
||||
AetherBiome(int id);
|
||||
|
||||
virtual Feature *getTreeFeature(Random *random);
|
||||
virtual Feature *getGrassFeature(Random *random);
|
||||
virtual int getGrassColor();
|
||||
virtual int getFolageColor();
|
||||
};
|
||||
@@ -0,0 +1,105 @@
|
||||
#include "stdafx.h"
|
||||
#include "AetherBiomeDecorator.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.level.tile.h"
|
||||
#include "net.minecraft.world.level.levelgen.feature.h"
|
||||
#include "net.minecraft.world.level.biome.h"
|
||||
#include "QuicksoilShelfFeature.h"
|
||||
|
||||
AetherBiomeDecorator::AetherBiomeDecorator(Biome *biome) : BiomeDecorator(biome)
|
||||
{
|
||||
// Aether ores replace holystone instead of stone
|
||||
ambrosiumOreFeature = new OreFeature(Tile::ambrosiumOre_Id, 16, Tile::holystone_Id);
|
||||
zaniteOreFeature = new OreFeature(Tile::zaniteOre_Id, 8, Tile::holystone_Id);
|
||||
gravititeOreFeature = new OreFeature(Tile::gravititeOre_Id, 4, Tile::holystone_Id);
|
||||
|
||||
// Quicksoil shelves on island undersides
|
||||
quicksoilShelfFeature = new QuicksoilShelfFeature();
|
||||
|
||||
// Aether decoration counts
|
||||
treeCount = 2;
|
||||
grassCount = 5;
|
||||
flowerCount = 2;
|
||||
|
||||
// Disable overworld-specific features
|
||||
sandCount = 0;
|
||||
clayCount = 0;
|
||||
gravelCount = 0;
|
||||
deadBushCount = 0;
|
||||
mushroomCount = 0;
|
||||
reedsCount = 0;
|
||||
cactusCount = 0;
|
||||
waterlilyCount = 0;
|
||||
hugeMushrooms = 0;
|
||||
liquids = false;
|
||||
}
|
||||
|
||||
void AetherBiomeDecorator::decorate()
|
||||
{
|
||||
PIXBeginNamedEvent(0, "Decorate Aether ores");
|
||||
decorateAetherOres();
|
||||
PIXEndNamedEvent();
|
||||
|
||||
PIXBeginNamedEvent(0, "Decorate Aether forests");
|
||||
int forests = treeCount;
|
||||
if (random->nextInt(10) == 0) forests += 1;
|
||||
|
||||
for (int i = 0; i < forests; i++)
|
||||
{
|
||||
int x = xo + random->nextInt(16) + 8;
|
||||
int z = zo + random->nextInt(16) + 8;
|
||||
Feature *tree = biome->getTreeFeature(random);
|
||||
tree->init(1, 1, 1);
|
||||
tree->place(level, random, x, level->getHeightmap(x, z), z);
|
||||
delete tree;
|
||||
}
|
||||
PIXEndNamedEvent();
|
||||
|
||||
PIXBeginNamedEvent(0, "Decorate Aether flowers/grass");
|
||||
for (int i = 0; i < flowerCount; i++)
|
||||
{
|
||||
int x = xo + random->nextInt(16) + 8;
|
||||
int y = random->nextInt(Level::genDepth);
|
||||
int z = zo + random->nextInt(16) + 8;
|
||||
yellowFlowerFeature->place(level, random, x, y, z);
|
||||
}
|
||||
|
||||
for (int i = 0; i < grassCount; i++)
|
||||
{
|
||||
int x = xo + random->nextInt(16) + 8;
|
||||
int y = random->nextInt(Level::genDepth);
|
||||
int z = zo + random->nextInt(16) + 8;
|
||||
MemSect(50);
|
||||
Feature *grassFeature = biome->getGrassFeature(random);
|
||||
MemSect(0);
|
||||
grassFeature->place(level, random, x, y, z);
|
||||
delete grassFeature;
|
||||
}
|
||||
PIXEndNamedEvent();
|
||||
|
||||
PIXBeginNamedEvent(0, "Decorate Aether quicksoil shelves");
|
||||
// Place quicksoil shelves on the undersides of islands
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
int x = xo + random->nextInt(16) + 8;
|
||||
int z = zo + random->nextInt(16) + 8;
|
||||
int y = level->getHeightmap(x, z);
|
||||
if (y > 0)
|
||||
{
|
||||
quicksoilShelfFeature->place(level, random, x, y, z);
|
||||
}
|
||||
}
|
||||
PIXEndNamedEvent();
|
||||
}
|
||||
|
||||
void AetherBiomeDecorator::decorateAetherOres()
|
||||
{
|
||||
level->setInstaTick(true);
|
||||
// Ambrosium: common, full height range
|
||||
decorateDepthSpan(20, ambrosiumOreFeature, 0, Level::genDepth);
|
||||
// Zanite: moderate, lower half
|
||||
decorateDepthSpan(10, zaniteOreFeature, 0, Level::genDepth / 2);
|
||||
// Gravitite: rare, bottom quarter
|
||||
decorateDepthSpan(4, gravititeOreFeature, 0, Level::genDepth / 4);
|
||||
level->setInstaTick(false);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include "BiomeDecorator.h"
|
||||
|
||||
class AetherBiomeDecorator : public BiomeDecorator
|
||||
{
|
||||
public:
|
||||
AetherBiomeDecorator(Biome *biome);
|
||||
|
||||
protected:
|
||||
// Aether ore features (replace holystone instead of stone)
|
||||
Feature *ambrosiumOreFeature;
|
||||
Feature *zaniteOreFeature;
|
||||
Feature *gravititeOreFeature;
|
||||
|
||||
// Quicksoil shelf feature for island undersides
|
||||
Feature *quicksoilShelfFeature;
|
||||
|
||||
virtual void decorate();
|
||||
void decorateAetherOres();
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "stdafx.h"
|
||||
#include "AetherBushTile.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
|
||||
AetherBushTile::AetherBushTile(int id) : Bush(id)
|
||||
{
|
||||
}
|
||||
|
||||
AetherBushTile::AetherBushTile(int id, Material *material) : Bush(id, material)
|
||||
{
|
||||
}
|
||||
|
||||
bool AetherBushTile::mayPlaceOn(int tile)
|
||||
{
|
||||
return tile == Tile::aetherGrass_Id || tile == Tile::aetherDirt_Id;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#include "Bush.h"
|
||||
|
||||
class AetherBushTile : public Bush
|
||||
{
|
||||
friend class Tile;
|
||||
protected:
|
||||
AetherBushTile(int id);
|
||||
AetherBushTile(int id, Material *material);
|
||||
|
||||
virtual bool mayPlaceOn(int tile);
|
||||
};
|
||||
@@ -0,0 +1,92 @@
|
||||
#include "stdafx.h"
|
||||
#include "AetherDimension.h"
|
||||
#include "FixedBiomeSource.h"
|
||||
#include "LevelData.h"
|
||||
#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.biome.h"
|
||||
#include "AetherLevelSource.h"
|
||||
#include "..\Minecraft.Client\Minecraft.h"
|
||||
#include "..\Minecraft.Client\Common\Colours\ColourTable.h"
|
||||
|
||||
void AetherDimension::init()
|
||||
{
|
||||
// Use the Aether biome for the sky dimension
|
||||
biomeSource = new FixedBiomeSource(Biome::aether, 0.5f, 0.0f);
|
||||
id = 2;
|
||||
hasCeiling = false;
|
||||
}
|
||||
|
||||
ChunkSource *AetherDimension::createRandomLevelSource() const
|
||||
{
|
||||
// Floating island terrain generation for the Aether
|
||||
return new AetherLevelSource(level, level->getSeed());
|
||||
}
|
||||
|
||||
float AetherDimension::getTimeOfDay(__int64 time, float a) const
|
||||
{
|
||||
// Permanent daytime — 0.0 gives maximum brightness (skyDarken = 0)
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
float *AetherDimension::getSunriseColor(float td, float a)
|
||||
{
|
||||
// No sunrise/sunset cycle in the Aether
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Vec3 *AetherDimension::getFogColor(float td, float a) const
|
||||
{
|
||||
// Bright sky-blue fog color for the Aether
|
||||
float r = 0.62f;
|
||||
float g = 0.80f;
|
||||
float b = 1.0f;
|
||||
return Vec3::newTemp(r, g, b);
|
||||
}
|
||||
|
||||
bool AetherDimension::hasGround()
|
||||
{
|
||||
// The Aether has ground (sky islands with void below, but ground exists)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AetherDimension::mayRespawn() const
|
||||
{
|
||||
// Cannot respawn in the Aether — sent back to Overworld on death
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AetherDimension::isNaturalDimension()
|
||||
{
|
||||
// Not a natural dimension (no day/night cycle mob spawning rules)
|
||||
return false;
|
||||
}
|
||||
|
||||
float AetherDimension::getCloudHeight()
|
||||
{
|
||||
// Clouds are higher in the Aether
|
||||
return (float)Level::genDepth + 32;
|
||||
}
|
||||
|
||||
bool AetherDimension::isValidSpawn(int x, int z) const
|
||||
{
|
||||
int topTile = level->getTopTile(x, z);
|
||||
if (topTile == 0) return false;
|
||||
return Tile::tiles[topTile]->material->blocksMotion();
|
||||
}
|
||||
|
||||
Pos *AetherDimension::getSpawnPos()
|
||||
{
|
||||
return new Pos(0, 64, 0);
|
||||
}
|
||||
|
||||
bool AetherDimension::isFoggyAt(int x, int z)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int AetherDimension::getSpawnYPosition()
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include "Dimension.h"
|
||||
|
||||
class AetherDimension : public Dimension
|
||||
{
|
||||
public:
|
||||
virtual void init();
|
||||
virtual ChunkSource *createRandomLevelSource() const;
|
||||
virtual float getTimeOfDay(__int64 time, float a) const;
|
||||
virtual float *getSunriseColor(float td, float a);
|
||||
virtual Vec3 *getFogColor(float td, float a) const;
|
||||
virtual bool hasGround();
|
||||
virtual bool mayRespawn() const;
|
||||
virtual bool isNaturalDimension();
|
||||
virtual float getCloudHeight();
|
||||
virtual bool isValidSpawn(int x, int z) const;
|
||||
virtual Pos *getSpawnPos();
|
||||
virtual int getSpawnYPosition();
|
||||
virtual bool isFoggyAt(int x, int z);
|
||||
};
|
||||
@@ -0,0 +1,88 @@
|
||||
#include "stdafx.h"
|
||||
#include "AetherGrassTile.h"
|
||||
#include "AetherNaturalTile.h"
|
||||
#include "net.minecraft.world.item.h"
|
||||
#include "net.minecraft.world.item.enchantment.h"
|
||||
#include "net.minecraft.world.entity.player.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.h"
|
||||
#include "Facing.h"
|
||||
#include "IconRegister.h"
|
||||
|
||||
AetherGrassTile::AetherGrassTile(int id) : Tile(id, Material::grass)
|
||||
{
|
||||
iconTop = NULL;
|
||||
iconSide = NULL;
|
||||
setTicking(true);
|
||||
}
|
||||
|
||||
Icon *AetherGrassTile::getTexture(int face, int data)
|
||||
{
|
||||
if (face == Facing::UP) return iconTop;
|
||||
if (face == Facing::DOWN) return Tile::aetherDirt->getTexture(face);
|
||||
return iconSide;
|
||||
}
|
||||
|
||||
Icon *AetherGrassTile::getTexture(LevelSource *level, int x, int y, int z, int face)
|
||||
{
|
||||
if (face == Facing::UP) return iconTop;
|
||||
if (face == Facing::DOWN) return Tile::aetherDirt->getTexture(face);
|
||||
return iconSide;
|
||||
}
|
||||
|
||||
void AetherGrassTile::registerIcons(IconRegister *iconRegister)
|
||||
{
|
||||
iconSide = iconRegister->registerIcon(L"AetherGrassSide");
|
||||
iconTop = iconRegister->registerIcon(L"AetherGrassTop");
|
||||
}
|
||||
|
||||
void AetherGrassTile::tick(Level *level, int x, int y, int z, Random *random)
|
||||
{
|
||||
if (level->isClientSide) return;
|
||||
|
||||
// Spread to adjacent aether dirt
|
||||
if (level->getRawBrightness(x, y + 1, z) >= Level::MAX_BRIGHTNESS - 6)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
int xt = x + random->nextInt(3) - 1;
|
||||
int yt = y + random->nextInt(5) - 3;
|
||||
int zt = z + random->nextInt(3) - 1;
|
||||
int above = level->getTile(xt, yt + 1, zt);
|
||||
if (level->getTile(xt, yt, zt) == Tile::aetherDirt_Id && level->getRawBrightness(xt, yt + 1, zt) >= MIN_BRIGHTNESS && Tile::lightBlock[above] <= 2)
|
||||
{
|
||||
level->setTile(xt, yt, zt, Tile::aetherGrass_Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int AetherGrassTile::getResource(int data, Random *random, int playerBonusLevel)
|
||||
{
|
||||
return Tile::aetherDirt_Id;
|
||||
}
|
||||
|
||||
bool AetherGrassTile::shouldTileTick(Level *level, int x, int y, int z)
|
||||
{
|
||||
return (level->getRawBrightness(x, y + 1, z) >= Level::MAX_BRIGHTNESS - 6);
|
||||
}
|
||||
|
||||
void AetherGrassTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr<Mob> by)
|
||||
{
|
||||
// Mark as player-placed so skyroot tools won't double-drop
|
||||
int data = level->getData(x, y, z);
|
||||
level->setData(x, y, z, data | AetherNaturalTile::PLAYER_PLACED_BIT);
|
||||
}
|
||||
|
||||
void AetherGrassTile::playerDestroy(Level *level, shared_ptr<Player> player, int x, int y, int z, int data)
|
||||
{
|
||||
int cleanData = data & ~AetherNaturalTile::PLAYER_PLACED_BIT;
|
||||
bool isPlayerPlaced = (data & AetherNaturalTile::PLAYER_PLACED_BIT) != 0;
|
||||
|
||||
Tile::playerDestroy(level, player, x, y, z, cleanData);
|
||||
|
||||
if (!isPlayerPlaced && AetherNaturalTile::isSkyrootTool(player))
|
||||
{
|
||||
AetherNaturalTile::spawnSkyrootBonusDrops(this, level, player, x, y, z, cleanData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
#include "Tile.h"
|
||||
#include "AetherNaturalTile.h"
|
||||
|
||||
class Level;
|
||||
class ChunkRebuildData;
|
||||
|
||||
class AetherGrassTile : public Tile
|
||||
{
|
||||
friend class Tile;
|
||||
friend class ChunkRebuildData;
|
||||
private:
|
||||
Icon *iconTop;
|
||||
Icon *iconSide;
|
||||
|
||||
public:
|
||||
static const int MIN_BRIGHTNESS = 4;
|
||||
|
||||
protected:
|
||||
AetherGrassTile(int id);
|
||||
|
||||
public:
|
||||
virtual Icon *getTexture(int face, int data);
|
||||
virtual Icon *getTexture(LevelSource *level, int x, int y, int z, int face);
|
||||
void registerIcons(IconRegister *iconRegister);
|
||||
virtual void tick(Level *level, int x, int y, int z, Random *random);
|
||||
virtual int getResource(int data, Random *random, int playerBonusLevel);
|
||||
|
||||
virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr<Mob> by);
|
||||
virtual void playerDestroy(Level *level, shared_ptr<Player> player, int x, int y, int z, int data);
|
||||
|
||||
virtual bool shouldTileTick(Level *level, int x, int y, int z);
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
#include "stdafx.h"
|
||||
#include "AetherLeafTile.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.h"
|
||||
|
||||
AetherLeafTile::AetherLeafTile(int id) : TransparentTile(id, Material::leaves, true, isSolidRender())
|
||||
{
|
||||
setTicking(false);
|
||||
}
|
||||
|
||||
int AetherLeafTile::getResource(int data, Random *random, int playerBonusLevel)
|
||||
{
|
||||
// Skyroot leaves drop skyroot saplings, golden oak leaves drop golden oak saplings
|
||||
if (id == Tile::goldenOakLeaves_Id) return Tile::goldenOakSapling_Id;
|
||||
return Tile::skyrootSapling_Id;
|
||||
}
|
||||
|
||||
int AetherLeafTile::getResourceCount(Random *random)
|
||||
{
|
||||
return random->nextInt(20) == 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
bool AetherLeafTile::isSeasonalLeaf() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
#include "TransparentTile.h"
|
||||
|
||||
class Random;
|
||||
|
||||
class AetherLeafTile : public TransparentTile
|
||||
{
|
||||
friend class Tile;
|
||||
protected:
|
||||
AetherLeafTile(int id);
|
||||
|
||||
public:
|
||||
virtual int getResource(int data, Random *random, int playerBonusLevel);
|
||||
virtual int getResourceCount(Random *random);
|
||||
virtual bool isSeasonalLeaf() const;
|
||||
};
|
||||
@@ -0,0 +1,399 @@
|
||||
#include "stdafx.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.level.biome.h"
|
||||
#include "net.minecraft.world.level.levelgen.h"
|
||||
#include "net.minecraft.world.level.levelgen.feature.h"
|
||||
#include "net.minecraft.world.level.levelgen.synth.h"
|
||||
#include "net.minecraft.world.level.tile.h"
|
||||
#include "net.minecraft.world.level.storage.h"
|
||||
#include "AetherLevelSource.h"
|
||||
|
||||
AetherLevelSource::AetherLevelSource(Level *level, __int64 seed)
|
||||
{
|
||||
m_XZSize = level->getLevelData()->getXZSize();
|
||||
|
||||
this->level = level;
|
||||
|
||||
random = new Random(seed);
|
||||
pprandom = new Random(seed);
|
||||
|
||||
lperlinNoise1 = new PerlinNoise(random, 16);
|
||||
lperlinNoise2 = new PerlinNoise(random, 16);
|
||||
perlinNoise1 = new PerlinNoise(random, 8);
|
||||
scaleNoise = new PerlinNoise(random, 10);
|
||||
depthNoise = new PerlinNoise(random, 16);
|
||||
// Island mask noise — creates scattered island clusters across the world
|
||||
islandNoise = new PerlinNoise(random, 4);
|
||||
// Carving noise — cuts irregular shapes into islands
|
||||
carvingNoise = new PerlinNoise(random, 6);
|
||||
}
|
||||
|
||||
AetherLevelSource::~AetherLevelSource()
|
||||
{
|
||||
delete random;
|
||||
delete pprandom;
|
||||
delete lperlinNoise1;
|
||||
delete lperlinNoise2;
|
||||
delete perlinNoise1;
|
||||
delete scaleNoise;
|
||||
delete depthNoise;
|
||||
delete islandNoise;
|
||||
delete carvingNoise;
|
||||
}
|
||||
|
||||
void AetherLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks, BiomeArray biomes)
|
||||
{
|
||||
doubleArray buffer;
|
||||
|
||||
int xChunks = 16 / CHUNK_WIDTH;
|
||||
|
||||
int xSize = xChunks + 1;
|
||||
int ySize = Level::genDepth / CHUNK_HEIGHT + 1;
|
||||
int zSize = xChunks + 1;
|
||||
buffer = getHeights(buffer, xOffs * xChunks, 0, zOffs * xChunks, xSize, ySize, zSize);
|
||||
|
||||
for (int xc = 0; xc < xChunks; xc++)
|
||||
{
|
||||
for (int zc = 0; zc < xChunks; zc++)
|
||||
{
|
||||
for (int yc = 0; yc < Level::genDepth / CHUNK_HEIGHT; yc++)
|
||||
{
|
||||
double yStep = 1 / (double) CHUNK_HEIGHT;
|
||||
double s0 = buffer[((xc + 0) * zSize + (zc + 0)) * ySize + (yc + 0)];
|
||||
double s1 = buffer[((xc + 0) * zSize + (zc + 1)) * ySize + (yc + 0)];
|
||||
double s2 = buffer[((xc + 1) * zSize + (zc + 0)) * ySize + (yc + 0)];
|
||||
double s3 = buffer[((xc + 1) * zSize + (zc + 1)) * ySize + (yc + 0)];
|
||||
|
||||
double s0a = (buffer[((xc + 0) * zSize + (zc + 0)) * ySize + (yc + 1)] - s0) * yStep;
|
||||
double s1a = (buffer[((xc + 0) * zSize + (zc + 1)) * ySize + (yc + 1)] - s1) * yStep;
|
||||
double s2a = (buffer[((xc + 1) * zSize + (zc + 0)) * ySize + (yc + 1)] - s2) * yStep;
|
||||
double s3a = (buffer[((xc + 1) * zSize + (zc + 1)) * ySize + (yc + 1)] - s3) * yStep;
|
||||
|
||||
for (int y = 0; y < CHUNK_HEIGHT; y++)
|
||||
{
|
||||
double xStep = 1 / (double) CHUNK_WIDTH;
|
||||
|
||||
double _s0 = s0;
|
||||
double _s1 = s1;
|
||||
double _s0a = (s2 - s0) * xStep;
|
||||
double _s1a = (s3 - s1) * xStep;
|
||||
|
||||
for (int x = 0; x < CHUNK_WIDTH; x++)
|
||||
{
|
||||
int offs = (x + xc * CHUNK_WIDTH) << Level::genDepthBitsPlusFour | (0 + zc * CHUNK_WIDTH) << Level::genDepthBits | (yc * CHUNK_HEIGHT + y);
|
||||
int step = 1 << Level::genDepthBits;
|
||||
double zStep = 1 / (double) CHUNK_WIDTH;
|
||||
|
||||
double val = _s0;
|
||||
double vala = (_s1 - _s0) * zStep;
|
||||
for (int z = 0; z < CHUNK_WIDTH; z++)
|
||||
{
|
||||
int tileId = 0;
|
||||
if (val > 0)
|
||||
{
|
||||
tileId = Tile::holystone_Id;
|
||||
}
|
||||
|
||||
blocks[offs] = (byte) tileId;
|
||||
offs += step;
|
||||
val += vala;
|
||||
}
|
||||
_s0 += _s0a;
|
||||
_s1 += _s1a;
|
||||
}
|
||||
|
||||
s0 += s0a;
|
||||
s1 += s1a;
|
||||
s2 += s2a;
|
||||
s3 += s3a;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
delete [] buffer.data;
|
||||
}
|
||||
|
||||
void AetherLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, BiomeArray biomes)
|
||||
{
|
||||
for (int x = 0; x < 16; x++)
|
||||
{
|
||||
for (int z = 0; z < 16; z++)
|
||||
{
|
||||
int run = -1;
|
||||
int runDepth = 3;
|
||||
|
||||
byte top = (byte) Tile::aetherGrass_Id;
|
||||
byte mid = (byte) Tile::aetherDirt_Id;
|
||||
byte base = (byte) Tile::holystone_Id;
|
||||
|
||||
for (int y = Level::genDepthMinusOne; y >= 0; y--)
|
||||
{
|
||||
int offs = (z * 16 + x) * Level::genDepth + y;
|
||||
|
||||
int old = blocks[offs];
|
||||
|
||||
if (old == 0)
|
||||
{
|
||||
run = -1;
|
||||
}
|
||||
else if (old == Tile::holystone_Id)
|
||||
{
|
||||
if (run == -1)
|
||||
{
|
||||
if (runDepth <= 0)
|
||||
{
|
||||
top = 0;
|
||||
mid = base;
|
||||
}
|
||||
|
||||
run = runDepth;
|
||||
// Top-most block: aether grass
|
||||
blocks[offs] = top;
|
||||
}
|
||||
else if (run > 0)
|
||||
{
|
||||
run--;
|
||||
// Underneath the top: aether dirt
|
||||
blocks[offs] = mid;
|
||||
}
|
||||
// When run reaches 0, the block stays as holystone
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LevelChunk *AetherLevelSource::create(int x, int z)
|
||||
{
|
||||
return getChunk(x, z);
|
||||
}
|
||||
|
||||
LevelChunk *AetherLevelSource::getChunk(int xOffs, int zOffs)
|
||||
{
|
||||
random->setSeed(xOffs * 341873128712l + zOffs * 132897987541l);
|
||||
|
||||
BiomeArray biomes;
|
||||
unsigned int blocksSize = Level::genDepth * 16 * 16;
|
||||
byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE);
|
||||
XMemSet128(tileData, 0, blocksSize);
|
||||
byteArray blocks = byteArray(tileData, blocksSize);
|
||||
|
||||
level->getBiomeSource()->getBiomeBlock(biomes, xOffs * 16, zOffs * 16, 16, 16, true);
|
||||
|
||||
prepareHeights(xOffs, zOffs, blocks, biomes);
|
||||
buildSurfaces(xOffs, zOffs, blocks, biomes);
|
||||
|
||||
LevelChunk *levelChunk = new LevelChunk(level, blocks, xOffs, zOffs);
|
||||
XPhysicalFree(tileData);
|
||||
|
||||
// 4J - recalcHeightmap moved to lightChunk() so it runs after the chunk is in the cache.
|
||||
// Without this, lightGaps() fails because the chunk isn't findable via hasChunk yet.
|
||||
|
||||
delete biomes.data;
|
||||
|
||||
return levelChunk;
|
||||
}
|
||||
|
||||
doubleArray AetherLevelSource::getHeights(doubleArray buffer, int x, int y, int z, int xSize, int ySize, int zSize)
|
||||
{
|
||||
if (buffer.data == NULL)
|
||||
{
|
||||
buffer = doubleArray(xSize * ySize * zSize);
|
||||
}
|
||||
|
||||
double s = 1 * 684.412;
|
||||
double hs = 1 * 684.412;
|
||||
|
||||
doubleArray pnr, ar, br, sr, dr;
|
||||
|
||||
sr = scaleNoise->getRegion(sr, x, z, xSize, zSize, 1.121, 1.121, 0.5);
|
||||
dr = depthNoise->getRegion(dr, x, z, xSize, zSize, 200.0, 200.0, 0.5);
|
||||
|
||||
s *= 2;
|
||||
|
||||
pnr = perlinNoise1->getRegion(pnr, x, y, z, xSize, ySize, zSize, s / 80.0, hs / 160.0, s / 80.0);
|
||||
ar = lperlinNoise1->getRegion(ar, x, y, z, xSize, ySize, zSize, s, hs, s);
|
||||
br = lperlinNoise2->getRegion(br, x, y, z, xSize, ySize, zSize, s, hs, s);
|
||||
|
||||
// Island noise — creates scattered island clusters
|
||||
doubleArray inr;
|
||||
inr = islandNoise->getRegion(inr, x, z, xSize, zSize, 0.35, 0.35, 0.5);
|
||||
|
||||
// Carving noise — cuts irregular shapes and hollows into islands
|
||||
doubleArray cnr;
|
||||
cnr = carvingNoise->getRegion(cnr, x, y, z, xSize, ySize, zSize, s / 30.0, hs / 30.0, s / 30.0);
|
||||
|
||||
// World bounds for edge fade (in noise column units)
|
||||
float worldHalf = (float)m_XZSize;
|
||||
|
||||
int p = 0;
|
||||
int pp = 0;
|
||||
|
||||
for (int xx = 0; xx < xSize; xx++)
|
||||
{
|
||||
for (int zz = 0; zz < zSize; zz++)
|
||||
{
|
||||
double scale = ((sr[pp] + 256.0) / 512);
|
||||
if (scale > 1) scale = 1;
|
||||
|
||||
double depth = (dr[pp] / 8000.0);
|
||||
if (depth < 0) depth = -depth * 0.3;
|
||||
depth = depth * 3.0 - 2.0;
|
||||
|
||||
// Island formation — higher threshold creates distinct scattered islands
|
||||
float islandVal = (float)inr[pp];
|
||||
float doffs = islandVal * 100.0f - 60.0f;
|
||||
|
||||
// Edge fade scaled to actual world size
|
||||
float xd = (float)(xx + x);
|
||||
float zd = (float)(zz + z);
|
||||
float edgeDist = sqrt(xd * xd + zd * zd);
|
||||
float fadeStart = worldHalf * 0.85f;
|
||||
float edgeFade;
|
||||
if (edgeDist < fadeStart)
|
||||
edgeFade = 80.0f;
|
||||
else
|
||||
edgeFade = 80.0f - ((edgeDist - fadeStart) / (worldHalf - fadeStart)) * 180.0f;
|
||||
if (edgeFade < -100) edgeFade = -100;
|
||||
|
||||
// Islands only appear where both noise and edge conditions allow
|
||||
if (edgeFade < doffs) doffs = edgeFade;
|
||||
|
||||
if (doffs < -100) doffs = -100;
|
||||
if (doffs > 80) doffs = 80;
|
||||
|
||||
// Use depth noise to shift terrain center — creates shelf-like elevation steps
|
||||
if (depth > 2) depth = 2;
|
||||
if (depth < -2) depth = -2;
|
||||
double depthShift = depth * 1.5;
|
||||
|
||||
if (scale < 0) scale = 0;
|
||||
scale = (scale) + 0.5;
|
||||
|
||||
pp++;
|
||||
|
||||
double yCenter = ySize / 2.0 + depthShift;
|
||||
|
||||
for (int yy = 0; yy < ySize; yy++)
|
||||
{
|
||||
double val = 0;
|
||||
double yOffs = (yy - yCenter) * 8 / scale;
|
||||
|
||||
if (yOffs < 0) yOffs *= -1;
|
||||
|
||||
double bb = ar[p] / 512;
|
||||
double cc = br[p] / 512;
|
||||
|
||||
double v = (pnr[p] / 10 + 1) / 2;
|
||||
if (v < 0) val = bb;
|
||||
else if (v > 1) val = cc;
|
||||
else val = bb + (cc - bb) * v;
|
||||
val -= 8;
|
||||
val += doffs;
|
||||
|
||||
// Carving — cut irregular shapes and hollows into solid areas
|
||||
double carve = cnr[p] / 384.0;
|
||||
if (val > 0 && carve < -6.0)
|
||||
{
|
||||
val += (carve + 6.0) * 2.0;
|
||||
}
|
||||
|
||||
// Slide down at the top of the world
|
||||
int r = 2;
|
||||
if (yy > ySize / 2 - r)
|
||||
{
|
||||
double slide = (yy - (ySize / 2 - r)) / (64.0f);
|
||||
if (slide < 0) slide = 0;
|
||||
if (slide > 1) slide = 1;
|
||||
val = val * (1 - slide) + -3000 * slide;
|
||||
}
|
||||
// Slide down at the bottom of the world
|
||||
r = 8;
|
||||
if (yy < r)
|
||||
{
|
||||
double slide = (r - yy) / (r - 1.0f);
|
||||
val = val * (1 - slide) + -30 * slide;
|
||||
}
|
||||
|
||||
buffer[p] = val;
|
||||
p++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delete [] pnr.data;
|
||||
delete [] ar.data;
|
||||
delete [] br.data;
|
||||
delete [] sr.data;
|
||||
delete [] dr.data;
|
||||
delete [] inr.data;
|
||||
delete [] cnr.data;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
bool AetherLevelSource::hasChunk(int x, int y)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// 4J - recalcHeightmap split out from getChunk so that it runs after the chunk is added to the cache.
|
||||
// This is required for skylight to be calculated correctly — lightGaps() needs the chunk to pass hasChunk().
|
||||
void AetherLevelSource::lightChunk(LevelChunk *lc)
|
||||
{
|
||||
lc->recalcHeightmap();
|
||||
}
|
||||
|
||||
void AetherLevelSource::postProcess(ChunkSource *parent, int xt, int zt)
|
||||
{
|
||||
HeavyTile::instaFall = true;
|
||||
int xo = xt * 16;
|
||||
int zo = zt * 16;
|
||||
|
||||
pprandom->setSeed(level->getSeed());
|
||||
__int64 xScale = pprandom->nextLong() / 2 * 2 + 1;
|
||||
__int64 zScale = pprandom->nextLong() / 2 * 2 + 1;
|
||||
pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed());
|
||||
|
||||
Biome *biome = level->getBiome(xo + 16, zo + 16);
|
||||
biome->decorate(level, pprandom, xo, zo);
|
||||
|
||||
HeavyTile::instaFall = false;
|
||||
|
||||
app.processSchematics(parent->getChunk(xt, zt));
|
||||
}
|
||||
|
||||
bool AetherLevelSource::save(bool force, ProgressListener *progressListener)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AetherLevelSource::tick()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AetherLevelSource::shouldSave()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
wstring AetherLevelSource::gatherStats()
|
||||
{
|
||||
return L"AetherLevelSource";
|
||||
}
|
||||
|
||||
vector<Biome::MobSpawnerData *> *AetherLevelSource::getMobsAt(MobCategory *mobCategory, int x, int y, int z)
|
||||
{
|
||||
Biome *biome = level->getBiome(x, z);
|
||||
if (biome == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return biome->getMobs(mobCategory);
|
||||
}
|
||||
|
||||
TilePos *AetherLevelSource::findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
|
||||
#include "ChunkSource.h"
|
||||
class PerlinNoise;
|
||||
|
||||
class AetherLevelSource : public ChunkSource
|
||||
{
|
||||
public:
|
||||
static const int CHUNK_HEIGHT = 4;
|
||||
static const int CHUNK_WIDTH = 8;
|
||||
private:
|
||||
Random *random;
|
||||
Random *pprandom;
|
||||
|
||||
private:
|
||||
PerlinNoise *lperlinNoise1;
|
||||
PerlinNoise *lperlinNoise2;
|
||||
PerlinNoise *perlinNoise1;
|
||||
public:
|
||||
PerlinNoise *scaleNoise;
|
||||
PerlinNoise *depthNoise;
|
||||
private:
|
||||
// Additional noise to create scattered island clusters
|
||||
PerlinNoise *islandNoise;
|
||||
// Carving noise for irregular island shapes
|
||||
PerlinNoise *carvingNoise;
|
||||
|
||||
Level *level;
|
||||
|
||||
public:
|
||||
AetherLevelSource(Level *level, __int64 seed);
|
||||
~AetherLevelSource();
|
||||
|
||||
void prepareHeights(int xOffs, int zOffs, byteArray blocks, BiomeArray biomes);
|
||||
void buildSurfaces(int xOffs, int zOffs, byteArray blocks, BiomeArray biomes);
|
||||
|
||||
public:
|
||||
virtual LevelChunk *create(int x, int z);
|
||||
virtual LevelChunk *getChunk(int xOffs, int zOffs);
|
||||
|
||||
private:
|
||||
doubleArray getHeights(doubleArray buffer, int x, int y, int z, int xSize, int ySize, int zSize);
|
||||
|
||||
public:
|
||||
virtual bool hasChunk(int x, int y);
|
||||
virtual void lightChunk(LevelChunk *lc);
|
||||
virtual void postProcess(ChunkSource *parent, int xt, int zt);
|
||||
virtual bool save(bool force, ProgressListener *progressListener);
|
||||
virtual bool tick();
|
||||
virtual bool shouldSave();
|
||||
virtual wstring gatherStats();
|
||||
|
||||
public:
|
||||
virtual vector<Biome::MobSpawnerData *> *getMobsAt(MobCategory *mobCategory, int x, int y, int z);
|
||||
virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z);
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
#include "stdafx.h"
|
||||
#include "AetherMultiFaceTile.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "Facing.h"
|
||||
#include "IconRegister.h"
|
||||
|
||||
AetherMultiFaceTile::AetherMultiFaceTile(int id, const wstring &topTex, const wstring &sideTex) : Tile(id, Material::stone)
|
||||
{
|
||||
iconTop = NULL;
|
||||
iconSide = NULL;
|
||||
texTop = topTex;
|
||||
texSide = sideTex;
|
||||
}
|
||||
|
||||
Icon *AetherMultiFaceTile::getTexture(int face, int data)
|
||||
{
|
||||
if (face == Facing::UP || face == Facing::DOWN) return iconTop;
|
||||
return iconSide;
|
||||
}
|
||||
|
||||
void AetherMultiFaceTile::registerIcons(IconRegister *iconRegister)
|
||||
{
|
||||
iconTop = iconRegister->registerIcon(texTop);
|
||||
iconSide = iconRegister->registerIcon(texSide);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
#include "Tile.h"
|
||||
|
||||
class AetherMultiFaceTile : public Tile
|
||||
{
|
||||
friend class Tile;
|
||||
private:
|
||||
Icon *iconTop;
|
||||
Icon *iconSide;
|
||||
wstring texTop;
|
||||
wstring texSide;
|
||||
|
||||
protected:
|
||||
AetherMultiFaceTile(int id, const wstring &topTex, const wstring &sideTex);
|
||||
|
||||
public:
|
||||
virtual Icon *getTexture(int face, int data);
|
||||
void registerIcons(IconRegister *iconRegister);
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
#include "stdafx.h"
|
||||
#include "AetherNaturalTile.h"
|
||||
#include "net.minecraft.world.item.h"
|
||||
#include "net.minecraft.world.item.enchantment.h"
|
||||
#include "net.minecraft.world.entity.player.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
|
||||
AetherNaturalTile::AetherNaturalTile(int id, Material *material) : Tile(id, material)
|
||||
{
|
||||
}
|
||||
|
||||
bool AetherNaturalTile::isSkyrootTool(shared_ptr<Player> player)
|
||||
{
|
||||
shared_ptr<ItemInstance> held = player->inventory->getSelected();
|
||||
if (held == NULL) return false;
|
||||
|
||||
int itemId = held->id;
|
||||
return itemId == Item::sword_skyroot_Id ||
|
||||
itemId == Item::shovel_skyroot_Id ||
|
||||
itemId == Item::pickAxe_skyroot_Id ||
|
||||
itemId == Item::hatchet_skyroot_Id;
|
||||
}
|
||||
|
||||
void AetherNaturalTile::spawnSkyrootBonusDrops(Tile *tile, Level *level, shared_ptr<Player> player, int x, int y, int z, int data)
|
||||
{
|
||||
// Don't double silk touch drops
|
||||
if (EnchantmentHelper::hasSilkTouch(player->inventory))
|
||||
return;
|
||||
|
||||
int playerBonusLevel = EnchantmentHelper::getDiggingLootBonus(player->inventory);
|
||||
tile->spawnResources(level, x, y, z, data, playerBonusLevel);
|
||||
}
|
||||
|
||||
void AetherNaturalTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr<Mob> by)
|
||||
{
|
||||
// Mark as player-placed so skyroot tools won't double-drop
|
||||
int data = level->getData(x, y, z);
|
||||
level->setData(x, y, z, data | PLAYER_PLACED_BIT);
|
||||
}
|
||||
|
||||
void AetherNaturalTile::playerDestroy(Level *level, shared_ptr<Player> player, int x, int y, int z, int data)
|
||||
{
|
||||
// Strip the player-placed bit before passing to base class
|
||||
int cleanData = data & ~PLAYER_PLACED_BIT;
|
||||
bool isPlayerPlaced = (data & PLAYER_PLACED_BIT) != 0;
|
||||
|
||||
// Normal drop logic
|
||||
Tile::playerDestroy(level, player, x, y, z, cleanData);
|
||||
|
||||
// Skyroot double-drop bonus on natural blocks only
|
||||
if (!isPlayerPlaced && isSkyrootTool(player))
|
||||
{
|
||||
spawnSkyrootBonusDrops(this, level, player, x, y, z, cleanData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
#include "Tile.h"
|
||||
|
||||
class Player;
|
||||
|
||||
// Simple tile for natural Aether terrain blocks (aether dirt, holystone, mossy holystone)
|
||||
// Handles the player-placed bit and skyroot double-drop mechanic.
|
||||
class AetherNaturalTile : public Tile
|
||||
{
|
||||
friend class Tile;
|
||||
public:
|
||||
// Bit used to mark a block as player-placed (prevents skyroot double drops)
|
||||
// For non-log Aether blocks, bit 3 is free (no data usage)
|
||||
static const int PLAYER_PLACED_BIT = 0x8;
|
||||
|
||||
// For log blocks, bit 0 is free (bits 2-3 used for rotation)
|
||||
static const int PLAYER_PLACED_BIT_LOG = 0x1;
|
||||
|
||||
// Returns true if the player is currently holding a skyroot tool
|
||||
static bool isSkyrootTool(shared_ptr<Player> player);
|
||||
|
||||
// Spawns an extra set of drops for the skyroot double-drop bonus.
|
||||
// Call this after the normal playerDestroy has already run.
|
||||
static void spawnSkyrootBonusDrops(Tile *tile, Level *level, shared_ptr<Player> player, int x, int y, int z, int data);
|
||||
|
||||
protected:
|
||||
AetherNaturalTile(int id, Material *material);
|
||||
|
||||
public:
|
||||
virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr<Mob> by);
|
||||
virtual void playerDestroy(Level *level, shared_ptr<Player> player, int x, int y, int z, int data);
|
||||
};
|
||||
@@ -0,0 +1,64 @@
|
||||
#include "stdafx.h"
|
||||
#include "AetherOreTile.h"
|
||||
#include "AetherNaturalTile.h"
|
||||
#include "net.minecraft.world.item.h"
|
||||
#include "net.minecraft.world.item.enchantment.h"
|
||||
#include "net.minecraft.world.entity.player.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
|
||||
AetherOreTile::AetherOreTile(int id) : Tile(id, Material::stone)
|
||||
{
|
||||
}
|
||||
|
||||
int AetherOreTile::getResource(int data, Random *random, int playerBonusLevel)
|
||||
{
|
||||
// Ambrosium ore drops ambrosium shard (item), zanite ore drops zanite gemstone (item)
|
||||
// Gravitite ore drops itself (needs smelting)
|
||||
if (id == Tile::ambrosiumOre_Id) return Item::ambrosiumShard_Id;
|
||||
if (id == Tile::zaniteOre_Id) return Item::zaniteGemstone_Id;
|
||||
return id; // gravitite drops itself
|
||||
}
|
||||
|
||||
int AetherOreTile::getResourceCount(Random *random)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void AetherOreTile::spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel)
|
||||
{
|
||||
Tile::spawnResources(level, x, y, z, data, odds, playerBonusLevel);
|
||||
|
||||
if (getResource(data, level->random, playerBonusLevel) != id)
|
||||
{
|
||||
int xpCount = 0;
|
||||
if (id == Tile::ambrosiumOre_Id)
|
||||
{
|
||||
xpCount = Mth::nextInt(level->random, 0, 2);
|
||||
}
|
||||
else if (id == Tile::zaniteOre_Id)
|
||||
{
|
||||
xpCount = Mth::nextInt(level->random, 2, 5);
|
||||
}
|
||||
popExperience(level, x, y, z, xpCount);
|
||||
}
|
||||
}
|
||||
|
||||
void AetherOreTile::setPlacedBy(Level *level, int x, int y, int z, shared_ptr<Mob> by)
|
||||
{
|
||||
// Mark as player-placed so skyroot tools won't double-drop
|
||||
int data = level->getData(x, y, z);
|
||||
level->setData(x, y, z, data | AetherNaturalTile::PLAYER_PLACED_BIT);
|
||||
}
|
||||
|
||||
void AetherOreTile::playerDestroy(Level *level, shared_ptr<Player> player, int x, int y, int z, int data)
|
||||
{
|
||||
int cleanData = data & ~AetherNaturalTile::PLAYER_PLACED_BIT;
|
||||
bool isPlayerPlaced = (data & AetherNaturalTile::PLAYER_PLACED_BIT) != 0;
|
||||
|
||||
Tile::playerDestroy(level, player, x, y, z, cleanData);
|
||||
|
||||
if (!isPlayerPlaced && AetherNaturalTile::isSkyrootTool(player))
|
||||
{
|
||||
AetherNaturalTile::spawnSkyrootBonusDrops(this, level, player, x, y, z, cleanData);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
#include "Tile.h"
|
||||
|
||||
class Random;
|
||||
class Player;
|
||||
|
||||
class AetherOreTile : public Tile
|
||||
{
|
||||
public:
|
||||
AetherOreTile(int id);
|
||||
virtual int getResource(int data, Random *random, int playerBonusLevel);
|
||||
virtual int getResourceCount(Random *random);
|
||||
virtual void spawnResources(Level *level, int x, int y, int z, int data, float odds, int playerBonusLevel);
|
||||
virtual void setPlacedBy(Level *level, int x, int y, int z, shared_ptr<Mob> by);
|
||||
virtual void playerDestroy(Level *level, shared_ptr<Player> player, int x, int y, int z, int data);
|
||||
};
|
||||
@@ -0,0 +1,200 @@
|
||||
#include "stdafx.h"
|
||||
#include "net.minecraft.world.entity.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.level.dimension.h"
|
||||
#include "net.minecraft.world.item.h"
|
||||
#include "AetherPortalTile.h"
|
||||
|
||||
AetherPortalTile::AetherPortalTile(int id) : HalfTransparentTile(id, L"water", Material::portal, false)
|
||||
{
|
||||
setTicking(true);
|
||||
}
|
||||
|
||||
void AetherPortalTile::tick(Level *level, int x, int y, int z, Random *random)
|
||||
{
|
||||
HalfTransparentTile::tick(level, x, y, z, random);
|
||||
}
|
||||
|
||||
AABB *AetherPortalTile::getAABB(Level *level, int x, int y, int z)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void AetherPortalTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr<TileEntity> forceEntity)
|
||||
{
|
||||
if (level->getTile(x - 1, y, z) == id || level->getTile(x + 1, y, z) == id)
|
||||
{
|
||||
float xr = 8 / 16.0f;
|
||||
float yr = 2 / 16.0f;
|
||||
this->setShape(0.5f - xr, 0, 0.5f - yr, 0.5f + xr, 1, 0.5f + yr);
|
||||
}
|
||||
else
|
||||
{
|
||||
float xr = 2 / 16.0f;
|
||||
float yr = 8 / 16.0f;
|
||||
this->setShape(0.5f - xr, 0, 0.5f - yr, 0.5f + xr, 1, 0.5f + yr);
|
||||
}
|
||||
}
|
||||
|
||||
bool AetherPortalTile::isSolidRender(bool isServerLevel)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AetherPortalTile::isCubeShaped()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AetherPortalTile::trySpawnPortal(Level *level, int x, int y, int z, bool actuallySpawn)
|
||||
{
|
||||
// The Aether portal uses a glowstone frame (like the Nether portal uses obsidian)
|
||||
int xd = 0, zd = 0;
|
||||
if (level->getTile(x - 1, y, z) == Tile::lightGem_Id || level->getTile(x + 1, y, z) == Tile::lightGem_Id) xd = 1;
|
||||
if (level->getTile(x, y, z - 1) == Tile::lightGem_Id || level->getTile(x, y, z + 1) == Tile::lightGem_Id) zd = 1;
|
||||
if (xd == zd) return false;
|
||||
|
||||
if (level->getTile(x - xd, y, z - zd) == 0) { x -= xd; z -= zd; }
|
||||
|
||||
for (int xx = -1; xx <= 2; xx++)
|
||||
{
|
||||
for (int yy = -1; yy <= 3; yy++)
|
||||
{
|
||||
bool edge = (xx == -1) || (xx == 2) || (yy == -1) || (yy == 3);
|
||||
if ((xx == -1 || xx == 2) && (yy == -1 || yy == 3)) continue;
|
||||
int t = level->getTile(x + xd * xx, y + yy, z + zd * xx);
|
||||
if (edge)
|
||||
{
|
||||
if (t != Tile::lightGem_Id) return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Interior must be empty or water (since water bucket activates the portal)
|
||||
if (t != 0 && t != Tile::water_Id && t != Tile::calmWater_Id) return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!actuallySpawn) return true;
|
||||
|
||||
level->noNeighborUpdate = true;
|
||||
for (int xx = 0; xx < 2; xx++)
|
||||
{
|
||||
for (int yy = 0; yy < 3; yy++)
|
||||
{
|
||||
level->setTile(x + xd * xx, y + yy, z + zd * xx, Tile::aetherPortalTile_Id);
|
||||
}
|
||||
}
|
||||
level->noNeighborUpdate = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AetherPortalTile::neighborChanged(Level *level, int x, int y, int z, int type)
|
||||
{
|
||||
// Determine portal orientation from adjacent portal blocks
|
||||
int xd = 0;
|
||||
int zd = 1;
|
||||
if (level->getTile(x - 1, y, z) == id || level->getTile(x + 1, y, z) == id)
|
||||
{
|
||||
xd = 1;
|
||||
zd = 0;
|
||||
}
|
||||
|
||||
// Scan down to find the bottom of the portal column
|
||||
int yBottom = y;
|
||||
while (level->getTile(x, yBottom - 1, z) == id)
|
||||
yBottom--;
|
||||
|
||||
// Bottom must be glowstone
|
||||
if (level->getTile(x, yBottom - 1, z) != Tile::lightGem_Id)
|
||||
{
|
||||
level->setTile(x, y, z, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Portal column must be exactly 3 tall with glowstone on top
|
||||
int height = 1;
|
||||
while (height < 4 && level->getTile(x, yBottom + height, z) == id)
|
||||
height++;
|
||||
|
||||
if (height != 3 || level->getTile(x, yBottom + height, z) != Tile::lightGem_Id)
|
||||
{
|
||||
level->setTile(x, y, z, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't allow cross-shaped portals
|
||||
bool we = level->getTile(x - 1, y, z) == id || level->getTile(x + 1, y, z) == id;
|
||||
bool ns = level->getTile(x, y, z - 1) == id || level->getTile(x, y, z + 1) == id;
|
||||
if (we && ns)
|
||||
{
|
||||
level->setTile(x, y, z, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// One neighbor must be glowstone frame, the other must be portal
|
||||
if (!(
|
||||
(level->getTile(x + xd, y, z + zd) == Tile::lightGem_Id && level->getTile(x - xd, y, z - zd) == id) ||
|
||||
(level->getTile(x - xd, y, z - zd) == Tile::lightGem_Id && level->getTile(x + xd, y, z + zd) == id)
|
||||
))
|
||||
{
|
||||
level->setTile(x, y, z, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool AetherPortalTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face)
|
||||
{
|
||||
if (level->getTile(x, y, z) == id) return false;
|
||||
|
||||
bool w = level->getTile(x - 1, y, z) == id && level->getTile(x - 2, y, z) != id;
|
||||
bool e = level->getTile(x + 1, y, z) == id && level->getTile(x + 2, y, z) != id;
|
||||
|
||||
bool n = level->getTile(x, y, z - 1) == id && level->getTile(x, y, z - 2) != id;
|
||||
bool s = level->getTile(x, y, z + 1) == id && level->getTile(x, y, z + 2) != id;
|
||||
|
||||
bool we = w || e;
|
||||
bool ns = n || s;
|
||||
|
||||
if (we && face == 4) return true;
|
||||
if (we && face == 5) return true;
|
||||
if (ns && face == 2) return true;
|
||||
if (ns && face == 3) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int AetherPortalTile::getResourceCount(Random *random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AetherPortalTile::getRenderLayer()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void AetherPortalTile::entityInside(Level *level, int x, int y, int z, shared_ptr<Entity> entity)
|
||||
{
|
||||
// Trigger portal teleportation — use the Aether portal flag
|
||||
if (entity->riding == NULL && entity->rider.lock() == NULL)
|
||||
{
|
||||
entity->handleInsideAetherPortal();
|
||||
}
|
||||
}
|
||||
|
||||
void AetherPortalTile::animateTick(Level *level, int xt, int yt, int zt, Random *random)
|
||||
{
|
||||
// No particles for the Aether portal
|
||||
}
|
||||
|
||||
int AetherPortalTile::cloneTileId(Level *level, int x, int y, int z)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool AetherPortalTile::mayPick()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
#include "HalfTransparentTile.h"
|
||||
#include "Definitions.h"
|
||||
|
||||
class Random;
|
||||
|
||||
class AetherPortalTile : public HalfTransparentTile
|
||||
{
|
||||
public:
|
||||
AetherPortalTile(int id);
|
||||
virtual void tick(Level *level, int x, int y, int z, Random *random);
|
||||
virtual AABB *getAABB(Level *level, int x, int y, int z);
|
||||
virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr<TileEntity> forceEntity = shared_ptr<TileEntity>());
|
||||
virtual bool isSolidRender(bool isServerLevel = false);
|
||||
virtual bool isCubeShaped();
|
||||
virtual bool trySpawnPortal(Level *level, int x, int y, int z, bool actuallySpawn);
|
||||
virtual void neighborChanged(Level *level, int x, int y, int z, int type);
|
||||
virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face);
|
||||
virtual int getResourceCount(Random *random);
|
||||
virtual int getRenderLayer();
|
||||
virtual void entityInside(Level *level, int x, int y, int z, shared_ptr<Entity> entity);
|
||||
virtual void animateTick(Level *level, int xt, int yt, int zt, Random *random);
|
||||
virtual int cloneTileId(Level *level, int x, int y, int z);
|
||||
virtual bool mayPick();
|
||||
};
|
||||
@@ -0,0 +1,64 @@
|
||||
#include "stdafx.h"
|
||||
#include "AetherSaplingTile.h"
|
||||
#include "SkyrootTreeFeature.h"
|
||||
#include "GoldenOakTreeFeature.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.level.tile.h"
|
||||
#include "net.minecraft.world.h"
|
||||
|
||||
AetherSaplingTile::AetherSaplingTile(int id) : AetherBushTile(id)
|
||||
{
|
||||
}
|
||||
|
||||
void AetherSaplingTile::tick(Level *level, int x, int y, int z, Random *random)
|
||||
{
|
||||
if (level->isClientSide) return;
|
||||
|
||||
Bush::tick(level, x, y, z, random);
|
||||
|
||||
if (level->getRawBrightness(x, y + 1, z) >= Level::MAX_BRIGHTNESS - 6)
|
||||
{
|
||||
if (random->nextInt(7) == 0)
|
||||
{
|
||||
int data = level->getData(x, y, z);
|
||||
if ((data & AGE_BIT) == 0)
|
||||
{
|
||||
level->setData(x, y, z, data | AGE_BIT);
|
||||
}
|
||||
else
|
||||
{
|
||||
growTree(level, x, y, z, random);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AetherSaplingTile::growTree(Level *level, int x, int y, int z, Random *random)
|
||||
{
|
||||
Feature *f = NULL;
|
||||
|
||||
if (this->id == Tile::skyrootSapling_Id)
|
||||
{
|
||||
f = new SkyrootTreeFeature(true);
|
||||
}
|
||||
else if (this->id == Tile::goldenOakSapling_Id)
|
||||
{
|
||||
f = new GoldenOakTreeFeature(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove sapling before attempting to place tree
|
||||
level->setTileNoUpdate(x, y, z, 0);
|
||||
|
||||
if (!f->place(level, random, x, y, z))
|
||||
{
|
||||
// Restore sapling if tree placement failed
|
||||
int data = level->getData(x, y, z);
|
||||
level->setTileAndDataNoUpdate(x, y, z, this->id, data);
|
||||
}
|
||||
|
||||
delete f;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
#include "AetherBushTile.h"
|
||||
|
||||
class AetherSaplingTile : public AetherBushTile
|
||||
{
|
||||
friend class Tile;
|
||||
public:
|
||||
static const int AGE_BIT = 8;
|
||||
|
||||
protected:
|
||||
AetherSaplingTile(int id);
|
||||
|
||||
public:
|
||||
virtual void tick(Level *level, int x, int y, int z, Random *random);
|
||||
|
||||
void growTree(Level *level, int x, int y, int z, Random *random);
|
||||
};
|
||||
@@ -24,11 +24,15 @@ const int _ArmorMaterial::chainArray[] = {2, 5, 4, 1};
|
||||
const int _ArmorMaterial::ironArray[] = {2, 6, 5, 2};
|
||||
const int _ArmorMaterial::goldArray[] = {2, 5, 3, 1};
|
||||
const int _ArmorMaterial::diamondArray[] = {3, 8, 6, 3};
|
||||
const int _ArmorMaterial::zaniteArray[] = {2, 6, 5, 2};
|
||||
const int _ArmorMaterial::gravititeArray[] = {3, 8, 6, 3};
|
||||
const _ArmorMaterial *_ArmorMaterial::CLOTH = new _ArmorMaterial(5, _ArmorMaterial::clothArray, 15);
|
||||
const _ArmorMaterial *_ArmorMaterial::CHAIN = new _ArmorMaterial(15, _ArmorMaterial::chainArray, 12);
|
||||
const _ArmorMaterial *_ArmorMaterial::IRON = new _ArmorMaterial(15, _ArmorMaterial::ironArray, 9);
|
||||
const _ArmorMaterial *_ArmorMaterial::GOLD = new _ArmorMaterial(7, _ArmorMaterial::goldArray, 25);
|
||||
const _ArmorMaterial *_ArmorMaterial::DIAMOND = new _ArmorMaterial(33, _ArmorMaterial::diamondArray, 10);
|
||||
const _ArmorMaterial *_ArmorMaterial::ZANITE = new _ArmorMaterial(15, _ArmorMaterial::zaniteArray, 9);
|
||||
const _ArmorMaterial *_ArmorMaterial::GRAVITITE = new _ArmorMaterial(33, _ArmorMaterial::gravititeArray, 10);
|
||||
|
||||
_ArmorMaterial::ArmorMaterial(int durabilityMultiplier, const int slotProtections[], int enchantmentValue)
|
||||
{
|
||||
|
||||
@@ -27,12 +27,16 @@ public:
|
||||
static const int ironArray[];
|
||||
static const int goldArray[];
|
||||
static const int diamondArray[];
|
||||
static const int zaniteArray[];
|
||||
static const int gravititeArray[];
|
||||
public:
|
||||
static const ArmorMaterial *CLOTH;
|
||||
static const ArmorMaterial *CHAIN;
|
||||
static const ArmorMaterial *IRON;
|
||||
static const ArmorMaterial *GOLD;
|
||||
static const ArmorMaterial *DIAMOND;
|
||||
static const ArmorMaterial *ZANITE;
|
||||
static const ArmorMaterial *GRAVITITE;
|
||||
|
||||
private:
|
||||
int durabilityMultiplier;
|
||||
|
||||
@@ -48,30 +48,45 @@ void ArmorRecipes::_init()
|
||||
ADD_OBJECT(map[0],Item::ironIngot);
|
||||
ADD_OBJECT(map[0],Item::diamond);
|
||||
ADD_OBJECT(map[0],Item::goldIngot);
|
||||
// Aether
|
||||
ADD_OBJECT(map[0],Item::zaniteGemstone);
|
||||
ADD_OBJECT(map[0],Item::gravititePlate);
|
||||
|
||||
ADD_OBJECT(map[1],Item::helmet_cloth);
|
||||
// ADD_OBJECT(map[1],Item::helmet_chain);
|
||||
ADD_OBJECT(map[1],Item::helmet_iron);
|
||||
ADD_OBJECT(map[1],Item::helmet_diamond);
|
||||
ADD_OBJECT(map[1],Item::helmet_gold);
|
||||
// Aether
|
||||
ADD_OBJECT(map[1],Item::helmet_zanite);
|
||||
ADD_OBJECT(map[1],Item::helmet_gravitite);
|
||||
|
||||
ADD_OBJECT(map[2],Item::chestplate_cloth);
|
||||
// ADD_OBJECT(map[2],Item::chestplate_chain);
|
||||
ADD_OBJECT(map[2],Item::chestplate_iron);
|
||||
ADD_OBJECT(map[2],Item::chestplate_diamond);
|
||||
ADD_OBJECT(map[2],Item::chestplate_gold);
|
||||
// Aether
|
||||
ADD_OBJECT(map[2],Item::chestplate_zanite);
|
||||
ADD_OBJECT(map[2],Item::chestplate_gravitite);
|
||||
|
||||
ADD_OBJECT(map[3],Item::leggings_cloth);
|
||||
// ADD_OBJECT(map[3],Item::leggings_chain);
|
||||
ADD_OBJECT(map[3],Item::leggings_iron);
|
||||
ADD_OBJECT(map[3],Item::leggings_diamond);
|
||||
ADD_OBJECT(map[3],Item::leggings_gold);
|
||||
// Aether
|
||||
ADD_OBJECT(map[3],Item::leggings_zanite);
|
||||
ADD_OBJECT(map[3],Item::leggings_gravitite);
|
||||
|
||||
ADD_OBJECT(map[4],Item::boots_cloth);
|
||||
// ADD_OBJECT(map[4],Item::boots_chain);
|
||||
ADD_OBJECT(map[4],Item::boots_iron);
|
||||
ADD_OBJECT(map[4],Item::boots_diamond);
|
||||
ADD_OBJECT(map[4],Item::boots_gold);
|
||||
// Aether
|
||||
ADD_OBJECT(map[4],Item::boots_zanite);
|
||||
ADD_OBJECT(map[4],Item::boots_gravitite);
|
||||
}
|
||||
|
||||
// 4J-PB added for quick equip in the inventory
|
||||
@@ -83,7 +98,9 @@ ArmorRecipes::_eArmorType ArmorRecipes::GetArmorType(int iId)
|
||||
case Item::helmet_chain_Id:
|
||||
case Item::helmet_iron_Id:
|
||||
case Item::helmet_diamond_Id:
|
||||
case Item::helmet_gold_Id:
|
||||
case Item::helmet_gold_Id:
|
||||
case Item::helmet_zanite_Id:
|
||||
case Item::helmet_gravitite_Id:
|
||||
return eArmorType_Helmet;
|
||||
break;
|
||||
|
||||
@@ -92,6 +109,8 @@ ArmorRecipes::_eArmorType ArmorRecipes::GetArmorType(int iId)
|
||||
case Item::chestplate_iron_Id:
|
||||
case Item::chestplate_diamond_Id:
|
||||
case Item::chestplate_gold_Id:
|
||||
case Item::chestplate_zanite_Id:
|
||||
case Item::chestplate_gravitite_Id:
|
||||
return eArmorType_Chestplate;
|
||||
break;
|
||||
|
||||
@@ -100,6 +119,8 @@ ArmorRecipes::_eArmorType ArmorRecipes::GetArmorType(int iId)
|
||||
case Item::leggings_iron_Id:
|
||||
case Item::leggings_diamond_Id:
|
||||
case Item::leggings_gold_Id:
|
||||
case Item::leggings_zanite_Id:
|
||||
case Item::leggings_gravitite_Id:
|
||||
return eArmorType_Leggings;
|
||||
break;
|
||||
|
||||
@@ -108,6 +129,8 @@ ArmorRecipes::_eArmorType ArmorRecipes::GetArmorType(int iId)
|
||||
case Item::boots_iron_Id:
|
||||
case Item::boots_diamond_Id:
|
||||
case Item::boots_gold_Id:
|
||||
case Item::boots_zanite_Id:
|
||||
case Item::boots_gravitite_Id:
|
||||
return eArmorType_Boots;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ Biome *Biome::smallerExtremeHills = NULL;
|
||||
|
||||
Biome *Biome::jungle = NULL;
|
||||
Biome *Biome::jungleHills = NULL;
|
||||
Biome *Biome::aether = NULL;
|
||||
|
||||
|
||||
void Biome::staticCtor()
|
||||
@@ -78,6 +79,8 @@ void Biome::staticCtor()
|
||||
|
||||
Biome::jungle = (new JungleBiome(21))->setColor(0x537b09)->setName(L"Jungle")->setLeafColor(0x537b09)->setTemperatureAndDownfall(1.2f, 0.9f)->setDepthAndScale(0.2f, 0.4f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Jungle, eMinecraftColour_Foliage_Jungle, eMinecraftColour_Water_Jungle,eMinecraftColour_Sky_Jungle);
|
||||
Biome::jungleHills = (new JungleBiome(22))->setColor(0x2c4205)->setName(L"JungleHills")->setLeafColor(0x537b09)->setTemperatureAndDownfall(1.2f, 0.9f)->setDepthAndScale(1.8f, 0.5f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_JungleHills, eMinecraftColour_Foliage_JungleHills, eMinecraftColour_Water_JungleHills,eMinecraftColour_Sky_JungleHills);
|
||||
|
||||
Biome::aether = (new AetherBiome(23))->setColor(0x7EC8E3)->setName(L"Aether")->setNoRain()->setTemperatureAndDownfall(0.5f, 0.0f)->setLeafFoliageWaterSkyColor(eMinecraftColour_Grass_Aether, eMinecraftColour_Foliage_Aether, eMinecraftColour_Water_Aether, eMinecraftColour_Sky_Aether);
|
||||
}
|
||||
|
||||
Biome::Biome(int id) : id(id)
|
||||
|
||||
@@ -46,8 +46,9 @@ public:
|
||||
static Biome *smallerExtremeHills;
|
||||
static Biome *jungle;
|
||||
static Biome *jungleHills;
|
||||
static Biome *aether;
|
||||
|
||||
static const int BIOME_COUNT = 23; // 4J Stu added
|
||||
static const int BIOME_COUNT = 24; // 4J Stu added
|
||||
|
||||
public:
|
||||
wstring m_name;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
#include "stdafx.h"
|
||||
#include "BlueAercloudTile.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.entity.h"
|
||||
#include "net.minecraft.world.h"
|
||||
|
||||
BlueAercloudTile::BlueAercloudTile(int id) : AercloudTile(id)
|
||||
{
|
||||
}
|
||||
|
||||
int BlueAercloudTile::getColor() const
|
||||
{
|
||||
return 0xA3D1FF; // Blue
|
||||
}
|
||||
|
||||
int BlueAercloudTile::getColor(int auxData)
|
||||
{
|
||||
return 0xA3D1FF;
|
||||
}
|
||||
|
||||
int BlueAercloudTile::getColor(LevelSource *level, int x, int y, int z)
|
||||
{
|
||||
return 0xA3D1FF;
|
||||
}
|
||||
|
||||
int BlueAercloudTile::getColor(LevelSource *level, int x, int y, int z, int data)
|
||||
{
|
||||
return 0xA3D1FF;
|
||||
}
|
||||
|
||||
void BlueAercloudTile::entityInside(Level *level, int x, int y, int z, shared_ptr<Entity> entity)
|
||||
{
|
||||
// Slow horizontal movement like regular aercloud
|
||||
entity->xd *= 0.4;
|
||||
entity->zd *= 0.4;
|
||||
|
||||
entity->fallDistance = 0;
|
||||
entity->yd = 1.25;
|
||||
|
||||
// Spawn water splash particles at the entity's feet
|
||||
float bbWidth = entity->bbWidth;
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
float xo = (level->random->nextFloat() * 2 - 1) * bbWidth;
|
||||
float zo = (level->random->nextFloat() * 2 - 1) * bbWidth;
|
||||
level->addParticle(eParticleType_splash, entity->x + xo, entity->y, entity->z + zo, 0, 0.25, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
#include "AercloudTile.h"
|
||||
|
||||
class BlueAercloudTile : public AercloudTile
|
||||
{
|
||||
friend class Tile;
|
||||
protected:
|
||||
BlueAercloudTile(int id);
|
||||
|
||||
public:
|
||||
virtual int getColor() const;
|
||||
virtual int getColor(int auxData);
|
||||
virtual int getColor(LevelSource *level, int x, int y, int z);
|
||||
virtual int getColor(LevelSource *level, int x, int y, int z, int data);
|
||||
|
||||
virtual void entityInside(Level *level, int x, int y, int z, shared_ptr<Entity> entity);
|
||||
};
|
||||
@@ -251,6 +251,14 @@ bool BucketItem::emptyBucket(Level *level, double x, double y, double z, int xt,
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if water bucket is being placed inside a glowstone frame — Aether portal
|
||||
if (content == Tile::water_Id && level->getTile(xt, yt - 1, zt) == Tile::lightGem_Id)
|
||||
{
|
||||
if (Tile::aetherPortalTile->trySpawnPortal(level, xt, yt, zt, true))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
level->setTileAndData(xt, yt, zt, content, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,8 @@ bool Bush::mayPlace(Level *level, int x, int y, int z)
|
||||
|
||||
bool Bush::mayPlaceOn(int tile)
|
||||
{
|
||||
return tile == Tile::grass_Id || tile == Tile::dirt_Id || tile == Tile::farmland_Id;
|
||||
return tile == Tile::grass_Id || tile == Tile::dirt_Id || tile == Tile::farmland_Id
|
||||
|| tile == Tile::aetherGrass_Id || tile == Tile::aetherDirt_Id;
|
||||
}
|
||||
|
||||
void Bush::neighborChanged(Level *level, int x, int y, int z, int type)
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "HellDimension.h"
|
||||
#include "NormalDimension.h"
|
||||
#include "TheEndDimension.h"
|
||||
#include "AetherDimension.h"
|
||||
#include "net.minecraft.world.level.tile.h"
|
||||
#include "..\Minecraft.Client\Minecraft.h"
|
||||
#include "..\Minecraft.Client\Common\Colours\ColourTable.h"
|
||||
@@ -184,6 +185,7 @@ Dimension *Dimension::getNew(int id)
|
||||
if (id == -1) return new HellDimension();
|
||||
if (id == 0) return new NormalDimension();
|
||||
if (id == 1) return new TheEndDimension();
|
||||
if (id == 2) return new AetherDimension();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -141,6 +141,18 @@ bool DyePowderItem::useOn(shared_ptr<ItemInstance> itemInstance, shared_ptr<Play
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (tile == Tile::skyrootSapling_Id || tile == Tile::goldenOakSapling_Id)
|
||||
{
|
||||
if(!bTestUseOnOnly)
|
||||
{
|
||||
if (!level->isClientSide)
|
||||
{
|
||||
((AetherSaplingTile *) Tile::tiles[tile])->growTree(level, x, y, z, level->random);
|
||||
itemInstance->count--;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (tile == Tile::mushroom1_Id || tile == Tile::mushroom2_Id)
|
||||
{
|
||||
if(!bTestUseOnOnly)
|
||||
|
||||
@@ -1665,6 +1665,10 @@ void Entity::handleInsidePortal()
|
||||
{
|
||||
}
|
||||
|
||||
void Entity::handleInsideAetherPortal()
|
||||
{
|
||||
}
|
||||
|
||||
void Entity::lerpMotion(double xd, double yd, double zd)
|
||||
{
|
||||
this->xd = xd;
|
||||
|
||||
@@ -301,6 +301,7 @@ public:
|
||||
virtual float getPickRadius();
|
||||
virtual Vec3 *getLookAngle();
|
||||
virtual void handleInsidePortal();
|
||||
virtual void handleInsideAetherPortal();
|
||||
virtual void lerpMotion(double xd, double yd, double zd);
|
||||
virtual void handleEntityEvent(byte eventId);
|
||||
virtual void animateHurt();
|
||||
|
||||
@@ -40,6 +40,9 @@ FurnaceRecipes::FurnaceRecipes()
|
||||
addFurnaceRecipy(Tile::lapisOre_Id, new ItemInstance(Item::dye_powder, 1, DyePowderItem::BLUE), .2f);
|
||||
addFurnaceRecipy(Tile::netherQuartz_Id, new ItemInstance(Item::netherQuartz), .2f);
|
||||
|
||||
// Aether
|
||||
addFurnaceRecipy(Tile::gravititeOre_Id, new ItemInstance(Item::gravititePlate), 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#include "stdafx.h"
|
||||
#include "GoldAercloudTile.h"
|
||||
|
||||
GoldAercloudTile::GoldAercloudTile(int id) : AercloudTile(id)
|
||||
{
|
||||
}
|
||||
|
||||
int GoldAercloudTile::getColor() const
|
||||
{
|
||||
return 0xFFEF91; // Gold
|
||||
}
|
||||
|
||||
int GoldAercloudTile::getColor(int auxData)
|
||||
{
|
||||
return 0xFFEF91;
|
||||
}
|
||||
|
||||
int GoldAercloudTile::getColor(LevelSource *level, int x, int y, int z)
|
||||
{
|
||||
return 0xFFEF91;
|
||||
}
|
||||
|
||||
int GoldAercloudTile::getColor(LevelSource *level, int x, int y, int z, int data)
|
||||
{
|
||||
return 0xFFEF91;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include "AercloudTile.h"
|
||||
|
||||
class GoldAercloudTile : public AercloudTile
|
||||
{
|
||||
friend class Tile;
|
||||
protected:
|
||||
GoldAercloudTile(int id);
|
||||
|
||||
public:
|
||||
virtual int getColor() const;
|
||||
virtual int getColor(int auxData);
|
||||
virtual int getColor(LevelSource *level, int x, int y, int z);
|
||||
virtual int getColor(LevelSource *level, int x, int y, int z, int data);
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
#include "stdafx.h"
|
||||
#include "GoldenOakLogTile.h"
|
||||
#include "AetherNaturalTile.h"
|
||||
#include "net.minecraft.world.item.h"
|
||||
#include "net.minecraft.world.entity.player.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "Mth.h"
|
||||
|
||||
GoldenOakLogTile::GoldenOakLogTile(int id, const wstring &sideTexture, const wstring &topTexture)
|
||||
: SkyrootLogTile(id, sideTexture, topTexture)
|
||||
{
|
||||
}
|
||||
|
||||
int GoldenOakLogTile::getResource(int data, Random *random, int playerBonusLevel)
|
||||
{
|
||||
// Golden oak logs drop skyroot logs instead of themselves
|
||||
return Tile::skyrootLog_Id;
|
||||
}
|
||||
|
||||
void GoldenOakLogTile::playerDestroy(Level *level, shared_ptr<Player> player, int x, int y, int z, int data)
|
||||
{
|
||||
// Handle skyroot log drops (1, or 2 with skyroot hatchet)
|
||||
SkyrootLogTile::playerDestroy(level, player, x, y, z, data);
|
||||
|
||||
// Additionally drop 1-2 golden amber
|
||||
if (!level->isClientSide)
|
||||
{
|
||||
int count = 1 + Mth::nextInt(level->random, 0, 1);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
popResource(level, x, y, z, shared_ptr<ItemInstance>(new ItemInstance(Item::goldenAmber_Id, 1, 0)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
#include "SkyrootLogTile.h"
|
||||
|
||||
class Player;
|
||||
|
||||
class GoldenOakLogTile : public SkyrootLogTile
|
||||
{
|
||||
friend class Tile;
|
||||
|
||||
protected:
|
||||
GoldenOakLogTile(int id, const wstring &sideTexture, const wstring &topTexture);
|
||||
|
||||
public:
|
||||
virtual int getResource(int data, Random *random, int playerBonusLevel);
|
||||
virtual void playerDestroy(Level *level, shared_ptr<Player> player, int x, int y, int z, int data);
|
||||
};
|
||||
@@ -0,0 +1,113 @@
|
||||
#include "stdafx.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.level.tile.h"
|
||||
#include "GoldenOakTreeFeature.h"
|
||||
|
||||
GoldenOakTreeFeature::GoldenOakTreeFeature(bool doUpdate) : Feature(doUpdate)
|
||||
{
|
||||
}
|
||||
|
||||
bool GoldenOakTreeFeature::place(Level *level, Random *random, int x, int y, int z)
|
||||
{
|
||||
// Spruce-style conical tree with golden oak logs and leaves
|
||||
int treeHeight = random->nextInt(4) + 6;
|
||||
int trunkHeight = 1 + random->nextInt(2);
|
||||
int topHeight = treeHeight - trunkHeight;
|
||||
int leafRadius = 2 + random->nextInt(2);
|
||||
|
||||
bool free = true;
|
||||
if (y < 1 || y + treeHeight + 1 > Level::maxBuildHeight) return false;
|
||||
|
||||
// 4J Stu Added to stop tree features generating areas previously placed by game rule generation
|
||||
if (app.getLevelGenerationOptions() != NULL)
|
||||
{
|
||||
LevelGenerationOptions *levelGenOptions = app.getLevelGenerationOptions();
|
||||
bool intersects = levelGenOptions->checkIntersects(x - leafRadius, y - 1, z - leafRadius, x + leafRadius, y + treeHeight, z + leafRadius);
|
||||
if (intersects)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure there is enough space
|
||||
for (int yy = y; yy <= y + 1 + treeHeight && free; yy++)
|
||||
{
|
||||
int r = 1;
|
||||
if ((yy - y) < trunkHeight)
|
||||
{
|
||||
r = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
r = leafRadius;
|
||||
}
|
||||
for (int xx = x - r; xx <= x + r && free; xx++)
|
||||
{
|
||||
for (int zz = z - r; zz <= z + r && free; zz++)
|
||||
{
|
||||
if (yy >= 0 && yy < Level::maxBuildHeight)
|
||||
{
|
||||
int tt = level->getTile(xx, yy, zz);
|
||||
if (tt != 0 && tt != Tile::goldenOakLeaves_Id && tt != Tile::skyrootLeaves_Id) free = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
free = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!free) return false;
|
||||
|
||||
// Must stand on aether ground
|
||||
int belowTile = level->getTile(x, y - 1, z);
|
||||
if ((belowTile != Tile::aetherGrass_Id && belowTile != Tile::aetherDirt_Id) || y >= Level::maxBuildHeight - treeHeight - 1) return false;
|
||||
|
||||
placeBlock(level, x, y - 1, z, Tile::aetherDirt_Id);
|
||||
|
||||
// Place leaf canopy (tapered cone like spruce)
|
||||
int currentRadius = random->nextInt(2);
|
||||
int maxRadius = 1;
|
||||
int minRadius = 0;
|
||||
for (int heightPos = 0; heightPos <= topHeight; heightPos++)
|
||||
{
|
||||
const int yy = y + treeHeight - heightPos;
|
||||
|
||||
for (int xx = x - currentRadius; xx <= x + currentRadius; xx++)
|
||||
{
|
||||
int xo = xx - (x);
|
||||
for (int zz = z - currentRadius; zz <= z + currentRadius; zz++)
|
||||
{
|
||||
int zo = zz - (z);
|
||||
if (abs(xo) == currentRadius && abs(zo) == currentRadius && currentRadius > 0) continue;
|
||||
if (!Tile::solid[level->getTile(xx, yy, zz)]) placeBlock(level, xx, yy, zz, Tile::goldenOakLeaves_Id, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (currentRadius >= maxRadius)
|
||||
{
|
||||
currentRadius = minRadius;
|
||||
minRadius = 1;
|
||||
maxRadius += 1;
|
||||
if (maxRadius > leafRadius)
|
||||
{
|
||||
maxRadius = leafRadius;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
currentRadius = currentRadius + 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Place trunk
|
||||
int topOffset = random->nextInt(3);
|
||||
for (int hh = 0; hh < treeHeight - topOffset; hh++)
|
||||
{
|
||||
int t = level->getTile(x, y + hh, z);
|
||||
if (t == 0 || t == Tile::goldenOakLeaves_Id || t == Tile::skyrootLeaves_Id) placeBlock(level, x, y + hh, z, Tile::goldenOakLog_Id, 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "Feature.h"
|
||||
|
||||
class GoldenOakTreeFeature : public Feature
|
||||
{
|
||||
public:
|
||||
GoldenOakTreeFeature(bool doUpdate);
|
||||
|
||||
virtual bool place(Level *level, Random *random, int x, int y, int z);
|
||||
};
|
||||
@@ -26,6 +26,16 @@ bool HalfTransparentTile::blocksLight()
|
||||
return false;
|
||||
}
|
||||
|
||||
bool HalfTransparentTile::isCubeShaped()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int HalfTransparentTile::getRenderLayer()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void HalfTransparentTile::registerIcons(IconRegister *iconRegister)
|
||||
{
|
||||
icon = iconRegister->registerIcon(texture);
|
||||
|
||||
@@ -6,6 +6,7 @@ class ChunkRebuildData;
|
||||
class HalfTransparentTile : public Tile
|
||||
{
|
||||
friend class ChunkRebuildData;
|
||||
friend class Tile;
|
||||
private:
|
||||
bool allowSame;
|
||||
wstring texture;
|
||||
@@ -15,5 +16,7 @@ public:
|
||||
virtual bool isSolidRender(bool isServerLevel = false);
|
||||
virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face);
|
||||
virtual bool blocksLight();
|
||||
virtual bool isCubeShaped();
|
||||
virtual int getRenderLayer();
|
||||
void registerIcons(IconRegister *iconRegister);
|
||||
};
|
||||
|
||||
@@ -25,6 +25,13 @@ const _Tier *_Tier::IRON = new _Tier(2, 250, 6, 2, 14); //
|
||||
const _Tier *_Tier::DIAMOND = new _Tier(3, 1561, 8, 3, 10); //
|
||||
const _Tier *_Tier::GOLD = new _Tier(0, 32, 12, 0, 22);
|
||||
|
||||
// Aether tiers (Skyroot=Wood, Holystone=Stone, Zanite=Iron, Gravitite=Diamond, Phoenix=Diamond)
|
||||
const _Tier *_Tier::SKYROOT = new _Tier(0, 59, 2, 0, 15);
|
||||
const _Tier *_Tier::HOLYSTONE = new _Tier(1, 131, 4, 1, 5);
|
||||
const _Tier *_Tier::ZANITE = new _Tier(2, 250, 6, 2, 14);
|
||||
const _Tier *_Tier::GRAVITITE = new _Tier(3, 1561, 8, 3, 10);
|
||||
const _Tier *_Tier::PHOENIX = new _Tier(3, 1561, 8, 3, 10);
|
||||
|
||||
Random *Item::random = new Random();
|
||||
|
||||
ItemArray Item::items = ItemArray( ITEM_NUM_COUNT );
|
||||
@@ -233,6 +240,67 @@ Item *Item::pumpkinPie = NULL;
|
||||
EnchantedBookItem *Item::enchantedBook = NULL;
|
||||
Item *Item::netherQuartz = NULL;
|
||||
|
||||
// Aether items
|
||||
Item *Item::ambrosiumShard = NULL;
|
||||
Item *Item::zaniteGemstone = NULL;
|
||||
Item *Item::flamingGemstone = NULL;
|
||||
Item *Item::skyrootStick = NULL;
|
||||
Item *Item::aechorPetal = NULL;
|
||||
Item *Item::goldenAmber = NULL;
|
||||
Item *Item::gummieSwet = NULL;
|
||||
Item *Item::lifeShard = NULL;
|
||||
Item *Item::regenerationStone = NULL;
|
||||
Item *Item::moaEgg = NULL;
|
||||
Item *Item::goldenFeather = NULL;
|
||||
Item *Item::aetherKey = NULL;
|
||||
Item *Item::skyrootBucket = NULL;
|
||||
Item *Item::skyrootBucketWater = NULL;
|
||||
Item *Item::skyrootBucketMilk = NULL;
|
||||
Item *Item::skyrootBucketPoison = NULL;
|
||||
Item *Item::dartGolden = NULL;
|
||||
Item *Item::dartEnchanted = NULL;
|
||||
Item *Item::dartPoison = NULL;
|
||||
Item *Item::dartShooter = NULL;
|
||||
Item *Item::dartShooterEnchanted = NULL;
|
||||
Item *Item::dartShooterPoison = NULL;
|
||||
Item *Item::cloudParachute = NULL;
|
||||
Item *Item::cloudStaff = NULL;
|
||||
Item *Item::natureStaff = NULL;
|
||||
Item *Item::repulsionShield = NULL;
|
||||
Item *Item::aetherLance = NULL;
|
||||
Item *Item::pigSlayer = NULL;
|
||||
Item *Item::vampireBlade = NULL;
|
||||
Item *Item::lightningKnife = NULL;
|
||||
Item *Item::sword_skyroot = NULL;
|
||||
Item *Item::shovel_skyroot = NULL;
|
||||
Item *Item::pickAxe_skyroot = NULL;
|
||||
Item *Item::hatchet_skyroot = NULL;
|
||||
Item *Item::sword_holystone = NULL;
|
||||
Item *Item::shovel_holystone = NULL;
|
||||
Item *Item::pickAxe_holystone = NULL;
|
||||
Item *Item::hatchet_holystone = NULL;
|
||||
Item *Item::sword_zanite = NULL;
|
||||
Item *Item::shovel_zanite = NULL;
|
||||
Item *Item::pickAxe_zanite = NULL;
|
||||
Item *Item::hatchet_zanite = NULL;
|
||||
Item *Item::sword_gravitite = NULL;
|
||||
Item *Item::shovel_gravitite = NULL;
|
||||
Item *Item::pickAxe_gravitite = NULL;
|
||||
Item *Item::hatchet_gravitite = NULL;
|
||||
Item *Item::phoenixSword = NULL;
|
||||
Item *Item::phoenixShovel = NULL;
|
||||
Item *Item::phoenixPickaxe = NULL;
|
||||
Item *Item::phoenixAxe = NULL;
|
||||
ArmorItem *Item::helmet_zanite = NULL;
|
||||
ArmorItem *Item::chestplate_zanite = NULL;
|
||||
ArmorItem *Item::leggings_zanite = NULL;
|
||||
ArmorItem *Item::boots_zanite = NULL;
|
||||
ArmorItem *Item::helmet_gravitite = NULL;
|
||||
ArmorItem *Item::chestplate_gravitite = NULL;
|
||||
ArmorItem *Item::leggings_gravitite = NULL;
|
||||
ArmorItem *Item::boots_gravitite = NULL;
|
||||
Item *Item::gravititePlate = NULL;
|
||||
|
||||
|
||||
void Item::staticCtor()
|
||||
{
|
||||
@@ -319,7 +387,7 @@ void Item::staticCtor()
|
||||
Item::apple = ( new FoodItem(4, 4, FoodConstants::FOOD_SATURATION_LOW, false) ) ->setTextureName(L"apple")->setDescriptionId(IDS_ITEM_APPLE)->setUseDescriptionId(IDS_DESC_APPLE);
|
||||
Item::coal = ( new CoalItem(7) ) ->setTextureName(L"coal")->setDescriptionId(IDS_ITEM_COAL)->setUseDescriptionId(IDS_DESC_COAL);
|
||||
Item::diamond = ( new Item(8) ) ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_diamond)->setTextureName(L"diamond")->setDescriptionId(IDS_ITEM_DIAMOND)->setUseDescriptionId(IDS_DESC_DIAMONDS);
|
||||
Item::stick = ( new Item(24) ) ->setTextureName(L"stick")->handEquipped()->setDescriptionId(IDS_ITEM_STICK)->setUseDescriptionId(IDS_DESC_STICK);
|
||||
Item::stick = ( new Item(24) ) ->setBaseItemTypeAndMaterial(eBaseItemType_stick, eMaterial_wood)->setTextureName(L"stick")->handEquipped()->setDescriptionId(IDS_ITEM_STICK)->setUseDescriptionId(IDS_DESC_STICK);
|
||||
Item::mushroomStew = ( new BowlFoodItem(26, 6) ) ->setTextureName(L"mushroomStew")->setDescriptionId(IDS_ITEM_MUSHROOM_STEW)->setUseDescriptionId(IDS_DESC_MUSHROOMSTEW);
|
||||
|
||||
Item::string = ( new TilePlanterItem(31, Tile::tripWire) ) ->setTextureName(L"string")->setDescriptionId(IDS_ITEM_STRING)->setUseDescriptionId(IDS_DESC_STRING);
|
||||
@@ -465,6 +533,91 @@ void Item::staticCtor()
|
||||
|
||||
EnchantedBookItem::enchantedBook = (EnchantedBookItem *)(new EnchantedBookItem(147)) ->setMaxStackSize(1)->setTextureName(L"enchantedBook")->setDescriptionId(IDS_ITEM_ENCHANTED_BOOK)->setUseDescriptionId(IDS_DESC_ENCHANTED_BOOK);
|
||||
Item::netherQuartz = (new Item(150))->setTextureName(L"netherquartz")->setDescriptionId(IDS_ITEM_NETHER_QUARTZ)->setUseDescriptionId(IDS_DESC_NETHER_QUARTZ);
|
||||
|
||||
// ========== Aether Items ==========
|
||||
|
||||
// -- Materials --
|
||||
Item::ambrosiumShard = ( new Item(151) )->setTextureName(L"ambrosiumShard")->setDescriptionId(IDS_ITEM_AMBROSIUM_SHARD);
|
||||
Item::zaniteGemstone = ( new Item(152) )->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_zanite)->setTextureName(L"zanite")->setDescriptionId(IDS_ITEM_ZANITE_GEMSTONE);
|
||||
Item::flamingGemstone = ( new Item(153) )->setTextureName(L"flamingGemstone")->setDescriptionId(IDS_ITEM_FLAMING_GEMSTONE);
|
||||
Item::skyrootStick = ( new Item(154) )->setBaseItemTypeAndMaterial(eBaseItemType_stick, eMaterial_skyroot)->setTextureName(L"skyrootStick")->handEquipped()->setDescriptionId(IDS_ITEM_SKYROOT_STICK);
|
||||
Item::aechorPetal = ( new Item(155) )->setTextureName(L"aechorPetal")->setDescriptionId(IDS_ITEM_AECHOR_PETAL);
|
||||
Item::goldenAmber = ( new Item(156) )->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_gravitite)->setTextureName(L"goldenAmber")->setDescriptionId(IDS_ITEM_GOLDEN_AMBER);
|
||||
Item::gummieSwet = ( new Item(157) )->setTextureName(L"gummieSwet")->setDescriptionId(IDS_ITEM_GUMMIE_SWET);
|
||||
Item::lifeShard = ( new Item(158) )->setTextureName(L"lifeShard")->setDescriptionId(IDS_ITEM_LIFE_SHARD);
|
||||
Item::regenerationStone = ( new Item(159) )->setTextureName(L"regenerationStone")->setDescriptionId(IDS_ITEM_REGENERATION_STONE);
|
||||
Item::moaEgg = ( new Item(160) )->setTextureName(L"moaEgg")->setDescriptionId(IDS_ITEM_MOA_EGG);
|
||||
Item::goldenFeather = ( new Item(161) )->setTextureName(L"goldenFeather")->setDescriptionId(IDS_ITEM_GOLDEN_FEATHER);
|
||||
Item::aetherKey = ( new Item(162) )->setTextureName(L"aetherKey")->setDescriptionId(IDS_ITEM_AETHER_KEY);
|
||||
|
||||
// -- Skyroot Buckets --
|
||||
Item::skyrootBucket = ( new Item(163) )->setBaseItemTypeAndMaterial(eBaseItemType_utensil, eMaterial_skyroot)->setTextureName(L"skyrootBucket")->setDescriptionId(IDS_ITEM_SKYROOT_BUCKET)->setMaxStackSize(16);
|
||||
Item::skyrootBucketWater = ( new Item(164) )->setTextureName(L"skyrootBucketWater")->setDescriptionId(IDS_ITEM_SKYROOT_BUCKET_WATER)->setMaxStackSize(1);
|
||||
Item::skyrootBucketMilk = ( new Item(165) )->setTextureName(L"skyrootBucketMilk")->setDescriptionId(IDS_ITEM_SKYROOT_BUCKET_MILK)->setMaxStackSize(1);
|
||||
Item::skyrootBucketPoison = ( new Item(166) )->setTextureName(L"skyrootBucketPoison")->setDescriptionId(IDS_ITEM_SKYROOT_BUCKET_POISON)->setMaxStackSize(1);
|
||||
|
||||
// -- Darts & Dart Shooters --
|
||||
Item::dartGolden = ( new Item(167) )->setTextureName(L"dartGolden")->setDescriptionId(IDS_ITEM_DART_GOLDEN);
|
||||
Item::dartEnchanted = ( new Item(168) )->setTextureName(L"dartEnchanted")->setDescriptionId(IDS_ITEM_DART_ENCHANTED);
|
||||
Item::dartPoison = ( new Item(169) )->setTextureName(L"dartPoison")->setDescriptionId(IDS_ITEM_DART_POISON);
|
||||
Item::dartShooter = ( new Item(170) )->setTextureName(L"dartShooter")->setDescriptionId(IDS_ITEM_DART_SHOOTER)->setMaxStackSize(1);
|
||||
Item::dartShooterEnchanted = ( new Item(171) )->setTextureName(L"dartShooterEnchanted")->setDescriptionId(IDS_ITEM_DART_SHOOTER_ENCHANTED)->setMaxStackSize(1);
|
||||
Item::dartShooterPoison = ( new Item(172) )->setTextureName(L"dartShooterPoison")->setDescriptionId(IDS_ITEM_DART_SHOOTER_POISON)->setMaxStackSize(1);
|
||||
|
||||
// -- Special Items --
|
||||
Item::cloudParachute = ( new Item(173) )->setTextureName(L"cloudParachute")->setDescriptionId(IDS_ITEM_CLOUD_PARACHUTE)->setMaxStackSize(1);
|
||||
Item::cloudStaff = ( new Item(174) )->setTextureName(L"cloudStaff")->handEquipped()->setDescriptionId(IDS_ITEM_CLOUD_STAFF)->setMaxStackSize(1);
|
||||
Item::natureStaff = ( new Item(175) )->setTextureName(L"natureStaff")->handEquipped()->setDescriptionId(IDS_ITEM_NATURE_STAFF)->setMaxStackSize(1);
|
||||
Item::repulsionShield = ( new Item(176) )->setTextureName(L"repulsionShield")->setDescriptionId(IDS_ITEM_REPULSION_SHIELD)->setMaxStackSize(1);
|
||||
Item::aetherLance = ( new WeaponItem(177, _Tier::IRON) )->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_zanite)->setTextureName(L"lance")->handEquipped()->setDescriptionId(IDS_ITEM_LANCE);
|
||||
Item::pigSlayer = ( new WeaponItem(178, _Tier::IRON) )->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_zanite)->setTextureName(L"pigSlayer")->setDescriptionId(IDS_ITEM_PIG_SLAYER);
|
||||
Item::vampireBlade = ( new WeaponItem(179, _Tier::DIAMOND) )->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_gravitite)->setTextureName(L"vampireBlade")->setDescriptionId(IDS_ITEM_VAMPIRE_BLADE);
|
||||
Item::lightningKnife = ( new Item(180) )->setTextureName(L"lightningKnife")->setDescriptionId(IDS_ITEM_LIGHTNING_KNIFE)->setMaxStackSize(16);
|
||||
|
||||
// -- Skyroot Tools (Wood equivalent) --
|
||||
Item::sword_skyroot = ( new WeaponItem(181, _Tier::SKYROOT) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_skyroot) ->setTextureName(L"swordSkyroot")->setDescriptionId(IDS_ITEM_SWORD_SKYROOT);
|
||||
Item::shovel_skyroot = ( new ShovelItem(182, _Tier::SKYROOT) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_skyroot) ->setTextureName(L"shovelSkyroot")->setDescriptionId(IDS_ITEM_SHOVEL_SKYROOT);
|
||||
Item::pickAxe_skyroot = ( new PickaxeItem(183, _Tier::SKYROOT) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_skyroot) ->setTextureName(L"pickaxeSkyroot")->setDescriptionId(IDS_ITEM_PICKAXE_SKYROOT);
|
||||
Item::hatchet_skyroot = ( new HatchetItem(184, _Tier::SKYROOT) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_skyroot) ->setTextureName(L"hatchetSkyroot")->setDescriptionId(IDS_ITEM_HATCHET_SKYROOT);
|
||||
|
||||
// -- Holystone Tools (Stone equivalent) --
|
||||
Item::sword_holystone = ( new WeaponItem(185, _Tier::HOLYSTONE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_holystone)->setTextureName(L"swordHolystone")->setDescriptionId(IDS_ITEM_SWORD_HOLYSTONE);
|
||||
Item::shovel_holystone = ( new ShovelItem(186, _Tier::HOLYSTONE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_holystone)->setTextureName(L"shovelHolystone")->setDescriptionId(IDS_ITEM_SHOVEL_HOLYSTONE);
|
||||
Item::pickAxe_holystone = ( new PickaxeItem(187, _Tier::HOLYSTONE) )->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_holystone)->setTextureName(L"pickaxeHolystone")->setDescriptionId(IDS_ITEM_PICKAXE_HOLYSTONE);
|
||||
Item::hatchet_holystone = ( new HatchetItem(188, _Tier::HOLYSTONE) )->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_holystone)->setTextureName(L"hatchetHolystone")->setDescriptionId(IDS_ITEM_HATCHET_HOLYSTONE);
|
||||
|
||||
// -- Zanite Tools (Iron equivalent) --
|
||||
Item::sword_zanite = ( new WeaponItem(189, _Tier::ZANITE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_zanite) ->setTextureName(L"swordZanite")->setDescriptionId(IDS_ITEM_SWORD_ZANITE);
|
||||
Item::shovel_zanite = ( new ShovelItem(190, _Tier::ZANITE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_zanite) ->setTextureName(L"shovelZanite")->setDescriptionId(IDS_ITEM_SHOVEL_ZANITE);
|
||||
Item::pickAxe_zanite = ( new PickaxeItem(191, _Tier::ZANITE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_zanite) ->setTextureName(L"pickaxeZanite")->setDescriptionId(IDS_ITEM_PICKAXE_ZANITE);
|
||||
Item::hatchet_zanite = ( new HatchetItem(192, _Tier::ZANITE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_zanite) ->setTextureName(L"hatchetZanite")->setDescriptionId(IDS_ITEM_HATCHET_ZANITE);
|
||||
|
||||
// -- Gravitite Tools (Diamond equivalent) --
|
||||
Item::sword_gravitite = ( new WeaponItem(193, _Tier::GRAVITITE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_gravitite)->setTextureName(L"swordGravitite")->setDescriptionId(IDS_ITEM_SWORD_GRAVITITE);
|
||||
Item::shovel_gravitite = ( new ShovelItem(194, _Tier::GRAVITITE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_gravitite)->setTextureName(L"shovelGravitite")->setDescriptionId(IDS_ITEM_SHOVEL_GRAVITITE);
|
||||
Item::pickAxe_gravitite = ( new PickaxeItem(195, _Tier::GRAVITITE) )->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_gravitite)->setTextureName(L"pickaxeGravitite")->setDescriptionId(IDS_ITEM_PICKAXE_GRAVITITE);
|
||||
Item::hatchet_gravitite = ( new HatchetItem(196, _Tier::GRAVITITE) )->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_gravitite)->setTextureName(L"hatchetGravitite")->setDescriptionId(IDS_ITEM_HATCHET_GRAVITITE);
|
||||
|
||||
// -- Phoenix Tools (Diamond equivalent) --
|
||||
Item::phoenixSword = ( new WeaponItem(197, _Tier::PHOENIX) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_phoenix) ->setTextureName(L"phoenixSword")->setDescriptionId(IDS_ITEM_PHOENIX_SWORD);
|
||||
Item::phoenixShovel = ( new ShovelItem(198, _Tier::PHOENIX) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_phoenix) ->setTextureName(L"phoenixShovel")->setDescriptionId(IDS_ITEM_PHOENIX_SHOVEL);
|
||||
Item::phoenixPickaxe = ( new PickaxeItem(199, _Tier::PHOENIX) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_phoenix) ->setTextureName(L"phoenixPickaxe")->setDescriptionId(IDS_ITEM_PHOENIX_PICKAXE);
|
||||
Item::phoenixAxe = ( new HatchetItem(200, _Tier::PHOENIX) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_phoenix) ->setTextureName(L"phoenixAxe")->setDescriptionId(IDS_ITEM_PHOENIX_AXE);
|
||||
|
||||
// -- Zanite Armor (Iron equivalent) --
|
||||
Item::helmet_zanite = (ArmorItem *) ( ( new ArmorItem(201, ArmorItem::ArmorMaterial::ZANITE, 5, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_zanite) ->setTextureName(L"helmetZanite")->setDescriptionId(IDS_ITEM_HELMET_ZANITE) );
|
||||
Item::chestplate_zanite = (ArmorItem *) ( ( new ArmorItem(202, ArmorItem::ArmorMaterial::ZANITE, 5, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_zanite) ->setTextureName(L"chestplateZanite")->setDescriptionId(IDS_ITEM_CHESTPLATE_ZANITE) );
|
||||
Item::leggings_zanite = (ArmorItem *) ( ( new ArmorItem(203, ArmorItem::ArmorMaterial::ZANITE, 5, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_zanite) ->setTextureName(L"leggingsZanite")->setDescriptionId(IDS_ITEM_LEGGINGS_ZANITE) );
|
||||
Item::boots_zanite = (ArmorItem *) ( ( new ArmorItem(204, ArmorItem::ArmorMaterial::ZANITE, 5, ArmorItem::SLOT_FEET) ) ->setBaseItemTypeAndMaterial(eBaseItemType_boots, eMaterial_zanite) ->setTextureName(L"bootsZanite")->setDescriptionId(IDS_ITEM_BOOTS_ZANITE) );
|
||||
|
||||
// -- Gravitite Armor (Diamond equivalent) --
|
||||
Item::helmet_gravitite = (ArmorItem *) ( ( new ArmorItem(205, ArmorItem::ArmorMaterial::GRAVITITE, 6, ArmorItem::SLOT_HEAD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_gravitite)->setTextureName(L"helmetGravitite")->setDescriptionId(IDS_ITEM_HELMET_GRAVITITE) );
|
||||
Item::chestplate_gravitite = (ArmorItem *) ( ( new ArmorItem(206, ArmorItem::ArmorMaterial::GRAVITITE, 6, ArmorItem::SLOT_TORSO) ) ->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_gravitite)->setTextureName(L"chestplateGravitite")->setDescriptionId(IDS_ITEM_CHESTPLATE_GRAVITITE) );
|
||||
Item::leggings_gravitite = (ArmorItem *) ( ( new ArmorItem(207, ArmorItem::ArmorMaterial::GRAVITITE, 6, ArmorItem::SLOT_LEGS) ) ->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_gravitite)->setTextureName(L"leggingsGravitite")->setDescriptionId(IDS_ITEM_LEGGINGS_GRAVITITE) );
|
||||
Item::boots_gravitite = (ArmorItem *) ( ( new ArmorItem(208, ArmorItem::ArmorMaterial::GRAVITITE, 6, ArmorItem::SLOT_FEET) ) ->setBaseItemTypeAndMaterial(eBaseItemType_boots, eMaterial_gravitite)->setTextureName(L"bootsGravitite")->setDescriptionId(IDS_ITEM_BOOTS_GRAVITITE) );
|
||||
|
||||
// -- Gravitite crafting material --
|
||||
Item::gravititePlate = ( new Item(209) )->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_gravitite)->setTextureName(L"gravititePlate")->setDescriptionId(IDS_ITEM_GRAVITITE_PLATE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -79,7 +79,14 @@ public:
|
||||
eMaterial_emerald,
|
||||
eMaterial_quartz,
|
||||
eMaterial_apple,
|
||||
eMaterial_carrot
|
||||
eMaterial_carrot,
|
||||
|
||||
// Aether materials
|
||||
eMaterial_skyroot,
|
||||
eMaterial_holystone,
|
||||
eMaterial_zanite,
|
||||
eMaterial_gravitite,
|
||||
eMaterial_phoenix
|
||||
}
|
||||
eMaterial;
|
||||
|
||||
@@ -123,6 +130,7 @@ public:
|
||||
eBaseItemType_rod,
|
||||
eBaseItemType_giltFruit,
|
||||
eBaseItemType_carpet,
|
||||
eBaseItemType_stick,
|
||||
eBaseItemType_MAXTYPES,
|
||||
}
|
||||
eBaseItemType;
|
||||
@@ -142,6 +150,13 @@ public:
|
||||
static const Tier *DIAMOND; //
|
||||
static const Tier *GOLD;
|
||||
|
||||
// Aether tiers
|
||||
static const Tier *SKYROOT;
|
||||
static const Tier *HOLYSTONE;
|
||||
static const Tier *ZANITE;
|
||||
static const Tier *GRAVITITE;
|
||||
static const Tier *PHOENIX;
|
||||
|
||||
private:
|
||||
const int level;
|
||||
const int uses;
|
||||
@@ -385,6 +400,89 @@ public:
|
||||
|
||||
static EnchantedBookItem *enchantedBook;
|
||||
|
||||
// Aether items - materials
|
||||
static Item *ambrosiumShard;
|
||||
static Item *zaniteGemstone;
|
||||
static Item *flamingGemstone;
|
||||
static Item *skyrootStick;
|
||||
static Item *aechorPetal;
|
||||
static Item *goldenAmber;
|
||||
static Item *gummieSwet;
|
||||
static Item *lifeShard;
|
||||
static Item *regenerationStone;
|
||||
static Item *moaEgg;
|
||||
static Item *goldenFeather;
|
||||
static Item *aetherKey;
|
||||
|
||||
// Aether items - buckets
|
||||
static Item *skyrootBucket;
|
||||
static Item *skyrootBucketWater;
|
||||
static Item *skyrootBucketMilk;
|
||||
static Item *skyrootBucketPoison;
|
||||
|
||||
// Aether items - darts
|
||||
static Item *dartGolden;
|
||||
static Item *dartEnchanted;
|
||||
static Item *dartPoison;
|
||||
static Item *dartShooter;
|
||||
static Item *dartShooterEnchanted;
|
||||
static Item *dartShooterPoison;
|
||||
|
||||
// Aether items - special weapons/tools
|
||||
static Item *cloudParachute;
|
||||
static Item *cloudStaff;
|
||||
static Item *natureStaff;
|
||||
static Item *repulsionShield;
|
||||
static Item *aetherLance;
|
||||
static Item *pigSlayer;
|
||||
static Item *vampireBlade;
|
||||
static Item *lightningKnife;
|
||||
|
||||
// Aether tools - Skyroot (Wood equivalent)
|
||||
static Item *sword_skyroot;
|
||||
static Item *shovel_skyroot;
|
||||
static Item *pickAxe_skyroot;
|
||||
static Item *hatchet_skyroot;
|
||||
|
||||
// Aether tools - Holystone (Stone equivalent)
|
||||
static Item *sword_holystone;
|
||||
static Item *shovel_holystone;
|
||||
static Item *pickAxe_holystone;
|
||||
static Item *hatchet_holystone;
|
||||
|
||||
// Aether tools - Zanite (Iron equivalent)
|
||||
static Item *sword_zanite;
|
||||
static Item *shovel_zanite;
|
||||
static Item *pickAxe_zanite;
|
||||
static Item *hatchet_zanite;
|
||||
|
||||
// Aether tools - Gravitite (Diamond equivalent)
|
||||
static Item *sword_gravitite;
|
||||
static Item *shovel_gravitite;
|
||||
static Item *pickAxe_gravitite;
|
||||
static Item *hatchet_gravitite;
|
||||
|
||||
// Aether tools - Phoenix (Diamond equivalent)
|
||||
static Item *phoenixSword;
|
||||
static Item *phoenixShovel;
|
||||
static Item *phoenixPickaxe;
|
||||
static Item *phoenixAxe;
|
||||
|
||||
// Aether armor - Zanite (Iron equivalent)
|
||||
static ArmorItem *helmet_zanite;
|
||||
static ArmorItem *chestplate_zanite;
|
||||
static ArmorItem *leggings_zanite;
|
||||
static ArmorItem *boots_zanite;
|
||||
|
||||
// Aether armor - Gravitite (Diamond equivalent)
|
||||
static ArmorItem *helmet_gravitite;
|
||||
static ArmorItem *chestplate_gravitite;
|
||||
static ArmorItem *leggings_gravitite;
|
||||
static ArmorItem *boots_gravitite;
|
||||
|
||||
// Aether crafting materials
|
||||
static Item *gravititePlate;
|
||||
|
||||
|
||||
static const int shovel_iron_Id = 256;
|
||||
static const int pickAxe_iron_Id = 257;
|
||||
@@ -576,6 +674,67 @@ public:
|
||||
static const int enchantedBook_Id = 403;
|
||||
static const int netherQuartz_Id = 406;
|
||||
|
||||
// Aether item IDs
|
||||
static const int ambrosiumShard_Id = 407;
|
||||
static const int zaniteGemstone_Id = 408;
|
||||
static const int flamingGemstone_Id = 409;
|
||||
static const int skyrootStick_Id = 410;
|
||||
static const int aechorPetal_Id = 411;
|
||||
static const int goldenAmber_Id = 412;
|
||||
static const int gummieSwet_Id = 413;
|
||||
static const int lifeShard_Id = 414;
|
||||
static const int regenerationStone_Id = 415;
|
||||
static const int moaEgg_Id = 416;
|
||||
static const int goldenFeather_Id = 417;
|
||||
static const int aetherKey_Id = 418;
|
||||
static const int skyrootBucket_Id = 419;
|
||||
static const int skyrootBucketWater_Id = 420;
|
||||
static const int skyrootBucketMilk_Id = 421;
|
||||
static const int skyrootBucketPoison_Id = 422;
|
||||
static const int dartGolden_Id = 423;
|
||||
static const int dartEnchanted_Id = 424;
|
||||
static const int dartPoison_Id = 425;
|
||||
static const int dartShooter_Id = 426;
|
||||
static const int dartShooterEnchanted_Id= 427;
|
||||
static const int dartShooterPoison_Id = 428;
|
||||
static const int cloudParachute_Id = 429;
|
||||
static const int cloudStaff_Id = 430;
|
||||
static const int natureStaff_Id = 431;
|
||||
static const int repulsionShield_Id = 432;
|
||||
static const int aetherLance_Id = 433;
|
||||
static const int pigSlayer_Id = 434;
|
||||
static const int vampireBlade_Id = 435;
|
||||
static const int lightningKnife_Id = 436;
|
||||
static const int sword_skyroot_Id = 437;
|
||||
static const int shovel_skyroot_Id = 438;
|
||||
static const int pickAxe_skyroot_Id = 439;
|
||||
static const int hatchet_skyroot_Id = 440;
|
||||
static const int sword_holystone_Id = 441;
|
||||
static const int shovel_holystone_Id = 442;
|
||||
static const int pickAxe_holystone_Id = 443;
|
||||
static const int hatchet_holystone_Id = 444;
|
||||
static const int sword_zanite_Id = 445;
|
||||
static const int shovel_zanite_Id = 446;
|
||||
static const int pickAxe_zanite_Id = 447;
|
||||
static const int hatchet_zanite_Id = 448;
|
||||
static const int sword_gravitite_Id = 449;
|
||||
static const int shovel_gravitite_Id = 450;
|
||||
static const int pickAxe_gravitite_Id = 451;
|
||||
static const int hatchet_gravitite_Id = 452;
|
||||
static const int phoenixSword_Id = 453;
|
||||
static const int phoenixShovel_Id = 454;
|
||||
static const int phoenixPickaxe_Id = 455;
|
||||
static const int phoenixAxe_Id = 456;
|
||||
static const int helmet_zanite_Id = 457;
|
||||
static const int chestplate_zanite_Id = 458;
|
||||
static const int leggings_zanite_Id = 459;
|
||||
static const int boots_zanite_Id = 460;
|
||||
static const int helmet_gravitite_Id = 461;
|
||||
static const int chestplate_gravitite_Id= 462;
|
||||
static const int leggings_gravitite_Id = 463;
|
||||
static const int boots_gravitite_Id = 464;
|
||||
static const int gravititePlate_Id = 465;
|
||||
|
||||
public:
|
||||
const int id;
|
||||
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
#include "LevelStorage.h"
|
||||
|
||||
const wstring LevelStorage::NETHER_FOLDER = L"DIM-1";
|
||||
const wstring LevelStorage::ENDER_FOLDER = L"DIM1/";
|
||||
const wstring LevelStorage::ENDER_FOLDER = L"DIM1/";
|
||||
const wstring LevelStorage::AETHER_FOLDER = L"DIM2/";
|
||||
@@ -17,6 +17,7 @@ class LevelStorage
|
||||
public:
|
||||
static const wstring NETHER_FOLDER;
|
||||
static const wstring ENDER_FOLDER;
|
||||
static const wstring AETHER_FOLDER;
|
||||
|
||||
virtual LevelData *prepareLevel() = 0;
|
||||
virtual void checkSession() = 0;
|
||||
|
||||
@@ -26,6 +26,10 @@ McRegionChunkStorage::McRegionChunkStorage(ConsoleSaveFile *saveFile, const wstr
|
||||
m_saveFile->createFile(ConsoleSavePath(L"DIM1/r.0.-1.mcr"));
|
||||
m_saveFile->createFile(ConsoleSavePath(L"DIM1/r.0.0.mcr"));
|
||||
m_saveFile->createFile(ConsoleSavePath(L"DIM1/r.-1.0.mcr"));
|
||||
m_saveFile->createFile(ConsoleSavePath(L"DIM2/r.-1.-1.mcr")); // aether
|
||||
m_saveFile->createFile(ConsoleSavePath(L"DIM2/r.0.-1.mcr")); // aether
|
||||
m_saveFile->createFile(ConsoleSavePath(L"DIM2/r.0.0.mcr")); // aether
|
||||
m_saveFile->createFile(ConsoleSavePath(L"DIM2/r.-1.0.mcr")); // aether
|
||||
m_saveFile->createFile(ConsoleSavePath(L"r.-1.-1.mcr"));
|
||||
m_saveFile->createFile(ConsoleSavePath(L"r.0.-1.mcr"));
|
||||
m_saveFile->createFile(ConsoleSavePath(L"r.0.0.mcr"));
|
||||
|
||||
@@ -86,6 +86,11 @@ ChunkStorage *McRegionLevelStorage::createChunkStorage(Dimension *dimension)
|
||||
return new McRegionChunkStorage(m_saveFile, LevelStorage::ENDER_FOLDER);
|
||||
}
|
||||
|
||||
if (dynamic_cast<AetherDimension *>(dimension) != NULL)
|
||||
{
|
||||
return new McRegionChunkStorage(m_saveFile, LevelStorage::AETHER_FOLDER);
|
||||
}
|
||||
|
||||
return new McRegionChunkStorage(m_saveFile, L"");
|
||||
}
|
||||
|
||||
|
||||
@@ -2181,8 +2181,12 @@
|
||||
<ClInclude Include="TextureAndGeometryPacket.h" />
|
||||
<ClInclude Include="TheEndBiome.h" />
|
||||
<ClInclude Include="TheEndBiomeDecorator.h" />
|
||||
<ClInclude Include="AetherBiome.h" />
|
||||
<ClInclude Include="AetherBiomeDecorator.h" />
|
||||
<ClInclude Include="AetherDimension.h" />
|
||||
<ClInclude Include="TheEndDimension.h" />
|
||||
<ClInclude Include="TheEndLevelRandomLevelSource.h" />
|
||||
<ClInclude Include="AetherLevelSource.h" />
|
||||
<ClInclude Include="TheEndPortal.h" />
|
||||
<ClInclude Include="TheEndPortalFrameTile.h" />
|
||||
<ClInclude Include="TheEndPortalTileEntity.h" />
|
||||
@@ -2509,6 +2513,7 @@
|
||||
<ClInclude Include="ObsidianTile.h" />
|
||||
<ClInclude Include="OldChunkStorage.h" />
|
||||
<ClInclude Include="OreFeature.h" />
|
||||
<ClInclude Include="QuicksoilShelfFeature.h" />
|
||||
<ClInclude Include="OreRecipies.h" />
|
||||
<ClInclude Include="OreTile.h" />
|
||||
<ClInclude Include="OutputStream.h" />
|
||||
@@ -2531,6 +2536,20 @@
|
||||
<ClInclude Include="PlayerIO.h" />
|
||||
<ClInclude Include="PortalForcer.h" />
|
||||
<ClInclude Include="PortalMaterial.h" />
|
||||
<ClInclude Include="AetherPortalTile.h" />
|
||||
<ClInclude Include="AetherGrassTile.h" />
|
||||
<ClInclude Include="SkyrootLogTile.h" />
|
||||
<ClInclude Include="GoldenOakLogTile.h" />
|
||||
<ClInclude Include="AetherLeafTile.h" />
|
||||
<ClInclude Include="AetherBushTile.h" />
|
||||
<ClInclude Include="AetherSaplingTile.h" />
|
||||
<ClInclude Include="AetherOreTile.h" />
|
||||
<ClInclude Include="AetherNaturalTile.h" />
|
||||
<ClInclude Include="AercloudTile.h" />
|
||||
<ClInclude Include="GoldAercloudTile.h" />
|
||||
<ClInclude Include="BlueAercloudTile.h" />
|
||||
<ClInclude Include="QuicksoilTile.h" />
|
||||
<ClInclude Include="AetherMultiFaceTile.h" />
|
||||
<ClInclude Include="PortalTile.h" />
|
||||
<ClInclude Include="Pos.h" />
|
||||
<ClInclude Include="PreLoginPacket.h" />
|
||||
@@ -2613,6 +2632,8 @@
|
||||
<ClInclude Include="SpringFeature.h" />
|
||||
<ClInclude Include="SpringTile.h" />
|
||||
<ClInclude Include="SpruceFeature.h" />
|
||||
<ClInclude Include="SkyrootTreeFeature.h" />
|
||||
<ClInclude Include="GoldenOakTreeFeature.h" />
|
||||
<ClInclude Include="Squid.h" />
|
||||
<ClInclude Include="Stat.h" />
|
||||
<ClInclude Include="StatFormatter.h" />
|
||||
@@ -3147,8 +3168,12 @@
|
||||
<ClCompile Include="TextureAndGeometryPacket.cpp" />
|
||||
<ClCompile Include="TheEndBiome.cpp" />
|
||||
<ClCompile Include="TheEndBiomeDecorator.cpp" />
|
||||
<ClCompile Include="AetherBiome.cpp" />
|
||||
<ClCompile Include="AetherBiomeDecorator.cpp" />
|
||||
<ClCompile Include="AetherDimension.cpp" />
|
||||
<ClCompile Include="TheEndDimension.cpp" />
|
||||
<ClCompile Include="TheEndLevelRandomLevelSource.cpp" />
|
||||
<ClCompile Include="AetherLevelSource.cpp" />
|
||||
<ClCompile Include="TheEndPortal.cpp" />
|
||||
<ClCompile Include="TheEndPortalFrameTile.cpp" />
|
||||
<ClCompile Include="TheEndPortalTileEntity.cpp" />
|
||||
@@ -3514,6 +3539,7 @@
|
||||
<ClCompile Include="ObsidianTile.cpp" />
|
||||
<ClCompile Include="OldChunkStorage.cpp" />
|
||||
<ClCompile Include="OreFeature.cpp" />
|
||||
<ClCompile Include="QuicksoilShelfFeature.cpp" />
|
||||
<ClCompile Include="OreRecipies.cpp" />
|
||||
<ClCompile Include="OreTile.cpp" />
|
||||
<ClCompile Include="Packet.cpp" />
|
||||
@@ -3540,6 +3566,20 @@
|
||||
<ClCompile Include="PlayerInfoPacket.cpp" />
|
||||
<ClCompile Include="PlayerInputPacket.cpp" />
|
||||
<ClCompile Include="PortalForcer.cpp" />
|
||||
<ClCompile Include="AetherPortalTile.cpp" />
|
||||
<ClCompile Include="AetherGrassTile.cpp" />
|
||||
<ClCompile Include="SkyrootLogTile.cpp" />
|
||||
<ClCompile Include="GoldenOakLogTile.cpp" />
|
||||
<ClCompile Include="AetherLeafTile.cpp" />
|
||||
<ClCompile Include="AetherBushTile.cpp" />
|
||||
<ClCompile Include="AetherSaplingTile.cpp" />
|
||||
<ClCompile Include="AetherOreTile.cpp" />
|
||||
<ClCompile Include="AetherNaturalTile.cpp" />
|
||||
<ClCompile Include="AercloudTile.cpp" />
|
||||
<ClCompile Include="GoldAercloudTile.cpp" />
|
||||
<ClCompile Include="BlueAercloudTile.cpp" />
|
||||
<ClCompile Include="QuicksoilTile.cpp" />
|
||||
<ClCompile Include="AetherMultiFaceTile.cpp" />
|
||||
<ClCompile Include="PortalTile.cpp" />
|
||||
<ClCompile Include="Pos.cpp" />
|
||||
<ClCompile Include="PreLoginPacket.cpp" />
|
||||
@@ -3674,6 +3714,8 @@
|
||||
<ClCompile Include="SpringFeature.cpp" />
|
||||
<ClCompile Include="SpringTile.cpp" />
|
||||
<ClCompile Include="SpruceFeature.cpp" />
|
||||
<ClCompile Include="SkyrootTreeFeature.cpp" />
|
||||
<ClCompile Include="GoldenOakTreeFeature.cpp" />
|
||||
<ClCompile Include="Squid.cpp" />
|
||||
<ClCompile Include="Stat.cpp" />
|
||||
<ClCompile Include="Stats.cpp" />
|
||||
|
||||