Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.capz.helix;
- import org.bukkit.Bukkit;
- import org.bukkit.ChatColor;
- import org.bukkit.Location;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer;
- 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.event.player.PlayerJoinEvent;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.util.Vector;
- import de.slikey.effectlib.EffectLib;
- import de.slikey.effectlib.EffectManager;
- public class version2 extends JavaPlugin implements Listener{
- EffectManager em;
- public void onEnable() {
- Bukkit.getPluginManager().registerEvents(this, this);
- EffectLib lib = EffectLib.instance();
- em = new EffectManager(lib);
- }
- public boolean onCommand(CommandSender sender, Command cmd, String cmdLabel, String[] args) {
- Player player = (Player)sender;
- if(cmd.getLabel().equalsIgnoreCase("flamey") && sender instanceof Player) {
- flamey(player);
- }
- return true;
- }
- private void flamey(Player player) {
- Location l = player.getLocation();
- double radius = 2;
- double maxHeight = 10;
- for(int i1 = 0; i1 < 1; i1++) {
- for(double y = 0; y < 2; y+= 0.1, radius--) {
- double x = Math.cos(y * radius) * 0.4; // Basically it is saying 3 * Math.cosine and sine, to make a helix around eachother.
- double z = Math.sin(y * radius) * 0.8;
- net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles("flame",
- ((float) (l.getX() + x)),
- ((float) (l.getY() + y)),
- ((float) (l.getZ() + z)),
- 0, 0, 0, 1, 0);
- ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
- }
- }
- }
- @EventHandler
- public void interact(PlayerInteractEvent e) {
- final Player player = e.getPlayer();
- if(e.getAction() == Action.LEFT_CLICK_AIR) {
- Location l = player.getEyeLocation();
- Vector direction = l.getDirection().normalize();
- Vector vector = new Vector();
- double radius = 1;
- double maxHeight = 10;
- double t = 0;
- t = t + Math.PI / 8;
- for(int i1 = 0; i1 < 80; i1++) {
- double y = t;
- double x = direction.getX(); // Basically it is saying 3 * Math.cosine and sine, to make a helix around eachother.
- double z = direction.getZ();
- l.add(x, y, z);
- net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles("flame",
- ((float) (l.getX() + 0.5)),
- ((float) (l.getY())),
- ((float) (l.getZ() + 0.5)),
- 0, 0, 0, 1, 0);
- ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
- }
- }
- }
- @EventHandler
- public void onPlayerJoin(final PlayerJoinEvent event) {
- new Runnable() {
- @Override
- public void run() {
- Player player = event.getPlayer();
- Location l = player.getLocation();
- double radius = 2;
- double maxHeight = 10;
- for(int i1 = 0; i1 < 20; i1++) {
- for(double y = 0; y < 5; y+= 0.005) {
- double x = Math.cos(y * radius); // Basically it is saying 3 * Math.cosine and sine, to make a helix around eachother.
- double z = Math.sin(y * radius);
- net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles packet = new net.minecraft.server.v1_7_R3.PacketPlayOutWorldParticles("flame",
- ((float) (l.getX()
- + x)),
- ((float) (l.getY()
- + y)),
- ((float) (l.getZ()
- + z)),
- 0, 0, 0, 1, 0);
- ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
- }
- }
- }
- };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement