mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-11-02 10:57:11 +00:00
Fixed some warnings.
This commit is contained in:
parent
2fdc76a3f9
commit
9e708b70a9
@ -34,6 +34,7 @@ public abstract class ArbitraryShape {
|
||||
private int cacheOffsetX;
|
||||
private int cacheOffsetY;
|
||||
private int cacheOffsetZ;
|
||||
@SuppressWarnings("FieldCanBeLocal")
|
||||
private int cacheSizeX;
|
||||
private int cacheSizeY;
|
||||
private int cacheSizeZ;
|
||||
@ -72,9 +73,9 @@ public abstract class ArbitraryShape {
|
||||
/**
|
||||
* Override this function to specify the shape to generate.
|
||||
*
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
* @param x X coordinate to be queried
|
||||
* @param y Y coordinate to be queried
|
||||
* @param z Z coordinate to be queried
|
||||
* @param defaultMaterial The material returned by the pattern for the current block.
|
||||
* @return material to place or null to not place anything.
|
||||
*/
|
||||
@ -136,7 +137,7 @@ public abstract class ArbitraryShape {
|
||||
/**
|
||||
* Generates the shape.
|
||||
*
|
||||
* @param editSession
|
||||
* @param editSession The EditSession to use.
|
||||
* @param pattern The pattern to generate default materials from.
|
||||
* @param hollow Specifies whether to generate a hollow shape.
|
||||
* @return number of affected blocks.
|
||||
@ -164,38 +165,36 @@ public abstract class ArbitraryShape {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hollow) {
|
||||
boolean draw = false;
|
||||
do {
|
||||
if (!isInsideCached(x + 1, y, z, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
if (!isInsideCached(x - 1, y, z, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
if (!isInsideCached(x, y + 1, z, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
if (!isInsideCached(x, y - 1, z, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
if (!isInsideCached(x, y, z + 1, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
if (!isInsideCached(x, y, z - 1, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
|
||||
if (!draw) {
|
||||
continue;
|
||||
boolean draw = false;
|
||||
do {
|
||||
if (!isInsideCached(x + 1, y, z, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
if (!isInsideCached(x - 1, y, z, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
if (!isInsideCached(x, y + 1, z, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
if (!isInsideCached(x, y - 1, z, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
if (!isInsideCached(x, y, z + 1, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
if (!isInsideCached(x, y, z - 1, pattern)) {
|
||||
draw = true;
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
|
||||
if (!draw) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (editSession.setBlock(position, material)) {
|
||||
|
@ -269,7 +269,7 @@ public class GenerationCommands {
|
||||
|
||||
int size = args.argsLength() > 0 ? Math.max(1, args.getInteger(0)) : 10;
|
||||
TreeGenerator.TreeType type = args.argsLength() > 1 ?
|
||||
type = TreeGenerator.lookup(args.getString(1))
|
||||
TreeGenerator.lookup(args.getString(1))
|
||||
: TreeGenerator.TreeType.TREE;
|
||||
double density = args.argsLength() > 2 ? args.getDouble(2) / 100 : 0.05;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user