Skip to content

Instantly share code, notes, and snippets.

View Redstoneguy129's full-sized avatar
🎯
Focusing

Cameron Whyte Redstoneguy129

🎯
Focusing
View GitHub Profile
@Plagiatus
Plagiatus / ms_auth_class.ts
Created September 12, 2021 15:19
A basic implementation for a full flow of Microsoft-Login -> Minecraft Auth + Player Info. No error handling included for easier understandability.
import { XMLHttpRequest } from "xmlhttprequest";
interface AuthorizationTokenResponse {
token_type: string,
expires_in: number,
scope: string,
access_token: string,
refresh_token: string,
user_id: string,
foci: string

Seed Cracking

Part 1: A little explanation about Java Random

  • java.util.Random, An instance of this class is used to generate a stream of pseudorandom numbers. The class uses a 48-bit seed, which is modified using a linear congruential formula. (See Donald Knuth, The Art of Computer Programming, Volume 2, Section 3.2.1.)

  • This class has 6 nifty functions:

    • nextBoolean()
    • nextDouble()
  • nextFloat()

@williewillus
williewillus / 1132_to_114.xml
Last active September 24, 2024 10:24
1.13.2 -> 1.14 migration mappings
<?xml version="1.0" encoding="UTF-8"?>
<migrationMap>
<name value="1.13.2 to 1.14" />
<description value="1.13.2 to 1.14 MCP changes" />
<entry oldName="net.minecraft.GameVersion" newName="net.minecraft.util.MinecraftVersion" type="class" />
<entry oldName="net.minecraft.advancements.AdvancementList.Listener" newName="net.minecraft.advancements.AdvancementList.IListener" type="class" />
<entry oldName="net.minecraft.advancements.RequirementsStrategy" newName="net.minecraft.advancements.IRequirementsStrategy" type="class" />
<entry oldName="net.minecraft.advancements.criterion.AbstractCriterionInstance" newName="net.minecraft.advancements.criterion.CriterionInstance" type="class" />
<entry oldName="net.minecraft.block.Block.EnumOffsetType" newName="net.minecraft.block.Block.OffsetType" type="class" />
<entry oldName="net.minecraft.block.BlockAbstractBanner" newName="net.minecraft.block.AbstractBannerBlock" type="class" />
@lispandfound
lispandfound / quicksort.rs
Created December 14, 2015 00:04
Quicksort implementation in rust
// A generic quicksort algorithm implementation in rust
fn quicksort<T: Eq + PartialEq + Clone + PartialOrd>(arr: &mut Vec<T>, low: usize, high: usize) {
if low < high {
let p = partition(arr, low, high, &|a, b| {a <= b});
quicksort(arr, low, p-1);
quicksort(arr, p+1, high);
}
}
fn partition<T: Clone, F: Fn(&T, &T) -> bool>(arr: &mut Vec<T>, low: usize, high: usize, f: &F) -> usize {
package minecrafthacker;
import java.io.FilterInputStream;
import java.io.FilterOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;