Package com.griefcraft.model

Examples of com.griefcraft.model.Protection


      // TODO: Can something else be protected by LWC? Or is it really only chests?
      // TODO: How about we run through each block in the chunk just to be on the safe side?
      if (blockState.getType() != Material.CHEST) continue;
      Block block = blockState.getBlock();
     
      Protection protection = LWC.getInstance().findProtection(block);
      if (protection == null) continue;
     
      ret.add(protection);
    }
   
View Full Code Here


        }

        Block block = event.getBlock();
        Player player = event.getPlayer();

        Protection protection = lwc.findProtection(block);

        if (protection == null) {
            return;
        }
View Full Code Here

        int y = block.getY();
        int z = block.getZ();

        String worldName = block.getWorld().getName();

        Protection existingProtection = lwc.getPhysicalDatabase().loadProtection(worldName, x, y, z);

        if (existingProtection != null) {
            event.setProtected(true);
            return;
        }

        LWCProtectionRegisterEvent protectionEvent = new LWCProtectionRegisterEvent(player, block);
        lwc.getModuleLoader().dispatchEvent(protectionEvent);

        if (protectionEvent.isCancelled()) {
            return;
        }

        Protection protection = lwc.getPhysicalDatabase().registerProtection(block.getTypeId(), Protection.Type.PRIVATE, worldName, player.getName(), "", x, y, z);

        if (protection != null) {
            event.setProtected(true);
        }
    }
View Full Code Here

        }
    }

    @EventHandler
    public void onShopRemove(ShopDestroyedEvent event) {
        Protection signProtection = lwc.findProtection(event.getSign().getBlock());

        if (signProtection != null) {
            signProtection.remove();
        }

        if (event.getChest() == null || !Properties.REMOVE_LWC_PROTECTION_AUTOMATICALLY) {
            return;
        }

        Protection chestProtection = lwc.findProtection(event.getChest().getBlock());

        if (chestProtection != null) {
            chestProtection.remove();
        }
    }
View Full Code Here

TOP

Related Classes of com.griefcraft.model.Protection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.