예제 #1
0
 public static ItemStack addGlow(ItemStack item) {
   switch (Version.getVersion()) {
     case TOO_NEW:
       Bukkit.getLogger()
           .log(
               Level.SEVERE,
               "[Crazy Crates]>> Your server is too new for this plugin. "
                   + "Please update or remove this plugin to stop further Errors.");
       break;
     case v1_10_R1:
       return NMS_v1_10_R1.addGlow(item);
     case v1_9_R2:
       return NMS_v1_9_R2.addGlow(item);
     case v1_9_R1:
       return NMS_v1_9_R1.addGlow(item);
     case v1_8_R3:
       return NMS_v1_8_R3.addGlow(item);
     case v1_8_R2:
       return NMS_v1_8_R2.addGlow(item);
     case v1_8_R1:
       return NMS_v1_8_R1.addGlow(item);
     case TOO_OLD:
       Bukkit.getLogger()
           .log(
               Level.SEVERE,
               "[Crazy Crates]>> Your server is too far out of date. "
                   + "Please update or remove this plugin to stop further Errors.");
       break;
   }
   return item;
 }
예제 #2
0
 public static void playChestAction(Block b, boolean open) {
   Location location = b.getLocation();
   Material type = b.getType();
   if (type == Material.CHEST || type == Material.TRAPPED_CHEST || type == Material.ENDER_CHEST) {
     switch (Version.getVersion()) {
       case TOO_NEW:
         Bukkit.getLogger()
             .log(
                 Level.SEVERE,
                 "[Crazy Crates]>> Your server is too new for this plugin. "
                     + "Please update or remove this plugin to stop further Errors.");
         break;
       case v1_10_R1:
         NMS_v1_10_R1.openChest(b, location, open);
         break;
       case v1_9_R2:
         NMS_v1_9_R2.openChest(b, location, open);
         break;
       case v1_9_R1:
         NMS_v1_9_R1.openChest(b, location, open);
         break;
       case v1_8_R3:
         NMS_v1_8_R3.openChest(b, location, open);
         break;
       case v1_8_R2:
         NMS_v1_8_R2.openChest(b, location, open);
         break;
       case v1_8_R1:
         NMS_v1_8_R1.openChest(b, location, open);
         break;
       case TOO_OLD:
         Bukkit.getLogger()
             .log(
                 Level.SEVERE,
                 "[Crazy Crates]>> Your server is too far out of date. "
                     + "Please update or remove this plugin to stop further Errors.");
         break;
     }
   }
 }
예제 #3
0
 public static List<Location> getLocations(String shem, Location loc) {
   switch (Version.getVersion()) {
     case TOO_NEW:
       Bukkit.getLogger()
           .log(
               Level.SEVERE,
               "[Crazy Crates]>> Your server is too new for this plugin. "
                   + "Please update or remove this plugin to stop further Errors.");
       break;
     case v1_10_R1:
       return NMS_v1_10_R1.getLocations(
           new File(plugin.getDataFolder() + "/Schematics/" + shem), loc);
     case v1_9_R2:
       return NMS_v1_9_R2.getLocations(
           new File(plugin.getDataFolder() + "/Schematics/" + shem), loc);
     case v1_9_R1:
       return NMS_v1_9_R1.getLocations(
           new File(plugin.getDataFolder() + "/Schematics/" + shem), loc);
     case v1_8_R3:
       return NMS_v1_8_R3.getLocations(
           new File(plugin.getDataFolder() + "/Schematics/" + shem), loc);
     case v1_8_R2:
       return NMS_v1_8_R2.getLocations(
           new File(plugin.getDataFolder() + "/Schematics/" + shem), loc);
     case v1_8_R1:
       return NMS_v1_8_R1.getLocations(
           new File(plugin.getDataFolder() + "/Schematics/" + shem), loc);
     case TOO_OLD:
       Bukkit.getLogger()
           .log(
               Level.SEVERE,
               "[Crazy Crates]>> Your server is too far out of date. "
                   + "Please update or remove this plugin to stop further Errors.");
       break;
   }
   return null;
 }