Files
BluTac10-Xbox_Neo/Minecraft.World/StoneTile.cpp
piebot 61e4d2cd36 Fixed Stone not dropping Cobblestone
also fixed obsidian having stone texture and name
2026-03-14 20:50:53 +03:00

67 lines
1.4 KiB
C++

#include "stdafx.h"
#include "StoneTile.h"
#include "net.minecraft.world.h"
#include "net.minecraft.h"
const unsigned int StoneTile::STONE_NAMES[STONE_NAMES_LENGTH] = { IDS_TILE_STONE,
IDS_TILE_STONE,
IDS_TILE_STONE,
IDS_TILE_STONE,
IDS_TILE_STONE,
IDS_TILE_STONE,
IDS_TILE_STONE };
const wstring StoneTile::TEXTURE_NAMES[] = { L"stone",
L"stone_granite", L"stone_granite_smooth",
L"stone_diorite", L"stone_diorite_smooth",
L"stone_andesite", L"stone_andesite_smooth"};
StoneTile::StoneTile(int id) : Tile(id, Material::stone)
{
icons = nullptr;
}
unsigned int StoneTile::getDescriptionId(int iData)
{
if (iData < 0 || iData >= STONE_NAMES_LENGTH) iData = 0;
return STONE_NAMES[iData];
}
int StoneTile::getResource(int data, Random* random, int playerBonusLevel)
{
if (data < 0 || data >= STONE_NAMES_LENGTH) data = 0;
if (data == 0) {
return Tile::cobblestone_Id;
}
return Tile::stone_Id;
}
int StoneTile::getSpawnResourcesAuxValue(int data)
{
if (data < 0 || data >= STONE_NAMES_LENGTH) data = 0;
return data;
}
Icon* StoneTile::getTexture(int face, int data)
{
if (data < 0 || data >= STONE_NAMES_LENGTH)
{
data = 0;
}
return icons[data];
}
void StoneTile::registerIcons(IconRegister* iconRegister)
{
icons = new Icon * [STONE_NAMES_LENGTH];
for (int i = 0; i < STONE_NAMES_LENGTH; i++)
{
icons[i] = iconRegister->registerIcon(TEXTURE_NAMES[i]);
}
}