mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-08-20 09:57:09 +00:00
fixed crashing when destroying a door
This commit is contained in:
parent
ce0686afae
commit
a83579edca
|
|
@ -8,10 +8,14 @@
|
||||||
#include "net.minecraft.world.h"
|
#include "net.minecraft.world.h"
|
||||||
#include "net.minecraft.h"
|
#include "net.minecraft.h"
|
||||||
|
|
||||||
static std::map<wstring, Item*> doorItemMap = {
|
static std::map<wstring, int> doorItemMap = {
|
||||||
{ L"doorWood", Item::door_wood },
|
{ L"doorWood", Item::door_wood_Id },
|
||||||
{ L"doorIron", Item::door_iron },
|
{ L"doorIron", Item::door_iron_Id },
|
||||||
{ L"doorSpruce", Item::door_spruce }
|
{ L"doorSpruce", Item::door_spruce_Id },
|
||||||
|
{ L"doorBirch", Item::door_birch_Id },
|
||||||
|
{ L"doorJungle", Item::door_jungle_Id },
|
||||||
|
{ L"doorAcacia", Item::door_acacia_Id },
|
||||||
|
{ L"doorDark", Item::door_dark_Id }
|
||||||
};
|
};
|
||||||
|
|
||||||
DoorTile::DoorTile(int id, Material *material, const wstring& doorType) : Tile(id, material,isSolidRender())
|
DoorTile::DoorTile(int id, Material *material, const wstring& doorType) : Tile(id, material,isSolidRender())
|
||||||
|
|
@ -285,7 +289,7 @@ void DoorTile::neighborChanged(Level *level, int x, int y, int z, int type)
|
||||||
int DoorTile::getResource(int data, Random *random, int playerBonusLevel)
|
int DoorTile::getResource(int data, Random *random, int playerBonusLevel)
|
||||||
{
|
{
|
||||||
if ((data & 8) != 0) return 0;
|
if ((data & 8) != 0) return 0;
|
||||||
return doorItemMap[doorType]->id;
|
return doorItemMap[doorType];
|
||||||
}
|
}
|
||||||
|
|
||||||
HitResult *DoorTile::clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b)
|
HitResult *DoorTile::clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue