index ed2190b480c5a4b592a11c8e60ec9998604c97f1..b1e4eca7199598c6c92be2fb40e2a5570292b5ff 100644 (file)
class Lib_items_store\r
{\r
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
/*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
/*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
- /*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
-\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
-\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
\r
/*Craft*/\r
public static void resetcrafts(int len)\r
\r
/*Craft*/\r
public static void resetcrafts(int len)\r
return craftOUT_flag[id] & 0xFF;\r
} catch(Exception e) { return 0xFF;}\r
}\r
return craftOUT_flag[id] & 0xFF;\r
} catch(Exception e) { return 0xFF;}\r
}\r
-\r
-/*Tools*/\r
- public static void resettools(int len)\r
- {\r
- try {\r
- tool_type = new byte[len];\r
- tool_lvl = new byte[len];\r
- tool_speed = new byte[len];\r
- tool_damg = new byte[len];\r
- } catch(Exception e) {e.printStackTrace();}\r
- }\r
-\r
- public static void settooldata(int id, int tool, int lvl, int speed, int damg)\r
- {\r
- try {\r
- tool_type[id] = (byte) tool;\r
- tool_lvl[id] = (byte) lvl;\r
- tool_speed[id] = (byte) speed;\r
- tool_damg[id] = (byte) damg;\r
- } catch(Exception e) {e.printStackTrace();}\r
- }\r
-\r
- public static int gettooltype(int id)\r
- {\r
- try {\r
- return tool_type[item_info[id]];\r
- } catch(Exception e) { return 0;}\r
- }\r
-\r
- public static int gettoollvl(int id)\r
- {\r
- try {\r
- return tool_lvl[item_info[id]];\r
- } catch(Exception e) { return 0;}\r
- }\r
-\r
- public static int gettoolspeed(int id)\r
- {\r
- try {\r
- return tool_speed[item_info[id]];\r
- } catch(Exception e) { return 0;}\r
- }\r
-\r
- public static int gettooldamg(int id)\r
- {\r
- try {\r
- return tool_damg[item_info[id]];\r
- } catch(Exception e) { return 0;}\r
- }\r
-\r
}\r
}\r