Browse Source

restrictflag and junk removal

combat-2
MagicBot 8 months ago
parent
commit
b3bffed179
  1. 47
      src/engine/objects/ItemBase.java

47
src/engine/objects/ItemBase.java

@ -19,7 +19,6 @@ import java.sql.ResultSet; @@ -19,7 +19,6 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.concurrent.ConcurrentHashMap;
public class ItemBase {
@ -28,7 +27,6 @@ public class ItemBase { @@ -28,7 +27,6 @@ public class ItemBase {
public static int GOLD_BASE_ID = 7;
public static ArrayList<Integer> AnniversaryGifts = new ArrayList<>();
public static HashMap<Integer, ItemBase> _itemBaseByUUID = new HashMap<>();
public static HashMap<engine.Enum.ItemType, HashSet<ItemBase>> ItemBaseTypeMap = new HashMap<>();
// Internal cache
private static final HashMap<Integer, Integer> itemHashIDMap = new HashMap<>();
private static final HashMap<String, Integer> _IDsByNames = new HashMap<>();
@ -44,7 +42,6 @@ public class ItemBase { @@ -44,7 +42,6 @@ public class ItemBase {
private final byte useAmount;
// Armor and weapon related values
private final int restrictFlag;
private final String skillRequired;
private final short percentRequired;
private final float blockMod;
@ -82,7 +79,6 @@ public class ItemBase { @@ -82,7 +79,6 @@ public class ItemBase {
this.hashID = rs.getInt("itemHashID");
this.isConsumable = false;
this.restrictFlag = rs.getInt("restrictFlag");
this.skillRequired = rs.getString("skillRequired");
this.percentRequired = rs.getShort("percentRequired");
this.blockMod = rs.getFloat("blockMod");
@ -374,53 +370,10 @@ public class ItemBase { @@ -374,53 +370,10 @@ public class ItemBase {
return uuid;
}
public boolean isLightArmor() {
return this.skillRequired.equals("Wear Armor, Light");
}
public boolean isMediumArmor() {
return this.skillRequired.equals("Wear Armor, Medium");
}
public boolean isHeavyArmor() {
return this.skillRequired.equals("Wear Armor, Heavy");
}
public boolean isClothArmor() {
return this.skillRequired.isEmpty();
}
public boolean isThrowing() {
return this.mastery.equals("Throwing");
}
public boolean isStaff() {
return this.mastery.equals("Staff");
}
public boolean isScepter() {
return this.mastery.equals("Benediction");
}
public boolean isArchery() {
return this.mastery.equals("Archery");
}
public boolean isMelee() {
return (this.isThrowing() == false && this.isStaff() == false && this.isScepter() == false && this.isArchery() == false);
}
public boolean isTwoHanded() {
return this.twoHanded;
}
/**
* @return the restrictFlag
*/
public int getRestrictFlag() {
return restrictFlag;
}
/**
* @return the skillRequired
*/

Loading…
Cancel
Save