mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-06 07:46:08 +00:00
Merge pull request #434 from CocoTheOwner/saplingOverrides
Add sapling / tree overrides WIP
This commit is contained in:
@@ -77,7 +77,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
private KList<IrisEntityInitialSpawn> entityInitialSpawns = new KList<>();
|
||||
|
||||
@ArrayType(min = 1, type = IrisEffect.class)
|
||||
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play arround the player even if where the effect was played is no longer in the biome the player is in.")
|
||||
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play around the player even if where the effect was played is no longer in the biome the player is in.")
|
||||
private KList<IrisEffect> effects = new KList<>();
|
||||
|
||||
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
|
||||
|
||||
@@ -70,6 +70,10 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@Desc("Improves the biome grid variation by shuffling the cell grid more depending on the seed. This makes biomes across multiple seeds look far different than before.")
|
||||
private boolean aggressiveBiomeReshuffle = false;
|
||||
|
||||
@Desc("Tree growth override settings")
|
||||
private IrisTreeSettings treeSettings = new IrisTreeSettings();
|
||||
|
||||
|
||||
@Desc("Instead of a flat bottom, applies a clamp (using this noise style) to the bottom instead of a flat bottom. Useful for carving out center-dimensions in a dimension composite world.")
|
||||
private IrisShapedGeneratorStyle undercarriage = null;
|
||||
|
||||
|
||||
@@ -416,6 +416,10 @@ public class IrisObject extends IrisRegistrant {
|
||||
return place(x, yv, z, placer, config, rng, null, null, rdata);
|
||||
}
|
||||
|
||||
public int place(Location loc, IObjectPlacer placer, IrisObjectPlacement config, RNG rng, IrisDataManager rdata) {
|
||||
return place(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), placer, config, rng, rdata);
|
||||
}
|
||||
|
||||
public int place(int x, int yv, int z, IObjectPlacer oplacer, IrisObjectPlacement config, RNG rng, Consumer<BlockPosition> listener, CarveResult c, IrisDataManager rdata) {
|
||||
IObjectPlacer placer = (config.getHeightmap() != null) ? new IObjectPlacer() {
|
||||
final long s = rng.nextLong() + yv + z - x;
|
||||
|
||||
@@ -62,7 +62,6 @@ public class IrisObjectPlacement {
|
||||
@Desc("The maximum layer level of a snow filter overtop of this placement. Set to 0 to disable. Max of 1.")
|
||||
private double snow = 0;
|
||||
|
||||
@Required
|
||||
@MinNumber(0)
|
||||
@MaxNumber(1)
|
||||
@Desc("The chance for this to place in a chunk. If you need multiple per chunk, set this to 1 and use density.")
|
||||
@@ -147,6 +146,10 @@ public class IrisObjectPlacement {
|
||||
@Desc("The loot tables to apply to these objects")
|
||||
private KList<IrisObjectLoot> loot = new KList<>();
|
||||
|
||||
@Desc("This object / these objects override the following trees when they grow...")
|
||||
@ArrayType(min = 1, type = IrisTree.class)
|
||||
private KList<IrisTree> trees = new KList<>();
|
||||
|
||||
public IrisObjectPlacement toPlacement(String... place) {
|
||||
IrisObjectPlacement p = new IrisObjectPlacement();
|
||||
p.setPlace(new KList<>(place));
|
||||
|
||||
@@ -20,8 +20,10 @@ package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@Desc("The terrain mode used to tell iris how to generate land")
|
||||
@Desc("Terrain modes are used to decide the generator type currently used")
|
||||
public enum IrisTerrainMode {
|
||||
@Desc("Normal terrain, similar to the vanilla overworld")
|
||||
NORMAL,
|
||||
@Desc("Island terrain, more similar to the end, but endless possibilities!")
|
||||
ISLANDS
|
||||
}
|
||||
|
||||
33
src/main/java/com/volmit/iris/engine/object/IrisTree.java
Normal file
33
src/main/java/com/volmit/iris/engine/object/IrisTree.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.*;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.bukkit.TreeType;
|
||||
|
||||
@Accessors(chain = true)
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Desc("Tree replace options for this object placer")
|
||||
@Data
|
||||
public class IrisTree {
|
||||
|
||||
@Required
|
||||
@Desc("The types of trees overwritten by this object")
|
||||
@ArrayType(min = 1, type = TreeType.class)
|
||||
private KList<TreeType> treeTypes;
|
||||
|
||||
@Desc("If enabled, overrides any TreeType")
|
||||
private boolean anyTree = false;
|
||||
|
||||
@Required
|
||||
@Desc("The size of the square of saplings this applies to (2 means a 2 * 2 sapling area)")
|
||||
@ArrayType(min = 1, type = IrisTreeSize.class)
|
||||
private KList<IrisTreeSize> sizes = new KList<>();
|
||||
|
||||
@Desc("If enabled, overrides trees of any size")
|
||||
private boolean anySize;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@Desc("Sapling override object picking options")
|
||||
public enum IrisTreeModes {
|
||||
@Desc("Check biome, then region, then dimension, pick the first one that has options")
|
||||
FIRST,
|
||||
|
||||
@Desc("Check biome, regions, and dimensions, and pick any option from the total list")
|
||||
ALL
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Accessors(chain = true)
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Desc("Tree growth override settings")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisTreeSettings {
|
||||
|
||||
@Required
|
||||
@Desc("Turn replacing on and off")
|
||||
boolean enabled = false;
|
||||
|
||||
@Desc("Object picking modes")
|
||||
IrisTreeModes mode = IrisTreeModes.FIRST;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Desc("Sapling override object picking options")
|
||||
@Data
|
||||
public class IrisTreeSize {
|
||||
|
||||
@Required
|
||||
@Desc("The width of the sapling area")
|
||||
int width = 1;
|
||||
|
||||
@Required
|
||||
@Desc("The depth of the sapling area")
|
||||
int depth = 1;
|
||||
|
||||
/**
|
||||
* Does the size match
|
||||
* @param size the size to check match
|
||||
* @return true if it matches (fits within width and depth)
|
||||
*/
|
||||
public boolean doesMatch(IrisTreeSize size){
|
||||
return (width == size.getWidth() && depth == size.getDepth()) || (depth == size.getWidth() && width == size.getDepth());
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ package com.volmit.iris.engine.object;
|
||||
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
|
||||
@Desc("A loot mode is used to descrive what to do with the existing loot layers before adding this loot. Using ADD will simply add this table to the building list of tables (i.e. add dimension tables, region tables then biome tables). By using clear or replace, you remove the parent tables before and add just your tables.")
|
||||
@Desc("A loot mode is used to describe what to do with the existing loot layers before adding this loot. Using ADD will simply add this table to the building list of tables (i.e. add dimension tables, region tables then biome tables). By using clear or replace, you remove the parent tables before and add just your tables.")
|
||||
public enum LootMode {
|
||||
@Desc("Add to the existing parent loot tables")
|
||||
ADD,
|
||||
|
||||
Reference in New Issue
Block a user