mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 04:05:50 -07:00
Generic cleanup of warnings, whitespace and style.
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
@@ -17,6 +17,7 @@ public class Bed extends MaterialData implements Directional {
|
||||
|
||||
/**
|
||||
* Instantiate a bed facing in a particular direction.
|
||||
*
|
||||
* @param direction the direction the bed's head is facing
|
||||
*/
|
||||
public Bed(BlockFace direction) {
|
||||
@@ -51,6 +52,7 @@ public class Bed extends MaterialData implements Directional {
|
||||
|
||||
/**
|
||||
* Configure this to be either the head or the foot of the bed
|
||||
*
|
||||
* @param isHeadOfBed True to make it the head.
|
||||
*/
|
||||
public void setHeadOfBed(boolean isHeadOfBed) {
|
||||
|
@@ -6,6 +6,7 @@ public interface Directional {
|
||||
|
||||
/**
|
||||
* Sets the direction that this block is facing in
|
||||
*
|
||||
* @param face The facing direction
|
||||
*/
|
||||
public void setFacingDirection(BlockFace face);
|
||||
|
@@ -29,6 +29,7 @@ public class Door extends MaterialData implements Directional {
|
||||
|
||||
/**
|
||||
* Check to see if the door is open.
|
||||
*
|
||||
* @return true if the door has swung counterclockwise around its hinge.
|
||||
*/
|
||||
public boolean isOpen() {
|
||||
@@ -37,6 +38,7 @@ public class Door extends MaterialData implements Directional {
|
||||
|
||||
/**
|
||||
* Configure this door to be either open or closed;
|
||||
*
|
||||
* @param isOpen True to open the door.
|
||||
*/
|
||||
public void setOpen(boolean isOpen) {
|
||||
@@ -52,6 +54,7 @@ public class Door extends MaterialData implements Directional {
|
||||
|
||||
/**
|
||||
* Configure this part of the door to be either the top or the bottom half;
|
||||
*
|
||||
* @param isTopHalf True to make it the top half.
|
||||
*/
|
||||
public void setTopHalf(boolean isTopHalf) {
|
||||
@@ -82,6 +85,7 @@ public class Door extends MaterialData implements Directional {
|
||||
|
||||
/**
|
||||
* Set the direction that this door should is facing.
|
||||
*
|
||||
* @param face the direction
|
||||
*/
|
||||
public void setFacingDirection(BlockFace face) {
|
||||
@@ -104,6 +108,7 @@ public class Door extends MaterialData implements Directional {
|
||||
|
||||
/**
|
||||
* Get the direction that this door is facing.
|
||||
*
|
||||
* @return the direction
|
||||
*/
|
||||
public BlockFace getFacing() {
|
||||
|
@@ -14,6 +14,7 @@ public class Furnace extends FurnaceAndDispenser {
|
||||
|
||||
/**
|
||||
* Instantiate a furnace facing in a particular direction.
|
||||
*
|
||||
* @param direction the direction the furnace's "opening" is facing
|
||||
*/
|
||||
public Furnace(BlockFace direction) {
|
||||
|
@@ -39,6 +39,7 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone {
|
||||
|
||||
/**
|
||||
* Set this lever to be powered or not.
|
||||
*
|
||||
* @param isPowered whether the lever should be powered or not
|
||||
*/
|
||||
public void setPowered(boolean isPowered) {
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
package org.bukkit.material;
|
||||
|
||||
import org.bukkit.Material;
|
||||
@@ -25,46 +24,46 @@ public class PistonBaseMaterial extends MaterialData implements Directional, Red
|
||||
}
|
||||
|
||||
public void setFacingDirection(BlockFace face) {
|
||||
byte data = (byte)(getData() & 0x8);
|
||||
byte data = (byte) (getData() & 0x8);
|
||||
|
||||
switch (face) {
|
||||
case UP:
|
||||
data |= 1;
|
||||
break;
|
||||
case EAST:
|
||||
data |= 2;
|
||||
break;
|
||||
case WEST:
|
||||
data |= 3;
|
||||
break;
|
||||
case NORTH:
|
||||
data |= 4;
|
||||
break;
|
||||
case SOUTH:
|
||||
data |= 5;
|
||||
break;
|
||||
case UP:
|
||||
data |= 1;
|
||||
break;
|
||||
case EAST:
|
||||
data |= 2;
|
||||
break;
|
||||
case WEST:
|
||||
data |= 3;
|
||||
break;
|
||||
case NORTH:
|
||||
data |= 4;
|
||||
break;
|
||||
case SOUTH:
|
||||
data |= 5;
|
||||
break;
|
||||
}
|
||||
setData(data);
|
||||
}
|
||||
|
||||
public BlockFace getFacing() {
|
||||
byte dir = (byte)(getData() & 7);
|
||||
byte dir = (byte) (getData() & 7);
|
||||
|
||||
switch (dir) {
|
||||
case 0:
|
||||
return BlockFace.DOWN;
|
||||
case 1:
|
||||
return BlockFace.UP;
|
||||
case 2:
|
||||
return BlockFace.EAST;
|
||||
case 3:
|
||||
return BlockFace.WEST;
|
||||
case 4:
|
||||
return BlockFace.NORTH;
|
||||
case 5:
|
||||
return BlockFace.SOUTH;
|
||||
default:
|
||||
return BlockFace.SELF;
|
||||
case 0:
|
||||
return BlockFace.DOWN;
|
||||
case 1:
|
||||
return BlockFace.UP;
|
||||
case 2:
|
||||
return BlockFace.EAST;
|
||||
case 3:
|
||||
return BlockFace.WEST;
|
||||
case 4:
|
||||
return BlockFace.NORTH;
|
||||
case 5:
|
||||
return BlockFace.SOUTH;
|
||||
default:
|
||||
return BlockFace.SELF;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
package org.bukkit.material;
|
||||
|
||||
import org.bukkit.Material;
|
||||
@@ -25,46 +24,46 @@ public class PistonExtensionMaterial extends MaterialData implements Attachable
|
||||
}
|
||||
|
||||
public void setFacingDirection(BlockFace face) {
|
||||
byte data = (byte)(getData() & 0x8);
|
||||
byte data = (byte) (getData() & 0x8);
|
||||
|
||||
switch (face) {
|
||||
case UP:
|
||||
data |= 1;
|
||||
break;
|
||||
case EAST:
|
||||
data |= 2;
|
||||
break;
|
||||
case WEST:
|
||||
data |= 3;
|
||||
break;
|
||||
case NORTH:
|
||||
data |= 4;
|
||||
break;
|
||||
case SOUTH:
|
||||
data |= 5;
|
||||
break;
|
||||
case UP:
|
||||
data |= 1;
|
||||
break;
|
||||
case EAST:
|
||||
data |= 2;
|
||||
break;
|
||||
case WEST:
|
||||
data |= 3;
|
||||
break;
|
||||
case NORTH:
|
||||
data |= 4;
|
||||
break;
|
||||
case SOUTH:
|
||||
data |= 5;
|
||||
break;
|
||||
}
|
||||
setData(data);
|
||||
}
|
||||
|
||||
public BlockFace getFacing() {
|
||||
byte dir = (byte)(getData() & 7);
|
||||
byte dir = (byte) (getData() & 7);
|
||||
|
||||
switch (dir) {
|
||||
case 0:
|
||||
return BlockFace.DOWN;
|
||||
case 1:
|
||||
return BlockFace.UP;
|
||||
case 2:
|
||||
return BlockFace.EAST;
|
||||
case 3:
|
||||
return BlockFace.WEST;
|
||||
case 4:
|
||||
return BlockFace.NORTH;
|
||||
case 5:
|
||||
return BlockFace.SOUTH;
|
||||
default:
|
||||
return BlockFace.SELF;
|
||||
case 0:
|
||||
return BlockFace.DOWN;
|
||||
case 1:
|
||||
return BlockFace.UP;
|
||||
case 2:
|
||||
return BlockFace.EAST;
|
||||
case 3:
|
||||
return BlockFace.WEST;
|
||||
case 4:
|
||||
return BlockFace.NORTH;
|
||||
case 5:
|
||||
return BlockFace.SOUTH;
|
||||
default:
|
||||
return BlockFace.SELF;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -32,6 +32,7 @@ public class PoweredRail extends ExtendedRails implements Redstone {
|
||||
|
||||
/**
|
||||
* Set whether this PoweredRail should be powered or not.
|
||||
*
|
||||
* @param isPowered whether or not the rail is powered
|
||||
*/
|
||||
public void setPowered(boolean isPowered) {
|
||||
|
@@ -14,6 +14,7 @@ public class Pumpkin extends MaterialData implements Directional {
|
||||
|
||||
/**
|
||||
* Instantiate a pumpkin facing in a particular direction.
|
||||
*
|
||||
* @param direction the direction the pumkin's face is facing
|
||||
*/
|
||||
public Pumpkin(BlockFace direction) {
|
||||
|
@@ -97,6 +97,7 @@ public class Rails extends MaterialData {
|
||||
|
||||
/**
|
||||
* Return the data without the extended properties used by {@link PoweredRail} and {@link DetectorRail}. Overridden in {@link ExtendedRails}
|
||||
*
|
||||
* @return the data without the extended part
|
||||
*/
|
||||
protected byte getConvertedData() {
|
||||
@@ -105,10 +106,11 @@ public class Rails extends MaterialData {
|
||||
|
||||
/**
|
||||
* Set the direction of these tracks<br>
|
||||
* Note that tracks are bidirectional and that the direction
|
||||
* returned is the ascending direction if the track is set on a
|
||||
* slope. If it is set as a curve, the corner of the track should
|
||||
* be supplied.
|
||||
* Note that tracks are bidirectional and that the direction
|
||||
* returned is the ascending direction if the track is set on a
|
||||
* slope. If it is set as a curve, the corner of the track should
|
||||
* be supplied.
|
||||
*
|
||||
* @param face the direction the track should be facing
|
||||
* @param isOnSlope whether or not the track should be on a slope
|
||||
*/
|
||||
|
@@ -27,14 +27,14 @@ public abstract class TexturedMaterial extends MaterialData {
|
||||
|
||||
/**
|
||||
* Retrieve a list of possible textures. The first element of the list will be used as a default.
|
||||
*
|
||||
*
|
||||
* @return a list of possible textures for this block
|
||||
*/
|
||||
public abstract List<Material> getTextures();
|
||||
|
||||
/**
|
||||
* Gets the current Material this block is made of
|
||||
*
|
||||
*
|
||||
* @return Material of this block
|
||||
*/
|
||||
public Material getMaterial() {
|
||||
@@ -42,13 +42,13 @@ public abstract class TexturedMaterial extends MaterialData {
|
||||
if (n > getTextures().size() - 1) {
|
||||
n = 0;
|
||||
}
|
||||
|
||||
|
||||
return getTextures().get(n);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the material this block is made of
|
||||
*
|
||||
*
|
||||
* @param material
|
||||
* New material of this block
|
||||
*/
|
||||
|
@@ -40,17 +40,17 @@ public class TrapDoor extends SimpleAttachableMaterialData {
|
||||
byte data = (byte) (getData() & 0x3);
|
||||
|
||||
switch (data) {
|
||||
case 0x0:
|
||||
return BlockFace.WEST;
|
||||
case 0x0:
|
||||
return BlockFace.WEST;
|
||||
|
||||
case 0x1:
|
||||
return BlockFace.EAST;
|
||||
case 0x1:
|
||||
return BlockFace.EAST;
|
||||
|
||||
case 0x2:
|
||||
return BlockFace.SOUTH;
|
||||
case 0x2:
|
||||
return BlockFace.SOUTH;
|
||||
|
||||
case 0x3:
|
||||
return BlockFace.NORTH;
|
||||
case 0x3:
|
||||
return BlockFace.NORTH;
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -61,15 +61,15 @@ public class TrapDoor extends SimpleAttachableMaterialData {
|
||||
byte data = (byte) (getData() & 0x4);
|
||||
|
||||
switch (face) {
|
||||
case WEST:
|
||||
data |= 0x1;
|
||||
break;
|
||||
case NORTH:
|
||||
data |= 0x2;
|
||||
break;
|
||||
case SOUTH:
|
||||
data |= 0x3;
|
||||
break;
|
||||
case WEST:
|
||||
data |= 0x1;
|
||||
break;
|
||||
case NORTH:
|
||||
data |= 0x2;
|
||||
break;
|
||||
case SOUTH:
|
||||
data |= 0x3;
|
||||
break;
|
||||
}
|
||||
|
||||
setData(data);
|
||||
|
Reference in New Issue
Block a user