Rename & rewrite, add limits & checks, better delete

This commit is contained in:
CocoTheOwner
2021-07-18 18:00:10 +02:00
parent 944ef83805
commit af1b17cb98
4 changed files with 74 additions and 51 deletions

View File

@@ -1,5 +1,6 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.core.TreeManager;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.util.collection.KList;
import lombok.AllArgsConstructor;
@@ -17,7 +18,7 @@ public class IrisTree {
@Required
@Desc("The types of trees overwritten")
@ArrayType(min = 1, type = TreeType.class)
@ArrayType(min = 1, type = IrisTreeType.class)
private KList<IrisTreeType> treeTypes;
@RegistryListObject
@@ -28,6 +29,6 @@ public class IrisTree {
@Desc("The size of the square of saplings this applies to (2 means a 2 * 2 sapling area)")
@MinNumber(1)
@MaxNumber(5)
@MaxNumber(TreeManager.maxSaplingPlane)
private int size = 1;
}

View File

@@ -1,56 +1,49 @@
package com.volmit.iris.engine.object;
import com.volmit.iris.engine.object.annotations.Desc;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.bukkit.TreeType;
@Accessors(chain = true)
@NoArgsConstructor
@Desc("Tree Types")
public enum IrisTreeType {
/**
* Oak tree (BIG_TREE, TREE)
*/
@Desc("Oak tree (BIG_TREE, TREE)")
OAK,
/**
* Spruce tree (MEGA_REDWOOD, REDWOOD, SWAMP, TALL_REDWOOD)
*/
@Desc("Spruce tree (MEGA_REDWOOD, REDWOOD, SWAMP, TALL_REDWOOD)")
SPRUCE,
/**
* Birch tree (BIRCH, TALL_BIRCH)
*/
@Desc("Birch tree (BIRCH, TALL_BIRCH)")
BIRCH,
/**
* Jungle tree (JUNGLE, SMALL_JUNGLE)
*/
@Desc("Jungle tree (JUNGLE, SMALL_JUNGLE)")
JUNGLE,
/**
* Big red mushroom; short and fat
*/
@Desc("Big red mushroom; short and fat")
RED_MUSHROOM,
/**
* Big brown mushroom; tall and umbrella-like
*/
@Desc("Big brown mushroom; tall and umbrella-like")
BROWN_MUSHROOM,
/**
* Acacia tree
*/
@Desc("Acacia tree")
ACACIA,
/**
* Dark Oak tree
*/
@Desc("Dark Oak tree")
DARK_OAK,
/**
* Large crimson fungus native to the nether
*/
@Desc("Large crimson fungus native to the nether")
CRIMSON_FUNGUS,
/**
* Large warped fungus native to the nether
*/
@Desc("Large warped fungus native to the nether")
WARPED_FUNGUS,
/**
* Tree with large roots which grows above lush caves
*/
@Desc("Tree with large roots which grows above lush caves")
AZALEA,
/**
* The fallback type for all other non-supported growth events
*/
@Desc("The fallback type for all other non-supported growth events")
NONE;
public static IrisTreeType fromTreeType(TreeType type){