mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-06 13:46:36 +00:00
chore: format Minecraft.World
This commit is contained in:
@@ -9,84 +9,77 @@ const std::wstring EnchantmentTableTile::TEXTURE_SIDE = L"enchantment_side";
|
||||
const std::wstring EnchantmentTableTile::TEXTURE_TOP = L"enchantment_top";
|
||||
const std::wstring EnchantmentTableTile::TEXTURE_BOTTOM = L"enchantment_bottom";
|
||||
|
||||
EnchantmentTableTile::EnchantmentTableTile(int id) : EntityTile(id, Material::stone, false)
|
||||
{
|
||||
updateDefaultShape();
|
||||
EnchantmentTableTile::EnchantmentTableTile(int id)
|
||||
: EntityTile(id, Material::stone, false) {
|
||||
updateDefaultShape();
|
||||
setLightBlock(0);
|
||||
|
||||
iconTop = NULL;
|
||||
iconBottom = NULL;
|
||||
iconTop = NULL;
|
||||
iconBottom = NULL;
|
||||
}
|
||||
|
||||
// 4J Added override
|
||||
void EnchantmentTableTile::updateDefaultShape()
|
||||
{
|
||||
void EnchantmentTableTile::updateDefaultShape() {
|
||||
setShape(0, 0, 0, 1, 12 / 16.0f, 1);
|
||||
}
|
||||
|
||||
bool EnchantmentTableTile::isCubeShaped()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
bool EnchantmentTableTile::isCubeShaped() { return false; }
|
||||
|
||||
void EnchantmentTableTile::animateTick(Level *level, int x, int y, int z, Random *random)
|
||||
{
|
||||
void EnchantmentTableTile::animateTick(Level* level, int x, int y, int z,
|
||||
Random* random) {
|
||||
EntityTile::animateTick(level, x, y, z, random);
|
||||
|
||||
for (int xx = x - 2; xx <= x + 2; xx++)
|
||||
{
|
||||
for (int zz = z - 2; zz <= z + 2; zz++)
|
||||
{
|
||||
if (xx > x - 2 && xx < x + 2 && zz == z - 1)
|
||||
{
|
||||
for (int xx = x - 2; xx <= x + 2; xx++) {
|
||||
for (int zz = z - 2; zz <= z + 2; zz++) {
|
||||
if (xx > x - 2 && xx < x + 2 && zz == z - 1) {
|
||||
zz = z + 2;
|
||||
}
|
||||
if (random->nextInt(16) != 0) continue;
|
||||
for (int yy = y; yy <= y + 1; yy++)
|
||||
{
|
||||
if (level->getTile(xx, yy, zz) == Tile::bookshelf_Id)
|
||||
{
|
||||
if (!level->isEmptyTile((xx - x) / 2 + x, yy, (zz - z) / 2 + z)) break;
|
||||
for (int yy = y; yy <= y + 1; yy++) {
|
||||
if (level->getTile(xx, yy, zz) == Tile::bookshelf_Id) {
|
||||
if (!level->isEmptyTile((xx - x) / 2 + x, yy,
|
||||
(zz - z) / 2 + z))
|
||||
break;
|
||||
|
||||
level->addParticle(eParticleType_enchantmenttable, x + 0.5, y + 2.0, z + 0.5, xx - x + random->nextFloat() - 0.5, yy - y - random->nextFloat() - 1, zz - z + random->nextFloat() - 0.5);
|
||||
level->addParticle(eParticleType_enchantmenttable, x + 0.5,
|
||||
y + 2.0, z + 0.5,
|
||||
xx - x + random->nextFloat() - 0.5,
|
||||
yy - y - random->nextFloat() - 1,
|
||||
zz - z + random->nextFloat() - 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool EnchantmentTableTile::isSolidRender(bool isServerLevel)
|
||||
{
|
||||
return false;
|
||||
bool EnchantmentTableTile::isSolidRender(bool isServerLevel) { return false; }
|
||||
|
||||
Icon* EnchantmentTableTile::getTexture(int face, int data) {
|
||||
if (face == Facing::DOWN) return iconBottom;
|
||||
if (face == Facing::UP) return iconTop;
|
||||
return icon;
|
||||
}
|
||||
|
||||
Icon *EnchantmentTableTile::getTexture(int face, int data)
|
||||
{
|
||||
if (face == Facing::DOWN) return iconBottom;
|
||||
if (face == Facing::UP) return iconTop;
|
||||
return icon;
|
||||
std::shared_ptr<TileEntity> EnchantmentTableTile::newTileEntity(Level* level) {
|
||||
return std::shared_ptr<TileEntity>(new EnchantmentTableEntity());
|
||||
}
|
||||
|
||||
std::shared_ptr<TileEntity> EnchantmentTableTile::newTileEntity(Level *level)
|
||||
bool EnchantmentTableTile::use(
|
||||
Level* level, int x, int y, int z, std::shared_ptr<Player> player,
|
||||
int clickedFace, float clickX, float clickY, float clickZ,
|
||||
bool soundOnly /*=false*/) // 4J added soundOnly param
|
||||
{
|
||||
return std::shared_ptr<TileEntity>(new EnchantmentTableEntity());
|
||||
}
|
||||
if (soundOnly) return false;
|
||||
|
||||
bool EnchantmentTableTile::use(Level *level, int x, int y, int z, std::shared_ptr<Player> player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param
|
||||
{
|
||||
if(soundOnly) return false;
|
||||
|
||||
if (level->isClientSide)
|
||||
{
|
||||
if (level->isClientSide) {
|
||||
return true;
|
||||
}
|
||||
player->startEnchanting(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
void EnchantmentTableTile::registerIcons(IconRegister *iconRegister)
|
||||
{
|
||||
icon = iconRegister->registerIcon(TEXTURE_SIDE);
|
||||
iconTop = iconRegister->registerIcon(TEXTURE_TOP);
|
||||
iconBottom = iconRegister->registerIcon(TEXTURE_BOTTOM);
|
||||
void EnchantmentTableTile::registerIcons(IconRegister* iconRegister) {
|
||||
icon = iconRegister->registerIcon(TEXTURE_SIDE);
|
||||
iconTop = iconRegister->registerIcon(TEXTURE_TOP);
|
||||
iconBottom = iconRegister->registerIcon(TEXTURE_BOTTOM);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user