Don't let people disguise as air blocks

This commit is contained in:
libraryaddict 2014-03-09 12:05:36 +13:00
parent ae874392ab
commit 1ba39f8920

View File

@ -1,5 +1,6 @@
package me.libraryaddict.disguise.disguisetypes.watchers; package me.libraryaddict.disguise.disguisetypes.watchers;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.Disguise;
@ -26,6 +27,9 @@ public class FallingBlockWatcher extends FlagWatcher {
public void setBlock(ItemStack block) { public void setBlock(ItemStack block) {
this.block = block; this.block = block;
if (block.getType() == null || block.getType() == Material.AIR) {
block.setType(Material.STONE);
}
if (getDisguise().getEntity() != null && getDisguise().getWatcher() == this) { if (getDisguise().getEntity() != null && getDisguise().getWatcher() == this) {
DisguiseUtilities.refreshTrackers(getDisguise()); DisguiseUtilities.refreshTrackers(getDisguise());
} }