public void setOffhand(Item<?> secondHand) { try { if (secondHand.is(Shield.class)) { setShield(secondHand); setWand(null); } else if (secondHand.is(WandWeapon.class)) { setWand(secondHand); setShield(null); } else { setShield(null); setWand(null); } } catch (NullPointerException e) { Logger.getLogger(Equipment.class).error("Player has wrong item"); } }
public void setShoulderMount(Item<?> shoulderMount) { if (shoulderMount == null) { setSpecialWeapon(null); setMantle(null); setWings(null); } else if (shoulderMount.is(SlayerWeapon.class)) { setMantle(null); setWings(null); setSpecialWeapon(shoulderMount); } else if (shoulderMount.is(HeavyWeapon.class)) { setMantle(null); setWings(null); setSpecialWeapon(shoulderMount); } else if (shoulderMount.is(Mantle.class)) { setSpecialWeapon(null); setWings(null); setMantle(shoulderMount); } else if (shoulderMount.is(Wing.class)) { setSpecialWeapon(null); setMantle(null); setWings(shoulderMount); } }
private void setWings(Item<?> wings) { if (wings != null && !wings.is(Wing.class)) { throw new IllegalArgumentException(); } this.wings = wings; }
private void setWand(Item<?> wand) { if (wand != null && !wand.is(WandWeapon.class)) { throw new IllegalArgumentException(); } this.wand = wand; }
private void setSpecialWeapon(Item<?> specialWeapon) { if (specialWeapon != null && !specialWeapon.is(SpecialWeapon.class)) { throw new IllegalArgumentException(); } this.specialWeapon = specialWeapon; }
private void setShield(Item<?> shield) { if (shield != null && !shield.is(Shield.class)) { throw new IllegalArgumentException(); } this.shield = shield; }
public void setPants(Item<?> pants) { if (pants != null && !pants.is(Armor.class)) { throw new IllegalArgumentException(); } this.pants = pants; }
public void setRing(Item<?> ring) { if (ring != null && !ring.is(Ring.class)) { throw new IllegalArgumentException(); } this.ring = ring; }
private void setMantle(Item<?> mantle) { if (mantle != null && !mantle.is(Mantle.class)) { throw new IllegalArgumentException(); } this.mantle = mantle; }
public void setNecklace(Item<?> necklace) { if (necklace != null && !necklace.is(Necklace.class)) { throw new IllegalArgumentException(); } this.necklace = necklace; }
public void setHelmet(Item<?> helmet) { if (helmet != null && !helmet.is(Armor.class)) { throw new IllegalArgumentException(); } this.helmet = helmet; }
public void setMainhand(Item<?> weapon) { if (weapon != null && !weapon.is(Weapon.class)) { throw new IllegalArgumentException(); } this.weapon = weapon; }
public void setBracelet(Item<?> bracelet) { if (bracelet != null && !bracelet.is(Bracelet.class)) { throw new IllegalArgumentException(); } this.bracelet = bracelet; }
public void setBoots(Item<?> boots) { if (boots != null && !boots.is(Armor.class)) { throw new IllegalArgumentException(); } this.boots = boots; }
public void setArmor(Item<?> armor) { if (armor != null && !armor.is(Armor.class)) { throw new IllegalArgumentException(); } this.armor = armor; }