Optimize getRealShipSize()
This commit is contained in:
parent
8c8a185a02
commit
5b66c1d84c
1 changed files with 7 additions and 8 deletions
|
@ -447,16 +447,14 @@ public class EntityJump extends Entity {
|
||||||
public int getRealShipSize() {
|
public int getRealShipSize() {
|
||||||
int shipSize = 0;
|
int shipSize = 0;
|
||||||
|
|
||||||
|
|
||||||
for (int y = minY; y <= maxY; y++) {
|
|
||||||
for (int x = minX; x <= maxX; x++) {
|
for (int x = minX; x <= maxX; x++) {
|
||||||
for (int z = minZ; z <= maxZ; z++) {
|
for (int z = minZ; z <= maxZ; z++) {
|
||||||
|
for (int y = minY; y <= maxY; y++) {
|
||||||
int blockID = worldObj.getBlockId(x, y, z);
|
int blockID = worldObj.getBlockId(x, y, z);
|
||||||
|
|
||||||
// Пропускаем пустые блоки воздуха
|
// Пропускаем пустые блоки воздуха
|
||||||
if (blockID != 0) {
|
if (blockID != 0) {
|
||||||
shipSize++;
|
shipSize++;
|
||||||
}
|
|
||||||
|
|
||||||
if (blockID == Block.bedrock.blockID) {
|
if (blockID == Block.bedrock.blockID) {
|
||||||
bedrockOnShip = true;
|
bedrockOnShip = true;
|
||||||
|
@ -465,6 +463,7 @@ public class EntityJump extends Entity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return shipSize;
|
return shipSize;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue