diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-05-24 16:03:42 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-05-24 16:03:42 -0400 |
| commit | 9a4d1e95ea7784f0f98ea2913701a3a3c28aefaa (patch) | |
| tree | b4307f58fe2197d2215707bb3f44cf8952229c6d /src/main/java/darkknight/jewelrycraft/effects/EffectEnderPearl.java | |
| parent | 4f7ad220df0438b6f3382110577b53f29da46453 (diff) | |
Formatting pass
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/effects/EffectEnderPearl.java')
| -rwxr-xr-x | src/main/java/darkknight/jewelrycraft/effects/EffectEnderPearl.java | 90 |
1 files changed, 62 insertions, 28 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/effects/EffectEnderPearl.java b/src/main/java/darkknight/jewelrycraft/effects/EffectEnderPearl.java index 0b48ba2..562d83e 100755 --- a/src/main/java/darkknight/jewelrycraft/effects/EffectEnderPearl.java +++ b/src/main/java/darkknight/jewelrycraft/effects/EffectEnderPearl.java @@ -27,57 +27,86 @@ public class EffectEnderPearl extends ModifierEffects { }
@Override
- public void action(ItemStack item, EntityPlayer player, Item jewelry) {
+ public void action(ItemStack item, EntityPlayer player,
+ Item jewelry) {
if (jewelry instanceof ItemEarrings) {
- AxisAlignedBB axisalignedbb =
- player.boundingBox.expand(2.0D, 2.0D, 2.0D);
- List<?> list = player.worldObj.getEntitiesWithinAABB(
- EntityArrow.class, axisalignedbb);
+ AxisAlignedBB axisalignedbb = player.boundingBox
+ .expand(2.0D, 2.0D, 2.0D);
+ List<?> list = player.worldObj
+ .getEntitiesWithinAABB(
+ EntityArrow.class,
+ axisalignedbb);
if (!player.worldObj.isRemote && list != null
&& !list.isEmpty()) {
Iterator<?> iterator = list.iterator();
while (iterator.hasNext()) {
- EntityArrow arrow = (EntityArrow) iterator.next();
+ EntityArrow arrow = (EntityArrow) iterator
+ .next();
if (arrow.shootingEntity == null
- || !(arrow.shootingEntity.equals(player)))
+ || !(arrow.shootingEntity
+ .equals(player)))
// Negative earrings
- if (rand.nextInt(30) == 0) {
- arrow.worldObj.createExplosion(new EntityTNTPrimed(arrow.worldObj), arrow.posX, arrow.posY, arrow.posZ, 2F, true);
- arrow.setDead();
+ if (rand.nextInt(
+ 30) == 0) {
+ arrow.worldObj.createExplosion(
+ new EntityTNTPrimed(
+ arrow.worldObj),
+ arrow.posX,
+ arrow.posY,
+ arrow.posZ,
+ 2F,
+ true);
+ arrow.setDead();
}
// Positive earrings
else
- arrow.setPosition(arrow.posX + rand.nextInt(16) - rand.nextInt(16), arrow.posY + rand.nextInt(16), arrow.posZ + rand.nextInt(16) - rand.nextInt(16));
+ arrow.setPosition(
+ arrow.posX + rand
+ .nextInt(16)
+ - rand.nextInt(16),
+ arrow.posY + rand
+ .nextInt(16),
+ arrow.posZ + rand
+ .nextInt(16)
+ - rand.nextInt(16));
}
}
}
// Negative Necklace
if (jewelry instanceof ItemNecklace)
- player.addPotionEffect(
- new PotionEffect(Potion.resistance.id, 60, -10, true));
+ player.addPotionEffect(new PotionEffect(
+ Potion.resistance.id, 60, -10,
+ true));
// Negative bracelet
if (jewelry instanceof ItemBracelet && player.isInWater())
player.setPositionAndUpdate(
- player.posX + rand.nextInt(16) - rand.nextInt(16),
+ player.posX + rand.nextInt(16)
+ - rand.nextInt(16),
player.posY + rand.nextInt(4),
- player.posZ + rand.nextInt(16) - rand.nextInt(16));
+ player.posZ + rand.nextInt(16)
+ - rand.nextInt(16));
}
@Override
public void onPlayerAttacked(ItemStack item, EntityPlayer player,
DamageSource source, Item jewelry, float amount) {
// Positive Necklace
- if (jewelry instanceof ItemNecklace && source.getEntity() != null)
- source.getEntity().attackEntityFrom(source, amount);
+ if (jewelry instanceof ItemNecklace
+ && source.getEntity() != null)
+ source.getEntity().attackEntityFrom(source,
+ amount);
// Positive bracelet
- if (jewelry instanceof ItemBracelet && !player.worldObj.isRemote) {
+ if (jewelry instanceof ItemBracelet
+ && !player.worldObj.isRemote) {
int id = player.worldObj.provider.dimensionId;
if (player.getHealth() <= 6F)
if (player.getBedLocation(id) != null)
- player.setPositionAndUpdate(
- player.getBedLocation(id).posX,
- player.getBedLocation(id).posY,
- player.getBedLocation(id).posZ);
+ player.setPositionAndUpdate(player
+ .getBedLocation(id).posX,
+ player.getBedLocation(
+ id).posY,
+ player.getBedLocation(
+ id).posZ);
else
player.setPositionAndUpdate(
player.worldObj.getSpawnPoint().posX,
@@ -92,14 +121,19 @@ public class EffectEnderPearl extends ModifierEffects { if (jewelry instanceof ItemRing) {
// Negative ring
if (target instanceof EntityEnderman)
- player.addPotionEffect(new PotionEffect(Potion.weakness.id,
- 400, 2, true));
+ player.addPotionEffect(new PotionEffect(
+ Potion.weakness.id, 400, 2,
+ true));
// Positive ring
else
- target.setPosition(
- target.posX + rand.nextInt(16) - rand.nextInt(16),
- target.posY + rand.nextInt(4),
- target.posZ + rand.nextInt(16) - rand.nextInt(16));
+ target.setPosition(target.posX
+ + rand.nextInt(16)
+ - rand.nextInt(16),
+ target.posY + rand.nextInt(
+ 4),
+ target.posZ + rand.nextInt(
+ 16)
+ - rand.nextInt(16));
}
}
|
