SimpleChairs request

Discussion in 'Archived: Plugin Requests' started by laacis2, Sep 30, 2013.

  1. Offline

    laacis2

    Plugin category: MECH

    Suggested name: SimpleChairs

    What I want:
    I would like to see a simple chairs plugin, that is not dependent on protocollib, and doesn't have unnecessary features.

    I used to use chairs reloaded for my server, but however, protocollib is conflicting with some of deep layer configuration. As a result, latest protocollib will not run on it, and deny people joining server.

    I have tested using citizens to spawn small entity, like silverfish, baby ocelot and similar. Technically, it works. My idea is to allow people to sit on invisible silverfish, or any other mob that stands high enough, that is spawned, as you sneak+rightclick a chair.
    There ain't garbage needed. No perms nor commands. Just make kids happy, and let them sit!

    Possible config:
    #add item id's you want people to sit on
    Blocks:
    - [id]
    - [id]
    - [id:dmg]
    #and so on.
    MaxChairWidth: [number of blocks]
    Empty hand activation: [true/false]
    #you must have empty hand to be able to interact with chair.
    DisabledWorlds:
    - world
    - world1
    - world2
    #worlds, chairs will not work on.

    Ideas for commands: No commands needed for this plugin.

    Ideas for permissions: No need for permissions.

    When I'd like it by: ASAP.

    Why would this be better, then others: i have searched all over the bukkit. Found quite lots of chair plugins, however none work. I do not need some lib packs, that will exhaust my server's speed for just being there. Small, efficient, independent chairs plugin will rock the bukkit in no time!
     
  2. Offline

    harrysbird

  3. Offline

    laacis2

    Are you kidding me pal? Does concept 'heavily outdated' ring a bell?=)
     
  4. Offline

    LiLChris

  5. Offline

    BillyGalbreath

    You do realize ProtocolLib isnt just a dependent library some dev decided to use on a whim. To make sitting on chairs possible there is a lot of packet manipulation going on. ProtocolLib is a standardized way of doing this without conflicting with other plugins trying to manipulate packets.
     
  6. Offline

    laacis2

    You do relise, that for sitting on an invisible silverfish, there is no packet manipulation required.

    And i have mentioned, that protocollib interferes with player ability to join my server. Also it makes any server lag to some degree.

    Nobody just wants to use a mob for chair. But i don't see why not? Sneak click on block, plugin puts something like baby ocelot (which is noiseless), makes it invisible, freezes in spot and tracks it while you sit. Once you leave chair, this baby ocelot goes poof.

    God if i could crack this java stuff, at which i am clearly at disadvantage. I understand the mechanics and logics, but i can't program it..

    Here is the 'complicated lot of packet manipulation ' Spawned cat using citizens, thrown invis potion at it and happy sitting'
    All we need, is to make plugin spawn it when you try to sit, and remove when you leave the chair.
    Screenie without invis:
    [​IMG]
    Screenie:[​IMG]

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

    BillyGalbreath

    Ok, you have my attention. I'll see what I can come up with.
     
  8. Offline

    Me4502

    Seeing as with bukkit you can't cancel entity movement, you'd have to check every few ticks and set the ocelot back to its prior position. This could be very jittery and odd.
     
    timtower likes this.
  9. Offline

    BillyGalbreath

    You can use potion effects to disable its movement. Speed Potion set to 0, Slowness potion set to 30, and a jump bonus potion set to -6 to prevent it from jumping. However, I'm stuck at how to make the entity stop turning in place (which causes the player to turn). Still looking for a solution to that last bit and its smooth sailing from there.

    Edit: Simply teleporting the entity will not work on 1.6 anymore if it has a passenger. You are forced to eject the passenger, teleport the entity, then add the passenger back. Which, needless to say, comes with a huge jumpy effect that looks horrible.
     
    AndyMcB1 likes this.
  10. Offline

    timtower Administrator Administrator Moderator

    Well, that is something you can't block
     
  11. Offline

    BillyGalbreath

    Ok, found the solution. I spawned a 2nd entity a few blocks away in the direction the "chair" is facing and applied the same potions so it doesnt move. I then set the target of the original entity (the one the player is a passenger of) to this second entity. It stopped turning.

    Now time to just clean it up and add the other bells and whistles the OP asked for.
     
  12. Offline

    laacis2

    in situation with citizens, mobs are always frozen on spot. Maybe check, what they did for the effects?

    Small artifacts, like vanilla un boarding teleports, or not leaving chair that was destroyed really is minor thing. It already sounds much better, then anything i could find.
     
  13. Offline

    BillyGalbreath

    I have. I used to use the same library they use on my original NPC plugin called DwDNPC. After months of playing with it I found a better solution to use ProtocolLib and I started a new NPC plugin called Pl3xNPC. And after further playing around I found out BKCommonLib is even better.

    However, in the OP you specifically states you do not want ProtocolLib dependency, or any other library.
     
  14. Offline

    laacis2


    Hello, sorry to bother, but have you got any progress with this plugin?
     
  15. Offline

    BillyGalbreath

    No. After we talked last night I tried to get the cats to rotate, but they still always looked south. Cats also dont target anything the way the silverfish did. Silverfish are noisy, though.

    I will revert all my lastest tests and upload the code for someone else to maybe pick up and try. I honestly dont think this is possible with reasonable results (not facing south, and no noisy entities) without packet manipulation.
     
  16. Offline

    laacis2

    i would use it even if players are facing south every time they sit down.. Better, then not sitting down at all.
    Candidate of chair plugin (chairs reloaded) comes with many flaws too. It would be more of a gimmick trying to get it going, and using it. Crashing players, and servers is major gimmick versus always facing south players.

    Is it possible to spawn standing cats as you did at first try, and then make the cat in chair sit down, and other cat despawn?
     
  17. Offline

    BillyGalbreath

    If you remember from the test runs while sitting on an entity you are locked to that position. turning moves your head but your body still wants to snap back to the original position. So, if you chair faces north your body will face south, but will turn side to side, but will never face directly north.

    Sadly, the cats dont target things like other entities do. I tried spawning two cats and targeting each other but they still faced south.

    I also tried other non living entities. Minecarts worked, but the sit position was too low and the player appears to be inside the chair. I tried raising it on the Y axis but the minecart just falls through the chair block like its air. I also tried an arrow, which works pretty well. It hides well inside the chair block and/or player body and it had no issues with locking to a certain direction (the player could freely move around in circles without snapping). The only problem with arrows is when you press shift the server kicks you saying "Nope" because for some reason ejecting from an arrow puts the player at an invalid location. I was unable to fix this, and its currently what is breaking other chair plugins like craftbook.

    All in all, I feel I've exhausted all areas of trial here other than packet manipulation.

    As promised, here is the source code I've been working on: https://bitbucket.org/BillyGalbreath/simplechairs/overview

    I put the source code back to its best behavior when we were using the Silverfish. This updated the player rotation correctly, however it has noisy Silverfish instead of silent Ocelots.

    Edit: Also note that I have commented out the invisibility potion effects so you can see the entities during testing. Just uncomment the 2 lines to make them invisible.

    I hope someone else can take over and figure this out. Good luck! ^_^
     
  18. Offline

    laacis2

    Someone willing to try this?
     

Share This Page