Initial 1.11.2 update

This commit is contained in:
Electroblob
2018-02-07 21:15:50 +00:00
parent 67f6be0671
commit 3df5597dcc
368 changed files with 17234 additions and 15082 deletions
@@ -23,45 +23,49 @@ import net.minecraft.world.World;
public class FlamingWeapon extends Spell {
public FlamingWeapon() {
public FlamingWeapon(){
super(Tier.ADVANCED, 35, Element.FIRE, "flaming_weapon", SpellType.UTILITY, 70, EnumAction.BOW, false);
}
@Override
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers) {
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers){
// Won't work if the weapon already has the enchantment
if(WizardData.get(caster) != null && WizardData.get(caster).getImbuementDuration(WizardryEnchantments.flaming_weapon) <= 0){
if(WizardData.get(caster) != null
&& WizardData.get(caster).getImbuementDuration(WizardryEnchantments.flaming_weapon) <= 0){
for(ItemStack stack : WizardryUtilities.getPrioritisedHotbarAndOffhand(caster)){
if(stack != null){
if((stack.getItem() instanceof ItemSword || stack.getItem() instanceof ItemBow)
&& !EnchantmentHelper.getEnchantments(stack).containsKey(WizardryEnchantments.flaming_weapon)){
// The enchantment level as determined by the damage multiplier. The + 0.5f is so that
// weird float processing doesn't incorrectly round it down.
stack.addEnchantment(WizardryEnchantments.flaming_weapon,
modifiers.get(SpellModifiers.DAMAGE) == 1.0f ? 1
: (int)((modifiers.get(SpellModifiers.DAMAGE) - 1.0f)
/ Constants.DAMAGE_INCREASE_PER_TIER + 0.5f));
if((stack.getItem() instanceof ItemSword || stack.getItem() instanceof ItemBow) && !EnchantmentHelper.getEnchantments(stack).containsKey(WizardryEnchantments.flaming_weapon)){
// The enchantment level as determined by the damage multiplier. The + 0.5f is so that
// weird float processing doesn't incorrectly round it down.
stack.addEnchantment(WizardryEnchantments.flaming_weapon, modifiers.get(SpellModifiers.DAMAGE) == 1.0f ? 1 : (int)((modifiers.get(SpellModifiers.DAMAGE) - 1.0f)/Constants.DAMAGE_INCREASE_PER_TIER + 0.5f));
WizardData.get(caster).setImbuementDuration(WizardryEnchantments.flaming_weapon,
(int)(900 * modifiers.get(WizardryItems.duration_upgrade)));
WizardData.get(caster).setImbuementDuration(WizardryEnchantments.flaming_weapon, (int)(900*modifiers.get(WizardryItems.duration_upgrade)));
if(world.isRemote){
for(int i=0; i<10; i++){
double x1 = (double)((float)caster.posX + world.rand.nextFloat()*2 - 1.0F);
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat()*2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, 48 + world.rand.nextInt(12), 0.9f, 0.7f, 1.0f);
}
if(world.isRemote){
for(int i = 0; i < 10; i++){
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F
+ world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.9f, 0.7f, 1.0f);
}
WizardryUtilities.playSoundAtPlayer(caster, WizardrySounds.SPELL_CONJURATION, 1.0f, 1.0f);
return true;
}
WizardryUtilities.playSoundAtPlayer(caster, WizardrySounds.SPELL_CONJURATION, 1.0f, 1.0f);
return true;
}
}
}
return false;
}
}