示例#1
0
    @Override
    public void run() {
      for (BCauldron cauldron : BCauldron.bcauldrons) {
        cauldron.onUpdate(); // runs every min to update cooking time
      }
      Barrel.onUpdate(); // runs every min to check and update ageing time
      BPlayer.onUpdate(); // updates players drunkeness

      debugLog("Update");

      DataSave.autoSave();
    }
示例#2
0
 // Returns true if the Block can be destroyed by the Player or something else (null)
 public boolean blockDestroy(Block block, Player player) {
   switch (block.getType()) {
     case CAULDRON:
       // will only remove when existing
       BCauldron.remove(block);
       return true;
     case FENCE:
     case NETHER_FENCE:
     case ACACIA_FENCE:
     case BIRCH_FENCE:
     case DARK_OAK_FENCE:
     case IRON_FENCE:
     case JUNGLE_FENCE:
     case SPRUCE_FENCE:
       // remove barrel and throw potions on the ground
       Barrel barrel = Barrel.getBySpigot(block);
       if (barrel != null) {
         if (barrel.hasPermsDestroy(player)) {
           barrel.remove(null, player);
           return true;
         } else {
           return false;
         }
       }
       return true;
     case SIGN_POST:
     case WALL_SIGN:
       // remove small Barrels
       Barrel barrel2 = Barrel.getBySpigot(block);
       if (barrel2 != null) {
         if (!barrel2.isLarge()) {
           if (barrel2.hasPermsDestroy(player)) {
             barrel2.remove(null, player);
             return true;
           } else {
             return false;
           }
         } else {
           barrel2.destroySign();
         }
       }
       return true;
     case WOOD:
     case WOOD_STAIRS:
     case BIRCH_WOOD_STAIRS:
     case JUNGLE_WOOD_STAIRS:
     case SPRUCE_WOOD_STAIRS:
     case ACACIA_STAIRS:
     case DARK_OAK_STAIRS:
       Barrel barrel3 = Barrel.getByWood(block);
       if (barrel3 != null) {
         if (barrel3.hasPermsDestroy(player)) {
           barrel3.remove(block, player);
         } else {
           return false;
         }
       }
     default:
       break;
   }
   return true;
 }