Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bloodHelix;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
- import org.bukkit.entity.Entity;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.Action;
- import org.bukkit.event.player.PlayerInteractEvent;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.plugin.Plugin;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- import org.bukkit.scheduler.BukkitRunnable;
- import mainInfo.MainClass;
- import net.minecraft.server.v1_12_R1.EnumParticle;
- import net.minecraft.server.v1_12_R1.PacketPlayOutWorldParticles;
- public class BloodHelix implements Listener {
- static Plugin plugin = MainClass.getPlugin(MainClass.class);
- @EventHandler
- public void helix(PlayerInteractEvent event) {
- Action a = event.getAction();
- Player player = event.getPlayer();
- ItemStack mainhand = player.getInventory().getItemInMainHand();
- if(a == Action.RIGHT_CLICK_AIR || a == Action.RIGHT_CLICK_BLOCK) {
- if(!mainhand.hasItemMeta()) return;
- else if(mainhand.getType() == Material.DIAMOND) {
- if(mainhand.getItemMeta().getDisplayName().equalsIgnoreCase("Dimension Warp")) {
- player.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 400, 10));
- player.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 400, 1));
- player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 400, 1));
- for (Entity entity : Bukkit.getWorld("warmode").getEntities()) {
- if (entity instanceof Player) {
- Player p = (Player) entity;
- new BukkitRunnable() {
- double phi = 0;
- @Override
- public void run() {
- phi = phi + Math.PI/8;
- double x, y, z;
- Location loc = p.getLocation();
- for(int f=0; f<20; f=f+1) {
- for (double t = 0; t <= 2*Math.PI; t = t + Math.PI/16) {
- for (double i = 0; i <= 1; i = i + 1) {
- float red = 255;
- float green = 10;
- float blue = 10;
- x = 0.4*(2*Math.PI-t)*0.5*Math.cos(t + phi + i*Math.PI);
- y = 0.5*t;
- z = 0.4*(2*Math.PI-t)*0.5*Math.sin(t + phi + i*Math.PI);
- PacketPlayOutWorldParticles particles = new PacketPlayOutWorldParticles(EnumParticle.SPELL_MOB, true, (float) (loc.getX() + x), (float) (loc.getY() + y), (float) (loc.getZ() + z), red, green, blue, (float)255, 0, 40);
- ((CraftPlayer) p).getHandle().playerConnection.sendPacket(particles);
- }
- }
- }
- //Cancel Event (this.cancel();)
- }
- }.runTaskTimerAsynchronously(plugin, 0, 3);
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment