#[IN DEV] CVN (Cross-Version-NMS)
1 messages ยท Page 2 of 1
that we will feed to spigot
it just does the same things a JavaPlugin does usually
apparently there is something called a PluginBase
Actually, JavaPlugin has a protected contructor that lets us give it a PluginFileDescriptor, meaning we can just call that using reflection without any extra classes
can you make that?
Once I finish the gradle plugin
Yeah
Just that we will also need a maven plugin
...and to publish on a maven repo
yeah x)
this is incredible
I'll make a youtube tutorial to teach how to use CVN as soon as we'll have finished
Actually, wait, we are overcomplicating things even more, since we end up creating a remapped jar, we can just change the cvn-plugin.yml to be a plugin.yml and load it like usual
I thought of that
This makes everything so much easier
but there was a problem but I can't remember which one
also, we shouldn't forget to make the plugins remapped using CVN as dependency to make sure we can update them before loading them (if the original not remapped file is changed, basically)
There shouldn't be one. We remap the plugin, change the cvn-plugin.yml to be a plugin.yml and put it in some directory + we add its hash so we know when to update the remapped jar
Then we load them through PluginManager#loadPlugin(File) and enjoy life
I'll work too
focus on the gradle/maven plugin, and push on github too
I'll do my best for CVN if I have time later
see you later
how I create the PluginDescriptionFile from the cvn-plugin.yml ?
what should I put for JavaPluginLoader ?
No need to, just do the approach I described here: #1243264378522959914 message
how can I rename a file in a jar?
Unsure whether the JarFile or whatever it was called has a method for that
google says that it's like a zip, hmm
it's called JarFile yeah
But you could unarchive it, as it is a zip, change the yml file name and rearchive it
yeah
@rigid saffron not finished, and there might be bugs that I'll patch after x)
https://github.com/Cross-Version-NMS/CVN/commit/b7817978e3435b59ce26999d75ef89ee842574da
and still no hash
why is this comment here
Lol
x)
Rad, why are you inspecting all the code
is the plugin going good ?
I still have no idea what is causing my issue
oh really
I have asked on a few forums, waiting
I think you should work on the plugin loader while waiting :)
i checked out the commit
Nah I'll play a mobile game and go sleep
i'm not necessarily seeing anything bad there
it should works
but i also dk anything about reflection and that typa thing
but not perfectly
there isn't reflection ๐
just modifying a jar file without extracting his content
yeah, just replacing cvn-plugin.yml by plugin.yml
Kinda
basically those lines :```java
InputStream stream = jar.getInputStream(jar.getJarEntry("cvn-plugin.yml"));
ZipFile zipFile = new ZipFile(plugin);
zipFile.removeFile("cvn-plugin.yml");
ZipParameters parameters = new ZipParameters();
parameters.setFileNameInZip("plugin.yml");
zipFile.addStream(stream, parameters);```
I should close the jar file too x)
idk if it's good ๐คท
@rigid saffron is there a way I can use intermediary mappings directly?
even, is it necessary to have intermediary mappings to pass the plugin into CVN?
just some basic bukkit code will works?
Wdym
You want a plugin with intermediary mappings for testing?
You can use the tiny-remapper by fabricmc and remap it
Use a try with resources to autoclose
Okok
I'm already using a try with resources, and then I pass the resource in return and reuse it after
so, wait, it's already closed?
I must remake a try with resource?
try with resource closes things automatically
The whole plugin?
yeah
Damn
Yeah, I'll refactor it a bit so it has less useless classes
Great plugin
I...
Lol
and it is not loaded by CVN ๐
Amazing
let's do a good debugging
Lol
and, if we edit the source code of the original server.jar ? ๐
That is even more cringe
x)
and, if we fake the server?
by creating a fake plugin.yml redirecting to an empty class?
We need a spigot expert
Lol
what the hell is that
Or maybe somebody else, frostalf or something
Bad path
Looks like your FilenameUtils is doing a linux format
the / at the beginning is the problem?
oh
but this will works on linux then?
Just do .endsWith(".jar")
^ here I think
@rigid saffron this is the problem
Paths.get(cvn.getServer().getClass().getProtectionDomain().getCodeSource().getLocation().getPath()),```
Interesting
Can you print the output without Paths.get and .getPath()
yeah, sure
file:/C:/Users/paule/Documents/Serveurs/test-plugin-1.9.4/cache/patched_1.9.4.jar
@rigid saffron
try .replace("file:/", "") and then turn it into a Path
bruh, here his what I get
the code disappeared, and cvn-plugin.yml hasn't been replaced :/
Show outout
/C:/Users/paule/Documents/Serveurs/test-plugin-1.9.4/cache/patched_1.9.4.jar
.replaceFirst("/", "") works "perfectly"
Show code
Paths.get(cvn.getServer().getClass().getProtectionDomain().getCodeSource().getLocation().getPath().replaceFirst("/", ""))
Does it actually work
and if I put both maybe?
Doubt it
I get this
#1243264378522959914 message
so it "works"
the problem is this
๐
the problem comes from when remapping
this path doesn't exist
that's why it doesn't work ?
(I'm asking myself)
oh
it's not the server
but wait
wtf
it's getting the patched file, so it should works?
bump
LOL
PAPER IS THE PROBLEM
I'll need to use paper as dependency to make some checks if the server is paper based
hope it will works, or I'll use reflection
basically, getServer#getClass#... is in cache/patched-version.jar
but we wants it as server.jar
I'll need to do some tricks
wtf
apache.commons >>>
a bit working
NO WAY
remapped, but not launched?
@rigid saffron @woven arrow @inland spoke ๐
yeah, many pings
but I'm happy ๐
great!
(logically)
Actual system - theorically working versions (because test plugin is not using mappings in his code) :
- 1.20.6 โ
(detected
getServerclass :versions\1.20.6\paper-1.20.6.jar) ASM : 9.3 - 1.20.4 โ
(detected
getServerclass :versions\1.20.4\paper-1.20.4.jar) ASM : 9.3 - 1.16.5 โ
(detected
getServerclass :cache\patched_1.16.5.jar) ASM : ?? - 1.14.4 โ
(detected
getServerclass :cache\patched_1.14.4.jar) ASM : ?? - 1.13.2 โ
(detected
getServerclass :cache\patched_1.13.2.jar) ASM : present - 1.12.2 โ
(detected
getServerclass :cache\patched_1.12.2.jar) - 1.11.2 โ
(detected
getServerclass :cache\patched_1.11.2.jar) - 1.10.2 โ
(detected
getServerclass :cache\patched_1.10.2.jar) - 1.9.4 โ
(detected
getServerclass :cache\patched_1.9.4.jar) - 1.8.8 โ
(detected
getServerclass :cache\patched_1.8.8.jar)
i think this will still be fine as most people either run 1.8 or 1.14.4+ so congrats
This is the place where it fucks up
Files.walkFileTree(fs.getPath("/"), new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
if (file.toString().endsWith(".class")) {
ClassInstance res = analyze(isInput, tags, srcPath, file);
if (res != null) ret.add(res);
}
return FileVisitResult.CONTINUE;
}
});```
(inside of the tiny remapper)
I'll inspect further
ClassVisitor cv = new ClassVisitor(Opcodes.ASM9) {
@Override
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
ret.init(name, version, mrjVersion, signature, superName, access, interfaces);
super.visit(version, access, name, signature, superName, interfaces);
}
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
MemberInstance prev = ret.addMember(new MemberInstance(TrMember.MemberType.METHOD, ret, name, desc, access, ret.getMembers().size()));
if (prev != null) throw new RuntimeException(String.format("duplicate method %s/%s%s in inputs", ret.getName(), name, desc));
return super.visitMethod(access, name, desc, signature, exceptions);
}
@Override
public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) {
MemberInstance prev = ret.addMember(new MemberInstance(TrMember.MemberType.FIELD, ret, name, desc, access, ret.getMembers().size()));
if (prev != null) throw new RuntimeException(String.format("duplicate field %s/%s;;%s in inputs", ret.getName(), name, desc));
return super.visitField(access, name, desc, signature, value);
}
};```
I thought it may be because of the java version, but why would 1.8 work then
I found an issue my googling the exception and this is the answer I found (two times on github and one time on stackoverflow)
Girls and boys, I found our issue
what's the issue
Most likely asm version shit
why did you do that on your phone
Can't test it, but who knows
Why not
If I can do something without standing up, I will do it without standing up
skull
That's how the dependency tree looks
I wonder if just setting asm level to 8 instead of 9 would change anything
Actually, lemme build a 1.9.4 jar and see the asm version for that
Why is there no java 8 for termux
just get up dude
In a hour
Damn, I have posted about my question on two forums and I did not get a single answer or even a question overnight, like, literally nothing
IT WORKED
all the jars are here
it worked
this is amazing
who could've thought that Files.newOutputStream could be the imposter
huh it did not?
why are the jars empty
interesting
I'm confused to death
People don't know what the fuck you are talking about lmao
I have fixed one issue but now I got another
please help me
Tell me what the issue is and I might be able to give you some intel but probably not
I wonder if my issue comes from the fact I'm doing some funky shits directly in the libs folder instead of doing stuff in the tmp folder and then moving to libs
lemme try
Oh, an ASM issue? If you give me reproduction steps I can find the cause and a solution rather easily
the asm issue is @fallow sky's issue, I'm currently fighting gradle
What do you mean ?
okay I personally can't reproduce anything so I'll just assume that there is no issue.
I suspect your issue could come from ASM version mismatch (it might be possible that minecraft has one version of ASM and tiny-remapper has another inside)
Oh I see
ASM is being shaded into the plugin jar. Depending on the classloader that is a non-issue
we could probably just not shadow ASM into tiny-remapper
my current issue is that class files suddenly go poof for no good reason
Not really, TR probably makes use of Opcodes.ASM9 (e.g. https://github.com/Cross-Version-NMS/tiny-remapper-dependency/blob/master/src/main/java/net/fabricmc/tinyremapper/extension/mixin/common/data/Constant.java#L24) where as older servers might only support ASM 5 - 7, so I suspect that won't work.
Instead, you might try to relocate ASM
Oh yeah
hmm
Oh yeah
haven't had to deal with relocation in gradle yet
We should see that, not very difficult shading or relocating
I had
do stuff here
I really don't see how it helps to fork TR tbh
Yeah I'll see for that don't worry
we'll just have a fork refactored to work with CVN just as we need
tr isn't a library by itself, that's why we turn it into one
Instead, can any of you see the version of ASM between 1.8, 1.9, 1.13 and 1.14 ?
To see if the problem is the version
1.19.4 uses 9.4 iirc
TR is meant to be used as a library.
If you have performance concerns caused by additional I/O overhead, you might want to use something like my stianloader-remapper but really there is no need to refractor TR
isn't TR a standalone application
It's a library
do all libraries have a Main class
It can also be used as a standalone application. Quite a few libs have a main class in fact
I know that as I've used it for a very long time in gslStarplane (until I switched to stianloader-remapper + micromixin-remapper)
but well, I will definitely just clean up the everything in the fork I made (configure gradle for it to relocate asm and remove a few unused by us classes)
And the only time I had to use a fork of TR is https://github.com/FabricMC/tiny-remapper/pull/109 - which would be a non-issue in spigot world either way
I haven't pushed the plugin yet
huh
Kinda forgor
x) I see that
can you also create a repo for a test plugin?
Give me a few minutes
oh wait no I can't rn
In the same place where it is located in any jar
But well, you don't even need to find it
in 1.20.4 I've got it
I need to check the version
Just install it into a gradle project and run gradlew dependencies
It'll show you all dependencies
hm I could
The best idea would be to just simply relocate asm in tr and not struggle with random shit
yeah but I need a lot of informations
Nah, just change the package and enjoy
There should be some gradle relocation plugin I'm sure
yeah
shadowJar even got a relocate feature apparently?
shadowJar {
relocate 'com.myCompany.project.event', 'com.myCompany.relocated.project.event'
}
I think so
I'll do that
I just want to finish that
when thinking of it, no
let's do relocating directly
paulem this is quite random but your english is really good
i just wanted to point it out
lol
thank you ๐
I really like english
Github Desktop is so cool wow
it worked ๐
who can test me ๐
so, now it should works on any version?
ยฏ_(ใ)_/ยฏ
We should make some software that would casually build and then run all versions of minecraft
yeah
but not enough time for now
x)
oh, maybe I was using the wrong dependency...
Wdym
not using the local-fat
let me cook...
perfect
here I go
LET'S FUCKING GOOOOOO
@rigid saffron @inland spoke @woven arrow
YAHOUUUUU
perfect
working on 1.13.2 too
https://hub.spigotmc.org/versions/ here is the repo with versions, we can use that to write the testing software
yeah
If you don't want to, I can write it later
fetching from jenkins, hummm
I'll try to do that, focus on the plugin x)
I'm pushing the patch on github too
CVN and tiny remapper have been updated
๐
there was an error with commons io in certain versions, but I fixed it by implementing apache commons, I think I'll made something more optimized than that later
yoooooo that's really cool
yeah
we still have the problem with those "huh, invalid plugin.yml"
We have three ways:
- (The easiest) Tell the users to ignore it
- Make a fake plugin.yml and some dummy class that will just disable the plugin
- (Please do not) Do funny stuffs to modify the server jar
Oh, and well
Use a different plugins directory
The best is either 1 or 2
like you said, that's cringe and not efficient
1 is bad, 3 is bad
Everything here is bad
- cvn-mixins
so the solution 2, I make it now
Solution 2 would be a gradle plugin thing I think
yeah
I forgot about that x)
I wonder if plugins can set their main class to be a class from another plugin
Can you try it?
Make some class in cvn called DummyPlugin, extend JavaPlugin, make it just disable itself, then make another plugin and set the main class to io.github.cvn.DummyPlugin
Unarchive to some temp folder, do changes, archive, replace old zip with new, delete temp folder
I'm pretty sure that's the way even WinRAR does it
Lol
I'm here in a few minutes
getServer().getPluginManager().disablePlugin(this);
yeah
Did it work tho
Ye
I'm actually copying some methods of apache commons io to lightweight the plugin
Also, we need to talk about the plugins license
yeah ?
๐
one of my plugin is LGPL
so it's good for me ๐
(you can download it here, yeah that's an ad : https://www.spigotmc.org/resources/better-mending.112248/)
april fool
no x)
bruh there is nothing in org.spigotmc
the biggest thing is bukkit, I forgot about that x)
Lol
setting the shadow jar archiveClassifier to empty only makes sense if the regular jar has a non-empty archiveClassifier
otherwise performance bye-bye
really ?
I mean that is how caching works
well, it generates me plugin.jar and plugin-all.jar so I wanted to "fix" that
You could of course dunk the regular ("slim") jar in some random dir, but that is more non-standard
and for tiny remapper, we don't really have choice because it doesn't choose tinyremapper-fat by default
hmm
the flat classifier shouldn't be used as a dependency either way
so how can I use tinyremapper-fat.jar as dependency?
why would you need to? Doing so completely kills the purpose of using dependency management tools in the first place
because we shaded asm
so I need asm
or should I shade asm directly from CVN ?
yeah, you shade dependencies as late in the build pipeline as possible
okay
doing it earlier would result in severe issues with dependency management tools - leading to duplicate classes, transitive dependencies that shouldn't exist but do (or vice-versa), and more
Only the things that want relocation
yes, not doing so could cause compatibility issues when the classloader is poorly written
we don't have control over the classloader (the classloader being bukkit).
And I haven't been doing bukkit in a long while and thus don't know how good it's classloader is.
definitely not the best
hum
looks like
I've seen it do weird shit before
Lol
@woven arrow there is a comment dedicated to you in CVN ๐
I mean writing classloaders is really hard - even my classloaders has serious faults at times. It's pretty much a pain to debug edge cases and when you encounter them you often tend to just work around them instead of fixing them outright
Thank god CVN doesn't need a classloader
Yeah, I'm very curious on whether the main class thing works or not
Bukkit when it has to load 7 plugins with the exact same main class be like: ???
oh yeah maybe that too
Just make it depend
yeah
We will just inject a dummy plugin.yml into the plugin anyways and maybe even let the user write their stuff in the normak plugin.yml and just rename it on compilation
"Make some class in cvn called DummyPlugin, extend JavaPlugin, make it just disable itself, then make another plugin and set the main class to io.github.cvn.DummyPlugin"
"Unarchive to some temp folder, do changes, archive, replace old zip with new, delete temp folder"
(bump)
yeah
yoo
what does it say
search ๐
the comment is in this x)
it's YOUR line ๐ซก
not OUR
๐ญ
:)
Lol
doc talks about facts
Yes
A plugin with a plugin.yml that leads to the class of another plugin?
shorter
Lol
huh, looks like it already exists
Besides when you are choosing between getBetterPlugin() and getPlugin()
hummm
it depends of context ๐ค
Another case is ZBLL vs ะัะฑะปะธะบ
hummmm
@spiral onyx right ะัะฑะปะธะบ?
one is more readable for the west world
West world doesn't matter fr
yes :3
Then we need to include it in all plugins, oh what a pain in the ass
Another addition to the gradle plugin
we'll make it smoother with the gradle plugin so not really a problem, right?
gradle pain-in
it's like a drive-in, just a pain-in
x)
paper...?
why paper 1.20.6
paper remaps to mojmapped
yeah, because if it works on paper, it works on spigot
DAMN
that will break stuff
that can be another little problem
LEGENDARY
!!
it wont for 20.5+
incredible
yeah
Lmfao
I'm thinking we'll rename all the plugins in the plugin.yml to CVNDummyPlugin-{uuid} so it doesn't get confusing why a plugin is loading, unloading and loading again
Gonna be a bit painful ig
Idk where to get the mojmaps from tbh
yeah
there is a problem
you're not allowed to publish mojmaps iirc
We won't
it doesn't remap anymore :/
mojank
I'M DUMB
or maybe not ?
no I'm dumb
see by yourself
so it's a PluginType.NONE
I need to put a condition if both are true
perfectly
not working
so I need to edit like you said
UUID pluginUuid = UUID.randomUUID();
String folderPath = plugin.getDataFolder().getAbsolutePath() + "/temp";
Files.createDirectories(Paths.get(folderPath));
// Edit from cvn-plugin.yml to plugin.yml
ZipFile zipFile = new ZipFile(remappedPlugin);
zipFile.removeFile("plugin.yml");
zipFile.renameFile("cvn-plugin.yml", "plugin.yml");
File tempPlugin = new File(folderPath + "/cvn-" + pluginUuid +".yml");
zipFile.extractFile("plugin.yml", tempPlugin.getAbsolutePath());
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(tempPlugin);
yamlConfiguration.set("name", "CVNDummyPlugin-" + pluginUuid);```
lol
I forgot to apply to the remapped jar
and to call my method too x)
not good ๐
Did something go wrong
yeah, because I don't know how to write code
and to write in english too lol
partially working
I need to go
holy fuck I just fixed the gradle plugin somehow
Finished remapping jars. Jar:
Intermediary mapped (to be used with CVN): NMSTestProject-1.0.jar
Official/Obfuscated (to be used like normal): NMSTestProject-1.0-official.jar
Original (Unmapped): NMSTestProject-1.0-original.jar
perfect
no problem
I'll work on CVN this afternoon
just, please, @rigid saffron PUSH ON GITHUUUUUUB
๐
okay ๐
._.
wat
I'm unable to push
use github desktop
can you send the source code here ?
sec
okay
here
thanks
the thing is a bit messy, I've written everything in one class, but it works
oh btw, this is the plugin that I tested with
okay
thanks
I'll push everything
you'll just have to clone the repo and you'll be able to push
but make a seperate repo for the test plugin
yeah for sure
๐
interesting
well, I gtg
bye
bye
do it in intellij with github logged in if possible
yeah, but the best is clearly github desktop
I got a few mins more
oh perfect
i just use gh cli or intellij ๐คท
I pushed in IJ with being logged into gh
should work then ๐คท
It denied access
Might add a token later
I used to have one added but it vanished
and then i can also just git clnoe
yeah
humm I don't think so
for now I'm just pushing and testing
if you want to make the mass server tester, maybe ๐คท
downloading all versions of spigot, and testing if the plugin works, and getting the result
Damn this is great
We only started 2 days ago and we already have an usable result
yeah x)
Definitely not the final result, but usable
The next thing I'll do will most likely be either the maven plugin or the mass tester
yeah
Hmm, where code
question
why are we logging to stdout and not bukkit logger
ohh that was gradle nvm
Lol
bukkit logger in gradle, ah yes
i might be the thinker
Also, why are you inspecting code again
i cloned everything
why
Ah
Either make the thing that downloads buildtools, gets all versions from https://hub.spigotmc.org/versions/ (that are actual mc versions), takes all files from a folder and setups servers for all versions to test whether things work
Or
Clean up our already existing code
so this is just a script that downloads everything and sets up servers?
Yeah, and then it runs them and tells us things
can i do it in kotlin
I thought of giving it a folder where you put stuff like the plugins folder, eula.txt, server.properties and it would copy it to all servers
Sure
yay
i'll start later
gets all versions from https://hub.spigotmc.org/versions/ (that are actual mc versions)
wtf are these other things
They are kinda like experimental builds or something
so 1.8.3-latest?
You can check whether it's an actual version by just checking whether it has more than one dot in the name
Ye
Nah, it just runs buildtools
yeah lol
A bit resource intensive but worth it
You'll also have to make it give all servers a different port because concurrency
time to make it in bend
in what
Never heard of it
I am very deep in java, can't get out this comfort zone, alright
it's spigot
just it was more efficient using System.out.println for debugging instead of instancing my main class and getting logger...
@rigid saffron don't forget to fetch the github branch before remodifying your code !!
because I renamed the gradle plugin to CVN
perfect remapping
it didn't remapped
it's almost working
basically, remapping using tinyremapper in CVN isn't working...
we're almost there
Show code
/**
* Takes in an intermediary mapped jar and remaps it to an official mapped jar (an obfuscated one).
* @param jarFile The jar file to remap
* @param resultJarFile The file to save the remapped jar to
*/
public void remapJarFromIntermediary(Path classpath, File jarFile, File resultJarFile) {
File mappingFile = plugin.getMappingFile();
if(mappingFile == null) throw new IllegalStateException("Could not find mapping file !");
TinyRemapper remapper = TinyRemapper.newRemapper()
.withMappings(
TinyUtils.createTinyMappingProvider(
mappingFile.toPath(),
Namespace.INTERMEDIARY.getNamespaceName(), // "intermediary"
Namespace.OBFUSCATED.getNamespaceName() // "official"
)
).build();
try (OutputConsumerPath outputConsumer = new OutputConsumerPath.Builder(resultJarFile.toPath()).build()) {
outputConsumer.addNonClassFiles(jarFile.toPath(), NonClassCopyMode.FIX_META_INF, remapper);
remapper.readInputs(jarFile.toPath());
remapper.readClassPath(classpath);
remapper.apply(outputConsumer);
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
remapper.finish();
}
}```
I think I might have a free minute
Have you decompiled the result jar
To see
yeah
well, the server saying that he doesn't know MinecraftServer
java.lang.RuntimeException: org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: net/minecraft/server/MinecraftServer
debugging what ?
The remapping
Just add sysouts
yeah
huh
oh I'm dumb
wait I forgot inverting
oh no
it was already switched
so if I re-switch ?
not working too
@rigid saffron any idea ?
wait
that is no sense
you told me to use the method to remap from intermediary, instead of using the one to remap to obfuscate
but we need obfuscate here
No
no ?
The one to obfuscate goes from mojang to obfuscated
The one from intermediary goes from intermediary to obfuscated
oh
but I need the mojang -> obfuscated to invert it for paper 1.20.6 and after
right ?
so 2 remappings for paper 1.20.6 and higher
Yeah
idk how to revert it
But I think paper goes from obfuscated to mojang by itself
but first, we need to know why intermediary to obfuscate don't work
If I remember correctly yeah
The issue is nobody has any idea
okay goodbye
Got a few free mins rn
CLASS net/minecraft/server/MinecraftServer$a net/minecraft/server/MinecraftServer$class_6897
CLASS net/minecraft/server/MinecraftServer$b net/minecraft/server/MinecraftServer$class_7460
CLASS net/minecraft/server/MinecraftServer$c net/minecraft/server/MinecraftServer$class_6414
CLASS net/minecraft/server/MinecraftServer$c$1 net/minecraft/server/MinecraftServer$class_6414$1```
MinecraftServer doesn't seem to be renamed. I wonder if NMS gets relocated
oh...
what can we do ?
huh
this is wild
but let's test that
@rigid saffron did you really choose the only class that isn't remapped x)
MinecraftServer is the common name for every namespace
All of them uses MinecraftServer as name
interesting
in 1.20.4, the error is
what the hell
ama is the obfuscated name for DedicatedServer, who extends MinecraftServer
@rigid saffron we forgot about craftbukkit
we need to "remap" the imported package too
oh
I always get a ClassNotFoundException
I think we can use a ClassLoader
oh, the thing that is really made bad ?
using nms 1.17.1, with craftbukkit 1.17.1, on a 1.17.1 server
if(className.startsWith("org.bukkit.craftbukkit")) super.findClass(replace the version with the right one)
so we need to do that for each class of the jarfile ?
the problem is that the name for MinecraftServer is... MinecraftServer and not "aas"
but here is what I see when decompiling
so idk why it's searching for aas if the namespace in the remapped code is MinecraftServer
i have been summoned
what do you need halp with
I need to know why it's searching for "aas" (obfuscated 1.17.1's name for MinecraftServer) instead of MinecraftServer, even more strange because in the remapped code, the namespace is named "MinecraftServer" so it should search for MinecraftServer
ok i can help in like 15mins
same issue on paper server and spigot server
@woven arrow use a 1.17.1 server for testing
We should ask the mapper himself (md_5) to help us
I doubt we can, finally, we don't load the plugin
hm
Our best idea would be to do more asm
okay i'm just tryna set up the project atm
huh
i tried to run 1.19.4 remapped buildtools
Lmao
๐ญ
I wonder if spigot does any extra remapping
It might be possible that spigot does a few things which will make us die
We should ask md5 directly
@latent mulch hello, sorry for pinging but we are a bit stuck, how can we solve this ?
And does spigot makes extra remapping ?
you get added
Yeah I noticed
Just tested it with a friend
Australian md is prob sleeping, right?
yea probs
Maybe ๐คท
He'll see that this night then x)
So can this issue be reproduced by simply building all plugins from source and using them on a paper 1.17 server, or?
Well, actually because of craftbukkit
But we will soon fix that
So actually, a CVN plugin using craftbukkit as dependency can only work for one version
But everything is on GitHub to reproduce the issue
so you found the solution now or?
No because I'm not programming rn
It's some strange cases of trying to use obfuscated namespace instead of Spigot one...
Yeah wait @rigid saffron, we should remap to Spigot, not obfuscated?
well I suppose that narrows it down
A bit, but we'll fix that
In the days comings
And when CVN will be working, I'll do some libs based on it, because it's not at his full potential
We can make much better
Spigot is just another type of deobfuscated mappings
I'll explain that later, but we are actually grouping similar nms versions, not all versions
It's not the same
It's kinda like mcp or yarn afaik
CVN or Spigot ?
Spigot mappings
But it's not the same ๐คโ๏ธ
I think that's why it's not working, we should do spigot remapping
Not obfuscated remapping
It's theory, but that could be a lib to do intra-remappings really easily
No, wtf are you saying
Spigot use spigot mappings, right ?
No
Spigot before mojmaps used spigot mappings
Mappings are just a way to make the games code more readable
On runtime the game is always obfuscated
Besides paper 1.20.6
And one quintillion other situations
But we are in spigot
Because spigot does funky stuff
We'll have to look into specialsource maven plugin ig
Funky groove ๐บ
Oh okay
Not shading it, it's +5 Mb ๐
Would be nice if md 5 himself could tell us
...but looks like he's sleeping
I have my doubts that it is because spigot uses a special type of mappings
I doubt that too
It is unlikely that md knows what it is
But I don't understand why MinecraftServer stays unmapped
But he knows more than we all do
I'm taking a look at it
Finally, he has written all of this spigot and spigot mapping ecosystem
What are the steps of reproducing the issue - just building all the plugins and the issue appears or is it more involved?
yeah, just building should do it
Build and run, should show the issue
But you might have to install a few things to your maven local
Well, first I need to run bt heh
seriously, I need to have 2FA enabled for this?
gah
Lol
It can't find the obfuscated name of MinecraftServer
Don't forget the logs I'd sent before
Probably because it does not exist or something
I can't test rn but can you make a plugin (just a plugin, not a CVN one) that just calls Class.forName("net.minecraft.server.MinecraftServer") and Class.forName("net.minecraft.server.v1_19_R01.MinecraftServer") or whatever your version is and wraps both of them in a try catch to know which one failed and which did not
oh yeah great idea
so - which jar am I supposed to use?
I searched a bit too
where ?
the highlighted one
(it's said on build)
that one fails on a random exception
hum wtf
is that the latest commit?
you're not using the latest
well time to nuke the build directory then
I'd fixed that
yeah lol
oh right - I completely forgot that build doesn't invoke the shadowJar task (you should change that)
'cause well actually
oh yeah
So it does exist there???
What class was missing then
build {
finalizedBy shadowJar
}
Or something
class name isn't obfuscated, method, field etc. yes therefore
I add that
I generally use dependsOn instead of finalizedBy
I don't think it makes much of a difference
google says that too
Can you send the class?
the entire jar?
The MinecraftServer class
oh okay
I wanna see it
wait
donno, even more random exception now
you're using linux...
I was a bit afraid of that x)
From the looks of it you are stripping the leading slash of the path
Holy shit how did you manage to mess up paths that much lol
I'm bad with paths x)
well at least linux paths a much more sane than how it works under windows
yeah
in windows, we have sometimes /, sometimes \, sometimes there is a / at the end, or even a \
everything is perfect ๐
and both can be present, like C:\Users/me/Documents\Hey Is That A Folder/hello\
oh, I messed up
then there is spaces, so you need to put " at the beginning and the end
I very like paths :/
how is it @rigid saffron ?
let's fix that ๐ค
I don't quite see where the error sneaks in though
with the / ?
Just like it should be
so OUR code is racist
ye
for 1.17.1
I know where it is
okay I think I got it now too
what ?
the / ?
@inland spoke see by yourself my "wonderful code"
Here my favourite method (setUsesAuthentication)
well not exactly the workaround I would have gone with though
incredible
how would you had done this?
If you know better options, tell us everything you know
Awful
nope, I was a bit blind
why is it even needed to strip the leading slash on windows?
because there is a / at the beginning...
I don't know why
Windows is shit ๐คโ๏ธ
does it work anyways?
it works.
Might be a valid UNC path for what I know
not on linux
What if you put it into a new File first
Without reformatting anything
not working
And then toPath()
No, I mean including the leading slash in windows
I was doing that before
Weren't you doing Paths.get
so new File(new File(path).toPath()) ๐
lol
oh yeah I was
import java.io.File;
import java.net.URISyntaxException;
public class JarPathFinder {
public static void main(String[] args) {
try {
// Get the location of the class file of the main class
String path = JarPathFinder.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
// Convert the path to a file to get a normalized version
File jarFile = new File(path);
// Get the absolute path of the JAR file
String jarFilePath = jarFile.getAbsolutePath();
// Print the path to the JAR file
System.out.println("Path to the JAR file: " + jarFilePath);
} catch (URISyntaxException e) {
e.printStackTrace();
}
}
}
``` chatgpt suggested me this
looks like I'm not doing this anymore
CHATGPT IS BAD
but let's listen to chatgpt a bit
It sometimes can be good
sometimes
Instead of jar path finder use the (bukkit) Server class
Who knows, who knows
x)
We need to make sure everything is ideal
there is still a lot of works to make everything ideal :/
it worked
Just that with every new mc version we will need to upload the mappings
but โจ still the same error โจ
not a problem
what error
"aas"?
see by yourself
DedicatedServer, so the extend of MinecraftServer
the real form of CraftServer.getServer