Bonjour,
Dans mon mod, j’ai besoin que lorsque ma structure dans le village spawn, elle fasse une petite modification à toutes les autres structures. J’ai donc enregistré les autres structures à sa création :
| |
| private final List <structurecomponent>pieces; |
| |
| public StructureStyxStart(StructureVillagePieces.Start start, List <structurecomponent>pieces, int type, Random rand, StructureBoundingBox sbb, EnumFacing facing) { |
| super(start, type); |
| |
| this.setCoordBaseMode(facing); |
| this.boundingBox = sbb; |
| this.pieces = pieces; |
| } |
| |
Et lorsque je la construis, j’appelle une fonction anonyme pour modifier les autres structures (ici rajouter un block d’or dans chaque structure) :
| |
| public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox sbbIn) { |
| |
| this.pieces.forEach(piece -> { |
| final StructureBoundingBox sbb = piece.getBoundingBox(); |
| final BlockPos posMin = new BlockPos(sbb.minX, sbb.minY, sbb.minZ); |
| |
| worldIn.setBlockState(posMin, Blocks.GOLD_BLOCK.getDefaultState()); |
| }); |
| |
Tout fonctionne, mais j’obtiens ce message d’erreur :
[16:26:39] [Server thread/WARN] [FML]: Styx loaded a new chunk (53, 226 Dimension: 0) during chunk population, causing cascading worldgen lag. Please report this to the mod’s issue tracker. This log can be disabled in the Forge config.
[16:26:39] [Server thread/WARN] [FML]: Styx loaded a new chunk (53, 227 Dimension: 0) during chunk population, causing cascading worldgen lag. Please report this to the mod’s issue tracker. This log can be disabled in the Forge config.
[16:26:39] [Server thread/WARN] [FML]: Styx loaded a new chunk (52, 227 Dimension: 0) during chunk population, causing cascading worldgen lag. Please report this to the mod’s issue tracker. This log can be disabled in the Forge config.
[16:26:39] [Server thread/WARN] [FML]: Styx loaded a new chunk (53, 228 Dimension: 0) during chunk population, causing cascading worldgen lag. Please report this to the mod’s issue tracker. This log can be disabled in the Forge config.
Qu’est-ce qui s’est mal passé… ?</structurecomponent></structurecomponent>