Papyrus

A mod that provides various named mappings to the Fabric loader MappingResolver

by
2.2K Downloads
fabriclibrary
Rent Server with this Mod

About this Mod

Papyrus

Papyrus provides various named mappings to the Fabric loader MappingResolver. This allows for more developer friendly
access to mappings at runtime for example for using named classes in reflection instead of intermediary.
Papyrus downloads mappings on the first run on any given version and stores cached mappings in tiny v2 format at
${game_dir}/cache/papyrus/${mapping}_${version}.tiny

Using Papyrus

To use Papyrus just add the maven repository which hosts Papyrus to your gradle build script:

# Kotlin DSL
repositories {
    maven("https://maven.nelind.dk/releases") {
        name = "Nelind Maven"
    }
}

# Groovy DSL
repositories {
    maven {
        name 'Nelind Maven'
        url 'https://maven.nelind.dk/releases'
    }
}

and then include Papyrus JIJ with the standard loom "include" gradle configuration:

# Kotlin DSL
modRuntimeOnly(include("dk.nelind:papyrus:(version)")!!)

# Groovy DSL
modRuntimeOnly include("dk.nelind:papyrus:(version)")

You can also choose to not include Papyrus JIJ in that case make sure to manually add Papyrus as a dependency in your
fabric.mod.json. If you need to access Papyrus internals you can also add Papyrus with the modApi configuration instead of the
modRuntimeOnly configuration.

Then in your fabric.mod.json you need to tell Papyrus what mappings you need access to and the version thereof:

{
  ...
  "custom": {
    "papyrus": {
      "mappings": [
        "mojmap",
        "yarn:build.1"
      ]
    }
  }
}

Then get and use the MappingResolver with any of the added mapping namespaces:

MappingResolver mappingResolver = FabricLoader.getInstance().getMappingResolver();
String runtimeClassNameFromYarnName = mappingResolver.mapClassName("yarn:build.1", yarnClassName);
String runtimeClassNameFromMojmapName = mappingResolver.mapClassname("mojmap", mojmapClassName);

Usage notes:

  • Papyrus injects the added mappings at preLaunch so you should only use Papyrus at some point after that.
    If the here and there talks about possible future fabric loader plugins go somewhere where it makes sense for
    Papyrus to become a loader plugin it will. Hopefully making extra mappings available at preLaunch

  • Mojmap handles inherited class members differently from Intermediary and Yarn!
    Intermediary and Yarn only give mappings for members defined directly in a class in said classes mapping
    definition whereas Mojmap gives names for all members a class has, inherited or not. In practice this means that if you
    ask the mapping resolver for a Mojmap method name in a class where the class has inherited the method while the runtime
    mappings are either Intermediary or Yarn you'll get null because the resolver can find that name (in Mojmap) but
    there is no defined name for that method in the runtime mapping. What does this mean for you? If you're using
    Mojmap names as the input to the mapping resolver you should use the class name of the class a method or field is
    declared on not the class you want to modify
    . Alternatively you can have a null check and programmatically find the
    class's super class and ask the mapping resolver for the member name with that class as the owning class.

Provided mappings

Mappings Namespace used in mapping resolver
Mojang Mappings mojmap
Yarn yarn

Note on versioning

Since Papyrus is almost entirely independent of the version of the game itself. The mod version indicates the java
version said build was built against. For example Papyrus x.y.z+java.17 is built against java 17 and as such supports
any game version that's also built against java 17 (that being any version from 1.18 to 1.20.4 inclusively).

Available Versions

Papyrus 0.2.0+java.21release
MC 1.20.5, 1.20.6, 1.21, 1.21.1fabric
September 22, 2024
Papyrus 0.2.0+java.17release
MC 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4fabric
September 22, 2024
Papyrus 0.1.0+java.21release
MC 1.20.5, 1.20.6, 1.21, 1.21.1fabric
June 9, 2024
Papyrus 0.1.0+java.17release
MC 1.18, 1.18.1, 1.18.2, 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4fabric
June 9, 2024

How to Install Papyrus on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.21.1).

3

Install Mod

Open the mod browser in the dashboard and search for "Papyrus". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabric

Minecraft Versions

1.21.1, 1.21, 1.20.6 (+14 more)

Server-side

~ Optional

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

Papyrus server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.1). You can switch loaders with one click in the panel.

Is Papyrus compatible with fabric?

Papyrus officially supports fabric for Minecraft 1.21.1, 1.21, 1.20.6. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with Papyrus – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Papyrus consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install Papyrus with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Optional

Supported Versions

1.21.11.211.20.61.20.51.20.41.20.31.20.21.20.11.201.19.4+7 more