[REQ] Better Pistons

Discussion in 'Archived: Plugin Requests' started by Klausar, Jul 1, 2011.

  1. Offline

    Klausar

    Hello bukkit community,
    I dont know if this is possible but it would be grate if someone makes the pistons work like the ones from the piston mod (throw people and sand/gravel up in the air) I think the first feature should be easy but I dont know if it works with Sand / gravel.

    King Regards
    Klausar
     
  2. Offline

    Klausar

  3. Offline

    marinating

  4. Offline

    feildmaster

    That should be possible. actually...
     
  5. Offline

    Klausar

    Would anyone try it?
     
  6. Offline

    feildmaster

    I'll try it in a little while.

    Well, I just racked the bukkit code, and found "no existing code" that will let us enhance the pistons.

    This will have to wait until they code in the API for pistons. For now, this project is "On Hold."

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

    Wakko

    I support this.
    Can't wait to see it. :)
     
  8. Offline

    Klausar

    Push. Piston API was added in rb 1000
     
  9. Offline

    feildmaster

    @Klausar : Can't really say it was entirely added, it was a rudimentary (basic) piston support. I can "probably" get it to work with blocks. Players, I'll have to play around with it.

    I should be able to get it up later today if I can find time.
     
  10. Offline

    Klausar

    Sand and gravel are more important than players.
     
  11. Offline

    feildmaster

    That's good to know. I'll see what I can do about that when I wake up.
     
  12. Offline

    Bubby4j

    It's easy to launch a player into the air! My SuperJump plugin does it.
    player.SetVelocity is your new friend!
     
  13. Offline

    feildmaster

    @Bubby4j : Ah, but detecting when the player is pushed by a piston is not easy. ;)

    Edit in: In second thought, before I started coding I realized that you can't move individual "blocks" smoothly in a single direction without a client mod, so I will give up for now. I don't make client mods at the moment.
     
  14. Offline

    Bubby4j

    How about detect when any piston is activated, and then look through the players to check if they are on top of a top-facing piston?
     
  15. Offline

    feildmaster

    @Bubby4j : then turning on pistons somewhere else when standing on top of an extracted piston would push the player in the air. rather... I think the guy wanted the blocks more than the player, and although I could probably code players (and entities) being tossed up like that, i am slightly inconvenienced on time now.
     
  16. Offline

    LucidLethargy

    Is this back on with build 1000? I can't believe Notch left out the only real cool part of pistons... throwing things! I hate that guy so much...
     
  17. Offline

    blackprince42

    Please Please make this work! this is what pistons need to be good again.
     
  18. Offline

    feildmaster

    If someone else wants to attempt this they can. Right now, not only are there too many bugs with attempting it, there is not enough ability to even fully implement this (in my opinion)
     
  19. Offline

    bergerkiller

    I looked through the bukkit coding, and why is it not possible to use the mobile class and spawn it?
    Code:
            World w = event.getPlayer().getWorld(); //temp
            org.bukkit.entity.FallingSand fs = w.spawn(event.getPlayer().getLocation(), org.bukkit.entity.FallingSand.class);
            fs.setVelocity(new Vector(0, -10, 0));
    I already used it to spawn fireballs; why wouldn't it work with sand this way?

    Plus, all there is to it is check if the block ontop of the piston is sand/gravel and turn this block into a moving entity. I believe it turns to gravel/sand on impact automatically.

    Same counts for bouncing off mobile entities that are x distance away from the piston.
     
  20. Offline

    feildmaster

    Could that push sand up in the air? I'm too tired to think at the moment.

    Either way that would solve half the problem. Detecting PEOPLE being pushed is another issue. (btw... I should probably look more into entities huh. I'm a bit lazy on the entity part, good job on that)


    If I can get enough sleep I'll see what I can do about sand/gravel when I wake up. Haven't been having too much luck, with plugins, recently.
     
  21. Offline

    bergerkiller

    You sure should, since there is an Entity class for all sorts of objects in the game:
    Code:
            org.bukkit.entity.TNTPrimed.class;
            org.bukkit.entity.Player
            org.bukkit.entity.LivingEntity
            org.bukkit.entity.Creature
    They should at least inherit SOME of the movement functions, although I never managed to make the Player class move using its velocity property. I believe the velocity gets updated elsewhere, using the onmove event in the background. Strange is, that if you set the velocity of an animal to 2+, they "teleport" (move too fast). This means it does affect something....
     
  22. Offline

    feildmaster

    using "player" (from above: event.getPlayer()) you setVelocity on the player.
     
  23. Offline

    Klausar

    Any news?
     
  24. Offline

    feildmaster

    @Klausar : Sorry Klaus, I haven't had any time to work/mess around with this feature. It honestly shouldn't be that hard though, unless the piston API refuses to allow it. If no one does it within a week or so, I'll work on it.
     
  25. Offline

    Xanatoss

    Bump, I'm very interested in having this. Maybe as a Config file for how high/far they launch?
     
  26. damn, this one is the 3 today whit the same REQ-.-
     
  27. Offline

    feildmaster

    @Marius A Winsjansen : You do realize this topic itself is a month old right?
     
  28. Offline

    Klausar

    Up :(

    No1 want to do this?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  29. Offline

    Grammar Troll

  30. Offline

    Klausar

    Well it can launch players but no Sand or gravel :(
     

Share This Page