[FUN] ChessCraft - Play Chess [BukkitDev]

Discussion in 'Archived: Plugin Releases' started by desht, Jul 4, 2011.

  1. Offline

    desht

    ChessCraft - play chess

    ChessCraft is now on dev.bukkit.org. This thread will remain open for now for general discussion, but please use dev.bukkit.org for reporting problems and feature requests.

    All documentation is now maintained on dev.bukkit.org. Nothing below here will be updated from now on (8th September 2011).

    ChessCraft lets you play games of chess in the world of Minecraft. It has support for multiple chessboards and multiple concurrent games. You can play against other humans, or against the computer.

    Download ChessCraft.jar 2.0.1
    View source code on github
    Read the User Manual on dev.bukkit.org

    Thanks to BrandonHopkins for this review & tutorial:


    And to the WoopaGaming folks for this one:


    Changelog
     
  2. Thats what i tried to do. It wouldnt work by the way, i dont have a craftbukkit.jar file. Does that mean the snapshot?

    I could make a video for you if i succeed.

    Every time i try typing the ChessCraft commands it says "Unknown command" Could you please help? I'll make a vid for you on how to install it. :)

    When i start my server it doesn't say ChessCraft, even though i have added the ChessCraft.jar to plugins.

    This is what it said when i tried to load it with my test server. I couldn't help noticing it said 1.7.2:
    151 recipes
    16 achievements
    14:45:26 [INFO] Starting minecraft server version Beta 1.7.2
    14:45:26 [INFO] Loading properties
    14:45:26 [INFO] Starting Minecraft server on *:12345
    14:45:27 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-904
    g9277096-b953jnks (MC: 1.7.2)
    14:45:27 [SEVERE] Could not load 'plugins\ChessCraft.jar' in folder 'plugins':
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown So
    rce)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.
    ava:173)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager
    java:199)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManage
    .java:122)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:118)
    at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:89)
    at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigu
    ationManager.java:51)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:132)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NoClassDefFoundError: chesspresso/move/IllegalMoveExceptio

    at me.desht.chesscraft.ChessCraft.<init>(ChessCraft.java:53)
    ... 13 more
    Caused by: java.lang.ClassNotFoundException: chesspresso.move.IllegalMoveExcept
    on
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader
    java:36)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader
    java:24)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 14 more
    14:45:27 [INFO] Preparing level "Puzzle_Map"
    14:45:27 [INFO] Preparing start region for level 0 (Seed: -4744135804255891688)
    14:45:27 [INFO] Preparing start region for level 1 (Seed: 1849883552189146762)
    14:45:28 [INFO] Preparing spawn area: 65%
    14:45:28 [INFO] Done (0,132s)! For help, type "help" or "?"
    Sorry for the long comment.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  3. Offline

    colin8696909

    love it.
     
    desht likes this.
  4. Offline

    desht

    Yep, this is because Chesspresso-lib.jar hasn't been installed - the plugin won't load without it. I'm not sure how much clearer I can make the installation instructions...

    Yes, craftbukkit-0.0.1-SNAPSHOT.jar. If you're in that folder, you should also see a subfolder called lib (if you don't see a lib, create it). What you need to do is extract Chesspresso-lib.jar from the ZIP file you downloaded from Sourceforge, and put Chesspresso-lib.jar in the lib subfolder.

    When you say "it wouldn't work", what exactly do you mean by that?

    Not quite sure I understand. When you mate someone, the game is over :)

    Or do you mean place the opposing king in check? I could add a message for that I guess, but the player already gets a message with the last player's move, and that includes a "+" if it's a checking move. E.g. something like White played [Qg4-h5+]

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  5. Offline

    m0dulus

    This is amazing!
     
    desht likes this.
  6. Oh yeah! I installed it! Thank you so much. Anybody know bout a good screencam programme? I wanna make a video for desht :) It was easier than i thought. I just didn't know there was a lib folder :p

    This is the best plugin ever made! I totally love it.

    Desht, make more awesome plugins like this.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  7. Offline

    XoX

    I know :p
    But for now it's difficult to play from platforms as most chess beginners don't know how ( I don't mean they don't know the command, they just don't know how it works), but anyways, thanks for fixing my bugs and considering my suggestions. :)
    Now just teach me java and I'm happy :D lol
     
  8. Offline

    maltazar1

    yes that's exactly what i was trying to write :) basicly when i play a game with someone i'm really aren't checking those white played [something] messages :) meaby u could just add a message that would display something like [Your king is in check] :)

    btw i was wandering maybe u would make an announcements file that could be translated to other languages
    (i don't mind having a chess game in english but i'm used to speak in my own language)

    Cheers
     
  9. Offline

    desht

    OK, I'll add both those requests to the TODO list. Translations were something I'd considered already, but I need to learn the Java translation API first :)
     
  10. Offline

    maltazar1

    Thank You sir :)
     
  11. Offline

    yakasuki

    hmm.needs a video
     
  12. Offline

    MatCat

    I LOVE IT, I am testing it out on my 30 to 50 on a time server. So far the response has been awesome, and I must say I think this plugin is very well put together.

    Some things I noticed, I think the process could be a bit friendlier message wise, I.E. When you actually /chess create game, perhaps it could automatically tell you Now please invite a player.... then once someone /chess join's, it could auto TP both to the arena (instead of having to manually type /chess tp obscureplayername-1), and let both players know to /chess start when ready, etc, it is the only confusion sofar with everyone that has played on my server is that its confusing to remember the commands.

    Also there was a situation where a player disconnected mid-game, and when the other player resigned he lost :D, the d/c'ing player should forfeit when that happens (Maybe out like a 60 second clock when a player d/c's?).

    Just my inputs, I will have more after it gets some more use!
     
  13. Offline

    desht

    Thanks for the input, appreciated!
    • Agreed, the "flow" of setting up a game needs working on, and I have some ideas about that (mostly pretty much matching up with what you've suggested :) ) You'll also find that v0.2 has a control panel on the side of each board with some goodies like "buttons" for a lot of the /chess commands (along with nice things like a to-move indicator, chess clocks...)
    • As for disconnections, really not sure about that. I don't see any good reason why the game can't just continue when both players are back on (which is how it works now). I guess I could make it a configurable.
     
  14. Offline

    MatCat

    Another idea just since the framework is there for it now... What about a checkers mode, as soon as everyone saw the chess board I had about 15 people ask me about checkers.
     
  15. Offline

    ppp

    Trying to make a custom board - simple to start, just modifying values of the default and saving under a new name:

    Code:
    # Chess board style definition
    
    # Materials can be specified as plain integer (e.g. '0' - air), material name
    #  (e.g. 'sandstone'), or material plus data (e.g. '35:0' or 'wool:white')
    # If you use plain integers, they must be quoted, or the style will not load!
    # If you use material names, they must match the org.bukkit.Material definitions exactly
    #  - see http://jd.bukkit.org/apidocs/org/bukkit/Material.html
    
    # Overall height of the board bounding box will be <height> + 2
    # Overall width/length of the board bounding box will be <square_size> * 8 + <frame_width> * 2
    
    # width/length of the board squares, in blocks
    square_size: 5
    # width in blocks of the frame surrounding the board
    frame_width: 3
    # height of the board - number of squares of clear air between board and enclosure roof
    height: 6
    # material/data for the white squares
    white_square: 42
    # material/data for the black squares
    black_square: 22
    # material/data for the frame
    frame: 1
    # material/data for the enclosure (if you don't use glass, then you better have lit = true!)
    enclosure: air
    # is the board lit up?
    lit: false
    # style of chess set to use (see ../pieces/*.yml)
    # the style chosen must fit within the square_size specified above
    piece_style: Standard
    
    Getting these errors when doing /chess create board test -style lapsnow (I know i changed it to iron, but that was testing if it was 'word' vs 'id')

    Code:
    16:35:21 [SEVERE] java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
    16:35:21 [SEVERE]       at me.desht.chesscraft.BoardView.loadStyle(BoardView.java:179)
    16:35:21 [SEVERE]       at me.desht.chesscraft.BoardView.<init>(BoardView.java:50)
    16:35:21 [SEVERE]       at me.desht.chesscraft.ExpectBoardCreation.doResponse(ExpectBoardCreation.java:26)
    16:35:21 [SEVERE]       at me.desht.chesscraft.ExpectResponse.handleAction(ExpectResponse.java:35)
    16:35:21 [SEVERE]       at me.desht.chesscraft.ChessPlayerListener.onPlayerInteract(ChessPlayerListener.java:55)
    16:35:21 [SEVERE]       at org.bukkit.plugin.java.JavaPluginLoader$10.execute(JavaPluginLoader.java:307)
    16:35:21 [SEVERE]       at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    16:35:21 [SEVERE]       at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
    16:35:21 [SEVERE]       at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java
    :168)
    16:35:21 [SEVERE]       at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:63)
    16:35:21 [SEVERE]       at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:457)
    16:35:21 [SEVERE]       at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
    16:35:21 [SEVERE]       at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    16:35:21 [SEVERE]       at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:84)
    16:35:21 [SEVERE]       at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    16:35:21 [SEVERE]       at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    16:35:21 [SEVERE]       at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    16:35:21 [SEVERE]       at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    16:35:21 [SEVERE] ChessCraft: can't load board style lapsnow: java.lang.ClassCastException: java.lang.Integer cannot be
    cast to java.lang.String
     
  16. Offline

    desht

    Check the comments at the top of the file:
    Code:
    # If you use plain integers, they must be quoted, or the style will not load!
    
    The material specification is a string, not an integer, since it can also be a material name ('iron_block', 'stone', 'wool:black', etc.)

    And that only applies to the material specifiers, not the dimensions (squaresize, height, framewidth really are integers).

     
    ppp likes this.
  17. Offline

    yakasuki

    can we make an under water game? like if its under water put glass around it in the file?

    also can we castle in this?in case you dont know what it is its like this

    P P P
    K<-->R

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  18. Offline

    desht

    Yes to both (and would I be implementing a whole chess client if I didn't know what castling was? :) )

    Hmm, that would actually be a lot harder than you perhaps think. The only real framework here is the code to draw the chessboard. The game rule logic is largely handled by Chesspresso, and the other code in my plugin is pretty chess-specific.

    Anyone's free to use my code to write a Checkers plugin (BoardView.java implements the board) but I'm afraid it's not a priority for me, sorry.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
  19. Offline

    yakasuki

    thanks XD hope this plug-in becomes more awsome XD
     
  20. Offline

    desht

    New release:

    v0.2 (13 Jul 2011)
    • Piece selection/moving has changed: now pieces are selected & moved by waving a wand item (new config item wand_item, default is empty hand) with left-click. Much more usable, since it can be done from a distance - less running about the board needed. Right-click still works but is deprecated and will print a warning every time it's used. Right-click will be removed in the next release.
    • Control panel on the side of each board with chess clock, to-play indicator, halfmove clock display, ply count display, and a set of buttons to make a lot of the /chess commands easier to use (e.g. you can now create a game on the board with one click).
    • More visible notification if you've been placed in check.
    • When you join a game, you can now be automatically teleported to it (new config item auto_teleport_on_join, default true).
    • If a player logs out, their opponent may claim victory by default after a configurable delay (new config item forfeit_timeout, default 60 seconds).
    • Board lighting is now checked once per second by default, not once per 10 seconds. The same task also updates chess clocks on each board.
    • Implemented the 50-move rule (game is drawn if no pawn moves & no captures in the last 50 moves - see the halfmove clock on the control panel).
    • Various minor tweaks & bug fixes.
     
  21. Offline

    maltazar1

    ah great :) v2 woohooo btw change ver in post!
     
  22. Offline

    desht

    And hot on the heels of v0.2:

    v0.2.1 (13 Jul 2011):
    • Plugin was telling everyone what chess games they were in on login, even if they had none. Now only tells you if you are actually in one or more games.
     
  23. Offline

    maltazar1

    great job :) now it's much more fun when u can actually see what are playing without flying :)
     
  24. Offline

    ppp

    Grr, hate when it's the simple stuff - thank ya kindly! Works great now - where should we submit new boards?
     
  25. Offline

    desht

    Well, those files aren't too large so no reason not part them here. Alternatively upload them to something like dropbox or pastebin.
     
  26. Offline

    TSO

    Might want to look into making 'castling' possible?
    If it already is maybe make information more accessible.
     
  27. Offline

    Pantheis

    First thing I tried was to castle and it worked fine.
     
  28. Offline

    desht

    I didn't think such a basic part of the game needed to be documented.
     
  29. Offline

    iMattxC

    is there any way to play a checkers gametype?
    some people on my server requested it.
     
  30. Offline

    desht

    No checkers, sorry. And not really planned - see earlier comments in the thread.
     
  31. Offline

    TSO

    My mistake I nvr use the move and a noob was trying to castle with pieces in the way.
     

Share This Page