DEADSOFTWARE

blocks.cfg -> Blocks.pas
[cavecraft.git] / libs / Lib_items_store.java
index ed2190b480c5a4b592a11c8e60ec9998604c97f1..75245bb80c3390126c3419b6b400113c87673ab5 100644 (file)
 class Lib_items_store\r
  {\r
   /*Items*/\r
-  static byte[] item_type;\r
-  static byte[] item_tex;\r
-  static int[] item_max;\r
   static byte[] item_info;\r
-  static byte[] item_flags;\r
-  /*Blocks*/\r
-  static byte[] block_tex;\r
-  static int[] block_hp;\r
-  static byte[] block_coll;\r
-  static byte[] block_tool;\r
-  static byte[] block_lvl;\r
-  static byte[] block_flags;\r
-  static byte[] block_tr;\r
-  static byte[] block_li;\r
+\r
   /*Craft*/\r
   static byte[] [] craftIN_item;\r
   static byte[] [] craftIN_sum;\r
   static byte[] craftOUT_item;\r
   static int[] craftOUT_sum;\r
   static byte[] craftOUT_flag;\r
+\r
   /*Tools*/\r
   static byte[] tool_type;\r
   static byte[] tool_lvl;\r
   static byte[] tool_speed;\r
   static byte[] tool_damg;\r
 \r
-/*Items*/\r
-  public static void resetitems(int len)\r
-   {\r
-    try {\r
-     item_type = new byte[len];\r
-     item_tex = new byte[len];\r
-     item_max = new int[len];\r
-     item_info = new byte[len];\r
-     item_flags = new byte[len];\r
-    } catch(Exception e) {e.printStackTrace();}\r
-   }\r
-\r
-  public static void setitemdata(int id, int type, int tex, int max, int info, int flags)\r
-   {\r
-    try {\r
-     item_type[id] = (byte) type;\r
-     item_tex[id] = (byte) tex;\r
-     item_max[id] = max;\r
-     item_info[id] = (byte) info;\r
-        item_flags[id] = (byte) flags;\r
-    } catch(Exception e) {e.printStackTrace();}\r
-   }\r
-/*\r
-  public static int getitemmax(int id)\r
-   {\r
-    try{\r
-     return item_max[id];\r
-    } catch(Exception e) { return 0;}\r
-   }\r
-*/\r
-\r
-/*Blocks*/\r
-\r
-  public static void resetblocks(int len)\r
-   {\r
-    try {\r
-     block_tex = new byte[len];\r
-     block_hp = new int[len];\r
-     block_coll = new byte[len];\r
-     block_tool = new byte[len];\r
-     block_lvl = new byte[len];\r
-     block_flags = new byte[len];\r
-     block_tr = new byte[len];\r
-     block_li = new byte[len];\r
-    } catch(Exception e) {e.printStackTrace();}\r
-   }\r
-\r
-  public static void setblockdata(int id, int tex, int hp, int coll, int tool, int lvl, int flags, int tr, int li)\r
-   {\r
-    try {\r
-     block_tex[id] = (byte) tex;\r
-     block_hp[id] = hp;\r
-     block_coll[id] = (byte) coll;\r
-     block_tool[id] = (byte) tool;\r
-     block_lvl[id] = (byte) lvl;\r
-     block_flags[id] = (byte) flags;\r
-     block_tr[id] = (byte) tr;\r
-     block_li[id] = (byte) li;\r
-    } catch(Exception e) {e.printStackTrace();}\r
-   }\r
+       /* Items */\r
 \r
-  public static int getblocktex(int id)\r
-   {\r
-    try {\r
-     return (int) block_tex[id] & 0xFF;\r
-    } catch(Exception e) { return 0;}\r
-   }\r
+       public static void resetitems(int len)\r
+       {\r
+               item_info = new byte[len];\r
+       }\r
 \r
-  public static int getblockhp(int id)\r
-   {\r
-    try {\r
-     return block_hp[id];\r
-    } catch(Exception e) { return 0;}\r
-   }\r
-\r
-  public static int getblockcoll(int id)\r
-   {\r
-    try {\r
-     return (int) block_coll[id] & 0xFF;\r
-    } catch(Exception e) { return 0;}\r
-   }\r
-\r
-  public static int getblocktool(int id)\r
-   {\r
-    try {\r
-     return (int) block_tool[id] & 0xFF;\r
-    } catch(Exception e) { return 0;}\r
-   }\r
-\r
-  public static int getblocklvl(int id)\r
-   {\r
-    try {\r
-     return (int) block_lvl[id] & 0xFF;\r
-    } catch(Exception e) { return 0;}\r
-   }\r
-\r
-  public static int getblockflags(int id)\r
-   {\r
-    try {\r
-     return (int) block_flags[id] & 0xFF;\r
-    } catch(Exception e) { return 0;}\r
-   }\r
-\r
-  public static int getblocktr(int id)\r
-   {\r
-    try {\r
-     return (int) block_tr[id] & 0xFF;\r
-    } catch(Exception e) { return 0;}\r
-   }\r
-\r
-  public static int getblockli(int id)\r
-   {\r
-    try {\r
-     return (int) block_li[id] & 0xFF;\r
-    } catch(Exception e) { return 0;}\r
-   }\r
+       public static void setitemdata(int id, int type, int tex, int max, int info, int flags)\r
+       {\r
+               item_info[id] = (byte) info;\r
+       }\r
 \r
  /*Craft*/\r
   public static void resetcrafts(int len)\r