Inactive [DEV] BukkitContrib Alpha 0.1.7 [1000]

Discussion in 'Inactive/Unsupported Plugins' started by Afforess, May 22, 2011.

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

    Afforess

    BukkitContrib is superseded by Spout, the new Bukkit/Client framework.
     
  2. Any chance on exposing the number of rows to display for openInventory()? Or is that calculated automatically by the given Inventory?
    Edit: also window titles for "chests"
     
  3. Offline

    Afforess

    The display procedure is all handled client side. If the inventory size is < 36 slots, it displays as many as possible. > 36, and it displays only slots 0...35.

    I can certainly expose that.

    Edit: Also, Added download link.
     
    waxdt likes this.
  4. @Afforess LOL, when I loaded it there was no download link, refreshed, and there it is :)

    @Afforess I made a test plugin that sweeps the inventory for TNT when if closes, and it works :)
    But what is this?
    Code:
    00:20:36 [INFO] Clicked: 13
    00:20:37 [INFO] Clicked: 14
    00:20:39 [INFO] Clicked: 15
    00:20:40 [INFO] Clicked: 16
    00:20:42 [INFO] Clicked: 17
    00:20:43 [INFO] Clicked: 12
    00:20:48 [INFO] Clicked: 12
    00:20:50 [INFO] Clicked: 13
    
    I'm guessing it is the inventory slot numbers, if not, why is it appearing?

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

    Afforess

    Also, I'd like to point out that the title for the bottom inventory is not controlled by the server, at least not at the moment. But I can expose a way to set the inventory name.

    Leftover debug code, I guess I forgot to remove it all. Yes, it's the slot. I'll remove it next release.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  6. I was referring to the slots in the packet, but upon checking out the source code, it looks like you're not doing it that way.

    Wait what? you can set the title for chests through the packet, but yea see above
     
  7. Offline

    Afforess

    No, I'm not.

    Chests are the top half of the screen though. If you change both titles, for example, only the inventory on top's changed name will be seen.
     
  8. ...which is exactly what I asked for.

    Anyway, the way you're doing it doesn't give any of the control I'll be needing, so... I'll probably have to do this my own way whenever I get to that point.
     
  9. Offline

    Afforess

    What type of control do you need?
     
  10. Packet modifying things.
     
  11. Offline

    Afforess

    That's not very specific...
     
  12. Well I can already see by the code you've written that you're not going in that direction.
     
  13. @Afforess It seems that when you scan an inventory for items when the inventory is closed, and you give yourself items and put them in a chest, they will no longer react on inventory close events. But if you throw them on the ground and pick them back up, they do once more. (sorry if that sounded stupid)

    @Afforess To be more specific than above, here you go:
    I have a plugin that I made just now that checks to see if each item slot in the inventory contains a blacklisted id. If id does, it clears the inventory of that ID and sends the player a message. That part works fine. BUT, when I /give myself some tnt, which is blacklisted, and put it in a chest, then close the chest, open it, and take it out, the TNT is no longer taken away when I close my inventory. IDK if this is completely my fault, if it is, I'm sorry.

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

    Afforess

    I'm not sure I follow... Can you list how to reproduce it in steps?

    Edit: Nvm, reading your reply.

    Okay, I think I know why. When the next inventory close occurs, it gives the inventory of the chest, not the player. Ideally, Inventory Open and Inventory Close should have both the inventories in the event. I'll fix that.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  15. @Afforess It seems to be working :p

    @Afforess This is taken totally out of context because I just happened to glance at the console and see this:
    Code:
    11:38:53 [SEVERE] Could not pass event PLAYER_INTERACT to BukkitContrib
    java.lang.ClassCastException: org.bukkit.craftbukkit.entity.CraftPlayer cannot be cast to org.bukkitcontrib.player.ContribCraftPlayer
        at org.bukkitcontrib.ContribPlayerListener.onPlayerInteract(ContribPlayerListener.java:46)
        at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:280)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:289)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
        at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:207)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:526)
        at net.minecraft.server.Packet15Place.a(SourceFile:57)
        at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:372)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:287)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    11:39:11 [SEVERE] Could not pass event PLAYER_INTERACT to BukkitContrib
    java.lang.ClassCastException: org.bukkit.craftbukkit.entity.CraftPlayer cannot be cast to org.bukkitcontrib.player.ContribCraftPlayer
        at org.bukkitcontrib.ContribPlayerListener.onPlayerInteract(ContribPlayerListener.java:46)
        at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:280)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:289)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
        at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:207)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:526)
        at net.minecraft.server.Packet15Place.a(SourceFile:57)
        at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:372)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:287)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  16. Offline

    Afforess

    Thanks, I'll take care of it.
     
  17. Offline

    DiddiZ

    Wow, sounds interesting. Will try whether I can use it for LB chest logging.
     
  18. Offline

    PatrickFreed

    Afforess you should be on the bukkit team :cool:
     
  19. Offline

    Afforess

    But then I would be the man, and who would I rail against? ;)
     
  20. Offline

    DiddiZ

    Works just fine :)
    Thank you so much.

    Could you please remove that debug message soon?
    Can imagine many people yelling at me when I release chest logging for LB and there is that message spamming.
    Furthermore may I include this plugin into the LB zip or shall I provide the download link?
     
  21. Offline

    Afforess

    1.) I'll be releasing Alpha 0.0.2 this evening, sans debug message.

    2.) Legally, you are free to include this plugin in your source, as long as I am credited with the work. BC is licensed CC 3.0, which lets you do pretty much whatever you want, so long as I get my name in the credits. I certainly won't be offended or anything if you do. However, I don't recommend it, since it is still in active development. I don't plan on breaking the API with new releases (or at least will deprecate first), but new releases may fix bugs, etc, etc.

    Alternatively, you could provide the link and use the "depend: [BukkitContrib]" in your plugin.yml. Then your plugin will not start unless BukkitContrib has already been started.

    Updated BukkitContrib to Alpha 0.0.2, changelog is on the OP.

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

    DiddiZ

    Nice :D
    Thanks for the statement. I prefer to ask before do someting.
    Hm, api breaks would be a pro for including.
    It should be optional, but do you know anything about soft dependcies? I belive to heard some like that ...
     
  23. Offline

    Afforess

    Yeah, use "softdepend: [BukkitContrib]".
     
  24. Offline

    DiddiZ

    Does it have any effect?
     
  25. Offline

    Afforess

    It simply makes your plugin load AFTER the listed plugins. Useful for things like Permissions, I suppose.
     
    DiddiZ likes this.
  26. Offline

    rhinorulz

    sorry I give internets the old way. +5 internets for making internetscool again outside of /4/
     
  27. Offline

    Archelaus

    @Afforess
    How did you avoid the problem of the inventory not updating? I've had problems with the inventory spewing weird results with the Heroes one.
     
  28. Offline

    Afforess

    The final result of the action (see the variable"clickSuccess") is what controls what happens after the packet is processed. If the packet change is accepted as-is (default -> passed through without being cancelled, etc., etc.), then you should process the top half of the clickSuccess statement (clickSuccess = true). If not, the bottom half sends a packet back to the client informing it of failure, and then updates the crafting inventory. I never really had the problem of the inventory not updating, but I'd bet that it's what is happening with you handling the packet wrong.

    Of course, I encourage you to not re-invent the wheel and just use BukkitContrib. ;)
     
  29. Offline

    Archelaus

    I'm not in charge of the inventory hooks. Rigby has decided to continue to use his own hooks for now.
     
Thread Status:
Not open for further replies.

Share This Page