Skip to content

Instantly share code, notes, and snippets.

View Earthcomputer's full-sized avatar

Joseph Burton Earthcomputer

View GitHub Profile
@Earthcomputer
Earthcomputer / how_to_make_mods_for_1.13.md
Last active October 16, 2022 14:03
How to make mods for 1.13

Decompiling

  1. Clone MCPConfig from the GitHub repository.
  2. In the root project directory, run gradlew :1.13:projectClientApplyPatches if you want to make a client side mod, or gradlew :1.13:projectServerApplyPatches if you want to make a server side mod.
  3. Naviage into versions/1.13/projects/server (or client). There are a couple of fixes necessary to get the code to compile:
    1. There is a missing class mcp.MethodsReturnNonnullByDefault which you will have to manually add. A copy can be found here.
    2. If you're making a server-only mod, the anonymous classes in net.minecraft.item.ItemClock and net.minecraft.item.ItemCompass need to be modified to override the method in net.minecraft.item.IItemPropertyGetter. This is never actually called on the server so you can make a dummy implementation.
  4. Copy versions/1.13/projects/server (or client) into a separate
@Earthcomputer
Earthcomputer / specialsource_fix.py
Created August 1, 2018 09:22
specialsource_fix.py
# EARTHCOMPUTER'S HACKFIX FOR SPECIALSOURCE FUCKING UP IN 1.13
from zipfile import ZipFile
import sys
def load_csrg(csrgf):
csrg = {}
for line in csrgf:
parts = line.rstrip().split(" ")
if len(parts) > 2:
@Earthcomputer
Earthcomputer / big oak tree growth.md
Last active October 2, 2021 17:48
A description of the big oak tree growth algorithm in Minecraft

Big Oak Tree Growth Algorithm

Outline

A big oak tree is made up of a main trunk and multiple branches. A "branch" always contains leaves, but may not always contain logs.

Parameters

  • heightLimit: The actual height of the tree, including leaf blocks at the top (between 5 and 16)
  • trunkHeight: The height of the trunk
  • leafDistanceLimit: The distance from a log that leaves can generate, set to 4 for sapling growth, though appears to be set to 5 for natural growth for some reason
package test;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.WrongUsageException;
import net.minecraft.server.MinecraftServer;
import test.TestRandom.DebugLevel;
public class CommandDebugRandom extends CommandBase {
package test;
import java.util.Arrays;
import java.util.Random;
import java.util.stream.Collectors;
public class TestRandom extends Random {
private static final long serialVersionUID = 1L;