Fix MaterialData directions being incorrect. Fixes BUKKIT-3160
Prior to 49690f9, BlockFaces were mostly correct in their respective MaterialData classes. However, a lot of things were not updated since implementation and broke without being addressed. This fixes any discrepancies with Block data. By: feildmaster <admin@feildmaster.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import org.bukkit.block.BlockFace;
|
||||
/**
|
||||
* Represents the cocoa plant
|
||||
*/
|
||||
public class CocoaPlant extends MaterialData implements Directional {
|
||||
public class CocoaPlant extends MaterialData implements Directional, Attachable {
|
||||
|
||||
public enum CocoaPlantSize {
|
||||
SMALL,
|
||||
@@ -71,9 +71,14 @@ public class CocoaPlant extends MaterialData implements Directional {
|
||||
setData((byte) dat);
|
||||
}
|
||||
|
||||
public BlockFace getAttachedFace() {
|
||||
return getFacing().getOppositeFace();
|
||||
}
|
||||
|
||||
public void setFacingDirection(BlockFace face) {
|
||||
int dat = getData() & 0xC;
|
||||
switch (face) {
|
||||
default:
|
||||
case SOUTH:
|
||||
break;
|
||||
case WEST:
|
||||
@@ -85,8 +90,6 @@ public class CocoaPlant extends MaterialData implements Directional {
|
||||
case EAST:
|
||||
dat |= 0x3;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
setData((byte) dat);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user