mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-09 07:37:34 +01:00
!Removed 1.12 deprecated methods
This commit is contained in:
parent
be9aa9ceea
commit
790ebd09a7
BIN
lib/MMOLib.jar
BIN
lib/MMOLib.jar
Binary file not shown.
@ -22,7 +22,8 @@ import net.mmogroup.mmolib.version.VersionSound;
|
||||
|
||||
public class Contamination extends Ability {
|
||||
public Contamination() {
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK, CastingMode.SHIFT_RIGHT_CLICK);
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK,
|
||||
CastingMode.SHIFT_RIGHT_CLICK);
|
||||
|
||||
addModifier("damage", 2);
|
||||
addModifier("duration", 8);
|
||||
@ -35,7 +36,7 @@ public class Contamination extends Ability {
|
||||
public AbilityResult whenRan(CachedStats stats, LivingEntity target, AbilityData ability, ItemAttackResult result) {
|
||||
return new LocationAbilityResult(ability, stats.getPlayer(), target);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void whenCast(CachedStats stats, AbilityResult ability, ItemAttackResult result) {
|
||||
Location loc = ((LocationAbilityResult) ability).getTarget();
|
||||
@ -53,7 +54,8 @@ public class Contamination extends Ability {
|
||||
if (j >= duration)
|
||||
cancel();
|
||||
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc.clone().add(Math.cos(ti / 3) * 5, 0, Math.sin(ti / 3) * 5), Color.PURPLE);
|
||||
loc.getWorld().spawnParticle(Particle.REDSTONE, loc.clone().add(Math.cos(ti / 3) * 5, 0, Math.sin(ti / 3) * 5), 1,
|
||||
new Particle.DustOptions(Color.PURPLE, 1));
|
||||
for (int j = 0; j < 3; j++) {
|
||||
ti += Math.PI / 32;
|
||||
double r = Math.sin(ti / 2) * 4;
|
||||
@ -65,7 +67,8 @@ public class Contamination extends Ability {
|
||||
loc.getWorld().playSound(loc, VersionSound.ENTITY_ENDERMAN_HURT.toSound(), 2, 1);
|
||||
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc))
|
||||
if (MMOUtils.canDamage(stats.getPlayer(), entity) && entity.getLocation().distanceSquared(loc) <= 25)
|
||||
MMOLib.plugin.getDamage().damage(stats.getPlayer(), (LivingEntity) entity, new AttackResult(dps, DamageType.SKILL, DamageType.MAGIC), false);
|
||||
MMOLib.plugin.getDamage().damage(stats.getPlayer(), (LivingEntity) entity,
|
||||
new AttackResult(dps, DamageType.SKILL, DamageType.MAGIC), false);
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(MMOItems.plugin, 0, 1);
|
||||
|
@ -15,14 +15,14 @@ import net.Indyuce.mmoitems.api.ability.AbilityResult;
|
||||
import net.Indyuce.mmoitems.api.ability.LocationAbilityResult;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.AttackResult;
|
||||
import net.mmogroup.mmolib.api.DamageType;
|
||||
import net.mmogroup.mmolib.version.VersionSound;
|
||||
|
||||
public class Corrupt extends Ability {
|
||||
public Corrupt() {
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK, CastingMode.SHIFT_RIGHT_CLICK);
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK,
|
||||
CastingMode.SHIFT_RIGHT_CLICK);
|
||||
|
||||
addModifier("damage", 8);
|
||||
addModifier("duration", 4);
|
||||
@ -52,7 +52,7 @@ public class Corrupt extends Ability {
|
||||
Location loc1 = loc.clone().add(Math.cos(j) * radius, 1, Math.sin(j) * radius);
|
||||
double y_max = .5 + random.nextDouble();
|
||||
for (double y = 0; y < y_max; y += .1)
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc1.clone().add(0, y, 0), Color.PURPLE);
|
||||
loc1.getWorld().spawnParticle(Particle.REDSTONE, loc1.clone().add(0, y, 0), 1, new Particle.DustOptions(Color.PURPLE, 1));
|
||||
}
|
||||
|
||||
for (Entity entity : MMOUtils.getNearbyChunkEntities(loc))
|
||||
|
@ -21,14 +21,14 @@ import net.Indyuce.mmoitems.api.ability.AbilityResult;
|
||||
import net.Indyuce.mmoitems.api.ability.VectorAbilityResult;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.AttackResult;
|
||||
import net.mmogroup.mmolib.api.DamageType;
|
||||
import net.mmogroup.mmolib.version.VersionSound;
|
||||
|
||||
public class Ice_Crystal extends Ability {
|
||||
public Ice_Crystal() {
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK, CastingMode.SHIFT_RIGHT_CLICK);
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK,
|
||||
CastingMode.SHIFT_RIGHT_CLICK);
|
||||
|
||||
addModifier("damage", 6);
|
||||
addModifier("duration", 3);
|
||||
@ -70,9 +70,10 @@ public class Ice_Crystal extends Ability {
|
||||
*/
|
||||
for (double r = 0; r < .4; r += .1)
|
||||
for (double a = 0; a < Math.PI * 2; a += Math.PI / 2) {
|
||||
Vector vec = MMOUtils.rotateFunc(new Vector(r * Math.cos(a + (double) ti / 10), r * Math.sin(a + (double) ti / 10), 0), loc);
|
||||
Vector vec = MMOUtils.rotateFunc(new Vector(r * Math.cos(a + (double) ti / 10), r * Math.sin(a + (double) ti / 10), 0),
|
||||
loc);
|
||||
loc.add(vec);
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc, .7f, Color.WHITE);
|
||||
loc.getWorld().spawnParticle(Particle.REDSTONE, loc, 1, new Particle.DustOptions(Color.WHITE, .7f));
|
||||
loc.add(vec.multiply(-1));
|
||||
}
|
||||
|
||||
@ -81,8 +82,10 @@ public class Ice_Crystal extends Ability {
|
||||
loc.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, loc, 0);
|
||||
loc.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, loc, 48, 0, 0, 0, .2);
|
||||
loc.getWorld().playSound(loc, Sound.ENTITY_GENERIC_EXPLODE, 2, 1);
|
||||
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE).damage(stats.getPlayer(), (LivingEntity) entity);
|
||||
((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.SLOW, (int) (ability.getModifier("duration") * 20), (int) ability.getModifier("amplifier")));
|
||||
new AttackResult(ability.getModifier("damage"), DamageType.SKILL, DamageType.MAGIC, DamageType.PROJECTILE)
|
||||
.damage(stats.getPlayer(), (LivingEntity) entity);
|
||||
((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.SLOW,
|
||||
(int) (ability.getModifier("duration") * 20), (int) ability.getModifier("amplifier")));
|
||||
cancel();
|
||||
return;
|
||||
}
|
||||
|
@ -19,12 +19,12 @@ import net.Indyuce.mmoitems.api.ability.AbilityResult;
|
||||
import net.Indyuce.mmoitems.api.ability.SimpleAbilityResult;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.version.VersionSound;
|
||||
|
||||
public class Magical_Shield extends Ability {
|
||||
public Magical_Shield() {
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK, CastingMode.SHIFT_RIGHT_CLICK);
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK,
|
||||
CastingMode.SHIFT_RIGHT_CLICK);
|
||||
|
||||
addModifier("power", 40);
|
||||
addModifier("radius", 5);
|
||||
@ -85,7 +85,9 @@ public class Magical_Shield extends Ability {
|
||||
|
||||
for (double j = 0; j < Math.PI / 2; j += Math.PI / (28 + random.nextInt(5)))
|
||||
for (double i = 0; i < Math.PI * 2; i += Math.PI / (14 + random.nextInt(5)))
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc.clone().add(2.5 * Math.cos(i + j) * Math.sin(j), 2.5 * Math.cos(j), 2.5 * Math.sin(i + j) * Math.sin(j)), Color.FUCHSIA);
|
||||
loc.getWorld().spawnParticle(Particle.REDSTONE,
|
||||
loc.clone().add(2.5 * Math.cos(i + j) * Math.sin(j), 2.5 * Math.cos(j), 2.5 * Math.sin(i + j) * Math.sin(j)), 1,
|
||||
new Particle.DustOptions(Color.FUCHSIA, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,11 +21,11 @@ import net.Indyuce.mmoitems.api.ability.AbilityResult;
|
||||
import net.Indyuce.mmoitems.api.ability.SimpleAbilityResult;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
|
||||
public class Shockwave extends Ability {
|
||||
public Shockwave() {
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK, CastingMode.SHIFT_RIGHT_CLICK);
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK,
|
||||
CastingMode.SHIFT_RIGHT_CLICK);
|
||||
|
||||
addModifier("cooldown", 7.5);
|
||||
addModifier("knock-up", 1);
|
||||
@ -58,10 +58,11 @@ public class Shockwave extends Ability {
|
||||
loc.add(vec);
|
||||
|
||||
loc.getWorld().playSound(loc, Sound.BLOCK_GRAVEL_BREAK, 1, 2);
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.BLOCK_CRACK, loc, 12, .5, 0, .5, 0, Material.DIRT);
|
||||
loc.getWorld().spawnParticle(Particle.BLOCK_CRACK, loc, 12, .5, 0, .5, 0, Material.DIRT.createBlockData());
|
||||
|
||||
for (Entity ent : MMOUtils.getNearbyChunkEntities(loc))
|
||||
if (ent.getLocation().distance(loc) < 1.1 && ent instanceof LivingEntity && !ent.equals(stats.getPlayer()) && !hit.contains(ent.getEntityId())) {
|
||||
if (ent.getLocation().distance(loc) < 1.1 && ent instanceof LivingEntity && !ent.equals(stats.getPlayer())
|
||||
&& !hit.contains(ent.getEntityId())) {
|
||||
hit.add(ent.getEntityId());
|
||||
ent.playEffect(EntityEffect.HURT);
|
||||
ent.setVelocity(ent.getVelocity().setY(.4 * knockUp));
|
||||
|
@ -23,7 +23,6 @@ import net.Indyuce.mmoitems.api.ability.AbilityResult;
|
||||
import net.Indyuce.mmoitems.api.ability.VectorAbilityResult;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.AttackResult;
|
||||
import net.mmogroup.mmolib.api.DamageType;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
@ -121,8 +120,8 @@ public class Shulker_Missile extends Ability implements Listener {
|
||||
y += .04;
|
||||
for (int j = 0; j < 2; j++) {
|
||||
double xz = y * Math.PI * 1.3 + (j * Math.PI);
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc.clone().add(Math.cos(xz), y, Math.sin(xz)),
|
||||
Color.MAROON);
|
||||
loc.getWorld().spawnParticle(Particle.REDSTONE, loc.clone().add(Math.cos(xz), y, Math.sin(xz)), 1,
|
||||
new Particle.DustOptions(Color.MAROON, 1));
|
||||
}
|
||||
}
|
||||
if (y >= 2)
|
||||
|
@ -15,12 +15,12 @@ import net.Indyuce.mmoitems.api.ability.AbilityResult;
|
||||
import net.Indyuce.mmoitems.api.ability.TargetAbilityResult;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.version.VersionSound;
|
||||
|
||||
public class Blind extends Ability {
|
||||
public Blind() {
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK, CastingMode.SHIFT_RIGHT_CLICK);
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK,
|
||||
CastingMode.SHIFT_RIGHT_CLICK);
|
||||
|
||||
addModifier("duration", 5);
|
||||
addModifier("cooldown", 9);
|
||||
@ -28,7 +28,6 @@ public class Blind extends Ability {
|
||||
addModifier("stamina", 0);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AbilityResult whenRan(CachedStats stats, LivingEntity target, AbilityData ability, ItemAttackResult result) {
|
||||
return new TargetAbilityResult(ability, stats.getPlayer(), target);
|
||||
@ -37,13 +36,14 @@ public class Blind extends Ability {
|
||||
@Override
|
||||
public void whenCast(CachedStats stats, AbilityResult ability, ItemAttackResult result) {
|
||||
LivingEntity target = ((TargetAbilityResult) ability).getTarget();
|
||||
|
||||
|
||||
target.getWorld().playSound(target.getLocation(), VersionSound.ENTITY_ENDERMAN_HURT.toSound(), 1, 2);
|
||||
for (double i = 0; i < Math.PI * 2; i += Math.PI / 24)
|
||||
for (double j = 0; j < 2; j++) {
|
||||
Location loc = target.getLocation();
|
||||
Vector vec = MMOUtils.rotateFunc(new Vector(Math.cos(i), 1 + Math.cos(i + (Math.PI * j)) * .5, Math.sin(i)), stats.getPlayer().getLocation());
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc.add(vec), Color.BLACK);
|
||||
Vector vec = MMOUtils.rotateFunc(new Vector(Math.cos(i), 1 + Math.cos(i + (Math.PI * j)) * .5, Math.sin(i)),
|
||||
stats.getPlayer().getLocation());
|
||||
loc.getWorld().spawnParticle(Particle.REDSTONE, loc.add(vec), 1, new Particle.DustOptions(Color.BLACK, 1));
|
||||
}
|
||||
target.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, (int) (ability.getModifier("duration") * 20), 0));
|
||||
}
|
||||
|
@ -16,11 +16,11 @@ import net.Indyuce.mmoitems.api.ability.AbilityResult;
|
||||
import net.Indyuce.mmoitems.api.ability.TargetAbilityResult;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
|
||||
public class Slow extends Ability {
|
||||
public Slow() {
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK, CastingMode.SHIFT_RIGHT_CLICK);
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK,
|
||||
CastingMode.SHIFT_RIGHT_CLICK);
|
||||
|
||||
addModifier("cooldown", 5);
|
||||
addModifier("duration", 3);
|
||||
@ -49,11 +49,14 @@ public class Slow extends Ability {
|
||||
|
||||
for (double j = 0; j < Math.PI * 2; j += Math.PI)
|
||||
for (double r = 0; r < .7; r += .1)
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc.clone().add(Math.cos((ti / 2) + j + (Math.PI * r)) * r * 2, .1, Math.sin((ti / 2) + j + (Math.PI * r)) * r * 2), Color.WHITE);
|
||||
loc.getWorld().spawnParticle(Particle.REDSTONE,
|
||||
loc.clone().add(Math.cos((ti / 2) + j + (Math.PI * r)) * r * 2, .1, Math.sin((ti / 2) + j + (Math.PI * r)) * r * 2),
|
||||
1, new Particle.DustOptions(Color.WHITE, 1));
|
||||
|
||||
}
|
||||
}.runTaskTimer(MMOItems.plugin, 0, 1);
|
||||
target.getWorld().playSound(target.getLocation(), Sound.ENTITY_LLAMA_ANGRY, 1, 2);
|
||||
target.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, (int) (ability.getModifier("duration") * 20), (int) ability.getModifier("amplifier")));
|
||||
target.addPotionEffect(
|
||||
new PotionEffect(PotionEffectType.SLOW, (int) (ability.getModifier("duration") * 20), (int) ability.getModifier("amplifier")));
|
||||
}
|
||||
}
|
||||
|
@ -15,11 +15,11 @@ import net.Indyuce.mmoitems.api.ability.AbilityResult;
|
||||
import net.Indyuce.mmoitems.api.ability.TargetAbilityResult;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
|
||||
public class Vampirism extends Ability {
|
||||
public Vampirism() {
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK, CastingMode.SHIFT_RIGHT_CLICK);
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK,
|
||||
CastingMode.SHIFT_RIGHT_CLICK);
|
||||
|
||||
addModifier("cooldown", 8);
|
||||
addModifier("drain", 10);
|
||||
@ -47,7 +47,9 @@ public class Vampirism extends Ability {
|
||||
dis += ti <= 10 ? .15 : -.15;
|
||||
|
||||
for (double j = 0; j < Math.PI * 2; j += Math.PI / 4)
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc.clone().add(Math.cos(j + (ti / 20)) * dis, 0, Math.sin(j + (ti / 20)) * dis), Color.RED);
|
||||
loc.getWorld().spawnParticle(Particle.REDSTONE,
|
||||
loc.clone().add(Math.cos(j + (ti / 20)) * dis, 0, Math.sin(j + (ti / 20)) * dis), 1,
|
||||
new Particle.DustOptions(Color.RED, 1));
|
||||
}
|
||||
if (ti >= 17)
|
||||
cancel();
|
||||
|
@ -26,7 +26,6 @@ import net.Indyuce.mmoitems.api.ability.AbilityResult;
|
||||
import net.Indyuce.mmoitems.api.ability.TargetAbilityResult;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.version.VersionSound;
|
||||
|
||||
public class Weaken_Target extends Ability implements Listener {
|
||||
@ -69,14 +68,16 @@ public class Weaken_Target extends Ability implements Listener {
|
||||
}
|
||||
|
||||
for (double j = 0; j < Math.PI * 2; j += Math.PI / 18)
|
||||
target.getWorld().spawnParticle(Particle.SMOKE_NORMAL, target.getLocation().clone().add(Math.cos(j) * .7, .1, Math.sin(j) * .7), 0);
|
||||
target.getWorld().spawnParticle(Particle.SMOKE_NORMAL, target.getLocation().clone().add(Math.cos(j) * .7, .1, Math.sin(j) * .7),
|
||||
0);
|
||||
}
|
||||
}.runTaskTimer(MMOItems.plugin, 0, 20);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void a(EntityDamageEvent event) {
|
||||
if (event.getCause() != DamageCause.ENTITY_ATTACK && event.getCause() != DamageCause.ENTITY_EXPLOSION && event.getCause() != DamageCause.PROJECTILE)
|
||||
if (event.getCause() != DamageCause.ENTITY_ATTACK && event.getCause() != DamageCause.ENTITY_EXPLOSION
|
||||
&& event.getCause() != DamageCause.PROJECTILE)
|
||||
return;
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
@ -106,7 +107,8 @@ public class Weaken_Target extends Ability implements Listener {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
y += .07;
|
||||
for (int k = 0; k < 3; k++)
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc.clone().add(Math.cos(y * Math.PI + (k * Math.PI * 2 / 3)) * (3 - y) / 2.5, y, Math.sin(y * Math.PI + (k * Math.PI * 2 / 3)) * (3 - y) / 2.5), Color.BLACK);
|
||||
loc.getWorld().spawnParticle(Particle.REDSTONE, loc.clone().add(Math.cos(y * Math.PI + (k * Math.PI * 2 / 3)) * (3 - y) / 2.5,
|
||||
y, Math.sin(y * Math.PI + (k * Math.PI * 2 / 3)) * (3 - y) / 2.5), 1, new Particle.DustOptions(Color.BLACK, 1));
|
||||
}
|
||||
if (y > 3)
|
||||
cancel();
|
||||
|
@ -16,11 +16,11 @@ import net.Indyuce.mmoitems.api.ability.AbilityResult;
|
||||
import net.Indyuce.mmoitems.api.ability.TargetAbilityResult;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
|
||||
public class Wither extends Ability {
|
||||
public Wither() {
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK, CastingMode.SHIFT_RIGHT_CLICK);
|
||||
super(CastingMode.ON_HIT, CastingMode.WHEN_HIT, CastingMode.LEFT_CLICK, CastingMode.RIGHT_CLICK, CastingMode.SHIFT_LEFT_CLICK,
|
||||
CastingMode.SHIFT_RIGHT_CLICK);
|
||||
|
||||
addModifier("cooldown", 8);
|
||||
addModifier("duration", 3);
|
||||
@ -52,12 +52,13 @@ public class Wither extends Ability {
|
||||
double a = y * Math.PI + (j * Math.PI * 2 / 3);
|
||||
double x = Math.cos(a) * (3 - y) / 2.5;
|
||||
double z = Math.sin(a) * (3 - y) / 2.5;
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc.clone().add(x, x, z), Color.BLACK);
|
||||
loc.getWorld().spawnParticle(Particle.REDSTONE, loc.clone().add(x, x, z), 1, new Particle.DustOptions(Color.BLACK, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(MMOItems.plugin, 0, 1);
|
||||
target.getWorld().playSound(target.getLocation(), Sound.ENTITY_WITHER_SHOOT, 2, 2);
|
||||
target.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, (int) (ability.getModifier("duration") * 20), (int) ability.getModifier("amplifier")));
|
||||
target.addPotionEffect(
|
||||
new PotionEffect(PotionEffectType.WITHER, (int) (ability.getModifier("duration") * 20), (int) ability.getModifier("amplifier")));
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import net.Indyuce.mmoitems.MMOItems;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
public class ArrowParticles extends BukkitRunnable {
|
||||
@ -43,8 +42,7 @@ public class ArrowParticles extends BukkitRunnable {
|
||||
}
|
||||
|
||||
if (color != null)
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(particle, arrow.getLocation().add(0, .25, 0), amount, offset, offset, offset, 0, 1,
|
||||
color);
|
||||
arrow.getWorld().spawnParticle(particle, arrow.getLocation().add(0, .25, 0), amount, offset, offset, offset, color);
|
||||
else
|
||||
arrow.getWorld().spawnParticle(particle, arrow.getLocation().add(0, .25, 0), amount, offset, offset, offset, speed);
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import net.Indyuce.mmoitems.MMOItems;
|
||||
import net.Indyuce.mmoitems.MMOUtils;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.Indyuce.mmoitems.listener.ElementListener;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.DamageType;
|
||||
import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
import net.mmogroup.mmolib.version.VersionSound;
|
||||
@ -47,9 +46,8 @@ public enum Element {
|
||||
if ((y += .07) >= 3)
|
||||
cancel();
|
||||
for (double k = 0; k < Math.PI * 2; k += Math.PI * 2 / 3)
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc.clone()
|
||||
.add(Math.cos(y * Math.PI + k) * (3 - y) / 2.5, y / 1.1, Math.sin(y * Math.PI + k) * (3 - y) / 2.5),
|
||||
Color.WHITE);
|
||||
loc.getWorld().spawnParticle(Particle.REDSTONE, loc.clone().add(Math.cos(y * Math.PI + k) * (3 - y) / 2.5,
|
||||
y / 1.1, Math.sin(y * Math.PI + k) * (3 - y) / 2.5), 1, new Particle.DustOptions(Color.WHITE, 1));
|
||||
}
|
||||
}
|
||||
}.runTaskTimer(MMOItems.plugin, 0, 1);
|
||||
@ -80,8 +78,8 @@ public enum Element {
|
||||
new ElementHandler() {
|
||||
public void elementAttack(CachedStats stats, ItemAttackResult result, LivingEntity target, double attack, double absolute) {
|
||||
target.getWorld().playSound(target.getLocation(), Sound.BLOCK_GRASS_BREAK, 2, 0);
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.BLOCK_CRACK, target.getLocation().add(0, .1, 0), 64, 1, 0, 1, 0,
|
||||
Material.DIRT);
|
||||
target.getWorld().spawnParticle(Particle.BLOCK_CRACK, target.getLocation().add(0, .1, 0), 64, 1, 0, 1,
|
||||
Material.DIRT.createBlockData());
|
||||
result.addDamage(absolute);
|
||||
|
||||
target.setVelocity(new Vector(0, 1, 0));
|
||||
@ -186,8 +184,8 @@ public enum Element {
|
||||
}
|
||||
|
||||
public ElementParticle(Particle particle, float speed, int amount, Material material) {
|
||||
display = (entity) -> MMOLib.plugin.getVersion().getWrapper().spawnParticle(particle,
|
||||
entity.getLocation().add(0, entity.getHeight() / 2, 0), amount, 0, 0, 0, speed, material);
|
||||
display = (entity) -> entity.getWorld().spawnParticle(particle, entity.getLocation().add(0, entity.getHeight() / 2, 0), amount, 0, 0, 0,
|
||||
speed, material.createBlockData());
|
||||
}
|
||||
|
||||
public void displayParticle(Entity entity) {
|
||||
|
@ -49,7 +49,7 @@ public class NewItemEdition implements Edition {
|
||||
* default chat edition feature
|
||||
*/
|
||||
new ChatEdition(this);
|
||||
MMOLib.plugin.getVersion().getWrapper().sendTitle(inv.getPlayer(), ChatColor.GOLD + "" + ChatColor.BOLD + "Item Creation", "See chat.", 10, 40, 10);
|
||||
inv.getPlayer().sendTitle(ChatColor.GOLD + "" + ChatColor.BOLD + "Item Creation", "See chat.", 10, 40, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -63,8 +63,7 @@ public class StatEdition implements Edition {
|
||||
* default chat edition feature
|
||||
*/
|
||||
new ChatEdition(this);
|
||||
MMOLib.plugin.getVersion().getWrapper().sendTitle(inv.getPlayer(), ChatColor.GOLD + "" + ChatColor.BOLD + "Item Edition", "See chat.", 10, 40,
|
||||
10);
|
||||
inv.getPlayer().sendTitle(ChatColor.GOLD + "" + ChatColor.BOLD + "Item Edition", "See chat.", 10, 40, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -15,7 +15,6 @@ import net.Indyuce.mmoitems.MMOItems;
|
||||
import net.Indyuce.mmoitems.MMOUtils;
|
||||
import net.Indyuce.mmoitems.api.ItemAttackResult;
|
||||
import net.Indyuce.mmoitems.api.player.PlayerStats.CachedStats;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.DamageType;
|
||||
import net.mmogroup.mmolib.api.item.NBTItem;
|
||||
|
||||
@ -46,11 +45,12 @@ public class ManaSpirit implements StaffAttackHandler {
|
||||
for (double item = 0; item < Math.PI * 2; item += Math.PI / 3.5) {
|
||||
Vector vec = MMOUtils.rotateFunc(new Vector(r * Math.cos(item), r * Math.sin(item), 0), loc);
|
||||
if (random.nextDouble() <= .6)
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(Particle.REDSTONE, loc.clone().add(vec), Color.AQUA);
|
||||
loc.getWorld().spawnParticle(Particle.REDSTONE, loc.clone().add(vec), 1, new Particle.DustOptions(Color.AQUA, 1));
|
||||
}
|
||||
for (Entity target : targets)
|
||||
if (MMOUtils.canDamage(stats.getPlayer(), loc, target)) {
|
||||
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.MAGIC).applyEffectsAndDamage(stats, nbt, (LivingEntity) target);
|
||||
new ItemAttackResult(attackDamage, DamageType.WEAPON, DamageType.MAGIC).applyEffectsAndDamage(stats, nbt,
|
||||
(LivingEntity) target);
|
||||
loc.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, loc, 0);
|
||||
cancel();
|
||||
return;
|
||||
|
@ -11,6 +11,7 @@ import org.bukkit.event.inventory.InventoryAction;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.Damageable;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import net.Indyuce.mmoitems.MMOItems;
|
||||
@ -20,7 +21,6 @@ import net.Indyuce.mmoitems.api.edition.StatEdition;
|
||||
import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate;
|
||||
import net.Indyuce.mmoitems.api.item.util.NamedItemStack;
|
||||
import net.Indyuce.mmoitems.stat.type.ItemStat;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
import net.mmogroup.mmolib.api.util.AltChar;
|
||||
import net.mmogroup.mmolib.version.VersionMaterial;
|
||||
|
||||
@ -132,8 +132,9 @@ public class UpgradingEdition extends EditionInventory {
|
||||
inv.setItem(24, successItem);
|
||||
|
||||
if (success > 0 && !template.getType().corresponds(Type.CONSUMABLE)) {
|
||||
ItemStack destroyOnFail = MMOLib.plugin.getVersion().getWrapper().generate(Material.FISHING_ROD, 30);
|
||||
ItemStack destroyOnFail = new ItemStack(Material.FISHING_ROD);
|
||||
ItemMeta destroyOnFailMeta = destroyOnFail.getItemMeta();
|
||||
((Damageable) destroyOnFailMeta).setDamage(30);
|
||||
destroyOnFailMeta.setDisplayName(ChatColor.GREEN + "Destroy on fail?");
|
||||
List<String> destroyOnFailLore = new ArrayList<>();
|
||||
destroyOnFailLore.add(ChatColor.GRAY + "When toggled on, the item will be");
|
||||
|
@ -47,7 +47,7 @@ public class ColorData implements StatData, RandomStatData {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{red=" + red + ",green=" + green + ",blue=" + blue + "}";
|
||||
return "{Red=" + red + ",Green=" + green + ",Blue=" + blue + "}";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,7 +20,6 @@ import net.Indyuce.mmoitems.particle.api.ParticleRunnable;
|
||||
import net.Indyuce.mmoitems.particle.api.ParticleType;
|
||||
import net.Indyuce.mmoitems.stat.data.random.RandomStatData;
|
||||
import net.Indyuce.mmoitems.stat.data.type.StatData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
|
||||
public class ParticleData implements StatData, RandomStatData {
|
||||
private final ParticleType type;
|
||||
@ -98,15 +97,14 @@ public class ParticleData implements StatData, RandomStatData {
|
||||
|
||||
public void display(Location location, int amount, float offsetX, float offsetY, float offsetZ, float speed) {
|
||||
if (isColorable(particle))
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(particle, location, amount, offsetX, offsetY, offsetZ, speed, 1, color);
|
||||
location.getWorld().spawnParticle(particle, location, amount, offsetX, offsetY, offsetZ, speed, new Particle.DustOptions(color, 1));
|
||||
else
|
||||
location.getWorld().spawnParticle(particle, location, amount, offsetX, offsetY, offsetZ, speed);
|
||||
}
|
||||
|
||||
public void display(Location location, Vector direction, float speed) {
|
||||
if (isColorable(particle))
|
||||
MMOLib.plugin.getVersion().getWrapper().spawnParticle(particle, location, 0, direction.getX(), direction.getY(), direction.getZ(), speed,
|
||||
1, color);
|
||||
location.getWorld().spawnParticle(particle, location, 0, direction.getX(), direction.getY(), direction.getZ(), speed, new Particle.DustOptions(color, 1));
|
||||
else
|
||||
location.getWorld().spawnParticle(particle, location, 0, direction.getX(), direction.getY(), direction.getZ(), speed);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user