Repository navigation
Gay Grass Resource Packs
Note: this page has not yet been updated to reflect 1.1.0, which added video & png support, and some new options
Using resource packs, almost every part of Gay Grass can be modified.
To start, you'll need to start a regular resource pack. Inside it will need to look like this:
- mypack
- assets
- mypack
- flags
- [images go here]
- flags.json
- flags
- mypack
- pack.mcmeta
- assets
At the time of writing, all images must be in SVG format. PNG may be added later, but SVG is more ideal anyway... assuming you actually have it in that format. Additionally, while SVG normally allows external references (for example, to a PNG), that is not currently available for unrelated reasons (the code needs to know the exact path to the file, and while the game makes accessing the contents of files in a resource pack fairly straightforward, it does not do the same for their paths. and yes i was too lazy to open a proper issue for that).
When making the SVG, it is highly recommended that shapes overlap slightly, otherwise they may produce a seam. For flags that happen to be a series of stripes, the files can easily be made by hand by copying any of the purely striped flags in the base mod and adjusting the numbers and colors. Beyond that (though arguably for that as well), i recommend learning from my mistakes and use an actual editor instead of typing out the entire progress flags (with overlap) by hand.
This file lists out all the flags. Merely putting a file in the flags folder will not do anything. The overall structure of this file is:
{
{
"id": "flag_name",
"attribute": "value",
"another_attribute": "trans rights are human rights"
},
{
"id": "another_flag"
}
}There are three forms for the id:
- a basic string (eg
"gay") for flags being added - a namespaced name (eg
"rubix:gay") along with"modify": truefor flags being modified -
*which sets the default attributes for flags (modifyis optional for this as it's fairly obvious you're modifying it)
For the attributes, all of them are optional, but some only apply to the global ("*") entry. As of writing, the only way to modify each attribute is by replacing it completely. Here is all of them, along with their type and default value.
Global values:
-
density(float1) the overall density of flags. (assuming the math is correct) it represents how many flags should be covering the average spot. so with1.0density, some blocks will have no flags covering it, some may have multiple overlapping, but the average is 1. Setting this to 0 essentially disables the mod. -
paprika(int0) modifies the randomization. The randomization is world seed dependent, this just adds a little extra spice in case you want to (and also is left over from when it wasn't based on the world seed). It's kind of like a salt for a password database, except that there's just one and it applies globally. But it's also not pepper because pepper is hardcoded and this is data-driven. So it's paprika, and in a password database would be rather useless.
Per-flag values:
-
weight(float1) the relative probability of this flag being the lucky one to be displayed. In the base mod, all of the niche flags have a weight of 1, while the major flags generally have 10-20. Setting this to 0 disables the flag. -
min_size(float10) the minimum diagonal length of the flag in blocks -
max_size(float200) the maximum diagonal length of the flag in blocks. i can't remember what happens if this is smaller thanmin_size. -
opacity(float0.85) opacity on a range from 0 to 1 -
antialias(booleanfalse) whether antialiasing should be used. In the base mod, this is set totruefor all of the flags that have curves. Unfortunately this is enabled/disabled for the entire flag, not just individual parts. -
modify(booleanfalse) whether this entry modifies an already existing flag. If this is enabled,idmust include the namespace. While not recommended on account of being more work, you can modify flags introduced in the same pack. -
resource(string, matchesidby default) the name of the file without the extension. This can be used to replace the image for a flag without resetting all the other attributes. -
scale(string"perexp") the method to distribute the sizes. This is mostly just left over from experimenting with different things instead of actually doing the math, and was only left in because it technically adds functionality, doesn't break things, and would be more work to remove. I don't recommend changing this. In particular, it is the function it should pass a uniformly distributed random number through to obtain the actual size. The default ensures that, by picking a random flag via choosing a block then selecting one of the flags covering it, the logarithm of the sizes (or the square sizes because log logic) are uniformly distributed. The others are"exp","exp2"(exp of squared),"2exp"(double exp), and"pow [n]"(basic power, iex ** n).