Fireworks Error

Discussion in 'Plugin Development' started by funnyman850, Aug 30, 2014.

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

    funnyman850

    What i get in the console is this
    Code:
    [10:42:34 ERROR]: Could not pass event PlayerMoveEvent to FunnyFoot v1.5
    org.bukkit.event.EventException
     
    Caused by: java.lang.Error: Unresolved compilation problems:
            Syntax error, insert "; ; ) Statement" to complete BlockStatements
            Syntax error, insert ";" to complete BlockStatements
            Syntax error on token "switch", interface expected
            Syntax error on tokens, InterfaceBody expected instead
            Syntax error on token "case", assert expected
            Syntax error on token "case", assert expected
            Syntax error on token "case", assert expected
            Syntax error on token "case", assert expected
            Syntax error on token "}", delete this token
            Syntax error on token "(", ; expected
            Syntax error on token ")", ; expected
     
            at me.funnyman850.FunnyFoots.FunnyFootsListener.shootFireworks(FunnyFootsListener.
    java:243) ~[?:?]
            at me.funnyman850.FunnyFoots.FunnyFootsListener.onFunnyFireworkMove(FunnyFootsList
    ener.java:237) ~[?:?]
            at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source) ~[?:?]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292) ~[
    craftbukkit.jar
            ... 14 more

    and my code for taht part is

    Code:java
    1. @EventHandler
    2. public void onFunnyFireworkMove(PlayerMoveEvent pme) {
    3. Player player = pme.getPlayer();
    4. if (FunnyFoots.instance.EnableFireworks)
    5. if (this.plugin.FunnyFireworks.contains(player)) {
    6. Location to = pme.getTo();
    7. Location from = pme.getFrom();
    8. Location loc = player.getLocation();
    9. if ((to.getX() != from.getBlockX())
    10. || (to.getY() != from.getY())
    11. || (to.getZ() != from.getZ())) {
    12. loc.setY(loc.getY());
    13. ParticleEffect.FIREWORKS_SPARK.display(loc, 0, 0, 0, 0, 5);
    14. ParticleEffect.PORTAL.display(loc, 0, 0, 0, 0, 5);
    15. shootFireworks();
    16. }
    17. }
    18. }
    19.  
    20. private void shootFireworks(){
    21. for (Logger player = Bukkit.getLogger()){
    22. Fireworks fw = (Fireworks)player.getWorld()spawn(player.getLocation(), Firework.class);
    23. FireworkMeta fm = fw.getFireworkMeta();
    24. Random r = new Random();
    25. Type type = type.BALL;
    26. int fType = r.nextInt(5) + 1;
    27. switch fType {
    28. default:
    29. case 1:
    30. type = Type.BALL;
    31. break;
    32. case 2:
    33. type = Type.BALL_LARGE;
    34. break;
    35. case 3:
    36. type = Type.BURST;
    37. break;
    38. case 4:
    39. type = Type.CREEPER;
    40. break;
    41. case 5:
    42. type = Type.STAR;
    43. break;
    44. }
    45.  
    46.  
    47. int c1 = r.nextInt(16) + 1;
    48. int c2 = r.nextInt(16) + 1;
    49. Color c1 = getColour(c1i);
    50. Color c2 = getColour(c2i);
    51. FireworkEffect effect = FireworkEffect.builder()
    52. .flicker(r.nextBoolean()).withColor(c1).withFade(c2)
    53. .with(type).trail(r.nextBoolean()).build();
    54. fm.addEffect(effects);
    55. int power = r.nextInt(2)+1;
    56. fm.setPower(power);
    57. fw.setFireworkMeta(fm);
    58. }
    59.  
    60.  
    61. public Color getColour (int c) {
    62. switch (c) {
    63. default:
    64. case 1:return Color.AQUA;
    65. case 2:return Color.BLACK;
    66. case 3:return Color.BLUE;
    67. case 4:return Color.FUCHSIA;
    68. case 5:return Color.GRAY;
    69. case 6:return Color.GREEN;
    70. case 7:return Color.LIME;
    71. case 8:return Color.MAROON;
    72. case 9:return Color.NAVY;
    73. case 10:return Color.OLIVE;
    74. case 11:return Color.PURPLE;
    75. case 12:return Color.RED;
    76. case 13:return Color.SILVER;
    77. case 14:return Color.TEAL;
    78. case 15:return Color.WHITE;
    79. case 16:return Color.YELLOW;
    80. }
    81. }
    82. }
    83.  


    im not really sure what to do...
     
  2. Offline

    Lewishjames

    This Looks like a method from the Bcbroz Videos
    If so you should get a updated one it could be fairly outdated and some of the methods could of changed and such
     
  3. Offline

    Seadragon91

    this thread will be closed, spigot is not supported on this forum.
     
  4. Offline

    funnyman850

    it is from bcbroz's video lol.. do you have any suggestions?
     
Thread Status:
Not open for further replies.

Share This Page