mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-25 23:07:07 +00:00
TU19: merge Minecraft.World/Blocks
This commit is contained in:
32
Minecraft.World/Blocks/BaseEntityTile.cpp
Normal file
32
Minecraft.World/Blocks/BaseEntityTile.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#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 != NULL) {
|
||||
return te->triggerEvent(b0, b1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user