Floating Islands and Shit

This commit is contained in:
Donothan73 2026-03-16 22:21:29 -04:00
parent ce82c0bcf8
commit e7a1302ef5
37 changed files with 977 additions and 36 deletions

View file

@ -43,6 +43,7 @@ void IUIScene_CreativeMenu::staticCtor()
ITEM(Tile::lapisBlock_Id)
ITEM(Tile::diamondBlock_Id)
ITEM(Tile::emeraldBlock_Id)
ITEM(Tile::rubyBlock_Id)
ITEM_AUX(Tile::quartzBlock_Id,QuartzBlockTile::TYPE_DEFAULT)
ITEM(Tile::coalOre_Id)
ITEM(Tile::lapisOre_Id)
@ -51,7 +52,9 @@ void IUIScene_CreativeMenu::staticCtor()
ITEM(Tile::ironOre_Id)
ITEM(Tile::goldOre_Id)
ITEM(Tile::emeraldOre_Id)
ITEM(Tile::rubyOre_Id)
ITEM(Tile::netherQuartz_Id)
ITEM(Tile::netherGold_Id)
ITEM(Tile::unbreakable_Id)
ITEM_AUX(Tile::wood_Id,0)
ITEM_AUX(Tile::wood_Id,TreeTile::DARK_TRUNK)
@ -84,6 +87,7 @@ void IUIScene_CreativeMenu::staticCtor()
ITEM_AUX(Tile::monsterStoneEgg_Id,StoneMonsterTile::HOST_COBBLE)
ITEM_AUX(Tile::monsterStoneEgg_Id,StoneMonsterTile::HOST_STONEBRICK)
ITEM(Tile::mycel_Id)
ITEM(Tile::alphaGrass_Id)
ITEM(Tile::netherBrick_Id)
ITEM(Tile::endStone_Id)
ITEM_AUX(Tile::quartzBlock_Id,QuartzBlockTile::TYPE_CHISELED)
@ -153,7 +157,9 @@ void IUIScene_CreativeMenu::staticCtor()
ITEM_AUX(Tile::leaves_Id, LeafTile::EVERGREEN_LEAF)
ITEM_AUX(Tile::leaves_Id, LeafTile::BIRCH_LEAF)
ITEM_AUX(Tile::leaves_Id, LeafTile::JUNGLE_LEAF)
ITEM_AUX(Tile::leaves_Id, LeafTile::ALPHA_LEAF)
ITEM(Tile::vine)
//ITEM(Tile::glowLichen_Id)
ITEM(Tile::waterLily_Id)
ITEM(Tile::torch_Id)
ITEM_AUX(Tile::tallgrass_Id, TallGrass::DEAD_SHRUB)
@ -162,6 +168,8 @@ void IUIScene_CreativeMenu::staticCtor()
ITEM(Tile::deadBush_Id)
ITEM(Tile::flower_Id)
ITEM(Tile::rose_Id)
ITEM(Tile::blueRose_Id)
ITEM(Tile::peony_Id)
ITEM(Tile::mushroom_brown_Id)
ITEM(Tile::mushroom_red_Id)
ITEM(Tile::cactus_Id)
@ -396,6 +404,7 @@ void IUIScene_CreativeMenu::staticCtor()
ITEM(Item::apple_Id)
ITEM(Item::apple_gold_Id)
ITEM_AUX(Item::apple_gold_Id,1) // Enchanted
//ITEM(Item::apple_ruby_Id)
ITEM(Item::melon_Id)
ITEM(Item::mushroomStew_Id)
ITEM(Item::bread_Id)
@ -407,6 +416,8 @@ void IUIScene_CreativeMenu::staticCtor()
ITEM(Item::porkChop_raw_Id)
ITEM(Item::beef_cooked_Id)
ITEM(Item::beef_raw_Id)
//ITEM(Item::mutton_cooked_Id)
//ITEM(Item::mutton_raw_Id)
ITEM(Item::chicken_raw_Id)
ITEM(Item::chicken_cooked_Id)
ITEM(Item::rotten_flesh_Id)
@ -476,6 +487,12 @@ void IUIScene_CreativeMenu::staticCtor()
ITEM(Item::hoe_diamond_Id)
ITEM(Item::fireball_Id)
ITEM(Item::sword_ruby_Id)
ITEM(Item::shovel_ruby_Id)
ITEM(Item::pickAxe_ruby_Id)
ITEM(Item::hatchet_ruby_Id)
ITEM(Item::hoe_ruby_Id)
ITEM(Item::clock_Id)
ITEM(Item::shears_Id)
ITEM(Item::fishingRod_Id)
@ -508,6 +525,7 @@ void IUIScene_CreativeMenu::staticCtor()
ITEM_AUX(Item::coal_Id,1)
ITEM(Item::diamond_Id)
ITEM(Item::emerald_Id)
ITEM(Item::ruby_Id)
ITEM(Item::ironIngot_Id)
ITEM(Item::goldIngot_Id)
ITEM(Item::netherQuartz_Id)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -510,7 +510,7 @@ void PreStitchedTextureMap::loadUVs()
ADD_ICON(10, 3, L"name_tag")
ADD_ICON(10, 4, L"lead")
ADD_ICON(10, 5, L"netherbrick")
//ADD_ICON(10, 6, L"unused")
ADD_ICON(10, 6, L"ruby_sword")
ADD_ICON(10, 7, L"minecart_furnace")
ADD_ICON(10, 8, L"charcoal")
ADD_ICON(10, 9, L"monsterPlacer_overlay")
@ -526,8 +526,8 @@ void PreStitchedTextureMap::loadUVs()
//ADD_ICON(11, 2, L"unused")
//ADD_ICON(11, 3, L"unused")
//ADD_ICON(11, 4, L"unused")
//ADD_ICON(11, 5, L"unused")
//ADD_ICON(11, 6, L"unused")
ADD_ICON(11, 5, L"ruby_helmet")
ADD_ICON(11, 6, L"ruby_shovel")
ADD_ICON(11, 7, L"minecart_hopper")
ADD_ICON(11, 8, L"hopper")
ADD_ICON(11, 9, L"nether_star")
@ -543,10 +543,10 @@ void PreStitchedTextureMap::loadUVs()
//ADD_ICON(12, 2, L"unused")
//ADD_ICON(12, 3, L"unused")
//ADD_ICON(12, 4, L"unused")
//ADD_ICON(12, 5, L"unused")
//ADD_ICON(12, 6, L"unused")
ADD_ICON(12, 5, L"ruby_chestplate")
ADD_ICON(12, 6, L"ruby_pickaxe")
ADD_ICON(12, 7, L"minecart_tnt")
//ADD_ICON(12, 8, L"unused")
ADD_ICON(12, 8, L"mutton_cooked")
ADD_ICON(12, 9, L"fireworks")
ADD_ICON(12, 10, L"fireworks_charge")
ADD_ICON(12, 11, L"fireworks_charge_overlay")
@ -555,13 +555,18 @@ void PreStitchedTextureMap::loadUVs()
ADD_ICON(12, 14, L"frame")
ADD_ICON(12, 15, L"enchantedBook")
ADD_ICON(13, 5, L"ruby_leggings")
ADD_ICON(13, 6, L"ruby_axe")
ADD_ICON(13, 5, L"mutton_raw")
ADD_ICON(13, 6, L"apple_ruby")
ADD_ICON(14, 0, L"skull_skeleton")
ADD_ICON(14, 1, L"skull_wither")
ADD_ICON(14, 2, L"skull_zombie")
ADD_ICON(14, 3, L"skull_char")
ADD_ICON(14, 4, L"skull_creeper")
//ADD_ICON(14, 5, L"unused")
//ADD_ICON(14, 6, L"unused")
ADD_ICON(14, 5, L"ruby_boots")
ADD_ICON(14, 6, L"ruby_hoe")
ADD_ICON_WITH_NAME(14, 7, L"compassP0", L"compass") // 4J Added
ADD_ICON_WITH_NAME(14, 8, L"compassP1", L"compass") // 4J Added
ADD_ICON_WITH_NAME(14, 9, L"compassP2", L"compass") // 4J Added
@ -986,5 +991,24 @@ void PreStitchedTextureMap::loadUVs()
ADD_ICON(19, 13, L"glass_pane_top_silver");
ADD_ICON(19, 14, L"glass_pane_top_white");
ADD_ICON(19, 15, L"glass_pane_top_yellow");
ADD_ICON(20, 0, L"ruby_ore");
ADD_ICON(20, 1, L"ruby_block");
ADD_ICON(20, 2, L"flower_peony");
ADD_ICON(20, 3, L"flower_blue_rose");
ADD_ICON(20, 4, L"gold_ore_netherrack");
ADD_ICON(20, 5, L"glow_lichen");
ADD_ICON(20, 6, L"end_rod");
ADD_ICON(20, 7, L"smooth_tuff");
ADD_ICON(20, 8, L"tuff");
ADD_ICON(20, 9, L"smooth_andesite");
ADD_ICON(20, 10, L"andesite");
ADD_ICON(20, 11, L"smooth_granite");
ADD_ICON(20, 12, L"granite");
ADD_ICON(20, 13, L"alpha_grass_side");
ADD_ICON(20, 14, L"alpha_grass_top");
ADD_ICON(20, 15, L"alpha_leaves");
ADD_ICON(21, 0, L"alpha_leaves_opaque");
}
}

View file

@ -63,11 +63,13 @@ 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::rubyArray[] = {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::RUBY = new _ArmorMaterial(33, _ArmorMaterial::rubyArray, 10);
_ArmorMaterial::ArmorMaterial(int durabilityMultiplier, const int slotProtections[], int enchantmentValue)
{
@ -118,6 +120,10 @@ int _ArmorMaterial::getTierItemId() const
{
return Item::diamond_Id;
}
else if (this == RUBY)
{
return Item::ruby_Id;
}
return 0;
}

View file

@ -35,12 +35,14 @@ public:
static const int ironArray[];
static const int goldArray[];
static const int diamondArray[];
static const int rubyArray[];
public:
static const ArmorMaterial *CLOTH;
static const ArmorMaterial *CHAIN;
static const ArmorMaterial *IRON;
static const ArmorMaterial *GOLD;
static const ArmorMaterial *DIAMOND;
static const ArmorMaterial *RUBY;
private:
int durabilityMultiplier;

View file

@ -3,6 +3,7 @@
#include "net.minecraft.world.level.tile.h"
#include "net.minecraft.world.level.levelgen.feature.h"
#include "net.minecraft.world.level.biome.h"
#include "IslandFeature.h"
BiomeDecorator::BiomeDecorator(Biome *biome)
{
@ -62,6 +63,12 @@ void BiomeDecorator::_init()
cactusFeature = new CactusFeature();
waterlilyFeature = new WaterlilyFeature();
rubyOreFeature = new OreFeature(Tile::rubyOre_Id, 5);
blueroseFlowerFeature = new FlowerFeature(Tile::blueRose_Id);
peonyFlowerFeature = new FlowerFeature(Tile::peony_Id);
emeraldOreFeature = new OreFeature(Tile::emeraldOre_Id, 3);
islandFeature = new IslandFeature(Tile::alphaGrass_Id);
waterlilyCount = 0;
treeCount = 0;
flowerCount = 2;
@ -84,6 +91,16 @@ void BiomeDecorator::decorate()
decorateOres();
PIXEndNamedEvent();
PIXBeginNamedEvent(0,"Decorate Islands");
for (int i = 0; i < random->nextInt(3)-1; i++)
{
int x = xo + random->nextInt(16) + 8;
int z = zo + random->nextInt(16) + 8;
islandFeature->place(level, random, x, (level->getTopSolidBlock(x, z)), (z));
}
PIXEndNamedEvent();
PIXBeginNamedEvent(0,"Decorate sand/clay/gravel");
for (int i = 0; i < sandCount; i++)
{
@ -130,19 +147,38 @@ void BiomeDecorator::decorate()
hugeMushroomFeature->place(level, random, x, level->getHeightmap(x, z), z);
}
for (int i = 0; i < flowerCount; i++)
for (int i = 0; i < flowerCount*2; 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);
if (random->nextInt(1) == 0)
{
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);
}
if (random->nextInt(2) == 0)
{
int x = xo + random->nextInt(16) + 8;
int y = random->nextInt(Level::genDepth);
int z = zo + random->nextInt(16) + 8;
peonyFlowerFeature->place(level, random, x, y, z);
}
if (random->nextInt(3) == 0)
{
int x = xo + random->nextInt(16) + 8;
int y = random->nextInt(Level::genDepth);
int z = zo + random->nextInt(16) + 8;
roseFlowerFeature->place(level, random, x, y, z);
}
if (random->nextInt(4) == 0)
{
x = xo + random->nextInt(16) + 8;
y = random->nextInt(Level::genDepth);
z = zo + random->nextInt(16) + 8;
roseFlowerFeature->place(level, random, x, y, z);
int x = xo + random->nextInt(16) + 8;
int y = random->nextInt(Level::genDepth);
int z = zo + random->nextInt(16) + 8;
blueroseFlowerFeature->place(level, random, x, y, z);
}
}
@ -324,5 +360,9 @@ void BiomeDecorator::decorateOres()
decorateDepthSpan(8, redStoneOreFeature, 0, Level::genDepth / 8);
decorateDepthSpan(1, diamondOreFeature, 0, Level::genDepth / 8);
decorateDepthAverage(1, lapisOreFeature, Level::genDepth / 8, Level::genDepth / 8);
decorateDepthSpan(3, emeraldOreFeature, 64, Level::genDepth *8);
decorateDepthSpan(10, rubyOreFeature, 0, Level::genDepth / 6);
level->setInstaTick(false);
}

View file

@ -47,6 +47,12 @@ protected:
Feature *reedsFeature;
Feature *cactusFeature;
Feature *waterlilyFeature;
Feature *rubyOreFeature;
Feature *emeraldOreFeature;
Feature *blueroseFlowerFeature;
Feature *peonyFlowerFeature;
Feature *islandFeature;
int waterlilyCount;
int treeCount;

View file

@ -323,13 +323,13 @@ void Boat::tick()
if (!level->isClientSide && !removed)
{
remove();
for (int i = 0; i < 3; i++)
for (int i = 0; i < 5; i++)
{
spawnAtLocation(Tile::wood_Id, 1, 0);
}
for (int i = 0; i < 2; i++)
{
spawnAtLocation(Item::stick->id, 1, 0);
//spawnAtLocation(Item::stick->id, 1, 0);
}
}
}

View file

@ -7,7 +7,7 @@ using namespace std;
bool CaveFeature::place(Level *level, Random *random, int x, int y, int z)
{
float dir = random->nextFloat() * PI;
double rd = 8;
double rd = 8 + random->nextDouble() * 8;
double x0 = x + 8 + Mth::sin(dir) * rd;
double x1 = x + 8 - Mth::sin(dir) * rd;

View file

@ -55,6 +55,10 @@ void ClothDyeRecipes::addRecipes(Recipes *r)
new ItemInstance(Item::dye_powder, 1, DyePowderItem::RED),
new ItemInstance(Item::dye_powder, 1, DyePowderItem::WHITE),L'D');
r->addShapelessRecipy(new ItemInstance(Item::dye_powder, 2, DyePowderItem::PINK), //
L"tg",
Tile::peony,L'D');
r->addShapelessRecipy(new ItemInstance(Item::dye_powder, 2, DyePowderItem::ORANGE), //
L"zzg",
new ItemInstance(Item::dye_powder, 1, DyePowderItem::RED),
@ -81,6 +85,10 @@ void ClothDyeRecipes::addRecipes(Recipes *r)
new ItemInstance(Item::dye_powder, 1, DyePowderItem::WHITE),
new ItemInstance(Item::dye_powder, 1, DyePowderItem::WHITE),L'D');
r->addShapelessRecipy(new ItemInstance(Item::dye_powder, 2, DyePowderItem::LIGHT_BLUE), //
L"tg",
Tile::blueRose,L'D');
r->addShapelessRecipy(new ItemInstance(Item::dye_powder, 2, DyePowderItem::LIGHT_BLUE), //
L"zzg",
new ItemInstance(Item::dye_powder, 1, DyePowderItem::BLUE),

View file

@ -285,10 +285,18 @@ bool DyePowderItem::growCrop(shared_ptr<ItemInstance> itemInstance, Level *level
{
if (Tile::flower->canSurvive(level, xx, yy, zz)) level->setTileAndUpdate(xx, yy, zz, Tile::flower_Id);
}
else
else if (random->nextInt(3) != 0)
{
if (Tile::rose->canSurvive(level, xx, yy, zz)) level->setTileAndUpdate(xx, yy, zz, Tile::rose_Id);
}
else if (random->nextInt(3) != 0)
{
if (Tile::peony->canSurvive(level, xx, yy, zz)) level->setTileAndUpdate(xx, yy, zz, Tile::peony_Id);
}
else if (random->nextInt(3) != 0)
{
if (Tile::blueRose->canSurvive(level, xx, yy, zz)) level->setTileAndUpdate(xx, yy, zz, Tile::blueRose_Id);
}
}
// 4J - Stops infinite loops.

View file

@ -17,6 +17,14 @@ void FoodRecipies::addRecipes(Recipes *r)
L'#', Item::goldIngot, L'X', Item::apple,
L'F');
//r->addShapedRecipy(new ItemInstance(Item::apple_ruby, 1, 0), //
//L"ssscicig",
//L"###", //
//L"#X#", //
//L"###", //
//L'#', Item::ruby, L'X', Item::apple,
//L'F');
r->addShapedRecipy(new ItemInstance(Item::apple_gold, 1, 1), //
L"sssctcig",
L"###", //

View file

@ -19,10 +19,12 @@ FurnaceRecipes::FurnaceRecipes()
{
addFurnaceRecipy(Tile::ironOre_Id, new ItemInstance(Item::ironIngot), .7f);
addFurnaceRecipy(Tile::goldOre_Id, new ItemInstance(Item::goldIngot), 1);
addFurnaceRecipy(Tile::netherGold_Id, new ItemInstance(Item::goldIngot), 1);
addFurnaceRecipy(Tile::diamondOre_Id, new ItemInstance(Item::diamond), 1);
addFurnaceRecipy(Tile::sand_Id, new ItemInstance(Tile::glass), .1f);
addFurnaceRecipy(Item::porkChop_raw_Id, new ItemInstance(Item::porkChop_cooked), .35f);
addFurnaceRecipy(Item::beef_raw_Id, new ItemInstance(Item::beef_cooked), .35f);
//addFurnaceRecipy(Item::mutton_raw_Id, new ItemInstance(Item::mutton_cooked), .35f);
addFurnaceRecipy(Item::chicken_raw_Id, new ItemInstance(Item::chicken_cooked), .35f);
addFurnaceRecipy(Item::fish_raw_Id, new ItemInstance(Item::fish_cooked), .35f);
addFurnaceRecipy(Tile::cobblestone_Id, new ItemInstance(Tile::stone), .1f);

View file

@ -496,6 +496,16 @@ void HellRandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt)
quartzFeature.place(level, pprandom, x, y, z);
}
OreFeature netherGoldFeature(Tile::netherGold_Id, 13, Tile::netherRack_Id);
for (int i = 0; i < 16; i++)
{
int x = xo + pprandom->nextInt(16);
int y = pprandom->nextInt(Level::genDepth - 20) + 10;
int z = zo + pprandom->nextInt(16);
netherGoldFeature.place(level, pprandom, x, y, z);
}
for (int i = 0; i < 16; i++)
{
int x = xo + random->nextInt(16);

View file

@ -0,0 +1,178 @@
#include "stdafx.h"
#include "IslandFeature.h"
#include "net.minecraft.world.level.h"
#include "net.minecraft.world.level.tile.h"
#include "net.minecraft.world.level.biome.h"
IslandFeature::IslandFeature(int tile)
{
this->tile = tile;
}
bool IslandFeature::place(Level *level, Random *random, int x, int y, int z)
{
x -= 8;
z -= 8;
while (y > 5 && level->isEmptyTile(x, y, z))
y--;
if (y <= 4)
{
return false;
}
y -= 4;
bool grid[16*16*8] = {0};
LevelGenerationOptions *levelGenOptions = nullptr;
if( app.getLevelGenerationOptions() != nullptr )
{
levelGenOptions = app.getLevelGenerationOptions();
int minX = x;
int minY = y;
int minZ = z;
int maxX = x + 16;
int maxY = y + 8;
int maxZ = z + 16;
bool intersects = levelGenOptions->checkIntersects(minX, minY, minZ, maxX, maxY, maxZ);
if(intersects)
{
//app.DebugPrintf("Skipping reeds feature generation as it overlaps a game rule structure\n");
return false;
}
}
int spots = random->nextInt(4) + 4;
for (int i = 0; i < spots; i++)
{
double xr = random->nextDouble() * 6 + 3;
double yr = random->nextDouble() * 4 + 2;
double zr = random->nextDouble() * 6 + 3;
double xp = random->nextDouble() * (16 - xr - 2) + 1 + xr / 2;
double yp = random->nextDouble() * (8 - yr - 4) + 2 + yr / 2;
double zp = random->nextDouble() * (16 - zr - 2) + 1 + zr / 2;
for (int xx = 1; xx < 15; xx++)
{
for (int zz = 1; zz < 15; zz++)
{
for (int yy = 1; yy < 7; yy++)
{
double xd = ((xx - xp) / (xr / 2));
double yd = ((yy - yp) / (yr / 2));
double zd = ((zz - zp) / (zr / 2));
double d = xd * xd + yd * yd + zd * zd;
if (d < 1) grid[((xx) * 16 + (zz)) * 8 + (yy)] = true;
}
}
}
}
for (int xx = 0; xx < 16; xx++)
{
for (int zz = 0; zz < 16; zz++)
{
for (int yy = 0; yy < 8; yy++)
{
bool check = !grid[((xx) * 16 + (zz)) * 8 + (yy)] && ((xx < 15 && grid[((xx + 1) * 16 + (zz)) * 8 + (yy)])//
|| (xx > 0 && grid[((xx - 1) * 16 + (zz)) * 8 + (yy)])
|| (zz < 15 && grid[((xx) * 16 + (zz + 1)) * 8 + (yy)])
|| (zz > 0 && grid[((xx) * 16 + (zz - 1)) * 8 + (yy)])
|| (yy < 7 && grid[((xx) * 16 + (zz)) * 8 + (yy + 1)])
|| (yy > 0 && grid[((xx) * 16 + (zz)) * 8 + (yy - 1)]));
if (check)
{
Material *m = level->getMaterial(x + xx, y + yy, z + zz);
if (yy >= 4 && m->isLiquid()) return false;
if (yy < 4 && (!m->isSolid() && level->getTile(x + xx, y + yy, z + zz) != tile)) return false;
}
}
}
}
int height = random->nextInt(32);
for (int xx = 0; xx < 16; xx++)
{
for (int zz = 0; zz < 16; zz++)
{
for (int yy = 0; yy < 8; yy++)
{
if (grid[((xx) * 8 + (zz)) * 8 + (yy)])
{
level->setTileAndData(x + xx, y + yy+100+height, z + zz, tile, 0, Tile::UPDATE_CLIENTS);
level->setTileAndData(x + xx, y + yy+98+height, z + zz, Tile::dirt_Id, 0, Tile::UPDATE_CLIENTS);
level->setTileAndData(x + xx, y + yy+96+height, z + zz, Tile::stone_Id, 0, Tile::UPDATE_CLIENTS);
}
}
}
}
for (int xx = 0; xx < 16; xx++)
{
for (int zz = 0; zz < 16; zz++)
{
for (int yy = 4; yy < 8; yy++)
{
if (grid[((xx) * 16 + (zz)) * 8 + (yy)])
{
if (level->getTile(x + xx, y + yy - 1, z + zz) == Tile::dirt_Id && level->getBrightness(LightLayer::Sky, x + xx, y + yy, z + zz) > 0)
{
Biome *b = level->getBiome(x + xx, z + zz);
if (b->topMaterial == Tile::mycel_Id) level->setTileAndData(x + xx, y + yy - 1, z + zz, Tile::mycel_Id, 0, Tile::UPDATE_CLIENTS);
else level->setTileAndData(x + xx, y + yy - 1, z + zz, Tile::grass_Id, 0, Tile::UPDATE_CLIENTS);
}
}
}
}
}
if (Tile::tiles[tile]->material == Material::lava)
{
for (int xx = 0; xx < 16; xx++)
{
for (int zz = 0; zz < 16; zz++)
{
for (int yy = 0; yy < 8; yy++)
{
bool check = !grid[((xx) * 16 + (zz)) * 8 + (yy)] && (
(xx < 15 && grid[(((xx + 1) * 16 + (zz)) * 8 + (yy))])
|| (xx > 0 && grid[(((xx - 1) * 16 + (zz)) * 8 + (yy))])
|| (zz < 15 && grid[(((xx) * 16 + (zz + 1)) * 8 + (yy))])
|| (zz > 0 && grid[(((xx) * 16 + (zz - 1)) * 8 + (yy))])
|| (yy < 7 && grid[(((xx) * 16 + (zz)) * 8 + (yy + 1))])
|| (yy > 0 && grid[(((xx) * 16 + (zz)) * 8 + (yy - 1))]));
if (check)
{
if ((yy<4 || random->nextInt(2)!=0) && level->getMaterial(x + xx, y + yy, z + zz)->isSolid())
{
level->setTileAndData(x + xx, y + yy, z + zz, Tile::stone_Id, 0, Tile::UPDATE_CLIENTS);
}
}
}
}
}
}
// 4J - brought forward from 1.8.2
if (Tile::tiles[tile]->material == Material::water)
{
for (int xx = 0; xx < 16; xx++)
{
for (int zz = 0; zz < 16; zz++)
{
int yy = 4;
if (level->shouldFreezeIgnoreNeighbors(x + xx, y + yy, z + zz)) level->setTileAndData(x + xx, y + yy, z + zz, Tile::ice_Id, 0, Tile::UPDATE_CLIENTS);
}
}
}
return true;
}

View file

@ -0,0 +1,14 @@
#pragma once
#include "Feature.h"
#include "Material.h"
class IslandFeature : public Feature
{
private:
int tile;
public:
IslandFeature (int tile);
virtual bool place(Level *level, Random *random, int x, int y, int z);
};

View file

@ -16,6 +16,7 @@
#include "HangingEntityItem.h"
#include "HtmlString.h"
typedef Item::Tier _Tier;
//const UUID Item::BASE_ATTACK_DAMAGE_UUID = UUID::fromString(L"CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
@ -25,6 +26,7 @@ wstring Item::ICON_DESCRIPTION_PREFIX = L"item.";
const _Tier *_Tier::WOOD = new _Tier(0, 59, 2, 0, 15); //
const _Tier *_Tier::STONE = new _Tier(1, 131, 4, 1, 5); //
const _Tier *_Tier::IRON = new _Tier(2, 250, 6, 2, 14); //
const _Tier *_Tier::RUBY = new _Tier(3, 67, 15, 3, 27); //
const _Tier *_Tier::DIAMOND = new _Tier(3, 1561, 8, 3, 10); //
const _Tier *_Tier::GOLD = new _Tier(0, 32, 12, 0, 22);
@ -60,6 +62,13 @@ Item *Item::shovel_diamond = nullptr;
Item *Item::pickAxe_diamond = nullptr;
Item *Item::hatchet_diamond = nullptr;
//Item *Item::sword_ruby = nullptr;
//Item *Item::shovel_ruby = nullptr;
//Item *Item::pickAxe_ruby = nullptr;
//Item *Item::hatchet_ruby = nullptr;
//Item *Item::hoe_ruby = nullptr;
//Item *Item::ruby = nullptr;
Item *Item::stick = nullptr;
Item *Item::bowl = nullptr;
Item *Item::mushroomStew = nullptr;
@ -259,30 +268,35 @@ void Item::staticCtor()
Item::sword_iron = ( new WeaponItem(11, _Tier::IRON) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_iron) ->setIconName(L"swordIron")->setDescriptionId(IDS_ITEM_SWORD_IRON)->setUseDescriptionId(IDS_DESC_SWORD);
Item::sword_diamond = ( new WeaponItem(20, _Tier::DIAMOND) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_diamond) ->setIconName(L"swordDiamond")->setDescriptionId(IDS_ITEM_SWORD_DIAMOND)->setUseDescriptionId(IDS_DESC_SWORD);
Item::sword_gold = ( new WeaponItem(27, _Tier::GOLD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_gold) ->setIconName(L"swordGold")->setDescriptionId(IDS_ITEM_SWORD_GOLD)->setUseDescriptionId(IDS_DESC_SWORD);
Item::shovel_wood = ( new ShovelItem(13, _Tier::WOOD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_wood) ->setIconName(L"shovelWood")->setDescriptionId(IDS_ITEM_SHOVEL_WOOD)->setUseDescriptionId(IDS_DESC_SHOVEL);
Item::shovel_stone = ( new ShovelItem(17, _Tier::STONE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_stone) ->setIconName(L"shovelStone")->setDescriptionId(IDS_ITEM_SHOVEL_STONE)->setUseDescriptionId(IDS_DESC_SHOVEL);
Item::shovel_iron = ( new ShovelItem(0, _Tier::IRON) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_iron) ->setIconName(L"shovelIron")->setDescriptionId(IDS_ITEM_SHOVEL_IRON)->setUseDescriptionId(IDS_DESC_SHOVEL);
Item::shovel_diamond = ( new ShovelItem(21, _Tier::DIAMOND) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_diamond) ->setIconName(L"shovelDiamond")->setDescriptionId(IDS_ITEM_SHOVEL_DIAMOND)->setUseDescriptionId(IDS_DESC_SHOVEL);
Item::shovel_gold = ( new ShovelItem(28, _Tier::GOLD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_gold) ->setIconName(L"shovelGold")->setDescriptionId(IDS_ITEM_SHOVEL_GOLD)->setUseDescriptionId(IDS_DESC_SHOVEL);
Item::pickAxe_wood = ( new PickaxeItem(14, _Tier::WOOD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_wood) ->setIconName(L"pickaxeWood")->setDescriptionId(IDS_ITEM_PICKAXE_WOOD)->setUseDescriptionId(IDS_DESC_PICKAXE);
Item::pickAxe_stone = ( new PickaxeItem(18, _Tier::STONE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_stone) ->setIconName(L"pickaxeStone")->setDescriptionId(IDS_ITEM_PICKAXE_STONE)->setUseDescriptionId(IDS_DESC_PICKAXE);
Item::pickAxe_iron = ( new PickaxeItem(1, _Tier::IRON) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_iron) ->setIconName(L"pickaxeIron")->setDescriptionId(IDS_ITEM_PICKAXE_IRON)->setUseDescriptionId(IDS_DESC_PICKAXE);
Item::pickAxe_diamond = ( new PickaxeItem(22, _Tier::DIAMOND) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_diamond) ->setIconName(L"pickaxeDiamond")->setDescriptionId(IDS_ITEM_PICKAXE_DIAMOND)->setUseDescriptionId(IDS_DESC_PICKAXE);
Item::pickAxe_gold = ( new PickaxeItem(29, _Tier::GOLD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_gold) ->setIconName(L"pickaxeGold")->setDescriptionId(IDS_ITEM_PICKAXE_GOLD)->setUseDescriptionId(IDS_DESC_PICKAXE);
Item::hatchet_wood = ( new HatchetItem(15, _Tier::WOOD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_wood) ->setIconName(L"hatchetWood")->setDescriptionId(IDS_ITEM_HATCHET_WOOD)->setUseDescriptionId(IDS_DESC_HATCHET);
Item::hatchet_stone = ( new HatchetItem(19, _Tier::STONE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_stone) ->setIconName(L"hatchetStone")->setDescriptionId(IDS_ITEM_HATCHET_STONE)->setUseDescriptionId(IDS_DESC_HATCHET);
Item::hatchet_iron = ( new HatchetItem(2, _Tier::IRON) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_iron) ->setIconName(L"hatchetIron")->setDescriptionId(IDS_ITEM_HATCHET_IRON)->setUseDescriptionId(IDS_DESC_HATCHET);
Item::hatchet_diamond = ( new HatchetItem(23, _Tier::DIAMOND) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_diamond) ->setIconName(L"hatchetDiamond")->setDescriptionId(IDS_ITEM_HATCHET_DIAMOND)->setUseDescriptionId(IDS_DESC_HATCHET);
Item::hatchet_gold = ( new HatchetItem(30, _Tier::GOLD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_gold) ->setIconName(L"hatchetGold")->setDescriptionId(IDS_ITEM_HATCHET_GOLD)->setUseDescriptionId(IDS_DESC_HATCHET);
Item::hoe_wood = ( new HoeItem(34, _Tier::WOOD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hoe, eMaterial_wood) ->setIconName(L"hoeWood")->setDescriptionId(IDS_ITEM_HOE_WOOD)->setUseDescriptionId(IDS_DESC_HOE);
Item::hoe_stone = ( new HoeItem(35, _Tier::STONE) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hoe, eMaterial_stone) ->setIconName(L"hoeStone")->setDescriptionId(IDS_ITEM_HOE_STONE)->setUseDescriptionId(IDS_DESC_HOE);
Item::hoe_iron = ( new HoeItem(36, _Tier::IRON) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hoe, eMaterial_iron) ->setIconName(L"hoeIron")->setDescriptionId(IDS_ITEM_HOE_IRON)->setUseDescriptionId(IDS_DESC_HOE);
Item::hoe_diamond = ( new HoeItem(37, _Tier::DIAMOND) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hoe, eMaterial_diamond) ->setIconName(L"hoeDiamond")->setDescriptionId(IDS_ITEM_HOE_DIAMOND)->setUseDescriptionId(IDS_DESC_HOE);
Item::hoe_gold = ( new HoeItem(38, _Tier::GOLD) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hoe, eMaterial_gold) ->setIconName(L"hoeGold")->setDescriptionId(IDS_ITEM_HOE_GOLD)->setUseDescriptionId(IDS_DESC_HOE);
Item::door_wood = ( new DoorItem(68, Material::wood) ) ->setBaseItemTypeAndMaterial(eBaseItemType_door, eMaterial_wood)->setIconName(L"doorWood")->setDescriptionId(IDS_ITEM_DOOR_WOOD)->setUseDescriptionId(IDS_DESC_DOOR_WOOD);
Item::door_iron = ( new DoorItem(74, Material::metal) ) ->setBaseItemTypeAndMaterial(eBaseItemType_door, eMaterial_iron)->setIconName(L"doorIron")->setDescriptionId(IDS_ITEM_DOOR_IRON)->setUseDescriptionId(IDS_DESC_DOOR_IRON);
@ -315,7 +329,6 @@ void Item::staticCtor()
Item::ironIngot = ( new Item(9) )->setIconName(L"ingotIron") ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_iron)->setDescriptionId(IDS_ITEM_INGOT_IRON)->setUseDescriptionId(IDS_DESC_INGOT);
Item::goldIngot = ( new Item(10) )->setIconName(L"ingotGold") ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_gold)->setDescriptionId(IDS_ITEM_INGOT_GOLD)->setUseDescriptionId(IDS_DESC_INGOT);
// 4J-PB - todo - add materials and base types to the ones below
Item::bucket_empty = ( new BucketItem(69, 0) ) ->setBaseItemTypeAndMaterial(eBaseItemType_utensil, eMaterial_water)->setIconName(L"bucket")->setDescriptionId(IDS_ITEM_BUCKET)->setUseDescriptionId(IDS_DESC_BUCKET)->setMaxStackSize(16);
Item::bowl = ( new Item(25) ) ->setBaseItemTypeAndMaterial(eBaseItemType_utensil, eMaterial_wood)->setIconName(L"bowl")->setDescriptionId(IDS_ITEM_BOWL)->setUseDescriptionId(IDS_DESC_BOWL)->setMaxStackSize(64);
@ -495,6 +508,20 @@ void Item::staticCtor()
Item::lead = (new LeashItem(164)) ->setBaseItemTypeAndMaterial(eBaseItemType_pockettool, eMaterial_undefined)->setIconName(L"lead")->setDescriptionId(IDS_ITEM_LEAD)->setUseDescriptionId(IDS_DESC_LEAD);
Item::nameTag = (new NameTagItem(165)) ->setIconName(L"name_tag")->setDescriptionId(IDS_ITEM_NAME_TAG)->setUseDescriptionId(IDS_DESC_NAME_TAG);}
Item *Item::ruby = (new Item(166)) ->setBaseItemTypeAndMaterial(eBaseItemType_treasure, eMaterial_ruby)->setIconName(L"ruby")->setDescriptionId(IDS_ITEM_EMERALD)->setUseDescriptionId(IDS_DESC_EMERALD);
Item *Item::sword_ruby = ( new WeaponItem(167, _Tier::RUBY) ) ->setBaseItemTypeAndMaterial(eBaseItemType_sword, eMaterial_ruby) ->setIconName(L"ruby_sword")->setDescriptionId(IDS_ITEM_SWORD_DIAMOND)->setUseDescriptionId(IDS_DESC_SWORD);
Item *Item::shovel_ruby = ( new ShovelItem(168, _Tier::RUBY) ) ->setBaseItemTypeAndMaterial(eBaseItemType_shovel, eMaterial_ruby) ->setIconName(L"ruby_shovel")->setDescriptionId(IDS_ITEM_SHOVEL_DIAMOND)->setUseDescriptionId(IDS_DESC_SHOVEL);
Item *Item::pickAxe_ruby = ( new PickaxeItem(169, _Tier::RUBY) ) ->setBaseItemTypeAndMaterial(eBaseItemType_pickaxe, eMaterial_ruby) ->setIconName(L"ruby_pickaxe")->setDescriptionId(IDS_ITEM_PICKAXE_DIAMOND)->setUseDescriptionId(IDS_DESC_PICKAXE);
Item *Item::hatchet_ruby = ( new HatchetItem(170, _Tier::RUBY) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hatchet, eMaterial_ruby) ->setIconName(L"ruby_axe")->setDescriptionId(IDS_ITEM_HATCHET_DIAMOND)->setUseDescriptionId(IDS_DESC_HATCHET);
Item *Item::hoe_ruby = ( new HoeItem(171, _Tier::RUBY) ) ->setBaseItemTypeAndMaterial(eBaseItemType_hoe, eMaterial_ruby) ->setIconName(L"ruby_hoe")->setDescriptionId(IDS_ITEM_HOE_DIAMOND)->setUseDescriptionId(IDS_DESC_HOE);
//ArmorItem *Item::helmet_ruby = static_cast<ArmorItem *>((new ArmorItem(172, ArmorItem::ArmorMaterial::RUBY, 3, ArmorItem::SLOT_HEAD))->setBaseItemTypeAndMaterial(eBaseItemType_helmet, eMaterial_ruby)->setIconName(L"ruby_helmet")->setDescriptionId(IDS_ITEM_HELMET_DIAMOND)->setUseDescriptionId(IDS_DESC_HELMET_DIAMOND));
//ArmorItem *Item::chestplate_ruby = static_cast<ArmorItem *>((new ArmorItem(173, ArmorItem::ArmorMaterial::RUBY, 3, ArmorItem::SLOT_TORSO))->setBaseItemTypeAndMaterial(eBaseItemType_chestplate, eMaterial_ruby)->setIconName(L"ruby_chestplate")->setDescriptionId(IDS_ITEM_CHESTPLATE_DIAMOND)->setUseDescriptionId(IDS_DESC_CHESTPLATE_DIAMOND));
//ArmorItem *Item::leggings_ruby = static_cast<ArmorItem *>((new ArmorItem(174, ArmorItem::ArmorMaterial::RUBY, 3, ArmorItem::SLOT_LEGS))->setBaseItemTypeAndMaterial(eBaseItemType_leggings, eMaterial_ruby)->setIconName(L"ruby_leggings")->setDescriptionId(IDS_ITEM_LEGGINGS_DIAMOND)->setUseDescriptionId(IDS_DESC_LEGGINGS_DIAMOND));
//ArmorItem *Item::boots_ruby = static_cast<ArmorItem *>((new ArmorItem(175, ArmorItem::ArmorMaterial::RUBY, 3, ArmorItem::SLOT_FEET))->setBaseItemTypeAndMaterial(eBaseItemType_boots, eMaterial_ruby)->setIconName(L"ruby_boots")->setDescriptionId(IDS_ITEM_BOOTS_DIAMOND)->setUseDescriptionId(IDS_DESC_BOOTS_DIAMOND));
//Item *Item::mutton_raw = (new FoodItem(172, 3, FoodConstants::FOOD_SATURATION_LOW, true)) ->setIconName(L"mutton_Raw")->setDescriptionId(IDS_ITEM_BEEF_RAW)->setUseDescriptionId(IDS_DESC_BEEF_RAW);
//Item *Item::mutton_cooked = (new FoodItem(173, 6, FoodConstants::FOOD_SATURATION_GOOD, true))->setIconName(L"mutton_Cooked")->setDescriptionId(IDS_ITEM_BEEF_COOKED)->setUseDescriptionId(IDS_DESC_BEEF_COOKED);
//Item *Item::apple_ruby = ( new GoldenAppleItem(174, 4, FoodConstants::FOOD_SATURATION_SUPERNATURAL, false) )->setCanAlwaysEat()->setEatEffect(MobEffect::regeneration->id, 5, 1, 1.0f)
// ->setBaseItemTypeAndMaterial(eBaseItemType_giltFruit,eMaterial_apple)->setIconName(L"appleRuby")->setDescriptionId(IDS_ITEM_APPLE_GOLD);//->setUseDescriptionId(IDS_DESC_GOLDENAPPLE);
// 4J Stu - We need to do this after the staticCtor AND after staticCtors for other class
// eg Recipes

View file

@ -45,6 +45,7 @@ public:
eMaterial_iron,
eMaterial_gold,
eMaterial_diamond,
eMaterial_ruby,
eMaterial_cloth,
eMaterial_chain, // 4J Stu - It's available in creative in 1.8
eMaterial_detector,
@ -158,6 +159,7 @@ public:
static const Tier *IRON; //
static const Tier *DIAMOND; //
static const Tier *GOLD;
static const Tier *RUBY;
private:
const int level;
@ -217,6 +219,22 @@ public:
static Item *pickAxe_diamond;
static Item *hatchet_diamond;
static Item *sword_ruby;
static Item *shovel_ruby;
static Item *pickAxe_ruby;
static Item *hatchet_ruby;
static Item *hoe_ruby;
static Item *ruby;
static Item *mutton_raw;
static Item *mutton_cooked;
static Item *apple_ruby;
static ArmorItem *helmet_ruby;
static ArmorItem *chestplate_ruby;
static ArmorItem *leggings_ruby;
static ArmorItem *boots_ruby;
static Item *stick;
static Item *bowl;
static Item *mushroomStew;
@ -618,6 +636,22 @@ public:
static const int lead_Id = 420;
static const int nameTag_Id = 421;
static const int ruby_Id = 422;
static const int sword_ruby_Id = 423;
static const int shovel_ruby_Id = 424;
static const int pickAxe_ruby_Id= 425;
static const int hatchet_ruby_Id = 426;
static const int hoe_ruby_Id = 427;
static const int helmet_ruby_Id = 428;
static const int chestplate_ruby_Id = 429;
static const int leggings_ruby_Id = 430;
static const int boots_ruby_Id = 431;
static const int mutton_cooked_Id = 432;
static const int mutton_raw_Id = 433;
static const int apple_ruby_Id = 434;
public:
const int id;

View file

@ -11,9 +11,10 @@ const unsigned int LeafTile::LEAF_NAMES[LEAF_NAMES_LENGTH] = { IDS_TILE_LEAVES_O
IDS_TILE_LEAVES_SPRUCE,
IDS_TILE_LEAVES_BIRCH,
IDS_TILE_LEAVES_JUNGLE,
IDS_TILE_LEAVES_OAK,
};
const wstring LeafTile::TEXTURES[2][4] = { {L"leaves", L"leaves_spruce", L"leaves", L"leaves_jungle"}, {L"leaves_opaque", L"leaves_spruce_opaque", L"leaves_opaque", L"leaves_jungle_opaque"},};
const wstring LeafTile::TEXTURES[2][5] = { {L"leaves", L"leaves_spruce", L"leaves", L"leaves_jungle", L"alpha_leaves"}, {L"leaves_opaque", L"leaves_spruce_opaque", L"leaves_opaque", L"leaves_jungle_opaque", L"alpha_leaves_opaque"},};
LeafTile::LeafTile(int id) : TransparentTile(id, Material::leaves, false, isSolidRender())
{
@ -48,6 +49,10 @@ int LeafTile::getColor(int data)
{
return FoliageColor::getBirchColor();
}
if ((data & LEAF_TYPE_MASK) == ALPHA_LEAF)
{
return FoliageColor::getDefaultColor();
}
return FoliageColor::getDefaultColor();
}
@ -68,6 +73,10 @@ int LeafTile::getColor(LevelSource *level, int x, int y, int z, int data)
{
return FoliageColor::getBirchColor();
}
if ((data & LEAF_TYPE_MASK) == ALPHA_LEAF)
{
return FoliageColor::getDefaultColor();
}
int totalRed = 0;
int totalGreen = 0;
@ -313,6 +322,11 @@ Icon *LeafTile::getTexture(int face, int data)
{
return icons[fancyTextureSet][BIRCH_LEAF];
}
if ((data & LEAF_TYPE_MASK) == ALPHA_LEAF)
{
return icons[fancyTextureSet][ALPHA_LEAF];
}
return icons[fancyTextureSet][0];
}

View file

@ -9,7 +9,7 @@ class LeafTile : public TransparentTile
friend class Tile;
friend class ChunkRebuildData;
public:
static const wstring TEXTURES[2][4];
static const wstring TEXTURES[2][5];
static const int REQUIRED_WOOD_RANGE = 4;
static const int UPDATE_LEAF_BIT = 8;
@ -18,8 +18,9 @@ public:
static const int EVERGREEN_LEAF = 1;
static const int BIRCH_LEAF = 2;
static const int JUNGLE_LEAF = 3;
static const int ALPHA_LEAF = 4;
static const int LEAF_NAMES_LENGTH = 4;
static const int LEAF_NAMES_LENGTH = 5;
static const unsigned int LEAF_NAMES[LEAF_NAMES_LENGTH];
private:

View file

@ -3143,6 +3143,7 @@
<ClInclude Include="ItemStat.h" />
<ClInclude Include="LadderTile.h" />
<ClInclude Include="LakeFeature.h" />
<ClInclude Include="IslandFeature.h" />
<ClInclude Include="LargeCaveFeature.h" />
<ClInclude Include="LargeFeature.h" />
<ClInclude Include="LargeHellCaveFeature.h" />
@ -4086,6 +4087,7 @@
<ClCompile Include="KeepAlivePacket.cpp" />
<ClCompile Include="LadderTile.cpp" />
<ClCompile Include="LakeFeature.cpp" />
<ClCompile Include="IslandFeature.cpp" />
<ClCompile Include="Language.cpp" />
<ClCompile Include="LargeCaveFeature.cpp" />
<ClCompile Include="LargeFeature.cpp" />

View file

@ -476,6 +476,9 @@
<ClInclude Include="LakeFeature.h">
<Filter>net\minecraft\world\level\levelgen\feature</Filter>
</ClInclude>
<ClInclude Include="IslandFeature.h">
<Filter>net\minecraft\world\level\levelgen\feature</Filter>
</ClInclude>
<ClInclude Include="LightGemFeature.h">
<Filter>net\minecraft\world\level\levelgen\feature</Filter>
</ClInclude>
@ -3346,6 +3349,9 @@
<ClCompile Include="LakeFeature.cpp">
<Filter>net\minecraft\world\level\levelgen\feature</Filter>
</ClCompile>
<ClCompile Include="IslandFeature.cpp">
<Filter>net\minecraft\world\level\levelgen\feature</Filter>
</ClCompile>
<ClCompile Include="LightGemFeature.cpp">
<Filter>net\minecraft\world\level\levelgen\feature</Filter>
</ClCompile>

View file

@ -32,6 +32,12 @@ void MycelTile::registerIcons(IconRegister *iconRegister)
icon = iconRegister->registerIcon(L"mycel_side");
iconTop = iconRegister->registerIcon(L"mycel_top");
iconSnowSide = iconRegister->registerIcon(L"snow_side");
if (id == Tile::alphaGrass_Id)
{
icon = iconRegister->registerIcon(L"alpha_grass_side");
iconTop = iconRegister->registerIcon(L"alpha_grass_top");
}
}
void MycelTile::tick(Level *level, int x, int y, int z, Random *random)
@ -64,7 +70,7 @@ void MycelTile::tick(Level *level, int x, int y, int z, Random *random)
void MycelTile::animateTick(Level *level, int x, int y, int z, Random *random)
{
Tile::animateTick(level, x, y, z, random);
if (random->nextInt(10) == 0) level->addParticle(eParticleType_townaura, x + random->nextFloat(), y + 1.1f, z + random->nextFloat(), 0, 0, 0);
if (random->nextInt(10) == 0 && id != Tile::alphaGrass_Id) level->addParticle(eParticleType_townaura, x + random->nextFloat(), y + 1.1f, z + random->nextFloat(), 0, 0, 0);
}

View file

@ -20,17 +20,20 @@ void OreRecipies::_init()
ADD_OBJECT(map[3],Tile::emeraldBlock);
ADD_OBJECT(map[3],new ItemInstance(Item::emerald, 9));
ADD_OBJECT(map[4],Tile::lapisBlock);
ADD_OBJECT(map[4],new ItemInstance(Item::dye_powder, 9, DyePowderItem::BLUE));
ADD_OBJECT(map[4],Tile::rubyBlock);
ADD_OBJECT(map[4],new ItemInstance(Item::ruby, 9));
ADD_OBJECT(map[5],Tile::redstoneBlock);
ADD_OBJECT(map[5],new ItemInstance(Item::redStone, 9));
ADD_OBJECT(map[5],Tile::lapisBlock);
ADD_OBJECT(map[5],new ItemInstance(Item::dye_powder, 9, DyePowderItem::BLUE));
ADD_OBJECT(map[6],Tile::coalBlock);
ADD_OBJECT(map[6],new ItemInstance(Item::coal, 9, CoalItem::STONE_COAL));
ADD_OBJECT(map[6],Tile::redstoneBlock);
ADD_OBJECT(map[6],new ItemInstance(Item::redStone, 9));
ADD_OBJECT(map[7],Tile::hayBlock);
ADD_OBJECT(map[7],new ItemInstance(Item::wheat, 9));
ADD_OBJECT(map[7],Tile::coalBlock);
ADD_OBJECT(map[7],new ItemInstance(Item::coal, 9, CoalItem::STONE_COAL));
ADD_OBJECT(map[8],Tile::hayBlock);
ADD_OBJECT(map[8],new ItemInstance(Item::wheat, 9));
}
void OreRecipies::addRecipes(Recipes *r)
{

View file

@ -1,6 +1,6 @@
#pragma once
#define MAX_ORE_RECIPES 8
#define MAX_ORE_RECIPES 9
class OreRecipies
{

View file

@ -14,6 +14,8 @@ int OreTile::getResource(int data, Random *random, int playerBonusLevel)
if (id == Tile::lapisOre_Id) return Item::dye_powder_Id;
if (id == Tile::emeraldOre_Id) return Item::emerald_Id;
if (id == Tile::netherQuartz_Id) return Item::netherQuartz_Id;
if (id == Tile::rubyOre_Id) return Item::ruby_Id;
return id;
}
@ -65,6 +67,10 @@ void OreTile::spawnResources(Level *level, int x, int y, int z, int data, float
{
magicCount = Mth::nextInt(level->random, 2, 5);
}
else if (id == Tile::rubyOre_Id)
{
magicCount = Mth::nextInt(level->random, 2, 8);
}
popExperience(level, x, y, z, magicCount);
}
}

View file

@ -33,6 +33,7 @@ RandomLevelSource::RandomLevelSource(Level *level, int64_t seed, bool generateSt
level->getLevelData()->getMoatFlags(&m_classicEdgeMoat, &m_smallEdgeMoat, &m_mediumEdgeMoat);
#endif
caveFeature = new LargeCaveFeature();
caveLargeFeature = new LargeCaveFeature();
strongholdFeature = new StrongholdFeature();
villageFeature = new VillageFeature(m_XZSize);
mineShaftFeature = new MineShaftFeature();
@ -68,6 +69,7 @@ RandomLevelSource::RandomLevelSource(Level *level, int64_t seed, bool generateSt
RandomLevelSource::~RandomLevelSource()
{
delete caveFeature;
delete caveLargeFeature;
delete strongholdFeature;
delete villageFeature;
delete mineShaftFeature;
@ -487,6 +489,7 @@ LevelChunk *RandomLevelSource::getChunk(int xOffs, int zOffs)
delete [] biomes.data;
caveFeature->apply(this, level, xOffs, zOffs, blocks);
caveLargeFeature->apply(this, level, xOffs / 4, zOffs / 4, blocks);
// 4J Stu Design Change - 1.8 gen goes stronghold, mineshaft, village, canyon
// this changed in 1.2 to canyon, mineshaft, village, stronghold
// This change makes sense as it stops canyons running through other structures

View file

@ -16,7 +16,7 @@ class RandomLevelSource : public ChunkSource
public:
static const double SNOW_CUTOFF;
static const double SNOW_SCALE;
static const bool FLOATING_ISLANDS = false;
static const bool FLOATING_ISLANDS = true;
static const int CHUNK_HEIGHT = 8;
static const int CHUNK_WIDTH = 4;
@ -63,6 +63,7 @@ public:
private:
LargeFeature *caveFeature;
LargeFeature *caveLargeFeature;
StrongholdFeature *strongholdFeature;
VillageFeature *villageFeature;
MineShaftFeature *mineShaftFeature;

View file

@ -110,6 +110,16 @@ void Sheep::dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel)
// killing a non-sheared sheep will drop a single block of cloth
spawnAtLocation(std::make_shared<ItemInstance>(Tile::wool_Id, 1, getColor()), 0.0f);
}
// and some meat
if (this->isOnFire())
{
//spawnAtLocation(Item::mutton_cooked_Id, 1);
}
else
{
//spawnAtLocation(Item::mutton_raw_Id, 1);
}
}
int Sheep::getDeathLoot()

View file

@ -17,6 +17,7 @@
#include "net.minecraft.h"
#include "Tile.h"
wstring Tile::TILE_DESCRIPTION_PREFIX = L"Tile.";
const float Tile::INDESTRUCTIBLE_DESTROY_TIME = -1.0f;
@ -220,6 +221,14 @@ Tile *Tile::woolCarpet = nullptr;
Tile *Tile::clayHardened = nullptr;
Tile *Tile::coalBlock = nullptr;
Tile *Tile::rubyOre = nullptr;
Tile *Tile::rubyBlock = nullptr;
Bush *Tile::blueRose = nullptr;
Bush *Tile::peony = nullptr;
Tile *Tile::glowLichen = nullptr;
Tile *Tile::netherGold = nullptr;
MycelTile *Tile::alphaGrass = nullptr;
DWORD Tile::tlsIdxShape = TlsAlloc();
Tile::ThreadStorage::ThreadStorage()
@ -442,6 +451,14 @@ void Tile::staticCtor()
Tile::clayHardened = (new Tile(172, Material::stone)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_clay, Item::eMaterial_clay)->setDestroyTime(1.25f)->setExplodeable(7)->setSoundType(SOUND_STONE)->setIconName(L"hardened_clay")->setDescriptionId(IDS_TILE_HARDENED_CLAY)->setUseDescriptionId(IDS_DESC_HARDENED_CLAY);
Tile::coalBlock = (new Tile(173, Material::stone)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_block, Item::eMaterial_coal)->setDestroyTime(5.0f)->setExplodeable(10)->setSoundType(SOUND_STONE)->setIconName(L"coal_block")->setDescriptionId(IDS_TILE_COAL)->setUseDescriptionId(IDS_DESC_COAL_BLOCK);
Tile::rubyOre = (new OreTile(174)) ->setDestroyTime(3.0f)->setExplodeable(5)->setSoundType(SOUND_STONE)->setIconName(L"ruby_ore")->setDescriptionId(IDS_TILE_EMERALDORE)->setUseDescriptionId(IDS_DESC_EMERALDORE);
Tile::rubyBlock = (new MetalTile(175)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_block, Item::eMaterial_emerald)->setDestroyTime(5.0f)->setExplodeable(10)->setSoundType(SOUND_METAL)->setIconName(L"ruby_block")->setDescriptionId(IDS_TILE_EMERALDBLOCK)->setUseDescriptionId(IDS_DESC_EMERALDBLOCK);
Tile::blueRose = static_cast<Bush *>((new Bush(176))->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_GRASS)->setIconName(L"flower_blue_rose")->setDescriptionId(IDS_TILE_FLOWER)->setUseDescriptionId(IDS_DESC_FLOWER)->disableMipmap());
Tile::peony = static_cast<Bush *>((new Bush(177))->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_GRASS)->setIconName(L"flower_peony")->setDescriptionId(IDS_TILE_FLOWER)->setUseDescriptionId(IDS_DESC_FLOWER)->disableMipmap());
//Tile::glowLichen = (new VineTile(178))->setDestroyTime(0.2f) ->setSoundType(SOUND_GRASS)->setLightEmission(0.33f)->setIconName(L"glow_Lichen")->setDescriptionId(IDS_TILE_VINE)->setUseDescriptionId(IDS_DESC_VINE)->sendTileData();
Tile::netherGold = (new OreTile(178)) ->setDestroyTime(3.0f)->setExplodeable(5)->setSoundType(SOUND_STONE)->setIconName(L"gold_ore_netherrack")->setDescriptionId(IDS_TILE_NETHER_QUARTZ)->setUseDescriptionId(IDS_DESC_NETHER_QUARTZ_ORE);
Tile::alphaGrass = static_cast<MycelTile *>((new MycelTile(179))->setDestroyTime(0.6f)->setSoundType(SOUND_GRASS)->setIconName(L"alpha_grass_side")->setDescriptionId(IDS_TILE_GRASS)->setUseDescriptionId(IDS_DESC_GRASS));
// Special cases for certain items since they can have different icons
Item::items[wool_Id] = ( new WoolTileItem(Tile::wool_Id- 256) )->setIconName(L"cloth")->setDescriptionId(IDS_TILE_CLOTH)->setUseDescriptionId(IDS_DESC_WOOL);
@ -1702,4 +1719,6 @@ const int Tile::netherQuartz_Id;
const int Tile::quartzBlock_Id;
const int Tile::stairs_quartz_Id;
const int Tile::woolCarpet_Id;
const int Tile::rubyOre_Id;
const int Tile::rubyBlock_Id;
#endif

View file

@ -365,6 +365,14 @@ public:
static const int clayHardened_Id = 172;
static const int coalBlock_Id = 173;
static const int rubyOre_Id = 174;
static const int rubyBlock_Id = 175;
static const int blueRose_Id = 176;
static const int peony_Id = 177;
//static const int glowLichen_Id = 178;
static const int netherGold_Id = 178;
static const int alphaGrass_Id = 179;
static Tile *stone;
static GrassTile *grass;
@ -541,6 +549,14 @@ public:
static Tile *clayHardened;
static Tile *coalBlock;
static Tile *rubyOre;
static Tile *rubyBlock;
static Bush *blueRose;
static Bush *peony;
static Tile *glowLichen;
static Tile *netherGold;
static MycelTile *alphaGrass;
static void staticCtor();
int id;

View file

@ -34,30 +34,36 @@ void ToolRecipies::_init()
ADD_OBJECT(map[0],Item::ironIngot);
ADD_OBJECT(map[0],Item::diamond);
ADD_OBJECT(map[0],Item::goldIngot);
ADD_OBJECT(map[0],Item::ruby);
ADD_OBJECT(map[1],Item::pickAxe_wood);
ADD_OBJECT(map[1],Item::pickAxe_stone);
ADD_OBJECT(map[1],Item::pickAxe_iron);
ADD_OBJECT(map[1],Item::pickAxe_diamond);
ADD_OBJECT(map[1],Item::pickAxe_gold);
ADD_OBJECT(map[1],Item::pickAxe_ruby);
ADD_OBJECT(map[2],Item::shovel_wood);
ADD_OBJECT(map[2],Item::shovel_stone);
ADD_OBJECT(map[2],Item::shovel_iron);
ADD_OBJECT(map[2],Item::shovel_diamond);
ADD_OBJECT(map[2],Item::shovel_gold);
ADD_OBJECT(map[2],Item::shovel_ruby);
ADD_OBJECT(map[3],Item::hatchet_wood);
ADD_OBJECT(map[3],Item::hatchet_stone);
ADD_OBJECT(map[3],Item::hatchet_iron);
ADD_OBJECT(map[3],Item::hatchet_diamond);
ADD_OBJECT(map[3],Item::hatchet_gold);
ADD_OBJECT(map[3],Item::hatchet_ruby);
ADD_OBJECT(map[4],Item::hoe_wood);
ADD_OBJECT(map[4],Item::hoe_stone);
ADD_OBJECT(map[4],Item::hoe_iron);
ADD_OBJECT(map[4],Item::hoe_diamond);
ADD_OBJECT(map[4],Item::hoe_gold);
ADD_OBJECT(map[4],Item::hoe_ruby);
}
void ToolRecipies::addRecipes(Recipes *r)

View file

@ -23,12 +23,14 @@ void WeaponRecipies::_init()
ADD_OBJECT(map[0],Item::ironIngot);
ADD_OBJECT(map[0],Item::diamond);
ADD_OBJECT(map[0],Item::goldIngot);
ADD_OBJECT(map[0],Item::ruby);
ADD_OBJECT(map[1],Item::sword_wood);
ADD_OBJECT(map[1],Item::sword_stone);
ADD_OBJECT(map[1],Item::sword_iron);
ADD_OBJECT(map[1],Item::sword_diamond);
ADD_OBJECT(map[1],Item::sword_gold);
ADD_OBJECT(map[1],Item::sword_ruby);
}
void WeaponRecipies::addRecipes(Recipes *r)