From 4f115291eb93d87fe4941216ab3059c82de458a9 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 22 Apr 2024 12:50:45 -0400 Subject: [PATCH] No some are longs --- src/engine/mbEnums.java | 4 ++-- src/engine/objects/ItemTemplate.java | 8 ++++---- src/engine/objects/Mob.java | 4 ++-- src/engine/objects/MobBase.java | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/engine/mbEnums.java b/src/engine/mbEnums.java index 98f5b8dc..720ede75 100644 --- a/src/engine/mbEnums.java +++ b/src/engine/mbEnums.java @@ -44,7 +44,7 @@ public class mbEnums { return bitvector; } - public static > EnumSet fromInt(int bitVector, Class enumClass) { + public static > EnumSet fromLong(long bitVector, Class enumClass) { // Bitvector -> EnumSet without the EnumBitvector dependency @@ -56,7 +56,7 @@ public class mbEnums { return enumSet; for (E enumValue : enumClass.getEnumConstants()) { - if ((bitVector & (1 << enumValue.ordinal())) != 0) { + if ((bitVector & (1L << enumValue.ordinal())) != 0) { enumSet.add(enumValue); } } diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index b6a6392b..95174741 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -500,13 +500,13 @@ public class ItemTemplate { rune_dsc = jsonObject.getString("rune_dsc"); rune_fx_txt = jsonObject.getString("rune_fx_txt"); - int group_tactics_bitvector = jsonObject.getInt("rune_group_tactics"); + long group_tactics_bitvector = jsonObject.getLong("rune_group_tactics"); - rune_group_tactics.addAll(mbEnums.fromInt(group_tactics_bitvector, mbEnums.MobBehaviourType.class)); + rune_group_tactics.addAll(mbEnums.fromLong(group_tactics_bitvector, mbEnums.MobBehaviourType.class)); - int group_role_bitvector = jsonObject.getInt("rune_group_role_set"); + long group_role_bitvector = jsonObject.getLong("rune_group_role_set"); - rune_group_role_set.addAll(mbEnums.fromInt(group_role_bitvector, mbEnums.MobBehaviourType.class)); + rune_group_role_set.addAll(mbEnums.fromLong(group_role_bitvector, mbEnums.MobBehaviourType.class)); JSONArray enemy_types_json = jsonObject.getJSONArray("rune_enemy_monster_types"); diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 025a57b1..3c68ddc9 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -143,8 +143,8 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed { this.runeSet = rs.getInt("runeSet"); this.bootySet = rs.getInt("bootySet"); - this.notEnemy = mbEnums.fromInt(rs.getInt("notEnemy"), mbEnums.MonsterType.class); - this.enemy = mbEnums.fromInt(rs.getInt("enemy"), mbEnums.MonsterType.class); + this.notEnemy = mbEnums.fromLong(rs.getLong("notEnemy"), mbEnums.MonsterType.class); + this.enemy = mbEnums.fromLong(rs.getLong("enemy"), mbEnums.MonsterType.class); this.firstName = rs.getString("mob_name"); if (rs.getString("fsm").length() > 1) diff --git a/src/engine/objects/MobBase.java b/src/engine/objects/MobBase.java index c7c3669c..ee54309b 100644 --- a/src/engine/objects/MobBase.java +++ b/src/engine/objects/MobBase.java @@ -77,9 +77,9 @@ public class MobBase extends AbstractGameObject { this.fsm = mbEnums.MobBehaviourType.valueOf(rs.getString("fsm")); - this.flags = mbEnums.fromInt(rs.getInt("flags"), mbEnums.MobFlagType.class); - this.notEnemy = mbEnums.fromInt(rs.getInt("notEnemy"), mbEnums.MonsterType.class); - this.enemy = mbEnums.fromInt(rs.getInt("enemy"), mbEnums.MonsterType.class); + this.flags = mbEnums.fromLong(rs.getLong("flags"), mbEnums.MobFlagType.class); + this.notEnemy = mbEnums.fromLong(rs.getLong("notEnemy"), mbEnums.MonsterType.class); + this.enemy = mbEnums.fromLong(rs.getLong("enemy"), mbEnums.MonsterType.class); this.seeInvis = rs.getInt("seeInvis"); this.scale = rs.getFloat("scale");