This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
What steps will reproduce the problem?1. Install and setup ChessCraft boards2. Restart the server3. Attempt to play vs AI4. AI doesn't move
What is the expected output? What do you see instead?Expected output is AI plays the game. What I am seeing is the AI not making any moves. Also when playing other players board isn't resetting at game end. In both cases the move clock doesn't seem to be counting.
What version of the product are you using?2.4.2
Do you have an error log of what happened?
2013-12-05 18:14:48 [INFO] [ChessCraft] Enabling ChessCraft v2.4.22013-12-05 18:14:48 [WARNING] [ChessCraft] Citizens plugin not detected: entity-based chess sets will not be available2013-12-05 18:14:48 [SEVERE] Error occurred while enabling ChessCraft v2.4.2 (Is it up to date?)java.lang.NullPointerException at org.bukkit.craftbukkit.v1_6_R3.block.CraftSign.<init>(CraftSign.java:17) at org.bukkit.craftbukkit.v1_6_R3.block.CraftBlock.getState(CraftBlock.java:243) at me.desht.chesscraft.controlpanel.AbstractSignLabel.repaint(AbstractSignLabel.java:114) at me.desht.chesscraft.controlpanel.ControlPanel.repaintSignButtons(ControlPanel.java:156) at me.desht.chesscraft.controlpanel.ControlPanel.repaintControls(ControlPanel.java:141) at me.desht.chesscraft.ChessPersistence.loadPersistedData(ChessPersistence.java:86) at me.desht.chesscraft.ChessPersistence.reload(ChessPersistence.java:38) at me.desht.chesscraft.ChessCraft.onEnable(ChessCraft.java:192) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugin(CraftServer.java:284) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.enablePlugins(CraftServer.java:266) at net.minecraft.server.v1_6_R3.MinecraftServer.l(MinecraftServer.java:315) at net.minecraft.server.v1_6_R3.MinecraftServer.f(MinecraftServer.java:292) at net.minecraft.server.v1_6_R3.MinecraftServer.a(MinecraftServer.java:252) at net.minecraft.server.v1_6_R3.DedicatedServer.init(DedicatedServer.java:152) at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:393) at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
Please provide any additional information below.
Deleting the generated ChessCraft folder and restarting the server appears to make it work correctly again. But after setting up some boards, then restarting the server, the plugin appears to stop working.
The NPE is from CraftBukkit itself, not ChessCraft. ChessCraft is trying to update the text on a sign, has found that a block is already of the WALL_SIGN material type, but the tile entity is missing - it's either been lost (world corruption) or hasn't been initialised yet.
As for why it's happening - I really don't know; I haven't seen that happen before (or had anyone else report it). A bit of research shows that this happened with other plugins in the past, but any of the possible causes don't seem to apply here (you're on an up to date version of CB, and I'm not storing any Block objects from unloaded chunks)
Anyway, I've created a debug build of ChessCraft 2.4.2 which I'd like you to try if you can: https://dl.dropboxusercontent.com/u/12467600/ChessCraft-2.4.2-chunkdbg.jar
It checks that the chunk for each sign is loaded before it tries to update it, and will warn if the chunk isn't load it (and force-load it). I'd be interested to see:
Thanks for the quick reply.
I have installed and run the debug build you have linked for me. I deleted the generated folder again, and recreated the boards. It worked the first time again, but when the server was restarted the same error appeared during start up. I ran it with with log_level fine this time to see if it reported anything that might suggest what the problem is.
2013-12-05 23:04:45 [INFO] [ChessCraft] Enabling ChessCraft v2.4.2 2013-12-05 23:04:46 [FINE] [ChessCraft] Connected to DB: SQLite 2013-12-05 23:04:46 [FINE] [ChessCraft] Loaded Vault v1.2.27-b349 2013-12-05 23:04:46 [FINE] [ChessCraft] ScrollingMenuSign plugin not detected. 2013-12-05 23:04:46 [FINE] [ChessCraft] WorldEdit plugin detected: chess board terrain saving enabled. 2013-12-05 23:04:46 [FINE] [ChessCraft] dynmap plugin detected. Boards and games will be labelled. 2013-12-05 23:04:46 [WARNING] [ChessCraft] Citizens plugin not detected: entity-based chess sets will not be available 2013-12-05 23:04:46 [FINE] [ChessCraft] loading board: plugins\ChessCraft\data\boards\1.yml 2013-12-05 23:04:46 [FINE] [ChessCraft] loaded chess set 'Standard' from plugins\ChessCraft\piece_styles\standard.yml 2013-12-05 23:04:46 [FINE] [ChessCraft] loading board: plugins\ChessCraft\data\boards\2.yml 2013-12-05 23:04:46 [FINE] [ChessCraft] loading board: plugins\ChessCraft\data\boards\3.yml 2013-12-05 23:04:46 [FINE] [ChessCraft] loading board: plugins\ChessCraft\data\boards\4.yml 2013-12-05 23:04:46 [SEVERE] Error occurred while enabling ChessCraft v2.4.2 (Is it up to date?) java.lang.NullPointerException at org.bukkit.craftbukkit.v1_6_R3.block.CraftSign.<init>(CraftSign.java:17) at org.bukkit.craftbukkit.v1_6_R3.block.CraftBlock.getState(CraftBlock.java:243) at me.desht.chesscraft.controlpanel.AbstractSignLabel.repaint(AbstractSignLabel.java:117) at me.desht.chesscraft.controlpanel.ControlPanel.repaintSignButtons(ControlPanel.java:153) at me.desht.chesscraft.controlpanel.ControlPanel.repaintControls(ControlPanel.java:138) at me.desht.chesscraft.ChessPersistence.loadPersistedData(ChessPersistence.java:85) at me.desht.chesscraft.ChessPersistence.reload(ChessPersistence.java:37) at me.desht.chesscraft.ChessCraft.onEnable(ChessCraft.java:132) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugin(CraftServer.java:284) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.enablePlugins(CraftServer.java:266) at net.minecraft.server.v1_6_R3.MinecraftServer.l(MinecraftServer.java:315) at net.minecraft.server.v1_6_R3.MinecraftServer.f(MinecraftServer.java:292) at net.minecraft.server.v1_6_R3.MinecraftServer.a(MinecraftServer.java:252) at net.minecraft.server.v1_6_R3.DedicatedServer.init(DedicatedServer.java:152) at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:393) at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
The server log contained no "Chunk XXX isn't loaded yet! Forcing load now" messages.
OK, that means the chunks that the board is on were loaded OK when ChessCraft tried to update the signs. So not a problem with a missing chunk. And it looks like the problem is happening with your board "4" (1 thru 3 seems to load OK), so there's possibly some specific problem with one or more of the chunks that "4" is in.
Not sure what else to suggest... maybe try deleting board "4" temporarily and see if the exception goes away. Then recreate the board in the same place and see what happens.
When you say "restarted", do you mean by shutting down and restarting from cold, or by doing a /reload?
I removed board 4 as suggested, same error occurs:
2013-12-06 00:18:41 [INFO] [ChessCraft] Enabling ChessCraft v2.4.2 2013-12-06 00:18:42 [FINE] [ChessCraft] Connected to DB: SQLite 2013-12-06 00:18:42 [FINE] [ChessCraft] Loaded Vault v1.2.27-b349 2013-12-06 00:18:42 [FINE] [ChessCraft] ScrollingMenuSign plugin not detected. 2013-12-06 00:18:42 [FINE] [ChessCraft] WorldEdit plugin detected: chess board terrain saving enabled. 2013-12-06 00:18:42 [FINE] [ChessCraft] dynmap plugin detected. Boards and games will be labelled. 2013-12-06 00:18:42 [WARNING] [ChessCraft] Citizens plugin not detected: entity-based chess sets will not be available 2013-12-06 00:18:42 [FINE] [ChessCraft] loading board: plugins\ChessCraft\data\boards\1.yml 2013-12-06 00:18:42 [FINE] [ChessCraft] loaded chess set 'Standard' from plugins\ChessCraft\piece_styles\standard.yml 2013-12-06 00:18:42 [FINE] [ChessCraft] loading board: plugins\ChessCraft\data\boards\2.yml 2013-12-06 00:18:42 [FINE] [ChessCraft] loading board: plugins\ChessCraft\data\boards\3.yml 2013-12-06 00:18:42 [SEVERE] Error occurred while enabling ChessCraft v2.4.2 (Is it up to date?) java.lang.NullPointerException at org.bukkit.craftbukkit.v1_6_R3.block.CraftSign.<init>(CraftSign.java:17) at org.bukkit.craftbukkit.v1_6_R3.block.CraftBlock.getState(CraftBlock.java:243) at me.desht.chesscraft.controlpanel.AbstractSignLabel.repaint(AbstractSignLabel.java:117) at me.desht.chesscraft.controlpanel.ControlPanel.repaintSignButtons(ControlPanel.java:153) at me.desht.chesscraft.controlpanel.ControlPanel.repaintControls(ControlPanel.java:138) at me.desht.chesscraft.ChessPersistence.loadPersistedData(ChessPersistence.java:85) at me.desht.chesscraft.ChessPersistence.reload(ChessPersistence.java:37) at me.desht.chesscraft.ChessCraft.onEnable(ChessCraft.java:132) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugin(CraftServer.java:284) at org.bukkit.craftbukkit.v1_6_R3.CraftServer.enablePlugins(CraftServer.java:266) at net.minecraft.server.v1_6_R3.MinecraftServer.l(MinecraftServer.java:315) at net.minecraft.server.v1_6_R3.MinecraftServer.f(MinecraftServer.java:292) at net.minecraft.server.v1_6_R3.MinecraftServer.a(MinecraftServer.java:252) at net.minecraft.server.v1_6_R3.DedicatedServer.init(DedicatedServer.java:152) at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:393) at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
By restart I mean shutting down and restarting from cold.
The plugin does seem to work to some degree even with the error on start up. It's still possible to move the pieces, and for 2 players to have a game of chess, but the AI doesn't seem to function, the move clocks don't function, and the boards don't reset when the game is complete.
When starting a game against an AI opponent, after the first player move the log shows this: 2013-12-06 00:29:04 [FINE] [ChessCraft] game [ultima84-2] AI [§fjcns3]: userHasMoved: 10->26 2013-12-06 00:29:04 [FINE] [ChessCraft] game [ultima84-2] AI [§fjcns3]: active => true 2013-12-06 00:29:05 [FINE] [ChessCraft] game [ultima84-2] AI [§fjcns3]: active => false 2013-12-06 00:29:05 [FINE] [ChessCraft] game [ultima84-2] AI [§fjcns3]: aiHasMoved: 62->47
I'm assuming that's the AI making it's move, but its piece does not actually move, and it won't recognise that it's the players turn (Says it is not your turn).
Yeah, there's a scheduled repeating task that gets added at the end of the plugin's onEnable() - it's responsible for updating clocks, checking for pending AI moves (AI runs in a separate thread) and removing finished games. That task isn't getting added, because the reloading of boards is terminating the onEnable() sequence early.
The question is.... why? And I'm really not sure at this point. I was wrong about it being board "4" obviously, but I'll need to add more debugging code and give you another debug build to see if we can track the problem down. I'll try to get you another build soon.
It's still looking likely that one specific chunk that one of boards happens to be on has some corruption issues, i.e. there's one or more missing tile entities for the sign blocks in that chunk. It might be possible to work around, though.
OK, another debug build: https://dl.dropboxusercontent.com/u/12467600/ChessCraft-2.4.2-dbg2.jar
You'll want to run with log_level at "finer". It will now report each board as it repaints the controls, and it will log every sign it tries to repaint. Look for the last message of the form "about to repaint sign: ...." before the exception, and that is the block with the missing tile entity. It may then be possible to manually break the block (you'll probably want to remove the board that owns that block), and hopefully the tile entity will be restored when the sign is next placed.
Ok, I've run the new debug version you have given me. With log_level finer the logs were getting a bit long, so I've stuck them on pastebin.
This is the result from recreating the 4 chess boards: http://pastebin.com/3QM2iE23
It shows that the problem is occurring on board 4.
I then removed boards 2, 3 and 4 and the plugin started with no errors. I then reassigned board "2" to the position I had board "4", and the error occurred again. http://pastebin.com/8r6JTq8a
So it does seem to be something wrong with that particular chunk
So I removed all the blocks and the signs for that board to see if the plugin would regenerate them. It regenerated 2, then erred again. http://pastebin.com/ykVBZVSs
Obviously the easiest fix would be to move that board to a different chunk, which I'm happy to do if you don't want to look into this any further.
To post a comment, please login or register a new account.