Tuesday, March 31, 2015

Achievement Get

JamOOJam Beta was last weekend, and I participated. The mod which I submitted, Achievement Get, is a game of achievements.



It allows server admins (or single players) to create custom stat-based achievements for their players to achieve. Creating new achievements is as simple as editing a json file and restarting the server. See the wiki page for more info on it.

This mod is NOT required on the client, so it is an optional mod. Players without it will not suffer from any bugs because of it. But if they do have it installed, they will receive a popup when they get an achievement and also be able to check their progress in the achievement page.

Requires Minecraft Forge and Minecraft 1.7.10. A 1.8 version is also available.

The 1.8 version is recommended because 1.8 has significantly more stats than 1.7.10 for achievement creators to take advantage of. The actual code in either versions hasn't changed.

Minecraft Forums: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2394599-achievement-get-a-game-of-achievements

Downloads

1.7.10: AchievementGet-1.7.10-1.0.1
1.8: AchievementGet-1.8-1.0.1.jar

Source and Copyright

Achievement Get uses the Apache v2.0 licence. You may use it in modpacks as long as you give credit. The source is available on Github.

Sunday, March 15, 2015

Kappa - Blockstates

I've made some additions to my annotation processor. I've added some new annotations for dealing with and automatically generating json blockstates and models.  The source is available on my Kappa Github repository.

The built jar is going to be a bit larger because I'm including gson with it. I do this so it works in eclipse without having to add another entry to the factory path.

Here's a short example on how to use this for Biomes O' Plenty.

  
@BlockDef(namespace = "biomesoplenty", blockname = "log", variants = {
        @BlockVariant(variant = "axis=y,variant=cherry", modelName = "cherry_log",
                modelType = ModelType.CUBE_COLUMN, textures = { "cherry_log_top", "cherry_log" })            @BlockVariant(variant = "axis=x,variant=cherry", modelName = "cherry_log",
                modelType = ModelType.CUBE_COLUMN, textures = { "cherry_log_top", "cherry_log" },
                pitch = 90),
        @BlockVariant(variant = "axis=z,variant=cherry", modelName = "cherry_log",
                modelType = ModelType.CUBE_COLUMN, textures = { "cherry_log_top", "cherry_log" },
                pitch = 90, yaw = 90)
})
Block log;

With the @BlockDef annotation, it can be placed on any field or variable, though preferably on a Block. You will give it arguments namespace and blockname. Namespace is your mod's ID or the domain your assets will be in. The variants argument is optional and will use the "normal" variant with a model of the same name as the block.

@BlockVariant will define both variants and models for the block def. All arguments are optional, so you can change what needs to be changed. You can rotate the model using pitch and yaw. The length of textures depends on modelType. See ModelType for a full list of models and their arguments.

Wednesday, March 4, 2015

HD Font Generator

Update March 5, 2015 (1.2): Use GNU Unifont as a fallback if a character isn't supported (it looks very similar to the default unicode font), decrease font size when it is too big and won't fit.

Update March 4, 2015 (1.1): Add experimental unicode generation and made errors more descriptive. Not all fonts support all the unicode characters, so this setting is not recommended.

Recently, I figured out how to create dynamic images in Java, so I felt like I should create a font generator from it, and now here I am writing this blog post.

This tool creates HD font resource packs using installed fonts on the system. If it's supported and installed in your computer, you can use it.

To use, select the font and texture size from the dropdown boxes and click Create. A zip named using the font name and the size will be created in the directory it was started from. Add this file as a resource pack.

For command line usage, just give it a font name with spaces replaced with underscores, then the texture size, one of [32, 64, 128, 256, 512]. A nonexistent font will use the JRE default (Dialog.plain).


Download [1.2] (Requires Oracle Java 7, not OpenJDK)
Pregenerated x32 Fonts (Agency, Arial Rounded, Arial, Comic Sans, Courier New, Impact, Tahoma, Times New Roman, Verdana) (Generated with v1.0)

Note: Every font is different, so some may look weird and require tweaking after generation, but most fonts should be fine.