#Add splash text without overwriting the existing?
80 messages · Page 1 of 1 (latest)
find wherever the splashes.txt file is loaded and add your own entries there
that would be overwritten by resource packs
or other mods doing the same
it wouldn’t if you do it from the code
so minecraft does not have datagen for it?
it has to get loaded at some point, and likely gets put into a list or something you can add your splashes to
what does datagen have to do with this?
it’s not, datapacks don’t exist if you aren’t in a world (technically they sort of do, but anyway)
it’s part of resourcepacks, but like I said you don’t need to use a resourcepack necessarily
so resourcepacks do not have a feature to add new entries not touched by mods or other resource packs?
i think the splash text is a txt file
it is
theres no replace: false
you'll fully replace it
which is why I was suggesting to add the custom splashes wherever it gets loaded
I do not wish to overwrite splash.txt or whatever the file is as that would break compatibility with resource packs
that is what I would like to do
write a resource loader
ok, so what I said then
I shall look for their source code
pretty much
that's the easy part
I Love ❤️ Botania 
- Botania is Open Source and distributed under the
- Botania License: http://botaniamod.net/license.php
gonna read their license to ensure I can do a copy paste of the mixn
well with different splash
adding your own resource pack handling might take some work
that mixin is too simple to copyright lol
gonna have to mod this mixin a bit as it seems things were renamed lol
Hmm gonna make my own mixin setup
want to do something unique
package com.skycatdev.nopeacefuldespawn.mixin;
import net.minecraft.client.gui.screen.SplashTextRenderer;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(SplashTextRenderer.class)
public class SplashExtraMixin {
public static final SplashTextRenderer SLIMES_COOL = new SplashTextRenderer("Baby slimes are your friend!");
public static final SplashTextRenderer HUG_CREEPER = new SplashTextRenderer("Don't hug that creeper!");
}``` Would this work?
It seems like Mojang heavily refactored their code
in
public class SplashTextRendere there is
public static final SplashTextRenderer MERRY_X_MAS_ = new SplashTextRenderer("Merry X-mas!");
So I would assume this mixin is correct based on
https://www.youtube.com/watch?v=U7j4bl_UAII&t=384s
In this Minecraft Modding Tutorial, I try to explain the fairly complex and intense topic of Mixins for Fabric 1.18.1
== ASSETS & DOWNLOAD LINKS ==
GitHub Repo: https://github.com/Tutorials-By-Kaupenjoe/Fabric-Tutorial-1.18.1/tree/28-mixins
Gist: https://url.kaupenjoe.net/yt236/gist
Mixin Wiki: https://github.com/SpongePowered/Mixin/wiki
== TI...
"this is actually all there is to it" is what Kaupenjoe said when adding persistentData
Big note that I am not messing with NBT and that system itself is already been heavily rewritten by Mojang
this class would also be different than Botania's system and so credit is not needed to them for that
Note that Intellij could not find usages for what I was trying to copy
no, just adding random fields isnt gonna do anything
read what the actual code is doing, and add your own splashes where neccesary like what botania does
well that is why I looked for usages
I know that the text in what I referenced shows up in game
I am confused to why intellij cannot find usages
I also checked the "Libraries"
same thing
did you generate sources?
SplashManager still exists, you might just be using yarn instead of mojmap
you can use linkie to translate https://linkie.shedaniel.dev/mappings
just add your text to SplashTextResourceSupplier
that will return one in random like vanilla
I was trying to update a repo that I pulled
Thanks for that link
Seems there is an outage
Oh wait
I already set to 1.21.6
?????
thats just intellij trying to download it, you can ignore that
you can turn that off
it fails cuz minecraft source obv isnt public, theres a setting for it somewhere
I hit "don't show again for this project"
Contribute to skycatminepokie/no-peaceful-despawn development by creating an account on GitHub.
I made my own way
it seems to work!
that mixin can be better, id probably WrapOperation the this.splashes.addAll(List) call in apply, and return a new list containing your splashes + whatever was in the original, also wouldn’t have to deal with manually making SplashTextRenderers this way
what you have now does work technically, but will likely break if another mod wants to do something similar
generally you want to avoid Inject + setReturnValue and use other injectors that are stack if multiple mods target the same thing
@tight gazelle I feel like I am not quite understanding this concept since I got a line count of the txt, but if you could figure out compatibility with other mods, it would be good before making 1.21.7 or above, which is why I only bumped to 1.21.6 in anticipation my low java skills might miss something
I want to thank you for merging for 1.21.6
I'll put it on my todos, but it's finals week.