Shorten my recent commit, modified checkBlock method slightly to not pass full BlockData; rather just the Material that is used in the method
This commit is contained in:
parent
a594219429
commit
9f7083441f
|
@ -159,7 +159,7 @@ public class CalcIslandLevel {
|
|||
if (Tag.SLABS.isTagged(blockData.getMaterial())) {
|
||||
Slab slab = (Slab)blockData;
|
||||
if (slab.getType().equals(Slab.Type.DOUBLE)) {
|
||||
checkBlock(blockData, belowSeaLevel);
|
||||
checkBlock(blockData.getMaterial(), belowSeaLevel);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,18 +170,19 @@ public class CalcIslandLevel {
|
|||
StackedBarrel barrel = WildStackerAPI.getStackedBarrel(cauldronBlock);
|
||||
int barrelAmt = WildStackerAPI.getBarrelAmount(cauldronBlock);
|
||||
for (int _x = 0; _x < barrelAmt; _x++) {
|
||||
checkStackedBlock(barrel.getType(), belowSeaLevel);
|
||||
checkBlock(barrel.getType(), belowSeaLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkBlock(blockData, belowSeaLevel);
|
||||
checkBlock(blockData.getMaterial(), belowSeaLevel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void checkStackedBlock(Material mat, boolean belowSeaLevel) {
|
||||
// Didnt see a reason to pass BlockData when all that's used was the material
|
||||
private void checkBlock(Material mat, boolean belowSeaLevel) {
|
||||
int count = limitCount(mat);
|
||||
if (belowSeaLevel) {
|
||||
result.underWaterBlockCount.addAndGet(count);
|
||||
|
@ -192,17 +193,6 @@ public class CalcIslandLevel {
|
|||
}
|
||||
}
|
||||
|
||||
private void checkBlock(BlockData bd, boolean belowSeaLevel) {
|
||||
int count = limitCount(bd.getMaterial());
|
||||
if (belowSeaLevel) {
|
||||
result.underWaterBlockCount.addAndGet(count);
|
||||
result.uwCount.add(bd.getMaterial());
|
||||
} else {
|
||||
result.rawBlockCount.addAndGet(count);
|
||||
result.mdCount.add(bd.getMaterial());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a block has been limited or not and whether a block has any value or not
|
||||
* @param md Material
|
||||
|
|
Loading…
Reference in New Issue