Generic cleanup of the org.bukkit.craftbukkit classes.
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
@@ -39,7 +39,7 @@ public class CraftBlock implements Block {
|
||||
* @return Location of the block
|
||||
*/
|
||||
public Location getLocation() {
|
||||
return new Location(getWorld(), x, y, z);
|
||||
return new Location(getWorld(), x, y, z);
|
||||
}
|
||||
|
||||
public BlockVector getVector() {
|
||||
|
||||
@@ -23,13 +23,13 @@ public class CraftBlockState implements BlockState {
|
||||
protected byte light;
|
||||
|
||||
public CraftBlockState(final Block block) {
|
||||
this.world = (CraftWorld)block.getWorld();
|
||||
this.world = (CraftWorld) block.getWorld();
|
||||
this.x = block.getX();
|
||||
this.y = block.getY();
|
||||
this.z = block.getZ();
|
||||
this.type = block.getTypeId();
|
||||
this.light = block.getLightLevel();
|
||||
this.chunk = (CraftChunk)block.getChunk();
|
||||
this.chunk = (CraftChunk) block.getChunk();
|
||||
|
||||
createData(block.getData());
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public class CraftBlockState implements BlockState {
|
||||
public boolean setTypeId(final int type) {
|
||||
this.type = type;
|
||||
|
||||
createData((byte)0);
|
||||
createData((byte) 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ public class CraftChest extends CraftBlockState implements Chest {
|
||||
public CraftChest(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
chest = (TileEntityChest)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
world = (CraftWorld) block.getWorld();
|
||||
chest = (TileEntityChest) world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public Inventory getInventory() {
|
||||
|
||||
@@ -13,8 +13,8 @@ public class CraftCreatureSpawner extends CraftBlockState implements CreatureSpa
|
||||
public CraftCreatureSpawner(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
spawner = (TileEntityMobSpawner)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
world = (CraftWorld) block.getWorld();
|
||||
spawner = (TileEntityMobSpawner) world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public CreatureType getCreatureType() {
|
||||
|
||||
@@ -22,8 +22,8 @@ public class CraftDispenser extends CraftBlockState implements Dispenser {
|
||||
public CraftDispenser(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
dispenser = (TileEntityDispenser)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
world = (CraftWorld) block.getWorld();
|
||||
dispenser = (TileEntityDispenser) world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public Inventory getInventory() {
|
||||
@@ -35,7 +35,8 @@ public class CraftDispenser extends CraftBlockState implements Dispenser {
|
||||
|
||||
synchronized (block) {
|
||||
if (block.getType() == Material.DISPENSER) {
|
||||
BlockDispenser dispense = (BlockDispenser)net.minecraft.server.Block.DISPENSER;
|
||||
BlockDispenser dispense = (BlockDispenser) net.minecraft.server.Block.DISPENSER;
|
||||
|
||||
dispense.dispense(world.getHandle(), getX(), getY(), getZ(), new Random());
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -19,8 +19,8 @@ public class CraftFurnace extends CraftBlockState implements Furnace {
|
||||
public CraftFurnace(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
furnace = (TileEntityFurnace)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
world = (CraftWorld) block.getWorld();
|
||||
furnace = (TileEntityFurnace) world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public Inventory getInventory() {
|
||||
@@ -39,7 +39,7 @@ public class CraftFurnace extends CraftBlockState implements Furnace {
|
||||
}
|
||||
|
||||
public short getBurnTime() {
|
||||
return (short)furnace.burnTime;
|
||||
return (short) furnace.burnTime;
|
||||
}
|
||||
|
||||
public void setBurnTime(short burnTime) {
|
||||
@@ -47,7 +47,7 @@ public class CraftFurnace extends CraftBlockState implements Furnace {
|
||||
}
|
||||
|
||||
public short getCookTime() {
|
||||
return (short)furnace.cookTime;
|
||||
return (short) furnace.cookTime;
|
||||
}
|
||||
|
||||
public void setCookTime(short cookTime) {
|
||||
|
||||
@@ -18,8 +18,8 @@ public class CraftNoteBlock extends CraftBlockState implements NoteBlock {
|
||||
public CraftNoteBlock(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
note = (TileEntityNote)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
world = (CraftWorld) block.getWorld();
|
||||
note = (TileEntityNote) world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public byte getNote() {
|
||||
|
||||
@@ -12,8 +12,8 @@ public class CraftSign extends CraftBlockState implements Sign {
|
||||
public CraftSign(final Block block) {
|
||||
super(block);
|
||||
|
||||
world = (CraftWorld)block.getWorld();
|
||||
sign = (TileEntitySign)world.getTileEntityAt(getX(), getY(), getZ());
|
||||
world = (CraftWorld) block.getWorld();
|
||||
sign = (TileEntitySign) world.getTileEntityAt(getX(), getY(), getZ());
|
||||
}
|
||||
|
||||
public String[] getLines() {
|
||||
|
||||
Reference in New Issue
Block a user