@@ -1,4 +1,3 @@
|
||||
|
||||
package org.bukkit.block;
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.bukkit.Location;
|
||||
* block which will not be modified.
|
||||
*/
|
||||
public interface Block {
|
||||
|
||||
/**
|
||||
* Gets the metadata for this block
|
||||
*
|
||||
@@ -135,7 +136,7 @@ public interface Block {
|
||||
* @param data New block specific metadata
|
||||
*/
|
||||
void setData(byte data);
|
||||
|
||||
|
||||
void setData(byte data, boolean applyPhyiscs);
|
||||
|
||||
/**
|
||||
@@ -152,9 +153,9 @@ public interface Block {
|
||||
* @return whether the block was changed
|
||||
*/
|
||||
boolean setTypeId(int type);
|
||||
|
||||
|
||||
boolean setTypeId(int type, boolean applyPhysics);
|
||||
|
||||
|
||||
boolean setTypeIdAndData(int type, byte data, boolean applyPhyiscs);
|
||||
|
||||
/**
|
||||
@@ -220,19 +221,19 @@ public interface Block {
|
||||
* @return
|
||||
*/
|
||||
boolean isBlockFaceIndirectlyPowered(BlockFace face);
|
||||
|
||||
|
||||
/**
|
||||
* Returns the redstone power being provided to this block face
|
||||
*
|
||||
*
|
||||
* @param face the face of the block to query or BlockFace.SELF for the block itself
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
int getBlockPower(BlockFace face);
|
||||
|
||||
/**
|
||||
* Returns the redstone power being provided to this block
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
int getBlockPower();
|
||||
}
|
||||
|
||||
@@ -55,33 +55,43 @@ public enum BlockFace {
|
||||
public int getModZ() {
|
||||
return modZ;
|
||||
}
|
||||
|
||||
|
||||
public BlockFace getOppositeFace() {
|
||||
switch (this) {
|
||||
case NORTH:
|
||||
return BlockFace.SOUTH;
|
||||
|
||||
case SOUTH:
|
||||
return BlockFace.NORTH;
|
||||
|
||||
case EAST:
|
||||
return BlockFace.WEST;
|
||||
|
||||
case WEST:
|
||||
return BlockFace.EAST;
|
||||
|
||||
case UP:
|
||||
return BlockFace.DOWN;
|
||||
|
||||
case DOWN:
|
||||
return BlockFace.UP;
|
||||
|
||||
case NORTH_EAST:
|
||||
return BlockFace.SOUTH_WEST;
|
||||
|
||||
case NORTH_WEST:
|
||||
return BlockFace.SOUTH_EAST;
|
||||
|
||||
case SOUTH_EAST:
|
||||
return BlockFace.NORTH_WEST;
|
||||
|
||||
case SOUTH_WEST:
|
||||
return BlockFace.NORTH_EAST;
|
||||
|
||||
case SELF:
|
||||
return BlockFace.SELF;
|
||||
}
|
||||
|
||||
|
||||
return BlockFace.SELF;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package org.bukkit.block;
|
||||
|
||||
import org.bukkit.Chunk;
|
||||
@@ -15,6 +14,7 @@ import org.bukkit.material.MaterialData;
|
||||
* another type entirely, causing your BlockState to become invalid.
|
||||
*/
|
||||
public interface BlockState {
|
||||
|
||||
/**
|
||||
* Gets the block represented by this BlockState
|
||||
*
|
||||
|
||||
@@ -2,8 +2,7 @@ package org.bukkit.block;
|
||||
|
||||
/**
|
||||
* Represents a chest.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public interface Chest extends BlockState, ContainerBlock {
|
||||
}
|
||||
public interface Chest extends BlockState, ContainerBlock {}
|
||||
|
||||
@@ -4,13 +4,14 @@ import org.bukkit.inventory.Inventory;
|
||||
|
||||
/**
|
||||
* Indicates a block type that has inventory.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public interface ContainerBlock {
|
||||
|
||||
/**
|
||||
* Get the block's inventory.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Inventory getInventory();
|
||||
|
||||
@@ -2,52 +2,52 @@ package org.bukkit.block;
|
||||
|
||||
import org.bukkit.entity.CreatureType;
|
||||
|
||||
|
||||
/**
|
||||
* Represents a creature spawner.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
* @author Cogito
|
||||
*/
|
||||
public interface CreatureSpawner extends BlockState {
|
||||
|
||||
/**
|
||||
* Get the spawner's creature type.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CreatureType getCreatureType();
|
||||
|
||||
|
||||
/**
|
||||
* Set the spawner creature type.
|
||||
*
|
||||
*
|
||||
* @param mobType
|
||||
*/
|
||||
public void setCreatureType(CreatureType creatureType);
|
||||
|
||||
|
||||
/**
|
||||
* Get the spawner's creature type.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getCreatureTypeId();
|
||||
|
||||
|
||||
/**
|
||||
* Set the spawner mob type.
|
||||
*
|
||||
*
|
||||
* @param creatureType
|
||||
*/
|
||||
public void setCreatureTypeId(String creatureType);
|
||||
|
||||
|
||||
/**
|
||||
* Get the spawner's delay.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getDelay();
|
||||
|
||||
|
||||
/**
|
||||
* Set the spawner's delay.
|
||||
*
|
||||
*
|
||||
* @param delay
|
||||
*/
|
||||
public void setDelay(int delay);
|
||||
|
||||
@@ -2,15 +2,16 @@ package org.bukkit.block;
|
||||
|
||||
/**
|
||||
* Represents a dispenser.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public interface Dispenser extends BlockState, ContainerBlock {
|
||||
|
||||
/**
|
||||
* Attempts to dispense the contents of this block<br />
|
||||
* <br />
|
||||
* If the block is no longer a dispenser, this will return false
|
||||
*
|
||||
*
|
||||
* @return true if successful, otherwise false
|
||||
*/
|
||||
public boolean dispense();
|
||||
|
||||
@@ -2,34 +2,35 @@ package org.bukkit.block;
|
||||
|
||||
/**
|
||||
* Represents a furnace.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public interface Furnace extends BlockState, ContainerBlock {
|
||||
|
||||
/**
|
||||
* Get burn time.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public short getBurnTime();
|
||||
|
||||
|
||||
/**
|
||||
* Set burn time.
|
||||
*
|
||||
*
|
||||
* @param burnTime
|
||||
*/
|
||||
public void setBurnTime(short burnTime);
|
||||
|
||||
|
||||
/**
|
||||
* Get cook time.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public short getCookTime();
|
||||
|
||||
|
||||
/**
|
||||
* Set cook time.
|
||||
*
|
||||
*
|
||||
* @param cookTime
|
||||
*/
|
||||
public void setCookTime(short cookTime);
|
||||
|
||||
@@ -4,24 +4,25 @@ import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Represents a note.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public interface NoteBlock extends BlockState {
|
||||
|
||||
/**
|
||||
* Gets the note.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public byte getNote();
|
||||
|
||||
|
||||
/**
|
||||
* Set the note.
|
||||
*
|
||||
*
|
||||
* @param note
|
||||
*/
|
||||
public void setNote(byte note);
|
||||
|
||||
|
||||
/**
|
||||
* Attempts to play the note at block<br />
|
||||
* <br />
|
||||
@@ -30,7 +31,7 @@ public interface NoteBlock extends BlockState {
|
||||
* @return true if successful, otherwise false
|
||||
*/
|
||||
public boolean play();
|
||||
|
||||
|
||||
/**
|
||||
* Plays an arbitrary note with an arbitrary instrument
|
||||
*
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
|
||||
package org.bukkit.block;
|
||||
|
||||
/**
|
||||
* Represents either a SignPost or a WallSign
|
||||
*/
|
||||
public interface Sign extends BlockState {
|
||||
|
||||
/**
|
||||
* Gets all the lines of text currently on this sign.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user