Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static final void loadItemBonuses() {
- try {
- RandomAccessFile in = new RandomAccessFile(PACKED_PATH, "r");
- FileChannel channel = in.getChannel();
- ByteBuffer buffer = channel.map(MapMode.READ_ONLY, 0,
- channel.size());
- itemBonuses = new HashMap<Integer, int[]>(buffer.remaining() / 38);
- while (buffer.hasRemaining()) {
- int itemId = buffer.getShort() & 0xffff;
- int[] bonuses = new int[18];
- for (int index = 0; index < bonuses.length; index++)
- bonuses[index] = buffer.getShort();
- itemBonuses.put(itemId, bonuses);
- }
- channel.close();
- in.close();
- } catch (Throwable e) {
- Logger.handle(e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement