Test: Replace GetData

This commit is contained in:
Frank Baumann
2014-05-19 15:41:52 +02:00
parent 8d8d83c176
commit ba87aaabcf
+9 -1
View File
@@ -8,17 +8,21 @@ import org.bukkit.Material;
import org.bukkit.entity.HumanEntity; import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.PotionMeta; import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.material.MaterialData;
import org.bukkit.material.Stairs;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import com.dre.brewery.integration.GriefPreventionBarrel; import com.dre.brewery.integration.GriefPreventionBarrel;
import com.dre.brewery.integration.LWCBarrel; import com.dre.brewery.integration.LWCBarrel;
import com.dre.brewery.integration.LogBlockBarrel; import com.dre.brewery.integration.LogBlockBarrel;
import com.dre.brewery.integration.WGBarrel; import com.dre.brewery.integration.WGBarrel;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.ArrayUtils;
public class Barrel { public class Barrel {
@@ -743,10 +747,14 @@ public class Barrel {
if (isStairs(type)) { if (isStairs(type)) {
if (y == 0) { if (y == 0) {
// stairs have to be upside down // stairs have to be upside down
if (block.getData() < 4) { MaterialData data = block.getState().getData();
if(data instanceof Stairs){
Stairs sdata = (Stairs) data;
if (sdata.getFacing() == BlockFace.DOWN) {
return block; return block;
} }
} }
}
stairs.add(block.getX()); stairs.add(block.getX());
stairs.add(block.getY()); stairs.add(block.getY());
stairs.add(block.getZ()); stairs.add(block.getZ());