Skip to content

Instantly share code, notes, and snippets.

Avatar
📞
Contact me on Discord!

SizableShrimp

📞
Contact me on Discord!
View GitHub Profile
@SizableShrimp
SizableShrimp / build.gradle
Last active Aug 3, 2022
Using shadowJar with FG's jarJar
View build.gradle
afterEvaluate {
tasks.named('jarJar') {
enabled = false
}
tasks.named('reobfJarJar') {
enabled = false
}
}
tasks.register('fullJar', net.minecraftforge.gradle.userdev.tasks.JarJar) {
@SizableShrimp
SizableShrimp / README.md
Last active Jul 12, 2022
How to remap your mod to include Forge's 1.19 renames
View README.md

How to remap your mod to include Forge's 1.19 renames

Forge versions 41.0.64 and 41.0.94 for Minecraft 1.19 together bring a large overhaul to rendering along with general renames to many older fields, methods, and classes that were previously based on MCP names. Together, these changes have broken almost all mods written for any older versions of Forge 1.19 or lower.

However, the Forge team has created a tool to aid modders in automatically remapping their mods to be in line with the renames. This tool has been designed with the future in mind. This means you should be able to use it starting from any Minecraft/Forge version (on FG5) on the way to porting to any future Minecraft/Forge versions (1.19+ / 41.0.94+).

Note: This does not port your mod for you. However, it greatly helps in automating parts that would otherwise be tedious.

@SizableShrimp
SizableShrimp / README.md
Last active Jun 12, 2022
Overview of Forge 1.18.2 registry and tag changes
View README.md

Overview of Forge 1.18.2 registry and tag changes

Forge version 1.18.2-40.0.18 introduced some changes to how custom registries and tags work to support Mojang's new universal tag system. The differences between tags in 1.18.1 and 1.18.2 were great enough to warrant breaking changes in Forge where necessary.

Enabling tags for custom registries

For simplicity, custom Forge registries are opt-in for universal tags. To enable tags for a registry, call RegistryBuilder#hasTags(). This tells Forge to run the necessary setup to allow tags for a custom registry. Tag-enabled forge registries will be registered to the root registry in Registry to promote as much compatibility with vanilla systems as possible.

@SizableShrimp
SizableShrimp / README.md
Last active Jun 12, 2022
How to use the Game Test Framework on Forge
View README.md

Game Test Framework on Forge

The Game Test Framework is a powerful tool provided by Mojang that is included with Minecraft in 1.17 and up. It allows you to declare game tests that can be run inside a Minecraft world and provide a success or fail state. Game tests are similar in concept to unit tests, but they allow you to interact with a running instance of Minecraft. This means you can test block interactions, entity interactions, item functionality, etc. Game tests use template structures to define the dimensions of the test and what blocks and entities will start in the test structure. This framework has useful applications for Continuous Integration (CI) and testing during development to ensure features are working as expected.

For a more in-depth explanation about the Game Test Framework itself and how Mojang uses it to test the base game, please see this video with contributions by Dinnerbone. This guide is tailored towards Forge modders by expla

@SizableShrimp
SizableShrimp / README.md
Last active Aug 2, 2022
How to setup shading with Minecraft Forge
View README.md

How to setup shading with Minecraft Forge

Shading is the concept of packing external dependencies inside your jar so that they exist in production. Without this, using external libraries would produce ClassNotFoundExceptions when you run your mod jar outside of an IDE. This guide explains how to setup shading through Gradle.

Assumptions

This guide assumes that:

  • You are on ForgeGradle 5 or higher
  • You are on Gradle 7.0 or higher
@SizableShrimp
SizableShrimp / README.md
Last active Aug 10, 2022
How to fix Java libraries not loading in Minecraft Forge 1.17+
View README.md

How to fix Java libraries not loading in Minecraft Forge 1.17+

By default, Minecraft Forge does not load dependencies from the classpath unless they are explicitly declared as mods. These steps outline how to remedy this. This guide assumes that:

  1. You are on ForgeGradle 5 or higher.
  2. You are on Forge 1.17.1 (37.0.13) or higher.

Using Java libraries

To configure your Java libraries to be loaded by Forge, you should use the minecraftLibrary configuration provided by ForgeGradle. You now must make sure to declare your dependencies using minecraftLibrary configuration.

View DataManager.java
/*
* Copyright (c) 2020 SizableShrimp.
* This file is provided under version 3 of the GNU Lesser General Public License.
*/
package me.sizableshrimp.adventofcode2020.helper;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
@SizableShrimp
SizableShrimp / My idea.md
Created Sep 21, 2020
Among Us - Angels vs. Devils
View My idea.md

Among Us - Angels vs. Devils

The concept

A new group is added to the game called "Devils", which have to always tell lies whenever asked questions. The current number of Devils that should be in a game is up for debate, but I'm thinking 1-2 similar to how many Impostors there are. The Devils would still be crewmates in-game, but they are like minions of sorts for the Impostors. Impostors can decide whether to lie or tell the truth depending on what makes more sense in the situation. Switching between lying and telling the truth too often however could lead to the Impostor being found out. If the Impostors win, the Devils win as well. Devils still have to do their tasks but can intentionally fake tasks to draw suspicion and try to get themselves outed as an Impostor.

@SizableShrimp
SizableShrimp / crash-2020-08-11_04.00.35-server.txt
Created Aug 11, 2020
EnderIO Stack Overflow Error (with Compact Machines 3 Tunnels)
View crash-2020-08-11_04.00.35-server.txt
---- Minecraft Crash Report ----
WARNING: coremods are present:
TransformLoader (DynamicSurroundings-1.12.2-3.6.1.0.jar)
TransformerLoader (OpenComputers-MC1.12.2-1.7.5.192.jar)
ForgelinPlugin (Forgelin-1.8.4.jar)
OpenDisksUnpack (OpenDisks-MC1.12.2-0.1.0.3.jar)
MoreSoundConfigCore (moresoundconfig-core-1.0.4.jar)
AppleCore (AppleCore-mc1.12.2-3.4.0.jar)
MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.2.277.jar)
@SizableShrimp
SizableShrimp / LangManager.java
Created Jul 27, 2020
LangManager for Forge mod 1.12.2
View LangManager.java
package me.sizableshrimp.compactcommands.lang;
import me.sizableshrimp.compactcommands.CompactCommands;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.NetworkManager;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.translation.I18n;