Using getters

This commit is contained in:
Frank 2023-05-17 14:50:56 +02:00
parent 2f878800ca
commit 145e6168c3
2 changed files with 5 additions and 5 deletions

View file

@ -27,9 +27,9 @@ public class DestructionStructureProcessor extends StructureProcessor {
StructurePlaceSettings structurePlacementData
) {
if (!BlocksHelper.isInvulnerable(
structureBlockInfo2.state,
structureBlockInfo2.state(),
worldView,
structureBlockInfo2.pos
structureBlockInfo2.pos()
) && MHelper.RANDOM.nextInt(chance) == 0) {
return null;
}

View file

@ -27,11 +27,11 @@ public class TerrainStructureProcessor extends StructureProcessor {
StructureBlockInfo structureBlockInfo2,
StructurePlaceSettings structurePlacementData
) {
BlockPos bpos = structureBlockInfo2.pos;
if (structureBlockInfo2.state.is(defaultBlock) && worldView.isEmptyBlock(bpos.above())) {
BlockPos bpos = structureBlockInfo2.pos();
if (structureBlockInfo2.state().is(defaultBlock) && worldView.isEmptyBlock(bpos.above())) {
final BlockState top = BiomeAPI.findTopMaterial(worldView.getBiome(pos))
.orElse(defaultBlock.defaultBlockState());
return new StructureBlockInfo(bpos, top, structureBlockInfo2.nbt);
return new StructureBlockInfo(bpos, top, structureBlockInfo2.nbt());
}
return structureBlockInfo2;
}