Skip to content

Instantly share code, notes, and snippets.

View liach's full-sized avatar

Chen Liang liach

  • Oracle
  • ATX
  • 00:02 (UTC -06:00)
View GitHub Profile
@liach
liach / zh_CN.lang
Created April 26, 2016 06:50
LiteLoader Mandarin Localization
# This file MUST be saved as UTF-8
key.categories.litemods=§e模组按键
gui.about.modsloaded=已读取%d个模组
gui.about.versiontext=版本%s
gui.about.poweredbyversion=v%s§r,由LiteLoader v%s提供支持
gui.about.checkupdates=§n检查更新
@liach
liach / DynamicEnumTest.java
Last active January 6, 2018 03:53
The modified version of Dynamic Enum Test that shows the bug
import sun.reflect.ConstructorAccessor;
import sun.reflect.FieldAccessor;
import sun.reflect.ReflectionFactory;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
---- Minecraft Crash Report ----
// Would you like a cupcake?
Time: 5/29/18 8:12 PM
Description: Updating screen events
java.lang.NullPointerException: Updating screen events
at net.minecraft.inventory.SlotCrafting.func_190901_a(SlotCrafting.java:86)
at net.minecraft.inventory.Container.func_184996_a(Container.java:303)
at net.minecraft.client.multiplayer.PlayerControllerMP.func_187098_a(PlayerControllerMP.java:566)
---- Minecraft Crash Report ----
// This doesn't make any sense!
Time: 5/29/18 8:16 PM
Description: Updating screen events
java.lang.NullPointerException: The validated object is null
at org.apache.commons.lang3.Validate.notNull(Validate.java:225)
at org.apache.commons.lang3.Validate.notNull(Validate.java:206)
at net.minecraft.util.NonNullList.set(SourceFile:49)
@liach
liach / gist:c25f17dda1fcadb38fadfb0841cb722c
Created December 6, 2018 06:52
Calls to search for plugins
=== Field Calls ===
=== Method Calls ===
Lorg/spongepowered/api/command/CommandManager
process
(Lorg/spongepowered/api/command/CommandSource;Ljava/lang/String;)Lorg/spongepowered/api/command/CommandResult;
Lorg/spongepowered/api/command/CommandManager
register
@liach
liach / Debate
Created August 24, 2019 03:36
Refute against forge discord's forgevsfabric trick
Minecraft Forge and FabricMC both have similar infrastructures: mod loaders, mod api, gradle build tools, deobuscation tools.
Mod loader: supposed to just load mods in Minecraft and deobfuscate the game.
Mod API: Offer events, loaders, hooks (e.g. model loading systems, config systems, standard energy API)
Gradle build tool: The gradle plugin that is used to build mods
Deobfuscation tool: Converts obfuscated Minecraft to deobfuscated ones so that modders can understand what they are modding
Minecraft Forge:
- Mod loader: Forge (more exactly, fmllauncher source set since 1.13, previously FML)
- Mod API: Forge (previously Forge and part of FML)
@liach
liach / hideforge.js
Last active November 8, 2019 09:44 — forked from Vazkii/hidefabric.js
Userscript to hide forge mods (use with Tampermonkey or any other userscript plugin)
// ==UserScript==
// @name Hide Fabric Mods
// @version 1.0
// @description Hides fabric mods from CurseForge
// @author Vazkii
// @match https://www.curseforge.com/minecraft/mc-mods*
// ==/UserScript==
(function() {
'use strict';
@liach
liach / guideline.md
Created November 27, 2019 20:10
Fabric api temporary guideline from @sfPlayer1

In order to retain maintainability, portability and discoverability, Fabric API targets only features that are important to a broader set of mods. Whether an addition is desirable depends on its usefulness in relation to its complexity, inherent necessity for compatibility, performance impact and continued support by the authors or other interested parties.

Fabric API generally is not for bugfixes, performance improvements or gameplay changes - exceptions need careful evaluation. so not too niche, requirements scale with maintenance cost

there are a few obvious questions:

  • how many mods would use this?
  • how complex is this to implement / keep updated?
  • how likely is mojang to change this severely?
  • does it have a compatibiliy or performance impact?
@liach
liach / BlockPos Refactor.md
Last active March 11, 2021 17:17
BlockPos refactor for mojang

BlockPos Refactoring

In one of the recent snapshots, I observed a large-scale refactor on BlockPos. However, the changes failed to resolve one of the essential problems of BlockPos: immutability.

What refactor

Before, the class hierarchy is like

Vec3i <- BlockPos <- BlockPos.Mutable

Now the class hierarchy will be