mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-24 09:51:21 +01:00
Fixes 1405, though that error should only happen if you fire something insanely far away from the spawn or idk (Causing some X co-ordinate to be infinity)
This commit is contained in:
parent
cdda1b6179
commit
5eeaba43c7
@ -10,6 +10,7 @@ import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem;
|
|||||||
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
|
import net.Indyuce.mmoitems.api.item.mmoitem.VolatileMMOItem;
|
||||||
import net.Indyuce.mmoitems.api.player.PlayerData;
|
import net.Indyuce.mmoitems.api.player.PlayerData;
|
||||||
import net.Indyuce.mmoitems.api.util.message.Message;
|
import net.Indyuce.mmoitems.api.util.message.Message;
|
||||||
|
import net.Indyuce.mmoitems.stat.Enchants;
|
||||||
import net.Indyuce.mmoitems.stat.GemUpgradeScaling;
|
import net.Indyuce.mmoitems.stat.GemUpgradeScaling;
|
||||||
import net.Indyuce.mmoitems.stat.data.GemSocketsData;
|
import net.Indyuce.mmoitems.stat.data.GemSocketsData;
|
||||||
import net.Indyuce.mmoitems.stat.data.GemstoneData;
|
import net.Indyuce.mmoitems.stat.data.GemstoneData;
|
||||||
@ -81,6 +82,11 @@ public class GemStone extends UseItem {
|
|||||||
if (called.isCancelled())
|
if (called.isCancelled())
|
||||||
return new ApplyResult(ResultType.NONE);
|
return new ApplyResult(ResultType.NONE);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* To not clear enchantments put by players
|
||||||
|
*/
|
||||||
|
Enchants.separateEnchantments(targetMMO);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Gem stone can be successfully applied. apply stats then abilities and
|
* Gem stone can be successfully applied. apply stats then abilities and
|
||||||
* permanent effects. also REGISTER gem stone in the item gem stone
|
* permanent effects. also REGISTER gem stone in the item gem stone
|
||||||
|
@ -72,12 +72,14 @@ public class Staff extends UntargetedWeapon {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
double power = MMOItems.plugin.getConfig().getDouble("item-ability.staff.power");
|
double power = MMOItems.plugin.getConfig().getDouble("item-ability.staff.power");
|
||||||
Vector vec = target.getLocation().toVector().subtract(getPlayer().getLocation().toVector()).setY(0).normalize().multiply(1.75 * power)
|
|
||||||
.setY(.65 * power);
|
try {
|
||||||
|
Vector vec = target.getLocation().toVector().subtract(getPlayer().getLocation().toVector()).setY(0).normalize().multiply(1.75 * power).setY(.65 * power);
|
||||||
target.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, target.getLocation().add(0, 1, 0), 0);
|
target.getWorld().spawnParticle(Particle.EXPLOSION_LARGE, target.getLocation().add(0, 1, 0), 0);
|
||||||
target.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, target.getLocation().add(0, 1, 0), 16, 0, 0, 0, .1);
|
target.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, target.getLocation().add(0, 1, 0), 16, 0, 0, 0, .1);
|
||||||
target.setVelocity(vec);
|
target.setVelocity(vec);
|
||||||
target.playEffect(EntityEffect.HURT);
|
target.playEffect(EntityEffect.HURT);
|
||||||
target.getWorld().playSound(target.getLocation(), Sound.BLOCK_ANVIL_LAND, 1, 2);
|
target.getWorld().playSound(target.getLocation(), Sound.BLOCK_ANVIL_LAND, 1, 2);
|
||||||
|
} catch (IllegalArgumentException ignored) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user