Skip to content

Instantly share code, notes, and snippets.

View alcatrazEscapee's full-sized avatar
💭
This party never stops, time is dead and meaning has no meaning!

Alex O'Neill alcatrazEscapee

💭
This party never stops, time is dead and meaning has no meaning!
View GitHub Profile
@alcatrazEscapee
alcatrazEscapee / TestAnnotations.java
Created September 4, 2018 15:36
Test Annotations
package testproject.test;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
@alcatrazEscapee
alcatrazEscapee / ExampleFlowers.java
Created February 19, 2019 15:05
An example of using an enum to control flower generation for TFC
import java.util.*;
import java.util.function.Supplier;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraftforge.fml.common.IWorldGenerator;
import net.minecraftforge.registries.IForgeRegistry;
import java.util.Random;
import javax.annotation.ParametersAreNonnullByDefault;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos;
==============================================
Factorio Computer V2 Specifications
==============================================
TABLE OF CONTENTS
1. Basic Specifications
1.1 Guidelines
1.2 Register File
1.3 ALU

Rock Layer Design Document

Idea:

Rock layers in TFC 1.7.10 are fairly boring. They contribute a lot to gameplay in the form of restricting access to resources, which forces the player to explore in search of various different rock types or categories. However, due to the random nature of rock layer distribution, there is no strategic element to finding specific rocks. Additionally, while there are three layers, the top is by far the most utilized due to the difficulty mining and/or searching for ores in the second / third layers.

Goals:
  • Add interesting gameplay elements to searching for specific rocks.
  • Add more reasons for players to explore and utilize lower layers.

TFC Recipes Code Style

Outline

The purpose of this document is to specify how developers and contributors should build recipes into TFC-TNG. As we are developing for 1.12 while preparing to update to 1.13/14, we are trying to design systems that will require minimal changes during the update. In addition, one of the goals of TFC-TNG is to increase compatibility with other mods, and specifically allow pack makers to modify recipes without requiring an addon mod. Finally, it is beneficial to have all recipe systems in TFC use a similar system, as it makes them easier to maintain and understand independent of the original author.

Future Plans

Minecraft 1.13 adds Datapacks and along with forge, a fancy RecipeType / IRecipeSerializer system. This system will allow all TFC recipes to move to json based recipes, which are handled completely by vanilla resource managers. This will allow users to add new recipes, override old recipes, and remove recipes all by specifying them via json.

@alcatrazEscapee
alcatrazEscapee / TFC Assets CLA.md
Last active June 18, 2019 23:52
Fix spacing and formatting

Contributor License Agreement for the TerraFirmaCraft mod for 1.12-TNG, made by Dries007, AlcatrazEscapee, and Bunsan.

The TFC Assets repository is licensed under CC-BY-SA 4.0. In addition, the contents of this repository are able to be distributed under the terms of the EUPL v1.2 when part of the TerraFirmaCraft mod. As a contributor to the TFC-Assets repository, you grant the developers of TFC-TNG the following:

  • You grant copyright ownership of your contributions to the TFC dev team.
  • You grant the TFC dev team the right to use your contributions under the terms of this license.

This is intended as a legally binding copyright assignment for any contributions to the TFC Assets repository.

TFC Time Systems Design Doc

Vanilla Systems

  1. World Total Time
  • Incremented on every server tick
  • T=0 is the beginning of the world
  1. World Time
  • Incremented on every server tick IF game rule doDaylightCycle is true
@Nullable
IBlockState findSlabVariant(World world, BlockPos pos, IBlockState stateIn)
{
ItemStack stackIn = stateIn.getBlock().getPickBlock(stateIn, null, world, pos, null);
if (!stackIn.isEmpty())
{
// Slab inventory shape
InventoryCrafting craftMatrix = new InventoryCraftingEmpty();
// todo: figure out which index positions match to a slab pattern
for (int index : SLAB_INDEXES)
@alcatrazEscapee
alcatrazEscapee / TFC 1.15 Update Primer.md
Last active April 15, 2020 00:00
TFC 1.15 Update Primer

TFC-TNG 1.15 Update Primer

This is not meant to be a comprehensive guide or outline of everything possible that needs to be done, but rather a series of guidelines on what things should be done during the port in order to improve the code base and take advantage of new systems such as data packs.

Overall Code Style / Organization

  • Package organization should be kept roughly the same as 1.12, where applicable. The exception is world generation, which is getting a top-to-bottom rewrite
  • Class names should follow standard Java and MCP naming conventions. This means moving from Suffixes to Prefixes (BlockFoo -> FooBlock), Interfaces prefixed with I, etc.
  • If a TFC class would duplicate a vanilla class exactly, then it's allowed to prefix the name with TFC, for instance TFCGrassBlock, or TFCBiomeProviderType. In general avoid prefixing things with TFC that don't require it.
  • Registry objects should use RegistryObject, as they provide convenient implementations of what were exist