use of team.cqr.cqrepoured.world.structure.generation.generation.generatable.GeneratableBlockInfo in project ChocolateQuestRepoured by TeamChocoQuest.
the class PreparableBossInfo method prepareDebug.
@Override
protected GeneratablePosInfo prepareDebug(World world, DungeonPlacement placement, BlockPos pos) {
TileEntityBoss tileEntity = new TileEntityBoss();
if (this.bossTag != null) {
ItemStack stack = new ItemStack(CQRItems.SOUL_BOTTLE);
CompoundNBT tag = new CompoundNBT();
tag.setTag(ItemSoulBottle.ENTITY_IN_TAG, this.bossTag);
stack.setTagCompound(tag);
tileEntity.inventory.setStackInSlot(0, stack);
}
return new GeneratableBlockInfo(pos, CQRBlocks.BOSS_BLOCK.getDefaultState(), tileEntity);
}
use of team.cqr.cqrepoured.world.structure.generation.generation.generatable.GeneratableBlockInfo in project ChocolateQuestRepoured by TeamChocoQuest.
the class PreparableLootChestInfo method prepare.
@Override
protected GeneratablePosInfo prepare(World world, DungeonPlacement placement, BlockPos pos) {
BlockState state = Blocks.CHEST.getDefaultState().withProperty(ChestBlock.FACING, this.facing);
state = state.withMirror(placement.getMirror()).withRotation(placement.getRotation());
TileEntity tileEntity = state.getBlock().createTileEntity(world, state);
if (tileEntity instanceof ChestTileEntity) {
long seed = WorldDungeonGenerator.getSeed(world, pos.getX(), pos.getZ());
((ChestTileEntity) tileEntity).setLootTable(this.lootTable, seed);
}
return new GeneratableBlockInfo(pos, state, tileEntity);
}
use of team.cqr.cqrepoured.world.structure.generation.generation.generatable.GeneratableBlockInfo in project ChocolateQuestRepoured by TeamChocoQuest.
the class PreparableSpawnerInfo method prepare.
@Override
protected GeneratablePosInfo prepare(World world, DungeonPlacement placement, BlockPos pos) {
BlockState state;
TileEntity tileEntity;
BlockPos p = pos.toImmutable();
if (this.tileEntityData.getBoolean("vanillaSpawner")) {
state = Blocks.MOB_SPAWNER.getDefaultState();
tileEntity = state.getBlock().createTileEntity(world, state);
if (tileEntity instanceof MobSpawnerTileEntity) {
this.vanillaSpawnerReadFromNBT(world, placement, p, (MobSpawnerTileEntity) tileEntity);
}
} else {
state = CQRBlocks.SPAWNER.getDefaultState();
tileEntity = state.getBlock().createTileEntity(world, state);
if (tileEntity instanceof TileEntitySpawner) {
this.cqrSpawnerReadFromNBT(world, placement, p, (TileEntitySpawner) tileEntity);
}
}
return new GeneratableBlockInfo(p, state, tileEntity);
}
use of team.cqr.cqrepoured.world.structure.generation.generation.generatable.GeneratableBlockInfo in project ChocolateQuestRepoured by TeamChocoQuest.
the class PreparableSpawnerInfo method prepareDebug.
@Override
protected GeneratablePosInfo prepareDebug(World world, DungeonPlacement placement, BlockPos pos) {
BlockState transformedState = CQRBlocks.SPAWNER.getDefaultState().withMirror(placement.getMirror()).withRotation(placement.getRotation());
TileEntity tileEntity = null;
if (this.tileEntityData != null) {
tileEntity = transformedState.getBlock().createTileEntity(world, transformedState);
if (tileEntity != null) {
this.tileEntityData.setInteger("x", pos.getX());
this.tileEntityData.setInteger("y", pos.getY());
this.tileEntityData.setInteger("z", pos.getZ());
tileEntity.readFromNBT(this.tileEntityData);
tileEntity.mirror(placement.getMirror());
tileEntity.rotate(placement.getRotation());
this.tileEntityData.removeTag("x");
this.tileEntityData.removeTag("y");
this.tileEntityData.removeTag("z");
}
}
return new GeneratableBlockInfo(pos, transformedState, tileEntity);
}
use of team.cqr.cqrepoured.world.structure.generation.generation.generatable.GeneratableBlockInfo in project ChocolateQuestRepoured by TeamChocoQuest.
the class PreparableLootChestInfo method prepareDebug.
@Override
protected GeneratablePosInfo prepareDebug(World world, DungeonPlacement placement, BlockPos pos) {
BlockExporterChest block = BlockExporterChest.getExporterChests().stream().filter(BlockExporterChestCQR.class::isInstance).filter(b -> ((BlockExporterChestCQR) b).getLootTable().equals(this.lootTable)).findFirst().orElse(CQRBlocks.EXPORTER_CHEST_CUSTOM);
BlockState state = block.getDefaultState().withProperty(HorizontalBlock.FACING, this.facing);
state = state.withMirror(placement.getMirror()).withRotation(placement.getRotation());
if (block != CQRBlocks.EXPORTER_CHEST_CUSTOM) {
return new GeneratableBlockInfo(pos, state, null);
}
TileEntityExporterChestCustom tileEntity = new TileEntityExporterChestCustom();
tileEntity.setLootTable(this.lootTable);
return new GeneratableBlockInfo(pos, state, tileEntity);
}
Aggregations