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
@@ -18,27 +18,27 @@ import net.minecraft.world.World;
public class InvokeWeather extends Spell {
public InvokeWeather() {
public InvokeWeather(){
super(Tier.ADVANCED, 30, Element.LIGHTNING, "invoke_weather", SpellType.UTILITY, 100, 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.dimension == 0){
if(!world.isRemote){
// TODO: Backport these changes.
int standardWeatherTime = (300 + (new Random()).nextInt(600)) * 20;
if(world.isRaining()){
caster.addChatComponentMessage(new TextComponentTranslation("spell.invoke_weather.sun"));
caster.sendMessage(new TextComponentTranslation("spell.invoke_weather.sun"));
world.getWorldInfo().setCleanWeatherTime(standardWeatherTime);
world.getWorldInfo().setRainTime(0);
world.getWorldInfo().setThunderTime(0);
world.getWorldInfo().setRaining(false);
world.getWorldInfo().setThundering(false);
}else{
caster.addChatComponentMessage(new TextComponentTranslation("spell.invoke_weather.rain"));
caster.sendMessage(new TextComponentTranslation("spell.invoke_weather.rain"));
world.getWorldInfo().setCleanWeatherTime(0);
world.getWorldInfo().setRainTime(standardWeatherTime);
world.getWorldInfo().setThunderTime(standardWeatherTime);
@@ -47,21 +47,22 @@ public class InvokeWeather extends Spell {
world.getWorldInfo().setThundering(world.rand.nextInt(3) == 0);
}
}
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.5f, 0.7f, 1.0f);
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.5f, 0.7f, 1.0f);
}
}
WizardryUtilities.playSoundAtPlayer(caster, SoundEvents.ENTITY_LIGHTNING_THUNDER, 0.5F, 1.0f);
return true;
}
return false;
}
}