Skip to content

Documentation

LudoCrypt edited this page Dec 2, 2021 · 53 revisions

Vistas Main Menu Customization

Vistas as we all know is a library mod that lets us change the main menu panorama to our hearts content! But how do we use the tool you ask yourself? Well dear friend here's just where to learn!

Example Packs

If you want an example resourcepack, try this one here which adds the old panoramas back!

Via Resourcepack

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!

panoramas.json specification

The panoramas.json file holds all of the panoramas you want to register within that namespace. Here is an example panoramas.json. If you want a clean, non-commented template, click here.

{
 "default": {
  "weight": 1, // How often this panorama is chosen
  "musicSound": {
   "sound": "music.menu", // The music to play
   "min_delay": 20, // The minimum time waiting for music to play
   "max_delay": 600, // The maximum time waiting for music to play (music will play at some interval between these two values)
   "replace_current_music": true // Whether or not to stop the music currently playing and play this one, or to keep playing the previous music and only play this one after that one stops.
  },
  "splashText": "minecraft:texts/splashes.txt", // The set of splash texts to use
  "logoControl": {
   "logoId": "textures/gui/title/minecraft.png", // The id for the 'MINECRAFT' logo replacement. (Default is a 512x512 image, to maintain pixel consistency, keep it in that size, centred at the middle.
   "logoX": 0.0, // How much to move the title (from its location) in the X direction
   "logoY": 0.0, // How much to move the title (from its location) in the Y direction
   "logoRot": 0.0, // How much to rotate the title (anchored around its centre)
   "outlined": true, // Whether or not to outline the title
   "splashX": 0.0, // How much to move the splash (from its location) in the X direction
   "splashY": 0.0, // How much to move the splash (from its location) in the Y direction
   "splashRot": -20.0, // How much to rotate the splash (anchored around its centre)
   "showEdition": true // Whether or not to show 'Java Edition'
  },
  "cubemaps": [ // An array of the cubemaps (in order) to render. Top of the list renders first (behind), bottom of the list renders last (in front), transparency applies.
   {
    "cubemapId": "textures/gui/title/background/panorama", // The id for the cubemap to render. Must have images _0-_5. If it has an overlay, it will render that after it renders the cubemap.
    "rotationControl": {
     "frozen": false, // Do not rotate
     "woozy": false, // Rotate in a custom weird way
     "addedPitch": 0.0, // Rotate up or down extra
     "addedYaw": 0.0, // Rotate left or right extra
     "addedRoll": 0.0, // Rotate Clockwise or Counterclockwise
     "speedMultiplier": 1.0 // Move faster or slower
    },
    "visualControl": {
     "fov": 85.0, // FOV in which the cubemap will render at
     "width": 2.0, // Width of the cubemap
     "height": 2.0, // Height of the cubemap
     "depth": 2.0, // Depth of the cubemap
     "addedX": 0.0, // Move the camera inside the cubemap in the X direction
     "addedY": 0.0, // Move the camera inside the cubemap in the Y direction
     "addedZ": 0.0, // Move the camera inside the cubemap in the Z direction
     "colorR": 255.0, // Color the cubemap (using the multiply method) on the Red channel
     "colorG": 255.0, // Color the cubemap (using the multiply method) on the Green channel
     "colorB": 255.0, // Color the cubemap (using the multiply method) on the Blue channel
     "colorA": 255.0 // Color the cubemap (using the multiply method) on the Alpha channel
    }
   }
  ]
 }
}

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": {
 }
}

Via Java

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!

build.gradle

To implement the mod into your build.gradle, you first need to add the TerraformersMC maven to your repositories.

repositories {
 maven {
  url = 'https://maven.terraformersmc.com/'
 }
}

Then, in your dependencies section, you need to put this.

dependencies {
 modImplementation "com.terraformersmc:Vistas:${project.vistas_version}"
}

Then, in your gradle.properties, put a line like this. You can change it to be whatever version available. Though, versions before 2.0.0 are stored in com.terraformersmc:vistas (with a lowercase v) in the maven. As for why? Not sure.

vistas_version=2.1.0

Api Class

VistasApi.class is a class that you can implement and register all your panoramas there!

public class ExampleVistasApiImpl implements VistasApi {
 @Override
 public void appendPanoramas(Map<Identifier, Panorama> set) {
  // All your panorama magic goes here!
  set.put(new Identifier("mod", "panorama_1"), Panorama.DEFAULT);
 }

fabric.mod.json

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" ]
}