Skip to content

Instantly share code, notes, and snippets.

View Geolykt's full-sized avatar
🍴
Fork, fork

Geolykt

🍴
Fork, fork
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<metadata modelVersion="1.1.0">
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<versioning>
<snapshot>
<timestamp>20220725.090125</timestamp>
<buildNumber>47</buildNumber>
</snapshot>
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#NOTE: This file was written by de.geolykt:mavenresolver, a nonstandard resolver implementation!
#Sat Mar 11 23:55:23 CET 2023
maven-metadata-jitpack.xml.error=java.io.IOException\: Query for https\://jitpack.io/org/spigotmc/spigot-api/maven-metadata.xml returned with a response code of 404 (Not Found)
maven-metadata-coreprotect-repo.xml.lastUpdated=1678575062125
maven-metadata-geolykt-maven.xml.lastUpdated=1672852515277
maven-metadata-central.xml.error=java.io.IOException\: Query for https\://repo1.maven.org/maven2/org/spigotmc/spigot-api/maven-metadata.xml returned with a response code of 404 (Not Found)
maven-metadata-spigot-repo.xml.lastUpdated=1678575061507
maven-metadata-sk89q-repo.xml.lastUpdated=1678575061952
maven-metadata-rosewood-repo.xml.error=java.io.IOException\: Query for https\://repo.rosewooddev.io/repository/public/org/spigotmc/spigot-api/maven-metadata.xml returned with a response c
java.lang.ClassCastException: com.sun.tools.javac.code.Type$AnnotatedType cannot be cast to com.sun.tools.javac.code.Type$ClassType
at com.sun.tools.javac.api.JavacTrees$3.visitErrorType(JavacTrees.java:689)
at com.sun.tools.javac.api.JavacTrees$3.visitErrorType(JavacTrees.java:646)
at com.sun.tools.javac.code.Type$ErrorType.accept(Type.java:1829)
at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:4571)
at com.sun.tools.javac.api.JavacTrees.fuzzyMatch(JavacTrees.java:642)
at com.sun.tools.javac.api.JavacTrees.fuzzyMatch(JavacTrees.java:633)
at com.sun.tools.javac.api.JavacTrees.hasParameterTypes(JavacTrees.java:625)
at com.sun.tools.javac.api.JavacTrees.searchMethod(JavacTrees.java:572)
at com.sun.tools.javac.api.JavacTrees.findMethod(JavacTrees.java:528)
@Geolykt
Geolykt / DeprecationAnnotationMigrator.java
Created May 19, 2023 17:17
Migrate Java 9+ `@Deprecated` to Java 8 Deprecated annotations
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.Iterator;
import java.util.List;
public class DeprecationAnnotationMigrator {
public static void main(String[] args) throws IOException {
Obligatory foreword: Please be aware that the galimulator modding scene has moved in a very different direction compared to most JVM modding communities and we are still stuck in the past when it comes to certain things. While tinyv2 isn't something we plan to use anytime soon (we make hefty use of tinyv1 though), future developments could mean that newer versions of tiny are used, which is why I feel inclined to comment on this matter.
Signatures: Those are already automatically generated by our deobfuscator, however the data it generates is directly applied to the jar. In the past there has been no need to store signatures separately to disk. In the future it is planned to double down on the automation, thus merging those files would make sense - especially if it is supported by enigma-like tools.
Per-class default LVT names: An interesting idea - however I can't recall any cases where I'd need it. In minecraft space there is a larger usecase though given that suffixes and prefixes are used frequently.
A
@Geolykt
Geolykt / SidedProcessingSlotWrapper.java
Created April 24, 2023 20:20
SidedProcessingSlotWrapper attempt
package com.smashingmods.alchemylib.api.storage;
import javax.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.IItemHandler;
@Geolykt
Geolykt / Pixmap2PixmapBlitter.java
Created January 2, 2023 15:36
Old half-broken Pixmap2PixmapBlitter
package de.geolykt.cityblitter.blitting;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import org.slf4j.LoggerFactory;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Pixmap.Format;
@Geolykt
Geolykt / Test.java
Created December 17, 2022 13:16
In-memory bukkit plugins (unlikely to work as-is)
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.HashMap;
import java.util.HashSet;
.version 61 0
.class public d/g/mc/un/UN
.super org/bukkit/plugin/java/JavaPlugin
.sourcefile "UN.j"
.field private prios Ljava/util/List;
.field private fserr Z
.field private fspnc Z
.method public <init> : ()V
@Geolykt
Geolykt / fix-git-permissions.sh
Created October 22, 2022 18:22
Set all modified (probably modified due to changed file mods) files to have a chmod of 644
git status | grep "modified" | egrep -o " {3}.+" | egrep -o "[^ ]+" | xargs -n1 chmod -v 644