use of crazypants.enderio.base.item.darksteel.upgrade.energy.EnergyUpgrade in project EnderIO by SleepyTrousers.
the class ItemDarkSteelArmor method getSubItems.
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> par3List) {
if (isInCreativeTab(tab)) {
@Nonnull ItemStack is = new ItemStack(this);
par3List.add(is);
is = new ItemStack(this);
EnergyUpgrade.EMPOWERED_FOUR.addToItem(is, this);
EnergyUpgradeManager.setPowerFull(is, this);
Iterator<IDarkSteelUpgrade> iter = DarkSteelRecipeManager.recipeIterator();
while (iter.hasNext()) {
IDarkSteelUpgrade upgrade = iter.next();
if (!(upgrade instanceof EnergyUpgrade || upgrade instanceof GliderUpgrade || upgrade instanceof ElytraUpgrade) && upgrade.canAddToItem(is, this)) {
upgrade.addToItem(is, this);
}
}
if (GliderUpgrade.INSTANCE.canAddToItem(is, this)) {
ItemStack is2 = is.copy();
GliderUpgrade.INSTANCE.addToItem(is2, this);
par3List.add(is2);
if (ElytraUpgrade.INSTANCE.canAddToItem(is, this)) {
ItemStack is3 = is.copy();
ElytraUpgrade.INSTANCE.addToItem(is3, this);
par3List.add(is3);
}
return;
}
par3List.add(is);
}
}
use of crazypants.enderio.base.item.darksteel.upgrade.energy.EnergyUpgrade in project EnderIO by SleepyTrousers.
the class ItemDarkSteelSword method getAttributeModifiers.
@Override
@Nonnull
public Multimap<String, AttributeModifier> getAttributeModifiers(@Nonnull EntityEquipmentSlot equipmentSlot, @Nonnull ItemStack stack) {
Multimap<String, AttributeModifier> res = super.getItemAttributeModifiers(equipmentSlot);
if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
if (Config.darkSteelSwordPowerUsePerHit <= 0 || EnergyUpgradeManager.getEnergyStored(stack) >= Config.darkSteelSwordPowerUsePerHit) {
EnergyUpgrade energyUpgrade = EnergyUpgrade.loadAnyFromItem(stack);
int level = energyUpgrade.getLevel();
res.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), DarkSteelAttributeModifiers.getAttackDamage(level));
res.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), DarkSteelAttributeModifiers.getAttackSpeed(level));
}
}
return res;
}
use of crazypants.enderio.base.item.darksteel.upgrade.energy.EnergyUpgrade in project EnderIO by SleepyTrousers.
the class SpeedController method setModifiers.
private static void setModifiers(@Nonnull EntityPlayer player) {
SpeedUpgrade speedUpgrade = getActiveSpeedUpgrade(player);
if (speedUpgrade != null) {
EnergyUpgrade energyUpgrade = getActiveEnergyUpgrade(player);
if (energyUpgrade != null) {
IAttributeInstance moveInst = player.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.MOVEMENT_SPEED);
AttributeModifier modifier = DarkSteelAttributeModifiers.getWalkSpeed(player.isSprinting(), speedUpgrade.getLevel(), energyUpgrade.getLevel());
moveInst.applyModifier(modifier);
}
}
}
Aggregations