Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onConfig(int id, int value) throws InterruptedException {
- if (runes.size() == 3) {
- if (id == 1139) {
- /*
- * Gets the quantities of runes in rune pouch from configs
- */
- long con = (long) value; // getConfigs().get(1139);
- long config = con < 0 ? Integer.MAX_VALUE + (Integer.MAX_VALUE - Math.abs(con)) : con;
- if (config > 0) {
- int first = 0, second = 0, third = 0;
- int slotConfig = getConfigs().get(1140);
- if (slotConfig > 0) {
- if (slotConfig >= 16385) {
- third = (int) Math.floor(slotConfig / 16384);
- slotConfig = slotConfig % 16384;
- }
- if (slotConfig > 0) {
- second = slotConfig;
- }
- }
- int a = ((int) Math.floor(config / 4096));
- first = (int) Math.floor(a / 64);
- // f = f % 64;
- // Rune runeC = Rune.forValue(f);
- // config = config % 4096;
- addRune((Rune) runes.keySet().toArray()[2], third);
- // e = (int) Math.floor(config / 64);
- // Rune runeB = Rune.forValue(e);
- // config = config % 64;
- addRune((Rune) runes.keySet().toArray()[1], second);
- // Rune runeA = Rune.forValue((int) config);
- addRune((Rune) runes.keySet().toArray()[0], first);
- } else {
- runes = new LinkedHashMap<>();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement