Water Fountain

Discussion in 'Archived: Plugin Requests' started by Deltateamsoldier, Aug 28, 2014.

  1. Plugin category: Fountain

    Suggested name: I ONLY NEED THE CODE TO PUT IT IN MY PLUGIN

    What I want: I need a plugin that spawns the water particle effect 2 blocks high on some special places... If someone wants to make it, pls make a little config where I can change/add the coordination points for the particles (not fallen water blocks with fallingsand!!), where they spawn... if theres a way to change the distance from where you can see them, make that to a high level.. I think something like 40-50 blocks would be nice. The plugin shouldn't have any commands and should be so little how possible.. Sorry for bad English I hope you have understood everything :)
    Also, skim-reading is much easier with paragraphs!

    Ideas for commands: No commands

    Ideas for permissions: no permissions
    If it can cause lags on client, make a permission that user without this permission cant see the water particles.. arraylist...

    When I'd like it by: On the weekend would be nice (Saturday or Sunday)
     
  2. No Answer for this thread?! Really? :'(
     
  3. Offline

    timtower Moderator Moderator

    Deltateamsoldier I will start with the part that you only want code to put in the plugin. And if you know some coding then you can make this yourself.
     
  4. Offline

    timtower Moderator Moderator

    I think that you got me wrong, I won't make a thing as you should be able to make this yourself.
     
  5. timtower I cant do this because I never worked with locations.. I will try it and post the code in here and you can have a look whats wrong in it
     
  6. Offline

    bwfcwalshy Retired Staff

    Last edited by a moderator: Jun 10, 2016
  7. Offline

    timtower Moderator Moderator

    No I am not.
    Good opportunity to learn them.
     
  8. Code:java
    1. package de.jan.fountain;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.Effect;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandSender;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.event.Listener;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10.  
    11. public class Main extends JavaPlugin implements Listener {
    12.  
    13. @SuppressWarnings("deprecation")
    14. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    15. final Player p = (Player) sender;
    16. if(cmd.getName().equalsIgnoreCase("fountain"))
    17. if(args.length == 0) {
    18. p.sendMessage("");
    19. p.sendMessage("§8§l> §aBenutze §2§l/fountain §acreate oder §2§l/fountain info");
    20. p.sendMessage("");
    21.  
    22. }
    23.  
    24. if(args[0].equalsIgnoreCase("info")) {
    25. p.sendMessage("");
    26. p.sendMessage("§8§l> §2§lFountain - §aVersion §21.0");
    27. p.sendMessage("");
    28.  
    29. }
    30.  
    31. if(args[0].equalsIgnoreCase("create")) {
    32. Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
    33.  
    34. @Override
    35. public void run() {
    36. p.playEffect(p.getLocation(), Effect.MOBSPAWNER_FLAMES, 1); //I dont know how to use a particle effect
    37.  
    38.  
    39. }
    40.  
    41. }, 0, 300*20); //How can I do it endless?
    42. p.sendMessage("");
    43. p.sendMessage("Du hast einen Fountain erstellt");
    44. p.sendMessage("");
    45.  
    46.  
    47.  
    48. }
    49.  
    50. return false;
    51.  
    52. }
    53. }

    timtower here is the example ^^



     
  9. Offline

    timtower Moderator Moderator

    Deltateamsoldier You probably want to look at the configuration API, return statements, and try to start smaller. Try to get some java and bukkit knowledge. Your code will throw errors when not using arguments or just when running it from the console
     
  10. Yes now theres the "if(sender instanceof Player) { " inside... In 2 month I will do a course on a Universits of applied science in Java ... sorry for my bad English ^^

    - added return statements

    timtower
    Code:java
    1. package de.jan.fountain;
    2.  
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.Effect;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandSender;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.event.Listener;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10.  
    11. public class Main extends JavaPlugin implements Listener {
    12.  
    13. @SuppressWarnings("deprecation")
    14. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    15. if(sender instanceof Player) {
    16. final Player p = (Player) sender;
    17. if(cmd.getName().equalsIgnoreCase("fountain"))
    18. if(args.length == 0) {
    19. p.sendMessage("");
    20. p.sendMessage("§8§l> §aUse §2§l/fountain info §afor all commands");
    21. p.sendMessage("");
    22. return true;
    23.  
    24. }
    25.  
    26. if(args[0].equalsIgnoreCase("info")) {
    27. p.sendMessage("");
    28. p.sendMessage("§8§l> §2§lFountain - §aVersion §21.0");
    29. p.sendMessage("");
    30. return true;
    31.  
    32. }
    33.  
    34. if(args[0].equalsIgnoreCase("create")) {
    35. Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
    36.  
    37. @Override
    38. public void run() {
    39. p.playEffect(p.getLocation(), Effect.MOBSPAWNER_FLAMES, 1); //I don't know how to use a particle effect
    40.  
    41.  
    42. }
    43.  
    44. }, 0, 300*20); //How can I do it endless?
    45. p.sendMessage("");
    46. p.sendMessage("§8§l> §aNew fountain §ccreated");
    47. p.sendMessage("");
    48. return true;
    49.  
    50.  
    51. }
    52.  
    53. if(args[0].equalsIgnoreCase("remove")) {
    54. Bukkit.getServer().getScheduler().cancelTask(0); //end of scheduler
    55. p.sendMessage("§8§l> §aFountain §cremoved");
    56. return true;
    57.  
    58.  
    59. } else {
    60. if(!(sender instanceof Player)) {
    61. System.out.println("§cNur als Spieler ausführbar!");
    62. }
    63.  
    64.  
    65. }
    66.  
    67. }
    68. return false;
    69. }
    70. }
    71.  


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

    Shmobi

    Deltateamsoldier threads like this are supposed to be in the development forum and not in the request forum
     
  12. Shmobi I made a request man! But timtower thinks that I should code that -.-

    Best support forum guys! [sheep]

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

    timtower Moderator Moderator

    Deltateamsoldier You are requesting plain code for something that isn't that hard to learn yourself if you put some effort in.
     
  14. But how should I do that if I don't know much about Java or Bukkit and have the course in 2 month?! Someone has to explain but no one want because its to much "work" ^^
     
  15. Offline

    timtower Moderator Moderator

    Deltateamsoldier I know plenty of people that self thought java, it takes time, don't rush things, don't try to make something when you don't know how.
     
  16. Okay I think I will start learning it soon, because I have to do some stuff for school next weeks... Thanks for your answers timtower and bwfcwalshy ;)
     
  17. timtower I have one last question. I will do the particle effect with the particleffect library from DarkBladee12 I think its the famoust Particleeffect library.. But in this library are many effects I don't need... could you send me the part of the lib. with the code of the water particle?
     
  18. Offline

    timtower Moderator Moderator

    Deltateamsoldier I won't strip a library, most libraries have more functionality that the user needs. Just ignore those features.
     
  19. timtower and you don't think its more "work" for the server with the complete library?
    sry for bad English ^^
     
  20. Offline

    timtower Moderator Moderator

    You don't call the other effects so the server won't notice it.
     
    cnniillaa likes this.
  21. timtower Okay thanks for your answers man ;)
     

Share This Page