Commit 07898d85 authored by kellerkindt's avatar kellerkindt
Browse files

Allow to place block at shop block location to restore glitched shops (github #8)

parent d8d998c4
......@@ -44,9 +44,10 @@ public class BlockListener implements Listener{
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
public void onBlockPlace (BlockPlaceEvent e) {
if ( scs.getShopHandler().isShopBlock(e.getBlock()) )
e.setCancelled(true);
else if ( scs.getShopHandler().isShopBlock(e.getBlockPlaced().getLocation().subtract(0, 1, 0).getBlock()) ){
if ( scs.getShopHandler().isShopBlock(e.getBlock()) ) {
// allow placing blocks to restore glitched shops
// e.setCancelled(true);
} else if ( scs.getShopHandler().isShopBlock(e.getBlockPlaced().getLocation().subtract(0, 1, 0).getBlock()) ){
//This is the block above.
//CHeck for attchables for the block being placed.
if(!(Material.STEP.equals(e.getBlockPlaced().getLocation().subtract(0, 1, 0).getBlock().getType())))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment