mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
QOL Mycel & Grass changes
Makes Mycel tillable Makes Grass & Mycel decay with a block over them Makes sugarcane placeable on mycel
This commit is contained in:
parent
1036b7368e
commit
4ba83027c7
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue