-
Notifications
You must be signed in to change notification settings - Fork 9
Documentation
I have supplied y'all with an example that includes some of the main features one might want to use.
For a real resourcepack, check out this one that has the old menu panoramas!
In a resourcepack, to create a panorama, create a panoramas.json
directly inside of assets/modid
, where sounds.json
also goes. panoramas.json
follows the same format as sounds.json
. Anything with (optional)
has the default already set in this example.
{
// The name of this entry (not locally used)
"Default Panorama": {
// The name used for config.
"name": "minecraft",
// The identifier of the textures to show.
"panoramaId": "textures/gui/title/background/panorama",
// The identifier of the music it plays. (optional)
"musicId": "music.menu",
// The movement settings (optional)
"movementSettings": {
// Does it move? (optional)
"frozen": false,
// How much to add to X. (optional)
"addedX": 0.0,
// How much to add to Y. (optional)
"addedY": 0.0,
// How fast it moves (compared to normal). (optional)
"speedMultiplier": 1.0,
// Move woozily. (optional)
"woozy": false
},
// How much this one is picked. (optional)
"weight": 1,
// Custom set of splash text. (optional)
"splashTexts": "texts/splashes.txt"
}
}
Or use a music sound instead of an identifier. Don't use both
{
"default": {
"name": "Minecraft",
"panoramaId": "textures/gui/title/background/panorama",
// The music sound. (optional)
"musicSound": {
// The identifier of what music to play. (optional)
"sound": "music.menu",
// The minimum time to wait before it plays (in ticks). (optional)
"min_delay": 20,
// The maximum time to wait before it plays (in ticks). (optional)
"max_delay": 600,
// When this music is supposed to play, cut off the old music and play this one?. (optional)
"replace_current_music": true
},
"weight": 1,
"splashTexts": "texts/splashes.txt"
}
}
In your custom splash.txt files, there exist a few more features present than you can do without vistas installed.
To add an entire category of splash text from a different panorama, such as the default 'minecraft' panorama, simply put $
and $Splash
surrounding the name of the panorama, as such:
$minecraft$Splash
This goes recursively. Eg. You redirect to $other_panorama$Splash
and that includes $minecraft$Splash
, it will count that aswell.
There are two other special splash cases. $p$Splash
gets replaced with the player's username. Likewise $P$Splash
gets replaced with the player's username in all capitals.
repositories {
maven {
name = 'TerraformersMC'
url = 'https://maven.terraformersmc.com/'
}
}
modImplementation "com.terraformersmc:vistas:${project.vistas_version}"
include "com.terraformersmc:vistas:${project.vistas_version}"
vistas_version=1.3.1
Get versions from here
Create a class such as the one below, variables are separated for clarity. Let's use cinderscapes as an example.
public class ExampleVistasApiImpl implements VistasApi {
@Override
public void appendPanoramas(Set<Panorama> panoramas) {
// The name that the config uses to show this panorama.
String name = "cinderscapes:panorama";
// The identifier of the panorama textures.
Identifier backgroundId = new Identifier("cinderscapes", "textures/gui/panorama/panorama");
// The music sound that the music plays from.
MusicSound music = Panorama.Builder.createMenuSound(SoundEvents.MUSIC_MENU);
// How much the panorama is chosen
int weight = 1;
// The Set of splash text to use
Identifier splashText = new Identifier("cinderscapes", "texts/panorama_splash.txt")
// The Movement Settings
// Does the panorama move?
boolean frozen = false;
// How much to add on the X axis
float addedX = 0.0F;
// How much to add on the Y axis
float addedY = 0.0F;
// How fast it moves (compared to normal)
float speedMultiplier = 1.0F;
// Move woozily
boolean woozy = false;
// Or just use your own equations for it. These are optional and are by default turned off.
// Y'know, just put whatever
Function<Float, Float> XEquation = (time) -> {
return (float)Math.sin(time * 5) * 38;
};
Function<Float, Float> YEquation = (time) -> {
return (float)Math.sin(time * 15) * 69;
};
Panorama defaultPanorama = new Panorama.Builder(name)
.setBackgroundId(backgroundId)
.setMusic(music)
.setWeight(weight)
.setSplashTexts(splashText)
.setFrozen(frozen)
.setAddedX(addedX)
.setAddedY(addedY)
.setSpeedMultiplier(speedMultiplier)
.setWoozy(woozy)
// Again, these things are optional
.setXEquation(XEquation)
.setYEquation(YEquation)
.build();
panoramas.add(defaultPanorama);
}
}
Add the class you just made into an entrypoint to your fabric.mod.json, such as this one here
"entrypoints": {
"vistas": [ "com.example.mod.ExampleVistasApiImpl" ]
}