Skip to content

Instantly share code, notes, and snippets.

@Commoble
Commoble / ThisIsHowYouMakeDimensionsInForgeForMinecraft14.java
Last active February 25, 2022 21:42
Custom Dimensions and How You Go In Them in Minecraft Forge 1.14 and 1.15
/**
WHAT ARE WE WORKING WITH
--Dimension, DimensionType, ServerWorld
-- There exists a 1:1:1 relationship between each of these, e.g. there will be one DimensionType instance
and one Dimension instance for a given ServerWorld, and those DimensionType and Dimension instances will only be
used on that worldserver
--ServerWorld
-- The server-specific version of the World, which holds all the block and chunk data, entities, tile entities, etc.\
for a given dimension. You won't be making these yourself or extending the class, but you'll need to find and use the
ServerWorld for your Dimension to teleport the player there.
@williewillus
williewillus / 1132_to_114.xml
Last active July 16, 2022 02:14
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" />
@Earthcomputer
Earthcomputer / Jar vs Fabric.md
Created April 27, 2019 14:34
Comparison of whether CarpetMod should be a Jar Mod or a Fabric Mod

I'm going to attempt to give a fair comparison of how well CarpetMod would work as a Jar Mod vs a Fabric Mod in the future, then give my opinion at the end.

Jar Mods

Jar Mods are what the 1.12 and 1.13 versions of CarpetMod currently are. They basically work by us directly modifying vanilla classes directly. Quick rundown of the process that isn't too in-depth: in order for us to do this, we must first translate the bytecode which Java executes into readable source code that we can understand and edit. This process is called "decompilation". Then, after we have edited the classes, we translate the code back into back into bytecode which Java can execute ("recompilation"). We then distribute parts of the code we have made changes to. Recompilation is very trivial and is unlikely to contain any errors at all. Although we use the best decompiler that exists (ForgeFlower), decompilation is still not 100% accurate.

Fabric Mods

QuickCarpet for 1.14 is a Fabric Mod. Fabric Mods are loaded by a mod loader cal

@mcenderdragon
mcenderdragon / Primer Forge Gradle Commands for 1.13 and later.md
Last active October 12, 2020 05:24
Short command list of what is now needed to setup forge and MDK

If a command breaks, use --no-daemon as the ForgeGradle currently doesn't uses it

Setup MDK (For Modders who want to create a mod)

package com.unascribed.chipper;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL43.*;
import static org.lwjgl.system.MemoryUtil.*;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@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
@JamiesWhiteShirt
JamiesWhiteShirt / GlStateManager.md
Last active July 7, 2024 02:26
Why you should never use OpenGL directly or GlStateManager.pushAttrib/popAttrib

OpenGL calls, OpenGL state, and state leaks

Making OpenGL calls has a performance cost. It is therefore desirable to reduce the amount of calls.

OpenGL has global state. The state is modified by enabling/disabling blending/culling/alpha testing/etc, specifying the blend function, changing the cull face, etc.

A state leak happens when a method leaves OpenGL in a different state after being called. This is generally undesirable as it often breaks expectations about the OpenGL state in other methods.

Modifying the OpenGL state requires OpenGL calls. Minecraft is not particularly optimized for reducing the amount of OpenGL calls, but makes an attempt using GlStateManager.

GlStateManager

@williewillus
williewillus / primer.md
Last active April 22, 2024 15:29
1.13/1.14 update primer

This primer is licensed under CC0, do whatever you want.

BUT do note that this can be updated, so leave a link here so readers can see the updated information themselves.

1.13 and 1.14 are lumped together in this doc, you're on your own if you just want to go to 1.13 and not 1.14, for some reason.

1.15 stuff: https://gist.github.com/williewillus/30d7e3f775fe93c503bddf054ef3f93e

Things in Advance

  • ResourceLocation now throw on non-snake-case names instead of silently lowercasing for you, so you probably should go and change all those string constants now. More precisely, domains must only contain alphanumeric lowercase, underscore (_), dash (-), or dot (.). Paths have the same restrictions, but can also contain forward slashes (/).
@williewillus
williewillus / foo.java
Last active July 4, 2023 01:01
recipe to json dumper
// You can include this in your mod/a pack/whatever you want, as long as that work follows the Mojang EULA.
// The original source is viewable at https://gist.github.com/williewillus/a1a899ce5b0f0ba099078d46ae3dae6e
// This is a janky JSON generator, for porting from below 1.12 to 1.12.
// Simply replace calls to GameRegistry.addShapeless/ShapedRecipe with these methods, which will dump it to a json in RECIPE_DIR
// Also works with OD, replace GameRegistry.addRecipe(new ShapedOreRecipe/ShapelessOreRecipe with the same calls
// After you are done, call generateConstants()
// Note that in many cases, you can combine multiple old recipes into one, since you can now specify multiple possibilities for an ingredient without using the OD. See vanilla for examples.
private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create();
anonymous
anonymous / mcmod.info
Created August 8, 2016 01:22
Buildcraft's mcmod.info as of c0c9fd0 for the `mcmod.info` section of the MCForge Readthedocs page
[
{
"modid": "buildcraftcore",
"name": "BuildCraft",
"version": "${version}",
"mcversion": "${mcversion}",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more!",
"credits": "Created by SpaceToad",
"logoFile": "assets/buildcraft/logo.png",
"url": "http://www.mod-buildcraft.com/",