mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-24 08:43:59 +00:00
32 lines
1.1 KiB
C++
32 lines
1.1 KiB
C++
#include "../Platform/stdafx.h"
|
|
#include "../Headers/net.minecraft.world.level.h"
|
|
#include "../Headers/net.minecraft.world.entity.h"
|
|
#include "TileEntities/TileEntity.h"
|
|
#include "BaseEntityTile.h"
|
|
|
|
BaseEntityTile::BaseEntityTile(int id, Material* material,
|
|
bool isSolidRender /*= true*/)
|
|
: Tile(id, material, isSolidRender) {
|
|
_isEntityTile = true;
|
|
}
|
|
|
|
void BaseEntityTile::onPlace(Level* level, int x, int y, int z) {
|
|
Tile::onPlace(level, x, y, z);
|
|
// level->setTileEntity(x, y, z, newTileEntity(level));
|
|
}
|
|
|
|
void BaseEntityTile::onRemove(Level* level, int x, int y, int z, int id,
|
|
int data) {
|
|
Tile::onRemove(level, x, y, z, id, data);
|
|
level->removeTileEntity(x, y, z);
|
|
}
|
|
|
|
bool BaseEntityTile::triggerEvent(Level* level, int x, int y, int z, int b0,
|
|
int b1) {
|
|
Tile::triggerEvent(level, x, y, z, b0, b1);
|
|
std::shared_ptr<TileEntity> te = level->getTileEntity(x, y, z);
|
|
if (te != nullptr) {
|
|
return te->triggerEvent(b0, b1);
|
|
}
|
|
return false;
|
|
} |