Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display inconsistency fix #200

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.bukkit.entity.Player
import org.bukkit.inventory.ItemStack

class PacketHeldWindowItems(plugin: EcoPlugin) :
AbstractPacketAdapter(plugin, PacketType.Play.Server.WINDOW_ITEMS, false) {
AbstractPacketAdapter(plugin, PacketType.Play.Server.HELD_ITEM_SLOT, false) {
override fun onSend(
packet: PacketContainer,
player: Player,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,17 @@ class PacketWindowItems(plugin: EcoPlugin) : AbstractPacketAdapter(plugin, Packe

val windowId = packet.integers.read(0)

if (windowId != 0) {
/*When things are working well, windowId is non-zero
* but occasionally this onsend method is called
* more than once with the additional calls having
* a windowId of 0. Those additional calls didn't
* allow the DisplayFrame to be set to empty and
* caused the display to break for tiers and enchants
* -Bradarr */

//if (windowId != 0) {
player.lastDisplayFrame = DisplayFrame.EMPTY
}
//}

val itemStacks = packet.itemListModifier.read(0) ?: return

Expand Down