use of party.lemons.biomemakeover.util.DirectionalDataHandler in project Biome-Makeover by Lemonszz.
the class SimpleStructurePieceMixin method generate.
@Inject(method = "generate", at = @At(value = "INVOKE", ordinal = 0, target = "Lnet/minecraft/structure/Structure;getInfosForBlock(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Lnet/minecraft/block/Block;)Ljava/util/List;"))
public void generate(StructureWorldAccess world, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox box, ChunkPos chunkPos, BlockPos blockPos, CallbackInfoReturnable<Boolean> cbi) {
if (this instanceof DirectionalDataHandler) {
List<Structure.StructureBlockInfo> list = this.structure.getInfosForBlock(this.pos, this.placementData, BMBlocks.DIRECTIONAL_DATA);
for (Structure.StructureBlockInfo info : list) {
if (info.tag != null) {
String meta = info.tag.getString("metadata");
Direction dir = info.state.get(FacingBlock.FACING);
world.setBlockState(info.pos, Blocks.AIR.getDefaultState(), 3);
((DirectionalDataHandler) this).handleDirectionalMetadata(meta, dir, info.pos, world, random, box);
}
}
}
}
Aggregations