mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 04:17:44 +01:00
Added Ladder MaterialData
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
3d5303ef55
commit
c8183cbb22
@ -67,7 +67,7 @@ public enum Material {
|
||||
BURNING_FURNACE(62),
|
||||
SIGN_POST(63),
|
||||
WOODEN_DOOR(64),
|
||||
LADDER(65),
|
||||
LADDER(65, Ladder.class),
|
||||
RAILS(66),
|
||||
COBBLESTONE_STAIRS(67),
|
||||
WALL_SIGN(68),
|
||||
|
48
paper-api/src/main/java/org/bukkit/material/Ladder.java
Normal file
48
paper-api/src/main/java/org/bukkit/material/Ladder.java
Normal file
@ -0,0 +1,48 @@
|
||||
|
||||
package org.bukkit.material;
|
||||
|
||||
import org.bukkit.BlockFace;
|
||||
import org.bukkit.Material;
|
||||
|
||||
/**
|
||||
* Represents Ladder data
|
||||
*/
|
||||
public class Ladder extends MaterialData implements Attachable {
|
||||
public Ladder(final int type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public Ladder(final Material type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public Ladder(final int type, final byte data) {
|
||||
super(type, data);
|
||||
}
|
||||
|
||||
public Ladder(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 0x2:
|
||||
return BlockFace.WEST;
|
||||
case 0x3:
|
||||
return BlockFace.EAST;
|
||||
case 0x4:
|
||||
return BlockFace.SOUTH;
|
||||
case 0x5:
|
||||
return BlockFace.NORTH;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user