Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Commit

Permalink
Pre-init windup haste modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Dec 22, 2014
1 parent b49aafa commit a7e4dca
Showing 1 changed file with 10 additions and 5 deletions.
Expand Up @@ -52,10 +52,12 @@ public class RandomBonuses {
public static Set<Modifier> usefulToolModifiers = new HashSet<Modifier>();
public static Set<Modifier> usefulWeaponModifiers = new HashSet<Modifier>();
public static Set<Modifier> usefulBowModifiers = new HashSet<Modifier>();
public static Set<Modifier> usefulAmmoModifiers = new HashSet<Modifier>();

public static Map<Modifier, Integer> toolWeights = new HashMap<Modifier, Integer>();
public static Map<Modifier, Integer> weaponWeights = new HashMap<Modifier, Integer>();
public static Map<Modifier, Integer> bowWeights = new HashMap<Modifier, Integer>();
public static Map<Modifier, Integer> ammoWeights = new HashMap<Modifier, Integer>();

public static Integer usageBonusWeight = 70;

Expand All @@ -71,6 +73,14 @@ public class RandomBonuses {

// also ensure the correct attack modifier
modCache.put(TinkerTools.modAttack.key, TinkerTools.modAttack);

// special case: windup is a redstone modifier
for(ItemModifier modifier : ModifyBuilder.instance.itemModifiers) {
if(modifier instanceof ModWindup) {
modCache.put("Windup", modifier);
break;
}
}
}

public static Modifier tryModifying(EntityPlayer player, ItemStack tool)
Expand Down Expand Up @@ -430,11 +440,6 @@ private static ItemModifier getModifier(String key)
return modCache.get(key);

for(ItemModifier modifier : ModifyBuilder.instance.itemModifiers) {
// special case: windup is a redstone modifier
if("Windup".equals(key) && modifier instanceof ModWindup) {
modCache.put(key, modifier);
return modifier;
}
if (modifier.key.equals(key)) {
modCache.put(key, modifier);
return modifier;
Expand Down

0 comments on commit a7e4dca

Please sign in to comment.