Is it possible: 3 slot inventory

Discussion in 'Plugin Development' started by sgavster, Nov 29, 2013.

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

    sgavster

    Hi!

    I was playing on a server, and I noticed that they had a 3 slot inventory! It was not Spout (I didn't have to use the spout client to connect). If someone knows how to to it, please let me know!

    Thanks!
     
  2. Offline

    PolarCraft

    sgavster Maybe make a custom inventory event? And make so when they open their inventory it opens the custom one?
     
  3. Offline

    Windy Day

    Maybe:
    Code:
    Inventory ThreeSlotInv = Bukkit.createInventory(null, 3, "A Three Slot Inventory!");
    
    Where the first parameter is the owner, second the number of slots, and third the title. And if you want them to have it as their inventory, use an event like PolarCraft said and open the three slot one instead of their normal one.
     
  4. Offline

    sgavster

  5. Offline

    KingNyuels

    Maybe you can fill the other 6 with glass or whatever and cancel the event, if a player wants to take this ones.
    Otherwise you have to change these parts in CraftBukkit:
    Code:java
    1. public Inventory createInventory(InventoryHolder owner, int size) throws IllegalArgumentException {
    2. Validate.isTrue(size % 9 == 0, "Chests must have a size that is a multiple of 9!");
    3. return new CraftInventoryCustom(owner, size);
    4. }
    5.  
    6. public Inventory createInventory(InventoryHolder owner, int size, String title) throws IllegalArgumentException {
    7. Validate.isTrue(size % 9 == 0, "Chests must have a size that is a multiple of 9!");
    8. return new CraftInventoryCustom(owner, size, title);
    9. }


    Of org.bukkit.craftbukkit.CraftServer
     
  6. Offline

    sgavster

    KingNyuels I do not want to do that. I would have done that if I wanted to.

    How would I 'change' it?.
     
  7. Offline

    Plo124

    sgavster Can you post a screen shot of the 3 slot inventory, because it might just be an illusion, or something, idk until I see
     
    Max_The_Link_Fan likes this.
  8. Offline

    AoH_Ruthless


    Do you mean the other slots were unusable or they were just gone?
     
  9. Offline

    KingNyuels

    Do you mean the part with 'changing' the parts in CraftBukkit? Do you want a plugin just for your Server? Or for everyone. Then you cannot make it. Then will everyone who use this plugin have to change their CraftBukkit!

    Else you can Download the CraftBukkit repository from GitHub with Eclipse. Enable the Maven-Dependancy and modifie the parts. After that you have to compile this CraftBukkit-Version via Maven.

    If someone knows a better way: Tell it! - English is not my native language, so sometimes the translation is a little bit broken.

    KingNyuels
    PS: But it can be that the MC-Client crashes - I don't tested it
     
  10. Offline

    Phinary

    The closest thing I could come up with was a modified hopper inventory that was renamed:
    [​IMG]

    http://wiki.vg/Protocol#Open_Window
    From my understanding this is the closest thing you can do, but as always I could be wrong..
     
  11. Offline

    sgavster

  12. Offline

    xTrollxDudex

  13. Offline

    jorisk322

    No, he already said it was not.
     
  14. Offline

    DarkBladee12

    sgavster Could you please post a screenshot of it or post the ip of the server?
     
  15. Offline

    Adriani6

    The arrow is pointing at reply button ;p
     
  16. Offline

    sgavster

    DarkBladee12 They changed it, but the IP was:
    cubekrowd.net. They used to have it though!
     
  17. Offline

    Plo124

    Perhaps it was just one of the minecraft bugs where the inventory slots change color.
     
  18. Offline

    iiHeroo


    It might be possible since 3 is a factor of 9 :3 But that might explain why I'm passing Math by 0 points :(
     
  19. Offline

    sgavster

  20. Offline

    Maulss

    What about dispensers? They have 3 rows of 3 slots. If you can use numbers divisible by 9 as slots into a chest system, I bet you can open a dispenser inventory and only set 1 row for it.
     
    maxben34 likes this.
  21. Offline

    sgavster

    Maulss The question is.. How o-o
     
  22. Offline

    Maulss

    Actually I think they used direct Minecraft code (NMS or something), I don't think CraftBukkit supports this.
     
  23. Offline

    iiHeroo


    net.minecraft.server

    It breaks every update too, if I'm correct, never used it :OOOOO
     
  24. Offline

    xTrollxDudex

    Maulss
    CraftBukkit is an NMS wrapper, how could it not work?
     
  25. Offline

    Garris0n

    He probably meant the API.

    And I'm pretty much positive this isn't possible, unless there's some sort of little-known exploit I've never heard of. Are you sure it wasn't just a texture pack?
     
  26. Offline

    Blah1

    Post a screenshot
     
Thread Status:
Not open for further replies.

Share This Page