Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Minecraft.World/GrassTile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ void GrassTile::tick(Level *level, int x, int y, int z, Random *random)
}
}
}

Material* above = level->getMaterial(x, y + 1, z);
if (above->isSolid() || above->isLiquid()) level->setTileAndUpdate(x, y, z, Tile::dirt_Id);
}

int GrassTile::getResource(int data, Random *random, int playerBonusLevel)
Expand Down
4 changes: 2 additions & 2 deletions Minecraft.World/HoeItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ HoeItem::HoeItem(int id, const Tier *tier) : Item(id)
setMaxDamage(tier->getUses());
}

bool HoeItem::useOn(shared_ptr<ItemInstance> instance, shared_ptr<Player> player, Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly)
bool HoeItem::useOn(shared_ptr<ItemInstance> instance, shared_ptr<Player> player, Level* level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, bool bTestUseOnOnly)
{
if (!player->mayUseItemAt(x, y, z, face, instance)) return false;

Expand All @@ -21,7 +21,7 @@ bool HoeItem::useOn(shared_ptr<ItemInstance> instance, shared_ptr<Player> player
int targetType = level->getTile(x, y, z);
int above = level->getTile(x, y + 1, z);

if (face != 0 && above == 0 && (targetType == Tile::grass_Id || targetType == Tile::dirt_Id))
if (face != 0 && above == 0 && (targetType == Tile::grass_Id || targetType == Tile::dirt_Id || targetType == Tile::mycel_Id))
{
if(!bTestUseOnOnly)
{
Expand Down
3 changes: 3 additions & 0 deletions Minecraft.World/MycelTile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ void MycelTile::tick(Level *level, int x, int y, int z, Random *random)
}
}
}

Material* above = level->getMaterial(x, y + 1, z);
if (above->isSolid() || above->isLiquid()) level->setTileAndUpdate(x, y, z, Tile::dirt_Id);
}

void MycelTile::animateTick(Level *level, int x, int y, int z, Random *random)
Expand Down
2 changes: 1 addition & 1 deletion Minecraft.World/ReedTile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ bool ReedTile::mayPlace(Level *level, int x, int y, int z)
{
int below = level->getTile(x, y - 1, z);
if (below == id) return true;
if (below != Tile::grass_Id && below != Tile::dirt_Id && below != Tile::sand_Id) return false;
if (below != Tile::grass_Id && below != Tile::dirt_Id && below != Tile::sand_Id && below != Tile::mycel_Id) return false;
if (level->getMaterial(x - 1, y - 1, z) == Material::water) return true;
if (level->getMaterial(x + 1, y - 1, z) == Material::water) return true;
if (level->getMaterial(x, y - 1, z - 1) == Material::water) return true;
Expand Down
Loading