Skip to content

Instantly share code, notes, and snippets.

package dev.compactmods.machines.test.worldgen;
import net.minecraft.core.BlockPos;
import net.minecraft.world.phys.AABB;
import net.neoforged.bus.api.Event;
import net.neoforged.bus.api.ICancellableEvent;
import java.util.Collection;
/**
@robotgryphon
robotgryphon / FakeInventory.java
Created June 5, 2021 16:26
Fake Recipe Inventory
package com.robotgryphon.compactcrafting.recipes.setup;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
public class FakeInventory implements IInventory {
/**
* Returns the number of slots in the inventory.
*/
@robotgryphon
robotgryphon / status.md
Created January 31, 2021 22:52
Compact Mods Status

Current mod features

Compact Machines Alpha 6

  • Items: Personal Shrinking Device, Machines
  • Compact Machine dimension (compact_world) is implemented
  • Machines can be placed by a user and entered with the PSD
  • Machine rooms generate in a spiral algorithm instead of the old X-axis style.
  • Tunnel support IS implemented, but it's extremely unstable.
    • Only major support is for item tunnels. You need buffer chests.
  • Use at your own risk. Bug reports WILL be ignored right now.
@robotgryphon
robotgryphon / build.gradle
Created November 25, 2020 15:34
Forge De-Obfuscated JAR Mods
// Loads files in the format {modid}-{version}.jar, MC version optional but picky about hyphens.
// See the regex pattern.
def getModVersion(filename) {
// println(filename);
def pattern = /^(?<modid>[^-]+)(?:-(?<mcversion>[0-9.]+))?(?:-(?<modver>[0-9.\-]+))\.jar$/;
def matcher = filename =~ pattern
def found = matcher.find()
package com.robotgryphon.compactmachines.block;
import com.robotgryphon.compactmachines.block.tiles.CompactMachineTile;
import com.robotgryphon.compactmachines.core.Registrations;
import com.robotgryphon.compactmachines.reference.EnumMachineSize;
import com.robotgryphon.compactmachines.reference.Reference;
import com.robotgryphon.compactmachines.util.CompactMachineUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.LivingEntity;
@robotgryphon
robotgryphon / Deferred.java
Created September 26, 2020 18:00
Registry Derp
// ================================================================================================================
// REGISTRIES
// ================================================================================================================
private static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MOD_ID);
private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MOD_ID);
private static final DeferredRegister<TileEntityType<?>> TILE_ENTITIES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, MOD_ID);
public static final DeferredRegister<MiniaturizationRecipe> MINIATURIZATION_RECIPES = DeferredRegister.create(MiniaturizationRecipe.class, MOD_ID);
@robotgryphon
robotgryphon / example.json
Created September 20, 2020 02:47
Dimension Generation - 1.16.1
{
"type": {
"name": "compactmachines:void",
"ultrawarm": false,
"natural": false,
"piglin_safe": false,
"respawn_anchor_works": false,
"bed_works": false,
"has_raids": false,
"has_skylight": true,
buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
}
}
@Override
public void drawForeground(Point mouse) {
// GuiUtils.drawRectangle(contentArea, Color.MAGENTA);
Point drawOffset = displayedContentArea.getLocation();
drawOffset.translate(contentArea.x, contentArea.y);
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
RenderGameOverlayEvent
Categories: effect, hud, overlays, debug
effect (anything obscuring the player vision)
pumpkin overlay
portal
player hud (hotbar, etc)
hotbar