Added Dirt and Stone Variants
Added podzol, coarse dirt, granite, polished granite, andesite, polished andesite, diorite, polished diorite.
This commit is contained in:
@@ -1,6 +1,58 @@
|
||||
#include "stdafx.h"
|
||||
#include "DirtTile.h"
|
||||
#include "net.minecraft.world.h"
|
||||
#include "net.minecraft.h"
|
||||
|
||||
const unsigned int DirtTile::DIRT_NAMES[DIRT_NAMES_LENGTH] = { IDS_TILE_DIRT,
|
||||
IDS_TILE_DIRT,
|
||||
IDS_TILE_DIRT
|
||||
};
|
||||
|
||||
const wstring DirtTile::TEXTURE_NAMES[] = { L"dirt", L"coarse_dirt", L"dirt_podzol"};
|
||||
|
||||
DirtTile::DirtTile(int id) : Tile(id, Material::dirt)
|
||||
{
|
||||
icons = nullptr;
|
||||
podzolTop = nullptr;
|
||||
podzolSide = nullptr;
|
||||
}
|
||||
|
||||
unsigned int DirtTile::getDescriptionId(int iData)
|
||||
{
|
||||
if (iData < 0 || iData >= DIRT_NAMES_LENGTH) iData = 0;
|
||||
|
||||
return DIRT_NAMES[iData];
|
||||
}
|
||||
|
||||
int DirtTile::getSpawnResourcesAuxValue(int data)
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
Icon* DirtTile::getTexture(int face, int data)
|
||||
{
|
||||
if (data < 0 || data >= DIRT_NAMES_LENGTH)
|
||||
data = 0;
|
||||
|
||||
if (TEXTURE_NAMES[data] == L"dirt_podzol") {
|
||||
return (face == Facing::UP) ? podzolTop : podzolSide;
|
||||
}
|
||||
|
||||
return icons[data];
|
||||
}
|
||||
|
||||
void DirtTile::registerIcons(IconRegister* iconRegister)
|
||||
{
|
||||
icons = new Icon * [DIRT_NAMES_LENGTH];
|
||||
|
||||
for (int i = 0; i < DIRT_NAMES_LENGTH; i++)
|
||||
{
|
||||
if (TEXTURE_NAMES[i] == L"dirt_podzol") {
|
||||
icons[i] = nullptr;
|
||||
podzolTop = iconRegister->registerIcon(L"dirt_podzol_top");
|
||||
podzolSide = iconRegister->registerIcon(L"dirt_podzol_side");
|
||||
} else {
|
||||
icons[i] = iconRegister->registerIcon(TEXTURE_NAMES[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user