#[IN DEV] CVN (Cross-Version-NMS)

1 messages · Page 4 of 1

fallow sky
#

okay man

#

you could have then refetched from github to have a good git, but well...

#

that's your problem, not mine 😌

fallow sky
#

and everything will works correctly

#

and please, switch to github desktop 🙏

rigid saffron
#

I did a git reset

#

gotta copy my classes rq

fallow sky
#

okay

rigid saffron
#

there we go

#

repaired it

fallow sky
#

perfect

rigid saffron
#

it works now

fallow sky
#

perfect

woven arrow
rigid saffron
woven arrow
#

crazy

#

!!

rigid saffron
#

tomorrow is a free day so I have today and tomorrow

fallow sky
#

good 👍

rigid saffron
#

everybody, the cvn remapper gradle plugin has now been updated

fallow sky
#

thanks 😄

rigid saffron
#

pull the changes and publish it to your local maven repo

fallow sky
#

let's rename the org

rigid saffron
#

yeah

#

do it

fallow sky
#

it's good

rigid saffron
#

everybody here is allocated to some repo

#

you work on cvn and mappings downloader, I work on the gradle plugin and spigot mappings downloader

#

rad works on the mass testing thing

#

if we do any changes to somebody elses repo, we should first ask for permission to commit and push, okay?

fallow sky
#

wait

fallow sky
#

so I need to copy your spigot remapping method to put it in CVN, right ?

rigid saffron
#

well, not quite

fallow sky
#

and invert it ?

#

(the thing I don't know xD)

rigid saffron
#

it heavily depends on the fact that buildtools has been ran

fallow sky
#

huh

rigid saffron
#

so that's why I make the spigot mappings downloader

#

actually, I wonder how things happened before mojmaps

#

because rn it maps fields using mojmaps I think

fallow sky
#

huh

rigid saffron
#

does that mean it does not map fields?

fallow sky
#

so Intermediary -> Mojmap -> Spigot ?

rigid saffron
#

not quite

#

intermediary -> obfuscated -> spigot

#

but spigot field maps are generated using mojmaps

fallow sky
#

oh okay

fallow sky
rigid saffron
#

but Idk about older versions

#

did it just not map fields at all?

fallow sky
#

1.8.8

rigid saffron
#

I have 1.12.2 mappings rn

fallow sky
#

well, forget

rigid saffron
#

that's mojang

#

we need patched

fallow sky
#

I saw that

fallow sky
rigid saffron
#

wait

#

can you open a patched 1.8 and 1.19 or other ones that come after mojmaps times

fallow sky
#

it's Spigot mappings for 1.8.8

rigid saffron
#

mojmaps came after 1.17 iirc

#

and find some fields

#

and compare

fallow sky
#

okay

rigid saffron
#

what will happen if I send spigot mappings here

fallow sky
fallow sky
#

because it's for science

rigid saffron
#

lol

rigid saffron
fallow sky
#

yeah

rigid saffron
#

wait

#

sec

#

this is from the field mappings

fallow sky
rigid saffron
#

1.19.4

fallow sky
#

PAPER
1.20.4 :

  • fields -> obfuscated
    1.8.8 :
  • some fields -> Spigot
  • some fields -> obfuscated

SPIGOT
Wait...

#

what

#

oh I see

#

what. the. hell

#

wtf

#

Spigot and obfuscated fields ?

#

(on 1.8.8)

rigid saffron
#

show 1.19.4

#

or 1.20.4

#

or whatever

#

that is modern

fallow sky
#

1.20.4

#

(paper)

#

interesting

#

but 😭

#

sigh

#

PAPER
1.8.8 :

  • some fields -> Spigot
  • some fields -> obfuscated

1.20.4 :

  • some fields/methods -> Spigot
  • some fields/methods-> obfuscated

SPIGOT
1.8.8 :

  • some fields -> Spigot
  • some fields -> obfuscated

1.17.1

  • fields/methods -> obfuscated

1.20.4 :

  • fields/methods -> obfuscated

@rigid saffron

rigid saffron
#

I'm confused to death

fallow sky
#

me too

#

AHAHAHAHAHA

#

spigot 1.8.8, that's all.

#

BOTH SPIGOT AND OBFUSCATED

#

ARE YOU HAPPY ???

#

but well, paper is the worst

#

@rigid saffron are you okay ?

woven arrow
fallow sky
#

I really want to ping md5

rigid saffron
rigid saffron
#

but I'm still struggling to understand everything

fallow sky
#

I think

#

md5 has a problem

#

or even

#

the creator of bukkit

rigid saffron
#

whoever the heck made this system

#

has to be from hell

fallow sky
#

x)

fallow sky
#

he's evil

#

but he's from bukkit

#

I think we should blame md5 🤓

rigid saffron
#

yeah

#

what if we contacted md per email

fallow sky
#

you can do that if you want x)

rigid saffron
#

what is the email

fallow sky
#

idk

#

maybe on spigot contact section ?

rigid saffron
fallow sky
rigid saffron
#

time to log into my outlook and start writing

fallow sky
#

x)

#

we'll get our answers

#

he knows everything

#

but, maybe not for paper

#

I don't think he really likes paper

rigid saffron
#

We'll get an answer in a year

rigid saffron
#

@woven arrow you work with fabric mods sometimes, right? Do you know how loom adds remapped mc and dependency code and stuff like that so the IDE sees it and the compiler doesn't complain?

woven arrow
#

i've worked with it once

#

i just have a fabric setup to copy mojang code

rigid saffron
#

Lol

woven arrow
#

i copied 1000 lines of java registry code

#

just to have simple registries

rigid saffron
#

Relatable

woven arrow
#

accurate depiction of modding

rigid saffron
#

True

woven arrow
#

allat just to have custom registries

#

😔

rigid saffron
#

public void apply(Project project) {
project.getLogger().lifecycle("Fabric Loom: " + LOOM_VERSION);
LibraryLocationLogger.logLibraryVersions();

    // Apply default plugins
    project.apply(ImmutableMap.of("plugin", "java-library"));
    project.apply(ImmutableMap.of("plugin", "eclipse"));
    project.apply(ImmutableMap.of("plugin", "idea"));

    // Setup extensions
    project.getExtensions().create(LoomGradleExtensionAPI.class, "loom", LoomGradleExtensionImpl.class, project, LoomFiles.create(project));
    project.getExtensions().create("fabricApi", FabricApiExtension.class);

    for (Class<? extends Runnable> jobClass : SETUP_JOBS) {
        project.getObjects().newInstance(jobClass).run();
    }
}
#

Hmm

#

Actually

#

Can't I just add some jars to the dependencies

#

That I remap

#

Okay, I got an answer

rigid saffron
#

@fallow sky we are still Cross-Version-NMS technically btw

fallow sky
#

That's not a problem

rigid saffron
#

Is this right

rigid saffron
rigid saffron
fallow sky
rigid saffron
#

Ye

fallow sky
#

Okay I'll do that

rigid saffron
#

Spigotcvn or spigotcvn or SpigotCVN

fallow sky
rigid saffron
#

- don't work in package names btw

fallow sky
#

I'm dealing with java since 2 years

#

I know how to name packages 🤣

rigid saffron
#

Lol

#

Also, is it okay if I make a private readme? I wanna write who "owns" what repo and that kinda stuff

#

Interesting

fallow sky
rigid saffron
#

damn, my copilot was dead for 2 hours and I didn't even notice

rigid saffron
#

@fallow sky does this look good

#

maybe If you want to contribute to a repository that you are not maintaing, please ask permission from the person who is allocated to maintain that repository or If you want to contribute to a repository that you are not maintaing, please ask permission from the person who is maintaining that repository

fallow sky
#

We don't really say "allocated" for the owner

rigid saffron
#

okay

#

how does this look

#

funnily enough, I don't even have the CVN plugin cloned onto my local machine

rigid saffron
#

definitely

#

just believe me

woven arrow
#

my computer might explode now

#

nvm

#

nothing happened

#

:(

rigid saffron
#

what

woven arrow
#

trying to run 3 buildtools processes at once

rigid saffron
#

Lol

woven arrow
#

actually will bt just crash or sth?

#

does anyone know

rigid saffron
woven arrow
#

hmm

#

okay then i'm not doing that

rigid saffron
#

Lol

#

You don't really want to run lots of buildtools at once, with a good computer 2-3, with a slower one 1 is the limit

#

Just make it configurable

woven arrow
#

i cannot f igure it out lol

#

might just leave my computer running tomorrow, only got 2hrs of school

rigid saffron
#

Ya got school?

woven arrow
#

yeah sadly

rigid saffron
#

Oof

woven arrow
#

i had monday and tuesday off

#

and last week two days

#

🙃

rigid saffron
#

Well, may is the month when you go to school only 3 times a week instead of usual 5

woven arrow
rigid saffron
#

Again?

woven arrow
#

duplicates

rigid saffron
#

Use a set, I think it can only have one of an element at a time

#

Even tho, dunno how it'll react if there are different instances of strings

woven arrow
#

kotlin stdlib my beloved

rigid saffron
#

Show solution

woven arrow
#

.distinct()

rigid saffron
#

Also, I think you have perms to make repos in the gh org, would be nice if you uploaded the source code
Not very nice that we have two langs, but fabric loom has both, kotlin in java in the same plugin, it can't really get worse than that

woven arrow
#

i am literally setting up the repo rn lol

rigid saffron
#

Nice

woven arrow
#

(changing the remote urls)

rigid saffron
#

The org rename was a bit painful, but definitely worth it

woven arrow
#

yea

#

why tf do i not have a .gitignore

#

deleting my .git rn

rigid saffron
#

Lol

rigid saffron
woven arrow
#

i used ij 🤷

#

oh why tf does it not generate one

#

that's so silly

rigid saffron
#

I think you needed to check the box that said something about git when creating the project

#

Or if you did somethings messy

woven arrow
#

should I make it public or private

#

the repo

#

also what license

rigid saffron
#

public and LGPL iirc

woven arrow
#

\👍

rigid saffron
#

Bro 👍'd unsuccessfully

woven arrow
#

\❌

#

OH WHY TF DO YOU USE MAIn

rigid saffron
#

Nah stop it pl

woven arrow
#

CRIMINAL

rigid saffron
#

I have to setup the local git repo through cli because of that

woven arrow
#

pushed

#

don't ask about this

rigid saffron
#

Sure

woven arrow
#

mixing coroutines with sync can be a bit of a pain

fallow sky
woven arrow
#

question about the mass tester

#

how does it test if the plugin works

#

does it check the motd?

fallow sky
#

you can check if there is an error somewhere in latest.log after shutting down the server

#

and also, you can put the logs in a zip file, and renaming them with the version they are using

#

would be pretty useful

rigid saffron
fallow sky
#

yeah

#

would be the easiest

#

but, I haven't finished the CB package relocate yet

#

so it shouldn't work properly

#

or I use reflection cast CB temporarily

woven arrow
woven arrow
fallow sky
#

just search for "exception"

woven arrow
#

oh god

fallow sky
#

if the key "exception" is present in latest.log, there is an error

#

or even error, idk what you want

woven arrow
#

that sounds like a really bad way to do it

fallow sky
#

it's a simple server with two plugin : CVN and the TestProject

woven arrow
#

does spigot print errors to stderr? 🤔

fallow sky
#

there shouldn't be any other exception than the two plugins

fallow sky
#

log4j maybe ?

woven arrow
fallow sky
#

well

woven arrow
fallow sky
#

just use the latest.log

woven arrow
fallow sky
#

I know

#

smth that will works in some versions

#

you know mfnalex is a gigachad, @woven arrow ?

#

Spigot uses Log4j to log console output, hence making it easy to listen to incoming console messages, or to block certain console messages from appearing. Prequisities You need to have Log4J on your classpath. We simply add the dependency to our pom.xml using the provided scope, as Spigot already contains those classes on runtime: Create...

#

maybe not the best solution, I think you can find something on google about getting console output from another java program

woven arrow
#

md the mapping god himself has answered

#

it prints to stderr

#

which is great!

rigid saffron
#

Damn

#

Why is md suddenly our god

woven arrow
#

idk

#

i don't work with mappings

#

you tell me

rigid saffron
#

Well

#

He is our god now

#

So

#

He should help us

woven arrow
#

hmm ok

#

sounds good

rigid saffron
#

Would be fun if he just flooded us like once happened in the bible

woven arrow
rigid saffron
fallow sky
#

because of you, I was about to ping him to ask him for help

rigid saffron
#

I don't think he responds to pings tho

fallow sky
#

humm

#

let's not disturb him, for now :)

rigid saffron
rigid saffron
fallow sky
fallow sky
#

@inland spoke how can I use your versioning system to compare versions?

inland spoke
#

MavenVersion.parse("1.0.0").isNewer(MavenVersion.parse("2.0.0")) == false iirc

rigid saffron
#

"MavenVersion"?

inland spoke
#

You can also use the compareTo methods so MavenVersion.parse("1.0.0").compareTo(MavenVersion.parse("1.0.0.final-0")) == 0

fallow sky
#

oh okay thanks 😄

fallow sky
rigid saffron
#

Btw I'm currently working on making the gradle plugin add the dummy class and the cvn-plugin.yml thing

inland spoke
#

well it's more of a storage container for the individual parts that make up a version but yeah

fallow sky
fallow sky
#

bruh

#

I get that on gradle config for tiny remapper

rigid saffron
#

what

fallow sky
#

I'm on a school pc

rigid saffron
#

No idea what to do in a situation like thag

fallow sky
#

huh

#

well, I think I cant build then...

rigid saffron
#

Okay, so, I now know more about spigot mappings

#

Class mappings: self explainatory
Member mappings: includes methods and from what I understood, some fields
Field mappings: mojmaps fields, but adapted to work with spigot class mappings (only exists on newer versions)

fallow sky
#

@inland spoke, so I switched to your versioning system

#

hey, that's true

rigid saffron
#

I think I might need to already seperate my util methods into util classes

fallow sky
rigid saffron
#

holy fuckidy fuckd

woven arrow
fallow sky
#

okay, I think I've found about the problem with tiny remapper

#

maybe it's because I wasn't using java 11

rigid saffron
#

lol

fallow sky
#

not working

#

@rigid saffron can you send me the compiled jar of tiny remapper please ?

#

(the one in .m2)

#

I'll do that roughly

#

well

#

forget

#

I won't do that

rigid saffron
#

ok?

fallow sky
rigid saffron
#

shouldn't it be shaded

#

he: nah I don't have that many util methods, I barely even need one class for them
also he:

rigid saffron
woven arrow
#

happily as long as it's an object and not a class

rigid saffron
woven arrow
#

FUCK

#

go fork yourself

rigid saffron
#

lol

woven arrow
#

he was not an object
fml (forge mod loader)

rigid saffron
woven arrow
#

what string is that

rigid saffron
#

joinList

woven arrow
#

oh

rigid saffron
#

just a method I made so it seems like a real class

#

I think I will have the remapping gradle plugin done by tomorrow

#

@fallow sky I have done so that the cvn plugin jar will automatically have its plugin.yml moved to cvn-plugin.yml, then have a dummy plugin.yml and a DummyJavaPlugin class which just disables itself

#

it also has a different plugin name so no conflicts

rigid saffron
rigid saffron
woven arrow
#

:o

rigid saffron
#

its gotten way better

woven arrow
#

W?

woven arrow
#

pfft

rigid saffron
#

now Idk what to do

#

I finished everything

#

I could definitely polish it even more but then it'll start yelling "Nie jestem wtyczką Gradle, jestem Polakiem" (polish words)

fallow sky
#

"Nie jestem wtyczką Gradle, jestem Polakie" ?

#

lol

fallow sky
fallow sky
rigid saffron
fallow sky
#

so, what I have to do on my side ?

fallow sky
rigid saffron
#

if you want, I could try

fallow sky
rigid saffron
#

but well, I'll probably be ready by like tomorrow evening or the day after

fallow sky
#

not a problem

rigid saffron
#

do you got something to work on in the meantime?

fallow sky
#

making the jar file correctly

rigid saffron
#

👍

#

as in, changing the craftbukkit and nms package names to match the current?

fallow sky
#

but the lib I use doesn't seem to works correctly for what I do

fallow sky
#

no

#

Zipfile

#

Zip4j*

rigid saffron
#

tf is that

fallow sky
rigid saffron
#

I have this

#

not the best

#

but works

fallow sky
#

well

#

what I do is a bit more complex

rigid saffron
#

what exactly are you doing

fallow sky
#

renaming files in jar, and replacing files in a jar

rigid saffron
#

exactly what I used this util for

fallow sky
#

the second one isn't working properly because it's moving in a sub directory (io/github/spigotcvn)

rigid saffron
#

what exactly are you doing

fallow sky
#

and zip4j seems to only work with one depth directory

fallow sky
rigid saffron
#

hmm

#

unarchive it, then do stuff

fallow sky
#

that's what I'm doing

rigid saffron
#

hmm

#

well, it should be pretty straighforward

fallow sky
#

looks like it's not...

rigid saffron
#

whats your current code

fallow sky
#

here is what I get

#
FileUtils.remapCraftBukkitImports(cvn, remappedPlugin).forEach(((file, path) -> {
    ZipFile zipFile = new ZipFile(remappedPlugin);

    try {
        zipFile.removeFile(file.getName());
    } catch (ZipException e) {
        throw new RuntimeException(e);
    }

    ZipParameters parameters = new ZipParameters();
    parameters.setDefaultFolderPath(path.substring(0, path.lastIndexOf("/")));

    try {
        zipFile.addFile(file, parameters);
    } catch (ZipException e) {
        throw new RuntimeException(e);
    }
}));```
#
public static Map<File, String> remapCraftBukkitImports(CVN plugin, File zipFile) throws IOException {
    plugin.getLogger().info("Mapping CraftBukkit imports...");

    ZipFile zip = new ZipFile(zipFile);

    // Get the extract folder
    File extractFolder = new File(plugin.getTempFolder() + "/asm-remap");

    // Create it if it doesn't exist
    Files.createDirectories(Paths.get(extractFolder.getAbsolutePath()));

    // Extract the zip file
    zip.extractAll(extractFolder.getAbsolutePath());

    Map<File, String> fileStringMap = new HashMap<>();

    // Get all the class files
    List<File> files = FileUtils.getClassFiles(extractFolder);

    for(File file : files) {
        CustomRemapper remapper = new CustomRemapper(plugin);
        fileStringMap.put(file, AsmWriter.writeAsm(file, remapper));
    }

    return fileStringMap;
}```
rigid saffron
#

do you know where exactly it's going wrong?

fallow sky
#

yeah

#

atjava parameters.setDefaultFolderPath(path.substring(0, path.lastIndexOf("/")));

#

it puts in testplugin instead of io/github/spigotcvn/testplugin

fallow sky
rigid saffron
#

Path has a thing called relativize or something like that, gimme a lil sec

fallow sky
#

okay

rigid saffron
#

I had this String entryName = unarchiveDir.toPath().relativize(file.toPath()).toString();

#

it automatically adjusted the file path to be relative from the folder I unarchived too

#

idk if that helps at all

fallow sky
#

well

#

let's try

rigid saffron
#

so?

#

Bro despawned

fallow sky
#

huh

#

I restarted my pc

#

well

#

let's try so x)

fallow sky
rigid saffron
#

If file.getParentFile() is the root of where you unarchived the files then should be a yes

fallow sky
#

okay

#

so sad

#

wait

rigid saffron
fallow sky
#

nah

#

same "error"

#

looks like it's from the lib..

rigid saffron
#

Debug

#

Or well, you know what you could do

#

Use my jar util file

fallow sky
#

well

rigid saffron
#

It lets you unarchive to a dir, do anything and then repack the jar

fallow sky
#

huh

#

..\..\..\..\..\..\..\TestProject-1.0-remapped.jar

rigid saffron
#

lmao what

fallow sky
#

I think I'll do that instead

#

where is your class ?

#

found

rigid saffron
#

Might javadoc them someday

fallow sky
#

yeah

rigid saffron
#

You might need a method from the Util class, just copy it over

fallow sky
#

yeah

rigid saffron
#

Btw, the plugins uuid (the one used in the dummy plugin.yml) is generated from the name of the plugin from the real plugin.yml so it will never ever conflict and also stay consistent

#

Might rename the dummy class into that uuid just in case

rigid saffron
#

Did you fix the thing

fallow sky
#

I'm doing my homeworks

rigid saffron
#

👍

fallow sky
#

okay

#

might works

#

bruh

#

my bad

#

well

#

looks like this is ✨ not working ✨

rigid saffron
#

That looks slightly empty

fallow sky
#

yeah

rigid saffron
#

Code?

fallow sky
#
Pair<Map<File, String>, File> mapFilePair = FileUtils.remapCraftBukkitImports(cvn, remappedPlugin);

mapFilePair.first().forEach(((file, path) -> {
    try {
        JarUtil.repackJar(remappedPlugin, mapFilePair.second());
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}));```
```java
public static Pair<Map<File, String>, File> remapCraftBukkitImports(CVN plugin, File zipFile) throws IOException {
    plugin.getLogger().info("Mapping CraftBukkit imports...");

    ZipFile zip = new ZipFile(zipFile);

    // Get the extract folder
    File extractFolder = new File(plugin.getTempFolder() + "/asm-remap");

    // Create it if it doesn't exist
    Files.createDirectories(Paths.get(extractFolder.getAbsolutePath()));

    // Extract the zip file
    zip.extractAll(extractFolder.getAbsolutePath());

    Map<File, String> fileStringMap = new HashMap<>();

    // Get all the class files
    List<File> files = FileUtils.getClassFiles(extractFolder);

    for(File file : files) {
        CustomRemapper remapper = new CustomRemapper(plugin);
        fileStringMap.put(file, AsmWriter.writeAsm(file, remapper));
    }

    return Pair.of(fileStringMap, extractFolder);
}```
rigid saffron
#

What is the file string map

fallow sky
#

wait

#

what

#

what the hell I'm doing

rigid saffron
#

JarUtil#repackJar(File resultJar, File unarchiveDir)
@param resultJar The file that will be written to
@param unarchiveDir The directory with the unarchived jar contents

fallow sky
#

yeah

rigid saffron
#

Tell me the result and then I'll go sleep

fallow sky
#

okay

#

well

#

looks like PLUGIN ALREADY INITIALIZED

#

we've got our remapped classes

rigid saffron
#

Update the uhh

#

Gradle plugin

#

And remap again

fallow sky
#

okay

rigid saffron
#

It will generate a dummy plugin.yml

fallow sky
#

k

rigid saffron
#

With other name and stuff

fallow sky
#

let's do that

rigid saffron
#

But if it will recognize loaded classes then we'll have to take extra meassures

#

From unloading to bundling the real jar in a dummy jar

#

Ok gtg sleep, bye bye

fallow sky
#

huh

#

good night

fallow sky
#

huh

#
[ModernPluginLoadingStrategy] Could not load plugin 'NMSTestProject-1.0-remapped.jar' in folder 'C:\Users\paule\Documents\Serveurs\1.20.4\plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `io.github.spigotcvn.test.Test'```
fallow sky
#

I tested on paper 1.18.2, same

fallow sky
#

paper and spigot are really, well wtf are they made like this

#

If you don't use the provided API, you're f*cked

#

so many things change between versions

woven arrow
rigid saffron
#

Ah fuck

#

I totally forgot you need to replace all \ in paths by /

#
public static void repackJar(File resultJarFile, File unarchiveDir) throws IOException {
        try (FileOutputStream fos = new FileOutputStream(resultJarFile);
             JarOutputStream jos = new JarOutputStream(fos)) {

            // Iterate over all files in the unarchive directory and add them to the JAR
            Util.iterateOverFiles(file -> {
                try {
                    String entryName = unarchiveDir.toPath()
                        .relativize(file.toPath())
                        .toString()
                        .replaceAll("\\" + File.separator, "/");
                    JarEntry entry = new JarEntry(entryName);
                    jos.putNextEntry(entry);
                    Files.copy(file.toPath(), jos);
                    jos.closeEntry();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }, unarchiveDir);
        }

        Util.iterateOverFiles(File::delete, unarchiveDir);
        unarchiveDir.delete();
    }
``` could work, Idk if it will
inland spoke
#

what on earth

#

aren't paths in java world always /?

rigid saffron
#

jars can only use / for paths, in java tho you get File.separator and shit

#

I think I'll just use tinyv1 for now

inland spoke
#

well java.nio.file.Path should use / I think. It's just java.io.File that uses File.separator

rigid saffron
#

it probably adapts to the version

#

I mean

#

os

rigid saffron
#

decently decent

#

I also, by accident, invented an extremely inefficient way of storing mappings

#

same thing, different size

#

tell me one class

#

remapped into spiogt

#

spigot

#

if it work, it work

#

now all thats left is to implement reading tiny mappings

rigid saffron
#

damn, it works both ways with both csrg and tiny

fallow sky
#

I'll dev after

#

just going to my radio first x)

rigid saffron
#

I can now load it, do anything to it and save it with no weird changes

#

(loaded it, then immidiately saved to another file)

#

it doesn't save comments but I don't think they matter

rigid saffron
#

just remap it to obfuscated, then to spigot, otherwise that'll take seven years of time (just to write proper code that does shit correctly)

rigid saffron
rigid saffron
#

I hope paulem will come back soon

rigid saffron
odd panther
#

like fabric's mapping-io

rigid saffron
#

Does it even let me merge two different mappings

#

And I don't even need it anymore, too many problems

odd panther
#

wdym "merge"

rigid saffron
#

I wanted to put spigot mappings into our intermediary mappings

#

But decided to not, just do it in two steps

odd panther
#

you can have multiple namespaces in mio

#

tiny files support saving that

rigid saffron
#

Yeah but here there are too many issues, spigot mappings use csrg, tiny mappings want descriptors on their fields which csrg doesn't have an then spigot also doesn't map everything

#

So, just forget

inland spoke
#

I mean you probably could just infer the descriptors ahead of time

rigid saffron
#

maybe

#

But its easier to just double remap it at this point

rigid saffron
#

damn

#

we got no progress today

woven arrow
rigid saffron
#

I'm waiting for this and for spigot smp and now my arm is hurting sir

#

I need that progress

odd panther
rigid saffron
#

oh right

balmy bramble
#

reflection,

rigid saffron
#

reflection what

fallow sky
#

well

#

I can't really work on the plugin today

#

I'm not in the mood of programming, especially programming

rigid saffron
#

👍

woven arrow
#

not in the mood of programming, especially programming
relatable

rigid saffron
#

I remember when we, a week ago, thought we were almost ready

#

Lol

rigid saffron
#

You in programming mood today?

fallow sky
woven arrow
#

i could but by laptop is way too shitty to run buildtools in under twenty minutes

rigid saffron
fallow sky
#

Well, I'm actually on the road, so it's a bit complicated to program, but I'll later don't worry x)

fallow sky
#

bruh my commits names 💀

fallow sky
#

because it wants a regex, and this is not a regex

#

so replaced by .replace

#

@woven arrow is mass tester actually working ?

woven arrow
#

it only runs bt atm

rigid saffron
#

How many works

fallow sky
rigid saffron
#

Did you make it work

#

Also, where does it put the remapped jar

fallow sky
fallow sky
rigid saffron
fallow sky
#

yeah

#

CANNOT FIND MAIN CLASS 🗣️🗣️🗣️🗣️🗣️🗣️🗣️🗣️🗣️

rigid saffron
#

Show everything

fallow sky
rigid saffron
#

Remapped jar?

fallow sky
#

yeah

rigid saffron
#

Send it please

fallow sky
#

wtf

rigid saffron
#

Still same issue

fallow sky
#

wait

#

you're test plugin is out of nonsense

#

there are incoherences between package naming and plugin.yml

#

lemme push everything to github

rigid saffron
#

I never used it in an actual env so idk

fallow sky
#

strange

rigid saffron
#

The thing I sent should have worked just fine

fallow sky
#

looks like it's not

rigid saffron
#

Show

fallow sky
#

wait

#

I said. wait

rigid saffron
#

Weird

#

Show the code

fallow sky
#

of ?

rigid saffron
#

Repacking

fallow sky
#
public static void repackJar(File resultJarFile, File unarchiveDir) throws IOException {
    try (FileOutputStream fos = new FileOutputStream(resultJarFile);
         JarOutputStream jos = new JarOutputStream(fos)) {

        // Iterate over all files in the unarchive directory and add them to the JAR
        iterateOverFiles(file -> {
            try {
                String entryName = unarchiveDir.toPath()
                        .relativize(file.toPath())
                        .toString()
                        .replace("\\" + File.separator, "/");
                JarEntry entry = new JarEntry(entryName);
                jos.putNextEntry(entry);
                Files.copy(file.toPath(), jos);
                jos.closeEntry();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }, unarchiveDir);
    }

    iterateOverFiles(File::delete, unarchiveDir);
    unarchiveDir.delete();
}```
rigid saffron
#

System.out.println(entryName); right after defining it

rigid saffron
#

print File.separator

fallow sky
#

with replaceAll

rigid saffron
fallow sky
#

but not at compilation

rigid saffron
#

it works

fallow sky
#

yeah

rigid saffron
#

just the compilation part

#

okay, I have an idea

fallow sky
#

so wait

rigid saffron
#

what if we merge intermediary and spigot mappings so we only remap one time

fallow sky
#

idk

rigid saffron
#

well

#

I can do that I think

fallow sky
#

k

#

okay, so it can't find ama, yes

rigid saffron
#

ama is just obfuscated names issue

fallow sky
#

yeah

#

but what is ama ?

rigid saffron
fallow sky
rigid saffron
#

ama net/minecraft/server/players/GameProfileBanList

fallow sky
#

oh ok

rigid saffron
#

btw, does the craftbukkit remapping work?

fallow sky
#

yeah

#

perfectly working

rigid saffron
#

nice

fallow sky
rigid saffron
#

👍

#

okay, so

fallow sky
#

actually

rigid saffron
#

two mappings can have one common namespace, right?

fallow sky
#

ama is DedicatedServer

rigid saffron
fallow sky
#

see by yourself

fallow sky
rigid saffron
#

I have mappings for 1.19.4 rn

#

so yeah, understandable

fallow sky
#

to check if everything works correctly for CB remapping

rigid saffron
# fallow sky

I don't like the fact that it says method_{numbers}

#

that's not great

fallow sky
#

yeah

rigid saffron
#

when I manually find it

#

net/minecraft/server/MinecraftServer a (I)V setPort

#

it is right

fallow sky
#

yeah

rigid saffron
#

damn, I just made official -> intermediary -> spigot mappings

#

very messy and unreusable methods, but works

#

oh no it doesn't

#

@fallow sky I think we can just remap to obfuscated, then to spigot for now

#

or wait

#

I think we can't

#

because the classpath jar we have is in spigot, not obfuscated

#

so we do need the merger

#

hard

fallow sky
#

huh

#

I can't really help you with that because I don't know about how to remap, but if you say it...

rigid saffron
#

well

#

I guess I'll have to write the merger

rigid saffron
#

Okay, time to think

#

So, a mapping file consists of one a description of the original field/method/class, the original name and then a translation into another name

#

Tiny mappings can have multiple namespaces but they are essentially the same

#

What we would want to do

#

Is to get one mapping (original name, description -> new name) and then search for something that matches it as close as possible in another mapping

#

So we can add a new namespace

#

Sounds logical, right?

#

I think we can not do inheritance here

fallow sky
rigid saffron
#

I think I can do that

#

I already wrote a csrg and tiny parser before

#

Only issue is that I tried to apply inheritance here, where it did not exactly work because of how different tiny and csrg are

rigid saffron
#

So I think with a second try, I can do it

fallow sky
rigid saffron
#

I'm working on it

fallow sky
#

okok

#

I'm trying mass tester

#

let's build a lot of spigot versions, perfect

rigid saffron
#

lol

fallow sky
#

I need to go

#

see you later

woven arrow
#

cya

rigid saffron
#

I did nearly implement it but now I got the issue that .tiny files take like five quintillion years to save for some reason

rigid saffron
#

I think I fucked something up

woven arrow
#

oop

#

that does not sound like official

rigid saffron
#

official = obfuscated btw

woven arrow
#

okay i do not know anything about mappings i learnt

rigid saffron
#

basically, the first one is right, the second has one extra thing for some reason

#

this is just for me

#

dw

woven arrow
#

i have no ida what any of this fuckery means

rigid saffron
#

I have fucked something up, hmm

#
Mapping{type=FIELD, name='fdm$1', className='a', descriptor='[I'} -> Mapping{type=FIELD, name='a', className='a', descriptor='[I'}
Mapping{type=FIELD, name='fdm$1', className='a', descriptor='[I'} -> Mapping{type=FIELD, name='field_39795', className='a', descriptor='[I'}
``` why tf does fdm$1 map to a and to field_39795 when of those two only field_39795 actually exists
#

I fucked up my loading logic somewhere

#

aha, so my loading logic is absolutely fucked

#

👍

#

amazing

#

yeah, this should work better

#

it did work besides double tabs

fallow sky
#

Working ?

rigid saffron
#

no changes but the new comment

woven arrow
#

quaternions concern

#

still traumatised by those

rigid saffron
#

lol

woven arrow
#

what

#

45s is

#

someting

rigid saffron
#

yeah

#

I'm attempting to optimize it

#

but it doesn't look very great

woven arrow
#

when does it run

rigid saffron
#

and Idk why it takes so long when I'm literally just adding some strings together and iterating a few times

woven arrow
#

on server boot

#

on plugin compile

#

?

rigid saffron
#

to create mappings

#

but still long

woven arrow
#

45s isn't that bad for a one time thing

#

have seen way worse

rigid saffron
#

well, 3mb is quite a lot apparently

woven arrow
#

for text yes

#

my rickroll resourcepack is a gigabyte for 50 secs of footage

fallow sky
rigid saffron
#

brother
Writing tiny...
Took 63509ms

#

I think we have an issue

woven arrow
fallow sky
#

But it's working ?

#

If it's working, don't touch it 🤓☝️

rigid saffron
#

it is working

#

as efficiently as I can make it work

fallow sky
#

Perfect 👌

rigid saffron
fallow sky
#

(nah, not really)

rigid saffron
#

is this a lot of bytes

rigid saffron
#

of bytes

#

why is taking so long tho

woven arrow
#

3mb of bytes

rigid saffron
#

I'm literally just writing some strings

fallow sky
#

Because java is suck 🤓☝️

woven arrow
#

saving that one

fallow sky
woven arrow
fallow sky
fallow sky
woven arrow
#

okay

#

no

fallow sky
#

Kotlin = Java with another syntax 🤓☝️

rigid saffron
# fallow sky Because java is suck 🤓☝️

well, if you want me to write a buffered file writer in C and then use it in java why not, just with the little issue that converting between different languages types is gonna take even longer

woven arrow
fallow sky
#

WHO SAYS "fun" FOR A METHOD ???

fallow sky
rigid saffron
#

here my lil wolves, help me fix my issue

    public void saveToStream(OutputStream os) {
        try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os), 1024 * 1024)) {
            StringBuilder sb = new StringBuilder();

            // Write header
            sb.append("# Generated by MappingMerger").append("\n");
            sb.append("v1").append("\t").append(originalNamespace);
            for (String namespace : namespaces.keySet()) {
                sb.append("\t").append(namespace);
            }
            sb.append("\n");
            writer.write(sb.toString());

            // Reset StringBuilder for reuse
            sb.setLength(0);

            // Cache namespace entry sets
            List<String> namespaceKeys = new LinkedList<>(namespaces.keySet());
            List<Pair<Mapping, Mapping>> firstNamespaceMappings = namespaces.get(namespaceKeys.get(0));

            for (Pair<Mapping, Mapping> pair : firstNamespaceMappings) {
                Mapping from = pair.getKey();

                sb.append(from.getType().name()).append("\t")
                        .append(from.getName());
                if (from.getDescriptor() != null) {
                    sb.append("\t").append(from.getDescriptor());
                }
                if (from.getClassName() != null) {
                    sb.append("\t").append(from.getClassName());
                }

                for (String namespace : namespaceKeys) {
                    Mapping to = getMapping(namespace, from);
                    if (to == null) {
                        throw new IllegalStateException("Missing mapping for " + from + " in " + namespace);
                    }
                    sb.append("\t").append(to.getName());
                }
                sb.append("\n");
                writer.write(sb.toString());
                sb.setLength(0);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
woven arrow
#

stop spamming smh

fallow sky
rigid saffron
fallow sky
#

That's it

woven arrow
fallow sky
#

Well

#

Let me enjoy my iced tea 🍵

rigid saffron
fallow sky
woven arrow
#

same !!

fallow sky
rigid saffron
fallow sky
#

I'm confused

woven arrow
#

LMAO

rigid saffron
#

lmfao

fallow sky
#

I'm dazed and confused, for so long it's not true

#

(Led zeppelin)

fallow sky
#

Well

#

Dancing polish cow

#

🐄🐄🐄

rigid saffron
#

TYLKO JEDNO W GLOWIE MAM

#

KOKSU PIEC GRAM

woven arrow
#

@optic

spiral onyx
#

fiber optic cable core

woven arrow
#

agree

rigid saffron
#

I hope making all my array lists linked lists will help

woven arrow
#

okay

#

what is a linkedlist

spiral onyx
#

ah yes, a very time consuming operation to do by hand

woven arrow
#

skull

spiral onyx
woven arrow
#

okay

#

but what is linked

rigid saffron
woven arrow
#

fuck arrays

#

all my homies hate arrays

rigid saffron
#

so the second node is connect to the first and the third

#

you can go back or forward

fallow sky
#

It's better

rigid saffron
fallow sky
#

If I don't misunderstand, they are better

woven arrow
#

me when ConcurrentHashMap

fallow sky
rigid saffron
#

currently it seems that they are worse

woven arrow
#

lmfao

rigid saffron
fallow sky
#

Bruh

rigid saffron
#

BROTHER

woven arrow
#

oh god

rigid saffron
#

Writing tiny...
Took 175176ms

woven arrow
#

lmao

spiral onyx
fallow sky
#

Use a [] array 🤓

spiral onyx
#

even though i probably should instead just not write and read concurrently

spiral onyx
#

though it's probably not good to do that

#

who gives a shit though

fallow sky
#

Or even, do not use array

fallow sky
#

Stop everything on a string

woven arrow
#

just don't use classes

#

easier on the compiler frfr

rigid saffron
spiral onyx
#

go full haskell

fallow sky
woven arrow
#

no need for di

rigid saffron
woven arrow
#

just have a big class

spiral onyx
woven arrow
#

with the entire plugin

fallow sky
spiral onyx
#

i didn't learn dagger for nothing

woven arrow
#

bytecode>>>>

spiral onyx
fallow sky
spiral onyx
#

send cosmic rays into the computer in a way that they precisely switch the bits you want

rigid saffron
#

I think I might as well have fried my laptop by accident with all of this stuff

rigid saffron
#

but replacing all linked by array lists did help a lot

woven arrow
#

i have a way to fry it even more

fallow sky
woven arrow
#

compile my rickroll-mc concern

#

and start the server

fallow sky
#

Create your own collection implementation

woven arrow
#

will take about 18gb of ram

rigid saffron
#

damn bro, I just breathed and it sounded like a lil cat screaming

woven arrow
#

more probs

fallow sky
woven arrow
#

LMAO

woven arrow
spiral onyx
#

will this bitch hurry up

rigid saffron
woven arrow
#

mewo

rigid saffron
#

I do know some C and I have done dynamic arrays in C before

#

so I could

#

but I have no idea how to do it good

#

so no

fallow sky
spiral onyx
#

so i'm updating everything there is to update

rigid saffron
spiral onyx
#

fucking intellij

spiral onyx
#

i tried

fallow sky
fallow sky
fallow sky
#

I've said "the french guy here"

woven arrow
#

WHAT THE FUCK IS A KILAWWMIDURR 🗣️ 🗣️ 🗣️ 🗣️ 🦅 🦅 🦅 🦅 🦅 🦅 🦅 🇺🇸 🇺🇸 🇺🇸 🇺🇸

fallow sky
spiral onyx
#

fr*ench language (aeuitybknruiyknaeruyniktaweliou'aeruitnawun3miaetrb is pronounced as "bo-en")

rigid saffron
spiral onyx
fallow sky
fallow sky
rigid saffron
#

lol

woven arrow
woven arrow
#

2nd longest german word

#

i know it by heart lmfao

fallow sky
#

Stop smashing your keyboard

woven arrow
#

why 😏

spiral onyx
woven arrow
#

no

rigid saffron
fallow sky
#

I only know one thing about germans

woven arrow
#

yuh uh

#

you are a law

rigid saffron
#

law sir makes it sound like I'm talking about a lawyer

#

hmm

#

what if I

spiral onyx
#

every law person from germany is mfnalex

rigid saffron
#

paralelize

fallow sky
#

OKAY I STOP HERE

woven arrow
woven arrow
fallow sky
#

You gonna kill me TwT

rigid saffron
fallow sky
woven arrow
fallow sky
woven arrow
fallow sky
fallow sky
#

Ask stackoverflow

#

But well

rigid saffron
#

is this better
Writing tiny...
Took 17732ms
Bytes: 3043664

fallow sky
#

Don't break your code

fallow sky
#

But not really that