diff --git a/src/Crafting/FlowerPot.yml b/src/Crafting/FlowerPot.yml index 2d444c5..3427fe5 100644 --- a/src/Crafting/FlowerPot.yml +++ b/src/Crafting/FlowerPot.yml @@ -4,7 +4,7 @@ FlowerPot: glow: false lore: '' crafting: - disable: true + disable: false recipe: XTX,ATA,TAT index: T: 0 diff --git a/src/de/Ste3et_C0st/Furniture/Objects/garden/graveStone.java b/src/de/Ste3et_C0st/Furniture/Objects/garden/graveStone.java index f4eed16..1175319 100644 --- a/src/de/Ste3et_C0st/Furniture/Objects/garden/graveStone.java +++ b/src/de/Ste3et_C0st/Furniture/Objects/garden/graveStone.java @@ -14,9 +14,7 @@ import org.bukkit.block.Sign; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.event.block.BlockPlaceEvent; -import org.bukkit.event.entity.ItemSpawnEvent; +import org.bukkit.event.block.BlockPhysicsEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.BookMeta; import org.bukkit.plugin.Plugin; @@ -135,45 +133,19 @@ public class graveStone extends Furniture implements Listener{ sign.setType(Material.AIR); sign = null; delete(); + removeSign(); } @EventHandler - private void onBlockRemove(BlockBreakEvent e) - { - if(getObjID()==null){return;} - if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;} - if (sign==null) return; - if (e.getBlock() == null) return; - if (e.getBlock().getLocation() == null) return; - if (e.getBlock().getLocation().toVector().distance(signLoc.toVector())==0) return; - resetSign(); - } - - @EventHandler - private void onBlockPlaceEvent(BlockPlaceEvent e){ - if(getObjID()==null){return;} + private void onPhysiks(BlockPhysicsEvent e){ + if(getObjID()==null){return;} if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;} if (sign==null) return; if (e.getBlock() == null) return; - if (e.getBlock().getLocation() == null) return; - if (e.getBlock().getLocation().toVector().distance(signLoc.toVector())!=1) return; - resetSign(); + if (!e.getBlock().equals(sign)) return; + e.setCancelled(true); } - @EventHandler - private void onDrop(ItemSpawnEvent e){ - if(getObjID()==null){return;} - if(getObjID().getSQLAction().equals(SQLAction.REMOVE)){return;} - if (sign==null) return; - if (e.getLocation() == null) return; - ItemStack is = e.getEntity().getItemStack(); - if (is == null) return; - if (!is.getType().equals(Material.SIGN)) return; - if (e.getLocation().toVector().distance(signLoc.toVector())>=2) return; - e.getEntity().remove(); - } - - @EventHandler public void onFurnitureClick(FurnitureClickEvent e){ if(getObjID()==null){return;} @@ -237,14 +209,16 @@ public class graveStone extends Furniture implements Listener{ } public void placetext(){ - Sign sign = (Sign) this.sign.getState(); - Integer i = 0; - for(String s : lines){ - if(i>3){break;} - sign.setLine(i, s); - i++; + if ((this.sign.getState() instanceof Sign) && lines != null){ + Sign sign = (Sign) this.sign.getState(); + Integer i = 0; + for(String s : lines){ + if(i>3){break;} + sign.setLine(i, s); + i++; + } + sign.update(true, false); } - sign.update(true, false); } public String[] getText(){ diff --git a/src/plugin.yml b/src/plugin.yml index 24c97ee..dc75c0b 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,5 +1,5 @@ name: DiceFurniture -version: 2.4 +version: 2.4.1 description: Add some new Objects to the Server author: Ste3et_C0st website: http://dicecraft.de