Skip to content

Instantly share code, notes, and snippets.

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

Geolykt

🍴
Fork, fork
View GitHub Profile
@Geolykt
Geolykt / slbc-chains.md
Created October 17, 2022 18:00
Implementation of task in the starloader-build-chain core

Chains

The build tool uses a concept called "Chains", which are comparable to Maven lifecycles. They are however meant to be a bit more intuitive, which is done by providing proper documentation through documents such as this one.

Problems of not using Chains

(SL-)Brachyura only has a concept of Tasks, which can only be invoked once at a single time. This means that a Task cannot run after a given Task, unless the

package render.tile.geom;
public class DimetricGeometry implements Geometry {
private static final int TILE_WIDTH = 64;
private static final int TILE_HEIGHT = 31;
@Override
public void render(int centerX, int centerY, float screenWidth, float screenHeight, float screenOffsetX, float screenOffsetY, float zoomFactor, GeometryTileVisitor visitor) {
final float actualHeight = TILE_HEIGHT * zoomFactor;
@Geolykt
Geolykt / pom.xml
Created September 6, 2022 18:42
Example pom for using cancel-backtrace
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.geolykt</groupId>
<artifactId>canceller-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>CancellerTest</name>
<repositories>
package de.geolykt.multiplayer.packets.s2c;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.ThreadLocalRandom;
import org.slf4j.LoggerFactory;
import de.geolykt.multiplayer.client.Shared;
import de.geolykt.multiplayer.client.hacks.ClientEmpire;
import de.geolykt.multiplayer.client.hacks.HackStarGenerator;
package de.geolykt.starplane;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
package de.geolykt.mavenresolver.version;
@Deprecated // This class was created by mistake
public class SemverVersion {
public final long major;
public final int minor;
public final int patch;
public final String[] preReleaseIdentifiers;
public final String[] metadata;
@Geolykt
Geolykt / keybase.md
Created July 9, 2022 18:13
keybase.md

Keybase proof

I hereby claim:

  • I am geolykt on github.
  • I am geolykt (https://keybase.io/geolykt) on keybase.
  • I have a public key whose fingerprint is C25D 4D19 CD6C 0880 C7EB 75AF E5BA 2919 5650 89C3

To claim this, I am signing this object:

[Geolykt@emeric-pc-linux tdiff]$ curl -s https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.3/asm-tree-9.3.jar --output asm-tree.jar
[Geolykt@emeric-pc-linux tdiff]$ curl -s https://repo1.maven.org/maven2/org/ow2/asm/asm-util/9.3/asm-util-9.3.jar --output asm-util.jar
[Geolykt@emeric-pc-linux tdiff]$ curl -s https://repo1.maven.org/maven2/org/ow2/asm/asm/9.3/asm-9.3.jar --output asm.jar
[Geolykt@emeric-pc-linux tdiff]$ mkdir jar
[Geolykt@emeric-pc-linux tdiff]$ cp *.jar jar
[Geolykt@emeric-pc-linux tdiff]$ cp unapplied/build/libs/claimchunk-0.0.23-RC8-plugin.jar jar/
[Geolykt@emeric-pc-linux tdiff]$ java -classpath "./jar/*" org.objectweb.asm.util.ASMifier com.cjburkey.claimchunk.ClaimChunk > unapplied.java
[Geolykt@emeric-pc-linux tdiff]$ cp applied/build/libs/claimchunk-0.0.23-RC8-plugin.jar jar/
[Geolykt@emeric-pc-linux tdiff]$ java -classpath "./jar/*" org.objectweb.asm.util.ASMifier com.cjburkey.claimchunk.ClaimChunk > applied.java
[Geolykt@emeric-pc-linux tdiff]$ diff unapplied.java applied.java
@Geolykt
Geolykt / CoordinatesProcessor.java
Created April 2, 2022 19:37
Tool to aid the placement of structures on sites such as r/place. Syntax: `java CoordinatesProcessor.java <inputFile> <leftX> <upperY>`
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.font.GlyphVector;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
public class CoordinatesProcessor {
@Geolykt
Geolykt / gist:d456a7c2aa53b6d8582cf19f9d3d8d08
Created October 30, 2021 19:23
Quiltflower decompile issues
WARN: Method parseOptions ([Ljava/lang/String;)[Ljava/lang/String; in class org/junit/runner/JUnitCommandLineParseResult couldn't be decompiled.
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.base/java.util.Objects.checkIndex(Objects.java:359)
at java.base/java.util.ArrayList.get(ArrayList.java:427)
at org.jetbrains.java.decompiler.modules.decompiler.InlineSingleBlockHelper.inlineBlock(InlineSingleBlockHelper.java:50)
at org.jetbrains.java.decompiler.modules.decompiler.InlineSingleBlockHelper.inlineSingleBlocksRec(InlineSingleBlockHelper.java:37)
at org.jetbrains.java.decompiler.modules.decompiler.InlineSingleBlockHelper.inlineSingleBlocksRec(InlineSingleBlockHelper.java:29)