mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-29 16:15:17 +01:00
commit
893d3eefb5
@ -7,6 +7,7 @@ import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
|
|||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@ -19,9 +20,6 @@ public class Marksman extends EcoEnchant {
|
|||||||
}
|
}
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onMarksmanShoot(@NotNull final ProjectileLaunchEvent event) {
|
public void onMarksmanShoot(@NotNull final ProjectileLaunchEvent event) {
|
||||||
if (event.getEntityType() != EntityType.ARROW) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(event.getEntity().getShooter() instanceof Player)) {
|
if (!(event.getEntity().getShooter() instanceof Player)) {
|
||||||
return;
|
return;
|
||||||
@ -37,10 +35,7 @@ public class Marksman extends EcoEnchant {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(event.getEntity() instanceof Arrow)) {
|
Projectile a = event.getEntity();
|
||||||
return;
|
|
||||||
}
|
|
||||||
Arrow a = (Arrow) event.getEntity();
|
|
||||||
a.setGravity(false);
|
a.setGravity(false);
|
||||||
|
|
||||||
int ticks = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "remove-arrow-after-ticks");
|
int ticks = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "remove-arrow-after-ticks");
|
||||||
|
Loading…
Reference in New Issue
Block a user