Skip to content

Instantly share code, notes, and snippets.

View CorgiTaco's full-sized avatar

Corgi Taco CorgiTaco

View GitHub Profile
@CorgiTaco
CorgiTaco / mc_forge_mod_proguard.gradle
Last active December 31, 2023 09:21
Proguard task for a Forge Minecraft mod. Tested against Forge 1.18.2. Setting up Proguard in gradle can be found here: https://www.guardsquare.com/manual/setup/gradle
tasks.register('proguard', ProGuardTask) {
dependsOn tasks.jar
keep(["allowobfuscation": true], "public class ${project.group}.** { *; }")
keep(["allowobfuscation": false], "public class ${project.group}.mixin.** { *; }") //TODO: Update mixin config in jar
optimizationpasses(10)
keepattributes("*Annotation*")
verbose()

Custom NBT Tree Tutorial

Overview

As of 1.19.2-2.0.1.0 BYG, BYG now depends on Corgilib. This library offers a new world gen feature for creating custom trees from NBT files.

Features include but not are limited to:

  • Allows to build trees with trunk & canopy structure NBT parts.
  • Allows the use of vanilla & modded tree decorators. These include but are not limited to:
  • Vines
This file has been truncated, but you can view the full file.
[
{
"date": 1675367576,
"title": "Test",
"subtitle": "Test subtitle",
"banner": "https://user-images.githubusercontent.com/66983020/216435278-87f301c7-6565-4808-9856-f7d914b13a51.png",
"description": "description"
},
{
"date": 1675367576,
import net.fabricmc.loom.api.mappings.layered.MappingContext
import net.fabricmc.loom.api.mappings.layered.MappingLayer
import net.fabricmc.loom.api.mappings.layered.MappingsNamespace
import net.fabricmc.loom.api.mappings.layered.spec.MappingsSpec
import net.fabricmc.loom.configuration.providers.mappings.intermediary.IntermediaryMappingLayer
import net.fabricmc.mappingio.MappingVisitor
import net.fabricmc.mappingio.tree.MemoryMappingTree
buildscript {
@CorgiTaco
CorgiTaco / AbstractRegistration.md
Last active April 30, 2022 06:00
MultiLoader abstract registration

Multi Loader Abstract Registration

The point of this gist is to explain how my mods like BYG register their registry objects(ie. blocks) in a way that avoids duplicate code across all modules and keeps it only in the common module.

Common Module

In the common module objects we utilize a helper class that contains both the object and the ID like so:

public record BYGRegistryObject<T>(T object, String id) {
}
@CorgiTaco
CorgiTaco / PaypalCSVReader.java
Last active April 9, 2022 09:22
Prints out the total payment of a given payer for each month as well as the total paid/losses to a given vendor from a Paypal CSV file in the given user's currency and it uses the currency exchange rate for the day of the transaction. Good for taxes.
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.time.Month;
import java.util.Map;
/*MIT License
Copyright (c) 2021 Corgi Taco
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

1.17 Cubic Chunks World Generation

Hi and welcome to a document that will hopefully layout the way world generation functions in Cubic Chunks in 1.17+.

Cubic Chunks world generation is composed of cubes that are pushed through the numerous generation stages/chunk statuses. (Vanilla System but 3D)

ProtoCube (aka CubePrimer at the time of writing) is what's pushed through all stages of world generation to eventually upgrade to a BigCube.

ProtoCube is the CC equivalent of a ProtoChunk(extends ProtoChunk) BigCube is the CC equivalent of a LevelChunk(does not extend LevelChunk)

/*
The MIT License (MIT)
Copyright (c) 2020 Joseph Bettendorff aka "Commoble"
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all