Watershow plugin

Discussion in 'Plugin Requests' started by Dmrtje, Mar 21, 2014.

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

    e1kfws7


    There are a lot of things you have to do with this... It just isn't an easy project. :p
     
  2. Offline

    webbhead

    Dmrtje
    I have seen this before, and it is possible to do without plugins.
     
  3. Offline

    Dmrtje

    I know and i know how that works it is with /summon but it spams your console is ugly and a lot of work for each fountain you need 23 commandblocks to make it a little bit nice.

    And thanks @Iproductions !!!
     
  4. there is a gamerule that makes command blocks not spam the console i think its logadmincommand
     
  5. Offline

    Onlineids

    [​IMG]

    doCommandOutput

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

    ponedagame

    Using bits and pieces of your guys' comments, and using a bit of Iproductions code, I seem to be able to create water coming from a water stream shoot up into the air, but i'm working on the part of it coming down, i'll check in later to show you guys. :D
     
  7. Offline

    JBoss925

    That sound a lot like the major's mask song…haha sorry.
     
  8. Offline

    ponedagame

    Here is the code straight from eclipse:


    package me.bukkit.ponedagame;

    import org.bukkit.Material;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerLoginEvent;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.EventPriority;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Event;
    import org.bukkit.event.player.PlayerEvent;
    import org.bukkit.event.player.PlayerGameModeChangeEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.permissions.Permission;

    public class Environment extends JavaPlugin {

    }
    @Override
    public @ onEnable( {
    new BlockListener(this){
    PluginManager pm = getServer().getPluginManager();

    @Override
    public void onDisable() {}

    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {

    if (FallingBlock) fallingBlock=player.getWorld().spawnFallingBlock(location, Material.WATER,(byte)o);

    return true;

    return false;}
    }



    I'm getting an EmunBody error after the Bracket above. And an error on the fallingBlock strip. Maybe you could figure this out.
     
  9. Offline

    Dmrtje

    can someone plese help him?

    i think you have to remove the last return false;
     
  10. Offline

    JungleSociety

    ponedagame
    Why are you returning true and false in the same block? I don't believe that's the problem, I was just wondering for future reference.
     
  11. Offline

    timtower Administrator Administrator Moderator

  12. Offline

    JungleSociety

    timtower likes this.
  13. Offline

    Hykar

    Hey what about that is it really slow ?:
    Code:java
    1. package watershow;
    2.  
    3. import java.util.ArrayList;
    4.  
    5. import org.bukkit.Bukkit;
    6. import org.bukkit.Location;
    7. import org.bukkit.Material;
    8. import org.bukkit.World;
    9. import org.bukkit.entity.FallingBlock;
    10. import org.bukkit.util.Vector;
    11.  
    12. public class WaterStream implements Runnable {
    13.  
    14. World world;
    15. Location start;
    16. Vector motion;
    17. int timeout,timeoutBlock;
    18. long ticks=0;
    19. int eventID=-1;
    20. ArrayList<FallingBlock> blockList = new ArrayList<FallingBlock>();
    21. public void setEventID(int id){
    22. this.eventID =id;
    23. }
    24. public WaterStream(Location position,Vector motion,int timeoutEffect,int timeoutBlock){
    25. start = position.clone();
    26. this.world = start.getWorld();
    27. this.motion=motion;
    28. this.timeout =timeoutEffect;
    29. this.timeoutBlock=timeoutBlock;
    30. }
    31. public void run() {
    32. if(eventID==-1)return;
    33. ticks++;
    34. if(ticks == timeout){
    35. for(int i=0;i<blockList.size();i++){
    36.  
    37. blockList.get(i).remove();
    38. blockList.remove(i);
    39. i--;
    40.  
    41. }
    42. Bukkit.getScheduler().cancelTask(this.eventID);
    43. return;
    44. }
    45. int lastID = blockList.size();
    46. blockList.add(world.spawnFallingBlock(start,Material.WATER,(byte) 0));
    47. blockList.get(lastID).setVelocity(motion);
    48. for(int i=0;i<blockList.size();i++){
    49. if(blockList.get(i).getTicksLived()>timeoutBlock){
    50. blockList.get(i).remove();
    51. blockList.remove(i);
    52. i--;
    53. }
    54. }
    55. }
    56.  
    57. }
    58.  

    Code:java
    1. package watershow;
    2.  
    3. import org.bukkit.command.Command;
    4. import org.bukkit.command.CommandSender;
    5. import org.bukkit.command.PluginCommand;
    6. import org.bukkit.entity.Player;
    7. import org.bukkit.plugin.java.JavaPlugin;
    8. import org.bukkit.util.Vector;
    9.  
    10. public class WaterShow extends JavaPlugin {
    11.  
    12. @Override
    13. public boolean onCommand(CommandSender sender, Command command,
    14. String label, String[] args) {
    15.  
    16. if(label.equalsIgnoreCase("w")){
    17. try{
    18. Player player=(Player)sender;
    19. int last = Integer.valueOf(args[0]);
    20. int blast = Integer.valueOf(args[1]);
    21. int x= Integer.valueOf(args[2]);
    22. int y= Integer.valueOf(args[3]);
    23. int z= Integer.valueOf(args[4]);
    24. WaterStream wts = new WaterStream(player.getLocation(),new Vector((double)x,(double)y,(double)z),last,blast);
    25. int eventID =this.getServer().getScheduler().scheduleSyncRepeatingTask(this, wts, 0, 2);
    26. wts.setEventID(eventID);
    27. }catch(Exception ex){}
    28. if(!(sender instanceof Player)){
    29. return super.onCommand(sender, command, label, args);
    30. }
    31. }
    32. return super.onCommand(sender, command, label, args);
    33. }
    34.  
    35.  
    36.  
    37.  
    38. }
    39.  

    EDIT:x,y,z might be read as double so its more smooth
    Thats the base we just need to chain it so one water stream goes after another
    timtower JungleSociety
    Atleast it looks smooth: http://postimg.org/image/qla8wbcwj/
    For 10 min. coding
    Also works very good with 20 small sized water streams
     
  14. Offline

    RulingKyle1496

    Ima start working on this right now :D
     
  15. Offline

    Dmrtje

    Hykar Yeah that is really nice!
     
  16. Offline

    scenecraft

  17. Offline

    Dmrtje

    Anyone who's busy with this?

    any upgrades?
     
  18. Offline

    CMG

    Hykar What parameters did you use to achieve that?
     
  19. Offline

    Hykar

    You need to change x,y,z to double so you can cast 0.x value and then test it . However I don't remember the params sorry.
     
  20. Offline

    CMG

    Ah Nevermind, i did change them to double but after a certain distance the blocks bug out and move up a few inches.
     
  21. Offline

    Hykar

    yeah thats mc physics ..
     
  22. Offline

    Dmrtje

    yeah.....
    but it doesn't matter.
    it is still nice!
     
  23. Offline

    Dmrtje

  24. Offline

    Dmrtje

    Hykar CMG Do you have any progress with the plugin???!
     
  25. Offline

    CMG

    Yes I'm attempting to optimize Hykar 's code, its working alright at the moment but I'm trying to actually create a successful water show with signs, like CraftVenture's wet-gates. To help, I'm also using some of bergerkillers code for the signs, and I've been able to create a simple water-show, however this takes a lot of time, and i have my first GCSE (General Certificate of Secondary Education) Exam tomorrow. So for the next 2 weeks; i will be revising. Just FYI I'm working on a lot of community projects on these forums and some custom ones so i am a very busy. :)
     
  26. Offline

    Hykar

    I don't really work on it , I was just interested if I could do something like that in 10-20min and I felt like sharing the code if someone might need help for doing it. Thats all :D
     
  27. Offline

    xMrPoi

    The video is private.
     
  28. Offline

    LordFox

    I hope this plugin comes through, ive really been looking forward to this
     
  29. Offline

    Dmrtje

    Fixed it now it is another video!
     
  30. Offline

    Dmrtje

Thread Status:
Not open for further replies.

Share This Page