-
Notifications
You must be signed in to change notification settings - Fork 9
Documentation
Vistas as we all know is a library mod that lets us change the main menu to our hearts content! But how do we use the tool you ask yourself? Well dear friend here's just where to learn!
If you want an example resourcepack, try this one here which adds the old panoramas back!
Or a community made pack! this one here adds a ton of new panoramas to check out!
Just like the sounds.json
registers sound events, we use a similar system. Inside your resourcepack, assets/
you will create a folder. This folder is your namespace (keep that in mind later). Then in there you create a panoramas.json
file!
The panoramas.json file holds all of the panoramas you want to register within that namespace. Here is an example panoramas.json.
{
"default": {
"weight": 1,
"music": {
"sound": "music.menu",
"min_delay": 20,
"max_delay": 600,
"replace_current_music": true
},
"splashTexts": "texts/splashes.txt",
"titleSettings": {
"titleId": "textures/gui/title/minecraft.png",
"showEdition": true,
"addedX": 0,
"addedY": 0,
"addedSplashX": 0,
"addedSplashY": 0,
"outlined": true
},
"panoramas": [
{
"backgroundId": "textures/gui/title/background/panorama",
"movementSettings": {
"frozen": false,
"addedX": 0.0,
"addedY": 0.0,
"speedMultiplier": 1.0,
"woozy": false
},
"visualSettings": {
"fov": 85.0,
"xLength": 2.0,
"yLength": 2.0,
"zLength": 2.0,
"addedX": 0.0,
"addedY": 0.0,
"addedZ": 0.0,
"colorR": 255,
"colorG": 255,
"colorB": 255,
"alpha": 255
}
}
]
}
}
This one will register as namespace:default (replace namespace with whatever namespace folder you put the panoramas.json inside). Whenever you put in config that registry identifier, it will call to this panorama. Make sure that the name you give it though is a valid identifier. No Capital letters or special characters. only numbers 0-9, letters a-z, and underscores are allowed.
Everything in this panorama is optional, the only thing that you have to specify is the name of the group.
For example, you could just have this and it will work.
{
"default": {
}
}
For the music
field, you can either have the full MusicSound (keep in mind that the MusicSound CODEC requires all options to be avaliable), which is what is shown in the example, or just the Identifier.
"music": "music.menu"
Either will work.
For the panoramas
field, it is an array and goes in order top to bottom. Entries further up will get rendered first and entries near the bottom will render last.
As everything is optional, you can even have
"panoramas": [
{
}
]
To add more, simply put a comma and create another one!
"panoramas": [
{
},
{
}
]
And you can do this as many times as you please!
Every other option is self explanatory, toy around and see what everything does if you still don't understand!
Want a little more spice in your panoramas? Our API lets you do a few little things in Java that you cant have a json file do!
VistasApi.class
is a class that you can implement and register all your panoramas there!
public class ExampleVistasApiImpl implements VistasApi {
@Override
public void registerPanoramas() {
// All your panorama magic goes here!
Registry.register(VistasRegistry.PANORAMA_REGISTRY, new Identifier("mod", "panorama_1"), PanoramaGroup.DEFAULT);
}
The only thing that the Java API has over the json specifications is in MovementSettings you can use a function as opposed to the only nifty movement you can get in there, which being woozy
.
To get the api to work, in your fabric.mod.json, have something like this. com.example.mod.ExampleVistasApiImpl
will be replaced with wherever your class is.
"entrypoints": {
"vistas": [ "com.example.mod.ExampleVistasApiImpl" ]
}