Generify BlockMap

(cherry picked from commit 7384b6973498084f4082d7e1a805b84b13a3ba44)
This commit is contained in:
Octavia Togami
2020-01-30 01:05:31 -08:00
committed by MattBDev
parent d5828861de
commit 38d5506e18
7 changed files with 86 additions and 71 deletions

View File

@ -43,7 +43,7 @@ import java.util.Optional;
*/
public class ChunkBatchingExtent extends AbstractBufferingExtent {
private final BlockMap blockMap = BlockMap.create();
private final BlockMap<BaseBlock> blockMap = BlockMap.createForBaseBlock();
private boolean enabled;
public ChunkBatchingExtent(Extent extent) {

View File

@ -142,7 +142,7 @@ public class MultiStageReorder extends AbstractBufferingExtent implements Reorde
priorityMap.put(BlockTypes.MOVING_PISTON, PlacementPriority.FINAL);
}
private Map<PlacementPriority, BlockMap> stages = new HashMap<>();
private Map<PlacementPriority, BlockMap<BaseBlock>> stages = new HashMap<>();
private boolean enabled;
@ -176,7 +176,7 @@ public class MultiStageReorder extends AbstractBufferingExtent implements Reorde
this.enabled = enabled;
for (PlacementPriority priority : PlacementPriority.values()) {
stages.put(priority, BlockMap.create());
stages.put(priority, BlockMap.createForBaseBlock());
}
}
@ -261,7 +261,7 @@ public class MultiStageReorder extends AbstractBufferingExtent implements Reorde
}
List<Operation> operations = new ArrayList<>();
for (PlacementPriority priority : PlacementPriority.values()) {
BlockMap blocks = stages.get(priority);
BlockMap<BaseBlock> blocks = stages.get(priority);
operations.add(new SetBlockMap(getExtent(), blocks) {
@Override
public Operation resume(RunContext run) throws WorldEditException {