Initial 1.11.2 update
This commit is contained in:
@@ -15,30 +15,32 @@ import net.minecraft.world.World;
|
||||
|
||||
public class ReplenishHunger extends Spell {
|
||||
|
||||
public ReplenishHunger() {
|
||||
public ReplenishHunger(){
|
||||
super(Tier.APPRENTICE, 10, Element.HEALING, "replenish_hunger", SpellType.UTILITY, 30, 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){
|
||||
|
||||
if(caster.getFoodStats().needFood()){
|
||||
int foodAmount = (int)(6*modifiers.get(SpellModifiers.DAMAGE));
|
||||
int foodAmount = (int)(6 * modifiers.get(SpellModifiers.DAMAGE));
|
||||
// Fixed issue #6: Changed to addStats, since setFoodLevel is client-side only
|
||||
caster.getFoodStats().addStats(foodAmount, foodAmount*0.1f);
|
||||
caster.getFoodStats().addStats(foodAmount, foodAmount * 0.1f);
|
||||
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), 1.0f, 0.7f, 0.3f);
|
||||
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), 1.0f, 0.7f, 0.3f);
|
||||
}
|
||||
}
|
||||
WizardryUtilities.playSoundAtPlayer(caster, WizardrySounds.SPELL_HEAL, 0.7F, world.rand.nextFloat() * 0.4F + 1.0F);
|
||||
WizardryUtilities.playSoundAtPlayer(caster, WizardrySounds.SPELL_HEAL, 0.7F,
|
||||
world.rand.nextFloat() * 0.4F + 1.0F);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user