[INACTIVE][FUN/MECH] Wings 1.3 - Simple Flight + Hover (Permissions 2.5.5) [635]

Discussion in 'Inactive/Unsupported Plugins' started by weasel5i2, Mar 23, 2011.

  1. Offline

    weasel5i2

    Wings - Simple Flight
    Version: v1.3

    This plugin lets you fly around. Simply hold a feather in your hand and right-click with it to toggle flying and hovering on/off. First click will enable flight mode. A second right-click will switch you into hover mode. A third right-click will switch off flying and you will fall to the ground (without damage, as long as you're still holding the feather!)

    You will fly in the direction you're facing, so if you're going to hit that mountain, well.. PULL UP!! PULL UP!!!

    Features:
    • Flying around in the sky like some crazy bird.
    • Hovering! (mostly..) - while hovering, hold down SHIFT to move yourself upwards.
    Permissions node:

    - 'wings.fly'

    Configuration:
    The configuration is located in plugins/Wings/Settings.ini. The file looks like this:​
    Code:
    hoverMultiplier=0.0012410253
    hoverBoostMultiplier=0.00555
    allowOps=true
    flyingEatsFeathers=true
    defaultFeatherAmount=500
    flightSpeed=1.0
    

    * hoverMultiplier: The vector amount to achieve the player hovering effect. Your mileage may vary depending on how this is set.​
    * hoverBoostMultiplier: The vector amount to get that extra upward boost when you press SHIFT whilst hovering.​
    * allowOps: Allow Op users to fly, regardless of their Permissions setting.​
    * flightSpeed: The amount to multiply the flight vector by. Don't set this too high or you may end up extremely far away from your intended destination!​
    * flyingEatsFeathers: (disabled by default) - Set whether or not flying and hovering will consume feathers. Note that the feather must be held in the FIRST hand inventory slot #1 (at least until I can figure out how to get it to see them elsewhere in the player's inventory)​
    * defaultFeatherAmount: This sets how many ticks each feather will last before being consumed. On my server, the default 500 setting makes them last approximately 15-20 seconds each before disappearing from the stack.​

    Download:

    Download The Plugin v1.3 (JAR)​
    Download The Plugin v1.3 (ZIP)​

    Download the Source v1.3 (ZIP, Eclipse project)​

    To Do:


    Changelog:


    Version 1.3 04-Apr-2011
    * Added feather consuming support​
    * Added configuration file plugins/Wings/Settings.ini (see above)​

    Version 1.2 03-Apr-2011
    * Added Permissions 2.5.5 support​
    * Added hovering!​

    Version 1.1 31-Mar-2011 - unreleased
    * Experimental stuff. Didn't work out too well. :)

    Version 1.0 23-Mar-2011
    * Created plugin​

     
    lolligertyp and Steve Cole like this.
  2. Offline

    piousminion

    Umm, where exactly does it say this? I see no text of that size or color and certainly nothing saying it doesn't work with 617.

    Does this really not work for 617? If so, why make a plugin for a build of bukkit higher than any recommended build? I'm thoroughly confused.
     
  3. Offline

    ZachBora

    In one of the previous comment, the someone wrote in red text :
    This is because bukkit broke something between 600 and 617 (included) and it is only fixed on 618+. It's impossible to make a working flight plugin on 618 in the same way as this plugin.
     
  4. Offline

    Itssnowing

    Oh, that big red text. That doesn't apply to me because I can't skim the past two or three pages of post.

    :rolleyes:



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

    piousminion

    If it's not in the OP then the probability of it being posted by a tard/noob is rather high.
    If it's not in the last page or so then the probability of it being ancient is rather high.
    If it's not in either, the probability of it being useful is slim to none.

    People can't be expected to read through an entire thread post by post to skim for a (potential) gem from an unimaginable amount of garbage. This has nothing to do with Wings or bukkit, that's simply how forums work. Refusing to accept this and responding in the manner in which you have helps no one. Please refrain from commenting on my posts in the future. Thank you.

    Thank you very much. That clears up all my confusion. :)
     
  6. Offline

    Itssnowing

    That "Entire thread" is four pages. I can understand when someone posts on the Permissions thread asking something that's been asked a dozen times, because it's 100 pages long, and no one wants to read that. But if it's four pages long, man, that's like ten minutes of skimming, tops. That's faster than waiting all night for a reply from someone.

    Edit: Also, ancient is two days ago.
     
  7. Offline

    ZachBora

    I just wish they'd make map loading faster.

    Is the setVelocity() something that can be overriden by a plugin? I haven't had much time to give it a try at making a plugin, but I would expect being able to change most things, aside from validating with server the credentials... I do hope plugins can't fetch that information.
     
  8. Offline

    Genwedar

    any word on when this will be updated for use by users who dont use a permissions pluggin?
     
  9. Offline

    anon

    Humm, i today downloaded new RB 670.

    Never used your plugin before, so I was all, WOW im flying! Then after 20 seconds it stoped working :(
    Seems to be related to the feather consuming thing. I fly, then when it reaches the time to consume it, it doesnt, even if I have a stack of it. It returns a message telling "You are no longuer flying" then if I try to activate it again, it will atctiva and deactivate at the same second. If i disconect and reconect, I still cant fly, only being solved by restarting server.
     
  10. Offline

    Itssnowing

    @anon The logical solution seems to be to disable the consuming of feathers. :p
     
  11. Offline

    link3n1

    I dont work for me..... Nothing hapends after i have right clicked with the feather. I dont really get it how i should do. Can someone help me?
     
  12. Offline

    SharkWipf

    You have the stack of feathers in slot 1 right? Else it won't work :)
     
  13. Offline

    ShaDooM

    Being able to "walk" in hover mode would be great.
     
  14. 19:37:20 [SEVERE] Could not pass event PLAYER_INTERACT to Wings
    java.lang.NoClassDefFoundError: com/nijiko/permissions/PermissionHandler
    at net.weasel.Wings.Wings.isAllowed(Wings.java:195)
    at net.weasel.Wings.PlayerListener.onPlayerInteract(PlayerListener.java:105)
    at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:217)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:133)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:415)
    at net.minecraft.server.Packet15Place.a(SourceFile:57)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)



    i get this over and over again. im using wings version 1.3 and im using bukkit version 670. please help :)
     
  15. Offline

    Genwedar

    Yeah same here Joel. He says it has to do with no having a permissions plugin and he needs to write in something to default it to op only for people that dont use permissions managers.

    Just waiting for him to get around to it.
     
    Joel Nightingale likes this.
  16. oh ok I didnt know this, thanks for letting me know! I shall wait too.
     
  17. Offline

    DemmyDemon

    I have a very odd bug on my server, and it seems to be related to Wings.
    Either it's Wings on it's own (doubtful), or a combination with other plugins, but for whatever reason:

    When Wings is loaded, animals no longer spawn.

    I have no idea why this is, but through the process of elimination I've determined that enabling/disabling Wings also toggles sheep, cows, chickens, pigs, squid and wolves.
    I know how this sounds. I also know that the animal spawn code is not within 300KB of Wings, but still, that's what the experimentation shows.

    :confused:

    Other plugins currently loaded:
    FenceStack, LoginMessage, Permissions, AdminCmd, BedrockControl, InstaBreak, GlowstoneDrop, PhysicalShop

    Edit: Oh, CraftBukkit 670, btw.
     
  18. Offline

    vancraft

    is there a video of this working?
     
  19. Offline

    quantumripple

    Wow. This plugin works wonderfully. There only things it doesn't have that I would like.

    * A config file adjustable flying vertical modifier (a constant vertical velocity addition) so i can look a little bit down while flying level. Really nice for scenery.
    * moving laterally while hovering
    * Down while hovering

    The last two could probably be added by just having shift enable a slow flight while its held

    All in all, its great if only for what it can already do.
     
  20. Offline

    Dawodo

    Hm, I think there is a bug in it atm - If i have the wings plugin installed, then fall damage is globally disabled even if I don't have a feather with me. Disabling Wings solves this. Maybe a check fails?
    Edit: Oh and it would be nice if you could define the item - I changed the hardcoded feather for my server, but as there is config file, this won't be much work :)
     
  21. Offline

    _LB

    Is there a way to make it so that hovering is merged with flying in a way they you hold shift to hover and release to fly? Having to fall and then fly again doesn't make sense for players that just want to take a short look at something.
     
  22. Offline

    Stee_vo

    The mod doesnt work for me :S it say in the RUN window (the on eyou use to start the server) that the server is using the plugin ''wings'' and everything is right but i cant fly :S please help!
     
  23. Offline

    Zorkinian

    Here's the problem with the falling damage.

    In Wings.java, you have this method:


    Code:
        public static Integer isFlying(final Player player)
        {
            if(flyingPlayers.containsKey(player))
                return flyingPlayers.get(player);
            else
                return 0;
        }
    Note that this method will always return a number greater than or equal to 0 (since it'll either return the key, or 0)
    And here's where you (potentially) cancel fall damage:

    Code:
        public void onEntityDamage(EntityDamageEvent event)
        {
            if ((event.getCause().equals(EntityDamageEvent.DamageCause.FALL)) && ((event.getEntity() instanceof Player)))
            try
            {
                Player player = ((Player)event.getEntity());
    
                if( Wings.isFlying(player) >= 0 ) event.setCancelled( true );
            }
            catch (Exception e)
            {
                // Do nothing..
            }
        }
    
    That check at the end: if(Wings.isFlying(player) >=0) will always evaluate to True, since Wings.isFlying always returns a number that is zero or greater.

    The fix is simple - just change the check to:

    if(Wings.isFlying(player) > 0) event.setCancelled(true);

    Well, unintended side effect - if you fly down a long distance, then stop just a few inches (or a long distance, it doesn't matter) above the ground and stop flying, as you gently come to rest you take all that fall damage at once and explode.

    A workaround could be this:

    Code:
                if(( Wings.isFlying(player) > 0 ) || (player.getItemInHand().getType() == Material.FEATHER))
                    event.setCancelled( true );
    Upside - canceling your flight can't hurt you as long as you have a feather (or a stack of feathers) in hand
    Downside - People with just 1 feather can run around your server immune to fall damage if they pull it out fast enough.

    I didn't want to muck around with your code too much, but what you really need is to remember if a player has been flying sometime in the last, say, 3 seconds. If so, cancel the damage event.

    Okay, after playing around a bit more, I have a few more suggestions:

    1) Change the setFlying call in Wings.java to this:
    Code:
        public static void setFlying(final Player player, final Integer value)
        {
            flyingPlayers.put(player,value);
            if (value == 0)
            {
                //reset the fall distance, since we've been flying around
                player.setFallDistance(0);
            }
        }
    This solves the earlier issue - if you stop flying, now you take appropriate fall damage, calculated from where you stopped flying. You can still keep the code I had in the last post if you want people holding feathers to be immune to fall damage.


    ----------------------

    2) Move your flying code around a little

    Right now, your code flow generally looks like this:

    a) Set the player's velocity
    b) If something is not good, stop them from flying

    This can create buggy situations - a better general pattern should be:

    a) If something's not good, remove them from teh flying list
    b) If they're on the flying list, set their velocity

    --------------------------

    3) Feather reducing code

    Your current code has a lot of problems, most of which stem from the fact that when you check to see if you have feathers left, you throw an exception, and currently you just swallow the exception and stop flying.

    I suggest replacing everything inside your try block with this:

    Code:
                        //This code removes 1 feather from the user's held item.
                        //Upside - easy to code.
                        //Downside - doesn't support holding other items while flying
                        int currentNumberOfFeathers = player.getItemInHand().getAmount();
    
                        if( currentNumberOfFeathers == 1 )
                        {
                            //we have to do more work - the item must be fully destroyed;
                            player.getInventory().setItemInHand(null);
                            //now that they're out of feathers, no more flying!
                            Wings.setFlying( player, 0 );
                            player.sendMessage( "You are no longer flying." );
                        }
                        else
                        {
                            //they ran out of points, so they lose a feather
                            player.getItemInHand().setAmount(currentNumberOfFeathers - 1);
                            Wings.setFeatherPoints( player, Wings.defaultFeatherAmount );
                        }
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  24. Offline

    paul13nov

    not working on 670 :(
     
  25. Offline

    Dave Wright

    I would guess it's a permissions thing or you've not got the latest version, I'm running 670 and the latest wings and it's working fine (though I'd still like to slow the flying down enough that chunk loading isn't an issue on the server)
     
  26. Offline

    Zorkinian

    You can set the fly speed in the .ini file that gets created in the plugins/wings directory.
     
  27. Offline

    Wesley211

    Hey,

    I just downloaded your plugin; and installed it the right way.

    Im getting no errors, but when i use a feather & right click till i get the fly feature, it doesnt do anything.
    It just says " You are now flying.", and nothing else.. I can look up & walk, i can look down & walk, but i wont fly or something like that. Tried to jump, press shift, etc.

    You know what to do or how to fix it?
    Using those plugins btw: http://pastie.org/1792635

    Thanks!
    ~Wesley

    Edit:
    I made myself OP aswell, and still didn't work
     
  28. Offline

    Zorkinian

    Make sure you're holding feathers in slot 1 - it can behave kind of badly otherwise. This may or may not solve your issue though...
     
  29. Offline

    Wesley211

    Nope, not working neither.. :|
     
  30. Offline

    InXanity

    Lovely plugin, works really well, apart from one minor detail.
    When I land after having flown a little, I get a weird sound bug, and the only solution to it is getting into water.
     
  31. Offline

    paul13nov

    its just not working, it's the latest version, on 670, not using permissions so its just ops default, all the config is correct, god knows why
    but ive started using zombe now, much better imho
     

Share This Page