Custom flags was my submition to ModJam. For those who don't know ModJam is a 96 hour coding competition, were a modder has to code, test, bug fix and submit a mod starting from scratch in 96 hours. Voting for modjam mods will begin shortly. It should be noted that I have added a few small features (map item rendering, vertical hanging flags, bock type aware poles), please do not judge based on these features. All modjam entries can be downloaded from here, I will post a link to where you can vote (for me) when one is avaliable
Custom adds flags to minecraft that allow full customisation by the user. Flags can be attached to a flag pole and be put on display for everyone to see.
An instruction manual can be obtained by using the /cf.instructions command.
The mod revolves around 1 new item (Flag) and 1 new block (Flag pole)
4 Flag poles are created by placing 3 wooden logs or 3 iron ingots in a vertical line in the crafting recipe
[ ][L][ ]
[ ][L][ ] = Flag Pole
[ ][L][ ]
Flag poles can be placed on any block. If you place a flag pole on the top or bottom of a block, you will be able to hag a horizontal flag, if you place it on the side of a block, you will be able to place a vertical hanging flag.
Flags are created by arranging 4 wool blocks (of any colour) in a 2 x 2 square in the crafting grid
[ ][W][W] = Flag
[ ][ ][ ]
The wool may be any colour (or any combination of colours) and the resulting flag will take the colours of the wool blocks used.
Flags may be attached to any flag pole by right clicking a flag pole while holding a flag. In survival/hardcore modes, this will consume the flag, in creative mode, no flag is consumed. Each flag pole block can have a maximum of 4 flags attached to it. Each flag placed after the first will be placed after the previous flag. Right clicking on an flag pole with empty hands will remove the most recently attached flag and place it in the players inventory.
Flags attached to a flag pole will blow in the wind. Due to the fact minecraft wind only blows in the north direction, flags on vertical poles will ALWAYS blow north. The speed of the animation can be changed in the config file, (valid between 1 & 10) higher numbers will speed up the animation, lower nmumbers will slow it down.
Right clicking while holding a flag (with no usable block in front of the player) will open the flag designer gui. The GUI supports a 32x32 12 bit ARGB image. A colour chooser is included on the right of the screen and drawing tools on the left The tools include
- Pen Tool: Draws a single pixel at the current mouse location when the left mouse button is down
- Holding shift will draw a straight line from the last location clicked to the current mouse location
- Rectangle Tool: Draws a rectangle with the corners of the last 2 clicked locations.
- Holding shift will force the rectangle into a square
- Oval Tool: Draws an oval with the corners of the last 2 clicked locations.
- Holding shift will force the oval into a circle
- Flood Fill: Clicking the left mouse button will change all of the connected pixals of the same colour to the currently selected colour
- Holding shift while clicking will fill the whole 32x32 area with the colour selected
- Text Tool: Allows the user to write text at the most recently clicked location.
- Pressing enter saves the text
- Colour Picker: Clicking will set the current colour to the colour of the selected pixal
- Save: Opens a save dialog to allow the user to save the current design to their filesystem for later use
- Load: Opens a load dialog to allow the user to use an image on their current file system as their current flag. Images will be scaled to 32x32 and converted to 12bit ARGB before being drawn on the canvus
- Load Section: Opens a load dialog to allow the user to use a section of an image on their current file system as their current flag. After selecting the desired file, a user will be asked how many sections they desire in the X and Y directions (between 1 & 4) and which section they want to use for the current flag. The resulting image will be scaled to 32x32 and converted to 12 bit ARGB colour space.
- The OK button will save the design to the currently held flag, pressing escape will close the flag designer without changing the design.
- Undo/Redo: Pressing Ctrl-z will undo and Ctrl-y will re-do.
The configuration file for the mod is located in the configs directory under the name custom_flags.cfg The fields correspond to
- Animation Detail Level: The detail level for the waving animation. 0 will turn the animation off, higher values will produce higher levels of detail (generally 16ish is way more than needed)
- Cache Size: Not currently in use
- Flag Speed: The speed of the animation (between 1 & 10). Higher values will speed up the animation
- Use System L&F: Mimic the system look and feel for swing dialogs. Set to false to use the default look and feel (likely the cross platform metal L&F). Some users may have issues with the save/load buttons, if this is the case try changing this.
- Load Images in FileChooser: Will preview the images in the filechooser. This feature may also have issues on some systems, turn it off if you have issues with the Save/Load buttons.
- Flag Pole Id: The Id of the Flag Pole Block (defaults to 2700)
- Flag Id: The Id of the Flag Item (defaults to 24532)
The mod is compiled for Minecraft 1.6.2
- Download and Install Minecraft Forge (http://files.minecraftforge.net/)
- The mod was compiled using Minecraft Forge version 220.127.116.114
- Download Custom Flags
- Place the downloaded Custom Flags file into the /mods directory in the .minecraft directory (for Client) or the root of the server directory (for Server)
- Run the client or server as usual
Known Bugs & Issues
Crafting an Iron flag pole will give you an oak flag pole
- Some people may have issues with the Save/Load dialogs, try turning off the "Use System L&F" or the "Load Images in FileChooser" options in the config.
The Save dialog sometimes opens behind the minecraft window, causing the appearance of minecraft not responding.