PluginBugs / Issues-ItemsAdder

Repository used to keep track of issues of my plugin ItemsAdder
https://itemsadder.devs.beer
52 stars 21 forks source link

MMOitems integration problems on player join (Packet too large kick) #2278

Closed Millionary closed 1 year ago

Millionary commented 1 year ago

Terms

Discord tag (optional)

Millionary#3711

What happened?

I updated to 1.19.3 and the integration with MMOitems is causing trouble. I have many tools created with ItemsAdder and hooked to MMOitems, the problem is that if i have all my tools the server doesn't let me join becouse of the Packet Too Large Exception even if the "fix-packet-too-large-kick" option it's set to true.

When i remove many of the Items Adder items hooked to MMOitems the problem is solved.

I have aproximately 364 Items hooked to MMOitems, when i remove 140 (from my Trees wooden tools) the problem get fixed.

Steps to reproduce the issue

  1. Update to 1.19.3 from 1.19.2
  2. Update ItemsAdder to 3.3.0b-r5 from 3.3.0b-r2
  3. Update MMOitems to 6.9.1 from 6.8.2 (MythicLib too)
  4. Try to join the server and recieve "Internal Exception: net.minecraft.networkPacketEncoder$PacketTooLargeException: PacketTooLarge - PacketPlayOutRecipeUpdate is 3588901. Max is 2097152
  5. Can't join the server

Server version

This server is running Paper version git-Paper-380 (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT) (Git: 0ed4b91)

ItemsAdder Version

ItemsAdder version 3.3.0b-r5

ProtocolLib Version

ProtocolLib version 5.0.0-SNAPSHOT-b612

LoneLibs Version

LoneLibs version 1.0.23

LightAPI Version (optional)

LightAPI version bukkit-5.3.0 (build SNAPSHOT)

LibsDisguises Version (optional)

No response

FULL server log

latest.log

Error (optional)

[15:34:56 WARN]: [ItemsAdder] Cleaned 2614 recipes.
[15:34:56 WARN]: [ItemsAdder] Cleaned 3717 NBT.
[15:34:56 WARN]: [ItemsAdder] Time -1258095632826 ms.
[15:34:56 ERROR]: Could not pass event PlayerJoinEvent to MagicCosmetics v2.1.9
java.util.NoSuchElementException: decoder
        at io.netty.channel.DefaultChannelPipeline.getContextOrDie(DefaultChannelPipeline.java:1073) ~[netty-transport-4.1.87.Final.jar:4.1.87.Final]
        at io.netty.channel.DefaultChannelPipeline.addAfter(DefaultChannelPipeline.java:302) ~[netty-transport-4.1.87.Final.jar:4.1.87.Final]
        at io.netty.channel.DefaultChannelPipeline.addAfter(DefaultChannelPipeline.java:290) ~[netty-transport-4.1.87.Final.jar:4.1.87.Final]
        at com.francobm.magicosmetics.models.v1_19_R2.PacketReaderHandler.inject(PacketReaderHandler.java:35) ~[MagicCosmetics-2.1.9.jar:?]
        at com.francobm.magicosmetics.listeners.PlayerListener.onJoin(PlayerListener.java:46) ~[MagicCosmetics-2.1.9.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor857.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:git-Paper-380]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:672) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.players.PlayerList.placeNewPlayer(PlayerList.java:319) ~[paper-1.19.3.jar:git-Paper-380]
        at net.minecraft.server.network.ServerLoginPacketListenerImpl.placeNewPlayer(ServerLoginPacketListenerImpl.java:202) ~[?:?]
        at net.minecraft.server.network.ServerLoginPacketListenerImpl.handleAcceptedLogin(ServerLoginPacketListenerImpl.java:183) ~[?:?]
        at net.minecraft.server.network.ServerLoginPacketListenerImpl.tick(ServerLoginPacketListenerImpl.java:85) ~[?:?]
        at net.minecraft.network.Connection.tick(Connection.java:585) ~[?:?]
        at net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:233) ~[?:?]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1565) ~[paper-1.19.3.jar:git-Paper-380]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:440) ~[paper-1.19.3.jar:git-Paper-380]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1397) ~[paper-1.19.3.jar:git-Paper-380]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[paper-1.19.3.jar:git-Paper-380]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.19.3.jar:git-Paper-380]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
[15:34:57 INFO]:  >  Millionary
[15:34:57 WARN]: [MMOCore] Plugin MMOCore v1.11.1 generated an exception while executing task 10301
java.lang.NullPointerException: Player is offline
        at java.util.Objects.requireNonNull(Objects.java:233) ~[?:?]
        at io.lumine.mythic.lib.api.player.MMOPlayerData.getPlayer(MMOPlayerData.java:227) ~[MythicLib-1.5.jar:?]
        at io.lumine.mythic.lib.api.stat.handler.AttributeStatHandler.getBaseValue(AttributeStatHandler.java:73) ~[MythicLib-1.5.jar:?]
        at io.lumine.mythic.lib.manager.StatManager.getBaseValue(StatManager.java:98) ~[MythicLib-1.5.jar:?]
        at io.lumine.mythic.lib.api.stat.StatInstance.getBase(StatInstance.java:33) ~[MythicLib-1.5.jar:?]
        at net.Indyuce.mmocore.api.player.stats.PlayerStats.updateStats(PlayerStats.java:85) ~[MMOCore-1.11.1.jar:?]
        at net.Indyuce.mmocore.manager.data.PlayerDataManager.lambda$setup$2(PlayerDataManager.java:88) ~[MMOCore-1.11.1.jar:?]
        at org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.19.3.jar:git-Paper-380]
        at org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.19.3.jar:git-Paper-380]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.19.3.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Magic Cosmetics and MMOcore doesn't cause the trouble, i try it without those two and it's the same.

Problematic items yml configuration file (optional)

metrics: true
update-checker: true
disable-plugin-loading-messages_DONT_ASK_ME_FOR_SUPPORT_IF_YOU_SET_TRUE__THANKS: false
ignore-server-compatibility-check: false
resource-pack:
  hosting:
    no-host:
      enabled: false
    auto-external-host:
      enabled: false
    self-host:
      enabled: true
      server-ip: 127.0.0.1
      pack-port: 8163
    external-host:
      enabled: false
      url: ''
      skip-url-file-type-check___DONT_ASK_HELP_IF_SET_TRUE: false
  apply-on-join: true
  kick-player-on-decline: true
  kick-player-on-fail: true
  delay-ticks: 1
  notify-other-plugins-interfering: true
  title:
    enabled: true
  1_19_3_atlas_support: true
  protect-player:
    black-screen: true
    hide-hud: true
    cancel-movement: true
    lock-player: true
  command:
    usage-cooldown-seconds: 60
  custom-font:
    enabled: false
    name: ipaexg.ttf
    shift: '[0,0]'
    size: 11.0
    oversample: 2.0
  thin-font:
    enabled: false
  zip:
    protect-file-from-unzip:
      protection_1: true
      protection_2: true
    compress-png-files: true
    compress-json-files: false
    generate-custom-armors-textures:
      vanilla_1_17: true
      optifine: true
    disable-overwrite-leather-armor-layers-textures: false
    fix_transparent_noteblocks: true
    ignore-files-ext:
    - db
    - yml
    - xcf
    - psd
    - html
    - gz
    - rar
    - zip
    - 7z
    extract_internal_utility_assets: true
    contents-folders-priority:
    - vanilla
    - _iainternal
  items:
    CustomModelData-starting-value:
      ALL: 10000
      DIAMOND: 11000
config_files:
  lang: es
  dictionaries-lang: es
  force-sync-loading: false
blocks:
  light-api: true
  fix-liquids-flow: true
  fix-floating-blocks: true
  fix-glitched-blocks:
    enabled: true
    only-new-chunks: false
  cancel-break-wrong-tool:
    enabled: true
    send-actionbar: true
  campfire:
    unlit-on-place: true
    allow-any-item: true
  disable-REAL: false
  disable-REAL_NOTE: false
  disable-REAL_TRANSPARENT: false
  disable-REAL_WIRE: false
  disable-FIRE: false
  convert-vanilla-blocks:
    enabled: false
    only-new-chunks: true
items:
  fix-show-attack-and-damage-as-lore: true
  give_death_location_maps: true
  hide-custom-durability-lore: false
liquids:
  enabled: true
huds:
  enabled: true
loots:
  allow-loots-drop-from-spawners-using-silk-touch: false
mobs:
  disable-MOB-behaviour__DISABLE_AT_YOUR_OWN_RISK: false
chat-preview: false
font_images:
  replace-in-customitems-name-and-lore: true
  chat:
    enabled: true
    doublecheck-permission__disable-for-more-performance: false
    add-hover-suggestion: true
    tab-autocompletion_1_19_1_plus: true
  command:
    enabled: true
    commandblocks: true
    excluded:
    - home
    - sethome
    - tpa
  sign:
    enabled: true
  book:
    enabled: true
  anvil:
    enabled: true
  inventory-title:
    enabled: true
  vault-prefix-suffix:
    enabled: true
    update-every-ticks: 1200
  scoreboard-teams:
    enabled: false
    update-every-ticks: 3600
  player-display-name:
    enabled: true
    update-every-ticks: 1200
effects:
  hide-scoreboard-numbers: true
  text-effects:
    enabled: true
    replace-in-customitems-name-and-lore: true
    chat:
      enabled: true
    sign:
      enabled: true
    book:
      enabled: true
    anvil:
      enabled: true
entities:
  max-furniture-vehicles-per-chunk: 16
  allow-removing-old-furnitures_2_3_11: false
  custom-entitites:
    enabled: true
    emotes: true
    interval-rendering-packets-ticks: 1
    optimized-packets: true
recipes:
  hide-vanilla-unrecognized-recipe-errors: true
  fix-packet-too-large-kick: true
  show-no-permission-popup-in-recipebook: true
  show-no-permission-chat-message: false
  custom-recipes:
    unlock:
      all-on-join: true
      on-pickup:
        any: true
        ingredients: true
  remove-vanilla-recipes:
    enabled: false
    list:
      DIAMOND_SWORD: false
      IRON_INGOT: false
debug:
  benchmark: false
  items:
    log-files-loading: false
    log-items-loading: false
    log-items-loading-disabled: false
    log-font-images-loading: false
    log-huds-loading: false
    log-attribute-modifiers-loading: false
    log-warnings: false
    log-loots-loading: false
    log-loots-loading-disabled: false
    log-armors-loading: false
  recipes:
    log-recipes-loading: false
    log-recipes-loading-disabled: false
    log-recipes-removed-vanilla: false
    log-recipes-unknown-item: false
    log-fix-packet-too-large: true
  resource-pack:
    log-extract-default-resources: false
    log-not-extract-default-resources-already-exist: false
  blocks:
    log-save: false
    log-save-on-unload: false
    log-mined-unknown-blocks: true
    log-convert-vanilla-blocks: false
    log-unusual-block-break: false
  worlds-populators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-populators: false
    log-loading-no-world: true
    log-generation: false
  trees-populators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-populators: false
    log-loading-no-world: true
    log-generation: false
  surface-decorators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-decorators: false
    log-loading-no-world: true
    log-generation: false
  cave-decorators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-decorators: false
    log-loading-no-world: true
    log-generation: false
  player-stats:
    log-save: false
  performance:
    loading-ms: true
  huds:
    log-triggers: false
  other:
    log-dictionaries-loading: false
    log-liquids-loading: false
    log-minecraft_lang_overwrite-loading: false
  categories:
    log-total-loaded: true
    log-single-loaded: false
    log-single-loaded-overwrite: false
    log-single-skip: false
    log-icon-failed-load: false
  entities:
    log-files-loading: false
    log-entities-loading: false
    log-entities-loading-disabled: false

Other files, you can drag and drop them here to upload. (optional)

No response

Screenshots/Videos (you can drag and drop files or paste links)

Demostration video: https://youtu.be/HN_0eW9GV2A

This is ItemsAdder with all the elements from my trees:

image

And this is without it:

image

140 items from those are tools hooked to MMOitems, without those the bug get fixed

Millionary commented 1 year ago

There's two ways to "fix" the bug, delete all MMOitems or remove some IA items as i do in the video.

dinobossytnew commented 1 year ago

@LoneDev6 This problem is still going on.

LoneDev6 commented 1 year ago

Well seems you have an insane amount of recipes. Please install this and post the log.

https://www.spigotmc.org/resources/recipescount.98632/

Millionary commented 1 year ago
[11:57:23 INFO]: [RecipesCount] [STDOUT] Total recipes: 4174
[11:57:23 WARN]: Nag author(s): '[]' of 'RecipesCount' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger).
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_decoradores -> 47
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_ciruela -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_almendro -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_roble_ancestral -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_roble -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_naranja -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_bananero -> 54
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_jacaranda -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_durazno -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_aguacate -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_roble -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_secoya -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_pera -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    crafteos -> 40
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_cerezo -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_armaduras -> 21
[11:57:23 INFO]: [RecipesCount] [STDOUT]    minerales -> 136
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_purificadores_de_agua -> 3
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_crafteos -> 40
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_mango -> 54
[11:57:23 INFO]: [RecipesCount] [STDOUT]    decoradores -> 47
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_variantes_de_maderas -> 231
[11:57:23 INFO]: [RecipesCount] [STDOUT]    customcrafting -> 153
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_bananero -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_aguacate -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    minecraft -> 1089
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_baobab -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    betterbackpacks -> 6
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_naranja -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_roble_ancestral -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_ciruela -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    variantes_de_maderas -> 231
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_cipres -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_maple -> 50
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_limon -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_almendro -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_baobab -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    customcrops -> 9
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_olivo -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_maple -> 54
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_cipres -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_mango -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_aspen -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_customcrops -> 9
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_palmera -> 49
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_palmera -> 53
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_minerales -> 74
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_olivo -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    purificadores_de_agua -> 6
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_jacaranda -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_aspen -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_secoya -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_cerezo -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    arbol_durazno -> 52
[11:57:23 INFO]: [RecipesCount] [STDOUT]    armaduras -> 21
[11:57:23 INFO]: [RecipesCount] [STDOUT]    extractableenchantments -> 1
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_limon -> 48
[11:57:23 INFO]: [RecipesCount] [STDOUT]    zzzfake_arbol_pera -> 48
Millionary commented 1 year ago

What is the zzzfake namespace? It seems like some namespaces are duplicated

Millionary commented 1 year ago

I don't think the number of recipes is the cause because even with all the items but without the MMOitems the server allows me to access normally

Millionary commented 1 year ago

If this haven't a solution i will delete the recipes and put them into a custom table (a block/furniture trade machine)

Delete many of the recipes "fix" the problem but it still going wrong with crafting table recipes @LoneDev6

Millionary commented 1 year ago

This only happen when the itemsadder items are hooked into mmoitems, without the hook there's no problem When there aren't any MMOitems items the recipes work fine

LoneDev6 commented 1 year ago

This is not the complete list of the output of the RecipesCount plugin.

What is the zzzfake namespace? It seems like some namespaces are duplicated

It's an internal thing of ItemsAdder and is not the cause of the "Packet too large kick" problem since they are not even sent to the client.

This problem happens because you have a lot of recipes which have ingredients and results with big NBT data (display name, lore, attributes). The game duplicates these items on e bugach recipe even if they are the same item, it's stupid but it's how it works. ItemsAdder implemented a workaround fix for that Minecraft bug which can be enabled in config.yml fix-packet-too-large-kick: true. If that doesn't work it means that you have somehow reached the limit anyway because of the high amount of items in recipes.

It's the only explanation I can give: the recipes list+ingredients packet is too large.

More info here: https://github.com/PluginBugs/Issues-ItemsAdder/issues/1838

LoneDev6 commented 1 year ago

Duplicate of https://github.com/PluginBugs/Issues-ItemsAdder/issues/1838

Millionary commented 1 year ago

@LoneDev6 thanks for the explanation, i will transfer the recipes to block/furniture trade machines, that solves the problem because the items are very complex with a lot of data from MMOitems, apreciate your time and pacience, love your plugin ;)

LoneDev6 commented 1 year ago

No problem! I just wish Mojang didn't structure the recipes packet in that stupid way. Like yea let's send all recipes in a single go XD They might fix in the future, Fabric already fixed this in a patch.

Have a nice week!