Skip to content

Instantly share code, notes, and snippets.

View sciwhiz12's full-sized avatar
:shipit:
commit, push, and ship it

sciwhiz12

:shipit:
commit, push, and ship it
View GitHub Profile
@sciwhiz12
sciwhiz12 / Test_decompiled.java
Created July 2, 2026 18:17
Conditional pattern matching in switches, using Java 25 and Vineflower 1.12.0
// Compiled using Java 25 (javac 25.0.3) and Decompiled using Vineflower 1.12.0
import Test.FirstRecord;
import Test.SecondRecord;
import java.lang.runtime.SwitchBootstraps;
public class Test {
public static void main(String... var0) {
FirstRecord var1 = new FirstRecord(0, null, null);
FirstRecord var2 = var1;
byte var3 = 0;
@sciwhiz12
sciwhiz12 / gist:7c0a76f1dc06ffbec2ab82ce5ca0c545
Created October 20, 2023 18:45
printing of declared methods in ChangelogGenerationExtension, beautified
[
public java.lang.Object net.neoforged.gradleutils.ChangelogGenerationExtension_Decorated.getProperty(java.lang.String),
public java.lang.String net.neoforged.gradleutils.ChangelogGenerationExtension_Decorated.toString(),
public void net.neoforged.gradleutils.ChangelogGenerationExtension_Decorated.setProperty(java.lang.String,java.lang.Object),
public org.gradle.api.plugins.ExtensionContainer net.neoforged.gradleutils.ChangelogGenerationExtension_Decorated.getExtensions(),
public org.gradle.api.internal.ConventionMapping net.neoforged.gradleutils.ChangelogGenerationExtension_Decorated.getConventionMapping(),
public java.lang.Object net.neoforged.gradleutils.ChangelogGenerationExtension_Decorated.invokeMethod(java.lang.String,java.lang.Object),
public void net.neoforged.gradleutils.ChangelogGenerationExtension_Decorated.setMetaClass(groovy.lang.MetaClass),
public groovy.lang.MetaClass net.neoforged.gradleutils.ChangelogGenerationExtension_Decorated.getMetaClass(),
public boolean net.neoforged.gradleut
@sciwhiz12
sciwhiz12 / instability.md
Created September 20, 2023 19:03
Proposal of the stable and unstable surfaces of the API, and the instability window.

Working upon the premise that the suggestion of denoting certain APIs as incubating/experimental bears some merit:

The two API surfaces

The API can be roughly divided into two surfaces: the stable surface, and the unstable surface.

The stable surface is the API which is known to be stable; outside of bug fixes, there should be little to no changes in this API which would cause a mod compiled against it to be broken, behavioral-wise or binary-wise. (In old Forge terms, the API after a Recommended Build would be considered to be wholly on the stable surface.)

The unstable surface is the API which is not stable, and therefore is subject to change or removal over the coming versions. Mods using APIs on the unstable surface may or may not work when built on newer versions.

@sciwhiz12
sciwhiz12 / README.md
Created September 9, 2023 17:35
Final (unfinished) version of my personal (unfinished) draft for NeoForged governance

Core Governance

The core foundational governance structure of the project is split into three core groups: the [Maintainers team][maintainers], [Moderation team][moderation], and the [Steering Council][council].

For clarity: core groups refers to all three, while core teams refer only to the Maintainers team and the Moderation team.

All other structures within the project, such as [ancillary teams][ancillary], are derived from the cooperation, membership, and approval of these three core groups, as may be defined in other documents

All members of all core groups and all teams shall adhere to the code of conduct and other ethical policies, and may face disciplinary sanctions, up to and including their removal from their team or the project as a whole, should they be found to violate those policies.

@sciwhiz12
sciwhiz12 / tps.lua
Created August 19, 2023 23:34
TPS monitoring programs, suitable for use on a command computer. Originally written for the public MC server for the Minecraft Mod Development discord guild (hence, references to `mmd`).
if not commands then
printError("This requires a command computer")
return
end
local getMeanTickTime = function(sText)
local tickTime = string.match(sText, "Mean tick time: ([%d.]+) ms")
if (tickTime == nil) then
return nil
end
@sciwhiz12
sciwhiz12 / 1_ExampleMod.java
Last active February 14, 2023 11:13
Test mod showing that DatapackBuiltinEntriesProvider is erroring out when used for custom registries
package com.example.modid;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.data.DataGenerator;
/*
* Copyright (c) Forge Development LLC and contributors
* SPDX-License-Identifier: LGPL-2.1-only
*/
package net.minecraftforge.common.data;
import com.google.common.collect.ImmutableList;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
@sciwhiz12
sciwhiz12 / code-style.md
Last active December 22, 2022 21:13
Copy of code style and patching guide WIP documents I have in my Obsidian, as of 2022-12-21 UTC+8

Forge Code Style

The following guide outlines the code style used by the Forge Project for the main Minecraft Forge API code.

Important

The following style does not apply to the patched Minecraft source code.

This is not a fully comprehensive document; there may be cases in which a strict reading of this document does not show a clear answer. In these cases, please ask the Triage Team to clarify on the case and to update this document accordingly. In absence of a response, try to strike a balance towards readability and existing guidelines.

This code style guide is based off the Google Java Style Guide, which is available under the Creative Commons Attribution 3.0 Unported license.

@sciwhiz12
sciwhiz12 / Scratch.java
Last active May 17, 2022 09:14
javadoc formatting example
public class Scratch {
/**
* I'm the first sentence of the first paragraph, so I should summarize what the method is. The following sentences
* should add on to the info of the first paragraph or, if there are no more succeeding paragraphs, may contain the
* rest of the information for the method. I can link to {@link Object#equals(Object) certain methods}, or perhaps
* link but using {@linkplain Object#hashCode() regular font instead of monospace}. There's also {@code inline
* monospace}!
*
* <p>I'm the second paragraph. I could be giving more details about how or why the method was implemented and
* designed. As the second paragraph, I can also give important tips or tidbits about how the method works. You can
@sciwhiz12
sciwhiz12 / parchmentmc-cla.md
Last active June 3, 2021 18:12
Contributor License Agreement for ParchmentMC repositories

Contributor License Agreement

In order to clarify the intellectual property license granted with Contributions from any person or entity, the ParchmentMC team must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the ParchmentMC team and their users; it does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the ParchmentMC team. Except for the license granted herein to the ParchmentMC team and recipients of software distributed by the ParchmentMC team, You reserve all right, title, and interest in and to Your Contributions.

Section 1. Definitions.

  • "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with the Par