Skip to content

Instantly share code, notes, and snippets.

var transformerName = "Gigaherz PlayerContainer Transformer";
var targetClass = "net.minecraft.inventory.container.PlayerContainer";
function initializeCoreMod() {
return {
transformerName: {
'target': {
'type': 'CLASS',
'name': targetClass
},
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package net.minecraft.client.renderer.chunk;
import net.minecraft.block.BlockState;
import net.minecraft.fluid.IFluidState;
import net.minecraft.tileentity.TileEntity;
package me.asuramagica.blocks.tileentity;
import me.asuramagica.block.inventory.ManaStoneContainer;
import me.asuramagica.list.BlockList;
import me.asuramagica.list.ItemList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.FireBlock;
import net.minecraft.entity.player.PlayerEntity;
package net.minecraft.client.gui;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
package io.github.cadiboo.testrender.render;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.glfw.GLFWErrorCallback;
import org.lwjgl.glfw.GLFWVidMode;
import org.lwjgl.opengl.GL;
import static io.github.cadiboo.testrender.main.Main.handleException;
import static org.lwjgl.glfw.GLFW.GLFW_FALSE;
import static org.lwjgl.glfw.GLFW.GLFW_KEY_ESCAPE;
/*
* Minecraft Forge
* Copyright (c) 2016-2019.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
@Cadiboo
Cadiboo / ModDimensionTeleporter.java
Created January 6, 2020 11:19
How to get to your Dimension in 1.14 (and probably in 1.13 and 1.15 too)
// By Commoble#9251
// https://discordapp.com/channels/176780432371744769/179315645005955072/661244291833790494 on the MMD Discord (https://discord.mcmoddev.com/)
// How to get to your Dimension in 1.14 (and probably in 1.13 and 1.15 too)
public static void teleportPlayerToDimension(ServerPlayerEntity player, DimensionType destinationType, BlockPos destinationPos) {
ServerWorld nextWorld = player.getServer().getWorld(destinationType);
nextWorld.getChunk(destinationPos); // Make sure the chunk is loaded
player.teleport(nextWorld, destinationPos.getX(), destinationPos.getY(), destinationPos.getZ(), player.rotationYaw, player.rotationPitch);
}
@Cadiboo
Cadiboo / FieldDebug.java
Created January 6, 2020 12:10
Rendering Debugging helper
public class FieldDebug {
/**
* Call this code from a debugger evaluation from some working code and some code that
* doesn't work then compare the two dumps. Comparing the two will allow you to see the
* differences and change your code to eliminate the differences by invoking methods on
* the RenderSystem.
*/
public static void printGlStateManager() throws IllegalAccessException {
final StringBuilder stringBuilder = new StringBuilder();
Test: get
5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 0,
8, 9, 7, 10, 6,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
3, 4, 2, 5, 1, 6, 0, 7, 8, 9, 10,
7, 8, 6, 9, 5, 10, 4, 11, 3, 12, 2, 13, 1, 14, 0, 15, 16, 17, 18, 19, 20,
15, 16, 14, 17, 13, 18, 12, 19, 11, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
Test: get2
5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 0,