Bukkit, CraftBukkit, Spigot & BungeeCord 1.14.4 Development Builds

Discussion in 'News and Announcements' started by md_5, Apr 23, 2019.

  1. @Maximvdw could you verify if player teleport event is called before player join event?
     
  2. Thank you so much md_5, all your hard work is incredibly appreciated and we can’t say thank you enough!
     
    • Friendly Friendly x 1
  3. omg, we don't have a final release yet!?!?! Im kidding of course, but be prepared for it lol

    Great work MD5 and all other devs involved.
     
  4. It seems that getName() is missing or moved in the InventoryClickEvent (event.getInventory().getName()) ??? or where do I find the Inventory name?
     
    • Agree Agree x 2
  5. I'm also searching for that. :unsure:

    Code (Text):
    e.getClickedInventory().getType().getDefaultTitle()
    That only returns "Chest" as it's the default title obv.
     
  6. Thank you for your always amazing work, you are amazing!
     
  7. InventoryView#getTitle is the new location.
     
    • Informative Informative x 6
  8. thanks @md_5 for the update!

    btw seems something is changed in NBT key add/set methods, am I wrong?
    Code (Text):
    java.lang.NoSuchMethodException: net.minecraft.server.v1_14_R1.NBTTagList.add(net.minecraft.server.v1_14_R1.NBTBase)
    1.14:
    [​IMG]
    1.13.2:
    [​IMG]
     
  9. Is there a way to get the InventoryView from InventoryClickEvent or do I have to save the InventoryView while opening the inventory?
     
  10. I only have Inventory#getViewers which is a list of HumanEntity. Looks like I have to call
    getOpenInventory on the player then

    //Edit

    Indeed, that works! Thank you!
    Code (Text):
    e.getClickedInventory().getViewers().forEach(entity -> {
                System.out.println(entity.getOpenInventory().getTitle());
            });
     
    • Informative Informative x 3
  11. Slightly simpler method; InventoryClickEvent#getView thought it was part of Inventory instead of InventoryClickEvent for some reason.
     
    • Agree Agree x 2
    • Informative Informative x 1
    • Useful Useful x 1
  12. Choco

    Moderator

    NMS is unsupported. You're on your own to reverse engineer what that int does. Though based on the declaration alone, it's likely similar to List#add(int, E)
     
    • Winner Winner x 1
    • Useful Useful x 1
  13. Fixed.
    Just call the function setting var0 to 0

    Another question:
    Does anyone got this too?
    Code (Text):
    java.lang.IllegalStateException: PrepareItemCraftEvent cannot be triggered asynchronously from another thread.
     
    • Winner Winner x 1
  14. Yes that's the same.

    See:
     
  15. Found the problem, I call this in the event:
    Code (Text):
    Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(plugin, () -> {
                    e.getInventory().setMatrix(matrix);
                }, 0);
    In 1.13 used to work, is there a way to make it working without getting the "PrepareItemCraftEvent cannot be triggered asynchronously from another thread." error? I really need this since it's useful on my plugin logic.
     
  16. Choco

    Moderator

    Don't run it asynchronously. There should be no reason to have done that to begin with. Run it sync. Bukkit 1.14 enforces synchronous/asynchronous event calling, as mentioned in the OP
     
    • Agree Agree x 1
  17. Thanks! Interesting. Seems it works good calling it without async thread trick I used in 1.13, good!

    Another question:
    Is it normal that I get an exception when clicking on double chest virtual inventories?

    Code (Text):
    ava.lang.IndexOutOfBoundsException: Index: 69, Size: 63
            at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_161]
            at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_161]
            at net.minecraft.server.v1_14_R1.Container.getSlot(Container.java:170) ~[spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1989) ~[spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.PacketPlayInWindowClick.a(SourceFile:33) ~[spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.PacketPlayInWindowClick.a(SourceFile:10) ~[spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:13) ~[spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) ~[spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.h(SourceFile:135) [spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.h(SourceFile:23) [spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.p(SourceFile:114) [spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.MinecraftServer.aW(MinecraftServer.java:876) [spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.MinecraftServer.p(MinecraftServer.java:869) [spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.c(SourceFile:123) [spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:853) [spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:793) [spigot1.14.jar:git-Spigot-6dbf995-364b6fb]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_161]
    I don't know if it's a bug in my inventory system, but I also noticed last row in inventory is not rendered (items are there since I can click with buttons in the area and actions gets called).

    Also another "bug", if you call this while player has double chest inventory opened, items gets added to hotbar and bottom inventory:
    Code (Java):
    player.getInventory().addItem(item);
    I also tried to call this to avoid duplication with no luck:
    Code (Java):
    player.getOpenInventory().getBottomInventory().addItem(item);

    Omg, maybe i've understood, seems player inventory now has higher size in 1.14 and bugs out other inventories when opened, am I wrong?
     
    #137 LoneDev, Apr 23, 2019
    Last edited: Apr 23, 2019
  18. From what I can tell so far:
    It appears the following things are fixed in 1.14-Pre5
    1) Carpet duping (finally)
    2) rail duping (also finally)
    3) 0 tick block updates (seem mostly fixed)

    Not Fixed:
    1) TNT Duping is alive and well in 1.14
    2) Bedrock Destruction also works in 1.14
     
    #138 dNiym, Apr 23, 2019
    Last edited: Apr 23, 2019
    • Like Like x 1
  19. Same thing for me, the last 3 rows are not rendered and just shows items the player has in his inventory.

    [​IMG]
     
    • Agree Agree x 2

  20. Clearly a duplication bug