#[IN DEV] CVN (Cross-Version-NMS)
1 messages · Page 1 of 1 (latest)
Okay, so let's create a lib TOGETHER (URSS anthem please) to interact with multiple Minecraft versions' nms using an intermediary approach (something like fabric intermediary)
WE should make a maven/gradle plugin to transform from remapped to intermediary, and a lib with a classloader that will be able to convert intermediary to obfuscated on runtime. Then remap the plugins so intermediary is remapped into obfuscated in the plugin classes and then load them to the spigot server like usual
Github : https://github.com/SpigotCVN
Some principal links we need to consider :
- New nms notation : https://forums.papermc.io/threads/important-dev-psa-future-removal-of-cb-package-relocation.1106/
- Fabric mappings/system : https://github.com/FabricMC/intermediary / https://github.com/FabricMC/fabric-loader
- Generating mappings : https://github.com/sfplayer1/matcher / https://fabricmc.net/wiki/documentation:matcher
- Legacy mappings : https://github.com/Legacy-Fabric/Legacy-Intermediaries / https://github.com/OrnitheMC/feather-mappings
- Working with deobfuscation mapping files : https://github.com/FabricMC/mapping-io
Feel free to help with some code you made/you found !
You just want to make multi versions compatibility ?
exactly
there is a readable exemple
private SlimeNMS getNMSBridge() throws InvalidVersionException {
String version = Bukkit.getServer().getClass().getPackage().getName();
String nmsVersion = version.substring(version.lastIndexOf('.') + 1);
switch (nmsVersion) {
case "v1_8_R3":
return new v1_8_R3SlimeNMS();
case "v1_9_R1":
return new v1_9_R1SlimeNMS();
case "v1_9_R2":
return new v1_9_R2SlimeNMS();
case "v1_10_R1":
return new v1_10_R1SlimeNMS();
case "v1_11_R1":
return new v1_11_R1SlimeNMS();
case "v1_12_R1":
return new v1_12_R1SlimeNMS();
case "v1_13_R1":
return new v1_13_R1SlimeNMS();
case "v1_13_R2":
return new v1_13_R2SlimeNMS();
case "v1_14_R1":
return new v1_14_R1SlimeNMS();
case "v1_15_R1":
return new v1_15_R1SlimeNMS();
default:
throw new InvalidVersionException(nmsVersion);
}
}
ok ok 🙂
I'm very unclear at this point of development on "how should I structure that?" but I'll find soon x)
the aime is to be used by several plugins as api ?
yeah
Oh i see this should be very interesting
yeah, the goal is to make that working for every version (maybe 1.8-1.20.6), with reflection
yeah currently it's a wast of time to implement each nms versions 😦
that's what I'm thinking too
I'm pretty sure the goal here is to make it compatible with nms versions without modularizing it like that
Yes I miss understand the question of PauLem
I had the idea of such a thing longer ago so I was happy to see somebody have a similar idea
x)
Wow you are both French ? 😄
Am german
I'm french, yeah
The "Mayo/naise" caught me xD
oh lol x)
Do you like mayo
It's better than the Ketchup
Well, this is getting a bit off topic
I think too x)
a bit
but np with that
(sorry)
Well, I do have more of an idea on how to do this now
Tell me what you know everything you know
Okay, so
We need to create our own intermediary mappings using some software linked on this repo, we will start at 1.8 and update the mappings for all spigot versions
Then we need some classloader that the plugins utilizing the library will use. That classloader will have the mappings for the current spigot version (it'll either have them all hardcoded or it will dynamically download them from some github repo) and will find nms classes by their intermediary names. So, when there is a call to load net.minecraft.server.c_1509_ it will load net.minecraft.server.v1_17_R1.b or whatever the obfuscated name is
The last, but not least part is the maven/gradle plugin. That will find the intermediary name and change it to that (for example, change net.minecraft.server.v1_17_R1.Player to net.minecraft.server.c_1509_ or something like that)
This is just a rough idea on how that would work, I have no idea how to implement that and whether this is exactly how it works
hmmm I see (a bit)
I'm not a native english, so still a bit lazy with english, but I think I'll understand when I'll deal more with nms
I'll see how to implement after making the first logic working
(and it'll be soon on github)
But what the aim this nms api exactly ? I mean what are the limits ? If this API give an abstract access to all nms classes it's literaly a project like Bukkit or Fabric right ? Or I just still don't understand
interacting with nms classes in a convenient and efficient way for a large amount of versions
but wich interactions ?
creating instance, editing field, getting values...
All nms versions are differents we can't have the same abstract access for all versions
I know
how to manage that ? If we must check manually might as well use NMS
hummm
okay
so let's use modules
Well, a lot of common code is kept accross versions (mojang doesn't rewrite minecraft every few months) and something like this will majorly optimize usage of common code. Imagine this:
You have nms implementations from 1.8 to 1.20, but the only versions where the nms code actually changed were 1.13 and 1.17
With this lib you could drastically reduce the amount of code needed in a mostly efficient way
Ok i think I see, with this example we write only two implémentation (pre 1.13 and 1.13+) instead to implement all nms vesrion between 1.8 and 1.20 ?
exactly
but first, I need to know the "commons codes" between each version, so let's do it with modules first
the only problem I'll see with reflection is that each method has a different name between each version of minecraft because of obfuscation (b(), e())
so it would need me to search the name of the method in this version, based on the mapping, which have a common name between each version
That's exactly what intermediary mapping will help us fix. It will have constant names that are not version dependent that do map to the obfuscated names
Also, in this case we will not even need reflection, a custom classloader (dunno if that qualifies as reflection tbh) would allow us to access any class like usual and maybe even extend and implement classes
I think you are still misunderstanding the concept I suggested
I think too, but I'll understand when I'll go further
Well, to go further you need to know what to start with, yk
I already started, and then I'll optimize
what exactly did you start
Making the system for 1.9.4
Show code
let me publish that to github
actually in very beta
but working
https://github.com/Paulem79/GNI
@rigid saffron
You are just implementing nms classes as your own right?
yeah basically
but I'll group that
That's the approach we do not want, as that requires lots of working and that's basically just rewriting bukkit inside of bukkit but extra complicated
so it's not that
I'll use reflection after, but first I need to understand correctly nms
The idea of intermediary mapping nms is to allow directly interacting with nms without any wrapping
yeah
I know
but please, wait a bit
Ok
I said three times that I first need to understand nms correctly
Technically, this project doesn't really require knowledge of nms
We can generate it ourselves
using Matcher?
Yeah
but how can I then get the mappings for a specific version in my code and then get the corresponding obfuscated name?
Upload the mappins somewhere (for example github) and dynamically download them depending on the version, using a classloader and a fuckton of magic we find and remap the classes we need and give it to the plugins
huh
let's do that then
I guess we'll even need asm or something like that to remap the classes properly
hum
I never used asm
but anyway, that's a collective project
Neither did I, but we'll have to learn
exactly
Yeah, just load the correct class and remap all fields and methods
The biggest issue is remapping fields and methods, that sounds like modifying class bytecode
yeah
do you know how to generate mappings using matcher? I'm stuck
`java.lang.UnsupportedClassVersionError: org/openjfx/gradle/JavaFXPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
org/openjfx/gradle/JavaFXPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0`
Changing the default project java does nothing
Java version being a pain in the ass again
Can you change the JAVA_HOME
I'm trying using java 11
yeah
I'm just downloading java 11, seems to be the used version
humm, my very good network connexion
oh, that's the outdated fork
@rigid saffron huh
what should I do there?
¯_(ツ)_/¯
oh, I found a doc
never used it before, on the top there is "File", "Matching", "Mapping", etc
nvm, I found the wiki
If you wanna dig into that
@rigid saffron I found
https://github.com/Legacy-Fabric/Legacy-Intermediaries
https://github.com/OrnitheMC/feather-mappings
@rigid saffron I must switch to gradle to use intermediary mappings ?
depends on what you define as must
what I'm saying is if there is a will there is a way
well, yeah
did you ever used intermediary mappings ?
well, rn not really
I don't mod minecraft so no
okay okay
you would wanna write some plugin that will remap the plugin after compiling
you could make it a maven plugin too
oh yeah I see
But I know that writing maven extensions (not plugins - unless you want to copy the curse that is the specialsource plugin) might be a valid way of achieving that
x) I should investigate about extensions
shits complicated
why even use maven in the first place, imo gradle is way better
but I talked about writing a gradle/maven plugin from the beggining
however for all intents and purposes sticking with gradle is the more sensical approach unless one has already experience with writing maven plugins
even here
because of multi modules using nms
i don't see how that's a valid point here
Also easily possible using gradle, FYI.
Some might say it is even easier compared to maven
yea
I also use maven much more than gradle
okay but you can still use gradle
I always use gradle
but I should switch to gradle
- you get the added benefit of kotlin script :DDD
for some it's a benefit, for some not ¯_(ツ)_/¯
better than groovy
I don't see the benefit of kotlin script
I don't see kotlin script
xml-based configs are a pain
I always use groovy gradle
you, sir, are a menace
guys
I ate a whole raw onion yesterday
you should copy the repo and do some pull requests to make the work faster !
OUR WORK
It's meant to be a script - not an entire programming language. Ditching eclipse over a few changes in syntax is not worth it imo.
if you want to have complicated logic, you have a gradle plugin written in java
and change everything you want, basically
even the base structure
you like eclipse I think ?
isn't it meant to be your project
communism, i see
I was always communist ngl
i knew it
no, but if you ever intend for me fixing some random issue, you better not be using kotlin script.
lmao
okay, I follow master
all the kotlin haters arising rn
remember the onion I ate yesterday? It was soviet. A soviet onion
ohhh
I mean, compared to groovy there is little difference in the first place
but if your wrong... gulag
sometimes I wish we had less of those "proper languages"
Well groovy is a nice programming language for configurations
how-
the only valuable and good language in the world is Pascal 😎
no.
Using groovy for anything other than assignments (be it through closures or whatever) is a bit iffy
my personal favourite is C. It's makes programming way simpler (comparing to assembly) and it works
If you have a standard for loop in your buildscript, you are doing something you should not be doing
...but it doesn't work with Spigot
FFI cries in the corner
rust has a minecraft server lib (it's barely usable)
so, let's re-talk about GNI, WE should make a maven/gradle plugin to transform from remapped to intermediary, and a lib with a classloader that will be able to convert intermediary to obfuscated on runtime. Then remap the plugins so intermediary is remapped into obfuscated in the plugin classes and then load them to the spigot server like usual
no, we need to transform remapped into intermediary
then a classloader that will be able to convert intermediary to obfuscated on runtime
so this is in the lib?
yeah
so, this?
and that class loader will also perform some funky binary operations modifying the classes method and field names to allow calling from intermediary and a lot of other shit that my brain is barely able to comprehend
I add that to the paragraph
I wonder how much issues that would cause the way I described it, I'll look at fabrics impl later
okay 👍
they're now always mojmapped, as well as the server on 1.20.5
ah, I've seen a 1.20.6 server remap a plugin on runtime
totally forgot
WE would be able to remake fabric server-side api when GNI will be finished, right?
why fabric
because forge isn't open source I think 🤓
but it is?
LMFAO
how else would you use their api
it is ?
yeah?
ofc it is lmao
why mods tho
"why mods"?
yea
actually, no, we remap the plugins so intermediary is remapped into obfuscated in the plugin classes and then load them to the spigot server like usual
huh
client?
okay thanks
my brain is a bit fried, excuse me please
i don't get why you need a mod here
we need no mods
we don't need mods
that's what i'm saying lol
we need what makes mod able to write code without class.b and class.e(var1, var2 OH WHAT THE HELL IS THIS)
interesting https://github.com/FabricMC/mapping-io
but with a good and convenient Crepper.makeHimExplodes(rightnow) 🤗
humm let's see that
@rigid saffron if i ever contribute to this you know damn well i'll only write kotlin
and also, we use fabric because fabric has a lot of code like this
don't worry, I'll translate your kotlin code into java if needed
more like we steal from fabric
exactly
you will have a thousand statics tho as jetbrains converts companion objects to statics (if you use their button to convert kotlin -> java)
nah, I'll translate it by hand
oh god
with a paper and a pen
ain't gonna let some automation replace my job (my job is to create automation)
interesting, let's add this to the pinned urls
getting a bit high
(not me, the original message 🤓)
but wtf is that
I've got so many questions because I don't know how to use this/ASM
it's what fabric uses to make intermediary possible from what I can tell
hmm
also, because of how spigot works, we might want to load the plugins that depend on the lib ourselves and then throw them into spigot, this way we don't experience problems with spigot fucking shit up
oh, so a separated folder?
We can also just make them use a file different than plugin.yml
Idk, gniplugin.yml
yeah, though of that too
bro is making a spigot fork
so a plugin loader
Yeah
doesn't paper have custom plugin loaders now
wouldn't it be easier to transform everything at compile?
We need this to remap the intermediary inside of the plugins into the obfuscated names that the server is currently using
oh yeah, forgot about that
Idk, but I've extended PluginLoader or some shit like that even in spigot once, by accident
And I would probably quit this if we make it paper dependent
LOL
lol
no paper dependent
we are here for SPIGOT
even bukkit if possible
but who uses bukkit without spigot?
Dunno about the "craft" part, but yeah
@rigid saffron how did I've been discovered? 🤔
#521545796882006027 message
This is yet another project that is split into the runtime part and the dev tools part lol
Additional to this project we could also maybe write a plugin that will fuck around with the ide and stuff to remap the game into all mappings the user would like to (mojmaps, parchment, spigot for older versions, unmapped/obfuscated, mcp for older versions, yarn)
@fallow sky updated that one thing I drew before to match the current idea
oh okay I'll see that
Or maybe this is better
I decided to try to write a remapping plugin and I have already cloned 2 repos
perfect
does it's working?
"Intermediary would work for this use case. You can use tiny remapper to do the actual remapping of the classes.
There isn't really a guide for this kind of thing. The easy way to do it would be to do it in 2 stages. First remap the plugin to intermediary (using intermediary data for the source version). And then remap from intermediary to the official names (using intermediary for the target version)
You could use mapping-io to create a single set of mappings to do it in one pass.
My first suggestion you could likely do without any code. You can just use the tiny remapper command line.
I'd get it working first, and then get clever with mapping-io later."
To download intermediary mappings -> "You can download those from the intermediary maven or GitHub."
(just for pinning)
here are the intermediary mappings we need @rigid saffron
this class seems interesting
https://github.com/FabricMC/fabric-loader/blob/master/src/main/java/net/fabricmc/loader/impl/MappingResolverImpl.java
let's go sleep, gn
I went through it, all it does is utilize the mappings io lib
I went through the code of the lib and also experimented with it a bit, it takes in the tiny mappings and then you can get the remapped name if you have the original or vice versa
The namespace for the original (obfuscated) mapping is called original and the one for intermediary is called intermediary
We probably want them in a repo or another place where they are easily accessable by the version name, that way the lib can dynamically download the mappings for the current version of mc
Interesting https://github.com/FabricMC/tiny-remapper
Yeah, remapping without TR is a bit suicidal. Sure - there are tools such as https://github.com/Felis-Project/actually-tiny-remapper or https://github.com/stianloader/stianloader-remapper, but unless you have very specific design requirements it makes no sense to not use TR.
oh wow, the longer I look at this the more hell it gets
I guess I'll have to original map it first, then intermediary map it
how so?
and then I'll also wanna write all of that in both, a gradle and maven plugin
and I have no idea how any of those work
I mean yeah, you have to reverse the mappings but that isn't witchcraft
Also, writing gradle plugins isn't that bad as in the worst case you can plainly bruteforce the remapping process
sounds a bit inefficient
but sounds cool
where does spigot have its mapping files
or does it directly pull mojang mappings
I used to bruteforce the remapping process by plainly calling TR repeatedly in a plugin of mine as performance wise it was okay
the fuck is csrg
mapping format; most likely a derivative of SRG
mojmaps btw
ehh, nobody ain't gonna sue me anyways, right?
Compared to tinyv1 srg is one of the worst mapping formats on earth, but unfortunately srg is very frequently used
# (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.```
lol
it might even be the worst mapping format due to how flawed it is
what flaws does it have
oh you know, being not verbose enough?
and that means?
Well it's missing the descriptor. So while you might know that something needs to be remapped, you don't actually know what that something is
btw, the mojmaps I sent are from intermediary to mojang iirc
also, there might be more than just one intermediary format FYI
I know too much about intermediary mappings already, don't worry
hmm, I just tried manually remapping and it seems that minecraft classes in spigot are in a different place than in the mappings ._.
what a fucking pain in the ass
or no?
idk
why did it not remap
you'll probably be better off using the same inputs as the specialsource plugin tbh
or you could use paper and use the inputs provided by paperweight
did you forget to attach the minecraft jar to the remapping library classpath
the what and the what
no idea what yall doing but looks fun ill join the thread
read up
it's painful
basically, we are making a library and a gradle/maven plugin, the plugin remaps the plugin to intermediary mappings after compilation and the library remaps the plugin to the current obfuscated mappings and then loads it as a normal spigot plugin
I don't understand the internals anyways
lol
Github
I'll make the part for downloading the good intermediary mappings for the current server version from GitHub @rigid saffron
Let's split the work, as I can see you already have something pretty good 👍
ye
LET'S GOOOO IT REMAPPED
this is surely gonna be a pain in the ass
Btw MinecraftServer#method_3864(boolean) aka MinecraftServer#d(boolean) is MinecraftServer#setUsesAuthentication(boolean) in mojmaps, so that plugin literally just disables online mode forever lol
We need to put this in every single plugin but with true instead of false
Fuck them pirated servers
(well except for local testing because i only have 2 accounts)
Lmao
I remember I had a few cracked friends so I made a fabric mod so they can join my lan world
PERFECT
I was about to suggest from intermediary to mojmaps, but some mojmaps names change between versions?
Yeah
so we shouldn't do that?
We should not, yes
okay okay
I did have to write the code in obfuscated nms because gradle fuckery, but who cares
x)
so, now you got the base ?
Basically, I now know everything I need to know
perfect
The only problem I have on my mind rn is: will we have the user manually tell us the mc version they are using or can we somehow automate that
I'm starting the mapping downloader, shouldn't take long
bro
Future removal of CB package relocation + moving away from obfuscation at runtime
If you are not a developer but a server owner, this might still be important for you. Check the bottom section on what action you might have to take.
Update: This change has been put into effect in 1.20.5, make...
with this
there is the perfect method inside to get the mc version, this is not a problem
and if the user encouter a bug, we can make a simple config file to override the detected minecraft version
but this shouldn't happen
this is how we get the minecraft version:```java
/**
- Returns the actual running Minecraft version, e.g. 1.20 or 1.16.5
- @return Minecraft version
*/
private String getMinecraftVersion() {
if (minecraftVersion != null) {
return minecraftVersion;
} else {
String bukkitGetVersionOutput = Bukkit.getVersion();
Matcher matcher = Pattern.compile("\(MC: (?<version>\d+\.\d+(\.\d+)?)\)").matcher(bukkitGetVersionOutput);
if (matcher.find()) {
return minecraftVersion = matcher.group("version");
} else {
throw new RuntimeException("Could not determine Minecraft version from Bukkit.getVersion(): " + bukkitGetVersionOutput);
}
}
}```
@rigid saffron, thanks to mfnalex basically x)
Not the issue I was talking about
ah?
oh yeah
Because of mappings, yk
can't we compile the plugins directly at runtime?
What the fuck are you saying
hmmm
Do you want to make users install fricking java code or what
Actually, I think we can get the spigot artifact, the version and even the location on the local maven repo
making GNI compile the plugins using GNI by telling them the actual server version
but it will works for one version?
oh okay
Our only issue would be paper and its mojmapping stuff
huh, paper 🤮 (for dev)
Most servers run on paper, not like we have a choice
yeah
We could likely detect versions above 1.20.6 and then remap plugins into the current mojmaps
Intermediary will let us remap plugins to anything at runtime
not before?
perfect
Ye
because paper use mojmaps directly instead of obfuscate?
I think paper should even have some methods for doing that, since it does that itself
Apparently, yes
wtf
runtime mojmaps are a standard these days
the only notable modloader of note that does not do that is fabric
They can do it because they never directly ship mojmaps, they remap on runtime
Intermediary mappings >>>
there is 0 sense in using intermediary mappings since you will use mojmap anyways for stacktraces
but, using mojmaps instead of obfuscate for some cases isn't a problem, right ?
intermediary only makes sense for older versions where mojmap plainly never existed
and for having the same methods, classes and fields name
Which is exactly what this project does, it gives us compat between tons of versions
the goal : 1.8-latest
huh
good luck for those developing before 1.14 lol, no docs because it wasn't build officially before 1.14
Thing is - all these versions have already been released
really ?? 😮
You can easily just skip the intermediary process and go straight from named -> official
I think I will write some plugin to let you use any mappings
._.
okay, let's make the downloader
That's simple, just have a url to the repo with a %s, then replace that %s with whatever version you're on and download
yeah
on gradle you are probably better off using configurations imo
here it is
https://github.com/Paulem79/GNI-mappings
You should've made an org for gni
I have one time
I remove this repository too
https://github.com/Paulem79/GNI
@rigid saffron I name it GNI ?
Yeah
@inland spoke wanna be in this org too?
I suppose that is possible
:/
well I mean 3-latter org names are probably all taken already
GNI-MC or GNI-Spigot or SpigotGNI
Unified-NMS-Interface would be more to the point imo
noreply@norep.ly fr fr
Cross-Version-NMS?
choose x)
What about we spin da wheel?
hmmm
pretty good 👍
let's ||not|| choose that
we'll see later
Cross-Version-NMS for now x)
Essig
ok
The one before is the one I lost access to
here it is https://github.com/Cross-Version-NMS
@inland spoke I invited you
[IN DEV] CVN (Cross-Version-NMS)
ok
perfect
Ideal pfp fr fr
Lol
let me cook
This should be better fr fr
LMFAO
let's choose this for now
bump
Why is that message not pinned
because I don't know how to pin x)
I can't pin
We need somebody to pin it
should I ping a mod? x)
¯_(ツ)_/¯
let's wait

Thank you great conclube
Thank you very much 😄

hmm I wonder how the specialsource maven plugin or whatever it was called reobfuscates stuff
and of them all, spigot uses the most fucked one, csrg
hmm, the mojmaps spigot stores is of the ProGuard format (likely what it is originally download as)
painful
I agree
\❌
hmm
is it open source?
everything spigot is open source lol
perfect
Specialsource
Specialsource
besides the few times where it decides to do some weird shit
...that has been resolved?
the imports I ended up using
I wonder if I can rewrite it to only use SpecialSource
I don't think so
hmmm
I don't really know
never digged into the creation of plugins with gradle
I'm working on the mappingsdownloader
really easy
hm
@rigid saffron we'll use this repo instead
https://github.com/Cross-Version-NMS/CVN-mappings
yeah
to have full control on mappings if there is any problem
okay
import java.io.*;
🤮
intellij does that for you
- originally compiled jar
- reobfuscated jar
- intermediary mapped jar
FUCK YEAAAH
if you use too many imports of the same package it condenses them
there's an option to disable it
perfect
i do see why
potential conflicts with other classes of the same name in different packages
but that happens so rarely
that it basically never happens
nice job 🙂
we gotta celebrate this
wait that's so cool
it pulled the intermediary mappings from the mappings repo and the spigot jar and mojmaps from the maven local repo (spigot puts the things there)
will be our notation
so if you ran buildtools once it will work
perfect
wait so does it transform the jar or sth
that's clean
that is pretty cool yeah
thank god I didn't need to write the asm myself
thank md
and the fabric guys
x)
that will also be licensed under LGPL because of the fabric guys lol
and here the other part
wat
huh
R0.1
if I remember correctly, there is a version with a R0.2
or smth like that
lol
hmm
but I have not encountered one yet, so no
not in my repo
do you have a headset recommendation
ah, my favorite spigot version. 1.19.4-R0.1-SNAPSHOT-R0.1-SNAPSHOT
mine is some from logitech iirc
idk how that appeared
looks like he did a bad name 🤓
can you check what it is
devmgmt.msc
and tell me your experience
when putting the wrong naming, it creates a folder
Logitech Pro X, got them recommended by my cousin, bought them, pretty nice
costly 😦
they were like 20% off or something like that when I bought them ¯_(ツ)_/¯
I think it was something seasonal
That was also the time when I figured out I have like 70 euro in amazon gift cards lying around for some reason
Or was it 50? Idk
Were a few gift cards
btw random but tell me your life story
why do you live in germany and know russian and etc
where were you born and where did you move etc
My parents left russia some time ago, they went to germany, they met there, then I was born, they barely knew german themselves so I spoke only russian until I went to the german kindergarden where I could not speak a single german word
And then time went, I spoke russian at home and with friends in a similar situation and german everywhere else
It's shrimple my friend
damn, can your parents adopt me?
lol
don't worry, be happy
If you are okay living in the toilet room or in a small box with my cat, maybe
i can't be happy i've been stressing about being drafted since i was 13 and i'll be stressing about it until i'm 30 what part of this makes me eligible for happy
hmm
that works
Me calling you Зяблик should make you a bit happy, right Зяблик?
totally cutie :3
we can be happy 😌
like he says, In every life we have some trouble But when you worry, you make it double
i don't mind making it double
we need to take the life like she's
i do not care about cheap optimism i want to be realistic and actually see what's ahead of me
hm
and ahead of me is the high potential of being drafted to army and thus my life going down the drain
Actually, that'd be fun, we could play minecraft on my ps4 together, every day
unless i get lucky and manage to get a job in IT after i'm 23 and work there for 7 years straight
less goooo
here it is
not perfect
but it's working
(in the form of a plugin for testing purposes)
@spiral onyx do you have github?
wanna be in the org?
i doubt i'll contribute much, if anything
it's not a problem
i'm doing maths all day and i have 4 projects that i'd rather be working on
if i make it 5 nothings gonna change lol
I'll test my gradle plugin today, after that I will make a repo and push my code
i mean sure you can add me if you feel like it
if you have a time, a day, you have the opportunity to contribute 😌
perfect !
i beg to differ
waw
this is just the beginning of what i was gonna do today
do that with three axes x)
wdym?
there is x and y
yep
find all values of a so that the system has 2 solutions
i solved it graphically because there is an obvious circle equation, a line equation and a line bundle
hmm
so delta?
delta what?
delta has two possibles values if I mind correctly
Sadly my brain is too slow today to realize what is happening there
delta most often is used to signify the change between two values
not exactly sure what you are trying to say
but I learned sin, cos and tan this year so I'm not really advanced in mathematics
oh that's trigonometry
yeah
it's also fun
yeah, just not really precise
this is called a parametric equation
Delta time in game dev
or in this case, a parametric system of equations
yuppie
huh
so
imagine an equation
as simple as
2x + 4 = 12
it's obvious that x = 4
now imagine this equation
2x + a = 12
in this case you cannot find the exact value
but you can find the value in terms of a
it will be
x = (12 - a)/2
this is called a parametric equation, and a is called the parameter
but most often you are not asked to find values of x
you are asked to find values of a, so that the equation has some amount of solutions
We went from remapping nms to parametric equations lmao
for example look at this equation
ax = 10
we can find x
x = 10/a
but this only works if a != 0
so, for a != 0, x = 10/a (1 solution)
for a = 0, there are no solutions
this is the essence of parametric equations
there are also parametric inequalities and systems with parametric equations but they are basically all the same thing
because there is two unknows 🤓
exactly
yep
parametric equations, most often, can be solved two ways - algebraically and graphically
f(x) 😌
some can be only solved one way (either because the other way is too hard or just impossible)
hmm okay I see
for example, find all values of a so that the equation x^2 - 2(a - 2)x + 4a + 5 = 0 has two roots and both are above 1
i'll break it down
hmmm
but i'm not a good teacher so i'll be talking about some concepts that i have not yet explained, please bear with me
seems a bit difficult x)
notice that this equation is a quadratic equation
in this quadratic equation, the coefficients are as follows
a = 1
b = 2(a - 2)
c = 4a + 5
a is just a number, it can be any number. x is the unknown value
a is a constant
a is not constant
a
it is any number at all
it is a parameter, an everchanging value
this is what we are looking for
all values of a that conform to some condition
not necessarily
because if it's equal
they can be if a is a certain value
but that does not matter at all. this is still a quadratic equation in terms of x
2a - 4 = 4a + 5
2a = 4a +1
take a look at it on paper
this is a classic quadratic equation
you know quadratic equations, right?
never heard about that
i have no idea what you mean by delta
but perhaps yes
so you know quadratic equations, right? can you solve this?
x^2 - 2x + 1 = 0
not really, because of the ^2
or
no
?
for x^2 = 0 yeah
ok in this case i shouldn't be talking about parametric equations lmao, you should study these topics in an orderly fashion
I'll take my lessons
why are you talking about parametric equations in the CVN thread 🤔
rad would you like me to explain how to solve this
aw shucks
school is so overrated x)
the solution's really cool though
real
i love maths
Why not
do YOU want me to explain perhaps
how this has come to life
I'm playing WoT rn so I won't comprehend anything anyways
well fuck me
i'll go eat my lunch
if there's something to eat
i don't wanna cook rn
huh
If I mind correctly, I learned how to solve for some x with ² and without ² = 0
you shouldn't be trying to comprehend this rn, you need to study topics in the order they are presented
but not with x² + 2x + 5 or any constant
parametric equations are studied in 11th grade in Russia, if even that
i see
but I already tried using delta to solve that
so you'll get there some time later
and it worked
ah i see what you mean by delta
well, Russia and France are really different
the discriminant
that does not make parametric equations any easier
it is a convoluted topic that requires you to understand quadratic equations, logarithmic equations, square roots and absolute values, the equations of a circle, a parabola, a line, etc, and to be able to operate all of them easily
i thought i would try to explain an easy one in simple terms but i don't think i can do that if you do not perfectly understand quadratic equations yet unfortunately
dw about it though
again everybody studies at their own pace
there was a video I applied
⬇️⬇️ Tu veux la solution pour devenir solide en maths 💪 ? C'est par ici ⬇️⬇️
☞ https://hedacademy.fr
Comment résoudre une équation du second degré en 1 minute... ou presque !
it uses delta
let's make an infinite loop for fun
lol
@fallow sky making the lib that loads plugins should be really easy
perfect
I've sent the file with the methods, you can easily change some stuff to make it remap the jar from intermediary to current obfuscated
hum
I've shown the method for converting obfuscated to intermediary, just invert it and it works
okay okay
I'll try
just pushing the update for the downloader of mappings on github
👍
What exactly
so, I name it CVN ?
Yeah
wait
when thinking of it
humm
I'll see if I'm stuck
it's incredible being at this stage of development in only two days
can you send me the dependencies?
Fabrics tiny-remapper or something like that, you'll also need asm and mapping io for it to work. It itself does not seem to be availavbe as a dependency, I will probably fork and refactor it later
did you push it on github?
I just dropped the tiny remapper in my src folder, but I would recommend you to install it into your maven local and depend on it like that
"it"?
Nah, still gotta test it
okok
okok
let's pick up all of that x)
Ig if you shadow all the dependencies into the tiny remapper jar and then install it inside the local maven repo to then shadow it again you will have the lowest amount of dependencies that you have to shadow
yeah I see what you mean
let's make it works first x)
we'll see optimization later
huh
?
it's a bit difficult x)
I think I'll need to shadowJar directly then put to maven local repo and after import, like you said
gradlew publishToMavenLocal 👍
perfectly working, for now
@rigid saffron I need to import specialsource too?
Nah, that's only for remapping mojang to obfuscated
so no need?
I can remove that?
Yep
No, you'll need to rewrite that method to remapJarToObfuscated and then store the remapped jar somewhere else with maybe a hash, so you know when to reremap the jar, and then load the remapped jar
but
I didn't understand
how can I make remapJarToObfuscated without this method, and it's already made?
The one present in my java file remaps mojang to obfuscated (see the javadoc)
The other one, which remaps to intermediary, remaps from obfuscated mappings.
The first one uses some files from buildtools and the proguard format, while the latter uses the .tiny format and does everything you want to do on runtime, just that you will need to make it go from intermediary to obfuscated instead of obfuscated to intermediary
okay
If you can't figure it out I'll rewrite it a bit later
so I need to work on remapJarToIntermediary ?
Yeah
to make it remapJarFromIntermediary
what are the steps to do this?
Change two strings
NAMESPACE_FROM and NAMESPACE_TO ?
Yeah
what are their values in your code?
NAMESPACE_TO to official and NAMESPACE_FROM to intermediary and it should work
so the namespace are "official" and "intermediary" ?
Yep
so it's
public String NAMESPACE_FROM = "intermediary", NAMESPACE_TO = "official";
/**
* Takes in an officially mapped jar (an obfuscated one) and remaps it to the intermediary mappings.
* @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_FROM, NAMESPACE_TO))
.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();
}
}```
right?
No, opposite
Yeah, but then you get a new jar and you gotta do some stuff to ensure it stays updated and that it loads
Well, first we need to ensure the users don't make a plugin.yml, otherwise spigot'll attempt to load it and error
We will need them to create something like a cvn-plugin.yml
but, we'll also need to load it as a plugin?
Which will let us identify it is our plugin
The lib can do that
Oh, we'll also end up looping through all jars and checking whether they're ours
@rigid saffron I need to go help my parents for smth, here is the cpde I already got
mappings-downloader is on github, you need to publish it to your maven local
ok
@rigid saffron if a plugin doesn't have a plugin.yml, spigot throw an error, right?
so we can't put our plugins inside the plugins directory?
but we must put it in smth like plugin/CVN ?
beware that paper has their own plugin.yml these days I think
that's true
I need to try
PERFECT
no problem with that
there isn't any error
wait
I forgot this is paper
let's try with spigot
/shrug it might ignore these kinds of jars for what I know
nah
spigot will just think it's not a plugin and continue looping over the leftover jars
yeah
allow access 🤓☝️
you found ?
no
yeah
I swear spigot had an identical one
public class PluginLoader {
public CVN cvn;
public File plugin;
public PluginLoader(CVN cvn, File plugin) {
this.cvn = cvn;
this.plugin = plugin;
}
public PluginType getPluginType() {
try (JarFile jar = new JarFile(plugin)) {
JarEntry cvnPluginYaml = jar.getJarEntry("cvn-plugin.yml");
JarEntry pluginYaml = jar.getJarEntry("plugin.yml");
// Is a basic plugin
if (cvnPluginYaml == null && pluginYaml != null) {
return PluginType.SPIGOT;
}
// Is a CVN plugin
else if (cvnPluginYaml != null && pluginYaml == null) {
return PluginType.CVN;
}
} catch (IOException | YAMLException ex) {
cvn.getLogger().severe("Cannot read plugin type for " + plugin.getName() + " !");
}
// There is not a plugin.yml, neither a cvn-plugin.yml
return PluginType.NONE;
}
public enum PluginType {
CVN,
SPIGOT,
NONE;
}
}
I picked up some code from spigot
yeah, I should rename it?
nah, keep it
okay
@rigid saffron for this:java File classpathJar = new File( System.getProperty("user.home") + "/.m2/repository/" + SPIGOT_GROUP.replace(".", "/") + "/" + SPIGOT_ARTIFACT + "/" + MINECRAFT_VERSION + "-R0.1-SNAPSHOT/" + SPIGOT_ARTIFACT + "-" + MINECRAFT_VERSION + "-R0.1-SNAPSHOT.jar" );
As we are at runtime, I should get the server.jar?
yeah
okay
let's ask in #help-development
or maybe not
google first
nothing on google
@rigid saffron I think I'm done with the remapping system
I push this on github
but my question is : how I load the plugin as a spigot plugin after?
this is the last thing to do
@rigid saffron here it is
https://github.com/Cross-Version-NMS/CVN
getServer().getPluginManager().loadPlugin(...)
but, it doesn't have a spigot.yml
no
it still doesn't have any spigot.yml..
we can make our own Plugin class
or something
yeah
then we just implement the few thousand methods and done
x)
without modifying?
we can probably just take the original JavaPlugin the plugin has, instanciate it, feed it to the custom plugin class and give it over to spigot
new JavaPlugin() ?
bruh
no
all plugins provide a main class in their plugin.yml
we use reflection, instanciate it and enjoy
something like this
I'll go eat x)
why not reflection?
I push on github, so you can work, I need to go eat x)
you need no reflection here
at PluginLoader#loadPlugin
oh okay
this is just the plugin class