Assorted whitespace fixes

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2017-08-06 09:08:05 +10:00
parent da073e8e66
commit e3d4acc303
50 changed files with 96 additions and 107 deletions

View File

@@ -20,7 +20,7 @@ public class Cauldron extends MaterialData {
* @deprecated Magic value
*/
@Deprecated
public Cauldron(int type, byte data){
public Cauldron(int type, byte data) {
super(type, data);
}

View File

@@ -41,7 +41,7 @@ public class Comparator extends MaterialData implements Directional, Redstone {
* @see BlockFace
*/
public Comparator(BlockFace facingDirection, boolean isSubtraction) {
this(facingDirection, isSubtraction, DEFAULT_STATE);
this(facingDirection, isSubtraction, DEFAULT_STATE);
}
/**
@@ -98,7 +98,7 @@ public class Comparator extends MaterialData implements Directional, Redstone {
* @param isSubtraction True if the comparator is in subtraction mode, false for normal comparator operation
*/
public void setSubtractionMode(boolean isSubtraction) {
setData((byte)(getData() & 0xB | (isSubtraction ? 0x4 : 0x0)));
setData((byte) (getData() & 0xB | (isSubtraction ? 0x4 : 0x0)));
}
/**
@@ -139,7 +139,7 @@ public class Comparator extends MaterialData implements Directional, Redstone {
data |= 0x0;
}
setData((byte)data);
setData((byte) data);
}
/**

View File

@@ -96,12 +96,12 @@ public class Crops extends MaterialData {
case CARROT:
case POTATO:
// Mask the data just in case top bit set
return CropState.getByData((byte)(getData() & 0x7));
return CropState.getByData((byte) (getData() & 0x7));
case BEETROOT_BLOCK:
case NETHER_WARTS:
// Mask the data just in case top bits are set
// Will return SEEDED, SMALL, TALL, RIPE for the three growth data values
return CropState.getByData((byte)(((getData() & 0x3)*7+2)/3)) ;
return CropState.getByData((byte) (((getData() & 0x3) * 7 + 2) / 3));
default:
throw new IllegalArgumentException("Block type is not a crop");
}
@@ -127,12 +127,12 @@ public class Crops extends MaterialData {
case CARROT:
case POTATO:
// Preserve the top bit in case it is set
setData((byte)((getData() & 0x8)|state.getData()));
setData((byte) ((getData() & 0x8) | state.getData()));
break;
case NETHER_WARTS:
case BEETROOT_BLOCK:
// Preserve the top bits in case they are set
setData((byte)((getData() & 0xC)|(state.getData() >> 1)));
setData((byte) ((getData() & 0xC) | (state.getData() >> 1)));
break;
default:
throw new IllegalArgumentException("Block type is not a crop");

View File

@@ -18,7 +18,7 @@ public class Gate extends MaterialData implements Directional, Openable {
super(Material.FENCE_GATE);
}
public Gate(int type, byte data){
public Gate(int type, byte data) {
super(type, data);
}
@@ -27,7 +27,7 @@ public class Gate extends MaterialData implements Directional, Openable {
}
public void setFacingDirection(BlockFace face) {
byte data = (byte) (getData() &~ DIR_BIT);
byte data = (byte) (getData() & ~DIR_BIT);
switch (face) {
default:
@@ -88,4 +88,4 @@ public class Gate extends MaterialData implements Directional, Openable {
public Gate clone() {
return (Gate) super.clone();
}
}
}

View File

@@ -88,7 +88,7 @@ public class Mushroom extends MaterialData {
* @deprecated Magic value
*/
@Deprecated
public Mushroom(int type, byte data){
public Mushroom(int type, byte data) {
super(type, data);
Validate.isTrue(type == Material.HUGE_MUSHROOM_1.getId() || type == Material.HUGE_MUSHROOM_2.getId(), "Not a mushroom!");
}
@@ -237,8 +237,7 @@ public class Mushroom extends MaterialData {
case DOWN:
if (painted) {
data = MushroomBlockTexture.ALL_CAP.getData();
}
else {
} else {
data = MushroomBlockTexture.ALL_PORES.getData();
}
break;

View File

@@ -26,7 +26,7 @@ public class NetherWarts extends MaterialData {
}
public NetherWarts(final Material type) {
super (type);
super(type);
}
/**

View File

@@ -21,7 +21,7 @@ public class SpawnEgg extends MaterialData {
* @deprecated Magic value
*/
@Deprecated
public SpawnEgg(int type, byte data){
public SpawnEgg(int type, byte data) {
super(type, data);
}

View File

@@ -130,7 +130,7 @@ public class Stairs extends MaterialData implements Directional {
@Override
public String toString() {
return super.toString() + " facing " + getFacing() + (isInverted()?" inverted":"");
return super.toString() + " facing " + getFacing() + (isInverted() ? " inverted" : "");
}
@Override

View File

@@ -116,6 +116,6 @@ public class Step extends TexturedMaterial {
@Override
public String toString() {
return super.toString() + (isInverted()?"inverted":"");
return super.toString() + (isInverted() ? "inverted" : "");
}
}

View File

@@ -6,7 +6,7 @@ import org.bukkit.Material;
* Represents the tripwire
*/
public class Tripwire extends MaterialData {
public Tripwire() {
super(Material.TRIPWIRE);
}
@@ -38,7 +38,7 @@ public class Tripwire extends MaterialData {
public boolean isActivated() {
return (getData() & 0x4) != 0;
}
/**
* Set tripwire activated state
*
@@ -50,8 +50,8 @@ public class Tripwire extends MaterialData {
dat |= 0x4;
}
setData((byte) dat);
}
}
/**
* Test if object triggering this tripwire directly
*
@@ -81,6 +81,6 @@ public class Tripwire extends MaterialData {
@Override
public String toString() {
return super.toString() + (isActivated()?" Activated":"") + (isObjectTriggering()?" Triggered":"");
return super.toString() + (isActivated() ? " Activated" : "") + (isObjectTriggering() ? " Triggered" : "");
}
}

View File

@@ -124,6 +124,6 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto
@Override
public String toString() {
return super.toString() + " facing " + getFacing() + (isActivated()?" Activated":"") + (isConnected()?" Connected":"");
return super.toString() + " facing " + getFacing() + (isActivated() ? " Activated" : "") + (isConnected() ? " Connected" : "");
}
}

View File

@@ -26,7 +26,7 @@ public class Vine extends MaterialData {
* @deprecated Magic value
*/
@Deprecated
public Vine(int type, byte data){
public Vine(int type, byte data) {
super(type, data);
}
@@ -107,7 +107,7 @@ public class Vine extends MaterialData {
* @param face The face to attach.
*/
public void putOnFace(BlockFace face) {
switch(face) {
switch (face) {
case WEST:
setData((byte) (getData() | VINE_WEST));
break;
@@ -149,7 +149,7 @@ public class Vine extends MaterialData {
* @param face The face to detach.
*/
public void removeFromFace(BlockFace face) {
switch(face) {
switch (face) {
case WEST:
setData((byte) (getData() & ~VINE_WEST));
break;