Skip to content

Instantly share code, notes, and snippets.

@ChampionAsh5357
ChampionAsh5357 / 1194-120-primer.md
Last active May 28, 2024 22:18
Minecraft 1.19.4 -> 1.20 Mod Migration Primer

Minecraft 1.19.4 -> 1.20 Mod Migration Primer

This is a high level, non-exhaustive overview on how to migrate your mod from 1.19.4 to 1.20 using Forge.

This primer is licensed under the Creative Commons Attribution 4.0 International, so feel free to use it as a reference and leave a link so that other readers can consume the primer.

If there's any incorrect or missing information, please leave a comment below. Thanks!

Pack Changes

@MrIvanPlays
MrIvanPlays / PlayerArgument.java
Created June 21, 2021 19:35
BungeeCord brigadier player argument.
package com.mrivanplays.ivancord.api.command.arguments;
import com.mojang.brigadier.LiteralMessage;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import com.mojang.brigadier.suggestion.Suggestions;
@fancellu
fancellu / OkScalaTorSocksSttp.scala
Last active March 2, 2024 08:12
Shows how to use okhttp and sttp in Scala asynchronously to talk to a Tor onion address via a Tor socks proxy, without trying to resolve DNS outside of proxy
// Shows how to use okhttp and sttp in Scala asynchronously to talk to a Tor onion address via a Tor socks proxy,
// without trying to resolve DNS outside of proxy (few http clients do this properly and instead return UnknownHostException)
// libraryDependencies ++= Seq("com.squareup.okhttp3" % "okhttp" % "4.7.2",
// "com.softwaremill.sttp.client" %% "okhttp-backend" % "2.1.2"))
import java.io.IOException
import java.net.{InetSocketAddress, Proxy}
import okhttp3.{Call, Callback, OkHttpClient, Request, Response}
@vimtaai
vimtaai / markdown-flavors.md
Last active May 14, 2024 03:57
Comparison of features in various Markdown flavors

Comparison of syntax extensions in Markdown flavors

I created a crude comparison of the syntax of the various common Markdown extensions to have a better view on what are the most common extensions and what is the most widely accepted syntax for them. The list of Markdown flavors that I looked at was based on the list found on CommonMark's GitHub Wiki.

Flavor Superscript Subscript Deletion*
Strikethrough
Insertion* Highlight* Footnote Task list Table Abbr Deflist Smart typo TOC Math Math Block Mermaid
GFM
package com.bringholm.testplugin.bukkitutils;
import com.google.common.collect.Maps;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.json.simple.JSONArray;
@games647
games647 / Account.java
Created December 9, 2016 14:54
Upload a Minecraft skin automatically
package com.github.games647.changeskin.core.model.mojang.auth;
import com.github.games647.changeskin.core.model.PlayerProfile;
public class Account {
private final PlayerProfile profile;
private final String accessToken;
public Account(PlayerProfile profile, String accessToken) {
@MineTheCube
MineTheCube / texture-to-head.php
Created September 1, 2016 18:27
Get head picture from base64 encoded texture
<?php
// Encoded equivalent of:
// {"textures":{"SKIN":{"url":"http://textures.minecraft.net/texture/56936d4f0d1b93fef775b1fbd19281b70c6f88475bb5a41bf372c12f1f8a22"}}}
$base64 = 'eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTY5MzZkNGYwZDFiOTNmZWY3NzViMWZiZDE5MjgxYjcwYzZmODg0NzViYjVhNDFiZjM3MmMxMmYxZjhhMjIifX19';
// Return skin from base64 texture
function get_head_from_texture($base64) {
$texture = json_decode(base64_decode($base64), true);
if (is_array($texture) and isset($texture['textures'], $texture['textures']['SKIN'], $texture['textures']['SKIN']['url'])) {
@unascribed
unascribed / BrokenHash.java
Last active March 28, 2024 16:10
How to generate a (correct) Minecraft-style hex digest. Tested.
package com.unascribed.brokenhash;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.nio.charset.StandardCharsets;
/**
* Generates a broken Minecraft-style twos-complement signed
@kirilkirkov
kirilkirkov / Multipart RAR Files
Created October 19, 2015 08:29
What is multipart archive
Hi! I am a complete newbie to RAR files and I want to learn what to do with them. I was just wondering:
What is a multipart RAR file?
1. A multipart RAR file is a standard RAR file, that was split into many smaller parts. This way, very large Archives can be placed on many small mediums, e.g. CDs.
2. The parts of a multipart RAR file are usually named "xyz.part1.rar", "yxz.part2.rar" etc. or "xyz.rar", "xyz.r01", "xyz.r02" etc. Depending on how many parts have been generated, there may be a few or a few hundred of these files.
3. A multipart RAR file can additionally be encrypted and protected by a password. Read more on password protection in the protected RAR files section of this FAQ.
4. BE CAREFUL: Sometimes multipart RAR files are used for phishing. Learn more in the phishing RAR files section of this FAQ.
5. Sometimes a multipart RAR file can be damaged and corrupted. Please take a look at the corrupted RAR files section of this FAQ to learn more.
Hi! I am an absolute beginner and
@bcoles
bcoles / 7zip-jtr.sh
Last active April 23, 2024 19:17
7zip-JTR Decrypt Script
#!/bin/bash
# 7zip-JTR Decrypt Script
#
# Clone of JTR Decrypt Scripts by synacl modified for 7zip
# - RAR-JTR Decrypt Script - https://synacl.wordpress.com/2012/02/10/using-john-the-ripper-to-crack-a-password-protected-rar-archive/
# - ZIP-JTR Decrypt Script - https://synacl.wordpress.com/2012/08/18/decrypting-a-zip-using-john-the-ripper/
echo "7zip-JTR Decrypt Script";
if [ $# -ne 2 ]
then