mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Added Torches
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
4d443d2fc5
commit
da00145da7
1 changed files with 50 additions and 0 deletions
50
paper-api/src/main/java/org/bukkit/material/Torch.java
Normal file
50
paper-api/src/main/java/org/bukkit/material/Torch.java
Normal file
|
@ -0,0 +1,50 @@
|
|||
|
||||
package org.bukkit.material;
|
||||
|
||||
import org.bukkit.BlockFace;
|
||||
import org.bukkit.Material;
|
||||
|
||||
/**
|
||||
* MaterialData for torches
|
||||
*/
|
||||
public class Torch extends MaterialData implements Attachable {
|
||||
public Torch(final int type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public Torch(final Material type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public Torch(final int type, final byte data) {
|
||||
super(type, data);
|
||||
}
|
||||
|
||||
public Torch(final Material type, final byte data) {
|
||||
super(type, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the face that this block is attached on
|
||||
*
|
||||
* @return BlockFace attached to
|
||||
*/
|
||||
public BlockFace getAttachedFace() {
|
||||
byte data = getData();
|
||||
|
||||
switch (data) {
|
||||
case 0x1:
|
||||
return BlockFace.NORTH;
|
||||
case 0x2:
|
||||
return BlockFace.SOUTH;
|
||||
case 0x3:
|
||||
return BlockFace.EAST;
|
||||
case 0x4:
|
||||
return BlockFace.WEST;
|
||||
case 0x5:
|
||||
return BlockFace.DOWN;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue