Code style fix, interface rename, custom item getter

This commit is contained in:
paulevsGitch 2021-07-20 00:10:00 +03:00
parent 179ada3296
commit c6afa74529
134 changed files with 3404 additions and 1244 deletions

View file

@ -18,7 +18,11 @@ public class DestructionStructureProcessor extends StructureProcessor {
@Override
public StructureBlockInfo processBlock(LevelReader worldView, BlockPos pos, BlockPos blockPos, StructureBlockInfo structureBlockInfo, StructureBlockInfo structureBlockInfo2, StructurePlaceSettings structurePlacementData) {
if (!BlocksHelper.isInvulnerable(structureBlockInfo2.state, worldView, structureBlockInfo2.pos) && MHelper.RANDOM.nextInt(chance) == 0) {
if (!BlocksHelper.isInvulnerable(
structureBlockInfo2.state,
worldView,
structureBlockInfo2.pos
) && MHelper.RANDOM.nextInt(chance) == 0) {
return null;
}
return structureBlockInfo2;

View file

@ -14,7 +14,10 @@ public class TerrainStructureProcessor extends StructureProcessor {
public StructureBlockInfo processBlock(LevelReader worldView, BlockPos pos, BlockPos blockPos, StructureBlockInfo structureBlockInfo, StructureBlockInfo structureBlockInfo2, StructurePlaceSettings structurePlacementData) {
BlockPos bpos = structureBlockInfo2.pos;
if (structureBlockInfo2.state.is(Blocks.END_STONE) && worldView.isEmptyBlock(bpos.above())) {
BlockState top = worldView.getBiome(structureBlockInfo2.pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
BlockState top = worldView.getBiome(structureBlockInfo2.pos)
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
return new StructureBlockInfo(bpos, top, structureBlockInfo2.nbt);
}
return structureBlockInfo2;