Trouble Using EffectLib! Please Help! :(

Discussion in 'Plugin Help/Development/Requests' started by mkezar, Jun 24, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    mkezar

    Could that be the problem? What should I use then instead of entityeffect? There's one more thing I need to do. I forgot to change the build path to the newest version you gave to me an hour ago. So let me do that as soon as I get home
     
  2. Offline

    NathanWolf

    It's not a problem, it's an indication that your server is running with an outdated version of EffectLib.

    If you are compiling EffectLib into your plugin, then the build path could be the issue- otherwise, probably not. It only matters what code is actually running on your server.

    That should come from the EffectLib.jar that you've put in your plugins folder.

    If you've chosen to compile EffectLib into your plugin, make sure you're using Maven and shading it properly.
     
  3. Offline

    mkezar

    yeah I haven't compiled it into my plugin because I have never used Maven before. :p

    EDIT: So is there no way to fix this (besides using Maven)? and am I doing everything right? Because whenever I decide to do anything (whether trying new plugins or using Libs) i've always done something wrong :p
     
  4. Offline

    NathanWolf

    It really just looks like you are still running the old version of EffectLib. If you want, pastebin your entire server log and put the link here and I can double check that.
     
  5. Offline

    mkezar

    @NathanWolf I've had this problem in the past. Where I have a new version but it doesn't recognize it. Let me copy my code and delete EffectLib completely and remove it from my build path. Then I will re-add it. I think it might be a bug in Eclipse.

    EDIT: Didn't Work :p Let me try again

    EDIT for the EDIT: I found a version of EffectLib 3.2 not in my plugins folder but in my server folder. i deleted it. Let me test it now

    EDIT for the EDIT's EDIT: That Didn't do anything. :( *sigh*
     
    Last edited: Jun 26, 2015
  6. Offline

    NathanWolf

    Did you want to paste you server logs, please?
     
  7. Offline

    mkezar

    Sure.
    Full Log (open)


    C:\Users\Mkezar\Desktop\Server>java -Xmx2048m -XX:MaxPermSize=256 -jar craftbukkit-1.8-R0.1-SNAPSHOT.jar -o true
    Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256; support was removed in 8.0
    Loading libraries, please wait...
    [15:25:39 INFO]: Starting minecraft server version 1.8
    [15:25:39 INFO]: Loading properties
    [15:25:40 INFO]: Default game type: SURVIVAL
    [15:25:40 INFO]: Generating keypair
    [15:25:40 INFO]: Starting Minecraft server on *:25565
    [15:25:41 INFO]: This server is running CraftBukkit version git-Bukkit-1092acb (MC: 1.8) (Implementing API version 1.8-R0.1-SNAPSHOT)
    [15:25:43 INFO]: [FarmWars] Loading FarmWars v1.0
    [15:25:43 INFO]: [MkProtect] Loading MkProtect v1.0
    [15:25:43 INFO]: [Effect Library] Loading EffectLib v3.4
    [15:25:43 INFO]: [Launchpads] Loading Launchpads v1.0
    [15:25:43 INFO]: [OldAge] Loading OldAge v6.5
    [15:25:43 INFO]: [Fusrodahs] Loading Fusrodahs v1.0
    [15:25:43 INFO]: [MegaWallsKits] Loading MegaWallsKits v1.0
    [15:25:43 INFO]: [Perk] Loading Perk v1.0
    [15:25:43 INFO]: [TeamZombieFight] Loading TeamZombieFight v1.0
    [15:25:43 INFO]: [ParticleCraft] Loading ParticleCraft v1.0
    [15:25:43 INFO]: [Multiverse-Core] Loading Multiverse-Core v2.4-b527
    [15:25:43 INFO]: Preparing level "world"
    [15:25:43 INFO]: Preparing start region for level 0 (Seed: 4769229038942337798)
    [15:25:44 INFO]: Preparing spawn area: 27%
    [15:25:45 INFO]: Preparing spawn area: 52%
    [15:25:46 INFO]: Preparing start region for level 1 (Seed: 3230499705986462673)
    [15:25:47 INFO]: Preparing spawn area: 50%
    [15:25:48 INFO]: Preparing start region for level 2 (Seed: -4636006247282337956)
    [15:25:48 INFO]: [FarmWars] Enabling FarmWars v1.0
    [15:25:48 INFO]: [MkProtect] Enabling MkProtect v1.0
    [15:25:48 INFO]: [Effect Library] Enabling EffectLib v3.4
    [15:25:48 INFO]: [Launchpads] Enabling Launchpads v1.0
    [15:25:48 INFO]: [OldAge] Enabling OldAge v6.5
    [15:25:48 INFO]: [Fusrodahs] Enabling Fusrodahs v1.0
    [15:25:48 INFO]: [MegaWallsKits] Enabling MegaWallsKits v1.0
    [15:25:48 INFO]: [Perk] Enabling Perk v1.0
    [15:25:48 INFO]: [TeamZombieFight] Enabling TeamZombieFight v1.0
    [15:25:48 INFO]: [ParticleCraft] Enabling ParticleCraft v1.0
    [15:25:48 INFO]: No ParticleCraft folder, must create one!
    [15:25:48 INFO]: ParticleCraft Folder Not Created...
    [15:25:48 INFO]: [Multiverse-Core] Enabling Multiverse-Core v2.4-b527
    [15:25:48 INFO]: [Multiverse-Core] - Version 2.4-b527 (API v14) Enabled - By Rigby, fernferret, lithium3141 and main--
    [15:25:48 INFO]: [AllPay] - Version 10.0 - using only an item based economy for Multiverse-Core v2.4-b527
    [15:25:54 INFO]: [Multiverse-Core] Loading World & Settings - 'world' - Env: NORMAL - Type: NORMAL & seed: 4769229038942337798
    [15:25:55 INFO]: [Multiverse-Core] Loading World & Settings - 'world_nether' - Env: NETHER - Type: NORMAL & seed: 3230499705986462673
    [15:25:55 INFO]: [Multiverse-Core] Loading World & Settings - 'world_the_end' - Env: THE_END - Type: NORMAL & seed: -4636006247282337956
    [15:25:56 INFO]: [Multiverse-Core] Loading World & Settings - 'Adrenaline' - Env: NORMAL - Type: NORMAL & seed: 5544408468266927710
    [15:25:56 INFO]: Preparing start region for level 3 (Seed: 5544408468266927710)
    [15:25:57 INFO]: Preparing spawn area for Adrenaline, 77%
    [15:25:57 INFO]: [Multiverse-Core] 4 - World(s) loaded.
    [15:25:57 INFO]: Server permissions file permissions.yml is empty, ignoring it
    [15:26:03 INFO]: Done (19.701s)! For help, type "help" or "?"
    [15:26:17 INFO]: UUID of player Mkezar is 8b60c3d9-06f4-42a1-b7fd-576ea671c65a
    [15:26:18 INFO]: Mkezar[/127.0.0.1:7043] logged in with entity id 505 at ([Adrenaline] 285.83697958348336, 78.03042452050047, 420.52473489601266)
    [15:26:24 INFO]: Mkezar issued server command: /mwpig
    >


    Im not getting any error. But it doesn't do any particle effect. Let me re-add the Join event bleeding thing and ill EDIT this post and tahg you so you know @NathanWolf

    EDIT: WAIT!!! I bled out! the particles were there and everything! GOOD SIGN! :D now the only thing that wont work is my command that spawns the ShieldEffect @NathanWolf
    Here it is! My block of code that wont even run the println. Am I doing it wrong?
    Code:
    if(commandLabel.equalsIgnoreCase("mwpig")) {
                     ShieldEntityEffect shieldEffect = new ShieldEntityEffect(effectManager, player.getPlayer());
                        // period * iterations = time of effect
                     System.out.println("Test");
                        shieldEffect.iterations = 15 * 20;
                        shieldEffect.start();
                        effectManager.disposeOnTermination();
                }
     
    Last edited: Jun 26, 2015
  8. Offline

    NathanWolf

    Yay!

    As for your command- is that just in onCommand? Or have you registered a command executor? Put your command in your plugin.yml?

    Lots of random reasons why commands may not work, that's what I can think of off the top of my head anyway :)
     
  9. Offline

    mkezar

    Multiple commands in onCommand (They all work except this one) they are all in plugin YML @NathanWolf

    EDIT: ok @NathanWolf. There was a tiny bug with my onCommand. so I deleted it, and re-added it. whenever i run the code unfortunatly, i get this:
    Stacktrace (open)

    [19:10:21 INFO]: Mkezar issued server command: /mwpig
    [19:10:21 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'mwpig' in plugin MegaWallsKits v1.0
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:624) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1058) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:919) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:37) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:9) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_31]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_31]
    at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:643) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:284) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:598) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:506) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_31]
    Caused by: java.lang.NoClassDefFoundError: net/minecraft/util/org/apache/commons/lang3/Validate
    at de.slikey.effectlib.effect.EntityEffect.<init>(EntityEffect.java:16) ~[?:?]
    at de.slikey.effectlib.effect.ShieldEntityEffect.<init>(ShieldEntityEffect.java:33) ~[?:?]
    at plugins.mkezar.Kits.onCommand(Kits.java:84) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    ... 14 more
    Caused by: java.lang.ClassNotFoundException: net.minecraft.util.org.apache.commons.lang3.Validate
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:67) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:62) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_31]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_31]
    at de.slikey.effectlib.effect.EntityEffect.<init>(EntityEffect.java:16) ~[?:?]
    at de.slikey.effectlib.effect.ShieldEntityEffect.<init>(ShieldEntityEffect.java:33) ~[?:?]
    at plugins.mkezar.Kits.onCommand(Kits.java:84) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    ... 14 more


    Wait! Does EffectLib not work with ParticleEffect? If so, how do i spawn a particle with EffectLib @NathanWolf (if I can)

    Wait! I noticed something @NathanWolf. I took the join event and replaced the bleeding effect with the Shield effect. Then it gave me a major error. Could it be a problem with only the Shield Effect? Im thinking that the others might be fine but Shield Effect might be broken.
     
    Last edited by a moderator: Jun 26, 2015
  10. Offline

    NathanWolf

    Can you post your current code, and the error you get?

    I just tried ShieldEffect and it seems to be working fine. My plugin is config-driven, so it's a little different from what you're doing, but you ought to be able to just spawn out BleedEffect for ShieldEffect, I think.
     
  11. Offline

    mkezar

    Sure ill post the code.

    Now here is my CURRENT code. The commands that have ParticleEffects keep combating with EffectLib. So is there any way to spawn a particle using EffectLib so 2 libraries don't combat?

    Code:
    Code:
    package plugins.mkezar;
    
    import net.minecraft.server.v1_8_R1.Vec3D;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.Sound;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
    import org.bukkit.entity.Arrow;
    import org.bukkit.entity.Entity;
    import org.bukkit.entity.Firework;
    import org.bukkit.entity.Player;
    import org.bukkit.entity.WitherSkull;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.HandlerList;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.scheduler.BukkitRunnable;
    import org.bukkit.util.Vector;
    
    import de.slikey.effectlib.Effect;
    import de.slikey.effectlib.EffectLib;
    import de.slikey.effectlib.EffectManager;
    import de.slikey.effectlib.effect.BleedEffect;
    import de.slikey.effectlib.effect.BleedEntityEffect;
    import de.slikey.effectlib.effect.CircleEffect;
    import de.slikey.effectlib.effect.ShieldEffect;
    import de.slikey.effectlib.effect.ShieldEntityEffect;
    import de.slikey.effectlib.util.ParticleEffect;
    
    public class Kits extends JavaPlugin implements Listener {
        private EffectManager effectManager;
     
        @Override
        public void onEnable() {
         Bukkit.getPluginManager().registerEvents(this, this);
             EffectLib lib = EffectLib.instance();
                effectManager = new EffectManager(lib);
          
        }
        @Override
        public void onDisable() {
             Bukkit.getServer().getPluginManager().registerEvents(this, this);
              effectManager.dispose();
                HandlerList.unregisterAll((Listener) this);
             
          
        }
     
        @SuppressWarnings("deprecation")
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
            final Player player = (Player)sender;
         
            if(commandLabel.equalsIgnoreCase("mwzombie")) {
                ParticleEffect.HEART.display(0.1f,0.3f,0.5f,0.4f,20,player.getLocation(),1.0);
                player.playSound(player.getLocation(),Sound.LEVEL_UP,1,1);
                Bukkit.broadcastMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "You Were Healed By " + player.getName() + "'s Heal Skill");
            }
         
            if(commandLabel.equalsIgnoreCase("mwcreeper")) {
                Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
                     public void run() {
                         ParticleEffect.EXPLOSION_HUGE.display(0.1f,0.3f,0.5f,0.4f,20,player.getLocation(),25.0);
                         player.playSound(player.getLocation(),Sound.EXPLODE,1,1);
                         System.out.println("this is being ran");
                         }
                }, 30L);
                player.playSound(player.getLocation(),Sound.CREEPER_HISS,1,50);
            }
         
            if(commandLabel.equalsIgnoreCase("mwskeleton")) {
                Arrow A = player.launchProjectile(Arrow.class);
                A.setVelocity(player.getEyeLocation().getDirection().multiply(1));
             
            }
            if(commandLabel.equalsIgnoreCase("mwpig")) {
                ShieldEntityEffect shieldEffect = new ShieldEntityEffect(effectManager, player.getPlayer());
                // period * iterations = time of effect
             System.out.println("Test");
                shieldEffect.iterations = 15 * 20;
                shieldEffect.start();
                effectManager.disposeOnTermination();
            }
       
            if(commandLabel.equalsIgnoreCase("mwdreadlord")) {
                WitherSkull WitherSkull = player.getPlayer().launchProjectile(WitherSkull.class);
                WitherSkull.setShooter(player.getPlayer());
                WitherSkull.setVelocity(player.getPlayer().getLocation().getDirection().multiply(1));
             
             
                WitherSkull WitherSkull2 = player.getPlayer().launchProjectile(WitherSkull.class);
                WitherSkull2.setShooter(player.getPlayer());
                WitherSkull2.setVelocity(player.getPlayer().getLocation().getDirection().multiply(1));
             
                WitherSkull WitherSkull3 = player.getPlayer().launchProjectile(WitherSkull.class);
                WitherSkull3.setShooter(player.getPlayer());
                WitherSkull3.setVelocity(player.getPlayer().getLocation().getDirection().multiply(1));
             
                player.playSound(player.getLocation(),Sound.WITHER_SHOOT,1,1);
            }
         
         
            if(commandLabel.equalsIgnoreCase("mwspider")) {
                //onCommand stuff
             
                if(sender instanceof Player) {
                 
                     player.getPlayer().setVelocity(player.getPlayer().getLocation().getDirection().multiply(5));
                     player.getPlayer().setVelocity(new Vector(player.getPlayer().getVelocity().getX(), 1.0D, player.getPlayer().getVelocity().getZ()));
                  
                     player.playSound(player.getLocation(),Sound.SPIDER_DEATH,2,20);
                  
                 
             
         
                }
         
            }
            return false;
         
        }
        @EventHandler
        public void onPlayerJoin(final PlayerJoinEvent event) {
            // Create the Effect and attach it to the Player
            Player player = event.getPlayer();
            BleedEffect bleedEffect = new BleedEffect(effectManager);
            bleedEffect.setEntity(event.getPlayer());
    
            // Add a callback to the effect
         
            bleedEffect.callback = new Runnable() {
    
                @Override
                public void run() {
                    event.getPlayer().sendMessage("You bled out..");
                    event.getPlayer().setHealth(0d);
                }
    
            };
            // Bleeding takes 15 seconds
            // period * iterations = time of effect
            bleedEffect.iterations = 15 * 20;
            bleedEffect.start();
        }
     
    
    }
    
    Here you go! @NathanWolf

    And now the problem is in this section of the code:

    Code:
    if(commandLabel.equalsIgnoreCase("mwpig")) {
                ShieldEntityEffect shieldEffect = new ShieldEntityEffect(effectManager, player.getPlayer());
                // period * iterations = time of effect
             System.out.println("Test");
                shieldEffect.iterations = 15 * 20;
                shieldEffect.start();
                effectManager.disposeOnTermination();
            }
    And then another problem is when i replace all BleedEffects with ShieldEntityEffect:

    Code:
    @EventHandler
        public void onPlayerJoin(final PlayerJoinEvent event) {
            // Create the Effect and attach it to the Player
            Player player = event.getPlayer();
            BleedEffect bleedEffect = new BleedEffect(effectManager);
            bleedEffect.setEntity(event.getPlayer());
    
            // Add a callback to the effect
           
            bleedEffect.callback = new Runnable() {
    
                @Override
                public void run() {
                    event.getPlayer().sendMessage("You bled out..");
                    event.getPlayer().setHealth(0d);
                }
    
            };
            // Bleeding takes 15 seconds
            // period * iterations = time of effect
            bleedEffect.iterations = 15 * 20;
            bleedEffect.start();
        }
     
  12. Offline

    NathanWolf

  13. Offline

    mkezar

    I feel so stupid now!!! Well, I'll test this in the morning! Let's hope all goes well @NathanWolf! :)

    Well @NathanWolf, I got the results... Not good. I changed the ShieldEntityEffect to ShieldEffect and removed unnecessary arguments. I reloaded and I got this error:
    Stacktrace (open)

    [12:39:54 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'mwpig' in plugin MegaWallsKits v1.0
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:624) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1058) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:919) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:37) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:9) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_31]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_31]
    at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:643) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:284) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:598) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:506) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_31]
    Caused by: java.lang.IllegalStateException: EffectManager is disposed and not able to accept any effects.
    at de.slikey.effectlib.EffectManager.start(EffectManager.java:73) ~[?:?]
    at de.slikey.effectlib.Effect.start(Effect.java:211) ~[?:?]
    at plugins.mkezar.Kits.onCommand(Kits.java:88) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    ... 14 more


    Good news is, it doesn't mention Validate anymore! :D well, I don't think...

    I removed ParticleEffect and let EffectLib spawn the particles. I got this error every time I try to spawn a particle:
    In the stacktrace I use 2 commands. 1 spawning a huge explosion and the other, hearts.

    Another Stacktrace (open)

    [12:40:20 INFO]: Mkezar issued server command: /mwcreeper
    [12:40:22 WARN]: [MegaWallsKits] Task #307 for MegaWallsKits v1.0 generated an exception
    java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()[Lorg/bukkit/entity/Player;
    at de.slikey.effectlib.util.ParticleEffect$ParticlePacket.sendTo(ParticleEffect.java:1209) ~[?:?]
    at de.slikey.effectlib.util.ParticleEffect.display(ParticleEffect.java:590) ~[?:?]
    at plugins.mkezar.Kits$1.run(Kits.java:70) ~[?:?]
    at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftTask.run(CraftTask.java:53) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:349) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:653) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:284) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:598) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:506) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_31]
    [12:40:35 INFO]: Mkezar issued server command: /mwzombie
    [12:40:35 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'mwzombie' in plugin MegaWallsKits v1.0
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:624) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1058) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:919) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:37) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:9) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_31]
    at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_31]
    at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:643) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:284) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:598) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:506) [craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_31]
    Caused by: java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()[Lorg/bukkit/entity/Player;
    at de.slikey.effectlib.util.ParticleEffect$ParticlePacket.sendTo(ParticleEffect.java:1209) ~[?:?]
    at de.slikey.effectlib.util.ParticleEffect.display(ParticleEffect.java:590) ~[?:?]
    at plugins.mkezar.Kits.onCommand(Kits.java:62) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit-1.8-R0.1-SNAPSHOT.jar:git-Bukkit-1092acb]
    ... 14 more


    Here is my new code:
    Code:
    package plugins.mkezar;
    
    import net.minecraft.server.v1_8_R1.Vec3D;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.Sound;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.craftbukkit.v1_8_R1.entity.CraftEntity;
    import org.bukkit.entity.Arrow;
    import org.bukkit.entity.Entity;
    import org.bukkit.entity.Firework;
    import org.bukkit.entity.Player;
    import org.bukkit.entity.WitherSkull;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.HandlerList;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.scheduler.BukkitRunnable;
    import org.bukkit.util.Vector;
    
    import de.slikey.effectlib.Effect;
    import de.slikey.effectlib.EffectLib;
    import de.slikey.effectlib.EffectManager;
    import de.slikey.effectlib.effect.BleedEffect;
    import de.slikey.effectlib.effect.BleedEntityEffect;
    import de.slikey.effectlib.effect.CircleEffect;
    import de.slikey.effectlib.effect.ShieldEffect;
    import de.slikey.effectlib.effect.ShieldEntityEffect;
    import de.slikey.effectlib.util.ParticleEffect;
    
    public class Kits extends JavaPlugin implements Listener {
        private EffectManager effectManager;
       
        @Override
        public void onEnable() {
         Bukkit.getPluginManager().registerEvents(this, this);
             EffectLib lib = EffectLib.instance();
                effectManager = new EffectManager(lib);
            
        }
        @Override
        public void onDisable() {
             Bukkit.getServer().getPluginManager().registerEvents(this, this);
              effectManager.dispose();
                HandlerList.unregisterAll((Listener) this);
               
            
        }
       
        @SuppressWarnings("deprecation")
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
            final Player player = (Player)sender;
           
            if(commandLabel.equalsIgnoreCase("mwzombie")) {
                ParticleEffect.HEART.display(0.1f,0.3f,0.5f,0.4f,20,player.getLocation(),1.0);
                player.playSound(player.getLocation(),Sound.LEVEL_UP,1,1);
                Bukkit.broadcastMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "You Were Healed By " + player.getName() + "'s Heal Skill");
            }
           
            if(commandLabel.equalsIgnoreCase("mwcreeper")) {
                Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
                     public void run() {
                         ParticleEffect.EXPLOSION_HUGE.display(0.1f,0.3f,0.5f,0.4f,20,player.getLocation(),25.0);
                         player.playSound(player.getLocation(),Sound.EXPLODE,1,1);
                         System.out.println("this is being ran");
                         }
                }, 30L);
                player.playSound(player.getLocation(),Sound.CREEPER_HISS,1,50);
            }
           
            if(commandLabel.equalsIgnoreCase("mwskeleton")) {
                Arrow A = player.launchProjectile(Arrow.class);
                A.setVelocity(player.getEyeLocation().getDirection().multiply(1));
               
            }
            if(commandLabel.equalsIgnoreCase("mwpig")) {
                ShieldEffect shieldEffect = new ShieldEffect(effectManager);
                // period * iterations = time of effect
             System.out.println("Test");
                shieldEffect.iterations = 15 * 20;
                shieldEffect.start();
                effectManager.disposeOnTermination();
            }
         
            if(commandLabel.equalsIgnoreCase("mwdreadlord")) {
                WitherSkull WitherSkull = player.getPlayer().launchProjectile(WitherSkull.class);
                WitherSkull.setShooter(player.getPlayer());
                WitherSkull.setVelocity(player.getPlayer().getLocation().getDirection().multiply(1));
               
               
                WitherSkull WitherSkull2 = player.getPlayer().launchProjectile(WitherSkull.class);
                WitherSkull2.setShooter(player.getPlayer());
                WitherSkull2.setVelocity(player.getPlayer().getLocation().getDirection().multiply(1));
               
                WitherSkull WitherSkull3 = player.getPlayer().launchProjectile(WitherSkull.class);
                WitherSkull3.setShooter(player.getPlayer());
                WitherSkull3.setVelocity(player.getPlayer().getLocation().getDirection().multiply(1));
               
                player.playSound(player.getLocation(),Sound.WITHER_SHOOT,1,1);
            }
           
           
            if(commandLabel.equalsIgnoreCase("mwspider")) {
                //onCommand stuff
               
                if(sender instanceof Player) {
                   
                     player.getPlayer().setVelocity(player.getPlayer().getLocation().getDirection().multiply(5));
                     player.getPlayer().setVelocity(new Vector(player.getPlayer().getVelocity().getX(), 1.0D, player.getPlayer().getVelocity().getZ()));
                    
                     player.playSound(player.getLocation(),Sound.SPIDER_DEATH,2,20);
                    
                   
               
           
                }
           
            }
            return false;
           
        }
        @EventHandler
        public void onPlayerJoin(final PlayerJoinEvent event) {
            // Create the Effect and attach it to the Player
            Player player = event.getPlayer();
            BleedEffect bleedEffect = new BleedEffect(effectManager);
            bleedEffect.setEntity(event.getPlayer());
    
            // Add a callback to the effect
           
            bleedEffect.callback = new Runnable() {
    
                @Override
                public void run() {
                    event.getPlayer().sendMessage("You bled out..");
                    event.getPlayer().setHealth(0d);
                }
    
            };
            // Bleeding takes 15 seconds
            // period * iterations = time of effect
            bleedEffect.iterations = 15 * 20;
            bleedEffect.start();
        }
       
    
    }
    
    I'm an error type person! :p

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
  14. Offline

    NathanWolf

    Don't use "effectManager.disposeOnTermination()" - just take that line out. That means you want to dispose of the entire lib after it finishes one effect.

    I think this is the cause of your first error.

    The second error, looks like you are still building against ParticleLib, and also you are building against CraftBukkit.. I think. The getOnlinePlayers thing is a known issue that has to do with your dependencies- if you don't need to be building against CraftBukkit, remove it and only build against the bukkit api.
     
  15. Offline

    mkezar

    @NathanWolf
    Good news and bad news:

    The good news is! my shield bubble wont give me an error! itll run the println! but it wont display the shieldeffect :/ like, i cant see it but it should be working :/ my particles is set to all and stuff. Well at least this is a start! :p

    Bad news. I have no idea what you meant when you said this :p
     
  16. Offline

    NathanWolf

    Well if you are not getting that getOnlinePlayers error anymore than I guess you can ignore that second part.. but I'm also at a loss to how it could be not working but still not show any errors :(
     
  17. Offline

    mkezar

    I'm so confused... could it be a tiny problem in my code that we don't see? :(
     
  18. Offline

    NathanWolf

    I'm not sure how this is even building :|

    Code:
    import de.slikey.effectlib.effect.BleedEffect;
    import de.slikey.effectlib.effect.BleedEntityEffect;
    import de.slikey.effectlib.effect.CircleEffect;
    import de.slikey.effectlib.effect.ShieldEffect;
    import de.slikey.effectlib.effect.ShieldEntityEffect;
    Unless you're building against two different versions of EffectLib, there's no way that would compile.

    Do you use an IDE, like Eclipse? Several of the errors you've had should be things your IDE shows you (red underlines) or at the very least compile-time errors, like something you should see before you ever get to running.

    Check your build path- I'm not sure how to do that in Eclipse, I think in the project settings. Or if you use Maven, let me know. I'm guessing you've got more than one EffectLib version in there, and possibly CraftBukkit.jar or whatever you're building against that may not be needed.

    You should only build against the Bukkit API jar and one version of EffectLib- the same one you're running with.
     
  19. Offline

    mkezar

    I use Eclipse and I have no red underlines. my build path has CraftBukkit 1.8 and Effectlib 3.4 Thats It.
    @NathanWolf
    I removed the unused imports and im going to test it
     
  20. Offline

    NathanWolf

    If you are not using NMS or CraftBukkit classes, it'd be best to build against the Bukkit API.

    I think building against the server jar itself can get you into trouble, along the lines of that getPlayers[] error you saw at some point.

    If you had those imports in there and they were not giving you errors, then something is really wrong. One of those two classes won't exist, depending on your EffectLib version - if it's 3.4 than BleedEntityEffect should've thrown an error, it doesn't exist.
     
  21. Offline

    mkezar

    thats how i learned in the past... do you have a link to the bukkit API itself @NathanWolf
     
  22. Offline

    NathanWolf

  23. Offline

    mkezar

    that means that the bukkit im using has nothing to do with it! @NathanWolf :p I removed Craftbukkit 1.8 from my build path and replaced it with bukkit-1.7.9 and i renamed one of the imports to ShieldEntityEffect. Didn't give me an error. So could it be a problem with the version still @NathanWolf?
     
  24. Offline

    NathanWolf

    "ShieldEntityEffect" does not exist in any recent builds of EffectLib. If it's still letting you compile with that import, then I'm at a loss- you're building against an older version of EffectLib, possibly as well as a newer version.
     
  25. Offline

    mkezar

    let me try something when I get home. Here's what im going to do. I've had this old version problem in the past. Im going to create a new class, and add EffectLib 3.4 to the build path and start from scratch. If it wasn't the eclipse bug of having that old version problem then its definitely something :p
     
Thread Status:
Not open for further replies.

Share This Page