#[IN DEV] CVN (Cross-Version-NMS)
1 messages ยท Page 5 of 1
0.1s is better
Maybe
bitch this is a boolean
yes
there's no 0.5
ok
I'm quantum
nuh uh
So, I would say 2
bro is quanternium
QUATERNION F MENTIONED ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ๐ฅ WHAT THE HELL IS PAIN ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ๐ฅ
just use the bukkit scheduler bro
didn't help
Writing tiny...
Took 20624ms
Bytes: 3043664
Switch on phone
Parallelize more
15-20s is good
Rewrite from the beginning
Destroy your pc
in comparison to 45 secs? yes
juts Bukkit.getAsyncScheduler().runTask() smh
I'll test on mine, maybe I'll get 2s lol
it's a laptop sir
PUSH ON GITHUB ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ๐ฅ
I've got a laptop too
Maybe the problem is your COUNTRY
fr
Switch to France
do
sudo apt-get install france
sudo apt-get remove ww1 ww2```
Should work perfectly

SIGMA
RAD MENTIONED
๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ๐ฅ
Yeah it's him
omg
YAY
So you're not the same
i love pink ๐ฃ๏ธ ๐ฃ๏ธ ๐ฃ๏ธ ๐ฅ
The singer ?

what the fuck
Now I can peacefully relax
EIN SWEIN POLIZEI ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ๐ฅ
Working ??
I'll continue tomorrow
skull
PUSH ON GITHUB ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ
no
YESSS ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ๐ฅ
It doesn't merge yet
MERGE ๐ฃ๏ธ๐ฃ๏ธ๐ฅ
It only loads and saves very great
no how dare you pause working without stressing about not achieving what you wanted to achieve and losing all motivation i thought that was illegal/not possible
SO PUSH ๐ฃ๏ธ๐ฃ๏ธ๐ฅ
Same
I can't sleep if I don't have my work done
Ya zdes chtob isportit vam paty
che nahui
Pesnya takaya, u menya ona shas na zadnem fone
ne znayu takoi pesni
Exactly what I did yesterday
Nu i ne nado
nu blyat(
Ya yjki cito jutye importun takaha spoume sout africa
ne podelischa?
Gyat :(
Lmao
make this a gif yall
Ls?
I don't even know what this mean
ok
ls remove ./
That's the language of @rigid saffron
wut
True
So
We come from CVN to Gyat
Map art
Everything is good
what about this one
.
We are way more active than #help-development
#help-development is not cool anymore
True
ImIllusion was drunk this day
tf
My little collection
Spigot members when they realize I have recorded even their worst thoughts:
you?
we need more though
i know there's more
and host them somewhere
make a half assed website
bro's on a 2x combo
Already hosting them somewhere
but an art gallery
share
I have a laptop
just make one i cba to webdev
i have a server too
And 2.5 hours I could've played on the smp wasted to more or less efficiently save a file
or at least send an invite or something we need this to be public
yes that works
you have a proper domain too you should do it
mine is a free subdomain lol
It's kinda in a staff section
make me stuff then? don't see what the big deal is
bro wants to be stuffed
lol
Lol
add me to that servre
Find my mods modrinth or cf page and find the discord server there
Incredible
Not enough challanges
bet
ะฐะปะตะฝะฐ ัะฒะตั makes great songs apparently
who tf that
Ratio
@woven arrow when building for 1.20.5 ERROR: Method a (Lcom/mojang/datafixers/Dynamic;)V couldn't be written.
idk it just runs buildtools
it made gradlew run crash
I think you should fix that
Do we even need 1.20.5
that's nothing compared to some node_modules and occasionally rust's cache ๐
i haven't used js but i've heard some stuff
yeah
Yeah there is a critical bug
i finally coded something today
ggggggggggggggggggggggggggggg
perfect
well i gotta remove all usages of gridfs and substitute them for regular mongodb documents tomorrow because apparently now that i'm like 80% done with this thing it turns out that gridfs is not a good fit for replacing the contents of entire files and furthermore my files are under 1mb so gridfs is simply overkill
shit
And I gotta write the merger
don't think it's my isssue
can you run buildtools jar
yeah for sure
it's fetching files for 1.20.6
well, api isn't in good terms with 1.20.5
but that's not a problem
yeah
Buildtools does that for some versions
also, is your remapping code working ?
Somewhat
somewhat ?
bruh
the one for remapping only fields and methods or smth like that
and I don't remember what we should do for classes
the what
x)
Everything will work dw
okok
1.20.5 doesnt exist
it got replaced by 1.20.6
also you need java 21 for it
Happens automatically
for any version >=1.20.5 it uses jdk21
Sir nobody here is manually running buildtools
We have a tool running bt
is it a gradle script
oh
nvm
standalone
make it a gradle script on ur project
val javaVersion: Int get() {
if(minor < 17) return 8
if(minor == 17) return 16
if(minor < 20 && rev < 5) return 17
return 21
}
more gradle scripts
no
build src plugin it
Btw @woven arrow would be nice if you can instead of making it take paths seperately for all plugins it will just have one folder that it copies into all servers
hm
that could be a thing yeah
haven't actually implemented that yet so easier to change
How it advanced rn ?
damn bro
I need a profiler
where was it
Remapping...
Took 151907ms
Writing tiny...
Took 47171ms
holy god
it didn't even work
or it did, Irdk tbh
why not use jb profiler
huh???
(original is original mappings list, remapped is spigot mappings list)
aaa lag
yeah okay my brain is fried
whatever is happening there
wtf
I have nulls even tho I don't have any nulls
Like, I looped through all my Pairs and none of them have or are a null, yet I still get null issues
sounds like you have a null that you arent finding
And I have no idea where
add sysouts everywhere
๐ต A pain in the ass ๐ต
use a debugger with breakpoints everywhere then
Ig
The interesting thing is that there are no nulls, at the adding part, before the saving part, but when the saving happens it suddenly spawns
hmmmm
I even null check code that adds elements so nulls are not possible but they occur
send your saving system
Can't rn
okok
And it also only occurs after adding the spigot namespace to it
strange
And only if I parallelized the adding of the namespace (if I don't it takes up to 2 minutes)
It could be that somewhere in the threads a fuckery happens but why
When I parallelized the saving of the mappings I had 0 issues and it even kept its order
I think I should rewrite this in c++
Because 20 seconds to save 3mb of mappings is an absolute ๐ moment
Wait, why is the size 69k when it sbould be 74k
(nice)
Lol
is it working now ?
Give me a few mins
omg it's not erroring
Remapping...
Original size: 74574
Remapped size: 74574
Took 36395ms
Writing tiny...
Took 41756ms
takes a while
but it worked
yay
I think the slowness comes from my laptop not having enough cores
on real server hardware it would probably run way faster
anybody wanna test?
i have 6 cores want me to test
hmm, I wonder if using a Set would work here, finally, I never query something by the index and duplicate elements would also not make any sense
aha, I was running low performance mode
well
I've got 8 cores, I can test for you x)
@rigid saffron can you push on github ?
sec
I'm eating but I'll try after
no this is even slower
Merging mappings mappings.csrg into mappings.tiny.
The process may take a while, please wait...
Merging mappings took 21698ms.
Saving mappings to mappings-new.tiny.
The process may take a while, please wait...
Saving mappings took 35544ms.
The whole process took 57242ms.
my best
source code public
okay then wait
I'll try it
well, there is a little issue with that
Idk if I can send the mapping files here
โจ dms โจ
let's try
but here they are, just put them all in one directory and run
java -jar mapping-merger.jar --from mappings.csrg --to mappings.tiny --out mappings-new.tiny --namespace spigot
if I get banned you know why
but I doubt I will
what java version
damn
lemme cook
why tf does pair require jfx 
no idea, I just imported the first pair class ij suggested
Merging mappings mappings.csrg into mappings.tiny.
The process may take a while, please wait...
Merging mappings took 9055ms.
Saving mappings to mappings-new.tiny.
The process may take a while, please wait...
Saving mappings took 12268ms.
The whole process took 21323ms.
i doubt it should take 9 seconds still somehow
well, it is a bit of an expensive operation so kinda of expected ig
I can put parallel streams everywhere but I doubt abusing them is a great idea
we love abusing shit
Especially villagers
Yk what, I decided to try using parallel streams everywhere and performance became worse
Lol
I'm trying
BRO
๐
@rigid saffron
yeah
Well, I guess I'm not running cvn on my laptop lol
My current implemention is pretty much the fastest apparently
@fallow sky btw you can now continue working on cvn
Download spigot mappings, download intermediary mappings, merge them, then remap the plugin jar to spigot
Yeah, with the tools I wrote
I turned off everything on my laptop and ran it
My cpu was at 10-15% and it immidiately peaked to 100% as soon I started
But I did get a better result, 47 seconds
I even closed sharex, my screenshotting software
Should've closed explorer too
I'm around 10s personally
well
I need to publish mappings-merger to maven local @rigid saffron ?
let's edit a bit
@rigid saffron, what are the possible namespaces ?
adapted to spigot, now 43Kb
perfect
I've learned so much of gradle in a while
incredible
Wdym
for --namespace
Anything, it's just what the spigot namespace will get added as
it's normal
it has no manifest
it'll be a dependency
Did I push the manifest and shadow plugin changes to gh?
It'll be used in CVN directly on server, no need to add a manifest
It has a somewhat of an api
yeah
MappingMerger and Tiny- + CsrgMappingFile
Ye
What did you edit
the jar I'll use, if you want
removing optionparser and his dependency and instead adding arguments, renaming from Main to MappingsMerger, removing shadowjar, removing jetbrains as implementation...
Just remove Main then
now using getLogger
Main should not be used as api
very final
We have a MappingMerger class for a reason
what is even the purpose of this project
it's just to make using nms between versions easier
it also changes nms and cb imports to the current version
isn't that just 1 gradle script though
no, it does that on runtime so you don't need to have 20 jars or one jar and twenty implementations
why not just write ASM then
well, if you think it's useless then you can just leave this thread
I'll do something for those who wants 20 jars (one for each version) when the project will be finished
basically a gradle plugin
but I'll do that by my side, not really the goal of the project actually
final-final jar
x)
why publishToMavenLocal... doesn't publish to maven local ?
it does if you setup your publish plugin
you need to configure the published component
how ?
publications {
create<MavenPublication>("Maven") {
project.shadow.component(this)
this.artifact(tasks.aggregateJavadocJar)
}
}```
If you're using shadow its this, otherwise you just get the jar components
okok thanks
any groovy version ?
no I only use kotlin
okok
its probably some random arbitrary less verbose thing
it does
it doesn't...
just add maven local to published repos
in publish you can add repositories, add maven local there, then just run the publish task
still not working...```groovy
plugins {
id 'java'
id 'maven-publish'
}
group = 'io.github.spigotcvn'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
mavenLocal()
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = 8
}
}
dependencies {
compileOnly 'org.jetbrains:annotations:20.1.0'
compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT'
}
test {
useJUnitPlatform()
}```
@rigid saffron do you know why ?
Ah wait no
I think you don't need to add maven local
You just need this
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
Iirc
Also why tf are you adapting all the libs to use spigot api
That's very unnecessary
They work without it
well
just to have one method to call
@rigid saffron, I put the mapping-merger instead of what ?
Wdym
// Remap from intermediary to server obfuscate and put the file as remappedPlugin
this.remappedPlugin = new File(plugin.getAbsolutePath().replace(".jar", "-remapped.jar"));
File classpathJar = new File(FileUtils.formatToGoodJarFilePath(cvn.getServer().getClass()));
remapper.remapJarFromIntermediary(
classpathJar.toPath(),
plugin,
remappedPlugin
);
FileUtils.jarToCVNJar(cvn, remappedPlugin);
Pair<Map<File, String>, File> mapFilePair = FileUtils.remapCraftBukkitImports(cvn, remappedPlugin);
try {
JarUtil.repackJar(remappedPlugin, mapFilePair.second());
} catch (IOException e) {
throw new RuntimeException(e);
}```
I put it where ?
Before remapping the jar, you download the intermediary mappings, generate combined spigot mappings and after that you run the merger, save the new mapping file and use it to remap from intermediary to spigot instead of to official
oh okay thanks
what is the method to remap from intermediary to spigot instead of to official ?
I don't think I have it
What is remapJarFromIntermediary, show it
Create a Namespace.SPIGOT
Yes
should I use SpigotMappingsDownloader#generateCombinedMappings ?
Yes
If it is needed it'll do it automatically
okay perfect
Btw, don't forget to implement some checks so it reclones the builddata and regenerates the mappings when the version changes
It's not something the lib should be doing
wait
But if you do need me to contribute in the plugin I can do that
Don't forget to push your changes
Tf is MappingMerger.map();
It's just Main.main
Bruh
By replacing args by File and namespace by String
You are unnecessarly complicating stuff
Yeah
I have a class with a static method that specifically takes 3 arguments and describes them as good as possible in the javadoc
And you still renamed the Main method
Do everything
I'm in a car right now
Just rearrange the code correctly
@rigid saffron is it working ?
I was playing on #1242181722326569000
???
what even is the point of the downloadSpigotMappings method
it just runs the downloadMappings method and that's it
I didn't have time to finish it
That's why I wanted you to do it x)
and I'm unable to do that because I can't understand anything
oh I see
I'll try by myself then
but first you download spigot mappings to some directory (it will pull the whole builddata repo)
then you combine them into one mapping
then you download intermediary mappings
you merge intermediary and combined spigot mappings together
๐
@woven arrow when cvn is done, will you use it
No, like, in your plugins
i don't do other plugins
Damn
we run our servers on 1.20.6 and use viaversion for 1.20.2-1.20.6 compatibility
Understandable
If you can't work at all, then I can try doing something
Yeah, do what you want ๐
Personally, I think I'll use it
But not with compile at runtime
But directly as a plugin
I'll do that when everything will be working
Or even
Like multi module basically
Actually, why am I using a list of pairs in the merger
Shouldn't a BiMap work
I was concerned about duplicates on either side but that's nonsense
One thing can't be remapped to multiple things and multiple things can't remap to the same thing
hmmm
performancizationMerging mappings mappings.csrg into mappings.tiny.
The process may take a while, please wait...
Merging mappings took 133ms.
Saving mappings to mappings-new.tiny.
The process may take a while, please wait...
Saving mappings took 163ms.
The whole process took 296ms.
???
Duplicate mapping: Mapping{type=FIELD, name='baa$e', className='a', descriptor='Ljava/nio/file/Path;'} -> Mapping{type=FIELD, name='comp_1156', className='a', descriptor='Ljava/nio/file/Path;'}
Existing mapping: Mapping{type=FIELD, name='baa$a', className='a', descriptor='Ljava/nio/file/Path;'} -> null
wtf
eeu/willTickThisTick: Mapping{type=METHOD, name='eel', className='b', descriptor='(Lgt;Ljava/lang/Object;)Z'} -> Mapping{type=METHOD, name='willTickThisTick', className='b', descriptor='(Lgt;Ljava/lang/Object;)Z'}
eeu/willTickThisTick: Mapping{type=METHOD, name='eeu', className='b', descriptor='(Lgt;Ljava/lang/Object;)Z'} -> null
``` this is nonsense
System.out.println(from.getName() + "/" + to.getName() + ": " + from + " -> " + orig2remap.get(from));
vs
println("${from.name}/${to.name}: $from -> ${orig2remap[from]}")
sorry i had to glaze kotlin real quick for my kotlin fix
println my beloved โค๏ธ
why are you parsing eels
willTickThisTick
mojang moment
that's fast
might be possible that I'm a dumbass
and messed up parameters
wtf
now it's throwing the exception just for fun
it does literally not exist
wat ๐
but the exception that it exists is still thrown
IT LITERALLY DOES NOT EXIST
WHAT THE FUCK
wtf
I think it isn't accounting for the class name
holy god
but why
this is nonsense
oh my god
why the fuck
is the remapped name
in the class name
instead of the name
huh but there is no method name o in the class a
wait
what if
huh
that worked
apparently I messed up the order a little bit
first comes class, then name, then description, then remapped name
bruh
hmm
wtf
in the tiny mappings there are nonexistant duplicates
just as I said duplicates wouldn't make sense
@fallow sky where did you get these cursed mappings from
the exact thing that should not happen
which version ?
1.19.4 iirc
fabric official intermediary mappings
newer : https://github.com/FabricMC/intermediary
legacy : https://github.com/Legacy-Fabric/Legacy-Intermediarie
are you sure they work with each other
they should
Not yet
Merging mappings mappings.csrg into mappings.tiny.
The process may take a while, please wait...
Merging mappings took 167ms.
Saving mappings to mappings-new.tiny.
The process may take a while, please wait...
Saving mappings took 220ms.
The whole process took 387ms.
``` does this count as solved
"minor"
c'mon man, it's just 100 times faster, not that much lol
Lol
Should've called it "micro optimization"
yeah
nah @rigid saffron that was wild
Lol
List of pairs did work pretty well but a LinkedHashMap seems to work better (I always look shit up by the obfuscated name of the element so it does kind of make sense to use specifically a HashMap and to keep order a Linked one)
logically, here you can use a Set instead of a List, because duplicated key values are already destroyed, so collect your stream to a Set
I don't think it quite matters
well
An array list in some cases will be even more performant than a Set (I have tested switching tbe ArrayList to a HashSet in the orig2remap map)
And the list will only be looped through which from what I'm aware of is way less complex than looping through a set
well, yeah
I didn't read at the other part of the code, only the part shown in the commit report
I could even use a forEach and then add but that is a bit bad when it comes to parallel streams
I did test
Nah I just wasted a lot of time on pointless stuff
x)
nice
My friends usually tell me the opposite
x)
ive done quite the opposite today
you'd an exam too ?
bruh
Always the idiots
true
delivered a halfly working site
Usually I'm the guy who isn't allowed to do anything in the back, but when it comes to presenting the project I'm suddenly the most important person and have to give the most fucking amazing speach ever given
๐
i love giving demos
i'm the guy who has to do everything lmao
I'm better at writing than at speaking, but usually I'm the one speaking, rather than the one writing
That cured my social anxiety btw
Polska krowa
RASPUTIN ๐ฃ๏ธ
Tf
very slow, but pretty good
meanwhile theres #1230253251169878026 lol
@fallow sky is there anything I have to work on or is everything left to do yours?
did you make it working ?
well, I did make it speedy and work correctly
but it's now your turn to use it all in the plugin
which I hope you will do correctly
x)
so
I need to download spigot mappings, and then remap using spigot mappings and tiny mappings ?
basically, in your plugins data folder you will have two folders, one for remapped jars (rjf for short) and one for the builddata repo (bdrf for short)
Basically, you download spigot mappings, download mojmaps, then combine them and then you use the combined mapping for everything else (iirc the combined mapping generate method should take care of all of everything that hasn't been done before)
If the version changed, run the generate mappings method with argument true, that will ensure the mappings are redownloaded and regenerated
The method will give you a MappingFile, hold onto it until you have downloaded intermediary mappings. Then use the mappings merger (please without renaming the main class and just use the provided api) and combine the tiny and spigot mappings, as the namespace set the spigot
Now you have the tiny mappings, remap the jars using that from intermediary to spigot and store the remapped jars in the rjf. With them also store one text file that has an identical name, just with .txt added to the back (don't even need to remove .jar) which will simply hold the hash of the original (unremapped) file. Every reboot it will go through all jars and if it's a cvn plugin, it should check whether its hash exists and whether it has changed, if any of the conditions don't meet it will remap the jar and regenerate the hash.
Then you just call load on the remapped jars and that's it
i ain't reading allat
if i try to understand that i will have a breakdown
(c) 2020 Microsoft Corporation. These mappings are provided "as-is" and you bear the risk of using them. You may copy and use the mappings for development purposes, but you may not redistribute the mappings complete and unmodified. Microsoft makes no warranties, express or implied, with respect to the mappings provided here. Use and modification of this document or the source code (in any form) of Minecraft: Java Edition is governed by the Minecraft End User License Agreement available at https://account.mojang.com/documents/minecraft_eula.
(btw this means you can freely redistribute code mojampped if you don't bundle mojmaps with it lol)
okay thanks, I'll do that
but later, I'm busy now
no problem, do it when you have the time
'cause it's my sister's birthday
I think I'm almost done
just have to implement the check with hash
but not today
more likely tomorrow
@rigid saffron I passed the combined csrg file to remapJarFromIntermediary and got thatjava java.lang.RuntimeException: java.io.IOException: invalid/unsupported mapping format
with java mappings.remapJarFromIntermediary( classpathJar.toPath(), plugin, remappedPlugin, Mappings.Namespace.INTERMEDIARY, Mappings.Namespace.SPIGOT );
let's go to sleep, I'll see that tomorrow
see ya
Meaning I will be working on the mapping merger all day again, yay
Let's gooo ๐ญ
@rigid saffron did you make it works ? :3
what
did you found the issue ?
Nah, haven't looked into it yet
okok
I'm doing a modrinth api system (wrapper ? idk if we say like that) to fetch projects, etc.
nothing to do with CVN
k
I'll do a plugin to directly have a remapped version at compilation (one for each version, and after combining every versions in one like multi module)
Like, one that writes multi-module nms for you?
Huh no, idk
Wdym then
Just compiling the project and making one jar for each version based on the intermediary mappings
Isn't that kinda eh
Or much better, combining all jars into one
Like multi module project when they are compiled
So, just making it write the multi module nms for you
Yeah
But directly by manipulating the jar
Ye I understood
Sounds fairly simple
And fairly complicated because fuck the gradle plugin api
Yeah
Nah shouldn't be a problem, I'll learn
Yk what you could do for that plugin? Something where you can provide seperate modules for versions where nms did change and then it will just generate the ones in-between by itself
Humm
So you can for example provide 1.8, 1.13 and 1.20.6 because these are the only versions in which something you do changed and just generate everything in between yourself
might run the mass-tester to just run buildtools and generate all the mapping files and shit yk
Hmm, I'll have to tweak the cvn gradle plugin to ensure it works correctly with versions that do not have mojmaps
I don't really know how to do that
Well, as you said, you'll learn
X)
I think to make gradle plugins configurable you use extensions
Guys can you help me translate this ?
Ukrainian, interesting
Ye
I can see ukrainian from far away
Doesn't mean I can easily comprehend it tho
I can see that it's not readable from far away personally
Lol
I can recognize what language it is when I see cyrillic
Send me russian, ukrainian, belarussian, bulgarian and serbian texts and I will be able to tell you what is what
But I really wanna try now lol
You should try making the remapJarFromIntermediary works ๐คโ๏ธ
yet you did not push the new code yet
hmm, tiny v1 don't got comments lmao
pushed update, it should work ig
try updating the dependency and running cvn again
it's pushed
okay
Downloading spigot mappings...
@rigid saffron
java.lang.RuntimeException: java.io.IOException: invalid/unsupported mapping format```
โจ
you are never merging the mappings
instead you are just passing the spigot mappings which are csrg and not tiny
combined spigot mappings != merged mappings
combined spigot mappings are just normal spigot mappings but in one file
merged mappings include obfuscated, intermediary and spigot
how can I fix that ?
okay okay okay
no UncheckedIOException ๐๐
@rigid saffron like this?java public void mergeMappings() throws InvalidMappingFormatException { File from = plugin.getCombinedMappingFile(); File to = plugin.getTinyMappingFile(); File out = plugin.getMergedMappingFile(); String namespace = Namespace.SPIGOT.getNamespaceName(); CSRGMappingFile fromFile = new CSRGMappingFile(); fromFile.loadFromFile(from); TinyMappingFile toFile = new TinyMappingFile(); toFile.loadFromFile(to); System.out.println("Merging mappings " + from.getName() + " into " + to.getName() + "."); System.out.println("The process may take a while, please wait..."); long start = System.currentTimeMillis(); long startMerge = System.currentTimeMillis(); MappingMerger.mergeTinyWithCSRG(toFile, fromFile, namespace); long endMerge = System.currentTimeMillis(); System.out.println("Merging mappings took " + (endMerge - startMerge) + "ms."); System.out.println("Saving mappings to " + out.getName() + "."); System.out.println("The process may take a while, please wait..."); long startSave = System.currentTimeMillis(); toFile.saveToFile(out); long endSave = System.currentTimeMillis(); System.out.println("Saving mappings took " + (endSave - startSave) + "ms."); long end = System.currentTimeMillis(); System.out.println("The whole process took " + (end - start) + "ms."); }
HEY
yes, but without all of the print statements and longs
WERE ALMOST THERE
[15:53:06 ERROR]: Error occurred while enabling CVN v1.0 (Is it up to date?)
java.lang.RuntimeException: org.bukkit.plugin.InvalidPluginException: Unsupported API version 1.20```
Lol
paper moment
x)
okay
let's retry
I've done a lot of pushes
[15:56:58 ERROR]: Error occurred while enabling Test-CVN v1.0 (Is it up to date?)
java.lang.NoSuchMethodError: 'void net.minecraft.server.MinecraftServer.method_3779(int)'
at io.github.spigotcvn.test.Test.onEnable(Test.java:17) ~[NMSTestProject-1.0-remapped.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-388]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:665) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:432) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1164) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at java.lang.Thread.run(Thread.java:840) ~[?:?]
[15:56:58 INFO]: [Test-CVN] Disabling Test-CVN v1.0```
how remapped is the jar
tbh no idea
uh in the merged mappings file
it doesn't have the right mapping for the method_3779
BRUH
that's because those two methods are missing a spigot remapping in the merged mappings it seems
and I have no idea why
huh
I think I fucked up the mapping format again
bruh
gimme a minute
why is everybody communist suddenly
x)
because mappings are communist
open source is communism
everyone help and contribute with comrades
x)
'FIELD' <tab> <parent-class-name-a> <tab> <field-desc-a> <tab> <field-name-a> <tab> <field-name-b> <extra-ns-field-names>
hmm
but I doubt this is how it has to look like
METHOD a (I)V net/minecraft/server/MinecraftServer method_3779 setPort
maybe... ?
METHOD net/minecraft/server/MinecraftServer (I)V a method_3779 setPort
``` looks better
you know how to fix that ?
changes pushed
send mapping file
well i bet it has a good personality though-
wat ?
[16:20:49 WARN]: Enabled plugin with unregistered PluginClassLoader Test-CVN v1.0
[16:20:49 ERROR]: Error occurred while enabling Test-CVN v1.0 (Is it up to date?)
java.lang.NoSuchMethodError: 'void net.minecraft.server.MinecraftServer.method_3779(int)'
at io.github.spigotcvn.test.Test.onEnable(Test.java:17) ~[NMSTestProject-1.0-remapped.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-388]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:665) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:432) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1164) ~[paper-1.18.2.jar:git-Paper-388]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
at java.lang.Thread.run(Thread.java:840) ~[?:?]```
โจ
gimme a second
It's for testing purposes ๐คโ๏ธ
I'm working on something
okok
hmmm
this is getting complicated
I think the issue is that the classpath is in spigot mappings, but the intermediary mappings are in obfuscated
huh
it now generates spigot to intermediary mappings!
create a tiny mappings file, save it in original form, then call replaceOriginalNamespace(TinyMappingFile tiny, String namespaceReplacedBy) on it with arguments (tinyMappingFile, "spigot"), this will make the main/original namespace spigot and see if that helps at all
@fallow sky pls see
yeah for sure
added to the code I already have ?
hmm I just tried it and it did not seem to work :/
Basically, the initial idea of just merging the mappings should work just fine, no idea why it's doing this weird thing
hum
I asked in fabric discord, lets wait now
okay
I can confirm that gradle > maven
lol
I swear if we will end up rewriting the tiny remapper
Maybe ๐
I HAVE REALIZED
Come to a realization
The classpath in mapped in spigot, but the from mapping is intermediary
oh shit
I think that might require us to change a fuckton of code
We can either
- Remap the server jar and use that as classpath
or - Rewrite some of the tiny remapper in order to make it accept differently mapped input which it can remap on the go so we can get an intermediary mapped class from a jar
The second will be slightly more efficient simply because we don't need a second jar and we aren't gonna write anything
Or we can externally try to add our intermediary classpath which sounds fun and at the same time does not
The first one still sounds like the best
well, who could've guessed, it decided to not remap methods
even when remapping the spigot server jar
fields and methods stay untouched
I wonder if we can remap stuff using specialsource
If you can remap stuff by ignoring the mapping hierarchy you could use stianloader-remapper I guess
The main "problem" (actually completely intended) is that stianloader-remapper will for example treat java.lang.Object's toString method differently to the toString method of java.lang.Integer - easily causing mapping tears if you are not careful with subclassing
This is the reason why TR needs the classpath in the first place as it did not choose the path of trusting the API consumer with that knowledge and will instead try to apply the mappings in a way where mapping tears are not possible
great, but that doesn't tell me anything about this issue
I can remap from obfuscated to intermediary, I wonder if I can revert
But on plugin build time I usually have an obfuscated mc server jar, on runtime I do not
Tr is good, our situation isn't
So, you think you can fix that ?
ยฏ_(ใ)_/ยฏ
reminder that yall should work on cvn
Could've tried coming up with a solution yourself too
If you can't find, I can't find too
The efficiency of working grows logistically depending on the amount of workers
That's true
But I think you should send me the resources you base on to do everything you have done
I need to learn first
What's the exact, detailed issue ?
classpath
it needs a spigot jar remapped in intermediary to check hierarchy but Idk how to remap spigot to intermediary
huh
well, I guess it's time to write another email to md_5
last time he responded pretty quickly (a bit less than a day of wait)
what'd he reply with
I wrote him the most formal email ever and he responded like I'm his bro with "
Hi
Those field mappings are a combination of Spigot class names and Mojang field names.
On earlier versions, Spigot had its own field mappings."
ngl respectable man
based
big W I'd say
Yeah that's a pretty good idea
I didn't have time to work on CVN today
And it's not even just working, but also learning, I'm very busy this time because I was a sick for a week, I missed a lot of school...
And well, my relations are a bit difficult those times...
So sorry ๐ I'll try my best
bro actually just said "Idk about those tools ya using, ask somebody else"
lmaoo
Ig I'll fork buildtools today, check how it works
based md moment
Absolutely
Bruuuh
Well I have a few ideas
well
I find nothing on google to help me :/
why the fuck does tr leave unmapped classes in the jar after remapping wtf
would look right to me if not the method name
METHOD l (Lclo;Lgt;Lcpi;Lgz;Lcpi;)Ljava/util/Optional; a method_34851 getTopConnectedBlock
METHOD l (Lgt;Lgz$a;ILgz$a;ILjava/util/function/Predicate;)Ll$a; a method_30574 getLargestRectangleAround
METHOD l (Ljava/util/function/Predicate;Lgt$a;Lgz;I)I a method_30575 getLimit
METHOD l ([I)Lcom/mojang/datafixers/util/Pair; a method_30576 getMaxRectangleLocation
for whatever reason they are unmapped in the actual spigot jar
the more I look into this the more fucked it is
WHY IS THE FIRST EXISTANT AND THE SECOND NOT WHEN BOTH SHOULD EXIST
I have specifically implemented equals and hashCode to make sure they work for comparisons and hashmaps but now everythings fucked???
Is this what I think it is?
wdym
just a few guys doing a lil project for fun
NMS on any version?
yeah but like not really
That's not lil project ๐
you do know nms changes
lol
Yes
true
it's just to allow for writing less nms impls when working with nms for example
because not all nms versions change stuff yk
So it's like a set of wrappers to make working with NMS easier
well, it's a bit complicated what cvn is
what are you guys doing?
well, no
ยฏ_(ใ)_/ยฏ
yk how fabric works with intermediary mapping mods and stuff?
I didn't touch much fabric, but yes, I listend something abt that
basically, mappings change between versions, but some are made specifically to stay the exact same between versions, called intermediary. CVN has a gradle plugin and a spigot plugin, the gradle plugin remaps spigot plugins to indermediary (currently only mojmap -> intermediary, planning to add support for other stuff and older versions later)
Then we have the spigot plugin, it detects cvn plugins, remaps them (and saves them to some cache directory) to the current mappings and then loads them like usual. It should also store a hash of the original file so whenever the file changes (plugin update or something) it will be re-remapped
Oh, that's similar to what paper does?
Probably not
Some things the cvn gradle plugin also does is rename the plugin.yml to cvn-plugin.yml and add a fake plugin.yml with some dummy JavaPlugin class so spigot doesn't throw an exception about a jar lacking a plugin.yml, main class and also so cvn can identify cvn jars
