GlowstoneMC / Glowstone

A fast, customizable and compatible open source server for Minecraft: Java Edition
https://glowstone.net
Other
1.88k stars 270 forks source link

UnsupportedOperationException when opening DoubleChest #1071

Closed PayDevD closed 4 years ago

PayDevD commented 4 years ago

Title: UnsupportedOperationException when opening DoubleChest

Glowstone build: #1068

When I try to open DoubleChest, the error occurred then didn't open it.

16:54:47 [심각] Error while handling BlockPlacementMessage(x=-62, y=66, z=37, direction=2, hand=0, cursorX=0.014901343, cursorY=0.52474195, cursorZ=0.0625) (handler: BlockPlacementHandler)
java.lang.UnsupportedOperationException
        at java.util.Collections$UnmodifiableCollection.add(Unknown Source)
        at net.glowstone.util.collection.SuperCollection.add(SuperCollection.java:116)
        at net.glowstone.inventory.GlowInventory.addViewer(GlowInventory.java:111)
        at net.glowstone.inventory.GlowDoubleChestInventory.addViewer(GlowDoubleChestInventory.java:51)
        at net.glowstone.entity.GlowHumanEntity.addViewer(GlowHumanEntity.java:456)
        at net.glowstone.entity.GlowHumanEntity.openInventory(GlowHumanEntity.java:372)
        at net.glowstone.entity.GlowPlayer.openInventory(GlowPlayer.java:3111)
        at net.glowstone.entity.GlowHumanEntity.openInventory(GlowHumanEntity.java:359)
        at net.glowstone.block.blocktype.BlockChest.blockInteract(BlockChest.java:125)
        at net.glowstone.net.handler.play.player.BlockPlacementHandler.handleRightClickBlock(BlockPlacementHandler.java:116)
        at net.glowstone.net.handler.play.player.BlockPlacementHandler.handle(BlockPlacementHandler.java:100)
        at net.glowstone.net.handler.play.player.BlockPlacementHandler.handle(BlockPlacementHandler.java:24)
        at com.flowpowered.network.session.BasicSession.handleMessage(BasicSession.java:80)
        at com.flowpowered.network.session.BasicSession.messageReceived(BasicSession.java:136)
        at net.glowstone.net.GlowSession.pulse(GlowSession.java:418)
        at java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(Unknown Source)
        at net.glowstone.net.SessionRegistry.pulse(SessionRegistry.java:23)
        at net.glowstone.scheduler.GlowScheduler.pulse(GlowScheduler.java:188)
        at net.glowstone.scheduler.GlowScheduler.lambda$start$0(GlowScheduler.java:122)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Can I handle this issue?

KisaragiEffective commented 4 years ago

note: Immutable collection error