Skip to content

Commit

Permalink
Added the "Tree" object. Currently unused. This is what needs to be r…
Browse files Browse the repository at this point in the history
…egistered via the custom registry
  • Loading branch information
alcatrazEscapee committed Jul 16, 2018
1 parent 09f4a1a commit bad8c8c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/net/dries007/tfc/objects/Wood.java
Expand Up @@ -7,6 +7,7 @@

import net.dries007.tfc.objects.trees.ITreeGenerator;
import net.dries007.tfc.objects.trees.TreeGenNormal;
import net.dries007.tfc.objects.trees.TreeGenTall;

public enum Wood
{
Expand Down
54 changes: 54 additions & 0 deletions src/main/java/net/dries007/tfc/objects/trees/Tree.java
@@ -0,0 +1,54 @@
/*
* Work under Copyright. Licensed under the EUPL.
* See the project README.md and LICENSE.txt for more information.
*
*/

package net.dries007.tfc.objects.trees;

// This is the thing that will be registered
public class Tree
{
// Properties to be accessed by world gen
public final float minTemp;
public final float maxTemp;
public final float minRain;
public final float maxRain;
public final float minEVT;
public final float maxEVT;

// Used when growing a tree
public final ITreeGenerator gen;
public final int maxGrowthRadius;

/**
* This is the object that should be registered via the custom registry event
* It needs to have a string name, which is used similar to how the enum is used.
* It also needs to have an int index, which will be used by the worldgen to save and load this value
*
* Addon mods that want to add trees should subscribe to the registry event for this class
* They also must put (in their mod) the required resources in /assets/tfc/...
* That way there is no need for custom logic during tree generation
*
* @param minTemp min temperature
* @param maxTemp max temperature
* @param minRain min rainfall
* @param maxRain max rainfall
* @param minEVT min EVT
* @param maxEVT max EVT
* @param gen the generator that should be called to generate this tree, both during world gen and when growing from a sapling
*/
public Tree(float minTemp, float maxTemp, float minRain, float maxRain, float minEVT, float maxEVT, ITreeGenerator gen, int maxGrowthRadius)
{
this.minTemp = minTemp;
this.maxTemp = maxTemp;
this.minRain = minRain;
this.maxRain = maxRain;
this.minEVT = minEVT;
this.maxEVT = maxEVT;

this.gen = gen;
this.maxGrowthRadius = maxGrowthRadius;

}
}

0 comments on commit bad8c8c

Please sign in to comment.