mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-28 07:41:19 +00:00
TU19: merge Minecraft.World/Items
This commit is contained in:
@@ -1,14 +1,22 @@
|
||||
#include "../../Platform/stdafx.h"
|
||||
#include "../../Blocks/Tile.h"
|
||||
#include "MultiTextureTileItem.h"
|
||||
#include "../../Headers/net.minecraft.world.item.crafting.h"
|
||||
|
||||
MultiTextureTileItem::MultiTextureTileItem(int id, Tile* parentTile,
|
||||
int* nameExtensions, int iLength)
|
||||
int* nameExtensions, int iLength,
|
||||
int anyValueName)
|
||||
: TileItem(id) {
|
||||
this->parentTile = parentTile;
|
||||
this->nameExtensions = nameExtensions;
|
||||
this->m_iNameExtensionsLength = iLength;
|
||||
|
||||
if (anyValueName != -1) {
|
||||
m_anyValueName = anyValueName;
|
||||
} else {
|
||||
m_anyValueName = nameExtensions[0];
|
||||
}
|
||||
|
||||
setMaxDamage(0);
|
||||
setStackedByData(true);
|
||||
}
|
||||
@@ -25,16 +33,15 @@ unsigned int MultiTextureTileItem::getDescriptionId(int iData) {
|
||||
if (iData < 0 || iData >= m_iNameExtensionsLength) {
|
||||
iData = 0;
|
||||
}
|
||||
// return super.getDescriptionId() + "." + nameExtensions[auxValue];
|
||||
return nameExtensions[iData];
|
||||
}
|
||||
|
||||
unsigned int MultiTextureTileItem::getDescriptionId(
|
||||
std::shared_ptr<ItemInstance> instance) {
|
||||
int auxValue = instance->getAuxValue();
|
||||
if (auxValue < 0 || auxValue >= m_iNameExtensionsLength) {
|
||||
auxValue = 0;
|
||||
if (auxValue == Recipes::ANY_AUX_VALUE || auxValue < 0 ||
|
||||
auxValue >= m_iNameExtensionsLength) {
|
||||
return m_anyValueName;
|
||||
}
|
||||
// return super.getDescriptionId() + "." + nameExtensions[auxValue];
|
||||
return nameExtensions[auxValue];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user