use of dev.rosewood.rosestacker.nms.v1_18_R1.spawner.StackedSpawnerTileImpl in project RoseStacker by Rosewood-Development.
the class NMSHandlerImpl method injectStackedSpawnerTile.
@Override
public StackedSpawnerTile injectStackedSpawnerTile(Object stackedSpawnerObj) {
StackedSpawner stackedSpawner = (StackedSpawner) stackedSpawnerObj;
Block block = stackedSpawner.getBlock();
ServerLevel level = ((CraftWorld) block.getWorld()).getHandle();
BlockEntity blockEntity = level.getBlockEntity(new BlockPos(block.getX(), block.getY(), block.getZ()));
if (blockEntity instanceof SpawnerBlockEntity) {
SpawnerBlockEntity spawnerBlockEntity = (SpawnerBlockEntity) blockEntity;
if (!(spawnerBlockEntity.getSpawner() instanceof StackedSpawnerTileImpl)) {
StackedSpawnerTile stackedSpawnerTile = new StackedSpawnerTileImpl(spawnerBlockEntity.getSpawner(), spawnerBlockEntity, stackedSpawner);
unsafe.putObject(spawnerBlockEntity, field_SpawnerBlockEntity_spawner_offset, stackedSpawnerTile);
return stackedSpawnerTile;
} else {
StackedSpawnerTileImpl spawnerTile = (StackedSpawnerTileImpl) spawnerBlockEntity.getSpawner();
spawnerTile.updateStackedSpawner(stackedSpawner);
return spawnerTile;
}
}
return null;
}
use of dev.rosewood.rosestacker.nms.v1_18_R1.spawner.StackedSpawnerTileImpl in project RoseStacker by Rosewood-Development.
the class NMSHandlerImpl method injectStackedSpawnerTile.
@Override
public StackedSpawnerTile injectStackedSpawnerTile(Object stackedSpawnerObj) {
StackedSpawner stackedSpawner = (StackedSpawner) stackedSpawnerObj;
Block block = stackedSpawner.getBlock();
WorldServer level = ((CraftWorld) block.getWorld()).getHandle();
TileEntity blockEntity = level.getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));
if (blockEntity instanceof TileEntityMobSpawner) {
TileEntityMobSpawner spawnerBlockEntity = (TileEntityMobSpawner) blockEntity;
if (!(spawnerBlockEntity.getSpawner() instanceof StackedSpawnerTileImpl)) {
StackedSpawnerTile stackedSpawnerTile = new StackedSpawnerTileImpl(spawnerBlockEntity.getSpawner(), spawnerBlockEntity, stackedSpawner);
unsafe.putObject(spawnerBlockEntity, field_SpawnerBlockEntity_spawner_offset, stackedSpawnerTile);
return stackedSpawnerTile;
} else {
StackedSpawnerTileImpl spawnerTile = (StackedSpawnerTileImpl) spawnerBlockEntity.getSpawner();
spawnerTile.updateStackedSpawner(stackedSpawner);
return spawnerTile;
}
}
return null;
}
use of dev.rosewood.rosestacker.nms.v1_18_R1.spawner.StackedSpawnerTileImpl in project RoseStacker by Rosewood-Development.
the class NMSHandlerImpl method injectStackedSpawnerTile.
@Override
public StackedSpawnerTile injectStackedSpawnerTile(Object stackedSpawnerObj) {
StackedSpawner stackedSpawner = (StackedSpawner) stackedSpawnerObj;
Block block = stackedSpawner.getBlock();
ServerLevel level = ((CraftWorld) block.getWorld()).getHandle();
BlockEntity blockEntity = level.getBlockEntity(new BlockPos(block.getX(), block.getY(), block.getZ()));
if (blockEntity instanceof SpawnerBlockEntity) {
SpawnerBlockEntity spawnerBlockEntity = (SpawnerBlockEntity) blockEntity;
if (!(spawnerBlockEntity.getSpawner() instanceof StackedSpawnerTileImpl)) {
StackedSpawnerTile stackedSpawnerTile = new StackedSpawnerTileImpl(spawnerBlockEntity.getSpawner(), spawnerBlockEntity, stackedSpawner);
unsafe.putObject(spawnerBlockEntity, field_SpawnerBlockEntity_spawner_offset, stackedSpawnerTile);
return stackedSpawnerTile;
} else {
StackedSpawnerTileImpl spawnerTile = (StackedSpawnerTileImpl) spawnerBlockEntity.getSpawner();
spawnerTile.updateStackedSpawner(stackedSpawner);
return spawnerTile;
}
}
return null;
}
use of dev.rosewood.rosestacker.nms.v1_18_R1.spawner.StackedSpawnerTileImpl in project RoseStacker by Rosewood-Development.
the class NMSHandlerImpl method injectStackedSpawnerTile.
@Override
public StackedSpawnerTile injectStackedSpawnerTile(Object stackedSpawnerObj) {
StackedSpawner stackedSpawner = (StackedSpawner) stackedSpawnerObj;
Block block = stackedSpawner.getBlock();
ServerLevel level = ((CraftWorld) block.getWorld()).getHandle();
BlockEntity blockEntity = level.getBlockEntity(new BlockPos(block.getX(), block.getY(), block.getZ()));
if (blockEntity instanceof SpawnerBlockEntity) {
SpawnerBlockEntity spawnerBlockEntity = (SpawnerBlockEntity) blockEntity;
if (!(spawnerBlockEntity.getSpawner() instanceof StackedSpawnerTileImpl)) {
StackedSpawnerTile stackedSpawnerTile = new StackedSpawnerTileImpl(spawnerBlockEntity.getSpawner(), spawnerBlockEntity, stackedSpawner);
unsafe.putObject(spawnerBlockEntity, field_SpawnerBlockEntity_spawner_offset, stackedSpawnerTile);
return stackedSpawnerTile;
} else {
StackedSpawnerTileImpl spawnerTile = (StackedSpawnerTileImpl) spawnerBlockEntity.getSpawner();
spawnerTile.updateStackedSpawner(stackedSpawner);
return spawnerTile;
}
}
return null;
}
use of dev.rosewood.rosestacker.nms.v1_18_R1.spawner.StackedSpawnerTileImpl in project RoseStacker by Rosewood-Development.
the class NMSHandlerImpl method injectStackedSpawnerTile.
@Override
public StackedSpawnerTile injectStackedSpawnerTile(Object stackedSpawnerObj) {
StackedSpawner stackedSpawner = (StackedSpawner) stackedSpawnerObj;
Block block = stackedSpawner.getBlock();
WorldServer level = ((CraftWorld) block.getWorld()).getHandle();
TileEntity blockEntity = level.getTileEntity(new BlockPosition(block.getX(), block.getY(), block.getZ()));
if (blockEntity instanceof TileEntityMobSpawner) {
TileEntityMobSpawner spawnerBlockEntity = (TileEntityMobSpawner) blockEntity;
if (!(spawnerBlockEntity.getSpawner() instanceof StackedSpawnerTileImpl)) {
StackedSpawnerTile stackedSpawnerTile = new StackedSpawnerTileImpl(spawnerBlockEntity.getSpawner(), spawnerBlockEntity, stackedSpawner);
unsafe.putObject(spawnerBlockEntity, field_SpawnerBlockEntity_spawner_offset, stackedSpawnerTile);
return stackedSpawnerTile;
} else {
StackedSpawnerTileImpl spawnerTile = (StackedSpawnerTileImpl) spawnerBlockEntity.getSpawner();
spawnerTile.updateStackedSpawner(stackedSpawner);
return spawnerTile;
}
}
return null;
}
Aggregations