MC version: 1.15.2
Forge Version: 31.1.27
Mod version: 1.15.2-1.0.0
Config: (default settings - relevant setting: flight = true)
When flight is enabled, equipping a Rhodonite armor item crashes the player. Turning off flight avoids the issue.
Example stack trace:
[25Mar2020 00:01:54.867] [Server thread/WARN] [net.minecraft.network.NetworkSystem/]: Failed to handle packet for /127.0.0.1:60399
net.minecraft.crash.ReportedException: Ticking player
at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:424) ~[?:?]
at net.minecraft.network.play.ServerPlayNetHandler.func_73660_a(ServerPlayNetHandler.java:183) ~[?:?]
at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:228) ~[?:?]
at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:135) [?:?]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:866) [?:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:329) [?:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:784) [?:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:637) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.NoSuchMethodError: net.minecraft.entity.player.PlayerInventory.func_70440_f(I)Lnet/minecraft/item/ItemStack;
at com.vincentmet.rhodonite.armor.RhodoniteBoots.onArmorTick(RhodoniteBoots.java:34) ~[?:1.15.2-1.0.0]
at net.minecraftforge.common.extensions.IForgeItemStack.onArmorTick(IForgeItemStack.java:289) ~[?:?]
at net.minecraft.entity.player.PlayerInventory.lambda$tick$0(PlayerInventory.java:269) ~[?:?]
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?]
at net.minecraft.entity.player.PlayerInventory.func_70429_k(PlayerInventory.java:269) ~[?:?]
at net.minecraft.entity.player.PlayerEntity.func_70636_d(PlayerEntity.java:505) ~[?:?]
at net.minecraft.entity.LivingEntity.func_70071h(LivingEntity.java:2104) ~[?:?]
at net.minecraft.entity.player.PlayerEntity.func_70071h(PlayerEntity.java:233) ~[?:?]
at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:361) ~[?:?]
... 8 more
MC version: 1.15.2 Forge Version: 31.1.27 Mod version: 1.15.2-1.0.0 Config: (default settings - relevant setting: flight = true)
When flight is enabled, equipping a Rhodonite armor item crashes the player. Turning off flight avoids the issue.
Example stack trace: [25Mar2020 00:01:54.867] [Server thread/WARN] [net.minecraft.network.NetworkSystem/]: Failed to handle packet for /127.0.0.1:60399 net.minecraft.crash.ReportedException: Ticking player at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:424) ~[?:?] at net.minecraft.network.play.ServerPlayNetHandler.func_73660_a(ServerPlayNetHandler.java:183) ~[?:?] at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:228) ~[?:?] at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:135) [?:?] at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:866) [?:?] at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:329) [?:?] at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:784) [?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:637) [?:?] at java.lang.Thread.run(Thread.java:834) [?:?] Caused by: java.lang.NoSuchMethodError: net.minecraft.entity.player.PlayerInventory.func_70440_f(I)Lnet/minecraft/item/ItemStack; at com.vincentmet.rhodonite.armor.RhodoniteBoots.onArmorTick(RhodoniteBoots.java:34) ~[?:1.15.2-1.0.0] at net.minecraftforge.common.extensions.IForgeItemStack.onArmorTick(IForgeItemStack.java:289) ~[?:?] at net.minecraft.entity.player.PlayerInventory.lambda$tick$0(PlayerInventory.java:269) ~[?:?] at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] at net.minecraft.entity.player.PlayerInventory.func_70429_k(PlayerInventory.java:269) ~[?:?] at net.minecraft.entity.player.PlayerEntity.func_70636_d(PlayerEntity.java:505) ~[?:?] at net.minecraft.entity.LivingEntity.func_70071h(LivingEntity.java:2104) ~[?:?] at net.minecraft.entity.player.PlayerEntity.func_70071h(PlayerEntity.java:233) ~[?:?] at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:361) ~[?:?] ... 8 more
References:
"InventoryPlayer#armorItemInSlot is client-side only. Use EntityPlayer#getItemStackFromSlot" (https://www.minecraftforge.net/forum/topic/65662-ifplayerinventoryarmoriteminslot-crash-on-server/)
"armorItemInSlot is a client-sided method. All you need to do is change it to armorInventory.get" (https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/modification-development/2945893-armor-w-effects-crashes-player-on-servers-resolved)