Files
LegacyRenouveau/Minecraft.World/GrassPathTile.cpp
T
Tranqlmao 37cd621561 TU43 Release 1
+ Mending & FrostWalker (Needs some tlc)
+ Path Blocks
+ All Beetroot Items
- Some SWF & Texture atlasChanges
2026-07-06 23:28:11 -04:00

61 lines
1.2 KiB
C++

#include "stdafx.h"
#include "net.minecraft.world.level.h"
#include "Material.h"
#include "IconRegister.h"
#include "Facing.h"
#include "GrassPathTile.h"
GrassPathTile::GrassPathTile(int id) : Tile(id, Material::dirt), iconTop(nullptr)
{
}
void GrassPathTile::updateDefaultShape()
{
setShape(0, 0, 0, 1, 15 / 16.0f, 1);
}
bool GrassPathTile::isSolidRender(bool isServerLevel)
{
return false;
}
bool GrassPathTile::isCubeShaped()
{
return false;
}
void GrassPathTile::registerIcons(IconRegister *iconRegister)
{
iconTop = iconRegister->registerIcon(L"grass_path_top");
icon = iconRegister->registerIcon(L"grass_path_side");
}
Icon *GrassPathTile::getTexture(int face, int data)
{
if (face == Facing::UP) return iconTop;
return icon;
}
void GrassPathTile::checkAndConvert(Level *level, int x, int y, int z)
{
if (level->getMaterial(x, y + 1, z)->blocksMotion())
{
level->setTileAndUpdate(x, y, z, Tile::dirt_Id);
}
}
void GrassPathTile::neighborChanged(Level *level, int x, int y, int z, int neighborId)
{
checkAndConvert(level, x, y, z);
}
int GrassPathTile::getResource(int data, Random *random, int playerBonusLevel)
{
return Tile::dirt_Id;
}
int GrassPathTile::getResourceCount(Random *random)
{
return 1;
}