diff --git a/build.gradle b/build.gradle index 2563cfe3..8cbb7bb9 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ apply plugin: 'net.minecraftforge.gradle.forge' sourceCompatibility = targetCompatibility = 1.8 -def parseprops(File cfg) { +static def parseprops(File cfg) { cfg.withReader { def prop = new Properties() prop.load(it) @@ -23,29 +23,30 @@ def parseprops(File cfg) { } ext.ref = parseprops(file('build.properties')) -ext.ref.mod_deps = parseprops(file('mod_deps.properties')) group = ref.package_base + '.' + ref.mod_id -archivesBaseName = ref.mod_abbr -version = ref.mc_version + '-' + ref.mod_version +archivesBaseName = (ref.mod_name as String) + '-' + (ref.mc_version as String) +version = ref.mod_version + +dependencies { + provided fileTree(dir: 'libs', include: '*.jar') +} minecraft { - version = (ref.mcf_postfix!='') ? ref.mcf_version + '-' + ref.mcf_postfix : ref.mcf_version + version = (ref.mcf_suffix!='') ? ref.mcf_version + '-' + ref.mcf_suffix : ref.mcf_version + mappings = ref.mcp_mappings runDir = ref.run_dir - mappings = ref.mappings - replace '@MOD_NAME@', ref.mod_name - replace '@MOD_ID@', ref.mod_id - replace '@MOD_VERSION@', version - replace '@MCF_VERSION@', ref.mcf_version - if (ref.mod_deps!="") replace '@MOD_DEPS@', ";" + ref.mod_deps.depstring - else replace '@MOD_DEPS@', '' + makeObfSourceJar = false + replace '= "appalachia";', '= "' + (ref.mod_id as String) + '";' + replace '= "Appalachia";', '= "' + (ref.mod_name as String) + '";' + replace '@MOD_VERSION@', project.version + replace '0.0-MCF+MINVER', ref.mcf_minver + replace '9001.0-MCF+MAXVER', ref.mcf_maxver + replace '0.0-RTG+MINVER', ref.rtg_minver + replace '9001.0-RTG+MINVER', ref.rtg_maxver replaceIn 'ModInfo.java' } -dependencies { - provided fileTree(dir: 'libs', include: '*.jar') -} - processResources { from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' @@ -69,8 +70,18 @@ sourceJar {classifier = 'src'} // For a debugging session used 'gradle -DEBUG [runClient|runServer]' allprojects { tasks.withType(JavaExec) { - jvmArgs '-Xms2G', '-Xmx4G' +// disabled to possibly alleviate testing issues on cumputers with low memory +// jvmArgs '-Xms2G', '-Xmx4G' if (System.getProperty("EBUG")!=null) jvmArgs '-agentlib:jdwp=transport=dt_socket,address=localhost:5005,server=y,suspend=y' } } + +// use -Dwarn|-Dwarnall CLI arguement for verbose compiler warnings +// -Dwarn covers the 3 most common warnings only +tasks.withType(JavaCompile) { + if (System.getProperty("warn") != null) + options.compilerArgs << "-Xlint:unchecked" << "-Xlint:rawtypes" << "-Xlint:deprecation" + if (System.getProperty("warnall") != null) + options.compilerArgs << "-Xlint:all" +} diff --git a/build.properties b/build.properties index c99c7dc8..a2e48b80 100644 --- a/build.properties +++ b/build.properties @@ -1,19 +1,22 @@ # TODO: should maybe find a way to update mod_version automatically in the future (perhaps from git), but not neccessary. # mod_author has to be in ""'s (and comma-separated, ie: "","",""), because array[] mod_id=appalachia -mod_abbr=Appalachia mod_name=Appalachia -mod_desc=Minecraft mod that adds biomes inspired by the Appalachia region of the United States of America. -mod_version=0.0.1 +mod_desc=Minecraft mod that adds biomes inspired by the Appalachian region of North America. +mod_version=0.1.0-UNSTABLE-ALPHA-1 mc_version=1.10.2 -mod_url=https://github.com/whichonespink44/Appalachia -mod_author="WhichOnesPink" +mod_url=https://github.com/Team-RTG/Appalachia +mod_author="Team RTG" mod_creds= mod_logo=assets/appalachia/logo.png -mcf_version=12.18.1.2011 -# mcf_postfix is the branch postfix (without '-') on the Forge version when it's not the default branch in the Forge repo -# This should be same as mc_version, eg Non-default: 1.9.4-12.17.0.1974-1.9.4, Default: 1.9.4-12.17.0.1976 -mcf_postfix= -mappings=snapshot_nodoc_20160724 +rtg_minver=4.1.1.3 +rtg_maxver= +mcf_version=12.18.1.2094 +mcf_minver=12.18.1.2011 +mcf_maxver= +# mcf_suffix is the branch suffix (without '-') on the Forge version when it's not the default branch in the Forge repo +# This may be the same as mc_version, eg Non-default: 1.9.4-12.17.0.1974-1.9.4, Default: 1.9.4-12.17.0.1976 +mcf_suffix= +mcp_mappings=snapshot_nodoc_20160830 run_dir=run package_base=org.teamrtg diff --git a/etc/assets/wood/blockstates/fence_autumn_charcoal.json b/etc/assets/wood/blockstates/fence_autumn_charcoal.json new file mode 100644 index 00000000..229c7ef5 --- /dev/null +++ b/etc/assets/wood/blockstates/fence_autumn_charcoal.json @@ -0,0 +1,17 @@ +{ + "multipart": [ + { "apply": { "model": "appalachia:fence_autumn_charcoal_post" }}, + { "when": { "north": "true" }, + "apply": { "model": "appalachia:fence_autumn_charcoal_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "appalachia:fence_autumn_charcoal_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "appalachia:fence_autumn_charcoal_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "appalachia:fence_autumn_charcoal_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/etc/assets/wood/blockstates/fence_gate_autumn_charcoal.json b/etc/assets/wood/blockstates/fence_gate_autumn_charcoal.json new file mode 100644 index 00000000..bd6e345a --- /dev/null +++ b/etc/assets/wood/blockstates/fence_gate_autumn_charcoal.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,in_wall=false,open=false": { "model": "appalachia:fence_gate_autumn_charcoal_closed" }, + "facing=west,in_wall=false,open=false": { "model": "appalachia:fence_gate_autumn_charcoal_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=false": { "model": "appalachia:fence_gate_autumn_charcoal_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=false": { "model": "appalachia:fence_gate_autumn_charcoal_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=false,open=true": { "model": "appalachia:fence_gate_autumn_charcoal_open" }, + "facing=west,in_wall=false,open=true": { "model": "appalachia:fence_gate_autumn_charcoal_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=true": { "model": "appalachia:fence_gate_autumn_charcoal_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=true": { "model": "appalachia:fence_gate_autumn_charcoal_open", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=false": { "model": "appalachia:fence_gate_autumn_charcoal_wall_closed" }, + "facing=west,in_wall=true,open=false": { "model": "appalachia:fence_gate_autumn_charcoal_wall_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=false": { "model": "appalachia:fence_gate_autumn_charcoal_wall_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=false": { "model": "appalachia:fence_gate_autumn_charcoal_wall_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=true": { "model": "appalachia:fence_gate_autumn_charcoal_wall_open" }, + "facing=west,in_wall=true,open=true": { "model": "appalachia:fence_gate_autumn_charcoal_wall_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=true": { "model": "appalachia:fence_gate_autumn_charcoal_wall_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=true": { "model": "appalachia:fence_gate_autumn_charcoal_wall_open", "y": 270, "uvlock": true } + } +} diff --git a/etc/assets/wood/blockstates/log_autumn_charcoal.json b/etc/assets/wood/blockstates/log_autumn_charcoal.json new file mode 100644 index 00000000..36ede5fc --- /dev/null +++ b/etc/assets/wood/blockstates/log_autumn_charcoal.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "appalachia:log_autumn_charcoal" }, + "axis=z": { "model": "appalachia:log_autumn_charcoal_side" }, + "axis=x": { "model": "appalachia:log_autumn_charcoal_side", "y": 90 }, + "axis=none": { "model": "appalachia:log_autumn_charcoal" } + } +} \ No newline at end of file diff --git a/etc/assets/wood/blockstates/planks_autumn_charcoal.json b/etc/assets/wood/blockstates/planks_autumn_charcoal.json new file mode 100644 index 00000000..7cf76233 --- /dev/null +++ b/etc/assets/wood/blockstates/planks_autumn_charcoal.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "appalachia:planks_autumn_charcoal" } + } +} \ No newline at end of file diff --git a/etc/assets/wood/blockstates/slab_autumn_charcoal.json b/etc/assets/wood/blockstates/slab_autumn_charcoal.json new file mode 100644 index 00000000..0ea5ac32 --- /dev/null +++ b/etc/assets/wood/blockstates/slab_autumn_charcoal.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "appalachia:slab_autumn_charcoal" }, + "half=top": { "model": "appalachia:slab_autumn_charcoal_upper" } + } +} \ No newline at end of file diff --git a/etc/assets/wood/blockstates/stairs_autumn_charcoal.json b/etc/assets/wood/blockstates/stairs_autumn_charcoal.json new file mode 100644 index 00000000..dfb5e446 --- /dev/null +++ b/etc/assets/wood/blockstates/stairs_autumn_charcoal.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "appalachia:stairs_autumn_charcoal" }, + "facing=west,half=bottom,shape=straight": { "model": "appalachia:stairs_autumn_charcoal", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "appalachia:stairs_autumn_charcoal", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "appalachia:stairs_autumn_charcoal", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "appalachia:stairs_autumn_charcoal_outer" }, + "facing=west,half=bottom,shape=outer_right": { "model": "appalachia:stairs_autumn_charcoal_outer", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "appalachia:stairs_autumn_charcoal_outer", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "appalachia:stairs_autumn_charcoal_outer", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "appalachia:stairs_autumn_charcoal_outer", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "appalachia:stairs_autumn_charcoal_outer", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "appalachia:stairs_autumn_charcoal_outer" }, + "facing=north,half=bottom,shape=outer_left": { "model": "appalachia:stairs_autumn_charcoal_outer", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "appalachia:stairs_autumn_charcoal_inner" }, + "facing=west,half=bottom,shape=inner_right": { "model": "appalachia:stairs_autumn_charcoal_inner", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "appalachia:stairs_autumn_charcoal_inner", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "appalachia:stairs_autumn_charcoal_inner", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "appalachia:stairs_autumn_charcoal_inner", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "appalachia:stairs_autumn_charcoal_inner", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "appalachia:stairs_autumn_charcoal_inner" }, + "facing=north,half=bottom,shape=inner_left": { "model": "appalachia:stairs_autumn_charcoal_inner", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "appalachia:stairs_autumn_charcoal", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "appalachia:stairs_autumn_charcoal", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "appalachia:stairs_autumn_charcoal", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "appalachia:stairs_autumn_charcoal", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "appalachia:stairs_autumn_charcoal_outer", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "appalachia:stairs_autumn_charcoal_outer", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "appalachia:stairs_autumn_charcoal_outer", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "appalachia:stairs_autumn_charcoal_outer", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "appalachia:stairs_autumn_charcoal_outer", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "appalachia:stairs_autumn_charcoal_outer", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "appalachia:stairs_autumn_charcoal_outer", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "appalachia:stairs_autumn_charcoal_outer", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "appalachia:stairs_autumn_charcoal_inner", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "appalachia:stairs_autumn_charcoal_inner", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "appalachia:stairs_autumn_charcoal_inner", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "appalachia:stairs_autumn_charcoal_inner", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "appalachia:stairs_autumn_charcoal_inner", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "appalachia:stairs_autumn_charcoal_inner", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "appalachia:stairs_autumn_charcoal_inner", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "appalachia:stairs_autumn_charcoal_inner", "x": 180, "uvlock": true } + } +} diff --git a/etc/assets/wood/models/block/fence_autumn_charcoal.json b/etc/assets/wood/models/block/fence_autumn_charcoal.json new file mode 100644 index 00000000..aefabc9f --- /dev/null +++ b/etc/assets/wood/models/block/fence_autumn_charcoal.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/fence_autumn_charcoal_inventory.json b/etc/assets/wood/models/block/fence_autumn_charcoal_inventory.json new file mode 100644 index 00000000..aefabc9f --- /dev/null +++ b/etc/assets/wood/models/block/fence_autumn_charcoal_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/fence_autumn_charcoal_post.json b/etc/assets/wood/models/block/fence_autumn_charcoal_post.json new file mode 100644 index 00000000..b429df3a --- /dev/null +++ b/etc/assets/wood/models/block/fence_autumn_charcoal_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/fence_autumn_charcoal_side.json b/etc/assets/wood/models/block/fence_autumn_charcoal_side.json new file mode 100644 index 00000000..be40f354 --- /dev/null +++ b/etc/assets/wood/models/block/fence_autumn_charcoal_side.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_side", + "textures": { + "texture": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/fence_gate_autumn_charcoal_closed.json b/etc/assets/wood/models/block/fence_gate_autumn_charcoal_closed.json new file mode 100644 index 00000000..1127786f --- /dev/null +++ b/etc/assets/wood/models/block/fence_gate_autumn_charcoal_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_closed", + "textures": { + "texture": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/fence_gate_autumn_charcoal_open.json b/etc/assets/wood/models/block/fence_gate_autumn_charcoal_open.json new file mode 100644 index 00000000..6bfc48e6 --- /dev/null +++ b/etc/assets/wood/models/block/fence_gate_autumn_charcoal_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_open", + "textures": { + "texture": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/fence_gate_autumn_charcoal_wall_closed.json b/etc/assets/wood/models/block/fence_gate_autumn_charcoal_wall_closed.json new file mode 100644 index 00000000..7633850a --- /dev/null +++ b/etc/assets/wood/models/block/fence_gate_autumn_charcoal_wall_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_closed", + "textures": { + "texture": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/fence_gate_autumn_charcoal_wall_open.json b/etc/assets/wood/models/block/fence_gate_autumn_charcoal_wall_open.json new file mode 100644 index 00000000..22a6d7d6 --- /dev/null +++ b/etc/assets/wood/models/block/fence_gate_autumn_charcoal_wall_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_open", + "textures": { + "texture": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/log_autumn_charcoal.json b/etc/assets/wood/models/block/log_autumn_charcoal.json new file mode 100644 index 00000000..62384fdc --- /dev/null +++ b/etc/assets/wood/models/block/log_autumn_charcoal.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "appalachia:blocks/log_autumn_charcoal_top", + "side": "appalachia:blocks/log_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/log_autumn_charcoal_side.json b/etc/assets/wood/models/block/log_autumn_charcoal_side.json new file mode 100644 index 00000000..99738171 --- /dev/null +++ b/etc/assets/wood/models/block/log_autumn_charcoal_side.json @@ -0,0 +1,7 @@ +{ + "parent": "block/column_side", + "textures": { + "end": "appalachia:blocks/log_autumn_charcoal_top", + "side": "appalachia:blocks/log_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/planks_autumn_charcoal.json b/etc/assets/wood/models/block/planks_autumn_charcoal.json new file mode 100644 index 00000000..9fc7c0eb --- /dev/null +++ b/etc/assets/wood/models/block/planks_autumn_charcoal.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/slab_autumn_charcoal.json b/etc/assets/wood/models/block/slab_autumn_charcoal.json new file mode 100644 index 00000000..225aa3af --- /dev/null +++ b/etc/assets/wood/models/block/slab_autumn_charcoal.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "appalachia:blocks/planks_autumn_charcoal", + "top": "appalachia:blocks/planks_autumn_charcoal", + "side": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/slab_autumn_charcoal_upper.json b/etc/assets/wood/models/block/slab_autumn_charcoal_upper.json new file mode 100644 index 00000000..6af3bd66 --- /dev/null +++ b/etc/assets/wood/models/block/slab_autumn_charcoal_upper.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "appalachia:blocks/planks_autumn_charcoal", + "top": "appalachia:blocks/planks_autumn_charcoal", + "side": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/stairs_autumn_charcoal.json b/etc/assets/wood/models/block/stairs_autumn_charcoal.json new file mode 100644 index 00000000..1a3606ca --- /dev/null +++ b/etc/assets/wood/models/block/stairs_autumn_charcoal.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "appalachia:blocks/planks_autumn_charcoal", + "top": "appalachia:blocks/planks_autumn_charcoal", + "side": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/stairs_autumn_charcoal_inner.json b/etc/assets/wood/models/block/stairs_autumn_charcoal_inner.json new file mode 100644 index 00000000..e302bd13 --- /dev/null +++ b/etc/assets/wood/models/block/stairs_autumn_charcoal_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "appalachia:blocks/planks_autumn_charcoal", + "top": "appalachia:blocks/planks_autumn_charcoal", + "side": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/block/stairs_autumn_charcoal_outer.json b/etc/assets/wood/models/block/stairs_autumn_charcoal_outer.json new file mode 100644 index 00000000..a7705be1 --- /dev/null +++ b/etc/assets/wood/models/block/stairs_autumn_charcoal_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "appalachia:blocks/planks_autumn_charcoal", + "top": "appalachia:blocks/planks_autumn_charcoal", + "side": "appalachia:blocks/planks_autumn_charcoal" + } +} diff --git a/etc/assets/wood/models/item/fence_autumn_charcoal.json b/etc/assets/wood/models/item/fence_autumn_charcoal.json new file mode 100644 index 00000000..90c8da3e --- /dev/null +++ b/etc/assets/wood/models/item/fence_autumn_charcoal.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/fence_autumn_charcoal_inventory" +} diff --git a/etc/assets/wood/models/item/fence_gate_autumn_charcoal.json b/etc/assets/wood/models/item/fence_gate_autumn_charcoal.json new file mode 100644 index 00000000..19725dd0 --- /dev/null +++ b/etc/assets/wood/models/item/fence_gate_autumn_charcoal.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/fence_gate_autumn_charcoal_closed" +} diff --git a/etc/assets/wood/models/item/log_autumn_charcoal.json b/etc/assets/wood/models/item/log_autumn_charcoal.json new file mode 100644 index 00000000..026b3763 --- /dev/null +++ b/etc/assets/wood/models/item/log_autumn_charcoal.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/log_autumn_charcoal" +} diff --git a/etc/assets/wood/models/item/planks_autumn_charcoal.json b/etc/assets/wood/models/item/planks_autumn_charcoal.json new file mode 100644 index 00000000..abd338e7 --- /dev/null +++ b/etc/assets/wood/models/item/planks_autumn_charcoal.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/planks_autumn_charcoal" +} diff --git a/etc/assets/wood/models/item/slab_autumn_charcoal.json b/etc/assets/wood/models/item/slab_autumn_charcoal.json new file mode 100644 index 00000000..586a8cd9 --- /dev/null +++ b/etc/assets/wood/models/item/slab_autumn_charcoal.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/slab_autumn_charcoal" +} diff --git a/etc/assets/wood/models/item/stairs_autumn_charcoal.json b/etc/assets/wood/models/item/stairs_autumn_charcoal.json new file mode 100644 index 00000000..df6149f8 --- /dev/null +++ b/etc/assets/wood/models/item/stairs_autumn_charcoal.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/stairs_autumn_charcoal" +} diff --git a/etc/config/Appalachia/appalachia.cfg b/etc/config/Appalachia/appalachia.cfg index 7d68ef2f..5b0f4615 100644 --- a/etc/config/Appalachia/appalachia.cfg +++ b/etc/config/Appalachia/appalachia.cfg @@ -1,5 +1,77 @@ # Configuration file +"biome ids" { + # [range: 0 ~ 255, default: 40] + I:"Appalachian Mountains Biome ID"=40 + + # [range: 0 ~ 255, default: 48] + I:"Autumn Blue Ridge Forest Biome ID"=48 + + # [range: 0 ~ 255, default: 49] + I:"Autumn Blue Ridge Hills Biome ID"=49 + + # [range: 0 ~ 255, default: 50] + I:"Autumn Blue Ridge Mountains Biome ID"=50 + + # [range: 0 ~ 255, default: 44] + I:"Blue Ridge Beach Biome ID"=44 + + # [range: 0 ~ 255, default: 42] + I:"Blue Ridge Forest Biome ID"=42 + + # [range: 0 ~ 255, default: 43] + I:"Blue Ridge Hills Biome ID"=43 + + # [range: 0 ~ 255, default: 41] + I:"Blue Ridge Mountains Biome ID"=41 + + # [range: 0 ~ 255, default: 45] + I:"Blue Ridge River Biome ID"=45 + + # [range: 0 ~ 255, default: 46] + I:"Prairie Biome ID"=46 + + # [range: 0 ~ 255, default: 47] + I:"Smoky Mountains Biome ID"=47 +} + + +"biome weights" { + # [range: 0 ~ 2147483647, default: 20] + I:"Appalachian Mountains Biome Weight"=20 + + # [range: 0 ~ 2147483647, default: 20] + I:"Autumn Blue Ridge Forest Biome Weight"=20 + + # [range: 0 ~ 2147483647, default: 20] + I:"Autumn Blue Ridge Hills Biome Weight"=20 + + # [range: 0 ~ 2147483647, default: 20] + I:"Autumn Blue Ridge Mountains Biome Weight"=20 + + # [range: 0 ~ 2147483647, default: 0] + I:"Blue Ridge Beach Biome Weight"=0 + + # [range: 0 ~ 2147483647, default: 20] + I:"Blue Ridge Forest Biome Weight"=20 + + # [range: 0 ~ 2147483647, default: 20] + I:"Blue Ridge Hills Biome Weight"=20 + + # [range: 0 ~ 2147483647, default: 20] + I:"Blue Ridge Mountains Biome Weight"=20 + + # [range: 0 ~ 2147483647, default: 0] + I:"Blue Ridge River Biome Weight"=0 + + # [range: 0 ~ 2147483647, default: 20] + I:"Prairie Biome Weight"=20 + + # [range: 0 ~ 2147483647, default: 20] + I:"Smoky Mountains Biome Weight"=20 +} + + debugging { # WARNING: This should only be enabled if you know what you're doing. # [default: false] diff --git a/etc/creative/Appalachia.pspimage b/etc/creative/Appalachia.pspimage new file mode 100644 index 00000000..baacbf18 Binary files /dev/null and b/etc/creative/Appalachia.pspimage differ diff --git a/mod_deps.properties b/mod_deps.properties deleted file mode 100644 index 9ecc026e..00000000 --- a/mod_deps.properties +++ /dev/null @@ -1,8 +0,0 @@ -# mod_deps should be 'after:' (unquoted, semicolon-separated, \escaped for newline, see example below) -#bopver=1.10.2-5.0.0.2067 -#acver=1.10.2-1.9.2.5 -#depstring=after:BiomesOPlenty@[5.0.0.2067,);\ -# after:AbyssalCraftAPI@[1.8,);\ -# after:BiomesYouGo@[3.0.2,);\ -# after:flowercraft;\ -# after:sugiforest diff --git a/src/api/java/biomesoplenty/api/achievement/BOPAchievements.java b/src/api/java/biomesoplenty/api/achievement/BOPAchievements.java new file mode 100644 index 00000000..3c93046a --- /dev/null +++ b/src/api/java/biomesoplenty/api/achievement/BOPAchievements.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package biomesoplenty.api.achievement; + +import net.minecraft.stats.Achievement; + +public class BOPAchievements +{ + public static Achievement obtain_flowers; + public static Achievement obtain_berry; + public static Achievement obtain_coral; + public static Achievement obtain_miners_delight; + public static Achievement obtain_wilted_lily; + public static Achievement eat_shroom_powder; + public static Achievement obtain_thorn; + public static Achievement craft_flax_string; + public static Achievement craft_muddy_pickaxe; + public static Achievement obtain_deathbloom; + public static Achievement obtain_turnip; + public static Achievement grow_sacred_oak; + public static Achievement obtain_honeycomb; + public static Achievement obtain_pixie_dust; + public static Achievement obtain_soul; + public static Achievement obtain_celestial_crystal; + public static Achievement craft_terrestrial_artifact; + public static Achievement craft_ambrosia; + public static Achievement explore_all_biomes; + public static Achievement use_enderporter; + public static Achievement use_biome_finder; + +} diff --git a/src/api/java/biomesoplenty/api/biome/BOPBiomes.java b/src/api/java/biomesoplenty/api/biome/BOPBiomes.java new file mode 100644 index 00000000..a314daf0 --- /dev/null +++ b/src/api/java/biomesoplenty/api/biome/BOPBiomes.java @@ -0,0 +1,146 @@ +/******************************************************************************* + * Copyright 2015-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.biome; + +import java.util.List; + +import com.google.common.base.Optional; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; + +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.Biome; + +public class BOPBiomes +{ + public static final IBiomeRegistry REG_INSTANCE = createRegistry(); + + /**A list of world types where BoP biome decoration does not occur**/ + public static List excludedDecoratedWorldTypes = Lists.newArrayList(); + + // normal biomes which have weights + public static Optional alps = Optional.absent(); + public static Optional bamboo_forest = Optional.absent(); + public static Optional bayou = Optional.absent(); + public static Optional bog = Optional.absent(); + public static Optional boreal_forest = Optional.absent(); + public static Optional brushland = Optional.absent(); + public static Optional chaparral = Optional.absent(); + public static Optional cherry_blossom_grove = Optional.absent(); + public static Optional cold_desert = Optional.absent(); + public static Optional coniferous_forest = Optional.absent(); + public static Optional crag = Optional.absent(); + public static Optional dead_forest = Optional.absent(); + public static Optional dead_swamp = Optional.absent(); + public static Optional eucalyptus_forest = Optional.absent(); + public static Optional fen = Optional.absent(); + public static Optional flower_field = Optional.absent(); + public static Optional grassland = Optional.absent(); + public static Optional grove = Optional.absent(); + public static Optional heathland = Optional.absent(); + public static Optional highland = Optional.absent(); + public static Optional land_of_lakes = Optional.absent(); + public static Optional lavender_fields = Optional.absent(); + public static Optional lush_desert = Optional.absent(); + public static Optional lush_swamp = Optional.absent(); + public static Optional maple_woods = Optional.absent(); + public static Optional marsh = Optional.absent(); + public static Optional meadow = Optional.absent(); + public static Optional moor = Optional.absent(); + public static Optional mountain = Optional.absent(); + public static Optional mystic_grove = Optional.absent(); + public static Optional ominous_woods = Optional.absent(); + public static Optional orchard = Optional.absent(); + public static Optional outback = Optional.absent(); + public static Optional overgrown_cliffs = Optional.absent(); + public static Optional prairie = Optional.absent(); + public static Optional quagmire = Optional.absent(); + public static Optional rainforest = Optional.absent(); + public static Optional redwood_forest = Optional.absent(); + public static Optional sacred_springs = Optional.absent(); + public static Optional seasonal_forest = Optional.absent(); + public static Optional shield = Optional.absent(); + public static Optional shrubland = Optional.absent(); + public static Optional snowy_coniferous_forest = Optional.absent(); + public static Optional snowy_forest = Optional.absent(); + public static Optional steppe = Optional.absent(); + public static Optional temperate_rainforest = Optional.absent(); + public static Optional tropical_rainforest = Optional.absent(); + public static Optional tundra = Optional.absent(); + public static Optional wasteland = Optional.absent(); + public static Optional wetland = Optional.absent(); + public static Optional woodland = Optional.absent(); + public static Optional xeric_shrubland = Optional.absent(); + + // edge-biomes, sub-biomes and mutated-biomes + public static Optional mountain_foothills = Optional.absent(); + public static Optional glacier = Optional.absent(); + public static Optional oasis = Optional.absent(); + public static Optional coral_reef = Optional.absent(); + public static Optional kelp_forest = Optional.absent(); + public static Optional mangrove = Optional.absent(); + public static Optional origin_island = Optional.absent(); + public static Optional tropical_island = Optional.absent(); + public static Optional volcanic_island = Optional.absent(); + public static Optional flower_island = Optional.absent(); + public static Optional gravel_beach = Optional.absent(); + + //Biome extensions + public static IExtendedBiome end_extension; + public static IExtendedBiome mushroom_island_extension; + public static IExtendedBiome plains_extension; + public static IExtendedBiome forest_extension; + public static IExtendedBiome forest_hills_extension; + public static IExtendedBiome jungle_extension; + public static IExtendedBiome jungle_hills_extension; + public static IExtendedBiome desert_extension; + public static IExtendedBiome desert_hills_extension; + public static IExtendedBiome taiga_extension; + public static IExtendedBiome taiga_hills_extension; + public static IExtendedBiome mesa_extension; + public static IExtendedBiome mesa_plateau_extension; + public static IExtendedBiome ice_plains_extension; + public static IExtendedBiome ice_mountains_extension; + public static IExtendedBiome extreme_hills_extension; + public static IExtendedBiome extreme_hills_plus_extension; + public static IExtendedBiome swampland_extension; + public static IExtendedBiome birch_forest_extension; + public static IExtendedBiome birch_forest_hills_extension; + public static IExtendedBiome roofed_forest_extension; + public static IExtendedBiome savanna_extension; + public static IExtendedBiome savanna_plateau_extension; + public static IExtendedBiome ocean_extension; + public static IExtendedBiome cold_taiga_extension; + public static IExtendedBiome cold_taiga_hills_extension; + public static IExtendedBiome mega_taiga_extension; + public static IExtendedBiome mega_taiga_hills_extension; + + private static IBiomeRegistry createRegistry() + { + IBiomeRegistry instance = null; + + try + { + instance = (IBiomeRegistry)Class.forName("biomesoplenty.common.init.ModBiomes").newInstance(); + } + catch (Exception e) + { + e.printStackTrace(); + } + + return instance; + } + + public static interface IBiomeRegistry + { + public IExtendedBiome registerBiome(IExtendedBiome biome, String idName); + public IExtendedBiome getExtendedBiome(Biome biome); + public ImmutableSet getPresentBiomes(); + } +} diff --git a/src/api/java/biomesoplenty/api/biome/BiomeOwner.java b/src/api/java/biomesoplenty/api/biome/BiomeOwner.java new file mode 100644 index 00000000..83d2a60c --- /dev/null +++ b/src/api/java/biomesoplenty/api/biome/BiomeOwner.java @@ -0,0 +1,14 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.biome; + +public enum BiomeOwner +{ + BIOMESOPLENTY, OTHER; +} diff --git a/src/api/java/biomesoplenty/api/biome/IExtendedBiome.java b/src/api/java/biomesoplenty/api/biome/IExtendedBiome.java new file mode 100644 index 00000000..4646f7a6 --- /dev/null +++ b/src/api/java/biomesoplenty/api/biome/IExtendedBiome.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.biome; + +import java.util.Map; + +import biomesoplenty.api.config.IBOPWorldSettings; +import biomesoplenty.api.config.IConfigObj; +import biomesoplenty.api.enums.BOPClimates; +import biomesoplenty.api.generation.GeneratorStage; +import biomesoplenty.api.generation.IGenerationManager; +import biomesoplenty.api.generation.IGenerator; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.Biome; + +public interface IExtendedBiome +{ + public void applySettings(IBOPWorldSettings settings); + public void configure(IConfigObj conf); + + public BiomeOwner getBiomeOwner(); + public void addGenerator(String name, GeneratorStage stage, IGenerator generator); + public IGenerationManager getGenerationManager(); + public Map getWeightMap(); + public void clearWeights(); + public void addWeight(BOPClimates climate, int weight); + + public ResourceLocation getBeachLocation(); + + /**Get the base biome associated with this extension**/ + public Biome getBaseBiome(); + public ResourceLocation getResourceLocation(); +} diff --git a/src/api/java/biomesoplenty/api/block/BOPBlocks.java b/src/api/java/biomesoplenty/api/block/BOPBlocks.java new file mode 100644 index 00000000..837ade57 --- /dev/null +++ b/src/api/java/biomesoplenty/api/block/BOPBlocks.java @@ -0,0 +1,158 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.block; + +import net.minecraft.block.Block; +import net.minecraftforge.fluids.Fluid; + +public class BOPBlocks +{ + public static Block bamboo_thatching; + public static Block ash_block; + public static Block bamboo; + public static Block coral; + public static Block seaweed; + public static Block gem_block; + public static Block gem_ore; + public static Block hive; + public static Block mushroom; + public static Block stone; + public static Block biome_block; + + public static Block flower_0; + public static Block flower_1; + public static Block log_0; + public static Block log_1; + public static Block log_2; + public static Block log_3; + public static Block log_4; + public static Block leaves_0; + public static Block leaves_1; + public static Block leaves_2; + public static Block leaves_3; + public static Block leaves_4; + public static Block leaves_5; + public static Block leaves_6; + public static Block sapling_0; + public static Block sapling_1; + public static Block sapling_2; + // TODO fruit tree leaves and saplings + public static Block planks_0; + public static Block wood_slab_0; + public static Block wood_slab_1; + public static Block double_wood_slab_0; + public static Block double_wood_slab_1; + public static Block sacred_oak_stairs; + public static Block cherry_stairs; + public static Block umbran_stairs; + public static Block fir_stairs; + public static Block ethereal_stairs; + public static Block magic_stairs; + public static Block mangrove_stairs; + public static Block palm_stairs; + public static Block redwood_stairs; + public static Block willow_stairs; + public static Block pine_stairs; + public static Block hellbark_stairs; + public static Block jacaranda_stairs; + public static Block mahogany_stairs; + public static Block ebony_stairs; + public static Block eucalyptus_stairs; + public static Block sacred_oak_fence; + public static Block cherry_fence; + public static Block umbran_fence; + public static Block fir_fence; + public static Block ethereal_fence; + public static Block magic_fence; + public static Block mangrove_fence; + public static Block palm_fence; + public static Block redwood_fence; + public static Block willow_fence; + public static Block pine_fence; + public static Block hellbark_fence; + public static Block jacaranda_fence; + public static Block mahogany_fence; + public static Block ebony_fence; + public static Block eucalyptus_fence; + public static Block sacred_oak_fence_gate; + public static Block cherry_fence_gate; + public static Block umbran_fence_gate; + public static Block fir_fence_gate; + public static Block ethereal_fence_gate; + public static Block magic_fence_gate; + public static Block mangrove_fence_gate; + public static Block palm_fence_gate; + public static Block redwood_fence_gate; + public static Block willow_fence_gate; + public static Block pine_fence_gate; + public static Block hellbark_fence_gate; + public static Block jacaranda_fence_gate; + public static Block mahogany_fence_gate; + public static Block ebony_fence_gate; + public static Block eucalyptus_fence_gate; + public static Block sacred_oak_door; + public static Block cherry_door; + public static Block umbran_door; + public static Block fir_door; + public static Block ethereal_door; + public static Block magic_door; + public static Block mangrove_door; + public static Block palm_door; + public static Block redwood_door; + public static Block willow_door; + public static Block pine_door; + public static Block hellbark_door; + public static Block jacaranda_door; + public static Block mahogany_door; + public static Block ebony_door; + public static Block eucalyptus_door; + + public static Block mud; + public static Block turnip_block; + public static Block flesh; + public static Block grass; + public static Block grass_path; + public static Block waterlily; + public static Block dirt; + public static Block farmland_0; + public static Block farmland_1; + public static Block stone_formations; + public static Block hard_ice; + public static Block dried_sand; + public static Block crag_rock; + public static Block mud_brick_block; + public static Block crystal; + public static Block other_slab; + public static Block double_other_slab; + + public static Block mud_brick_stairs; + + public static Block flower_vine; + public static Block ivy; + public static Block tree_moss; + + public static Block plant_0; + public static Block plant_1; + public static Block double_plant; + + public static Block honey_block; + public static Block jelled_poison; + public static Block terrarium; + + public static Block sand; + public static Fluid sand_fluid; + public static Block honey; + public static Fluid honey_fluid; + public static Block blood; + public static Fluid blood_fluid; + public static Block poison; + public static Fluid poison_fluid; + public static Block hot_spring_water; + public static Fluid hot_spring_water_fluid; +} diff --git a/src/api/java/biomesoplenty/api/block/BlockQueries.java b/src/api/java/biomesoplenty/api/block/BlockQueries.java new file mode 100644 index 00000000..8a36fc4c --- /dev/null +++ b/src/api/java/biomesoplenty/api/block/BlockQueries.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.block; + +public class BlockQueries +{ + public static IBlockPosQuery anything; + public static IBlockPosQuery nothing; + public static IBlockPosQuery hasWater; + public static IBlockPosQuery airAbove; + public static IBlockPosQuery airBelow; + public static IBlockPosQuery waterCovered; + public static IBlockPosQuery breakable; + public static IBlockPosQuery air; + public static IBlockPosQuery airOrLeaves; + public static IBlockPosQuery surfaceBlocks; + public static IBlockPosQuery groundBlocks; + public static IBlockPosQuery solid; + public static IBlockPosQuery replaceable; + + public static IBlockPosQuery fertile; + public static IBlockPosQuery fertileOrNetherrack; + public static IBlockPosQuery sustainsCave; + public static IBlockPosQuery sustainsNether; + public static IBlockPosQuery endish; + public static IBlockPosQuery hellish; + public static IBlockPosQuery litFertile; + public static IBlockPosQuery litBeach; + public static IBlockPosQuery litFertileWaterside; + public static IBlockPosQuery litSand; + public static IBlockPosQuery litDry; + public static IBlockPosQuery litFertileOrDry; + public static IBlockPosQuery spectralMoss; + public static IBlockPosQuery fertileSeaBed; + public static IBlockPosQuery underwater; + public static IBlockPosQuery suitableForReed; + public static IBlockPosQuery rootsCanDigThrough; +} \ No newline at end of file diff --git a/src/api/java/biomesoplenty/api/block/IBlockPosQuery.java b/src/api/java/biomesoplenty/api/block/IBlockPosQuery.java new file mode 100644 index 00000000..2a79fe7b --- /dev/null +++ b/src/api/java/biomesoplenty/api/block/IBlockPosQuery.java @@ -0,0 +1,17 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package biomesoplenty.api.block; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +// for queries on a particular block position in the world +public interface IBlockPosQuery +{ + public boolean matches(World world, BlockPos pos); +} \ No newline at end of file diff --git a/src/api/java/biomesoplenty/api/config/IBOPWorldSettings.java b/src/api/java/biomesoplenty/api/config/IBOPWorldSettings.java new file mode 100644 index 00000000..994b34a8 --- /dev/null +++ b/src/api/java/biomesoplenty/api/config/IBOPWorldSettings.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package biomesoplenty.api.config; + +public interface IBOPWorldSettings +{ + boolean isEnabled(GeneratorType type); + + public static enum GeneratorType + { + GEMS, SOILS, TREES, GRASSES, FOLIAGE, FLOWERS, PLANTS, WATER_PLANTS, MUSHROOMS, + ROCK_FORMATIONS, POISON_IVY, FLAX, BERRY_BUSHES, THORNS, QUICKSAND, LIQUID_POISON, HOT_SPRINGS, + NETHER_HIVES, NETHER_PLANTS, END_FEATURES; + } +} diff --git a/src/api/java/biomesoplenty/api/config/IConfigObj.java b/src/api/java/biomesoplenty/api/config/IConfigObj.java new file mode 100644 index 00000000..0309a0ad --- /dev/null +++ b/src/api/java/biomesoplenty/api/config/IConfigObj.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package biomesoplenty.api.config; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import biomesoplenty.api.block.IBlockPosQuery; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.ResourceLocation; + +public interface IConfigObj +{ + public void addMessage(String message); + public void addMessage(String extraPrefix, String message); + public List flushMessages(); + public boolean isEmpty(); + public boolean has(String name); + public Set getKeys(); + + public IConfigObj getObject(String name); + public ArrayList getObjectArray(String name); + public IConfigObj getObject(String name, boolean warnIfMissing); + public ArrayList getObjectArray(String name, boolean warnIfMissing); + + // Use the methods below when you want to obtain a value from a config file, if it is present, but you have a default value to use if it isn't + // No warning messages will be logged using these methods if the value is missing + public Boolean getBool(String name, Boolean defaultVal); + public String getString(String name, String defaultVal); + public Integer getInt(String name, Integer defaultVal); + public Float getFloat(String name, Float defaultVal); + public IBlockState getBlockState(String name, IBlockState defaultVal); + public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal); + public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal); + public E getEnum(String name, E defaultVal, Class clazz); + + // Use the methods below when you want to obtain a value from a config file which SHOULD be present + // If the value is missing, a warning message is logged, and null is returned + public Boolean getBool(String name); + public String getString(String name); + public Integer getInt(String name); + public Float getFloat(String name); + public IBlockState getBlockState(String name); + public IBlockPosQuery getBlockPosQuery(String name); + public ResourceLocation getResourceLocation(String name); + public E getEnum(String name, Class clazz); + + // Use the methods below when you want to obtain an array of values from a config file, if it is present, but you have a default value to use if it isn't + // No warning messages will be logged using these methods if the value is missing + public ArrayList getBoolArray(String name, ArrayList defaultVal); + public ArrayList getStringArray(String name, ArrayList defaultVal); + public ArrayList getIntArray(String name, ArrayList defaultVal); + public ArrayList getFloatArray(String name, ArrayList defaultVal); + public ArrayList getBlockStateArray(String name, ArrayList defaultVal); + public ArrayList getBlockPosQueryArray(String name, ArrayList defaultVal); + public ArrayList getResourceLocationArray(String name, ArrayList defaultVal); + public ArrayList getEnumArray(String name, ArrayList defaultVal, Class clazz); + + // Use the methods below when you want to obtain an array of values from a config file which SHOULD be present + // If the value is missing, a warning message is logged, and null is returned + public ArrayList getBoolArray(String name); + public ArrayList getStringArray(String name); + public ArrayList getIntArray(String name); + public ArrayList getFloatArray(String name); + public ArrayList getBlockStateArray(String name); + public ArrayList getBlockPosQueryArray(String name); + public ArrayList getResourceLocationArray(String name); + public ArrayList getEnumArray(String name, Class clazz); + + +} \ No newline at end of file diff --git a/src/api/java/biomesoplenty/api/enums/BOPClimates.java b/src/api/java/biomesoplenty/api/enums/BOPClimates.java new file mode 100644 index 00000000..42be2738 --- /dev/null +++ b/src/api/java/biomesoplenty/api/enums/BOPClimates.java @@ -0,0 +1,155 @@ +package biomesoplenty.api.enums; + +import java.util.ArrayList; +import java.util.Iterator; + +import biomesoplenty.api.generation.BOPGenLayer; +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; +import net.minecraftforge.common.BiomeManager.BiomeType; + +public enum BOPClimates { + + ICE_CAP (BiomeType.ICY), + TUNDRA (BiomeType.ICY), + BOREAL (BiomeType.COOL), + COLD_SWAMP (BiomeType.COOL), + WET_TEMPERATE (BiomeType.WARM), + DRY_TEMPERATE (BiomeType.WARM), + COOL_TEMPERATE (BiomeType.COOL), + WARM_TEMPERATE (BiomeType.WARM), + HOT_SWAMP (BiomeType.WARM), + TROPICAL (BiomeType.DESERT), + MEDITERANEAN (BiomeType.WARM), + SAVANNA (BiomeType.DESERT), + HOT_DESERT (BiomeType.DESERT), + WASTELAND (BiomeType.DESERT); + + public final BiomeType biomeType; + private int totalLandBiomesWeight; + private ArrayList landBiomes = new ArrayList(); + + private BOPClimates(BiomeType biomeType) + { + this.biomeType = biomeType; + } + + public BOPClimates addLandBiome(int weight, Biome biome) + { + return this.addLandBiome(new WeightedBiomeEntry(weight, biome)); + } + + public BOPClimates addLandBiome(WeightedBiomeEntry biomeEntry) + { + this.totalLandBiomesWeight += biomeEntry.weight; + this.landBiomes.add(biomeEntry); + return this; + } + + public Biome getRandomLandBiome(BOPGenLayer layer) + { + int weight = layer.nextInt(this.totalLandBiomesWeight); + Iterator iterator = this.landBiomes.iterator(); + WeightedBiomeEntry item; + do + { + item = iterator.next(); + weight -= item.weight; + } + while (weight >= 0); + return item.biome; + } + + public Biome getRandomOceanBiome(BOPGenLayer layer, boolean deep) + { + switch (this) + { + case ICE_CAP: + return (layer.nextInt(2)==0) ? this.getRandomLandBiome(layer) : Biomes.FROZEN_OCEAN; + case TUNDRA: case BOREAL: + return (layer.nextInt(3)!=0) ? (deep ? Biomes.DEEP_OCEAN : Biomes.OCEAN) : Biomes.FROZEN_OCEAN; + default: + return (deep ? Biomes.DEEP_OCEAN : Biomes.OCEAN); + } + } + + static + { + // set up vanilla biomes + + BOPClimates.ICE_CAP.addLandBiome(10,Biomes.ICE_PLAINS); + BOPClimates.TUNDRA.addLandBiome(10, Biomes.COLD_TAIGA).addLandBiome(10, Biomes.EXTREME_HILLS); + BOPClimates.BOREAL.addLandBiome(5, Biomes.REDWOOD_TAIGA).addLandBiome(5, Biomes.EXTREME_HILLS).addLandBiome(20, Biomes.TAIGA); + BOPClimates.COLD_SWAMP.addLandBiome(5, Biomes.SWAMPLAND); + BOPClimates.WET_TEMPERATE.addLandBiome(20, Biomes.ROOFED_FOREST).addLandBiome(5, Biomes.FOREST); + BOPClimates.DRY_TEMPERATE.addLandBiome(5, Biomes.PLAINS); + BOPClimates.COOL_TEMPERATE.addLandBiome(15, Biomes.FOREST).addLandBiome(10, Biomes.BIRCH_FOREST); + BOPClimates.WARM_TEMPERATE.addLandBiome(20, Biomes.PLAINS).addLandBiome(5, Biomes.BIRCH_FOREST); + BOPClimates.HOT_SWAMP.addLandBiome(5, Biomes.SWAMPLAND); + BOPClimates.TROPICAL.addLandBiome(15, Biomes.JUNGLE); + BOPClimates.MEDITERANEAN.addLandBiome(5, Biomes.PLAINS); + BOPClimates.SAVANNA.addLandBiome(20, Biomes.SAVANNA); + BOPClimates.HOT_DESERT.addLandBiome(30, Biomes.DESERT).addLandBiome(10, Biomes.MESA_CLEAR_ROCK); + BOPClimates.WASTELAND.addLandBiome(1, Biomes.DESERT); + } + + + + + + private static BOPClimates[] values = BOPClimates.values(); + + public static BOPClimates lookup(int i) {return values[i];} + + // map temperature and rainfall to climates + // temperature values from 0 (cold) to 8 (hot) and rainfall values from 0 (wet) to 11 (dry), index is (temperatureValue * 12) + rainfallValue + // we will contrive to make any combination equally likely, so the overall rarity of each climate is in proportion to the number of times it appears in the array + private static final BOPClimates[] climateMapping = new BOPClimates[] { + // 0 1 2 3 4 5 6 7 8 9 10 11 + TUNDRA, TUNDRA, TUNDRA, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, ICE_CAP, // 0 + BOREAL, BOREAL, BOREAL, TUNDRA, TUNDRA, TUNDRA, TUNDRA, TUNDRA, TUNDRA, TUNDRA, TUNDRA, TUNDRA, // 1 + COLD_SWAMP, COLD_SWAMP, COLD_SWAMP, BOREAL, BOREAL, BOREAL, BOREAL, BOREAL, BOREAL, BOREAL, BOREAL, BOREAL, // 2 + COLD_SWAMP, COLD_SWAMP, COLD_SWAMP, WET_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, DRY_TEMPERATE, DRY_TEMPERATE, DRY_TEMPERATE, // 3 + COLD_SWAMP, WET_TEMPERATE, WET_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, COOL_TEMPERATE, DRY_TEMPERATE, DRY_TEMPERATE, DRY_TEMPERATE, DRY_TEMPERATE, // 4 + WET_TEMPERATE, WET_TEMPERATE, WET_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, DRY_TEMPERATE, SAVANNA, SAVANNA, // 5 + HOT_SWAMP, HOT_SWAMP, HOT_SWAMP, WET_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, WARM_TEMPERATE, MEDITERANEAN, MEDITERANEAN, SAVANNA, HOT_DESERT, HOT_DESERT, // 6 + TROPICAL, TROPICAL, HOT_SWAMP, HOT_SWAMP, WET_TEMPERATE, WARM_TEMPERATE, MEDITERANEAN, MEDITERANEAN, SAVANNA, HOT_DESERT, HOT_DESERT, WASTELAND, // 7 + TROPICAL, TROPICAL, TROPICAL, HOT_SWAMP, HOT_SWAMP, MEDITERANEAN, MEDITERANEAN, SAVANNA, HOT_DESERT, HOT_DESERT, WASTELAND, WASTELAND // 8 + }; + + public static int[] getClimateMappingInts() + { + // 9 temperature values, 12 rainfall values, 12 * 9 = 108 + int[] out = new int[108]; + for (int i = 0; i < 108; i++) + { + out[i] = climateMapping[i].ordinal(); + } + return out; + } + + public static class WeightedBiomeEntry + { + public final int weight; + public final Biome biome; + + public WeightedBiomeEntry(int weight, Biome biome) + { + this.weight = weight; + this.biome = biome; + } + } + + // for debugging purposes + public static void printWeights() + { + for (BOPClimates climate : BOPClimates.values()) + { + for (WeightedBiomeEntry entry : climate.landBiomes) + { + System.out.println(climate.name()+" "+entry.biome.getBiomeName()+" "+entry.weight); + } + } + } + +} diff --git a/src/api/java/biomesoplenty/api/generation/BOPGenLayer.java b/src/api/java/biomesoplenty/api/generation/BOPGenLayer.java new file mode 100644 index 00000000..a49a7750 --- /dev/null +++ b/src/api/java/biomesoplenty/api/generation/BOPGenLayer.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright 2015-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.generation; +import net.minecraft.world.gen.layer.GenLayer; + +public abstract class BOPGenLayer extends GenLayer +{ + public BOPGenLayer(long seed) { + super(seed); + } + + // make nextInt public + @Override + public int nextInt(int a) + { + return super.nextInt(a); + } +} \ No newline at end of file diff --git a/src/api/java/biomesoplenty/api/generation/BOPGeneratorBase.java b/src/api/java/biomesoplenty/api/generation/BOPGeneratorBase.java new file mode 100644 index 00000000..bd437126 --- /dev/null +++ b/src/api/java/biomesoplenty/api/generation/BOPGeneratorBase.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright 2015-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.generation; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public abstract class BOPGeneratorBase extends WorldGenerator implements IGenerator +{ + protected final String identifier; + protected String name; + protected GeneratorStage stage; + protected float amountPerChunk; + + protected BOPGeneratorBase(float amountPerChunk) + { + this.identifier = Generators.registry.getIdentifier((Class)this.getClass()); + + if (this.identifier == null) + { + throw new RuntimeException("The identifier for " + this.getClass().getCanonicalName() + " cannot be null!"); + } + + this.amountPerChunk = amountPerChunk; + } + + + protected static abstract class InnerBuilder, G extends BOPGeneratorBase> + { + protected T self() {return (T)this;} + protected float amountPerChunk; + public T amountPerChunk(float amountPerChunk) {this.amountPerChunk = amountPerChunk; return this.self();} + public abstract G create(); + } + + + @Override + public void setName(String name) + { + this.name = name; + } + + @Override + public void setStage(GeneratorStage stage) + { + this.stage = stage; + } + + @Override + public String getName() + { + return this.name; + } + + @Override + public GeneratorStage getStage() + { + return this.stage; + } + + @Override + public final String getIdentifier() + { + return this.identifier; + } + + public abstract BlockPos getScatterY(World world, Random random, int x, int z); + + public int getAmountToScatter(Random random) + { + int amount = MathHelper.floor_float(this.amountPerChunk); + float remainder = this.amountPerChunk - amount; + if (random.nextFloat() < remainder) {amount++;} + return amount; + } + + @Override + public void scatter(World world, Random random, BlockPos pos) + { + int amount = this.getAmountToScatter(random); + for (int i = 0; i < amount; i++) + { + int x = pos.getX() + random.nextInt(16) + 8; + int z = pos.getZ() + random.nextInt(16) + 8; + generate(world, random, this.getScatterY(world, random, x, z)); + } + } +} diff --git a/src/api/java/biomesoplenty/api/generation/GeneratorStage.java b/src/api/java/biomesoplenty/api/generation/GeneratorStage.java new file mode 100644 index 00000000..f303184a --- /dev/null +++ b/src/api/java/biomesoplenty/api/generation/GeneratorStage.java @@ -0,0 +1,110 @@ +/******************************************************************************* + * Copyright 2015-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.generation; + +import java.util.EnumMap; + +import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate; + +import com.google.common.collect.Maps; +import com.google.gson.annotations.SerializedName; + +public enum GeneratorStage +{ + @SerializedName("pre") + PRE(null), + @SerializedName("big_shroom") + BIG_SHROOM(Decorate.EventType.BIG_SHROOM), + @SerializedName("cactus") + CACTUS(Decorate.EventType.CACTUS), + @SerializedName("clay") + CLAY(Decorate.EventType.CLAY), + @SerializedName("dead_bush") + DEAD_BUSH(Decorate.EventType.DEAD_BUSH), + //@SerializedName("desert_well") + //DESERT_WELL(Decorate.EventType.DESERT_WELL), + @SerializedName("lilypad") + LILYPAD(Decorate.EventType.LILYPAD), + @SerializedName("flowers") + FLOWERS(Decorate.EventType.FLOWERS), + //@SerializedName("fossil") + //FOSSIL(Decorate.EventType.FOSSIL), + @SerializedName("grass") + GRASS(Decorate.EventType.GRASS), + //@SerializedName("ice") + //ICE(Decorate.EventType.ICE), + @SerializedName("lake_water") + LAKE_WATER(Decorate.EventType.LAKE_WATER), + @SerializedName("lake_lava") + LAKE_LAVA(Decorate.EventType.LAKE_LAVA), + @SerializedName("pumpkin") + PUMPKIN(Decorate.EventType.PUMPKIN), + @SerializedName("reed") + REED(Decorate.EventType.REED), + //@SerializedName("rock") + //ROCK(Decorate.EventType.ROCK), + @SerializedName("sand") + SAND(Decorate.EventType.SAND), + @SerializedName("sand_pass_2") + SAND_PASS2(Decorate.EventType.SAND_PASS2), + @SerializedName("shroom") + SHROOM(Decorate.EventType.SHROOM), + @SerializedName("tree") + TREE(Decorate.EventType.TREE), + @SerializedName("post") + POST(null), + @SerializedName("parent") + PARENT(null), + @SerializedName("ore_pre") + ORE_PRE(null), + @SerializedName("ore_post") + ORE_POST(null); + + private Decorate.EventType decorateType; + + private GeneratorStage(Decorate.EventType decorateType) + { + this.decorateType = decorateType; + } + + public Decorate.EventType getDecorateType() + { + return this.decorateType; + } + + private static final EnumMap decorateTypeMapper = Maps.newEnumMap(Decorate.EventType.class); + static + { + decorateTypeMapper.put(Decorate.EventType.BIG_SHROOM, BIG_SHROOM); + decorateTypeMapper.put(Decorate.EventType.CACTUS, CACTUS); + decorateTypeMapper.put(Decorate.EventType.CLAY, CLAY); + decorateTypeMapper.put(Decorate.EventType.DEAD_BUSH, DEAD_BUSH); + //decorateTypeMapper.put(Decorate.EventType.DESERT_WELL, DESERT_WELL); + decorateTypeMapper.put(Decorate.EventType.LILYPAD, LILYPAD); + decorateTypeMapper.put(Decorate.EventType.FLOWERS, FLOWERS); + //decorateTypeMapper.put(Decorate.EventType.FOSSIL, FOSSIL); + decorateTypeMapper.put(Decorate.EventType.GRASS, GRASS); + //decorateTypeMapper.put(Decorate.EventType.ICE, ICE); + decorateTypeMapper.put(Decorate.EventType.LAKE_WATER, LAKE_WATER); + decorateTypeMapper.put(Decorate.EventType.LAKE_LAVA, LAKE_LAVA); + decorateTypeMapper.put(Decorate.EventType.PUMPKIN, PUMPKIN); + decorateTypeMapper.put(Decorate.EventType.REED, REED); + //decorateTypeMapper.put(Decorate.EventType.ROCK, ROCK); + decorateTypeMapper.put(Decorate.EventType.SAND, SAND); + decorateTypeMapper.put(Decorate.EventType.SAND_PASS2, SAND_PASS2); + decorateTypeMapper.put(Decorate.EventType.SHROOM, SHROOM); + decorateTypeMapper.put(Decorate.EventType.TREE, TREE); + } + + public static GeneratorStage mapDecorateType(Decorate.EventType decorateType) + { + //Somewhat of a hack, requires the ordering of our enum to be the same as the decorate event + return decorateType != Decorate.EventType.CUSTOM ? decorateTypeMapper.get(decorateType) : null; + } +} diff --git a/src/api/java/biomesoplenty/api/generation/Generators.java b/src/api/java/biomesoplenty/api/generation/Generators.java new file mode 100644 index 00000000..2fd103b1 --- /dev/null +++ b/src/api/java/biomesoplenty/api/generation/Generators.java @@ -0,0 +1,18 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package biomesoplenty.api.generation; + +import net.minecraft.world.gen.layer.GenLayer; + +public class Generators +{ + public static IGeneratorRegistry registry; + + public static GenLayer biomeGenLayer; + public static GenLayer biomeIndexLayer; +} diff --git a/src/api/java/biomesoplenty/api/generation/IGenerationManager.java b/src/api/java/biomesoplenty/api/generation/IGenerationManager.java new file mode 100644 index 00000000..b2c31a5d --- /dev/null +++ b/src/api/java/biomesoplenty/api/generation/IGenerationManager.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package biomesoplenty.api.generation; + +import com.google.common.collect.ImmutableCollection; + +import biomesoplenty.api.config.IConfigObj; + +public interface IGenerationManager +{ + void addGenerator(String name, GeneratorStage stage, IGenerator generator); + ImmutableCollection getGeneratorsForStage(GeneratorStage stage); + void removeGenerator(String name); + IGenerator getGenerator(String name); + void configureWith(String name, IConfigObj conf); +} diff --git a/src/api/java/biomesoplenty/api/generation/IGenerator.java b/src/api/java/biomesoplenty/api/generation/IGenerator.java new file mode 100644 index 00000000..416b072f --- /dev/null +++ b/src/api/java/biomesoplenty/api/generation/IGenerator.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.generation; + +import java.util.Random; + +import biomesoplenty.api.config.IConfigObj; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public interface IGenerator +{ + public void scatter(World world, Random random, BlockPos pos); + public boolean generate(World world, Random random, BlockPos pos); + + public void setStage(GeneratorStage stage); + public void setName(String name); + + /**A unique name used to classify the purpose of a generator. For example, emeralds and ruby use the + * same generator (and thus, have the same identifier) but have differing names. + */ + public String getName(); + /**The identifier for this generator should be consistent across all instances of the same type*/ + public String getIdentifier(); + public GeneratorStage getStage(); + + public static interface IGeneratorBuilder + { + public T create(); + } + + public void configure(IConfigObj conf); +} diff --git a/src/api/java/biomesoplenty/api/generation/IGeneratorRegistry.java b/src/api/java/biomesoplenty/api/generation/IGeneratorRegistry.java new file mode 100644 index 00000000..7c9bed99 --- /dev/null +++ b/src/api/java/biomesoplenty/api/generation/IGeneratorRegistry.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package biomesoplenty.api.generation; + +import biomesoplenty.api.config.IConfigObj; + +public interface IGeneratorRegistry +{ + void registerGenerator(String identifier, Class generatorClass, IGenerator.IGeneratorBuilder builder); + String getIdentifier(Class generatorClass); + Class getGeneratorClass(String identifier); + IGenerator.IGeneratorBuilder getGeneratorBuilder(String identifier); + boolean generatorExists(String identifier); + IGenerator createGenerator(IConfigObj conf); +} diff --git a/src/api/java/biomesoplenty/api/item/BOPItems.java b/src/api/java/biomesoplenty/api/item/BOPItems.java new file mode 100644 index 00000000..b426300f --- /dev/null +++ b/src/api/java/biomesoplenty/api/item/BOPItems.java @@ -0,0 +1,117 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.item; + +import net.minecraft.item.Item; + +public class BOPItems +{ + + public static Item berries; + public static Item shroompowder; + public static Item peach; + public static Item saladfruit; + public static Item saladveggie; + public static Item saladshroom; + public static Item earth; + public static Item persimmon; + public static Item filled_honeycomb; + public static Item ambrosia; + public static Item turnip; + public static Item pear; + public static Item ricebowl; + + public static Item fleshchunk; + public static Item mudball; + public static Item turnip_seeds; + public static Item crystal_shard; + public static Item terrestrial_artifact; + public static Item flax_string; + public static Item honeycomb; + public static Item gem; + public static Item ash; + public static Item mud_brick; + public static Item blue_dye; + public static Item brown_dye; + public static Item green_dye; + public static Item white_dye; + public static Item black_dye; + public static Item soul; + public static Item pixie_dust; + public static Item ichor; + public static Item pinecone; + public static Item other_slab; + + public static Item sacred_oak_door; + public static Item cherry_door; + public static Item umbran_door; + public static Item fir_door; + public static Item ethereal_door; + public static Item magic_door; + public static Item mangrove_door; + public static Item palm_door; + public static Item redwood_door; + public static Item willow_door; + public static Item pine_door; + public static Item hellbark_door; + public static Item jacaranda_door; + public static Item mahogany_door; + public static Item ebony_door; + public static Item eucalyptus_door; + + public static Item wood_slab_0; + public static Item wood_slab_1; + + public static Item wading_boots; + public static Item flippers; + public static Item plain_flower_band; + public static Item lush_flower_band; + public static Item exotic_flower_band; + public static Item dull_flower_band; + + public static Item mud_helmet; + public static Item mud_chestplate; + public static Item mud_leggings; + public static Item mud_boots; + + public static Item mud_axe; + public static Item mud_hoe; + public static Item mud_pickaxe; + public static Item mud_shovel; + public static Item mud_sword; + + public static Item mud_scythe; + public static Item wood_scythe; + public static Item stone_scythe; + public static Item iron_scythe; + public static Item gold_scythe; + public static Item diamond_scythe; + + public static Item biome_finder; + public static Item biome_essence; + public static Item enderporter; + public static Item flower_basket; + public static Item jar_empty; + public static Item jar_filled; + public static Item sand_bucket; + public static Item honey_bucket; + public static Item blood_bucket; + public static Item poison_bucket; + public static Item hot_spring_water_bucket; + + public static Item record_wanderer; + public static Item record_corruption; + + public static Item spawn_egg; + + // TODO: public static Item ancientStaff; + // TODO: public static Item bop_bucket; + + +} \ No newline at end of file diff --git a/src/api/java/biomesoplenty/api/item/BOPMaterials.java b/src/api/java/biomesoplenty/api/item/BOPMaterials.java new file mode 100644 index 00000000..d1f82310 --- /dev/null +++ b/src/api/java/biomesoplenty/api/item/BOPMaterials.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.item; + +import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemArmor.ArmorMaterial; + +public class BOPMaterials +{ + public static ArmorMaterial wading_boots_material; + public static ArmorMaterial flippers_material; + public static ArmorMaterial plain_flower_band_material; + public static ArmorMaterial lush_flower_band_material; + public static ArmorMaterial exotic_flower_band_material; + public static ArmorMaterial dull_flower_band_material; + + public static ArmorMaterial mud_armor_material; + public static ToolMaterial mud_tool_material; +} \ No newline at end of file diff --git a/src/api/java/biomesoplenty/api/particle/BOPParticleTypes.java b/src/api/java/biomesoplenty/api/particle/BOPParticleTypes.java new file mode 100644 index 00000000..8390b4b9 --- /dev/null +++ b/src/api/java/biomesoplenty/api/particle/BOPParticleTypes.java @@ -0,0 +1,6 @@ +package biomesoplenty.api.particle; + +public enum BOPParticleTypes +{ + PIXIETRAIL, MUD, PLAYER_TRAIL; +} \ No newline at end of file diff --git a/src/api/java/biomesoplenty/api/potion/BOPPotions.java b/src/api/java/biomesoplenty/api/potion/BOPPotions.java new file mode 100644 index 00000000..4b3659d1 --- /dev/null +++ b/src/api/java/biomesoplenty/api/potion/BOPPotions.java @@ -0,0 +1,18 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.api.potion; + +import net.minecraft.potion.Potion; + +public class BOPPotions +{ + public static Potion paralysis; + public static Potion possession; + +} \ No newline at end of file diff --git a/src/api/java/biomesoplenty/api/sound/BOPSounds.java b/src/api/java/biomesoplenty/api/sound/BOPSounds.java new file mode 100644 index 00000000..cc9ee33e --- /dev/null +++ b/src/api/java/biomesoplenty/api/sound/BOPSounds.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * Copyright 2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ +package biomesoplenty.api.sound; + +import net.minecraft.util.SoundEvent; + +public class BOPSounds +{ + public static SoundEvent pixie_ambient; + public static SoundEvent pixie_hurt; + public static SoundEvent wasp_ambient; + public static SoundEvent wasp_hurt; + public static SoundEvent records_corruption; + public static SoundEvent records_wanderer; +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/APIUtils.java b/src/api/java/com/shinoow/abyssalcraft/api/APIUtils.java new file mode 100644 index 00000000..4edb507b --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/APIUtils.java @@ -0,0 +1,84 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +import com.shinoow.abyssalcraft.api.item.ICrystal; +import com.shinoow.abyssalcraft.api.recipe.EngraverRecipes; + +/** + * Utilities for the AbyssalCraft API + * @author shinoow + * + * @since 1.4 + */ +public class APIUtils { + + /** + * Checks if the ItemStack is a Crystal + * @param item ItemStack to check + * @return True if the ItemStack is a Crystal, otherwise false + * + * @since 1.4 + */ + public static boolean isCrystal(ItemStack item){ + if(item.getItem() instanceof ICrystal) + return true; + for(ItemStack crystal: AbyssalCraftAPI.getCrystals()) + if(crystal.getItem() == item.getItem() && (crystal.getItemDamage() == OreDictionary.WILDCARD_VALUE + || crystal.getItemDamage() == item.getItemDamage())) + return true; + return false; + } + + /** + * Checks if the ItemStack is a Coin + * @param item ItemStack to check + * @return True if the ItemStack is a Coin, otherwise false + * + * @since 1.5 + */ + public static boolean isCoin(ItemStack item){ + for(ItemStack coin : EngraverRecipes.instance().getCoinList()) + if(coin.getItem() == item.getItem() && (coin.getItemDamage() == OreDictionary.WILDCARD_VALUE + || coin.getItemDamage() == item.getItemDamage())) + return true; + return false; + } + + /** + * Converts an Object to an ItemStack, if possible + * @param obj Object to convert + * @return An ItemStack, or a ClassCastException if not possible + */ + public static ItemStack convertToStack(Object obj){ + if(obj == null) + return (ItemStack)obj; + else if(obj instanceof ItemStack) + return ((ItemStack)obj).copy(); + else if(obj instanceof Item) + return new ItemStack((Item)obj); + else if(obj instanceof Block) + return new ItemStack((Block)obj); + else if(obj instanceof String) + return OreDictionary.getOres((String)obj).get(0).copy(); + else if(obj instanceof List) + return ((ItemStack)((List) obj).get(0)).copy(); + else throw new ClassCastException("Not a Item, Block, ItemStack, String or List of ItemStacks!"); + } +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/AbyssalCraftAPI.java b/src/api/java/com/shinoow/abyssalcraft/api/AbyssalCraftAPI.java new file mode 100644 index 00000000..0f7d66f3 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/AbyssalCraftAPI.java @@ -0,0 +1,858 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api; + +import java.util.List; +import java.util.Map; + +import org.apache.logging.log4j.Level; + +import net.minecraft.block.Block; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.*; +import net.minecraft.entity.passive.*; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.Item; +import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.potion.Potion; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.EnumHelper; +import net.minecraftforge.oredict.OreDictionary; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.shinoow.abyssalcraft.api.block.ACBlocks; +import com.shinoow.abyssalcraft.api.entity.EntityUtil; +import com.shinoow.abyssalcraft.api.internal.DummyNecroDataHandler; +import com.shinoow.abyssalcraft.api.internal.IInternalNecroDataHandler; +import com.shinoow.abyssalcraft.api.item.ACItems; +import com.shinoow.abyssalcraft.api.item.ItemEngraving; +import com.shinoow.abyssalcraft.api.necronomicon.NecroData; +import com.shinoow.abyssalcraft.api.recipe.*; + +import net.minecraftforge.fml.common.FMLLog; +import net.minecraftforge.fml.common.IFuelHandler; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.LoaderState; +import net.minecraftforge.fml.common.registry.GameRegistry; + +/** + * Main API class for AbyssalCraft, has child classes for most features.
+ * Check {@link IMCHelper} for InterModComms registration + * + * @author shinoow + * + */ +public class AbyssalCraftAPI { + + /** + * String used to specify the API version in the "package-info.java" classes + */ + public static final String API_VERSION = "1.8.1"; + + public static Enchantment coralium_enchantment, dread_enchantment, light_pierce, iron_wall; + + public static Potion coralium_plague, dread_plague, antimatter_potion; + + private static List crystallizerFuelHandlers = Lists.newArrayList(); + private static List transmutatorFuelHandlers = Lists.newArrayList(); + + public static DamageSource coralium = new DamageSource("coralium").setDamageBypassesArmor().setMagicDamage(); + public static DamageSource dread = new DamageSource("dread").setDamageBypassesArmor().setMagicDamage(); + public static DamageSource antimatter = new DamageSource("antimatter").setDamageBypassesArmor().setMagicDamage(); + + private static List shoggothBlockBlacklist = Lists.newArrayList(); + + private static List crystals = Lists.newArrayList(); + + private static Map necroData = Maps.newHashMap(); + + private static Map ghoul_helmet = Maps.newHashMap(); + private static Map ghoul_chestplate = Maps.newHashMap(); + private static Map ghoul_leggings = Maps.newHashMap(); + private static Map ghoul_boots = Maps.newHashMap(); + + /** + * {@link EnumCreatureAttribute} used for the Shadow mobs + */ + public static EnumCreatureAttribute SHADOW = EnumHelper.addCreatureAttribute("SHADOW"); + + public static ArmorMaterial abyssalniteArmor = EnumHelper.addArmorMaterial("Abyssalnite", "abyssalcraft:abyssalnite", 35, new int[]{3, 6, 8, 3}, 13, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F); + public static ArmorMaterial dreadedAbyssalniteArmor = EnumHelper.addArmorMaterial("Dread", "abyssalcraft:dread", 36, new int[]{3, 6, 8, 3}, 15, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F); + public static ArmorMaterial refinedCoraliumArmor = EnumHelper.addArmorMaterial("Coralium", "abyssalcraft:coralium", 37, new int[]{3, 6, 8, 3}, 14, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F); + public static ArmorMaterial platedCoraliumArmor = EnumHelper.addArmorMaterial("CoraliumP", "abyssalcraft:coraliump", 55, new int[]{4, 7, 9, 4}, 14, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 3.0F); + public static ArmorMaterial depthsArmor = EnumHelper.addArmorMaterial("Depths", "abyssalcraft:depths", 33, new int[]{3, 6, 8, 3}, 25, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.5F); + public static ArmorMaterial dreadiumArmor = EnumHelper.addArmorMaterial("Dreadium", "abyssalcraft:dreadium", 40, new int[]{3, 6, 8, 3}, 15, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F); + public static ArmorMaterial dreadiumSamuraiArmor = EnumHelper.addArmorMaterial("DreadiumS", "abyssalcraft:dreadiums", 45, new int[]{3, 6, 8, 3}, 20, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.5F); + public static ArmorMaterial ethaxiumArmor = EnumHelper.addArmorMaterial("Ethaxium", "abyssalcraft:ethaxium", 50, new int[]{3, 6, 8, 3}, 25, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 2.0F); + + public static ToolMaterial darkstoneTool = EnumHelper.addToolMaterial("DARKSTONE", 1, 180, 5.0F, 1, 5); + public static ToolMaterial abyssalniteTool = EnumHelper.addToolMaterial("ABYSSALNITE", 4, 1261, 10.0F, 4, 12); + public static ToolMaterial refinedCoraliumTool = EnumHelper.addToolMaterial("CORALIUM", 5, 1800, 12.0F, 5, 13); + public static ToolMaterial dreadiumTool = EnumHelper.addToolMaterial("DREADIUM", 6, 2300, 14.0F, 6, 14); + public static ToolMaterial ethaxiumTool = EnumHelper.addToolMaterial("ETHAXIUM", 8, 2800, 16.0F, 8, 20); + + private static IInternalNecroDataHandler internalNDHandler = new DummyNecroDataHandler(); + + /** + * Used by AbyssalCraft to set the Internal NecroData Handler.
+ * If any other mod tries to use this method, nothing will happen. + * @param handler Handler instance + */ + public static void setInternalNDHandler(IInternalNecroDataHandler handler){ + if(internalNDHandler.getClass().getName().equals(DummyNecroDataHandler.class.getName()) + && Loader.instance().getLoaderState() == LoaderState.PREINITIALIZATION + && Loader.instance().activeModContainer().getModId().equals("abyssalcraft")) + internalNDHandler = handler; + } + + /** + * Internal NecroData handler.
+ * Use this to alter the internal NecroData instances. + */ + public static IInternalNecroDataHandler getInternalNDHandler(){ + return internalNDHandler; + } + + /** + * Sets the repair items for each armor/tool material + */ + public static void setRepairItems(){ + + abyssalniteArmor.customCraftingMaterial = ACItems.abyssalnite_ingot; + dreadedAbyssalniteArmor.customCraftingMaterial = ACItems.dreaded_shard_of_abyssalnite; + refinedCoraliumArmor.customCraftingMaterial = ACItems.refined_coralium_ingot; + platedCoraliumArmor.customCraftingMaterial = ACItems.coralium_plate; + depthsArmor.customCraftingMaterial = ACItems.coralium_gem_cluster_9; + dreadiumArmor.customCraftingMaterial = ACItems.dreadium_ingot; + dreadiumSamuraiArmor.customCraftingMaterial = ACItems.dreadium_plate; + ethaxiumArmor.customCraftingMaterial = ACItems.ethaxium_ingot; + + darkstoneTool.setRepairItem(new ItemStack(ACBlocks.darkstone_cobblestone)); + abyssalniteTool.setRepairItem(new ItemStack(ACItems.abyssalnite_ingot)); + refinedCoraliumTool.setRepairItem(new ItemStack(ACItems.refined_coralium_ingot)); + dreadiumTool.setRepairItem(new ItemStack(ACItems.dreadium_ingot)); + ethaxiumTool.setRepairItem(new ItemStack(ACItems.ethaxium_ingot)); + } + + /** + * Basic Crystallization + * @param input The block to crystallize + * @param output1 The first crystal output + * @param output2 The second crystal output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addCrystallization(Block input, ItemStack output1, ItemStack output2, float xp){ + CrystallizerRecipes.instance().crystallize(input, output1, output2, xp); + } + + /** + * Basic Crystallization + * @param input The item to crystallize + * @param output1 The first crystal output + * @param output2 The second crystal output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addCrystallization(Item input, ItemStack output1, ItemStack output2, float xp){ + CrystallizerRecipes.instance().crystallize(input, output1, output2, xp); + } + + /** + * Basic Crystallization + * @param input The itemstack to crystallize + * @param output1 The first crystal output + * @param output2 The second crystal output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addCrystallization(ItemStack input, ItemStack output1, ItemStack output2, float xp){ + CrystallizerRecipes.instance().crystallize(input, output1, output2, xp); + } + + /** + * Single-output Crystallization + * @param input The block to crystallize + * @param output The crystal output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addSingleCrystallization(Block input, ItemStack output, float xp){ + addCrystallization(input, output, null, xp); + } + + /** + * Single-output Crystallization + * @param input The item to crystallize + * @param output The crystal output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addSingleCrystallization(Item input, ItemStack output, float xp){ + addCrystallization(input, output, null, xp); + } + + /** + * Single-output Crystallization + * @param input The itemstack to crystallize + * @param output The crystal output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addSingleCrystallization(ItemStack input, ItemStack output, float xp){ + addCrystallization(input, output, null, xp); + } + + /** + * Basic Transmutation + * @param input The block to transmutate + * @param output The transmutated output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addTransmutation(Block input, ItemStack output, float xp){ + TransmutatorRecipes.instance().transmute(input, output, xp); + } + + /** + * Basic Transmutation + * @param input The item to transmutate + * @param output The transmutated output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addTransmutation(Item input, ItemStack output, float xp){ + TransmutatorRecipes.instance().transmute(input, output, xp); + } + + /** + * Basic Transmutation + * @param input The itemstack to transmutate + * @param output The transmutated output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addTransmutation(ItemStack input, ItemStack output, float xp){ + TransmutatorRecipes.instance().transmute(input, output, xp); + } + + /** + * Smelting through the OreDictionary + * @param input The ore input + * @param output The ore output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addOreSmelting(String input, String output, float xp){ + if(!OreDictionary.getOres(output).isEmpty()) + for(ItemStack stack : OreDictionary.getOres(input)) + FurnaceRecipes.instance().addSmeltingRecipe(stack, OreDictionary.getOres(output).get(0), xp); + } + + /** + * OreDictionary specific Crystallization + * @param input The ore input + * @param output1 The first ore output + * @param output2 The second ore output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addCrystallization(String input, String output1, String output2, float xp){ + if(!OreDictionary.getOres(output1).isEmpty() && !OreDictionary.getOres(output2).isEmpty()) + for(ItemStack stack : OreDictionary.getOres(input)) + addCrystallization(stack, OreDictionary.getOres(output1).get(0), OreDictionary.getOres(output2).get(0), xp); + } + + /** + * OreDictionary specific Crystallization + * @param input The ore input + * @param output1 The first ore output + * @param out1 Quantity of the first output + * @param output2 The second ore output + * @param out2 Quantity of the second output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addCrystallization(String input, String output1, int out1, String output2, int out2, float xp){ + if(!OreDictionary.getOres(output1).isEmpty() && !OreDictionary.getOres(output2).isEmpty()){ + ItemStack o1 = OreDictionary.getOres(output1).get(0).copy(); + o1.stackSize = out1; + ItemStack o2 = OreDictionary.getOres(output2).get(0).copy(); + o2.stackSize = out2; + for(ItemStack stack : OreDictionary.getOres(input)) + addCrystallization(stack, o1, o2, xp); + } + } + + /** + * OreDictionary specific single-output Crystallization + * @param input The ore input + * @param output The ore output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addSingleCrystallization(String input, String output, float xp){ + if(!OreDictionary.getOres(output).isEmpty()) + for(ItemStack stack : OreDictionary.getOres(input)) + addSingleCrystallization(stack, OreDictionary.getOres(output).get(0), xp); + } + + /** + * OreDictionary specific single-output Crystallization + * @param input The ore input + * @param output The ore output + * @param out The output quantity + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addSingleCrystallization(String input, String output, int out, float xp){ + if(!OreDictionary.getOres(output).isEmpty()){ + ItemStack o = OreDictionary.getOres(output).get(0).copy(); + o.stackSize = out; + for(ItemStack stack : OreDictionary.getOres(input)) + addSingleCrystallization(stack, o, xp); + } + } + + /** + * OreDictionary specific Transmutation + * @param input The ore input + * @param output The ore output + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addTransmutation(String input, String output, float xp){ + if(!OreDictionary.getOres(output).isEmpty()) + for(ItemStack stack : OreDictionary.getOres(input)) + addTransmutation(stack, OreDictionary.getOres(output).get(0), xp); + } + + /** + * OreDictionary specific Transmutation + * @param input The ore input + * @param output The ore output + * @param out The output quantity + * @param xp Amount of exp given + * + * @since 1.0 + */ + public static void addTransmutation(String input, String output, int out, float xp){ + if(!OreDictionary.getOres(output).isEmpty()){ + ItemStack o = OreDictionary.getOres(output).get(0).copy(); + o.stackSize = out; + for(ItemStack stack : OreDictionary.getOres(input)) + addTransmutation(stack, o, xp); + } + } + + /** + * Registers a coin to the coin list (use {@link #addEngraving(ItemStack, ItemEngraving, float)}. + * Both regular coins and engraved coins should be registered here + * to register the engraving template and engraved coin) + * @param coin The ItemStack containing a coin + * + * @since 1.3.5 + */ + public static void addCoin(ItemStack coin){ + if(!EngraverRecipes.instance().getCoinList().contains(coin)) + EngraverRecipes.instance().addCoin(coin); + else FMLLog.log("AbyssalCraftAPI", Level.ERROR, "This Coin is already registered!"); + } + + /** + * Registers a coin to the coin list (use {@link #addEngraving(Item, ItemEngraving, float)}. + * Both regular coins and engraved coins should be registered here + * to register the engraving template and engraved coin) + * @param coin The Item representing a coin + * + * @since 1.3.5 + */ + public static void addCoin(Item coin){ + if(!EngraverRecipes.instance().getCoinList().contains(new ItemStack(coin))) + EngraverRecipes.instance().addCoin(coin); + else FMLLog.log("AbyssalCraftAPI", Level.ERROR, "This Coin is already registered!"); + } + + /** + * Registers a coin engraving (use {@link #addCoin(ItemStack)} to register the coin) + * @param coin The Engraved Coin + * @param engraving The Engraving Template + * @param xp Amount of exp given + * + * @since 1.3.5 + */ + public static void addEngraving(ItemStack coin, ItemEngraving engraving, float xp){ + if(!EngraverRecipes.instance().getEngravingList().containsKey(engraving) && + !EngraverRecipes.instance().getEngravingList().containsValue(coin)) + EngraverRecipes.instance().addEngraving(coin, engraving, xp); + else FMLLog.log("AbyssalCraftAPI", Level.ERROR, "This Engraving Template and/or Engraved Coin is already registered!"); + } + + /** + * Registers a coin engraving (use {@link #addCoin(Item)} to register the coin) + * @param coin The Engraved Coin + * @param engraving The Engraving Template + * @param xp Amount of exp given + * + * @since 1.3.5 + */ + public static void addEngraving(Item coin, ItemEngraving engraving, float xp){ + if(!EngraverRecipes.instance().getEngravingList().containsKey(engraving) && + !EngraverRecipes.instance().getEngravingList().containsValue(new ItemStack(coin))) + EngraverRecipes.instance().addEngraving(coin, engraving, xp); + else FMLLog.log("AbyssalCraftAPI", Level.ERROR, "This Engraving Template and/or Engraved Coin is already registered!"); + } + + /** + * Basic Materialization.
+ * Note: all inputs has to be either {@link ICrystal}s or be registered in the Crystal List {@link AbyssalCraftAPI#addCrystal(ItemStack)} + * @param input An array of ItemStacks (maximum is 5) + * @param output The output + * @param xp Amount of exp given + * + * @since 1.4.5 + */ + public static void addMaterialization(ItemStack[] input, ItemStack output){ + for(ItemStack item : input) + if(!APIUtils.isCrystal(item)) throw new ClassCastException("All of the input items has to be Crystals!"); + if(input.length > 0 && input != null) + if(input.length <= 5) + MaterializerRecipes.instance().materialize(input, output); + else FMLLog.log("AbyssalCraftAPI", Level.ERROR, "This Materializer recipe has more than 5 inputs! (%d)", input.length); + else FMLLog.log("AbyssalCraftAPI", Level.ERROR, "This Materializer recipe has no inputs!"); + } + + /** + * Basic Materialization. + * @param materialization A Materializer Recipe + * + * @since 1.5 + */ + public static void addMaterialization(Materialization materialization){ + MaterializerRecipes.instance().materialize(materialization); + } + + /** + * Fuel types, also has support for the vanilla furnace. + * @author shinoow + * + */ + public enum FuelType{ + CRYSTALLIZER, TRANSMUTATOR, FURNACE + } + + /** + * Registers a fuel handler for an AbyssalCraft fuel type + * @param handler The file that implements {@link IFuelHandler} + * @param type The fuel type + * + * @since 1.0 + */ + public static void registerFuelHandler(IFuelHandler handler, FuelType type){ + switch(type){ + case CRYSTALLIZER: + crystallizerFuelHandlers.add(handler); + break; + case TRANSMUTATOR: + transmutatorFuelHandlers.add(handler); + break; + case FURNACE: + GameRegistry.registerFuelHandler(handler); + } + } + + /** + * Gets the fuel value from an ItemStack, depending on the fuel type + * @param itemStack The ItemStack getting checked + * @param type The fuel type + * @return The fuel value for the specified machine + * + * @since 1.0 + */ + public static int getFuelValue(ItemStack itemStack, FuelType type){ + int fuelValue = 0; + switch(type){ + case CRYSTALLIZER: + for (IFuelHandler handler : crystallizerFuelHandlers) + fuelValue = Math.max(fuelValue, handler.getBurnTime(itemStack)); + break; + case TRANSMUTATOR: + for (IFuelHandler handler : transmutatorFuelHandlers) + fuelValue = Math.max(fuelValue, handler.getBurnTime(itemStack)); + break; + case FURNACE: + GameRegistry.getFuelValue(itemStack); + } + return fuelValue; + } + + /** + * Adds the entity to a list of entities that the Lesser Shoggoth eats + * (Note: It's useless to add your entity here if it extends {@link EntityAnimal}, {@link EntityAmbientCreature}, {@link EntityWaterMob} or {@link EntityTameable}). + * If your Entity's superclass is a subclass of EntityTameable, you will need to add the superclass. + * @param clazz The potential "food" for the Lesser Shoggoth + * + * @since 1.2 + * + * @deprecated use {@link EntityUtil#addShoggothFood(Class)} instead + */ + @Deprecated + public static void addShoggothFood(Class clazz){ + EntityUtil.addShoggothFood(clazz); + } + + /** + * Used by the Lesser Shoggoth to fetch a list of things to eat + * @return An ArrayList containing Entity classes + * + * @since 1.2 + * + * @deprecated use {@link EntityUtil#getShoggothFood()} instead + */ + @Deprecated + public static List> getShoggothFood(){ + return EntityUtil.getShoggothFood(); + } + + /** + * Adds the block to a list of blocks that won't turn into + * a fleshy soil when a Lesser Shoggoth walks over it + * (Note: Any liquid block and tile entity block will automatically be blacklisted) + * @param block The block to blacklist + * + * @since 1.4 + */ + public static void addShoggothBlacklist(Block block){ + shoggothBlockBlacklist.add(block); + } + + /** + * Used by the Lesser Shoggoth to fetch a list of blocks that won't be converted when + * it walks over them + * @return An ArrayList containing Blocks + * + * @since 1.4 + */ + public static List getShoggothBlockBlacklist(){ + return shoggothBlockBlacklist; + } + + /** + * Adds the ItemStack to the crystal list. Anything added to this list will function like a {@link ICrystal} + * @param crystal The ItemStack to be added + * + * @since 1.3 + */ + public static void addCrystal(ItemStack crystal){ + crystals.add(crystal); + } + + /** + * Used by various things to fetch a list of ItemStacks that should function like {@link ICrystal}s + * @return An ArrayList of ItemStacks + * + * @since 1.3 + */ + public static List getCrystals(){ + return crystals; + } + + /** + * Method used to register pages to the Necronomicon + * @param data The NecroData instance, with page data + * @param bookType The Necronomicon "level" required in order to read this. + *
    + *
  • 0 = Necronomicon
  • + *
  • 1 = Abyssal Wasteland Necronomicon
  • + *
  • 2 = Dreadlands Necronomicon
  • + *
  • 3 = Omothol Necronomicon
  • + *
  • 4 = Abyssalnomicon
  • + *
+ * + * @since 1.3.5 + */ + public static void registerNecronomiconData(NecroData data, int bookType){ + if(bookType <= 4 && bookType >= 0) + necroData.put(data, bookType); + else FMLLog.log("AbyssalCraftAPI", Level.ERROR, "Necronomicon book type does not exist: %d", bookType); + } + + /** + * Used by the Necronomicon for fetching pages made outside of AbyssalCraft + * @return A HashMap of NecroDatas and Integers + * + * @since 1.3.5 + */ + public static Map getNecronomiconData(){ + return necroData; + } + + /** + * Registers a texture for a Helmet (when worn by a Ghoul Entity) + * @param helmet Helmet Item + * @param res Texture ResourceLocation + * + * @since 1.8 + */ + public static void addGhoulHelmetTexture(Item helmet, ResourceLocation res){ + if(helmet == null || res == null) return; + if(ghoul_helmet.containsKey(helmet)) + FMLLog.log("AbyssalCraftAPI", Level.INFO, "Mod %s is overwriting the texture for Helmet %s", Loader.instance().activeModContainer().getModId(), helmet.getItemStackDisplayName(new ItemStack(helmet))); + ghoul_helmet.put(helmet, res); + } + + /** + * Registers a texture for a Chestplate (when worn by a Ghoul Entity) + * @param chestplate Chestplate Item + * @param res Texture ResourceLocation + * + * @since 1.8 + */ + public static void addGhoulChestplateTexture(Item chestplate, ResourceLocation res){ + if(chestplate == null || res == null) return; + if(ghoul_chestplate.containsKey(chestplate)) + FMLLog.log("AbyssalCraftAPI", Level.INFO, "Mod %s is overwriting the texture for Chestplate %s", Loader.instance().activeModContainer().getModId(), chestplate.getItemStackDisplayName(new ItemStack(chestplate))); + ghoul_chestplate.put(chestplate, res); + } + + /** + * Registers a texture for a pair of Leggings (when worn by a Ghoul Entity) + * @param leggings Leggings Item + * @param res Texture ResourceLocation + * + * @since 1.8 + */ + public static void addGhoulLeggingsTexture(Item leggings, ResourceLocation res){ + if(leggings == null || res == null) return; + if(ghoul_leggings.containsKey(leggings)) + FMLLog.log("AbyssalCraftAPI", Level.INFO, "Mod %s is overwriting the texture for Leggings %s", Loader.instance().activeModContainer().getModId(), leggings.getItemStackDisplayName(new ItemStack(leggings))); + ghoul_leggings.put(leggings, res); + } + + /** + * Registers a texture for a pair of Boots (when worn by a Ghoul Entity) + * @param boots Boots Item + * @param res Texture ResourceLocation + * + * @since 1.8 + */ + public static void addGhoulBootsTexture(Item boots, ResourceLocation res){ + if(boots == null || res == null) return; + if(ghoul_boots.containsKey(boots)) + FMLLog.log("AbyssalCraftAPI", Level.INFO, "Mod %s is overwriting the texture for Boots %s", Loader.instance().activeModContainer().getModId(), boots.getItemStackDisplayName(new ItemStack(boots))); + ghoul_boots.put(boots, res); + } + + /** + * Registers a texture for a Helmet (when worn by a Ghoul Entity) + * @param helmet Helmet Item + * @param res Texture String (should be formatted as "modid:path/to/texture.png") + * + * @since 1.8 + */ + public static void addGhoulHelmetTexture(Item helmet, String res){ + addGhoulHelmetTexture(helmet, new ResourceLocation(res)); + } + + /** + * Registers a texture for a Chestplate (when worn by a Ghoul Entity) + * @param chestplate Chestplate Item + * @param res Texture String (should be formatted as "modid:path/to/texture.png") + * + * @since 1.8 + */ + public static void addGhoulChestplateTexture(Item chestplate, String res){ + addGhoulChestplateTexture(chestplate, new ResourceLocation(res)); + } + + /** + * Registers a texture for a pair of Leggings (when worn by a Ghoul Entity) + * @param leggings Leggings Item + * @param res Texture String (should be formatted as "modid:path/to/texture.png") + * + * @since 1.8 + */ + public static void addGhoulLeggingsTexture(Item leggings, String res){ + addGhoulLeggingsTexture(leggings, new ResourceLocation(res)); + } + + /** + * Registers a texture for a pair of Boots (when worn by a Ghoul Entity) + * @param boots Boots Item + * @param res Texture String (should be formatted as "modid:path/to/texture.png") + * + * @since 1.8 + */ + public static void addGhoulBootsTexture(Item boots, String res){ + addGhoulBootsTexture(boots, new ResourceLocation(res)); + } + + /** + * Registers textures for a set of Armor (when worn by a Ghoul Entity)
+ * If you use different textures for each piece, register them separately. + * @param helmet Helmet Item + * @param chestplate Chestplate Item + * @param leggings Leggings Item + * @param boots Boots Item + * @param res1 Texture ResourceLocation for Helmet, Chestplate and Boots + * @param res2 Texture ResourceLocation for Leggings + * + * @since 1.8 + */ + public static void addGhoulArmorTextures(Item helmet, Item chestplate, Item leggings, Item boots, ResourceLocation res1, ResourceLocation res2){ + addGhoulHelmetTexture(helmet, res1); + addGhoulChestplateTexture(chestplate, res1); + addGhoulLeggingsTexture(leggings, res2); + addGhoulBootsTexture(boots, res1); + } + + /** + * Registers textures for a set of Armor (when worn by a Ghoul Entity)
+ * If you use different textures for each piece, register them separately. + * @param helmet Helmet Item + * @param chestplate Chestplate Item + * @param leggings Leggings Item + * @param boots Boots Item + * @param res1 Texture String for Helmet, Chestplate and Boots (should be formatted as "modid:path/to/texture.png") + * @param res2 Texture String for Leggings (should be formatted as "modid:path/to/texture.png") + * + * @since 1.8 + */ + public static void addGhoulArmorTextures(Item helmet, Item chestplate, Item leggings, Item boots, String res1, String res2){ + addGhoulArmorTextures(helmet, chestplate, leggings, boots, new ResourceLocation(res1), new ResourceLocation(res2)); + } + + /** + * Fetches a ResourceLocation for the armor texture of a Helmet, if any + * @param helmet Helmet Item + * @return A ResourceLocation for the Helmet texture, if any + * + * @since 1.8 + */ + public static ResourceLocation getGhoulHelmetTexture(Item helmet){ + return ghoul_helmet.get(helmet); + } + + /** + * Fetches a ResourceLocation for the armor texture of a Chestplate, if any + * @param chestplate Chestplate Item + * @return A ResourceLocation for the Chestplate texture, if any + * + * @since 1.8 + */ + public static ResourceLocation getGhoulChestplateTexture(Item chestplate){ + return ghoul_chestplate.get(chestplate); + } + + /** + * Fetches a ResourceLocation for the armor texture of a pair of Leggings, if any + * @param leggings Leggings Item + * @return A ResourceLocation for the Leggings texture, if any + * + * @since 1.8 + */ + public static ResourceLocation getGhoulLeggingsTexture(Item leggings){ + return ghoul_leggings.get(leggings); + } + + /** + * Fetches a ResourceLocation for the armor texture of a pair of Boots, if any + * @param boots Boots Item + * @return A ResourceLocation for the Boots texture, if any + * + * @since 1.8 + */ + public static ResourceLocation getGhoulBootsTexture(Item boots){ + return ghoul_boots.get(boots); + } + + /** + * Contains the names of all mobs added in AbyssalCraft. + * + * @author shinoow + * + */ + public static class ACEntities { + + private static String[] mobNames = {"depthsghoul", "evilpig", "abyssalzombie", "Jzahar", "abygolem", "dreadgolem", + "dreadguard", "dragonminion", "dragonboss", "shadowcreature", "shadowmonster", "dreadling", "dreadspawn", + "demonpig", "gskeleton", "chagarothspawn", "chagarothfist", "chagaroth", "shadowbeast", "shadowboss", + "antiabyssalzombie", "antibat", "antichicken", "anticow", "anticreeper", "antighoul", "antipig", "antiplayer", + "antiskeleton", "antispider", "antizombie", "lessershoggoth", "shadowtitan", "omotholwarden", "jzaharminion", + "omotholghoul", "remnant", "greaterdreadspawn", "lesserdreadbeast", "evilcow", "evilchicken", "demoncow", + "demonchicken"}; + + public static String depths_ghoul = mobNames[0]; + public static String evil_pig = mobNames[1]; + public static String abyssal_zombie = mobNames[2]; + public static String jzahar = mobNames[3]; + public static String abyssalnite_golem = mobNames[4]; + public static String dreaded_abyssalnite_golem = mobNames[5]; + public static String dreadguard = mobNames[6]; + public static String spectral_dragon = mobNames[7]; + public static String asorah = mobNames[8]; + public static String shadow_creature = mobNames[9]; + public static String shadow_monster = mobNames[10]; + public static String dreadling = mobNames[11]; + public static String dread_spawn = mobNames[12]; + public static String demon_pig = mobNames[13]; + public static String skeleton_goliath = mobNames[14]; + public static String spawn_of_chagaroth = mobNames[15]; + public static String fist_of_chagaroth = mobNames[16]; + public static String chagaroth = mobNames[17]; + public static String shadow_beast = mobNames[18]; + public static String sacthoth = mobNames[19]; + public static String abyssal_anti_zombie = mobNames[20]; + public static String anti_bat = mobNames[21]; + public static String anti_chicken = mobNames[22]; + public static String anti_cow = mobNames[23]; + public static String anti_creeper = mobNames[24]; + public static String anti_ghoul = mobNames[25]; + public static String anti_pig = mobNames[26]; + public static String anti_player = mobNames[27]; + public static String anti_skeleton = mobNames[28]; + public static String anti_spider = mobNames[29]; + public static String anti_zombie = mobNames[30]; + public static String lesser_shoggoth = mobNames[31]; + public static String shadow_titan = mobNames[32]; + public static String omothol_warden = mobNames[33]; + public static String minion_of_the_gatekeeper = mobNames[34]; + public static String omothol_ghoul = mobNames[35]; + public static String remnant = mobNames[36]; + public static String greater_dread_spawn = mobNames[37]; + public static String lesser_dreadbeast = mobNames[38]; + public static String evil_cow = mobNames[39]; + public static String evil_chicken = mobNames[40]; + public static String demon_cow = mobNames[41]; + public static String demon_chicken = mobNames[42]; + } +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/IMCHelper.java b/src/api/java/com/shinoow/abyssalcraft/api/IMCHelper.java new file mode 100644 index 00000000..b419be4d --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/IMCHelper.java @@ -0,0 +1,166 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api; + +/** + * List of InterModComms messages you can use instead of the API registry methods + * + * @author shinoow + * + */ +public class IMCHelper { + + //SHOGGOTH FOOD //////////////////////////////////////////////////////////////////////////// + /** + * This is a IMC version of AbyssalCraftAPI#addShoggothFood + * You can use the IMC message "shoggothFood" to add a Entity to the Shoggoth Food list + * The format for the message should be the string path to the entity class + * + * Example of how it would look like if I added the Depths Ghoul to the food list: + * FMLInterModComms.sendMessage("abyssalcraft", "shoggothFood", "com.shinoow.abyssalcraft.common.entity.EntityDepthsGhoul"); + */ + + //TRANSMUTATOR FUEL HANDLER /////////////////////////////////////////////////////////////// + /** + * This is a IMC version of AbyssalCraftAPI#registerFuelHandler made for registering Transmutator fuel handlers + * You can use the IMC message "registerTransmutatorFuel" to register a fuel handler + * The format for the message should be the string path to the handler class + * + * Example of how it would look like if I added my Furnace fuel handler as a Transmutator fuel handler: + * FMLInterModComms.sendMessage("abyssalcraft", "registerTransmutatorFuel", "com.shinoow.abyssalcraft.common.handlers.FurnaceFuelHandler"); + */ + + //CRYSTALLIZER FUEL HANDLER /////////////////////////////////////////////////////////////// + /** + * This is a IMC version of AbyssalCraftAPI#registerFuelHandler made for registering Crystallizer fuel handlers + * You can use the IMC message "registerCrystallizerFuel" to register a fuel handler + * The format for the message should be the string path to the handler class + * + * Example of how it would look like if I added my Furnace fuel handler as a Crystallizer fuel handler: + * FMLInterModComms.sendMessage("abyssalcraft", "registerCrystallizerFuel", "com.shinoow.abyssalcraft.common.handlers.FurnaceFuelHandler"); + */ + + //CRYSTALS ///////////////////////////////////////////////////////////////////////////////// + + /** + * This is a IMC version of AbyssalCraftAPI#addCrystal + * You can use the IMC message "addCrystal" + * + * Example of how it would look like if I added my Abyssalnite Ingot as a crystal: + * FMLInterModComms.sendMessage("abyssalcraft", "addCrystal", new ItemStack(ACItems.abyssalnite_ingot)); + */ + + //CRYSTALLIZATION ////////////////////////////////////////////////////////////////////////// + + /** + * This is a IMC version of AbyssalCraftAPI#addCrystallization + * It has the following IMC messages: + * "addCrystallization" - used for normal crystallization with 2 ItemStack outputs + * "addSingleCrystallization" - used for single-output crystallization with only 1 ItemStack output + * "addOredictCrystallization" - used for normal OreDictionary crystallization with 2 ItemStack outputs + * "addOredictSingleCrystallization" - used for single-output OreDictinoary crystallization with only 1 ItemStack output + * + * The IMC message should contain a NBTTagCompound with the following tags: + * "input" - the input, should be a ItemStack unless it's a OreDictionary recipe, in which case it should be a String + * "output1" - the first input, same as above. Used for normal crystallizations + * "output2" - the second output, same as above. Used for normal crystallizations + * "output" - the output - same as above. Used for single-output crystallizations + * "quantity1" (optional) - quantity of the first output, will null any metadata if used without the "meta1" tag. Used for normal crystallization + * "quantity2" (optional) - quantity of the second output, will null any metadata if used without the "meta2" tag. Used for normal crystallization + * "quantity" (optional) - quantity of the output, will null any metadata if used without the "meta" tag. Used for single-output crystallization + * "meta1" (optional) - metadata for the first output. Used for normal crystallization + * "meta2" (optional) - metadata for the second output. Used for normal crystallization + * "meta" (optional) - metadata for the output. Used for single-output crystallization + * "xp" - experience points gained from the crystallization, used in all cases + * + * The message is sent this way: + * FMLInterModComms.sendMessage("abyssalcraft", , ); + */ + + //TRANSMUTATION //////////////////////////////////////////////////////////////////////////// + + /** + * This is a IMC version of AbyssalCraftAPI#addTransmutation + * It has the following IMC messages: + * "addTransmutation" - used for normal transmutatiion + * "attOredictTransmutation" - used for OreDictionary transmutation + * + * The IMC message should contain a NBTTagCompound with the following tags: + * "input" - the input, either a ItemStack or a String + * "output" - the output, either a ItemStack or a String + * "quantity" (optional) - quantity of the output, will null any metadata if used without the "meta" tag + * "meta" (optional) - metadata for the output + * "xp" - experience points gained from the transmutation, used in both cases + * + * The message is sent this way: + * FMLInterModComms.sendMessage("abyssalcraft", , ); + */ + + //MATERIALIZATION ////////////////////////////////////////////////////////////////////////// + + /** + * This is a IMC version of AbyssalCraftAPI#addMaterialization + * It has the following IMC message: + * "addMaterialization" + * + * The IMC message should contain a NBTTagCompound with the following tags: + * "input1" - the first output, a ItemStack, can't be null + * "input2" - the second output, same as above. Can be null + * "input3" - the third output, same as above. Can be null + * "input4" - the fourth output, same as above. Can be null + * "input5" - the fifth output, same as above. Can be null + * "output" - the output, same as above, can't be null + * "level" - required Necronomicon level (Necronomicon = 0, Abyssal Wasteland Necronomicon = 1, + * Dreadlands Necronomicon = 2, Omothol Necronomicon = 3, Abyssalnomicon = 4) + * + * The message is sent this way: + * FMLInterModComms.sendMessage("abyssalcraft", "addMaterialization", ); + */ + + //SHOGGOTH BLOCK BLACKLIST ///////////////////////////////////////////////////////////////// + + /** + * This is a IMC version of AbyssalCraftAPI#addShoggothBlacklist + * You can use the IMC message "shoggothBlacklist" to add a Block to the Shoggoth Block Blacklist + * The format for the message should be a ItemStack containing a Block + * + * Example of how it would look like if I added Darkstone Bricks to the food list: + * FMLInterModComms.sendMessage("abyssalcraft", "shoggothBlacklist", new ItemStack(ACBlocks.darkstone_brick)); + */ + + //GHOUL ARMOR REGISTRATION ///////////////////////////////////////////////////////////////// + + /** + * These are IMC versions of AbyssalCraftAPI#addGhoulArmorTextures (and the one for separate pieces) + * You can use the IMC message "addGhoulArmor" respective "addGhoulHelmet", "addGhoulChestplate", + * "addGhoulLeggings" and "addGhoulBoots" to register armor textures for various armor pieces + * + * For registration of a full armor set, the IMC message should contain a NBTTagCompound with the following tags: + * "helmet" - a ItemStack containing the Helmet + * "chestplate" - a ItemStack containing the Chestplate + * "leggings" - a ItemStack containing the Leggings + * "boots" - a ItemStack containing the Boots + * "res1" - a ResourceLocation pointing to the texture used for the Helmet, Chestplate and Boots + * "res2"- a ResourceLocation pointing to the texture used for the Leggings + * + * The message is sent this way: + * FMLInterModComms.sendMessage("abyssalcraft", "addGhoulArmor", ); + * + * If your armor set doesn't used the standard texture coordination (one texture for helmet, chestplate, boots, + * then another for the leggings), you can registed each piece separately with the following tags instead of the above: + * "helmet" / "chestplate" / "leggings" / "boots" - a ItemStack with the desired piece of armor (only use one of them per message) + * "res" - a ResourceLocation pointing to the texture used for the piece + * + * The message is sent this way (where is replaced with the name of the armor piece you want to register): + * FMLInterModComms.sendMessage("abyssalcraft", "addGhoul", ); + */ +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/biome/ACBiomes.java b/src/api/java/com/shinoow/abyssalcraft/api/biome/ACBiomes.java new file mode 100644 index 00000000..9e3570c3 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/biome/ACBiomes.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.biome; + +import net.minecraft.world.biome.Biome; + +/** + * Contains all biomes added in AbyssalCraft + * + * @author shinoow + * + */ +public class ACBiomes { + + public static Biome darklands; + public static Biome darklands_forest; + public static Biome darklands_plains; + public static Biome darklands_hills; + public static Biome darklands_mountains; + public static Biome coralium_infested_swamp; + public static Biome abyssal_wastelands; + public static Biome dreadlands; + public static Biome purified_dreadlands; + public static Biome dreadlands_mountains; + public static Biome dreadlands_forest; + public static Biome omothol; + public static Biome dark_realm; +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/biome/IDarklandsBiome.java b/src/api/java/com/shinoow/abyssalcraft/api/biome/IDarklandsBiome.java new file mode 100644 index 00000000..ab214663 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/biome/IDarklandsBiome.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.biome; + +/** + * Interface to define a Darklands biome + * + * @author shinoow + * + * @since 1.7 + */ +public interface IDarklandsBiome { + +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/biome/IDreadlandsBiome.java b/src/api/java/com/shinoow/abyssalcraft/api/biome/IDreadlandsBiome.java new file mode 100644 index 00000000..23eb3f08 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/biome/IDreadlandsBiome.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.biome; + +/** + * Interface to define a Dreadlands biome + * + * @author shinoow + * + * @since 1.7 + */ +public interface IDreadlandsBiome { + +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/biome/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/biome/package-info.java new file mode 100644 index 00000000..01a6f457 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/biome/package-info.java @@ -0,0 +1,4 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.biome; +import net.minecraftforge.fml.common.API; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; diff --git a/src/api/java/com/shinoow/abyssalcraft/api/block/ACBlocks.java b/src/api/java/com/shinoow/abyssalcraft/api/block/ACBlocks.java new file mode 100644 index 00000000..cdf7de0d --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/block/ACBlocks.java @@ -0,0 +1,169 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.block; + +import net.minecraft.block.Block; + +/** + * Contains all blocks added in AbyssalCraft + * + * @author shinoow + * + */ +public class ACBlocks { + + public static Block darkstone; + public static Block darkstone_cobblestone; + public static Block darkstone_brick; + public static Block glowing_darkstone_bricks; + public static Block darkstone_brick_slab; + public static Block darkstone_cobblestone_slab; + public static Block darklands_grass; + public static Block darkstone_brick_stairs; + public static Block darkstone_cobblestone_stairs; + public static Block darklands_oak_leaves; + public static Block darklands_oak_wood; + public static Block darklands_oak_sapling; + public static Block abyssal_stone; + public static Block abyssal_stone_brick; + public static Block abyssal_stone_brick_slab; + public static Block abyssal_stone_brick_stairs; + public static Block coralium_ore; + public static Block abyssalnite_ore; + public static Block abyssal_stone_brick_fence; + public static Block darkstone_cobblestone_wall; + public static Block oblivion_deathbomb; + public static Block block_of_abyssalnite; + public static Block coralium_infused_stone; + public static Block odb_core; + public static Block wooden_crate; + public static Block abyssal_gateway; + public static Block darkstone_slab; + public static Block darkstone_doubleslab; + public static Block coralium_fire; + public static Block darkstone_button; + public static Block darkstone_pressure_plate; + public static Block darklands_oak_planks; + public static Block darklands_oak_button; + public static Block darklands_oak_pressure_plate; + public static Block darklands_oak_stairs; + public static Block darklands_oak_slab; + public static Block liquid_coralium; + public static Block block_of_coralium; + public static Block dreadlands_infused_powerstone; + public static Block abyssal_coralium_ore; + public static Block abyssal_stone_button; + public static Block abyssal_stone_pressure_plate; + public static Block darkstone_brick_fence; + public static Block darklands_oak_fence; + public static Block dreadstone; + public static Block abyssalnite_stone; + public static Block dreadlands_abyssalnite_ore; + public static Block dreaded_abyssalnite_ore; + public static Block dreadstone_brick; + public static Block abyssalnite_stone_brick; + public static Block dreadlands_grass; + public static Block dreadlands_log; + public static Block dreadlands_leaves; + public static Block dreadlands_sapling; + public static Block dreadlands_planks; + public static Block dreaded_gateway; + public static Block dreaded_fire; + public static Block depths_ghoul_head; + public static Block pete_head; + public static Block mr_wilson_head; + public static Block dr_orange_head; + public static Block dreadstone_brick_stairs; + public static Block dreadstone_brick_fence; + public static Block dreadstone_brick_slab; + public static Block abyssalnite_stone_brick_stairs; + public static Block abyssalnite_stone_brick_fence; + public static Block abyssalnite_stone_brick_slab; + public static Block liquid_antimatter; + public static Block coralium_stone; + public static Block coralium_stone_brick; + public static Block coralium_stone_brick_fence; + public static Block coralium_stone_brick_slab; + public static Block coralium_stone_brick_stairs; + public static Block coralium_stone_button; + public static Block coralium_stone_pressure_plate; + public static Block chagaroth_altar_top; + public static Block chagaroth_altar_bottom; + public static Block crystallizer_idle; + public static Block crystallizer_active; + public static Block block_of_dreadium; + public static Block transmutator_idle; + public static Block transmutator_active; + public static Block dreadguard_spawner; + public static Block chagaroth_spawner; + public static Block dreadlands_wood_fence; + public static Block nitre_ore; + public static Block abyssal_iron_ore; + public static Block abyssal_gold_ore; + public static Block abyssal_diamond_ore; + public static Block abyssal_nitre_ore; + public static Block abyssal_tin_ore; + public static Block abyssal_copper_ore; + public static Block pearlescent_coralium_ore; + public static Block liquified_coralium_ore; + public static Block solid_lava; + public static Block ethaxium; + /** Metadata block, 0 = Ethaxium Brick, 1 = Chiseled Ethaxium Brick */ + public static Block ethaxium_brick; + public static Block ethaxium_pillar; + public static Block ethaxium_brick_stairs; + public static Block ethaxium_brick_slab; + public static Block ethaxium_brick_fence; + public static Block omothol_stone; + public static Block block_of_ethaxium; + public static Block omothol_gateway; + public static Block omothol_fire; + public static Block engraver; + public static Block materializer; + /** Metadata block, 0 = Dark Ethaxium Brick, 1 = Chiseled Dark Ethaxium Brick */ + public static Block dark_ethaxium_brick; + public static Block dark_ethaxium_pillar; + public static Block dark_ethaxium_brick_stairs; + public static Block dark_ethaxium_brick_slab; + public static Block dark_ethaxium_brick_fence; + public static Block ritual_altar; + public static Block ritual_pedestal; + public static Block shoggoth_ooze; + public static Block cthulhu_statue; + public static Block hastur_statue; + public static Block jzahar_statue; + public static Block azathoth_statue; + public static Block nyarlathotep_statue; + public static Block yog_sothoth_statue; + public static Block shub_niggurath_statue; + public static Block monolith_stone; + public static Block shoggoth_biomass; + public static Block energy_pedestal; + public static Block monolith_pillar; + public static Block sacrificial_altar; + /** Metadata block, 0 = Overworld, 1 = Abyssal Wasteland, 2 = Dreadlands, 3 = Omothol */ + public static Block tiered_energy_pedestal; + /** Metadata block, 0 = Overworld, 1 = Abyssal Wasteland, 2 = Dreadlands, 3 = Omothol */ + public static Block tiered_sacrificial_altar; + public static Block jzahar_spawner; + public static Block minion_of_the_gatekeeper_spawner; + public static Block mimic_fire; + public static Block decorative_cthulhu_statue; + public static Block decorative_hastur_statue; + public static Block decorative_jzahar_statue; + public static Block decorative_azathoth_statue; + public static Block decorative_nyarlathotep_statue; + public static Block decorative_yog_sothoth_statue; + public static Block decorative_shub_niggurath_statue; + public static Block crystal_cluster; + public static Block crystal_cluster2; +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/block/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/block/package-info.java new file mode 100644 index 00000000..808638c2 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/block/package-info.java @@ -0,0 +1,4 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.block; +import net.minecraftforge.fml.common.API; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/EnergyEnum.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/EnergyEnum.java new file mode 100644 index 00000000..f7d062e0 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/EnergyEnum.java @@ -0,0 +1,132 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy; + +import net.minecraft.util.text.translation.I18n; +import net.minecraftforge.common.util.EnumHelper; + +/** + * Collection of Enums used by various parts of the Potential Energy system.
+ * Also contains useful methods related to said Enums. + * @author shinoow + * + * @since 1.5 + */ +public class EnergyEnum { + + /** + * Amplifier Types
+ * RANGE - Range at which the amplified thing can transfer
+ * DURATION - Amount of time it takes to transfer
+ * POWER - Boost in amount of power transferred + * + * @since 1.5 + */ + public enum AmplifierType{ + + RANGE("range"), DURATION("duration"), POWER("power"); + + private String unlocalizedName; + + private AmplifierType(String name){ + unlocalizedName = name; + } + + /** + * Getter for the Amplifier's unlocalized name + */ + public String getUnlocalizedName(){ + return "ac.amplifier." + unlocalizedName; + } + + /** + * Getter for the Amplifier's localized name + */ + public String getLocalizedName(){ + return I18n.translateToLocal(getUnlocalizedName()); + } + } + + /** + * Deity Types
+ * Allows limiting certain actions to images/statues of a certain deity + * + * @since 1.5 + */ + public enum DeityType{ + + CTHULHU("Cthulhu"), HASTUR("Hastur"), JZAHAR("J'zahar"), + AZATHOTH("Azathoth"), NYARLATHOTEP("Nyarlathotep"), + SHUBNIGGURATH("Shub-Niggurath"), YOGSOTHOTH("Yog-Sothoth"); + + private String name; + + private DeityType(String name){ + this.name = name; + } + + /** + * Getter for the Deity's name + */ + public String getName(){ + return name; + } + } + + /** + * Fetches the localized name of a AmplifierType + * @param type Type to fetch the name from + * @return A localized name if found, otherwise "None" + * + * @since 1.5 + */ + public static String getAmplifierName(AmplifierType type){ + if(type == null) return I18n.translateToLocal("ac.text.none"); + return type.getLocalizedName(); + } + + /** + * Fetches the localized name of a DeityType + * @param type Type to fetch the name from + * @return A localized name if found, otherwise "None" + * + * @since 1.5 + */ + public static String getDeityName(DeityType type){ + if(type == null) return I18n.translateToLocal("ac.text.none"); + return type.getName(); + } + + /** + * Adds a Amplifier Type + * @param enumName Name for the enum (eg. Amplifier name in caps with only letters) + * @param name Name of the amplifier (will be prefixed with "ac.amplifier") + * @return A new Amplifier Type + * + * @since 1.5 + */ + public AmplifierType addAmplifierType(String enumName, String name){ + return EnumHelper.addEnum(AmplifierType.class, enumName, new Class[]{String.class}, name); + } + + /** + * Adds a Deity Type + * @param enumName Name for the enum (eg. Deity name in caps with only letters) + * @param name Name of the Deity + * @return A new Deity Type + * + * @since 1.5 + */ + public DeityType addDeityType(String enumName, String name){ + return EnumHelper.addEnum(DeityType.class, enumName, new Class[]{String.class}, name); + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/IAmplifierCharm.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/IAmplifierCharm.java new file mode 100644 index 00000000..d6736ffd --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/IAmplifierCharm.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy; + +import net.minecraft.item.ItemStack; + +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.AmplifierType; +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.DeityType; + +/** + * Interface to use on items that can amplify a {@link IEnergyManipulator} (WIP)
+ * WARNING: Any methods in this interface might end up getting removed,
+ * so I would suggest not using it until this text (and the WIP part) is removed. + * + * @author shinoow + * + * @since 1.5 + */ +public interface IAmplifierCharm { + + /** + * Gets the amplifier associated with the item + * @param stack ItemStack containing the item + */ + public AmplifierType getAmplifier(ItemStack stack); + + /** + * Gets the deity associated with the item (can be null) + * @param stack ItemStack containing the item + */ + public DeityType getDeity(ItemStack stack); +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyAmplifier.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyAmplifier.java new file mode 100644 index 00000000..c7b69add --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyAmplifier.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy; + +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.AmplifierType; + +/** + * Interface to use on blocks that can amplify a {@link IEnergyManipulator} (WIP)
+ * WARNING: Any methods in this interface might end up getting removed,
+ * so I would suggest not using it until this text (and the WIP part) is removed. + * + * @author shinoow + * + * @since 1.5 + */ +public interface IEnergyAmplifier { + + /** + * Gets the amplifier type associated with the block + */ + public AmplifierType getAmplifierType(); +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyContainer.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyContainer.java new file mode 100644 index 00000000..4afa0772 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyContainer.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy; + +/** + * Interface to use on tile entities that can hold Potential Energy (WIP)
+ * WARNING: Any methods in this interface might end up getting removed,
+ * so I would suggest not using it until this text (and the WIP part) is removed. + * + * @author shinoow + * + * @since 1.4.5 + */ +public interface IEnergyContainer { + + /** + * Gets the Potential Energy contained within the tile entity + */ + public float getContainedEnergy(); + + /** + * Gets the maximum Potential Energy the tile entity can hold + */ + public int getMaxEnergy(); + + /** + * Adds Potential Energy to the tile entity + * @param energy Energy quota to add + */ + public void addEnergy(float energy); + + /** + * Consumes (removes) Potential Energy from the tile entity + * @param energy Energy quota to consume + */ + public void consumeEnergy(float energy); + + /** + * Returns Whether or not this container can accept Potential Energy + */ + public boolean canAcceptPE(); + + /** + * Returns whether or not this container can transfer Potential Energy + */ + public boolean canTransferPE(); +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyContainerItem.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyContainerItem.java new file mode 100644 index 00000000..284be2d2 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyContainerItem.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy; + +import net.minecraft.item.ItemStack; + +/** + * Interface to use on items that can hold Potential Energy (WIP)
+ * WARNING: Any methods in this interface might end up getting removed,
+ * so I would suggest not using it until this text (and the WIP part) is removed. + * + * @author shinoow + * + * @since 1.7.5 + */ +public interface IEnergyContainerItem { + + /** + * Gets the Potential Energy contained within the item + * @param stack ItemStack containing the item + */ + public float getContainedEnergy(ItemStack stack); + + /** + * Gets the maximum Potential Energy the item can hold + * @param stack ItemStack containing the item + */ + public int getMaxEnergy(ItemStack stack); + + /** + * Adds Potential Energy to the item + * @param stack ItemStack containing the item + * @param energy Energy quanta to add + */ + public void addEnergy(ItemStack stack, float energy); + + /** + * Consumes (removes) Potential Energy from the item + * @param stack ItemStack containing the item + * @param energy Energy quanta to consume + */ + public void consumeEnergy(ItemStack stack, float energy); + + /** + * Returns Whether or not this item can accept Potential Energy + */ + public boolean canAcceptPE(ItemStack stack); + + /** + * Returns Whether or not this item can transfer Potential Energy + */ + public boolean canTransferPE(ItemStack stack); +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyManipulator.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyManipulator.java new file mode 100644 index 00000000..515867bf --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyManipulator.java @@ -0,0 +1,84 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy; + +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.AmplifierType; +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.DeityType; + +/** + * Interface to use on tile entities that can manipulate Ley Lines (WIP)
+ * WARNING: Any methods in this interface might end up getting removed,
+ * so I would suggest not using it until this text (and the WIP part) is removed. + * + * @author shinoow + * + * @since 1.4.5 + */ +public interface IEnergyManipulator { + + /** + * Gets the quanta of Potential Energy that the tile entity can drain + */ + public float getEnergyQuanta(); + + /** + * Activates the Amplifier boost + * @param amp Current Amplifier + * @param deity Current Deity + */ + public void setActive(AmplifierType amp, DeityType deity); + + /** + * Checks if the Amplifier boost is active + */ + public boolean isActive(); + + /** + * Returns the Deity associated with this manipulator (can be null) + */ + public DeityType getDeity(); + + /** + * Used to calculate Amplification through Charms.
+ * Should be called whenever something that can be amplified is calculated. + * @param type Type to check + */ + public float getAmplifier(AmplifierType type); + + /** + * Returns the Active Deity (assigned in {@link #setActive(AmplifierType, DeityType)}) + */ + public DeityType getActiveDeity(); + + /** + * Returns the active Deity (assigned in {@link #setActive(AmplifierType, DeityType)}) + */ + public AmplifierType getActiveAmplifier(); + + /** + * Sets the Active Deity + * @param deity Deity Type + */ + public void setActiveDeity(DeityType deity); + + /** + * Sets the Active Amplifier + * @param amplifier Amplifier Type + */ + public void setActiveAmplifier(AmplifierType amplifier); + + /** + * Something bad that has the potential of happening + * @param factor A random occasion (could be 5% trigger chance if activated etc) + */ + public void disrupt(boolean factor); +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyRelay.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyRelay.java new file mode 100644 index 00000000..e2d1417b --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyRelay.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy; + +import net.minecraft.util.EnumFacing; + +/** + * Interface to use on tile entities that can transport Potential Energy (WIP)
+ * WARNING: Any methods in this interface might end up getting removed,
+ * so I would suggest not using it until this text (and the WIP part) is removed. + * + * @author shinoow + * + * @since 1.7.5 + */ +public interface IEnergyRelay { + + public void transportPE(EnumFacing facing); + + public boolean canTransport(EnumFacing facing); +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyTransporterItem.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyTransporterItem.java new file mode 100644 index 00000000..cdf2047f --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/IEnergyTransporterItem.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy; + +import net.minecraft.item.ItemStack; + +/** + * Interface to use on items that can transport Potential Energy externally (WIP)
+ * WARNING: Any methods in this interface might end up getting removed,
+ * so I would suggest not using it until this text (and the WIP part) is removed. + * + * @author shinoow + * + * @since 1.7.5 + */ +public interface IEnergyTransporterItem extends IEnergyContainerItem { + + /** + * Returns whether or not the item can accept Potential Energy externally
+ * (eg. a PE manipulator that transfers PE to a player's held item) + * @param stack ItemStack containing the item + */ + public boolean canAcceptPEExternally(ItemStack stack); + + /** + * Returns whether or not the item can transfer Potential Energy externally
+ * (eg. a Ritual Altar draining PE from a Necronomicon during a ritual) + * @param stack ItemStack containing the item + */ + public boolean canTransferPEExternally(ItemStack stack); +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/PEUtils.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/PEUtils.java new file mode 100644 index 00000000..b924720a --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/PEUtils.java @@ -0,0 +1,247 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.util.ITickable; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import com.google.common.collect.Lists; +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.AmplifierType; +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.DeityType; +import com.shinoow.abyssalcraft.api.entity.EntityUtil; + +/** + * Backbone for handling interactions between
+ * various PE mechanics + * @author shinoow + * + */ +public class PEUtils { + + /** + * Attempts to transfer PE from a Manipulator to nearby Players + * @param world Current World + * @param pos Current BlockPos + * @param manipulator PE Manipulator + * @param range Transfer Range + */ + public static void transferPEToNearbyPlayers(World world, BlockPos pos, IEnergyManipulator manipulator, int range){ + + int xp = pos.getX(); + int yp = pos.getY(); + int zp = pos.getZ(); + + List players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(pos).expand(range, range, range)); + + for(EntityPlayer player : players) + if(EntityUtil.hasNecronomicon(player)){ + ItemStack item = player.getHeldItem(EnumHand.MAIN_HAND); + ItemStack item1 = player.getHeldItem(EnumHand.OFF_HAND); + if(item != null && item.getItem() instanceof IEnergyTransporterItem || + item1 != null && item1.getItem() instanceof IEnergyTransporterItem){ + if(!world.isRemote){ + transferPEToStack(item, manipulator); + transferPEToStack(item1, manipulator); + } + for(double i = 0; i <= 0.7; i += 0.03) { + int xPos = xp < (int) player.posX ? 1 : xp > (int) player.posX ? -1 : 0; + int yPos = yp < (int) player.posY ? 1 : yp > (int) player.posY ? -1 : 0; + int zPos = zp < (int) player.posZ ? 1 : zp > (int) player.posZ ? -1 : 0; + double x = i * Math.cos(i) / 2 * xPos; + double y = i * Math.sin(i) / 2 * yPos; + double z = i * Math.sin(i) / 2 * zPos; + world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, xp + 0.5, yp + 0.5, zp + 0.5, x, y, z); + } + } + } + } + + /** + * Shortcut method for Transferring PE to an ItemStack + * @param stack ItemStack to potentially transfer PE to + * @param manipulator PE Manipulator to transfer said PE + */ + private static void transferPEToStack(ItemStack stack, IEnergyManipulator manipulator){ + if(stack != null && stack.getItem() instanceof IEnergyTransporterItem) + if(((IEnergyTransporterItem) stack.getItem()).canAcceptPEExternally(stack) && + ((IEnergyTransporterItem) stack.getItem()).getContainedEnergy(stack) < ((IEnergyTransporterItem) stack.getItem()).getMaxEnergy(stack)) + ((IEnergyTransporterItem) stack.getItem()).addEnergy(stack, manipulator.getEnergyQuanta()); + } + + /** + * Attempts to transfer PE from a Manipulator to nearby Collectors + * @param world Current World + * @param pos Current BlockPos + * @param manipulator PE Manipulator + * @param boost Any range boost applied to the manipulator + */ + public static void transferPEToCollectors(World world, BlockPos pos, IEnergyManipulator manipulator, int boost){ + + int xp = pos.getX(); + int yp = pos.getY(); + int zp = pos.getZ(); + + List collectors = Lists.newArrayList(); + + for(int x = -1*(3+boost); x <= 3+boost; x++) + for(int y = 0; y <= getRangeAmplifiers(world, pos); y++) + for(int z = -1*(3+boost); z <= 3+boost; z++) + if(x < -2 || x > 2 || z < -2 || z > 2) + if(isCollector(world.getTileEntity(new BlockPos(xp + x, yp - y, zp + z)))) + collectors.add(world.getTileEntity(new BlockPos(xp + x, yp - y, zp + z))); + + for(TileEntity tile : collectors) + if(checkForAdjacentCollectors(world, tile.getPos())) + if(world.rand.nextInt(120-(int)(20 * manipulator.getAmplifier(AmplifierType.DURATION))) == 0) + if(((IEnergyContainer) tile).getContainedEnergy() < ((IEnergyContainer) tile).getMaxEnergy()){ + if(!world.isRemote) + ((IEnergyContainer) tile).addEnergy(manipulator.getEnergyQuanta()); + for(double i = 0; i <= 0.7; i += 0.03) { + int xPos = xp < tile.getPos().getX() ? 1 : xp > tile.getPos().getX() ? -1 : 0; + int yPos = yp < tile.getPos().getY() ? 1 : yp > tile.getPos().getY() ? -1 : 0; + int zPos = zp < tile.getPos().getZ() ? 1 : zp > tile.getPos().getZ() ? -1 : 0; + double x = i * Math.cos(i) / 2 * xPos; + double y = i * Math.sin(i) / 2 * yPos; + double z = i * Math.sin(i) / 2 * zPos; + world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, xp + 0.5, yp + 0.5, zp + 0.5, x, y, z); + } + } + } + + /** + * Utility method for clearing the active Deity and Amplifier
+ * when a PE Manipulator no longer is active. Should be called in
+ * update() ({@link ITickable}) every tick to ensure the data is
+ * properly erased when it should be. + * @param manipulator PE Manipulator to reset + */ + public static void clearManipulatorData(IEnergyManipulator manipulator){ + if(!manipulator.isActive()){ + NBTTagCompound tag = new NBTTagCompound(); + ((TileEntity) manipulator).writeToNBT(tag); + tag.setString("Deity", ""); + tag.setString("Amplifier", ""); + manipulator.setActiveDeity(null); + manipulator.setActiveAmplifier(null); + ((TileEntity) manipulator).readFromNBT(tag); + } + } + + /** + * Utility method for reading specific NBT data in a PE Manipulator.
+ * Call in your TE's readFromNBT! + * @param manipulator PE Manipulator + * @param compound NBT Tag Compound + */ + public static void readManipulatorNBT(IEnergyManipulator manipulator, NBTTagCompound compound){ + if(compound.hasKey("ActiveDeity") && !compound.getString("ActiveDeity").equals("")) + manipulator.setActiveDeity(DeityType.valueOf(compound.getString("ActiveDeity"))); + if(compound.hasKey("ActiveAmplifier") && !compound.getString("ActiveAmplifier").equals("")) + manipulator.setActiveAmplifier(AmplifierType.valueOf(compound.getString("ActiveAmplifier"))); + } + + /** + * Utility method for writing specific NBT data in a PE Manipulator.
+ * Call in your TE's writeToNBT! + * @param manipulator PE Manipulator + * @param compound NBT Tag Compound + */ + public static void writeManipulatorNBT(IEnergyManipulator manipulator, NBTTagCompound compound){ + if(manipulator.getActiveDeity() != null) + compound.setString("ActiveDeity", manipulator.getActiveDeity().name()); + if(manipulator.getActiveAmplifier() != null) + compound.setString("ActiveAmplifier", manipulator.getActiveAmplifier().name()); + } + + /** + * Checks for any range amplifying blocks below a specific BlockPos + * @param world Current World + * @param pos Current BlockPos + * @return A number between 0 and 2, representing the amount of range amplifiers below this BlockPos + */ + public static int getRangeAmplifiers(World world, BlockPos pos){ + Block block1 = world.getBlockState(new BlockPos(pos.getX(), pos.getY() - 1, pos.getZ())).getBlock(); + Block block2 = world.getBlockState(new BlockPos(pos.getX(), pos.getY() - 2, pos.getZ())).getBlock(); + int num = 0; + if(block1 != null && block1 instanceof IEnergyAmplifier && + ((IEnergyAmplifier) block1).getAmplifierType() == AmplifierType.RANGE) + num = 1; + if(block1 != null && block1 instanceof IEnergyAmplifier && + ((IEnergyAmplifier) block1).getAmplifierType() == AmplifierType.RANGE + && block2 != null && block2 instanceof IEnergyAmplifier && + ((IEnergyAmplifier) block2).getAmplifierType() == AmplifierType.RANGE) + num = 2; + return num; + } + + /** + * Checks if a TileEntity is a PE Collector (extends IEnergyContainer and can accept PE) + * @param tile TileEntity to check + * @return True if the TileEntity is a PE Collector, otherwise false + */ + public static boolean isCollector(TileEntity tile){ + if(tile != null) return tile instanceof IEnergyContainer && ((IEnergyContainer)tile).canAcceptPE(); + return false; + } + + /** + * Checks if a TileEntity is a PE Manipulator (extends IEnergyManipulator) + * @param tile TileEntity to check + * @return True if the TileEntity is a PE Manipulator, otherwise false + */ + public static boolean isManipulator(TileEntity tile){ + if(tile != null) return tile instanceof IEnergyManipulator; + return false; + } + + /** + * Checks that the BlockPos has no adjacent PE Collectors + * @param world Current World + * @param pos Current BlockPos + * @return True if the BlockPos has no adjacent PE Collectors, otherwise false + */ + public static boolean checkForAdjacentCollectors(World world, BlockPos pos){ + for(EnumFacing face : EnumFacing.values()) + if(isCollector(world.getTileEntity(pos.offset(face)))) + return false; + return true; + } + + /** + * Checks that the BlockPos has no adjacent PE Manipulators + * @param world Current World + * @param pos Current BlockPos + * @return True if the BlockPos has no adjacent PE Manipulators, otherwise false + */ + public static boolean checkForAdjacentManipulators(World world, BlockPos pos){ + for(EnumFacing face : EnumFacing.values()) + if(isManipulator(world.getTileEntity(pos.offset(face)))) + return false; + if(isManipulator(world.getTileEntity(pos.up(2)))) //Might remove this extra check + return false; + if(isManipulator(world.getTileEntity(pos.down(2)))) // ^ + return false; + return true; + } +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionEntry.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionEntry.java new file mode 100644 index 00000000..20f2f2e9 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionEntry.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy.disruption; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.translation.I18n; +import net.minecraft.world.World; + +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.DeityType; + +/** + * A Disruption Entry + * @author shinoow + * + * @since 1.5 + */ +public abstract class DisruptionEntry { + + private DeityType deity; + private String unlocalizedName; + + /** + * A Disruption Entry + * @param unlocalizedName A String representing the disruption name (mainly used for Necronomicon categorization) + * @param deity Deity whose image must be present for this to happen + */ + public DisruptionEntry(String unlocalizedName, DeityType deity){ + this.deity = deity; + this.unlocalizedName = unlocalizedName; + } + + /** + * Fetches the Deity this disruption is limited to.
+ * (If null, there's no limit) + */ + public DeityType getDeity(){ + return deity; + } + + /** + * Used to fetch the unlocalized name for a disruption + * @return A string prefixed by "ac.disruption." + */ + public String getUnlocalizedName(){ + return "ac.disruption." + unlocalizedName; + } + + /** + * Used to fetch the localized name for a disruption + * @return A localized string representing a name + */ + public String getLocalizedName(){ + return I18n.translateToLocal(getUnlocalizedName()); + } + + /** + * Used to fetch the description for the disruption + * @return A localized string representing a description + */ + public String getDescrption(){ + return I18n.translateToLocal(getUnlocalizedName() + ".desc"); + } + + /** + * This is where all the evil things happen + * @param world Current World + * @param pos Current BlockPos + * @param players Nearby Players (16 block range or larger) + */ + public abstract void disrupt(World world, BlockPos pos, List players); +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionHandler.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionHandler.java new file mode 100644 index 00000000..defb9849 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionHandler.java @@ -0,0 +1,95 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy.disruption; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.FMLLog; + +import org.apache.logging.log4j.Level; + +import com.google.common.collect.Lists; +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.DeityType; +import com.shinoow.abyssalcraft.api.event.ACEvents.DisruptionEvent; + +/** + * Handler for disruptions (when something bad happens during Potential Energy manipulation) + * @author shinoow + * + * @since 1.5 + */ +public class DisruptionHandler { + + private List disruptions = Lists.newArrayList(); + + private static final DisruptionHandler instance = new DisruptionHandler(); + + public static DisruptionHandler instance(){ + return instance; + } + + /** + * Registers a Disruption Entry + * @param disruption The Disruption + * + * @since 1.5 + */ + public void registerDisruption(DisruptionEntry disruption){ + for(DisruptionEntry entry : disruptions) + if(disruption.getUnlocalizedName().equals(entry.getUnlocalizedName())){ + FMLLog.log("DisruptionHandler", Level.ERROR, "Disruption Entry already registered: %s", disruption.getUnlocalizedName()); + return; + } + disruptions.add(disruption); + } + + /** + * Used to fetch a list of disruptions + * @return An ArrayList containing all registered Disruptions + * + * @since 1.5 + */ + public List getDisruptions(){ + return disruptions; + } + + /** + * Generates a Disruption + * @param deity Deity tied to the manipulator + * @param world Current World + * @param pos Current BlockPos + * @param players Nearby players (16 block radius or larger) + * + * @since 1.5 + */ + public void generateDisruption(DeityType deity, World world, BlockPos pos, List players){ + List dis = Lists.newArrayList(); + + if(deity == null){ + for(DisruptionEntry entry : disruptions) + if(entry.getDeity() == null) + dis.add(entry); + } else + for(DisruptionEntry entry : disruptions) + if(entry.getDeity() == deity || entry.getDeity() == null) + dis.add(entry); + + DisruptionEntry disruption = dis.get(world.rand.nextInt(dis.size())); + + if(!MinecraftForge.EVENT_BUS.post(new DisruptionEvent(deity, world, pos, players, disruption))) + disruption.disrupt(world, pos, players); + } +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionPotion.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionPotion.java new file mode 100644 index 00000000..027a9a71 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionPotion.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy.disruption; + +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.DeityType; +import com.shinoow.abyssalcraft.api.entity.EntityUtil; + +/** + * A Potion Disruption Entry + * @author shinoow + * + * @since 1.5 + */ +public class DisruptionPotion extends DisruptionEntry { + + private Potion potion; + + /** + * A Potion Disruption Entry + * @param unlocalizedName A String representing the disruption name (mainly used for Necronomicon categorization) + * @param deity Deity whose image must be present for this to happen + * @param potion A Potion Effect + */ + public DisruptionPotion(String unlocalizedName, DeityType deity, Potion potion) { + super(unlocalizedName, deity); + this.potion = potion; + } + + @Override + public void disrupt(World world, BlockPos pos, List players) { + + if(!world.isRemote){ + List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(pos).expand(16, 16, 16)); + + for(EntityLivingBase entity : entities) + if(!EntityUtil.isEntityImmune(entity, potion)) + entity.addPotionEffect(new PotionEffect(potion, 600)); + } + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionSpawn.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionSpawn.java new file mode 100644 index 00000000..b8b44121 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionSpawn.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy.disruption; + +import java.lang.reflect.InvocationTargetException; +import java.util.List; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.DeityType; + +/** + * A Spawning Disruption Entry + * @author shinoow + * + * @since 1.5 + */ +public class DisruptionSpawn extends DisruptionEntry { + + private Class entity; + + /** + * A Spawning Disruption Entry + * @param unlocalizedName A String representing the disruption name (mainly used for Necronomicon categorization) + * @param deity Deity whose image must be present for this to happen + * @param entity The Entity to spawn + */ + public DisruptionSpawn(String unlocalizedName, DeityType deity, Class entity) { + super(unlocalizedName, deity); + this.entity = entity; + } + + @Override + public void disrupt(World world, BlockPos pos, List players) { + + if(!world.isRemote){ + EntityLivingBase entityliving = null; + try { + entityliving = entity.getConstructor(World.class).newInstance(world); + } catch (InstantiationException | IllegalAccessException + | IllegalArgumentException | InvocationTargetException + | NoSuchMethodException | SecurityException e) { + e.printStackTrace(); + } + if(entityliving != null){ + entityliving.setLocationAndAngles(pos.getX(), pos.getY() + 1, pos.getZ(), entityliving.rotationYaw, entityliving.rotationPitch); + ((EntityLiving) entityliving).onInitialSpawn(world.getDifficultyForLocation(pos.up()), (IEntityLivingData)null); + world.spawnEntityInWorld(entityliving); + } + } + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionSwarm.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionSwarm.java new file mode 100644 index 00000000..c63e8871 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/DisruptionSwarm.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.energy.disruption; + +import java.lang.reflect.InvocationTargetException; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.DeityType; + +/** + * A Swarm Disruption Entry + * @author shinoow + * + * @since 1.5 + */ +public class DisruptionSwarm extends DisruptionEntry { + + private Class[] entities; + + /** + * A Spawning Disruption Entry + * @param unlocalizedName A String representing the disruption name (mainly used for Necronomicon categorization) + * @param deity Deity whose image must be present for this to happen + * @param entities An array of entities to spawn + */ + public DisruptionSwarm(String unlocalizedName, DeityType deity, Class...entities) { + super(unlocalizedName, deity); + this.entities = entities; + } + + private int randomNum(Random rand){ + return rand.nextBoolean() ? 3 : -3; + } + + @Override + public void disrupt(World world, BlockPos pos, List players) { + + if(!world.isRemote) + for(Class clazz : entities) + for(int i = 0; i < 4; i++) + try { + EntityLivingBase entity = clazz.getConstructor(World.class).newInstance(world); + BlockPos pos1 = new BlockPos(pos.getX() + randomNum(world.rand), pos.getY() + 1, pos.getZ() + randomNum(world.rand)); + entity.setLocationAndAngles(pos1.getX(), pos1.getY(), pos1.getZ(), entity.rotationYaw, entity.rotationPitch); + ((EntityLiving) entity).onInitialSpawn(world.getDifficultyForLocation(pos1), (IEntityLivingData)null); + world.spawnEntityInWorld(entity); + } catch (InstantiationException | IllegalAccessException + | IllegalArgumentException + | InvocationTargetException | NoSuchMethodException + | SecurityException e) { + e.printStackTrace(); + } + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/package-info.java new file mode 100644 index 00000000..276a6b00 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/disruption/package-info.java @@ -0,0 +1,4 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.energy.disruption; +import net.minecraftforge.fml.common.API; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/energy/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/energy/package-info.java new file mode 100644 index 00000000..7ac362a4 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/energy/package-info.java @@ -0,0 +1,4 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.energy; +import net.minecraftforge.fml.common.API; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/entity/EntityUtil.java b/src/api/java/com/shinoow/abyssalcraft/api/entity/EntityUtil.java new file mode 100644 index 00000000..5a24da3a --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/entity/EntityUtil.java @@ -0,0 +1,137 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.entity; + +import java.util.List; +import java.util.UUID; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.*; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.launchwrapper.Launch; +import net.minecraft.potion.Potion; + +import com.google.common.collect.Lists; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; +import com.shinoow.abyssalcraft.api.item.ACItems; + +/** + * Utility class for handling things regarding entities.
+ * Also handles the Lesser Shoggoth Food list. + * @author shinoow + * + * @since 1.7.5 + * + */ +public final class EntityUtil { + + private EntityUtil(){} + + private static List> shoggothFood = Lists.newArrayList(); + + /** + * Checks if the Entity is immune to the Coralium Plague + * @param par1 The Entity to check + * @return True if the Entity is immune, otherwise false + */ + public static boolean isEntityCoralium(EntityLivingBase par1){ + return par1 instanceof ICoraliumEntity || par1 instanceof EntityPlayer && isPlayerCoralium((EntityPlayer)par1); + } + + /** + * Checks if a Player has a certain name, and nulls the Coralium Plague if they do + * @param par1 The Player to check + * @return True if the Player has a certain name, otherwise false + */ + public static final boolean isPlayerCoralium(EntityPlayer par1){ + if(Vars.dev) + return par1.getName().equals("shinoow") || par1.getName().equals("Oblivionaire"); + else return par1.getUniqueID().equals(Vars.uuid1) || par1.getUniqueID().equals(Vars.uuid2); + } + + /** + * Checks if the Entity is immune to the Dread Plague + * @param par1 The Entity to check + * @return True if the Entity is immune, otherwise false + */ + public static boolean isEntityDread(EntityLivingBase par1){ + return par1 instanceof IDreadEntity; + } + + /** + * Checks if the Entity is immune to Antimatter + * @param par1 The Entity to check + * @return True if the Entity is immune, otherwise false + */ + public static boolean isEntityAnti(EntityLivingBase par1){ + return par1 instanceof IAntiEntity; + } + + /** + * Checks if a Player has a Necronomicon + * @param player The Player to check + * @return True if the Player has a Necronomicon, otherwise false + */ + public static boolean hasNecronomicon(EntityPlayer player){ + return player.inventory.hasItemStack(new ItemStack(ACItems.necronomicon)) || player.inventory.hasItemStack(new ItemStack(ACItems.abyssal_wasteland_necronomicon)) + || player.inventory.hasItemStack(new ItemStack(ACItems.dreadlands_necronomicon)) || player.inventory.hasItemStack(new ItemStack(ACItems.omothol_necronomicon)) + || player.inventory.hasItemStack(new ItemStack(ACItems.abyssalnomicon)); + } + + /** + * Simplified way to crosscheck if a Entity is immune to a Potion before trying to apply it
+ * (applies to AbyssalCraft Potions only) + * @param entity The Entity to check + * @param potion The Potion to check + * @return True if the Entity is immune, otherwise false + */ + public static boolean isEntityImmune(EntityLivingBase entity, Potion potion){ + return potion == AbyssalCraftAPI.coralium_plague && isEntityCoralium(entity) || + potion == AbyssalCraftAPI.dread_plague && isEntityDread(entity) || + potion == AbyssalCraftAPI.antimatter_potion && isEntityAnti(entity); + } + + /** + * Adds the entity to a list of entities that the Lesser Shoggoth eats + * (Note: It's useless to add your entity here if it extends {@link EntityAnimal}, {@link EntityAmbientCreature}, {@link EntityWaterMob} or {@link EntityTameable}). + * If your Entity's superclass is a subclass of EntityTameable, you will need to add the superclass. + * @param clazz The potential "food" for the Lesser Shoggoth + */ + public static void addShoggothFood(Class clazz){ + shoggothFood.add(clazz); + } + + /** + * Used by the Lesser Shoggoth to fetch a list of things to eat + * @return An ArrayList containing Entity classes + */ + public static List> getShoggothFood(){ + return shoggothFood; + } + + /** + * Checks if the Entity class, it's superclass or it's superclass' superclass is food + * @param entity The Entity to check + * @return true if the Entity is food, otherwise false + */ + public static boolean isShoggothFood(EntityLivingBase entity){ + return shoggothFood.contains(entity.getClass()) ? true : shoggothFood.contains(entity.getClass().getSuperclass()) ? true : + shoggothFood.contains(entity.getClass().getSuperclass().getSuperclass()) ? true : false; + } + + static class Vars{ + static boolean dev = (Boolean)Launch.blackboard.get("fml.deobfuscatedEnvironment"); + static UUID uuid1 = UUID.fromString("a5d8abca-0979-4bb0-825a-f1ccda0b350b"); + static UUID uuid2 = UUID.fromString("08f3211c-d425-47fd-afd8-f0e7f94152c4"); + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/entity/IAntiEntity.java b/src/api/java/com/shinoow/abyssalcraft/api/entity/IAntiEntity.java new file mode 100644 index 00000000..830b44a3 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/entity/IAntiEntity.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.entity; + +/** + * Interface to define a entity that's immune to the Antimatter potion effect + * + * @author shinoow + * + * @since 1.0 + */ +public interface IAntiEntity { + +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/entity/ICoraliumEntity.java b/src/api/java/com/shinoow/abyssalcraft/api/entity/ICoraliumEntity.java new file mode 100644 index 00000000..37f4c0d8 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/entity/ICoraliumEntity.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.entity; + +/** + * Interface to define a entity that's immune to the Coralium Plague + * + * @author shinoow + * + * @since 1.0 + */ +public interface ICoraliumEntity { + +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/entity/IDreadEntity.java b/src/api/java/com/shinoow/abyssalcraft/api/entity/IDreadEntity.java new file mode 100644 index 00000000..bcdab671 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/entity/IDreadEntity.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.entity; + +/** + * Interface to define a entity that's immune to the Dread Plague + * + * @author shinoow + * + * @since 1.0 + */ +public interface IDreadEntity { + +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/entity/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/entity/package-info.java new file mode 100644 index 00000000..b8862a8e --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/entity/package-info.java @@ -0,0 +1,4 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.entity; +import net.minecraftforge.fml.common.API; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/event/ACEvents.java b/src/api/java/com/shinoow/abyssalcraft/api/event/ACEvents.java new file mode 100644 index 00000000..5c244fd8 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/event/ACEvents.java @@ -0,0 +1,325 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.event; + +import java.util.List; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.event.terraingen.BiomeEvent.GetVillageBlockID; +import net.minecraftforge.fml.common.eventhandler.Cancelable; +import net.minecraftforge.fml.common.eventhandler.Event; + +import com.shinoow.abyssalcraft.api.energy.EnergyEnum.DeityType; +import com.shinoow.abyssalcraft.api.energy.disruption.DisruptionEntry; +import com.shinoow.abyssalcraft.api.ritual.NecronomiconRitual; + +/** + * A class containing events used by AbyssalCraft.
+ * All events are fired on the {@link MinecraftForge#EVENT_BUS}. + * + * @author shinoow + * + * @since 1.4 + */ +public class ACEvents { + + /** + * ItemTransmutedEvent is fired when a player picks up an Item from the output slot of a Transmutator.
+ *
+ * {@link #transmuted} contains the Item found in the Transmutator output slot.
+ *
+ * This event is not {@link Cancelable}. + *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + * + * @author shinoow + * + * @since 1.4 + */ + public static class ItemTransmutedEvent extends PlayerEvent { + + private final ItemStack transmuted; + + public ItemTransmutedEvent(EntityPlayer player, ItemStack crafting){ + super(player); + transmuted = crafting; + } + + public ItemStack getTransmutedStack(){ + return transmuted; + } + } + + /** + * ItemCrystallizedEvent is fired when a player picks up an Item from the output slot of a Crystallizer.
+ *
+ * {@link #crystallized} contains the Item found in the Crystallizer output slot.
+ *
+ * This event is not {@link Cancelable}. + *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + * + * @author shinoow + * + * @since 1.4 + */ + public static class ItemCrystallizedEvent extends PlayerEvent { + + private final ItemStack crystallized; + + public ItemCrystallizedEvent(EntityPlayer player, ItemStack crafting){ + super(player); + crystallized = crafting; + } + + public ItemStack getCrystallizedStack(){ + return crystallized; + } + } + + /** + * ItemEngravedEvent is fired when a player picks up an Item from the output slot of an Engraver.
+ *
+ * {@link #engraved} contains the Item found in the Engraver output slot.
+ *
+ * This event is not {@link Cancelable}. + *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + * + * @author shinoow + * + * @since 1.4 + */ + public static class ItemEngravedEvent extends PlayerEvent { + + private final ItemStack engraved; + + public ItemEngravedEvent(EntityPlayer player, ItemStack crafting){ + super(player); + engraved = crafting; + } + + public ItemStack getEngravedStack(){ + return engraved; + } + } + + /** + * ItemMaterializedEvent is fired when a player picks up an Item from the output slot of a Materializer.
+ *
+ * {@link #materialized} contains the Item found in the Materializer output slot.
+ *
+ * This event is not {@link Cancelable}. + *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + * + * @author shinoow + * + * @since 1.4 + */ + public static class ItemMaterializedEvent extends PlayerEvent { + + private final ItemStack materialized; + + public ItemMaterializedEvent(EntityPlayer player, ItemStack crafting){ + super(player); + materialized = crafting; + } + + public ItemStack getMaterializedStack(){ + return materialized; + } + } + + /** + * RitualEvent is fired when Necronomicon Rituals are performed.
+ * {@link RitualEvent.Pre} is fired before the Ritual is performed.
+ * {@link RitualEvent.Post} is fired before the Ritual is completed.
+ *
+ * {@link #ritual} contains the ritual being performed.
+ * {@link #world} contains the world at which this event is occurring.
+ * {@link #pos} contains the BlockPos at which this event is occurring.
+ *
+ * Any child event of this event is {@link Cancelable}. + *
+ * If cancelled, the ritual won't be performed/won't complete.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + * + * @author shinoow + * + * @since 1.4 + */ + public static class RitualEvent extends PlayerEvent { + private final NecronomiconRitual ritual; + private final World world; + private final BlockPos pos; + + public RitualEvent(EntityPlayer player, NecronomiconRitual ritual, World world, BlockPos pos){ + super(player); + this.ritual = ritual; + this.world = world; + this.pos = pos; + } + + public NecronomiconRitual getRitual(){ + return ritual; + } + + public World getWorld(){ + return world; + } + + public BlockPos getPos(){ + return pos; + } + + @Cancelable + public static class Pre extends RitualEvent { + + public Pre(EntityPlayer player, NecronomiconRitual ritual, World world, BlockPos pos) { + super(player, ritual, world, pos); + } + } + + @Cancelable + public static class Post extends RitualEvent { + + public Post(EntityPlayer player, NecronomiconRitual ritual, World world, BlockPos pos) { + super(player, ritual, world, pos); + } + } + } + + /** + * DisruptionEvent is fired before a Disruption is triggered.
+ *
+ * {@link #deity} contains the Deity Type for this particular Disruption (can be null).
+ * {@link #world} contains the world at which this event is occurring.
+ * {@link #pos} contains the BlockPos at which this event is occurring.
+ * {@link #players} contains a list of nearby players where this event is occurring (can be empty).
+ * {@link #disruption} contains the Disruption about to be triggered after this event.
+ *
+ * This event is {@link Cancelable}. + *
+ * If cancelled, the Disruption won't occur.
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + * + * @author shinoow + * + * @since 1.7.5 + */ + @Cancelable + public static class DisruptionEvent extends Event { + private final DeityType deity; + private final World world; + private final BlockPos pos; + private final List players; + private final DisruptionEntry disruption; + + public DisruptionEvent(DeityType deity, World world, BlockPos pos, List players, DisruptionEntry disruption){ + this.deity = deity; + this.world = world; + this.pos = pos; + this.players = players; + this.disruption = disruption; + } + + public DeityType getDeityType(){ + return deity; + } + + public World getWorld(){ + return world; + } + + public BlockPos getPos(){ + return pos; + } + + public List getPlayers(){ + return players; + } + + public DisruptionEntry getDisruption(){ + return disruption; + } + } + + /** + * ShoggothOoze is fired before a Lesser Shoggoth places down a Ooze block.
+ *
+ * {@link #world} contains the world at which this event is occurring.
+ * {@link #pos} contains the BlockPos at which this event is occurring.
+ * {@link #replace} contains a possible replacement for the ooze.
+ *
+ * This event is {@link Cancelable}. + *
+ * If cancelled, the replacement block will be used (alternatively, nothing happens if there's no replacement).
+ *
+ * This event is used like {@link GetVillageBlockID} (apart from this one requiring a call to setCancelled() instead of setResult()).
+ *
+ * This event does not have a result. {@link HasResult}
+ *
+ * This event is fired on the {@link MinecraftForge#EVENT_BUS}. + * + * @author shinoow + * + * @since 1.7.5 + */ + @Cancelable + public static class ShoggothOozeEvent extends Event { + private final World world; + private final BlockPos pos; + private IBlockState replace; + + public ShoggothOozeEvent(World world, BlockPos pos){ + this.world = world; + this.pos = pos; + } + + public World getWorld(){ + return world; + } + + public BlockPos getPos(){ + return pos; + } + + public IBlockState getReplacement(){ + return replace; + } + + public void setReplacement(IBlockState replace){ + this.replace = replace; + } + } +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/event/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/event/package-info.java new file mode 100644 index 00000000..c4baad54 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/event/package-info.java @@ -0,0 +1,4 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.event; +import net.minecraftforge.fml.common.API; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/integration/ACPlugin.java b/src/api/java/com/shinoow/abyssalcraft/api/integration/ACPlugin.java new file mode 100644 index 00000000..ba7dc86a --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/integration/ACPlugin.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.integration; + +/** + * Simple annotation for handling integrations. Should be used together with
+ * the {@link IACPlugin} interface. Any class annotated with this will be picked
+ * up when AbyssalCraft is scanning for integrations. + * + * @author shinoow + * + * @since 1.6.5 + */ +public @interface ACPlugin {} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/integration/IACPlugin.java b/src/api/java/com/shinoow/abyssalcraft/api/integration/IACPlugin.java new file mode 100644 index 00000000..50f706e4 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/integration/IACPlugin.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.integration; + +/** + * Simple interface for handling integrations. Should be used together with the
+ * {@literal @}{@link ACPlugin} annotation.
+ * The integration plugins follow the standard FML lifecycle (apart from the pre-init
+ * method not being called by AbyssalCraft, so that you can call that yourself if
+ * the plugin adds any new Item/Block/Entity). + * + * @author shinoow + * + * @since 1.3 + */ +public interface IACPlugin { + + /** + * Used to fetch the mod name + * @return A String representing the mod's name + */ + public String getModName(); + + /** + * Determines whether or not this plugin can be loaded.
+ * Should normally just return true, but can have a different
+ * return value depending on factors (like a config option to load
+ * the plugin, or just checking if the mod the plugin's for is present). + * @return True if the plugin can be loaded, otherwise false. + */ + public boolean canLoad(); + + /** + * Won't be called by AbyssalCraft, allowing you to register any new Item/Block/Entity
+ * your plugin might add. Should be called at the pre-init stage. + */ + public void preInit(); + + /** + * Will be called at the end of the init stage + */ + public void init(); + + /** + * Will be called at the end of the post-init stage + */ + public void postInit(); +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/integration/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/integration/package-info.java new file mode 100644 index 00000000..64599854 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/integration/package-info.java @@ -0,0 +1,4 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.integration; +import net.minecraftforge.fml.common.API; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; diff --git a/src/api/java/com/shinoow/abyssalcraft/api/internal/DummyNecroDataHandler.java b/src/api/java/com/shinoow/abyssalcraft/api/internal/DummyNecroDataHandler.java new file mode 100644 index 00000000..5e055568 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/internal/DummyNecroDataHandler.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.internal; + +import com.shinoow.abyssalcraft.api.necronomicon.NecroData; +import com.shinoow.abyssalcraft.api.necronomicon.NecroData.Chapter; +import com.shinoow.abyssalcraft.api.necronomicon.NecroData.Page; + +public class DummyNecroDataHandler implements IInternalNecroDataHandler { + + @Override + public NecroData getInternalNecroData(String identifier){ return null; } + + @Override + public void addChapter(Chapter chapter, String identifier) {} + + @Override + public void removeChapter(String necroidentifier, String chapteridentifier) {} + + @Override + public void addPage(Page page, String necroidentifier, String chapteridentifier) {} + + @Override + public void removePage(int pageNum, String necroidentifier, String chapteridentifier) {} + + @Override + public void registerInternalPages() {} +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/internal/IInternalNecroDataHandler.java b/src/api/java/com/shinoow/abyssalcraft/api/internal/IInternalNecroDataHandler.java new file mode 100644 index 00000000..3a826ac2 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/internal/IInternalNecroDataHandler.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.internal; + +import com.shinoow.abyssalcraft.api.necronomicon.NecroData; +import com.shinoow.abyssalcraft.api.necronomicon.NecroData.Chapter; +import com.shinoow.abyssalcraft.api.necronomicon.NecroData.Page; + +public interface IInternalNecroDataHandler { + + /** + * Fetches an internal NecroData from the provided identifier + * @param identifier String representing the NecroData + */ + public NecroData getInternalNecroData(String identifier); + + /** + * Adds a Chapter to an internal NecroData + * @param chapter Chapter object + * @param identifier String representing the NecroData + */ + public void addChapter(Chapter chapter, String identifier); + + /** + * Removes a Chapter from an internal NecroData + * @param necroidentifier String representing the NecroData + * @param chapteridentifier String representing the Chapter + */ + public void removeChapter(String necroidentifier, String chapteridentifier); + + /** + * Adds a Page to a Chapter of an internal NecroData + * @param page Page object + * @param necroidentifier String representing the NecroData + * @param chapteridentifier String representing the Chapter + */ + public void addPage(Page page, String necroidentifier, String chapteridentifier); + + /** + * Removes a Page from a Chapter of an internal NecroData + * @param pageNum Page number + * @param necroidentifier String representing the NecroData + * @param chapteridentifier String representing the Chapter + */ + public void removePage(int pageNum, String necroidentifier, String chapteridentifier); + + /** + * Adds the internal pages to the internal NecroDatas.
+ * This method is fired at Init. + */ + public void registerInternalPages(); +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/internal/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/internal/package-info.java new file mode 100644 index 00000000..4354defa --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/internal/package-info.java @@ -0,0 +1,6 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.internal; +import net.minecraftforge.fml.common.API; + +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; + diff --git a/src/api/java/com/shinoow/abyssalcraft/api/item/ACItems.java b/src/api/java/com/shinoow/abyssalcraft/api/item/ACItems.java new file mode 100644 index 00000000..3b132b33 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/item/ACItems.java @@ -0,0 +1,226 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.item; + +import net.minecraft.item.Item; + +/** + * Contains all items added in AbyssalCraft + * + * @author shinoow + * + */ +public class ACItems { + + public static Item oblivion_catalyst; + public static Item gateway_key; + public static Item staff_of_the_gatekeeper; + public static Item liquid_coralium_bucket; + public static Item powerstone_tracker; + public static Item eye_of_the_abyss; + public static Item dreaded_gateway_key; + public static Item dreaded_shard_of_abyssalnite; + public static Item dreaded_chunk_of_abyssalnite; + public static Item chunk_of_abyssalnite; + public static Item abyssalnite_ingot; + public static Item coralium_gem; + public static Item coralium_gem_cluster_2; + public static Item coralium_gem_cluster_3; + public static Item coralium_gem_cluster_4; + public static Item coralium_gem_cluster_5; + public static Item coralium_gem_cluster_6; + public static Item coralium_gem_cluster_7; + public static Item coralium_gem_cluster_8; + public static Item coralium_gem_cluster_9; + public static Item coralium_pearl; + public static Item chunk_of_coralium; + public static Item refined_coralium_ingot; + public static Item coralium_plate; + public static Item transmutation_gem; + public static Item coralium_plagued_flesh; + public static Item coralium_plagued_flesh_on_a_bone; + public static Item darkstone_pickaxe; + public static Item darkstone_axe; + public static Item darkstone_shovel; + public static Item darkstone_sword; + public static Item darkstone_hoe; + public static Item abyssalnite_pickaxe; + public static Item abyssalnite_axe; + public static Item abyssalnite_shovel; + public static Item abyssalnite_sword; + public static Item abyssalnite_hoe; + public static Item refined_coralium_pickaxe; + public static Item refined_coralium_axe; + public static Item refined_coralium_shovel; + public static Item refined_coralium_sword; + public static Item refined_coralium_hoe; + public static Item abyssalnite_helmet; + public static Item abyssalnite_chestplate; + public static Item abyssalnite_leggings; + public static Item abyssalnite_boots; + public static Item dreaded_abyssalnite_helmet; + public static Item dreaded_abyssalnite_chestplate; + public static Item dreaded_abyssalnite_leggings; + public static Item dreaded_abyssalnite_boots; + public static Item refined_coralium_helmet; + public static Item refined_coralium_chestplate; + public static Item refined_coralium_leggings; + public static Item refined_coralium_boots; + public static Item plated_coralium_helmet; + public static Item plated_coralium_chestplate; + public static Item plated_coralium_leggings; + public static Item plated_coralium_boots; + public static Item depths_helmet; + public static Item depths_chestplate; + public static Item depths_leggings; + public static Item depths_boots; + public static Item cobblestone_upgrade_kit; + public static Item iron_upgrade_kit; + public static Item gold_upgrade_kit; + public static Item diamond_upgrade_kit; + public static Item abyssalnite_upgrade_kit; + public static Item coralium_upgrade_kit; + public static Item mre; + public static Item iron_plate; + public static Item chicken_on_a_plate; + public static Item pork_on_a_plate; + public static Item beef_on_a_plate; + public static Item fish_on_a_plate; + public static Item dirty_plate; + public static Item fried_egg; + public static Item fried_egg_on_a_plate; + public static Item washcloth; + public static Item shadow_fragment; + public static Item shadow_shard; + public static Item shadow_gem; + public static Item shard_of_oblivion; + public static Item coralium_longbow; + public static Item liquid_antimatter_bucket; + public static Item coralium_brick; + public static Item cudgel; + public static Item dreadium_ingot; + public static Item dread_fragment; + public static Item dreadium_helmet; + public static Item dreadium_chestplate; + public static Item dreadium_leggings; + public static Item dreadium_boots; + public static Item dreadium_pickaxe; + public static Item dreadium_axe; + public static Item dreadium_shovel; + public static Item dreadium_sword; + public static Item dreadium_hoe; + public static Item dreadium_upgrade_kit; + public static Item carbon_cluster; + public static Item dense_carbon_cluster; + public static Item methane; + public static Item nitre; + public static Item sulfur; + /** Metadata Item, 0 = Iron, 1 = Gold, 2 = Sulfur, 3 = Carbon, 4 = Oxygen, 5 = Hydrogen, 6 = Nitrogen, 7 = Phosphorus, + * 8 = Potassium, 9 = Nitrate, 10 = Methane, 11 = Redstone, 12 = Abyssalnite, 13 = Coralium, 14 = Dreadium, 15 = Blaze, + * 16 = Tin, 17 = Copper, 18 = Silicon, 19 = Magnesium, 20 = Aluminium, 21 = Silica, 22 = Alumina, 23 = Magnesia, 24 = Zinc */ + public static Item crystal; + /** Metadata Item, 0 = Iron, 1 = Gold, 2 = Sulfur, 3 = Carbon, 4 = Oxygen, 5 = Hydrogen, 6 = Nitrogen, 7 = Phosphorus, + * 8 = Potassium, 9 = Nitrate, 10 = Methane, 11 = Redstone, 12 = Abyssalnite, 13 = Coralium, 14 = Dreadium, 15 = Blaze, + * 16 = Tin, 17 = Copper, 18 = Silicon, 19 = Magnesium, 20 = Aluminium, 21 = Silica, 22 = Alumina, 23 = Magnesia, 24 = Zinc */ + public static Item crystal_shard; + public static Item dread_cloth; + public static Item dreadium_plate; + public static Item dreadium_katana_blade; + public static Item dreadium_katana_hilt; + public static Item dreadium_katana; + public static Item dread_plagued_gateway_key; + public static Item rlyehian_gateway_key; + public static Item dreadium_samurai_helmet; + public static Item dreadium_samurai_chestplate; + public static Item dreadium_samurai_leggings; + public static Item dreadium_samurai_boots; + public static Item tin_ingot; + public static Item copper_ingot; + public static Item anti_beef; + public static Item anti_chicken; + public static Item anti_pork; + public static Item rotten_anti_flesh; + public static Item anti_bone; + public static Item anti_spider_eye; + public static Item sacthoths_soul_harvesting_blade; + public static Item ethaxium_brick; + public static Item ethaxium_ingot; + public static Item life_crystal; + public static Item ethaxium_helmet; + public static Item ethaxium_chestplate; + public static Item ethaxium_leggings; + public static Item ethaxium_boots; + public static Item ethaxium_pickaxe; + public static Item ethaxium_axe; + public static Item ethaxium_shovel; + public static Item ethaxium_sword; + public static Item ethaxium_hoe; + public static Item ethaxium_upgrade_kit; + public static Item coin; + public static Item cthulhu_engraved_coin; + public static Item elder_engraved_coin; + public static Item jzahar_engraved_coin; + public static Item blank_engraving; + public static Item cthulhu_engraving; + public static Item elder_engraving; + public static Item jzahar_engraving; + public static Item eldritch_scale; + public static Item omothol_flesh; + public static Item anti_plagued_flesh; + public static Item anti_plagued_flesh_on_a_bone; + public static Item necronomicon; + public static Item abyssal_wasteland_necronomicon; + public static Item dreadlands_necronomicon; + public static Item omothol_necronomicon; + public static Item abyssalnomicon; + public static Item small_crystal_bag; + public static Item medium_crystal_bag; + public static Item large_crystal_bag; + public static Item huge_crystal_bag; + /** Metadata Item, 0 = Overworld, 1 = Abyssal Wasteland, 2 = Dreadlands, 3 = Omothol, 4 = Dark Realm */ + public static Item shoggoth_flesh; + /** Metadata Item, 0 = Abyssalnite, 1 = Refined Coralium, 2 = Dreadium, 3 = Ethaxium */ + public static Item ingot_nugget; + public static Item staff_of_rending; + /** Metadata Item, 0 = Abyssal Wasteland, 1 = Dreadlands, 2 = Omothol */ + public static Item essence; + /** Metadata Item, 0 = Abyssal Wasteland, 1 = Dreadlands, 2 = Omothol */ + public static Item skin; + /** Metadata Item, 0 = empty, 1 = range, 2 = duration, 3 = power */ + public static Item ritual_charm; + /** Metadata Item, 0 = empty, 1 = range, 2 = duration, 3 = power */ + public static Item cthulhu_charm; + /** Metadata Item, 0 = empty, 1 = range, 2 = duration, 3 = power */ + public static Item hastur_charm; + /** Metadata Item, 0 = empty, 1 = range, 2 = duration, 3 = power */ + public static Item jzahar_charm; + /** Metadata Item, 0 = empty, 1 = range, 2 = duration, 3 = power */ + public static Item azathoth_charm; + /** Metadata Item, 0 = empty, 1 = range, 2 = duration, 3 = power */ + public static Item nyarlathotep_charm; + /** Metadata Item, 0 = empty, 1 = range, 2 = duration, 3 = power */ + public static Item yog_sothoth_charm; + /** Metadata Item, 0 = empty, 1 = range, 2 = duration, 3 = power */ + public static Item shub_niggurath_charm; + public static Item hastur_engraved_coin; + public static Item azathoth_engraved_coin; + public static Item nyarlathotep_engraved_coin; + public static Item yog_sothoth_engraved_coin; + public static Item shub_niggurath_engraved_coin; + public static Item hastur_engraving; + public static Item azathoth_engraving; + public static Item nyarlathotep_engraving; + public static Item yog_sothoth_engraving; + public static Item shub_niggurath_engraving; + public static Item essence_of_the_gatekeeper; + // public static Item shadow_titan_armor_plate = getItem("shadowplate"); +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/item/ICrystal.java b/src/api/java/com/shinoow/abyssalcraft/api/item/ICrystal.java new file mode 100644 index 00000000..992ae3ff --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/item/ICrystal.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.item; + +/** + * Items with this interface are recognized as crystallized elements by AbyssalCraft. + * + * @author shinoow + * + * @since 1.3 + */ +public interface ICrystal { + +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/item/ItemEngraving.java b/src/api/java/com/shinoow/abyssalcraft/api/item/ItemEngraving.java new file mode 100644 index 00000000..b1c49964 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/item/ItemEngraving.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.item; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +/** + * The "fuel" in Coin Engraving. Use this class if you want to make your own engravings. + * + * @author shinoow + * + * @since 1.1 + */ +public class ItemEngraving extends Item { + + /** + * The "fuel" in Coin Engraving. Use this class if you want to make your own engravings. + * @param par1 The unlocalized name, will be prefixed by "engraving_" + * @param par2 The item damage, used as a durability check + */ + public ItemEngraving(String par1, int par2){ + super(); + setUnlocalizedName("engraving_" + par1); + setMaxDamage(par2); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + @Override + public void addInformation(ItemStack is, EntityPlayer player, List l, boolean B){ + l.add(getMaxDamage() - getDamage(is) +"/"+ is.getMaxDamage()); + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/item/ItemUpgradeKit.java b/src/api/java/com/shinoow/abyssalcraft/api/item/ItemUpgradeKit.java new file mode 100644 index 00000000..9f1a3fcc --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/item/ItemUpgradeKit.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.item; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +/** + * Use this class to create Upgrade Kits for tools/armor. + * You will need to create a crafting recipe for the upgrade: + * GameRegistry.addRecipe(new ItemStack(NewItem, 1), new Object [] {"#", "@", '#', OldItem, '@', UpgradeKit); + * + * @author shinoow + * + * @since 1.0 + */ +public class ItemUpgradeKit extends Item { + + public final String typeName; + public final String typeName2; + + /** + * The Strings are only for display. + * Remember to create a crafting recipe for the upgrade: + * GameRegistry.addRecipe(new ItemStack(NewItem, 1), new Object [] {"#", "@", '#', OldItem, '@', UpgradeKit); + * @param par2Str The old material + * @param par3Str The new material + */ + public ItemUpgradeKit(String par2Str, String par3Str){ + super(); + typeName = par2Str; + typeName2 = par3Str; + maxStackSize = 16; + } + + @Override + @SuppressWarnings({ "rawtypes", "unchecked" }) + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + par3List.add(typeName + " To " + typeName2); + } +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/item/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/item/package-info.java new file mode 100644 index 00000000..def89f01 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/item/package-info.java @@ -0,0 +1,4 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.item; +import net.minecraftforge.fml.common.API; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/necronomicon/CraftingStack.java b/src/api/java/com/shinoow/abyssalcraft/api/necronomicon/CraftingStack.java new file mode 100644 index 00000000..a67aaeb7 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/necronomicon/CraftingStack.java @@ -0,0 +1,153 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.necronomicon; + +import com.shinoow.abyssalcraft.api.APIUtils; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.item.crafting.ShapelessRecipes; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; + +/** + * Simple collection of ItemStacks used for displaying crafting recipes in the Necronomicon + * @author shinoow + * + * @since 1.3.5 + */ +public class CraftingStack { + + private ItemStack output; + private ItemStack[] recipe = new ItemStack[9]; + + /** + * Simple collection of Objects used to display a recipe + * @param output The Item/Block/ItemStack that's crafted + * @param recipe The Items/Blocks/ItemStacks used to craft said Item/Block/ItemStack (has to contain 9 elements, all of them can be null) + */ + public CraftingStack(Object output, Object...recipe){ + if(output != null){ + if(recipe != null){ + if(recipe.length == 9){ + this.output = APIUtils.convertToStack(output); + for(int i = 0; i < 9; i++) + this.recipe[i] = APIUtils.convertToStack(recipe[i]); + } else throw new ArrayIndexOutOfBoundsException("The array must contain preciesly 9 elements, not "+recipe.length+"!"); + } else throw new NullPointerException("This array can't be empty!"); + } else throw new NullPointerException("Output can't be null!"); + } + + /** + * Simple collection of Objects used to display a recipe.
+ * This version looks through the CraftingManager for the
+ * Item/Block's Crafting Recipe. + * @param output The Item/Block/ItemStack that's crafted + */ + public CraftingStack(Object output){ + if(output != null){ + Object[] stuff = new Object[9]; + this.output = APIUtils.convertToStack(output); + for(Object thing : CraftingManager.getInstance().getRecipeList()) + if(thing instanceof IRecipe){ + IRecipe recipe = (IRecipe)thing; + if(recipe.getRecipeOutput() != null && recipe.getRecipeOutput().isItemEqual(this.output)){ + if(recipe instanceof ShapedRecipes) + for(int i = 0; i < recipe.getRecipeSize(); i++) + stuff[i] = ((ShapedRecipes) recipe).recipeItems[i]; + if(recipe instanceof ShapelessRecipes) + for(int i = 0; i < recipe.getRecipeSize(); i++) + stuff[i] = ((ShapelessRecipes) recipe).recipeItems.get(i); + if(recipe instanceof ShapedOreRecipe) + for(int i = 0; i < recipe.getRecipeSize(); i++) + stuff[i] = ((ShapedOreRecipe) recipe).getInput()[i]; + if(recipe instanceof ShapelessOreRecipe) + for(int i = 0; i < recipe.getRecipeSize(); i++) + stuff[i] = ((ShapelessOreRecipe) recipe).getInput().get(i); + + if(recipe.getRecipeSize() == 4){ + Object[] copy = stuff.clone(); + stuff = new Object[9]; + for(int i = 0; i < 2; i++){ + stuff[i] = copy[i]; + stuff[i+3] = copy[i+2]; + } + } + this.output.stackSize = recipe.getRecipeOutput().stackSize; + } + } + for(int i = 0; i < 9; i++) + recipe[i] = APIUtils.convertToStack(stuff[i]); + } + + for(ItemStack stack : recipe) + if(stack != null && stack.getItemDamage() == OreDictionary.WILDCARD_VALUE) + stack.setItemDamage(0); + } + + /** + * Getter for the output ItemStack + * @return A ItemStack representing the output + */ + public ItemStack getOutput(){ + return output; + } + + /** + * Getter for the ItemStack array containing the recipe + * @return An array of ItemStacks representing the crafting recipe + */ + public ItemStack[] getCraftingRecipe(){ + return recipe; + } + + /** + * Getter for the first 3 positioned ItemStacks in the crafting grid + * @return An ItemStack array with 3 ItemStacks + */ + public ItemStack[] getFirstArray(){ + return new ItemStack[]{recipe[0], recipe[1], recipe[2]}; + } + + /** + * Getter for the second 3 positioned ItemStacks in the crafting grid + * @return An ItemStack array with 3 ItemStacks + */ + public ItemStack[] getSecondArray(){ + return new ItemStack[]{recipe[3], recipe[4], recipe[5]}; + } + + /** + * Getter for the third 3 positioned ItemStacks in the crafting grid + * @return An ItemStack array with 3 ItemStacks + */ + public ItemStack[] getThirdArray(){ + return new ItemStack[]{recipe[6], recipe[7], recipe[8]}; + } + + /** + * Easier way to make CraftingStack arrays + * @param stacks A bunch of CraftingStacks + * @return An Array with the CraftingStacks + */ + public static CraftingStack[] arrayFrom(CraftingStack...stacks){ + return stacks; + } + + @Override + public String toString(){ + return "CraftingStack{Output: "+ output.toString()+ ", Recipe: "+ recipe.toString() +"}"; + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/necronomicon/NecroData.java b/src/api/java/com/shinoow/abyssalcraft/api/necronomicon/NecroData.java new file mode 100644 index 00000000..33b06c52 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/necronomicon/NecroData.java @@ -0,0 +1,328 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.necronomicon; + +import java.util.Collections; +import java.util.Comparator; +import java.util.Map; +import java.util.NavigableMap; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.FMLLog; + +import org.apache.logging.log4j.Level; + +import com.google.common.collect.Maps; + +/** + * Base data structure for Necronomicon information pages + * @author shinoow + * + * @since 1.2 + */ +public class NecroData { + + private String identifier; + private String title; + private String information; + private Chapter[] chapters; + + /** + * The base data structure for Necronomicon information pages + * @param title Title to display on the "Index" for the information page + * @param info Optional text to write beside buttons for sub-category pages + * @param chapters Chapters for sub-category pages + */ + public NecroData(String identifier, String title, String info,Chapter...chapters){ + this.identifier = identifier; + this.title = title; + this.chapters = chapters; + information = info; + } + + /** + * The base data structure for Necronomicon information pages + * @param title Title to display on the "Index" for the information page + * @param chapters Chapters for sub-category pages + */ + public NecroData(String identifier, String title,Chapter...chapters){ + this(identifier, title, null, chapters); + } + + /** + * Getter for the NecroData title + * @return A string representing the Title of the information page + */ + public String getTitle(){ + return title; + } + + /** + * Getter for the category information + * @return A specified string used to display on the information page + */ + public String getInformation(){ + return information; + } + + /** + * Getter for the NecroData identifier + * @return A unique string representing this NecroData + */ + public String getIdentifier(){ + return identifier; + } + + /** + * Getter for the Chapter array + * @return An array of stored Chapters + */ + public Chapter[] getChapters(){ + return chapters; + } + + /** + * Method for getting the title of a specific sub-category + * @param index Position in the index to check + * @return A string representing the Chapter title + */ + public String getChapterTitle(int index){ + return chapters[index].title; + } + + /** + * Adds a Chapter (or overrides one that already exists) + * @param chapter Chapter to add + */ + public void addChapter(Chapter chapter){ + for(Chapter chap : chapters) + if(chap.identifier.equals(chapter.identifier)){ + chap = chapter; + return; + } + + if(chapters.length < 7){ + Chapter[] newchap = new Chapter[chapters.length + 1]; + for(int i = 0; i < chapters.length; i++) + newchap[i] = chapters[i]; + + newchap[chapters.length] = chapter; + + chapters = newchap; + } else FMLLog.log("AbyssalCraftAPI", Level.ERROR, "NecroData instance is already full, can't add a new Chapter!"); + } + + /** + * Removes a Chapter (if it exists) + * @param identifier Chapter identifier + */ + public void removeChapter(String identifier){ + Chapter[] newchap = new Chapter[chapters.length -1]; + Chapter[] oldchap = chapters.clone(); + + for(Chapter chap : oldchap) + if(chap.identifier.equals(identifier)){ + for(Chapter chapnew : newchap) + for(Chapter chap2 : oldchap) + if(chap2 != null && !chap2.identifier.equals(identifier)){ + chapnew = chap2; + chap2 = null; + break; + } + chapters = newchap; + return; + } + } + + /** + * A Necronomicon Chapter (collection of pages) + * @author shinoow + * + * @since 1.6 + */ + public static class Chapter{ + private NavigableMap pages = Maps.newTreeMap(new Comparator(){ + + @Override + public int compare(Integer o1, Integer o2) { + if(o1 > o2) + return 1; + if(o1 < o2) + return -1; + return 0; + } + }); + private String identifier; + private String title; + + /** + * A Necronomicon Chapter + * @param identifier Identifier (used to locate the chapter, should be unique for every NecroData) + * @param title Title to display on pages in the Chapter + */ + public Chapter(String identifier, String title){ + this.identifier = identifier; + this.title = title; + } + + /** + * A Necronomicon Chapter + * @param identifier Identifier (used to locate the chapter, should be unique for every NecroData) + * @param title Title to display on pages in the Chapter + * @param pages an array of Pages (it is optional to do it this way) + */ + public Chapter(String identifier, String title, Page...pages){ + this(identifier, title); + for(Page page : pages) + addPage(page); + } + + /** + * Getter for the Chapter identifier + */ + public String getIdentifier(){ + return identifier; + } + + /** + * Getter for the Chapter title + */ + public String getTitle(){ + return title; + } + + /** + * Fetches a unmodifiable Map of all the Pages contained in this Chapter + */ + public Map getPages(){ + return Collections.unmodifiableMap(pages); + } + + /** + * Getter for the page amount + */ + public int getPageAmount(){ + return pages.size(); + } + + /** + * Getter for the turn-up amount (last page number evenly divided by 2) + */ + public int getTurnupAmount(){ + return pages.lastKey() / 2 + (pages.lastKey() % 2 == 0 ? 0 : 1); + } + + /** + * Adds a page to the Chapter + * @param page Page to add + */ + public void addPage(Page page){ + pages.put(page.pageNum, page); + } + + /** + * Removes a Page (if it exists) + * @param pageNum Page number + */ + public void removePage(int pageNum){ + pages.remove(pageNum); + } + + /** + * Fetches a page (if it exists) + * @param pageNum Page number + */ + public Page getPage(int pageNum){ + return pages.get(pageNum); + } + + /** + * Checks if a Page exists + * @param pageNum Page number + */ + public boolean hasPage(int pageNum){ + return pages.containsKey(pageNum); + } + } + + /** + * A Necronomicon Page + * @author shinoow + * + * @since 1.6 + */ + public static class Page{ + private Object icon; + private int pageNum; + private String text; + + /** + * A Necronomicon Page + * @param pageNum Page number + * @param text Text to display on the Page + */ + public Page(int pageNum, String text){ + this(pageNum, null, text); + } + + /** + * A Necronomicon Page + * @param pageNum Page number + * @param icon ResourceLocation/ItemStack/CraftingStack to display on the Page + * @param text Text to display on the Page + */ + public Page(int pageNum, Object icon, String text){ + if(pageNum == 0) throw new ArithmeticException("The Page number can't be zero"); + this.pageNum = pageNum; + if(icon != null) + if(!(icon instanceof ResourceLocation) && !(icon instanceof ItemStack) && !(icon instanceof CraftingStack)) + throw new IllegalArgumentException("Icon isn't a ResourceLocation, ItemStack or CraftingStack!"); + this.icon = icon; + this.text = text; + } + + /** + * Fetches the page's number (used for ordering and overriding/removing/replacing pages). + */ + public int getPageNumber(){ + return pageNum; + } + + /** + * Fetches the ResourceLocation/ItemStack/CraftingStack to display on the page (if any exist). + */ + public Object getIcon(){ + return icon; + } + + /** + * Fetches the text to display on the page. + */ + public String getText(){ + return text; + } + + @Override + public boolean equals(Object obj){ + if(!(obj instanceof Page)) return false; + + Page page = (Page)obj; + + boolean test1 = page.pageNum == pageNum; + boolean test2 = page.icon == null && icon == null || page.icon.equals(icon); + boolean test3 = page.text.equals(text); + + return test1 && test2 && test3; + } + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/necronomicon/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/necronomicon/package-info.java new file mode 100644 index 00000000..b2555592 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/necronomicon/package-info.java @@ -0,0 +1,4 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.necronomicon; +import net.minecraftforge.fml.common.API; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/package-info.java new file mode 100644 index 00000000..37d457ca --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/package-info.java @@ -0,0 +1,3 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api; +import net.minecraftforge.fml.common.API; \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/recipe/CrystallizerRecipes.java b/src/api/java/com/shinoow/abyssalcraft/api/recipe/CrystallizerRecipes.java new file mode 100644 index 00000000..b2a5cf0b --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/recipe/CrystallizerRecipes.java @@ -0,0 +1,89 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.recipe; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class CrystallizerRecipes { + + private static final CrystallizerRecipes crystallizationBase = new CrystallizerRecipes(); + /** The list of crystallization results. */ + private Map crystallizationList = new HashMap(); + private Map experienceList = new HashMap(); + + public static CrystallizerRecipes instance() + { + return crystallizationBase; + } + + private CrystallizerRecipes() + { + + } + + public void crystallize(Block input, ItemStack output1, ItemStack output2, float xp) + { + crystallize(Item.getItemFromBlock(input), output1, output2, xp); + } + + public void crystallize(Item input, ItemStack output1, ItemStack output2, float xp) + { + crystallize(new ItemStack(input, 1, OreDictionary.WILDCARD_VALUE), output1, output2, xp); + } + + public void crystallize(ItemStack input, ItemStack output1, ItemStack output2, float xp) + { + crystallizationList.put(input, new ItemStack[]{output1, output2}); + experienceList.put(output1, Float.valueOf(xp)); + } + + /** + * Returns the crystallization result of an item. + */ + public ItemStack[] getCrystallizationResult(ItemStack par1ItemStack) + { + for(Entry entry : crystallizationList.entrySet()) + if(areStacksEqual(par1ItemStack, entry.getKey())) + return entry.getValue(); + + return null; + } + + private boolean areStacksEqual(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return par2ItemStack.getItem() == par1ItemStack.getItem() && (par2ItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE|| par2ItemStack.getItemDamage() == par1ItemStack.getItemDamage()); + } + + public Map getCrystallizationList() + { + return crystallizationList; + } + + public float getExperience(ItemStack par1ItemStack) + { + float ret = par1ItemStack.getItem().getSmeltingExperience(par1ItemStack); + if (ret != -1) return ret; + + for (Entry entry : experienceList.entrySet()) + if (areStacksEqual(par1ItemStack, entry.getKey())) + return entry.getValue().floatValue(); + + return 0.0F; + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/recipe/EngraverRecipes.java b/src/api/java/com/shinoow/abyssalcraft/api/recipe/EngraverRecipes.java new file mode 100644 index 00000000..8f89aad1 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/recipe/EngraverRecipes.java @@ -0,0 +1,121 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.recipe; + +import java.util.*; +import java.util.Map.Entry; + +import net.minecraft.item.*; +import net.minecraftforge.oredict.OreDictionary; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.shinoow.abyssalcraft.api.item.*; + +public class EngraverRecipes { + + private static final EngraverRecipes engravingBase = new EngraverRecipes(); + + private List coins = Lists.newArrayList(); + private Map engravings = Maps.newHashMap(); + private Map engravingList = Maps.newHashMap(); + private Map experienceList = Maps.newHashMap(); + + public static EngraverRecipes instance() + { + return engravingBase; + } + + private EngraverRecipes(){} + + public void addCoin(Item coin){ + addCoin(new ItemStack(coin, 1, OreDictionary.WILDCARD_VALUE)); + } + + public void addCoin(ItemStack coin){ + coins.add(coin); + } + + public void addEngraving(Item coin, ItemEngraving engraving, float xp){ + addEngraving(new ItemStack(coin), engraving, xp); + } + + public void addEngraving(ItemStack coin, ItemEngraving engraving, float xp){ + engravings.put(engraving, coin); + engravingList.put(new ItemStack(engraving), coin); + experienceList.put(coin, xp); + } + + /** + * Returns the engraving result of an item. This method doesn't do shit tbh + */ + public ItemStack getEngravingResult(ItemStack par1ItemStack) + { + if(coins.contains(par1ItemStack)) + return par1ItemStack; + + return null; + } + + /** + * Returns the engraving result of an item. + */ + public ItemStack getEngravingResult(ItemStack par2, ItemEngraving par1) + { + for(ItemStack stack : coins) + if(areStacksEqual(par2, stack)) + if(engravings.get(par1) != null) + if(par2.getItem() != ACItems.coin && par1 == ACItems.blank_engraving || + par2.getItem() == ACItems.coin && par1 != ACItems.blank_engraving) + return engravings.get(par1); + + return null; + } + + private boolean areStacksEqual(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return (par2ItemStack.getItem() == par1ItemStack.getItem() || par1ItemStack.getItem() == ACItems.coin) && (par2ItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE || par2ItemStack.getItemDamage() == par1ItemStack.getItemDamage()); + } + + /** + * Returns the coin list + */ + public List getCoinList(){ + return coins; + } + + /** + * Returns the actual engraving list, with engravings and coins + */ + public Map getEngravings(){ + return engravings; + } + + /** + * Returns a ItemStack version of the engraving list + */ + public Map getEngravingList(){ + return engravingList; + } + + public float getExperience(ItemStack par1ItemStack) + { + float ret = par1ItemStack.getItem().getSmeltingExperience(par1ItemStack); + if (ret != -1) return ret; + + for (Entry entry : experienceList.entrySet()) + if (areStacksEqual(par1ItemStack, entry.getKey())) + return entry.getValue().floatValue(); + + return 0.0F; + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/recipe/Materialization.java b/src/api/java/com/shinoow/abyssalcraft/api/recipe/Materialization.java new file mode 100644 index 00000000..a3a69988 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/recipe/Materialization.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.recipe; + +import com.shinoow.abyssalcraft.api.APIUtils; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; +import com.shinoow.abyssalcraft.api.item.ICrystal; + +import net.minecraft.item.ItemStack; + +/** + * A Materializer recipe + * @author shinoow + * + * @since 1.5 + */ +public class Materialization { + + public final ItemStack output; + public final ItemStack[] input; + + /** + * A Materializer recipe.
+ * Note: all inputs has to be either {@link ICrystal}s or be registered in the Crystal List {@link AbyssalCraftAPI#addCrystal(ItemStack)} + * @param input An array of ItemStacks (maximum is 5) + * @param output The output + */ + public Materialization(ItemStack[] input, ItemStack output){ + + if(input.length > 5) throw new ArrayIndexOutOfBoundsException("Array is too large ("+input.length+")! Maximum size is 5!"); + for(ItemStack item : input) + if(!APIUtils.isCrystal(item)) throw new ClassCastException("All of the input items has to be Crystals!"); + + this.output = output; + this.input = input; + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/recipe/MaterializerRecipes.java b/src/api/java/com/shinoow/abyssalcraft/api/recipe/MaterializerRecipes.java new file mode 100644 index 00000000..b262cd69 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/recipe/MaterializerRecipes.java @@ -0,0 +1,123 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.recipe; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.oredict.OreDictionary; + +import com.google.common.collect.Lists; +import com.shinoow.abyssalcraft.api.APIUtils; + +public class MaterializerRecipes { + + private static final MaterializerRecipes materializerBase = new MaterializerRecipes(); + /** The list of materialization results. */ + private List materializationList = Lists.newArrayList(); + + public static MaterializerRecipes instance() + { + return materializerBase; + } + + private MaterializerRecipes() + { + + } + + public void materialize(ItemStack[] input, ItemStack output){ + + materialize(new Materialization(input, output)); + } + + public void materialize(Materialization materialization){ + materializationList.add(materialization); + } + + public List getMaterializationResult(ItemStack stack){ + + ItemStack[] inventory = null; + + if(stack.getTagCompound() == null) + stack.setTagCompound(new NBTTagCompound()); + if(stack.getTagCompound().hasKey("ItemInventory")){ + NBTTagList items = stack.getTagCompound().getTagList("ItemInventory", 10); + + inventory = new ItemStack[items.tagCount()]; + for (int i = 0; i < items.tagCount(); ++i) + { + NBTTagCompound item = items.getCompoundTagAt(i); + byte slot = item.getByte("Slot"); + + inventory[slot] = ItemStack.loadItemStackFromNBT(item); + } + } + + if(inventory == null) return null; + + for(ItemStack item : inventory) + if(!APIUtils.isCrystal(item)) return null; + + List displayList = Lists.newArrayList(); + + Iterator iterator = materializationList.iterator(); + Materialization entry; + + do + { + if(!iterator.hasNext()) + return displayList; + + entry = iterator.next(); + if(arrayContainsOtherArray(inventory, entry.input)) + displayList.add(entry.output); + } + while(!arrayContainsOtherArray(inventory, entry.input)); + + // for(Materialization mat : materializationList){ + // if(arrayContainsOtherArray(inventory, mat.input)) + // displayList.add(mat.output); + // } + + return displayList; + } + + private boolean areStacksEqual(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + if(par1ItemStack == null || par2ItemStack == null) return false; + return par2ItemStack.getItem() == par1ItemStack.getItem() && (par2ItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE || par2ItemStack.getItemDamage() == par1ItemStack.getItemDamage()); + } + + private boolean arrayContainsOtherArray(ItemStack[] array1, ItemStack[] array2){ + List inventory = Lists.newArrayList(array1); + List recipe = Lists.newArrayList(array2); + + if(inventory.size() >= recipe.size()) + for(ItemStack invItem : inventory) + for(ItemStack recipeItem : recipe) + if(areStacksEqual(invItem, recipeItem) && invItem.stackSize >= recipeItem.stackSize){ + recipe.remove(recipeItem); + break; + } + + return recipe.isEmpty(); + } + + public List getMaterializationList() + { + return materializationList; + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/recipe/TransmutatorRecipes.java b/src/api/java/com/shinoow/abyssalcraft/api/recipe/TransmutatorRecipes.java new file mode 100644 index 00000000..75bbf16f --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/recipe/TransmutatorRecipes.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.recipe; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class TransmutatorRecipes { + + private static final TransmutatorRecipes transmutationBase = new TransmutatorRecipes(); + /** The list of transmutation results. */ + private Map transmutationList = new HashMap(); + private Map experienceList = new HashMap(); + + public static TransmutatorRecipes instance() + { + return transmutationBase; + } + + private TransmutatorRecipes() + { + transmute(Items.DIAMOND, new ItemStack(Items.COAL, 64), 0.2F); + transmute(Items.WATER_BUCKET, new ItemStack(Blocks.ICE, 8), 0.0F); + transmute(Blocks.WOOL, new ItemStack(Items.STRING, 4), 0.0F); + transmute(Blocks.GRAVEL, new ItemStack(Items.FLINT, 2), 0.0F); + transmute(Blocks.QUARTZ_BLOCK, new ItemStack(Items.QUARTZ, 4), 0.0F); + transmute(Blocks.NETHER_BRICK, new ItemStack(Items.NETHERBRICK, 4), 0.0F); + transmute(Items.NETHERBRICK, new ItemStack(Blocks.NETHERRACK), 0.0F); + transmute(Items.WHEAT, new ItemStack(Items.WHEAT_SEEDS), 0.0F); + transmute(Items.WHEAT_SEEDS, new ItemStack(Items.WHEAT), 0.0F); + } + + public void transmute(Block input, ItemStack output, float xp) + { + transmute(Item.getItemFromBlock(input), output, xp); + } + + public void transmute(Item input, ItemStack output, float xp) + { + transmute(new ItemStack(input, 1, OreDictionary.WILDCARD_VALUE), output, xp); + } + + public void transmute(ItemStack input, ItemStack output, float xp) + { + transmutationList.put(input, output); + experienceList.put(output, Float.valueOf(xp)); + } + + /** + * Returns the transmutation result of an item. + */ + public ItemStack getTransmutationResult(ItemStack par1ItemStack) + { + for(Entry entry : transmutationList.entrySet()) + if(areStacksEqual(par1ItemStack, entry.getKey())) + return entry.getValue(); + + return null; + } + + private boolean areStacksEqual(ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return par2ItemStack.getItem() == par1ItemStack.getItem() && (par2ItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE || par2ItemStack.getItemDamage() == par1ItemStack.getItemDamage()); + } + + public Map getTransmutationList() + { + return transmutationList; + } + + public float getExperience(ItemStack par1ItemStack) + { + float ret = par1ItemStack.getItem().getSmeltingExperience(par1ItemStack); + if (ret != -1) return ret; + + for (Entry entry : experienceList.entrySet()) + if (areStacksEqual(par1ItemStack, entry.getKey())) + return entry.getValue().floatValue(); + + return 0.0F; + } +} \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/recipe/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/recipe/package-info.java new file mode 100644 index 00000000..487cc1a8 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/recipe/package-info.java @@ -0,0 +1,4 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.recipe; +import net.minecraftforge.fml.common.API; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; \ No newline at end of file diff --git a/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconCreationRitual.java b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconCreationRitual.java new file mode 100644 index 00000000..8a70d482 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconCreationRitual.java @@ -0,0 +1,123 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.ritual; + +import net.minecraft.entity.effect.EntityLightningBolt; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * A Necronomicon Creation Ritual + * @author shinoow + * + * @since 1.4 + */ +public class NecronomiconCreationRitual extends NecronomiconRitual { + + private ItemStack item; + + /** + * A Necronomicon Creation Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be performed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param requiresSacrifice If the ritual requires a living sacrifice + * @param item The Item given from the ritual + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconCreationRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, boolean requiresSacrifice, ItemStack item, Object...offerings) { + super(unlocalizedName, bookType, dimension, requiredEnergy, requiresSacrifice, offerings); + this.item = item; + if(item.stackSize > 1) + item.stackSize = 1; + } + + /** + * A Necronomicon Creation Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be peformed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param item The Item given from the ritual + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconCreationRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, ItemStack item, Object...offerings) { + this(unlocalizedName, bookType, dimension, requiredEnergy, false, item, offerings); + } + + /** + * A Necronomicon Creation Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param requiredEnergy Amount of Potential Energy required to perform + * @param item The Item given from the ritual + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconCreationRitual(String unlocalizedName, int bookType, float requiredEnergy, ItemStack item, Object...offerings) { + this(unlocalizedName, bookType, -1, requiredEnergy, item, offerings); + } + + /** + * Getter for the item + * @return A ItemStack representing the ritual "reward" + */ + public ItemStack getItem(){ + return item; + } + + @Override + public boolean canCompleteRitual(World world, BlockPos pos, EntityPlayer player) { + + return true; + } + + @Override + protected void completeRitualServer(World world, BlockPos pos, EntityPlayer player){ + + world.addWeatherEffect(new EntityLightningBolt(world, pos.getX(), pos.getY() + 1, pos.getZ(), false)); + + TileEntity altar = world.getTileEntity(pos); + + NBTTagCompound compound = new NBTTagCompound(); + NBTTagCompound newItem = new NBTTagCompound(); + altar.writeToNBT(compound); + NBTTagCompound nbtItem = compound.getCompoundTag("Item"); + + if(ItemStack.loadItemStackFromNBT(nbtItem) == null || !ItemStack.loadItemStackFromNBT(nbtItem).isItemEqual(item)){ + item.writeToNBT(newItem); + compound.setTag("Item", newItem); + } + altar.readFromNBT(compound); + } + + @Override + protected void completeRitualClient(World world, BlockPos pos, EntityPlayer player){ + + TileEntity altar = world.getTileEntity(pos); + + NBTTagCompound compound = new NBTTagCompound(); + NBTTagCompound newItem = new NBTTagCompound(); + altar.writeToNBT(compound); + NBTTagCompound nbtItem = compound.getCompoundTag("Item"); + + if(ItemStack.loadItemStackFromNBT(nbtItem) == null || !ItemStack.loadItemStackFromNBT(nbtItem).isItemEqual(item)){ + item.writeToNBT(newItem); + compound.setTag("Item", newItem); + } + altar.readFromNBT(compound); + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconEnchantmentRitual.java b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconEnchantmentRitual.java new file mode 100644 index 00000000..300bfd4a --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconEnchantmentRitual.java @@ -0,0 +1,146 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.ritual; + +import java.util.Map; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentData; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * A Necronomicon Enchantment Ritual + * @author shinoow + * + * @since 1.7.5 + */ +public class NecronomiconEnchantmentRitual extends NecronomiconRitual { + + private EnchantmentData enchantment; + + /** + * A Necronomicon Creation Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be peformed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param requiresSacrifice If the ritual requires a living sacrifice + * @param enchantment EnchantmentData for the Enchantment applied through the ritual + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconEnchantmentRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, boolean requiresSacrifice, EnchantmentData enchantment, Object...offerings) { + super(unlocalizedName, bookType, dimension, requiredEnergy, requiresSacrifice, offerings); + this.enchantment = enchantment; + } + + /** + * A Necronomicon Creation Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be peformed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param enchantment EnchantmentData for the Enchantment applied through the ritual + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconEnchantmentRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, EnchantmentData enchantment, Object...offerings) { + this(unlocalizedName, bookType, dimension, requiredEnergy, false, enchantment, offerings); + } + + /** + * A Necronomicon Creation Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param requiredEnergy Amount of Potential Energy required to perform + * @param enchantment EnchantmentData for the Enchantment applied through the ritual + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconEnchantmentRitual(String unlocalizedName, int bookType, float requiredEnergy, EnchantmentData enchantment, Object...offerings) { + this(unlocalizedName, bookType, -1, requiredEnergy, enchantment, offerings); + } + + @Override + public boolean requiresItemSacrifice(){ + return true; + } + + /** + * Getter for the EnchantmentData + * @return EnchantmentData for the Enchantment applied through the ritual + */ + public EnchantmentData getEnchantment(){ + return enchantment; + } + + @Override + public boolean canCompleteRitual(World world, BlockPos pos, EntityPlayer player) { + + TileEntity altar = world.getTileEntity(pos); + + NBTTagCompound compound = new NBTTagCompound(); + altar.writeToNBT(compound); + NBTTagCompound nbtItem = compound.getCompoundTag("Item"); + + return canEnchant(ItemStack.loadItemStackFromNBT(nbtItem)); + } + + private boolean canEnchant(ItemStack stack){ + if(stack == null) return false; + if(stack.isItemEnchanted()){ + Map enchantments = EnchantmentHelper.getEnchantments(stack); + for(Enchantment ench : enchantments.keySet()) + if(!ench.canApplyTogether(enchantment.enchantmentobj) || !enchantment.enchantmentobj.canApplyTogether(ench)) + return false; + return enchantment.enchantmentobj.canApply(stack); + } + return enchantment.enchantmentobj.canApply(stack); + } + + @Override + protected void completeRitualClient(World world, BlockPos pos, EntityPlayer player) { + TileEntity altar = world.getTileEntity(pos); + + NBTTagCompound compound = new NBTTagCompound(); + altar.writeToNBT(compound); + NBTTagCompound nbtItem = compound.getCompoundTag("Item"); + + if(canEnchant(ItemStack.loadItemStackFromNBT(nbtItem))){ + ItemStack item = ItemStack.loadItemStackFromNBT(nbtItem); + item.addEnchantment(enchantment.enchantmentobj, enchantment.enchantmentLevel); + item.writeToNBT(nbtItem); + compound.setTag("Item", nbtItem); + } + altar.readFromNBT(compound); + } + + @Override + protected void completeRitualServer(World world, BlockPos pos, EntityPlayer player) { + TileEntity altar = world.getTileEntity(pos); + + NBTTagCompound compound = new NBTTagCompound(); + altar.writeToNBT(compound); + NBTTagCompound nbtItem = compound.getCompoundTag("Item"); + + if(canEnchant(ItemStack.loadItemStackFromNBT(nbtItem))){ + ItemStack item = ItemStack.loadItemStackFromNBT(nbtItem); + item.addEnchantment(enchantment.enchantmentobj, enchantment.enchantmentLevel); + item.writeToNBT(nbtItem); + compound.setTag("Item", nbtItem); + } + altar.readFromNBT(compound); + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconInfusionRitual.java b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconInfusionRitual.java new file mode 100644 index 00000000..c32c8293 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconInfusionRitual.java @@ -0,0 +1,96 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.ritual; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * A Necronomicon Infusion Ritual + * @author shinoow + * + * @since 1.4 + */ +public class NecronomiconInfusionRitual extends NecronomiconCreationRitual { + + /** + * A Necronomicon Infusion Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be peformed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param requiresSacrifice If the ritual requires a living sacrifice + * @param item The Item given from the ritual + * @param sacrifice Item to upgrade + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconInfusionRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, + boolean requiresSacrifice, ItemStack item, Object sacrifice, Object...offerings) { + super(unlocalizedName, bookType, dimension, requiredEnergy, requiresSacrifice, item, offerings); + this.sacrifice = sacrifice; + } + + /** + * A Necronomicon Infusion Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be peformed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param item The Item given from the ritual + * @param sacrifice Item to upgrade + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconInfusionRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, + ItemStack item, Object sacrifice, Object...offerings) { + this(unlocalizedName, bookType, dimension, requiredEnergy, false, item, sacrifice, offerings); + + } + + /** + * A Necronomicon Infusion Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param requiredEnergy Amount of Potential Energy required to perform + * @param item The Item given from the ritual + * @param sacrifice Item to upgrade + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconInfusionRitual(String unlocalizedName, int bookType, float requiredEnergy, ItemStack item, Object sacrifice, Object...offerings) { + this(unlocalizedName, bookType, -1, requiredEnergy, item, sacrifice, offerings); + } + + @Override + public boolean canCompleteRitual(World world, BlockPos pos, EntityPlayer player) { + + TileEntity altar = world.getTileEntity(pos); + + NBTTagCompound compound = new NBTTagCompound(); + altar.writeToNBT(compound); + NBTTagCompound nbtItem = compound.getCompoundTag("Item"); + + return RitualRegistry.instance().areObjectsEqual(ItemStack.loadItemStackFromNBT(nbtItem), sacrifice); + } + + @Override + protected void completeRitualServer(World world, BlockPos pos, EntityPlayer player){ + if(canCompleteRitual(world, pos, player)) super.completeRitualServer(world, pos, player); + } + + @Override + protected void completeRitualClient(World world, BlockPos pos, EntityPlayer player){ + if(canCompleteRitual(world, pos, player)) super.completeRitualClient(world, pos, player); + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconPotionAoERitual.java b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconPotionAoERitual.java new file mode 100644 index 00000000..238fa3a3 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconPotionAoERitual.java @@ -0,0 +1,110 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.ritual; + +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import com.shinoow.abyssalcraft.api.entity.EntityUtil; + +/** + * A Necronomicon Area-of-Effect Ritual + * @author shinoow + * + * @since 1.4 + */ +public class NecronomiconPotionAoERitual extends NecronomiconRitual { + + private Object potion; + + /** + * A Necronomicon Potion Area-of-Effect Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be performed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param requiresSacrifice If the ritual requires a living sacrifice + * @param potions Either a Potion effect or a Potion ID (will last for 20 seconds) + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconPotionAoERitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, boolean requiresSacrifice, Object potion, Object...offerings) { + super(unlocalizedName, bookType, dimension, requiredEnergy, requiresSacrifice, offerings); + this.potion = potion; + } + + /** + * A Necronomicon Potion Area-of-Effect Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be peformed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param potions Either a Potion effect or a Potion ID (will last for 20 seconds) + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconPotionAoERitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, Object potion, Object...offerings) { + this(unlocalizedName, bookType, dimension, requiredEnergy, false, potion, offerings); + } + + /** + * A Necronomicon Potion Area-of-Effect Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param requiredEnergy Amount of Potential Energy required to perform + * @param potions Either a Potion effect or a Potion ID (will last for 20 seconds) + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconPotionAoERitual(String unlocalizedName, int bookType, float requiredEnergy, Object potion, Object...offerings) { + this(unlocalizedName, bookType, -1, requiredEnergy, potion, offerings); + } + + /** + * A getter for the Potion Effect + * @return Either a Potion Effect or null + */ + public Potion getPotionEffect(){ + if(potion instanceof Potion) + return (Potion) potion; + if(potion instanceof Integer) + return Potion.getPotionById((int) potion); + return null; + } + + @Override + public boolean canCompleteRitual(World world, BlockPos pos, EntityPlayer player) { + + return true; + } + + @Override + protected void completeRitualServer(World world, BlockPos pos, EntityPlayer player){ + + List entities = world.getEntitiesWithinAABBExcludingEntity(player, new AxisAlignedBB(pos).expand(16, 3, 16)); + + if(!entities.isEmpty()) + for(Entity entity : entities) + if(entity instanceof EntityLivingBase && !entity.isDead) + if(!EntityUtil.isEntityImmune((EntityLivingBase) entity, getPotionEffect())) + ((EntityLiving)entity).addPotionEffect(new PotionEffect(getPotionEffect(), 400)); + } + + @Override + protected void completeRitualClient(World world, BlockPos pos, EntityPlayer player){} +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconPotionRitual.java b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconPotionRitual.java new file mode 100644 index 00000000..96fa47ee --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconPotionRitual.java @@ -0,0 +1,121 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.ritual; + +import java.util.Random; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * A Necronomicon Potion Ritual + * @author shinoow + * + * @since 1.4 + */ +public class NecronomiconPotionRitual extends NecronomiconRitual { + + private Object potion; + + /** + * A Necronomicon Potion Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be performed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param requiresSacrifice If the ritual requires a living sacrifice + * @param potions Either a Potion effect or a Potion ID (will last for 2 minutes) + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconPotionRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, boolean requiresSacrifice, + Object potion, Object...offerings) { + super(unlocalizedName, bookType, dimension, requiredEnergy, requiresSacrifice, offerings); + this.potion = potion; + } + + /** + * A Necronomicon Potion Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be peformed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param potions Either a Potion effect or a Potion ID (will last for 2 minutes) + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconPotionRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, Object potion, + Object...offerings) { + this(unlocalizedName, bookType, dimension, requiredEnergy, false, potion, offerings); + } + + /** + * A Necronomicon Potion Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param requiredEnergy Amount of Potential Energy required to perform + * @param potions Either a Potion effect or a Potion ID (will last for 2 minutes) + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconPotionRitual(String unlocalizedName, int bookType, float requiredEnergy, Object potion, Object...offerings) { + this(unlocalizedName, bookType, -1, requiredEnergy, potion, offerings); + } + + /** + * A getter for the Potion Effect + * @return Either a Potion Effect or null + */ + public Potion getPotionEffect(){ + if(potion instanceof Potion) + return (Potion) potion; + if(potion instanceof Integer) + return Potion.getPotionById((int) potion); + return null; + } + + private Potion getBadEffect(Random rand){ + switch(rand.nextInt(5)){ + case 0: + return MobEffects.BLINDNESS; + case 1: + return MobEffects.NAUSEA; + case 2: + return MobEffects.MINING_FATIGUE; + case 3: + return MobEffects.HUNGER; + case 4: + return MobEffects.WEAKNESS; + case 5: + return MobEffects.SLOWNESS; + default: + return getBadEffect(rand); + } + } + + @Override + public boolean canCompleteRitual(World world, BlockPos pos, EntityPlayer player) { + + return true; + } + + @Override + protected void completeRitualServer(World world, BlockPos pos, EntityPlayer player){ + + player.addPotionEffect(new PotionEffect(getPotionEffect(), 2400)); + player.addPotionEffect(new PotionEffect(getBadEffect(world.rand), 600)); + } + + @Override + protected void completeRitualClient(World world, BlockPos pos, EntityPlayer player){} +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconRitual.java b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconRitual.java new file mode 100644 index 00000000..ca913555 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconRitual.java @@ -0,0 +1,210 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.ritual; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.translation.I18n; +import net.minecraft.world.World; + +/** + * Base Necronomicon Ritual.
+ * Extend to make your own rituals. + * @author shinoow + * + * @since 1.4 + */ +public abstract class NecronomiconRitual { + + private Object[] offerings = new Object[8]; + private boolean requiresSacrifice; + private int bookType; + private int dimension; + private String unlocalizedName; + private float requiredEnergy; + protected Object sacrifice; + + /** + * A Necronomicon Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be performed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param requiresSacrifice If the ritual requires a living sacrifice + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, boolean requiresSacrifice, Object...offerings){ + this.unlocalizedName = unlocalizedName; + this.bookType = bookType; + this.dimension = dimension; + this.requiredEnergy = requiredEnergy; + this.requiresSacrifice = requiresSacrifice; + if(offerings.length < 8){ + this.offerings = new Object[offerings.length]; + for(int i = 0; i < offerings.length; i++) + this.offerings[i] = offerings[i]; + } + else this.offerings = offerings; + } + + /** + * A Necronomicon Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be peformed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, Object...offerings){ + this(unlocalizedName, bookType, dimension, requiredEnergy, false, offerings); + } + + /** + * A Necronomicon Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param requiredEnergy Amount of Potential Energy required to perform + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconRitual(String unlocalizedName, int bookType, float requiredEnergy, Object...offerings){ + this(unlocalizedName, bookType, -1, requiredEnergy, offerings); + } + + /** + * Used to fetch the offerings + * @return An array of ItemStacks representing offerings + */ + public Object[] getOfferings(){ + return offerings; + } + + /** + * Used to see if this ritual requires a living sacrifice + * @return True if the ritual requires a living sacrifice to be present + */ + public boolean requiresSacrifice(){ + return requiresSacrifice; + } + + /** + * Used to fetch the required book type + * @return A Integer representing the book type required for the ritual + */ + public int getBookType(){ + return bookType; + } + + /** + * Used to fetch the dimension ID (if -1, it can be performed anywhere) + * @return A Integer representing the ID for the dimension where the ritual can be performed + */ + public int getDimension(){ + return dimension; + } + + /** + * Used to fetch the required Potential Energy for the ritual + * @return A Float representing the amount of Potential Energy required to perform the ritual + */ + public float getReqEnergy(){ + return requiredEnergy; + } + + /** + * Used to fetch the unlocalized name for a ritual + * @return A string prefixed by "ac.ritual." + */ + public String getUnlocalizedName(){ + return "ac.ritual." + unlocalizedName; + } + + /** + * Used to fetch the localized name for a ritual + * @return A localized string representing a name + */ + public String getLocalizedName(){ + return I18n.translateToLocal(getUnlocalizedName()); + } + + /** + * Used to fetch the description for the ritual + * @return A localized string representing a description + */ + public String getDescription(){ + return I18n.translateToLocal(getUnlocalizedName() + ".desc"); + } + + /** + * Used for Ritual types that don't require a specific Item sacrifice, but needs
+ * something to be placed on the Ritual Altar. + * @return Whether or not the Ritual requires there to be something placed
+ * on the Ritual Altar (used in the Enchantment ritual to ensure
+ * there's an item there to enchant) + */ + public boolean requiresItemSacrifice(){ + return false; + } + + /** + * Getter for the sacrifice (mainly used by Infusion Rituals) + * @return An Object representing an item placed on the altar + * (should be removed/replaced in both completeRitual methods, like + * {@link NecronomiconCreationRitual#completeRitualClient(World, int, int, int, EntityPlayer)}) + */ + public Object getSacrifice(){ + return sacrifice; + } + + /** + * Override this to ensure that the ritual can be completed + * @param world Current World + * @param x X coordinate + * @param y Y coordinate + * @param z Z coordinate + * @param player Player performing the ritual + * @return True if all conditions are met, otherwise false + */ + public abstract boolean canCompleteRitual(World world, BlockPos pos, EntityPlayer player); + + /** + * Called when a ritual is completed + * @param world Current World + * @param x X coordinate + * @param y Y coordinate + * @param z Z coordinate + * @param player Player who performed the ritual + */ + public void completeRitual(World world, BlockPos pos, EntityPlayer player){ + if(!world.isRemote) completeRitualServer(world, pos, player); + if(world.isRemote) completeRitualClient(world, pos, player); + } + + /** + * Override this to do something client-side when the ritual is completed + * @param world Current World + * @param x X coordinate + * @param y Y coordinate + * @param z Z coordinate + * @param player Player who performed the ritual + */ + protected abstract void completeRitualClient(World world, BlockPos pos, EntityPlayer player); + + /** + * Override this to do something server-side when the ritual is completed + * @param world Current World + * @param x X coordinate + * @param y Y coordinate + * @param z Z coordinate + * @param player Player who performed the ritual + */ + protected abstract void completeRitualServer(World world, BlockPos pos, EntityPlayer player); +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconSummonRitual.java b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconSummonRitual.java new file mode 100644 index 00000000..46c52e20 --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/ritual/NecronomiconSummonRitual.java @@ -0,0 +1,119 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.ritual; + +import java.lang.reflect.InvocationTargetException; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.world.World; + +/** + * A Necronomicon Summoning Ritual + * @author shinoow + * + * @since 1.4 + */ +public class NecronomiconSummonRitual extends NecronomiconRitual { + + private Class entity; + + /** + * A Necronomicon Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be peformed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param requiresSacrifice If the ritual requires a living sacrifice + * @param entity Class representing the entity this ritual summons + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconSummonRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, boolean requiresSacrifice, Class entity, Object...offerings) { + super(unlocalizedName, bookType, dimension, requiredEnergy, requiresSacrifice, offerings); + this.entity = entity; + } + + /** + * A Necronomicon Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param dimension Dimension where the ritual can be peformed + * @param requiredEnergy Amount of Potential Energy required to perform + * @param entity Class representing the entity this ritual summons + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconSummonRitual(String unlocalizedName, int bookType, int dimension, float requiredEnergy, Class entity, Object...offerings) { + this(unlocalizedName, bookType, dimension, requiredEnergy, false, entity, offerings); + } + + /** + * A Necronomicon Ritual + * @param unlocalizedName A string representing the ritual name + * @param bookType Necronomicon book type required + * @param requiredEnergy Amount of Potential Energy required to perform + * @param entity Class representing the entity this ritual summons + * @param offerings Components used to perform the ritual, are consumed afterwards + */ + public NecronomiconSummonRitual(String unlocalizedName, int bookType, float requiredEnergy, Class entity, Object...offerings) { + this(unlocalizedName, bookType, -1, requiredEnergy, entity, offerings); + } + + /** + * Getter for the entity + * @return A Class that represents the entity this ritual summons + */ + public Class getEntity(){ + return entity; + } + + @Override + public boolean canCompleteRitual(World world, BlockPos pos, EntityPlayer player) { + + return true; + } + + @Override + protected void completeRitualServer(World world, BlockPos pos, EntityPlayer player){ + + EntityLivingBase entityliving = null; + try { + entityliving = entity.getConstructor(World.class).newInstance(world); + } catch (InstantiationException | IllegalAccessException + | IllegalArgumentException | InvocationTargetException + | NoSuchMethodException | SecurityException e) { + e.printStackTrace(); + } + if(entityliving != null){ + entityliving.setLocationAndAngles(pos.getX(), pos.getY() + 1, pos.getZ(), entityliving.rotationYaw, entityliving.rotationPitch); + ((EntityLiving) entityliving).onInitialSpawn(world.getDifficultyForLocation(pos.up()), (IEntityLivingData)null); + world.spawnEntityInWorld(entityliving); + } + } + + @Override + protected void completeRitualClient(World world, BlockPos pos, EntityPlayer player){ + EntityLivingBase entityliving = null; + try { + entityliving = entity.getConstructor(World.class).newInstance(world); + } catch (InstantiationException | IllegalAccessException + | IllegalArgumentException | InvocationTargetException + | NoSuchMethodException | SecurityException e) { + e.printStackTrace(); + } + if(entityliving == null) player.addChatMessage(new TextComponentString("The Entity could not be summoned.")); + + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/ritual/RitualRegistry.java b/src/api/java/com/shinoow/abyssalcraft/api/ritual/RitualRegistry.java new file mode 100644 index 00000000..5947988c --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/ritual/RitualRegistry.java @@ -0,0 +1,230 @@ +/******************************************************************************* + * AbyssalCraft + * Copyright (c) 2012 - 2016 Shinoow. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the GNU Lesser Public License v3 + * which accompanies this distribution, and is available at + * http://www.gnu.org/licenses/lgpl-3.0.txt + * + * Contributors: + * Shinoow - implementation + ******************************************************************************/ +package com.shinoow.abyssalcraft.api.ritual; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.FMLLog; +import net.minecraftforge.oredict.OreDictionary; + +import org.apache.logging.log4j.Level; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + +/** + * Registry class for Necronomicon Rituals + * @author shinoow + * + * @since 1.4 + */ +public class RitualRegistry { + + private Map dimToBookType = Maps.newHashMap(); + private Map dimToName = Maps.newHashMap(); + private Map ritualToBookType = Maps.newHashMap(); + private ArrayList rituals = Lists.newArrayList(); + + private static final RitualRegistry instance = new RitualRegistry(); + + public static RitualRegistry instance(){ + return instance; + } + + /** + * Maps a dimension to a book type, in order to specify dimensions where a ritual of that book type can be performed + * @param dim The Dimension ID + * @param bookType The Necronomicon book type required + * + * @since 1.4 + */ + public void addDimensionToBookType(int dim, int bookType){ + if(bookType <= 4 && bookType >= 0) + if(dim != -1 && dim != 1) + dimToBookType.put(dim, bookType); + else FMLLog.log("RitualRegistry", Level.ERROR, "You're not allowed to register that Dimension ID: %d", dim); + else FMLLog.log("RitualRegistry", Level.ERROR, "Necronomicon book type does not exist: %d", bookType); + } + + /** + * Maps a dimension to a name, in order to display it in the Necronomicon if rituals can only be performed in said dimension + * @param dim The Dimension ID + * @param name A String representing the name + * + * @since 1.4.5 + */ + public void addDimensionToName(int dim, String name){ + if(dim != -1 && dim != 1) + dimToName.put(dim, name); + else FMLLog.log("RitualRegistry", Level.ERROR, "You're not allowed to register that Dimension ID: %d", dim); + } + + /** + * Maps a dimension to a book type, in order to specify dimensions where a ritual of that book type can be performed,
+ * and maps it to a name, in order to display it in the Necronomicon if rituals can only be performed in said dimension + * @param dim The Dimension ID + * @param bookType The Necronomicon book type required + * @param name A String representing the name + * + * @since 1.4.5 + */ + public void addDimensionToBookTypeAndName(int dim, int bookType, String name){ + addDimensionToBookType(dim, bookType); + addDimensionToName(dim, name); + } + + /** + * Checks if any Ritual-related action can be performed in this dimension with the current Necronomicon + * @param dim The dimension ID + * @param bookType The Necronomicon book type + * @return True if the action can be performed, otherwise false + * + * @since 1.4 + */ + public boolean canPerformAction(int dim, int bookType){ + if(!dimToBookType.containsKey(dim)) return false; + return bookType >= dimToBookType.get(dim); + } + + /** + * A more sensitive version of {@link #canPerformAction(int, int)} + * @param dim The dimension ID + * @param bookType The Necronomicon book type + * @return True if the book types match, otherwise false + * + * @since 1.4 + */ + public boolean sameBookType(int dim, int bookType){ + if(!dimToBookType.containsKey(dim)) return false; + return bookType == dimToBookType.get(dim); + } + + /** + * Registers a Necronomicon Ritual + * @param ritual The Ritual, contains all data used to perform it + * + * @since 1.4 + */ + public void registerRitual(NecronomiconRitual ritual){ + if(ritual.getBookType() <= 4 && ritual.getBookType() >= 0){ + for(NecronomiconRitual entry : rituals) + if(ritual.getUnlocalizedName().equals(entry.getUnlocalizedName())){ + FMLLog.log("RitualRegistry", Level.ERROR, "Necronomicon Ritual already registered: %s", ritual.getUnlocalizedName()); + return; + } + rituals.add(ritual); + } else FMLLog.log("RitualRegistry", Level.ERROR, "Necronomicon book type does not exist: %d", ritual.getBookType()); + } + + /** + * Used to fetch a list of rituals + * @return An ArrayList containing all registered Necronomicon Rituals + * + * @since 1.4 + */ + public List getRituals(){ + return rituals; + } + + /** + * Used to fetch the dimension/name mappings + * @return A HashMap containing Dimension IDs and Strings associated with them + */ + public Map getDimensionNameMappings(){ + return dimToName; + } + + /** + * Attempts to fetch a ritual + * @param dimension The provided dimension + * @param bookType The provided book type + * @param offerings The provided offerings + * @param sacrifice The provided sacrifice (object placed on the altar) + * @return A Necronomicon Ritual, or null if none was found + * + * @since 1.4 + */ + public NecronomiconRitual getRitual(int dimension, int bookType, ItemStack[] offerings, ItemStack sacrifice){ + + for(NecronomiconRitual ritual : rituals) + if(areRitualsSame(ritual, dimension, bookType, offerings, sacrifice)) return ritual; + + return null; + } + + /** + * Used to check if a Necronomicon Ritual has the same values as the supplied values + * @param ritual The ritual in question + * @param dimension The supplied dimension ID + * @param bookType The supplied book type + * @param offerings The supplied offerings + * @param sacrifice The supplied sacrifice + * @return True if the rituals match, otherwise false + * + * @since 1.4 + */ + private boolean areRitualsSame(NecronomiconRitual ritual, int dimension, int bookType, ItemStack[] offerings, ItemStack sacrifice){ + if(ritual.getDimension() == dimension || ritual.getDimension() == -1) + if(ritual.getBookType() <= bookType) + if(ritual.getOfferings() != null && offerings != null) + if(areItemStackArraysEqual(ritual.getOfferings(), offerings)) + if(ritual.requiresItemSacrifice() || ritual.getSacrifice() == null && sacrifice == null || + areObjectsEqual(sacrifice, ritual.getSacrifice())) + return true; + return false; + } + + private boolean areItemStackArraysEqual(Object[] array1, ItemStack[] array2){ + + List compareList = Lists.newArrayList(array1); + List itemList = Lists.newArrayList(); + + for(ItemStack item : array2) + if(item != null) + itemList.add(item); + + if(itemList.size() == compareList.size()) + for(ItemStack item : itemList) + for(Object compare : compareList) + if(areObjectsEqual(item, compare)){ + compareList.remove(compare); + break; + } + + return compareList.isEmpty(); + } + + public boolean areObjectsEqual(ItemStack stack, Object obj){ + if(obj instanceof ItemStack) + return areStacksEqual(stack, (ItemStack)obj); + else if(obj instanceof Item) + return areStacksEqual(stack, new ItemStack((Item)obj)); + else if(obj instanceof Block) + return areStacksEqual(stack, new ItemStack((Block)obj)); + else if(obj instanceof String) + for(ItemStack item : OreDictionary.getOres((String)obj)) + return areStacksEqual(stack, item); + return false; + } + + public boolean areStacksEqual(ItemStack stack1, ItemStack stack2) + { + if (stack1 == null || stack2 == null) return false; + return stack1.getItem() == stack2.getItem() && (stack1.getItemDamage() == OreDictionary.WILDCARD_VALUE + || stack1.getItemDamage() == stack2.getItemDamage()); + } +} diff --git a/src/api/java/com/shinoow/abyssalcraft/api/ritual/package-info.java b/src/api/java/com/shinoow/abyssalcraft/api/ritual/package-info.java new file mode 100644 index 00000000..b4641bdd --- /dev/null +++ b/src/api/java/com/shinoow/abyssalcraft/api/ritual/package-info.java @@ -0,0 +1,4 @@ +@API(apiVersion=AbyssalCraftAPI.API_VERSION,owner="abyssalcraft",provides="AbyssalCraftAPI") +package com.shinoow.abyssalcraft.api.ritual; +import net.minecraftforge.fml.common.API; +import com.shinoow.abyssalcraft.api.AbyssalCraftAPI; \ No newline at end of file diff --git a/src/api/java/rtg/RTG.java b/src/api/java/rtg/RTG.java new file mode 100644 index 00000000..5ea4e068 --- /dev/null +++ b/src/api/java/rtg/RTG.java @@ -0,0 +1,147 @@ +package rtg; + +import java.io.File; +import java.util.ArrayList; + +import net.minecraft.world.gen.structure.MapGenStructureIO; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.Mod.EventHandler; +import net.minecraftforge.fml.common.Mod.Instance; +import net.minecraftforge.fml.common.SidedProxy; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.event.FMLServerStoppedEvent; + +import rtg.api.event.BiomeConfigEvent; +import rtg.config.BiomeConfigManager; +import rtg.config.ConfigManager; +import rtg.config.rtg.ConfigRTG; +import rtg.event.EventManagerRTG; +import rtg.event.WorldTypeMessageEventHandler; +import rtg.proxy.ClientProxy; +import rtg.proxy.CommonProxy; +import rtg.reference.ModInfo; +import rtg.util.RealisticBiomePresenceTester; +import rtg.world.WorldTypeRTG; +import rtg.world.biome.realistic.abyssalcraft.RealisticBiomeACBase; +import rtg.world.biome.realistic.agriculturalrevolution.RealisticBiomeARBase; +import rtg.world.biome.realistic.betteragriculture.RealisticBiomeBABase; +import rtg.world.biome.realistic.biomesoplenty.RealisticBiomeBOPBase; +import rtg.world.biome.realistic.biomesyougo.RealisticBiomeBYGBase; +import rtg.world.biome.realistic.flowercraft.RealisticBiomeFCBase; +import rtg.world.biome.realistic.mithwoodforest.RealisticBiomeMFBase; +import rtg.world.biome.realistic.sugiforest.RealisticBiomeSFBase; +import rtg.world.biome.realistic.vanilla.RealisticBiomeVanillaBase; +import rtg.world.gen.structure.MapGenScatteredFeatureRTG; +import rtg.world.gen.structure.MapGenStrongholdRTG; +import rtg.world.gen.structure.MapGenVillageRTG; +import rtg.world.gen.structure.StructureOceanMonumentRTG; + + +public class RTG { + + public static String configPath; + public static WorldTypeRTG worldtype; + public static EventManagerRTG eventMgr; + private ConfigManager configManager = new ConfigManager(); + private ArrayList oneShotServerCloseActions = new ArrayList<>(); + private ArrayList serverCloseActions = new ArrayList<>(); + + @Instance(ModInfo.MOD_ID) + public static RTG instance; + + @SidedProxy(serverSide = CommonProxy.LOCATION, clientSide = ClientProxy.LOCATION) + public static CommonProxy proxy; + + @EventHandler + public void initPre(FMLPreInitializationEvent event) { + + instance = this; + + worldtype = new WorldTypeRTG(ModInfo.WORLD_TYPE); + + // Biome configs MUST get initialised before the main config. + MinecraftForge.EVENT_BUS.post(new BiomeConfigEvent.Pre()); + BiomeConfigManager.initBiomeConfigs(); + MinecraftForge.EVENT_BUS.post(new BiomeConfigEvent.Post()); + + configPath = event.getModConfigurationDirectory() + File.separator + ModInfo.CONFIG_DIRECTORY + File.separator; + ConfigManager.init(configPath); + + this.registerStructures(); + } + + @EventHandler + public void init(FMLInitializationEvent event) { + + eventMgr = new EventManagerRTG(); + eventMgr.registerEventHandlers(); + + // This event handler unregisters itself, so it doesn't need to be a part of the event management system. + if (ConfigRTG.enableWorldTypeNotificationScreen) { + MinecraftForge.EVENT_BUS.register(WorldTypeMessageEventHandler.instance); + } + } + + @EventHandler + public void initPost(FMLPostInitializationEvent event) { + + RealisticBiomeVanillaBase.addBiomes(); + + RealisticBiomeACBase.addBiomes(); + RealisticBiomeARBase.addBiomes(); + RealisticBiomeBABase.addBiomes(); + RealisticBiomeBOPBase.addBiomes(); + RealisticBiomeBYGBase.addBiomes(); + RealisticBiomeFCBase.addBiomes(); + RealisticBiomeMFBase.addBiomes(); + RealisticBiomeSFBase.addBiomes(); + + RealisticBiomePresenceTester.doBiomeCheck(); + } + + @EventHandler + public void onServerStopped(FMLServerStoppedEvent event) + { + serverCloseActions.forEach(Runnable::run); + oneShotServerCloseActions.forEach(Runnable::run); + oneShotServerCloseActions.clear(); + } + + private void registerStructures() { + + if (ConfigRTG.enableScatteredFeatureModifications) { + MapGenStructureIO.registerStructure(MapGenScatteredFeatureRTG.Start.class, "rtg_MapGenScatteredFeatureRTG"); + } + + if (ConfigRTG.enableVillageModifications) { + MapGenStructureIO.registerStructure(MapGenVillageRTG.Start.class, "rtg_MapGenVillageRTG"); + } + + if (ConfigRTG.enableOceanMonumentModifications) { + MapGenStructureIO.registerStructure(StructureOceanMonumentRTG.StartMonument.class, "rtg_MapGenOceanMonumentRTG"); + } + + if (ConfigRTG.enableStrongholdModifications) { + MapGenStructureIO.registerStructure(MapGenStrongholdRTG.Start.class, "rtg_MapGenStrongholdRTG"); + } + } + + public void runOnServerClose(Runnable action) { + serverCloseActions.add(action); + } + + public void runOnNextServerCloseOnly(Runnable action) { + serverCloseActions.add(action); + } + + /* + * This method is currently unused, but we're leaving it here for when we start + * supporting multiple dimensions. + */ + public ConfigManager configManager(int dimension) { + return configManager; + } +} diff --git a/src/api/java/rtg/api/biome/BiomeConfig.java b/src/api/java/rtg/api/biome/BiomeConfig.java new file mode 100644 index 00000000..d07bab34 --- /dev/null +++ b/src/api/java/rtg/api/biome/BiomeConfig.java @@ -0,0 +1,179 @@ +package rtg.api.biome; + +import java.util.ArrayList; + +import net.minecraftforge.common.config.Configuration; + +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfig { + + public static final String allowVillagesId = "allowVillages"; + public static final String allowVillagesName = "Allow Villages"; + public static final String allowVolcanoesId = "allowVolcanoes"; + public static final String allowVolcanoesName = "Allow Volcanoes"; + public static final String volcanoChanceId = "volcanoChance"; + public static final String volcanoChanceName = "Volcano Chance"; + public static final String useRTGDecorationsId = "useRTGDecorations"; + public static final String useRTGDecorationsName = "Use RTG Decorations"; + public static final String useRTGSurfacesId = "useRTGSurfaces"; + public static final String useRTGSurfacesName = "Use RTG Surfaces"; + public static final String surfaceTopBlockId = "surfaceTopBlock"; + public static final String surfaceTopBlockName = "RTG Surface: Top Block"; + public static final String surfaceTopBlockMetaId = "surfaceTopBlockMeta"; + public static final String surfaceTopBlockMetaName = "RTG Surface: Top Block Meta"; + public static final String surfaceFillerBlockId = "surfaceFillerBlock"; + public static final String surfaceFillerBlockName = "RTG Surface: Filler Block"; + public static final String surfaceFillerBlockMetaId = "surfaceFillerBlockMeta"; + public static final String surfaceFillerBlockMetaName = "RTG Surface: Filler Block Meta"; + public static final String caveDensityId = "caveDensity"; + public static final String caveDensityName = "Cave Density"; + public static final String caveFrequencyId = "caveFrequency"; + public static final String caveFrequencyName = "Cave Frequency"; + public static final String ravineFrequencyId = "ravineFrequency"; + public static final String ravineFrequencyName = "Ravine Frequency"; + public static final String beachBiomeId = "beachBiome"; + public static final String beachBiomeName = "Beach Biome"; + public String modSlug; + public String biomeSlug; + public ArrayList properties; + + public BiomeConfig(String modSlug, String biomeSlug) { + + this.modSlug = modSlug; + this.biomeSlug = biomeSlug; + + this.properties = new ArrayList(); + + this.addProperty(new BiomeConfigProperty(allowVillagesId, Type.BOOLEAN, allowVillagesName, "", true)); + + this.addProperty(new BiomeConfigProperty(allowVolcanoesId, Type.BOOLEAN, allowVolcanoesName, "", false)); + this.addProperty(new BiomeConfigProperty(volcanoChanceId, Type.INTEGER, volcanoChanceName, "1/x chance that a volcano will generate if this biome has volcanoes enabled." + Configuration.NEW_LINE + "1 = Always generate if possible; 2 = 50% chance; 4 = 25% chance" + Configuration.NEW_LINE + "Set to -1 to use global setting. Set to 0 to disable volcanoes for this biome." + Configuration.NEW_LINE, -1, -1, Integer.MAX_VALUE)); + + this.addProperty(new BiomeConfigProperty(useRTGDecorationsId, Type.BOOLEAN, useRTGDecorationsName, "", true)); + + this.addProperty(new BiomeConfigProperty(useRTGSurfacesId, Type.BOOLEAN, useRTGSurfacesName, "", true)); + this.addProperty(new BiomeConfigProperty(surfaceTopBlockId, Type.STRING, surfaceTopBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceTopBlockMetaId, Type.STRING, surfaceTopBlockMetaName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceFillerBlockId, Type.STRING, surfaceFillerBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceFillerBlockMetaId, Type.STRING, surfaceFillerBlockMetaName, "", "")); + this.addProperty(new BiomeConfigProperty(caveDensityId, Type.INTEGER, caveDensityName, "This setting controls the size of caves." + Configuration.NEW_LINE + "HIGHER values = BIGGER caves & MORE lag. (14 = vanilla cave density)" + Configuration.NEW_LINE + "Set to -1 to use global setting. Set to 0 to disable caves for this biome." + Configuration.NEW_LINE, -1, -1, 40)); + this.addProperty(new BiomeConfigProperty(caveFrequencyId, Type.INTEGER, caveFrequencyName, "This setting controls the number of caves that generate." + Configuration.NEW_LINE + "LOWER values = MORE caves & MORE lag. (6 = vanilla cave frequency)" + Configuration.NEW_LINE + "Set to -1 to use global setting. Set to 0 to disable caves for this biome." + Configuration.NEW_LINE, -1, -1, 40)); + this.addProperty(new BiomeConfigProperty(ravineFrequencyId, Type.INTEGER, ravineFrequencyName, "This setting controls the number of ravines that generate." + Configuration.NEW_LINE + "LOWER values = MORE ravines & MORE lag. (50 = vanilla ravine frequency)" + Configuration.NEW_LINE + "Set to -1 to use global setting. Set to 0 to disable ravines for this biome." + Configuration.NEW_LINE, -1, -1, 100)); + + this.addProperty(new BiomeConfigProperty( + beachBiomeId, Type.INTEGER, beachBiomeName, + "Biome ID to use for this biome's beach." + + Configuration.NEW_LINE + + "The only 'officially supported' values for this setting are:" + + Configuration.NEW_LINE + + "-1 = Automatic beach generation (RECOMMENDED)" + + Configuration.NEW_LINE + + "16 = Vanilla Beach" + + Configuration.NEW_LINE + + "26 = Vanilla Cold Beach" + + Configuration.NEW_LINE + + "25 = Vanilla Stone Beach" + + Configuration.NEW_LINE + + "The ID of this biome = No beach" + + Configuration.NEW_LINE + + "Other biome IDs are allowed, but they have not been tested, may yield undesirable results, and will not be supported." + + Configuration.NEW_LINE + + "Note: If this biome has been hardcoded by RTG to use a specific beach, this setting will have no effect." + + Configuration.NEW_LINE, + -1, -1, 255 + )); + } + + public void addProperty(BiomeConfigProperty property) { + + for (int i = 0; i < this.properties.size(); i++) { + + if (this.properties.get(i).id.contentEquals(property.id)) { + removeProperty(property.id); + break; + } + } + + this.properties.add(property); + } + + public void removeProperty(String id) { + + for (int i = 0; i < this.properties.size(); i++) { + + if (this.properties.get(i).id.contentEquals(id)) { + this.properties.remove(i); + return; + } + } + } + + public ArrayList getProperties() { + + return this.properties; + } + + public BiomeConfigProperty getPropertyById(String id) { + + for (int i = 0; i < this.properties.size(); i++) { + + if (this.properties.get(i).id.contentEquals(id)) { + return this.properties.get(i); + } + } + return null; + } + + public void setPropertyValueById(String id, boolean value) { + + getPropertyById(id).valueBoolean = value; + } + + public void setPropertyValueById(String id, int value) { + + getPropertyById(id).valueInt = value; + } + + public void setPropertyValueById(String id, String value) { + + getPropertyById(id).valueString = value; + } + + public boolean _boolean(String id) { + + try { + + return getPropertyById(id).valueBoolean; + } + catch (Exception e) { + + throw new RuntimeException("Biome config property (" + modSlug + "." + biomeSlug + "." + id + ") could not be found. Reason: " + e.getMessage()); + } + } + + public int _int(String id) { + + try { + + return getPropertyById(id).valueInt; + } + catch (Exception e) { + + throw new RuntimeException("Biome config property (" + modSlug + "." + biomeSlug + "." + id + ") could not be found. Reason: " + e.getMessage()); + } + } + + public String _string(String id) { + + try { + + return getPropertyById(id).valueString; + } + catch (Exception e) { + + throw new RuntimeException("Biome config property (" + modSlug + "." + biomeSlug + "." + id + ") could not be found. Reason: " + e.getMessage()); + } + } +} diff --git a/src/api/java/rtg/api/biome/BiomeConfigProperty.java b/src/api/java/rtg/api/biome/BiomeConfigProperty.java new file mode 100644 index 00000000..fb3ac25a --- /dev/null +++ b/src/api/java/rtg/api/biome/BiomeConfigProperty.java @@ -0,0 +1,53 @@ +package rtg.api.biome; + + +public class BiomeConfigProperty { + + public String id; + public Type type; + public String name; + public String description; + + public int minValue; + public int maxValue; + public int valueInt; + public boolean valueBoolean; + public String valueString; + + public BiomeConfigProperty(String id, Type type, String name, String description) { + + this.id = id; + this.type = type; + this.name = name; + this.description = description; + } + + public BiomeConfigProperty(String id, Type type, String name, String description, boolean defaultValue) { + + this(id, type, name, description); + + this.valueBoolean = defaultValue; + } + + public BiomeConfigProperty(String id, Type type, String name, String description, String defaultValue) { + + this(id, type, name, description); + + this.valueString = defaultValue; + } + + public BiomeConfigProperty(String id, Type type, String name, String description, int defaultValue, int minValue, int maxValue) { + + this(id, type, name, description); + + this.valueInt = defaultValue; + this.minValue = minValue; + this.maxValue = maxValue; + } + + public enum Type { + INTEGER, + BOOLEAN, + STRING + } +} diff --git a/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigAC.java b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigAC.java new file mode 100644 index 00000000..593214d6 --- /dev/null +++ b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigAC.java @@ -0,0 +1,27 @@ +package rtg.api.biome.abyssalcraft.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigAC { + + public static BiomeConfig biomeConfigACCoraliumInfestedSwamp; + public static BiomeConfig biomeConfigACDarklands; + public static BiomeConfig biomeConfigACDarklandsForest; + public static BiomeConfig biomeConfigACDarklandsHighland; + public static BiomeConfig biomeConfigACDarklandsMountains; + public static BiomeConfig biomeConfigACDarklandsPlains; + + public static BiomeConfig[] getBiomeConfigs() { + + BiomeConfig[] biomeConfigs = new BiomeConfig[]{ + biomeConfigACCoraliumInfestedSwamp, + biomeConfigACDarklands, + biomeConfigACDarklandsForest, + biomeConfigACDarklandsHighland, + biomeConfigACDarklandsMountains, + biomeConfigACDarklandsPlains + }; + + return biomeConfigs; + } +} diff --git a/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACBase.java b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACBase.java new file mode 100644 index 00000000..cefc8f99 --- /dev/null +++ b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACBase.java @@ -0,0 +1,13 @@ +package rtg.api.biome.abyssalcraft.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigACBase extends BiomeConfig { + + public BiomeConfigACBase(String biomeSlug) { + + super("abyssalcraft", biomeSlug); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACCoraliumInfestedSwamp.java b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACCoraliumInfestedSwamp.java new file mode 100644 index 00000000..1dcdec45 --- /dev/null +++ b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACCoraliumInfestedSwamp.java @@ -0,0 +1,10 @@ +package rtg.api.biome.abyssalcraft.config; + + +public class BiomeConfigACCoraliumInfestedSwamp extends BiomeConfigACBase { + + public BiomeConfigACCoraliumInfestedSwamp() { + + super("coraliuminfestedswamp"); + } +} diff --git a/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklands.java b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklands.java new file mode 100644 index 00000000..dc78fd13 --- /dev/null +++ b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklands.java @@ -0,0 +1,27 @@ +package rtg.api.biome.abyssalcraft.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigACDarklands extends BiomeConfigACBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigACDarklands() { + + super("darklands"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsForest.java b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsForest.java new file mode 100644 index 00000000..916e5a28 --- /dev/null +++ b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsForest.java @@ -0,0 +1,27 @@ +package rtg.api.biome.abyssalcraft.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigACDarklandsForest extends BiomeConfigACBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigACDarklandsForest() { + + super("darklandsforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsHighland.java b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsHighland.java new file mode 100644 index 00000000..ea0b4095 --- /dev/null +++ b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsHighland.java @@ -0,0 +1,30 @@ +package rtg.api.biome.abyssalcraft.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigACDarklandsHighland extends BiomeConfigACBase { + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public static final String surfaceMixFillerBlockId = "surfaceMixFillerBlock"; + public static final String surfaceMixFillerBlockName = "RTG Surface: Mix Filler Block"; + + public static final String surfaceMixFillerBlockMetaId = "surfaceMixFillerBlockMeta"; + public static final String surfaceMixFillerBlockMetaName = "RTG Surface: Mix Filler Block Meta"; + + public BiomeConfigACDarklandsHighland() { + + super("darklandshighland"); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixFillerBlockId, Type.STRING, surfaceMixFillerBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixFillerBlockMetaId, Type.STRING, surfaceMixFillerBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsMountains.java b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsMountains.java new file mode 100644 index 00000000..df8ff202 --- /dev/null +++ b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsMountains.java @@ -0,0 +1,10 @@ +package rtg.api.biome.abyssalcraft.config; + + +public class BiomeConfigACDarklandsMountains extends BiomeConfigACBase { + + public BiomeConfigACDarklandsMountains() { + + super("darklandsmountains"); + } +} diff --git a/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsPlains.java b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsPlains.java new file mode 100644 index 00000000..108783fc --- /dev/null +++ b/src/api/java/rtg/api/biome/abyssalcraft/config/BiomeConfigACDarklandsPlains.java @@ -0,0 +1,10 @@ +package rtg.api.biome.abyssalcraft.config; + + +public class BiomeConfigACDarklandsPlains extends BiomeConfigACBase { + + public BiomeConfigACDarklandsPlains() { + + super("darklandsplains"); + } +} diff --git a/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigAR.java b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigAR.java new file mode 100644 index 00000000..dcb8548e --- /dev/null +++ b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigAR.java @@ -0,0 +1,27 @@ +package rtg.api.biome.agriculturalrevolution.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigAR { + + public static BiomeConfig biomeConfigARBambooGrove; + public static BiomeConfig biomeConfigARCoralReef; + public static BiomeConfig biomeConfigARDeepReef; + public static BiomeConfig biomeConfigARKelpForest; + public static BiomeConfig biomeConfigAROrchard; + public static BiomeConfig biomeConfigARTropicalHills; + + public static BiomeConfig[] getBiomeConfigs() { + + BiomeConfig[] biomeConfigs = new BiomeConfig[]{ + biomeConfigARBambooGrove, + biomeConfigARCoralReef, + biomeConfigARDeepReef, + biomeConfigARKelpForest, + biomeConfigAROrchard, + biomeConfigARTropicalHills + }; + + return biomeConfigs; + } +} diff --git a/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARBambooGrove.java b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARBambooGrove.java new file mode 100644 index 00000000..9c747f08 --- /dev/null +++ b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARBambooGrove.java @@ -0,0 +1,10 @@ +package rtg.api.biome.agriculturalrevolution.config; + + +public class BiomeConfigARBambooGrove extends BiomeConfigARBase { + + public BiomeConfigARBambooGrove() { + + super("bamboogrove"); + } +} diff --git a/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARBase.java b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARBase.java new file mode 100644 index 00000000..77f78ab8 --- /dev/null +++ b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARBase.java @@ -0,0 +1,11 @@ +package rtg.api.biome.agriculturalrevolution.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigARBase extends BiomeConfig { + + public BiomeConfigARBase(String biomeSlug) { + + super("cookingplus", biomeSlug); + } +} diff --git a/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARCoralReef.java b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARCoralReef.java new file mode 100644 index 00000000..d235501b --- /dev/null +++ b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARCoralReef.java @@ -0,0 +1,12 @@ +package rtg.api.biome.agriculturalrevolution.config; + + +public class BiomeConfigARCoralReef extends BiomeConfigARBase { + + public BiomeConfigARCoralReef() { + + super("coralreef"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARDeepReef.java b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARDeepReef.java new file mode 100644 index 00000000..bee202c6 --- /dev/null +++ b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARDeepReef.java @@ -0,0 +1,12 @@ +package rtg.api.biome.agriculturalrevolution.config; + + +public class BiomeConfigARDeepReef extends BiomeConfigARBase { + + public BiomeConfigARDeepReef() { + + super("deepreef"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARKelpForest.java b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARKelpForest.java new file mode 100644 index 00000000..a5b2b2e4 --- /dev/null +++ b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARKelpForest.java @@ -0,0 +1,12 @@ +package rtg.api.biome.agriculturalrevolution.config; + + +public class BiomeConfigARKelpForest extends BiomeConfigARBase { + + public BiomeConfigARKelpForest() { + + super("kelpforest"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigAROrchard.java b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigAROrchard.java new file mode 100644 index 00000000..995631bc --- /dev/null +++ b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigAROrchard.java @@ -0,0 +1,10 @@ +package rtg.api.biome.agriculturalrevolution.config; + + +public class BiomeConfigAROrchard extends BiomeConfigARBase { + + public BiomeConfigAROrchard() { + + super("orchard"); + } +} diff --git a/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARTropicalHills.java b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARTropicalHills.java new file mode 100644 index 00000000..f6a83a67 --- /dev/null +++ b/src/api/java/rtg/api/biome/agriculturalrevolution/config/BiomeConfigARTropicalHills.java @@ -0,0 +1,10 @@ +package rtg.api.biome.agriculturalrevolution.config; + + +public class BiomeConfigARTropicalHills extends BiomeConfigARBase { + + public BiomeConfigARTropicalHills() { + + super("tropicalhills"); + } +} diff --git a/src/api/java/rtg/api/biome/betteragriculture/config/BiomeConfigBA.java b/src/api/java/rtg/api/biome/betteragriculture/config/BiomeConfigBA.java new file mode 100644 index 00000000..66118836 --- /dev/null +++ b/src/api/java/rtg/api/biome/betteragriculture/config/BiomeConfigBA.java @@ -0,0 +1,17 @@ +package rtg.api.biome.betteragriculture.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigBA { + + public static BiomeConfig biomeConfigBAFarmlandBiome; + + public static BiomeConfig[] getBiomeConfigs() { + + BiomeConfig[] biomeConfigs = new BiomeConfig[]{ + biomeConfigBAFarmlandBiome + }; + + return biomeConfigs; + } +} diff --git a/src/api/java/rtg/api/biome/betteragriculture/config/BiomeConfigBABase.java b/src/api/java/rtg/api/biome/betteragriculture/config/BiomeConfigBABase.java new file mode 100644 index 00000000..f26eedcb --- /dev/null +++ b/src/api/java/rtg/api/biome/betteragriculture/config/BiomeConfigBABase.java @@ -0,0 +1,11 @@ +package rtg.api.biome.betteragriculture.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigBABase extends BiomeConfig { + + public BiomeConfigBABase(String biomeSlug) { + + super("betteragriculture", biomeSlug); + } +} diff --git a/src/api/java/rtg/api/biome/betteragriculture/config/BiomeConfigBAFarmlandBiome.java b/src/api/java/rtg/api/biome/betteragriculture/config/BiomeConfigBAFarmlandBiome.java new file mode 100644 index 00000000..f45834e2 --- /dev/null +++ b/src/api/java/rtg/api/biome/betteragriculture/config/BiomeConfigBAFarmlandBiome.java @@ -0,0 +1,17 @@ +package rtg.api.biome.betteragriculture.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigBAFarmlandBiome extends rtg.api.biome.betteragriculture.config.BiomeConfigBABase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBAFarmlandBiome() { + + super("farmlandbiome"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOP.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOP.java new file mode 100644 index 00000000..8f5b0675 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOP.java @@ -0,0 +1,141 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigBOP { + + public static BiomeConfig biomeConfigBOPAlps; + public static BiomeConfig biomeConfigBOPBambooForest; + public static BiomeConfig biomeConfigBOPBayou; + public static BiomeConfig biomeConfigBOPBog; + public static BiomeConfig biomeConfigBOPBorealForest; + public static BiomeConfig biomeConfigBOPBrushland; + public static BiomeConfig biomeConfigBOPChaparral; + public static BiomeConfig biomeConfigBOPCherryBlossomGrove; + public static BiomeConfig biomeConfigBOPColdDesert; + public static BiomeConfig biomeConfigBOPConiferousForest; + public static BiomeConfig biomeConfigBOPCoralReef; + public static BiomeConfig biomeConfigBOPCrag; + public static BiomeConfig biomeConfigBOPDeadForest; + public static BiomeConfig biomeConfigBOPDeadSwamp; + public static BiomeConfig biomeConfigBOPEucalyptusForest; + public static BiomeConfig biomeConfigBOPFen; + public static BiomeConfig biomeConfigBOPFlowerField; + public static BiomeConfig biomeConfigBOPFlowerIsland; + public static BiomeConfig biomeConfigBOPGlacier; + public static BiomeConfig biomeConfigBOPGrassland; + public static BiomeConfig biomeConfigBOPGravelBeach; + public static BiomeConfig biomeConfigBOPGrove; + public static BiomeConfig biomeConfigBOPHeathland; + public static BiomeConfig biomeConfigBOPHighland; + public static BiomeConfig biomeConfigBOPKelpForest; + public static BiomeConfig biomeConfigBOPLandOfLakes; + public static BiomeConfig biomeConfigBOPLavenderFields; + public static BiomeConfig biomeConfigBOPLushDesert; + public static BiomeConfig biomeConfigBOPLushSwamp; + public static BiomeConfig biomeConfigBOPMangrove; + public static BiomeConfig biomeConfigBOPMapleWoods; + public static BiomeConfig biomeConfigBOPMarsh; + public static BiomeConfig biomeConfigBOPMeadow; + public static BiomeConfig biomeConfigBOPMoor; + public static BiomeConfig biomeConfigBOPMountainPeaks; + public static BiomeConfig biomeConfigBOPMountainFoothills; + public static BiomeConfig biomeConfigBOPMysticGrove; + public static BiomeConfig biomeConfigBOPOasis; + public static BiomeConfig biomeConfigBOPOminousWoods; + public static BiomeConfig biomeConfigBOPOrchard; + public static BiomeConfig biomeConfigBOPOriginIsland; + public static BiomeConfig biomeConfigBOPOutback; + public static BiomeConfig biomeConfigBOPOvergrownCliffs; + public static BiomeConfig biomeConfigBOPPrairie; + public static BiomeConfig biomeConfigBOPQuagmire; + public static BiomeConfig biomeConfigBOPRainforest; + public static BiomeConfig biomeConfigBOPRedwoodForest; + public static BiomeConfig biomeConfigBOPSacredSprings; + public static BiomeConfig biomeConfigBOPSeasonalForest; + public static BiomeConfig biomeConfigBOPShield; + public static BiomeConfig biomeConfigBOPShrubland; + public static BiomeConfig biomeConfigBOPSnowyConiferousForest; + public static BiomeConfig biomeConfigBOPSnowyForest; + public static BiomeConfig biomeConfigBOPSteppe; + public static BiomeConfig biomeConfigBOPTemperateRainforest; + public static BiomeConfig biomeConfigBOPTropicalIsland; + public static BiomeConfig biomeConfigBOPTropicalRainforest; + public static BiomeConfig biomeConfigBOPTundra; + public static BiomeConfig biomeConfigBOPVolcanicIsland; + public static BiomeConfig biomeConfigBOPWasteland; + public static BiomeConfig biomeConfigBOPWetland; + public static BiomeConfig biomeConfigBOPWoodland; + public static BiomeConfig biomeConfigBOPXericShrubland; + + public static BiomeConfig[] getBiomeConfigs() { + + BiomeConfig[] biomeConfigs = new BiomeConfig[]{ + biomeConfigBOPAlps, + biomeConfigBOPBambooForest, + biomeConfigBOPBayou, + biomeConfigBOPBog, + biomeConfigBOPBorealForest, + biomeConfigBOPBrushland, + biomeConfigBOPChaparral, + biomeConfigBOPCherryBlossomGrove, + biomeConfigBOPColdDesert, + biomeConfigBOPConiferousForest, + biomeConfigBOPCoralReef, + biomeConfigBOPCrag, + biomeConfigBOPDeadForest, + biomeConfigBOPDeadSwamp, + biomeConfigBOPEucalyptusForest, + biomeConfigBOPFen, + biomeConfigBOPFlowerField, + biomeConfigBOPFlowerIsland, + biomeConfigBOPGlacier, + biomeConfigBOPGrassland, + biomeConfigBOPGravelBeach, + biomeConfigBOPGrove, + biomeConfigBOPHeathland, + biomeConfigBOPHighland, + biomeConfigBOPKelpForest, + biomeConfigBOPLandOfLakes, + biomeConfigBOPLavenderFields, + biomeConfigBOPLushDesert, + biomeConfigBOPLushSwamp, + biomeConfigBOPMangrove, + biomeConfigBOPMapleWoods, + biomeConfigBOPMarsh, + biomeConfigBOPMeadow, + biomeConfigBOPMoor, + biomeConfigBOPMountainPeaks, + biomeConfigBOPMountainFoothills, + biomeConfigBOPMysticGrove, + biomeConfigBOPOasis, + biomeConfigBOPOminousWoods, + biomeConfigBOPOrchard, + biomeConfigBOPOriginIsland, + biomeConfigBOPOutback, + biomeConfigBOPOvergrownCliffs, + biomeConfigBOPPrairie, + biomeConfigBOPQuagmire, + biomeConfigBOPRainforest, + biomeConfigBOPRedwoodForest, + biomeConfigBOPSacredSprings, + biomeConfigBOPSeasonalForest, + biomeConfigBOPShield, + biomeConfigBOPShrubland, + biomeConfigBOPSnowyConiferousForest, + biomeConfigBOPSnowyForest, + biomeConfigBOPSteppe, + biomeConfigBOPTemperateRainforest, + biomeConfigBOPTropicalIsland, + biomeConfigBOPTropicalRainforest, + biomeConfigBOPTundra, + biomeConfigBOPVolcanicIsland, + biomeConfigBOPWasteland, + biomeConfigBOPWetland, + biomeConfigBOPWoodland, + biomeConfigBOPXericShrubland + }; + + return biomeConfigs; + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPAlps.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPAlps.java new file mode 100644 index 00000000..c0f55807 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPAlps.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPAlps extends BiomeConfigBOPBase { + + public BiomeConfigBOPAlps() { + + super("alps"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBambooForest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBambooForest.java new file mode 100644 index 00000000..ac512b50 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBambooForest.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPBambooForest extends BiomeConfigBOPBase { + + public BiomeConfigBOPBambooForest() { + + super("bambooforest"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBase.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBase.java new file mode 100644 index 00000000..5bc501bc --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBase.java @@ -0,0 +1,11 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigBOPBase extends BiomeConfig { + + public BiomeConfigBOPBase(String biomeSlug) { + + super("biomesoplenty", biomeSlug); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBayou.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBayou.java new file mode 100644 index 00000000..26e2dc84 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBayou.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPBayou extends BiomeConfigBOPBase { + + public BiomeConfigBOPBayou() { + + super("bayou"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBog.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBog.java new file mode 100644 index 00000000..2443e84a --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBog.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPBog extends BiomeConfigBOPBase { + + public BiomeConfigBOPBog() { + + super("bog"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBorealForest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBorealForest.java new file mode 100644 index 00000000..172e913c --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBorealForest.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPBorealForest extends BiomeConfigBOPBase { + + public BiomeConfigBOPBorealForest() { + + super("borealforest"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBrushland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBrushland.java new file mode 100644 index 00000000..7b8b3745 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPBrushland.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPBrushland extends BiomeConfigBOPBase { + + public BiomeConfigBOPBrushland() { + + super("brushland"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPChaparral.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPChaparral.java new file mode 100644 index 00000000..87349ea3 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPChaparral.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPChaparral extends BiomeConfigBOPBase { + + public BiomeConfigBOPChaparral() { + + super("chaparral"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPCherryBlossomGrove.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPCherryBlossomGrove.java new file mode 100644 index 00000000..6e009602 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPCherryBlossomGrove.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPCherryBlossomGrove extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPCherryBlossomGrove() { + + super("cherryblossomgrove"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPColdDesert.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPColdDesert.java new file mode 100644 index 00000000..56046c23 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPColdDesert.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPColdDesert extends BiomeConfigBOPBase { + + public BiomeConfigBOPColdDesert() { + + super("colddesert"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPConiferousForest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPConiferousForest.java new file mode 100644 index 00000000..ad2a7988 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPConiferousForest.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPConiferousForest extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPConiferousForest() { + + super("coniferousforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPCoralReef.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPCoralReef.java new file mode 100644 index 00000000..65e27575 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPCoralReef.java @@ -0,0 +1,12 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPCoralReef extends BiomeConfigBOPBase { + + public BiomeConfigBOPCoralReef() { + + super("coralreef"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPCrag.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPCrag.java new file mode 100644 index 00000000..b735c9c9 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPCrag.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPCrag extends BiomeConfigBOPBase { + + public BiomeConfigBOPCrag() { + + super("crag"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPDeadForest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPDeadForest.java new file mode 100644 index 00000000..5758b64d --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPDeadForest.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPDeadForest extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPDeadForest() { + + super("deadforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPDeadSwamp.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPDeadSwamp.java new file mode 100644 index 00000000..c843d0b4 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPDeadSwamp.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPDeadSwamp extends BiomeConfigBOPBase { + + public BiomeConfigBOPDeadSwamp() { + + super("deadswamp"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPEucalyptusForest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPEucalyptusForest.java new file mode 100644 index 00000000..98687597 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPEucalyptusForest.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPEucalyptusForest extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPEucalyptusForest() { + + super("eucalyptusforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPFen.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPFen.java new file mode 100644 index 00000000..bd9fb585 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPFen.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPFen extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPFen() { + + super("fen"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPFlowerField.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPFlowerField.java new file mode 100644 index 00000000..f06a1d1f --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPFlowerField.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPFlowerField extends BiomeConfigBOPBase { + + public BiomeConfigBOPFlowerField() { + + super("flowerfield"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPFlowerIsland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPFlowerIsland.java new file mode 100644 index 00000000..b0d7e9e0 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPFlowerIsland.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPFlowerIsland extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPFlowerIsland() { + + super("flowerisland"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGlacier.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGlacier.java new file mode 100644 index 00000000..8a07ef78 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGlacier.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPGlacier extends BiomeConfigBOPBase { + + public BiomeConfigBOPGlacier() { + + super("glacier"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGrassland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGrassland.java new file mode 100644 index 00000000..e8734048 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGrassland.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPGrassland extends BiomeConfigBOPBase { + + public BiomeConfigBOPGrassland() { + + super("grassland"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGravelBeach.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGravelBeach.java new file mode 100644 index 00000000..8cc1a6d0 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGravelBeach.java @@ -0,0 +1,12 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPGravelBeach extends BiomeConfigBOPBase { + + public BiomeConfigBOPGravelBeach() { + + super("gravelbeach"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGrove.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGrove.java new file mode 100644 index 00000000..6d7adcda --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPGrove.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPGrove extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPGrove() { + + super("grove"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPHeathland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPHeathland.java new file mode 100644 index 00000000..500a5c4d --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPHeathland.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPHeathland extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPHeathland() { + + super("heathland"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPHighland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPHighland.java new file mode 100644 index 00000000..bb1996b1 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPHighland.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPHighland extends BiomeConfigBOPBase { + + public BiomeConfigBOPHighland() { + + super("highland"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPKelpForest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPKelpForest.java new file mode 100644 index 00000000..d0a06468 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPKelpForest.java @@ -0,0 +1,12 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPKelpForest extends BiomeConfigBOPBase { + + public BiomeConfigBOPKelpForest() { + + super("kelpforest"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLandOfLakes.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLandOfLakes.java new file mode 100644 index 00000000..c788d274 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLandOfLakes.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPLandOfLakes extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPLandOfLakes() { + + super("landoflakes"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLavenderFields.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLavenderFields.java new file mode 100644 index 00000000..8a9051c9 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLavenderFields.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPLavenderFields extends BiomeConfigBOPBase { + + public BiomeConfigBOPLavenderFields() { + + super("lavenderfields"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLushDesert.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLushDesert.java new file mode 100644 index 00000000..6c1987fa --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLushDesert.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPLushDesert extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPLushDesert() { + + super("lushdesert"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLushSwamp.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLushSwamp.java new file mode 100644 index 00000000..cba77b35 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPLushSwamp.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPLushSwamp extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPLushSwamp() { + + super("lushswamp"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMangrove.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMangrove.java new file mode 100644 index 00000000..2329e2bb --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMangrove.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPMangrove extends BiomeConfigBOPBase +{ + public BiomeConfigBOPMangrove() + { + super("mangrove"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMapleWoods.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMapleWoods.java new file mode 100644 index 00000000..0eb9d66c --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMapleWoods.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPMapleWoods extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPMapleWoods() { + + super("maplewoods"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMarsh.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMarsh.java new file mode 100644 index 00000000..7d45b66a --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMarsh.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPMarsh extends BiomeConfigBOPBase { + + public BiomeConfigBOPMarsh() { + + super("marsh"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMeadow.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMeadow.java new file mode 100644 index 00000000..6c7701e8 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMeadow.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPMeadow extends BiomeConfigBOPBase { + + public BiomeConfigBOPMeadow() { + + super("meadow"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMoor.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMoor.java new file mode 100644 index 00000000..bd569ce3 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMoor.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPMoor extends BiomeConfigBOPBase { + + public BiomeConfigBOPMoor() { + + super("moor"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMountainFoothills.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMountainFoothills.java new file mode 100644 index 00000000..b759bf35 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMountainFoothills.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPMountainFoothills extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPMountainFoothills() { + + super("mountainfoothills"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMountainPeaks.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMountainPeaks.java new file mode 100644 index 00000000..af93f180 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMountainPeaks.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPMountainPeaks extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPMountainPeaks() { + + super("mountainpeaks"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMysticGrove.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMysticGrove.java new file mode 100644 index 00000000..8161d9fc --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPMysticGrove.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPMysticGrove extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPMysticGrove() { + + super("mysticgrove"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOasis.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOasis.java new file mode 100644 index 00000000..dfeba39f --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOasis.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPOasis extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPOasis() { + + super("oasis"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOminousWoods.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOminousWoods.java new file mode 100644 index 00000000..3223b33e --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOminousWoods.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPOminousWoods extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPOminousWoods() { + + super("ominouswoods"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOrchard.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOrchard.java new file mode 100644 index 00000000..a285b37c --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOrchard.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPOrchard extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPOrchard() { + + super("orchard"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOriginIsland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOriginIsland.java new file mode 100644 index 00000000..a832c063 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOriginIsland.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPOriginIsland extends BiomeConfigBOPBase { + + public BiomeConfigBOPOriginIsland() { + + super("originisland"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOutback.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOutback.java new file mode 100644 index 00000000..92aa29b9 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOutback.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPOutback extends BiomeConfigBOPBase { + + public BiomeConfigBOPOutback() { + + super("outback"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOvergrownCliffs.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOvergrownCliffs.java new file mode 100644 index 00000000..a8d3a32c --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPOvergrownCliffs.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPOvergrownCliffs extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPOvergrownCliffs() { + + super("overgrowncliffs"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPPrairie.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPPrairie.java new file mode 100644 index 00000000..ee04e7af --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPPrairie.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPPrairie extends BiomeConfigBOPBase { + + public BiomeConfigBOPPrairie() { + + super("prairie"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPQuagmire.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPQuagmire.java new file mode 100644 index 00000000..acbeec87 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPQuagmire.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPQuagmire extends BiomeConfigBOPBase { + + public BiomeConfigBOPQuagmire() { + + super("quagmire"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPRainforest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPRainforest.java new file mode 100644 index 00000000..cb86889f --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPRainforest.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPRainforest extends BiomeConfigBOPBase { + + public BiomeConfigBOPRainforest() { + + super("rainforest"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPRedwoodForest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPRedwoodForest.java new file mode 100644 index 00000000..04f67bd1 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPRedwoodForest.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPRedwoodForest extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPRedwoodForest() { + + super("redwoodforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSacredSprings.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSacredSprings.java new file mode 100644 index 00000000..b8458d89 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSacredSprings.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPSacredSprings extends BiomeConfigBOPBase { + + public BiomeConfigBOPSacredSprings() { + + super("sacredsprings"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSeasonalForest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSeasonalForest.java new file mode 100644 index 00000000..f46a2e9b --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSeasonalForest.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPSeasonalForest extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPSeasonalForest() { + + super("seasonalforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPShield.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPShield.java new file mode 100644 index 00000000..58ada340 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPShield.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPShield extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPShield() { + + super("shield"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPShrubland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPShrubland.java new file mode 100644 index 00000000..fd03609a --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPShrubland.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPShrubland extends BiomeConfigBOPBase { + + public BiomeConfigBOPShrubland() { + + super("shrubland"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSnowyConiferousForest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSnowyConiferousForest.java new file mode 100644 index 00000000..af40c390 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSnowyConiferousForest.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPSnowyConiferousForest extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPSnowyConiferousForest() { + + super("snowyconiferousforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSnowyForest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSnowyForest.java new file mode 100644 index 00000000..d4029e65 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSnowyForest.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPSnowyForest extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPSnowyForest() { + + super("snowyforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSteppe.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSteppe.java new file mode 100644 index 00000000..2854cda5 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPSteppe.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPSteppe extends BiomeConfigBOPBase { + + public BiomeConfigBOPSteppe() { + + super("steppe"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTemperateRainforest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTemperateRainforest.java new file mode 100644 index 00000000..c03f03ec --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTemperateRainforest.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPTemperateRainforest extends BiomeConfigBOPBase { + + public BiomeConfigBOPTemperateRainforest() { + + super("temperaterainforest"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTropicalIsland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTropicalIsland.java new file mode 100644 index 00000000..659db8d5 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTropicalIsland.java @@ -0,0 +1,18 @@ +package rtg.api.biome.biomesoplenty.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigBOPTropicalIsland extends BiomeConfigBOPBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBOPTropicalIsland() { + + super("tropicalisland"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTropicalRainforest.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTropicalRainforest.java new file mode 100644 index 00000000..04649a65 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTropicalRainforest.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPTropicalRainforest extends BiomeConfigBOPBase { + + public BiomeConfigBOPTropicalRainforest() { + + super("tropicalrainforest"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTundra.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTundra.java new file mode 100644 index 00000000..ec7fc075 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPTundra.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPTundra extends BiomeConfigBOPBase { + + public BiomeConfigBOPTundra() { + + super("tundra"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPVolcanicIsland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPVolcanicIsland.java new file mode 100644 index 00000000..6a415f1e --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPVolcanicIsland.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPVolcanicIsland extends BiomeConfigBOPBase { + + public BiomeConfigBOPVolcanicIsland() { + + super("volcanicisland"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPWasteland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPWasteland.java new file mode 100644 index 00000000..8011b851 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPWasteland.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPWasteland extends BiomeConfigBOPBase { + + public BiomeConfigBOPWasteland() { + + super("wasteland"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPWetland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPWetland.java new file mode 100644 index 00000000..ad4eddd2 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPWetland.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPWetland extends BiomeConfigBOPBase { + + public BiomeConfigBOPWetland() { + + super("wetland"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPWoodland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPWoodland.java new file mode 100644 index 00000000..adb43c25 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPWoodland.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPWoodland extends BiomeConfigBOPBase { + + public BiomeConfigBOPWoodland() { + + super("woodland"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPXericShrubland.java b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPXericShrubland.java new file mode 100644 index 00000000..3c79ea1e --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesoplenty/config/BiomeConfigBOPXericShrubland.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesoplenty.config; + + +public class BiomeConfigBOPXericShrubland extends BiomeConfigBOPBase { + + public BiomeConfigBOPXericShrubland() { + + super("xericshrubland"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYG.java b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYG.java new file mode 100644 index 00000000..ccaabf31 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYG.java @@ -0,0 +1,29 @@ +package rtg.api.biome.biomesyougo.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigBYG { + + public static BiomeConfig biomeConfigBYGAutumnForest; + public static BiomeConfig biomeConfigBYGBirchPlains; + public static BiomeConfig biomeConfigBYGFrozenTundra; + public static BiomeConfig biomeConfigBYGLushForest; + public static BiomeConfig biomeConfigBYGRedDesert; + public static BiomeConfig biomeConfigBYGRedRockMountains; + public static BiomeConfig biomeConfigBYGWillowSwamps; + + public static BiomeConfig[] getBiomeConfigs() { + + BiomeConfig[] biomeConfigs = new BiomeConfig[]{ + biomeConfigBYGAutumnForest, + biomeConfigBYGBirchPlains, + biomeConfigBYGFrozenTundra, + biomeConfigBYGLushForest, + biomeConfigBYGRedDesert, + biomeConfigBYGRedRockMountains, + biomeConfigBYGWillowSwamps + }; + + return biomeConfigs; + } +} diff --git a/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGAutumnForest.java b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGAutumnForest.java new file mode 100644 index 00000000..9cc971eb --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGAutumnForest.java @@ -0,0 +1,26 @@ +package rtg.api.biome.biomesyougo.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigBYGAutumnForest extends BiomeConfigBYGBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigBYGAutumnForest() { + + super("autumnforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, BiomeConfigProperty.Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, BiomeConfigProperty.Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGBase.java b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGBase.java new file mode 100644 index 00000000..19dcd71b --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGBase.java @@ -0,0 +1,11 @@ +package rtg.api.biome.biomesyougo.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigBYGBase extends BiomeConfig { + + public BiomeConfigBYGBase(String biomeSlug) { + + super("biomesyougo", biomeSlug); + } +} diff --git a/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGBirchPlains.java b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGBirchPlains.java new file mode 100644 index 00000000..f2598937 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGBirchPlains.java @@ -0,0 +1,26 @@ +package rtg.api.biome.biomesyougo.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigBYGBirchPlains extends BiomeConfigBYGBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigBYGBirchPlains() { + + super("birchplains2"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, BiomeConfigProperty.Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, BiomeConfigProperty.Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGFrozenTundra.java b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGFrozenTundra.java new file mode 100644 index 00000000..79c8fa6d --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGFrozenTundra.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesyougo.config; + + +public class BiomeConfigBYGFrozenTundra extends BiomeConfigBYGBase { + + public BiomeConfigBYGFrozenTundra() { + + super("frozentundra"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGLushForest.java b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGLushForest.java new file mode 100644 index 00000000..abd75201 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGLushForest.java @@ -0,0 +1,26 @@ +package rtg.api.biome.biomesyougo.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigBYGLushForest extends BiomeConfigBYGBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigBYGLushForest() { + + super("birchplains"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, BiomeConfigProperty.Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, BiomeConfigProperty.Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGRedDesert.java b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGRedDesert.java new file mode 100644 index 00000000..1b8c73ef --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGRedDesert.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesyougo.config; + + +public class BiomeConfigBYGRedDesert extends BiomeConfigBYGBase { + + public BiomeConfigBYGRedDesert() { + + super("reddesert"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGRedRockMountains.java b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGRedRockMountains.java new file mode 100644 index 00000000..b4d8a1ef --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGRedRockMountains.java @@ -0,0 +1,10 @@ +package rtg.api.biome.biomesyougo.config; + + +public class BiomeConfigBYGRedRockMountains extends BiomeConfigBYGBase { + + public BiomeConfigBYGRedRockMountains() { + + super("redrockmoutains"); + } +} diff --git a/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGWillowSwamps.java b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGWillowSwamps.java new file mode 100644 index 00000000..30696046 --- /dev/null +++ b/src/api/java/rtg/api/biome/biomesyougo/config/BiomeConfigBYGWillowSwamps.java @@ -0,0 +1,17 @@ +package rtg.api.biome.biomesyougo.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigBYGWillowSwamps extends BiomeConfigBYGBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigBYGWillowSwamps() { + + super("willowswamps"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/flowercraft/config/BiomeConfigFC.java b/src/api/java/rtg/api/biome/flowercraft/config/BiomeConfigFC.java new file mode 100644 index 00000000..763d1e2f --- /dev/null +++ b/src/api/java/rtg/api/biome/flowercraft/config/BiomeConfigFC.java @@ -0,0 +1,17 @@ +package rtg.api.biome.flowercraft.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigFC { + + public static BiomeConfig biomeConfigFCPhantasia; + + public static BiomeConfig[] getBiomeConfigs() { + + BiomeConfig[] biomeConfigs = new BiomeConfig[]{ + biomeConfigFCPhantasia + }; + + return biomeConfigs; + } +} diff --git a/src/api/java/rtg/api/biome/flowercraft/config/BiomeConfigFCBase.java b/src/api/java/rtg/api/biome/flowercraft/config/BiomeConfigFCBase.java new file mode 100644 index 00000000..5d475301 --- /dev/null +++ b/src/api/java/rtg/api/biome/flowercraft/config/BiomeConfigFCBase.java @@ -0,0 +1,11 @@ +package rtg.api.biome.flowercraft.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigFCBase extends BiomeConfig { + + public BiomeConfigFCBase(String biomeSlug) { + + super("flowercraft", biomeSlug); + } +} diff --git a/src/api/java/rtg/api/biome/flowercraft/config/BiomeConfigFCPhantasia.java b/src/api/java/rtg/api/biome/flowercraft/config/BiomeConfigFCPhantasia.java new file mode 100644 index 00000000..a32a52c9 --- /dev/null +++ b/src/api/java/rtg/api/biome/flowercraft/config/BiomeConfigFCPhantasia.java @@ -0,0 +1,10 @@ +package rtg.api.biome.flowercraft.config; + + +public class BiomeConfigFCPhantasia extends BiomeConfigFCBase { + + public BiomeConfigFCPhantasia() { + + super("phantasia"); + } +} diff --git a/src/api/java/rtg/api/biome/mithwoodforest/config/BiomeConfigMF.java b/src/api/java/rtg/api/biome/mithwoodforest/config/BiomeConfigMF.java new file mode 100644 index 00000000..3638cf3c --- /dev/null +++ b/src/api/java/rtg/api/biome/mithwoodforest/config/BiomeConfigMF.java @@ -0,0 +1,17 @@ +package rtg.api.biome.mithwoodforest.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigMF { + + public static BiomeConfig biomeConfigMFMithwoodForest; + + public static BiomeConfig[] getBiomeConfigs() { + + BiomeConfig[] biomeConfigs = new BiomeConfig[]{ + biomeConfigMFMithwoodForest + }; + + return biomeConfigs; + } +} diff --git a/src/api/java/rtg/api/biome/mithwoodforest/config/BiomeConfigMFBase.java b/src/api/java/rtg/api/biome/mithwoodforest/config/BiomeConfigMFBase.java new file mode 100644 index 00000000..be814817 --- /dev/null +++ b/src/api/java/rtg/api/biome/mithwoodforest/config/BiomeConfigMFBase.java @@ -0,0 +1,11 @@ +package rtg.api.biome.mithwoodforest.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigMFBase extends BiomeConfig { + + public BiomeConfigMFBase(String biomeSlug) { + + super("mithwoodforest", biomeSlug); + } +} diff --git a/src/api/java/rtg/api/biome/mithwoodforest/config/BiomeConfigMFMithwoodForest.java b/src/api/java/rtg/api/biome/mithwoodforest/config/BiomeConfigMFMithwoodForest.java new file mode 100644 index 00000000..eaea099c --- /dev/null +++ b/src/api/java/rtg/api/biome/mithwoodforest/config/BiomeConfigMFMithwoodForest.java @@ -0,0 +1,27 @@ +package rtg.api.biome.mithwoodforest.config; + + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + +public class BiomeConfigMFMithwoodForest extends BiomeConfigMFBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigMFMithwoodForest() { + + super("mithwoodforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/sugiforest/config/BiomeConfigSF.java b/src/api/java/rtg/api/biome/sugiforest/config/BiomeConfigSF.java new file mode 100644 index 00000000..8cf24c5e --- /dev/null +++ b/src/api/java/rtg/api/biome/sugiforest/config/BiomeConfigSF.java @@ -0,0 +1,17 @@ +package rtg.api.biome.sugiforest.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigSF { + + public static BiomeConfig biomeConfigSFSugiForest; + + public static BiomeConfig[] getBiomeConfigs() { + + BiomeConfig[] biomeConfigs = new BiomeConfig[]{ + biomeConfigSFSugiForest + }; + + return biomeConfigs; + } +} diff --git a/src/api/java/rtg/api/biome/sugiforest/config/BiomeConfigSFBase.java b/src/api/java/rtg/api/biome/sugiforest/config/BiomeConfigSFBase.java new file mode 100644 index 00000000..eaa81be5 --- /dev/null +++ b/src/api/java/rtg/api/biome/sugiforest/config/BiomeConfigSFBase.java @@ -0,0 +1,11 @@ +package rtg.api.biome.sugiforest.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigSFBase extends BiomeConfig { + + public BiomeConfigSFBase(String biomeSlug) { + + super("sugiforest", biomeSlug); + } +} diff --git a/src/api/java/rtg/api/biome/sugiforest/config/BiomeConfigSFSugiForest.java b/src/api/java/rtg/api/biome/sugiforest/config/BiomeConfigSFSugiForest.java new file mode 100644 index 00000000..b87a5477 --- /dev/null +++ b/src/api/java/rtg/api/biome/sugiforest/config/BiomeConfigSFSugiForest.java @@ -0,0 +1,17 @@ +package rtg.api.biome.sugiforest.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigSFSugiForest extends BiomeConfigSFBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigSFSugiForest() { + + super("sugiforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanilla.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanilla.java new file mode 100644 index 00000000..6145489c --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanilla.java @@ -0,0 +1,133 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigVanilla { + + public static BiomeConfig biomeConfigVanillaBeach; + public static BiomeConfig biomeConfigVanillaBirchForest; + public static BiomeConfig biomeConfigVanillaBirchForestHills; + public static BiomeConfig biomeConfigVanillaColdBeach; + public static BiomeConfig biomeConfigVanillaColdTaiga; + public static BiomeConfig biomeConfigVanillaColdTaigaHills; + public static BiomeConfig biomeConfigVanillaDeepOcean; + public static BiomeConfig biomeConfigVanillaDesert; + public static BiomeConfig biomeConfigVanillaDesertHills; + public static BiomeConfig biomeConfigVanillaExtremeHills; + public static BiomeConfig biomeConfigVanillaExtremeHillsEdge; + public static BiomeConfig biomeConfigVanillaExtremeHillsPlus; + public static BiomeConfig biomeConfigVanillaForest; + public static BiomeConfig biomeConfigVanillaForestHills; + public static BiomeConfig biomeConfigVanillaFrozenOcean; + public static BiomeConfig biomeConfigVanillaFrozenRiver; + public static BiomeConfig biomeConfigVanillaIcePlains; + public static BiomeConfig biomeConfigVanillaIceMountains; + public static BiomeConfig biomeConfigVanillaJungle; + public static BiomeConfig biomeConfigVanillaJungleEdge; + public static BiomeConfig biomeConfigVanillaJungleHills; + public static BiomeConfig biomeConfigVanillaMegaTaiga; + public static BiomeConfig biomeConfigVanillaMegaTaigaHills; + public static BiomeConfig biomeConfigVanillaMesa; + public static BiomeConfig biomeConfigVanillaMesaPlateau; + public static BiomeConfig biomeConfigVanillaMesaPlateauF; + public static BiomeConfig biomeConfigVanillaMushroomIsland; + public static BiomeConfig biomeConfigVanillaMushroomIslandShore; + public static BiomeConfig biomeConfigVanillaOcean; + public static BiomeConfig biomeConfigVanillaPlains; + public static BiomeConfig biomeConfigVanillaRiver; + public static BiomeConfig biomeConfigVanillaRoofedForest; + public static BiomeConfig biomeConfigVanillaSavanna; + public static BiomeConfig biomeConfigVanillaSavannaPlateau; + public static BiomeConfig biomeConfigVanillaStoneBeach; + public static BiomeConfig biomeConfigVanillaSwampland; + public static BiomeConfig biomeConfigVanillaTaiga; + public static BiomeConfig biomeConfigVanillaTaigaHills; + public static BiomeConfig biomeConfigVanillaSunflowerPlains; + public static BiomeConfig biomeConfigVanillaDesertM; + public static BiomeConfig biomeConfigVanillaExtremeHillsM; + public static BiomeConfig biomeConfigVanillaFlowerForest; + public static BiomeConfig biomeConfigVanillaTaigaM; + public static BiomeConfig biomeConfigVanillaSwamplandM; + public static BiomeConfig biomeConfigVanillaIcePlainsSpikes; + public static BiomeConfig biomeConfigVanillaJungleM; + public static BiomeConfig biomeConfigVanillaJungleEdgeM; + public static BiomeConfig biomeConfigVanillaBirchForestM; + public static BiomeConfig biomeConfigVanillaBirchForestHillsM; + public static BiomeConfig biomeConfigVanillaRoofedForestM; + public static BiomeConfig biomeConfigVanillaColdTaigaM; + public static BiomeConfig biomeConfigVanillaMegaSpruceTaiga; + public static BiomeConfig biomeConfigVanillaRedwoodTaigaHills; + public static BiomeConfig biomeConfigVanillaExtremeHillsPlusM; + public static BiomeConfig biomeConfigVanillaSavannaM; + public static BiomeConfig biomeConfigVanillaSavannaPlateauM; + public static BiomeConfig biomeConfigVanillaMesaBryce; + public static BiomeConfig biomeConfigVanillaMesaPlateauFM; + public static BiomeConfig biomeConfigVanillaMesaPlateauM; + + public static BiomeConfig[] getBiomeConfigs() { + + BiomeConfig[] biomeConfigs = new BiomeConfig[]{ + biomeConfigVanillaBeach, + biomeConfigVanillaBirchForest, + biomeConfigVanillaBirchForestHills, + biomeConfigVanillaBirchForestHillsM, + biomeConfigVanillaBirchForestM, + biomeConfigVanillaColdBeach, + biomeConfigVanillaColdTaiga, + biomeConfigVanillaColdTaigaHills, + biomeConfigVanillaColdTaigaM, + biomeConfigVanillaDeepOcean, + biomeConfigVanillaDesert, + biomeConfigVanillaDesertHills, + biomeConfigVanillaDesertM, + biomeConfigVanillaExtremeHills, + biomeConfigVanillaExtremeHillsEdge, + biomeConfigVanillaExtremeHillsM, + biomeConfigVanillaExtremeHillsPlus, + biomeConfigVanillaExtremeHillsPlusM, + biomeConfigVanillaFlowerForest, + biomeConfigVanillaForest, + biomeConfigVanillaForestHills, + biomeConfigVanillaFrozenOcean, + biomeConfigVanillaFrozenRiver, + biomeConfigVanillaIceMountains, + biomeConfigVanillaIcePlains, + biomeConfigVanillaIcePlainsSpikes, + biomeConfigVanillaJungle, + biomeConfigVanillaJungleEdge, + biomeConfigVanillaJungleEdgeM, + biomeConfigVanillaJungleHills, + biomeConfigVanillaJungleM, + biomeConfigVanillaMegaSpruceTaiga, + biomeConfigVanillaMegaTaiga, + biomeConfigVanillaMegaTaigaHills, + biomeConfigVanillaMesa, + biomeConfigVanillaMesaBryce, + biomeConfigVanillaMesaPlateau, + biomeConfigVanillaMesaPlateauF, + biomeConfigVanillaMesaPlateauFM, + biomeConfigVanillaMesaPlateauM, + biomeConfigVanillaMushroomIsland, + biomeConfigVanillaMushroomIslandShore, + biomeConfigVanillaOcean, + biomeConfigVanillaPlains, + biomeConfigVanillaRedwoodTaigaHills, + biomeConfigVanillaRiver, + biomeConfigVanillaRoofedForest, + biomeConfigVanillaRoofedForestM, + biomeConfigVanillaSavanna, + biomeConfigVanillaSavannaM, + biomeConfigVanillaSavannaPlateau, + biomeConfigVanillaSavannaPlateauM, + biomeConfigVanillaStoneBeach, + biomeConfigVanillaSunflowerPlains, + biomeConfigVanillaSwampland, + biomeConfigVanillaSwamplandM, + biomeConfigVanillaTaiga, + biomeConfigVanillaTaigaHills, + biomeConfigVanillaTaigaM + }; + + return biomeConfigs; + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBase.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBase.java new file mode 100644 index 00000000..e6fbddea --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBase.java @@ -0,0 +1,11 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigVanillaBase extends BiomeConfig { + + public BiomeConfigVanillaBase(String biomeSlug) { + + super("vanilla", biomeSlug); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBeach.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBeach.java new file mode 100644 index 00000000..a2d630a3 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBeach.java @@ -0,0 +1,20 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaBeach extends BiomeConfigVanillaBase { + + public static final String decorationPalmTreesId = "decorationPalmTrees"; + public static final String decorationPalmTreesName = "RTG Decoration: Palm Trees"; + + public BiomeConfigVanillaBeach() { + + super("beach"); + + setPropertyValueById(allowVillagesId, false); + + this.addProperty(new BiomeConfigProperty(decorationPalmTreesId, Type.BOOLEAN, decorationPalmTreesName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForest.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForest.java new file mode 100644 index 00000000..763765fe --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForest.java @@ -0,0 +1,27 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaBirchForest extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaBirchForest() { + + super("birchforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForestHills.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForestHills.java new file mode 100644 index 00000000..410e5b02 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForestHills.java @@ -0,0 +1,27 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaBirchForestHills extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaBirchForestHills() { + + super("birchforesthills"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForestHillsM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForestHillsM.java new file mode 100644 index 00000000..ab2d359e --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForestHillsM.java @@ -0,0 +1,18 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaBirchForestHillsM extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaBirchForestHillsM() { + + super("birchforesthillsm"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForestM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForestM.java new file mode 100644 index 00000000..873c1a5e --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaBirchForestM.java @@ -0,0 +1,27 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaBirchForestM extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaBirchForestM() { + + super("birchforestm"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdBeach.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdBeach.java new file mode 100644 index 00000000..9879c0a5 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdBeach.java @@ -0,0 +1,12 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaColdBeach extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaColdBeach() { + + super("coldbeach"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdTaiga.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdTaiga.java new file mode 100644 index 00000000..df7f47fa --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdTaiga.java @@ -0,0 +1,18 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaColdTaiga extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaColdTaiga() { + + super("coldtaiga"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdTaigaHills.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdTaigaHills.java new file mode 100644 index 00000000..c28190b6 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdTaigaHills.java @@ -0,0 +1,18 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaColdTaigaHills extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaColdTaigaHills() { + + super("coldtaigahills"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdTaigaM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdTaigaM.java new file mode 100644 index 00000000..d3a91bc2 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaColdTaigaM.java @@ -0,0 +1,18 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaColdTaigaM extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaColdTaigaM() { + + super("coldtaigam"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDeepOcean.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDeepOcean.java new file mode 100644 index 00000000..f6b94901 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDeepOcean.java @@ -0,0 +1,24 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaDeepOcean extends BiomeConfigVanillaBase { + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaDeepOcean() { + + super("deepocean"); + + setPropertyValueById(allowVillagesId, false); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDesert.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDesert.java new file mode 100644 index 00000000..9a41d18d --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDesert.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaDesert extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaDesert() { + + super("desert"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDesertHills.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDesertHills.java new file mode 100644 index 00000000..3b3dd96c --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDesertHills.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaDesertHills extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaDesertHills() { + + super("deserthills"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDesertM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDesertM.java new file mode 100644 index 00000000..2a33ae42 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaDesertM.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaDesertM extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaDesertM() { + + super("desertm"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHills.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHills.java new file mode 100644 index 00000000..0cc35976 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHills.java @@ -0,0 +1,35 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaExtremeHills extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public static final String surfaceMixFillerBlockId = "surfaceMixFillerBlock"; + public static final String surfaceMixFillerBlockName = "RTG Surface: Mix Filler Block"; + + public static final String surfaceMixFillerBlockMetaId = "surfaceMixFillerBlockMeta"; + public static final String surfaceMixFillerBlockMetaName = "RTG Surface: Mix Filler Block Meta"; + + public BiomeConfigVanillaExtremeHills() { + + super("extremehills"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixFillerBlockId, Type.STRING, surfaceMixFillerBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixFillerBlockMetaId, Type.STRING, surfaceMixFillerBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsEdge.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsEdge.java new file mode 100644 index 00000000..cac99174 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsEdge.java @@ -0,0 +1,35 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaExtremeHillsEdge extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public static final String surfaceMixFillerBlockId = "surfaceMixFillerBlock"; + public static final String surfaceMixFillerBlockName = "RTG Surface: Mix Filler Block"; + + public static final String surfaceMixFillerBlockMetaId = "surfaceMixFillerBlockMeta"; + public static final String surfaceMixFillerBlockMetaName = "RTG Surface: Mix Filler Block Meta"; + + public BiomeConfigVanillaExtremeHillsEdge() { + + super("extremehillsedge"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixFillerBlockId, Type.STRING, surfaceMixFillerBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixFillerBlockMetaId, Type.STRING, surfaceMixFillerBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsM.java new file mode 100644 index 00000000..4641db84 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsM.java @@ -0,0 +1,30 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaExtremeHillsM extends BiomeConfigVanillaBase { + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public static final String surfaceMixFillerBlockId = "surfaceMixFillerBlock"; + public static final String surfaceMixFillerBlockName = "RTG Surface: Mix Filler Block"; + + public static final String surfaceMixFillerBlockMetaId = "surfaceMixFillerBlockMeta"; + public static final String surfaceMixFillerBlockMetaName = "RTG Surface: Mix Filler Block Meta"; + + public BiomeConfigVanillaExtremeHillsM() { + + super("extremehillsm"); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixFillerBlockId, Type.STRING, surfaceMixFillerBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixFillerBlockMetaId, Type.STRING, surfaceMixFillerBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsPlus.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsPlus.java new file mode 100644 index 00000000..fe129b28 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsPlus.java @@ -0,0 +1,27 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaExtremeHillsPlus extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaExtremeHillsPlus() { + + super("extremehillsplus"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsPlusM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsPlusM.java new file mode 100644 index 00000000..0822ae3f --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaExtremeHillsPlusM.java @@ -0,0 +1,22 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaExtremeHillsPlusM extends BiomeConfigVanillaBase { + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaExtremeHillsPlusM() { + + super("extremehillsplusm"); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaFlowerForest.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaFlowerForest.java new file mode 100644 index 00000000..c3ced75a --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaFlowerForest.java @@ -0,0 +1,27 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaFlowerForest extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaFlowerForest() { + + super("flowerforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaForest.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaForest.java new file mode 100644 index 00000000..1f553576 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaForest.java @@ -0,0 +1,27 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaForest extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaForest() { + + super("forest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaForestHills.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaForestHills.java new file mode 100644 index 00000000..2a360091 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaForestHills.java @@ -0,0 +1,27 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaForestHills extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaForestHills() { + + super("foresthills"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaFrozenOcean.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaFrozenOcean.java new file mode 100644 index 00000000..07cb6d54 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaFrozenOcean.java @@ -0,0 +1,24 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaFrozenOcean extends BiomeConfigVanillaBase { + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaFrozenOcean() { + + super("frozenocean"); + + setPropertyValueById(allowVillagesId, false); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaFrozenRiver.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaFrozenRiver.java new file mode 100644 index 00000000..de114bf9 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaFrozenRiver.java @@ -0,0 +1,12 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaFrozenRiver extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaFrozenRiver() { + + super("frozenriver"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaIceMountains.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaIceMountains.java new file mode 100644 index 00000000..4b312356 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaIceMountains.java @@ -0,0 +1,30 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaIceMountains extends BiomeConfigVanillaBase { + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public static final String surfaceMixFillerBlockId = "surfaceMixFillerBlock"; + public static final String surfaceMixFillerBlockName = "RTG Surface: Mix Filler Block"; + + public static final String surfaceMixFillerBlockMetaId = "surfaceMixFillerBlockMeta"; + public static final String surfaceMixFillerBlockMetaName = "RTG Surface: Mix Filler Block Meta"; + + public BiomeConfigVanillaIceMountains() { + + super("icemountains"); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixFillerBlockId, Type.STRING, surfaceMixFillerBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixFillerBlockMetaId, Type.STRING, surfaceMixFillerBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaIcePlains.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaIcePlains.java new file mode 100644 index 00000000..30dbd8a6 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaIcePlains.java @@ -0,0 +1,18 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaIcePlains extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaIcePlains() { + + super("iceplains"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaIcePlainsSpikes.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaIcePlainsSpikes.java new file mode 100644 index 00000000..273cdde3 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaIcePlainsSpikes.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaIcePlainsSpikes extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaIcePlainsSpikes() { + + super("iceplainsspikes"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungle.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungle.java new file mode 100644 index 00000000..ad5d6e02 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungle.java @@ -0,0 +1,35 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; +import rtg.config.rtg.ConfigRTG; + + +public class BiomeConfigVanillaJungle extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String decorationCactusId = "decorationCactus"; + public static final String decorationCactusName = "RTG Decoration: Cactus"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaJungle() { + + super("jungle"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + this.addProperty(new BiomeConfigProperty(decorationCactusId, Type.BOOLEAN, decorationCactusName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + + this.setPropertyValueById(allowVolcanoesId, true); + this.setPropertyValueById(volcanoChanceId, (ConfigRTG.volcanoChance * 2)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleEdge.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleEdge.java new file mode 100644 index 00000000..87b5d859 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleEdge.java @@ -0,0 +1,22 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; +import rtg.config.rtg.ConfigRTG; + + +public class BiomeConfigVanillaJungleEdge extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaJungleEdge() { + + super("jungleedge"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.setPropertyValueById(allowVolcanoesId, true); + this.setPropertyValueById(volcanoChanceId, (ConfigRTG.volcanoChance * 2)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleEdgeM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleEdgeM.java new file mode 100644 index 00000000..214c09c7 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleEdgeM.java @@ -0,0 +1,22 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; +import rtg.config.rtg.ConfigRTG; + + +public class BiomeConfigVanillaJungleEdgeM extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaJungleEdgeM() { + + super("jungleedgem"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.setPropertyValueById(allowVolcanoesId, true); + this.setPropertyValueById(volcanoChanceId, (ConfigRTG.volcanoChance * 2)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleHills.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleHills.java new file mode 100644 index 00000000..32edc5f6 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleHills.java @@ -0,0 +1,26 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; +import rtg.config.rtg.ConfigRTG; + + +public class BiomeConfigVanillaJungleHills extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String decorationCactusId = "decorationCactus"; + public static final String decorationCactusName = "RTG Decoration: Cactus"; + + public BiomeConfigVanillaJungleHills() { + + super("junglehills"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + this.addProperty(new BiomeConfigProperty(decorationCactusId, Type.BOOLEAN, decorationCactusName, "", true)); + + this.setPropertyValueById(allowVolcanoesId, true); + this.setPropertyValueById(volcanoChanceId, (ConfigRTG.volcanoChance * 2)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleM.java new file mode 100644 index 00000000..6de0820e --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaJungleM.java @@ -0,0 +1,26 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; +import rtg.config.rtg.ConfigRTG; + + +public class BiomeConfigVanillaJungleM extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String decorationCactusId = "decorationCactus"; + public static final String decorationCactusName = "RTG Decoration: Cactus"; + + public BiomeConfigVanillaJungleM() { + + super("junglem"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + this.addProperty(new BiomeConfigProperty(decorationCactusId, Type.BOOLEAN, decorationCactusName, "", true)); + + this.setPropertyValueById(allowVolcanoesId, true); + this.setPropertyValueById(volcanoChanceId, (ConfigRTG.volcanoChance * 2)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMegaSpruceTaiga.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMegaSpruceTaiga.java new file mode 100644 index 00000000..a1f25491 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMegaSpruceTaiga.java @@ -0,0 +1,21 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaMegaSpruceTaiga extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaMegaSpruceTaiga() { + + super("megasprucetaiga"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.setPropertyValueById(allowVolcanoesId, true); + this.setPropertyValueById(volcanoChanceId, -1); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMegaTaiga.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMegaTaiga.java new file mode 100644 index 00000000..6b0b512c --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMegaTaiga.java @@ -0,0 +1,21 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaMegaTaiga extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaMegaTaiga() { + + super("megataiga"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.setPropertyValueById(allowVolcanoesId, true); + this.setPropertyValueById(volcanoChanceId, -1); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMegaTaigaHills.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMegaTaigaHills.java new file mode 100644 index 00000000..41154c28 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMegaTaigaHills.java @@ -0,0 +1,21 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaMegaTaigaHills extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaMegaTaigaHills() { + + super("megataigahills"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.setPropertyValueById(allowVolcanoesId, true); + this.setPropertyValueById(volcanoChanceId, -1); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesa.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesa.java new file mode 100644 index 00000000..c1a7fa5a --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesa.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaMesa extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaMesa() { + + super("mesa"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaBryce.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaBryce.java new file mode 100644 index 00000000..2c383feb --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaBryce.java @@ -0,0 +1,12 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaMesaBryce extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaMesaBryce() { + + super("mesabryce"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateau.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateau.java new file mode 100644 index 00000000..05363b89 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateau.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaMesaPlateau extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaMesaPlateau() { + + super("mesaplateau"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateauF.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateauF.java new file mode 100644 index 00000000..ac5cb1d3 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateauF.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaMesaPlateauF extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaMesaPlateauF() { + + super("mesaplateauf"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateauFM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateauFM.java new file mode 100644 index 00000000..18d04513 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateauFM.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaMesaPlateauFM extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaMesaPlateauFM() { + + super("mesaplateaufm"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateauM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateauM.java new file mode 100644 index 00000000..91b29ee2 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMesaPlateauM.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaMesaPlateauM extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaMesaPlateauM() { + + super("mesaplateaum"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMushroomIsland.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMushroomIsland.java new file mode 100644 index 00000000..74c08e88 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMushroomIsland.java @@ -0,0 +1,12 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaMushroomIsland extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaMushroomIsland() { + + super("mushroomisland"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMushroomIslandShore.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMushroomIslandShore.java new file mode 100644 index 00000000..766ec13c --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaMushroomIslandShore.java @@ -0,0 +1,12 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaMushroomIslandShore extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaMushroomIslandShore() { + + super("mushroomislandshore"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaOcean.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaOcean.java new file mode 100644 index 00000000..f6d16796 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaOcean.java @@ -0,0 +1,24 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaOcean extends BiomeConfigVanillaBase { + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaOcean() { + + super("ocean"); + + setPropertyValueById(allowVillagesId, false); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaPlains.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaPlains.java new file mode 100644 index 00000000..4b2eaac3 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaPlains.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaPlains extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaPlains() { + + super("plains"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRedwoodTaigaHills.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRedwoodTaigaHills.java new file mode 100644 index 00000000..00234309 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRedwoodTaigaHills.java @@ -0,0 +1,18 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaRedwoodTaigaHills extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaRedwoodTaigaHills() { + + super("redwoodtaigahills"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRiver.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRiver.java new file mode 100644 index 00000000..0dbdc424 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRiver.java @@ -0,0 +1,12 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaRiver extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaRiver() { + + super("river"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRoofedForest.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRoofedForest.java new file mode 100644 index 00000000..08a0b93b --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRoofedForest.java @@ -0,0 +1,31 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaRoofedForest extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String decorationCobwebsId = "decorationCobwebs"; + public static final String decorationCobwebsName = "RTG Decoration: Cobwebs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaRoofedForest() { + + super("roofedforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + this.addProperty(new BiomeConfigProperty(decorationCobwebsId, Type.BOOLEAN, decorationCobwebsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRoofedForestM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRoofedForestM.java new file mode 100644 index 00000000..801c00f8 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaRoofedForestM.java @@ -0,0 +1,27 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaRoofedForestM extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaRoofedForestM() { + + super("roofedforestm"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavanna.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavanna.java new file mode 100644 index 00000000..a3b8803f --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavanna.java @@ -0,0 +1,27 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaSavanna extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaSavanna() { + + super("savanna"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavannaM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavannaM.java new file mode 100644 index 00000000..06c6b2f6 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavannaM.java @@ -0,0 +1,27 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaSavannaM extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigVanillaSavannaM() { + + super("savannam"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavannaPlateau.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavannaPlateau.java new file mode 100644 index 00000000..b7cf98de --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavannaPlateau.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaSavannaPlateau extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaSavannaPlateau() { + + super("savannaplateau"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavannaPlateauM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavannaPlateauM.java new file mode 100644 index 00000000..17773e3a --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSavannaPlateauM.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaSavannaPlateauM extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaSavannaPlateauM() { + + super("savannaplateaum"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaStoneBeach.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaStoneBeach.java new file mode 100644 index 00000000..cfd91abf --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaStoneBeach.java @@ -0,0 +1,12 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaStoneBeach extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaStoneBeach() { + + super("stonebeach"); + + setPropertyValueById(allowVillagesId, false); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSunflowerPlains.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSunflowerPlains.java new file mode 100644 index 00000000..ce999581 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSunflowerPlains.java @@ -0,0 +1,10 @@ +package rtg.api.biome.vanilla.config; + + +public class BiomeConfigVanillaSunflowerPlains extends BiomeConfigVanillaBase { + + public BiomeConfigVanillaSunflowerPlains() { + + super("sunflowerplains"); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSwampland.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSwampland.java new file mode 100644 index 00000000..3f44ea08 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSwampland.java @@ -0,0 +1,18 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaSwampland extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaSwampland() { + + super("swampland"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSwamplandM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSwamplandM.java new file mode 100644 index 00000000..5139ed8e --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaSwamplandM.java @@ -0,0 +1,18 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaSwamplandM extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaSwamplandM() { + + super("swamplandm"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaTaiga.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaTaiga.java new file mode 100644 index 00000000..5a937bdc --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaTaiga.java @@ -0,0 +1,18 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaTaiga extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaTaiga() { + + super("taiga"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaTaigaHills.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaTaigaHills.java new file mode 100644 index 00000000..3a46e1bd --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaTaigaHills.java @@ -0,0 +1,18 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaTaigaHills extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaTaigaHills() { + + super("taigahills"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaTaigaM.java b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaTaigaM.java new file mode 100644 index 00000000..c4978384 --- /dev/null +++ b/src/api/java/rtg/api/biome/vanilla/config/BiomeConfigVanillaTaigaM.java @@ -0,0 +1,18 @@ +package rtg.api.biome.vanilla.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigVanillaTaigaM extends BiomeConfigVanillaBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigVanillaTaigaM() { + + super("taigam"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/api/java/rtg/api/event/BiomeConfigEvent.java b/src/api/java/rtg/api/event/BiomeConfigEvent.java new file mode 100644 index 00000000..3b5e411e --- /dev/null +++ b/src/api/java/rtg/api/event/BiomeConfigEvent.java @@ -0,0 +1,27 @@ +package rtg.api.event; + +import net.minecraftforge.fml.common.eventhandler.Event; + +public class BiomeConfigEvent extends Event { + + public BiomeConfigEvent() { + + super(); + } + + public static class Pre extends BiomeConfigEvent { + + public Pre() { + + super(); + } + } + + public static class Post extends BiomeConfigEvent { + + public Post() { + + super(); + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/client/gui/WorldTypeMessageGUI.java b/src/api/java/rtg/client/gui/WorldTypeMessageGUI.java new file mode 100644 index 00000000..3f224ee0 --- /dev/null +++ b/src/api/java/rtg/client/gui/WorldTypeMessageGUI.java @@ -0,0 +1,109 @@ +package rtg.client.gui; + +import java.io.File; +import java.io.IOException; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextComponentTranslation; +import static net.minecraft.util.text.TextFormatting.DARK_RED; +import static net.minecraft.util.text.TextFormatting.WHITE; + +import org.apache.commons.io.FileUtils; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +/** + * Displays a notification screen when creating a new world. + * + * @author @Adubbz (https://github.com/Adubbz) + * + * Source: https://github.com/Glitchfiend/BiomesOPlenty/blob/BOP-1.7.10-2.1.x/src/main/java/biomesoplenty/client/gui/WorldTypeMessageGUI.java + * Modified by: WhichOnesPink (https://github.com/whichonespink44) + */ +public class WorldTypeMessageGUI extends GuiScreen { + private GuiScreen parentGuiScreen; + + private File nameHashFile; + private String nameHash; + + private static final ResourceLocation rtgLogoTexture = new ResourceLocation("rtg:textures/gui/rtg-logo-worldtype.png"); + + public WorldTypeMessageGUI(GuiScreen parentGuiScreen, File nameHashFile, String nameHash) { + + this.parentGuiScreen = parentGuiScreen; + + this.nameHashFile = nameHashFile; + this.nameHash = nameHash; + } + + @Override + public void initGui() { + + Keyboard.enableRepeatEvents(true); + this.buttonList.clear(); + this.buttonList.add(new GuiButton(0, this.width / 2 - 175, this.height - 24, 350, 20, I18n.format("OK"))); + } + + @Override + public void onGuiClosed() { + + Keyboard.enableRepeatEvents(false); + } + + @Override + protected void actionPerformed(GuiButton button) { + + if (button.enabled) + { + if (button.id == 0) + { + try + { + nameHashFile.createNewFile(); + FileUtils.write(nameHashFile, nameHash + "StartupWarning".hashCode()); + } + catch (IOException e) + { + e.printStackTrace(); + } + + this.mc.displayGuiScreen(this.parentGuiScreen); + } + } + } + + @Override + public void drawScreen(int x, int y, float renderPartialTicks) { + + TextComponentTranslation rtgStartup1 = new TextComponentTranslation("warning.rtgStartup1"); + TextComponentTranslation rtgStartup2 = new TextComponentTranslation("warning.rtgStartup2"); + TextComponentTranslation rtgStartup3 = new TextComponentTranslation("warning.rtgStartup3"); + TextComponentTranslation rtgStartup4 = new TextComponentTranslation("warning.rtgStartup4"); + TextComponentTranslation rtgStartup5 = new TextComponentTranslation("warning.rtgStartup5"); + TextComponentTranslation rtgStartup6 = new TextComponentTranslation("warning.rtgStartup6"); + + this.drawDefaultBackground(); + + this.drawCenteredString(this.fontRendererObj, "" + WHITE + rtgStartup1.getFormattedText(), this.width / 2, 82, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "" + WHITE + rtgStartup2.getFormattedText(), this.width / 2, 94, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "" + WHITE + rtgStartup3.getFormattedText(), this.width / 2, 106, 0xFFFFFF); + + this.drawCenteredString(this.fontRendererObj, "" + WHITE + rtgStartup4.getFormattedText(), this.width / 2, 132, 0xFFFFFF); + this.drawCenteredString(this.fontRendererObj, "" + WHITE + rtgStartup5.getFormattedText(), this.width / 2, 144, 0xFFFFFF); + + this.drawCenteredString(this.fontRendererObj, "" + DARK_RED + rtgStartup6.getFormattedText(), this.width / 2, 168, 0xFFFFFF); + + GL11.glEnable(GL11.GL_BLEND); + this.mc.getTextureManager().bindTexture(rtgLogoTexture); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + this.drawTexturedModalRect(this.width / 2 - 168 / 2, 0, 0, 0, 168, 80); + + GL11.glDisable(GL11.GL_BLEND); + + super.drawScreen(x, y, renderPartialTicks); + } +} diff --git a/src/api/java/rtg/config/BiomeConfigManager.java b/src/api/java/rtg/config/BiomeConfigManager.java new file mode 100644 index 00000000..f2c55929 --- /dev/null +++ b/src/api/java/rtg/config/BiomeConfigManager.java @@ -0,0 +1,272 @@ +package rtg.config; + +import java.util.ArrayList; + +import net.minecraftforge.common.config.Configuration; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.abyssalcraft.config.*; +import rtg.api.biome.agriculturalrevolution.config.*; +import rtg.api.biome.betteragriculture.config.BiomeConfigBA; +import rtg.api.biome.betteragriculture.config.BiomeConfigBAFarmlandBiome; +import rtg.api.biome.biomesoplenty.config.*; +import rtg.api.biome.biomesyougo.config.*; +import rtg.api.biome.flowercraft.config.BiomeConfigFC; +import rtg.api.biome.flowercraft.config.BiomeConfigFCPhantasia; +import rtg.api.biome.mithwoodforest.config.BiomeConfigMF; +import rtg.api.biome.mithwoodforest.config.BiomeConfigMFMithwoodForest; +import rtg.api.biome.sugiforest.config.BiomeConfigSF; +import rtg.api.biome.sugiforest.config.BiomeConfigSFSugiForest; +import rtg.api.biome.vanilla.config.*; + +public class BiomeConfigManager { + + public static void initBiomeConfigs() { + + initBiomeConfigsAC(); + initBiomeConfigsAR(); + initBiomeConfigsBA(); + initBiomeConfigsBOP(); + initBiomeConfigsBYG(); + initBiomeConfigsFC(); + initBiomeConfigsMF(); + initBiomeConfigsSF(); + initBiomeConfigsVanilla(); + } + + public static void initBiomeConfigsAC() { + + BiomeConfigAC.biomeConfigACCoraliumInfestedSwamp = new BiomeConfigACCoraliumInfestedSwamp(); + BiomeConfigAC.biomeConfigACDarklands = new BiomeConfigACDarklands(); + BiomeConfigAC.biomeConfigACDarklandsForest = new BiomeConfigACDarklandsForest(); + BiomeConfigAC.biomeConfigACDarklandsHighland = new BiomeConfigACDarklandsHighland(); + BiomeConfigAC.biomeConfigACDarklandsMountains = new BiomeConfigACDarklandsMountains(); + BiomeConfigAC.biomeConfigACDarklandsPlains = new BiomeConfigACDarklandsPlains(); + } + + public static void initBiomeConfigsAR() { + + BiomeConfigAR.biomeConfigARBambooGrove = new BiomeConfigARBambooGrove(); + BiomeConfigAR.biomeConfigARCoralReef = new BiomeConfigARCoralReef(); + BiomeConfigAR.biomeConfigARDeepReef = new BiomeConfigARDeepReef(); + BiomeConfigAR.biomeConfigARKelpForest = new BiomeConfigARKelpForest(); + BiomeConfigAR.biomeConfigAROrchard = new BiomeConfigAROrchard(); + BiomeConfigAR.biomeConfigARTropicalHills = new BiomeConfigARTropicalHills(); + } + + public static void initBiomeConfigsBA() { + + BiomeConfigBA.biomeConfigBAFarmlandBiome = new BiomeConfigBAFarmlandBiome(); + } + + public static void initBiomeConfigsBOP() { + + BiomeConfigBOP.biomeConfigBOPAlps = new BiomeConfigBOPAlps(); + BiomeConfigBOP.biomeConfigBOPBambooForest = new BiomeConfigBOPBambooForest(); + BiomeConfigBOP.biomeConfigBOPBayou = new BiomeConfigBOPBayou(); + BiomeConfigBOP.biomeConfigBOPBog = new BiomeConfigBOPBog(); + BiomeConfigBOP.biomeConfigBOPBorealForest = new BiomeConfigBOPBorealForest(); + BiomeConfigBOP.biomeConfigBOPBrushland = new BiomeConfigBOPBrushland(); + BiomeConfigBOP.biomeConfigBOPChaparral = new BiomeConfigBOPChaparral(); + BiomeConfigBOP.biomeConfigBOPCherryBlossomGrove = new BiomeConfigBOPCherryBlossomGrove(); + BiomeConfigBOP.biomeConfigBOPColdDesert = new BiomeConfigBOPColdDesert(); + BiomeConfigBOP.biomeConfigBOPConiferousForest = new BiomeConfigBOPConiferousForest(); + BiomeConfigBOP.biomeConfigBOPCoralReef = new BiomeConfigBOPCoralReef(); + BiomeConfigBOP.biomeConfigBOPCrag = new BiomeConfigBOPCrag(); + BiomeConfigBOP.biomeConfigBOPDeadForest = new BiomeConfigBOPDeadForest(); + BiomeConfigBOP.biomeConfigBOPDeadSwamp = new BiomeConfigBOPDeadSwamp(); + BiomeConfigBOP.biomeConfigBOPEucalyptusForest = new BiomeConfigBOPEucalyptusForest(); + BiomeConfigBOP.biomeConfigBOPFen = new BiomeConfigBOPFen(); + BiomeConfigBOP.biomeConfigBOPFlowerField = new BiomeConfigBOPFlowerField(); + BiomeConfigBOP.biomeConfigBOPFlowerIsland = new BiomeConfigBOPFlowerIsland(); + BiomeConfigBOP.biomeConfigBOPGlacier = new BiomeConfigBOPGlacier(); + BiomeConfigBOP.biomeConfigBOPGrassland = new BiomeConfigBOPGrassland(); + BiomeConfigBOP.biomeConfigBOPGravelBeach = new BiomeConfigBOPGravelBeach(); + BiomeConfigBOP.biomeConfigBOPGrove = new BiomeConfigBOPGrove(); + BiomeConfigBOP.biomeConfigBOPHeathland = new BiomeConfigBOPHeathland(); + BiomeConfigBOP.biomeConfigBOPHighland = new BiomeConfigBOPHighland(); + BiomeConfigBOP.biomeConfigBOPKelpForest = new BiomeConfigBOPKelpForest(); + BiomeConfigBOP.biomeConfigBOPLandOfLakes = new BiomeConfigBOPLandOfLakes(); + BiomeConfigBOP.biomeConfigBOPLavenderFields = new BiomeConfigBOPLavenderFields(); + BiomeConfigBOP.biomeConfigBOPLushDesert = new BiomeConfigBOPLushDesert(); + BiomeConfigBOP.biomeConfigBOPLushSwamp = new BiomeConfigBOPLushSwamp(); + BiomeConfigBOP.biomeConfigBOPMangrove = new BiomeConfigBOPMangrove(); + BiomeConfigBOP.biomeConfigBOPMapleWoods = new BiomeConfigBOPMapleWoods(); + BiomeConfigBOP.biomeConfigBOPMarsh = new BiomeConfigBOPMarsh(); + BiomeConfigBOP.biomeConfigBOPMeadow = new BiomeConfigBOPMeadow(); + BiomeConfigBOP.biomeConfigBOPMoor = new BiomeConfigBOPMoor(); + BiomeConfigBOP.biomeConfigBOPMountainPeaks = new BiomeConfigBOPMountainPeaks(); + BiomeConfigBOP.biomeConfigBOPMountainFoothills = new BiomeConfigBOPMountainFoothills(); + BiomeConfigBOP.biomeConfigBOPMysticGrove = new BiomeConfigBOPMysticGrove(); + BiomeConfigBOP.biomeConfigBOPOasis = new BiomeConfigBOPOasis(); + BiomeConfigBOP.biomeConfigBOPOminousWoods = new BiomeConfigBOPOminousWoods(); + BiomeConfigBOP.biomeConfigBOPOrchard = new BiomeConfigBOPOrchard(); + BiomeConfigBOP.biomeConfigBOPOriginIsland = new BiomeConfigBOPOriginIsland(); + BiomeConfigBOP.biomeConfigBOPOutback = new BiomeConfigBOPOutback(); + BiomeConfigBOP.biomeConfigBOPOvergrownCliffs = new BiomeConfigBOPOvergrownCliffs(); + BiomeConfigBOP.biomeConfigBOPPrairie = new BiomeConfigBOPPrairie(); + BiomeConfigBOP.biomeConfigBOPQuagmire = new BiomeConfigBOPQuagmire(); + BiomeConfigBOP.biomeConfigBOPRainforest = new BiomeConfigBOPRainforest(); + BiomeConfigBOP.biomeConfigBOPRedwoodForest = new BiomeConfigBOPRedwoodForest(); + BiomeConfigBOP.biomeConfigBOPSacredSprings = new BiomeConfigBOPSacredSprings(); + BiomeConfigBOP.biomeConfigBOPSeasonalForest = new BiomeConfigBOPSeasonalForest(); + BiomeConfigBOP.biomeConfigBOPShield = new BiomeConfigBOPShield(); + BiomeConfigBOP.biomeConfigBOPShrubland = new BiomeConfigBOPShrubland(); + BiomeConfigBOP.biomeConfigBOPSnowyConiferousForest = new BiomeConfigBOPSnowyConiferousForest(); + BiomeConfigBOP.biomeConfigBOPSnowyForest = new BiomeConfigBOPSnowyForest(); + BiomeConfigBOP.biomeConfigBOPSteppe = new BiomeConfigBOPSteppe(); + BiomeConfigBOP.biomeConfigBOPTemperateRainforest = new BiomeConfigBOPTemperateRainforest(); + BiomeConfigBOP.biomeConfigBOPTropicalIsland = new BiomeConfigBOPTropicalIsland(); + BiomeConfigBOP.biomeConfigBOPTropicalRainforest = new BiomeConfigBOPTropicalRainforest(); + BiomeConfigBOP.biomeConfigBOPTundra = new BiomeConfigBOPTundra(); + BiomeConfigBOP.biomeConfigBOPVolcanicIsland = new BiomeConfigBOPVolcanicIsland(); + BiomeConfigBOP.biomeConfigBOPWasteland = new BiomeConfigBOPWasteland(); + BiomeConfigBOP.biomeConfigBOPWetland = new BiomeConfigBOPWetland(); + BiomeConfigBOP.biomeConfigBOPWoodland = new BiomeConfigBOPWoodland(); + BiomeConfigBOP.biomeConfigBOPXericShrubland = new BiomeConfigBOPXericShrubland(); + } + + public static void initBiomeConfigsBYG() { + + BiomeConfigBYG.biomeConfigBYGAutumnForest = new BiomeConfigBYGAutumnForest(); + BiomeConfigBYG.biomeConfigBYGBirchPlains = new BiomeConfigBYGBirchPlains(); + BiomeConfigBYG.biomeConfigBYGFrozenTundra = new BiomeConfigBYGFrozenTundra(); + BiomeConfigBYG.biomeConfigBYGLushForest = new BiomeConfigBYGLushForest(); + BiomeConfigBYG.biomeConfigBYGRedDesert = new BiomeConfigBYGRedDesert(); + BiomeConfigBYG.biomeConfigBYGRedRockMountains = new BiomeConfigBYGRedRockMountains(); + BiomeConfigBYG.biomeConfigBYGWillowSwamps = new BiomeConfigBYGWillowSwamps(); + } + + public static void initBiomeConfigsFC() { + + BiomeConfigFC.biomeConfigFCPhantasia = new BiomeConfigFCPhantasia(); + } + + public static void initBiomeConfigsMF() { + + BiomeConfigMF.biomeConfigMFMithwoodForest = new BiomeConfigMFMithwoodForest(); + } + + public static void initBiomeConfigsSF() { + + BiomeConfigSF.biomeConfigSFSugiForest = new BiomeConfigSFSugiForest(); + } + + public static void initBiomeConfigsVanilla() { + + BiomeConfigVanilla.biomeConfigVanillaBeach = new BiomeConfigVanillaBeach(); + BiomeConfigVanilla.biomeConfigVanillaBirchForest = new BiomeConfigVanillaBirchForest(); + BiomeConfigVanilla.biomeConfigVanillaBirchForestHills = new BiomeConfigVanillaBirchForestHills(); + BiomeConfigVanilla.biomeConfigVanillaColdBeach = new BiomeConfigVanillaColdBeach(); + BiomeConfigVanilla.biomeConfigVanillaColdTaiga = new BiomeConfigVanillaColdTaiga(); + BiomeConfigVanilla.biomeConfigVanillaColdTaigaHills = new BiomeConfigVanillaColdTaigaHills(); + BiomeConfigVanilla.biomeConfigVanillaDeepOcean = new BiomeConfigVanillaDeepOcean(); + BiomeConfigVanilla.biomeConfigVanillaDesert = new BiomeConfigVanillaDesert(); + BiomeConfigVanilla.biomeConfigVanillaDesertHills = new BiomeConfigVanillaDesertHills(); + BiomeConfigVanilla.biomeConfigVanillaExtremeHills = new BiomeConfigVanillaExtremeHills(); + BiomeConfigVanilla.biomeConfigVanillaExtremeHillsEdge = new BiomeConfigVanillaExtremeHillsEdge(); + BiomeConfigVanilla.biomeConfigVanillaExtremeHillsPlus = new BiomeConfigVanillaExtremeHillsPlus(); + BiomeConfigVanilla.biomeConfigVanillaForest = new BiomeConfigVanillaForest(); + BiomeConfigVanilla.biomeConfigVanillaForestHills = new BiomeConfigVanillaForestHills(); + BiomeConfigVanilla.biomeConfigVanillaFrozenOcean = new BiomeConfigVanillaFrozenOcean(); + BiomeConfigVanilla.biomeConfigVanillaFrozenRiver = new BiomeConfigVanillaFrozenRiver(); + BiomeConfigVanilla.biomeConfigVanillaIcePlains = new BiomeConfigVanillaIcePlains(); + BiomeConfigVanilla.biomeConfigVanillaIceMountains = new BiomeConfigVanillaIceMountains(); + BiomeConfigVanilla.biomeConfigVanillaJungle = new BiomeConfigVanillaJungle(); + BiomeConfigVanilla.biomeConfigVanillaJungleEdge = new BiomeConfigVanillaJungleEdge(); + BiomeConfigVanilla.biomeConfigVanillaJungleHills = new BiomeConfigVanillaJungleHills(); + BiomeConfigVanilla.biomeConfigVanillaMegaTaiga = new BiomeConfigVanillaMegaTaiga(); + BiomeConfigVanilla.biomeConfigVanillaMegaTaigaHills = new BiomeConfigVanillaMegaTaigaHills(); + BiomeConfigVanilla.biomeConfigVanillaMesa = new BiomeConfigVanillaMesa(); + BiomeConfigVanilla.biomeConfigVanillaMesaPlateau = new BiomeConfigVanillaMesaPlateau(); + BiomeConfigVanilla.biomeConfigVanillaMesaPlateauF = new BiomeConfigVanillaMesaPlateauF(); + BiomeConfigVanilla.biomeConfigVanillaMushroomIsland = new BiomeConfigVanillaMushroomIsland(); + BiomeConfigVanilla.biomeConfigVanillaMushroomIslandShore = new BiomeConfigVanillaMushroomIslandShore(); + BiomeConfigVanilla.biomeConfigVanillaOcean = new BiomeConfigVanillaOcean(); + BiomeConfigVanilla.biomeConfigVanillaPlains = new BiomeConfigVanillaPlains(); + BiomeConfigVanilla.biomeConfigVanillaRiver = new BiomeConfigVanillaRiver(); + BiomeConfigVanilla.biomeConfigVanillaRoofedForest = new BiomeConfigVanillaRoofedForest(); + BiomeConfigVanilla.biomeConfigVanillaSavanna = new BiomeConfigVanillaSavanna(); + BiomeConfigVanilla.biomeConfigVanillaSavannaPlateau = new BiomeConfigVanillaSavannaPlateau(); + BiomeConfigVanilla.biomeConfigVanillaStoneBeach = new BiomeConfigVanillaStoneBeach(); + BiomeConfigVanilla.biomeConfigVanillaSwampland = new BiomeConfigVanillaSwampland(); + BiomeConfigVanilla.biomeConfigVanillaTaiga = new BiomeConfigVanillaTaiga(); + BiomeConfigVanilla.biomeConfigVanillaTaigaHills = new BiomeConfigVanillaTaigaHills(); + BiomeConfigVanilla.biomeConfigVanillaSunflowerPlains = new BiomeConfigVanillaSunflowerPlains(); + BiomeConfigVanilla.biomeConfigVanillaDesertM = new BiomeConfigVanillaDesertM(); + BiomeConfigVanilla.biomeConfigVanillaExtremeHillsM = new BiomeConfigVanillaExtremeHillsM(); + BiomeConfigVanilla.biomeConfigVanillaFlowerForest = new BiomeConfigVanillaFlowerForest(); + BiomeConfigVanilla.biomeConfigVanillaTaigaM = new BiomeConfigVanillaTaigaM(); + BiomeConfigVanilla.biomeConfigVanillaSwamplandM = new BiomeConfigVanillaSwamplandM(); + BiomeConfigVanilla.biomeConfigVanillaIcePlainsSpikes = new BiomeConfigVanillaIcePlainsSpikes(); + BiomeConfigVanilla.biomeConfigVanillaJungleM = new BiomeConfigVanillaJungleM(); + BiomeConfigVanilla.biomeConfigVanillaJungleEdgeM = new BiomeConfigVanillaJungleEdgeM(); + BiomeConfigVanilla.biomeConfigVanillaBirchForestM = new BiomeConfigVanillaBirchForestM(); + BiomeConfigVanilla.biomeConfigVanillaBirchForestHillsM = new BiomeConfigVanillaBirchForestHillsM(); + BiomeConfigVanilla.biomeConfigVanillaRoofedForestM = new BiomeConfigVanillaRoofedForestM(); + BiomeConfigVanilla.biomeConfigVanillaColdTaigaM = new BiomeConfigVanillaColdTaigaM(); + BiomeConfigVanilla.biomeConfigVanillaMegaSpruceTaiga = new BiomeConfigVanillaMegaSpruceTaiga(); + BiomeConfigVanilla.biomeConfigVanillaRedwoodTaigaHills = new BiomeConfigVanillaRedwoodTaigaHills(); + BiomeConfigVanilla.biomeConfigVanillaExtremeHillsPlusM = new BiomeConfigVanillaExtremeHillsPlusM(); + BiomeConfigVanilla.biomeConfigVanillaSavannaM = new BiomeConfigVanillaSavannaM(); + BiomeConfigVanilla.biomeConfigVanillaSavannaPlateauM = new BiomeConfigVanillaSavannaPlateauM(); + BiomeConfigVanilla.biomeConfigVanillaMesaBryce = new BiomeConfigVanillaMesaBryce(); + BiomeConfigVanilla.biomeConfigVanillaMesaPlateauFM = new BiomeConfigVanillaMesaPlateauFM(); + BiomeConfigVanilla.biomeConfigVanillaMesaPlateauM = new BiomeConfigVanillaMesaPlateauM(); + } + + public static void setBiomeConfigsFromUserConfigs(BiomeConfig[] biomeConfigs, Configuration config) { + + for (int i = 0; i < biomeConfigs.length; i++) { + + String categoryName = "biome." + biomeConfigs[i].modSlug + "." + biomeConfigs[i].biomeSlug; + ArrayList properties = biomeConfigs[i].getProperties(); + + for (int j = 0; j < properties.size(); j++) { + + BiomeConfigProperty prop = properties.get(j); + + switch (prop.type) { + + case INTEGER: + + prop.valueInt = config.getInt( + prop.name, + categoryName, + prop.valueInt, + prop.minValue, + prop.maxValue, + prop.description + ); + + break; + + case BOOLEAN: + + prop.valueBoolean = config.getBoolean( + prop.name, + categoryName, + prop.valueBoolean, + prop.description + ); + + break; + + case STRING: + + prop.valueString = config.getString( + prop.name, + categoryName, + prop.valueString, + prop.description + ); + + break; + default: + throw new RuntimeException("BiomeConfigProperty type not supported."); + } + } + } + } +} diff --git a/src/api/java/rtg/config/ConfigManager.java b/src/api/java/rtg/config/ConfigManager.java new file mode 100644 index 00000000..4e068240 --- /dev/null +++ b/src/api/java/rtg/config/ConfigManager.java @@ -0,0 +1,62 @@ +package rtg.config; + +import java.io.File; + +import rtg.config.abyssalcraft.ConfigAC; +import rtg.config.agriculturalrevolution.ConfigAR; +import rtg.config.betteragriculture.ConfigBA; +import rtg.config.biomesoplenty.ConfigBOP; +import rtg.config.biomesyougo.ConfigBYG; +import rtg.config.flowercraft.ConfigFC; +import rtg.config.mithwoodforest.ConfigMF; +import rtg.config.rtg.ConfigRTG; +import rtg.config.sugiforest.ConfigSF; +import rtg.config.vanilla.ConfigVanilla; + +public class ConfigManager { + + public static File rtgConfigFile; + public static File vanillaConfigFile; + public static File acConfigFile; + public static File arConfigFile; + public static File baConfigFile; + public static File bopConfigFile; + public static File bygConfigFile; + public static File fcConfigFile; + public static File mfConfigFile; + public static File sfConfigFile; + + private ConfigRTG configRTG = new ConfigRTG(); + + public static void init(String configpath) { + + rtgConfigFile = new File(configpath + "rtg.cfg"); + vanillaConfigFile = new File(configpath + "biomes/vanilla.cfg"); + acConfigFile = new File(configpath + "biomes/abyssalcraft.cfg"); + arConfigFile = new File(configpath + "biomes/agriculturalrevolution.cfg"); + baConfigFile = new File(configpath + "biomes/betteragriculture.cfg"); + bopConfigFile = new File(configpath + "biomes/biomesoplenty.cfg"); + bygConfigFile = new File(configpath + "biomes/biomesyougo.cfg"); + fcConfigFile = new File(configpath + "biomes/flowercraft.cfg"); + mfConfigFile = new File(configpath + "biomes/mithwoodforest.cfg"); + sfConfigFile = new File(configpath + "biomes/sugiforest.cfg"); + + ConfigRTG.init(rtgConfigFile); + + ConfigVanilla.init(vanillaConfigFile); + + ConfigAC.init(acConfigFile); + ConfigAR.init(arConfigFile); + ConfigBA.init(baConfigFile); + ConfigBOP.init(bopConfigFile); + ConfigBYG.init(bygConfigFile); + ConfigFC.init(fcConfigFile); + ConfigMF.init(mfConfigFile); + ConfigSF.init(sfConfigFile); + } + + public ConfigRTG rtg() { + + return configRTG; + } +} diff --git a/src/api/java/rtg/config/abyssalcraft/ConfigAC.java b/src/api/java/rtg/config/abyssalcraft/ConfigAC.java new file mode 100644 index 00000000..b354c4a6 --- /dev/null +++ b/src/api/java/rtg/config/abyssalcraft/ConfigAC.java @@ -0,0 +1,34 @@ +package rtg.config.abyssalcraft; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +import rtg.api.biome.abyssalcraft.config.BiomeConfigAC; +import rtg.config.BiomeConfigManager; +import rtg.util.Logger; + +public class ConfigAC { + + public static Configuration config; + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + config.load(); + + BiomeConfigManager.setBiomeConfigsFromUserConfigs(BiomeConfigAC.getBiomeConfigs(), config); + + } + catch (Exception e) { + Logger.error("RTG had a problem loading AC configuration."); + } + finally { + if (config.hasChanged()) { + config.save(); + } + } + } +} diff --git a/src/api/java/rtg/config/agriculturalrevolution/ConfigAR.java b/src/api/java/rtg/config/agriculturalrevolution/ConfigAR.java new file mode 100644 index 00000000..e3725afd --- /dev/null +++ b/src/api/java/rtg/config/agriculturalrevolution/ConfigAR.java @@ -0,0 +1,33 @@ +package rtg.config.agriculturalrevolution; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +import rtg.api.biome.agriculturalrevolution.config.BiomeConfigAR; +import rtg.config.BiomeConfigManager; +import rtg.util.Logger; + +public class ConfigAR { + + public static Configuration config; + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + config.load(); + + BiomeConfigManager.setBiomeConfigsFromUserConfigs(BiomeConfigAR.getBiomeConfigs(), config); + } + catch (Exception e) { + Logger.error("RTG had a problem loading AR configuration."); + } + finally { + if (config.hasChanged()) { + config.save(); + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/config/betteragriculture/ConfigBA.java b/src/api/java/rtg/config/betteragriculture/ConfigBA.java new file mode 100644 index 00000000..84116239 --- /dev/null +++ b/src/api/java/rtg/config/betteragriculture/ConfigBA.java @@ -0,0 +1,33 @@ +package rtg.config.betteragriculture; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +import rtg.api.biome.betteragriculture.config.BiomeConfigBA; +import rtg.config.BiomeConfigManager; +import rtg.util.Logger; + +public class ConfigBA { + + public static Configuration config; + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + config.load(); + + BiomeConfigManager.setBiomeConfigsFromUserConfigs(BiomeConfigBA.getBiomeConfigs(), config); + } + catch (Exception e) { + Logger.error("RTG had a problem loading BA configuration."); + } + finally { + if (config.hasChanged()) { + config.save(); + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/config/biomesoplenty/ConfigBOP.java b/src/api/java/rtg/config/biomesoplenty/ConfigBOP.java new file mode 100644 index 00000000..d7c883ce --- /dev/null +++ b/src/api/java/rtg/config/biomesoplenty/ConfigBOP.java @@ -0,0 +1,33 @@ +package rtg.config.biomesoplenty; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOP; +import rtg.config.BiomeConfigManager; +import rtg.util.Logger; + +public class ConfigBOP { + + public static Configuration config; + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + config.load(); + + BiomeConfigManager.setBiomeConfigsFromUserConfigs(BiomeConfigBOP.getBiomeConfigs(), config); + } + catch (Exception e) { + Logger.error("RTG had a problem loading BOP configuration."); + } + finally { + if (config.hasChanged()) { + config.save(); + } + } + } +} diff --git a/src/api/java/rtg/config/biomesyougo/ConfigBYG.java b/src/api/java/rtg/config/biomesyougo/ConfigBYG.java new file mode 100644 index 00000000..6aa8634f --- /dev/null +++ b/src/api/java/rtg/config/biomesyougo/ConfigBYG.java @@ -0,0 +1,33 @@ +package rtg.config.biomesyougo; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +import rtg.api.biome.biomesyougo.config.BiomeConfigBYG; +import rtg.config.BiomeConfigManager; +import rtg.util.Logger; + +public class ConfigBYG { + + public static Configuration config; + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + config.load(); + + BiomeConfigManager.setBiomeConfigsFromUserConfigs(BiomeConfigBYG.getBiomeConfigs(), config); + } + catch (Exception e) { + Logger.error("RTG had a problem loading BYG configuration."); + } + finally { + if (config.hasChanged()) { + config.save(); + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/config/flowercraft/ConfigFC.java b/src/api/java/rtg/config/flowercraft/ConfigFC.java new file mode 100644 index 00000000..acca4875 --- /dev/null +++ b/src/api/java/rtg/config/flowercraft/ConfigFC.java @@ -0,0 +1,33 @@ +package rtg.config.flowercraft; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +import rtg.api.biome.flowercraft.config.BiomeConfigFC; +import rtg.config.BiomeConfigManager; +import rtg.util.Logger; + +public class ConfigFC { + + public static Configuration config; + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + config.load(); + + BiomeConfigManager.setBiomeConfigsFromUserConfigs(BiomeConfigFC.getBiomeConfigs(), config); + } + catch (Exception e) { + Logger.error("RTG had a problem loading FC configuration."); + } + finally { + if (config.hasChanged()) { + config.save(); + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/config/mithwoodforest/ConfigMF.java b/src/api/java/rtg/config/mithwoodforest/ConfigMF.java new file mode 100644 index 00000000..80a8da73 --- /dev/null +++ b/src/api/java/rtg/config/mithwoodforest/ConfigMF.java @@ -0,0 +1,33 @@ +package rtg.config.mithwoodforest; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +import rtg.api.biome.mithwoodforest.config.BiomeConfigMF; +import rtg.config.BiomeConfigManager; +import rtg.util.Logger; + +public class ConfigMF { + + public static Configuration config; + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + config.load(); + + BiomeConfigManager.setBiomeConfigsFromUserConfigs(BiomeConfigMF.getBiomeConfigs(), config); + } + catch (Exception e) { + Logger.error("RTG had a problem loading MF configuration."); + } + finally { + if (config.hasChanged()) { + config.save(); + } + } + } +} diff --git a/src/api/java/rtg/config/rtg/ConfigRTG.java b/src/api/java/rtg/config/rtg/ConfigRTG.java new file mode 100644 index 00000000..4e1522a6 --- /dev/null +++ b/src/api/java/rtg/config/rtg/ConfigRTG.java @@ -0,0 +1,1001 @@ +package rtg.config.rtg; + +import java.io.File; +import java.util.ArrayList; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; + +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.fml.common.Loader; + +import org.apache.commons.lang3.ArrayUtils; + +import rtg.util.Logger; + +public class ConfigRTG { + + public static Configuration config; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Bedrock + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static int flatBedrockLayers = 0; + public static String bedrockBlockId = "minecraft:bedrock"; + public static int bedrockBlockByte = 0; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Biomes + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableRTGBiomeDecorations = true; + public static boolean enableRTGBiomeSurfaces = true; + public static int patchBiomeId = 1; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Boulders + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableCobblestoneBoulders = true; + public static int cobblestoneBoulderChance = 1; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Caves + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableCaveModifications = true; + public static boolean enableCaves = true; + public static int caveDensity = 8; + public static int caveFrequency = 16; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Debugging + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableDebugging = false; + public static boolean crashOnStructureExceptions = false; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Dunes + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static int duneHeight = 4; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Dungeons + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean generateDungeons = true; + public static int dungeonFrequency = 8; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Flowing liquids + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableFlowingLiquidModifications = true; + public static int flowingWaterChance = 200; + public static int flowingLavaChance = 200; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // GUI + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableWorldTypeNotificationScreen = true; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Lakes (Scenic) + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + private static float lakeSizeMultiplier = 1f; // same deal with lakes + public static float lakeFrequencyMultiplier = 1f; + public static float lakeShoreBendinessMultiplier = 1f; + public static int scenicLakeBiome = 7; + public static int scenicFrozenLakeBiome = 11; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Lakes (Surface) + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableWaterSurfaceLakes = true; + public static int waterSurfaceLakeChance = 10; + + public static boolean enableLavaSurfaceLakes = true; + public static int lavaSurfaceLakeChance = 10; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Lakes (Underground) + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableWaterUndergroundLakes = true; + public static int waterUndergroundLakeChance = 10; + + public static boolean enableLavaUndergroundLakes = true; + public static int lavaUndergroundLakeChance = 10; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Mineshafts + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean generateMineshafts = true; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Ocean monuments + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableOceanMonumentModifications = true; + public static boolean generateOceanMonuments = true; + public static int oceanMonumentSpacing = 32; // Vanilla = 32 (Minimum = 1; must be greater than separation) + public static int oceanMonumentSeparation = 5; // Vanilla = 5 (Minimum = 1) + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Ore gen + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean generateOreAndesite = true; + public static boolean generateOreCoal = true; + public static boolean generateOreDiamond = true; + public static boolean generateOreDiorite = true; + public static boolean generateOreDirt = true; + public static boolean generateOreEmerald = true; + public static boolean generateOreGold = true; + public static boolean generateOreGranite = true; + public static boolean generateOreGravel = true; + public static boolean generateOreIron = true; + public static boolean generateOreLapis = true; + public static boolean generateOreRedstone = true; + public static boolean generateOreSilverfish = true; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Plateaus + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static String plateauGradientBlockId = "minecraft:stained_hardened_clay"; + + public static String plateauBlockId = "minecraft:hardened_clay"; + public static int plateauBlockByte = 0; + + public static String mesaGradientString = "0,1,8,14,1,8"; + public static String mesaBryceGradientString = "-1,-1,0,1,0,0,0,14,0,8,0,1,8,0,-1,0,14,0,0,14,0,0,8"; + public static String savannaGradientString = "0,0,0,0,8,8,12,12,8,0,8,12,12,8,12,8,0,0,8,12,12"; + + public static byte[] mesaPlateauBlockMetas = getPlateauGradientBlockMetasFromConfigString(mesaGradientString); + public static byte[] mesaBrycePlateauBlockMetas = getPlateauGradientBlockMetasFromConfigString(mesaBryceGradientString); + public static byte[] savannaPlateauBlockMetas = getPlateauGradientBlockMetasFromConfigString(savannaGradientString); + + public static boolean stoneSavannas = true; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Ravines + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableRavineModifications = true; + public static boolean enableRavines = false; + public static int ravineFrequency = 50; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Rivers + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + private static float riverSizeMultiplier = 1f; // this is private because we want a transformed version + public static float riverFrequencyMultiplier = 1f; + public static float riverBendinessMultiplier = 1f; + public static float riverCutOffScale = 350f; + public static float riverCutOffAmplitude = 0.5f; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Saplings + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableRTGSaplings = true; + public static int rtgTreeChance = 2; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Scattered features + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableScatteredFeatureModifications = true; + public static boolean generateScatteredFeatures = true; + public static int minDistanceScatteredFeatures = 12; // Vanilla = 8 + public static int maxDistanceScatteredFeatures = 48; // Vanilla = 32 + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Snow + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableSnowLayers = true; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Strongholds + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableStrongholdModifications = true; + public static boolean generateStrongholds = true; + public static int strongholdCount = 128; // Vanilla = 128 (Minimum = 1) + public static int strongholdDistance = 32; // Vanilla = 32 (Minimum = 1) + public static int strongholdSpread = 3; // Vanilla = 3 (Minimum = 1) + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Terrain shadowing + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static String shadowStoneBlockId = "minecraft:stained_hardened_clay"; + public static int shadowStoneBlockByte = 9; + + public static String shadowDesertBlockId = "minecraft:stained_hardened_clay"; + public static int shadowDesertBlockByte = 0; + + public static boolean enableUBCStoneShadowing = true; + public static boolean enableUBCDesertShadowing = true; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Trees + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean allowTreesToGenerateOnSand = true; + public static boolean allowShrubsToGenerateBelowSurface = true; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Villages + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean generateVillages = true; + + public static boolean enableVillageModifications = enableVillageTweaks(); + public static int villageSize = 0; + public static int minDistanceVillages = 12; // Vanilla = 8 + public static int maxDistanceVillages = 48; // Vanilla = 32 + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Volcanoes + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + // These constants are used as fallbacks when generating volcanoes, in case the user enters an invalid block ID. + public static final IBlockState volcanoBlock = Blocks.OBSIDIAN.getDefaultState(); + public static final IBlockState volcanoMix1Block = Blocks.COBBLESTONE.getDefaultState(); + public static final IBlockState volcanoMix2Block = Blocks.GRAVEL.getDefaultState(); + public static final IBlockState volcanoMix3Block = Blocks.COAL_BLOCK.getDefaultState(); + + public static String volcanoBlockId = "minecraft:obsidian"; + public static int volcanoBlockMeta = 0; + public static String volcanoMix1BlockId = "minecraft:cobblestone"; + public static int volcanoMix1BlockMeta = 0; + public static String volcanoMix2BlockId = "minecraft:gravel"; + public static int volcanoMix2BlockMeta = 0; + public static String volcanoMix3BlockId = "minecraft:coal_block"; + public static int volcanoMix3BlockMeta = 0; + + public static boolean enableVolcanoes = true; + public static boolean enableVolcanoEruptions = true; + public static int volcanoChance = 48; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + + config.load(); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Bedrock + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + flatBedrockLayers = config.getInt("Number of flat bedrock layers", "Bedrock", flatBedrockLayers, 0, 5, "0 = Normal bedrock (rough pattern); 1-5 = Number of flat bedrock layers to generate" + Configuration.NEW_LINE); + + bedrockBlockId = config.getString( + "Bedrock block ID", + "Bedrock", + bedrockBlockId, + "The block to use for the bottom of the Overworld." + + Configuration.NEW_LINE + ); + + bedrockBlockByte = config.getInt("Bedrock block meta value", "Bedrock", bedrockBlockByte, 0, 15, "The meta value of the bedrock block." + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Biomes + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableRTGBiomeDecorations = config.getBoolean( + "Enable RTG Biome Decorations", + "Biomes", + enableRTGBiomeDecorations, + "If TRUE, uses the individual biome settings in the biome config files. If FALSE, disables all RTG decorations and uses vanilla decorations instead." + + Configuration.NEW_LINE + ); + + enableRTGBiomeSurfaces = config.getBoolean( + "Enable RTG Biome Surfaces", + "Biomes", + enableRTGBiomeSurfaces, + "If TRUE, uses the individual biome settings in the biome config files. If FALSE, disables all RTG surfaces and uses vanilla surfaces instead." + + Configuration.NEW_LINE + ); + + patchBiomeId = config.getInt( + "Patch Biome ID", + "Biomes", + patchBiomeId, + -1, + 255, + "If RTG tries to generate an unsupported biome or a biome that has an ID conflict, it will generate this biome instead." + + Configuration.NEW_LINE + + "If set to -1, RTG will crash instead of generating the patch biome. You might want to do this if you're making a mod pack" + + Configuration.NEW_LINE + + "and want to make sure all biomes are generating correctly." + + Configuration.NEW_LINE + + "Default = Vanilla Plains" + + Configuration.NEW_LINE + ); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Boulders + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableCobblestoneBoulders = config.getBoolean("Enable Cobblestone Boulders", "Boulders", enableCobblestoneBoulders, ""); + cobblestoneBoulderChance = config.getInt("1/x chance that Cobblestone Boulders will generate if given the opportunity to do so during world gen", "Boulders", cobblestoneBoulderChance, 1, 100, "1 = Always generate if possible; 2 = 50% chance; 4 = 25% chance" + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Caves + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableCaveModifications = config.getBoolean( + "Enable Cave Modifications", + "Caves", + enableCaveModifications, + "Must be set to TRUE for the other cave settings to have any effect." + + Configuration.NEW_LINE + + "If FALSE, RTG won't interfere with cave generation at all." + + Configuration.NEW_LINE + + "WARNING! Setting this to FALSE may result in unpredictable cave generation." + + Configuration.NEW_LINE + ); + + enableCaves = config.getBoolean("Enable Caves", "Caves", enableCaves, ""); + caveDensity = config.getInt("Cave Density", "Caves", caveDensity, 1, 40, "This setting controls the size of caves." + Configuration.NEW_LINE + "HIGHER values = BIGGER caves & MORE lag. (14 = vanilla cave density)" + Configuration.NEW_LINE); + caveFrequency = config.getInt("Cave Frequency", "Caves", caveFrequency, 1, 40, "This setting controls the number of caves that generate." + Configuration.NEW_LINE + "LOWER values = MORE caves & MORE lag. (6 = vanilla cave frequency)" + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Debugging + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableDebugging = config.getBoolean( + "Enable Debugging", + "Debugging", + enableDebugging, + "WARNING: This should only be enabled if you know what you're doing." + + Configuration.NEW_LINE + ); + + crashOnStructureExceptions = config.getBoolean( + "Crash on Structure Exceptions", + "Debugging", + crashOnStructureExceptions, + "Instead of crashing when it experiences 'java.util.ConcurrentModificationException' (or any other exception)" + + Configuration.NEW_LINE + + "during structure generation, RTG will stop trying to generate that structure and continue generating the world." + + Configuration.NEW_LINE + + "You should only set this to TRUE if you have been instructed to do so by an RTG developer, or if you know what you're doing." + + Configuration.NEW_LINE + ); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Dunes + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + duneHeight = config.getInt("Height of Dunes", "Dunes", duneHeight, 1, 12, "This setting controls the height of both sand dunes and snow dunes." + Configuration.NEW_LINE + "Higher values = taller dunes." + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Dungeons + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + generateDungeons = config.getBoolean("Generate Dungeons", "Dungeons", generateDungeons, ""); + dungeonFrequency = config.getInt("Dungeon Frequency", "Dungeons", dungeonFrequency, 1, 200, "This setting controls the number of dungeons that generate." + Configuration.NEW_LINE + "HIGHER values = MORE dungeons & MORE lag. (8 = vanilla dungeon frequency)" + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Flowing liquids + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableFlowingLiquidModifications = config.getBoolean( + "Enable Flowing Liquid Modifications", + "Flowing Liquids", + enableFlowingLiquidModifications, + "Must be set to TRUE for the other flowing liquid settings to have any effect." + + Configuration.NEW_LINE + + "If FALSE, RTG won't interfere with flowing liquid generation at all." + + Configuration.NEW_LINE + + "(Flowing liquids are the water/lava streams that generate on the sides of hills and mountains.)" + + Configuration.NEW_LINE + ); + + flowingLavaChance = config.getInt( + "Flowing Lava Chance", + "Flowing Liquids", + flowingLavaChance, 0, Integer.MAX_VALUE, + "1/x chance that a lava stream will generate on the side of a hill or mountain." + + Configuration.NEW_LINE + + "0 = Never generate; 1 = Always generate if possible; 2 = 50% chance; 4 = 25% chance" + + Configuration.NEW_LINE + ); + + flowingWaterChance = config.getInt( + "Flowing Water Chance", + "Flowing Liquids", + flowingWaterChance, 0, Integer.MAX_VALUE, + "1/x chance that a water stream will generate on the side of a hill or mountain." + + Configuration.NEW_LINE + + "0 = Never generate; 1 = Always generate if possible; 2 = 50% chance; 4 = 25% chance" + + Configuration.NEW_LINE + ); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // GUI + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableWorldTypeNotificationScreen = config.getBoolean("Enable World Type Notification Screen", "GUI", enableWorldTypeNotificationScreen, ""); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Lakes (Scenic) + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + lakeSizeMultiplier = config.getFloat( + "Lake Size Multipler", + "Lakes (Scenic)", + 1, 0, 10, + "Defaults to 1 (standard size)" + Configuration.NEW_LINE); + + lakeFrequencyMultiplier = config.getFloat( + "Lake Frequency Multipler", + "Lakes (Scenic)", + 1, 0, 10, + "Defaults to 1 (standard frequency)" + Configuration.NEW_LINE); + + lakeShoreBendinessMultiplier = config.getFloat( + "Lake Shore Irregularity", + "Lakes (Scenic)", + 1, 0, 2, + "Makes scenic lake shores bend and curve more. Defaults to 1" + Configuration.NEW_LINE); + + scenicLakeBiome = config.getInt("Biome for scenic lakes", "Lakes (Scenic)", + 7, 0, 254, "Biome ID for scenic lakes when not frozen (default 7 = River)" + Configuration.NEW_LINE); + + scenicFrozenLakeBiome = config.getInt("Biome for frozen scenic lakes", "Lakes (Scenic)", + 11, 0, 254, "Biome ID for scenic lakes when frozen (default 11 = Frozen River)" + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Lakes (Surface) + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableWaterSurfaceLakes = config.getBoolean("Enable Water Surface Lakes", "Lakes (Surface)", enableWaterSurfaceLakes, ""); + waterSurfaceLakeChance = config.getInt("1/x chance that Water Surface Lakes will generate if given the opportunity to do so during world gen", "Lakes (Surface)", waterSurfaceLakeChance, 1, 100, "1 = Always generate if possible; 2 = 50% chance; 4 = 25% chance" + Configuration.NEW_LINE); + + enableLavaSurfaceLakes = config.getBoolean("Enable Lava Surface Lakes", "Lakes (Surface)", enableLavaSurfaceLakes, ""); + lavaSurfaceLakeChance = config.getInt("1/x chance that Lava Surface Lakes will generate if given the opportunity to do so during world gen", "Lakes (Surface)", lavaSurfaceLakeChance, 1, 100, "1 = Always generate if possible; 2 = 50% chance; 4 = 25% chance" + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Lakes (Underground) + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableWaterUndergroundLakes = config.getBoolean("Enable Water Underground Lakes", "Lakes (Underground)", enableWaterUndergroundLakes, ""); + waterUndergroundLakeChance = config.getInt("1/x chance that Water Underground Lakes will generate if given the opportunity to do so during world gen", "Lakes (Underground)", waterUndergroundLakeChance, 1, 100, "1 = Always generate if possible; 2 = 50% chance; 4 = 25% chance" + Configuration.NEW_LINE); + + enableLavaUndergroundLakes = config.getBoolean("Enable Lava Underground Lakes", "Lakes (Underground)", enableLavaUndergroundLakes, ""); + lavaUndergroundLakeChance = config.getInt("1/x chance that Lava Underground Lakes will generate if given the opportunity to do so during world gen", "Lakes (Underground)", lavaUndergroundLakeChance, 1, 100, "1 = Always generate if possible; 2 = 50% chance; 4 = 25% chance" + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Mineshafts + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + generateMineshafts = config.getBoolean("Generate Mineshafts", "Mineshafts", generateMineshafts, ""); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Ocean monuments + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableOceanMonumentModifications = config.getBoolean( + "Enable Ocean Monument Modifications", + "Ocean Monuments", + enableOceanMonumentModifications, + "Must be set to TRUE for the other ocean monument settings to have any effect." + + Configuration.NEW_LINE + + "If FALSE, RTG won't interfere with ocean monument generation at all." + + Configuration.NEW_LINE + + "WARNING! Setting this to FALSE may result in ocean monuments generating in unpredictable locations, including those outside of oceanic biomes." + + Configuration.NEW_LINE + ); + + generateOceanMonuments = config.getBoolean("Generate Ocean Monuments", "Ocean Monuments", generateOceanMonuments, ""); + + oceanMonumentSpacing = config.getInt( + "Ocean Monument Spacing", + "Ocean Monuments", + oceanMonumentSpacing, + 1, + 1024, + "This setting determines the size of the grid, in chunks, on which ocean monuments are generated." + + Configuration.NEW_LINE + + "LOWER values = MORE monuments & MORE lag. (32 = Vanilla spacing)" + + Configuration.NEW_LINE + + "This value MUST be greater than the 'separation' value." + + Configuration.NEW_LINE + ); + + oceanMonumentSeparation = config.getInt( + "Ocean Monument Separation", + "Ocean Monuments", + oceanMonumentSeparation, + 1, + Integer.MAX_VALUE, + "This setting determines the minimum distance, in chunks, between ocean monuments." + + Configuration.NEW_LINE + + "LOWER values = MORE monuments & MORE lag. (5 = Vanilla separation)" + + Configuration.NEW_LINE + + "This value MUST be less than the 'spacing' value." + + Configuration.NEW_LINE + ); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Ore gen + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + generateOreAndesite = config.getBoolean("Generate Andesite Ore", "Ore Gen", generateOreAndesite, ""); + generateOreCoal = config.getBoolean("Generate Coal Ore", "Ore Gen", generateOreCoal, ""); + generateOreDiamond = config.getBoolean("Generate Diamond Ore", "Ore Gen", generateOreDiamond, ""); + generateOreDiorite = config.getBoolean("Generate Diorite Ore", "Ore Gen", generateOreDiorite, ""); + generateOreDirt = config.getBoolean("Generate Dirt Ore", "Ore Gen", generateOreDirt, ""); + generateOreEmerald = config.getBoolean("Generate Emerald Ore", "Ore Gen", generateOreEmerald, ""); + generateOreGold = config.getBoolean("Generate Gold Ore", "Ore Gen", generateOreGold, ""); + generateOreGranite = config.getBoolean("Generate Granite Ore", "Ore Gen", generateOreGranite, ""); + generateOreGravel = config.getBoolean("Generate Gravel Ore", "Ore Gen", generateOreGravel, ""); + generateOreIron = config.getBoolean("Generate Iron Ore", "Ore Gen", generateOreIron, ""); + generateOreLapis = config.getBoolean("Generate Lapis Ore", "Ore Gen", generateOreLapis, ""); + generateOreRedstone = config.getBoolean("Generate Redstone Ore", "Ore Gen", generateOreRedstone, ""); + generateOreSilverfish = config.getBoolean("Generate Silverfish Ore", "Ore Gen", generateOreSilverfish, ""); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Plateaus + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + plateauGradientBlockId = config.getString( + "Gradient Plateau Block ID", + "Plateaus", + plateauGradientBlockId, + "The block to use for Mesa & Savanna plateau gradients. Defaults to stained hardened clay." + + Configuration.NEW_LINE + + "This can be any block, but it works best with blocks that have multiple colours, such as stained hardened clay." + + Configuration.NEW_LINE + + "The various 'meta' options in this section will use this block to configure the plateau gradients." + + Configuration.NEW_LINE + ); + + mesaBrycePlateauBlockMetas = getPlateauGradientBlockMetasFromConfigString(config.getString( + "Gradient Plateau Block Meta Values (Mesa Bryce)", + "Plateaus", + mesaBryceGradientString, + getPlateauGradientBlockMetasComment("Mesa Bryce biome") + )); + + mesaPlateauBlockMetas = getPlateauGradientBlockMetasFromConfigString(config.getString( + "Gradient Plateau Block Meta Values (Mesa)", + "Plateaus", + mesaGradientString, + getPlateauGradientBlockMetasComment("Mesa biome variants (doesn't include Mesa Bryce)") + )); + + savannaPlateauBlockMetas = getPlateauGradientBlockMetasFromConfigString(config.getString( + "Gradient Plateau Block Meta Values (Savanna)", + "Plateaus", + savannaGradientString, + getPlateauGradientBlockMetasComment("Savanna biome variants") + )); + + plateauBlockId = config.getString( + "Plateau Block ID", + "Plateaus", + plateauBlockId, + "An extra block to use for Mesa & Savanna plateau gradients. Defaults to hardened clay." + + Configuration.NEW_LINE + + "When configuring the various 'meta' options in this section, use a value of '-1' to reference this block." + + Configuration.NEW_LINE + ); + + plateauBlockByte = config.getInt("Plateau Block Meta Value", "Plateaus", plateauBlockByte, 0, 15, "The meta value of the plateau block." + Configuration.NEW_LINE); + + stoneSavannas = config.getBoolean( + "Use stone for most Savanna biome variants", + "Plateaus", + stoneSavannas, + "If set to TRUE, Savanna biome variants will mostly use stone/cobblestone instead of gradient blocks for cliffs and plateaus." + + Configuration.NEW_LINE + + "Savanna Plateau M will always use gradient blocks." + + Configuration.NEW_LINE + ); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Ravines + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableRavineModifications = config.getBoolean( + "Enable Ravine Modifications", + "Ravines", + enableRavineModifications, + "Must be set to TRUE for the other ravine settings to have any effect." + + Configuration.NEW_LINE + + "If FALSE, RTG won't interfere with ravine generation at all." + + Configuration.NEW_LINE + + "WARNING! Setting this to FALSE may result in unpredictable ravine generation." + + Configuration.NEW_LINE + ); + + enableRavines = config.getBoolean("Enable Ravines", "Ravines", enableRavines, ""); + ravineFrequency = config.getInt("Ravine Frequency", "Ravines", ravineFrequency, 1, 100, "This setting controls the number of ravines that generate." + Configuration.NEW_LINE + "LOWER values = MORE ravines & MORE lag. (50 = vanilla ravine frequency)" + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Rivers + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + riverSizeMultiplier = config.getFloat( + "River Width Multipler", + "Rivers", + 1, 0, 10, + "Defaults to 1 (standard width)" + Configuration.NEW_LINE); + riverFrequencyMultiplier = config.getFloat( + "River Frequency Multiplier", + "Rivers", + 1, 0, 10, + "Multiplier to river widths. Defaults to 1" + Configuration.NEW_LINE); + riverBendinessMultiplier = config.getFloat( + "Multiplier to River Bending", + "Rivers", + 1, 0, 2, + "Higher numbers make rivers bend more. Defaults to 1" + Configuration.NEW_LINE); + riverCutOffScale = config.getFloat( + "Scale of Large-Scale River Cut Off", + "Rivers", + 350, 50, 5000, + "Higher numbers make grassy areas near rivers bigger, but also more rare. Defaults to 350" + Configuration.NEW_LINE); + riverCutOffAmplitude = config.getFloat( + "Amplitude of Large-Scale River Cut Off", + "Rivers", + 0.5f, 0, 2, + "Higher numbers make the large-scale cut-off noise have a greater effect. Defaults to 0.5" + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Saplings + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableRTGSaplings = config.getBoolean( + "Enable RTG Saplings", + "Saplings", + enableRTGSaplings, + "Set this to TRUE to allow RTG's custom trees to grow from vanilla saplings." + + Configuration.NEW_LINE + + "RTG's custom trees can be grown only from the saplings that their leaves would drop naturally, and only in the biomes where they naturally generate." + + Configuration.NEW_LINE + + "For example, you can only grow a Swamp Willow in a Swamp biome, and only with an Oak sapling (because Swamp Willows have Oak leaves)." + + Configuration.NEW_LINE + ); + + rtgTreeChance = config.getInt( + "RTG Tree from Vanilla Sapling Chance", + "Saplings", + rtgTreeChance, 1, Integer.MAX_VALUE, + "1/x chance that a vanilla sapling will grow one of RTG's custom trees." + + Configuration.NEW_LINE + + "1 = Always generate if possible; 2 = 50% chance; 4 = 25% chance" + + Configuration.NEW_LINE + ); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Scattered features + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableScatteredFeatureModifications = config.getBoolean( + "Enable Scattered Feature Modifications", + "Scattered Features", + enableScatteredFeatureModifications, + "Must be set to TRUE for the other scattered feature settings to have any effect." + + Configuration.NEW_LINE + + "If FALSE, RTG won't interfere with scattered feature generation at all." + + Configuration.NEW_LINE + + "WARNING! Setting this to FALSE may result in unpredictable scattered feature generation." + + Configuration.NEW_LINE + ); + + generateScatteredFeatures = config.getBoolean("Generate Scattered Features", "Scattered Features", generateScatteredFeatures, ""); + + minDistanceScatteredFeatures = config.getInt("Minimum distance between scattered features", "Scattered Features", minDistanceScatteredFeatures, 2, Integer.MAX_VALUE, "Scattered features = desert temples, jungle temples, and witch huts; 8 = Vanilla" + Configuration.NEW_LINE); + maxDistanceScatteredFeatures = config.getInt("Maximum distance between scattered features", "Scattered Features", maxDistanceScatteredFeatures, 4, Integer.MAX_VALUE, "Scattered features = desert temples, jungle temples, and witch huts; 32 = Vanilla" + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Snow + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableSnowLayers = config.getBoolean("Enable Snow Layers", "Snow", enableSnowLayers, "This applies to newly-generated chunks only. Snow layers will still appear in cold/snowy biomes after it snows." + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Strongholds + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableStrongholdModifications = config.getBoolean( + "Enable Stronghold Modifications", + "Strongholds", + enableStrongholdModifications, + "Must be set to TRUE for the other stronghold settings to have any effect." + + Configuration.NEW_LINE + + "If FALSE, RTG won't interfere with stronghold generation at all." + + Configuration.NEW_LINE + + "WARNING! Setting this to FALSE may result in unpredictable stronghold generation." + + Configuration.NEW_LINE + ); + + generateStrongholds = config.getBoolean("Generate Strongholds", "Strongholds", generateStrongholds, ""); + + strongholdCount = config.getInt( + "Stronghold Count", + "Strongholds", + strongholdCount, + 1, + Integer.MAX_VALUE, + "This setting is the number of strongholds that exist per world." + + Configuration.NEW_LINE + + "HIGHER values = MORE strongholds & MORE lag. (3 = Vanilla)" + + Configuration.NEW_LINE + ); + + strongholdDistance = config.getInt( + "Stronghold Distance", + "Strongholds", + strongholdDistance, + 1, + Integer.MAX_VALUE, + "This setting determines how far strongholds are from the spawn and other strongholds." + + Configuration.NEW_LINE + + "LOWER values = MORE strongholds & MORE lag. (32 = Vanilla)" + + Configuration.NEW_LINE + ); + + strongholdSpread = config.getInt( + "Stronghold Spread", + "Strongholds", + strongholdSpread, + 1, + Integer.MAX_VALUE, + "This setting determines how concentrated strongholds are around the spawn." + + Configuration.NEW_LINE + + "LOWER values = LOWER concentration around spawn. (3 = Vanilla)" + + Configuration.NEW_LINE + ); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Terrain shadowing + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + shadowStoneBlockId = config.getString( + "Stone shadow block ID", + "Terrain shadowing", + shadowStoneBlockId, + "The block to use for stone terrain shadowing, typically seen on the cliffs of stone mountains. Defaults to stained hardened clay." + + Configuration.NEW_LINE + ); + + shadowStoneBlockByte = config.getInt("Stone shadow block meta value", "Terrain shadowing", shadowStoneBlockByte, 0, 15, "The meta value of the shadow block for stone cliffs. Defaults to " + shadowStoneBlockByte + " (cyan)." + Configuration.NEW_LINE); + + shadowDesertBlockId = config.getString( + "Desert shadow block ID", + "Terrain shadowing", + shadowDesertBlockId, + "The block to use for desert terrain shadowing, typically seen on the cliffs of desert mountains. Defaults to stained hardened clay." + + Configuration.NEW_LINE + ); + + shadowDesertBlockByte = config.getInt("Desert shadow block meta value", "Terrain shadowing", shadowDesertBlockByte, 0, 15, "The meta value of the shadow block for desert cliffs. Defaults to " + shadowDesertBlockByte + " (white)." + Configuration.NEW_LINE); + + enableUBCStoneShadowing = config.getBoolean( + "UBC Mode (Stone)", + "Terrain shadowing", + enableUBCStoneShadowing, + "Set this to TRUE to allow UBC to override stone shadowing." + + Configuration.NEW_LINE + + "This setting doesn't have any effect if UBC is not installed." + + Configuration.NEW_LINE + ); + + enableUBCDesertShadowing = config.getBoolean( + "UBC Mode (Desert)", + "Terrain shadowing", + enableUBCDesertShadowing, + "Set this to TRUE to allow UBC to override desert shadowing." + + Configuration.NEW_LINE + + "This setting doesn't have any effect if UBC is not installed." + + Configuration.NEW_LINE + ); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Trees + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + allowTreesToGenerateOnSand = config.getBoolean( + "Allow Trees to Generate on Sand", + "Trees", + allowTreesToGenerateOnSand, + "Set this to FALSE to prevent trees from generating on sand." + + Configuration.NEW_LINE + + "This setting only affects trees generated by RTG. Trees generated by a biome's decorator" + + Configuration.NEW_LINE + + "will adhere to their own generation rules. (RTG's Palm Trees ignore this setting.)" + + Configuration.NEW_LINE + ); + + allowShrubsToGenerateBelowSurface = config.getBoolean( + "Allow Shrubs to Generate Below Surface", + "Trees", + allowShrubsToGenerateBelowSurface, + "Set this to FALSE to prevent shrub trunks from generating below the surface." + + Configuration.NEW_LINE + ); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Villages + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableVillageModifications = config.getBoolean( + "Enable village modifications", + "Villages", + enableVillageModifications, + "Set this to FALSE to resolve issues with mods that also modify villages." + + Configuration.NEW_LINE + + "If set to FALSE, the 'Minimum distance between villages', 'Maximum distance between villages' & 'Size of villages' settings will have no effect." + + Configuration.NEW_LINE + + "WARNING! Setting this to FALSE may result in unpredictable village generation." + + Configuration.NEW_LINE + ); + + generateVillages = config.getBoolean("Generate Villages", "Villages", generateVillages, ""); + villageSize = config.getInt("Size of villages", "Villages", villageSize, 0, 10, "Higher values = bigger villages; 0 = Vanilla" + Configuration.NEW_LINE); + minDistanceVillages = config.getInt("Minimum distance between villages", "Villages", minDistanceVillages, 1, Integer.MAX_VALUE, "Higher values = villages further apart; 8 = Vanilla" + Configuration.NEW_LINE); + maxDistanceVillages = config.getInt("Maximum distance between villages", "Villages", maxDistanceVillages, 1, Integer.MAX_VALUE, "Lower values = villages closer together; 32 = Vanilla" + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Volcanoes + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + volcanoBlockId = config.getString( + "Volcano block ID", + "Volcanoes", + volcanoBlockId, + "The main block to use for the surface of the volcano." + + Configuration.NEW_LINE + ); + + volcanoBlockMeta = config.getInt("Volcano block meta value", "Volcanoes", volcanoBlockMeta, 0, 15, "The meta value of the volcano block." + Configuration.NEW_LINE); + + volcanoMix1BlockId = config.getString( + "Volcano mix 1 block ID", + "Volcanoes", + volcanoMix1BlockId, + "The block ID of the 1st volcano mix block." + + Configuration.NEW_LINE + ); + + volcanoMix1BlockMeta = config.getInt("Volcano mix 1 block meta value", "Volcanoes", volcanoMix1BlockMeta, 0, 15, "The meta value of the 1st volcano mix block." + Configuration.NEW_LINE); + + volcanoMix2BlockId = config.getString( + "Volcano mix 2 block ID", + "Volcanoes", + volcanoMix2BlockId, + "The block ID of the 2nd volcano mix block." + + Configuration.NEW_LINE + ); + + volcanoMix2BlockMeta = config.getInt("Volcano mix 2 block meta value", "Volcanoes", volcanoMix2BlockMeta, 0, 15, "The meta value of the 2nd volcano mix block." + Configuration.NEW_LINE); + + volcanoMix3BlockId = config.getString( + "Volcano mix 3 block ID", + "Volcanoes", + volcanoMix3BlockId, + "The block ID of the 3rd volcano mix block." + + Configuration.NEW_LINE + ); + + volcanoMix3BlockMeta = config.getInt("Volcano mix 3 block meta value", "Volcanoes", volcanoMix3BlockMeta, 0, 15, "The meta value of the 3rd volcano mix block." + Configuration.NEW_LINE); + + enableVolcanoes = config.getBoolean( + "Enable volcanoes", + "Volcanoes", + enableVolcanoes, + "Set this to FALSE to prevent volcanoes from generating." + + Configuration.NEW_LINE + ); + + enableVolcanoEruptions = config.getBoolean( + "Enable volcano eruptions", + "Volcanoes", + enableVolcanoEruptions, + "Set this to FALSE to prevent lava from flowing down the sides of volcanoes." + + Configuration.NEW_LINE + ); + + volcanoChance = config.getInt( + "Volcano Chance", + "Volcanoes", + volcanoChance, 1, Integer.MAX_VALUE, + "1/x chance that a volcano will generate in a biome that has volcanoes enabled." + + Configuration.NEW_LINE + + "1 = Always generate if possible; 2 = 50% chance; 4 = 25% chance" + + Configuration.NEW_LINE + ); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + catch (Exception e) { + + Logger.error("RTG had a problem loading RTG configuration."); + } + finally { + + if (config.hasChanged()) { + config.save(); + } + } + } + + private static boolean enableVillageTweaks() { + + boolean enableVillageModifications = true; + + if (Loader.isModLoaded("RSG")) { + enableVillageModifications = false; + } + + return enableVillageModifications; + } + + private static byte[] getPlateauGradientBlockMetasFromConfigString(String configString) + { + String[] strings = configString.split(","); + ArrayList byteList = new ArrayList(){}; + + for (int i = 0; i < strings.length; i++) { + strings[i] = strings[i].trim(); + if (strings[i].matches("-1|0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15")) { + byteList.add(Byte.valueOf(strings[i])); + } + } + + Byte[] bytes = byteList.toArray(new Byte[byteList.size()]); + return ArrayUtils.toPrimitive(bytes); + } + + private static String getPlateauGradientBlockMetasComment(String biomeName) + { + String comment = + "Comma-separated list of meta values for the gradient plateau blocks used in the " + biomeName + "." + + Configuration.NEW_LINE + + "-1 = Plateau block; 0-15 = Plateau gradient block" + + Configuration.NEW_LINE + + "0 = White; 1 = Orange; 2 = Magenta; 3 = Light Blue; 4 = Yellow; 5 = Lime; 6 = Pink; 7 = Gray" + + Configuration.NEW_LINE + + "8 = Light Gray; 9 = Cyan; 10 = Purple; 11 = Blue; 12 = Brown; 13 = Green; 14 = Red; 15 = Black" + + Configuration.NEW_LINE; + + return comment; + } + + public static float lakeSizeMultiplier() { + // with the river system changing frequency also shinks size and that will + // confuse the heck out of users. + return lakeSizeMultiplier*lakeFrequencyMultiplier; + } + + public static float riverSizeMultiplier() { + // with the river system changing frequency also shinks size and that will + // confuse the heck out of users. + return riverSizeMultiplier*riverFrequencyMultiplier; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/config/sugiforest/ConfigSF.java b/src/api/java/rtg/config/sugiforest/ConfigSF.java new file mode 100644 index 00000000..5dbddd9d --- /dev/null +++ b/src/api/java/rtg/config/sugiforest/ConfigSF.java @@ -0,0 +1,33 @@ +package rtg.config.sugiforest; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +import rtg.api.biome.sugiforest.config.BiomeConfigSF; +import rtg.config.BiomeConfigManager; +import rtg.util.Logger; + +public class ConfigSF { + + public static Configuration config; + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + config.load(); + + BiomeConfigManager.setBiomeConfigsFromUserConfigs(BiomeConfigSF.getBiomeConfigs(), config); + } + catch (Exception e) { + Logger.error("RTG had a problem loading SF configuration."); + } + finally { + if (config.hasChanged()) { + config.save(); + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/config/vanilla/ConfigVanilla.java b/src/api/java/rtg/config/vanilla/ConfigVanilla.java new file mode 100644 index 00000000..df67d396 --- /dev/null +++ b/src/api/java/rtg/config/vanilla/ConfigVanilla.java @@ -0,0 +1,33 @@ +package rtg.config.vanilla; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +import rtg.api.biome.vanilla.config.BiomeConfigVanilla; +import rtg.config.BiomeConfigManager; +import rtg.util.Logger; + +public class ConfigVanilla { + + public static Configuration config; + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + config.load(); + + BiomeConfigManager.setBiomeConfigsFromUserConfigs(BiomeConfigVanilla.getBiomeConfigs(), config); + } + catch (Exception e) { + Logger.error("RTG had a problem loading Vanilla configuration."); + } + finally { + if (config.hasChanged()) { + config.save(); + } + } + } +} diff --git a/src/api/java/rtg/event/EventManagerRTG.java b/src/api/java/rtg/event/EventManagerRTG.java new file mode 100644 index 00000000..ccb6eddd --- /dev/null +++ b/src/api/java/rtg/event/EventManagerRTG.java @@ -0,0 +1,405 @@ +package rtg.event; + +import java.util.ArrayList; +import java.util.WeakHashMap; + +import net.minecraft.block.BlockSapling; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; +import net.minecraftforge.event.terraingen.OreGenEvent; +import net.minecraftforge.event.terraingen.SaplingGrowTreeEvent; +import net.minecraftforge.event.terraingen.WorldTypeEvent; +import net.minecraftforge.event.world.ChunkEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.Event; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.Acceptor; +import rtg.util.Logger; +import rtg.util.RandomUtil; +import rtg.util.SaplingUtil; +import rtg.world.WorldTypeRTG; +import rtg.world.biome.BiomeProviderRTG; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.biome.realistic.RealisticBiomePatcher; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.genlayer.RiverRemover; + + +@SuppressWarnings({"WeakerAccess", "unused"}) +public class EventManagerRTG { + + // Event handlers. + private final WorldEventRTG WORLD_EVENT_HANDLER = new WorldEventRTG(); + private final LoadChunkRTG LOAD_CHUNK_EVENT_HANDLER = new LoadChunkRTG(); + private final GenerateMinableRTG GENERATE_MINABLE_EVENT_HANDLER = new GenerateMinableRTG(); + private final InitBiomeGensRTG INIT_BIOME_GENS_EVENT_HANDLER = new InitBiomeGensRTG(); + private final SaplingGrowTreeRTG SAPLING_GROW_TREE_EVENT_HANDLER = new SaplingGrowTreeRTG(); + private final DecorateBiomeEventRTG DECORATE_BIOME_EVENT_HANDLER = new DecorateBiomeEventRTG(); + + private WeakHashMap> chunkLoadEvents = new WeakHashMap<>(); + private long worldSeed; + + public EventManagerRTG() { + + } + + public class LoadChunkRTG + { + LoadChunkRTG() { + logEventMessage("Initialising LoadChunkRTG..."); + } + + @SubscribeEvent + public void loadChunkRTG(ChunkEvent.Load event) { + + // Are we in an RTG world? + if (!(event.getWorld().getWorldInfo().getTerrainType() instanceof WorldTypeRTG)) { + return; + } + + Acceptor acceptor = chunkLoadEvents.get(event.getWorld().provider.getDimension()); + if (acceptor != null) { + acceptor.accept(event); + } + } + } + + public class GenerateMinableRTG { + + @SubscribeEvent + public void generateMinableRTG(OreGenEvent.GenerateMinable event) { + + // Are we in an RTG world? + if (!(event.getWorld().getWorldInfo().getTerrainType() instanceof WorldTypeRTG)) { + return; + } + + switch (event.getType()) { + + case ANDESITE: + if (!ConfigRTG.generateOreAndesite) { + event.setResult(Event.Result.DENY); + } + break; + + case COAL: + if (!ConfigRTG.generateOreCoal) { + event.setResult(Event.Result.DENY); + } + break; + + case DIAMOND: + if (!ConfigRTG.generateOreDiamond) { + event.setResult(Event.Result.DENY); + } + break; + + case DIORITE: + if (!ConfigRTG.generateOreDiorite) { + event.setResult(Event.Result.DENY); + } + break; + + case DIRT: + if (!ConfigRTG.generateOreDirt) { + event.setResult(Event.Result.DENY); + } + break; + + case EMERALD: + if (!ConfigRTG.generateOreEmerald) { + event.setResult(Event.Result.DENY); + } + break; + + case GOLD: + if (!ConfigRTG.generateOreGold) { + event.setResult(Event.Result.DENY); + } + break; + + case GRANITE: + if (!ConfigRTG.generateOreGranite) { + event.setResult(Event.Result.DENY); + } + break; + + case GRAVEL: + if (!ConfigRTG.generateOreGravel) { + event.setResult(Event.Result.DENY); + } + break; + + case IRON: + if (!ConfigRTG.generateOreIron) { + event.setResult(Event.Result.DENY); + } + break; + + case LAPIS: + if (!ConfigRTG.generateOreLapis) { + event.setResult(Event.Result.DENY); + } + break; + + case REDSTONE: + if (!ConfigRTG.generateOreRedstone) { + event.setResult(Event.Result.DENY); + } + break; + + case SILVERFISH: + if (!ConfigRTG.generateOreSilverfish) { + event.setResult(Event.Result.DENY); + } + break; + + default: + break; + } + } + } + + public class InitBiomeGensRTG { + + @SubscribeEvent + public void initBiomeGensRTG(WorldTypeEvent.InitBiomeGens event) { + + // Are we in an RTG world? + if (!(event.getWorldType() instanceof WorldTypeRTG)) { + return; + } + + try { + event.setNewBiomeGens(new RiverRemover().riverLess(event.getOriginalBiomeGens())); + } + catch (ClassCastException ex) { + //throw ex; + // failed attempt because the GenLayers don't end with GenLayerRiverMix + } + } + } + + public class SaplingGrowTreeRTG + { + SaplingGrowTreeRTG() { + logEventMessage("Initialising SaplingGrowTreeRTG..."); + } + + @SubscribeEvent + public void saplingGrowTreeRTG(SaplingGrowTreeEvent event) { + + // Are RTG saplings enabled? + if (!ConfigRTG.enableRTGSaplings) { + return; + } + + // Are we in an RTG world? Do we have RTG's chunk manager? + if (!(event.getWorld().getWorldInfo().getTerrainType() instanceof WorldTypeRTG) || + !(event.getWorld().getBiomeProvider() instanceof BiomeProviderRTG)) return; + + // Should we generate a vanilla tree instead? + if (event.getRand().nextInt(ConfigRTG.rtgTreeChance) != 0) { + + Logger.debug("Skipping RTG tree generation."); + return; + } + + IBlockState saplingBlock = event.getWorld().getBlockState(event.getPos()); + + // Are we dealing with a sapling? Sounds like a silly question, but apparently it's one that needs to be asked. + if (!(saplingBlock.getBlock() instanceof BlockSapling)) { + Logger.warn("Could not get sapling meta from non-sapling BlockState (%s).", saplingBlock.getBlock().getLocalizedName()); + return; + } + + BiomeProviderRTG cmr = (BiomeProviderRTG) event.getWorld().getBiomeProvider(); + //Biome bgg = cmr.getBiomeGenAt(x, z); + Biome bgg = event.getWorld().getBiome(event.getPos()); + RealisticBiomeBase rb = RealisticBiomeBase.getBiome(Biome.getIdForBiome(bgg)); + + // Do we need to patch the biome? + if (rb == null) { + RealisticBiomePatcher biomePatcher = new RealisticBiomePatcher(); + rb = biomePatcher.getPatchedRealisticBiome( + "NULL biome (" + Biome.getIdForBiome(bgg) + ") found when growing an RTG sapling."); + } + + ArrayList biomeTrees = rb.rtgTrees; + int saplingMeta = SaplingUtil.getMetaFromState(saplingBlock); + + Logger.debug("Biome = %s", rb.baseBiome.getBiomeName()); + Logger.debug("Ground Sapling Block = %s", saplingBlock.getBlock().getLocalizedName()); + Logger.debug("Ground Sapling Meta = %d", saplingMeta); + + if (biomeTrees.size() > 0) { + + // First, let's get all of the trees in this biome that match the sapling on the ground. + ArrayList validTrees = new ArrayList<>(); + + for (int i = 0; i < biomeTrees.size(); i++) { + + Logger.debug("Biome Tree #%d = %s", i, biomeTrees.get(i).getClass().getName()); + Logger.debug("Biome Tree #%d Sapling Block = %s", i, biomeTrees.get(i).saplingBlock.getBlock().getLocalizedName()); + Logger.debug("Biome Tree #%d Sapling Meta = %d", i, SaplingUtil.getMetaFromState(biomeTrees.get(i).saplingBlock)); + + if (saplingBlock.getBlock() == biomeTrees.get(i).saplingBlock.getBlock()) { + + if (SaplingUtil.getMetaFromState(saplingBlock) == SaplingUtil.getMetaFromState(biomeTrees.get(i).saplingBlock)) { + + validTrees.add(biomeTrees.get(i)); + Logger.debug("Valid tree found!"); + } + } + } + + // If there are valid trees, then proceed; otherwise, let's get out here. + if (validTrees.size() > 0) { + + // Get a random tree from the list of valid trees. + TreeRTG tree = validTrees.get(event.getRand().nextInt(validTrees.size())); + + Logger.debug("Tree = %s", tree.getClass().getName()); + + // Set the trunk size if min/max values have been set. + if (tree.minTrunkSize > 0 && tree.maxTrunkSize > tree.minTrunkSize) { + + tree.trunkSize = RandomUtil.getRandomInt(event.getRand(), tree.minTrunkSize, tree.maxTrunkSize); + } + + // Set the crown size if min/max values have been set. + if (tree.minCrownSize > 0 && tree.maxCrownSize > tree.minCrownSize) { + + tree.crownSize = RandomUtil.getRandomInt(event.getRand(), tree.minCrownSize, tree.maxCrownSize); + } + + /* + * Set the generateFlag to what it needs to be for growing trees from saplings, + * generate the tree, and then set it back to what it was before. + * + * TODO: Does this affect the generation of normal RTG trees? - Pink + */ + int oldFlag = tree.generateFlag; + tree.generateFlag = 3; + boolean generated = tree.generate(event.getWorld(), event.getRand(), event.getPos()); + tree.generateFlag = oldFlag; + + if (generated) { + + // Prevent the original tree from generating. + event.setResult(Event.Result.DENY); + + // Sometimes we have to remove the sapling manually because some trees grow around it, leaving the original sapling. + if (event.getWorld().getBlockState(event.getPos()) == saplingBlock) { + event.getWorld().setBlockState(event.getPos(), Blocks.AIR.getDefaultState(), 2); + } + } + } + else { + + Logger.debug("There are no RTG trees associated with the sapling on the ground." + + " Generating a vanilla tree instead."); + } + } + } + } + + public class WorldEventRTG { + + WorldEventRTG() { + + logEventMessage("Initialising WorldEventRTG..."); + } + + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load event) { + + // This event fires for each dimension loaded (and then one last time in which it returns 0?), + // so initialise a field to 0 and set it to the world seed and only display it in the log once. + if (worldSeed != event.getWorld().getSeed() && event.getWorld().getSeed() != 0) { + + worldSeed = event.getWorld().getSeed(); + Logger.info("World Seed: " + worldSeed); + } + } + + @SubscribeEvent + public void onWorldUnload(WorldEvent.Unload event) { + + // Reset the world seed so that it logs on the next server start if the seed is the same as the last load. + worldSeed = 0; + } + } + + public class DecorateBiomeEventRTG { + + DecorateBiomeEventRTG() { + + logEventMessage("Initialising DecorateBiomeEventRTG..."); + } + + @SubscribeEvent + public void onBiomeDecorate(DecorateBiomeEvent.Decorate event) { + + // Are flowing liquid modifications enabled? + // Note: This will need to move to the switch statement below if we add more case statements. + if (!ConfigRTG.enableFlowingLiquidModifications) { + return; + } + + // Are we in an RTG world? Do we have RTG's chunk manager? + if (!(event.getWorld().getWorldInfo().getTerrainType() instanceof WorldTypeRTG) || + !(event.getWorld().getBiomeProvider() instanceof BiomeProviderRTG)) return; + + switch (event.getType()) + { + /* + * Vanilla generates flowing liquids during biome decoration, + * so we're going to cancel that event here and generate them via rPopulatePostDecorate(). + */ + case LAKE_WATER: + case LAKE_LAVA: + + event.setResult(Event.Result.DENY); + + default: + break; + } + } + } + + /* + * This method registers most of RTG's event handlers. + * + * We don't need to check if the event handlers are unregistered before registering them + * because Forge already performs those checks. This means that we could execute this method a + * million times, and each event handler would still only be registered once. + */ + public void registerEventHandlers() { + + logEventMessage("Registering RTG's event handlers..."); + + MinecraftForge.EVENT_BUS.register(WORLD_EVENT_HANDLER); + MinecraftForge.EVENT_BUS.register(LOAD_CHUNK_EVENT_HANDLER); + MinecraftForge.ORE_GEN_BUS.register(GENERATE_MINABLE_EVENT_HANDLER); + MinecraftForge.TERRAIN_GEN_BUS.register(INIT_BIOME_GENS_EVENT_HANDLER); + MinecraftForge.TERRAIN_GEN_BUS.register(SAPLING_GROW_TREE_EVENT_HANDLER); + MinecraftForge.TERRAIN_GEN_BUS.register(DECORATE_BIOME_EVENT_HANDLER); + + logEventMessage("RTG's event handlers have been registered successfully."); + } + + private static void logEventMessage(String message) { + Logger.debug("RTG Event System: " + message); + } + + public void setDimensionChunkLoadEvent(int dimension, Acceptor action) { + chunkLoadEvents.put(dimension, action); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/event/WorldTypeMessageEventHandler.java b/src/api/java/rtg/event/WorldTypeMessageEventHandler.java new file mode 100644 index 00000000..11f919be --- /dev/null +++ b/src/api/java/rtg/event/WorldTypeMessageEventHandler.java @@ -0,0 +1,51 @@ +package rtg.event; + +import java.io.File; +import java.io.IOException; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiCreateWorld; + +import net.minecraftforge.client.event.GuiOpenEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import org.apache.commons.io.FileUtils; + +import rtg.client.gui.WorldTypeMessageGUI; + +/** + * Handles the display of the notification screen when creating a new world. + * + * @author @Adubbz (https://github.com/Adubbz) + *

+ * Source: https://github.com/Glitchfiend/BiomesOPlenty/blob/BOP-1.7.10-2.1.x/src/main/java/biomesoplenty/common/eventhandler/client/gui/WorldTypeMessageEventHandler.java + * Modified by: WhichOnesPink (https://github.com/whichonespink44) + */ +public class WorldTypeMessageEventHandler { + + public static WorldTypeMessageEventHandler instance = new WorldTypeMessageEventHandler(); + + @SubscribeEvent + @SideOnly(Side.CLIENT) + public void openCreateWorld(GuiOpenEvent event) { + + if (event.getGui() instanceof GuiCreateWorld) { + File nameHashFile = new File(Minecraft.getMinecraft().mcDataDir.getPath() + File.separator + "settings.rtg"); + String nameHash = "" + Minecraft.getMinecraft().getSession().getUsername().hashCode(); + + try { + if (!nameHashFile.exists() || !FileUtils.readFileToString(nameHashFile).contains(nameHash + "StartupWarning".hashCode())) { + event.setGui(new WorldTypeMessageGUI(event.getGui(), nameHashFile, nameHash)); + } + } + catch (IOException e) { + e.printStackTrace(); + } + + MinecraftForge.EVENT_BUS.unregister(instance); + } + } +} diff --git a/src/api/java/rtg/proxy/ClientProxy.java b/src/api/java/rtg/proxy/ClientProxy.java new file mode 100644 index 00000000..f5b4097f --- /dev/null +++ b/src/api/java/rtg/proxy/ClientProxy.java @@ -0,0 +1,28 @@ +package rtg.proxy; + +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; + +public class ClientProxy extends CommonProxy +{ + public static final String LOCATION = "rtg.proxy.ClientProxy"; + + @Override + public void preInit(FMLPreInitializationEvent event) { + + super.preInit(event); + } + + @Override + public void init(FMLInitializationEvent event) { + + super.init(event); + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + + super.postInit(event); + } +} diff --git a/src/api/java/rtg/proxy/CommonProxy.java b/src/api/java/rtg/proxy/CommonProxy.java new file mode 100644 index 00000000..3982ec4d --- /dev/null +++ b/src/api/java/rtg/proxy/CommonProxy.java @@ -0,0 +1,22 @@ +package rtg.proxy; + +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; + +public class CommonProxy +{ + public static final String LOCATION = "rtg.proxy.CommonProxy"; + + public void preInit(FMLPreInitializationEvent event) { + + } + + public void init(FMLInitializationEvent event) { + + } + + public void postInit(FMLPostInitializationEvent event) { + + } +} \ No newline at end of file diff --git a/src/api/java/rtg/reference/ModInfo.java b/src/api/java/rtg/reference/ModInfo.java new file mode 100644 index 00000000..3e301fac --- /dev/null +++ b/src/api/java/rtg/reference/ModInfo.java @@ -0,0 +1,14 @@ +package rtg.reference; + + +public class ModInfo +{ + public static final String MOD_ID = "RTG"; // DO NOT MODIFY! This gets replaced during gradle build. + public static final String MOD_NAME = "Realistic Terrain Generation"; // DO NOT MODIFY! This gets replaced during gradle build. + public static final String MOD_VERSION = "@MOD_VERSION@"; + public static final String MCF_MINVER = "0.0-MCF+MINVER"; + public static final String MCF_MAXVER = "9001.0-MCF+MAXVER"; + public static final String MOD_DEPS = ";after:MODDEPS"; + public static final String WORLD_TYPE = MOD_ID.toUpperCase(); // Let's keep this uppercase. - Pink + public static final String CONFIG_DIRECTORY = MOD_ID.toUpperCase(); // Let's keep this uppercase too. - Pink +} diff --git a/src/api/java/rtg/util/Acceptor.java b/src/api/java/rtg/util/Acceptor.java new file mode 100644 index 00000000..84f45b30 --- /dev/null +++ b/src/api/java/rtg/util/Acceptor.java @@ -0,0 +1,26 @@ + +package rtg.util; + + +/** + * + * @author Zeno410 + */ +public abstract class Acceptor { + public abstract void accept(Type accepted); + + public static class Ignorer extends Acceptor { + public void accept(IgnoredType ignored) {} + } + + public static class OneShotRedirector extends Acceptor { + private Acceptor target; + public void accept(RedirectedType redirected) { + target.accept(redirected); + target = null; + } + public void redirectTo(Acceptor newTarget) { + target = newTarget; + } + } +} diff --git a/src/api/java/rtg/util/Accessor.java b/src/api/java/rtg/util/Accessor.java new file mode 100644 index 00000000..e1c54c2f --- /dev/null +++ b/src/api/java/rtg/util/Accessor.java @@ -0,0 +1,82 @@ +package rtg.util; + + +import java.lang.reflect.Field; +import java.util.Arrays; + +/** + * @author Zeno410 + * Modified by topisani to allow for multiple possible field names. + * This is useful for catching both the obfuscated and the deobfuscated field. + */ +public class Accessor { + + private final String[] fieldNames; + private Field field; + + public Accessor(String... _fieldName) { + + fieldNames = _fieldName; + } + + public FieldType get(ObjectType object) { + + try { + return (FieldType)(field(object).get(object)); + } + catch (IllegalArgumentException ex) { + throw new RuntimeException(ex); + } + catch (IllegalAccessException ex) { + throw new RuntimeException(ex); + } + } + + private Field field(ObjectType example) { + + Class classObject = example.getClass(); + if (field == null) { + try { + setField(classObject); + } + catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } + return field; + } + + private void setField(Class classObject) throws IllegalAccessException { + // hunts through the class object and all superclasses looking for the field name + Field[] fields; + do { + fields = classObject.getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + for (String fieldName : fieldNames) { + if (fields[i].getName().contains(fieldName)) { + field = fields[i]; + field.setAccessible(true); + return; + } + } + } + classObject = classObject.getSuperclass(); + } + while (classObject != Object.class); + throw new RuntimeException("None of " + Arrays.toString(fieldNames) + " found in class " + classObject.getName()); + } + + public void setField(ObjectType object, FieldType fieldValue) { + + try { + field(object).set(object, fieldValue); + } + catch (IllegalArgumentException ex) { + throw new RuntimeException(ex); + } + catch (IllegalAccessException ex) { + throw new RuntimeException(ex); + } + } + +} \ No newline at end of file diff --git a/src/api/java/rtg/util/BlockForcer.java b/src/api/java/rtg/util/BlockForcer.java new file mode 100644 index 00000000..a6584812 --- /dev/null +++ b/src/api/java/rtg/util/BlockForcer.java @@ -0,0 +1,20 @@ + +package rtg.util; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +/** + * + * @author Zeno410 + */ +public class BlockForcer { + + public void placeBlock(World target, int x, int y , int z, IBlockState placed) { + Chunk chunk = target.getChunkFromBlockCoords(new BlockPos(x, 0, z)); + chunk.setBlockState(new BlockPos(x&15, y, z&15), placed); + } + +} diff --git a/src/api/java/rtg/util/BlockUtil.java b/src/api/java/rtg/util/BlockUtil.java new file mode 100644 index 00000000..6c2f510e --- /dev/null +++ b/src/api/java/rtg/util/BlockUtil.java @@ -0,0 +1,201 @@ +package rtg.util; + +import net.minecraft.block.*; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; + +public class BlockUtil { + + public static IBlockState getStateSand(int meta) { + + switch (meta) { + case 0: + return Blocks.SAND.getDefaultState(); + case 1: + return Blocks.SAND.getDefaultState().withProperty(BlockSand.VARIANT, BlockSand.EnumType.RED_SAND); + default: + return Blocks.SAND.getDefaultState(); + } + } + + public static IBlockState getStateClay(int meta) { + switch (meta) { + case 0: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.WHITE); + case 1: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.ORANGE); + case 2: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.MAGENTA); + case 3: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.LIGHT_BLUE); + case 4: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.YELLOW); + case 5: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.LIME); + case 6: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.PINK); + case 7: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.GRAY); + case 8: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.SILVER); + case 9: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.CYAN); + case 10: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.PURPLE); + case 11: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.BLUE); + case 12: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.BROWN); + case 13: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.GREEN); + case 14: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.RED); + case 15: + return Blocks.STAINED_HARDENED_CLAY.getDefaultState().withProperty(BlockStainedGlass.COLOR, EnumDyeColor.BLACK); + default: + return Blocks.HARDENED_CLAY.getDefaultState(); + } + } + + public static IBlockState getStateLog(int meta) { + switch (meta) { + case 0: + return Blocks.LOG.getDefaultState(); + case 1: + return Blocks.LOG.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.SPRUCE); + case 2: + return Blocks.LOG.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.BIRCH); + case 3: + return Blocks.LOG.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE); + default: + return Blocks.LOG.getDefaultState(); + } + } + + public static IBlockState getStateLeaf(int meta) { + switch (meta) { + case 0: + return Blocks.LEAVES.getDefaultState(); + case 1: + return Blocks.LEAVES.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.SPRUCE); + case 2: + return Blocks.LEAVES.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.BIRCH); + case 3: + return Blocks.LEAVES.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE); + default: + return Blocks.LEAVES.getDefaultState(); + } + } + + public static IBlockState getStateLog2(int meta) { + switch (meta) { + case 0: + return Blocks.LOG2.getDefaultState(); + case 1: + return Blocks.LOG2.getDefaultState().withProperty(BlockNewLog.VARIANT, BlockPlanks.EnumType.DARK_OAK); + default: + return Blocks.LOG2.getDefaultState(); + } + } + + public static IBlockState getStateLeaf2(int meta) { + switch (meta) { + case 0: + return Blocks.LEAVES2.getDefaultState(); + case 1: + return Blocks.LEAVES2.getDefaultState().withProperty(BlockNewLeaf.VARIANT, BlockPlanks.EnumType.DARK_OAK); + default: + return Blocks.LEAVES2.getDefaultState(); + } + } + + public static IBlockState getStateDirt(int meta) { + switch(meta) { + case 0: + return Blocks.DIRT.getDefaultState(); + case 1: + return Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT); + case 2: + return Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL); + default: + return Blocks.DIRT.getDefaultState(); + } + } + + public static IBlockState getStateSapling (int meta) { + switch (meta) { + case 0: + return Blocks.SAPLING.getDefaultState(); + case 1: + return Blocks.SAPLING.getDefaultState().withProperty(BlockSapling.TYPE, BlockPlanks.EnumType.SPRUCE); + case 2: + return Blocks.SAPLING.getDefaultState().withProperty(BlockSapling.TYPE, BlockPlanks.EnumType.BIRCH); + case 3: + return Blocks.SAPLING.getDefaultState().withProperty(BlockSapling.TYPE, BlockPlanks.EnumType.JUNGLE); + case 4: + return Blocks.SAPLING.getDefaultState().withProperty(BlockSapling.TYPE, BlockPlanks.EnumType.ACACIA); + case 5: + return Blocks.SAPLING.getDefaultState().withProperty(BlockSapling.TYPE, BlockPlanks.EnumType.DARK_OAK); + default: + return Blocks.SAPLING.getDefaultState(); + } + } + + /* + * FLOWER LIST: + * 0 Poppy + * 1 Blue Orchid + * 2 Allium + * 3 Azure Bluet + * 4 Red Tulip + * 5 Orange Tulip + * 6 White Tulip + * 7 Pink Tulip + * 8 Oxeye Daisy + * 9 Yellow Flower + * 10 Sunflower + * 11 Lilac + * 12 Double Tallgrass + * 13 Large Fern + * 14 Rose Bush + * 15 Peony + */ + public static IBlockState getStateFlower (int meta) { + switch (meta) { + case 0: + return Blocks.RED_FLOWER.getDefaultState(); + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + return Blocks.RED_FLOWER.getStateFromMeta(meta); + case 9: + return Blocks.YELLOW_FLOWER.getDefaultState(); + case 10: + return Blocks.DOUBLE_PLANT.getDefaultState() + .withProperty(BlockDoublePlant.VARIANT, BlockDoublePlant.EnumPlantType.SUNFLOWER); + case 11: + return Blocks.DOUBLE_PLANT.getDefaultState() + .withProperty(BlockDoublePlant.VARIANT, BlockDoublePlant.EnumPlantType.SYRINGA); + case 12: + return Blocks.DOUBLE_PLANT.getDefaultState() + .withProperty(BlockDoublePlant.VARIANT, BlockDoublePlant.EnumPlantType.GRASS); + case 13: + return Blocks.DOUBLE_PLANT.getDefaultState() + .withProperty(BlockDoublePlant.VARIANT, BlockDoublePlant.EnumPlantType.FERN); + case 14: + return Blocks.DOUBLE_PLANT.getDefaultState() + .withProperty(BlockDoublePlant.VARIANT, BlockDoublePlant.EnumPlantType.ROSE); + case 15: + return Blocks.DOUBLE_PLANT.getDefaultState() + .withProperty(BlockDoublePlant.VARIANT, BlockDoublePlant.EnumPlantType.PAEONIA); + default: + return Blocks.RED_FLOWER.getStateFromMeta(meta); + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/util/BoulderUtil.java b/src/api/java/rtg/util/BoulderUtil.java new file mode 100644 index 00000000..e4c394cf --- /dev/null +++ b/src/api/java/rtg/util/BoulderUtil.java @@ -0,0 +1,11 @@ +package rtg.util; + +import net.minecraft.block.state.IBlockState; + +public class BoulderUtil { + + public IBlockState getBoulderBlock(IBlockState defaultBlock, int worldX, int worldY, int worldZ) { + + return defaultBlock; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/util/CanyonColour.java b/src/api/java/rtg/util/CanyonColour.java new file mode 100644 index 00000000..ff84d192 --- /dev/null +++ b/src/api/java/rtg/util/CanyonColour.java @@ -0,0 +1,64 @@ +package rtg.util; + +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; + +import rtg.config.rtg.ConfigRTG; + +/** + * + * @author topisani + * + */ +public enum CanyonColour { + + MESA(ConfigRTG.mesaPlateauBlockMetas), + MESA_BRYCE(ConfigRTG.mesaBrycePlateauBlockMetas), + SAVANNA(ConfigRTG.savannaPlateauBlockMetas); + + private static Map colourBlocks = new HashMap(); + private static OpenSimplexNoise simplex; + private byte[] bytes; + + private static IBlockState plateauBlock = Block.getBlockFromName(ConfigRTG.plateauBlockId).getStateFromMeta(ConfigRTG.plateauBlockByte); + private static Block plateauGradientBlock = Block.getBlockFromName(ConfigRTG.plateauGradientBlockId); + + CanyonColour(byte[] bytes) { + this.bytes = bytes; + } + + public static void init(long l) { + + simplex = new OpenSimplexNoise(l); + + for (CanyonColour colour : CanyonColour.values()) { + + IBlockState[] c = new IBlockState[256]; + int j; + + for (int i = 0; i < 256; i++) { + + byte b = colour.bytes[i % colour.bytes.length]; + c[i] = (b == -1) ? plateauBlock : plateauGradientBlock.getStateFromMeta(b); + } + + colourBlocks.put(colour, c); + } + } + + public IBlockState getBlockForHeight(int x, int y, int z) { + + return getBlockForHeight(x, (float)y, z); + } + + public IBlockState getBlockForHeight(int x, float y, int z) { + + y = (y < 0) ? 0 : (y > 255) ? 255 : y; + + return colourBlocks.get(this)[(int)y]; + } +} + diff --git a/src/api/java/rtg/util/CellNoise.java b/src/api/java/rtg/util/CellNoise.java new file mode 100644 index 00000000..7efc677a --- /dev/null +++ b/src/api/java/rtg/util/CellNoise.java @@ -0,0 +1,6 @@ +package rtg.util; +public interface CellNoise { + public float noise(double x, double z,double depth) ; + public CellOctave octave(int index); + public CellOctave river(); +} diff --git a/src/api/java/rtg/util/CellOctave.java b/src/api/java/rtg/util/CellOctave.java new file mode 100644 index 00000000..b397b2f0 --- /dev/null +++ b/src/api/java/rtg/util/CellOctave.java @@ -0,0 +1,10 @@ +package rtg.util; + +/** + * + * @author Zeno410 + */ +public interface CellOctave { + public float noise(double x, double z,double depth) ; + public double [] eval(double x, double y); +} diff --git a/src/api/java/rtg/util/CircularSearchCreator.java b/src/api/java/rtg/util/CircularSearchCreator.java new file mode 100644 index 00000000..b6bdb858 --- /dev/null +++ b/src/api/java/rtg/util/CircularSearchCreator.java @@ -0,0 +1,97 @@ + +package rtg.util; + +/** + * This routine creates a 16x16 array for an ordered circular search + * @author Zeno410 + */ +public class CircularSearchCreator { + private boolean active = false; + private int size; + private float center; + + public int [] pattern() { + return pattern(12f,16); + } + + public int[] pattern(float maxRadius, int requestedSize) { + if (active) throw new RuntimeException(); + active = true; + size = requestedSize; + center = ((float)(size-1f))/2f; + int [] result = new int[size*size]; + boolean [] found = new boolean[size*size]; + int nextResult = 0; + int smallerHalfSize = size/2; + int largerHalfSize = (size +1)/2; + for (float radius = 0; radiusradius) continue;// still too far; skip + //place in patter + result[nextResult++]=index; + found[index] = true; + } + } + //lower right + for (int x = size-1;x>=smallerHalfSize;x--) {// out to in + for (int y = largerHalfSize;yradius) continue;// still too far; skip + //place in patter + result[nextResult++]=index; + found[index] = true; + } + } + //lower left + for (int y = size-1;y>=largerHalfSize-1;y--) {// out to in + for (int x = smallerHalfSize-1;x>-1;x--) { + int index = (int)x*size+y; + if (found[index]) continue;// skip to next block; this is already in the patter + float distance = distanceFromCenter(x,y); + if (distance>radius) continue;// still too far; skip + //place in pattern + result[nextResult++]=index; + found[index] = true; + } + } + //upper left + for (int x = 0;x-1;y--) { + int index = (int)x*size+y; + if (found[index]) continue;// skip to next block; this is already in the patter + float distance = distanceFromCenter(x,y); + if (distance>radius) continue;// still too far; skip + //place in pattern + result[nextResult++]=index; + found[index] = true; + } + } + } + active=false; + if (nextResult < result.length) { + int [] newResult = new int [nextResult]; + for (int i = 0; i 0) { + cliff = test(cliff, Math.abs(noise[x * 16 + z] - noise[(x - 1) * 16 + z])); + } + + if (z > 0) { + cliff = test(cliff, Math.abs(noise[x * 16 + z] - noise[x * 16 + z - 1])); + } + + if (x < 15) { + cliff = test(cliff, Math.abs(noise[x * 16 + z] - noise[(x + 1) * 16 + z])); + } + + if (z < 15) { + cliff = test(cliff, Math.abs(noise[x * 16 + z] - noise[x * 16 + z + 1])); + } + + return cliff; + } + + public static float calcNoise(int x, int z, float[] noise, Random rand, float randomNoise) { + + float cliff = 0f; + + if (x > 0) { + cliff = test(cliff, Math.abs(noise[x * 16 + z] - noise[(x - 1) * 16 + z])); + } + + if (z > 0) { + cliff = test(cliff, Math.abs(noise[x * 16 + z] - noise[x * 16 + z - 1])); + } + + if (x < 15) { + cliff = test(cliff, Math.abs(noise[x * 16 + z] - noise[(x + 1) * 16 + z])); + } + + if (z < 15) { + cliff = test(cliff, Math.abs(noise[x * 16 + z] - noise[x * 16 + z + 1])); + } + + return cliff - randomNoise + rand.nextFloat() * randomNoise * 2; + } + + private static float test(float cliff, float value) { + + if (value > cliff) { + return value; + } + + return cliff; + } +} diff --git a/src/api/java/rtg/util/Compass.java b/src/api/java/rtg/util/Compass.java new file mode 100644 index 00000000..42ca1958 --- /dev/null +++ b/src/api/java/rtg/util/Compass.java @@ -0,0 +1,54 @@ + +package rtg.util; + +import java.util.ArrayList; + +/** + * provide integer access to compass directions, and clockwise/counterclockwise options + * @author Zeno410 + */ +public class Compass { + private Direction [] directions = new Direction [8]; + + public Compass() { + directions[0] = Direction.UP; + directions[1] = Direction.UP_RIGHT; + directions[2] = Direction.RIGHT; + directions[3] = Direction.DOWN_RIGHT; + directions[4] = Direction.DOWN; + directions[5] = Direction.DOWN_LEFT; + directions[6] = Direction.LEFT; + directions[7] = Direction.UP_LEFT; + } + + public Direction direction(int index) { + return directions[index]; + } + public int index(Direction compassDirection) { + for (int i = 0; i < 8 ; i++) { + if (directions[i].equals(compassDirection)) return i; + } + throw new RuntimeException("nonexistent compass direction"); + } + + public Direction clockwise(Direction start) { + int result = index(start)+1; + return directions[result % 8]; + } + + public Direction counterClockwise(Direction start) { + int result = index(start)+7; + return directions[result % 8]; + } + + public Direction opposite(Direction start) { + int result = index(start)+4; + return directions[result % 8]; + } + + public ArrayList directions() { + ArrayList result = new ArrayList(8); + for (int i = 0; i < 8; i++) result.add(direction(i)); + return result; + } +} diff --git a/src/api/java/rtg/util/Converter.java b/src/api/java/rtg/util/Converter.java new file mode 100644 index 00000000..555abcf2 --- /dev/null +++ b/src/api/java/rtg/util/Converter.java @@ -0,0 +1,85 @@ + +package rtg.util; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +/** + * A class for converting one type into another + * @author Zeno410 + */ +public abstract class Converter { + + /** Creates a new instance of Converter */ + public Converter() { + } + + abstract public ToType result(FromType original); + + public ToType of(FromType original) {return result(original);} + + + public Collection listResult(Collection source) { + Collection result = new ArrayList(source.size()); + Iterator sourceList = source.iterator(); + while(sourceList.hasNext()) result.add(result(sourceList.next())); + return result; + } + + class IteratorConverter implements Iterator { + Iterator source; + IteratorConverter(Iterator theSource) {source = theSource;} + public boolean hasNext() {return source.hasNext();} + public ToType next() {return result(source.next());} + public void remove() {source.remove();} + } + + + public Acceptor acceptor(final Acceptor target) { + return new Acceptor() { + public void accept(FromType accepted) {target.accept(result(accepted));} + }; + } + + public Converter composedWith(Converter following) { + return new ChainTo(following); + } + + public class ChainTo extends Converter{ + Converter finalizer; + public ChainTo(Converter theFinalizer) { + finalizer = theFinalizer; + } + public FinalType result(FromType original) {return finalizer.result(Converter.this.result(original));} + } + + + public Converter,Named> namer() { + return new NamedConverter(this); + } + + public static class Constant extends Converter { + private final CToType value; + public Constant(CToType theValue) {value = theValue;} + public CToType result(CFromType original) {return value;} + } + + + @SuppressWarnings("hiding") + public Iterator forEach( + Converter> converterizer, + Iterator data) { + return null; + } +} + +class NamedConverter + extends Converter,Named> { + Converter handler; + public NamedConverter(Converter theHandler) {handler = theHandler;} + public Named result(Named original) { + return new Named(original.name,handler.result(original.object)); + } + +} diff --git a/src/api/java/rtg/util/Direction.java b/src/api/java/rtg/util/Direction.java new file mode 100644 index 00000000..3cd4246e --- /dev/null +++ b/src/api/java/rtg/util/Direction.java @@ -0,0 +1,24 @@ + +package rtg.util; + + +/** + * + * @author Zeno410 + */ +public class Direction { + public static Direction UP = new Direction(0,-1); + public static Direction UP_RIGHT = new Direction(1,-1); + public static Direction RIGHT = new Direction(1,0); + public static Direction DOWN_RIGHT = new Direction(1,1); + public static Direction DOWN = new Direction(0,1); + public static Direction DOWN_LEFT = new Direction(-1,1); + public static Direction LEFT = new Direction(-1,0); + public static Direction UP_LEFT = new Direction(-1,-1); + public final int xOffset; + public final int zOffset; + private Direction (int _xMultiple, int _zMultiple) { + xOffset = _xMultiple; + zOffset = _zMultiple; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/util/Dumper.java b/src/api/java/rtg/util/Dumper.java new file mode 100644 index 00000000..0056290c --- /dev/null +++ b/src/api/java/rtg/util/Dumper.java @@ -0,0 +1,188 @@ +package rtg.util; + +import java.lang.reflect.Array; +import java.lang.reflect.Field; +import java.util.HashMap; + +public class Dumper { + private static Dumper instance = new Dumper(); + + protected static Dumper getInstance() { + return instance; + } + + class DumpContext { + int maxDepth = 0; + int maxArrayElements = 0; + int callCount = 0; + HashMap ignoreList = new HashMap(); + HashMap visited = new HashMap(); + } + + public static String dump(Object o) { + return dump(o, 0, 0, null); + } + + public static String dump(Object o, int maxDepth, int maxArrayElements, String[] ignoreList) { + DumpContext ctx = Dumper.getInstance().new DumpContext(); + ctx.maxDepth = maxDepth; + ctx.maxArrayElements = maxArrayElements; + + if (ignoreList != null) { + for (int i = 0; i < Array.getLength(ignoreList); i++) { + int colonIdx = ignoreList[i].indexOf(':'); + if (colonIdx == -1) + ignoreList[i] = ignoreList[i] + ":"; + ctx.ignoreList.put(ignoreList[i], ignoreList[i]); + } + } + + return dump(o, ctx); + } + + protected static String dump(Object o, DumpContext ctx) { + if (o == null) { + return ""; + } + + ctx.callCount++; + StringBuffer tabs = new StringBuffer(); + for (int k = 0; k < ctx.callCount; k++) { + tabs.append("\t"); + } + StringBuffer buffer = new StringBuffer(); + Class oClass = o.getClass(); + + String oSimpleName = getSimpleNameWithoutArrayQualifier(oClass); + + if (ctx.ignoreList.get(oSimpleName + ":") != null) + return ""; + + if (oClass.isArray()) { + buffer.append("\n"); + buffer.append(tabs.toString().substring(1)); + buffer.append("[\n"); + int rowCount = ctx.maxArrayElements == 0 ? Array.getLength(o) : Math.min(ctx.maxArrayElements, Array.getLength(o)); + for (int i = 0; i < rowCount; i++) { + buffer.append(tabs.toString()); + try { + Object value = Array.get(o, i); + buffer.append(dumpValue(value, ctx)); + } catch (Exception e) { + buffer.append(e.getMessage()); + } + if (i < Array.getLength(o) - 1) + buffer.append(","); + buffer.append("\n"); + } + if (rowCount < Array.getLength(o)) { + buffer.append(tabs.toString()); + buffer.append(Array.getLength(o) - rowCount + " more array elements..."); + buffer.append("\n"); + } + buffer.append(tabs.toString().substring(1)); + buffer.append("]"); + } else { + buffer.append("\n"); + buffer.append(tabs.toString().substring(1)); + buffer.append("{\n"); + buffer.append(tabs.toString()); + buffer.append("hashCode: " + o.hashCode()); + buffer.append("\n"); + while (oClass != null && oClass != Object.class) { + Field[] fields = oClass.getDeclaredFields(); + + if (ctx.ignoreList.get(oClass.getSimpleName()) == null) { + if (oClass != o.getClass()) { + buffer.append(tabs.toString().substring(1)); + buffer.append(" Inherited from superclass " + oSimpleName + ":\n"); + } + + for (int i = 0; i < fields.length; i++) { + + String fSimpleName = getSimpleNameWithoutArrayQualifier(fields[i].getType()); + String fName = fields[i].getName(); + + fields[i].setAccessible(true); + buffer.append(tabs.toString()); + buffer.append(fName + "(" + fSimpleName + ")"); + buffer.append("="); + + if (ctx.ignoreList.get(":" + fName) == null && + ctx.ignoreList.get(fSimpleName + ":" + fName) == null && + ctx.ignoreList.get(fSimpleName + ":") == null) { + + try { + Object value = fields[i].get(o); + buffer.append(dumpValue(value, ctx)); + } catch (Exception e) { + buffer.append(e.getMessage()); + } + buffer.append("\n"); + } + else { + buffer.append(""); + buffer.append("\n"); + } + } + oClass = oClass.getSuperclass(); + oSimpleName = oClass.getSimpleName(); + } + else { + oClass = null; + oSimpleName = ""; + } + } + buffer.append(tabs.toString().substring(1)); + buffer.append("}"); + } + ctx.callCount--; + return buffer.toString(); + } + + protected static String dumpValue(Object value, DumpContext ctx) { + if (value == null) { + return ""; + } + if (value.getClass().isPrimitive() || + value.getClass() == java.lang.Short.class || + value.getClass() == java.lang.Long.class || + value.getClass() == java.lang.String.class || + value.getClass() == java.lang.Integer.class || + value.getClass() == java.lang.Float.class || + value.getClass() == java.lang.Byte.class || + value.getClass() == java.lang.Character.class || + value.getClass() == java.lang.Double.class || + value.getClass() == java.lang.Boolean.class || + value.getClass() == java.util.Date.class || + value.getClass().isEnum()) { + + return value.toString(); + + } else { + + Integer visitedIndex = ctx.visited.get(value); + if (visitedIndex == null) { + ctx.visited.put(value, ctx.callCount); + if (ctx.maxDepth == 0 || ctx.callCount < ctx.maxDepth) { + return dump(value, ctx); + } + else { + return ""; + } + } + else { + return ""; + } + } + } + + + private static String getSimpleNameWithoutArrayQualifier(Class clazz) { + String simpleName = clazz.getSimpleName(); + int indexOfBracket = simpleName.indexOf('['); + if (indexOfBracket != -1) + return simpleName.substring(0, indexOfBracket); + return simpleName; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/util/LimitedMap.java b/src/api/java/rtg/util/LimitedMap.java new file mode 100644 index 00000000..d6a8086b --- /dev/null +++ b/src/api/java/rtg/util/LimitedMap.java @@ -0,0 +1,95 @@ + +package rtg.util; + +import java.util.*; + +/** + * + * @author Zeno410 + */ +public class LimitedMap implements Map { + + private int limit; + private int nextIndex = 0; + private boolean reachedLimit = false; + private final ArrayList keyList; + private final HashMap map; + + public LimitedMap(int maximumSize) { + limit = maximumSize; + keyList = new ArrayList(limit); + map = new HashMap(limit); + } + + public int size() { + if (reachedLimit) return limit; + return nextIndex; + } + + public boolean isEmpty() { + return size() == 0; + } + + public boolean containsKey(Object arg0) { + return keyList.contains(arg0); + } + + public boolean containsValue(Object arg0) { + for (Value value: map.values()) { + if (value.equals(arg0)) return true; + }; + return false; + } + + public Value get(Object arg0) { + return map.get(arg0); + } + + public synchronized Value put(Key arg0, Value arg1) { + if (reachedLimit) { + map.remove(keyList.get(nextIndex)); + keyList.set(nextIndex++, arg0); + if (nextIndex >= limit) { + nextIndex = 0; + } + } else { + keyList.add(arg0); + nextIndex ++; + if (nextIndex >= limit) { + reachedLimit = true; + nextIndex = 0; + } + } + return map.put(arg0, arg1); + } + + public Value remove(Object arg0) { + return null;// not going to bother + } + + public void putAll(Map arg0) { + for (Key key: arg0.keySet()) { + put(key,arg0.get(key)); + } + } + + public void clear() { + nextIndex = 0; + reachedLimit = false; + keyList.clear(); + map.clear(); + } + + public Set keySet() { + return map.keySet(); + } + + public Collection values() { + return map.values(); + } + + public Set> entrySet() { + return map.entrySet(); + } + +} diff --git a/src/api/java/rtg/util/LimitedSet.java b/src/api/java/rtg/util/LimitedSet.java new file mode 100644 index 00000000..7ec2271d --- /dev/null +++ b/src/api/java/rtg/util/LimitedSet.java @@ -0,0 +1,88 @@ + +package rtg.util; + +import java.util.*; + +/** + * + * @author Zeno410 + */ +public class LimitedSet implements Set, Iterable { + private HashSet members = new HashSet(); + private ArrayList limiting; + private int nextIndex; + private int maxSize; + private boolean full = false; + + public LimitedSet(int maxSize) { + limiting = new ArrayList (maxSize); + this.maxSize = maxSize; + } + + public int size() { + return members.size(); + } + + public boolean isEmpty() { + return members.isEmpty(); + } + + public boolean contains(Object arg0) { + return members.contains(arg0); + } + + public Iterator iterator() { + return members.iterator(); + } + + public Object[] toArray() { + return members.toArray(); + } + + public T[] toArray(T[] arg0) { + return members.toArray(arg0); + } + + public boolean add(Type arg0) { + if (full){ + members.remove(limiting.get(nextIndex)); + limiting.set(nextIndex, arg0); + } else { + limiting.add(arg0); + } + nextIndex ++; + if (nextIndex >= maxSize) { + nextIndex = 0; + full = true; + } + return members.add(arg0); + } + + public boolean remove(Object arg0) { + return members.remove(arg0); + } + + public boolean containsAll(Collection arg0) { + return members.containsAll(arg0); + } + + public boolean addAll(Collection arg0) { + for (Type added: arg0) { + add(added); + } + return true; + } + + public boolean retainAll(Collection arg0) { + return members.retainAll(arg0); + } + + public boolean removeAll(Collection arg0) { + return members.removeAll(arg0); + } + + public void clear() { + members.clear(); + } + +} diff --git a/src/api/java/rtg/util/Logger.java b/src/api/java/rtg/util/Logger.java new file mode 100644 index 00000000..6c67d5d5 --- /dev/null +++ b/src/api/java/rtg/util/Logger.java @@ -0,0 +1,41 @@ +package rtg.util; + +import net.minecraft.client.Minecraft; +import net.minecraft.crash.CrashReport; + +import net.minecraftforge.fml.common.FMLLog; + +import org.apache.logging.log4j.Level; + +import rtg.config.rtg.ConfigRTG; + +public class Logger { + + public static void debug(String format, Object... data) { + + if (ConfigRTG.enableDebugging) { + FMLLog.log(Level.INFO, "[RTG-DEBUG] " + format, data); + } + } + + public static void info(String format, Object... data) { + + FMLLog.log(Level.INFO, "[RTG-INFO] " + format, data); + } + + public static void warn(String format, Object... data) { + + FMLLog.log(Level.WARN, "[RTG-WARN] " + format, data); + } + + public static void error(String format, Object... data) { + + FMLLog.log(Level.ERROR, "[RTG-ERROR] " + format, data); + } + + public static void fatal(String message, Throwable throwable, Object... data) { + + FMLLog.log(Level.FATAL, "[RTG-FATAL] " + message, data); + Minecraft.getMinecraft().crashed(new CrashReport(message, throwable)); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/util/MathUtils.java b/src/api/java/rtg/util/MathUtils.java new file mode 100644 index 00000000..75fbbcf5 --- /dev/null +++ b/src/api/java/rtg/util/MathUtils.java @@ -0,0 +1,31 @@ +package rtg.util; + +public class MathUtils { + + public static final int[] XY_INVERTED; + + static { + int[] result = new int[256]; + for (int i = 0; i < 16; i++) { + for (int j = 0; j < 16; j++) { + result[i * 16 + j] = j * 16 + i; + } + } + for (int i = 0; i < 256; i++) { + if (result[result[i]] != i) throw new RuntimeException("" + i + "" + result[i] + " " + result[result[i]]); + } + XY_INVERTED = result; + } + + public static final int globalToLocal(int x) { + return ((x % 16) + 16) % 16; + } + + public static final int globalToChunk(int x) { + return (int) Math.floor((double) x / 16d); + } + + public static final int globalToIndex(int x, int z) { + return globalToLocal(x) * 16 + globalToLocal(z); + } +} diff --git a/src/api/java/rtg/util/ModPresenceTester.java b/src/api/java/rtg/util/ModPresenceTester.java new file mode 100644 index 00000000..cd871855 --- /dev/null +++ b/src/api/java/rtg/util/ModPresenceTester.java @@ -0,0 +1,25 @@ +package rtg.util; + +import net.minecraftforge.fml.common.Loader; + +/** + * + * @author Zeno410 + */ +public class ModPresenceTester { + public final String name; + private boolean unknown = true; + private boolean present; + + public ModPresenceTester(String name) { + this.name = name; + } + + public boolean present() { + if (unknown) { + present = Loader.isModLoaded(name); + unknown = false; + } + return present; + } +} diff --git a/src/api/java/rtg/util/Named.java b/src/api/java/rtg/util/Named.java new file mode 100644 index 00000000..268f3496 --- /dev/null +++ b/src/api/java/rtg/util/Named.java @@ -0,0 +1,48 @@ + +package rtg.util; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * + * @author Zeno410 + */ +public class Named { + public String name; + public Type object; + /** Creates a new instance of Named */ + + public Named(String theName, Type theObject) { + name = theName; + object = theObject; + } + + public static Named from(String name,T object) { + return new Named(name,object); + } + + public static NamedStreamer streamer(Streamer streamer) { + return new NamedStreamer(streamer); + } + + public static class NamedStreamer extends Streamer> { + private final Streamer streamer; + public NamedStreamer(Streamer streamer) { + this.streamer = streamer; + } + + public Named readFrom(DataInput input) throws IOException { + String name = input.readUTF(); + return new Named(name,streamer.readFrom(input)); + + } + public void writeTo(Named written, DataOutput output) throws IOException{ + output.writeUTF(written.name); + streamer.writeTo(written.object, output); + + } + + } +} \ No newline at end of file diff --git a/src/api/java/rtg/util/OpenSimplexNoise.java b/src/api/java/rtg/util/OpenSimplexNoise.java new file mode 100644 index 00000000..22b7c52d --- /dev/null +++ b/src/api/java/rtg/util/OpenSimplexNoise.java @@ -0,0 +1,76 @@ +/** + * A shell to contain multiple instances of OpenSimplexNoise and masquerade as the first instance + * Names are currently odd for compatibility - this should eventually be called "suite" and + * SimplexOctave should be OpenSimplexNoise + */ + +package rtg.util; + +/** + * @author Zeno410 + * @version $Revision: 1.3$ + * @see https://gist.github.com/KdotJPG/b1270127455a94ac5d19 + */ +@SuppressWarnings("JavadocReference") +public class OpenSimplexNoise extends SimplexOctave { + + private final SimplexOctave [] octaves; + private static final int OCTAVE_COUNT = 10;// perhaps should be a variable + // but that creates coordination issues + + + public OpenSimplexNoise(long seed) { + octaves = new SimplexOctave[OCTAVE_COUNT]; + + for (int i = 0 ;i < OCTAVE_COUNT;i++){ + octaves[i] = new SimplexOctave(seed+i); + } + } + + /* + * Aliases + */ + + //Alias for 1D + public float noise1(float x) { + return octaves[0].noise1(x); + } + + //Alias for 2D + public float noise2(float x, float y) { + return (float)octaves[0].noise(x, y); + } + + //Alias for 3D + public float noise3(float x, float y, float z) { + return (float)octaves[0].noise(x, y, z); + } + + //Alias for 3D (again) + public double improvedNoise(double x, double y, double z) { + return octaves[0].noise(x, y, z); + } + + /* + * Standard functions + */ + + //2D OpenSimplex noise (KdotJPG) + public double noise(double x, double y) { + return octaves[0].noise(x, y); + } + + //3D OpenSimplex Noise (DigitalShadow) + public double noise(double x, double y, double z) + { + return octaves[0].noise(x, y,z); + } + + public SimplexOctave octave(int index) { + return octaves[index]; + } + public SimplexOctave mountain() {return octaves[0];} + + public SimplexOctave riverJitter() {return octaves[1];} + +} \ No newline at end of file diff --git a/src/api/java/rtg/util/RandomUtil.java b/src/api/java/rtg/util/RandomUtil.java new file mode 100644 index 00000000..1918ea72 --- /dev/null +++ b/src/api/java/rtg/util/RandomUtil.java @@ -0,0 +1,16 @@ +package rtg.util; + +import java.util.Random; + +public class RandomUtil +{ + public static int getRandomInt(int intStart, int intEnd) + { + return (int)( (Math.random() * intEnd) + intStart ); + } + + public static int getRandomInt(Random rand, int intStart, int intEnd) + { + return intStart + rand.nextInt(intEnd - intStart + 1); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/util/RealisticBiomePresenceTester.java b/src/api/java/rtg/util/RealisticBiomePresenceTester.java new file mode 100644 index 00000000..05a00191 --- /dev/null +++ b/src/api/java/rtg/util/RealisticBiomePresenceTester.java @@ -0,0 +1,47 @@ +package rtg.util; + +import net.minecraft.world.biome.Biome; + +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * + * @author WhichOnesPink + * @author srs_bsns + */ +public class RealisticBiomePresenceTester { + + public static void doBiomeCheck() + { + for (Biome biome : Biome.REGISTRY) + { + int biomeId = Biome.getIdForBiome(biome); + String biomeName = biome.getBiomeName(); + String biomeClass = biome.getBiomeClass().getName(); + + switch (biomeId) { + + case 8: // The Nether + case 9: // The End + case 127: // The Void + + // Do nothing. + break; + + default: + + try { + RealisticBiomeBase rBiome = RealisticBiomeBase.getBiome(biomeId); + String rBiomeName = rBiome.config.biomeSlug; + + Logger.info("Found biome (%d) %s from %s with a %s beach.", biomeId, biomeName, biomeClass, rBiome.beachBiome().getBiomeName()); + } + catch (Exception e) { + Logger.warn("WARNING! RTG could not find a realistic version of %s (%d) from %s. (If %s is a non-Overworld biome, then this is not an error.)", biomeName, biomeId, biomeClass, biomeName); + } + + break; + } + } + } +} diff --git a/src/api/java/rtg/util/SaplingUtil.java b/src/api/java/rtg/util/SaplingUtil.java new file mode 100644 index 00000000..cf031925 --- /dev/null +++ b/src/api/java/rtg/util/SaplingUtil.java @@ -0,0 +1,51 @@ +package rtg.util; + +import net.minecraft.block.BlockSapling; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; + +public class SaplingUtil { + + public static int getMetaFromState(IBlockState state) { + + try { + + if (!(state.getBlock() instanceof BlockSapling)) { + Logger.warn("Could not get sapling meta from non-sapling BlockState (%s).", state.getBlock().getLocalizedName()); + return 0; + } + + return state.getValue(BlockSapling.TYPE).getMetadata(); + } + catch (Exception e) { + + Logger.warn("Could not get sapling meta from state. Reason: " + e.getMessage()); + return 0; + } + } + + public static IBlockState getSaplingFromLeaves(IBlockState leavesBlock) { + + if (leavesBlock == Blocks.LEAVES.getDefaultState()) { + return Blocks.SAPLING.getDefaultState(); + } + else if (leavesBlock == BlockUtil.getStateLeaf(1)) { + return BlockUtil.getStateSapling(1); + } + else if (leavesBlock == BlockUtil.getStateLeaf(2)) { + return BlockUtil.getStateSapling(2); + } + else if (leavesBlock == BlockUtil.getStateLeaf(3)) { + return BlockUtil.getStateSapling(3); + } + else if (leavesBlock == Blocks.LEAVES2.getDefaultState()) { + return BlockUtil.getStateSapling(4); + } + else if (leavesBlock == BlockUtil.getStateLeaf2(1)) { + return BlockUtil.getStateSapling(5); + } + else { + return Blocks.SAPLING.getDefaultState(); + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/util/SimplexCellularNoise.java b/src/api/java/rtg/util/SimplexCellularNoise.java new file mode 100644 index 00000000..fa41419c --- /dev/null +++ b/src/api/java/rtg/util/SimplexCellularNoise.java @@ -0,0 +1,47 @@ +package rtg.util; + +/** + * @author KdotJPG + * + * Generates 2D Simplex-cellular noise. + * + * Simplex-cellular noise is cellular noise implemented using the lattice + * of Simplex noise. + * + * In this case the point contribution determination is implemented using + * a lookup scheme inspired by DigitalShadow's optimized implementation of + * OpenSimplex noise, and a permutation table of size 1024 is used instead + * of the traditional 256. + * + * Each point set is defined as the directions from the center to the + * vertices of the normalized expanded vertex figure of the lattice for + * the given dimensionality. These point sets are symmetric with the + * lattice, but don't include directions that follow edges or facets. + * + * Supports multi-evaluation with F1 and F2 values. + * + * Version 02/05/2015 + */ + +public class SimplexCellularNoise implements CellNoise { + + private SimplexCellularOctave [] octaves = new SimplexCellularOctave [5]; + public final int OCTAVE_COUNT = 5; + + public SimplexCellularNoise(long seed) { + for (int i = 0; i < 5; i++) { + octaves[i]= new SimplexCellularOctave(seed+i); + } + } + + public SimplexCellularOctave octave(int index) { + return octaves[index]; + } + + public SimplexCellularOctave river() {return octave(0);} + + public float noise(double x, double z, double depth) { + return river().noise(x, z, depth); + } + +} diff --git a/src/api/java/rtg/util/SimplexCellularOctave.java b/src/api/java/rtg/util/SimplexCellularOctave.java new file mode 100644 index 00000000..b52b2fe9 --- /dev/null +++ b/src/api/java/rtg/util/SimplexCellularOctave.java @@ -0,0 +1,314 @@ +package rtg.util; + +/** + * @author KdotJPG + * + * Generates 2D Simplex-cellular noise. + * + * Simplex-cellular noise is cellular noise implemented using the lattice + * of Simplex noise. + * + * In this case the point contribution determination is implemented using + * a lookup scheme inspired by DigitalShadow's optimized implementation of + * OpenSimplex noise, and a permutation table of size 1024 is used instead + * of the traditional 256. + * + * Each point set is defined as the directions from the center to the + * vertices of the normalized expanded vertex figure of the lattice for + * the given dimensionality. These point sets are symmetric with the + * lattice, but don't include directions that follow edges or facets. + * + * Supports multi-evaluation with F1 and F2 values. + * + * Version 02/05/2015 + */ + +public class SimplexCellularOctave implements CellOctave { + + private short[] perm; + private short[] perm2D; + private int f1Index = 0; + private int f2Index =1; + + public SimplexCellularOctave(long seed) { + perm = new short[1024]; + perm2D = new short[1024]; + short[] source = new short[1024]; + for (short i = 0; i < 1024; i++) + source[i] = i; + for (int i = 1023; i >= 0; i--) { + seed = seed * 6364136223846793005L + 1442695040888963407L; + int r = (int)((seed + 31) % (i + 1)); + if (r < 0) + r += (i + 1); + perm[i] = source[r]; + perm2D[i] = (short)((perm[i] % 12) * 2); + source[r] = source[i]; + } + } + + /* + * 2D multi-instance evaluation function + */ + + //2D Simplex-Cellular noise (Multi-eval) + private double[] extantX = new double[9]; + private double[] extantY = new double[9]; + private int extant = 0; + private int[] pointIndex = new int[2]; + + private boolean tooClose(double thisX, double thisY) { + + boolean tooClose = false; + for (int j = 0; j < extant; j++) { + double fromX = thisX - extantX[j]; + double fromY = thisY - extantY[j]; + if (fromX*fromX+fromY*fromY<.002) { + return true; + } + } + // not tooClose; add + extantX[extant] = thisX; + extantY[extant++] = thisY; + return tooClose; + } + + private int pointTooClose(double thisX, double thisY) { + // returns the index for the point too close + for (int j = 0; j < extant; j++) { + double fromX = thisX - extantX[j]; + double fromY = thisY - extantY[j]; + if (fromX*fromX+fromY*fromY<.002) { + return j; + } + if (fromX*fromX+fromY*fromY<.004) { + throw new RuntimeException(); + } + } + // not tooClose; add + extantX[extant] = thisX; + extantY[extant] = thisY; + extant ++; + return -1; + } + + private static String otherSide = null; + public static boolean crashing = false; + public static String chunkManagerProblems = ""; + + public double [] eval(double x, double y) { + + extant = 0;// clear the point record + double [] results = new double[2]; + results[0] = Double.POSITIVE_INFINITY; + results[1] = Double.POSITIVE_INFINITY; + // set the found points to not found + pointIndex[0] = -2; + pointIndex[1] = -2; + + //Get points for A2* lattice + double s = 0.366025403784439 * (x + y); + double xs = x + s, ys = y + s; + + String complaint = null; + + //Get base points and offsets + int xsb = fastFloor(xs), ysb = fastFloor(ys); + double xsi = xs - xsb, ysi = ys - ysb; + + //Index to point list + int index = + ((int)(xsi + ysi) * 9) + + ((int)(xsi * 2 - ysi + 1) * 9 * 2) + + ((int)(ysi * 2 - xsi + 1) * 9 * 6); + + //Offsets in input space + double ssi = (xsi + ysi) * -0.211324865405187; + double xi = xsi + ssi, yi = ysi + ssi; + + if (crashing) { + complaint = "" + x; + complaint += " " + y; + complaint += " " + (int)(x*1875.0); + complaint += " " + (int)(y*1875.0); + } + + //Point contributions + for (int i = 0; i < 9; i++) { + LatticePoint2D c = LOOKUP_2D[index + i]; + int pxm = (xsb + c.xsv) & 1023, pym = (ysb + c.ysv) & 1023; + int ji = perm2D[perm[pxm] ^ pym]; + double jx = JITTER_2D[ji + 0], jy = JITTER_2D[ji + 1]; + // suppress points to close to existing ones + //if (tooClose(jx -c.dx,jy - c.dy)) continue; + double djx = jx - (c.dx + xi), + djy = jy - (c.dy + yi); + double distance = Math.sqrt(djx * djx + djy * djy); + + if (crashing) { + complaint += "" + i + " " + (jx -c.dx) + " " + (jy - c.dy) + " " + distance+" "; + } + int closeTo = pointTooClose(jx -c.dx,jy - c.dy); + if (closeTo != -1) { + // just replace existing points if appropriate + if (pointIndex[f1Index] == i) { + if (distance < results[f1Index]) { + results[f1Index] = distance; + pointIndex[f1Index] = i; + } + } + if (pointIndex[f2Index] == i) { + if (distance < results[f1Index]) { + // complicated; the old point was #2 and the new is #1 + results[f2Index] = results[f1Index]; + pointIndex[f2Index] = pointIndex[f1Index]; + results[f1Index] = distance; + pointIndex[f1Index] = i; + } + else if (distance < results[f2Index]) { + results[f2Index] = distance; + pointIndex[f2Index] = i; + } + } + } else { + if (f2Index >= 0) { + if (distance < results[f2Index]) { + results[f2Index] = distance; + pointIndex[f2Index]=i; + if (distance < results[f1Index]) { + results[f2Index] = results[f1Index]; + pointIndex[f2Index] = pointIndex[f1Index]; + results[f1Index] = distance; + pointIndex[f1Index]=i; + } + } + } else if (f1Index >= 0) { + if (distance < results[f1Index]) { + results[f1Index] = distance; + pointIndex[f1Index] = i; + } + } + } + } + + if (crashing) { + complaint += pointIndex[f1Index] + " " + results[f1Index]+ " " ; + complaint += pointIndex[f2Index] + " " + results[f2Index]+ " " ; + if (otherSide == null) { + otherSide = complaint; + } else { + throw new RuntimeException(otherSide + " " +complaint+ " " + chunkManagerProblems); + } + crashing = false; + } + if (results[0]>results[1]) throw new RuntimeException(); + return results; + } + + /* + * Init functions + */ + + public static double[] initResultArray(NoiseInstance2[] instances) { + int max = 0; + for (NoiseInstance2 instance : instances) { + if (instance.f1Index > max) max = instance.f1Index; + if (instance.f2Index > max) max = instance.f2Index; + } + double[] destination = new double[max + 1]; + return destination; + } + + public static void resetResultArray(NoiseInstance2[] instances, double[] results) { + for (NoiseInstance2 instance : instances) { + if (instance.f1Index >= 0) { + results[instance.f1Index] = Double.POSITIVE_INFINITY; + } + if (instance.f2Index >= 0) { + results[instance.f2Index] = Double.POSITIVE_INFINITY; + } + } + } + + /* + * Utility + */ + + private static int fastFloor(double x) { + int xi = (int)x; + return x < xi ? xi - 1 : xi; + } + + /* + * Definitions + */ + + private static final LatticePoint2D[] LOOKUP_2D; + static { + LOOKUP_2D = new LatticePoint2D[18 * 9]; + + for (int i = 0; i < 18; i++) { + int i1, j1, i2, j2, i3, j3, i4, j4, i5, j5; + int a = (i & 1); + int b = (i / 2) % 3; + int c = (i / 6) % 3; + if (a == 0) { i1 = -1; j1 = -1; } else { i1 = 2; j1 = 2; } + if (b < 2) { i2 = -1; j2 = 0; } else { i2 = 2; j2 = 0; } + if (b < 1) { i3 = -1; j3 = 1; } else { i3 = 2; j3 = 1; } + if (c < 2) { i4 = 0; j4 = -1; } else { i4 = 0; j4 = 2; } + if (c < 1) { i5 = 1; j5 = -1; } else { i5 = 1; j5 = 2; } + LOOKUP_2D[i * 9 + 0] = new LatticePoint2D(0, 0); + LOOKUP_2D[i * 9 + 1] = new LatticePoint2D(1, 0); + LOOKUP_2D[i * 9 + 2] = new LatticePoint2D(0, 1); + LOOKUP_2D[i * 9 + 3] = new LatticePoint2D(1, 1); + LOOKUP_2D[i * 9 + 4] = new LatticePoint2D(i1, j1); + LOOKUP_2D[i * 9 + 5] = new LatticePoint2D(i2, j2); + LOOKUP_2D[i * 9 + 6] = new LatticePoint2D(i3, j3); + LOOKUP_2D[i * 9 + 7] = new LatticePoint2D(i4, j4); + LOOKUP_2D[i * 9 + 8] = new LatticePoint2D(i5, j5); + } + } + + //2D Points: Dodecagon + private static final double[] JITTER_2D = new double[] { + 0, 0.408248290463863, + 0.204124145231932, 0.353553390593274, + 0.353553390593274, 0.204124145231932, + 0.408248290463863, 0, + 0.353553390593274, -0.204124145231932, + 0.204124145231932, -0.353553390593274, + 0, -0.408248290463863, + -0.204124145231932, -0.353553390593274, + -0.353553390593274, -0.204124145231932, + -0.408248290463863, 0, + -0.353553390593274, 0.204124145231932, + -0.204124145231932, 0.353553390593274 + }; + + public float noise(double x, double z, double depth) { + return (float)eval(x,z)[0]; + } + + private static class LatticePoint2D { + public int xsv, ysv; + public double dx, dy; + public LatticePoint2D(int xsv, int ysv) { + this.xsv = xsv; this.ysv = ysv; + double ssv = (xsv + ysv) * -0.211324865405187; + this.dx = -xsv - ssv; + this.dy = -ysv - ssv; + } + } + + public static class NoiseInstance2 { + public NoiseInstance2(SimplexCellularOctave noise, int f1Index, + int f2Index) { + this.noise = noise; + this.f1Index = f1Index; + this.f2Index = f2Index; + } + public SimplexCellularOctave noise; + public int f1Index; + public int f2Index; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/util/SimplexOctave.java b/src/api/java/rtg/util/SimplexOctave.java new file mode 100644 index 00000000..c84fe02d --- /dev/null +++ b/src/api/java/rtg/util/SimplexOctave.java @@ -0,0 +1,605 @@ +/** + * Generates OpenSimplex Noise + * + * 2D function lookup-table version by KdotJPG (With new Dodecagonal gradient set) + * 3D function lookup-table version by DigitalShadow (With new normalized expanded cuboctahedral gradient set) + * + * Both implemented using permutation tables of size 1024 instead of the traditional 256. + * + * Includes additional 2D function that supports + * - Simultaneous evaluation of the same point with different seeds + * - First derivatives + * - SPH2-noise (output is a 2D coordinate within a unit disc, rather than a 1D value) + */ + +package rtg.util; + +/** + * @author KdotJPG + * @version $Revision: 1.3$ + * @see https://gist.github.com/KdotJPG/b1270127455a94ac5d19 + */ +@SuppressWarnings("JavadocReference") +public class SimplexOctave { + + private static final double STRETCH_2D = -0.211324865405187; //(1/Math.sqrt(2+1)-1)/2; + private static final double SQUISH_2D = 0.366025403784439; //(Math.sqrt(2+1)-1)/2; + private static final double STRETCH_3D = -1.0 / 6.0; //(1/Math.sqrt(3+1)-1)/3; + private static final double SQUISH_3D = 1.0 / 3.0; //(Math.sqrt(3+1)-1)/3; + + private static final long DEFAULT_SEED = 0; + + private int[] perm; + private int[] perm2D; + private int[] perm2D_sph2; + private int[] perm3D; + + public SimplexOctave() { + this(DEFAULT_SEED); + } + + public SimplexOctave(long seed) { + perm = new int[1024]; + perm2D = new int[1024]; + perm2D_sph2 = new int[1024]; + perm3D = new int[1024]; + int[] source = new int[1024]; + for (int i = 0; i < 1024; i++) { + source[i] = i; + } + for (int i = 1023; i >= 0; i--) { + seed = seed * 6364136223846793005L + 1442695040888963407L; + int r = (int)((seed + 31) % (i + 1)); + if (r < 0) { + r += (i + 1); + } + perm[i] = source[r]; + perm2D[i] = ((perm[i] % 12) * 2); + perm2D_sph2[i] = (((perm[i] / 12) % 12) * 2); + perm3D[i] = ((perm[i] % 48) * 3); + source[r] = source[i]; + } + } + + /* + * Aliases + */ + + //Alias for 1D + public float noise1(float x) { + return (float)noise(x, 0.5); + } + + //Alias for 2D + public float noise2(float x, float y) { + return (float)noise(x, y); + } + + //Alias for 3D + public float noise3(float x, float y, float z) { + return (float)noise(x, y, z); + } + + //Alias for 3D (again) + public double improvedNoise(double x, double y, double z) { + return noise(x, y, z); + } + + /* + * Standard functions + */ + + //2D OpenSimplex noise (KdotJPG) + public double noise(double x, double y) { + double value = 0; + + //Get points for A2 lattice + double s = STRETCH_2D * (x + y); + double xs = x + s, ys = y + s; + + //Get base points and offsets + int xsb = fastFloor(xs), ysb = fastFloor(ys); + double xsi = xs - xsb, ysi = ys - ysb; + + //Index to point list + int a = (int)(ysi - xsi + 1); + int index = + (a << 2) | + (int)(xsi + ysi / 2.0 + a / 2.0) << 3 | + (int)(ysi + xsi / 2.0 + 1.0 / 2.0 - a / 2.0) << 4; + + //Get unskewed offsets. + double ssi = (xsi + ysi) * SQUISH_2D; + double xi = xsi + ssi, yi = ysi + ssi; + + //Point contributions + for (int i = 0; i < 4; i++) { + LatticePoint2D c = LOOKUP_2D[index + i]; + + double dx = xi + c.dx, dy = yi + c.dy; + double attn = 2.0 - dx * dx - dy * dy; + if (attn <= 0) continue; + + int pxm = (xsb + c.xsv) & 1023, pym = (ysb + c.ysv) & 1023; + int gi = perm2D[perm[pxm] ^ pym]; + double extrapolation = GRADIENTS_2D[gi] * dx + + GRADIENTS_2D[gi + 1] * dy; + + attn *= attn; + value += attn * attn * extrapolation; + } + + return value; + } + + //3D OpenSimplex Noise (DigitalShadow) + public double noise(double x, double y, double z) + { + double stretchOffset = (x + y + z) * STRETCH_3D; + double xs = x + stretchOffset; + double ys = y + stretchOffset; + double zs = z + stretchOffset; + + int xsb = fastFloor(xs); + int ysb = fastFloor(ys); + int zsb = fastFloor(zs); + + double squishOffset = (xsb + ysb + zsb) * SQUISH_3D; + double dx0 = x - (xsb + squishOffset); + double dy0 = y - (ysb + squishOffset); + double dz0 = z - (zsb + squishOffset); + + double xins = xs - xsb; + double yins = ys - ysb; + double zins = zs - zsb; + + double inSum = xins + yins + zins; + + int hash = + (int)(yins - zins + 1) | + (int)(xins - yins + 1) << 1 | + (int)(xins - zins + 1) << 2 | + (int)inSum << 3 | + (int)(inSum + zins) << 5 | + (int)(inSum + yins) << 7 | + (int)(inSum + xins) << 9; + + Contribution3 c = LOOKUP_3D[hash]; + + double value = 0.0; + while (c != null) + { + double dx = dx0 + c.dx; + double dy = dy0 + c.dy; + double dz = dz0 + c.dz; + double attn = 2 - dx * dx - dy * dy - dz * dz; + if (attn > 0) + { + int px = xsb + c.xsb; + int py = ysb + c.ysb; + int pz = zsb + c.zsb; + + int i = perm3D[(perm[(perm[px & 0x3FF] ^ py) & 0x3FF] ^ pz) & 0x3FF]; + double valuePart = GRADIENTS_3D[i] * dx + GRADIENTS_3D[i + 1] * dy + GRADIENTS_3D[i + 2] * dz; + + attn *= attn; + value += attn * attn * valuePart; + } + + c = c.next; + } + return value; + } + + /* + * Multi-eval + */ + + //2D OpenSimplex noise Multi-eval (KdotJPG) + public static void noise(double x, double y, NoiseInstance2[] instances, double[] results) { + + //Get points for A2 lattice + double s = STRETCH_2D * (x + y); + double xs = x + s, ys = y + s; + + //Get base points and offsets + int xsb = fastFloor(xs), ysb = fastFloor(ys); + double xsi = xs - xsb, ysi = ys - ysb; + + //Index to point list + int a = (int)(ysi - xsi + 1); + int index = + (a << 2) | + (int)(xsi + ysi / 2.0 + a / 2.0) << 3 | + (int)(ysi + xsi / 2.0 + 1.0 / 2.0 - a / 2.0) << 4; + + //Get unskewed offsets. + double ssi = (xsi + ysi) * SQUISH_2D; + double xi = xsi + ssi, yi = ysi + ssi; + + //Point contributions + for (int i = 0; i < 4; i++) { + LatticePoint2D c = LOOKUP_2D[index + i]; + + double dx = xi + c.dx, dy = yi + c.dy; + double attn = 2.0 - dx * dx - dy * dy; + if (attn <= 0) continue; + double attnSq = attn * attn; + + int pxm = (xsb + c.xsv) & 1023, pym = (ysb + c.ysv) & 1023; + for (NoiseInstance2 instance : instances) { + int gi_p = instance.noise.perm[pxm] ^ pym; + int gi = instance.noise.perm2D[gi_p]; + double gx = GRADIENTS_2D[gi + 0], gy = GRADIENTS_2D[gi + 1]; + double extrapolation = gx * dx + gy * dy; + + if (instance.valueIndex >= 0) { + results[instance.valueIndex] += attnSq * attnSq * extrapolation; + } + if ((instance.ddxIndex & instance.ddyIndex) >= 0) { + if (instance.ddxIndex >= 0) { + results[instance.ddxIndex] += (gx * attn - 8 * dx * extrapolation) * attnSq * attn; + } + if (instance.ddyIndex >= 0) { + results[instance.ddyIndex] += (gy * attn - 8 * dy * extrapolation) * attnSq * attn; + } + } + if ((instance.sph2xIndex & instance.sph2yIndex) >= 0) { + int gi_sph2 = instance.noise.perm2D_sph2[gi_p]; + if (instance.sph2xIndex >= 0) { + results[instance.sph2xIndex] += attnSq * attnSq * extrapolation * GRADIENTS_SPH2[gi_sph2 + 0]; + } + if (instance.sph2yIndex >= 0) { + results[instance.sph2yIndex] += attnSq * attnSq * extrapolation * GRADIENTS_SPH2[gi_sph2 + 1]; + } + } + } + } + } + + public void evaluateNoise(double x, double y, DataStore data) { + + //Get points for A2 lattice + double s = STRETCH_2D * (x + y); + double xs = x + s, ys = y + s; + + //Get base points and offsets + int xsb = fastFloor(xs), ysb = fastFloor(ys); + double xsi = xs - xsb, ysi = ys - ysb; + + //Index to point list + int a = (int)(ysi - xsi + 1); + int index = + (a << 2) | + (int)(xsi + ysi / 2.0 + a / 2.0) << 3 | + (int)(ysi + xsi / 2.0 + 1.0 / 2.0 - a / 2.0) << 4; + + //Get unskewed offsets. + double ssi = (xsi + ysi) * SQUISH_2D; + double xi = xsi + ssi, yi = ysi + ssi; + + // clear data + data.clear(); + //Point contributions + for (int i = 0; i < 4; i++) { + LatticePoint2D c = LOOKUP_2D[index + i]; + + double dx = xi + c.dx, dy = yi + c.dy; + double attn = 2.0 - dx * dx - dy * dy; + if (attn <= 0) continue; + + int pxm = (xsb + c.xsv) & 1023, pym = (ysb + c.ysv) & 1023; + int gi_p = perm[pxm] ^ pym; + int gi = perm2D[gi_p]; + double gx = GRADIENTS_2D[gi + 0], gy = GRADIENTS_2D[gi + 1]; + double extrapolation = gx * dx + gy * dy; + int gi_sph2 = perm2D_sph2[gi_p]; + data.request().record(attn, extrapolation, gx, gy,gi_sph2,dx, dy); + } + } + + /* Data Request scheme + * Outside methods have the ability to create DataStore objects. + * They can know the type of data in them + * SimplexOctave objects can set the data in a DataStore + * + */ + + private interface DataRequest { + abstract void record(double attn,double extrapolation,double gx, double gy, int gi_sph2,double dx, double dy); + } + + abstract public static class DataStore { + // methods not public to indicate outside classes should not use + // can't make private, which would be ideal, becuase of java rules + abstract DataRequest request(); + abstract void clear(); + } + + public static class Disk extends DataStore { + private final DataRequest request; + private double deltax; + private double deltay; + + public Disk() { + super(); + request = new Request(); + } + + @Override + void clear() { + deltax = 0; + deltay = 0; + } + + public final double deltax (){return deltax;} + public final double deltay (){return deltay;} + + DataRequest request() {return request;} + + private class Request implements DataRequest { + public final void record(double attn, double extrapolation, double gx, double gy, int gi_sph2,double dx, double dy) { + double attnSq = attn*attn; + deltax += attnSq * attnSq * extrapolation * GRADIENTS_SPH2[gi_sph2 + 0]; + deltay += attnSq * attnSq * extrapolation * GRADIENTS_SPH2[gi_sph2 + 1]; + + } + } + } + + public static class Derivative extends DataStore { + private final DataRequest request; + private double deltax; + private double deltay; + + public Derivative() { + super(); + request = new Request(); + } + + @Override + void clear() { + deltax = 0; + deltay = 0; + } + + public final double deltax (){return deltax;} + public final double deltay (){return deltay;} + + DataRequest request() {return request;} + + private class Request implements DataRequest { + public final void record(double attn, double extrapolation, double gx, double gy, int gi_sph2,double dx, double dy) { + double attnSq = attn*attn; + deltax += (gx * attn - 8 * dx * extrapolation) * attnSq * attn; + deltay += (gy * attn - 8 * dy * extrapolation) * attnSq * attn; + } + } + } + + public static class Scalar extends DataStore { + private final DataRequest request; + private double value; + + public Scalar() { + super(); + request = new Request(); + } + + @Override + void clear() { + value = 0; + } + + public final double value (){return value;} + + DataRequest request() {return request;} + + private class Request implements DataRequest { + public final void record(double attn, double extrapolation, double gx, double gy, int gi_sph2,double dx, double dy) { + double attnSq = attn*attn; + value += attnSq * attnSq * extrapolation; + } + } + } + + + /* + * Utility + */ + + private static int fastFloor(double x) { + int xi = (int)x; + return x < xi ? xi - 1 : xi; + } + + /* + * Definitions + */ + + private static final LatticePoint2D[] LOOKUP_2D; + private static Contribution3[] LOOKUP_3D; + static { + + //2D (KdotJPG) + LOOKUP_2D = new LatticePoint2D[8 * 4]; + for (int i = 0; i < 8; i++) { + int i1, j1, i2, j2; + if ((i & 1) == 0) { + if ((i & 2) == 0) { i1 = 0; j1 = 0; } else { i1 = 2; j1 = 0; } + if ((i & 4) == 0) { i2 = 1; j2 = -1; } else { i2 = 1; j2 = 1; } + } else { + if ((i & 2) == 0) { i1 = -1; j1 = 1; } else { i1 = 1; j1 = 1; } + if ((i & 4) == 0) { i2 = 0; j2 = 0; } else { i2 = 0; j2 = 2; } + } + LOOKUP_2D[i * 4 + 0] = new LatticePoint2D(1, 0); + LOOKUP_2D[i * 4 + 1] = new LatticePoint2D(0, 1); + LOOKUP_2D[i * 4 + 2] = new LatticePoint2D(i1, j1); + LOOKUP_2D[i * 4 + 3] = new LatticePoint2D(i2, j2); + } + + //3D (DigitalShadow) + int[][] base3D = new int[][] { + new int[] { 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1 }, + new int[] { 2, 1, 1, 0, 2, 1, 0, 1, 2, 0, 1, 1, 3, 1, 1, 1 }, + new int[] { 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 2, 1, 1, 0, 2, 1, 0, 1, 2, 0, 1, 1 } + }; + int[] p3D = new int[] { 0, 0, 1, -1, 0, 0, 1, 0, -1, 0, 0, -1, 1, 0, 0, 0, 1, -1, 0, 0, -1, 0, 1, 0, 0, -1, 1, 0, 2, 1, 1, 0, 1, 1, 1, -1, 0, 2, 1, 0, 1, 1, 1, -1, 1, 0, 2, 0, 1, 1, 1, -1, 1, 1, 1, 3, 2, 1, 0, 3, 1, 2, 0, 1, 3, 2, 0, 1, 3, 1, 0, 2, 1, 3, 0, 2, 1, 3, 0, 1, 2, 1, 1, 1, 0, 0, 2, 2, 0, 0, 1, 1, 0, 1, 0, 2, 0, 2, 0, 1, 1, 0, 0, 1, 2, 0, 0, 2, 2, 0, 0, 0, 0, 1, 1, -1, 1, 2, 0, 0, 0, 0, 1, -1, 1, 1, 2, 0, 0, 0, 0, 1, 1, 1, -1, 2, 3, 1, 1, 1, 2, 0, 0, 2, 2, 3, 1, 1, 1, 2, 2, 0, 0, 2, 3, 1, 1, 1, 2, 0, 2, 0, 2, 1, 1, -1, 1, 2, 0, 0, 2, 2, 1, 1, -1, 1, 2, 2, 0, 0, 2, 1, -1, 1, 1, 2, 0, 0, 2, 2, 1, -1, 1, 1, 2, 0, 2, 0, 2, 1, 1, 1, -1, 2, 2, 0, 0, 2, 1, 1, 1, -1, 2, 0, 2, 0 }; + int[] lookupPairs3D = new int[] { 0, 2, 1, 1, 2, 2, 5, 1, 6, 0, 7, 0, 32, 2, 34, 2, 129, 1, 133, 1, 160, 5, 161, 5, 518, 0, 519, 0, 546, 4, 550, 4, 645, 3, 647, 3, 672, 5, 673, 5, 674, 4, 677, 3, 678, 4, 679, 3, 680, 13, 681, 13, 682, 12, 685, 14, 686, 12, 687, 14, 712, 20, 714, 18, 809, 21, 813, 23, 840, 20, 841, 21, 1198, 19, 1199, 22, 1226, 18, 1230, 19, 1325, 23, 1327, 22, 1352, 15, 1353, 17, 1354, 15, 1357, 17, 1358, 16, 1359, 16, 1360, 11, 1361, 10, 1362, 11, 1365, 10, 1366, 9, 1367, 9, 1392, 11, 1394, 11, 1489, 10, 1493, 10, 1520, 8, 1521, 8, 1878, 9, 1879, 9, 1906, 7, 1910, 7, 2005, 6, 2007, 6, 2032, 8, 2033, 8, 2034, 7, 2037, 6, 2038, 7, 2039, 6 }; + + Contribution3[] contributions3D = new Contribution3[p3D.length / 9]; + for (int i = 0; i < p3D.length; i += 9) { + int[] baseSet = base3D[p3D[i]]; + Contribution3 previous = null, current = null; + for (int k = 0; k < baseSet.length; k += 4) { + current = new Contribution3(baseSet[k], baseSet[k + 1], baseSet[k + 2], baseSet[k + 3]); + if (previous == null) { + contributions3D[i / 9] = current; + } else { + previous.next = current; + } + previous = current; + } + current.next = new Contribution3(p3D[i + 1], p3D[i + 2], p3D[i + 3], p3D[i + 4]); + current.next.next = new Contribution3(p3D[i + 5], p3D[i + 6], p3D[i + 7], p3D[i + 8]); + } + + LOOKUP_3D = new Contribution3[2048]; + for (int i = 0; i < lookupPairs3D.length; i += 2) { + LOOKUP_3D[lookupPairs3D[i]] = contributions3D[lookupPairs3D[i + 1]]; + } + } + + //2D Gradients -- new scheme (Dodecagon) + private static double[] GRADIENTS_2D = new double[] { + 0.114251372530929, 0.065963060686016, + 0.131926121372032, 0.000000000000000, + 0.114251372530929, -0.065963060686016, + 0.065963060686016, -0.114251372530929, + 0.000000000000000, -0.131926121372032, + -0.065963060686016, -0.114251372530929, + -0.114251372530929, -0.065963060686016, + -0.131926121372032, -0.000000000000000, + -0.114251372530929, 0.065963060686016, + -0.065963060686016, 0.114251372530929, + -0.000000000000000, 0.131926121372032, + 0.065963060686016, 0.114251372530929, + }; + + private static final double[] GRADIENTS_SPH2 = new double[] { + 0, 1.000000000000000, + 0.500000000000000, 0.866025403784439, + 0.866025403784439, 0.500000000000000, + 1.000000000000000, 0, + 0.866025403784439, -0.500000000000000, + 0.500000000000000, -0.866025403784439, + 0, -1.000000000000000, + -0.500000000000000, -0.866025403784439, + -0.866025403784439, -0.500000000000000, + -1.000000000000000, 0, + -0.866025403784439, 0.500000000000000, + -0.500000000000000, 0.866025403784439 + }; + + //3D Gradients -- new scheme (Normalized expanded cuboctahedron) + private static double[] GRADIENTS_3D = new double[] { + -0.009192019279820, 0.061948581592974, 0.105513124626310, + 0.061948581592974, -0.009192019279820, 0.105513124626310, + 0.052339395980958, 0.052339395980958, 0.097858646551677, + 0.002784312704445, 0.002784312704445, 0.122636188189934, + -0.009192019279820, 0.105513124626310, 0.061948581592974, + 0.061948581592974, 0.105513124626310, -0.009192019279820, + 0.052339395980958, 0.097858646551677, 0.052339395980958, + 0.002784312704445, 0.122636188189934, 0.002784312704445, + 0.105513124626310, -0.009192019279820, 0.061948581592974, + 0.105513124626310, 0.061948581592974, -0.009192019279820, + 0.097858646551677, 0.052339395980958, 0.052339395980958, + 0.122636188189934, 0.002784312704445, 0.002784312704445, + -0.067278076657600, 0.090991610281865, 0.047427067248529, + -0.090991610281865, 0.067278076657600, -0.047427067248529, + -0.057908021389848, 0.107463104666361, -0.012388770819128, + -0.107463104666361, 0.057908021389848, 0.012388770819128, + -0.067278076657600, 0.047427067248529, 0.090991610281865, + -0.090991610281865, -0.047427067248529, 0.067278076657600, + -0.057908021389848, -0.012388770819128, 0.107463104666361, + -0.107463104666361, 0.012388770819128, 0.057908021389848, + 0.047427067248529, -0.067278076657600, 0.090991610281865, + -0.047427067248529, -0.090991610281865, 0.067278076657600, + -0.012388770819128, -0.057908021389848, 0.107463104666361, + 0.012388770819128, -0.107463104666361, 0.057908021389848, + 0.067278076657600, -0.090991610281865, -0.047427067248529, + 0.090991610281865, -0.067278076657600, 0.047427067248529, + 0.107463104666361, -0.057908021389848, -0.012388770819128, + 0.057908021389848, -0.107463104666361, 0.012388770819128, + 0.067278076657600, -0.047427067248529, -0.090991610281865, + 0.090991610281865, 0.047427067248529, -0.067278076657600, + 0.107463104666361, -0.012388770819128, -0.057908021389848, + 0.057908021389848, 0.012388770819128, -0.107463104666361, + -0.047427067248529, 0.067278076657600, -0.090991610281865, + 0.047427067248529, 0.090991610281865, -0.067278076657600, + -0.012388770819128, 0.107463104666361, -0.057908021389848, + 0.012388770819128, 0.057908021389848, -0.107463104666361, + 0.009192019279820, -0.061948581592974, -0.105513124626310, + -0.061948581592974, 0.009192019279820, -0.105513124626310, + -0.002784312704445, -0.002784312704445, -0.122636188189934, + -0.052339395980958, -0.052339395980958, -0.097858646551677, + 0.009192019279820, -0.105513124626310, -0.061948581592974, + -0.061948581592974, -0.105513124626310, 0.009192019279820, + -0.002784312704445, -0.122636188189934, -0.002784312704445, + -0.052339395980958, -0.097858646551677, -0.052339395980958, + -0.105513124626310, 0.009192019279820, -0.061948581592974, + -0.105513124626310, -0.061948581592974, 0.009192019279820, + -0.122636188189934, -0.002784312704445, -0.002784312704445, + -0.097858646551677, -0.052339395980958, -0.052339395980958 + }; + + private static class LatticePoint2D { + public int xsv, ysv; + public double dx, dy; + public LatticePoint2D(int xsv, int ysv) { + this.xsv = xsv; this.ysv = ysv; + double ssv = (xsv + ysv) * SQUISH_2D; + this.dx = -xsv - ssv; + this.dy = -ysv - ssv; + } + } + + private static class Contribution3 { + public double dx, dy, dz; + public int xsb, ysb, zsb; + public Contribution3 next; + + public Contribution3(double multiplier, int xsb, int ysb, int zsb) { + dx = -xsb - multiplier * SQUISH_3D; + dy = -ysb - multiplier * SQUISH_3D; + dz = -zsb - multiplier * SQUISH_3D; + this.xsb = xsb; + this.ysb = ysb; + this.zsb = zsb; + } + } + + public static class NoiseInstance2 { + public NoiseInstance2(SimplexOctave noise, int valueIndex, + int ddxIndex, int ddyIndex, int sph2xIndex, int sph2yIndex) { + this.noise = noise; + this.valueIndex = valueIndex; + this.ddxIndex = ddxIndex; + this.ddyIndex = ddyIndex; + this.sph2xIndex = sph2xIndex; + this.sph2yIndex = sph2yIndex; + } + public NoiseInstance2(SimplexOctave noise, int valueIndex, + int ddxIndex, int ddyIndex) { + this(noise, valueIndex, ddxIndex, ddyIndex, -1, -1); + } + public NoiseInstance2(SimplexOctave noise, int valueIndex) { + this(noise, valueIndex, -1, -1, -1, -1); + } + public SimplexOctave noise; + public int valueIndex; + public int ddxIndex, ddyIndex; + public int sph2xIndex, sph2yIndex; + } + +} \ No newline at end of file diff --git a/src/api/java/rtg/util/SnowHeightCalculator.java b/src/api/java/rtg/util/SnowHeightCalculator.java new file mode 100644 index 00000000..d34d2698 --- /dev/null +++ b/src/api/java/rtg/util/SnowHeightCalculator.java @@ -0,0 +1,20 @@ +package rtg.util; + +import net.minecraft.block.BlockSnow; +import net.minecraft.init.Blocks; +import net.minecraft.world.chunk.ChunkPrimer; + +public class SnowHeightCalculator { + public static void calc(int x, int y, int z, ChunkPrimer primer, float[] noise) { + if (y < 254) { + byte h = (byte) ((noise[x * 16 + z] - ((int) noise[x * 16 + z])) * 8); + + if (h > 7) { + primer.setBlockState(x, y + 2, z, Blocks.SNOW_LAYER.getDefaultState()); + primer.setBlockState(x, y + 1, z, Blocks.SNOW_LAYER.getDefaultState().withProperty(BlockSnow.LAYERS, 7)); + } else { + primer.setBlockState(x, y + 1, z, Blocks.SNOW_LAYER.getDefaultState().withProperty(BlockSnow.LAYERS, (int) h)); + } + } + } +} diff --git a/src/api/java/rtg/util/Streamer.java b/src/api/java/rtg/util/Streamer.java new file mode 100644 index 00000000..1cdc3958 --- /dev/null +++ b/src/api/java/rtg/util/Streamer.java @@ -0,0 +1,39 @@ + +package rtg.util; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; + +/** + * + * @author Zeno410 + */ +abstract public class Streamer { + + abstract public Type readFrom(DataInput input) throws IOException ; + abstract public void writeTo(Type written, DataOutput output) throws IOException; + + public static Streamer ofString() { + return new Streamer() { + public String readFrom(DataInput input) throws IOException { + return input.readUTF(); + } + public void writeTo(String written,DataOutput output) throws IOException { + output.writeUTF(written); + } + }; + } + + public static Streamer ofInt() { + return new Streamer() { + public Integer readFrom(DataInput input) throws IOException { + return input.readInt(); + } + public void writeTo(Integer written,DataOutput output) throws IOException { + output.writeInt(written); + } + }; + } + +} \ No newline at end of file diff --git a/src/api/java/rtg/util/TerrainMath.java b/src/api/java/rtg/util/TerrainMath.java new file mode 100644 index 00000000..c4e5ab7f --- /dev/null +++ b/src/api/java/rtg/util/TerrainMath.java @@ -0,0 +1,43 @@ +package rtg.util; + +public class TerrainMath +{ + public static double nextX(double x, double d, double s) + { + return x + (s * Math.cos(d * Math.PI / 180.0)); + } + + public static double nextY(double y, double d, double s) + { + return y + (s * Math.sin(d * Math.PI / 180.0)); + } + + public static double dis1(double n1, double n2) + { + return Math.sqrt((n1-n2)*(n1-n2)); + } + + public static double dis2(double x1, double y1, double x2, double y2) + { + return Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); + } + public static double dis2Elliptic(double x1, double y1, double x2, double y2, double fX, double fY) + { + return Math.sqrt((x1-x2)*(x1-x2)/fX*fX + (y1-y2)*(y1-y2)/fY*fY); + } + + public static float lerp(float a, float b, float f) + { + return (a * (1.0f - f)) + (b * f); + } + + public static double dis3(double x1, double y1, double z1, double x2, double y2, double z2) + { + return Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) + (z1-z2)*(z1-z2)); + } + + public static double dirToPoint2(double x1, double y1, double x2, double y2) + { + return Math.atan2((y2 - y1), (x2 - x1)) * 180 / Math.PI; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/util/TimeTracker.java b/src/api/java/rtg/util/TimeTracker.java new file mode 100644 index 00000000..f87458bf --- /dev/null +++ b/src/api/java/rtg/util/TimeTracker.java @@ -0,0 +1,138 @@ + +package rtg.util; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.HashMap; + +import rtg.RTG; + +/** + * A simple utility to track time spent in various procedures. + * Crashes in re-entrant procedures, which is desired + * That would require a much more complex system. + * @author Zeno410 + */ +public class TimeTracker { + + //private boolean started; + private boolean stopped; + private int depth; + private int maxDepth; + private long startTime; + private long stopTime; + private long totalOn = 0; + private long totalOff = 0; + public static final Manager manager = new Manager(); + + public String report () { + return new String(" on proportion "+((float)totalOn/(float)(totalOn+totalOff+1))+ " max depth " + + maxDepth); + } + + public void start() { + //if (started) throw new RuntimeException(); + startTime = System.currentTimeMillis(); + //started = true; + depth++; + if (depth>maxDepth) maxDepth++; + if (stopped) { + totalOff += startTime - stopTime; + stopped = false; + } + } + + public void stop() { + //if (!started) throw new RuntimeException(); + depth--; + if (depth == 0) { + stopTime = System.currentTimeMillis(); + stopped = true; + totalOn += stopTime - startTime; + } + //started = false; + } + + public static class Manager { + private HashMap trackers = new HashMap(); + private Manager() { + RTG.instance.runOnServerClose(runReport()); + } + + private Runnable runReport() { + return new Runnable() { + public void run() { + report(); + } + }; + } + + private TimeTracker tracker(String name) { + TimeTracker result = trackers.get(name); + if (result == null){ + result = new TimeTracker(); + trackers.put(name, result); + } + return result; + } + + public void start(String name) { + tracker(name).start(); + } + + public void stop(String name) { + tracker(name).stop(); + } + + public void report() { + if (trackers.size()<1) return; + StringWriter output = StringWriter.from("TimeUsage.txt"); + for (String name: trackers.keySet()) { + output.accept(name + " " + trackers.get(name).report()); + } + output.done(); + //trackers.clear(); + } + } + +} + +class StringWriter { + BufferedWriter output; + boolean started = false; + + /** Creates a new instance of StringWriter */ + public StringWriter(File file) throws IOException { + output = new BufferedWriter(new FileWriter(file)); + } + + public static StringWriter from(File file) { + try{ return new StringWriter(file);} + catch (IOException e) {throw new RuntimeException();} + } + + public static StringWriter from(String fileName) { + return StringWriter.from(new File(fileName)); + } + + public void accept(String written) { + try { + if (started) output.write('\r'); + started = true; + output.write(written); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + } + + public void done() { + try { + output.flush(); + output.close(); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/util/TimedHashMap.java b/src/api/java/rtg/util/TimedHashMap.java new file mode 100644 index 00000000..219018a4 --- /dev/null +++ b/src/api/java/rtg/util/TimedHashMap.java @@ -0,0 +1,136 @@ + +package rtg.util; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +/** + * + * @author Zeno410 + */ +public class TimedHashMap implements Map { + private final int holdMillis; + private Map map = new HashMap(); + private LinkTail link = new LinkTail(); + + + public TimedHashMap(int holdTicks) { + this.holdMillis = holdTicks; + } + + public int size() { + return map.size(); + } + + public boolean isEmpty() { + return map.isEmpty(); + } + + public boolean containsKey(Object arg0) { + clearEntries(); + return map.containsKey(arg0); + } + + public boolean containsValue(Object arg0) { + clearEntries(); + return map.containsValue(arg0); + } + + public Value get(Object arg0) { + clearEntries(); + return map.get(arg0); + } + + public Value put(Key arg0, Value arg1) { + clearEntries(); + // if we already have the key replace value; + if (map.containsKey(arg0)) return map.put(arg0, arg1); + this.link.add(arg0); + return map.put(arg0, arg1); + } + + public Value remove(Object arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void putAll(Map arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void clear() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Set keySet() { + clearEntries(); + return map.keySet(); + } + + public Collection values() { + clearEntries(); + return map.values(); + } + + public Set> entrySet() { + clearEntries(); + return map.entrySet(); + } + + private synchronized void clearEntries() { + link.clear();; + } + + abstract class LinkEntry { + LinkEntry next; + abstract boolean old(); + abstract void remove(); + } + + + class LinkTail extends LinkEntry { + LinkEntry latest; + LinkTail() { + this.latest = this; + this.next = this; + } + boolean old() {return false;} + void remove() {throw new RuntimeException();} + void clear() { + while (next.old()) { + next.remove(); + next = next.next; + } + } + void add(Key added) { + LinkEntry toAdd = new Timed(added); + toAdd.next = this; + latest.next = toAdd; + latest = toAdd; + } + } + + @SuppressWarnings("hiding") + class Timed extends LinkEntry { + final long time; + final Key timed; + Timed(Key timed) { + this.timed = timed; + time = System.currentTimeMillis(); + } + + void remove() { + map.remove(timed); + } + + @Override + boolean old() { + return (time + holdMillis implements Set { + private final int holdMillis; + private Set map = new HashSet(); + private LinkTail link = new LinkTail(); + + public TimedHashSet(int holdTicks) { + this.holdMillis = holdTicks; + } + public int size() { + return map.size(); + } + + public boolean isEmpty() { + return map.isEmpty(); + } + + public boolean contains(Object arg0) { + clearEntries(); + return map.contains(arg0); + } + + public Iterator iterator() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Object[] toArray() { + return map.toArray(); + } + + public T[] toArray(T[] arg0) { + return map.toArray(arg0); + } + + public boolean add(Type arg0) { + clearEntries(); + // if we already have the key replace value; + return map.add(arg0); + } + + public boolean remove(Object arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean containsAll(Collection arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean addAll(Collection arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean retainAll(Collection arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean removeAll(Collection arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void clear() { + throw new UnsupportedOperationException("Not supported yet."); + } + + private synchronized void clearEntries() { + link.clear();; + } + + private abstract class LinkEntry { + LinkEntry next; + abstract boolean old(); + abstract void remove(); + } + + private class LinkTail extends LinkEntry { + LinkEntry latest; + LinkTail() { + this.latest = this; + this.next = this; + } + boolean old() {return false;} + void remove() {throw new RuntimeException();} + void clear() { + while (next.old()) { + next.remove(); + next = next.next; + } + } + void add(Type added) { + LinkEntry toAdd = new Timed(added); + toAdd.next = this; + latest.next = toAdd; + latest = toAdd; + } + } + + private class Timed extends LinkEntry { + final long time; + final Key timed; + Timed(Key timed) { + this.timed = timed; + time = System.currentTimeMillis(); + } + + void remove() { + map.remove(timed); + } + + @Override + boolean old() { + return (time + holdMillis. + * + */ +package rtg.util; + +import java.util.Random; + +/** + * This is a Voronoi noise generator, originally from https://github.com/TJHJava/libnoiseforjava + * It was modified to work in a similar way to the bukkit noise generators, and to support + * octaves and 2d noise, + * + * by mncat77 and jtjj222. <---------- + */ +public class VoronoiCellOctave implements CellOctave +{ + private static final double SQRT_2 = 1.4142135623730950488; + private static final double SQRT_3 = 1.7320508075688772935; + + private boolean useDistance = false; + + private long seed; + private long ySeed; + private long zSeed; + private short distanceMethod; + + + public VoronoiCellOctave(long seed, short distanceMethod, boolean useDistance){ + this.seed = seed; + ySeed = new Random(seed).nextLong(); + zSeed = new Random(ySeed).nextLong(); + this.distanceMethod = distanceMethod; + this.useDistance = useDistance; + } + + private double distance(double xDist, double zDist) + { + return Math.sqrt(xDist * xDist + zDist * zDist); + } + + private double getDistance2D(double xDist, double zDist) + { + switch(distanceMethod) + { + case 0: + return Math.sqrt(xDist * xDist + zDist * zDist) / SQRT_2; + case 1: + return xDist + zDist; + default: + return Double.NaN; + } + } + + private double getDistance(double xDist, double yDist, double zDist) + { + switch(distanceMethod) + { + case 0: + return Math.sqrt(xDist * xDist + yDist * yDist + zDist * zDist) / SQRT_3; //Approximation (for speed) of elucidean (regular) distance + case 1: + return xDist + yDist + zDist; + default: + return Double.NaN; + } + } + + public boolean isUseDistance() + { + return useDistance; + } + + public void setUseDistance(boolean useDistance) + { + this.useDistance = useDistance; + } + + public short getDistanceMethod() + { + return distanceMethod; + } + + public long getSeed() + { + return seed; + } + + public void setDistanceMethod(short distanceMethod) + { + this.distanceMethod = distanceMethod; + } + + public void setSeed(long seed) + { + this.seed = seed; + ySeed = new Random(seed).nextLong(); + zSeed = new Random(ySeed).nextLong(); + } + + public float noise(double x, double z, double frequency) + { + x *= frequency; + z *= frequency; + + int xInt = (x > .0? (int)x: (int)x - 1); + int zInt = (z > .0? (int)z: (int)z - 1); + + double minDist = 32000000.0; + + double xCandidate = 0; + double zCandidate = 0; + + for(int zCur = zInt - 2; zCur <= zInt + 2; zCur++) + { + for(int xCur = xInt - 2; xCur <= xInt + 2; xCur++) + { + + double xPos = xCur + valueNoise2D(xCur, zCur, seed); + double zPos = zCur + valueNoise2D(xCur, zCur, zSeed); + double xDist = xPos - x; + double zDist = zPos - z; + double dist = xDist * xDist + zDist * zDist; + + if(dist < minDist) + { + minDist = dist; + xCandidate = xPos; + zCandidate = zPos; + } + } + } + + if (useDistance) + { + double xDist = xCandidate - x; + double zDist = zCandidate - z; + return (float)getDistance2D(xDist, zDist); + } + + else return ((float)valueNoise2D ( + (int)(Math.floor (xCandidate)), + (int)(Math.floor (zCandidate)), seed)); + } + + public float border2(double x, double z, double width, float depth) + { + x *= 1D; + z *= 1D; + + int xInt = (x > .0? (int)x: (int)x - 1); + int zInt = (z > .0? (int)z: (int)z - 1); + + double dCandidate = 32000000.0; + double xCandidate = 0; + double zCandidate = 0; + + double dNeighbour = 32000000.0; + double xNeighbour = 0; + double zNeighbour = 0; + + double xPos, zPos, xDist, zDist, dist; + for(int zCur = zInt - 2; zCur <= zInt + 2; zCur++) + { + for(int xCur = xInt - 2; xCur <= xInt + 2; xCur++) + { + xPos = xCur + valueNoise2D(xCur, zCur, seed); + zPos = zCur + valueNoise2D(xCur, zCur, zSeed); + xDist = xPos - x; + zDist = zPos - z; + dist = distance(xPos - x, zPos - z); + + if(dist < dCandidate) + { + dNeighbour = dCandidate; + xNeighbour = xCandidate; + zNeighbour = zCandidate; + + dCandidate = dist; + xCandidate = xPos; + zCandidate = zPos; + } + else if(dist > dCandidate && dist < dNeighbour) + { + dNeighbour = dist; + xNeighbour = xPos; + zNeighbour = zPos; + } + } + } + + //double diff = distance(xCandidate - xNeighbour, zCandidate - zNeighbour); + //double total = (dCandidate + dNeighbour) / diff; + + //dCandidate = dCandidate / total; + //dNeighbour = dNeighbour / total; + + //double c = (diff / 2D) - dCandidate; + double c = (dNeighbour - dCandidate)/dNeighbour; + if(c < width) + { + return (((float)(c / width)) - 1f) * depth; + } + else + { + return 0f; + } + } + + public double[] eval (double x, double z) + { + + int xInt = (x > .0? (int)x: (int)x - 1); + int zInt = (z > .0? (int)z: (int)z - 1); + + double dCandidate = 32000000.0; + double xCandidate = 0; + double zCandidate = 0; + + double dNeighbour = 32000000.0; + double xNeighbour = 0; + double zNeighbour = 0; + + for(int zCur = zInt - 2; zCur <= zInt + 2; zCur++) + { + for(int xCur = xInt - 2; xCur <= xInt + 2; xCur++) + { + + double xPos = xCur + valueNoise2D(xCur, zCur, seed); + double zPos = zCur + valueNoise2D(xCur, zCur, zSeed); + double xDist = xPos - x; + double zDist = zPos - z; + double dist = xDist * xDist + zDist * zDist; + //double dist = getDistance2D(xPos - x, zPos - z); + + if(dist < dCandidate) + { + dNeighbour = dCandidate; + dCandidate = dist; + + /*dNeighbour = dCandidate; + xNeighbour = xCandidate; + zNeighbour = zCandidate; + + dCandidate = dist; + xCandidate = xPos; + zCandidate = zPos;*/ + } + else if(dist < dNeighbour) + { + dNeighbour = dist; + } + } + } + + //double c = getDistance2D(xNeighbour - x, zNeighbour - z) - getDistance2D(xCandidate - x, zCandidate - z); + double [] result= new double [2]; + result [0] = dCandidate ; + result [1] = dNeighbour; + return result; + } + + public double noise(double x, double y, double z, double frequency) + { + // Inside each unit cube, there is a seed point at a random position. Go + // through each of the nearby cubes until we find a cube with a seed point + // that is closest to the specified position. + x *= frequency; + y *= frequency; + z *= frequency; + + int xInt = (x > .0? (int)x: (int)x - 1); + int yInt = (y > .0? (int)y: (int)y - 1); + int zInt = (z > .0? (int)z: (int)z - 1); + + double minDist = 32000000.0; + + double xCandidate = 0; + double yCandidate = 0; + double zCandidate = 0; + + Random rand = new Random(seed); + + for(int zCur = zInt - 2; zCur <= zInt + 2; zCur++) { + for(int yCur = yInt - 2; yCur <= yInt + 2; yCur++) { + for(int xCur = xInt - 2; xCur <= xInt + 2; xCur++) { + // Calculate the position and distance to the seed point inside of + // this unit cube. + + double xPos = xCur + valueNoise3D (xCur, yCur, zCur, seed); + double yPos = yCur + valueNoise3D (xCur, yCur, zCur, ySeed); + double zPos = zCur + valueNoise3D (xCur, yCur, zCur, zSeed); + double xDist = xPos - x; + double yDist = yPos - y; + double zDist = zPos - z; + double dist = xDist * xDist + yDist * yDist + zDist * zDist; + + if(dist < minDist) { + // This seed point is closer to any others found so far, so record + // this seed point. + minDist = dist; + xCandidate = xPos; + yCandidate = yPos; + zCandidate = zPos; + } + } + } + } + + if (useDistance) + { + double xDist = xCandidate - x; + double yDist = yCandidate - y; + double zDist = zCandidate - z; + + return getDistance(xDist, yDist, zDist); + } + + else return ((double)valueNoise3D ( + (int)(Math.floor (xCandidate)), + (int)(Math.floor (yCandidate)), + (int)(Math.floor (zCandidate)), seed)); + + } + + /** + * To avoid having to store the feature points, we use a hash function + * of the coordinates and the seed instead. Those big scary numbers are + * arbitrary primes. + */ + public static double valueNoise2D (int x, int z, long seed) + { + long n = (1619 * x + 6971 * z + 1013 * seed) & 0x7fffffff; + n = (n >> 13) ^ n; + return 1.0 - ((double)((n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff) / 1073741824.0); + } + + public static double valueNoise3D (int x, int y, int z, long seed) + { + long n = (1619 * x + 31337 * y + 6971 * z + 1013 * seed) & 0x7fffffff; + n = (n >> 13) ^ n; + return 1.0 - ((double)((n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff) / 1073741824.0); + } + +} \ No newline at end of file diff --git a/src/api/java/rtg/util/WeakHashCache.java b/src/api/java/rtg/util/WeakHashCache.java new file mode 100644 index 00000000..0debe679 --- /dev/null +++ b/src/api/java/rtg/util/WeakHashCache.java @@ -0,0 +1,59 @@ + +package rtg.util; + +import java.lang.ref.WeakReference; +import java.util.WeakHashMap; + +/** + * NOT CURRENTLY FUNCTIONAL + * + * This is a complex class to achieve the goal of a HashMap where the objects are + * held with weak references and so can be garbage collected + * + * IMPORTANT IMPORTANT IMPORTANT + * The Key class must be "keyable", meaning that two different objects with the same date + * will return "equal" and will have the same hashvalue. Otherwise you'll never be able + * to get the values out! The Java Number classes and String are all keyable, BTW. + * @author Zeno410 + */ +public class WeakHashCache { + + // we make our own + private final Converter keyer; + + // this map forces the garbage collector to keep the keys around as long as + // the values still exist + private WeakHashMap storageIndicator = new WeakHashMap(); + + // this map can retrieve the values if they're still around but doesn't stop + // the garbage collector from tossing them. It also lets the keys be GC'd, which + // is stopped if need by their existence in storageIndicator; + + private WeakHashMap> mapping = + new WeakHashMap>(); + + public WeakHashCache(Converter keyer) { + this.keyer = keyer; + } + + public int size() {return storageIndicator.size();} + + public static class ValueMissing extends Exception { + // this class exists to force clients to pay attention to missing values; + } + + public void cache(Value value) { + Key key = keyer.of(value); + storageIndicator.put(value, key); + mapping.put(key, new WeakReference(value)); + } + + public Value get(Key key) throws ValueMissing { + WeakReference reference = mapping.get(key); + if (reference != null) { + Value result = reference.get(); + if (result != null) return result; + } + throw new ValueMissing(); + } +} diff --git a/src/api/java/rtg/util/WorldUtil.java b/src/api/java/rtg/util/WorldUtil.java new file mode 100644 index 00000000..d44b35de --- /dev/null +++ b/src/api/java/rtg/util/WorldUtil.java @@ -0,0 +1,132 @@ +package rtg.util; + +import java.util.Random; + +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class WorldUtil { + + private World world; + + public WorldUtil(World world) { + + this.world = world; + } + + /** + * Checks a given coordinate to see if it is surrounded by a given block, usually air. + * This method only checks along the same Y coord. + */ + public boolean isSurroundedByBlock(IBlockState checkBlock, int checkDistance, SurroundCheckType checkType, Random rand, int x, int y, int z) { + + switch (checkType) { + case FULL: // Checks the entire radius around the coord. + + for (int ix = -checkDistance; ix <= checkDistance; ix++) { + for (int iz = -checkDistance; iz <= checkDistance; iz++) { + + if (x == ix && z == iz) { + continue; + } + + if (this.world.getBlockState(new BlockPos(x + ix, y, z + iz)) != checkBlock) { + return false; + } + } + } + + break; + + case CARDINAL: // Checks the N/E/S/W directions around the coord. + + for (int i = checkDistance; i > 0; i--) { + + if (this.world.getBlockState(new BlockPos(x, y, z + i)) != checkBlock) { + return false; + } + if (this.world.getBlockState(new BlockPos(x, y, z - i)) != checkBlock) { + return false; + } + if (this.world.getBlockState(new BlockPos(x + i, y, z)) != checkBlock) { + return false; + } + if (this.world.getBlockState(new BlockPos(x - i, y, z)) != checkBlock) { + return false; + } + } + + break; + + case ORDINAL: // Checks the NE/SE/SW/NW directions around the coord. + + for (int i = checkDistance; i > 0; i--) { + + if (this.world.getBlockState(new BlockPos(x + i, y, z + i)) != checkBlock) { + return false; + } + if (this.world.getBlockState(new BlockPos(x + i, y, z - i)) != checkBlock) { + return false; + } + if (this.world.getBlockState(new BlockPos(x - i, y, z + i)) != checkBlock) { + return false; + } + if (this.world.getBlockState(new BlockPos(x - i, y, z - i)) != checkBlock) { + return false; + } + } + + break; + + default: + break; + } + + return true; + } + + /** + * Checks to see if a given block is above a given coordinate. + */ + public boolean isBlockAbove(IBlockState checkBlock, int checkDistance, World world, int x, int y, int z, boolean materialCheck) { + + Material checkBlockMaterial = checkBlock.getMaterial(); + IBlockState blockAbove; + Material m; + + for (int i = 1; i <= checkDistance; i++) { + + blockAbove = world.getBlockState(new BlockPos(x, y + checkDistance, z)); + + if (materialCheck) { + m = blockAbove.getMaterial(); + if (m != checkBlockMaterial) { + return false; + } + } + else if (blockAbove != checkBlock) { + return false; + } + } + + return true; + } + + public void setDoublePlant(BlockPos lowerPos, IBlockState doublePlant, int flag) { + this.world.setBlockState(lowerPos, doublePlant.withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.LOWER), flag); + this.world.setBlockState(lowerPos.up(), doublePlant.withProperty(BlockDoublePlant.HALF, BlockDoublePlant.EnumBlockHalf.UPPER), flag); + } + + public void setDoublePlant(BlockPos lowerPos, IBlockState doublePlant) { + this.setDoublePlant(lowerPos, doublePlant, 2); + } + + public enum SurroundCheckType { + FULL, + CARDINAL, + ORDINAL + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/WorldTypeRTG.java b/src/api/java/rtg/world/WorldTypeRTG.java new file mode 100644 index 00000000..26201a45 --- /dev/null +++ b/src/api/java/rtg/world/WorldTypeRTG.java @@ -0,0 +1,87 @@ +package rtg.world; + +import javax.annotation.Nonnull; + +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.BiomeProvider; +import net.minecraft.world.chunk.IChunkGenerator; +import net.minecraft.world.gen.ChunkProviderOverworld; + +import rtg.RTG; +import rtg.world.biome.BiomeProviderRTG; +import rtg.world.gen.ChunkProviderRTG; + +public class WorldTypeRTG extends WorldType +{ + + private static BiomeProviderRTG biomeProvider; + public static ChunkProviderRTG chunkProvider; + + public WorldTypeRTG(String name) + { + super(name); + } + + @Override @Nonnull + public BiomeProvider getBiomeProvider(@Nonnull World world) + { + if (world.provider.getDimension() == 0) + { + if (biomeProvider == null) { + + biomeProvider = new BiomeProviderRTG(world, this); + RTG.instance.runOnNextServerCloseOnly(clearProvider(biomeProvider)); + } + return biomeProvider; + } + else + { + return new BiomeProvider(world.getWorldInfo()); + } + } + + @Override @Nonnull + public IChunkGenerator getChunkGenerator(@Nonnull World world, String generatorOptions) + { + if (world.provider.getDimension() == 0) { + + if (chunkProvider == null) { + chunkProvider = new ChunkProviderRTG(world, world.getSeed()); + RTG.instance.runOnNextServerCloseOnly(clearProvider(chunkProvider)); + + // inform the event manager about the ChunkEvent.Load event + RTG.eventMgr.setDimensionChunkLoadEvent(world.provider.getDimension(), chunkProvider.delayedDecorator); + RTG.instance.runOnNextServerCloseOnly(chunkProvider.clearOnServerClose()); + + return chunkProvider; + } + + // return a "fake" provider that won't decorate for Streams + ChunkProviderRTG result = new ChunkProviderRTG(world, world.getSeed()); + result.isFakeGenerator(); + + return result; + + // no server close because it's not supposed to decorate + //return chunkProvider; + } + else return new ChunkProviderOverworld( + world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions + ); + } + + @Override + public float getCloudHeight() + { + return 256F; + } + + private static Runnable clearProvider(Object provider) { + if (provider instanceof BiomeProviderRTG) + return () -> biomeProvider = null; + else if (provider instanceof ChunkProviderRTG) + return () -> chunkProvider = null; + else return null; + } +} diff --git a/src/api/java/rtg/world/biome/BiomeAnalyzer.java b/src/api/java/rtg/world/biome/BiomeAnalyzer.java new file mode 100644 index 00000000..0063d1fe --- /dev/null +++ b/src/api/java/rtg/world/biome/BiomeAnalyzer.java @@ -0,0 +1,494 @@ + +package rtg.world.biome; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.BiomeDictionary; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.CircularSearchCreator; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.biome.realistic.RealisticBiomePatcher; + + +/** + * @author Zeno410, Modified by srs_bsns 20160914 + */ +public class BiomeAnalyzer { + private boolean [] riverBiome; + private boolean [] oceanBiome; + private boolean [] swampBiome; + private boolean [] beachBiome; + private boolean [] landBiome; + private int [] preferredBeach; + private RealisticBiomeBase [] savedJittered; + private RealisticBiomeBase scenicLakeBiome = RealisticBiomeBase.getBiome(ConfigRTG.scenicLakeBiome); + private RealisticBiomeBase scenicFrozenLakeBiome = RealisticBiomeBase.getBiome(ConfigRTG.scenicFrozenLakeBiome); + private SmoothingSearchStatus beachSearch; + private SmoothingSearchStatus landSearch; + private SmoothingSearchStatus oceanSearch; + private final static int NO_BIOME = -1; + private RealisticBiomePatcher biomePatcher = new RealisticBiomePatcher(); + + public BiomeAnalyzer() { + determineRiverBiomes(); + determineOceanBiomes(); + determineSwampBiomes(); + determineBeachBiomes(); + determineLandBiomes(); + setupBeachesForBiomes(); + prepareSearchPattern(); + setSearches(); + savedJittered = new RealisticBiomeBase[256]; + } + + public int[] xyinverted() { + + int [] result = new int [256]; + + for (int i = 0; i < 16; i++) { + for (int j = 0; j < 16; j++) { + result[i * 16 + j] = j * 16 + i; + } + } + + for (int i = 0; i < 256; i++) { + if (result[result[i]] != i) throw new RuntimeException("" + i + " " + result[i] + " " + result[result[i]]); + } + + return result; + } + + /** + * + * @author Zeno410, Modified by srs_bsns 20160914 + */ + private class SmoothingSearchStatus + { + boolean absent = false; + boolean notHunted; + private int size() {return 3;} + private int [] findings = new int [3*3]; + // weightings is part of a system to generate some variability in repaired chunks weighting is + // based on how long the search went on (so quasipsuedorandom, based on direction plus distance + private float [] weightings = new float [3*3]; + public int [] biomes = new int [256]; + private boolean [] desired; + private int arraySize; + private int [] pattern; + private final int upperLeftFinding = 0; + private final int upperRightFinding = 3; + private final int lowerLeftFinding = 1; + private final int lowerRightFinding = 4; + private final int [] quadrantBiome = new int[4]; + private final float [] quadrantBiomeWeighting = new float [4]; + private int biomeCount; + private int [] xyinverted = xyinverted(); + + SmoothingSearchStatus(boolean[] desired) { this.desired = desired; } + + void hunt(int[] biomeNeighborhood) { + // 0,0 in the chunk is 9,9 int the array ; 8,8 is 10,10 and is treated as the center + clear(); + int oldArraySize = arraySize; + arraySize = (int)Math.sqrt(biomeNeighborhood.length); + if (arraySize*arraySize != biomeNeighborhood.length) + throw new RuntimeException("non-square array"); + if (arraySize != oldArraySize) + pattern = new CircularSearchCreator().pattern(arraySize/2-1, arraySize); + for (int xOffset = -1; xOffset<=1; xOffset++) + for (int zOffset = -1; zOffset<=1; zOffset++) + search(xOffset,zOffset, biomeNeighborhood); + // calling a routine because it gets too indented otherwise + smoothBiomes(); + } + + private void search(int xOffset, int zOffset, int [] biomeNeighborhood) { + int offset = xOffset*arraySize +zOffset; + int location = (xOffset+1)*size()+zOffset+1; + // set to failed search, which sticks if nothing is found + findings[location] = NO_BIOME; + weightings[location] = 2f; + for (int i = 0; i < pattern.length; i++) { + int biome = biomeNeighborhood[pattern[i]+offset]; + if (desired[biome]) { + findings[location]=biome; + weightings[location] = (float)Math.sqrt(pattern.length) -(float)Math.sqrt(i) + 2f ; + break; + } + } + } + + private void smoothBiomes() { + // more sophisticated version offsets into findings and biomes upperleft + smoothQuadrant(biomeIndex(0,0),upperLeftFinding); + smoothQuadrant(biomeIndex(8,0),upperRightFinding); + smoothQuadrant(biomeIndex(0,8),lowerLeftFinding); + smoothQuadrant(biomeIndex(8,8),lowerRightFinding); + } + + private void smoothQuadrant(int biomesOffset, int findingsOffset) { + int upperLeft = findings[upperLeftFinding+findingsOffset]; + int upperRight = findings[upperRightFinding+findingsOffset]; + int lowerLeft = findings[lowerLeftFinding+findingsOffset]; + int lowerRight = findings[lowerRightFinding+findingsOffset]; + // check for uniformity + if ((upperLeft == upperRight)&&(upperLeft == lowerLeft)&&(upperLeft == lowerRight)){ + // everythings the same; uniform fill; + for (int x = 0; x<8;x++) + for (int z =0; z<8;z++) + biomes[biomeIndex(x,z)+biomesOffset] = upperLeft; + return; + } + // not all the same; we have to work; + biomeCount = 0; + addBiome(upperLeft); + addBiome(upperRight); + addBiome(lowerLeft); + addBiome(lowerRight); + for (int x = 0; x<8; x++) { + for (int z= 0; z<8; z++) { + addBiome(lowerRight); + for (int i = 0; i < 4; i ++) quadrantBiomeWeighting[i] = 0; + // weighting strategy: weights go down as you move away from the corner. + // they go to 0 on the far edges so only the points on the edge have effects there + // for continuity with the next quadrant + addWeight(upperLeft,weightings[upperLeftFinding+findingsOffset]*(7-x)*(7-z)); + addWeight(upperRight,weightings[upperRightFinding+findingsOffset]*x*(7-z)); + addWeight(lowerLeft,weightings[lowerLeftFinding+findingsOffset]*(7-x)*z); + addWeight(lowerRight,weightings[lowerRightFinding+findingsOffset]*x*z); + biomes[biomeIndex(x,z)+biomesOffset] = preferredBiome(); + } + } + } + + private void addBiome(int biome) { + for (int i = 0; i < biomeCount; i++) + if (biome == quadrantBiome[i]) return; + // not there, add + quadrantBiome[biomeCount++] = biome; + } + + private void addWeight(int biome, float weight) { + for (int i = 0; i bestWeight) { + bestWeight =quadrantBiomeWeighting[i]; + result = quadrantBiome[i]; + } + } + return result; + } + + private int biomeIndex(int x, int z) + { + return x*16+z; + } + + private void clear() + { + for (int i = 0;i (1.0f + 0.5f) && temp > 0.05f) || isTaigaBiome(biome)) { + beach = Biomes.STONE_BEACH; + } + + // Snowy biomes should always use cold beach; otherwise, the transition looks too abrupt. + if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY)) { + beach = Biomes.COLD_BEACH; + } + + return beach; + } + + private static boolean isTaigaBiome(Biome biome) { + return BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.COLD) + && BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.CONIFEROUS) + && BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST) + && !BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SNOWY); + } + + /* HUNTING + * + */ + + public void newRepair(int [] genLayerBiomes, RealisticBiomeBase [] jitteredBiomes, int [] biomeNeighborhood, int neighborhoodSize, float [] noise, float [] riverStrength) { + + int sampleSize = 8; + RealisticBiomeBase realisticBiome; + int realisticBiomeId; + if (neighborhoodSize != sampleSize) throw new RuntimeException("mismatch between chunk and analyzer neighborhood sizes"); + + // currently just stuffs the genLayer into the jitter; + for (int i = 0; i < 256; i++) { + + realisticBiome = RealisticBiomeBase.getBiome(genLayerBiomes[i]); + // Do we need to patch the biome? + if (realisticBiome == null) { + realisticBiome = biomePatcher.getPatchedRealisticBiome( + "NULL biome (" + i + ") found when performing new repair."); + } + realisticBiomeId = Biome.getIdForBiome(realisticBiome.baseBiome); + + boolean canBeRiver = riverStrength[i] > 0.7; + + // save what's there since the jitter keeps changing + savedJittered[i] = jitteredBiomes[i]; + //if (savedJittered[i]== null) throw new RuntimeException(); + + if (noise[i] > 61.5) { + // replace + jitteredBiomes[i] = realisticBiome; + } else { + // check for river + if (canBeRiver && !oceanBiome[realisticBiomeId] && !swampBiome[realisticBiomeId]) { + // make river + int riverBiomeID = Biome.getIdForBiome(realisticBiome.riverBiome); + jitteredBiomes[i] = RealisticBiomeBase.getBiome(riverBiomeID); + } else { + // replace + jitteredBiomes[i] = realisticBiome; + } + } + } + + // put beaches on shores + beachSearch.notHunted = true; + beachSearch.absent = false; + float beachTop = 64.5f; + for (int i = 0; i < 256; i++) { + if (beachSearch.absent) break; //no point + float beachBottom = 61.5f; + if (noise[i]< beachBottom ||noise[i]>riverAdjusted(beachTop,riverStrength[i])) continue;// this block isn't beach level + int biomeID = Biome.getIdForBiome(jitteredBiomes[i].baseBiome); + if (swampBiome[biomeID]) continue;// swamps are acceptable at beach level + if (beachSearch.notHunted) { + beachSearch.hunt(biomeNeighborhood); + landSearch.hunt(biomeNeighborhood); + } + int foundBiome = beachSearch.biomes[i]; + if (foundBiome != NO_BIOME) { + int nearestLandBiome = landSearch.biomes[i]; + if (nearestLandBiome>-1) { + foundBiome = preferredBeach[nearestLandBiome]; + } + + realisticBiome = RealisticBiomeBase.getBiome(foundBiome); + // Do we need to patch the biome? + if (realisticBiome == null) { + realisticBiome = biomePatcher.getPatchedRealisticBiome( + "NULL biome (" + i + ") found when performing new repair."); + } + jitteredBiomes[i] = realisticBiome; + } + } + + // put land higher up; + landSearch.absent = false; + landSearch.notHunted = true; + for (int i = 0; i < 256; i++) { + if (landSearch.absent) break; //no point + // this block isn't above beach level + if (noise[i] < riverAdjusted(beachTop, riverStrength[i])) continue; + int biomeID = Biome.getIdForBiome(jitteredBiomes[i].baseBiome); + // already land + if (landBiome[biomeID]) continue; + // swamps are acceptable above water + if (swampBiome[biomeID]) continue; + if (landSearch.notHunted) landSearch.hunt(biomeNeighborhood); + int foundBiome = landSearch.biomes[i]; + + if (foundBiome != NO_BIOME) { + + realisticBiome = RealisticBiomeBase.getBiome(foundBiome); + // Do we need to patch the biome? + if (realisticBiome == null) { + realisticBiome = biomePatcher.getPatchedRealisticBiome( + "NULL biome (" + i + ") found when performing new repair."); + } + jitteredBiomes[i] = realisticBiome; + } + } + + // put ocean below sea level + oceanSearch.absent = false; + oceanSearch.notHunted = true; + for (int i = 0; i < 256; i++) { + if (oceanSearch.absent) break; //no point + float oceanTop = 61.5f; + if (noise[i]> oceanTop) continue;// too hight + int biomeID = Biome.getIdForBiome(jitteredBiomes[i].baseBiome); + if (oceanBiome[biomeID]) continue;// obviously ocean is OK + if (swampBiome[biomeID]) continue;// swamps are acceptable + if (riverBiome[biomeID]) continue;// rivers stay rivers + if (oceanSearch.notHunted) oceanSearch.hunt(biomeNeighborhood); + int foundBiome = oceanSearch.biomes[i]; + + if (foundBiome != NO_BIOME) { + + realisticBiome = RealisticBiomeBase.getBiome(foundBiome); + // Do we need to patch the biome? + if (realisticBiome == null) { + realisticBiome = biomePatcher.getPatchedRealisticBiome( + "NULL biome (" + i + ") found when performing new repair."); + } + jitteredBiomes[i] = realisticBiome; + } + } + // convert remainder below sea level to lake biome + for (int i = 0; i < 256; i++) { + int biomeID = Biome.getIdForBiome(jitteredBiomes[i].baseBiome); + if (noise[i]<=61.5&&!riverBiome[biomeID]) { + // check for river + if (!oceanBiome[biomeID] && + !swampBiome[biomeID] && + !beachBiome[biomeID]) { + int riverReplacement = Biome.getIdForBiome(jitteredBiomes[i].riverBiome); // make river + if (riverReplacement == Biome.getIdForBiome(Biomes.FROZEN_RIVER)) + jitteredBiomes[i] = scenicFrozenLakeBiome; + else jitteredBiomes[i] = scenicLakeBiome; + } + } + } + } + + private void prepareSearchPattern() { /*if (searchPattern.length != 256) throw new RuntimeException();*/ } + + private void setSearches() { + beachSearch = new SmoothingSearchStatus(this.beachBiome); + landSearch = new SmoothingSearchStatus(this.landBiome); + oceanSearch = new SmoothingSearchStatus(this.oceanBiome); + } + + private float riverAdjusted (float top, float river) { + if (river>=1) return top; + float erodedRiver = river/RealisticBiomeBase.actualRiverProportion; + if (erodedRiver <= 1f) top = top*(1-erodedRiver)+62f*erodedRiver; + top = top*(1-river)+62f*river; + return top; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/biome/BiomeDecoratorRTG.java b/src/api/java/rtg/world/biome/BiomeDecoratorRTG.java new file mode 100644 index 00000000..c1e8473a --- /dev/null +++ b/src/api/java/rtg/world/biome/BiomeDecoratorRTG.java @@ -0,0 +1,352 @@ +package rtg.world.biome; + +import java.util.Random; + +import net.minecraft.block.BlockSilverfish; +import net.minecraft.block.BlockStone; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.state.pattern.BlockMatcher; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.IChunkGenerator; +import net.minecraft.world.gen.ChunkProviderSettings; +import net.minecraft.world.gen.feature.*; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.OreGenEvent; +import net.minecraftforge.event.terraingen.PopulateChunkEvent; +import net.minecraftforge.event.terraingen.TerrainGen; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.RandomUtil; +import rtg.world.biome.realistic.RealisticBiomeBase; + +public class BiomeDecoratorRTG +{ + public BlockPos pos; + public RealisticBiomeBase rbb; + public Biome biome; + + public BiomeDecoratorRTG(RealisticBiomeBase rbb) { + + this.rbb = rbb; + this.biome = rbb.baseBiome; + } + + /* + * This method should only be called by DecoBaseBiomeDecorations or rDecorateSeedBiome(). + */ + public void decorateOres(World worldIn, Random random, int worldX, int worldZ, OpenSimplexNoise simplex, CellNoise cell, float border, float river, boolean hasPlacedVillageBlocks) + { + if (biome.theBiomeDecorator.chunkProviderSettings == null) { + + String generatorOptions = worldIn.getWorldInfo().getGeneratorOptions(); + generatorOptions = (generatorOptions != null) ? generatorOptions : ""; + + biome.theBiomeDecorator.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(generatorOptions).build(); + } + + pos = new BlockPos(worldX, 0, worldZ); + + biome.theBiomeDecorator.dirtGen = new WorldGenMinable(Blocks.DIRT.getDefaultState(), biome.theBiomeDecorator.chunkProviderSettings.dirtSize); + biome.theBiomeDecorator.gravelGen = new WorldGenMinable(Blocks.GRAVEL.getDefaultState(), biome.theBiomeDecorator.chunkProviderSettings.gravelSize); + biome.theBiomeDecorator.graniteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), biome.theBiomeDecorator.chunkProviderSettings.graniteSize); + biome.theBiomeDecorator.dioriteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), biome.theBiomeDecorator.chunkProviderSettings.dioriteSize); + biome.theBiomeDecorator.andesiteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), biome.theBiomeDecorator.chunkProviderSettings.andesiteSize); + biome.theBiomeDecorator.coalGen = new WorldGenMinable(Blocks.COAL_ORE.getDefaultState(), biome.theBiomeDecorator.chunkProviderSettings.coalSize); + biome.theBiomeDecorator.ironGen = new WorldGenMinable(Blocks.IRON_ORE.getDefaultState(), biome.theBiomeDecorator.chunkProviderSettings.ironSize); + biome.theBiomeDecorator.goldGen = new WorldGenMinable(Blocks.GOLD_ORE.getDefaultState(), biome.theBiomeDecorator.chunkProviderSettings.goldSize); + biome.theBiomeDecorator.redstoneGen = new WorldGenMinable(Blocks.REDSTONE_ORE.getDefaultState(), biome.theBiomeDecorator.chunkProviderSettings.redstoneSize); + biome.theBiomeDecorator.diamondGen = new WorldGenMinable(Blocks.DIAMOND_ORE.getDefaultState(), biome.theBiomeDecorator.chunkProviderSettings.diamondSize); + biome.theBiomeDecorator.lapisGen = new WorldGenMinable(Blocks.LAPIS_ORE.getDefaultState(), biome.theBiomeDecorator.chunkProviderSettings.lapisSize); + + MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(worldIn, random, pos)); + if (TerrainGen.generateOre(worldIn, random, biome.theBiomeDecorator.dirtGen, pos, OreGenEvent.GenerateMinable.EventType.DIRT)) { + this.genStandardOre1(worldIn, random, biome.theBiomeDecorator.chunkProviderSettings.dirtCount, biome.theBiomeDecorator.dirtGen, biome.theBiomeDecorator.chunkProviderSettings.dirtMinHeight, biome.theBiomeDecorator.chunkProviderSettings.dirtMaxHeight); + } + if (TerrainGen.generateOre(worldIn, random, biome.theBiomeDecorator.gravelGen, pos, OreGenEvent.GenerateMinable.EventType.GRAVEL)) { + this.genStandardOre1(worldIn, random, biome.theBiomeDecorator.chunkProviderSettings.gravelCount, biome.theBiomeDecorator.gravelGen, biome.theBiomeDecorator.chunkProviderSettings.gravelMinHeight, biome.theBiomeDecorator.chunkProviderSettings.gravelMaxHeight); + } + if (TerrainGen.generateOre(worldIn, random, biome.theBiomeDecorator.dioriteGen, pos, OreGenEvent.GenerateMinable.EventType.DIORITE)) { + this.genStandardOre1(worldIn, random, biome.theBiomeDecorator.chunkProviderSettings.dioriteCount, biome.theBiomeDecorator.dioriteGen, biome.theBiomeDecorator.chunkProviderSettings.dioriteMinHeight, biome.theBiomeDecorator.chunkProviderSettings.dioriteMaxHeight); + } + if (TerrainGen.generateOre(worldIn, random, biome.theBiomeDecorator.graniteGen, pos, OreGenEvent.GenerateMinable.EventType.GRANITE)) { + this.genStandardOre1(worldIn, random, biome.theBiomeDecorator.chunkProviderSettings.graniteCount, biome.theBiomeDecorator.graniteGen, biome.theBiomeDecorator.chunkProviderSettings.graniteMinHeight, biome.theBiomeDecorator.chunkProviderSettings.graniteMaxHeight); + } + if (TerrainGen.generateOre(worldIn, random, biome.theBiomeDecorator.andesiteGen, pos, OreGenEvent.GenerateMinable.EventType.ANDESITE)) { + this.genStandardOre1(worldIn, random, biome.theBiomeDecorator.chunkProviderSettings.andesiteCount, biome.theBiomeDecorator.andesiteGen, biome.theBiomeDecorator.chunkProviderSettings.andesiteMinHeight, biome.theBiomeDecorator.chunkProviderSettings.andesiteMaxHeight); + } + if (TerrainGen.generateOre(worldIn, random, biome.theBiomeDecorator.coalGen, pos, OreGenEvent.GenerateMinable.EventType.COAL)) { + this.genStandardOre1(worldIn, random, biome.theBiomeDecorator.chunkProviderSettings.coalCount, biome.theBiomeDecorator.coalGen, biome.theBiomeDecorator.chunkProviderSettings.coalMinHeight, biome.theBiomeDecorator.chunkProviderSettings.coalMaxHeight); + } + if (TerrainGen.generateOre(worldIn, random, biome.theBiomeDecorator.ironGen, pos, OreGenEvent.GenerateMinable.EventType.IRON)) { + this.genStandardOre1(worldIn, random, biome.theBiomeDecorator.chunkProviderSettings.ironCount, biome.theBiomeDecorator.ironGen, biome.theBiomeDecorator.chunkProviderSettings.ironMinHeight, biome.theBiomeDecorator.chunkProviderSettings.ironMaxHeight); + } + if (TerrainGen.generateOre(worldIn, random, biome.theBiomeDecorator.goldGen, pos, OreGenEvent.GenerateMinable.EventType.GOLD)) { + this.genStandardOre1(worldIn, random, biome.theBiomeDecorator.chunkProviderSettings.goldCount, biome.theBiomeDecorator.goldGen, biome.theBiomeDecorator.chunkProviderSettings.goldMinHeight, biome.theBiomeDecorator.chunkProviderSettings.goldMaxHeight); + } + if (TerrainGen.generateOre(worldIn, random, biome.theBiomeDecorator.redstoneGen, pos, OreGenEvent.GenerateMinable.EventType.REDSTONE)) { + this.genStandardOre1(worldIn, random, biome.theBiomeDecorator.chunkProviderSettings.redstoneCount, biome.theBiomeDecorator.redstoneGen, biome.theBiomeDecorator.chunkProviderSettings.redstoneMinHeight, biome.theBiomeDecorator.chunkProviderSettings.redstoneMaxHeight); + } + if (TerrainGen.generateOre(worldIn, random, biome.theBiomeDecorator.diamondGen, pos, OreGenEvent.GenerateMinable.EventType.DIAMOND)) { + this.genStandardOre1(worldIn, random, biome.theBiomeDecorator.chunkProviderSettings.diamondCount, biome.theBiomeDecorator.diamondGen, biome.theBiomeDecorator.chunkProviderSettings.diamondMinHeight, biome.theBiomeDecorator.chunkProviderSettings.diamondMaxHeight); + } + if (TerrainGen.generateOre(worldIn, random, biome.theBiomeDecorator.lapisGen, pos, OreGenEvent.GenerateMinable.EventType.LAPIS)) { + this.genStandardOre2(worldIn, random, biome.theBiomeDecorator.chunkProviderSettings.lapisCount, biome.theBiomeDecorator.lapisGen, biome.theBiomeDecorator.chunkProviderSettings.lapisCenterHeight, biome.theBiomeDecorator.chunkProviderSettings.lapisSpread); + } + if (rbb.generatesEmeralds) { + this.genEmeraldOre(worldIn, random, pos); + } + if (rbb.generatesSilverfish) { + this.genSilverfishOre(worldIn, random, pos); + } + if (rbb.getExtraGoldGenCount() > 0) { + this.genStandardOre1(worldIn, random, rbb.getExtraGoldGenCount(), biome.theBiomeDecorator.goldGen, rbb.getExtraGoldGenMinHeight(), rbb.getExtraGoldGenMaxHeight()); + } + MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(worldIn, random, pos)); + } + + public void genStandardOre1(World worldIn, Random random, int blockCount, WorldGenerator generator, int minHeight, int maxHeight) + { + if (maxHeight < minHeight) + { + int i = minHeight; + minHeight = maxHeight; + maxHeight = i; + } + else if (maxHeight == minHeight) + { + if (minHeight < 255) + { + ++maxHeight; + } + else + { + --minHeight; + } + } + + for (int j = 0; j < blockCount; ++j) + { + BlockPos blockpos = this.pos.add(random.nextInt(16), random.nextInt(maxHeight - minHeight) + minHeight, random.nextInt(16)); + generator.generate(worldIn, random, blockpos); + } + } + + public void genStandardOre2(World worldIn, Random random, int blockCount, WorldGenerator generator, int centerHeight, int spread) + { + for (int i = 0; i < blockCount; ++i) + { + BlockPos blockpos = this.pos.add(random.nextInt(16), random.nextInt(spread) + random.nextInt(spread) + centerHeight - spread, random.nextInt(16)); + generator.generate(worldIn, random, blockpos); + } + } + + /** + * @see net.minecraft.world.biome.BiomeHills + */ + public void genEmeraldOre(World worldIn, Random rand, BlockPos pos) { + WorldGenerator emeralds = new EmeraldGenerator(); + if (TerrainGen.generateOre(worldIn, rand, emeralds, pos, OreGenEvent.GenerateMinable.EventType.EMERALD)) + emeralds.generate(worldIn, rand, pos); + } + + /** + * @see net.minecraft.world.biome.BiomeHills + */ + public void genSilverfishOre(World worldIn, Random rand, BlockPos pos) { + + WorldGenerator generator = new WorldGenMinable(Blocks.MONSTER_EGG.getDefaultState().withProperty(BlockSilverfish.VARIANT, BlockSilverfish.EnumType.STONE), 9); + + for (int i = 0; i < 7; ++i) + { + int j1 = rand.nextInt(16); + int k1 = rand.nextInt(64); + int l1 = rand.nextInt(16); + if (TerrainGen.generateOre(worldIn, rand, generator, pos.add(j1, k1, l1), OreGenEvent.GenerateMinable.EventType.SILVERFISH)) + generator.generate(worldIn, rand, pos.add(j1, k1, l1)); + } + } + + /** + * Standard emerald ore generator. + * + * @see net.minecraft.world.biome.BiomeHills + */ + public static class EmeraldGenerator extends WorldGenerator + { + @Override + public boolean generate(World worldIn, Random rand, BlockPos pos) + { + int count = 3 + rand.nextInt(6); + for (int i = 0; i < count; i++) + { + BlockPos blockpos = pos.add(rand.nextInt(16), rand.nextInt(28) + 4, rand.nextInt(16)); + + IBlockState state = worldIn.getBlockState(blockpos); + if (state.getBlock().isReplaceableOreGen(state, worldIn, blockpos, BlockMatcher.forBlock(Blocks.STONE))) + { + worldIn.setBlockState(blockpos, Blocks.EMERALD_ORE.getDefaultState(), 2); + } + } + return true; + } + } + + /** + * When manually decorating biomes, sometimes you want the biome to partially decorate itself. + * That's what this method does... it calls the biome's decorate() method. + * If the conditions for decoration aren't met, we still need to generate ores. + */ + public void rDecorateSeedBiome(World world, Random rand, int worldX, int worldZ, OpenSimplexNoise simplex, CellNoise cell, float strength, float river) { + + if (strength > 0.3f) { + this.biome.decorate(world, rand, new BlockPos(worldX, 0, worldZ)); + } + else { + this.decorateOres(world, rand, worldX, worldZ, simplex, cell, strength, river, false); + } + } + + public void rPopulatePreDecorate(IChunkGenerator ichunkgenerator, World worldObj, Random rand, int chunkX, int chunkZ, boolean villageBuilding) { + + int worldX = chunkX * 16; + int worldZ = chunkZ * 16; + boolean gen = true; + + gen = TerrainGen.populate(ichunkgenerator, worldObj, rand, chunkX, chunkZ, villageBuilding, PopulateChunkEvent.Populate.EventType.LAKE); + + // Underground water lakes. + if (ConfigRTG.enableWaterUndergroundLakes) { + + if (gen && (ConfigRTG.waterUndergroundLakeChance > 0) && (rbb.waterUndergroundLakeChance > 0)) { + + int i2 = worldX + rand.nextInt(16);// + 8; + int l4 = RandomUtil.getRandomInt(rand, 1, 50); + int i8 = worldZ + rand.nextInt(16);// + 8; + + if (rand.nextInt(ConfigRTG.waterUndergroundLakeChance) == 0 && rand.nextInt(rbb.waterUndergroundLakeChance) == 0) { + + (new WorldGenLakes(Blocks.WATER)).generate(worldObj, rand, new BlockPos(new BlockPos(i2, l4, i8))); + } + } + } + + // Surface water lakes. + if (ConfigRTG.enableWaterSurfaceLakes && !villageBuilding) { + + if (gen && (ConfigRTG.waterSurfaceLakeChance > 0) && (rbb.waterSurfaceLakeChance > 0)) { + + int i2 = worldX + rand.nextInt(16);// + 8; + int i8 = worldZ + rand.nextInt(16);// + 8; + int l4 = worldObj.getHeight(new BlockPos(i2, 0, i8)).getY(); + + //Surface lakes. + if (rand.nextInt(ConfigRTG.waterSurfaceLakeChance) == 0 && rand.nextInt(rbb.waterSurfaceLakeChance) == 0) { + + if (l4 > 63) { + + (new WorldGenLakes(Blocks.WATER)).generate(worldObj, rand, new BlockPos(i2, l4, i8)); + } + } + } + } + + gen = TerrainGen.populate(ichunkgenerator, worldObj, rand, chunkX, chunkZ, villageBuilding, PopulateChunkEvent.Populate.EventType.LAVA); + + // Underground lava lakes. + if (ConfigRTG.enableLavaUndergroundLakes) { + + if (gen && (ConfigRTG.lavaUndergroundLakeChance > 0) && (rbb.lavaUndergroundLakeChance > 0)) { + + int i2 = worldX + rand.nextInt(16);// + 8; + int l4 = RandomUtil.getRandomInt(rand, 1, 50); + int i8 = worldZ + rand.nextInt(16);// + 8; + + if (rand.nextInt(ConfigRTG.lavaUndergroundLakeChance) == 0 && rand.nextInt(rbb.lavaUndergroundLakeChance) == 0) { + + (new WorldGenLakes(Blocks.LAVA)).generate(worldObj, rand, new BlockPos(i2, l4, i8)); + } + } + } + + // Surface lava lakes. + if (ConfigRTG.enableLavaSurfaceLakes && !villageBuilding) { + + if (gen && (ConfigRTG.lavaSurfaceLakeChance > 0) && (rbb.lavaSurfaceLakeChance > 0)) { + + int i2 = worldX + rand.nextInt(16);// + 8; + int i8 = worldZ + rand.nextInt(16);// + 8; + int l4 = worldObj.getHeight(new BlockPos(i2, 0, i8)).getY(); + + //Surface lakes. + if (rand.nextInt(ConfigRTG.lavaSurfaceLakeChance) == 0 && rand.nextInt(rbb.lavaSurfaceLakeChance) == 0) { + + if (l4 > 63) { + + (new WorldGenLakes(Blocks.LAVA)).generate(worldObj, rand, new BlockPos(i2, l4, i8)); + } + } + } + } + + if (ConfigRTG.generateDungeons) { + + gen = TerrainGen.populate(ichunkgenerator, worldObj, rand, chunkX, chunkZ, villageBuilding, PopulateChunkEvent.Populate.EventType.DUNGEON); + + if (gen) { + + for(int k1 = 0; k1 < ConfigRTG.dungeonFrequency; k1++) { + + int j5 = worldX + rand.nextInt(16);// + 8; + int k8 = rand.nextInt(128); + int j11 = worldZ + rand.nextInt(16);// + 8; + + (new WorldGenDungeons()).generate(worldObj, rand, new BlockPos(j5, k8, j11)); + } + } + } + } + + public void rPopulatePostDecorate(World worldObj, Random rand, int chunkX, int chunkZ, boolean flag) { + + // Are flowing liquid modifications enabled? + if (!ConfigRTG.enableFlowingLiquidModifications) { + return; + } + + int worldX = chunkX * 16; + int worldZ = chunkZ * 16; + int worldHeight = worldObj.provider.getActualHeight(); + + //Flowing water. + if (ConfigRTG.flowingWaterChance > 0) { + if (rand.nextInt(ConfigRTG.flowingWaterChance) == 0) { + for(int l18 = 0; l18 < 50; l18++) + { + int l21 = worldX + rand.nextInt(16);// + 8; + int k23 = rand.nextInt(rand.nextInt(worldHeight - 16) + 10); + int l24 = worldZ + rand.nextInt(16);// + 8; + (new WorldGenLiquids(Blocks.FLOWING_WATER)).generate(worldObj, rand, new BlockPos(l21, k23, l24)); + } + } + } + + //Flowing lava. + if (ConfigRTG.flowingLavaChance > 0) { + if (rand.nextInt(ConfigRTG.flowingLavaChance) == 0) { + for(int i19 = 0; i19 < 20; i19++) + { + int i22 = worldX + rand.nextInt(16);// + 8; + int l23 = rand.nextInt(worldHeight / 2); + int i25 = worldZ + rand.nextInt(16);// + 8; + (new WorldGenLiquids(Blocks.FLOWING_LAVA)).generate(worldObj, rand, new BlockPos(i22, l23, i25)); + } + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/biome/BiomeProviderRTG.java b/src/api/java/rtg/world/biome/BiomeProviderRTG.java new file mode 100644 index 00000000..5cf8b0ec --- /dev/null +++ b/src/api/java/rtg/world/biome/BiomeProviderRTG.java @@ -0,0 +1,310 @@ +package rtg.world.biome; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import javax.annotation.Nonnull; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.WorldType; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.biome.BiomeProvider; +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.IntCache; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.WorldTypeEvent; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.*; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.biome.realistic.RealisticBiomePatcher; + +@SuppressWarnings({"WeakerAccess", "unused"}) +public class BiomeProviderRTG extends BiomeProvider implements IBiomeProviderRTG +{ + private static int[] incidences = new int[100]; + private static int references = 0; + /** A GenLayer containing the indices into Biome.biomeList[] */ + private GenLayer genBiomes; + private GenLayer biomeIndexLayer; + private List biomesToSpawnIn; + private OpenSimplexNoise simplex; + private CellNoise cell; + //private SimplexCellularNoise simplexCell; + private VoronoiCellNoise river; + private float[] borderNoise; + private RealisticBiomePatcher biomePatcher; + private double riverValleyLevel = 60.0 / 450.0;//60.0/450.0; + private float riverSeparation = 1875; + private float largeBendSize = 140; + private float smallBendSize = 30; + + public BiomeProviderRTG(World world, WorldType worldType) { + + super(world.getWorldInfo()); + + this.biomesToSpawnIn = new ArrayList<>(); + this.borderNoise = new float[256]; + this.biomePatcher = new RealisticBiomePatcher(); + this.riverSeparation /= ConfigRTG.riverFrequencyMultiplier; + this.riverValleyLevel *= ConfigRTG.riverSizeMultiplier(); + this.largeBendSize *= ConfigRTG.riverBendinessMultiplier; + this.smallBendSize *= ConfigRTG.riverBendinessMultiplier; + + long seed = world.getSeed(); + if (world.provider.getDimension() != 0) throw new RuntimeException(); + + simplex = new OpenSimplexNoise(seed); + cell = new SimplexCellularNoise(seed); + //simplexCell = new SimplexCellularNoise(seed); + river = new VoronoiCellNoise(seed); + GenLayer[] agenlayer = GenLayer.initializeAllBiomeGenerators(seed, worldType, ""); + agenlayer = getModdedBiomeGenerators(worldType, seed, agenlayer); + this.genBiomes = agenlayer[0]; //maybe this will be needed + this.biomeIndexLayer = agenlayer[1]; + testCellBorder(); + } + + private static void testCellBorder() { + double[] result = new double[2]; + result[0] = 0.5; + result[1] = 1; + if (cellBorder(result, 0.5, 1) < 0) throw new RuntimeException(); + } + + private static double cellBorder(double[] results, double width, double depth) { + double c = (results[1] - results[0]) / results[1]; + if (c < 0) throw new RuntimeException(); + /* + int slot = (int)Math.floor(c*100.0); + incidences[slot] += 1; + references ++; + if (references>40000) { + String result = ""; + for (int i = 0; i< 100; i ++) { + result += " " + incidences[i]; + } + throw new RuntimeException(result); + } + */ + if (c < width) return ((c / width) - 1f) * depth; + else return 0; + } + + @Override + public int[] getBiomesGens(int x, int z, int par3, int par4) { + + int[] d = new int[par3 * par4]; + + for (int i = 0; i < par3; i++) { + for (int j = 0; j < par4; j++) { + d[i * par3 + j] = Biome.getIdForBiome(getBiomeGenAt(x + i, z + j)); + } + } + return d; + } + + @Override + public float getRiverStrength(int x, int z) { + //New river curve function. No longer creates worldwide curve correlations along cardinal axes. + SimplexOctave.Disk jitter = new SimplexOctave.Disk(); + simplex.riverJitter().evaluateNoise((float) x / 240.0, (float) z / 240.0, jitter); + double pX = x + jitter.deltax() * largeBendSize; + double pZ = z + jitter.deltay() * largeBendSize; + + simplex.octave(2).evaluateNoise((float) x / 80.0, (float) z / 80.0, jitter); + pX += jitter.deltax() * smallBendSize; + pZ += jitter.deltay() * smallBendSize; + + double xRiver = pX / riverSeparation; + double zRiver = pZ / riverSeparation; + + //New cellular noise. + //TODO move the initialization of the results in a way that's more efficient but still thread safe. + //double[] results = cell.river().eval(xRiver,zRiver ); + //return (float) cellBorder(results, riverValleyLevel, 1.0); + return river.octave(0).border2(xRiver, zRiver, riverValleyLevel, 1f); + } + + /** + * @see IBiomeProviderRTG + */ + @Override + public Biome getBiomeGenAt(int x, int z) { + return this.getBiome(new BlockPos(x, 0, z)); + } + + /** + * @see IBiomeProviderRTG + */ + @Override + public RealisticBiomeBase getBiomeDataAt(int par1, int par2) { + /*long coords = ChunkCoordIntPair.chunkXZ2Int(par1, par2); + if (biomeDataMap.containsKey(coords)) { + return biomeDataMap.get(coords); + }*/ + RealisticBiomeBase output; + + output = RealisticBiomeBase.getBiome(Biome.getIdForBiome(this.getBiomeGenAt(par1, par2))); + if (output == null) output = biomePatcher.getPatchedRealisticBiome("No biome " + par1 + " " + par2); + + /*if (biomeDataMap.size() > 4096) { + biomeDataMap.clear(); + } + + biomeDataMap.put(coords, output);*/ + + return output; + } + + /** + * @see IBiomeProviderRTG + */ + @Override + public boolean isBorderlessAt(int x, int z) { + + int bx, bz; + for (bx = -2; bx <= 2; bx++) { + for (bz = -2; bz <= 2; bz++) { + borderNoise[Biome.getIdForBiome(getBiomeDataAt(x + bx * 16, z + bz * 16).baseBiome)] += 0.04f; + } + } + + bz = 0; + for (bx = 0; bx < 256; bx++) { + if (borderNoise[bx] > 0.98f) bz = 1; + borderNoise[bx] = 0; + } + return bz == 1; + } + + public boolean diff(float sample1, float sample2, float base) { + return (sample1 < base && sample2 > base) || (sample1 > base && sample2 < base); + } + + public float[] getRainfall(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) { + IntCache.resetIntCache(); + + if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5) { + par1ArrayOfFloat = new float[par4 * par5]; + } + + int[] aint = this.biomeIndexLayer.getInts(par2, par3, par4, par5); + + for (int i1 = 0; i1 < par4 * par5; ++i1) { + float f = 0; + int biome = aint[i1]; + + try { + if (biome > 255) throw new RuntimeException(biomeIndexLayer.toString()); + f = RealisticBiomeBase.getBiome(biome).baseBiome.getRainfall() / 65536.0F; + } + catch (Exception e) { + if (biome > 255) throw new RuntimeException(biomeIndexLayer.toString()); + if (RealisticBiomeBase.getBiome(biome) == null) { + f = biomePatcher.getPatchedRealisticBiome("Problem with biome " + biome + " from " + + e.getMessage()).baseBiome.getRainfall() / 65536.0F; + } + } + if (f > 1.0F) f = 1.0F; + par1ArrayOfFloat[i1] = f; + } + return par1ArrayOfFloat; + } + + @Override + @Nonnull + public List getBiomesToSpawnIn() { + return this.biomesToSpawnIn; + } + + @Override + public float getTemperatureAtHeight(float p_76939_1_, int p_76939_2_) { + return p_76939_1_; + } + + @Override + @Nonnull + public Biome[] getBiomesForGeneration(@Nonnull Biome[] biomes, int x, int z, int width, int height) { + IntCache.resetIntCache(); + + if (biomes.length < width * height) { + biomes = new Biome[width * height]; + } + + int[] aint = this.genBiomes.getInts(x, z, width, height); + + for (int i1 = 0; i1 < width * height; ++i1) { + biomes[i1] = Biome.getBiomeForId(aint[i1]); + + if (biomes[i1] == null) { + biomes[i1] = biomePatcher.getPatchedBaseBiome( + "BPRTG.getBiomesForGeneration() could not find biome " + aint[i1]); + } + } + return biomes; + } + + @Override + public boolean areBiomesViable(int x, int z, int radius, @Nonnull List allowed) { + + float centerNoise = getNoiseAt(x, z); + if (centerNoise < 62) return false; + + float lowestNoise = centerNoise; + float highestNoise = centerNoise; + for (int i = -2; i <= 2; i++) { + for (int j = -2; j <= 2; j++) { + if (i != 0 && j != 0) { + float n = getNoiseAt(x + i * 16, z + j * 16); + if (n < lowestNoise) lowestNoise = n; + if (n > highestNoise) highestNoise = n; + } + } + } + return highestNoise - lowestNoise < 22; + } + + public float getNoiseAt(int x, int y) { + + float river = getRiverStrength(x, y) + 1f; + if (river < 0.5f) return 59f; + return getBiomeDataAt(x, y).rNoise(simplex, cell, x, y, 1f, river); + } + + @Override + public BlockPos findBiomePosition(int x, int z, int range, @Nonnull List biomes, @Nonnull Random random) { + IntCache.resetIntCache(); + int i = x - range >> 2; + int j = z - range >> 2; + int k = x + range >> 2; + int l = z + range >> 2; + int i1 = k - i + 1; + int j1 = l - j + 1; + int[] aint = this.genBiomes.getInts(i, j, i1, j1); + BlockPos blockpos = null; + int k1 = 0; + + for (int l1 = 0; l1 < i1 * j1; ++l1) { + int i2 = i + l1 % i1 << 2; + int j2 = j + l1 / i1 << 2; + Biome biome = Biome.getBiome(aint[l1]); + + if (biomes.contains(biome) && (blockpos == null || random.nextInt(k1 + 1) == 0)) { + blockpos = new BlockPos(i2, 0, j2); + ++k1; + } + } + return blockpos; + } + + @Override + @Nonnull + public GenLayer[] getModdedBiomeGenerators(@Nonnull WorldType worldType, long seed, @Nonnull GenLayer[] original) { + WorldTypeEvent.InitBiomeGens event = new WorldTypeEvent.InitBiomeGens(worldType, seed, original); + MinecraftForge.TERRAIN_GEN_BUS.post(event); + return event.getNewBiomeGens(); + } +} diff --git a/src/api/java/rtg/world/biome/IBiomeProviderRTG.java b/src/api/java/rtg/world/biome/IBiomeProviderRTG.java new file mode 100644 index 00000000..3bc5be93 --- /dev/null +++ b/src/api/java/rtg/world/biome/IBiomeProviderRTG.java @@ -0,0 +1,21 @@ +/* + * Available under the Lesser GPL License 3.0 + */ + +package rtg.world.biome; + +import net.minecraft.world.biome.Biome; + +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * + * @author Zeno410 + */ +public interface IBiomeProviderRTG { + int[] getBiomesGens(int x, int z, int par3, int par4); + float getRiverStrength(int x, int y); + Biome getBiomeGenAt(int par1, int par2); + RealisticBiomeBase getBiomeDataAt(int par1, int par2); + boolean isBorderlessAt(int x, int y); +} diff --git a/src/api/java/rtg/world/biome/deco/DecoAbyssalCraftTree.java b/src/api/java/rtg/world/biome/deco/DecoAbyssalCraftTree.java new file mode 100644 index 00000000..8fe3bd6a --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoAbyssalCraftTree.java @@ -0,0 +1,100 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import com.shinoow.abyssalcraft.api.block.ACBlocks; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.tree.abyssalcraft.WorldGenTreeACDarkwood; + +/** + * @author WhichOnesPink + */ +public class DecoAbyssalCraftTree extends DecoTree { + + public TreeType treeType; + + public DecoAbyssalCraftTree() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.loops = 1; + this.strengthFactorForLoops = 0f; + this.strengthNoiseFactorForLoops = false; + this.strengthNoiseFactorXForLoops = false; + this.treeType = TreeType.DARKWOOD; + this.distribution = new DecoTree.Distribution(100f, 5f, 0.8f); + this.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + this.treeConditionNoise = 0f; + this.treeConditionChance = 1; + this.minY = 63; // No underwater trees by default. + this.maxY = 230; // Sensible upper height limit by default. + this.logBlock = Blocks.LOG.getDefaultState(); + this.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.minSize = 2; + this.maxSize = 4; + + this.addDecoTypes(DecoType.TREE); + } + + @Override + public boolean properlyDefined() { + + return true; + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), TREE)) { + + float noise = simplex.noise2(chunkX / this.distribution.noiseDivisor, chunkY / this.distribution.noiseDivisor) * this.distribution.noiseFactor + this.distribution.noiseAddend; + + int loopCount = this.loops; + loopCount = (this.strengthFactorForLoops > 0f) ? (int) (this.strengthFactorForLoops * strength) : loopCount; + loopCount = (this.strengthNoiseFactorForLoops) ? (int) (noise * strength) : loopCount; + loopCount = (this.strengthNoiseFactorXForLoops) ? (int) (noise * this.strengthFactorForLoops * strength) : loopCount; + for (int i = 0; i < loopCount; i++) { + int intX = chunkX + rand.nextInt(16) + 8; + int intZ = chunkY + rand.nextInt(16) + 8; + int intY = world.getHeight(new BlockPos(intX, 0, intZ)).getY(); + + switch (this.treeType) { + + case DARKWOOD: + + if (intY <= this.maxY && intY >= this.minY && isValidTreeCondition(noise, rand, strength)) { + + WorldGenerator worldgenerator = new WorldGenTreeACDarkwood(6 + rand.nextInt(6), 10 + rand.nextInt(10), ACBlocks.darklands_oak_wood.getDefaultState(), ACBlocks.darklands_oak_leaves.getDefaultState()); + worldgenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + + break; + + default: + break; + } + } + } + } + } + + public enum TreeType { + DARKWOOD; + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoBase.java b/src/api/java/rtg/world/biome/deco/DecoBase.java new file mode 100644 index 00000000..2c8abf3a --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoBase.java @@ -0,0 +1,146 @@ +package rtg.world.biome.deco; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.state.IBlockState; +import net.minecraft.world.World; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * Documentation for the new biome system can be found here: + * https://teamrtg.gitbooks.io/rtg-code-documentation/content/biome_decoration.html + * + * @author WhichOnesPink + */ +public class DecoBase { + + /** + * If false, the deco won't get generated during chunk decoration. + * Currently, the only deco that uses allow=false is the DecoBaseBiomeDecorations deco, and it only gets + * set to false when we need to generate ores in biomes that don't let the base biome handle decoration at all. + */ + public boolean allowed; + public ArrayList decoTypes; + public boolean checkRiver; + public float minRiver; // Minimum river value required to generate. + public float maxRiver; // Maximum river value required to generate. + + public DecoBase() { + + this.allowed = true; + this.decoTypes = new ArrayList(); + this.checkRiver = false; + this.minRiver = -2f; + this.maxRiver = 2f; + } + + public boolean properlyDefined() { + // this procedure should return true if the deco can respond properly to a generate() call + // in particular it should not crash. + return true; + } + + /** + * Performs pre-generation checks to determine if the deco is allowed to generate. + * + * @param biome + * @param world + * @param rand + * @param chunkX + * @param chunkY + * @param simplex + * @param cell + * @param strength + * @param river + * @param hasPlacedVillageBlocks + */ + public boolean preGenerate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.checkRiver) { + + if (river > this.maxRiver || river < this.minRiver) { + return false; + } + } + + return true; + } + + /** + * Generates the decoration. + * This method should be overridden in the individual deco objects. + * + * @param biome + * @param world + * @param rand + * @param chunkX + * @param chunkY + * @param simplex + * @param cell + * @param strength + * @param river + * @param hasPlacedVillageBlocks + */ + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + } + + /** + * Adds one or more deco types. + * + * @param decos + */ + public void addDecoTypes(DecoType... decos) { + + for (int i = 0; i < decos.length; i++) { + this.decoTypes.add(decos[i]); + } + } + + /** + * Enum to classify the various decos. + * + * @author WhichOnesPink + */ + public enum DecoType { + BASE_BIOME_DECORATION, + BOULDER, + COBWEB, + CACTUS, + DEAD_BUSH, + DESERT_WELL, + FALLEN_LEAVES, + FALLEN_TREE, + FERN, + FERN_DOUBLE, + FLOWER, + GRASS, + GRASS_DOUBLE, + LAYER, + LEAVES, + LILYPAD, + MUSHROOM, + PUMPKIN, + REED, + ROCK_SPIRE, + SHRUB, + TEST, + TREE, + VINE, + WHEAT + } + + public static void tweakShrubLeaves(DecoShrub deco, boolean checkDecay, boolean decayable) { + if (deco.leavesBlock.getBlock() instanceof BlockLeaves) { + IBlockState leaves = deco.leavesBlock + .withProperty(BlockLeaves.CHECK_DECAY, checkDecay) + .withProperty(BlockLeaves.DECAYABLE, decayable); + deco.leavesBlock = leaves; + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java b/src/api/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java new file mode 100644 index 00000000..bbea610d --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoBaseBiomeDecorations.java @@ -0,0 +1,107 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * This deco replaces the cumbersome rDecorateSeedBiome & rOreGenSeedBiome logic. + * Instead of having to remember when to use (and not use) rDecorateSeedBiome/rOreGenSeedBiome, + * now all you have to do is add this configured deco to the realistic biome wherever you want the base biome + * to decorate itself. You no longer need to worry about ore gen because that gets handled automatically. + * + * @author WhichOnesPink + */ +public class DecoBaseBiomeDecorations extends DecoBase { + + /** + * This optional setting is useful when you want the base biome to decorate a majority of the biome's chunks. + * Only used if greater than 0 + */ + public int equalsZeroChance; + + /** + * This optional setting is useful when you want the base biome to decorate a minority of the biome's chunks. + * Only used if greater than 0 + */ + public int notEqualsZeroChance; + + /** + * How many times per chunk do we want the base biome to decorate itself? (Usually only once) + */ + public int loops; + + /** + * Height restriction. + */ + public int minY; + public int maxY; + + public DecoBaseBiomeDecorations() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.equalsZeroChance = 0; // Only used if greater than 0 + this.notEqualsZeroChance = 0; // Only used if greater than 0 + this.loops = 1; // You almost always want to loop only once. + this.minY = 1; // No height limit by default. + this.maxY = 255; // No height limit by default. + + this.addDecoTypes(DecoType.BASE_BIOME_DECORATION); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int worldX, int worldZ, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + for (int i = 0; i < loops; i++) { + + int intX = worldX + rand.nextInt(16);// + 8; + int intZ = worldZ + rand.nextInt(16);// + 8; + int intY = world.getHeight(new BlockPos(intX, 0, intZ)).getY(); + + if (intY >= this.minY && intY <= this.maxY) { + + if (this.equalsZeroChance > 0) { + + if (rand.nextInt(this.equalsZeroChance) == 0) { + biome.rDecorator.rDecorateSeedBiome(world, rand, worldX, worldZ, simplex, cell, strength, river); + } + else { + biome.rDecorator.decorateOres(world, rand, worldX, worldZ, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + } + else if (this.notEqualsZeroChance > 0) { + + if (rand.nextInt(this.notEqualsZeroChance) != 0) { + biome.rDecorator.rDecorateSeedBiome(world, rand, worldX, worldZ, simplex, cell, strength, river); + } + else { + biome.rDecorator.decorateOres(world, rand, worldX, worldZ, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + } + else { + + biome.rDecorator.rDecorateSeedBiome(world, rand, worldX, worldZ, simplex, cell, strength, river); + } + } + else { + biome.rDecorator.decorateOres(world, rand, worldX, worldZ, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + } + } + else { + biome.rDecorator.decorateOres(world, rand, worldX, worldZ, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoBoulder.java b/src/api/java/rtg/world/biome/deco/DecoBoulder.java new file mode 100644 index 00000000..58e0a486 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoBoulder.java @@ -0,0 +1,75 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.WorldUtil; +import rtg.util.WorldUtil.SurroundCheckType; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenBlob; + +/** + * @author WhichOnesPink + */ +public class DecoBoulder extends DecoBase { + + public IBlockState boulderBlock; // This can be any block. + public float strengthFactor; // Higher = more/bigger boulders. + public int minY; // Lower height restriction. + public int maxY; // Upper height restriction. + public int chance; // Higher = more rare. + public boolean water; + + public DecoBoulder() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + this.strengthFactor = 2f; + this.minY = 60; // Sensible lower height limit by default. + this.maxY = 255; // No upper height limit by default. + this.chance = 10; + this.water = true; + + this.addDecoTypes(DecoType.BOULDER); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + WorldUtil worldUtil = new WorldUtil(world); + WorldGenerator worldGenerator = new WorldGenBlob(boulderBlock, 0, rand, this.water); + + for (int l1 = 0; l1 < this.strengthFactor * strength; ++l1) { + int i1 = chunkX + rand.nextInt(16);// + 8; + int j1 = chunkY + rand.nextInt(16);// + 8; + int k1 = world.getHeight(new BlockPos(i1, 0, j1)).getY(); + + if (k1 >= this.minY && k1 <= this.maxY && rand.nextInt(this.chance) == 0) { + + // If we're in a village, check to make sure the boulder has extra room to grow to avoid corrupting the village. + if (hasPlacedVillageBlocks) { + if (!worldUtil.isSurroundedByBlock(Blocks.AIR.getDefaultState(), 2, SurroundCheckType.CARDINAL, rand, i1, k1, j1)) { + return; + } + } + + worldGenerator.generate(world, rand, new BlockPos(i1, k1, j1)); + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoCactus.java b/src/api/java/rtg/world/biome/deco/DecoCactus.java new file mode 100644 index 00000000..a1dfddb4 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoCactus.java @@ -0,0 +1,74 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CACTUS; + +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenCacti; + +/** + * @author WhichOnesPink + */ +public class DecoCactus extends DecoBase { + + public int loops; + public int chance; + public float strengthFactor; + public int maxY; + public boolean sandOnly; + public IBlockState soilBlock; + + public DecoCactus() { + + super(); + + /* + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.loops = 1; + this.chance = 1; + this.maxY = 255; // No height limit by default. + this.strengthFactor = 0f; // The higher the value, the more there will be. + this.sandOnly = false; + this.soilBlock = Blocks.SAND.getDefaultState(); + + this.addDecoTypes(DecoType.CACTUS); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), CACTUS)) { + + WorldGenerator worldGenerator = new WorldGenCacti(this.sandOnly, 0, this.soilBlock); + + int loopCount = this.loops; + loopCount = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : loopCount; + for (int i = 0; i < loopCount * 10; i++) { + int intX = chunkX + rand.nextInt(16);// + 8; + int intY = rand.nextInt(this.maxY); + int intZ = chunkY + rand.nextInt(16);// + 8; + + if (intY <= this.maxY && rand.nextInt(this.chance) == 0) { + worldGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoCobwebs.java b/src/api/java/rtg/world/biome/deco/DecoCobwebs.java new file mode 100644 index 00000000..f5a1a9a8 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoCobwebs.java @@ -0,0 +1,65 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.RandomUtil; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenBlock; + +/** + * @author WhichOnesPink + */ +public class DecoCobwebs extends DecoBase { + + public float strengthFactor; // Higher = more/bigger boulders. + public int minY; // Lower height restriction. + public int maxY; // Upper height restriction. + public int chance; // Higher = more rare. + public IBlockState adjacentBlock; + public int minAdjacents; + + public DecoCobwebs() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.strengthFactor = 2f; + this.minY = 1; // No lower height limit by default. + this.maxY = 255; // No upper height limit by default. + this.chance = 10; + this.adjacentBlock = Blocks.AIR.getDefaultState(); + this.minAdjacents = 1; + + this.addDecoTypes(DecoType.COBWEB); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + WorldGenerator worldGenerator = new WorldGenBlock(Blocks.WEB.getDefaultState(), Blocks.AIR.getDefaultState(), this.adjacentBlock, this.minAdjacents); + + for (int l1 = 0; l1 < this.strengthFactor * strength; ++l1) { + int i1 = chunkX + rand.nextInt(16);// + 8; + int j1 = chunkY + rand.nextInt(16);// + 8; + int k1 = RandomUtil.getRandomInt(rand, this.minY, this.maxY); + + if (rand.nextInt(this.chance) == 0) { + worldGenerator.generate(world, rand, new BlockPos(i1, k1, j1)); + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoCrop.java b/src/api/java/rtg/world/biome/deco/DecoCrop.java new file mode 100644 index 00000000..dfa858b4 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoCrop.java @@ -0,0 +1,78 @@ +package rtg.world.biome.deco; + +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.WorldUtil; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenCrops; + +import java.util.Random; + +/** + * @author lightningo7 + */ +public class DecoCrop extends DecoBase { + + public int type; // This can the number 0,1,2,3. + public int size; //Higher = larger fields. + public int density; //Higher = Crops in fields closer together. + public int height; //Higher = Crops on more y levels - When higher tends to be less dense. + public float strengthFactor; // Higher = More frequent spawns. + public int minY; // Lower height restriction. + public int maxY; // Upper height restriction. + public int chance; // Higher = more rare. + public boolean water; + + public DecoCrop() { + + super(); + + /* + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.type = 2; + this.size = 5;//DO NOT PUT HIGHER THAN 30 + this.density = 50; + this.height = 2; + this.strengthFactor = 2f; + this.minY = 60; // Sensible lower height limit by default. + this.maxY = 255; // No upper height limit by default. + this.chance = 10; + this.water = true; + + this.addDecoTypes(DecoType.WHEAT); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + WorldUtil worldUtil = new WorldUtil(world); + WorldGenerator worldGenerator = new WorldGenCrops(type, size, density, height); + + for (int l1 = 0; l1 < this.strengthFactor * strength; ++l1) { + int i1 = chunkX + rand.nextInt(16);// + 8; + int j1 = chunkY + rand.nextInt(16);// + 8; + int k1 = world.getHeight(new BlockPos(i1, 0, j1)).getY(); + + if (k1 >= this.minY && k1 <= this.maxY && rand.nextInt(this.chance) == 0) { + + // If we're in a village, check to make sure the boulder has extra room to grow to avoid corrupting the village. + if (hasPlacedVillageBlocks) { + if (!worldUtil.isSurroundedByBlock(Blocks.AIR.getDefaultState(), 2, WorldUtil.SurroundCheckType.CARDINAL, rand, i1, k1, j1)) { + return; + } + } + + worldGenerator.generate(world, rand, new BlockPos(i1, k1, j1)); + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoDeadBush.java b/src/api/java/rtg/world/biome/deco/DecoDeadBush.java new file mode 100644 index 00000000..edca9ed8 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoDeadBush.java @@ -0,0 +1,66 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenDeadBush; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * @author WhichOnesPink + */ +public class DecoDeadBush extends DecoBase { + + public float strengthFactor; + public int maxY; + public int chance; + public int loops; + + public DecoDeadBush() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.maxY = 255; // No height limit by default. + this.strengthFactor = 0f; // The higher the value, the more there will be. + this.chance = 1; + this.loops = 1; + + this.addDecoTypes(DecoType.DEAD_BUSH); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), DEAD_BUSH)) { + + WorldGenerator worldGenerator = new WorldGenDeadBush(); + + int loopCount = this.loops; + loopCount = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : loopCount; + for (int i = 0; i < loopCount; i++) { + int intX = chunkX + rand.nextInt(16);// + 8; + int intY = rand.nextInt(this.maxY); + int intZ = chunkY + rand.nextInt(16);// + 8; + + if (intY <= this.maxY && rand.nextInt(this.chance) == 0) { + worldGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/biome/deco/DecoDesertWell.java b/src/api/java/rtg/world/biome/deco/DecoDesertWell.java new file mode 100644 index 00000000..0702dc1d --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoDesertWell.java @@ -0,0 +1,62 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenDesertWells; +import net.minecraft.world.gen.feature.WorldGenerator; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * @author WhichOnesPink + */ +public class DecoDesertWell extends DecoBase { + + public float strengthFactor; + public int maxY; + public int loops; + public int chance; + + public DecoDesertWell() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.maxY = 255; // No height limit by default. + this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. + this.loops = 1; + this.chance = 1; + + this.addDecoTypes(DecoType.DESERT_WELL); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + WorldGenerator worldGenerator = new WorldGenDesertWells(); + + this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + for (int i = 0; i < this.loops; i++) { + if (rand.nextInt(this.chance) == 0) { + + int intX = chunkX + rand.nextInt(16) + 8; + int intY = rand.nextInt(this.maxY); + int intZ = chunkY + rand.nextInt(16) + 8; + + if (intY <= this.maxY) { + worldGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoDoubleGrass.java b/src/api/java/rtg/world/biome/deco/DecoDoubleGrass.java new file mode 100644 index 00000000..2f1b7484 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoDoubleGrass.java @@ -0,0 +1,64 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenGrass; + +/** + * @author WhichOnesPink + */ +public class DecoDoubleGrass extends DecoBase { + + public float strengthFactor; + public int maxY; + public int loops; + + public DecoDoubleGrass() { + + super(); + + /* + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.maxY = 255; // No height limit by default. + this.strengthFactor = 0f; // The higher the value, the more there will be. + this.loops = 1; + + this.addDecoTypes(DecoType.GRASS_DOUBLE); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), GRASS)) { + + WorldGenerator worldGenerator = new WorldGenGrass(Blocks.DOUBLE_PLANT.getStateFromMeta(2), 2); + + this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + for (int i = 0; i < this.loops; i++) { + int intX = chunkX + rand.nextInt(16) + 8; + int intY = rand.nextInt(this.maxY); + int intZ = chunkY + rand.nextInt(16) + 8; + + if (intY <= this.maxY) { + worldGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoFallenTree.java b/src/api/java/rtg/world/biome/deco/DecoFallenTree.java new file mode 100644 index 00000000..a1929136 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoFallenTree.java @@ -0,0 +1,180 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.WorldUtil; +import rtg.util.WorldUtil.SurroundCheckType; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenLog; + +/** + * @author WhichOnesPink + */ +public class DecoFallenTree extends DecoBase { + + public int loops; + public DecoFallenTree.Distribution distribution; // Parameter object for noise calculations. + public LogCondition logCondition; // Enum for the various conditions/chances for log gen. + public float logConditionNoise; // Only applies to a noise-related LogCondition. + public int logConditionChance; // Only applies to a chance-related LogCondition. + public int maxY; // Height restriction. + public IBlockState logBlock; + public IBlockState leavesBlock; + public int minSize; // Min log height (only used with certain log presets) + public int maxSize; // Max log height (only used with certain log presets) + public IBlockState[] randomLogBlocks; + + public DecoFallenTree() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.loops = 1; + this.distribution = new DecoFallenTree.Distribution(100f, 5f, 0.8f); + this.logCondition = LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + this.logConditionNoise = 0f; + this.logConditionChance = 1; + this.maxY = 80; + this.logBlock = Blocks.LOG.getDefaultState(); + this.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.minSize = 2; + this.maxSize = 4; + this.randomLogBlocks = new IBlockState[]{}; + + this.addDecoTypes(DecoType.FALLEN_TREE); + } + + public DecoFallenTree(DecoFallenTree source) { + + this(); + this.loops = source.loops; + this.distribution = source.distribution; + this.logCondition = source.logCondition; + this.logConditionNoise = source.logConditionNoise; + this.logConditionChance = source.logConditionChance; + this.maxY = source.maxY; + this.logBlock = source.logBlock; + this.leavesBlock = source.leavesBlock; + this.minSize = source.minSize; + this.maxSize = source.maxSize; + this.randomLogBlocks = source.randomLogBlocks; + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + float noise = simplex.noise2(chunkX / this.distribution.noiseDivisor, chunkY / this.distribution.noiseDivisor) * this.distribution.noiseFactor + this.distribution.noiseAddend; + WorldUtil worldUtil = new WorldUtil(world); + + //Do we want to choose a random log? + if (this.randomLogBlocks.length > 0) { + this.logBlock = this.randomLogBlocks[rand.nextInt(this.randomLogBlocks.length)]; + } + + WorldGenerator worldGenerator = null; + int finalSize = 4; + if (this.maxSize > this.minSize) { + finalSize = this.minSize + rand.nextInt(this.maxSize - this.minSize); + worldGenerator = new WorldGenLog(this.logBlock, this.leavesBlock, finalSize); + } + else if (this.maxSize == this.minSize) { + finalSize = this.minSize; + worldGenerator = new WorldGenLog(this.logBlock, this.leavesBlock, finalSize); + } + else { + worldGenerator = new WorldGenLog(this.logBlock, this.leavesBlock, finalSize); + } + + for (int i = 0; i < this.loops; i++) { + if (isValidLogCondition(noise, strength, rand)) { + int x22 = chunkX + rand.nextInt(16);// + 8; + int z22 = chunkY + rand.nextInt(16);// + 8; + int y22 = world.getHeight(new BlockPos(x22, 0, z22)).getY(); + + if (y22 <= this.maxY) { + + // If we're in a village, check to make sure the log has extra room to grow to avoid corrupting the village. + if (hasPlacedVillageBlocks) { + if (!worldUtil.isSurroundedByBlock(Blocks.AIR.getDefaultState(), finalSize, SurroundCheckType.CARDINAL, rand, x22, y22, z22)) { + return; + } + } + + worldGenerator.generate(world, rand, new BlockPos(x22, y22, z22)); + } + } + } + } + } + + public boolean isValidLogCondition(float noise, float strength, Random rand) { + + switch (this.logCondition) { + case ALWAYS_GENERATE: + + return true; + + case RANDOM_CHANCE: + + return (rand.nextInt(this.logConditionChance) == 0); + + case NOISE_GREATER_AND_RANDOM_CHANCE: + + return (noise > this.logConditionNoise && rand.nextInt(this.logConditionChance) == 0); + + case NOISE_LESS_AND_RANDOM_CHANCE: + + return (noise < this.logConditionNoise && rand.nextInt(this.logConditionChance) == 0); + + case X_DIVIDED_BY_STRENGTH: + + return (rand.nextInt((int) (this.logConditionNoise / strength)) == 0); + + default: + return false; + } + } + + public enum LogCondition { + ALWAYS_GENERATE, + RANDOM_CHANCE, + NOISE_GREATER_AND_RANDOM_CHANCE, + NOISE_LESS_AND_RANDOM_CHANCE, + X_DIVIDED_BY_STRENGTH; + } + + /** + * Parameter object for noise calculations. + *

+ * simplex.noise2(chunkX / noiseDivisor, chunkY / noiseDivisor) * noiseFactor + noiseAddend; + * + * @author WhichOnesPink + * @author Zeno410 + */ + public static class Distribution { + + public float noiseDivisor; + public float noiseFactor; + public float noiseAddend; + + public Distribution(float noiseDivisor, float noiseFactor, float noiseAddend) { + + this.noiseDivisor = noiseDivisor; + this.noiseFactor = noiseFactor; + this.noiseAddend = noiseAddend; + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoFlowersRTG.java b/src/api/java/rtg/world/biome/deco/DecoFlowersRTG.java new file mode 100644 index 00000000..b72ca710 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoFlowersRTG.java @@ -0,0 +1,125 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.RandomUtil; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenFlowersRTG; + +/** + * @author WhichOnesPink + */ +public class DecoFlowersRTG extends DecoBase { + + public int[] flowers; // Integer array of flower IDs. + public float strengthFactor; // Higher = more flowers. + public int minY; // Height restriction. + public int maxY; // Height restriction. + public HeightType heightType; // How we determine the Y coord. + public int chance; // Higher = more rare. + public int notEqualsZeroChance; + public int loops; + + /* + * FLOWER LIST: + * 0 Poppy + * 1 Blue Orchid + * 2 Allium + * 3 Azure Bluet + * 4 Red Tulip + * 5 Orange Tulip + * 6 White Tulip + * 7 Pink Tulip + * 8 Oxeye Daisy + * 9 Yellow Flower + * 10 Sunflower + * 11 Lilac + * 12 Double Tallgrass + * 13 Large Fern + * 14 Rose Bush + * 15 Peony + */ + public DecoFlowersRTG() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.flowers = new int[]{0, 9}; // Only roses and dandelions by default. + this.chance = 1; // 100% chance of generating by default. + this.notEqualsZeroChance = 1; + this.minY = 1; // No lower height limit by default - this should really be 63, but... backwards-compatibility. :/ + this.maxY = 253; // 2 below max build height to account for 2-block tall flowers. + this.heightType = HeightType.NEXT_INT; + this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. + this.loops = 1; + + this.addDecoTypes(DecoType.FLOWER); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), FLOWERS)) { + + WorldGenerator worldGenerator = new WorldGenFlowersRTG(this.flowers); + + this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + + for (int i = 0; i < this.loops * 16; i++) { + int intX = chunkX + rand.nextInt(16);// + 8; + int intZ = chunkY + rand.nextInt(16);// + 8; + + int intY; + switch (this.heightType) { + case NEXT_INT: + intY = RandomUtil.getRandomInt(rand, this.minY, this.maxY); + break; + + case GET_HEIGHT_VALUE: + intY = world.getHeight(new BlockPos(intX, 0, intZ)).getY(); + break; + + default: + intY = rand.nextInt(this.maxY); + break; + + } + + if (this.notEqualsZeroChance > 1) { + + if (rand.nextInt(this.notEqualsZeroChance) != 0) { + + worldGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + else { + + if (rand.nextInt(this.chance) == 0) { + + worldGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } + } + + public enum HeightType { + NEXT_INT, + GET_HEIGHT_VALUE; + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoGrass.java b/src/api/java/rtg/world/biome/deco/DecoGrass.java new file mode 100644 index 00000000..9a112b0e --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoGrass.java @@ -0,0 +1,124 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenGrass; + +/* + * @author WhichOnesPink + */ +public class DecoGrass extends DecoBase { + + protected static final int MAX_LOOPS = 10; + + public float strengthFactor; + public int minY; + public int maxY; + public int loops; + public int chance; + public int notEqualsZerochance; + public IBlockState[] randomGrassBlocks; + public byte[] randomGrassMetas; + protected boolean useRandomGrass; + private IBlockState block; + private int meta; + private WorldGenGrass grassGenerator; + + public DecoGrass() { + + super(); + + /* + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.minY = 1; // No height limit by default. + this.maxY = 255; // No height limit by default. + this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. + this.loops = 1; + this.chance = 1; + this.notEqualsZerochance = 1; + this.block = Blocks.TALLGRASS.getStateFromMeta(1); + this.meta = 1; + this.randomGrassBlocks = new IBlockState[]{}; + this.randomGrassMetas = new byte[]{}; + this.useRandomGrass = (this.randomGrassBlocks.length > 0 && this.randomGrassBlocks.length == this.randomGrassMetas.length); + + this.addDecoTypes(DecoType.GRASS); + grassGenerator = new WorldGenGrass(block, meta); + } + + public DecoGrass(int meta) { + + this(); + this.meta = meta; + grassGenerator = new WorldGenGrass.SingleType(block, meta); + } + + public DecoGrass(IBlockState block) { + + this(); + this.block = block; + grassGenerator = new WorldGenGrass.SingleType(block, meta); + } + + public DecoGrass(IBlockState[] randomBlocks, byte[] randomMetas) { + + this(); + if (randomBlocks.length != randomMetas.length) { + throw new RuntimeException("Mismatch in block and metadata arrays for DecoGrass"); + } + this.randomGrassBlocks = randomBlocks; + this.randomGrassMetas = randomMetas; + grassGenerator = new WorldGenGrass.RandomType(randomGrassBlocks, randomGrassMetas); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), GRASS)) { + + this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + this.loops = (this.loops > this.MAX_LOOPS) ? this.MAX_LOOPS : this.loops; + for (int i = 0; i < this.loops * 64; i++) { + int intX = chunkX + rand.nextInt(16);// + 8; + int intY = this.minY + (rand.nextInt(this.maxY - this.minY) + 1); + int intZ = chunkY + rand.nextInt(16);// + 8; + + //Do we want to choose a random grass? + if (this.useRandomGrass) { + + //this.block = this.randomGrassBlocks[rand.nextInt(this.randomGrassBlocks.length)]; + //this.meta = this.randomGrassMetas[rand.nextInt(this.randomGrassMetas.length)]; + } + + if (this.notEqualsZerochance > 1) { + + if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.notEqualsZerochance) != 0) { + grassGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + else { + + if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.chance) == 0) { + grassGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoGrassDoubleTallgrass.java b/src/api/java/rtg/world/biome/deco/DecoGrassDoubleTallgrass.java new file mode 100644 index 00000000..fca11caf --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoGrassDoubleTallgrass.java @@ -0,0 +1,101 @@ +package rtg.world.biome.deco; + +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraftforge.event.terraingen.TerrainGen; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenGrass; + +import java.util.Random; + +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS; + +/** + * @author WhichOnesPink + */ +public class DecoGrassDoubleTallgrass extends DecoBase { + + public float strengthFactor; + public int maxY; + public int loops; + public int grassChance; + public int doubleGrassChance; + + public DecoGrassDoubleTallgrass() { + + super(); + + /* + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.maxY = 255; // No height limit by default. + this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. + this.loops = 1; + this.grassChance = 0; // 50% chance for both grass & double grass by default. + this.doubleGrassChance = 0; // 50% chance for both grass & double grass by default. (If set, overrides grass chance.) + + this.addDecoTypes(DecoType.GRASS, DecoType.GRASS_DOUBLE); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), GRASS)) { + + WorldGenerator worldGenerator = null; + if (this.doubleGrassChance > 0) { + + if (rand.nextInt(this.doubleGrassChance) == 0) { + + worldGenerator = new WorldGenGrass(Blocks.DOUBLE_PLANT.getStateFromMeta(2), 2); + } + else { + + worldGenerator = new WorldGenGrass(Blocks.TALLGRASS.getStateFromMeta(1), 1); + } + } + else if (this.grassChance > 0) { + + if (rand.nextInt(this.grassChance) == 0) { + + worldGenerator = new WorldGenGrass(Blocks.TALLGRASS.getStateFromMeta(1), 1); + } + else { + + worldGenerator = new WorldGenGrass(Blocks.DOUBLE_PLANT.getStateFromMeta(2), 2); + } + } + else { + + if (rand.nextBoolean()) { + + worldGenerator = new WorldGenGrass(Blocks.TALLGRASS.getStateFromMeta(1), 1); + } + else { + + worldGenerator = new WorldGenGrass(Blocks.DOUBLE_PLANT.getStateFromMeta(2), 2); + } + } + + this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + for (int i = 0; i < this.loops; i++) { + int intX = chunkX + rand.nextInt(16) + 8; + int intY = rand.nextInt(this.maxY); + int intZ = chunkY + rand.nextInt(16) + 8; + + if (intY <= this.maxY) { + + worldGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoJungleCacti.java b/src/api/java/rtg/world/biome/deco/DecoJungleCacti.java new file mode 100644 index 00000000..c8445f95 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoJungleCacti.java @@ -0,0 +1,66 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CACTUS; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenJungleCacti; + +/** + * @author WhichOnesPink + */ +public class DecoJungleCacti extends DecoBase { + + public float strengthFactor; + public int maxY; + public boolean sandOnly; + public int extraHeight; + public byte sandMeta; + + public DecoJungleCacti() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.strengthFactor = 8f; + this.maxY = 255; // No height limit by default. + this.sandOnly = false; + this.extraHeight = 7; + this.sandMeta = (byte) 1; + + this.addDecoTypes(DecoType.CACTUS); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), CACTUS)) { + + WorldGenerator worldGenerator = new WorldGenJungleCacti(this.sandOnly, rand.nextInt(this.extraHeight), this.sandMeta); + + for (int i = 0; i < this.strengthFactor * strength; i++) { + int intX = chunkX + rand.nextInt(16);// + 8; + int intY = rand.nextInt(160); + int intZ = chunkY + rand.nextInt(16);// + 8; + + if (intY < this.maxY) { + worldGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoJungleGrassVines.java b/src/api/java/rtg/world/biome/deco/DecoJungleGrassVines.java new file mode 100644 index 00000000..898a31c5 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoJungleGrassVines.java @@ -0,0 +1,111 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenGrass; +import rtg.world.gen.feature.WorldGenVinesRTG; + +/** + * @author WhichOnesPink + */ +public class DecoJungleGrassVines extends DecoBase { + + protected WorldGenerator worldgeneratorGrass; + protected WorldGenerator worldgeneratorDoubleTallgrass; + protected WorldGenerator worldgeneratorFern; + protected WorldGenerator worldgeneratorLargeFern; + protected WorldGenerator worldgeneratorVines; + + public DecoJungleGrassVines() { + + super(); + + this.worldgeneratorGrass = new WorldGenGrass(Blocks.TALLGRASS.getStateFromMeta(1), 1); + this.worldgeneratorDoubleTallgrass = new WorldGenGrass(Blocks.DOUBLE_PLANT.getStateFromMeta(2), 2); + this.worldgeneratorFern = new WorldGenGrass(Blocks.TALLGRASS.getStateFromMeta(2), 2); + this.worldgeneratorLargeFern = new WorldGenGrass(Blocks.DOUBLE_PLANT.getStateFromMeta(3), 3); + this.worldgeneratorVines = new WorldGenVinesRTG(); + + this.addDecoTypes(DecoType.GRASS, DecoType.VINE); + } + + /** + * No config options for this one yet. Just ripped it directly from the old code. + */ + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int worldX, int worldY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(worldX, 0, worldY), GRASS)) { + + for (int l14 = 0; l14 < 16f * strength; l14++) { + int l19 = worldX + rand.nextInt(16);// + 8; + int k22 = rand.nextInt(128); + int j24 = worldY + rand.nextInt(16);// + 8; + + if (rand.nextInt(8) == 0) { + if (rand.nextBoolean()) { + this.worldgeneratorGrass.generate(world, rand, new BlockPos(l19, k22, j24)); + } + else { + this.worldgeneratorFern.generate(world, rand, new BlockPos(l19, k22, j24)); + } + } + + for (int h44 = 0; h44 < 4 && k22 > 63; h44++) { + worldgeneratorVines.generate(world, rand, new BlockPos(l19, k22, j24)); + } + } + + for (int l14 = 0; l14 < 12f * strength; l14++) { + int l19 = worldX + rand.nextInt(16);// + 8; + int k22 = rand.nextInt(128); + int j24 = worldY + rand.nextInt(16);// + 8; + + if (rand.nextInt(5) == 0) { + if (rand.nextBoolean()) { + this.worldgeneratorDoubleTallgrass.generate(world, rand, new BlockPos(l19, k22, j24)); + } + else { + this.worldgeneratorLargeFern.generate(world, rand, new BlockPos(l19, k22, j24)); + } + } + } + + for (int l14 = 0; l14 < 16f * strength; l14++) { + int l19 = worldX + rand.nextInt(16);// + 8; + int k22 = rand.nextInt(128); + int j24 = worldY + rand.nextInt(16);// + 8; + + if (rand.nextInt(8) == 0) { + if (rand.nextBoolean()) { + this.worldgeneratorGrass.generate(world, rand, new BlockPos(l19, k22, j24)); + } + else { + this.worldgeneratorFern.generate(world, rand, new BlockPos(l19, k22, j24)); + } + } + + if (k22 > 63) { + + for (int h44 = 0; h44 < 8; h44++) { + worldgeneratorVines.generate(world, rand, new BlockPos(l19, k22, j24)); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoJungleLilypadVines.java b/src/api/java/rtg/world/biome/deco/DecoJungleLilypadVines.java new file mode 100644 index 00000000..d5c15456 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoJungleLilypadVines.java @@ -0,0 +1,77 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenWaterlily; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenVinesRTG; + +/** + * @author WhichOnesPink + */ +public class DecoJungleLilypadVines extends DecoBase { + + private static final Block volcanoBlock = Block.getBlockFromName(ConfigRTG.volcanoBlockId); + private static final Block volcanoMix1Block = Block.getBlockFromName(ConfigRTG.volcanoMix1BlockId); + private static final Block volcanoMix2Block = Block.getBlockFromName(ConfigRTG.volcanoMix2BlockId); + private static final Block volcanoMix3Block = Block.getBlockFromName(ConfigRTG.volcanoMix3BlockId); + + public DecoJungleLilypadVines() { + + super(); + + this.addDecoTypes(DecoType.LILYPAD, DecoType.VINE); + } + + /** + * No config options for this one yet. Just ripped it directly from the old code. + */ + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int blockX, int blockY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(blockX, 0, blockY), LILYPAD)) { + + WorldGenerator worldgeneratorLilypads = new WorldGenWaterlily(); + WorldGenerator worldgeneratorVines = new WorldGenVinesRTG(); + Block vb; + + for (int b33 = 0; b33 < 5; b33++) { + int j6 = blockX + rand.nextInt(16) + 8; + int k10 = blockY + rand.nextInt(16) + 8; + int z52 = world.getHeight(new BlockPos(j6, 0, k10)).getY(); + + for (int h44 = 0; h44 < 8; h44++) { + + if (z52 > 64) { + worldgeneratorLilypads.generate(world, rand, new BlockPos(j6, z52, k10)); + } + } + + for (int h44 = 100; h44 > 0; h44--) { + + vb = world.getBlockState(new BlockPos(j6, h44, k10)).getBlock(); + + if (vb == volcanoBlock || vb == volcanoMix1Block || vb == volcanoMix2Block || vb == volcanoMix3Block) { + return; + } + + worldgeneratorVines.generate(world, rand, new BlockPos(j6, z52, k10)); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoLargeFernDoubleTallgrass.java b/src/api/java/rtg/world/biome/deco/DecoLargeFernDoubleTallgrass.java new file mode 100644 index 00000000..43c2067c --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoLargeFernDoubleTallgrass.java @@ -0,0 +1,105 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenGrass; + +/** + * @author WhichOnesPink + */ +public class DecoLargeFernDoubleTallgrass extends DecoBase { + + private final int GRASS_META = 2; + private final int FERN_META = 3; + + public float strengthFactor; + public int maxY; + public int loops; + public int grassChance; + public int fernChance; + + public DecoLargeFernDoubleTallgrass() { + + super(); + + /* + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.maxY = 255; // No height limit by default. + this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. + this.loops = 1; + this.grassChance = 0; // 50% chance for both grass & ferns by default. + this.fernChance = 0; // 50% chance for both grass & ferns by default. (If set, overrides grass chance.) + + this.addDecoTypes(DecoType.GRASS_DOUBLE, DecoType.FERN_DOUBLE); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), GRASS)) { + + WorldGenerator worldgeneratorDoubleTallgrass = new WorldGenGrass(Blocks.DOUBLE_PLANT.getStateFromMeta(GRASS_META), GRASS_META); + WorldGenerator worldgeneratorLargeFern = new WorldGenGrass(Blocks.DOUBLE_PLANT.getStateFromMeta(FERN_META), FERN_META); + + this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + for (int i = 0; i < this.loops; i++) { + int intX = chunkX + rand.nextInt(16) + 8; + int intY = rand.nextInt(this.maxY); + int intZ = chunkY + rand.nextInt(16) + 8; + + if (intY <= this.maxY) { + + if (this.fernChance > 0) { + + if (rand.nextInt(this.fernChance) == 0) { + + worldgeneratorLargeFern.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + else { + + worldgeneratorDoubleTallgrass.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + else if (this.grassChance > 0) { + + if (rand.nextInt(this.grassChance) == 0) { + + worldgeneratorDoubleTallgrass.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + else { + + worldgeneratorLargeFern.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + else { + + if (rand.nextBoolean()) { + + worldgeneratorDoubleTallgrass.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + else { + + worldgeneratorLargeFern.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoLayer.java b/src/api/java/rtg/world/biome/deco/DecoLayer.java new file mode 100644 index 00000000..5367c383 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoLayer.java @@ -0,0 +1,101 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.WorldUtil; +import rtg.util.WorldUtil.SurroundCheckType; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenLayers; + +/** + * @author WhichOnesPink + */ +public class DecoLayer extends DecoBase { + + public IBlockState layerBlock; + public PropertyInteger layerProperty; + public int dropHeight; + public int layerRange; + public int layerScatter; + + public float strengthFactor; // Higher = more/bigger shrubs. + public int minY; // Height restriction. + public int maxY; // Height restriction. + public int chance; // Higher = more rare. + public int notEqualsZerochance; + public int loops; + + public DecoLayer(IBlockState layerBlock, PropertyInteger layerProperty) { + + super(); + + /* + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.layerBlock = layerBlock; + this.layerProperty = layerProperty; + this.dropHeight = 2; + this.layerRange = 4; + this.layerScatter = 3; + this.strengthFactor = 2f; + this.minY = 63; // Sensible height limit by default. + this.maxY = 255; // No height limit by default. + this.chance = 1; // 100% chance of generating by default. + this.notEqualsZerochance = 1; + this.loops = 1; + + this.addDecoTypes(DecoType.LAYER, DecoType.LEAVES, DecoType.FALLEN_LEAVES); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + WorldUtil worldUtil = new WorldUtil(world); + WorldGenerator worldGenerator = new WorldGenLayers(this.layerBlock, this.layerProperty, this.dropHeight, this.layerRange, this.layerScatter); + + int loopCount = this.loops; + loopCount = (this.strengthFactor > 0f) ? (int)(this.strengthFactor * strength) : loopCount; + for (int i = 0; i < loopCount; i++) { + int intX = chunkX + rand.nextInt(16);// + 8; + int intZ = chunkY + rand.nextInt(16);// + 8; + int intY = world.getHeight(new BlockPos(intX, 0, intZ)).getY(); + + if (this.notEqualsZerochance > 1) { + + if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.notEqualsZerochance) != 0) { + generateWorldGenerator(worldGenerator, worldUtil, world, rand, intX, intY, intZ, hasPlacedVillageBlocks); + } + } + else { + + if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.chance) == 0) { + generateWorldGenerator(worldGenerator, worldUtil, world, rand, intX, intY, intZ, hasPlacedVillageBlocks); + } + } + } + } + } + + private boolean generateWorldGenerator(WorldGenerator worldGenerator, WorldUtil worldUtil, World world, Random rand, int x, int y, int z, boolean hasPlacedVillageBlocks) { + // If we're in a village, check to make sure the layer has extra room to avoid corrupting the village. + if (hasPlacedVillageBlocks) { + if (!worldUtil.isSurroundedByBlock(Blocks.AIR.getDefaultState(), 2, SurroundCheckType.CARDINAL, rand, x, y, z)) { + return false; + } + } + + return worldGenerator.generate(world, rand, new BlockPos(x, y, z)); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/biome/deco/DecoMushrooms.java b/src/api/java/rtg/world/biome/deco/DecoMushrooms.java new file mode 100644 index 00000000..eaa12843 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoMushrooms.java @@ -0,0 +1,103 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenBush; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * @author WhichOnesPink + */ +public class DecoMushrooms extends DecoBase { + + public float strengthFactor; + public int maxY; + public float randomFloat; + public RandomType randomType; + public int chance; + public int loops; + + public DecoMushrooms() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.maxY = 255; // No height limit by default. + this.strengthFactor = 0f; // The higher the value, the more there will be. Disabled by default. + this.randomType = RandomType.USE_CHANCE_VALUE; + this.randomFloat = 1f; + this.chance = 1; + this.loops = 1; + + this.addDecoTypes(DecoType.MUSHROOM); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), SHROOM)) { + + // Let's figure out what the rand.nextInt() argument should be. + switch (this.randomType) { + case ALWAYS_GENERATE: + this.chance = 1; + break; + + case USE_CHANCE_VALUE: + break; + + case X_DIVIDED_BY_STRENGTH: + this.chance = (int) (this.randomFloat / strength); + break; + + default: + break; + } + + WorldGenerator worldGeneratorBrownShrooms = new WorldGenBush(Blocks.BROWN_MUSHROOM); + WorldGenerator worldGeneratorRedShrooms = new WorldGenBush(Blocks.RED_MUSHROOM); + + this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + for (int i = 0; i < this.loops; i++) { + if (rand.nextInt(this.chance) == 0) { + + int intX = chunkX + rand.nextInt(16);// + 8; + int intY = rand.nextInt(this.maxY); + int intZ = chunkY + rand.nextInt(16);// + 8; + + if (intY <= this.maxY) { + + if (rand.nextBoolean()) { + worldGeneratorBrownShrooms.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + else { + worldGeneratorRedShrooms.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } + } + } + + public enum RandomType { + ALWAYS_GENERATE, + USE_CHANCE_VALUE, + X_DIVIDED_BY_STRENGTH + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoPond.java b/src/api/java/rtg/world/biome/deco/DecoPond.java new file mode 100644 index 00000000..e5bb0b82 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoPond.java @@ -0,0 +1,44 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenPond; + +/** + * @author Zeno410 + */ +public class DecoPond extends DecoBase { + + public int chunksPerPond; + private WorldGenerator pondGenerator = new WorldGenPond(Blocks.WATER.getDefaultState()); + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed && ConfigRTG.waterSurfaceLakeChance > 0) { + + + int i2 = chunkX + rand.nextInt(16);// + 8; + int i8 = chunkY + rand.nextInt(16);// + 8; + int l4 = world.getHeight(new BlockPos(i2, 0, i8)).getY(); + + //Surface lakes. + if (rand.nextInt(chunksPerPond) == 0) { + + if (l4 > 63) { + + pondGenerator.generate(world, rand, new BlockPos(i2, l4, i8)); + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoPumpkin.java b/src/api/java/rtg/world/biome/deco/DecoPumpkin.java new file mode 100644 index 00000000..05c9dfe2 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoPumpkin.java @@ -0,0 +1,95 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenPumpkin; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * @author WhichOnesPink + */ +public class DecoPumpkin extends DecoBase { + + public float strengthFactor; + public int maxY; + public float randomFloat; + public RandomType randomType; + public int chance; + public int loops; + + public DecoPumpkin() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.maxY = 255; // No height limit by default. + this.strengthFactor = 0f; // The higher the value, the more there will be. Disabled by default. + this.randomType = RandomType.USE_CHANCE_VALUE; + this.randomFloat = 1f; + this.chance = 1; + this.loops = 1; + + this.addDecoTypes(DecoType.PUMPKIN); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), PUMPKIN)) { + + // Let's figure out what the rand.nextInt() argument should be. + switch (this.randomType) { + case ALWAYS_GENERATE: + this.chance = 1; + break; + + case USE_CHANCE_VALUE: + break; + + case X_DIVIDED_BY_STRENGTH: + this.chance = (int) (this.randomFloat / strength); + break; + + default: + break; + } + + WorldGenerator worldGenerator = new WorldGenPumpkin(); + + this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + for (int i = 0; i < this.loops; i++) { + if (rand.nextInt(this.chance) == 0) { + + int intX = chunkX + rand.nextInt(16) + 8; + int intY = rand.nextInt(this.maxY); + int intZ = chunkY + rand.nextInt(16) + 8; + + if (intY <= this.maxY) { + worldGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } + } + + public enum RandomType { + ALWAYS_GENERATE, + USE_CHANCE_VALUE, + X_DIVIDED_BY_STRENGTH + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoReed.java b/src/api/java/rtg/world/biome/deco/DecoReed.java new file mode 100644 index 00000000..6d2f8a56 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoReed.java @@ -0,0 +1,63 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenReed; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.REED; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * @author WhichOnesPink + */ +public class DecoReed extends DecoBase { + + public float strengthFactor; + public int maxY; + public int loops; + + public DecoReed() { + + super(); + + /* + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.maxY = 255; // No height limit by default. + this.strengthFactor = 0f; // Not sure why it was done like this, but... the higher the value, the more there will be. + this.loops = 1; + + this.addDecoTypes(DecoType.REED); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkY), REED)) { + + WorldGenerator worldGenerator = new WorldGenReed(); + + this.loops = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : this.loops; + for (int i = 0; i < this.loops; i++) { + int intX = chunkX + rand.nextInt(16) + 8; + int intY = rand.nextInt(this.maxY); + int intZ = chunkY + rand.nextInt(16) + 8; + + if (intY <= this.maxY) { + worldGenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/DecoShrub.java b/src/api/java/rtg/world/biome/deco/DecoShrub.java new file mode 100644 index 00000000..00e734df --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoShrub.java @@ -0,0 +1,131 @@ +package rtg.world.biome.deco; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.WorldUtil; +import rtg.util.WorldUtil.SurroundCheckType; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.WorldGenShrubRTG; + +import java.util.Random; + +/** + * @author WhichOnesPink + */ +public class DecoShrub extends DecoBase { + + public int size; + public boolean useDefaultRandom; + public boolean Sand; + public IBlockState[] randomLogBlocks; + public IBlockState[] randomLeavesBlocks; + public float strengthFactor; // Higher = more/bigger shrubs. + public int minY; // Height restriction. + public int maxY; // Height restriction. + public int chance; // Higher = more rare. + public int notEqualsZerochance; + public int loops; + public int minSize; + public int maxSize; + public IBlockState logBlock; + public IBlockState leavesBlock; + + public DecoShrub() { + + super(); + + /* + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.size = -1; + this.useDefaultRandom = false; + this.Sand = true; //Whether shrubs generate on sand + this.randomLogBlocks = new IBlockState[]{Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(1)}; + this.randomLeavesBlocks = new IBlockState[]{Blocks.LEAVES.getDefaultState(), BlockUtil.getStateLeaf(1)}; + this.strengthFactor = 3f; // Not sure why it was done like this, but... the higher the value, the more there will be. + this.minY = 1; // No height limit by default. + this.maxY = 255; // No height limit by default. + this.chance = 1; // 100% chance of generating by default. + this.notEqualsZerochance = 1; + this.loops = 1; + this.minSize = 3; + this.maxSize = 4; + this.logBlock = Blocks.LOG.getDefaultState(); + this.leavesBlock = Blocks.LEAVES.getDefaultState(); + + this.addDecoTypes(DecoType.SHRUB); + } + + public DecoShrub(boolean useDefaultRandom) { + + this(); + this.useDefaultRandom = true; + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + DecoBase.tweakShrubLeaves(this, false, true); + + // Shrub size. + this.size = (this.size == -1) ? rand.nextInt(4) + 1 : this.size; + if (this.minSize > 0 && this.maxSize > 0 && this.maxSize >= this.minSize) { + this.size = this.minSize + rand.nextInt(this.maxSize - this.minSize + 1); + } + + // Do we want random shrubs? + if (this.useDefaultRandom && + this.randomLogBlocks.length > 0 && + this.randomLogBlocks.length == this.randomLeavesBlocks.length) { + int rnd = rand.nextInt(this.randomLogBlocks.length); + + this.logBlock = this.randomLogBlocks[rnd]; + this.leavesBlock = this.randomLeavesBlocks[rnd]; + } + + WorldUtil worldUtil = new WorldUtil(world); + WorldGenerator worldGenerator = new WorldGenShrubRTG(this.size, this.logBlock, this.leavesBlock, this.Sand); + + int loopCount = this.loops; + loopCount = (this.strengthFactor > 0f) ? (int) (this.strengthFactor * strength) : loopCount; + for (int i = 0; i < loopCount; i++) { + int intX = chunkX + rand.nextInt(16);// + 8; + int intZ = chunkY + rand.nextInt(16);// + 8; + int intY = world.getHeight(new BlockPos(intX, 0, intZ)).getY(); + + if (this.notEqualsZerochance > 1) { + + if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.notEqualsZerochance) != 0) { + generateWorldGenerator(worldGenerator, worldUtil, world, rand, intX, intY, intZ, hasPlacedVillageBlocks); + } + } + else { + + if (intY >= this.minY && intY <= this.maxY && rand.nextInt(this.chance) == 0) { + generateWorldGenerator(worldGenerator, worldUtil, world, rand, intX, intY, intZ, hasPlacedVillageBlocks); + } + } + } + } + } + + private boolean generateWorldGenerator(WorldGenerator worldGenerator, WorldUtil worldUtil, World world, Random rand, int x, int y, int z, boolean hasPlacedVillageBlocks) { + // If we're in a village, check to make sure the shrub has extra room to grow to avoid corrupting the village. + if (hasPlacedVillageBlocks) { + if (!worldUtil.isSurroundedByBlock(Blocks.AIR.getDefaultState(), 2, SurroundCheckType.CARDINAL, rand, x, y, z)) { + return false; + } + } + + return worldGenerator.generate(world, rand, new BlockPos(x, y, z)); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/biome/deco/DecoTree.java b/src/api/java/rtg/world/biome/deco/DecoTree.java new file mode 100644 index 00000000..0b52697a --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/DecoTree.java @@ -0,0 +1,278 @@ +package rtg.world.biome.deco; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import net.minecraftforge.event.terraingen.TerrainGen; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.RandomUtil; +import rtg.util.WorldUtil; +import rtg.util.WorldUtil.SurroundCheckType; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.feature.tree.rtg.TreeRTG; + +/** + * @author WhichOnesPink + */ +public class DecoTree extends DecoBase { + + public int loops; + public float strengthFactorForLoops; // If set, this overrides and dynamically calculates 'loops' based on the strength parameter. + public boolean strengthNoiseFactorForLoops; // If true, this overrides and dynamically calculates 'loops' based on (noise * strength) + public boolean strengthNoiseFactorXForLoops; // If true, this overrides and dynamically calculates 'loops' based on (noise * X * strength) + public TreeType treeType; // Enum for the various tree presets. + public TreeRTG tree; + public WorldGenerator worldGen; + public DecoTree.Distribution distribution; // Parameter object for noise calculations. + public TreeCondition treeCondition; // Enum for the various conditions/chances for tree gen. + public float treeConditionNoise; // Only applies to a noise-related TreeCondition. + public int treeConditionChance; // Only applies to a chance-related TreeCondition. + public float treeConditionFloat; // Multi-purpose float. + public int minY; // Lower height restriction. + public int maxY; // Upper height restriction. + public IBlockState logBlock; + public IBlockState leavesBlock; + public int minSize; // Min tree height (only used with certain tree presets) + public int maxSize; // Max tree height (only used with certain tree presets) + public int minTrunkSize; // Min tree height (only used with certain tree presets) + public int maxTrunkSize; // Max tree height (only used with certain tree presets) + public int minCrownSize; // Min tree height (only used with certain tree presets) + public int maxCrownSize; // Max tree height (only used with certain tree presets) + public boolean noLeaves; + public Scatter scatter; + + public DecoTree() { + + super(); + + /** + * Default values. + * These can be overridden when configuring the Deco object in the realistic biome. + */ + this.loops = 1; + this.strengthFactorForLoops = 0f; + this.strengthNoiseFactorForLoops = false; + this.strengthNoiseFactorXForLoops = false; + this.treeType = TreeType.RTG_TREE; + this.tree = null; + this.worldGen = null; + this.distribution = new DecoTree.Distribution(100f, 5f, 0.8f); + this.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + this.treeConditionNoise = 0f; + this.treeConditionFloat = 0f; + this.treeConditionChance = 1; + this.minY = 63; // No underwater trees by default. + this.maxY = 230; // Sensible upper height limit by default. + this.logBlock = Blocks.LOG.getDefaultState(); + this.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.minSize = 2; + this.maxSize = 4; + this.minTrunkSize = 2; + this.maxTrunkSize = 4; + this.minCrownSize = 2; + this.maxCrownSize = 4; + this.noLeaves = false; + this.scatter = new Scatter(16, 0); + + this.addDecoTypes(DecoType.TREE); + } + + public DecoTree(DecoTree source) { + + this(); + this.loops = source.loops; + this.strengthFactorForLoops = source.strengthFactorForLoops; + this.strengthNoiseFactorForLoops = source.strengthNoiseFactorForLoops; + this.strengthNoiseFactorXForLoops = source.strengthNoiseFactorXForLoops; + this.treeType = source.treeType; + this.tree = source.tree; + this.distribution = source.distribution; + this.treeCondition = source.treeCondition; + this.treeConditionNoise = source.treeConditionNoise; + this.treeConditionChance = source.treeConditionChance; + this.minY = source.minY; + this.maxY = source.maxY; + this.logBlock = source.logBlock; + this.leavesBlock = source.leavesBlock; + this.minSize = source.minSize; + this.maxSize = source.maxSize; + this.minTrunkSize = source.minTrunkSize; + this.maxTrunkSize = source.maxTrunkSize; + this.minCrownSize = source.minCrownSize; + this.maxCrownSize = source.maxCrownSize; + this.noLeaves = source.noLeaves; + this.scatter = source.scatter; + } + + public DecoTree(TreeRTG tree) { + + this(); + this.tree = tree; + this.logBlock = tree.logBlock; + this.leavesBlock = tree.leavesBlock; + this.minTrunkSize = tree.minTrunkSize; + this.maxTrunkSize = tree.maxTrunkSize; + this.minCrownSize = tree.minCrownSize; + this.maxCrownSize = tree.maxCrownSize; + this.noLeaves = tree.noLeaves; + } + + public DecoTree(WorldGenerator worldGen) { + + this(); + this.worldGen = worldGen; + } + + public boolean properlyDefined() { + + if (this.treeType == TreeType.RTG_TREE) { + if (this.tree == null) { + return false; + } + } + return super.properlyDefined(); + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkZ, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (TerrainGen.decorate(world, rand, new BlockPos(chunkX, 0, chunkZ), TREE)) { + + WorldUtil worldUtil = new WorldUtil(world); + float noise = simplex.noise2(chunkX / this.distribution.noiseDivisor, chunkZ / this.distribution.noiseDivisor) * this.distribution.noiseFactor + this.distribution.noiseAddend; + + int loopCount = this.loops; + loopCount = (this.strengthFactorForLoops > 0f) ? (int) (this.strengthFactorForLoops * strength) : loopCount; + loopCount = (this.strengthNoiseFactorForLoops) ? (int) (noise * strength) : loopCount; + loopCount = (this.strengthNoiseFactorXForLoops) ? (int) (noise * this.strengthFactorForLoops * strength) : loopCount; + for (int i = 0; i < loopCount; i++) { + int intX = scatter.get(rand, chunkX); // + 8; + int intZ = scatter.get(rand, chunkZ); // + 8; + int intY = world.getHeight(new BlockPos(intX, 0, intZ)).getY(); + + if (intY <= this.maxY && intY >= this.minY && isValidTreeCondition(noise, rand, strength)) { + + // If we're in a village, check to make sure the tree has extra room to grow to avoid corrupting the village. + if (hasPlacedVillageBlocks) { + if (!worldUtil.isSurroundedByBlock(Blocks.AIR.getDefaultState(), 2, SurroundCheckType.CARDINAL, rand, intX, intY, intZ)) { + return; + } + } + + switch (this.treeType) { + + case RTG_TREE: + + this.tree.setLogBlock(this.logBlock); + this.tree.setLeavesBlock(this.leavesBlock); + this.tree.setTrunkSize(RandomUtil.getRandomInt(rand, this.minTrunkSize, this.maxTrunkSize)); + this.tree.setCrownSize(RandomUtil.getRandomInt(rand, this.minCrownSize, this.maxCrownSize)); + this.tree.setNoLeaves(this.noLeaves); + this.tree.generate(world, rand, new BlockPos(intX, intY, intZ)); + + break; + + case WORLDGEN: + + WorldGenerator worldgenerator = this.worldGen; + worldgenerator.generate(world, rand, new BlockPos(intX, intY, intZ)); + + break; + + default: + break; + } + } + } + } + } + } + + public boolean isValidTreeCondition(float noise, Random rand, float strength) { + + switch (this.treeCondition) { + case ALWAYS_GENERATE: + return true; + + case NOISE_GREATER_AND_RANDOM_CHANCE: + return (noise > this.treeConditionNoise && rand.nextInt(this.treeConditionChance) == 0); + + case NOISE_LESSER_AND_RANDOM_CHANCE: + return (noise < this.treeConditionNoise && rand.nextInt(this.treeConditionChance) == 0); + + case RANDOM_CHANCE: + return rand.nextInt(this.treeConditionChance) == 0; + + case X_DIVIDED_BY_STRENGTH: + return rand.nextInt((int) (this.treeConditionFloat / strength)) == 0; + + default: + return false; + } + } + + public enum TreeType { + RTG_TREE, + WORLDGEN; + } + + public enum TreeCondition { + ALWAYS_GENERATE, + NOISE_GREATER_AND_RANDOM_CHANCE, + NOISE_LESSER_AND_RANDOM_CHANCE, + RANDOM_CHANCE, + X_DIVIDED_BY_STRENGTH; + } + + public static class Scatter { + + int bound; + int reach; + + public Scatter(int bound, int reach) { + + if (bound < 1) { + throw new RuntimeException("Scatter bound must be greater than 0."); + }; + + this.bound = bound; + this.reach = reach; + } + + public int get(Random rand, int coord) { + return coord + rand.nextInt(bound) + reach; + } + } + + /** + * Parameter object for noise calculations. + *

+ * simplex.noise2(chunkX / noiseDivisor, chunkZ / noiseDivisor) * noiseFactor + noiseAddend; + * + * @author WhichOnesPink + * @author Zeno410 + */ + public static class Distribution { + + public float noiseDivisor; + public float noiseFactor; + public float noiseAddend; + + public Distribution(float noiseDivisor, float noiseFactor, float noiseAddend) { + + this.noiseDivisor = noiseDivisor; + this.noiseFactor = noiseFactor; + this.noiseAddend = noiseAddend; + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/collection/DecoCollectionBase.java b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionBase.java new file mode 100644 index 00000000..e9f6a4c0 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionBase.java @@ -0,0 +1,64 @@ +package rtg.world.biome.deco.collection; + +import java.util.ArrayList; + +import rtg.world.biome.deco.DecoBase; +import rtg.world.gen.feature.tree.rtg.TreeRTG; + +/** + * @author WhichOnesPink + */ +public class DecoCollectionBase { + + public ArrayList decos; + public ArrayList rtgTrees; + + public DecoCollectionBase() { + + this.decos = new ArrayList(); + this.rtgTrees = new ArrayList(); + } + + public void addDeco(DecoBase deco) { + + if (!deco.properlyDefined()) { + throw new RuntimeException(); + } + this.decos.add(deco); + } + + public void addDeco(DecoBase deco, boolean allowed) { + + if (allowed) { + if (!deco.properlyDefined()) { + throw new RuntimeException(); + } + this.decos.add(deco); + } + } + + /** + * Adds a tree to the list of RTG trees associated with this collection. + * The 'allowed' parameter allows us to pass biome config booleans dynamically when configuring the trees in the collection. + * + * @param tree + * @param allowed + */ + public void addTree(TreeRTG tree, boolean allowed) { + + if (allowed) { + + this.rtgTrees.add(tree); + } + } + + /** + * Convenience method for addTree() where 'allowed' is assumed to be true. + * + * @param tree + */ + public void addTree(TreeRTG tree) { + + this.addTree(tree, true); + } +} diff --git a/src/api/java/rtg/world/biome/deco/collection/DecoCollectionDesert.java b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionDesert.java new file mode 100644 index 00000000..e38e6a7c --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionDesert.java @@ -0,0 +1,35 @@ +package rtg.world.biome.deco.collection; + +import rtg.world.biome.deco.DecoCactus; +import rtg.world.biome.deco.DecoDeadBush; +import rtg.world.biome.deco.DecoDesertWell; + + +/** + * @author WhichOnesPink + */ +public class DecoCollectionDesert extends DecoCollectionBase { + + public DecoCollectionDesert() { + + super(); + + DecoDesertWell decoDesertWell = new DecoDesertWell(); + decoDesertWell.maxY = 80; + decoDesertWell.strengthFactor = 1f; + decoDesertWell.chance = 160; + this.addDeco(decoDesertWell); + + DecoCactus decoCactus = new DecoCactus(); + decoCactus.maxY = 90; + decoCactus.strengthFactor = 3f; + decoCactus.chance = 2; + this.addDeco(decoCactus); + + DecoDeadBush decoDeadBush = new DecoDeadBush(); + decoDeadBush.maxY = 128; + decoDeadBush.strengthFactor = 2f; + decoDeadBush.chance = 3; + this.addDeco(decoDeadBush); + } +} diff --git a/src/api/java/rtg/world/biome/deco/collection/DecoCollectionDesertRiver.java b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionDesertRiver.java new file mode 100644 index 00000000..eca90b98 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionDesertRiver.java @@ -0,0 +1,74 @@ +package rtg.world.biome.deco.collection; + +import net.minecraft.init.Blocks; + +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.DecoTree.TreeCondition; +import rtg.world.biome.deco.DecoTree.TreeType; +import rtg.world.biome.deco.helper.DecoHelperThisOrThat; +import rtg.world.biome.deco.helper.DecoHelperThisOrThat.ChanceType; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGAcaciaBucheri; + + +/** + * @author WhichOnesPink + */ +public class DecoCollectionDesertRiver extends DecoCollectionBase { + + public DecoCollectionDesertRiver() { + + super(); + + TreeRTG acaciaTree = new TreeRTGAcaciaBucheri(); + acaciaTree.logBlock = Blocks.LOG2.getDefaultState(); + acaciaTree.leavesBlock = Blocks.LEAVES2.getDefaultState(); + acaciaTree.minTrunkSize = 12; + acaciaTree.maxTrunkSize = 16; + this.addTree(acaciaTree); + + DecoTree acaciaTrees = new DecoTree(acaciaTree); + acaciaTrees.checkRiver = true; + acaciaTrees.minRiver = 0.86f; + acaciaTrees.loops = 1; + acaciaTrees.treeType = TreeType.RTG_TREE; + acaciaTrees.treeCondition = TreeCondition.ALWAYS_GENERATE; + acaciaTrees.maxY = 65; + this.addDeco(acaciaTrees); + + DecoShrub acaciaShrub = new DecoShrub(); + acaciaShrub.checkRiver = true; + acaciaShrub.minRiver = 0.86f; + acaciaShrub.logBlock = Blocks.LOG2.getDefaultState(); + acaciaShrub.leavesBlock = Blocks.LEAVES2.getDefaultState(); + acaciaShrub.maxY = 65; + acaciaShrub.loops = 1; + acaciaShrub.chance = 1; + this.addDeco(acaciaShrub); + + DecoHelperThisOrThat decoHelperThisOrThat = new DecoHelperThisOrThat(4, ChanceType.NOT_EQUALS_ZERO, acaciaShrub, acaciaTrees); + this.addDeco(decoHelperThisOrThat); + + DecoCactus decoRiverCactus = new DecoCactus(); + decoRiverCactus.checkRiver = true; + decoRiverCactus.minRiver = 0.7f; + decoRiverCactus.maxY = 80; + decoRiverCactus.strengthFactor = 12f; + this.addDeco(decoRiverCactus); + + DecoReed decoReed = new DecoReed(); + decoReed.checkRiver = true; + decoReed.minRiver = 0.7f; + decoReed.maxY = 68; + decoReed.strengthFactor = 2f; + this.addDeco(decoReed); + + DecoGrassDoubleTallgrass decoGrassDoubleTallgrass = new DecoGrassDoubleTallgrass(); + decoGrassDoubleTallgrass.checkRiver = true; + decoGrassDoubleTallgrass.minRiver = 0.7f; + decoGrassDoubleTallgrass.maxY = 128; + decoGrassDoubleTallgrass.loops = 15; + decoGrassDoubleTallgrass.doubleGrassChance = 3; + this.addDeco(decoGrassDoubleTallgrass); + } +} diff --git a/src/api/java/rtg/world/biome/deco/collection/DecoCollectionForest.java b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionForest.java new file mode 100644 index 00000000..3eda1686 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionForest.java @@ -0,0 +1,152 @@ +package rtg.world.biome.deco.collection; + +import net.minecraft.init.Blocks; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenerator; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.DecoFallenTree.LogCondition; +import rtg.world.biome.deco.DecoTree.TreeCondition; +import rtg.world.biome.deco.DecoTree.TreeType; +import rtg.world.biome.deco.helper.DecoHelper5050; +import rtg.world.biome.deco.helper.DecoHelperRandomSplit; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGPiceaSitchensis; +import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; + + +/** + * @author WhichOnesPink + */ +public class DecoCollectionForest extends DecoCollectionBase { + + public DecoCollectionForest(boolean fallenTrees) { + + // Trees first. + + TreeRTG ponderosaOakTree = new TreeRTGPinusPonderosa(); + ponderosaOakTree.logBlock = Blocks.LOG.getDefaultState(); + ponderosaOakTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + ponderosaOakTree.minTrunkSize = 11; + ponderosaOakTree.maxTrunkSize = 21; + ponderosaOakTree.minCrownSize = 15; + ponderosaOakTree.maxCrownSize = 29; + this.addTree(ponderosaOakTree); + + DecoTree oakPines = new DecoTree(ponderosaOakTree); + oakPines.strengthFactorForLoops = 8f; + oakPines.treeType = TreeType.RTG_TREE; + oakPines.distribution.noiseDivisor = 100f; + oakPines.distribution.noiseFactor = 6f; + oakPines.distribution.noiseAddend = 0.8f; + oakPines.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + oakPines.treeConditionNoise = 0f; + oakPines.treeConditionChance = 1; + oakPines.maxY = 85; + + TreeRTG ponderosaSpruceTree = new TreeRTGPinusPonderosa(); + ponderosaSpruceTree.logBlock = BlockUtil.getStateLog(1); + ponderosaSpruceTree.leavesBlock = BlockUtil.getStateLeaf(1); + ponderosaSpruceTree.minTrunkSize = 11; + ponderosaSpruceTree.maxTrunkSize = 21; + ponderosaSpruceTree.minCrownSize = 15; + ponderosaSpruceTree.maxCrownSize = 29; + this.addTree(ponderosaSpruceTree); + + DecoTree sprucePines = new DecoTree(ponderosaSpruceTree); + sprucePines.strengthFactorForLoops = 8f; + sprucePines.treeType = TreeType.RTG_TREE; + sprucePines.distribution.noiseDivisor = 100f; + sprucePines.distribution.noiseFactor = 6f; + sprucePines.distribution.noiseAddend = 0.8f; + sprucePines.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + sprucePines.treeConditionNoise = 0f; + sprucePines.treeConditionChance = 1; + sprucePines.maxY = 85; + + DecoHelper5050 decoPines = new DecoHelper5050(oakPines, sprucePines); + this.addDeco(decoPines); + + // More trees. + + TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); + sitchensisTree.logBlock = Blocks.LOG.getDefaultState(); + sitchensisTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + sitchensisTree.minTrunkSize = 4; + sitchensisTree.maxTrunkSize = 10; + sitchensisTree.minCrownSize = 6; + sitchensisTree.maxCrownSize = 14; + this.addTree(sitchensisTree); + + DecoTree oakPine = new DecoTree(sitchensisTree); + oakPine.strengthFactorForLoops = 3f; + oakPine.treeType = TreeType.RTG_TREE; + oakPine.treeCondition = TreeCondition.RANDOM_CHANCE; + oakPine.treeConditionChance = 4; + oakPine.maxY = 100; + + WorldGenerator vanillaTreeDefinition = new WorldGenTrees(false); + DecoTree vanillaTrees = new DecoTree(vanillaTreeDefinition); + vanillaTrees.strengthFactorForLoops = 3f; + vanillaTrees.treeType = TreeType.WORLDGEN; + vanillaTrees.treeCondition = TreeCondition.RANDOM_CHANCE; + vanillaTrees.treeConditionChance = 4; + vanillaTrees.maxY = 120; + + DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); + decoHelperRandomSplit.decos = new DecoBase[]{oakPine, vanillaTrees}; + decoHelperRandomSplit.chances = new int[]{8, 4}; + this.addDeco(decoHelperRandomSplit); + + // Add some fallen trees of the oak and spruce variety (50/50 distribution). + DecoFallenTree decoFallenOak = new DecoFallenTree(); + decoFallenOak.logCondition = LogCondition.RANDOM_CHANCE; + decoFallenOak.logConditionChance = 16; + decoFallenOak.maxY = 80; + decoFallenOak.logBlock = Blocks.LOG.getDefaultState(); + decoFallenOak.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenOak.minSize = 3; + decoFallenOak.maxSize = 6; + + DecoFallenTree decoFallenSpruce = new DecoFallenTree(); + decoFallenSpruce.logCondition = LogCondition.RANDOM_CHANCE; + decoFallenSpruce.logConditionChance = 24; + decoFallenSpruce.maxY = 80; + decoFallenSpruce.logBlock = BlockUtil.getStateLog(1); + decoFallenSpruce.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenSpruce.minSize = 3; + decoFallenSpruce.maxSize = 6; + + DecoHelper5050 decoFallenTree = new DecoHelper5050(decoFallenOak, decoFallenSpruce); + this.addDeco(decoFallenTree, fallenTrees); + + // Shrubs to fill in the blanks. + DecoShrub decoShrubOak = new DecoShrub(); + decoShrubOak.maxY = 140; + decoShrubOak.strengthFactor = 4f; + decoShrubOak.chance = 3; + this.addDeco(decoShrubOak); + + DecoShrub decoShrubSpruce = new DecoShrub(); + decoShrubSpruce.logBlock = BlockUtil.getStateLog(1); + decoShrubSpruce.leavesBlock = BlockUtil.getStateLeaf(1); + decoShrubSpruce.maxY = 140; + decoShrubSpruce.strengthFactor = 4f; + decoShrubSpruce.chance = 9; + this.addDeco(decoShrubSpruce); + + // Only 1-block tall flowers so we can see the trees better. + DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); + decoFlowersRTG.flowers = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + decoFlowersRTG.maxY = 128; + decoFlowersRTG.strengthFactor = 6f; + this.addDeco(decoFlowersRTG); + + // Grass filler. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.minY = 60; + decoGrass.maxY = 128; + decoGrass.loops = 8; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/deco/collection/DecoCollectionMegaTaiga.java b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionMegaTaiga.java new file mode 100644 index 00000000..2eb05e73 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionMegaTaiga.java @@ -0,0 +1,81 @@ +package rtg.world.biome.deco.collection; + +import net.minecraft.init.Blocks; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBase; +import rtg.world.biome.deco.DecoTree; +import rtg.world.biome.deco.DecoTree.TreeCondition; +import rtg.world.biome.deco.DecoTree.TreeType; +import rtg.world.biome.deco.helper.DecoHelperRandomSplit; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGPiceaPungens; +import rtg.world.gen.feature.tree.rtg.TreeRTGPiceaSitchensis; +import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; + + +/** + * @author WhichOnesPink + */ +public class DecoCollectionMegaTaiga extends DecoCollectionBase { + + public DecoCollectionMegaTaiga() { + + super(); + + TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); + sitchensisTree.logBlock = BlockUtil.getStateLog(1); + sitchensisTree.leavesBlock = BlockUtil.getStateLeaf(1); + sitchensisTree.minTrunkSize = 4; + sitchensisTree.maxTrunkSize = 9; + sitchensisTree.minCrownSize = 5; + sitchensisTree.maxCrownSize = 14; + this.addTree(sitchensisTree); + + DecoTree smallPines = new DecoTree(sitchensisTree); + smallPines.strengthNoiseFactorXForLoops = true; + smallPines.strengthFactorForLoops = 4f; + smallPines.treeType = TreeType.RTG_TREE; + smallPines.treeCondition = TreeCondition.ALWAYS_GENERATE; + smallPines.treeConditionChance = 3; + smallPines.maxY = 100; + + TreeRTG pungensTree = new TreeRTGPiceaPungens(); + pungensTree.logBlock = BlockUtil.getStateLog(1); + pungensTree.leavesBlock = BlockUtil.getStateLeaf(1); + pungensTree.minTrunkSize = 2; + pungensTree.maxTrunkSize = 7; + pungensTree.minCrownSize = 6; + pungensTree.maxCrownSize = 17; + this.addTree(pungensTree); + + DecoTree spruceTrees = new DecoTree(pungensTree); + spruceTrees.strengthNoiseFactorXForLoops = true; + spruceTrees.strengthFactorForLoops = 4f; + spruceTrees.treeType = TreeType.RTG_TREE; + spruceTrees.treeCondition = TreeCondition.ALWAYS_GENERATE; + spruceTrees.treeConditionChance = 1; + spruceTrees.maxY = 100; + + TreeRTG ponderosaTree = new TreeRTGPinusPonderosa(); + ponderosaTree.logBlock = Blocks.LOG.getDefaultState(); + ponderosaTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + ponderosaTree.minTrunkSize = 11; + ponderosaTree.maxTrunkSize = 21; + ponderosaTree.minCrownSize = 15; + ponderosaTree.maxCrownSize = 29; + this.addTree(ponderosaTree); + + DecoTree oakPines = new DecoTree(ponderosaTree); + oakPines.strengthNoiseFactorXForLoops = true; + oakPines.strengthFactorForLoops = 4f; + oakPines.treeType = TreeType.RTG_TREE; + oakPines.treeCondition = TreeCondition.ALWAYS_GENERATE; + oakPines.treeConditionChance = 1; + oakPines.maxY = 100; + + DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); + decoHelperRandomSplit.decos = new DecoBase[]{spruceTrees, smallPines, oakPines}; + decoHelperRandomSplit.chances = new int[]{8, 2, 2}; + this.addDeco(decoHelperRandomSplit); + } +} diff --git a/src/api/java/rtg/world/biome/deco/collection/DecoCollectionSavanna.java b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionSavanna.java new file mode 100644 index 00000000..3e229c0e --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionSavanna.java @@ -0,0 +1,76 @@ +package rtg.world.biome.deco.collection; + +import net.minecraft.init.Blocks; + +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.DecoFallenTree.LogCondition; +import rtg.world.biome.deco.DecoTree.TreeCondition; +import rtg.world.biome.deco.DecoTree.TreeType; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGAcaciaBucheri; + + +/** + * @author WhichOnesPink + */ +public class DecoCollectionSavanna extends DecoCollectionBase { + + public DecoCollectionSavanna(boolean fallenTrees) { + + DecoShrub acaciaShrub = new DecoShrub(); + acaciaShrub.logBlock = Blocks.LOG2.getDefaultState(); + acaciaShrub.leavesBlock = Blocks.LEAVES2.getDefaultState(); + acaciaShrub.maxY = 160; + acaciaShrub.strengthFactor = 2f; + acaciaShrub.chance = 12; + this.addDeco(acaciaShrub); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.loops = 1; + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 36; + decoFallenTree.logBlock = Blocks.LOG2.getDefaultState(); + decoFallenTree.leavesBlock = Blocks.LEAVES2.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, fallenTrees); + + TreeRTG bucheriTree = new TreeRTGAcaciaBucheri(); + bucheriTree.logBlock = Blocks.LOG2.getDefaultState(); + bucheriTree.leavesBlock = Blocks.LEAVES2.getDefaultState(); + bucheriTree.minTrunkSize = 4; + bucheriTree.maxTrunkSize = 9; + this.addTree(bucheriTree); + + DecoTree bucheriTrees = new DecoTree(bucheriTree); + bucheriTrees.loops = 1; + bucheriTrees.treeType = TreeType.RTG_TREE; + bucheriTrees.distribution.noiseDivisor = 80f; + bucheriTrees.distribution.noiseFactor = 60f; + bucheriTrees.distribution.noiseAddend = -15f; + bucheriTrees.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + bucheriTrees.treeConditionNoise = -0.4f; + bucheriTrees.treeConditionChance = 28; + this.addDeco(bucheriTrees); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.chance = 32; + decoBoulder.maxY = 95; + this.addDeco(decoBoulder); + + DecoDoubleGrass decoDoubleGrass = new DecoDoubleGrass(); + decoDoubleGrass.maxY = 128; + decoDoubleGrass.strengthFactor = 3f; + this.addDeco(decoDoubleGrass); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 10f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/deco/collection/DecoCollectionSmallPineTreesForest.java b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionSmallPineTreesForest.java new file mode 100644 index 00000000..9fa159c5 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionSmallPineTreesForest.java @@ -0,0 +1,50 @@ +package rtg.world.biome.deco.collection; + +import net.minecraft.init.Blocks; +import net.minecraft.world.gen.feature.WorldGenTrees; + +import rtg.world.biome.deco.DecoBase; +import rtg.world.biome.deco.DecoTree; +import rtg.world.biome.deco.DecoTree.TreeCondition; +import rtg.world.biome.deco.DecoTree.TreeType; +import rtg.world.biome.deco.helper.DecoHelperRandomSplit; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGPiceaSitchensis; + + +/** + * @author WhichOnesPink + */ +public class DecoCollectionSmallPineTreesForest extends DecoCollectionBase { + + public DecoCollectionSmallPineTreesForest() { + + TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); + sitchensisTree.logBlock = Blocks.LOG.getDefaultState(); + sitchensisTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + sitchensisTree.minTrunkSize = 4; + sitchensisTree.maxTrunkSize = 10; + sitchensisTree.minCrownSize = 6; + sitchensisTree.maxCrownSize = 14; + this.addTree(sitchensisTree); + + DecoTree oakPine = new DecoTree(sitchensisTree); + oakPine.strengthFactorForLoops = 3f; + oakPine.treeType = TreeType.RTG_TREE; + oakPine.treeCondition = TreeCondition.RANDOM_CHANCE; + oakPine.treeConditionChance = 4; + oakPine.maxY = 110; + + DecoTree vanillaTrees = new DecoTree(new WorldGenTrees(false)); + vanillaTrees.strengthFactorForLoops = 3f; + vanillaTrees.treeType = TreeType.WORLDGEN; + vanillaTrees.treeCondition = TreeCondition.RANDOM_CHANCE; + vanillaTrees.treeConditionChance = 4; + vanillaTrees.maxY = 110; + + DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); + decoHelperRandomSplit.decos = new DecoBase[]{oakPine, vanillaTrees}; + decoHelperRandomSplit.chances = new int[]{8, 4}; + this.addDeco(decoHelperRandomSplit); + } +} diff --git a/src/api/java/rtg/world/biome/deco/collection/DecoCollectionTaiga.java b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionTaiga.java new file mode 100644 index 00000000..8625e750 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/collection/DecoCollectionTaiga.java @@ -0,0 +1,218 @@ +package rtg.world.biome.deco.collection; + +import net.minecraft.init.Blocks; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.DecoFallenTree.LogCondition; +import rtg.world.biome.deco.DecoTree.TreeCondition; +import rtg.world.biome.deco.DecoTree.TreeType; +import rtg.world.biome.deco.helper.DecoHelperThisOrThat; +import rtg.world.biome.deco.helper.DecoHelperThisOrThat.ChanceType; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGCupressusSempervirens; +import rtg.world.gen.feature.tree.rtg.TreeRTGPiceaSitchensis; + + +/** + * @author WhichOnesPink + */ +public class DecoCollectionTaiga extends DecoCollectionBase { + + public DecoCollectionTaiga(boolean fallenTrees, float grassStrengthFactor) { + + super(); + + TreeRTG sempervirensSpruceTree1 = new TreeRTGCupressusSempervirens(); + sempervirensSpruceTree1.logBlock = BlockUtil.getStateLog(1); + sempervirensSpruceTree1.leavesBlock = BlockUtil.getStateLeaf(1); + sempervirensSpruceTree1.minTrunkSize = 3; + sempervirensSpruceTree1.maxTrunkSize = 7; + sempervirensSpruceTree1.minCrownSize = 5; + sempervirensSpruceTree1.maxCrownSize = 10; + this.addTree(sempervirensSpruceTree1); + + DecoTree bigSpruceTrees1 = new DecoTree(sempervirensSpruceTree1); + bigSpruceTrees1.strengthFactorForLoops = 4f; + bigSpruceTrees1.treeType = TreeType.RTG_TREE; + bigSpruceTrees1.distribution.noiseDivisor = 100f; + bigSpruceTrees1.distribution.noiseFactor = 6f; + bigSpruceTrees1.distribution.noiseAddend = 0.8f; + bigSpruceTrees1.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + bigSpruceTrees1.treeConditionNoise = 0f; + bigSpruceTrees1.treeConditionChance = 1; + bigSpruceTrees1.maxY = 110; + + TreeRTG sempervirensSpruceOakTree1 = new TreeRTGCupressusSempervirens(); + sempervirensSpruceOakTree1.logBlock = BlockUtil.getStateLog(1); + sempervirensSpruceOakTree1.leavesBlock = Blocks.LEAVES.getDefaultState(); + sempervirensSpruceOakTree1.minTrunkSize = 3; + sempervirensSpruceOakTree1.maxTrunkSize = 7; + sempervirensSpruceOakTree1.minCrownSize = 5; + sempervirensSpruceOakTree1.maxCrownSize = 10; + this.addTree(sempervirensSpruceOakTree1); + + DecoTree bigSpruceOakTrees1 = new DecoTree(sempervirensSpruceOakTree1); + bigSpruceOakTrees1.strengthFactorForLoops = 4f; + bigSpruceOakTrees1.treeType = TreeType.RTG_TREE; + bigSpruceOakTrees1.distribution.noiseDivisor = 100f; + bigSpruceOakTrees1.distribution.noiseFactor = 6f; + bigSpruceOakTrees1.distribution.noiseAddend = 0.8f; + bigSpruceOakTrees1.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + bigSpruceOakTrees1.treeConditionNoise = 0f; + bigSpruceOakTrees1.treeConditionChance = 1; + bigSpruceOakTrees1.maxY = 110; + + DecoHelperThisOrThat decoHelperThisOrThat1 = new DecoHelperThisOrThat(4, ChanceType.NOT_EQUALS_ZERO, bigSpruceTrees1, bigSpruceOakTrees1); + this.addDeco(decoHelperThisOrThat1); + + TreeRTG sempervirensSpruceTree2 = new TreeRTGCupressusSempervirens(); + sempervirensSpruceTree2.logBlock = BlockUtil.getStateLog(1); + sempervirensSpruceTree2.leavesBlock = BlockUtil.getStateLeaf(1); + sempervirensSpruceTree2.minTrunkSize = 3; + sempervirensSpruceTree2.maxTrunkSize = 7; + sempervirensSpruceTree2.minCrownSize = 5; + sempervirensSpruceTree2.maxCrownSize = 10; + this.addTree(sempervirensSpruceTree2); + + DecoTree bigSpruceTrees2 = new DecoTree(sempervirensSpruceTree2); + bigSpruceTrees2.strengthFactorForLoops = 4f; + bigSpruceTrees2.treeType = TreeType.RTG_TREE; + bigSpruceTrees2.distribution.noiseDivisor = 80f; + bigSpruceTrees2.distribution.noiseFactor = 60f; + bigSpruceTrees2.distribution.noiseAddend = -15f; + bigSpruceTrees2.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + bigSpruceTrees2.treeConditionNoise = 0f; + bigSpruceTrees2.treeConditionChance = 1; + bigSpruceTrees2.maxY = 110; + + TreeRTG sempervirensSpruceOakTree2 = new TreeRTGCupressusSempervirens(); + sempervirensSpruceOakTree2.logBlock = BlockUtil.getStateLog(1); + sempervirensSpruceOakTree2.leavesBlock = Blocks.LEAVES.getDefaultState(); + sempervirensSpruceOakTree2.minTrunkSize = 3; + sempervirensSpruceOakTree2.maxTrunkSize = 7; + sempervirensSpruceOakTree2.minCrownSize = 5; + sempervirensSpruceOakTree2.maxCrownSize = 10; + this.addTree(sempervirensSpruceOakTree2); + + DecoTree bigSpruceOakTrees2 = new DecoTree(sempervirensSpruceOakTree2); + bigSpruceOakTrees2.strengthFactorForLoops = 4f; + bigSpruceOakTrees2.treeType = TreeType.RTG_TREE; + bigSpruceOakTrees2.distribution.noiseDivisor = 80f; + bigSpruceOakTrees2.distribution.noiseFactor = 60f; + bigSpruceOakTrees2.distribution.noiseAddend = -15f; + bigSpruceOakTrees2.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + bigSpruceOakTrees2.treeConditionNoise = 0f; + bigSpruceOakTrees2.treeConditionChance = 1; + bigSpruceOakTrees2.maxY = 110; + + DecoHelperThisOrThat decoHelperThisOrThat2 = new DecoHelperThisOrThat(4, ChanceType.NOT_EQUALS_ZERO, bigSpruceTrees2, bigSpruceOakTrees2); + this.addDeco(decoHelperThisOrThat2); + + TreeRTG sempervirensSpruceTree3 = new TreeRTGCupressusSempervirens(); + sempervirensSpruceTree3.logBlock = BlockUtil.getStateLog(1); + sempervirensSpruceTree3.leavesBlock = BlockUtil.getStateLeaf(1); + sempervirensSpruceTree3.minTrunkSize = 3; + sempervirensSpruceTree3.maxTrunkSize = 7; + sempervirensSpruceTree3.minCrownSize = 5; + sempervirensSpruceTree3.maxCrownSize = 10; + this.addTree(sempervirensSpruceTree3); + + DecoTree bigSpruceTrees3 = new DecoTree(sempervirensSpruceTree3); + bigSpruceTrees3.strengthFactorForLoops = 3f; + bigSpruceTrees3.treeType = TreeType.RTG_TREE; + bigSpruceTrees3.distribution.noiseDivisor = 80f; + bigSpruceTrees3.distribution.noiseFactor = 60f; + bigSpruceTrees3.distribution.noiseAddend = -15f; + bigSpruceTrees3.treeCondition = TreeCondition.RANDOM_CHANCE; + bigSpruceTrees3.treeConditionChance = 2; + bigSpruceTrees3.maxY = 120; + + TreeRTG sempervirensSpruceOakTree3 = new TreeRTGCupressusSempervirens(); + sempervirensSpruceOakTree3.logBlock = BlockUtil.getStateLog(1); + sempervirensSpruceOakTree3.leavesBlock = Blocks.LEAVES.getDefaultState(); + sempervirensSpruceOakTree3.minTrunkSize = 3; + sempervirensSpruceOakTree3.maxTrunkSize = 7; + sempervirensSpruceOakTree3.minCrownSize = 5; + sempervirensSpruceOakTree3.maxCrownSize = 10; + this.addTree(sempervirensSpruceOakTree3); + + DecoTree bigSpruceOakTrees3 = new DecoTree(sempervirensSpruceOakTree3); + bigSpruceOakTrees3.strengthFactorForLoops = 3f; + bigSpruceOakTrees3.treeType = TreeType.RTG_TREE; + bigSpruceOakTrees3.distribution.noiseDivisor = 80f; + bigSpruceOakTrees3.distribution.noiseFactor = 60f; + bigSpruceOakTrees3.distribution.noiseAddend = -15f; + bigSpruceOakTrees3.treeCondition = TreeCondition.RANDOM_CHANCE; + bigSpruceOakTrees3.treeConditionChance = 2; + bigSpruceOakTrees3.maxY = 120; + + DecoHelperThisOrThat decoHelperThisOrThat3 = new DecoHelperThisOrThat(4, ChanceType.NOT_EQUALS_ZERO, bigSpruceTrees3, bigSpruceOakTrees3); + this.addDeco(decoHelperThisOrThat3); + + TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); + sitchensisTree.logBlock = BlockUtil.getStateLog(1); + sitchensisTree.leavesBlock = BlockUtil.getStateLeaf(1); + sitchensisTree.minTrunkSize = 4; + sitchensisTree.maxTrunkSize = 9; + sitchensisTree.minCrownSize = 5; + sitchensisTree.maxCrownSize = 14; + this.addTree(sitchensisTree); + + DecoTree decoTrees = new DecoTree(sitchensisTree); + decoTrees.strengthFactorForLoops = 4f; + decoTrees.treeType = TreeType.RTG_TREE; + decoTrees.treeCondition = TreeCondition.RANDOM_CHANCE; + decoTrees.treeConditionChance = 3; + decoTrees.maxY = 120; + this.addDeco(decoTrees); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 32; + decoFallenTree.logBlock = BlockUtil.getStateLog(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, fallenTrees); + + DecoShrub decoShrubSpruce = new DecoShrub(); + decoShrubSpruce.logBlock = BlockUtil.getStateLog(1); + decoShrubSpruce.leavesBlock = BlockUtil.getStateLeaf(1); + decoShrubSpruce.maxY = 100; + decoShrubSpruce.strengthFactor = 3f; + decoShrubSpruce.chance = 6; + this.addDeco(decoShrubSpruce); + +// DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); +// decoBaseBiomeDecorations.equalsZeroChance = 3; +// this.addDeco(decoBaseBiomeDecorations); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 20; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + DecoPumpkin decoPumpkin = new DecoPumpkin(); + decoPumpkin.maxY = 90; + decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; + decoPumpkin.randomFloat = 32f; + this.addDeco(decoPumpkin); + + DecoMushrooms decoMushrooms = new DecoMushrooms(); + decoMushrooms.maxY = 90; + decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; + decoMushrooms.randomFloat = 24f; + this.addDeco(decoMushrooms); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = grassStrengthFactor; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/deco/helper/DecoHelper5050.java b/src/api/java/rtg/world/biome/deco/helper/DecoHelper5050.java new file mode 100644 index 00000000..b371ef17 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/helper/DecoHelper5050.java @@ -0,0 +1,47 @@ +package rtg.world.biome.deco.helper; + +import java.util.Random; + +import net.minecraft.world.World; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.DecoBase; +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * This deco helper takes two deco objects and generates one of them at random. + * + * @author WhichOnesPink + */ +public class DecoHelper5050 extends DecoBase { + + private DecoBase deco1; + private DecoBase deco2; + + public DecoHelper5050(DecoBase deco1, DecoBase deco2) { + + super(); + + if (deco1 instanceof DecoHelper5050 || deco2 instanceof DecoHelper5050) { + throw new RuntimeException("DecoHelper5050 cannot accept itself as a parameter."); + } + + this.deco1 = deco1; + this.deco2 = deco2; + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (rand.nextBoolean()) { + this.deco1.generate(biome, world, rand, chunkX, chunkY, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + else { + this.deco2.generate(biome, world, rand, chunkX, chunkY, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/helper/DecoHelperBorder.java b/src/api/java/rtg/world/biome/deco/helper/DecoHelperBorder.java new file mode 100644 index 00000000..4d8a623f --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/helper/DecoHelperBorder.java @@ -0,0 +1,52 @@ +package rtg.world.biome.deco.helper; + +import java.util.Random; + +import net.minecraft.world.World; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.DecoBase; +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * @author Zeno410 + */ +public class DecoHelperBorder extends DecoBase { + + private DecoBase adjusted; + private float allAbove; + private float noneBelow; + + public DecoHelperBorder(DecoBase toAdjust, float allAbove, float noneBelow) { + + super(); + if (allAbove < noneBelow) { + throw new RuntimeException("Above and below parameters swapped"); + } + this.adjusted = toAdjust; + this.allAbove = allAbove; + this.noneBelow = noneBelow; + if (!toAdjust.properlyDefined()) { + throw new RuntimeException(); + } + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (strength < noneBelow) { + return; // border is too low + } + if (strength >= allAbove) { + // call with border 1 + adjusted.generate(biome, world, rand, chunkX, chunkY, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + else { + // call with interpolated border + float adjustedStrength = (strength - noneBelow) / (allAbove - noneBelow); + adjusted.generate(biome, world, rand, chunkX, chunkY, simplex, cell, adjustedStrength, river, hasPlacedVillageBlocks); + } + + } +} diff --git a/src/api/java/rtg/world/biome/deco/helper/DecoHelperOneIn.java b/src/api/java/rtg/world/biome/deco/helper/DecoHelperOneIn.java new file mode 100644 index 00000000..85892164 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/helper/DecoHelperOneIn.java @@ -0,0 +1,42 @@ +package rtg.world.biome.deco.helper; + +/** + * This deco helper has a one in x chance of called a given deco + * + * @author Zeno410 + */ + +import java.util.Random; + +import net.minecraft.world.World; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.DecoBase; +import rtg.world.biome.realistic.RealisticBiomeBase; + +public class DecoHelperOneIn extends DecoBase { + + private DecoBase deco; + private int chances; + + public DecoHelperOneIn(DecoBase deco, int chances) { + + super(); + + this.deco = deco; + this.chances = chances; + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (rand.nextInt(this.chances) == 0) { + + this.deco.generate(biome, world, rand, chunkX, chunkY, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/biome/deco/helper/DecoHelperRandomSplit.java b/src/api/java/rtg/world/biome/deco/helper/DecoHelperRandomSplit.java new file mode 100644 index 00000000..426601cf --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/helper/DecoHelperRandomSplit.java @@ -0,0 +1,66 @@ +package rtg.world.biome.deco.helper; + +import java.util.Random; + +import net.minecraft.world.World; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.DecoBase; +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * This deco helper takes an array of deco objects and an array of chances and generates one accordingly. + * + * @author WhichOnesPink + */ +public class DecoHelperRandomSplit extends DecoBase { + + public DecoBase[] decos; + public int[] chances; + + public DecoHelperRandomSplit() { + + super(); + + this.decos = new DecoBase[]{}; + this.chances = new int[]{}; + } + + public boolean properlyDefined() { + + for (int i = 0; i < decos.length; i++) { + if (!decos[i].properlyDefined()) { + return false; + } + } + return true; + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + if (this.decos.length < 1 || this.chances.length < 1 || this.decos.length != this.chances.length) { + throw new RuntimeException("DecoHelperRandomSplit is confused."); + } + + int totalChances = 0; + for (int i = 0; i < this.decos.length; i++) { + totalChances += chances[i]; + } + int chosen = rand.nextInt(totalChances); + + for (int i = 0; i < this.decos.length; i++) { + + if (chosen < (this.chances[i])) { + + this.decos[i].generate(biome, world, rand, chunkX, chunkY, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + // decrement chosen for the chances missed and continue; + chosen -= chances[i]; + } + } + } +} diff --git a/src/api/java/rtg/world/biome/deco/helper/DecoHelperThisOrThat.java b/src/api/java/rtg/world/biome/deco/helper/DecoHelperThisOrThat.java new file mode 100644 index 00000000..f76dda11 --- /dev/null +++ b/src/api/java/rtg/world/biome/deco/helper/DecoHelperThisOrThat.java @@ -0,0 +1,80 @@ +package rtg.world.biome.deco.helper; + +/** + * This deco helper has a one in x chance of called a given deco + * + * @author Zeno410 + */ + +import java.util.Random; + +import net.minecraft.world.World; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.DecoBase; +import rtg.world.biome.realistic.RealisticBiomeBase; + +public class DecoHelperThisOrThat extends DecoBase { + + public int chance; + public ChanceType chanceType; + private DecoBase decoThis; + private DecoBase decoThat; + + public DecoHelperThisOrThat(int chance, ChanceType chanceType, DecoBase decoThis, DecoBase decoThat) { + + super(); + + this.chance = chance; + this.chanceType = chanceType; + this.decoThis = decoThis; + this.decoThat = decoThat; + if (!decoThis.properlyDefined()) { + throw new RuntimeException(); + } + if (!decoThat.properlyDefined()) { + throw new RuntimeException(); + } + } + + @Override + public void generate(RealisticBiomeBase biome, World world, Random rand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float strength, float river, boolean hasPlacedVillageBlocks) { + + if (this.allowed) { + + switch (this.chanceType) { + case EQUALS_ZERO: + + if (rand.nextInt(this.chance) == 0) { + this.decoThis.generate(biome, world, rand, chunkX, chunkY, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + else { + this.decoThat.generate(biome, world, rand, chunkX, chunkY, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + + break; + + case NOT_EQUALS_ZERO: + + if (rand.nextInt(this.chance) != 0) { + this.decoThis.generate(biome, world, rand, chunkX, chunkY, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + else { + this.decoThat.generate(biome, world, rand, chunkX, chunkY, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + + break; + + default: + break; + + } + } + } + + public enum ChanceType { + EQUALS_ZERO, + NOT_EQUALS_ZERO; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/biome/realistic/RealisticBiomeBase.java b/src/api/java/rtg/world/biome/realistic/RealisticBiomeBase.java new file mode 100644 index 00000000..c815be00 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/RealisticBiomeBase.java @@ -0,0 +1,513 @@ +package rtg.world.biome.realistic; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.config.rtg.ConfigRTG; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.SaplingUtil; +import rtg.util.SimplexOctave; +import rtg.world.biome.BiomeAnalyzer; +import rtg.world.biome.BiomeDecoratorRTG; +import rtg.world.biome.IBiomeProviderRTG; +import rtg.world.biome.deco.DecoBase; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.collection.DecoCollectionBase; +import rtg.world.gen.feature.WorldGenVolcano; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.surface.SurfaceGeneric; +import rtg.world.gen.terrain.TerrainBase; + +@SuppressWarnings({"WeakerAccess", "UnusedParameters", "unused"}) +public class RealisticBiomeBase { + + private static final RealisticBiomeBase[] arrRealisticBiomeIds = + new RealisticBiomeBase[256]; + public final Biome baseBiome; + public final Biome riverBiome; + public final Biome beachBiome; + public BiomeConfig config; + + public TerrainBase terrain; + + public SurfaceBase[] surfaces; + public int surfacesLength; + public SurfaceBase surfaceGeneric; + + public BiomeDecoratorRTG rDecorator; + + public int waterSurfaceLakeChance; //Lower = more frequent + public int lavaSurfaceLakeChance; //Lower = more frequent + + public int waterUndergroundLakeChance; //Lower = more frequent + public int lavaUndergroundLakeChance; //Lower = more frequent + + public boolean generateVillages; + + public boolean generatesEmeralds; + public boolean generatesSilverfish; + + public ArrayList decos; + public ArrayList rtgTrees; + + // lake calculations + + private float lakeInterval = 989.0f; + private float lakeShoreLevel = 0.15f; + private float lakeWaterLevel = 0.11f;// the lakeStrength below which things should be below water + private float lakeDepressionLevel = 0.30f;// the lakeStrength below which land should start to be lowered + public boolean noLakes = false; + public boolean noWaterFeatures = false; + + private float largeBendSize = 100; + private float mediumBendSize = 40; + private float smallBendSize = 15; + + public boolean disallowStoneBeaches = false; // this is for rugged biomes that should have sand beaches + public boolean disallowAllBeaches = false; + + public RealisticBiomeBase(BiomeConfig config, Biome biome) { + + this(config, biome, Biomes.RIVER); + } + + public RealisticBiomeBase(BiomeConfig config, Biome biome, Biome river) { + + if (config == null) throw new RuntimeException("Biome config cannot be NULL when instantiating a realistic biome."); + this.config = config; + arrRealisticBiomeIds[Biome.getIdForBiome(biome)] = this; + baseBiome = biome; + riverBiome = river; + beachBiome = this.beachBiome(); + + rDecorator = new BiomeDecoratorRTG(this); + + waterSurfaceLakeChance = 10; + lavaSurfaceLakeChance = 0; // Disabled. + + waterUndergroundLakeChance = 1; + lavaUndergroundLakeChance = 1; + + generateVillages = true; + + generatesEmeralds = false; + generatesSilverfish = false; + decos = new ArrayList<>(); + rtgTrees = new ArrayList<>(); + + /* + * Disable base biome decorations by default. + * This also needs to be here so that ores get generated. + */ + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.allowed = false; + this.addDeco(decoBaseBiomeDecorations); + // set the water feature constants with the config changes + this.lakeInterval *= ConfigRTG.lakeFrequencyMultiplier; + this.lakeWaterLevel *= ConfigRTG.lakeSizeMultiplier(); + this.lakeShoreLevel *= ConfigRTG.lakeSizeMultiplier(); + this.lakeDepressionLevel *= ConfigRTG.lakeSizeMultiplier(); + + this.largeBendSize *= ConfigRTG.lakeFrequencyMultiplier; + this.mediumBendSize *= ConfigRTG.lakeFrequencyMultiplier; + this.smallBendSize *= ConfigRTG.lakeFrequencyMultiplier; + } + + public static RealisticBiomeBase getBiome(int id) { return arrRealisticBiomeIds[id]; } + public static RealisticBiomeBase[] arr() { return arrRealisticBiomeIds; } + + public RealisticBiomeBase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase[] s) { + + this(config, b, riverbiome); + + terrain = t; + + surfaces = s; + surfacesLength = s.length; + } + + public RealisticBiomeBase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase s) { + + this(config, b, riverbiome, t, new SurfaceBase[]{s}); + + surfaceGeneric = new SurfaceGeneric(config, s.getTopBlock(), s.getFillerBlock()); + } + + /* + * Returns the beach biome to use for this biome. + * By default, it uses the beach that has been set in the biome config. + * If automatic beach detection is enabled (-1), it uses the supplied preferred beach. + */ + protected Biome beachBiome(Biome preferredBeach) { + + Biome beach; + int configBeachId = this.config._int(BiomeConfig.beachBiomeId); + + if (configBeachId > -1 && configBeachId < 256) { + beach = Biome.getBiome(configBeachId, preferredBeach); + } + else { + beach = preferredBeach; + } + + return beach; + } + + /* + * Returns the beach biome to use for this biome, with a dynamically-calculated preferred beach. + */ + public Biome beachBiome() { + return this.beachBiome(BiomeAnalyzer.getPreferredBeachForBiome(this.baseBiome)); + } + + public void rMapVolcanoes( + ChunkPrimer primer, World world, IBiomeProviderRTG cmr, + Random mapRand, int baseX, int baseY, int chunkX, int chunkY, + OpenSimplexNoise simplex, CellNoise cell, float noise[]) { + + // Have volcanoes been disabled in the global config? + if (!ConfigRTG.enableVolcanoes) return; + + // Have volcanoes been disabled in the biome config? + int biomeId = Biome.getIdForBiome(cmr.getBiomeGenAt(baseX * 16, baseY * 16)); + RealisticBiomeBase realisticBiome = getBiome(biomeId); + // Do we need to patch the biome? + if (realisticBiome == null) { + RealisticBiomePatcher biomePatcher = new RealisticBiomePatcher(); + realisticBiome = biomePatcher.getPatchedRealisticBiome( + "NULL biome (" + biomeId + ") found when mapping volcanoes."); + } + if (!realisticBiome.config._boolean(BiomeConfig.allowVolcanoesId)) return; + + // Have volcanoes been disabled via frequency? + // Use the global frequency unless the biome frequency has been explicitly set. + int chance = realisticBiome.config._int(BiomeConfig.volcanoChanceId) == -1 ? ConfigRTG.volcanoChance : realisticBiome.config._int(BiomeConfig.volcanoChanceId); + if (chance < 1) return; + + // If we've made it this far, let's go ahead and generate the volcano. Exciting!!! :D + if (baseX % 4 == 0 && baseY % 4 == 0 && mapRand.nextInt(chance) == 0) { + + float river = cmr.getRiverStrength(baseX * 16, baseY * 16) + 1f; + if (river > 0.98f && cmr.isBorderlessAt(baseX * 16, baseY * 16)) { + long i1 = mapRand.nextLong() / 2L * 2L + 1L; + long j1 = mapRand.nextLong() / 2L * 2L + 1L; + mapRand.setSeed((long) chunkX * i1 + (long) chunkY * j1 ^ world.getSeed()); + + WorldGenVolcano.build(primer, world, mapRand, baseX, baseY, chunkX, chunkY, simplex, cell, noise); + } + } + } + + public void generateMapGen(ChunkPrimer primer, Long seed, World world, IBiomeProviderRTG cmr, Random mapRand, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float noise[]) { + + // Have volcanoes been disabled in the global config? + if (!ConfigRTG.enableVolcanoes) return; + + final int mapGenRadius = 5; + final int volcanoGenRadius = 15; + + mapRand.setSeed(seed); + long l = (mapRand.nextLong() / 2L) * 2L + 1L; + long l1 = (mapRand.nextLong() / 2L) * 2L + 1L; + + // Volcanoes generation + for (int baseX = chunkX - volcanoGenRadius; baseX <= chunkX + volcanoGenRadius; baseX++) { + for (int baseY = chunkY - volcanoGenRadius; baseY <= chunkY + volcanoGenRadius; baseY++) { + mapRand.setSeed((long) baseX * l + (long) baseY * l1 ^ seed); + rMapVolcanoes(primer, world, cmr, mapRand, baseX, baseY, chunkX, chunkY, simplex, cell, noise); + } + } + } + + public float rNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + // we now have both lakes and rivers lowering land + if (noWaterFeatures) { + float borderForRiver = border*2; + if (borderForRiver >1f) borderForRiver = 1; + river = 1f - (1f-borderForRiver)*(1f-river); + return terrain.generateNoise(simplex, cell, x, y, border, river); + } + float lakeStrength = lakePressure(simplex,cell,x,y,border); + float lakeFlattening = lakeFlattening(lakeStrength, lakeShoreLevel, lakeDepressionLevel); + // we add some flattening to the rivers. The lakes are pre-flattened. + float riverFlattening = river*1.25f-0.25f; + if (riverFlattening <0) riverFlattening = 0; + if ((river<1)&&(lakeFlattening<1)) { + riverFlattening = (1f-riverFlattening)/riverFlattening+(1f-lakeFlattening)/lakeFlattening; + riverFlattening = (1f/(riverFlattening+1f)); + } + else if (lakeFlattening < riverFlattening) riverFlattening = lakeFlattening; + // the lakes have to have a little less flattening to avoid the rocky edges + lakeFlattening = lakeFlattening(lakeStrength, lakeWaterLevel, lakeDepressionLevel); + + if ((river<1)&&(lakeFlattening<1)) { + river = (1f-river)/river+(1f-lakeFlattening)/lakeFlattening; + river = (1f/(river+1f)); + } + else if (lakeFlattening < river) river = lakeFlattening; + // flatten terrain to set up for the water features + float terrainNoise = terrain.generateNoise(simplex, cell, x, y, border, riverFlattening); + // place water features + return this.erodedNoise(simplex, cell, x, y, river, border, terrainNoise,lakeFlattening); + } + + public static final float actualRiverProportion = 300f/1600f; + public float erodedNoise( + OpenSimplexNoise simplex, CellNoise simplexCell, int x, int y, float river, + float border, float biomeHeight, double lakeFlattening) { + + float r; + // put a flat spot in the middle of the river + float riverFlattening = river; // moved the flattening to terrain stage + if (riverFlattening <0) riverFlattening = 0; + + // check if rivers need lowering + //if (riverFlattening < actualRiverProportion) { + r = riverFlattening/actualRiverProportion; + //} + + //if (1>0) return 62f+r*10f; + if ((r < 1f && biomeHeight > 57f)) { + return (biomeHeight * (r)) + ((57f + simplex.noise2(x / 12f, y / 12f) * + 2f + simplex.noise2(x / 8f, y / 8f) * 1.5f) * (1f-r)); + } + else return biomeHeight; + } + + public float lakeFlattening(OpenSimplexNoise simplex, CellNoise simplexCell,int x, int y, float border) { + return lakeFlattening(lakePressure(simplex, simplexCell, x, y, border), lakeWaterLevel, lakeDepressionLevel); + } + + public float lakePressure(OpenSimplexNoise simplex, CellNoise simplexCell,int x, int y, float border) { + if (noLakes) return 1f; + SimplexOctave.Disk jitter = new SimplexOctave.Disk(); + simplex.riverJitter().evaluateNoise((float)x / 240.0, (float)y / 240.0, jitter); + double pX = x + jitter.deltax() * largeBendSize; + double pY = y + jitter.deltay() * largeBendSize; + simplex.mountain().evaluateNoise((float)x / 80.0, (float)y / 80.0, jitter); + pX += jitter.deltax() * mediumBendSize; + pY += jitter.deltay() * mediumBendSize; + simplex.octave(4).evaluateNoise((float)x / 30.0, (float)y / 30.0, jitter); + pX += jitter.deltax() * smallBendSize; + pY += jitter.deltay() * smallBendSize; + //double results =simplexCell.river().noise(pX / lakeInterval, pY / lakeInterval,1.0); + double [] lakeResults = simplexCell.river().eval((float)pX/ lakeInterval, (float)pY/ lakeInterval); + float results = 1f-(float)((lakeResults[1]-lakeResults[0])/lakeResults[1]); + if (results >1.01) throw new RuntimeException("" + lakeResults[0]+ " , "+lakeResults[1]); + if (results<-.01) throw new RuntimeException("" + lakeResults[0]+ " , "+lakeResults[1]); + //return simplexCell.river().noise((float)x/ lakeInterval, (float)y/ lakeInterval,1.0); + return results; + } + + public float lakeFlattening(float pressure, float bottomLevel, float topLevel) { + // this number indicates a multiplier to height + if (pressure > topLevel) return 1; + if (pressure decoStack = new ArrayList<>(); + + public void rDecorate( + World world, Random rand, int chunkX, int chunkZ, + OpenSimplexNoise simplex, CellNoise cell, + float strength, float river, boolean hasPlacedVillageBlocks) { + + for (DecoBase deco : this.decos) { + decoStack.add(new ChunkDecoration(new ChunkPos(chunkX, chunkZ), deco)); + if (decoStack.size() > 20) { + String problem = ""; + for (ChunkDecoration inStack : decoStack) { + problem += "" + inStack.chunkLocation.toString() + " " + inStack.decoration.getClass().getSimpleName(); + } + throw new RuntimeException(problem); + } + if (deco.preGenerate(this, world, rand, chunkX, chunkZ, simplex, cell, strength, river, hasPlacedVillageBlocks)) { + deco.generate(this, world, rand, chunkX, chunkZ, simplex, cell, strength, river, hasPlacedVillageBlocks); + } + decoStack.remove(decoStack.size() - 1); + } + } + + /** + * Adds a deco object to the list of biome decos. + * The 'allowed' parameter allows us to pass biome config booleans dynamically when configuring the decos in the biome. + * + * @param deco + * @param allowed + */ + public void addDeco(DecoBase deco, boolean allowed) { + + if (allowed) { + if (!deco.properlyDefined()) throw new RuntimeException(deco.toString()); + + if (deco instanceof DecoBaseBiomeDecorations) { + + for (int i = 0; i < this.decos.size(); i++) { + + if (this.decos.get(i) instanceof DecoBaseBiomeDecorations) { + + this.decos.remove(i); + break; + } + } + } + + this.decos.add(deco); + } + } + + /** + * Convenience method for addDeco() where 'allowed' is assumed to be true. + * + * @param deco + */ + public void addDeco(DecoBase deco) { + if (!deco.properlyDefined()) throw new RuntimeException(deco.toString()); + this.addDeco(deco, true); + } + + public void addDecoCollection(DecoCollectionBase decoCollection) { + + if (decoCollection.decos.size() > 0) { + for (int i = 0; i < decoCollection.decos.size(); i++) { + this.addDeco(decoCollection.decos.get(i)); + } + } + + if (decoCollection.rtgTrees.size() > 0) { + for (int i = 0; i < decoCollection.rtgTrees.size(); i++) { + this.addTree(decoCollection.rtgTrees.get(i)); + } + } + } + + /** + * Adds a tree to the list of RTG trees associated with this biome. + * The 'allowed' parameter allows us to pass biome config booleans dynamically when configuring the trees in the biome. + * + * @param tree + * @param allowed + */ + public void addTree(TreeRTG tree, boolean allowed) { + + if (allowed) { + + // Set the sapling data for this tree before we add it to the list. + tree.saplingBlock = SaplingUtil.getSaplingFromLeaves(tree.leavesBlock); + + /* + * Make sure all leaves delay their decay to prevent insta-despawning of leaves (e.g. Swamp Willow) + * The try/catch is a safeguard against trees that use leaves which aren't an instance of BlockLeaves. + */ + try { + IBlockState leaves = tree.leavesBlock.withProperty(BlockLeaves.CHECK_DECAY, false); + tree.leavesBlock = leaves; + } + catch (Exception e) { + // Do nothing. + } + + this.rtgTrees.add(tree); + } + } + + /** + * Convenience method for addTree() where 'allowed' is assumed to be true. + * + * @param tree + */ + public void addTree(TreeRTG tree) { + + this.addTree(tree, true); + } + + /** + * Returns the number of extra blocks of gold ore to generate in this biome. + * Defaults to 0, but can be overridden by sub-classed biomes. + * Currently only used by vanilla Mesa biome variants. + */ + public int getExtraGoldGenCount() { + return 0; + } + + /** + * Returns the minimum Y value at which extra gold ore can generate. + * Defaults to 32 (BiomeMesa), but can be overridden by sub-classed biomes. + * Currently only used by vanilla Mesa biome variants. + * + * @see net.minecraft.world.biome.BiomeMesa + */ + public int getExtraGoldGenMinHeight() { + return 32; + } + + /** + * Returns the maximum Y value at which extra gold ore can generate. + * Defaults to 80 (BiomeMesa), but can be overridden by sub-classed biomes. + * + * @see net.minecraft.world.biome.BiomeMesa + */ + public int getExtraGoldGenMaxHeight() { + return 80; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/biome/realistic/RealisticBiomePatcher.java b/src/api/java/rtg/world/biome/realistic/RealisticBiomePatcher.java new file mode 100644 index 00000000..d969b238 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/RealisticBiomePatcher.java @@ -0,0 +1,64 @@ +package rtg.world.biome.realistic; + +import net.minecraft.world.biome.Biome; + +import rtg.config.rtg.ConfigRTG; + +public class RealisticBiomePatcher { + + private int patchBiomeId; + private RealisticBiomeBase realisticBiome; + private Biome baseBiome; + + public RealisticBiomePatcher() { + + this.patchBiomeId = ConfigRTG.patchBiomeId; + + if (this.patchBiomeId > -1) { + + try { + this.realisticBiome = RealisticBiomeBase.getBiome(this.patchBiomeId); + } + catch (Exception e) { + throw new RuntimeException("Realistic patch biome " + this.patchBiomeId + " not found. Please make sure this biome is enabled."); + } + + try { + this.baseBiome = realisticBiome.baseBiome; + } + catch (Exception e) { + throw new RuntimeException("Base patch biome " + this.patchBiomeId + " not found. Please make sure this biome is enabled."); + } + } + } + + public RealisticBiomeBase getPatchedRealisticBiome(String exceptionMessage) { + + if (this.patchBiomeId < 0) { + throw new RuntimeException(exceptionMessage); + } + else { + + if (this.realisticBiome == null) { + throw new RuntimeException("Problem patching realistic biome."); + } + + return this.realisticBiome; + } + } + + public Biome getPatchedBaseBiome(String exceptionMessage) { + + if (this.patchBiomeId < 0) { + throw new RuntimeException(exceptionMessage); + } + else { + + if (this.baseBiome == null) { + throw new RuntimeException("Problem patching base biome."); + } + + return this.baseBiome; + } + } +} diff --git a/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACBase.java b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACBase.java new file mode 100644 index 00000000..626514d7 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACBase.java @@ -0,0 +1,56 @@ +package rtg.world.biome.realistic.abyssalcraft; + +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.fml.common.Loader; + +import com.shinoow.abyssalcraft.api.biome.ACBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.abyssalcraft.config.BiomeConfigAC; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.terrain.TerrainBase; + +public class RealisticBiomeACBase extends RealisticBiomeBase { + + public static RealisticBiomeBase acCoraliumInfestedSwamp; + public static RealisticBiomeBase acDarklands; + public static RealisticBiomeBase acDarklandsForest; + public static RealisticBiomeBase acDarklandsHighland; + public static RealisticBiomeBase acDarklandsMountains; + public static RealisticBiomeBase acDarklandsPlains; + + public RealisticBiomeACBase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase s) { + + super(config, b, riverbiome, t, s); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + } + + public static void addBiomes() { + + if (Loader.isModLoaded("abyssalcraft")) { + + if (null != ACBiomes.coralium_infested_swamp) { + acCoraliumInfestedSwamp = new RealisticBiomeACCoraliumInfestedSwamp(BiomeConfigAC.biomeConfigACCoraliumInfestedSwamp); + } + if (null != ACBiomes.darklands) { + acDarklands = new RealisticBiomeACDarklands(BiomeConfigAC.biomeConfigACDarklands); + } + if (null != ACBiomes.darklands_forest) { + acDarklandsForest = new RealisticBiomeACDarklandsForest(BiomeConfigAC.biomeConfigACDarklandsForest); + } + if (null != ACBiomes.darklands_hills) { + acDarklandsHighland = new RealisticBiomeACDarklandsHighland(BiomeConfigAC.biomeConfigACDarklandsHighland); + } + if (null != ACBiomes.darklands_mountains) { + acDarklandsMountains = new RealisticBiomeACDarklandsMountains(BiomeConfigAC.biomeConfigACDarklandsMountains); + } + if (null != ACBiomes.darklands_plains) { + acDarklandsPlains = new RealisticBiomeACDarklandsPlains(BiomeConfigAC.biomeConfigACDarklandsPlains); + } + } + } +} diff --git a/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACCoraliumInfestedSwamp.java b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACCoraliumInfestedSwamp.java new file mode 100644 index 00000000..15a60834 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACCoraliumInfestedSwamp.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.abyssalcraft; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import com.shinoow.abyssalcraft.api.biome.ACBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.abyssalcraft.SurfaceACCoraliumInfestedSwamp; +import rtg.world.gen.terrain.abyssalcraft.TerrainACCoraliumInfestedSwamp; + +public class RealisticBiomeACCoraliumInfestedSwamp extends RealisticBiomeACBase { + + public static Biome biome = ACBiomes.coralium_infested_swamp; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeACCoraliumInfestedSwamp(BiomeConfig config) { + + super(config, biome, river, + new TerrainACCoraliumInfestedSwamp(), + new SurfaceACCoraliumInfestedSwamp(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklands.java b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklands.java new file mode 100644 index 00000000..d082a4c3 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklands.java @@ -0,0 +1,49 @@ +package rtg.world.biome.realistic.abyssalcraft; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import com.shinoow.abyssalcraft.api.biome.ACBiomes; +import com.shinoow.abyssalcraft.api.block.ACBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.abyssalcraft.config.BiomeConfigACDarklands; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.DecoShrub; +import rtg.world.gen.surface.abyssalcraft.SurfaceACDarklands; +import rtg.world.gen.terrain.abyssalcraft.TerrainACDarklands; + +public class RealisticBiomeACDarklands extends RealisticBiomeACBase { + + public static Biome biome = ACBiomes.darklands; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeACDarklands(BiomeConfig config) { + + super(config, biome, river, + new TerrainACDarklands(), + new SurfaceACDarklands(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, biome.topBlock, 0.15f) + ); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionChance = 8; + decoFallenTree.logBlock = ACBlocks.darklands_oak_wood.getDefaultState(); + decoFallenTree.leavesBlock = ACBlocks.darklands_oak_leaves.getDefaultState(); + decoFallenTree.minSize = 2; + decoFallenTree.maxSize = 3; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigACDarklands.decorationLogsId)); + + DecoShrub decoShrubCustom = new DecoShrub(); + decoShrubCustom.logBlock = ACBlocks.darklands_oak_wood.getDefaultState(); + decoShrubCustom.leavesBlock = ACBlocks.darklands_oak_leaves.getDefaultState(); + decoShrubCustom.maxY = 110; + decoShrubCustom.notEqualsZerochance = 3; + decoShrubCustom.strengthFactor = 2f; + this.addDeco(decoShrubCustom); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsForest.java b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsForest.java new file mode 100644 index 00000000..3ab726f6 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsForest.java @@ -0,0 +1,64 @@ +package rtg.world.biome.realistic.abyssalcraft; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import com.shinoow.abyssalcraft.api.biome.ACBiomes; +import com.shinoow.abyssalcraft.api.block.ACBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.abyssalcraft.config.BiomeConfigACDarklandsForest; +import rtg.world.biome.deco.*; +import rtg.world.gen.surface.abyssalcraft.SurfaceACDarklandsForest; +import rtg.world.gen.terrain.abyssalcraft.TerrainACDarklandsForest; + +public class RealisticBiomeACDarklandsForest extends RealisticBiomeACBase { + + public static Biome biome = ACBiomes.darklands_forest; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeACDarklandsForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainACDarklandsForest(), + new SurfaceACDarklandsForest(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, biome.topBlock, 0.10f) + ); + + DecoAbyssalCraftTree decoTrees = new DecoAbyssalCraftTree(); + decoTrees.strengthNoiseFactorXForLoops = true; + decoTrees.distribution.noiseDivisor = 80f; + decoTrees.distribution.noiseFactor = 60f; + decoTrees.distribution.noiseAddend = -15f; + decoTrees.treeType = DecoAbyssalCraftTree.TreeType.DARKWOOD; + decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + decoTrees.treeConditionChance = 3; + decoTrees.maxY = 110; + this.addDeco(decoTrees); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 12; + decoFallenTree.logBlock = ACBlocks.darklands_oak_wood.getDefaultState(); + decoFallenTree.leavesBlock = ACBlocks.darklands_oak_leaves.getDefaultState(); + decoFallenTree.minSize = 2; + decoFallenTree.maxSize = 3; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigACDarklandsForest.decorationLogsId)); + + DecoShrub decoShrubCustom = new DecoShrub(); + decoShrubCustom.logBlock = ACBlocks.darklands_oak_wood.getDefaultState(); + decoShrubCustom.leavesBlock = ACBlocks.darklands_oak_leaves.getDefaultState(); + decoShrubCustom.maxY = 110; + decoShrubCustom.notEqualsZerochance = 3; + decoShrubCustom.strengthFactor = 3f; + this.addDeco(decoShrubCustom); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 8f; + this.addDeco(decoGrass); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsHighland.java b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsHighland.java new file mode 100644 index 00000000..5f34af9a --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsHighland.java @@ -0,0 +1,31 @@ +package rtg.world.biome.realistic.abyssalcraft; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import com.shinoow.abyssalcraft.api.biome.ACBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.abyssalcraft.SurfaceACDarklandsHighland; +import rtg.world.gen.terrain.abyssalcraft.TerrainACDarklandsHighland; + +public class RealisticBiomeACDarklandsHighland extends RealisticBiomeACBase { + + public static Biome biome = ACBiomes.darklands_hills; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeACDarklandsHighland(BiomeConfig config) { + + super(config, biome, river, + new TerrainACDarklandsHighland(10f, 120f, 10f, 200f), + new SurfaceACDarklandsHighland(config, biome.topBlock, biome.fillerBlock, biome.topBlock, biome.fillerBlock, 60f, -0.14f, 14f, 0.25f) + ); + + this.noLakes = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsMountains.java b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsMountains.java new file mode 100644 index 00000000..80317c30 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsMountains.java @@ -0,0 +1,31 @@ +package rtg.world.biome.realistic.abyssalcraft; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import com.shinoow.abyssalcraft.api.biome.ACBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.abyssalcraft.SurfaceACDarklandsMountains; +import rtg.world.gen.terrain.abyssalcraft.TerrainACDarklandsMountains; + +public class RealisticBiomeACDarklandsMountains extends RealisticBiomeACBase { + + public static Biome biome = ACBiomes.darklands_mountains; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeACDarklandsMountains(BiomeConfig config) { + + super(config, biome, river, + new TerrainACDarklandsMountains(120f, 100f), + new SurfaceACDarklandsMountains(config, biome.topBlock, biome.fillerBlock, 0.2f) + ); + + this.noLakes = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsPlains.java b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsPlains.java new file mode 100644 index 00000000..c62a2c92 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/abyssalcraft/RealisticBiomeACDarklandsPlains.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.abyssalcraft; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import com.shinoow.abyssalcraft.api.biome.ACBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.abyssalcraft.SurfaceACDarklandsPlains; +import rtg.world.gen.terrain.abyssalcraft.TerrainACDarklandsPlains; + +public class RealisticBiomeACDarklandsPlains extends RealisticBiomeACBase { + + public static Biome biome = ACBiomes.darklands_plains; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeACDarklandsPlains(BiomeConfig config) { + + super(config, biome, river, + new TerrainACDarklandsPlains(), + new SurfaceACDarklandsPlains(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARBambooGrove.java b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARBambooGrove.java new file mode 100644 index 00000000..ea7b788b --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARBambooGrove.java @@ -0,0 +1,25 @@ +package rtg.world.biome.realistic.agriculturalrevolution; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.agriculturalrevolution.SurfaceARBambooGrove; +import rtg.world.gen.terrain.agriculturalrevolution.TerrainARBambooGrove; + +public class RealisticBiomeARBambooGrove extends RealisticBiomeARBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeARBambooGrove(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainARBambooGrove(), + new SurfaceARBambooGrove(config, biome.topBlock, biome.fillerBlock, false, null, 0f, 1.5f, 60f, 65f, 1.5f, biome.topBlock, 0.15f) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARBase.java b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARBase.java new file mode 100644 index 00000000..413e65ef --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARBase.java @@ -0,0 +1,65 @@ +package rtg.world.biome.realistic.agriculturalrevolution; + +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.fml.common.Loader; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.agriculturalrevolution.config.BiomeConfigAR; +import rtg.util.Logger; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.terrain.TerrainBase; + +public class RealisticBiomeARBase extends RealisticBiomeBase { + + public static RealisticBiomeBase arBambooGrove; + public static RealisticBiomeBase arCoralReef; + public static RealisticBiomeBase arDeepReef; + public static RealisticBiomeBase arKelpForest; + public static RealisticBiomeBase arOrchard; + public static RealisticBiomeBase arTropicalHills; + + public RealisticBiomeARBase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase s) { + + super(config, b, riverbiome, t, s); + + this.lavaSurfaceLakeChance = 0; + } + + public static void addBiomes() { + + if (Loader.isModLoaded("CookingPlus")) { + + for (Biome biome : Biome.REGISTRY) { + + if (biome.getBiomeName().isEmpty()) { + Logger.warn("Biome ID %d has no name.", Biome.getIdForBiome(biome)); + continue; + } + + String biomeName = biome.getBiomeName(); + String biomeClass = biome.getBiomeClass().getName(); + + if (biomeName.equals("Orchard") && biomeClass.equals("CookingPlus.generation.CookingPlusOrchardBiome")) { + arOrchard = new RealisticBiomeAROrchard(biome, BiomeConfigAR.biomeConfigAROrchard); + } + else if (biomeName.equals("Bamboo Grove") && biomeClass.equals("CookingPlus.generation.CookingPlusBambooBiome")) { + arBambooGrove = new RealisticBiomeARBambooGrove(biome, BiomeConfigAR.biomeConfigARBambooGrove); + } + else if (biomeName.equals("Kelp Forest") && biomeClass.equals("CookingPlus.generation.CookingPlusKelpForestBiome")) { + arKelpForest = new RealisticBiomeARKelpForest(biome, BiomeConfigAR.biomeConfigARKelpForest); + } + else if (biomeName.equals("Coral Reef") && biomeClass.equals("CookingPlus.generation.CookingPlusCoralReefBiome")) { + arCoralReef = new RealisticBiomeARCoralReef(biome, BiomeConfigAR.biomeConfigARCoralReef); + } + else if (biomeName.equals("Tropical Hills") && biomeClass.equals("CookingPlus.generation.CookingPlusTropicalBiome")) { + arTropicalHills = new RealisticBiomeARTropicalHills(biome, BiomeConfigAR.biomeConfigARTropicalHills); + } + else if (biomeName.equals("Deep Reef") && biomeClass.equals("CookingPlus.generation.CookingPlusDeepReefBiome")) { + arDeepReef = new RealisticBiomeARDeepReef(biome, BiomeConfigAR.biomeConfigARDeepReef); + } + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARCoralReef.java b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARCoralReef.java new file mode 100644 index 00000000..19aef887 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARCoralReef.java @@ -0,0 +1,30 @@ +package rtg.world.biome.realistic.agriculturalrevolution; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.agriculturalrevolution.SurfaceARCoralReef; +import rtg.world.gen.terrain.agriculturalrevolution.TerrainARCoralReef; + +public class RealisticBiomeARCoralReef extends RealisticBiomeARBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeARCoralReef(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainARCoralReef(false, -10f, 0f, 0f, 0f, 30f), + new SurfaceARCoralReef(config, biome.topBlock, biome.fillerBlock) + ); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + this.noLakes = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARDeepReef.java b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARDeepReef.java new file mode 100644 index 00000000..6f1dd03f --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARDeepReef.java @@ -0,0 +1,31 @@ +package rtg.world.biome.realistic.agriculturalrevolution; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.agriculturalrevolution.SurfaceARDeepReef; +import rtg.world.gen.terrain.agriculturalrevolution.TerrainARDeepReef; + +public class RealisticBiomeARDeepReef extends RealisticBiomeARBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeARDeepReef(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainARDeepReef(), + new SurfaceARDeepReef(config, Blocks.GRAVEL.getDefaultState(), Blocks.GRAVEL.getDefaultState(), Blocks.CLAY.getDefaultState(), 20f, 0.1f) + ); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + this.noLakes = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARKelpForest.java b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARKelpForest.java new file mode 100644 index 00000000..a5915b63 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARKelpForest.java @@ -0,0 +1,30 @@ +package rtg.world.biome.realistic.agriculturalrevolution; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.agriculturalrevolution.SurfaceARKelpForest; +import rtg.world.gen.terrain.agriculturalrevolution.TerrainARKelpForest; + +public class RealisticBiomeARKelpForest extends RealisticBiomeARBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeARKelpForest(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainARKelpForest(false, -10f, 0f, 0f, 0f, 30f), + new SurfaceARKelpForest(config, biome.topBlock, biome.fillerBlock) + ); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + this.noLakes = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeAROrchard.java b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeAROrchard.java new file mode 100644 index 00000000..80672ab7 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeAROrchard.java @@ -0,0 +1,25 @@ +package rtg.world.biome.realistic.agriculturalrevolution; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.agriculturalrevolution.SurfaceAROrchard; +import rtg.world.gen.terrain.agriculturalrevolution.TerrainAROrchard; + +public class RealisticBiomeAROrchard extends RealisticBiomeARBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeAROrchard(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainAROrchard(58f, 67f, 25f), + new SurfaceAROrchard(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARTropicalHills.java b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARTropicalHills.java new file mode 100644 index 00000000..7256f088 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/agriculturalrevolution/RealisticBiomeARTropicalHills.java @@ -0,0 +1,26 @@ +package rtg.world.biome.realistic.agriculturalrevolution; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.agriculturalrevolution.SurfaceARTropicalHills; +import rtg.world.gen.terrain.agriculturalrevolution.TerrainARTropicalHills; + +public class RealisticBiomeARTropicalHills extends RealisticBiomeARBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeARTropicalHills(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainARTropicalHills(10f, 80f, 68f, 200f), + new SurfaceARTropicalHills(config, Blocks.SAND.getDefaultState(), Blocks.SANDSTONE.getDefaultState(), false, null, 0f, 1.5f, 60f, 65f, 1.5f) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/betteragriculture/RealisticBiomeBABase.java b/src/api/java/rtg/world/biome/realistic/betteragriculture/RealisticBiomeBABase.java new file mode 100644 index 00000000..3736e868 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/betteragriculture/RealisticBiomeBABase.java @@ -0,0 +1,46 @@ +package rtg.world.biome.realistic.betteragriculture; + +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.fml.common.Loader; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.betteragriculture.config.BiomeConfigBA; +import rtg.util.Logger; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.terrain.TerrainBase; + +@SuppressWarnings("WeakerAccess") +public class RealisticBiomeBABase extends RealisticBiomeBase { + + public static RealisticBiomeBase baFarmlandBiome; + + public RealisticBiomeBABase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase s) { + + super(config, b, riverbiome, t, s); + + this.lavaSurfaceLakeChance = 0; + } + + public static void addBiomes() { + + if (Loader.isModLoaded("betteragriculture")) { + + for (Biome biome : Biome.REGISTRY) { + + if (biome.getBiomeName().isEmpty()) { + Logger.warn("Biome ID %d has no name.", Biome.getIdForBiome(biome)); + continue; + } + + String biomeName = biome.getBiomeName(); + String biomeClass = biome.getBiomeClass().getName(); + + if (biomeName.equals("FarmlandBiome") && biomeClass.equals("betteragriculture.world.biome.FarmlandBiome")) { + baFarmlandBiome = new RealisticBiomeBAFarmlandBiome(biome, BiomeConfigBA.biomeConfigBAFarmlandBiome); + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/realistic/betteragriculture/RealisticBiomeBAFarmlandBiome.java b/src/api/java/rtg/world/biome/realistic/betteragriculture/RealisticBiomeBAFarmlandBiome.java new file mode 100644 index 00000000..f81b3599 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/betteragriculture/RealisticBiomeBAFarmlandBiome.java @@ -0,0 +1,113 @@ +package rtg.world.biome.realistic.betteragriculture; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.betteragriculture.config.BiomeConfigBAFarmlandBiome; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.gen.surface.betteragriculture.SurfaceBAFarmlandBiome; +import rtg.world.gen.terrain.betteragriculture.TerrainBAFarmlandBiome; + + +class RealisticBiomeBAFarmlandBiome extends rtg.world.biome.realistic.betteragriculture.RealisticBiomeBABase { + + public static Biome river = Biomes.RIVER; + + RealisticBiomeBAFarmlandBiome(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainBAFarmlandBiome(), + new SurfaceBAFarmlandBiome(config, + biome.topBlock, //Block top + Blocks.DIRT.getDefaultState(), //Block filler, + BlockUtil.getStateDirt(1), //IBlockState mixTop, + Blocks.DIRT.getDefaultState(), //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 24; + decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); + decoFallenTree.leavesBlock = Blocks.LOG.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBAFarmlandBiome.decorationLogsId)); + + DecoCrop decoWheat = new DecoCrop(); + decoWheat.type = 3; + decoWheat.chance = 80; + decoWheat.strengthFactor = 15f; + decoWheat.maxY = 255; + decoWheat.size = 30;//DO NOT PUT HIGHER THAN 30 + decoWheat.density = 600; + decoWheat.height = 5; + this.addDeco(decoWheat); + + DecoCrop decoBeet = new DecoCrop(); + decoBeet.type = 2; + decoBeet.chance = 80; + decoBeet.strengthFactor = 12f; + decoBeet.maxY = 255; + decoBeet.size = 30;//DO NOT PUT HIGHER THAN 30 + decoBeet.density = 500; + decoBeet.height = 5; + this.addDeco(decoBeet); + + DecoCrop decoCarrot = new DecoCrop(); + decoCarrot.type = 1; + decoCarrot.chance = 80; + decoCarrot.strengthFactor = 12f; + decoCarrot.maxY = 255; + decoCarrot.size = 30;//DO NOT PUT HIGHER THAN 30 + decoCarrot.density = 500; + decoCarrot.height = 5; + this.addDeco(decoCarrot); + + DecoCrop decoPotato = new DecoCrop(); + decoPotato.type = 0; + decoPotato.chance = 80; + decoPotato.strengthFactor = 12f; + decoPotato.maxY = 255; + decoPotato.size = 30;//DO NOT PUT HIGHER THAN 30 + decoPotato.density = 500; + decoPotato.height = 5; + this.addDeco(decoPotato); + + DecoShrub decoShrubOak = new DecoShrub(); + decoShrubOak.maxY = 90; + decoShrubOak.strengthFactor = 2f; + decoShrubOak.chance = 4; + this.addDeco(decoShrubOak); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = BlockUtil.getStateDirt(2); + decoBoulder.chance = 24; + decoBoulder.maxY = 80; + decoBoulder.strengthFactor = 4f; + this.addDeco(decoBoulder); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.maxY = 105; + decoBaseBiomeDecorations.notEqualsZeroChance = 8; + this.addDeco(decoBaseBiomeDecorations); + + // Grass filler. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.minY = 63; + decoGrass.maxY = 100; + decoGrass.loops = 1; + this.addDeco(decoGrass); + + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java new file mode 100644 index 00000000..3a9615fc --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPAlps.java @@ -0,0 +1,31 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPAlps; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPAlps; + +public class RealisticBiomeBOPAlps extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.alps.get(); + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeBOPAlps(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPAlps(), + new SurfaceBOPAlps(config, biome.topBlock, biome.fillerBlock, 0.45f) + ); + + this.generatesEmeralds = true; + this.noLakes = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBambooForest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBambooForest.java new file mode 100644 index 00000000..059d6ffc --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBambooForest.java @@ -0,0 +1,27 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import biomesoplenty.api.biome.BOPBiomes; +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPBambooForest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPBambooForest; + +public class RealisticBiomeBOPBambooForest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.bamboo_forest.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPBambooForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPBambooForest(), + new SurfaceBOPBambooForest(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.15f) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBase.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBase.java new file mode 100644 index 00000000..2fe2fb3a --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBase.java @@ -0,0 +1,284 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.fml.common.Loader; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOP; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.terrain.TerrainBase; + +public class RealisticBiomeBOPBase extends RealisticBiomeBase { + + public static RealisticBiomeBase bopAlps; + public static RealisticBiomeBase bopBambooForest; + public static RealisticBiomeBase bopBayou; + public static RealisticBiomeBase bopBog; + public static RealisticBiomeBase bopBorealForest; + public static RealisticBiomeBase bopBrushland; + public static RealisticBiomeBase bopChaparral; + public static RealisticBiomeBase bopCherryBlossomGrove; + public static RealisticBiomeBase bopColdDesert; + public static RealisticBiomeBase bopConiferousForest; + public static RealisticBiomeBase bopCoralReef; + public static RealisticBiomeBase bopCrag; + public static RealisticBiomeBase bopDeadForest; + public static RealisticBiomeBase bopDeadSwamp; + public static RealisticBiomeBase bopEucalyptusForest; + public static RealisticBiomeBase bopFen; + public static RealisticBiomeBase bopFlowerField; + public static RealisticBiomeBase bopFlowerIsland; + public static RealisticBiomeBase bopGlacier; + public static RealisticBiomeBase bopGrassland; + public static RealisticBiomeBase bopGravelBeach; + public static RealisticBiomeBase bopGrove; + public static RealisticBiomeBase bopHeathland; + public static RealisticBiomeBase bopHighland; + public static RealisticBiomeBase bopKelpForest; + public static RealisticBiomeBase bopLandOfLakes; + public static RealisticBiomeBase bopLavenderFields; + public static RealisticBiomeBase bopLushDesert; + public static RealisticBiomeBase bopLushSwamp; + public static RealisticBiomeBase bopMangrove; + public static RealisticBiomeBase bopMapleWoods; + public static RealisticBiomeBase bopMarsh; + public static RealisticBiomeBase bopMeadow; + public static RealisticBiomeBase bopMoor; + public static RealisticBiomeBase bopMountain; + public static RealisticBiomeBase bopMountainFoothills; + public static RealisticBiomeBase bopMysticGrove; + public static RealisticBiomeBase bopOasis; + public static RealisticBiomeBase bopOminousWoods; + public static RealisticBiomeBase bopOrchard; + public static RealisticBiomeBase bopOriginIsland; + public static RealisticBiomeBase bopOutback; + public static RealisticBiomeBase bopOvergrownCliffs; + public static RealisticBiomeBase bopPrairie; + public static RealisticBiomeBase bopQuagmire; + public static RealisticBiomeBase bopRainforest; + public static RealisticBiomeBase bopRedwoodForest; + public static RealisticBiomeBase bopSacredSprings; + public static RealisticBiomeBase bopSeasonalForest; + public static RealisticBiomeBase bopShield; + public static RealisticBiomeBase bopShrubland; + public static RealisticBiomeBase bopSnowyConiferousForest; + public static RealisticBiomeBase bopSnowyForest; + public static RealisticBiomeBase bopSteppe; + public static RealisticBiomeBase bopTemperateRainforest; + public static RealisticBiomeBase bopTropicalRainforest; + public static RealisticBiomeBase bopTropicalIsland; + public static RealisticBiomeBase bopTundra; + public static RealisticBiomeBase bopVolcanicIsland; + public static RealisticBiomeBase bopWasteland; + public static RealisticBiomeBase bopWetland; + public static RealisticBiomeBase bopWoodland; + public static RealisticBiomeBase bopXericShrubland; + + + public RealisticBiomeBOPBase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase s) { + + super(config, b, riverbiome, t, s); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + } + + public static void addBiomes() { + + if (Loader.isModLoaded("BiomesOPlenty")) { + if (BOPBiomes.alps.isPresent()) { + bopAlps = new RealisticBiomeBOPAlps(BiomeConfigBOP.biomeConfigBOPAlps); + } + if (BOPBiomes.bamboo_forest.isPresent()) { + bopBambooForest = new RealisticBiomeBOPBambooForest(BiomeConfigBOP.biomeConfigBOPBambooForest); + } + if (BOPBiomes.bayou.isPresent()) { + bopBayou = new RealisticBiomeBOPBayou(BiomeConfigBOP.biomeConfigBOPBayou); + } + if (BOPBiomes.bog.isPresent()) { + bopBog = new RealisticBiomeBOPBog(BiomeConfigBOP.biomeConfigBOPBog); + } + if (BOPBiomes.boreal_forest.isPresent()) { + bopBorealForest = new RealisticBiomeBOPBorealForest(BiomeConfigBOP.biomeConfigBOPBorealForest); + } + if (BOPBiomes.brushland.isPresent()) { + bopBrushland = new RealisticBiomeBOPBrushland(BiomeConfigBOP.biomeConfigBOPBrushland); + } + if (BOPBiomes.chaparral.isPresent()) { + bopChaparral = new RealisticBiomeBOPChaparral(BiomeConfigBOP.biomeConfigBOPChaparral); + } + if (BOPBiomes.cherry_blossom_grove.isPresent()) { + bopCherryBlossomGrove = new RealisticBiomeBOPCherryBlossomGrove(BiomeConfigBOP.biomeConfigBOPCherryBlossomGrove); + } + if (BOPBiomes.cold_desert.isPresent()) { + bopColdDesert = new RealisticBiomeBOPColdDesert(BiomeConfigBOP.biomeConfigBOPColdDesert); + } + if (BOPBiomes.coniferous_forest.isPresent()) { + bopConiferousForest = new RealisticBiomeBOPConiferousForest(BiomeConfigBOP.biomeConfigBOPConiferousForest); + } + if (BOPBiomes.coral_reef.isPresent()) { + bopCoralReef = new RealisticBiomeBOPCoralReef(BiomeConfigBOP.biomeConfigBOPCoralReef); + } + if (BOPBiomes.crag.isPresent()) { + bopCrag = new RealisticBiomeBOPCrag(BiomeConfigBOP.biomeConfigBOPCrag); + } + if (BOPBiomes.dead_forest.isPresent()) { + bopDeadForest = new RealisticBiomeBOPDeadForest(BiomeConfigBOP.biomeConfigBOPDeadForest); + } + if (BOPBiomes.dead_swamp.isPresent()) { + bopDeadSwamp = new RealisticBiomeBOPDeadSwamp(BiomeConfigBOP.biomeConfigBOPDeadSwamp); + } + if (BOPBiomes.eucalyptus_forest.isPresent()) { + bopEucalyptusForest = new RealisticBiomeBOPEucalyptusForest(BiomeConfigBOP.biomeConfigBOPEucalyptusForest); + } + if (BOPBiomes.fen.isPresent()) { + bopFen = new RealisticBiomeBOPFen(BiomeConfigBOP.biomeConfigBOPFen); + } + if (BOPBiomes.flower_field.isPresent()) { + bopFlowerField = new RealisticBiomeBOPFlowerField(BiomeConfigBOP.biomeConfigBOPFlowerField); + } + if (BOPBiomes.flower_island.isPresent()) { + bopFlowerIsland = new RealisticBiomeBOPFlowerIsland(BiomeConfigBOP.biomeConfigBOPFlowerIsland); + } + if (BOPBiomes.glacier.isPresent()) { + bopGlacier = new RealisticBiomeBOPGlacier(BiomeConfigBOP.biomeConfigBOPGlacier); + } + if (BOPBiomes.grassland.isPresent()) { + bopGrassland = new RealisticBiomeBOPGrassland(BiomeConfigBOP.biomeConfigBOPGrassland); + } + if (BOPBiomes.gravel_beach.isPresent()) { + bopGravelBeach = new RealisticBiomeBOPGravelBeach(BiomeConfigBOP.biomeConfigBOPGravelBeach); + } + if (BOPBiomes.grove.isPresent()) { + bopGrove = new RealisticBiomeBOPGrove(BiomeConfigBOP.biomeConfigBOPGrove); + } + if (BOPBiomes.heathland.isPresent()) { + bopHeathland = new RealisticBiomeBOPHeathland(BiomeConfigBOP.biomeConfigBOPHeathland); + } + if (BOPBiomes.highland.isPresent()) { + bopHighland = new RealisticBiomeBOPHighland(BiomeConfigBOP.biomeConfigBOPHighland); + } + if (BOPBiomes.kelp_forest.isPresent()) { + bopKelpForest = new RealisticBiomeBOPKelpForest(BiomeConfigBOP.biomeConfigBOPKelpForest); + } + if (BOPBiomes.land_of_lakes.isPresent()) { + bopLandOfLakes = new RealisticBiomeBOPLandOfLakes(BiomeConfigBOP.biomeConfigBOPLandOfLakes); + } + if (BOPBiomes.lavender_fields.isPresent()) { + bopLavenderFields = new RealisticBiomeBOPLavenderFields(BiomeConfigBOP.biomeConfigBOPLavenderFields); + } + if (BOPBiomes.lush_desert.isPresent()) { + bopLushDesert = new RealisticBiomeBOPLushDesert(BiomeConfigBOP.biomeConfigBOPLushDesert); + } + if (BOPBiomes.lush_swamp.isPresent()) { + bopLushSwamp = new RealisticBiomeBOPLushSwamp(BiomeConfigBOP.biomeConfigBOPLushSwamp); + } + if (BOPBiomes.mangrove.isPresent()) { + bopMangrove = new RealisticBiomeBOPMangrove(BiomeConfigBOP.biomeConfigBOPMangrove); + } + if (BOPBiomes.maple_woods.isPresent()) { + bopMapleWoods = new RealisticBiomeBOPMapleWoods(BiomeConfigBOP.biomeConfigBOPMapleWoods); + } + if (BOPBiomes.marsh.isPresent()) { + bopMarsh = new RealisticBiomeBOPMarsh(BiomeConfigBOP.biomeConfigBOPMarsh); + } + if (BOPBiomes.meadow.isPresent()) { + bopMeadow = new RealisticBiomeBOPMeadow(BiomeConfigBOP.biomeConfigBOPMeadow); + } + if (BOPBiomes.moor.isPresent()) { + bopMoor = new RealisticBiomeBOPMoor(BiomeConfigBOP.biomeConfigBOPMoor); + } + if (BOPBiomes.mountain.isPresent()) { + bopMountain = new RealisticBiomeBOPMountainPeaks(BiomeConfigBOP.biomeConfigBOPMountainPeaks); + } + if (BOPBiomes.mountain_foothills.isPresent()) { + bopMountainFoothills = new RealisticBiomeBOPMountainFoothills(BiomeConfigBOP.biomeConfigBOPMountainFoothills); + } + if (BOPBiomes.mystic_grove.isPresent()) { + bopMysticGrove = new RealisticBiomeBOPMysticGrove(BiomeConfigBOP.biomeConfigBOPMysticGrove); + } + if (BOPBiomes.oasis.isPresent()) { + bopOasis = new RealisticBiomeBOPOasis(BiomeConfigBOP.biomeConfigBOPOasis); + } + if (BOPBiomes.ominous_woods.isPresent()) { + bopOminousWoods = new RealisticBiomeBOPOminousWoods(BiomeConfigBOP.biomeConfigBOPOminousWoods); + } + if (BOPBiomes.orchard.isPresent()) { + bopOrchard = new RealisticBiomeBOPOrchard(BiomeConfigBOP.biomeConfigBOPOrchard); + } + if (BOPBiomes.origin_island.isPresent()) { + bopOriginIsland = new RealisticBiomeBOPOriginIsland(BiomeConfigBOP.biomeConfigBOPOriginIsland); + } + if (BOPBiomes.outback.isPresent()) { + bopOutback = new RealisticBiomeBOPOutback(BiomeConfigBOP.biomeConfigBOPOutback); + } + if (BOPBiomes.overgrown_cliffs.isPresent()) { + bopOvergrownCliffs = new RealisticBiomeBOPOvergrownCliffs(BiomeConfigBOP.biomeConfigBOPOvergrownCliffs); + } + if (BOPBiomes.prairie.isPresent()) { + bopPrairie = new RealisticBiomeBOPPrairie(BiomeConfigBOP.biomeConfigBOPPrairie); + } + if (BOPBiomes.quagmire.isPresent()) { + bopQuagmire = new RealisticBiomeBOPQuagmire(BiomeConfigBOP.biomeConfigBOPQuagmire); + } + if (BOPBiomes.rainforest.isPresent()) { + bopRainforest = new RealisticBiomeBOPRainforest(BiomeConfigBOP.biomeConfigBOPRainforest); + } + if (BOPBiomes.redwood_forest.isPresent()) { + bopRedwoodForest = new RealisticBiomeBOPRedwoodForest(BiomeConfigBOP.biomeConfigBOPRedwoodForest); + } + if (BOPBiomes.sacred_springs.isPresent()) { + bopSacredSprings = new RealisticBiomeBOPSacredSprings(BiomeConfigBOP.biomeConfigBOPSacredSprings); + } + if (BOPBiomes.seasonal_forest.isPresent()) { + bopSeasonalForest = new RealisticBiomeBOPSeasonalForest(BiomeConfigBOP.biomeConfigBOPSeasonalForest); + } + if (BOPBiomes.shield.isPresent()) { + bopShield = new RealisticBiomeBOPShield(BiomeConfigBOP.biomeConfigBOPShield); + } + if (BOPBiomes.shrubland.isPresent()) { + bopShrubland = new RealisticBiomeBOPShrubland(BiomeConfigBOP.biomeConfigBOPShrubland); + } + if (BOPBiomes.snowy_coniferous_forest.isPresent()) { + bopSnowyConiferousForest = new RealisticBiomeBOPSnowyConiferousForest(BiomeConfigBOP.biomeConfigBOPSnowyConiferousForest); + } + if (BOPBiomes.snowy_forest.isPresent()) { + bopSnowyForest = new RealisticBiomeBOPSnowyForest(BiomeConfigBOP.biomeConfigBOPSnowyForest); + } + if (BOPBiomes.steppe.isPresent()) { + bopSteppe = new RealisticBiomeBOPSteppe(BiomeConfigBOP.biomeConfigBOPSteppe); + } + if (BOPBiomes.temperate_rainforest.isPresent()) { + bopTemperateRainforest = new RealisticBiomeBOPTemperateRainforest(BiomeConfigBOP.biomeConfigBOPTemperateRainforest); + } + if (BOPBiomes.tropical_island.isPresent()) { + bopTropicalIsland = new RealisticBiomeBOPTropicalIsland(BiomeConfigBOP.biomeConfigBOPTropicalIsland); + } + if (BOPBiomes.tropical_rainforest.isPresent()) { + bopTropicalRainforest = new RealisticBiomeBOPTropicalRainforest(BiomeConfigBOP.biomeConfigBOPTropicalRainforest); + } + if (BOPBiomes.tundra.isPresent()) { + bopTundra = new RealisticBiomeBOPTundra(BiomeConfigBOP.biomeConfigBOPTundra); + } + if (BOPBiomes.volcanic_island.isPresent()) { + bopVolcanicIsland = new RealisticBiomeBOPVolcanicIsland(BiomeConfigBOP.biomeConfigBOPVolcanicIsland); + } + if (BOPBiomes.wasteland.isPresent()) { + bopWasteland = new RealisticBiomeBOPWasteland(BiomeConfigBOP.biomeConfigBOPWasteland); + } + if (BOPBiomes.wetland.isPresent()) { + bopWetland = new RealisticBiomeBOPWetland(BiomeConfigBOP.biomeConfigBOPWetland); + } + if (BOPBiomes.woodland.isPresent()) { + bopWoodland = new RealisticBiomeBOPWoodland(BiomeConfigBOP.biomeConfigBOPWoodland); + } + if (BOPBiomes.xeric_shrubland.isPresent()) { + bopXericShrubland = new RealisticBiomeBOPXericShrubland(BiomeConfigBOP.biomeConfigBOPXericShrubland); + } + } + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBayou.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBayou.java new file mode 100644 index 00000000..6c9d562c --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBayou.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPBayou; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPBayou; + +public class RealisticBiomeBOPBayou extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.bayou.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPBayou(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPBayou(), + new SurfaceBOPBayou(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBog.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBog.java new file mode 100644 index 00000000..b92856f7 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBog.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPBog; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPBog; + +public class RealisticBiomeBOPBog extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.bog.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPBog(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPBog(), + new SurfaceBOPBog(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBorealForest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBorealForest.java new file mode 100644 index 00000000..10cd4e2b --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBorealForest.java @@ -0,0 +1,27 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import biomesoplenty.api.biome.BOPBiomes; +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPBorealForest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPBorealForest; + +public class RealisticBiomeBOPBorealForest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.boreal_forest.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPBorealForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPBorealForest(), + new SurfaceBOPBorealForest(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.15f) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBrushland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBrushland.java new file mode 100644 index 00000000..31e5701b --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPBrushland.java @@ -0,0 +1,29 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPBrushland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPBrushland; + +public class RealisticBiomeBOPBrushland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.brushland.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPBrushland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPBrushland(), + new SurfaceBOPBrushland(config, biome.topBlock, biome.fillerBlock, Blocks.SAND.getDefaultState(), 13f, 0.27f) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPChaparral.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPChaparral.java new file mode 100644 index 00000000..e142dce8 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPChaparral.java @@ -0,0 +1,29 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPChaparral; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPChaparral; + +public class RealisticBiomeBOPChaparral extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.chaparral.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPChaparral(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPChaparral(), + new SurfaceBOPChaparral(config, biome.topBlock, biome.fillerBlock, Blocks.SAND.getDefaultState(), 26f, 0.35f) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCherryBlossomGrove.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCherryBlossomGrove.java new file mode 100644 index 00000000..ed8de760 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCherryBlossomGrove.java @@ -0,0 +1,81 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPCherryBlossomGrove; +import rtg.world.biome.deco.DecoBase; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.helper.DecoHelperRandomSplit; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPCherryBlossomGrove; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPCherryBlossomGrove; + +public class RealisticBiomeBOPCherryBlossomGrove extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.cherry_blossom_grove.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPCherryBlossomGrove(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPCherryBlossomGrove(58f, 76f, 20f), + new SurfaceBOPCherryBlossomGrove(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 95; + this.addDeco(decoBoulder); + + DecoFallenTree decoFallenTree1 = new DecoFallenTree(); + decoFallenTree1.distribution.noiseDivisor = 100f; + decoFallenTree1.distribution.noiseFactor = 6f; + decoFallenTree1.distribution.noiseAddend = 0.8f; + decoFallenTree1.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree1.logConditionNoise = 0f; + decoFallenTree1.logConditionChance = 16; + decoFallenTree1.maxY = 100; + decoFallenTree1.logBlock = BOPBlocks.log_1.getStateFromMeta(1); + decoFallenTree1.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree1.minSize = 3; + decoFallenTree1.maxSize = 5; + + DecoFallenTree decoFallenTree2 = new DecoFallenTree(); + decoFallenTree1.distribution.noiseDivisor = 100f; + decoFallenTree1.distribution.noiseFactor = 6f; + decoFallenTree1.distribution.noiseAddend = 0.8f; + decoFallenTree2.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree2.logConditionNoise = 0f; + decoFallenTree2.logConditionChance = 16; + decoFallenTree2.maxY = 100; + decoFallenTree2.logBlock = Blocks.LOG.getDefaultState(); + decoFallenTree2.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree2.minSize = 3; + decoFallenTree2.maxSize = 5; + + DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); + decoHelperRandomSplit.decos = new DecoBase[]{decoFallenTree2, decoFallenTree1}; + decoHelperRandomSplit.chances = new int[]{15, 1}; + this.addDeco(decoHelperRandomSplit, this.config._boolean(BiomeConfigBOPCherryBlossomGrove.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPColdDesert.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPColdDesert.java new file mode 100644 index 00000000..988ea4ae --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPColdDesert.java @@ -0,0 +1,38 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPColdDesert; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPColdDesert; + +public class RealisticBiomeBOPColdDesert extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.cold_desert.get(); + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeBOPColdDesert(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPColdDesert(), + new SurfaceBOPColdDesert(config, + Blocks.SNOW.getDefaultState(), //Block top + biome.fillerBlock, //Block filler, + Blocks.SNOW.getDefaultState(), //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPConiferousForest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPConiferousForest.java new file mode 100644 index 00000000..8b8aad6d --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPConiferousForest.java @@ -0,0 +1,65 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPConiferousForest; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPConiferousForest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPConiferousForest; + +public class RealisticBiomeBOPConiferousForest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.coniferous_forest.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPConiferousForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPConiferousForest(58f, 84f, 24f), + new SurfaceBOPConiferousForest(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 1f; + this.addDeco(decoBoulder); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.loops = 1; + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 16; + decoFallenTree.logBlock = BOPBlocks.log_1.getStateFromMeta(3); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 5; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPConiferousForest.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.notEqualsZeroChance = 12; + decoBaseBiomeDecorations.loops = 1; + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCoralReef.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCoralReef.java new file mode 100644 index 00000000..e00c8e6e --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCoralReef.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPCoralReef; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPCoralReef; + +public class RealisticBiomeBOPCoralReef extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.coral_reef.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPCoralReef(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPCoralReef(false, -10f, 0f, 0f, 0f, 30f), + new SurfaceBOPCoralReef(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCrag.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCrag.java new file mode 100644 index 00000000..87df38e8 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPCrag.java @@ -0,0 +1,39 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoPond; +import rtg.world.biome.deco.helper.DecoHelperBorder; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPCrag; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPCrag; + +public class RealisticBiomeBOPCrag extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.crag.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPCrag(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPCrag(90f), + new SurfaceBOPCrag(config, biome.topBlock, biome.fillerBlock, biome.topBlock) + ); + + this.generatesEmeralds = true; + this.noLakes = true; + this.noWaterFeatures = true; + + DecoPond decoPond = new DecoPond(); + decoPond.chunksPerPond = 3;// very high because most are blocked by topography + DecoHelperBorder borderedPond = new DecoHelperBorder(decoPond, 0.8f, 0.7f); + this.addDeco(borderedPond); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadForest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadForest.java new file mode 100644 index 00000000..e4672099 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadForest.java @@ -0,0 +1,85 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPDeadForest; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBase; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.helper.DecoHelperRandomSplit; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPDeadForest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPDeadForest; + +public class RealisticBiomeBOPDeadForest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.dead_forest.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPDeadForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPDeadForest(58f, 80f, 30f), + new SurfaceBOPDeadForest(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 1f; + this.addDeco(decoBoulder); + + DecoFallenTree decoFallenTree1 = new DecoFallenTree(); + decoFallenTree1.loops = 1; + decoFallenTree1.distribution.noiseDivisor = 100f; + decoFallenTree1.distribution.noiseFactor = 6f; + decoFallenTree1.distribution.noiseAddend = 0.8f; + decoFallenTree1.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree1.logConditionNoise = 0f; + decoFallenTree1.logConditionChance = 10; + decoFallenTree1.maxY = 100; + decoFallenTree1.logBlock = BOPBlocks.log_3.getStateFromMeta(2); + decoFallenTree1.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree1.minSize = 3; + decoFallenTree1.maxSize = 5; + + DecoFallenTree decoFallenTree2 = new DecoFallenTree(); + decoFallenTree2.loops = 1; + decoFallenTree2.distribution.noiseDivisor = 100f; + decoFallenTree2.distribution.noiseFactor = 6f; + decoFallenTree2.distribution.noiseAddend = 0.8f; + decoFallenTree2.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree2.logConditionNoise = 0f; + decoFallenTree2.logConditionChance = 10; + decoFallenTree2.maxY = 100; + decoFallenTree2.logBlock = BlockUtil.getStateLog(1); + decoFallenTree2.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree2.minSize = 3; + decoFallenTree2.maxSize = 5; + + DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); + decoHelperRandomSplit.decos = new DecoBase[]{decoFallenTree2, decoFallenTree1}; + decoHelperRandomSplit.chances = new int[]{12, 1}; + this.addDeco(decoHelperRandomSplit, this.config._boolean(BiomeConfigBOPDeadForest.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadSwamp.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadSwamp.java new file mode 100644 index 00000000..3138dcf6 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPDeadSwamp.java @@ -0,0 +1,29 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPDeadSwamp; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPDeadSwamp; + +public class RealisticBiomeBOPDeadSwamp extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.dead_swamp.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPDeadSwamp(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPDeadSwamp(), + new SurfaceBOPDeadSwamp(config, BOPBlocks.grass.getDefaultState(), BOPBlocks.dirt.getDefaultState()) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPEucalyptusForest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPEucalyptusForest.java new file mode 100644 index 00000000..6d797ecd --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPEucalyptusForest.java @@ -0,0 +1,67 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import biomesoplenty.api.biome.BOPBiomes; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPEucalyptusForest; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.helper.DecoHelper5050; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPEucalyptusForest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPEucalyptusForest; + +public class RealisticBiomeBOPEucalyptusForest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.eucalyptus_forest.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPEucalyptusForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPEucalyptusForest(),//(58f, 80f, 36f), + new SurfaceBOPEucalyptusForest(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBoulder decoBoulder1 = new DecoBoulder(); + decoBoulder1.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder1.maxY = 80; + decoBoulder1.chance = 12; + decoBoulder1.strengthFactor = 1f; + DecoBoulder decoBoulder2 = new DecoBoulder(); + decoBoulder2.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder2.maxY = 80; + decoBoulder2.chance = 12; + decoBoulder2.strengthFactor = 1f; + DecoHelper5050 decoHelper5050 = new DecoHelper5050(decoBoulder1, decoBoulder2); + this.addDeco(decoHelper5050); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 16; + decoFallenTree.logBlock = BlockUtil.getStateLog(3); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); + decoFallenTree.minSize = 8; + decoFallenTree.maxSize = 14; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPEucalyptusForest.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFen.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFen.java new file mode 100644 index 00000000..20bc05b4 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFen.java @@ -0,0 +1,87 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPFen; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBase; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.helper.DecoHelper5050; +import rtg.world.biome.deco.helper.DecoHelperRandomSplit; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPFen; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPFen; + +public class RealisticBiomeBOPFen extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.fen.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPFen(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPFen(), + new SurfaceBOPFen(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBoulder decoBoulder1 = new DecoBoulder(); + decoBoulder1.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder1.maxY = 80; + decoBoulder1.chance = 12; + decoBoulder1.strengthFactor = 1f; + DecoBoulder decoBoulder2 = new DecoBoulder(); + decoBoulder2.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder2.maxY = 80; + decoBoulder2.chance = 12; + decoBoulder2.strengthFactor = 1f; + DecoHelper5050 decoHelper5050 = new DecoHelper5050(decoBoulder1, decoBoulder2); + this.addDeco(decoHelper5050); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 16; + decoFallenTree.logBlock = BOPBlocks.log_3.getStateFromMeta(2); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 5; + DecoFallenTree decoFallenTree2 = new DecoFallenTree(); + decoFallenTree2.distribution.noiseDivisor = 100f; + decoFallenTree2.distribution.noiseFactor = 6f; + decoFallenTree2.distribution.noiseAddend = 0.8f; + decoFallenTree2.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree2.logConditionNoise = 0f; + decoFallenTree2.logConditionChance = 16; + decoFallenTree2.maxY = 100; + decoFallenTree2.logBlock = BlockUtil.getStateLog2(1); + decoFallenTree2.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree2.minSize = 3; + decoFallenTree2.maxSize = 5; + DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); + decoHelperRandomSplit.decos = new DecoBase[]{decoFallenTree, decoFallenTree2}; + decoHelperRandomSplit.chances = new int[]{4, 1}; + this.addDeco(decoHelperRandomSplit, this.config._boolean(BiomeConfigBOPFen.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerField.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerField.java new file mode 100644 index 00000000..3b16df66 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerField.java @@ -0,0 +1,60 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFlowersRTG; +import rtg.world.biome.deco.DecoGrass; +import rtg.world.biome.deco.DecoShrub; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPFlowerField; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPFlowerField; + +public class RealisticBiomeBOPFlowerField extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.flower_field.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPFlowerField(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPFlowerField(), + new SurfaceBOPFlowerField(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, biome.topBlock, 0.05f) + ); + + // First, let's get a few shrubs in to break things up a bit. + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 110; + decoShrub.strengthFactor = 4f; + decoShrub.chance = 3; + this.addDeco(decoShrub); + + // Flowers are the most aesthetically important feature of this biome, so let's add those next. + DecoFlowersRTG decoFlowers1 = new DecoFlowersRTG(); + decoFlowers1.flowers = new int[]{0, 1, 2, 3, 8, 9}; //Only colourful 1-block-tall flowers. No tulips as BOP has those covered. + decoFlowers1.strengthFactor = 12f; // Lots and lots of flowers! + decoFlowers1.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; // We're only bothered about surface flowers here. + this.addDeco(decoFlowers1); + + DecoFlowersRTG decoFlowers2 = new DecoFlowersRTG(); + decoFlowers2.flowers = new int[]{10, 11, 14, 15}; //Only 2-block-tall flowers. + decoFlowers2.strengthFactor = 2f; // Not as many of these. + decoFlowers2.chance = 3; + decoFlowers2.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; // We're only bothered about surface flowers here. + this.addDeco(decoFlowers2); + + // Not much free space left, so let's give some space to the base biome. + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.notEqualsZeroChance = 4; + this.addDeco(decoBaseBiomeDecorations); + + // Grass filler. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 24f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerIsland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerIsland.java new file mode 100644 index 00000000..ec4a8365 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPFlowerIsland.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPFlowerIsland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPFlowerIsland; + +public class RealisticBiomeBOPFlowerIsland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.flower_island.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPFlowerIsland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPFlowerIsland(65f, 68f, 24f), + new SurfaceBOPFlowerIsland(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGlacier.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGlacier.java new file mode 100644 index 00000000..bd608c95 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGlacier.java @@ -0,0 +1,30 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPGlacier; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPGlacier; + +public class RealisticBiomeBOPGlacier extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.glacier.get(); + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeBOPGlacier(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPGlacier(230f, 40f, 68f), + new SurfaceBOPGlacier(config, biome.topBlock, biome.fillerBlock, biome.topBlock, biome.fillerBlock, Blocks.PACKED_ICE.getDefaultState(), Blocks.ICE.getDefaultState(), 60f, + -0.14f, 14f, 0.25f) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrassland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrassland.java new file mode 100644 index 00000000..194b6367 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrassland.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPGrassland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPGrassland; + +public class RealisticBiomeBOPGrassland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.grassland.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPGrassland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPGrassland(), + new SurfaceBOPGrassland(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGravelBeach.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGravelBeach.java new file mode 100644 index 00000000..6d887763 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGravelBeach.java @@ -0,0 +1,36 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPGravelBeach; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPGravelBeach; + +public class RealisticBiomeBOPGravelBeach extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.gravel_beach.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPGravelBeach(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPGravelBeach(), + new SurfaceBOPGravelBeach( + config, + biome.topBlock, + biome.fillerBlock, + biome.topBlock, + biome.fillerBlock, + (byte) 0, + 1 + ) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrove.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrove.java new file mode 100644 index 00000000..4b0c6eec --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPGrove.java @@ -0,0 +1,82 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import biomesoplenty.api.biome.BOPBiomes; +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPGrove; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.helper.DecoHelper5050; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPGrove; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPGrove; + +public class RealisticBiomeBOPGrove extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.grove.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPGrove(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPGrove(), + new SurfaceBOPGrove(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.15f) + ); + + DecoFallenTree decoFallenTree1 = new DecoFallenTree(); + decoFallenTree1.distribution.noiseDivisor = 80f; + decoFallenTree1.distribution.noiseFactor = 60f; + decoFallenTree1.distribution.noiseAddend = -15f; + decoFallenTree1.logCondition = DecoFallenTree.LogCondition.X_DIVIDED_BY_STRENGTH; + decoFallenTree1.logConditionNoise = 8f; + decoFallenTree1.logConditionChance = 1; + decoFallenTree1.maxY = 100; + decoFallenTree1.logBlock = BlockUtil.getStateLog(2); + decoFallenTree1.leavesBlock = BlockUtil.getStateLeaf(2); + decoFallenTree1.minSize = 3; + decoFallenTree1.maxSize = 6; + + DecoFallenTree decoFallenTree2 = new DecoFallenTree(); + decoFallenTree2.distribution.noiseDivisor = 80f; + decoFallenTree2.distribution.noiseFactor = 60f; + decoFallenTree2.distribution.noiseAddend = -15f; + decoFallenTree2.logCondition = DecoFallenTree.LogCondition.X_DIVIDED_BY_STRENGTH; + decoFallenTree2.logConditionNoise = 8f; + decoFallenTree2.logConditionChance = 1; + decoFallenTree2.maxY = 100; + decoFallenTree2.logBlock = BlockUtil.getStateLog2(1); + decoFallenTree2.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree2.minSize = 3; + decoFallenTree2.maxSize = 6; + + DecoHelper5050 decoHelperHelper5050 = new DecoHelper5050(decoFallenTree1, decoFallenTree2); + this.addDeco(decoHelperHelper5050, this.config._boolean(BiomeConfigBOPGrove.decorationLogsId)); + + DecoShrub decoShrubCustom = new DecoShrub(); + decoShrubCustom.logBlock = BlockUtil.getStateLog(2); + decoShrubCustom.leavesBlock = BlockUtil.getStateLeaf(2); + decoShrubCustom.maxY = 110; + decoShrubCustom.strengthFactor = 2f; + DecoShrub decoShrubCustom2 = new DecoShrub(); + decoShrubCustom2.logBlock = BlockUtil.getStateLog2(1); + decoShrubCustom2.leavesBlock = BlockUtil.getStateLeaf2(1); + decoShrubCustom2.maxY = 110; + decoShrubCustom2.strengthFactor = 2f; + DecoHelper5050 decoHelperHelper50502 = new DecoHelper5050(decoShrubCustom, decoShrubCustom2); + this.addDeco(decoHelperHelper50502); + + DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); + decoFlowersRTG.flowers = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; + decoFlowersRTG.maxY = 128; + decoFlowersRTG.strengthFactor = 2f; + this.addDeco(decoFlowersRTG); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 12f; + this.addDeco(decoGrass); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHeathland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHeathland.java new file mode 100644 index 00000000..86b3fa4c --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHeathland.java @@ -0,0 +1,44 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPHeathland; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPHeathland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPHeathland; + +public class RealisticBiomeBOPHeathland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.heathland.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPHeathland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPHeathland(), + new SurfaceBOPHeathland(config, biome.topBlock, biome.fillerBlock) + ); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.X_DIVIDED_BY_STRENGTH; + decoFallenTree.logConditionNoise = 8f; + decoFallenTree.logConditionChance = 1; + decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 4; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPHeathland.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHighland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHighland.java new file mode 100644 index 00000000..65fe2f21 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPHighland.java @@ -0,0 +1,31 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPHighland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPHighland; + +public class RealisticBiomeBOPHighland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.highland.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPHighland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPHighland(), + new SurfaceBOPHighland(config, biome.topBlock, biome.fillerBlock) + ); + + this.generatesEmeralds = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPKelpForest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPKelpForest.java new file mode 100644 index 00000000..8c684b3d --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPKelpForest.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPKelpForest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPKelpForest; + +public class RealisticBiomeBOPKelpForest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.kelp_forest.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPKelpForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPKelpForest(false, -10f, 0f, 0f, 0f, 30f), + new SurfaceBOPKelpForest(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLandOfLakes.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLandOfLakes.java new file mode 100644 index 00000000..f06d7a56 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLandOfLakes.java @@ -0,0 +1,100 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import biomesoplenty.api.biome.BOPBiomes; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPLandOfLakes; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.helper.DecoHelper5050; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGBetulaPapyrifera; +import rtg.world.gen.feature.tree.rtg.TreeRTGPiceaSitchensis; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPLandOfLakes; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPLandOfLakes; + +public class RealisticBiomeBOPLandOfLakes extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.land_of_lakes.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPLandOfLakes(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPLandOfLakes(58f, 76f, 36f), + new SurfaceBOPLandOfLakes(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f, Blocks.STONE.getDefaultState(), 0.10f) + ); + + TreeRTG birchTree = new TreeRTGBetulaPapyrifera(); + birchTree.logBlock = BlockUtil.getStateLog(2); + birchTree.leavesBlock = BlockUtil.getStateLeaf(2); + birchTree.minTrunkSize = 4; + birchTree.maxTrunkSize = 10; + birchTree.minCrownSize = 8; + birchTree.maxCrownSize = 19; + this.addTree(birchTree); + + DecoTree birchTrees = new DecoTree(birchTree); + birchTrees.strengthFactorForLoops = 9f; + birchTrees.treeType = DecoTree.TreeType.RTG_TREE; + birchTrees.distribution.noiseDivisor = 100f; + birchTrees.distribution.noiseFactor = 6f; + birchTrees.distribution.noiseAddend = 0.8f; + birchTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + birchTrees.treeConditionChance = 1; + birchTrees.treeConditionNoise = 0f; + birchTrees.maxY = 120; + + TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); + sitchensisTree.logBlock = BlockUtil.getStateLog(1); + sitchensisTree.leavesBlock = BlockUtil.getStateLeaf(1); + sitchensisTree.minTrunkSize = 4; + sitchensisTree.maxTrunkSize = 9; + sitchensisTree.minCrownSize = 5; + sitchensisTree.maxCrownSize = 14; + this.addTree(sitchensisTree); + + DecoTree smallPine = new DecoTree(sitchensisTree); + smallPine.strengthFactorForLoops = 9f; + smallPine.treeType = DecoTree.TreeType.RTG_TREE; + smallPine.distribution.noiseDivisor = 100f; + smallPine.distribution.noiseFactor = 6f; + smallPine.distribution.noiseAddend = 0.8f; + smallPine.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + smallPine.treeConditionChance = 1; + smallPine.treeConditionNoise = 0f; + smallPine.maxY = 120; + + DecoHelper5050 decoHelper5050 = new DecoHelper5050(birchTrees, smallPine); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 12; + decoFallenTree.randomLogBlocks = new IBlockState[]{Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(1), BlockUtil.getStateLog(2)}; + decoFallenTree.minSize = 8; + decoFallenTree.maxSize = 12; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPLandOfLakes.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 110; + decoShrub.strengthFactor = 3f; + this.addDeco(decoShrub); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.maxY = 80; + decoBoulder.chance = 12; + decoBoulder.strengthFactor = 1f; + this.addDeco(decoBoulder); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLavenderFields.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLavenderFields.java new file mode 100644 index 00000000..e515f631 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLavenderFields.java @@ -0,0 +1,41 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoGrass; +import rtg.world.biome.deco.DecoShrub; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPLavenderFields; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPLavenderFields; + +public class RealisticBiomeBOPLavenderFields extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.lavender_fields.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPLavenderFields(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPLavenderFields(), + new SurfaceBOPLavenderFields(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, biome.topBlock, 0.05f) + ); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 110; + decoShrub.chance = 10; + decoShrub.strengthFactor = 4f; + this.addDeco(decoShrub); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 6f; + this.addDeco(decoGrass); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushDesert.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushDesert.java new file mode 100644 index 00000000..856b262e --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushDesert.java @@ -0,0 +1,68 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPLushDesert; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.DecoJungleCacti; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPLushDesert; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPLushDesert; + +public class RealisticBiomeBOPLushDesert extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.lush_desert.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPLushDesert(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPLushDesert(65f, 40f, 10f), + new SurfaceBOPLushDesert(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 40f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.maxY = 80; + decoBoulder.chance = 16; + decoBoulder.strengthFactor = 1f; + this.addDeco(decoBoulder); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 12; + decoFallenTree.randomLogBlocks = new IBlockState[]{Blocks.LOG2.getStateFromMeta(1), BOPBlocks.log_3.getStateFromMeta(2), Blocks.LOG.getDefaultState()}; + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 5; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPLushDesert.decorationLogsId)); + + DecoJungleCacti decoJungleCacti = new DecoJungleCacti(); + decoJungleCacti.strengthFactor = 8f; + decoJungleCacti.maxY = 110; + this.addDeco(decoJungleCacti); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushSwamp.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushSwamp.java new file mode 100644 index 00000000..10fe1691 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPLushSwamp.java @@ -0,0 +1,51 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPLushSwamp; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPLushSwamp; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPLushSwamp; + +public class RealisticBiomeBOPLushSwamp extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.lush_swamp.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPLushSwamp(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPLushSwamp(), + new SurfaceBOPLushSwamp(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.maxY = 80; + decoBoulder.chance = 16; + decoBoulder.strengthFactor = 1f; + this.addDeco(decoBoulder); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.ALWAYS_GENERATE; + decoFallenTree.logConditionChance = 4; + decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 4; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPLushSwamp.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMangrove.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMangrove.java new file mode 100644 index 00000000..78967ed1 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMangrove.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPMangrove; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPMangrove; + +public class RealisticBiomeBOPMangrove extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.mangrove.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPMangrove(BiomeConfig config) + { + super(config, biome, river, + new TerrainBOPMangrove(), + new SurfaceBOPMangrove(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMapleWoods.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMapleWoods.java new file mode 100644 index 00000000..4c9d7979 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMapleWoods.java @@ -0,0 +1,43 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import biomesoplenty.api.biome.BOPBiomes; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPMapleWoods; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPMapleWoods; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPMapleWoods; + +public class RealisticBiomeBOPMapleWoods extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.maple_woods.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPMapleWoods(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPMapleWoods(68f, 80f, 30f), + new SurfaceBOPMapleWoods(config, biome.topBlock, biome.fillerBlock) + ); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.X_DIVIDED_BY_STRENGTH; + decoFallenTree.logConditionNoise = 8f; + decoFallenTree.logConditionChance = 1; + decoFallenTree.randomLogBlocks = new IBlockState[]{Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(1)}; + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPMapleWoods.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMarsh.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMarsh.java new file mode 100644 index 00000000..d2ff3359 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMarsh.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPMarsh; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPMarsh; + +public class RealisticBiomeBOPMarsh extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.marsh.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPMarsh(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPMarsh(), + new SurfaceBOPMarsh(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMeadow.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMeadow.java new file mode 100644 index 00000000..f7473bbb --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMeadow.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPMeadow; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPMeadow; + +public class RealisticBiomeBOPMeadow extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.meadow.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPMeadow(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPMeadow(), + new SurfaceBOPMeadow(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMoor.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMoor.java new file mode 100644 index 00000000..1ec3ca48 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMoor.java @@ -0,0 +1,31 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPMoor; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPMoor; + +public class RealisticBiomeBOPMoor extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.moor.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPMoor(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPMoor(68f, 75f, 16f), + new SurfaceBOPMoor(config, BOPBlocks.grass.getDefaultState(), BOPBlocks.dirt.getDefaultState()) + ); + + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainFoothills.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainFoothills.java new file mode 100644 index 00000000..0291007f --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainFoothills.java @@ -0,0 +1,39 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPMountainFoothills; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPMountainFoothills; + +public class RealisticBiomeBOPMountainFoothills extends RealisticBiomeBOPBase { + + //TODO: Decidious + public static Biome biome = BOPBiomes.mountain_foothills.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPMountainFoothills(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPMountainFoothills(), + new SurfaceBOPMountainFoothills(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + Blocks.DIRT.getDefaultState(), //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainPeaks.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainPeaks.java new file mode 100644 index 00000000..fdee28cb --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMountainPeaks.java @@ -0,0 +1,75 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPMountainPeaks; +import rtg.world.biome.deco.*; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPMountainPeaks; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPMountainPeaks; + +public class RealisticBiomeBOPMountainPeaks extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.mountain.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPMountainPeaks(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPMountainPeaks(120f, 100f), + new SurfaceBOPMountainPeaks(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + this.generatesEmeralds = true; + this.noLakes = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.maxY = 90; + decoBoulder.chance = 16; + decoBoulder.strengthFactor = 3f; + this.addDeco(decoBoulder); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BOPBlocks.log_2.getStateFromMeta(6); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPMountainPeaks.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 110; + decoShrub.strengthFactor = 2f; + decoShrub.chance = 10; + this.addDeco(decoShrub); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 3f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMysticGrove.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMysticGrove.java new file mode 100644 index 00000000..17185a32 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPMysticGrove.java @@ -0,0 +1,44 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPMysticGrove; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPMysticGrove; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPMysticGrove; + +public class RealisticBiomeBOPMysticGrove extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.mystic_grove.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPMysticGrove(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPMysticGrove(), + new SurfaceBOPMysticGrove(config, biome.topBlock, biome.fillerBlock) + ); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionChance = 12; + decoFallenTree.randomLogBlocks = new IBlockState[]{Blocks.LOG.getDefaultState(), BOPBlocks.log_3.getStateFromMeta(4), BOPBlocks.log_1.getStateFromMeta(5)}; + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 5; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPMysticGrove.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOasis.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOasis.java new file mode 100644 index 00000000..00df1328 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOasis.java @@ -0,0 +1,53 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPOasis; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPOasis; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPOasis; + +public class RealisticBiomeBOPOasis extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.oasis.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPOasis(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPOasis(), + new SurfaceBOPOasis(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + Blocks.SAND.getDefaultState(), //IBlockState mixTop, + Blocks.SANDSTONE.getDefaultState(), //IBlockState mixFill, + 40f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionChance = 16; + decoFallenTree.logBlock = BOPBlocks.log_2.getStateFromMeta(3); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 5; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPOasis.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOminousWoods.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOminousWoods.java new file mode 100644 index 00000000..a777579e --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOminousWoods.java @@ -0,0 +1,43 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPOminousWoods; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPOminousWoods; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPOminousWoods; + +public class RealisticBiomeBOPOminousWoods extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.ominous_woods.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPOminousWoods(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPOminousWoods(65f, 80f, 48f), + new SurfaceBOPOminousWoods(config, BOPBlocks.grass.getDefaultState(), BOPBlocks.dirt.getDefaultState()) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionChance = 6; + decoFallenTree.randomLogBlocks = new IBlockState[]{BOPBlocks.log_1.getStateFromMeta(2), BOPBlocks.log_3.getStateFromMeta(2)}; + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPOminousWoods.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOrchard.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOrchard.java new file mode 100644 index 00000000..16996463 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOrchard.java @@ -0,0 +1,44 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPOrchard; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPOrchard; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPOrchard; + +public class +RealisticBiomeBOPOrchard extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.orchard.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPOrchard(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPOrchard(58f, 67f, 25f), + new SurfaceBOPOrchard(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionChance = 10; + decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 2; + decoFallenTree.maxSize = 3; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPOrchard.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOriginIsland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOriginIsland.java new file mode 100644 index 00000000..8cb1d05a --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOriginIsland.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPOriginIsland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPOriginIsland; + +public class RealisticBiomeBOPOriginIsland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.origin_island.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPOriginIsland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPOriginIsland(65f, 80f, 38f), + new SurfaceBOPOriginIsland(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOutback.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOutback.java new file mode 100644 index 00000000..f55614e4 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOutback.java @@ -0,0 +1,38 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPOutback; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPOutback; + +public class RealisticBiomeBOPOutback extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.outback.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPOutback(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPOutback(65f, 50f, 10f), + new SurfaceBOPOutback(config, + Blocks.GRASS.getDefaultState(), //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 40f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOvergrownCliffs.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOvergrownCliffs.java new file mode 100644 index 00000000..0b4bc7ab --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPOvergrownCliffs.java @@ -0,0 +1,30 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPOvergrownCliffs; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPOvergrownCliffs; + +public class RealisticBiomeBOPOvergrownCliffs extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.overgrown_cliffs.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPOvergrownCliffs(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPOvergrownCliffs(300f, 100f, 0f), + new SurfaceBOPOvergrownCliffs(config, biome.topBlock, biome.fillerBlock, 0.95f) + ); + + this.generatesEmeralds = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPPrairie.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPPrairie.java new file mode 100644 index 00000000..20297219 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPPrairie.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPPrairie; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPPrairie; + +public class RealisticBiomeBOPPrairie extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.prairie.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPPrairie(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPPrairie(65f, 80f, 25f), + new SurfaceBOPPrairie(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPQuagmire.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPQuagmire.java new file mode 100644 index 00000000..baadb345 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPQuagmire.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPQuagmire; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPQuagmire; + +public class RealisticBiomeBOPQuagmire extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.quagmire.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPQuagmire(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPQuagmire(), + new SurfaceBOPQuagmire(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRainforest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRainforest.java new file mode 100644 index 00000000..2cf2b7c1 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRainforest.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPRainforest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPRainforest; + +public class RealisticBiomeBOPRainforest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.rainforest.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPRainforest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPRainforest(90f, 300f), + new SurfaceBOPRainforest(config, biome.topBlock, biome.fillerBlock, 1.3f) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRedwoodForest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRedwoodForest.java new file mode 100644 index 00000000..3cfc733d --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPRedwoodForest.java @@ -0,0 +1,59 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPRedwoodForest; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.helper.DecoHelper5050; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPRedwoodForest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPRedwoodForest; + +public class RealisticBiomeBOPRedwoodForest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.redwood_forest.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPRedwoodForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPRedwoodForest(58f, 80f, 30f), + new SurfaceBOPRedwoodForest(config, biome.topBlock, biome.fillerBlock, 0.4f) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoBoulder decoBoulder1 = new DecoBoulder(); + decoBoulder1.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder1.maxY = 80; + decoBoulder1.chance = 16; + decoBoulder1.strengthFactor = 1f; + DecoBoulder decoBoulder2 = new DecoBoulder(); + decoBoulder2.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder2.maxY = 80; + decoBoulder2.chance = 16; + decoBoulder2.strengthFactor = 1f; + DecoHelper5050 decoHelper5050 = new DecoHelper5050(decoBoulder1, decoBoulder2); + this.addDeco(decoHelper5050); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionChance = 12; + decoFallenTree.logBlock = BOPBlocks.log_3.getDefaultState(); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 9; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPRedwoodForest.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSacredSprings.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSacredSprings.java new file mode 100644 index 00000000..6b651f73 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSacredSprings.java @@ -0,0 +1,31 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPSacredSprings; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPSacredSprings; + +public class RealisticBiomeBOPSacredSprings extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.sacred_springs.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPSacredSprings(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPSacredSprings(150f, 30f, 68f), + new SurfaceBOPSacredSprings(config, biome.topBlock, biome.fillerBlock) + ); + + this.noWaterFeatures = true; + this.waterSurfaceLakeChance = 2; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSeasonalForest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSeasonalForest.java new file mode 100644 index 00000000..76606703 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSeasonalForest.java @@ -0,0 +1,59 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import biomesoplenty.api.biome.BOPBiomes; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPSeasonalForest; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPSeasonalForest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPSeasonalForest; + +public class RealisticBiomeBOPSeasonalForest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.seasonal_forest.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPSeasonalForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPSeasonalForest(15f, 80f, 68f, 170f), + new SurfaceBOPSeasonalForest(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 0.5f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.maxY = 80; + decoBoulder.chance = 16; + decoBoulder.strengthFactor = 1f; + this.addDeco(decoBoulder); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionChance = 6; + decoFallenTree.randomLogBlocks = new IBlockState[]{BlockUtil.getStateLog2(1), Blocks.LOG.getDefaultState(), BlockUtil.getStateLog(2)}; + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 4; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPSeasonalForest.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShield.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShield.java new file mode 100644 index 00000000..c3864f21 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShield.java @@ -0,0 +1,71 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPShield; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.helper.DecoHelper5050; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPShield; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPShield; + +public class RealisticBiomeBOPShield extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.shield.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPShield(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPShield(0f, 100f, 68f, 170f), + new SurfaceBOPShield(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.maxY = 80; + decoBoulder.chance = 16; + decoBoulder.strengthFactor = 1f; + this.addDeco(decoBoulder); + + DecoFallenTree decoFallenTree1 = new DecoFallenTree(); + decoFallenTree1.distribution.noiseDivisor = 80f; + decoFallenTree1.distribution.noiseFactor = 60f; + decoFallenTree1.distribution.noiseAddend = -15f; + decoFallenTree1.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree1.logConditionNoise = 0f; + decoFallenTree1.logConditionChance = 6; + decoFallenTree1.maxY = 100; + decoFallenTree1.logBlock = BOPBlocks.log_2.getStateFromMeta(6); + decoFallenTree1.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree1.minSize = 3; + decoFallenTree1.maxSize = 4; + + DecoFallenTree decoFallenTree2 = new DecoFallenTree(); + decoFallenTree2.distribution.noiseDivisor = 80f; + decoFallenTree2.distribution.noiseFactor = 60f; + decoFallenTree2.distribution.noiseAddend = -15f; + decoFallenTree2.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree2.logConditionNoise = 0f; + decoFallenTree2.logConditionChance = 6; + decoFallenTree2.maxY = 100; + decoFallenTree2.logBlock = BlockUtil.getStateLog(1); + decoFallenTree2.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree2.minSize = 3; + decoFallenTree2.maxSize = 4; + + DecoHelper5050 decoHelperHelper5050 = new DecoHelper5050(decoFallenTree1, decoFallenTree2); + this.addDeco(decoHelperHelper5050, this.config._boolean(BiomeConfigBOPShield.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShrubland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShrubland.java new file mode 100644 index 00000000..567382b6 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPShrubland.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPShrubland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPShrubland; + +public class RealisticBiomeBOPShrubland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.shrubland.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPShrubland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPShrubland(), + new SurfaceBOPShrubland(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyConiferousForest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyConiferousForest.java new file mode 100644 index 00000000..11627470 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyConiferousForest.java @@ -0,0 +1,54 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPSnowyConiferousForest; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPSnowyConiferousForest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPSnowyConiferousForest; + +public class RealisticBiomeBOPSnowyConiferousForest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.snowy_coniferous_forest.get(); + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeBOPSnowyConiferousForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPSnowyConiferousForest(65f, 70f, 40f), + new SurfaceBOPSnowyConiferousForest(config, BOPBlocks.grass.getDefaultState(), BOPBlocks.dirt.getDefaultState(), 0.45f, 1.5f, 50f, 60f, 0.4f, 100f, 50f, 1.5f) + ); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.maxY = 80; + decoBoulder.chance = 16; + decoBoulder.strengthFactor = 1f; + this.addDeco(decoBoulder); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 16; + decoFallenTree.logBlock = BOPBlocks.log_1.getStateFromMeta(3); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 4; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPSnowyConiferousForest.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.notEqualsZeroChance = 12; + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyForest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyForest.java new file mode 100644 index 00000000..d008f236 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSnowyForest.java @@ -0,0 +1,37 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPSnowyForest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPSnowyForest; + +public class RealisticBiomeBOPSnowyForest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.snowy_forest.get(); + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeBOPSnowyForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPSnowyForest(58f, 69f, 28f), + new SurfaceBOPSnowyForest(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSteppe.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSteppe.java new file mode 100644 index 00000000..4450cbca --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPSteppe.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPSteppe; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPSteppe; + +public class RealisticBiomeBOPSteppe extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.steppe.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPSteppe(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPSteppe(65f, 68f, 30f), + new SurfaceBOPSteppe(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTemperateRainforest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTemperateRainforest.java new file mode 100644 index 00000000..82f2548e --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTemperateRainforest.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPTemperateRainforest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPTemperateRainforest; + +public class RealisticBiomeBOPTemperateRainforest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.temperate_rainforest.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPTemperateRainforest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPTemperateRainforest(), + new SurfaceBOPTemperateRainforest(config, biome.topBlock, biome.fillerBlock, 0.45f) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalIsland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalIsland.java new file mode 100644 index 00000000..1f43de4d --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalIsland.java @@ -0,0 +1,54 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesoplenty.config.BiomeConfigBOPTropicalIsland; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPTropicalIsland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPTropicalIsland; + +public class RealisticBiomeBOPTropicalIsland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.tropical_island.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPTropicalIsland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPTropicalIsland(), + new SurfaceBOPTropicalIsland(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + Blocks.SAND.getDefaultState(), //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 10f, //float mixWidth, + -0.15f, //float mixHeight, + 5f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 12; + decoFallenTree.logBlock = BOPBlocks.log_2.getStateFromMeta(3); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 4; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBOPTropicalIsland.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalRainforest.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalRainforest.java new file mode 100644 index 00000000..bfd08d66 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTropicalRainforest.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPTropicalRainforest; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPTropicalRainforest; + +public class RealisticBiomeBOPTropicalRainforest extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.tropical_rainforest.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPTropicalRainforest(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPTropicalRainforest(0f, 60f, 68f, 200f), + new SurfaceBOPTropicalRainforest(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTundra.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTundra.java new file mode 100644 index 00000000..277d9cc5 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPTundra.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPTundra; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPTundra; + +public class RealisticBiomeBOPTundra extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.tundra.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPTundra(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPTundra(), + new SurfaceBOPTundra(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPVolcanicIsland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPVolcanicIsland.java new file mode 100644 index 00000000..b3888f57 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPVolcanicIsland.java @@ -0,0 +1,45 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoGrassDoubleTallgrass; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPVolcanicIsland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPVolcanicIsland; + +public class RealisticBiomeBOPVolcanicIsland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.volcanic_island.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPVolcanicIsland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPVolcanicIsland(), + new SurfaceBOPVolcanicIsland(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 1; + this.noLakes = true; + this.noWaterFeatures = true; + + DecoGrassDoubleTallgrass decoGrassDoubleTallgrass = new DecoGrassDoubleTallgrass(); + decoGrassDoubleTallgrass.doubleGrassChance = 3; + decoGrassDoubleTallgrass.loops = 15; + decoGrassDoubleTallgrass.maxY = 128; + this.addDeco(decoGrassDoubleTallgrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWasteland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWasteland.java new file mode 100644 index 00000000..76ac27b9 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWasteland.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPWasteland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPWasteland; + +public class RealisticBiomeBOPWasteland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.wasteland.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPWasteland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPWasteland(), + new SurfaceBOPWasteland(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWetland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWetland.java new file mode 100644 index 00000000..9ee55a35 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWetland.java @@ -0,0 +1,29 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; +import biomesoplenty.api.block.BOPBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPWetland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPWetland; + +public class RealisticBiomeBOPWetland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.wetland.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPWetland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPWetland(), + new SurfaceBOPWetland(config, BOPBlocks.grass.getDefaultState(), BOPBlocks.dirt.getDefaultState()) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWoodland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWoodland.java new file mode 100644 index 00000000..94f82398 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPWoodland.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPWoodland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPWoodland; + +public class RealisticBiomeBOPWoodland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.woodland.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPWoodland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPWoodland(10f, 25f, 72f, 120f), + new SurfaceBOPWoodland(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPXericShrubland.java b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPXericShrubland.java new file mode 100644 index 00000000..10a0e740 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesoplenty/RealisticBiomeBOPXericShrubland.java @@ -0,0 +1,37 @@ +package rtg.world.biome.realistic.biomesoplenty; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import biomesoplenty.api.biome.BOPBiomes; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesoplenty.SurfaceBOPXericShrubland; +import rtg.world.gen.terrain.biomesoplenty.TerrainBOPXericShrubland; + +public class RealisticBiomeBOPXericShrubland extends RealisticBiomeBOPBase { + + public static Biome biome = BOPBiomes.xeric_shrubland.get(); + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBOPXericShrubland(BiomeConfig config) { + + super(config, biome, river, + new TerrainBOPXericShrubland(), + new SurfaceBOPXericShrubland(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGAutumnForest.java b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGAutumnForest.java new file mode 100644 index 00000000..bfcbe5d1 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGAutumnForest.java @@ -0,0 +1,109 @@ +package rtg.world.biome.realistic.biomesyougo; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesyougo.config.BiomeConfigBYGAutumnForest; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGQuercusRobur; +import rtg.world.gen.surface.biomesyougo.SurfaceBYGAutumnForest; +import rtg.world.gen.terrain.biomesyougo.TerrainBYGAutumnForest; + +public class RealisticBiomeBYGAutumnForest extends RealisticBiomeBYGBase { + + public static Biome river = Biomes.RIVER; + + private static IBlockState cikaLogBlock = Block.getBlockFromName("BiomesYouGo:CikaLog").getDefaultState(); + private static IBlockState cikaLeavesBlock = Block.getBlockFromName("BiomesYouGo:CikaLeaves").getDefaultState(); + + public RealisticBiomeBYGAutumnForest(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainBYGAutumnForest(), + new SurfaceBYGAutumnForest(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + BlockUtil.getStateDirt(2), //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + 0.35f, //float mixHeight, + 10f, //float smallWidth, + 0.65f //float smallStrength + ) + ); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 24; + decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBYGAutumnForest.decorationLogsId)); + + DecoShrub decoShrubCika = new DecoShrub(); + decoShrubCika.logBlock = cikaLogBlock; + decoShrubCika.leavesBlock = cikaLeavesBlock; + decoShrubCika.maxY = 90; + decoShrubCika.strengthFactor = 4f; + decoShrubCika.chance = 8; + this.addDeco(decoShrubCika); + + DecoShrub decoShrubOak = new DecoShrub(); + decoShrubOak.maxY = 90; + decoShrubOak.strengthFactor = 4f; + decoShrubOak.chance = 4; + this.addDeco(decoShrubOak); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.chance = 24; + decoBoulder.maxY = 80; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + TreeRTG quercusRoburOakTree = new TreeRTGQuercusRobur(); + quercusRoburOakTree.logBlock = Blocks.LOG.getDefaultState(); + quercusRoburOakTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + quercusRoburOakTree.minTrunkSize = 3; + quercusRoburOakTree.maxTrunkSize = 6; + quercusRoburOakTree.minCrownSize = 5; + quercusRoburOakTree.maxCrownSize = 9; + quercusRoburOakTree.validGroundBlocks.clear(); + quercusRoburOakTree.validGroundBlocks.add(BlockUtil.getStateDirt(2)); + this.addTree(quercusRoburOakTree); + + DecoTree bigOakTrees = new DecoTree(quercusRoburOakTree); + bigOakTrees.strengthFactorForLoops = 2f; + bigOakTrees.treeType = DecoTree.TreeType.RTG_TREE; + bigOakTrees.distribution.noiseDivisor = 100f; + bigOakTrees.distribution.noiseFactor = 6f; + bigOakTrees.distribution.noiseAddend = 0.8f; + bigOakTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + bigOakTrees.treeConditionNoise = 0f; + bigOakTrees.treeConditionChance = 6; + bigOakTrees.maxY = 105; + this.addDeco(bigOakTrees); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.maxY = 105; + decoBaseBiomeDecorations.notEqualsZeroChance = 8; + this.addDeco(decoBaseBiomeDecorations); + + // Grass filler. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.minY = 63; + decoGrass.maxY = 105; + decoGrass.loops = 1; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGBase.java b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGBase.java new file mode 100644 index 00000000..bf0eaf36 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGBase.java @@ -0,0 +1,71 @@ +package rtg.world.biome.realistic.biomesyougo; + +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.fml.common.Loader; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesyougo.config.BiomeConfigBYG; +import rtg.util.Logger; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.terrain.TerrainBase; + +@SuppressWarnings("WeakerAccess") +public class RealisticBiomeBYGBase extends RealisticBiomeBase { + + public static RealisticBiomeBase bygAutumnForest; + public static RealisticBiomeBase bygBirchPlains; + public static RealisticBiomeBase bygFrozenTundra; + public static RealisticBiomeBase bygLushForest; + public static RealisticBiomeBase bygRedDesert; + public static RealisticBiomeBase bygRedRockMountains; + public static RealisticBiomeBase bygWillowSwamps; + + public RealisticBiomeBYGBase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase s) { + + super(config, b, riverbiome, t, s); + + this.waterSurfaceLakeChance = 30; + this.lavaSurfaceLakeChance = 0; + } + + public static void addBiomes() { + + if (Loader.isModLoaded("BiomesYouGo")) { + + for (Biome biome : Biome.REGISTRY) { + + if (biome.getBiomeName().isEmpty()) { + Logger.warn("Biome ID %d has no name.", Biome.getIdForBiome(biome)); + continue; + } + + String biomeName = biome.getBiomeName(); + String biomeClass = biome.getBiomeClass().getName(); + + if (biomeName.equals("autumnForest") && biomeClass.equals("mod.mcreator.mcreator_autumnForest$BiomeGenautumnForest")) { + bygAutumnForest = new RealisticBiomeBYGAutumnForest(biome, BiomeConfigBYG.biomeConfigBYGAutumnForest); + } + else if (biomeName.equals("birchPlains") && biomeClass.equals("mod.mcreator.mcreator_birchPlains$BiomeGenbirchPlains")) { + bygLushForest = new RealisticBiomeBYGLushForest(biome, BiomeConfigBYG.biomeConfigBYGLushForest); + } + else if (biomeName.equals("redRockMoutains") && biomeClass.equals("mod.mcreator.mcreator_redRockMoutains$BiomeGenredRockMoutains")) { + bygRedRockMountains = new RealisticBiomeBYGRedRockMountains(biome, BiomeConfigBYG.biomeConfigBYGRedRockMountains); + } + else if (biomeName.equals("redDesert") && biomeClass.equals("mod.mcreator.mcreator_redDesert$BiomeGenredDesert")) { + bygRedDesert = new RealisticBiomeBYGRedDesert(biome, BiomeConfigBYG.biomeConfigBYGRedDesert); + } + else if (biomeName.equals("willowSwamps") && biomeClass.equals("mod.mcreator.mcreator_willowSwamps$BiomeGenwillowSwamps")) { + bygWillowSwamps = new RealisticBiomeBYGWillowSwamps(biome, BiomeConfigBYG.biomeConfigBYGWillowSwamps); + } + else if (biomeName.equals("birchPlains2") && biomeClass.equals("mod.mcreator.mcreator_birchPlains2$BiomeGenbirchPlains2")) { + bygBirchPlains = new RealisticBiomeBYGBirchPlains(biome, BiomeConfigBYG.biomeConfigBYGBirchPlains); + } + else if (biomeName.equals("frozenTundra") && biomeClass.equals("mod.mcreator.mcreator_frozenTundra$BiomeGenfrozenTundra")) { + bygFrozenTundra = new RealisticBiomeBYGFrozenTundra(biome, BiomeConfigBYG.biomeConfigBYGFrozenTundra); + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGBirchPlains.java b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGBirchPlains.java new file mode 100644 index 00000000..f3cc0f83 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGBirchPlains.java @@ -0,0 +1,56 @@ +package rtg.world.biome.realistic.biomesyougo; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesyougo.config.BiomeConfigBYGBirchPlains; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.DecoGrass; +import rtg.world.biome.deco.DecoShrub; +import rtg.world.gen.surface.biomesyougo.SurfaceBYGBirchPlains; +import rtg.world.gen.terrain.biomesyougo.TerrainBYGBirchPlains; + +public class RealisticBiomeBYGBirchPlains extends RealisticBiomeBYGBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBYGBirchPlains(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainBYGBirchPlains(), + new SurfaceBYGBirchPlains(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.15f) + ); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 24; + decoFallenTree.logBlock = BlockUtil.getStateLog(2); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBYGBirchPlains.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.maxY = 100; + this.addDeco(decoBaseBiomeDecorations); + + DecoShrub decoShrubBirch = new DecoShrub(); + decoShrubBirch.logBlock = BlockUtil.getStateLog(2); + decoShrubBirch.leavesBlock = BlockUtil.getStateLeaf(2); + decoShrubBirch.maxY = 90; + decoShrubBirch.strengthFactor = 6f; + decoShrubBirch.chance = 4; + this.addDeco(decoShrubBirch); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 100; + decoGrass.strengthFactor = 6f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGFrozenTundra.java b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGFrozenTundra.java new file mode 100644 index 00000000..1b63db2e --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGFrozenTundra.java @@ -0,0 +1,25 @@ +package rtg.world.biome.realistic.biomesyougo; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesyougo.SurfaceBYGFrozenTundra; +import rtg.world.gen.terrain.biomesyougo.TerrainBYGFrozenTundra; + +public class RealisticBiomeBYGFrozenTundra extends RealisticBiomeBYGBase { + + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeBYGFrozenTundra(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainBYGFrozenTundra(), + new SurfaceBYGFrozenTundra(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGLushForest.java b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGLushForest.java new file mode 100644 index 00000000..5bbe2df4 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGLushForest.java @@ -0,0 +1,56 @@ +package rtg.world.biome.realistic.biomesyougo; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesyougo.config.BiomeConfigBYGLushForest; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.DecoGrass; +import rtg.world.biome.deco.DecoShrub; +import rtg.world.gen.surface.biomesyougo.SurfaceBYGLushForest; +import rtg.world.gen.terrain.biomesyougo.TerrainBYGLushForest; + +public class RealisticBiomeBYGLushForest extends RealisticBiomeBYGBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBYGLushForest(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainBYGLushForest(), + new SurfaceBYGLushForest(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.15f) + ); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 24; + decoFallenTree.logBlock = BlockUtil.getStateLog(2); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBYGLushForest.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.maxY = 100; + this.addDeco(decoBaseBiomeDecorations); + + DecoShrub decoShrubBirch = new DecoShrub(); + decoShrubBirch.logBlock = BlockUtil.getStateLog(2); + decoShrubBirch.leavesBlock = BlockUtil.getStateLeaf(2); + decoShrubBirch.maxY = 90; + decoShrubBirch.strengthFactor = 6f; + decoShrubBirch.chance = 4; + this.addDeco(decoShrubBirch); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 100; + decoGrass.strengthFactor = 6f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedDesert.java b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedDesert.java new file mode 100644 index 00000000..059ca252 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedDesert.java @@ -0,0 +1,49 @@ +package rtg.world.biome.realistic.biomesyougo; + +import java.util.Random; + +import net.minecraft.init.Biomes; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.surface.SurfaceRiverOasis; +import rtg.world.gen.surface.biomesyougo.SurfaceBYGRedDesert; +import rtg.world.gen.terrain.biomesyougo.TerrainBYGRedDesert; + +public class RealisticBiomeBYGRedDesert extends RealisticBiomeBYGBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBYGRedDesert(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainBYGRedDesert(), + new SurfaceBYGRedDesert(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, biome.fillerBlock, 0.10f) + ); + + this.waterSurfaceLakeChance = 0; + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } + + @Override + public void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + this.getSurface().paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + + SurfaceBase riverSurface = new SurfaceRiverOasis(this.config); + riverSurface.paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedRockMountains.java b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedRockMountains.java new file mode 100644 index 00000000..eb4df699 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGRedRockMountains.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.biomesyougo; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.biomesyougo.SurfaceBYGRedRockMountains; +import rtg.world.gen.terrain.biomesyougo.TerrainBYGRedRockMountains; + +public class RealisticBiomeBYGRedRockMountains extends RealisticBiomeBYGBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeBYGRedRockMountains(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainBYGRedRockMountains(230f, 100f, 68f), + new SurfaceBYGRedRockMountains(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f) + ); + + this.noLakes = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGWillowSwamps.java b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGWillowSwamps.java new file mode 100644 index 00000000..083e605f --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/biomesyougo/RealisticBiomeBYGWillowSwamps.java @@ -0,0 +1,93 @@ +package rtg.world.biome.realistic.biomesyougo; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesyougo.config.BiomeConfigBYGWillowSwamps; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.DecoShrub; +import rtg.world.biome.deco.DecoTree; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGSalixMyrtilloides; +import rtg.world.gen.surface.biomesyougo.SurfaceBYGWillowSwamps; +import rtg.world.gen.terrain.biomesyougo.TerrainBYGWillowSwamps; + +public class RealisticBiomeBYGWillowSwamps extends RealisticBiomeBYGBase { + + public static Biome river = Biomes.RIVER; + + private static IBlockState willowLogBlock = Block.getBlockFromName("BiomesYouGo:WillowLog").getDefaultState(); + private static IBlockState willowLeavesBlock = Block.getBlockFromName("BiomesYouGo:WillowLeaves").getDefaultState(); + + public RealisticBiomeBYGWillowSwamps(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainBYGWillowSwamps(), + new SurfaceBYGWillowSwamps(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.maxY = 82; + this.addDeco(decoBaseBiomeDecorations); + + TreeRTG myrtilloidesTree = new TreeRTGSalixMyrtilloides(); + myrtilloidesTree.logBlock = Blocks.LOG.getDefaultState(); + myrtilloidesTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.addTree(myrtilloidesTree); + + DecoTree decoTrees = new DecoTree(myrtilloidesTree); + decoTrees.distribution.noiseDivisor = 80f; + decoTrees.distribution.noiseFactor = 60f; + decoTrees.distribution.noiseAddend = -15f; + decoTrees.treeType = DecoTree.TreeType.RTG_TREE; + decoTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoTrees.treeConditionNoise = 0f; + decoTrees.treeConditionChance = 16; + decoTrees.maxY = 70; + this.addDeco(decoTrees); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BlockUtil.getStateLog2(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf2(1); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + decoFallenTree.maxY = 76; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigBYGWillowSwamps.decorationLogsId)); + + TreeRTG deadWillowTree = new TreeRTGSalixMyrtilloides(); + deadWillowTree.logBlock = Blocks.LOG.getDefaultState(); + deadWillowTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + deadWillowTree.noLeaves = true; + this.addTree(deadWillowTree); + + DecoTree deadWillow = new DecoTree(deadWillowTree); + deadWillow.treeType = DecoTree.TreeType.RTG_TREE; + deadWillow.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + deadWillow.treeConditionChance = 18; + deadWillow.maxY = 84; + this.addDeco(deadWillow); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 88; + decoShrub.strengthFactor = 6f; + this.addDeco(decoShrub); + + DecoShrub decoShrubBYG = new DecoShrub(); + decoShrubBYG.logBlock = willowLogBlock; + decoShrubBYG.leavesBlock = willowLeavesBlock; + decoShrubBYG.maxY = 88; + decoShrubBYG.strengthFactor = 3f; + this.addDeco(decoShrubBYG); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/flowercraft/RealisticBiomeFCBase.java b/src/api/java/rtg/world/biome/realistic/flowercraft/RealisticBiomeFCBase.java new file mode 100644 index 00000000..cd8cf1a7 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/flowercraft/RealisticBiomeFCBase.java @@ -0,0 +1,48 @@ +package rtg.world.biome.realistic.flowercraft; + +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.fml.common.Loader; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.flowercraft.config.BiomeConfigFC; +import rtg.util.Logger; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.terrain.TerrainBase; + + +@SuppressWarnings("WeakerAccess") +public class RealisticBiomeFCBase extends RealisticBiomeBase { + + public static RealisticBiomeBase fcPhantasia; + + public RealisticBiomeFCBase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase s) { + + super(config, b, riverbiome, t, s); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + } + + public static void addBiomes() { + + if (Loader.isModLoaded("flowercraftmod")) { + + for (Biome biome : Biome.REGISTRY) { + + if (biome.getBiomeName().isEmpty()) { + Logger.warn("Biome ID %d has no name.", Biome.getIdForBiome(biome)); + continue; + } + + String biomeName = biome.getBiomeName(); + String biomeClass = biome.getBiomeClass().getName(); + + if (biomeName.equals("Phantasia") && biomeClass.equals("flowercraftmod.world.biome.BiomeGenFCPhantasia")) { + fcPhantasia = new RealisticBiomeFCPhantasia(biome, BiomeConfigFC.biomeConfigFCPhantasia); + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/realistic/flowercraft/RealisticBiomeFCPhantasia.java b/src/api/java/rtg/world/biome/realistic/flowercraft/RealisticBiomeFCPhantasia.java new file mode 100644 index 00000000..d985af09 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/flowercraft/RealisticBiomeFCPhantasia.java @@ -0,0 +1,25 @@ +package rtg.world.biome.realistic.flowercraft; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.flowercraft.SurfaceFCPhantasia; +import rtg.world.gen.terrain.flowercraft.TerrainFCPhantasia; + +public class RealisticBiomeFCPhantasia extends RealisticBiomeFCBase { + + public static Biome river = Biomes.RIVER; + + public RealisticBiomeFCPhantasia(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainFCPhantasia(), + new SurfaceFCPhantasia(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFBase.java b/src/api/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFBase.java new file mode 100644 index 00000000..ac073b3f --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFBase.java @@ -0,0 +1,46 @@ +package rtg.world.biome.realistic.mithwoodforest; + +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.fml.common.Loader; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.mithwoodforest.config.BiomeConfigMF; +import rtg.util.Logger; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.terrain.TerrainBase; + +@SuppressWarnings("WeakerAccess") +public class RealisticBiomeMFBase extends RealisticBiomeBase { + + public static RealisticBiomeBase mfMithwoodForest; + + public RealisticBiomeMFBase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase s) { + + super(config, b, riverbiome, t, s); + + this.lavaSurfaceLakeChance = 0; + } + + public static void addBiomes() { + + if (Loader.isModLoaded("mithwoodforest")) { + + for (Biome biome : Biome.REGISTRY) { + + if (biome.getBiomeName().isEmpty()) { + Logger.warn("Biome ID %d has no name.", Biome.getIdForBiome(biome)); + continue; + } + + String biomeName = biome.getBiomeName(); + String biomeClass = biome.getBiomeClass().getName(); + + if (biomeName.equals("Mithwood Forest") && biomeClass.equals("rainbeau.mithwoodforest.RMFWorldGen.BiomeMithwoodForest")) { + mfMithwoodForest = new RealisticBiomeMFMithwoodForest(biome, BiomeConfigMF.biomeConfigMFMithwoodForest); + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFMithwoodForest.java b/src/api/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFMithwoodForest.java new file mode 100644 index 00000000..7eaa0c4e --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/mithwoodforest/RealisticBiomeMFMithwoodForest.java @@ -0,0 +1,204 @@ +package rtg.world.biome.realistic.mithwoodforest; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.mithwoodforest.config.BiomeConfigMFMithwoodForest; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.DecoTree.TreeType; +import rtg.world.biome.deco.helper.DecoHelper5050; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGBetulaPapyrifera; +import rtg.world.gen.feature.tree.rtg.TreeRTGPinusNigra; +import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; +import rtg.world.gen.surface.mithwoodforest.SurfaceMFMithwoodForest; +import rtg.world.gen.terrain.mithwoodforest.TerrainMFMithwoodForest; + +public class RealisticBiomeMFMithwoodForest extends RealisticBiomeMFBase { + + public static Biome river = Biomes.RIVER; + + private static IBlockState mithwoodLogBlock = Block.getBlockFromName("mithwoodforest:mithwood_log").getDefaultState(); + private static IBlockState mithwoodLeavesBlock = Block.getBlockFromName("mithwoodforest:mithwood_leaves").getDefaultState(); + + public RealisticBiomeMFMithwoodForest(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainMFMithwoodForest(), + new SurfaceMFMithwoodForest(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.10f) + ); + + TreeRTG megaMithwood = new TreeRTGPinusNigra(); + megaMithwood.logBlock = mithwoodLogBlock; + megaMithwood.leavesBlock = mithwoodLeavesBlock; + megaMithwood.minTrunkSize = 18; + megaMithwood.maxTrunkSize = 27; + megaMithwood.minCrownSize = 7; + megaMithwood.maxCrownSize = 10; + this.addTree(megaMithwood); + + DecoTree RTGMithwood = new DecoTree(megaMithwood); + RTGMithwood.strengthFactorForLoops = 1f; + RTGMithwood.strengthNoiseFactorXForLoops = true; + RTGMithwood.distribution.noiseDivisor = 100f; + RTGMithwood.distribution.noiseFactor = 6f; + RTGMithwood.distribution.noiseAddend = 0.8f; + RTGMithwood.treeType = TreeType.RTG_TREE; + RTGMithwood.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + RTGMithwood.treeConditionChance = 12; + RTGMithwood.maxY = 100; + this.addDeco(RTGMithwood); + + TreeRTG megaOak = new TreeRTGPinusNigra(); + megaOak.logBlock = Blocks.LOG.getDefaultState(); + megaOak.leavesBlock = Blocks.LEAVES.getDefaultState(); + megaOak.minTrunkSize = 18; + megaOak.maxTrunkSize = 27; + megaOak.minCrownSize = 7; + megaOak.maxCrownSize = 10; + this.addTree(megaOak); + + DecoTree RTGOak = new DecoTree(megaOak); + RTGOak.strengthFactorForLoops = 4f; + RTGOak.strengthNoiseFactorXForLoops = true; + RTGOak.distribution.noiseDivisor = 100f; + RTGOak.distribution.noiseFactor = 6f; + RTGOak.distribution.noiseAddend = 0.8f; + RTGOak.treeType = TreeType.RTG_TREE; + RTGOak.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + RTGOak.treeConditionChance = 12; + RTGOak.maxY = 100; + this.addDeco(RTGOak); + + TreeRTG megaBirch = new TreeRTGBetulaPapyrifera(); + megaBirch.logBlock = BlockUtil.getStateLog(2); + megaBirch.leavesBlock = BlockUtil.getStateLeaf(2); + megaBirch.minTrunkSize = 4; + megaBirch.maxTrunkSize = 10; + megaBirch.minCrownSize = 8; + megaBirch.maxCrownSize = 19; + this.addTree(megaBirch); + + DecoTree RTGBirch = new DecoTree(megaBirch); + RTGBirch.strengthFactorForLoops = 2f; + RTGBirch.treeType = DecoTree.TreeType.RTG_TREE; + RTGBirch.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + RTGBirch.treeConditionChance = 24; + RTGBirch.maxY = 100; + this.addDeco(RTGBirch); + + TreeRTG megaSpruce = new TreeRTGPinusPonderosa(); + megaSpruce.logBlock = BlockUtil.getStateLog(1); + megaSpruce.leavesBlock = BlockUtil.getStateLeaf(1); + megaSpruce.minTrunkSize = 11; + megaSpruce.maxTrunkSize = 21; + megaSpruce.minCrownSize = 15; + megaSpruce.maxCrownSize = 29; + this.addTree(megaSpruce); + + DecoTree RTGSpruce = new DecoTree(megaSpruce); + RTGSpruce.strengthFactorForLoops = 2f; + RTGSpruce.strengthNoiseFactorForLoops = true; + RTGSpruce.treeType = DecoTree.TreeType.RTG_TREE; + RTGSpruce.distribution.noiseDivisor = 80f; + RTGSpruce.distribution.noiseFactor = 60f; + RTGSpruce.distribution.noiseAddend = -15f; + RTGSpruce.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + RTGSpruce.treeConditionNoise = 0f; + RTGSpruce.treeConditionChance = 24; + RTGSpruce.maxY = 140; + this.addDeco(RTGSpruce); + + DecoShrub decoShrubMithwood = new DecoShrub(); + decoShrubMithwood.logBlock = mithwoodLogBlock; + decoShrubMithwood.leavesBlock = mithwoodLeavesBlock; + decoShrubMithwood.maxY = 100; + decoShrubMithwood.strengthFactor = 1f; + decoShrubMithwood.chance = 2; + this.addDeco(decoShrubMithwood); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 100; + decoShrub.strengthFactor = 2f; + decoShrub.chance = 4; + this.addDeco(decoShrub); + + DecoFlowersRTG decoFlowers1 = new DecoFlowersRTG(); + decoFlowers1.flowers = new int[]{1, 2, 3, 6, 7, 8}; + decoFlowers1.strengthFactor = 2f; + decoFlowers1.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; + this.addDeco(decoFlowers1); + + DecoFlowersRTG decoFlowers2 = new DecoFlowersRTG(); + decoFlowers2.flowers = new int[]{11, 12, 13, 14}; + decoFlowers2.strengthFactor = 1f; + decoFlowers2.chance = 1; + decoFlowers2.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; + this.addDeco(decoFlowers2); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.chance = 2; + decoBoulder.maxY = 100; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.maxY = 100; + decoBaseBiomeDecorations.notEqualsZeroChance = 8; + this.addDeco(decoBaseBiomeDecorations); + + DecoFallenTree decoFallenMithwoodTree = new DecoFallenTree(); + decoFallenMithwoodTree.distribution.noiseDivisor = 100f; + decoFallenMithwoodTree.distribution.noiseFactor = 6f; + decoFallenMithwoodTree.distribution.noiseAddend = 0.8f; + decoFallenMithwoodTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenMithwoodTree.logConditionNoise = 0f; + decoFallenMithwoodTree.logConditionChance = 24; + decoFallenMithwoodTree.logBlock = mithwoodLogBlock; + decoFallenMithwoodTree.leavesBlock = mithwoodLeavesBlock; + decoFallenMithwoodTree.minSize = 3; + decoFallenMithwoodTree.maxSize = 6; + this.addDeco(decoFallenMithwoodTree, this.config._boolean(BiomeConfigMFMithwoodForest.decorationLogsId)); + + DecoFallenTree decoFallenOak = new DecoFallenTree(); + decoFallenOak.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenOak.logConditionChance = 8; + decoFallenOak.maxY = 100; + decoFallenOak.logBlock = Blocks.LOG.getDefaultState(); + decoFallenOak.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenOak.minSize = 3; + decoFallenOak.maxSize = 6; + this.addDeco(decoFallenOak, this.config._boolean(BiomeConfigMFMithwoodForest.decorationLogsId)); + + DecoFallenTree decoFallenBirch = new DecoFallenTree(); + decoFallenBirch.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenBirch.logConditionChance = 8; + decoFallenBirch.maxY = 100; + decoFallenBirch.logBlock = BlockUtil.getStateLog(2); + decoFallenBirch.leavesBlock = BlockUtil.getStateLeaf(2); + decoFallenBirch.minSize = 3; + decoFallenBirch.maxSize = 6; + + DecoFallenTree decoFallenSpruce = new DecoFallenTree(); + decoFallenSpruce.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenSpruce.logConditionChance = 8; + decoFallenSpruce.maxY = 100; + decoFallenSpruce.logBlock = BlockUtil.getStateLog(1); + decoFallenSpruce.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenSpruce.minSize = 3; + decoFallenSpruce.maxSize = 6; + DecoHelper5050 decoFallenTree = new DecoHelper5050(decoFallenBirch, decoFallenSpruce); + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigMFMithwoodForest.decorationLogsId)); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 24f; + this.addDeco(decoGrass); + + } +} diff --git a/src/api/java/rtg/world/biome/realistic/sugiforest/RealisticBiomeSFBase.java b/src/api/java/rtg/world/biome/realistic/sugiforest/RealisticBiomeSFBase.java new file mode 100644 index 00000000..1041d5ce --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/sugiforest/RealisticBiomeSFBase.java @@ -0,0 +1,46 @@ +package rtg.world.biome.realistic.sugiforest; + +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.fml.common.Loader; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.sugiforest.config.BiomeConfigSF; +import rtg.util.Logger; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.terrain.TerrainBase; + +@SuppressWarnings("WeakerAccess") +public class RealisticBiomeSFBase extends RealisticBiomeBase { + + public static RealisticBiomeBase sfSugiForest; + + public RealisticBiomeSFBase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase s) { + + super(config, b, riverbiome, t, s); + + this.lavaSurfaceLakeChance = 0; + } + + public static void addBiomes() { + + if (Loader.isModLoaded("sugiforest")) { + + for (Biome biome : Biome.REGISTRY) { + + if (biome.getBiomeName().isEmpty()) { + Logger.warn("Biome ID %d has no name.", Biome.getIdForBiome(biome)); + continue; + } + + String biomeName = biome.getBiomeName(); + String biomeClass = biome.getBiomeClass().getName(); + + if (biomeName.equals("Sugi Forest") && biomeClass.equals("sugiforest.world.BiomeSugiForest")) { + sfSugiForest = new RealisticBiomeSFSugiForest(biome, BiomeConfigSF.biomeConfigSFSugiForest); + } + } + } + } +} diff --git a/src/api/java/rtg/world/biome/realistic/sugiforest/RealisticBiomeSFSugiForest.java b/src/api/java/rtg/world/biome/realistic/sugiforest/RealisticBiomeSFSugiForest.java new file mode 100644 index 00000000..b93cd478 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/sugiforest/RealisticBiomeSFSugiForest.java @@ -0,0 +1,84 @@ +package rtg.world.biome.realistic.sugiforest; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.sugiforest.config.BiomeConfigSFSugiForest; +import rtg.world.biome.deco.*; +import rtg.world.gen.surface.sugiforest.SurfaceSFSugiForest; +import rtg.world.gen.terrain.sugiforest.TerrainSFSugiForest; + +public class RealisticBiomeSFSugiForest extends RealisticBiomeSFBase { + + public static Biome river = Biomes.RIVER; + + private static IBlockState sugiLogBlock = Block.getBlockFromName("sugiforest:sugi_log").getDefaultState(); + private static IBlockState sugiLeavesBlock = Block.getBlockFromName("sugiforest:sugi_leaves").getDefaultState(); + + public RealisticBiomeSFSugiForest(Biome biome, BiomeConfig config) { + + super(config, biome, river, + new TerrainSFSugiForest(), + new SurfaceSFSugiForest(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 24; + decoFallenTree.logBlock = sugiLogBlock; + decoFallenTree.leavesBlock = sugiLeavesBlock; + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigSFSugiForest.decorationLogsId)); + + DecoShrub decoShrubSugi = new DecoShrub(); + decoShrubSugi.logBlock = sugiLogBlock; + decoShrubSugi.leavesBlock = sugiLeavesBlock; + decoShrubSugi.maxY = 90; + decoShrubSugi.strengthFactor = 4f; + decoShrubSugi.chance = 8; + this.addDeco(decoShrubSugi); + + DecoShrub decoShrubOak = new DecoShrub(); + decoShrubOak.maxY = 90; + decoShrubOak.strengthFactor = 4f; + decoShrubOak.chance = 4; + this.addDeco(decoShrubOak); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.chance = 24; + decoBoulder.maxY = 80; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.maxY = 105; + decoBaseBiomeDecorations.notEqualsZeroChance = 8; + this.addDeco(decoBaseBiomeDecorations); + + // Grass filler. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.minY = 63; + decoGrass.maxY = 100; + decoGrass.loops = 1; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBase.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBase.java new file mode 100644 index 00000000..3ddba615 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBase.java @@ -0,0 +1,142 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanilla; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.terrain.TerrainBase; + +public class RealisticBiomeVanillaBase extends RealisticBiomeBase { + + public static RealisticBiomeBase vanillaBeach; + public static RealisticBiomeBase vanillaBirchForest; + public static RealisticBiomeBase vanillaBirchForestHills; + public static RealisticBiomeBase vanillaBirchForestHillsM; + public static RealisticBiomeBase vanillaBirchForestM; + public static RealisticBiomeBase vanillaColdBeach; + public static RealisticBiomeBase vanillaColdTaiga; + public static RealisticBiomeBase vanillaColdTaigaHills; + public static RealisticBiomeBase vanillaColdTaigaM; + public static RealisticBiomeBase vanillaDeepOcean; + public static RealisticBiomeBase vanillaDesert; + public static RealisticBiomeBase vanillaDesertHills; + public static RealisticBiomeBase vanillaDesertM; + public static RealisticBiomeBase vanillaExtremeHills; + public static RealisticBiomeBase vanillaExtremeHillsEdge; + public static RealisticBiomeBase vanillaExtremeHillsM; + public static RealisticBiomeBase vanillaExtremeHillsPlus; + public static RealisticBiomeBase vanillaExtremeHillsPlusM; + public static RealisticBiomeBase vanillaFlowerForest; + public static RealisticBiomeBase vanillaForest; + public static RealisticBiomeBase vanillaForestHills; + public static RealisticBiomeBase vanillaFrozenOcean; + public static RealisticBiomeBase vanillaFrozenRiver; + public static RealisticBiomeBase vanillaIceMountains; + public static RealisticBiomeBase vanillaIcePlains; + public static RealisticBiomeBase vanillaIcePlainsSpikes; + public static RealisticBiomeBase vanillaJungle; + public static RealisticBiomeBase vanillaJungleEdge; + public static RealisticBiomeBase vanillaJungleEdgeM; + public static RealisticBiomeBase vanillaJungleHills; + public static RealisticBiomeBase vanillaJungleM; + public static RealisticBiomeBase vanillaMegaSpruceTaiga; + public static RealisticBiomeBase vanillaMegaTaiga; + public static RealisticBiomeBase vanillaMegaTaigaHills; + public static RealisticBiomeBase vanillaMesa; + public static RealisticBiomeBase vanillaMesaBryce; + public static RealisticBiomeBase vanillaMesaPlateau; + public static RealisticBiomeBase vanillaMesaPlateau_F; + public static RealisticBiomeBase vanillaMesaPlateauFM; + public static RealisticBiomeBase vanillaMesaPlateauM; + public static RealisticBiomeBase vanillaMushroomIsland; + public static RealisticBiomeBase vanillaMushroomIslandShore; + public static RealisticBiomeBase vanillaOcean; + public static RealisticBiomeBase vanillaPlains; + public static RealisticBiomeBase vanillaRedwoodTaigaHills; + public static RealisticBiomeBase vanillaRiver; + public static RealisticBiomeBase vanillaRoofedForest; + public static RealisticBiomeBase vanillaRoofedForestM; + public static RealisticBiomeBase vanillaSavanna; + public static RealisticBiomeBase vanillaSavannaM; + public static RealisticBiomeBase vanillaSavannaPlateau; + public static RealisticBiomeBase vanillaSavannaPlateauM; + public static RealisticBiomeBase vanillaStoneBeach; + public static RealisticBiomeBase vanillaSunflowerPlains; + public static RealisticBiomeBase vanillaSwampland; + public static RealisticBiomeBase vanillaSwamplandM; + public static RealisticBiomeBase vanillaTaiga; + public static RealisticBiomeBase vanillaTaigaHills; + public static RealisticBiomeBase vanillaTaigaM; + + public RealisticBiomeVanillaBase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase s) { + + super(config, b, riverbiome, t, s); + + this.lavaSurfaceLakeChance = 0; + } + + public static void addBiomes() { + + vanillaBeach = new RealisticBiomeVanillaBeach(BiomeConfigVanilla.biomeConfigVanillaBeach); + vanillaBirchForest = new RealisticBiomeVanillaBirchForest(BiomeConfigVanilla.biomeConfigVanillaBirchForest); + vanillaBirchForestHills = new RealisticBiomeVanillaBirchForestHills(BiomeConfigVanilla.biomeConfigVanillaBirchForestHills); + vanillaBirchForestHillsM = new RealisticBiomeVanillaBirchForestHillsM(BiomeConfigVanilla.biomeConfigVanillaBirchForestHillsM); + vanillaBirchForestM = new RealisticBiomeVanillaBirchForestM(BiomeConfigVanilla.biomeConfigVanillaBirchForestM); + vanillaColdBeach = new RealisticBiomeVanillaColdBeach(BiomeConfigVanilla.biomeConfigVanillaColdBeach); + vanillaColdTaiga = new RealisticBiomeVanillaColdTaiga(BiomeConfigVanilla.biomeConfigVanillaColdTaiga); + vanillaColdTaigaHills = new RealisticBiomeVanillaColdTaigaHills(BiomeConfigVanilla.biomeConfigVanillaColdTaigaHills); + vanillaColdTaigaM = new RealisticBiomeVanillaColdTaigaM(BiomeConfigVanilla.biomeConfigVanillaColdTaigaM); + vanillaDeepOcean = new RealisticBiomeVanillaDeepOcean(BiomeConfigVanilla.biomeConfigVanillaDeepOcean); + vanillaDesert = new RealisticBiomeVanillaDesert(BiomeConfigVanilla.biomeConfigVanillaDesert); + vanillaDesertHills = new RealisticBiomeVanillaDesertHills(BiomeConfigVanilla.biomeConfigVanillaDesertHills); + vanillaDesertM = new RealisticBiomeVanillaDesertM(BiomeConfigVanilla.biomeConfigVanillaDesertM); + vanillaExtremeHills = new RealisticBiomeVanillaExtremeHills(BiomeConfigVanilla.biomeConfigVanillaExtremeHills); + vanillaExtremeHillsEdge = new RealisticBiomeVanillaExtremeHillsEdge(BiomeConfigVanilla.biomeConfigVanillaExtremeHillsEdge); + vanillaExtremeHillsM = new RealisticBiomeVanillaExtremeHillsM(BiomeConfigVanilla.biomeConfigVanillaExtremeHillsM); + vanillaExtremeHillsPlus = new RealisticBiomeVanillaExtremeHillsPlus(BiomeConfigVanilla.biomeConfigVanillaExtremeHillsPlus); + vanillaExtremeHillsPlusM = new RealisticBiomeVanillaExtremeHillsPlusM(BiomeConfigVanilla.biomeConfigVanillaExtremeHillsPlusM); + vanillaFlowerForest = new RealisticBiomeVanillaFlowerForest(BiomeConfigVanilla.biomeConfigVanillaFlowerForest); + vanillaForest = new RealisticBiomeVanillaForest(BiomeConfigVanilla.biomeConfigVanillaForest); + vanillaForestHills = new RealisticBiomeVanillaForestHills(BiomeConfigVanilla.biomeConfigVanillaForestHills); + vanillaFrozenOcean = new RealisticBiomeVanillaFrozenOcean(BiomeConfigVanilla.biomeConfigVanillaFrozenOcean); + vanillaFrozenRiver = new RealisticBiomeVanillaFrozenRiver(BiomeConfigVanilla.biomeConfigVanillaFrozenRiver); + vanillaIceMountains = new RealisticBiomeVanillaIceMountains(BiomeConfigVanilla.biomeConfigVanillaIceMountains); + vanillaIcePlains = new RealisticBiomeVanillaIcePlains(BiomeConfigVanilla.biomeConfigVanillaIcePlains); + vanillaIcePlainsSpikes = new RealisticBiomeVanillaIcePlainsSpikes(BiomeConfigVanilla.biomeConfigVanillaIcePlainsSpikes); + vanillaJungle = new RealisticBiomeVanillaJungle(BiomeConfigVanilla.biomeConfigVanillaJungle); + vanillaJungleEdge = new RealisticBiomeVanillaJungleEdge(BiomeConfigVanilla.biomeConfigVanillaJungleEdge); + vanillaJungleEdgeM = new RealisticBiomeVanillaJungleEdgeM(BiomeConfigVanilla.biomeConfigVanillaJungleEdgeM); + vanillaJungleHills = new RealisticBiomeVanillaJungleHills(BiomeConfigVanilla.biomeConfigVanillaJungleHills); + vanillaJungleM = new RealisticBiomeVanillaJungleM(BiomeConfigVanilla.biomeConfigVanillaJungleM); + vanillaMegaSpruceTaiga = new RealisticBiomeVanillaMegaSpruceTaiga(BiomeConfigVanilla.biomeConfigVanillaMegaSpruceTaiga); + vanillaMegaTaiga = new RealisticBiomeVanillaMegaTaiga(BiomeConfigVanilla.biomeConfigVanillaMegaTaiga); + vanillaMegaTaigaHills = new RealisticBiomeVanillaMegaTaigaHills(BiomeConfigVanilla.biomeConfigVanillaMegaTaigaHills); + vanillaMesa = new RealisticBiomeVanillaMesa(BiomeConfigVanilla.biomeConfigVanillaMesa); + vanillaMesaBryce = new RealisticBiomeVanillaMesaBryce(BiomeConfigVanilla.biomeConfigVanillaMesaBryce); + vanillaMesaPlateau = new RealisticBiomeVanillaMesaPlateau(BiomeConfigVanilla.biomeConfigVanillaMesaPlateau); + vanillaMesaPlateau_F = new RealisticBiomeVanillaMesaPlateauF(BiomeConfigVanilla.biomeConfigVanillaMesaPlateauF); + vanillaMesaPlateauFM = new RealisticBiomeVanillaMesaPlateauFM(BiomeConfigVanilla.biomeConfigVanillaMesaPlateauFM); + vanillaMesaPlateauM = new RealisticBiomeVanillaMesaPlateauM(BiomeConfigVanilla.biomeConfigVanillaMesaPlateauM); + vanillaMushroomIsland = new RealisticBiomeVanillaMushroomIsland(BiomeConfigVanilla.biomeConfigVanillaMushroomIsland); + vanillaMushroomIslandShore = new RealisticBiomeVanillaMushroomIslandShore(BiomeConfigVanilla.biomeConfigVanillaMushroomIslandShore); + vanillaOcean = new RealisticBiomeVanillaOcean(BiomeConfigVanilla.biomeConfigVanillaOcean); + vanillaPlains = new RealisticBiomeVanillaPlains(BiomeConfigVanilla.biomeConfigVanillaPlains); + vanillaRedwoodTaigaHills = new RealisticBiomeVanillaRedwoodTaigaHills(BiomeConfigVanilla.biomeConfigVanillaRedwoodTaigaHills); + vanillaRiver = new RealisticBiomeVanillaRiver(BiomeConfigVanilla.biomeConfigVanillaRiver); + vanillaRoofedForest = new RealisticBiomeVanillaRoofedForest(BiomeConfigVanilla.biomeConfigVanillaRoofedForest); + vanillaRoofedForestM = new RealisticBiomeVanillaRoofedForestM(BiomeConfigVanilla.biomeConfigVanillaRoofedForestM); + vanillaSavanna = new RealisticBiomeVanillaSavanna(BiomeConfigVanilla.biomeConfigVanillaSavanna); + vanillaSavannaM = new RealisticBiomeVanillaSavannaM(BiomeConfigVanilla.biomeConfigVanillaSavannaM); + vanillaSavannaPlateau = new RealisticBiomeVanillaSavannaPlateau(BiomeConfigVanilla.biomeConfigVanillaSavannaPlateau); + vanillaSavannaPlateauM = new RealisticBiomeVanillaSavannaPlateauM(BiomeConfigVanilla.biomeConfigVanillaSavannaPlateauM); + vanillaStoneBeach = new RealisticBiomeVanillaStoneBeach(BiomeConfigVanilla.biomeConfigVanillaStoneBeach); + vanillaSunflowerPlains = new RealisticBiomeVanillaSunflowerPlains(BiomeConfigVanilla.biomeConfigVanillaSunflowerPlains); + vanillaSwampland = new RealisticBiomeVanillaSwampland(BiomeConfigVanilla.biomeConfigVanillaSwampland); + vanillaSwamplandM = new RealisticBiomeVanillaSwamplandM(BiomeConfigVanilla.biomeConfigVanillaSwamplandM); + vanillaTaiga = new RealisticBiomeVanillaTaiga(BiomeConfigVanilla.biomeConfigVanillaTaiga); + vanillaTaigaHills = new RealisticBiomeVanillaTaigaHills(BiomeConfigVanilla.biomeConfigVanillaTaigaHills); + vanillaTaigaM = new RealisticBiomeVanillaTaigaM(BiomeConfigVanilla.biomeConfigVanillaTaigaM); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBeach.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBeach.java new file mode 100644 index 00000000..da5fab54 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBeach.java @@ -0,0 +1,46 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaBeach; +import rtg.world.biome.deco.DecoTree; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGCocosNucifera; +import rtg.world.gen.surface.vanilla.SurfaceVanillaBeach; +import rtg.world.gen.terrain.vanilla.TerrainVanillaBeach; + +public class RealisticBiomeVanillaBeach extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.BEACH; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaBeach(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaBeach(), + new SurfaceVanillaBeach(config, biome.topBlock, biome.fillerBlock, biome.topBlock, biome.fillerBlock, (byte) 0, 1) + ); + + // Scattered palm trees. + + TreeRTG nuciferaTree = new TreeRTGCocosNucifera(); + nuciferaTree.minTrunkSize = 7; + nuciferaTree.maxTrunkSize = 9; + nuciferaTree.minCrownSize = 6; + nuciferaTree.maxCrownSize = 8; + nuciferaTree.validGroundBlocks.clear(); + nuciferaTree.validGroundBlocks.add(Blocks.SAND.getDefaultState()); + this.addTree(nuciferaTree); + + DecoTree palmTrees = new DecoTree(nuciferaTree); + palmTrees.treeType = DecoTree.TreeType.RTG_TREE; + palmTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + palmTrees.treeConditionNoise = -0.2f; + palmTrees.treeConditionChance = 12; + palmTrees.maxY = 68; + this.addDeco(palmTrees, this.config._boolean(BiomeConfigVanillaBeach.decorationPalmTreesId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForest.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForest.java new file mode 100644 index 00000000..2bcf55e4 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForest.java @@ -0,0 +1,102 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.feature.WorldGenTrees; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaBirchForest; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.helper.DecoHelperRandomSplit; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGBetulaPapyrifera; +import rtg.world.gen.surface.vanilla.SurfaceVanillaBirchForest; +import rtg.world.gen.terrain.vanilla.TerrainVanillaBirchForest; + +public class RealisticBiomeVanillaBirchForest extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.BIRCH_FOREST; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaBirchForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaBirchForest(), + new SurfaceVanillaBirchForest(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.15f) + ); + + TreeRTG birchSmall = new TreeRTGBetulaPapyrifera(); + birchSmall.logBlock = BlockUtil.getStateLog(2); + birchSmall.leavesBlock = BlockUtil.getStateLeaf(2); + birchSmall.minTrunkSize = 4; + birchSmall.maxTrunkSize = 10; + birchSmall.minCrownSize = 8; + birchSmall.maxCrownSize = 19; + this.addTree(birchSmall); + + DecoTree smallBirch = new DecoTree(birchSmall); + smallBirch.strengthNoiseFactorForLoops = true; + smallBirch.treeType = DecoTree.TreeType.RTG_TREE; + smallBirch.distribution.noiseDivisor = 80f; + smallBirch.distribution.noiseFactor = 60f; + smallBirch.distribution.noiseAddend = -15f; + smallBirch.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + smallBirch.maxY = 120; + this.addDeco(smallBirch); + + TreeRTG birchTree = new TreeRTGBetulaPapyrifera(); + birchTree.logBlock = BlockUtil.getStateLog(2); + birchTree.leavesBlock = BlockUtil.getStateLeaf(2); + birchTree.minTrunkSize = 4; + birchTree.maxTrunkSize = 10; + birchTree.minCrownSize = 8; + birchTree.maxCrownSize = 19; + this.addTree(birchTree); + + DecoTree birchTrees = new DecoTree(birchTree); + birchTrees.strengthFactorForLoops = 3f; + birchTrees.treeType = DecoTree.TreeType.RTG_TREE; + birchTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + birchTrees.maxY = 100; + + DecoTree rtgTrees = new DecoTree(new WorldGenTrees(false)); + rtgTrees.treeType = DecoTree.TreeType.WORLDGEN; + rtgTrees.strengthFactorForLoops = 3f; + rtgTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + rtgTrees.maxY = 100; + + DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); + decoHelperRandomSplit.decos = new DecoBase[]{birchTrees, rtgTrees}; + decoHelperRandomSplit.chances = new int[]{10, 4}; + this.addDeco(decoHelperRandomSplit); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionChance = 8; + decoFallenTree.logBlock = BlockUtil.getStateLog(2); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaBirchForest.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 120; + decoShrub.strengthFactor = 3f; + this.addDeco(decoShrub); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.notEqualsZeroChance = 3; + this.addDeco(decoBaseBiomeDecorations); + + DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); + decoFlowersRTG.flowers = new int[]{3, 6}; + decoFlowersRTG.maxY = 128; + decoFlowersRTG.strengthFactor = 12f; + this.addDeco(decoFlowersRTG); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 20f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHills.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHills.java new file mode 100644 index 00000000..e86333d1 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHills.java @@ -0,0 +1,106 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.feature.WorldGenTrees; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaBirchForestHills; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.DecoTree.TreeType; +import rtg.world.biome.deco.helper.DecoHelperRandomSplit; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGBetulaPapyrifera; +import rtg.world.gen.surface.vanilla.SurfaceVanillaBirchForestHills; +import rtg.world.gen.terrain.vanilla.TerrainVanillaBirchForestHills; + +public class RealisticBiomeVanillaBirchForestHills extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.BIRCH_FOREST_HILLS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaBirchForestHills(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaBirchForestHills(), + new SurfaceVanillaBirchForestHills(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.10f) + ); + + this.noLakes = true; + + TreeRTG birchSmall = new TreeRTGBetulaPapyrifera(); + birchSmall.logBlock = BlockUtil.getStateLog(2); + birchSmall.leavesBlock = BlockUtil.getStateLeaf(2); + birchSmall.minTrunkSize = 4; + birchSmall.maxTrunkSize = 10; + birchSmall.minCrownSize = 8; + birchSmall.maxCrownSize = 19; + this.addTree(birchSmall); + + DecoTree smallBirch = new DecoTree(birchSmall); + smallBirch.strengthNoiseFactorForLoops = true; + smallBirch.treeType = TreeType.RTG_TREE; + smallBirch.distribution.noiseDivisor = 80f; + smallBirch.distribution.noiseFactor = 60f; + smallBirch.distribution.noiseAddend = -15f; + smallBirch.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + smallBirch.maxY = 120; + this.addDeco(smallBirch); + + TreeRTG birchTree = new TreeRTGBetulaPapyrifera(); + birchTree.logBlock = BlockUtil.getStateLog(2); + birchTree.leavesBlock = BlockUtil.getStateLeaf(2); + birchTree.minTrunkSize = 4; + birchTree.maxTrunkSize = 10; + birchTree.minCrownSize = 8; + birchTree.maxCrownSize = 19; + this.addTree(birchTree); + + DecoTree birchTrees = new DecoTree(birchTree); + birchTrees.strengthFactorForLoops = 3f; + birchTrees.treeType = TreeType.RTG_TREE; + birchTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + birchTrees.maxY = 100; + + DecoTree rtgTrees = new DecoTree(new WorldGenTrees(false)); + rtgTrees.treeType = TreeType.WORLDGEN; + rtgTrees.strengthFactorForLoops = 3f; + rtgTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + rtgTrees.maxY = 100; + + DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); + decoHelperRandomSplit.decos = new DecoBase[]{birchTrees, rtgTrees}; + decoHelperRandomSplit.chances = new int[]{10, 4}; + this.addDeco(decoHelperRandomSplit); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionChance = 8; + decoFallenTree.logBlock = BlockUtil.getStateLog(2); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaBirchForestHills.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 120; + decoShrub.strengthFactor = 3f; + this.addDeco(decoShrub); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.notEqualsZeroChance = 3; + this.addDeco(decoBaseBiomeDecorations); + + DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); + decoFlowersRTG.flowers = new int[]{3, 6}; + decoFlowersRTG.maxY = 128; + decoFlowersRTG.strengthFactor = 12f; + this.addDeco(decoFlowersRTG); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 20f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHillsM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHillsM.java new file mode 100644 index 00000000..237ba64b --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestHillsM.java @@ -0,0 +1,104 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.feature.WorldGenTrees; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaBirchForestHillsM; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.helper.DecoHelperRandomSplit; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGBetulaPapyrifera; +import rtg.world.gen.surface.vanilla.SurfaceVanillaBirchForestHillsM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaBirchForestHillsM; + +public class RealisticBiomeVanillaBirchForestHillsM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_BIRCH_FOREST_HILLS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaBirchForestHillsM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaBirchForestHillsM(), + new SurfaceVanillaBirchForestHillsM(config, biome.topBlock, biome.fillerBlock) + ); + + this.noLakes = true; + + TreeRTG birchSmall = new TreeRTGBetulaPapyrifera(); + birchSmall.logBlock = BlockUtil.getStateLog(2); + birchSmall.leavesBlock = BlockUtil.getStateLeaf(2); + birchSmall.minTrunkSize = 4; + birchSmall.maxTrunkSize = 10; + birchSmall.minCrownSize = 8; + birchSmall.maxCrownSize = 19; + this.addTree(birchSmall); + + DecoTree smallBirch = new DecoTree(birchSmall); + smallBirch.strengthNoiseFactorForLoops = true; + smallBirch.treeType = DecoTree.TreeType.RTG_TREE; + smallBirch.distribution.noiseDivisor = 80f; + smallBirch.distribution.noiseFactor = 60f; + smallBirch.distribution.noiseAddend = -15f; + smallBirch.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + smallBirch.maxY = 120; + this.addDeco(smallBirch); + + TreeRTG birchTree = new TreeRTGBetulaPapyrifera(); + birchTree.logBlock = BlockUtil.getStateLog(2); + birchTree.leavesBlock = BlockUtil.getStateLeaf(2); + birchTree.minTrunkSize = 4; + birchTree.maxTrunkSize = 10; + birchTree.minCrownSize = 8; + birchTree.maxCrownSize = 19; + this.addTree(birchTree); + + DecoTree birchTrees = new DecoTree(birchTree); + birchTrees.strengthFactorForLoops = 3f; + birchTrees.treeType = DecoTree.TreeType.RTG_TREE; + birchTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + birchTrees.maxY = 100; + + DecoTree rtgTrees = new DecoTree(new WorldGenTrees(false)); + rtgTrees.treeType = DecoTree.TreeType.WORLDGEN; + rtgTrees.strengthFactorForLoops = 3f; + rtgTrees.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + rtgTrees.maxY = 100; + + DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); + decoHelperRandomSplit.decos = new DecoBase[]{birchTrees, rtgTrees}; + decoHelperRandomSplit.chances = new int[]{10, 4}; + this.addDeco(decoHelperRandomSplit); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionChance = 8; + decoFallenTree.logBlock = BlockUtil.getStateLog(2); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaBirchForestHillsM.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 120; + decoShrub.strengthFactor = 3f; + this.addDeco(decoShrub); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.notEqualsZeroChance = 3; + this.addDeco(decoBaseBiomeDecorations); + + DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); + decoFlowersRTG.flowers = new int[]{3, 6}; + decoFlowersRTG.maxY = 128; + decoFlowersRTG.strengthFactor = 12f; + this.addDeco(decoFlowersRTG); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 20f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestM.java new file mode 100644 index 00000000..e8ea0f5f --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaBirchForestM.java @@ -0,0 +1,73 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaBirchForestM; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGBetulaPapyrifera; +import rtg.world.gen.surface.vanilla.SurfaceVanillaBirchForestM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaBirchForestM; + +public class RealisticBiomeVanillaBirchForestM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_BIRCH_FOREST; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaBirchForestM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaBirchForestM(), + new SurfaceVanillaBirchForestM(config, biome.topBlock, biome.fillerBlock, 0f, 1.5f, 60f, 65f, 1.5f, Blocks.DIRT.getDefaultState(), 0.15f) + ); + + this.noLakes = true; + + TreeRTG tallBirch = new TreeRTGBetulaPapyrifera(); + tallBirch.logBlock = BlockUtil.getStateLog(2); + tallBirch.leavesBlock = BlockUtil.getStateLeaf(2); + tallBirch.minTrunkSize = 16; + tallBirch.maxTrunkSize = 23; + tallBirch.minCrownSize = 4; + tallBirch.maxCrownSize = 11; + this.addTree(tallBirch); + + DecoTree superTallBirch = new DecoTree(tallBirch); + superTallBirch.strengthFactorForLoops = 16f; + superTallBirch.strengthNoiseFactorForLoops = true; + superTallBirch.treeType = DecoTree.TreeType.RTG_TREE; + superTallBirch.distribution.noiseDivisor = 80f; + superTallBirch.distribution.noiseFactor = 60f; + superTallBirch.distribution.noiseAddend = -15f; + superTallBirch.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + superTallBirch.maxY = 100; + this.addDeco(superTallBirch); + + DecoLargeFernDoubleTallgrass decoDoublePlants = new DecoLargeFernDoubleTallgrass(); + decoDoublePlants.maxY = 128; + decoDoublePlants.strengthFactor = 8f; + this.addDeco(decoDoublePlants); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 24f; + this.addDeco(decoGrass); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenTree.logConditionChance = 20; + decoFallenTree.logBlock = BlockUtil.getStateLog(2); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(2); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaBirchForestM.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 110; + decoShrub.strengthFactor = 2f; + this.addDeco(decoShrub); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdBeach.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdBeach.java new file mode 100644 index 00000000..1a7721e8 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdBeach.java @@ -0,0 +1,31 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.gen.surface.vanilla.SurfaceVanillaColdBeach; +import rtg.world.gen.terrain.vanilla.TerrainVanillaColdBeach; + +public class RealisticBiomeVanillaColdBeach extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.COLD_BEACH; + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeVanillaColdBeach(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaColdBeach(), + new SurfaceVanillaColdBeach(config, biome.topBlock, biome.fillerBlock, biome.topBlock, biome.fillerBlock, (byte) 0, 1) + ); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 3f; + this.addDeco(decoBoulder); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaiga.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaiga.java new file mode 100644 index 00000000..699ef9fc --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaiga.java @@ -0,0 +1,26 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaColdTaiga; +import rtg.world.biome.deco.collection.DecoCollectionTaiga; +import rtg.world.gen.surface.vanilla.SurfaceVanillaColdTaiga; +import rtg.world.gen.terrain.vanilla.TerrainVanillaColdTaiga; + +public class RealisticBiomeVanillaColdTaiga extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.COLD_TAIGA; + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeVanillaColdTaiga(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaColdTaiga(), + new SurfaceVanillaColdTaiga(config, biome.topBlock, biome.fillerBlock) + ); + + this.addDecoCollection(new DecoCollectionTaiga(this.config._boolean(BiomeConfigVanillaColdTaiga.decorationLogsId), 8f)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaHills.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaHills.java new file mode 100644 index 00000000..d963609a --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaHills.java @@ -0,0 +1,29 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaColdTaigaHills; +import rtg.world.biome.deco.collection.DecoCollectionTaiga; +import rtg.world.gen.surface.vanilla.SurfaceVanillaColdTaigaHills; +import rtg.world.gen.terrain.vanilla.TerrainVanillaColdTaigaHills; + +public class RealisticBiomeVanillaColdTaigaHills extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.COLD_TAIGA_HILLS; + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeVanillaColdTaigaHills(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaColdTaigaHills(), + new SurfaceVanillaColdTaigaHills(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0.2f) + ); + + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionTaiga(this.config._boolean(BiomeConfigVanillaColdTaigaHills.decorationLogsId), 8f)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaM.java new file mode 100644 index 00000000..4644c4cf --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaColdTaigaM.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaColdTaigaM; +import rtg.world.biome.deco.collection.DecoCollectionTaiga; +import rtg.world.gen.surface.vanilla.SurfaceVanillaColdTaigaM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaColdTaigaM; + +public class RealisticBiomeVanillaColdTaigaM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_TAIGA_COLD; + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeVanillaColdTaigaM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaColdTaigaM(), + new SurfaceVanillaColdTaigaM(config, biome.topBlock, biome.fillerBlock) + ); + + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionTaiga(this.config._boolean(BiomeConfigVanillaColdTaigaM.decorationLogsId), 8f)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDeepOcean.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDeepOcean.java new file mode 100644 index 00000000..b0da172e --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDeepOcean.java @@ -0,0 +1,32 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaDeepOcean; +import rtg.world.gen.terrain.vanilla.TerrainVanillaDeepOcean; + +public class RealisticBiomeVanillaDeepOcean extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.DEEP_OCEAN; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaDeepOcean(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaDeepOcean(), + new SurfaceVanillaDeepOcean(config, Blocks.GRAVEL.getDefaultState(), Blocks.GRAVEL.getDefaultState(), Blocks.CLAY.getDefaultState(), 20f, 0.1f) + ); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + this.noLakes = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesert.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesert.java new file mode 100644 index 00000000..3658a589 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesert.java @@ -0,0 +1,53 @@ +package rtg.world.biome.realistic.vanilla; + +import java.util.Random; + +import net.minecraft.init.Biomes; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.collection.DecoCollectionDesert; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.surface.SurfaceRiverOasis; +import rtg.world.gen.surface.vanilla.SurfaceVanillaDesert; +import rtg.world.gen.terrain.vanilla.TerrainVanillaDesert; + +public class RealisticBiomeVanillaDesert extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.DESERT; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaDesert(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaDesert(), + new SurfaceVanillaDesert(config, biome.topBlock, biome.fillerBlock) + ); + + this.waterSurfaceLakeChance = 0; + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + this.addDecoCollection(new DecoCollectionDesert()); + } + + @Override + public void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + this.getSurface().paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + + SurfaceBase riverSurface = new SurfaceRiverOasis(this.config); + riverSurface.paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertHills.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertHills.java new file mode 100644 index 00000000..c91c4323 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertHills.java @@ -0,0 +1,54 @@ +package rtg.world.biome.realistic.vanilla; + +import java.util.Random; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.collection.DecoCollectionDesert; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.surface.SurfaceRiverOasis; +import rtg.world.gen.surface.vanilla.SurfaceVanillaDesertHills; +import rtg.world.gen.terrain.vanilla.TerrainVanillaDesertHills; + +public class RealisticBiomeVanillaDesertHills extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.DESERT_HILLS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaDesertHills(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaDesertHills(10f, 80f, 68f, 200f), + new SurfaceVanillaDesertHills(config, Blocks.SAND.getDefaultState(), Blocks.SANDSTONE.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f) + ); + + this.waterSurfaceLakeChance = 0; + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + this.addDecoCollection(new DecoCollectionDesert()); + } + + @Override + public void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + this.getSurface().paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + + SurfaceBase riverSurface = new SurfaceRiverOasis(this.config); + riverSurface.paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertM.java new file mode 100644 index 00000000..907bede1 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaDesertM.java @@ -0,0 +1,54 @@ +package rtg.world.biome.realistic.vanilla; + +import java.util.Random; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.collection.DecoCollectionDesert; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.surface.SurfaceRiverOasis; +import rtg.world.gen.surface.vanilla.SurfaceVanillaDesertM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaDesertM; + +public class RealisticBiomeVanillaDesertM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_DESERT; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaDesertM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaDesertM(10f, 20f, 68f, 200f), + new SurfaceVanillaDesertM(config, Blocks.SAND.getDefaultState(), Blocks.SANDSTONE.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f) + ); + + this.waterSurfaceLakeChance = 0; + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + this.addDecoCollection(new DecoCollectionDesert()); + } + + @Override + public void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + this.getSurface().paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + + SurfaceBase riverSurface = new SurfaceRiverOasis(this.config); + riverSurface.paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHills.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHills.java new file mode 100644 index 00000000..73f98888 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHills.java @@ -0,0 +1,98 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaExtremeHills; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.DecoFallenTree.LogCondition; +import rtg.world.biome.deco.DecoTree.TreeType; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGPinusNigra; +import rtg.world.gen.surface.vanilla.SurfaceVanillaExtremeHills; +import rtg.world.gen.terrain.vanilla.TerrainVanillaExtremeHills; + +public class RealisticBiomeVanillaExtremeHills extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.EXTREME_HILLS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaExtremeHills(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaExtremeHills(10f, 120f, 10f, 200f), + new SurfaceVanillaExtremeHills(config, biome.topBlock, biome.fillerBlock, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 60f, -0.14f, 14f, 0.25f) + ); + + this.generatesEmeralds = true; + this.generatesSilverfish = true; + this.noLakes = true; + this.noWaterFeatures = true; + + TreeRTG nigraTree = new TreeRTGPinusNigra(); + nigraTree.logBlock = Blocks.LOG.getDefaultState(); + nigraTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + nigraTree.minTrunkSize = 18; + nigraTree.maxTrunkSize = 27; + nigraTree.minCrownSize = 7; + nigraTree.maxCrownSize = 10; + this.addTree(nigraTree); + + DecoTree decoTrees = new DecoTree(nigraTree); + decoTrees.strengthFactorForLoops = 4f; + decoTrees.strengthNoiseFactorXForLoops = true; + decoTrees.distribution.noiseDivisor = 100f; + decoTrees.distribution.noiseFactor = 6f; + decoTrees.distribution.noiseAddend = 0.8f; + decoTrees.treeType = TreeType.RTG_TREE; + decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + decoTrees.treeConditionChance = 24; + decoTrees.maxY = 100; + this.addDeco(decoTrees); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 16; + decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 4; + decoFallenTree.maxSize = 7; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaExtremeHills.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 100; + decoShrub.strengthFactor = 2f; + decoShrub.chance = 4; + this.addDeco(decoShrub); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 12; + decoBoulder.maxY = 90; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + DecoMushrooms decoMushrooms = new DecoMushrooms(); + decoMushrooms.maxY = 90; + decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; + decoMushrooms.randomFloat = 3f; + this.addDeco(decoMushrooms); + + DecoPumpkin decoPumpkin = new DecoPumpkin(); + decoPumpkin.maxY = 90; + decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; + decoPumpkin.randomFloat = 30f; + this.addDeco(decoPumpkin); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 10f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsEdge.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsEdge.java new file mode 100644 index 00000000..87bdf84d --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsEdge.java @@ -0,0 +1,95 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaExtremeHillsEdge; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGPinusNigra; +import rtg.world.gen.surface.vanilla.SurfaceVanillaExtremeHillsEdge; +import rtg.world.gen.terrain.vanilla.TerrainVanillaExtremeHillsEdge; + +public class RealisticBiomeVanillaExtremeHillsEdge extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.EXTREME_HILLS_EDGE; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaExtremeHillsEdge(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaExtremeHillsEdge(10f, 60f, 68f, 200f), + new SurfaceVanillaExtremeHillsEdge(config, biome.topBlock, biome.fillerBlock, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 60f, -0.14f, 14f, 0.25f) + ); + + this.generatesEmeralds = true; + this.generatesSilverfish = true; + this.noLakes = true; + this.noWaterFeatures = true; + + TreeRTG nigraTree = new TreeRTGPinusNigra(); + nigraTree.logBlock = Blocks.LOG.getDefaultState(); + nigraTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + nigraTree.minTrunkSize = 18; + nigraTree.maxTrunkSize = 27; + nigraTree.minCrownSize = 7; + nigraTree.maxCrownSize = 10; + this.addTree(nigraTree); + + DecoTree decoTrees = new DecoTree(nigraTree); + decoTrees.strengthFactorForLoops = 4f; + decoTrees.strengthNoiseFactorXForLoops = true; + decoTrees.distribution.noiseDivisor = 100f; + decoTrees.distribution.noiseFactor = 6f; + decoTrees.distribution.noiseAddend = 0.8f; + decoTrees.treeType = DecoTree.TreeType.RTG_TREE; + decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + decoTrees.treeConditionChance = 24; + decoTrees.maxY = 100; + this.addDeco(decoTrees); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BlockUtil.getStateLog(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaExtremeHillsEdge.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 100; + decoShrub.strengthFactor = 2f; + this.addDeco(decoShrub); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 12; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + DecoMushrooms decoMushrooms = new DecoMushrooms(); + decoMushrooms.maxY = 90; + decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; + decoMushrooms.randomFloat = 3f; + this.addDeco(decoMushrooms); + + DecoPumpkin decoPumpkin = new DecoPumpkin(); + decoPumpkin.maxY = 90; + decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; + decoPumpkin.randomFloat = 20f; + this.addDeco(decoPumpkin); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 10f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsM.java new file mode 100644 index 00000000..4beed15f --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsM.java @@ -0,0 +1,32 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaExtremeHillsM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaExtremeHillsM; + +public class RealisticBiomeVanillaExtremeHillsM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_EXTREME_HILLS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaExtremeHillsM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaExtremeHillsM(10f, 140f, 68f, 200f), + new SurfaceVanillaExtremeHillsM(config, biome.topBlock, biome.fillerBlock, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 60f, + -0.14f, 14f, 0.25f) + ); + + this.generatesEmeralds = true; + this.generatesSilverfish = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlus.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlus.java new file mode 100644 index 00000000..29d40cad --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlus.java @@ -0,0 +1,96 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaExtremeHillsPlus; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGPinusNigra; +import rtg.world.gen.surface.vanilla.SurfaceVanillaExtremeHillsPlus; +import rtg.world.gen.terrain.vanilla.TerrainVanillaExtremeHillsPlus; + +public class RealisticBiomeVanillaExtremeHillsPlus extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.EXTREME_HILLS_WITH_TREES; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaExtremeHillsPlus(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaExtremeHillsPlus(150f, 80f, 90f), + new SurfaceVanillaExtremeHillsPlus(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f, Blocks.GRAVEL.getDefaultState(), 0.08f) + ); + + this.generatesEmeralds = true; + this.generatesSilverfish = true; + this.noLakes = true; + this.noWaterFeatures = true; + + TreeRTG nigraTree = new TreeRTGPinusNigra(); + nigraTree.logBlock = Blocks.LOG.getDefaultState(); + nigraTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + nigraTree.minTrunkSize = 18; + nigraTree.maxTrunkSize = 27; + nigraTree.minCrownSize = 7; + nigraTree.maxCrownSize = 10; + this.addTree(nigraTree); + + DecoTree decoTrees = new DecoTree(nigraTree); + decoTrees.strengthFactorForLoops = 4f; + decoTrees.strengthNoiseFactorXForLoops = true; + decoTrees.distribution.noiseDivisor = 100f; + decoTrees.distribution.noiseFactor = 6f; + decoTrees.distribution.noiseAddend = 0.8f; + decoTrees.treeType = DecoTree.TreeType.RTG_TREE; + decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + decoTrees.treeConditionChance = 24; + decoTrees.maxY = 100; + this.addDeco(decoTrees); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 100; + decoShrub.strengthFactor = 2f; + this.addDeco(decoShrub); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BlockUtil.getStateLog(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaExtremeHillsPlus.decorationLogsId)); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 12; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + DecoPumpkin decoPumpkin = new DecoPumpkin(); + decoPumpkin.maxY = 90; + decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.USE_CHANCE_VALUE; + decoPumpkin.chance = 28; + this.addDeco(decoPumpkin); + + DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); + decoFlowersRTG.flowers = new int[]{9, 9, 9, 9, 3, 3, 3, 3, 3, 2, 2, 2, 11, 11, 11}; + decoFlowersRTG.maxY = 128; + decoFlowersRTG.loops = 3; + this.addDeco(decoFlowersRTG); + + DecoLargeFernDoubleTallgrass decoDoublePlants = new DecoLargeFernDoubleTallgrass(); + decoDoublePlants.maxY = 128; + decoDoublePlants.fernChance = 3; + decoDoublePlants.loops = 15; + this.addDeco(decoDoublePlants); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlusM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlusM.java new file mode 100644 index 00000000..e4a340ca --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaExtremeHillsPlusM.java @@ -0,0 +1,32 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaExtremeHillsPlusM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaExtremeHillsPlusM; + +public class RealisticBiomeVanillaExtremeHillsPlusM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_EXTREME_HILLS_WITH_TREES; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaExtremeHillsPlusM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaExtremeHillsPlusM(230f, 120f, 68f), + new SurfaceVanillaExtremeHillsPlusM(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f, Blocks.GRAVEL.getDefaultState(), 0.08f) + ); + + this.generatesEmeralds = true; + this.generatesSilverfish = true; + this.noLakes = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFlowerForest.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFlowerForest.java new file mode 100644 index 00000000..cfe0fe32 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFlowerForest.java @@ -0,0 +1,129 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaFlowerForest; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.collection.DecoCollectionSmallPineTreesForest; +import rtg.world.biome.deco.helper.DecoHelper5050; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; +import rtg.world.gen.surface.vanilla.SurfaceVanillaFlowerForest; +import rtg.world.gen.terrain.vanilla.TerrainVanillaFlowerForest; + +public class RealisticBiomeVanillaFlowerForest extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_FOREST; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaFlowerForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaFlowerForest(), + new SurfaceVanillaFlowerForest(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f, Blocks.GRASS.getDefaultState(), 0.05f) + ); + + // First, let's get a few shrubs in to break things up a bit. + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 110; + decoShrub.strengthFactor = 4f; + decoShrub.chance = 3; + this.addDeco(decoShrub); + + // Flowers are the most aesthetically important feature of this biome, so let's add those next. + DecoFlowersRTG decoFlowers1 = new DecoFlowersRTG(); + decoFlowers1.flowers = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; //Only colourful 1-block-tall flowers. + decoFlowers1.strengthFactor = 12f; // Lots and lots of flowers! + decoFlowers1.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; // We're only bothered about surface flowers here. + this.addDeco(decoFlowers1); + + DecoFlowersRTG decoFlowers2 = new DecoFlowersRTG(); + decoFlowers2.flowers = new int[]{10, 11, 14, 15}; //Only 2-block-tall flowers. + decoFlowers2.strengthFactor = 2f; // Not as many of these. + decoFlowers2.chance = 3; + decoFlowers2.heightType = DecoFlowersRTG.HeightType.GET_HEIGHT_VALUE; // We're only bothered about surface flowers here. + this.addDeco(decoFlowers2); + + // Trees first. + + TreeRTG ponderosaOakTree = new TreeRTGPinusPonderosa(); + ponderosaOakTree.logBlock = Blocks.LOG.getDefaultState(); + ponderosaOakTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + ponderosaOakTree.minTrunkSize = 11; + ponderosaOakTree.maxTrunkSize = 21; + ponderosaOakTree.minCrownSize = 15; + ponderosaOakTree.maxCrownSize = 29; + this.addTree(ponderosaOakTree); + + DecoTree oakPines = new DecoTree(ponderosaOakTree); + oakPines.strengthNoiseFactorForLoops = true; + oakPines.treeType = DecoTree.TreeType.RTG_TREE; + oakPines.distribution.noiseDivisor = 80f; + oakPines.distribution.noiseFactor = 60f; + oakPines.distribution.noiseAddend = -15f; + oakPines.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + oakPines.treeConditionNoise = 0f; + oakPines.treeConditionChance = 1; + oakPines.maxY = 140; + + TreeRTG ponderosaSpruceTree = new TreeRTGPinusPonderosa(); + ponderosaSpruceTree.logBlock = BlockUtil.getStateLog(1); + ponderosaSpruceTree.leavesBlock = BlockUtil.getStateLeaf(1); + ponderosaSpruceTree.minTrunkSize = 11; + ponderosaSpruceTree.maxTrunkSize = 21; + ponderosaSpruceTree.minCrownSize = 15; + ponderosaSpruceTree.maxCrownSize = 29; + this.addTree(ponderosaSpruceTree); + + DecoTree sprucePines = new DecoTree(ponderosaSpruceTree); + sprucePines.strengthNoiseFactorForLoops = true; + sprucePines.treeType = DecoTree.TreeType.RTG_TREE; + sprucePines.distribution.noiseDivisor = 80f; + sprucePines.distribution.noiseFactor = 60f; + sprucePines.distribution.noiseAddend = -15f; + sprucePines.treeCondition = DecoTree.TreeCondition.ALWAYS_GENERATE; + sprucePines.treeConditionNoise = 0f; + sprucePines.treeConditionChance = 1; + sprucePines.maxY = 140; + + DecoHelper5050 decoPines = new DecoHelper5050(oakPines, sprucePines); + this.addDeco(decoPines); + + // More trees. + this.addDecoCollection(new DecoCollectionSmallPineTreesForest()); + + // Not much free space left, so let's give some space to the base biome. + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.notEqualsZeroChance = 4; + this.addDeco(decoBaseBiomeDecorations); + + // Add some fallen trees of the oak and spruce variety (50/50 distribution). + DecoFallenTree decoFallenOak = new DecoFallenTree(); + decoFallenOak.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenOak.logConditionChance = 8; + decoFallenOak.maxY = 100; + decoFallenOak.logBlock = Blocks.LOG.getDefaultState(); + decoFallenOak.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenOak.minSize = 3; + decoFallenOak.maxSize = 6; + DecoFallenTree decoFallenSpruce = new DecoFallenTree(); + decoFallenSpruce.logCondition = DecoFallenTree.LogCondition.RANDOM_CHANCE; + decoFallenSpruce.logConditionChance = 8; + decoFallenSpruce.maxY = 100; + decoFallenSpruce.logBlock = BlockUtil.getStateLog(1); + decoFallenSpruce.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenSpruce.minSize = 3; + decoFallenSpruce.maxSize = 6; + DecoHelper5050 decoFallenTree = new DecoHelper5050(decoFallenOak, decoFallenSpruce); + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaFlowerForest.decorationLogsId)); + + // Grass filler. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 24f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForest.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForest.java new file mode 100644 index 00000000..de179a20 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForest.java @@ -0,0 +1,27 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaForest; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.collection.DecoCollectionForest; +import rtg.world.gen.surface.vanilla.SurfaceVanillaForest; +import rtg.world.gen.terrain.vanilla.TerrainVanillaForest; + +public class RealisticBiomeVanillaForest extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.FOREST; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaForest(), + new SurfaceVanillaForest(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.10f) + ); + + this.addDecoCollection(new DecoCollectionForest(this.config._boolean(BiomeConfigVanillaForest.decorationLogsId))); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForestHills.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForestHills.java new file mode 100644 index 00000000..046b7720 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaForestHills.java @@ -0,0 +1,29 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaForestHills; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.collection.DecoCollectionForest; +import rtg.world.gen.surface.vanilla.SurfaceVanillaForestHills; +import rtg.world.gen.terrain.vanilla.TerrainVanillaForestHills; + +public class RealisticBiomeVanillaForestHills extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.FOREST_HILLS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaForestHills(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaForestHills(), + new SurfaceVanillaForestHills(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.15f) + ); + + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionForest(this.config._boolean(BiomeConfigVanillaForestHills.decorationLogsId))); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenOcean.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenOcean.java new file mode 100644 index 00000000..48cec156 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenOcean.java @@ -0,0 +1,31 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaFrozenOcean; +import rtg.world.gen.terrain.vanilla.TerrainVanillaFrozenOcean; + +public class RealisticBiomeVanillaFrozenOcean extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.FROZEN_OCEAN; + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeVanillaFrozenOcean(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaFrozenOcean(), + new SurfaceVanillaFrozenOcean(config, Blocks.SAND.getDefaultState(), Blocks.SAND.getDefaultState(), Blocks.GRAVEL.getDefaultState(), 20f, 0.2f) + ); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + this.noLakes = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenRiver.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenRiver.java new file mode 100644 index 00000000..6a2e5c8a --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaFrozenRiver.java @@ -0,0 +1,29 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaFrozenRiver; +import rtg.world.gen.terrain.vanilla.TerrainVanillaFrozenRiver; + +public class RealisticBiomeVanillaFrozenRiver extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.FROZEN_RIVER; + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeVanillaFrozenRiver(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaFrozenRiver(), + new SurfaceVanillaFrozenRiver(config) + ); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIceMountains.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIceMountains.java new file mode 100644 index 00000000..80cd3775 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIceMountains.java @@ -0,0 +1,30 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaIceMountains; +import rtg.world.gen.terrain.vanilla.TerrainVanillaIceMountains; + +public class RealisticBiomeVanillaIceMountains extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.ICE_MOUNTAINS; + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeVanillaIceMountains(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaIceMountains(230f, 60f, 68f), + new SurfaceVanillaIceMountains(config, biome.topBlock, biome.fillerBlock, Blocks.SNOW.getDefaultState(), Blocks.SNOW.getDefaultState(), Blocks.PACKED_ICE.getDefaultState(), Blocks.ICE.getDefaultState(), 60f, + -0.14f, 14f, 0.25f) + ); + + this.noLakes = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlains.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlains.java new file mode 100644 index 00000000..03131639 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlains.java @@ -0,0 +1,49 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaIcePlains; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.biome.deco.DecoFallenTree.LogCondition; +import rtg.world.gen.surface.vanilla.SurfaceVanillaIcePlains; +import rtg.world.gen.terrain.vanilla.TerrainVanillaIcePlains; + +public class RealisticBiomeVanillaIcePlains extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.ICE_PLAINS; + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeVanillaIcePlains(BiomeConfig config) + { + super(config, biome, river, + new TerrainVanillaIcePlains(), + new SurfaceVanillaIcePlains(config, biome.topBlock, biome.fillerBlock, biome.topBlock, biome.topBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.checkRiver = true; + decoBoulder.minRiver = 0.87f; + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 5f; + this.addDeco(decoBoulder); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.logCondition = LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionChance = 24; + decoFallenTree.logBlock = BlockUtil.getStateLog(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree.minSize = 1; + decoFallenTree.maxSize = 5; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaIcePlains.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlainsSpikes.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlainsSpikes.java new file mode 100644 index 00000000..da18140b --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaIcePlainsSpikes.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaIcePlainsSpikes; +import rtg.world.gen.terrain.vanilla.TerrainVanillaIcePlainsSpikes; + +public class RealisticBiomeVanillaIcePlainsSpikes extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_ICE_FLATS; + public static Biome river = Biomes.FROZEN_RIVER; + + public RealisticBiomeVanillaIcePlainsSpikes(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaIcePlainsSpikes(), + new SurfaceVanillaIcePlainsSpikes(config, biome.topBlock, biome.fillerBlock, biome.topBlock, biome.topBlock) + ); + + this.noLakes = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungle.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungle.java new file mode 100644 index 00000000..2537bdb6 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungle.java @@ -0,0 +1,146 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaJungle; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.helper.DecoHelperThisOrThat; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGCocosNucifera; +import rtg.world.gen.feature.tree.rtg.TreeRTGRhizophoraMucronata; +import rtg.world.gen.surface.vanilla.SurfaceVanillaJungle; +import rtg.world.gen.terrain.vanilla.TerrainVanillaJungle; + +public class RealisticBiomeVanillaJungle extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.JUNGLE; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaJungle(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaJungle(), + new SurfaceVanillaJungle(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.09f) + ); + + this.waterSurfaceLakeChance = 3; + + // Blend of the WorldGenMegaJungle collection and some tall RTG Mangrove trees. + + TreeRTG mucronataTree = new TreeRTGRhizophoraMucronata(4, 5, 13f, 0.32f, 0.2f); + mucronataTree.logBlock = BlockUtil.getStateLog(3); + mucronataTree.leavesBlock = BlockUtil.getStateLeaf(3); + mucronataTree.minTrunkSize = 3; + mucronataTree.maxTrunkSize = 4; + mucronataTree.minCrownSize = 10; + mucronataTree.maxCrownSize = 27; + this.addTree(mucronataTree); + + DecoTree mangroves = new DecoTree(new TreeRTGRhizophoraMucronata(4, 5, 13f, 0.32f, 0.2f)); + mangroves.loops = 3; + mangroves.treeType = DecoTree.TreeType.RTG_TREE; + mangroves.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + mangroves.treeConditionChance = 2; + mangroves.maxY = 160; + + DecoTree megaJungle = new DecoTree(new WorldGenMegaJungle(false, 10, 27, BlockUtil.getStateLog(3), BlockUtil.getStateLeaf(3))); + megaJungle.logBlock = BlockUtil.getStateLog(3); + megaJungle.leavesBlock = BlockUtil.getStateLeaf(3); + megaJungle.minTrunkSize = 3; + megaJungle.maxTrunkSize = 4; + megaJungle.minCrownSize = 10; + megaJungle.maxCrownSize = 27; + megaJungle.loops = 3; + megaJungle.treeType = DecoTree.TreeType.WORLDGEN; + megaJungle.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + megaJungle.treeConditionChance = 2; + megaJungle.maxY = 160; + + DecoHelperThisOrThat decoHelperThisOrThat = new DecoHelperThisOrThat(3, DecoHelperThisOrThat.ChanceType.NOT_EQUALS_ZERO, megaJungle, mangroves); + this.addDeco(decoHelperThisOrThat); + + // Add some palm trees for variety. + + TreeRTG nuciferaTree = new TreeRTGCocosNucifera(); + nuciferaTree.minTrunkSize = 7; + nuciferaTree.maxTrunkSize = 9; + nuciferaTree.minCrownSize = 6; + nuciferaTree.maxCrownSize = 8; + this.addTree(nuciferaTree); + + DecoTree palmCustom = new DecoTree(nuciferaTree); + palmCustom.loops = 1; + palmCustom.treeType = DecoTree.TreeType.RTG_TREE; + palmCustom.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + palmCustom.treeConditionChance = 3; + palmCustom.maxY = 160; + this.addDeco(palmCustom); + + // Another pass of the WorldGenMegaJungle collection for extra jungleness. + this.addDeco(decoHelperThisOrThat); + + // Jungle logs. + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.loops = 1; + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 5f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 3; + decoFallenTree.logBlock = BlockUtil.getStateLog(3); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); + decoFallenTree.minSize = 4; + decoFallenTree.maxSize = 9; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaJungle.decorationLogsId)); + + // At this point, let's hand over some of the decoration to the base biome, but only about 85% of the time. + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.notEqualsZeroChance = 6; + decoBaseBiomeDecorations.loops = 1; + this.addDeco(decoBaseBiomeDecorations); + + // A combo-deal of lilypads and vines. (This could probably be pulled out into individual decos.) + DecoJungleLilypadVines decoJungleLilypadVines = new DecoJungleLilypadVines(); + this.addDeco(decoJungleLilypadVines); + + // A combo-deal of grass and vines. (This could probably be pulled out into individual decos.) + DecoJungleGrassVines decoJungleGrassVines = new DecoJungleGrassVines(); + this.addDeco(decoJungleGrassVines); + + // Flowers. + DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); + decoFlowersRTG.flowers = new int[]{5}; // Only orange tulips fit in with the colour scheme. + decoFlowersRTG.chance = 4; + decoFlowersRTG.maxY = 120; + decoFlowersRTG.strengthFactor = 2f; + this.addDeco(decoFlowersRTG); + + // Tall cacti on red sand - matches the colour scheme nicely. + DecoJungleCacti decoJungleCacti = new DecoJungleCacti(); + decoJungleCacti.strengthFactor = 8f; + decoJungleCacti.maxY = 120; + decoJungleCacti.sandOnly = false; + decoJungleCacti.extraHeight = 7; + decoJungleCacti.sandMeta = (byte) 1; + this.addDeco(decoJungleCacti, this.config._boolean(BiomeConfigVanillaJungle.decorationCactusId)); + + // Mossy boulders for the green. + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + // Grass filler. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 12f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdge.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdge.java new file mode 100644 index 00000000..5e8df3ce --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdge.java @@ -0,0 +1,42 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaJungleEdge; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.vanilla.SurfaceVanillaJungleEdge; +import rtg.world.gen.terrain.vanilla.TerrainVanillaJungleEdge; + +public class RealisticBiomeVanillaJungleEdge extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.JUNGLE_EDGE; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaJungleEdge(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaJungleEdge(), + new SurfaceVanillaJungleEdge(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.loops = 1; + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BlockUtil.getStateLog(3); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaJungleEdge.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdgeM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdgeM.java new file mode 100644 index 00000000..23003d70 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleEdgeM.java @@ -0,0 +1,42 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaJungleEdgeM; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.vanilla.SurfaceVanillaJungleEdgeM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaJungleEdgeM; + +public class RealisticBiomeVanillaJungleEdgeM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_JUNGLE_EDGE; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaJungleEdgeM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaJungleEdgeM(), + new SurfaceVanillaJungleEdgeM(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.loops = 1; + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BlockUtil.getStateLog(3); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaJungleEdgeM.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleHills.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleHills.java new file mode 100644 index 00000000..cb54c003 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleHills.java @@ -0,0 +1,147 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaJungleHills; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.helper.DecoHelperThisOrThat; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGCocosNucifera; +import rtg.world.gen.feature.tree.rtg.TreeRTGRhizophoraMucronata; +import rtg.world.gen.surface.vanilla.SurfaceVanillaJungleHills; +import rtg.world.gen.terrain.vanilla.TerrainVanillaJungleHills; + +public class RealisticBiomeVanillaJungleHills extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.JUNGLE_HILLS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaJungleHills(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaJungleHills(72f, 40f), + new SurfaceVanillaJungleHills(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 1f, 1.5f, 60f, 65f, 1.5f) + ); + + this.waterSurfaceLakeChance = 3; + this.noLakes = true; + + // Blend of the WorldGenMegaJungle collection and some tall RTG Mangrove trees. + + TreeRTG mucronataTree = new TreeRTGRhizophoraMucronata(4, 5, 13f, 0.32f, 0.2f); + mucronataTree.logBlock = BlockUtil.getStateLog(3); + mucronataTree.leavesBlock = BlockUtil.getStateLeaf(3); + mucronataTree.minTrunkSize = 3; + mucronataTree.maxTrunkSize = 4; + mucronataTree.minCrownSize = 10; + mucronataTree.maxCrownSize = 27; + this.addTree(mucronataTree); + + DecoTree mangroves = new DecoTree(mucronataTree); + mangroves.loops = 3; + mangroves.treeType = DecoTree.TreeType.RTG_TREE; + mangroves.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + mangroves.treeConditionChance = 2; + mangroves.maxY = 160; + + DecoTree megaJungle = new DecoTree(new WorldGenMegaJungle(false, 10, 27, BlockUtil.getStateLog(3), BlockUtil.getStateLeaf(3))); + megaJungle.logBlock = BlockUtil.getStateLog(3); + megaJungle.leavesBlock = BlockUtil.getStateLeaf(3); + megaJungle.minTrunkSize = 3; + megaJungle.maxTrunkSize = 4; + megaJungle.minCrownSize = 10; + megaJungle.maxCrownSize = 27; + megaJungle.loops = 3; + megaJungle.treeType = DecoTree.TreeType.WORLDGEN; + megaJungle.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + megaJungle.treeConditionChance = 2; + megaJungle.maxY = 160; + + DecoHelperThisOrThat decoHelperThisOrThat = new DecoHelperThisOrThat(3, DecoHelperThisOrThat.ChanceType.NOT_EQUALS_ZERO, megaJungle, mangroves); + this.addDeco(decoHelperThisOrThat); + + // Add some palm trees for variety. + + TreeRTG nuciferaTree = new TreeRTGCocosNucifera(); + nuciferaTree.minTrunkSize = 7; + nuciferaTree.maxTrunkSize = 9; + nuciferaTree.minCrownSize = 6; + nuciferaTree.maxCrownSize = 8; + this.addTree(nuciferaTree); + + DecoTree palmCustom = new DecoTree(nuciferaTree); + palmCustom.loops = 1; + palmCustom.treeType = DecoTree.TreeType.RTG_TREE; + palmCustom.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + palmCustom.treeConditionChance = 3; + palmCustom.maxY = 160; + this.addDeco(palmCustom); + + // Another pass of the WorldGenMegaJungle collection for extra jungleness. + this.addDeco(decoHelperThisOrThat); + + // Jungle logs. + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.loops = 1; + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 5f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 3; + decoFallenTree.logBlock = BlockUtil.getStateLog(3); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); + decoFallenTree.minSize = 4; + decoFallenTree.maxSize = 9; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaJungleHills.decorationLogsId)); + + // At this point, let's hand over some of the decoration to the base biome, but only about 85% of the time. + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.notEqualsZeroChance = 6; + decoBaseBiomeDecorations.loops = 1; + this.addDeco(decoBaseBiomeDecorations); + + // A combo-deal of lilypads and vines. (This could probably be pulled out into individual decos.) + DecoJungleLilypadVines decoJungleLilypadVines = new DecoJungleLilypadVines(); + this.addDeco(decoJungleLilypadVines); + + // A combo-deal of grass and vines. (This could probably be pulled out into individual decos.) + DecoJungleGrassVines decoJungleGrassVines = new DecoJungleGrassVines(); + this.addDeco(decoJungleGrassVines); + + // Flowers. + DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); + decoFlowersRTG.flowers = new int[]{5}; // Only orange tulips fit in with the colour scheme. + decoFlowersRTG.chance = 4; + decoFlowersRTG.maxY = 120; + decoFlowersRTG.strengthFactor = 2f; + this.addDeco(decoFlowersRTG); + + // Tall cacti on red sand - matches the colour scheme nicely. + DecoJungleCacti decoJungleCacti = new DecoJungleCacti(); + decoJungleCacti.strengthFactor = 8f; + decoJungleCacti.maxY = 120; + decoJungleCacti.sandOnly = false; + decoJungleCacti.extraHeight = 7; + decoJungleCacti.sandMeta = (byte) 1; + this.addDeco(decoJungleCacti, this.config._boolean(BiomeConfigVanillaJungleHills.decorationCactusId)); + + // Mossy boulders for the green. + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + // Grass filler. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 12f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleM.java new file mode 100644 index 00000000..6fa44668 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaJungleM.java @@ -0,0 +1,147 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.feature.WorldGenMegaJungle; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaJungleM; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.helper.DecoHelperThisOrThat; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGCocosNucifera; +import rtg.world.gen.feature.tree.rtg.TreeRTGRhizophoraMucronata; +import rtg.world.gen.surface.vanilla.SurfaceVanillaJungleM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaJungleM; + +public class RealisticBiomeVanillaJungleM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_JUNGLE; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaJungleM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaJungleM(), + new SurfaceVanillaJungleM(config, biome.topBlock, biome.fillerBlock) + ); + + this.waterSurfaceLakeChance = 3; + this.noLakes = true; + + // Blend of the WorldGenMegaJungle collection and some tall RTG Mangrove trees. + + TreeRTG mucronataTree = new TreeRTGRhizophoraMucronata(4, 5, 13f, 0.32f, 0.2f); + mucronataTree.logBlock = BlockUtil.getStateLog(3); + mucronataTree.leavesBlock = BlockUtil.getStateLeaf(3); + mucronataTree.minTrunkSize = 3; + mucronataTree.maxTrunkSize = 4; + mucronataTree.minCrownSize = 10; + mucronataTree.maxCrownSize = 27; + this.addTree(mucronataTree); + + DecoTree mangroves = new DecoTree(mucronataTree); + mangroves.loops = 3; + mangroves.treeType = DecoTree.TreeType.RTG_TREE; + mangroves.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + mangroves.treeConditionChance = 2; + mangroves.maxY = 160; + + DecoTree megaJungle = new DecoTree(new WorldGenMegaJungle(false, 10, 27, BlockUtil.getStateLog(3), BlockUtil.getStateLeaf(3))); + megaJungle.logBlock = BlockUtil.getStateLog(3); + megaJungle.leavesBlock = BlockUtil.getStateLeaf(3); + megaJungle.minTrunkSize = 3; + megaJungle.maxTrunkSize = 4; + megaJungle.minCrownSize = 10; + megaJungle.maxCrownSize = 27; + megaJungle.loops = 3; + megaJungle.treeType = DecoTree.TreeType.WORLDGEN; + megaJungle.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + megaJungle.treeConditionChance = 2; + megaJungle.maxY = 160; + + DecoHelperThisOrThat decoHelperThisOrThat = new DecoHelperThisOrThat(3, DecoHelperThisOrThat.ChanceType.NOT_EQUALS_ZERO, megaJungle, mangroves); + this.addDeco(decoHelperThisOrThat); + + // Add some palm trees for variety. + + TreeRTG nuciferaTree = new TreeRTGCocosNucifera(); + nuciferaTree.minTrunkSize = 7; + nuciferaTree.maxTrunkSize = 9; + nuciferaTree.minCrownSize = 6; + nuciferaTree.maxCrownSize = 8; + this.addTree(nuciferaTree); + + DecoTree palmCustom = new DecoTree(nuciferaTree); + palmCustom.loops = 1; + palmCustom.treeType = DecoTree.TreeType.RTG_TREE; + palmCustom.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + palmCustom.treeConditionChance = 3; + palmCustom.maxY = 160; + this.addDeco(palmCustom); + + // Another pass of the WorldGenMegaJungle collection for extra jungleness. + this.addDeco(decoHelperThisOrThat); + + // Jungle logs. + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.loops = 1; + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 5f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 3; + decoFallenTree.logBlock = BlockUtil.getStateLog(3); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(3); + decoFallenTree.minSize = 4; + decoFallenTree.maxSize = 9; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaJungleM.decorationLogsId)); + + // At this point, let's hand over some of the decoration to the base biome, but only about 85% of the time. + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.notEqualsZeroChance = 6; + decoBaseBiomeDecorations.loops = 1; + this.addDeco(decoBaseBiomeDecorations); + + // A combo-deal of lilypads and vines. (This could probably be pulled out into individual decos.) + DecoJungleLilypadVines decoJungleLilypadVines = new DecoJungleLilypadVines(); + this.addDeco(decoJungleLilypadVines); + + // A combo-deal of grass and vines. (This could probably be pulled out into individual decos.) + DecoJungleGrassVines decoJungleGrassVines = new DecoJungleGrassVines(); + this.addDeco(decoJungleGrassVines); + + // Flowers. + DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); + decoFlowersRTG.flowers = new int[]{5}; // Only orange tulips fit in with the colour scheme. + decoFlowersRTG.chance = 4; + decoFlowersRTG.maxY = 120; + decoFlowersRTG.strengthFactor = 2f; + this.addDeco(decoFlowersRTG); + + // Tall cacti on red sand - matches the colour scheme nicely. + DecoJungleCacti decoJungleCacti = new DecoJungleCacti(); + decoJungleCacti.strengthFactor = 8f; + decoJungleCacti.maxY = 120; + decoJungleCacti.sandOnly = false; + decoJungleCacti.extraHeight = 7; + decoJungleCacti.sandMeta = (byte) 1; + this.addDeco(decoJungleCacti, this.config._boolean(BiomeConfigVanillaJungleM.decorationCactusId)); + + // Mossy boulders for the green. + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + // Grass filler. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 12f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaSpruceTaiga.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaSpruceTaiga.java new file mode 100644 index 00000000..0f3c5697 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaSpruceTaiga.java @@ -0,0 +1,44 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaMegaSpruceTaiga; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.biome.deco.DecoFallenTree; +import rtg.world.gen.surface.vanilla.SurfaceVanillaMegaSpruceTaiga; +import rtg.world.gen.terrain.vanilla.TerrainVanillaMegaSpruceTaiga; + +public class RealisticBiomeVanillaMegaSpruceTaiga extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_REDWOOD_TAIGA; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaMegaSpruceTaiga(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaMegaSpruceTaiga(), + new SurfaceVanillaMegaSpruceTaiga(config, biome.topBlock, biome.fillerBlock) + ); + + this.noLakes = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.loops = 1; + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BlockUtil.getStateLog(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaMegaSpruceTaiga.decorationLogsId)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaiga.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaiga.java new file mode 100644 index 00000000..2f5fa4d1 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaiga.java @@ -0,0 +1,75 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaMegaTaiga; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.collection.DecoCollectionMegaTaiga; +import rtg.world.gen.surface.vanilla.SurfaceVanillaMegaTaiga; +import rtg.world.gen.terrain.vanilla.TerrainVanillaMegaTaiga; + +public class RealisticBiomeVanillaMegaTaiga extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.REDWOOD_TAIGA; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaMegaTaiga(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaMegaTaiga(), + new SurfaceVanillaMegaTaiga(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 3f; + this.addDeco(decoBoulder); + + this.addDecoCollection(new DecoCollectionMegaTaiga()); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BlockUtil.getStateLog(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaMegaTaiga.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 100; + decoShrub.strengthFactor = 2f; + decoShrub.chance = 10; + this.addDeco(decoShrub); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.equalsZeroChance = 3; + this.addDeco(decoBaseBiomeDecorations); + + DecoMushrooms decoMushrooms = new DecoMushrooms(); + decoMushrooms.maxY = 90; + decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; + decoMushrooms.randomFloat = 3f; + this.addDeco(decoMushrooms); + + DecoPumpkin decoPumpkin = new DecoPumpkin(); + decoPumpkin.maxY = 90; + decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; + decoPumpkin.randomFloat = 20f; + this.addDeco(decoPumpkin); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 10f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaigaHills.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaigaHills.java new file mode 100644 index 00000000..1f8ab8c4 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMegaTaigaHills.java @@ -0,0 +1,77 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaMegaTaigaHills; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.collection.DecoCollectionMegaTaiga; +import rtg.world.gen.surface.vanilla.SurfaceVanillaMegaTaigaHills; +import rtg.world.gen.terrain.vanilla.TerrainVanillaMegaTaigaHills; + +public class RealisticBiomeVanillaMegaTaigaHills extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.REDWOOD_TAIGA_HILLS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaMegaTaigaHills(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaMegaTaigaHills(), + new SurfaceVanillaMegaTaigaHills(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0.2f) + ); + + this.noLakes = true; + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 3f; + this.addDeco(decoBoulder); + + this.addDecoCollection(new DecoCollectionMegaTaiga()); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BlockUtil.getStateLog(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaMegaTaigaHills.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 100; + decoShrub.strengthFactor = 2f; + decoShrub.chance = 10; + this.addDeco(decoShrub); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.equalsZeroChance = 3; + this.addDeco(decoBaseBiomeDecorations); + + DecoMushrooms decoMushrooms = new DecoMushrooms(); + decoMushrooms.maxY = 90; + decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; + decoMushrooms.randomFloat = 3f; + this.addDeco(decoMushrooms); + + DecoPumpkin decoPumpkin = new DecoPumpkin(); + decoPumpkin.maxY = 90; + decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; + decoPumpkin.randomFloat = 20f; + this.addDeco(decoPumpkin); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 10f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesa.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesa.java new file mode 100644 index 00000000..32144c48 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesa.java @@ -0,0 +1,86 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoCactus; +import rtg.world.biome.deco.DecoDeadBush; +import rtg.world.biome.deco.DecoShrub; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.surface.SurfaceRiverOasis; +import rtg.world.gen.surface.vanilla.SurfaceVanillaMesa; +import rtg.world.gen.terrain.vanilla.TerrainVanillaMesa; + +import java.util.Random; + +public class RealisticBiomeVanillaMesa extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MESA; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaMesa(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaMesa(), + new SurfaceVanillaMesa( + config, + BlockUtil.getStateSand(1), + BlockUtil.getStateClay(1), + 0 + ) + ); + + this.waterSurfaceLakeChance = 20; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.maxY = 83; + this.addDeco(decoBoulder); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.loops = 3; + decoShrub.maxY = 90; + addDeco(decoShrub); + + DecoDeadBush decoDeadBush = new DecoDeadBush(); + decoDeadBush.maxY = 100; + decoDeadBush.loops = 3; + this.addDeco(decoDeadBush); + + DecoCactus decoCactus = new DecoCactus(); + decoCactus.soilBlock = BlockUtil.getStateSand(1); + decoCactus.loops = 18; + decoCactus.maxY = 100; + this.addDeco(decoCactus); + } + + @Override + public void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + this.getSurface().paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + + SurfaceBase riverSurface = new SurfaceRiverOasis(this.config); + riverSurface.paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + } + + @Override + public int getExtraGoldGenCount() { + return 20; + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaBryce.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaBryce.java new file mode 100644 index 00000000..11d2ac56 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaBryce.java @@ -0,0 +1,82 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.DecoBoulder; +import rtg.world.biome.deco.DecoCactus; +import rtg.world.biome.deco.DecoDeadBush; +import rtg.world.biome.deco.DecoShrub; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.surface.SurfaceRiverOasis; +import rtg.world.gen.surface.vanilla.SurfaceVanillaMesaBryce; +import rtg.world.gen.terrain.vanilla.TerrainVanillaMesaBryce; + +import java.util.Random; + +public class RealisticBiomeVanillaMesaBryce extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_MESA; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaMesaBryce(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaMesaBryce(false, 55f, 120f, 60f, 40f, 69f), + new SurfaceVanillaMesaBryce(config, BlockUtil.getStateSand(1), BlockUtil.getStateSand(1), 0) + ); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.maxY = 83; + this.addDeco(decoBoulder); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.loops = 3; + decoShrub.maxY = 90; + addDeco(decoShrub); + + DecoDeadBush decoDeadBush = new DecoDeadBush(); + decoDeadBush.maxY = 100; + decoDeadBush.loops = 3; + this.addDeco(decoDeadBush); + + DecoCactus decoCactus = new DecoCactus(); + decoCactus.soilBlock = BlockUtil.getStateSand(1); + decoCactus.loops = 18; + decoCactus.maxY = 100; + this.addDeco(decoCactus); + } + + @Override + public void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + this.getSurface().paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + + SurfaceBase riverSurface = new SurfaceRiverOasis(this.config); + riverSurface.paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + } + + @Override + public int getExtraGoldGenCount() { + return 20; + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateau.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateau.java new file mode 100644 index 00000000..53a17f02 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateau.java @@ -0,0 +1,89 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenTrees; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.surface.SurfaceRiverOasis; +import rtg.world.gen.surface.vanilla.SurfaceVanillaMesaPlateau; +import rtg.world.gen.terrain.vanilla.TerrainVanillaMesaPlateau; + +import java.util.Random; + +public class RealisticBiomeVanillaMesaPlateau extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MESA_CLEAR_ROCK; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaMesaPlateau(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaMesaPlateau(true, 35f, 160f, 60f, 40f, 69f), + new SurfaceVanillaMesaPlateau(config, BlockUtil.getStateSand(1), BlockUtil.getStateClay(1), 0) + ); + + this.noLakes = true; + this.waterSurfaceLakeChance = 30; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.chance = 10; + addDeco(decoShrub); + + DecoCactus decoCactus = new DecoCactus(); + decoCactus.strengthFactor = 25f; + decoCactus.soilBlock = BlockUtil.getStateSand(1); + decoCactus.sandOnly = false; + decoCactus.maxRiver = 0.8f; + addDeco(decoCactus); + + DecoReed decoReed = new DecoReed(); + decoReed.loops = 5; + decoReed.maxRiver = 0.8f; + addDeco(decoReed); + + DecoDeadBush decoDeadBush = new DecoDeadBush(); + decoDeadBush.strengthFactor = 5f; + addDeco(decoDeadBush); + + DecoTree decoTree = new DecoTree(new WorldGenTrees(false)); + decoTree.loops = 20; + decoTree.treeType = DecoTree.TreeType.WORLDGEN; + decoTree.treeCondition = DecoTree.TreeCondition.X_DIVIDED_BY_STRENGTH; + decoTree.distribution = new DecoTree.Distribution(24f, 1f, 0f); + decoTree.treeConditionChance = 0; + decoTree.treeConditionFloat = 4f; + decoTree.treeConditionNoise = 0f; + decoTree.minY = 74; + addDeco(decoTree); + } + + @Override + public void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + this.getSurface().paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + + SurfaceBase riverSurface = new SurfaceRiverOasis(this.config); + riverSurface.paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + } + + @Override + public int getExtraGoldGenCount() { + return 20; + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauF.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauF.java new file mode 100644 index 00000000..85ea9349 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauF.java @@ -0,0 +1,94 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenTrees; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.surface.SurfaceRiverOasis; +import rtg.world.gen.surface.vanilla.SurfaceVanillaMesaPlateauF; +import rtg.world.gen.terrain.vanilla.TerrainVanillaMesaPlateauF; + +import java.util.Random; + +public class RealisticBiomeVanillaMesaPlateauF extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MESA_ROCK; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaMesaPlateauF(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaMesaPlateauF(true, 35f, 160f, 60f, 40f, 69f), + new SurfaceVanillaMesaPlateauF( + config, + BlockUtil.getStateSand(1), + BlockUtil.getStateClay(1), + 0 + ) + ); + + this.noLakes = true; + this.waterSurfaceLakeChance = 30; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.chance = 10; + addDeco(decoShrub); + + DecoCactus decoCactus = new DecoCactus(); + decoCactus.strengthFactor = 25f; + decoCactus.soilBlock = BlockUtil.getStateSand(1); + decoCactus.sandOnly = false; + decoCactus.maxRiver = 0.8f; + addDeco(decoCactus); + + DecoReed decoReed = new DecoReed(); + decoReed.loops = 5; + decoReed.maxRiver = 0.8f; + addDeco(decoReed); + + DecoDeadBush decoDeadBush = new DecoDeadBush(); + decoDeadBush.strengthFactor = 5f; + addDeco(decoDeadBush); + + DecoTree decoTree = new DecoTree(new WorldGenTrees(false)); + decoTree.loops = 24; + decoTree.treeType = DecoTree.TreeType.WORLDGEN; + decoTree.treeCondition = DecoTree.TreeCondition.X_DIVIDED_BY_STRENGTH; + decoTree.distribution = new DecoTree.Distribution(24f, 1f, 0f); + decoTree.treeConditionChance = 0; + decoTree.treeConditionFloat = 4f; + decoTree.treeConditionNoise = 0f; + decoTree.minY = 74; + addDeco(decoTree); + } + + @Override + public void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + this.getSurface().paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + + SurfaceBase riverSurface = new SurfaceRiverOasis(this.config); + riverSurface.paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + } + + @Override + public int getExtraGoldGenCount() { + return 20; + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauFM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauFM.java new file mode 100644 index 00000000..6c374112 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauFM.java @@ -0,0 +1,94 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.feature.WorldGenTrees; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.surface.SurfaceRiverOasis; +import rtg.world.gen.surface.vanilla.SurfaceVanillaMesaPlateauFM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaMesaPlateauFM; + +import java.util.Random; + +public class RealisticBiomeVanillaMesaPlateauFM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_MESA_ROCK; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaMesaPlateauFM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaMesaPlateauFM(false, 35f, 160f, 60f, 40f, 69f), + new SurfaceVanillaMesaPlateauFM( + config, + BlockUtil.getStateSand(1), + BlockUtil.getStateClay(1), + 0 + ) + ); + + this.noLakes = true; + this.waterSurfaceLakeChance = 30; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.chance = 10; + addDeco(decoShrub); + + DecoCactus decoCactus = new DecoCactus(); + decoCactus.strengthFactor = 25f; + decoCactus.soilBlock = BlockUtil.getStateSand(1); + decoCactus.sandOnly = false; + decoCactus.maxRiver = 0.8f; + addDeco(decoCactus); + + DecoReed decoReed = new DecoReed(); + decoReed.loops = 5; + decoReed.maxRiver = 0.8f; + addDeco(decoReed); + + DecoDeadBush decoDeadBush = new DecoDeadBush(); + decoDeadBush.strengthFactor = 5f; + addDeco(decoDeadBush); + + DecoTree decoTree = new DecoTree(new WorldGenTrees(false)); + decoTree.loops = 16; + decoTree.treeType = DecoTree.TreeType.WORLDGEN; + decoTree.treeCondition = DecoTree.TreeCondition.X_DIVIDED_BY_STRENGTH; + decoTree.distribution = new DecoTree.Distribution(24f, 1f, 0f); + decoTree.treeConditionChance = 0; + decoTree.treeConditionFloat = 4f; + decoTree.treeConditionNoise = 0f; + decoTree.minY = 74; + addDeco(decoTree); + } + + @Override + public void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + this.getSurface().paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + + SurfaceBase riverSurface = new SurfaceRiverOasis(this.config); + riverSurface.paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + } + + @Override + public int getExtraGoldGenCount() { + return 20; + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauM.java new file mode 100644 index 00000000..7207db80 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMesaPlateauM.java @@ -0,0 +1,80 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.biome.deco.DecoCactus; +import rtg.world.biome.deco.DecoDeadBush; +import rtg.world.biome.deco.DecoReed; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.surface.SurfaceRiverOasis; +import rtg.world.gen.surface.vanilla.SurfaceVanillaMesaPlateauM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaMesaPlateauM; + +import java.util.Random; + +public class RealisticBiomeVanillaMesaPlateauM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_MESA_CLEAR_ROCK; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaMesaPlateauM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaMesaPlateauM(true, 15f, 260f, 50f, 30f, 79f), + new SurfaceVanillaMesaPlateauM( + config, + BlockUtil.getStateSand(1), + BlockUtil.getStateClay(1), + 0 + ) + ); + + this.noLakes = true; + this.waterSurfaceLakeChance = 30; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + + DecoCactus decoCactus = new DecoCactus(); + decoCactus.strengthFactor = 25f; + decoCactus.soilBlock = BlockUtil.getStateClay(1); + decoCactus.sandOnly = false; + decoCactus.maxRiver = 0.8f; + addDeco(decoCactus); + + DecoReed decoReed = new DecoReed(); + decoReed.loops = 5; + decoReed.maxRiver = 0.8f; + addDeco(decoReed); + + DecoDeadBush decoDeadBush = new DecoDeadBush(); + decoDeadBush.strengthFactor = 5f; + addDeco(decoDeadBush); + } + + @Override + public void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + this.getSurface().paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + + SurfaceBase riverSurface = new SurfaceRiverOasis(this.config); + riverSurface.paintTerrain(primer, i, j, x, y, depth, world, rand, simplex, cell, noise, river, base); + } + + @Override + public int getExtraGoldGenCount() { + return 20; + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIsland.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIsland.java new file mode 100644 index 00000000..fa28394e --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIsland.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaMushroomIsland; +import rtg.world.gen.terrain.vanilla.TerrainVanillaMushroomIsland; + +public class RealisticBiomeVanillaMushroomIsland extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUSHROOM_ISLAND; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaMushroomIsland(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaMushroomIsland(), + new SurfaceVanillaMushroomIsland(config, biome.topBlock, biome.fillerBlock, 0f) + ); + + this.noLakes = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIslandShore.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIslandShore.java new file mode 100644 index 00000000..24bcc4b9 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaMushroomIslandShore.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaMushroomIslandShore; +import rtg.world.gen.terrain.vanilla.TerrainVanillaMushroomIslandShore; + +public class RealisticBiomeVanillaMushroomIslandShore extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUSHROOM_ISLAND_SHORE; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaMushroomIslandShore(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaMushroomIslandShore(), + new SurfaceVanillaMushroomIslandShore(config, biome.topBlock, biome.fillerBlock, 0f) + ); + + this.noLakes = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaOcean.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaOcean.java new file mode 100644 index 00000000..9a447ecd --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaOcean.java @@ -0,0 +1,32 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaOcean; +import rtg.world.gen.terrain.vanilla.TerrainVanillaOcean; + +public class RealisticBiomeVanillaOcean extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.OCEAN; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaOcean(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaOcean(), + new SurfaceVanillaOcean(config, Blocks.SAND.getDefaultState(), Blocks.SAND.getDefaultState(), Blocks.GRAVEL.getDefaultState(), 20f, 0.2f) + ); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + this.noLakes = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaPlains.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaPlains.java new file mode 100644 index 00000000..e638bc7f --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaPlains.java @@ -0,0 +1,93 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.DecoFlowersRTG; +import rtg.world.biome.deco.DecoGrass; +import rtg.world.biome.deco.DecoShrub; +import rtg.world.biome.deco.DecoTree; +import rtg.world.biome.deco.helper.DecoHelperThisOrThat; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGQuercusRobur; +import rtg.world.gen.surface.vanilla.SurfaceVanillaPlains; +import rtg.world.gen.terrain.vanilla.TerrainVanillaPlains; + +public class RealisticBiomeVanillaPlains extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.PLAINS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaPlains(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaPlains(), + new SurfaceVanillaPlains(config, biome.topBlock, biome.fillerBlock) + ); + + // Very sparse shrubs. + DecoShrub decoShrubOak = new DecoShrub(); + decoShrubOak.logBlock = Blocks.LOG.getDefaultState(); + decoShrubOak.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoShrubOak.maxY = 110; + decoShrubOak.loops = 1; + decoShrubOak.chance = 36; + this.addDeco(decoShrubOak); + + // The occasional flower. + DecoFlowersRTG decoFlowersRTG = new DecoFlowersRTG(); + decoFlowersRTG.flowers = new int[]{0, 2, 3, 4, 5, 6, 7, 8, 9}; + decoFlowersRTG.maxY = 128; + decoFlowersRTG.strengthFactor = 2f; + this.addDeco(decoFlowersRTG); + + // Lots of grass, but not as much as vanilla. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.minY = 60; + decoGrass.maxY = 128; + decoGrass.loops = 6; + this.addDeco(decoGrass); + + // Very rare fat oak/birch trees. + + TreeRTG roburTree1 = new TreeRTGQuercusRobur(); + roburTree1.logBlock = Blocks.LOG.getDefaultState(); + roburTree1.leavesBlock = Blocks.LEAVES.getDefaultState(); + roburTree1.minTrunkSize = 3; + roburTree1.maxTrunkSize = 5; + roburTree1.minCrownSize = 7; + roburTree1.maxCrownSize = 9; + this.addTree(roburTree1); + + DecoTree oakTrees = new DecoTree(roburTree1); + oakTrees.treeType = DecoTree.TreeType.RTG_TREE; + oakTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + oakTrees.distribution = new DecoTree.Distribution(100f, 6f, 0.8f); + oakTrees.treeConditionNoise = 0.4f; + oakTrees.treeConditionChance = 48; + + TreeRTG roburTree2 = new TreeRTGQuercusRobur(); + roburTree2.logBlock = BlockUtil.getStateLog(2); + roburTree2.leavesBlock = BlockUtil.getStateLeaf(2); + roburTree2.minTrunkSize = 3; + roburTree2.maxTrunkSize = 5; + roburTree2.minCrownSize = 7; + roburTree2.maxCrownSize = 9; + this.addTree(roburTree2); + + DecoTree birchTrees = new DecoTree(roburTree2); + birchTrees.treeType = DecoTree.TreeType.RTG_TREE; + birchTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + birchTrees.distribution = new DecoTree.Distribution(100f, 6f, 0.8f); + birchTrees.treeConditionNoise = 0.4f; + birchTrees.treeConditionChance = 48; + + this.addDeco(new DecoHelperThisOrThat(4, DecoHelperThisOrThat.ChanceType.NOT_EQUALS_ZERO, oakTrees, birchTrees)); + + // Vanilla trees look awful in this biome, so let's make sure they don't generate. + //DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + //this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRedwoodTaigaHills.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRedwoodTaigaHills.java new file mode 100644 index 00000000..f1abe1fc --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRedwoodTaigaHills.java @@ -0,0 +1,77 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaRedwoodTaigaHills; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.collection.DecoCollectionMegaTaiga; +import rtg.world.gen.surface.vanilla.SurfaceVanillaRedwoodTaigaHills; +import rtg.world.gen.terrain.vanilla.TerrainVanillaRedwoodTaigaHills; + +public class RealisticBiomeVanillaRedwoodTaigaHills extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_REDWOOD_TAIGA_HILLS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaRedwoodTaigaHills(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaRedwoodTaigaHills(), + new SurfaceVanillaRedwoodTaigaHills(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0.2f) + ); + + this.noLakes = true; + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 95; + decoBoulder.strengthFactor = 3f; + this.addDeco(decoBoulder); + + this.addDecoCollection(new DecoCollectionMegaTaiga()); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BlockUtil.getStateLog(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf(1); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaRedwoodTaigaHills.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 100; + decoShrub.strengthFactor = 2f; + decoShrub.chance = 10; + this.addDeco(decoShrub); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.equalsZeroChance = 3; + this.addDeco(decoBaseBiomeDecorations); + + DecoMushrooms decoMushrooms = new DecoMushrooms(); + decoMushrooms.maxY = 90; + decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.X_DIVIDED_BY_STRENGTH; + decoMushrooms.randomFloat = 3f; + this.addDeco(decoMushrooms); + + DecoPumpkin decoPumpkin = new DecoPumpkin(); + decoPumpkin.maxY = 90; + decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; + decoPumpkin.randomFloat = 20f; + this.addDeco(decoPumpkin); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 10f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRiver.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRiver.java new file mode 100644 index 00000000..49bf54d2 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRiver.java @@ -0,0 +1,29 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaRiver; +import rtg.world.gen.terrain.vanilla.TerrainVanillaRiver; + +public class RealisticBiomeVanillaRiver extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.RIVER; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaRiver(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaRiver(), + new SurfaceVanillaRiver(config) + ); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForest.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForest.java new file mode 100644 index 00000000..0ee197af --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForest.java @@ -0,0 +1,154 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaRoofedForest; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.helper.DecoHelperThisOrThat; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGCeibaPentandra; +import rtg.world.gen.feature.tree.rtg.TreeRTGCeibaRosea; +import rtg.world.gen.feature.tree.rtg.TreeRTGRhizophoraMucronata; +import rtg.world.gen.surface.vanilla.SurfaceVanillaRoofedForest; +import rtg.world.gen.terrain.vanilla.TerrainVanillaRoofedForest; + +public class RealisticBiomeVanillaRoofedForest extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.ROOFED_FOREST; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaRoofedForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaRoofedForest(), + new SurfaceVanillaRoofedForest(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(2), 0.08f) + ); + + this.waterSurfaceLakeChance = 3; + + DecoMushrooms decoMushrooms = new DecoMushrooms(); + decoMushrooms.chance = 4; + decoMushrooms.maxY = 90; + decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.ALWAYS_GENERATE; + this.addDeco(decoMushrooms); + + TreeRTG mucronataTree = new TreeRTGRhizophoraMucronata(3, 4, 13f, 0.32f, 0.1f); + mucronataTree.logBlock = BlockUtil.getStateLog2(1); + mucronataTree.leavesBlock = BlockUtil.getStateLeaf2(1); + mucronataTree.minTrunkSize = 2; + mucronataTree.maxTrunkSize = 3; + mucronataTree.minCrownSize = 10; + mucronataTree.maxCrownSize = 18; + mucronataTree.noLeaves = false; + this.addTree(mucronataTree); + + DecoTree mangroveTree = new DecoTree(mucronataTree); + mangroveTree.treeType = DecoTree.TreeType.RTG_TREE; + mangroveTree.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + mangroveTree.treeConditionChance = 1; + mangroveTree.strengthFactorForLoops = 12f; + mangroveTree.maxY = 110; + mangroveTree.scatter = new DecoTree.Scatter(16, 0); + this.addDeco(mangroveTree); + + TreeRTG pentandraTree = new TreeRTGCeibaPentandra(13f, 3, 0.32f, 0.1f); + pentandraTree.logBlock = BlockUtil.getStateLog2(1); + pentandraTree.leavesBlock = BlockUtil.getStateLeaf2(1); + pentandraTree.minTrunkSize = 2; + pentandraTree.maxTrunkSize = 3; + pentandraTree.minCrownSize = 10; + pentandraTree.maxCrownSize = 18; + pentandraTree.noLeaves = false; + this.addTree(pentandraTree); + + DecoTree ceibaPentandraTree = new DecoTree(pentandraTree); + ceibaPentandraTree.treeType = DecoTree.TreeType.RTG_TREE; + ceibaPentandraTree.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + ceibaPentandraTree.treeConditionChance = 1; + ceibaPentandraTree.strengthFactorForLoops = 12f; + ceibaPentandraTree.maxY = 110; + ceibaPentandraTree.scatter = new DecoTree.Scatter(16, 0); + this.addDeco(ceibaPentandraTree); + + TreeRTG roseaTree = new TreeRTGCeibaRosea(16f, 5, 0.32f, 0.1f); + roseaTree.logBlock = BlockUtil.getStateLog2(1); + roseaTree.leavesBlock = BlockUtil.getStateLeaf2(1); + roseaTree.minTrunkSize = 2; + roseaTree.maxTrunkSize = 3; + roseaTree.minCrownSize = 10; + roseaTree.maxCrownSize = 18; + roseaTree.noLeaves = false; + this.addTree(roseaTree); + + DecoTree ceibaRoseaTree = new DecoTree(roseaTree); + ceibaRoseaTree.treeType = DecoTree.TreeType.RTG_TREE; + ceibaRoseaTree.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + ceibaRoseaTree.treeConditionChance = 1; + ceibaRoseaTree.strengthFactorForLoops = 12f; + ceibaRoseaTree.maxY = 110; + ceibaRoseaTree.scatter = new DecoTree.Scatter(16, 0); + this.addDeco(ceibaRoseaTree); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionChance = 16; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logBlock = BlockUtil.getStateLog2(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf2(1); + decoFallenTree.minSize = 4; + decoFallenTree.maxSize = 9; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaRoofedForest.decorationLogsId)); + + DecoShrub darkOakShrub = new DecoShrub(); + darkOakShrub.logBlock = BlockUtil.getStateLog2(1); + darkOakShrub.leavesBlock = BlockUtil.getStateLeaf2(1); + darkOakShrub.maxY = 100; + darkOakShrub.strengthFactor = 8f; + + DecoShrub oakShrub = new DecoShrub(); + oakShrub.logBlock = Blocks.LOG.getDefaultState(); + oakShrub.leavesBlock = Blocks.LEAVES.getDefaultState(); + oakShrub.maxY = 100; + oakShrub.strengthFactor = 8f; + + this.addDeco(new DecoHelperThisOrThat(4, DecoHelperThisOrThat.ChanceType.NOT_EQUALS_ZERO, darkOakShrub, oakShrub)); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 16; + decoBoulder.maxY = 80; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + DecoCobwebs decoCobwebs = new DecoCobwebs(); + decoCobwebs.chance = 1; + decoCobwebs.minY = 63; + decoCobwebs.maxY = 76; + decoCobwebs.strengthFactor = 24f; + decoCobwebs.adjacentBlock = BlockUtil.getStateLog2(1); + decoCobwebs.minAdjacents = 2; + this.addDeco(decoCobwebs, this.config._boolean(BiomeConfigVanillaRoofedForest.decorationCobwebsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + decoBaseBiomeDecorations.notEqualsZeroChance = 2; + decoBaseBiomeDecorations.maxY = 100; + this.addDeco(decoBaseBiomeDecorations); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 100; + decoGrass.strengthFactor = 20f; + this.addDeco(decoGrass); + + DecoDeadBush decoDeadBush = new DecoDeadBush(); + decoDeadBush.maxY = 100; + decoDeadBush.chance = 2; + decoDeadBush.strengthFactor = 2f; + this.addDeco(decoDeadBush); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForestM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForestM.java new file mode 100644 index 00000000..75afdf23 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaRoofedForestM.java @@ -0,0 +1,104 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaRoofedForestM; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGRhizophoraMucronata; +import rtg.world.gen.surface.vanilla.SurfaceVanillaRoofedForestM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaRoofedForestM; + +public class RealisticBiomeVanillaRoofedForestM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_ROOFED_FOREST; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaRoofedForestM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaRoofedForestM(), + new SurfaceVanillaRoofedForestM(config, biome.topBlock, biome.fillerBlock) + ); + + this.noLakes = true; + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.MOSSY_COBBLESTONE.getDefaultState(); + decoBoulder.chance = 20; + decoBoulder.maxY = 80; + decoBoulder.strengthFactor = 2f; + this.addDeco(decoBoulder); + + TreeRTG mucronataTree = new TreeRTGRhizophoraMucronata(3, 4, 13f, 0.32f, 0.1f); + mucronataTree.logBlock = BlockUtil.getStateLog2(1); + mucronataTree.leavesBlock = BlockUtil.getStateLeaf2(1); + mucronataTree.minTrunkSize = 3; + mucronataTree.maxTrunkSize = 4; + mucronataTree.minCrownSize = 7; + mucronataTree.maxCrownSize = 12; + this.addTree(mucronataTree); + + DecoTree decoTrees = new DecoTree(mucronataTree); + decoTrees.strengthFactorForLoops = 24f; + decoTrees.distribution.noiseDivisor = 80f; + decoTrees.distribution.noiseFactor = 60f; + decoTrees.distribution.noiseAddend = -15f; + decoTrees.treeType = DecoTree.TreeType.RTG_TREE; + decoTrees.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoTrees.treeConditionNoise = 0f; + decoTrees.treeConditionChance = 1; + decoTrees.maxY = 120; + this.addDeco(decoTrees); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.logCondition = DecoFallenTree.LogCondition.ALWAYS_GENERATE; + decoFallenTree.logConditionChance = 1; + decoFallenTree.loops = 4; + decoFallenTree.logBlock = BlockUtil.getStateLog2(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf2(1); + decoFallenTree.minSize = 4; + decoFallenTree.maxSize = 9; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaRoofedForestM.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 110; + decoShrub.strengthFactor = 1f; + this.addDeco(decoShrub); + + DecoGrassDoubleTallgrass decoGrassDoubleTallgrass = new DecoGrassDoubleTallgrass(); + decoGrassDoubleTallgrass.maxY = 128; + decoGrassDoubleTallgrass.strengthFactor = 8f; + decoGrassDoubleTallgrass.doubleGrassChance = 6; + this.addDeco(decoGrassDoubleTallgrass); + + DecoDeadBush decoDeadBush = new DecoDeadBush(); + decoDeadBush.maxY = 128; + decoDeadBush.chance = 16; + decoDeadBush.strengthFactor = 1f; + this.addDeco(decoDeadBush); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 4f; + decoGrass.chance = 2; + this.addDeco(decoGrass); + + DecoGrass decoFern = new DecoGrass(2); + decoFern.maxY = 128; + decoFern.strengthFactor = 4f; + decoFern.chance = 2; + this.addDeco(decoFern); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoMushrooms decoMushrooms = new DecoMushrooms(); + decoMushrooms.maxY = 90; + decoMushrooms.randomType = rtg.world.biome.deco.DecoMushrooms.RandomType.ALWAYS_GENERATE; + this.addDeco(decoMushrooms); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavanna.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavanna.java new file mode 100644 index 00000000..6590910a --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavanna.java @@ -0,0 +1,34 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaSavanna; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.biome.deco.collection.DecoCollectionSavanna; +import rtg.world.gen.surface.vanilla.SurfaceVanillaSavanna; +import rtg.world.gen.terrain.vanilla.TerrainVanillaSavanna; + +public class RealisticBiomeVanillaSavanna extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.SAVANNA; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaSavanna(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaSavanna(), + new SurfaceVanillaSavanna(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), Blocks.GRASS.getDefaultState(), 13f, 0.27f) + ); + + this.addDecoCollection(new DecoCollectionDesertRiver()); + this.addDecoCollection(new DecoCollectionSavanna(this.config._boolean(BiomeConfigVanillaSavanna.decorationLogsId))); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaM.java new file mode 100644 index 00000000..d7e061b4 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaM.java @@ -0,0 +1,36 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaSavannaM; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.biome.deco.collection.DecoCollectionSavanna; +import rtg.world.gen.surface.vanilla.SurfaceVanillaSavannaM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaSavannaM; + +public class RealisticBiomeVanillaSavannaM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_SAVANNA; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaSavannaM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaSavannaM(), + new SurfaceVanillaSavannaM(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0f, 1.5f, 60f, 65f, 1.5f, BlockUtil.getStateDirt(1)) + ); + + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + this.addDecoCollection(new DecoCollectionSavanna(this.config._boolean(BiomeConfigVanillaSavannaM.decorationLogsId))); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateau.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateau.java new file mode 100644 index 00000000..b348008c --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateau.java @@ -0,0 +1,87 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGAcaciaBucheri; +import rtg.world.gen.surface.vanilla.SurfaceVanillaSavannaPlateau; +import rtg.world.gen.terrain.vanilla.TerrainVanillaSavannaPlateau; + +public class RealisticBiomeVanillaSavannaPlateau extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.SAVANNA_PLATEAU; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaSavannaPlateau(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaSavannaPlateau(true, 35f, 160f, 60f, 40f, 69f), + new SurfaceVanillaSavannaPlateau(config, biome.topBlock, biome.fillerBlock, 0) + ); + + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + + DecoBoulder decoBoulder1 = new DecoBoulder(); + decoBoulder1.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder1.maxY = 80; + decoBoulder1.chance = 24; + this.addDeco(decoBoulder1); + + DecoBoulder decoBoulder2 = new DecoBoulder(); + decoBoulder2.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder1.minY = 110; + decoBoulder2.chance = 24; + this.addDeco(decoBoulder2); + + DecoShrub acaciaShrub = new DecoShrub(); + acaciaShrub.logBlock = Blocks.LOG2.getDefaultState(); + acaciaShrub.leavesBlock = Blocks.LEAVES2.getDefaultState(); + acaciaShrub.maxY = 160; + acaciaShrub.strengthFactor = 3f; + acaciaShrub.chance = 9; + this.addDeco(acaciaShrub); + + TreeRTG acaciaTree = new TreeRTGAcaciaBucheri(); + acaciaTree.logBlock = Blocks.LOG2.getDefaultState(); + acaciaTree.leavesBlock = Blocks.LEAVES2.getDefaultState(); + acaciaTree.minTrunkSize = 12; + acaciaTree.maxTrunkSize = 16; + this.addTree(acaciaTree); + + DecoTree acaciaTrees = new DecoTree(acaciaTree); + acaciaTrees.strengthFactorForLoops = 2f; + acaciaTrees.treeType = DecoTree.TreeType.RTG_TREE; + acaciaTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + acaciaTrees.treeConditionChance = 12; + acaciaTrees.maxY = 160; + this.addDeco(acaciaTrees); + + DecoCactus decoCactus = new DecoCactus(); + decoCactus.maxY = 160; + decoCactus.loops = 60; + decoCactus.chance = 8; + this.addDeco(decoCactus); + + DecoDoubleGrass decoDoubleGrass = new DecoDoubleGrass(); + decoDoubleGrass.maxY = 128; + decoDoubleGrass.strengthFactor = 3f; + this.addDeco(decoDoubleGrass); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 10f; + this.addDeco(decoGrass); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateauM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateauM.java new file mode 100644 index 00000000..3984647c --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSavannaPlateauM.java @@ -0,0 +1,87 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.collection.DecoCollectionDesertRiver; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGAcaciaBucheri; +import rtg.world.gen.surface.vanilla.SurfaceVanillaSavannaPlateauM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaSavannaPlateauM; + +public class RealisticBiomeVanillaSavannaPlateauM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_SAVANNA_ROCK; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaSavannaPlateauM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaSavannaPlateauM(true, 35f, 160f, 60f, 40f, 69f), + new SurfaceVanillaSavannaPlateauM(config, biome.topBlock, biome.fillerBlock, 0) + ); + + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionDesertRiver()); + + DecoBoulder decoBoulder1 = new DecoBoulder(); + decoBoulder1.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder1.maxY = 80; + decoBoulder1.chance = 24; + this.addDeco(decoBoulder1); + + DecoBoulder decoBoulder2 = new DecoBoulder(); + decoBoulder2.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder1.minY = 110; + decoBoulder2.chance = 24; + this.addDeco(decoBoulder2); + + DecoShrub acaciaShrub = new DecoShrub(); + acaciaShrub.logBlock = Blocks.LOG2.getDefaultState(); + acaciaShrub.leavesBlock = Blocks.LEAVES2.getDefaultState(); + acaciaShrub.maxY = 160; + acaciaShrub.strengthFactor = 3f; + acaciaShrub.chance = 9; + this.addDeco(acaciaShrub); + + TreeRTG acaciaTree = new TreeRTGAcaciaBucheri(); + acaciaTree.logBlock = Blocks.LOG2.getDefaultState(); + acaciaTree.leavesBlock = Blocks.LEAVES2.getDefaultState(); + acaciaTree.minTrunkSize = 12; + acaciaTree.maxTrunkSize = 16; + this.addTree(acaciaTree); + + DecoTree acaciaTrees = new DecoTree(acaciaTree); + acaciaTrees.strengthFactorForLoops = 2f; + acaciaTrees.treeType = DecoTree.TreeType.RTG_TREE; + acaciaTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + acaciaTrees.treeConditionChance = 12; + acaciaTrees.maxY = 160; + this.addDeco(acaciaTrees); + + DecoCactus decoCactus = new DecoCactus(); + decoCactus.maxY = 160; + decoCactus.loops = 60; + decoCactus.chance = 8; + this.addDeco(decoCactus); + + DecoDoubleGrass decoDoubleGrass = new DecoDoubleGrass(); + decoDoubleGrass.maxY = 128; + decoDoubleGrass.strengthFactor = 3f; + this.addDeco(decoDoubleGrass); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 10f; + this.addDeco(decoGrass); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaStoneBeach.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaStoneBeach.java new file mode 100644 index 00000000..5be99621 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaStoneBeach.java @@ -0,0 +1,27 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaStoneBeach; +import rtg.world.gen.terrain.vanilla.TerrainVanillaStoneBeach; + +public class RealisticBiomeVanillaStoneBeach extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.STONE_BEACH; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaStoneBeach(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaStoneBeach(), + new SurfaceVanillaStoneBeach(config, Blocks.GRAVEL.getDefaultState(), biome.fillerBlock, 1f, 1.5f, 85f, 20f, 4f) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSunflowerPlains.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSunflowerPlains.java new file mode 100644 index 00000000..5048823d --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSunflowerPlains.java @@ -0,0 +1,26 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; +import rtg.world.gen.surface.vanilla.SurfaceVanillaSunflowerPlains; +import rtg.world.gen.terrain.vanilla.TerrainVanillaSunflowerPlains; + +public class RealisticBiomeVanillaSunflowerPlains extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_PLAINS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaSunflowerPlains(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaSunflowerPlains(), + new SurfaceVanillaSunflowerPlains(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwampland.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwampland.java new file mode 100644 index 00000000..cda5f4a9 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwampland.java @@ -0,0 +1,94 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaSwampland; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; +import rtg.world.gen.feature.tree.rtg.TreeRTGSalixMyrtilloides; +import rtg.world.gen.surface.vanilla.SurfaceVanillaSwampland; +import rtg.world.gen.terrain.vanilla.TerrainVanillaSwampland; + +public class RealisticBiomeVanillaSwampland extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.SWAMPLAND; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaSwampland(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaSwampland(), + new SurfaceVanillaSwampland(config, biome.topBlock, biome.fillerBlock) + ); + + TreeRTG myrtilloidesTree = new TreeRTGSalixMyrtilloides(); + myrtilloidesTree.logBlock = Blocks.LOG.getDefaultState(); + myrtilloidesTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.addTree(myrtilloidesTree); + + DecoTree decoTrees = new DecoTree(myrtilloidesTree); + decoTrees.strengthNoiseFactorXForLoops = true; + decoTrees.strengthFactorForLoops = 1f; + decoTrees.distribution.noiseDivisor = 80f; + decoTrees.distribution.noiseFactor = 60f; + decoTrees.distribution.noiseAddend = -15f; + decoTrees.treeType = DecoTree.TreeType.RTG_TREE; + decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + decoTrees.treeConditionChance = 12; + decoTrees.maxY = 70; + this.addDeco(decoTrees); + + TreeRTG ponderosaTree = new TreeRTGPinusPonderosa(); + ponderosaTree.logBlock = Blocks.LOG.getDefaultState(); + ponderosaTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + ponderosaTree.minTrunkSize = 3; + ponderosaTree.maxTrunkSize = 6; + ponderosaTree.minCrownSize = 6; + ponderosaTree.maxCrownSize = 14; + ponderosaTree.noLeaves = true; + this.addTree(ponderosaTree); + + DecoTree deadPineTree = new DecoTree(ponderosaTree); + deadPineTree.treeType = DecoTree.TreeType.RTG_TREE; + deadPineTree.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + deadPineTree.treeConditionChance = 18; + deadPineTree.maxY = 100; + this.addDeco(deadPineTree); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 100; + decoShrub.strengthFactor = 3f; + this.addDeco(decoShrub); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BlockUtil.getStateLog2(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf2(1); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaSwampland.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoPumpkin decoPumpkin = new DecoPumpkin(); + decoPumpkin.maxY = 90; + decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; + decoPumpkin.randomFloat = 50f; + this.addDeco(decoPumpkin); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 12f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwamplandM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwamplandM.java new file mode 100644 index 00000000..39587867 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaSwamplandM.java @@ -0,0 +1,94 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaSwamplandM; +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; +import rtg.world.gen.feature.tree.rtg.TreeRTGSalixMyrtilloides; +import rtg.world.gen.surface.vanilla.SurfaceVanillaSwamplandM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaSwamplandM; + +public class RealisticBiomeVanillaSwamplandM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_SWAMPLAND; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaSwamplandM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaSwamplandM(50f, 25f, 60f), + new SurfaceVanillaSwamplandM(config, biome.topBlock, biome.fillerBlock) + ); + + TreeRTG myrtilloidesTree = new TreeRTGSalixMyrtilloides(); + myrtilloidesTree.logBlock = Blocks.LOG.getDefaultState(); + myrtilloidesTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.addTree(myrtilloidesTree); + + DecoTree decoTrees = new DecoTree(myrtilloidesTree); + decoTrees.strengthNoiseFactorXForLoops = true; + decoTrees.strengthFactorForLoops = 1f; + decoTrees.distribution.noiseDivisor = 80f; + decoTrees.distribution.noiseFactor = 60f; + decoTrees.distribution.noiseAddend = -15f; + decoTrees.treeType = DecoTree.TreeType.RTG_TREE; + decoTrees.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + decoTrees.treeConditionChance = 12; + decoTrees.maxY = 100; + this.addDeco(decoTrees); + + TreeRTG ponderosaTree = new TreeRTGPinusPonderosa(); + ponderosaTree.logBlock = Blocks.LOG.getDefaultState(); + ponderosaTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + ponderosaTree.minTrunkSize = 3; + ponderosaTree.maxTrunkSize = 6; + ponderosaTree.minCrownSize = 6; + ponderosaTree.maxCrownSize = 14; + ponderosaTree.noLeaves = true; + this.addTree(ponderosaTree); + + DecoTree deadPineTree = new DecoTree(ponderosaTree); + deadPineTree.treeType = DecoTree.TreeType.RTG_TREE; + deadPineTree.treeCondition = DecoTree.TreeCondition.RANDOM_CHANCE; + deadPineTree.treeConditionChance = 18; + deadPineTree.maxY = 100; + this.addDeco(deadPineTree); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 100; + decoShrub.strengthFactor = 3f; + this.addDeco(decoShrub); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 80f; + decoFallenTree.distribution.noiseFactor = 60f; + decoFallenTree.distribution.noiseAddend = -15f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = BlockUtil.getStateLog2(1); + decoFallenTree.leavesBlock = BlockUtil.getStateLeaf2(1); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigVanillaSwamplandM.decorationLogsId)); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoPumpkin decoPumpkin = new DecoPumpkin(); + decoPumpkin.maxY = 90; + decoPumpkin.randomType = rtg.world.biome.deco.DecoPumpkin.RandomType.X_DIVIDED_BY_STRENGTH; + decoPumpkin.randomFloat = 50f; + this.addDeco(decoPumpkin); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 12f; + this.addDeco(decoGrass); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaiga.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaiga.java new file mode 100644 index 00000000..f198d8f6 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaiga.java @@ -0,0 +1,26 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaTaiga; +import rtg.world.biome.deco.collection.DecoCollectionTaiga; +import rtg.world.gen.surface.vanilla.SurfaceVanillaTaiga; +import rtg.world.gen.terrain.vanilla.TerrainVanillaTaiga; + +public class RealisticBiomeVanillaTaiga extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.TAIGA; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaTaiga(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaTaiga(), + new SurfaceVanillaTaiga(config, biome.topBlock, biome.fillerBlock) + ); + + this.addDecoCollection(new DecoCollectionTaiga(this.config._boolean(BiomeConfigVanillaTaiga.decorationLogsId), 10f)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaHills.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaHills.java new file mode 100644 index 00000000..138d14e1 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaHills.java @@ -0,0 +1,29 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaTaigaHills; +import rtg.world.biome.deco.collection.DecoCollectionTaiga; +import rtg.world.gen.surface.vanilla.SurfaceVanillaTaigaHills; +import rtg.world.gen.terrain.vanilla.TerrainVanillaTaigaHills; + +public class RealisticBiomeVanillaTaigaHills extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.TAIGA_HILLS; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaTaigaHills(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaTaigaHills(), + new SurfaceVanillaTaigaHills(config, Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState(), 0.2f) + ); + + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionTaiga(this.config._boolean(BiomeConfigVanillaTaigaHills.decorationLogsId), 10f)); + } +} diff --git a/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaM.java b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaM.java new file mode 100644 index 00000000..f18b1628 --- /dev/null +++ b/src/api/java/rtg/world/biome/realistic/vanilla/RealisticBiomeVanillaTaigaM.java @@ -0,0 +1,28 @@ +package rtg.world.biome.realistic.vanilla; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaTaigaM; +import rtg.world.biome.deco.collection.DecoCollectionTaiga; +import rtg.world.gen.surface.vanilla.SurfaceVanillaTaigaM; +import rtg.world.gen.terrain.vanilla.TerrainVanillaTaigaM; + +public class RealisticBiomeVanillaTaigaM extends RealisticBiomeVanillaBase { + + public static Biome biome = Biomes.MUTATED_TAIGA; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeVanillaTaigaM(BiomeConfig config) { + + super(config, biome, river, + new TerrainVanillaTaigaM(70f, 180f, 7f, 100f, 38f, 160f, 68f), + new SurfaceVanillaTaigaM(config, biome.topBlock, biome.fillerBlock) + ); + + this.noLakes = true; + + this.addDecoCollection(new DecoCollectionTaiga(this.config._boolean(BiomeConfigVanillaTaigaM.decorationLogsId), 10f)); + } +} diff --git a/src/api/java/rtg/world/gen/ChunkLandscape.java b/src/api/java/rtg/world/gen/ChunkLandscape.java new file mode 100644 index 00000000..3b71c8c0 --- /dev/null +++ b/src/api/java/rtg/world/gen/ChunkLandscape.java @@ -0,0 +1,13 @@ +package rtg.world.gen; + +import rtg.world.biome.realistic.RealisticBiomeBase; + +/** + * + * @author Zeno410 + */ +public class ChunkLandscape { + public float [] noise = new float [256]; + public RealisticBiomeBase [] biome = new RealisticBiomeBase [256]; + public float [] river = new float [256]; +} diff --git a/src/api/java/rtg/world/gen/ChunkProviderRTG.java b/src/api/java/rtg/world/gen/ChunkProviderRTG.java new file mode 100644 index 00000000..41859237 --- /dev/null +++ b/src/api/java/rtg/world/gen/ChunkProviderRTG.java @@ -0,0 +1,987 @@ +package rtg.world.gen; + +import java.util.*; +import javax.annotation.Nonnull; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockFalling; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Blocks; +import net.minecraft.util.ClassInheritanceMultiMap; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.world.World; +import net.minecraft.world.WorldEntitySpawner; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.chunk.IChunkGenerator; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.chunk.storage.AnvilChunkLoader; +import net.minecraft.world.gen.ChunkProviderServer; +import net.minecraft.world.gen.MapGenBase; +import net.minecraft.world.gen.MapGenCaves; +import net.minecraft.world.gen.MapGenRavine; +import net.minecraft.world.gen.structure.*; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.ForgeEventFactory; +import net.minecraftforge.event.terraingen.ChunkGeneratorEvent; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; +import net.minecraftforge.event.terraingen.InitMapGenEvent.EventType; +import net.minecraftforge.event.terraingen.PopulateChunkEvent; +import net.minecraftforge.event.terraingen.TerrainGen; +import net.minecraftforge.event.world.ChunkEvent; +import net.minecraftforge.fml.common.eventhandler.Event; + +import rtg.api.biome.BiomeConfig; +import rtg.config.rtg.ConfigRTG; +import rtg.util.*; +import rtg.world.WorldTypeRTG; +import rtg.world.biome.BiomeAnalyzer; +import rtg.world.biome.BiomeProviderRTG; +import rtg.world.biome.IBiomeProviderRTG; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.biome.realistic.RealisticBiomePatcher; +import rtg.world.gen.structure.MapGenScatteredFeatureRTG; +import rtg.world.gen.structure.MapGenStrongholdRTG; +import rtg.world.gen.structure.MapGenVillageRTG; +import rtg.world.gen.structure.StructureOceanMonumentRTG; + + +@SuppressWarnings({"UnusedParameters", "deprecation"}) +public class ChunkProviderRTG implements IChunkGenerator +{ + private static ChunkProviderRTG populatingProvider; + private final MapGenBase caveGenerator; + private final MapGenBase ravineGenerator; + private final MapGenStronghold strongholdGenerator; + private final MapGenMineshaft mineshaftGenerator; + private final MapGenVillage villageGenerator; + private final MapGenScatteredFeature scatteredFeatureGenerator; + private final StructureOceanMonument oceanMonumentGenerator; + private final int sampleSize = 8; + private final int sampleArraySize; + private BiomeAnalyzer analyzer = new BiomeAnalyzer(); + private int [] xyinverted = analyzer.xyinverted(); + private final LandscapeGenerator landscapeGenerator; + private final LimitedMap availableChunks; + private final HashSet toDecorate = new HashSet<>(); + private boolean mapFeaturesEnabled; + private Block bedrockBlock = Block.getBlockFromName(ConfigRTG.bedrockBlockId); + private byte bedrockByte = (byte) ConfigRTG.bedrockBlockByte; + private Random rand; + private Random mapRand; + private World worldObj; + private IBiomeProviderRTG cmr; + private OpenSimplexNoise simplex; + private CellNoise cell; + private Biome[] baseBiomesList; + private boolean[] biomesGeneratedInChunk; + private float[] borderNoise; + private long worldSeed; + private RealisticBiomePatcher biomePatcher; + private HashMap inGeneration = new HashMap<>(); + private HashSet toCheck = new HashSet<>(); + private Compass compass = new Compass(); + private ArrayList directions = compass.directions(); + + //private HashSet everGenerated = new HashSet(); + private TimedHashSet chunkMade = new TimedHashSet<>(5 * 1000); + private boolean populating = false; + private boolean fakeGenerator = false; + private LimitedSet alreadyDecorated = new LimitedSet<>(1000); + private AnvilChunkLoader chunkLoader; + + // we have to store this callback because it's a WeakReference in the event manager + public final Acceptor delayedDecorator = new Acceptor() { + @Override + public void accept(ChunkEvent.Load event) { + if (event.isCanceled()) return; + ChunkPos pos = event.getChunk().getChunkCoordIntPair(); + + if (!toCheck.contains(pos)) return; + toCheck.remove(pos); + for (Direction forPopulation : directions) { + decorateIfOtherwiseSurrounded(event.getWorld().getChunkProvider(), pos, forPopulation); + } + //clearDecorations(0); + } + }; + + public ChunkProviderRTG(World world, long l) { + worldObj = world; + cmr = (BiomeProviderRTG) worldObj.getBiomeProvider(); + rand = new Random(l); + simplex = new OpenSimplexNoise(l); + cell = new SimplexCellularNoise(l); + landscapeGenerator = new LandscapeGenerator(simplex, cell); + mapRand = new Random(l); + worldSeed = l; + Map m = new HashMap<>(); + m.put("size", "0"); + m.put("distance", "24"); + mapFeaturesEnabled = world.getWorldInfo().isMapFeaturesEnabled(); + + boolean isRTGWorld = world.getWorldInfo().getTerrainType() instanceof WorldTypeRTG; + + if (isRTGWorld && ConfigRTG.enableCaveModifications) { + caveGenerator = (MapGenCaves) TerrainGen.getModdedMapGen(new MapGenCavesRTG(), EventType.CAVE); + } + else { + caveGenerator = (MapGenCaves) TerrainGen.getModdedMapGen(new MapGenCaves(), EventType.CAVE); + } + + if (isRTGWorld && ConfigRTG.enableRavineModifications) { + ravineGenerator = (MapGenRavine) TerrainGen.getModdedMapGen(new MapGenRavineRTG(), EventType.RAVINE); + } + else { + ravineGenerator = (MapGenRavine) TerrainGen.getModdedMapGen(new MapGenRavine(), EventType.RAVINE); + } + + if (isRTGWorld && ConfigRTG.enableVillageModifications) { + villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen(new MapGenVillageRTG(), EventType.VILLAGE); + } + else { + villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen(new MapGenVillage(m), EventType.VILLAGE); + } + + if (isRTGWorld && ConfigRTG.enableStrongholdModifications) { + strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(new MapGenStrongholdRTG(), EventType.STRONGHOLD); + } + else { + strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(new MapGenStronghold(), EventType.STRONGHOLD); + } + + mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(new MapGenMineshaft(), EventType.MINESHAFT); + + if (isRTGWorld && ConfigRTG.enableScatteredFeatureModifications) { + scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(new MapGenScatteredFeatureRTG(), EventType.SCATTERED_FEATURE); + } + else { + scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(new MapGenScatteredFeature(), EventType.SCATTERED_FEATURE); + } + + if (isRTGWorld && ConfigRTG.enableOceanMonumentModifications) { + oceanMonumentGenerator = (StructureOceanMonument) TerrainGen.getModdedMapGen(new StructureOceanMonumentRTG(), EventType.OCEAN_MONUMENT); + } + else { + oceanMonumentGenerator = (StructureOceanMonument) TerrainGen.getModdedMapGen(new StructureOceanMonument(), EventType.OCEAN_MONUMENT); + } + + CanyonColour.init(l); + sampleArraySize = sampleSize * 2 + 5; + baseBiomesList = new Biome[256]; + biomesGeneratedInChunk = new boolean[256]; + borderNoise = new float[256]; + biomePatcher = new RealisticBiomePatcher(); + + // set up the cache of available chunks + availableChunks = new LimitedMap<>(1000); + setWeightings(); + + // check for bogus world + if (worldObj == null) throw new RuntimeException("Attempt to create chunk provider without a world"); + } + + private void setWeightings() { + float[][] weightings = new float[sampleArraySize * sampleArraySize][256]; + for (int i = 0; i < 16; i++) { + for (int j = 0; j < 16; j++) { + TimeTracker.manager.start("Weighting"); + float limit = (float) Math.pow((56f * 56f), .7); + // float limit = 56f; + + for (int mapX = 0; mapX < sampleArraySize; mapX++) { + for (int mapZ = 0; mapZ < sampleArraySize; mapZ++) { + float xDist = (i - chunkCoordinate(mapX)); + float yDist = (j - chunkCoordinate(mapZ)); + float distanceSquared = xDist * xDist + yDist * yDist; + //float distance = (float)Math.sqrt(distanceSquared); + float distance = (float) Math.pow(distanceSquared, .7); + float weight = 1f - distance / limit; + if (weight < 0) weight = 0; + weightings[mapX * sampleArraySize + mapZ][i * 16 + j] = weight; + } + } + } + } + } + + private int chunkCoordinate(int biomeMapCoordinate) { + return (biomeMapCoordinate - sampleSize) * 8; + } + + public void isFakeGenerator() { + + this.fakeGenerator = true; + this.mapFeaturesEnabled = false; + } + + @Nonnull + public Chunk provideChunk(final int cx, final int cz) { + final ChunkPos pos = new ChunkPos(cx, cz); + if (inGeneration.containsKey(pos)) return inGeneration.get(pos); + //if (availableChunks.size() > 1000) throw new RuntimeException(); + if (chunkMade.contains(pos)) { + Chunk available; + available = availableChunks.get(pos); + // this should never be happening but it came up when Forge/MC re-requested an already + // made chunk for a lighting check (???) + + // we are having a problem with Forge complaining about double entity registration + // so we'll unload any loaded entities + if (available != null) { + ClassInheritanceMultiMap[] entityLists = available.getEntityLists(); + for (ClassInheritanceMultiMap entityList : entityLists) { + /* + Iterator iterator = entityLists[i].iterator(); + while (iterator.hasNext()) { + + iterator.next(); + iterator.remove(); + } + */ + worldObj.unloadEntities(entityList); + } + toCheck.add(pos); + return available; + } + } + + //if (everGenerated.contains(pos)) throw new RuntimeException(); + + String rtgTerrain = "RTG Terrain"; + TimeTracker.manager.start(rtgTerrain); + rand.setSeed((long) cx * 0x4f9939f508L + (long) cz * 0x1ef1565bd5L); + ChunkPrimer primer = new ChunkPrimer(); + int k; + RealisticBiomeBase realisticBiome; + + ChunkLandscape landscape = landscapeGenerator.landscape(cmr, cx * 16, cz * 16); + + generateTerrain(cmr, cx, cz, primer, landscape.biome, landscape.noise); + // that routine can change the blocks. + //get standard biome Data + + for (int ci = 0; ci < 256; ci++) { + + realisticBiome = landscape.biome[ci]; + + // Do we need to patch the biome? + if (realisticBiome == null) { + realisticBiome = biomePatcher.getPatchedRealisticBiome( + "NULL biome (" + ci + ") found when providing chunk."); + } + + biomesGeneratedInChunk[Biome.getIdForBiome(realisticBiome.baseBiome)] = true; + } + + for (k = 0; k < 256; k++) { + if (biomesGeneratedInChunk[k]) { + + realisticBiome = RealisticBiomeBase.getBiome(k); + + // Do we need to patch the biome? + if (realisticBiome == null) { + realisticBiome = biomePatcher.getPatchedRealisticBiome( + "NULL biome (" + k + ") found when providing chunk."); + } + + realisticBiome.generateMapGen(primer, worldSeed, worldObj, cmr, mapRand, cx, cz, simplex, cell, landscape.noise); + biomesGeneratedInChunk[k] = false; + } + + try { + baseBiomesList[k] = landscape.biome[k].baseBiome; + } + catch (Exception e) { + baseBiomesList[k] = biomePatcher.getPatchedBaseBiome("" + Biome.getIdForBiome(landscape.biome[k].baseBiome)); + } + } + + replaceBlocksForBiome(cx, cz, primer, landscape.biome, baseBiomesList, landscape.noise); + + caveGenerator.generate(worldObj, cx, cz, primer); + ravineGenerator.generate(worldObj, cx, cz, primer); + + if (mapFeaturesEnabled) { + + if (ConfigRTG.generateMineshafts) { + try { + mineshaftGenerator.generate(this.worldObj, cx, cz, primer); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + + if (ConfigRTG.generateStrongholds) { + try { + strongholdGenerator.generate(this.worldObj, cx, cz, primer); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + + if (ConfigRTG.generateVillages) { + try { + villageGenerator.generate(this.worldObj, cx, cz, primer); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + + if (ConfigRTG.generateScatteredFeatures) { + try { + scatteredFeatureGenerator.generate(this.worldObj, cx, cz, primer); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + + if (ConfigRTG.generateOceanMonuments) { + try { + oceanMonumentGenerator.generate(this.worldObj, cx, cz, primer); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + } + + // store in the in process pile + Chunk chunk = new Chunk(this.worldObj, primer, cx, cz); + inGeneration.put(pos, chunk); + + // doJitter no longer needed as the biome array gets fixed + + byte[] abyte1 = chunk.getBiomeArray(); + for (k = 0; k < abyte1.length; ++k) { + // Biomes are y-first and terrain x-first + byte b = (byte) Biome.getIdForBiome(this.baseBiomesList[xyinverted[k]]); + abyte1[k] = b; + } + chunk.setBiomeArray(abyte1); + + chunk.generateSkylightMap(); + toCheck.add(pos); + + // remove from in process pile + inGeneration.remove(pos); + this.chunkMade.add(pos); + //this.everGenerated.add(pos); + /*if (!chunkMade.contains(pos)||!everGenerated.contains(pos)) { + throw new RuntimeException(pos.toString() + chunkMade.size()); + }*/ + availableChunks.put(pos, chunk); + TimeTracker.manager.stop(rtgTerrain); + return chunk; + } + + private void generateTerrain(IBiomeProviderRTG cmr, int cx, int cz, ChunkPrimer primer, + RealisticBiomeBase biomes[], float[] noise) { + + int h; + for (int i = 0; i < 16; i++) { + for (int j = 0; j < 16; j++) { + h = (int) noise[i * 16 + j]; + + for (int k = 0; k < 256; k++) { + if (k > h) { + if (k < 63) { + primer.setBlockState(i, k, j, Blocks.WATER.getDefaultState()); + } + else { + primer.setBlockState(i, k, j, Blocks.AIR.getDefaultState()); + } + } + else { + primer.setBlockState(i, k, j, Blocks.STONE.getDefaultState()); + } + } + } + } + } + + private void replaceBlocksForBiome(int cx, int cz, ChunkPrimer primer, RealisticBiomeBase[] + biomes, Biome[] base, float[] n) { + + ChunkGeneratorEvent.ReplaceBiomeBlocks event = new ChunkGeneratorEvent.ReplaceBiomeBlocks( + this, cx, cz, primer, this.worldObj); + MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == Event.Result.DENY) return; + + int i, j, depth; + float river; + RealisticBiomeBase biome; + + for (i = 0; i < 16; i++) { + for (j = 0; j < 16; j++) { + + /* + * Some of the 'i' and 'j' parameters have been flipped when passing them. + * Prior to flipping, the surface was being XZ-chunk-flipped. - WhichOnesPink + */ + biome = biomes[i * 16 + j]; + river = -cmr.getRiverStrength(cx * 16 + i, cz * 16 + j); + depth = -1; + + biome.rReplace(primer, cx * 16 + i, cz * 16 + j, i, j, depth, worldObj, rand, simplex, cell, n, river, base); + + int rough; + int flatBedrockLayers = ConfigRTG.flatBedrockLayers; + flatBedrockLayers = flatBedrockLayers < 0 ? 0 : (flatBedrockLayers > 5 ? 5 : flatBedrockLayers); + + if (flatBedrockLayers > 0) { + for (int bl = 0; bl < flatBedrockLayers; bl++) { + primer.setBlockState(i, bl, j, bedrockBlock.getStateFromMeta(bedrockByte)); + } + } + else { + + primer.setBlockState(i, 0, j, bedrockBlock.getStateFromMeta(bedrockByte)); + + rough = rand.nextInt(2); + primer.setBlockState(i, rough, j, bedrockBlock.getStateFromMeta(bedrockByte)); + + rough = rand.nextInt(3); + primer.setBlockState(i, rough, j, bedrockBlock.getStateFromMeta(bedrockByte)); + + rough = rand.nextInt(4); + primer.setBlockState(i, rough, j, bedrockBlock.getStateFromMeta(bedrockByte)); + + rough = rand.nextInt(5); + primer.setBlockState(i, rough, j, bedrockBlock.getStateFromMeta(bedrockByte)); + } + } + } + } + + @Override + public void populate(int x, int z) { + // check if this is the master provider + if (this.fakeGenerator) return; + //if (this.alreadyDecorated.contains(new PlaneLocation.Invariant(chunkX, chunkZ))) return; + if (this.neighborsDone(x, z)) { + this.doPopulate(x, z); + } + clearDecorations(0); + } + + private boolean neighborsDone(int cx, int cz) { + return chunkExists(true, cx - 1, cz - 1) && chunkExists(true, cx - 1, cz) && chunkExists(true, cx - 1, cz + 1) && chunkExists(true, cx, cz - 1) && chunkExists(true, cx, cz + 1) && chunkExists(true, cx + 1, cz - 1) && chunkExists(true, cx + 1, cz) && chunkExists(true, cx + 1, cz + 1); + } + + private void doPopulate(int chunkX, int chunkZ) { + // don't populate if already done + + ChunkPos chunkPos = new ChunkPos(chunkX, chunkZ); + //Logger.debug("trying to decorate: " + chunkPos.toString()); + if (alreadyDecorated.contains(chunkPos)) return; + + if (populating) { + // this has been created by another decoration; put in to-do pile + addToDecorationList(chunkPos); + return; + } + + if (populatingProvider != null) throw new RuntimeException(toString() + " " + populatingProvider.toString()); + + if (inGeneration.containsKey(chunkPos)) { + addToDecorationList(chunkPos); + return; + } + + //Logger.debug("decorating"); + alreadyDecorated.add(chunkPos); + populating = true; + populatingProvider = this; + + TimeTracker.manager.start("RTG populate"); + TimeTracker.manager.start("Features"); + BlockFalling.fallInstantly = true; + + int worldX = chunkX * 16; + int worldZ = chunkZ * 16; + TimeTracker.manager.start("Biome Layout"); + + //Flippy McFlipperson. + RealisticBiomeBase biome = cmr.getBiomeDataAt(worldX + 16, worldZ + 16); + //Logger.debug("CPRTG#doPopulate: %s at %d %d", biome.baseBiome.getBiomeName(), worldX + 16, worldZ + 16); + + TimeTracker.manager.stop("Biome Layout"); + this.rand.setSeed(this.worldObj.getSeed()); + long i1 = this.rand.nextLong() / 2L * 2L + 1L; + long j1 = this.rand.nextLong() / 2L * 2L + 1L; + this.rand.setSeed((long) chunkX * i1 + (long) chunkZ * j1 ^ this.worldObj.getSeed()); + boolean hasPlacedVillageBlocks = false; + + ForgeEventFactory.onChunkPopulate(true, this, this.worldObj, this.rand, chunkX, chunkZ, false); + + if (mapFeaturesEnabled) { + + TimeTracker.manager.start("Mineshafts"); + if (ConfigRTG.generateMineshafts) { + try { + mineshaftGenerator.generateStructure(worldObj, rand, chunkPos); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + TimeTracker.manager.stop("Mineshafts"); + + TimeTracker.manager.start("Strongholds"); + if (ConfigRTG.generateStrongholds) { + try { + strongholdGenerator.generateStructure(worldObj, rand, chunkPos); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + TimeTracker.manager.stop("Strongholds"); + + TimeTracker.manager.start("Villages"); + if (ConfigRTG.generateVillages) { + try { + hasPlacedVillageBlocks = villageGenerator.generateStructure(worldObj, rand, chunkPos); + } + catch (Exception e) { + hasPlacedVillageBlocks = false; + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + TimeTracker.manager.stop("Villages"); + + TimeTracker.manager.start("Scattered"); + if (ConfigRTG.generateScatteredFeatures) { + try { + scatteredFeatureGenerator.generateStructure(worldObj, rand, chunkPos); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + TimeTracker.manager.stop("Scattered"); + + TimeTracker.manager.start("Monuments"); + if (ConfigRTG.generateOceanMonuments) { + try { + oceanMonumentGenerator.generateStructure(this.worldObj, rand, chunkPos); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + TimeTracker.manager.stop("Monuments"); + } + + TimeTracker.manager.start("Pools"); + biome.rDecorator.rPopulatePreDecorate(this, worldObj, rand, chunkX, chunkZ, hasPlacedVillageBlocks); + TimeTracker.manager.stop("Pools"); + + /* + * What is this doing? And why does it need to be done here? - Pink + * Answer: building a frequency table of nearby biomes - Zeno. + */ + + final int adjust = 24;// seems off? but decorations aren't matching their chunks. + + TimeTracker.manager.start("Biome Layout"); + for (int bx = -4; bx <= 4; bx++) { + + for (int bz = -4; bz <= 4; bz++) { + borderNoise[landscapeGenerator.getBiomeDataAt(cmr, worldX + adjust + bx * 4, worldZ + adjust + bz * 4)] += 0.01234569f; + } + } + TimeTracker.manager.stop("Biome Layout"); + TimeTracker.manager.stop("Features"); + + /* + * ######################################################################## + * # START DECORATE BIOME + * ######################################################################## + */ + + TimeTracker.manager.start("Decorations"); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldObj, rand, new BlockPos(worldX, 0, worldZ))); + + //Initialise variables. + float river = -cmr.getRiverStrength(worldX + 16, worldZ + 16); + + //Border noise. (Does this have to be done here? - Pink) + RealisticBiomeBase realisticBiome; + + for (int bn = 0; bn < 256; bn++) { + if (borderNoise[bn] > 0f) { + if (borderNoise[bn] >= 1f) borderNoise[bn] = 1f; + + realisticBiome = RealisticBiomeBase.getBiome(bn); + + // Do we need to patch the biome? + if (realisticBiome == null) { + realisticBiome = biomePatcher.getPatchedRealisticBiome( + "NULL biome (" + bn + ") found when generating border noise."); + } + + /* + * When decorating the biome, we need to look at the biome configs to see if RTG is allowed to decorate it. + * If the biome configs don't allow it, then we try to let the base biome decorate itself. + * However, there are some mod biomes that crash when they try to decorate themselves, + * so that's what the try/catch is for. If it fails, then it falls back to RTG decoration. + */ + if (ConfigRTG.enableRTGBiomeDecorations && realisticBiome.config._boolean(BiomeConfig.useRTGDecorationsId)) { + + realisticBiome.rDecorate(this.worldObj, this.rand, worldX, worldZ, simplex, cell, borderNoise[bn], river, hasPlacedVillageBlocks); + } + else { + + try { + + realisticBiome.baseBiome.decorate(this.worldObj, rand, new BlockPos(worldX, 0, worldZ)); + } + catch (Exception e) { + + realisticBiome.rDecorate(this.worldObj, this.rand, worldX, worldZ, simplex, cell, borderNoise[bn], river, hasPlacedVillageBlocks); + } + } + /* + if(realisticBiome.baseBiome.getTemperature() < 0.15f) {} + else {} + */ + borderNoise[bn] = 0f; + } + } + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldObj, rand, new BlockPos(worldX, 0, worldZ))); + + TimeTracker.manager.stop("Decorations"); + + /* + * ######################################################################## + * # END DECORATE BIOME + * ######################################################################## + */ + + TimeTracker.manager.start("Post-decorations"); + biome.rDecorator.rPopulatePostDecorate(worldObj, rand, chunkX, chunkZ, hasPlacedVillageBlocks); + TimeTracker.manager.stop("Post-decorations"); + + TimeTracker.manager.start("Entities"); + if (TerrainGen.populate(this, this.worldObj, this.rand, chunkX, chunkZ, hasPlacedVillageBlocks, PopulateChunkEvent.Populate.EventType.ANIMALS)) { + WorldEntitySpawner.performWorldGenSpawning(this.worldObj, biome.baseBiome, worldX + 8, worldZ + 8, 16, 16, this.rand); + } + TimeTracker.manager.stop("Entities"); + + TimeTracker.manager.start("Ice"); + if (TerrainGen.populate(this, this.worldObj, this.rand, chunkX, chunkZ, hasPlacedVillageBlocks, PopulateChunkEvent.Populate.EventType.ICE)) { + + int i4, j4; + + for (i4 = 0; i4 < 16; ++i4) { + + for (j4 = 0; j4 < 16; ++j4) { + + BlockPos snowPos = this.worldObj.getPrecipitationHeight(new BlockPos(worldX + i4, 0, worldZ + j4)); + BlockPos icePos = snowPos.down(); + + if(this.worldObj.canBlockFreezeWater(icePos)) { + this.worldObj.setBlockState(icePos, Blocks.ICE.getDefaultState(), 2); + } + + if (ConfigRTG.enableSnowLayers && this.worldObj.canSnowAt(snowPos, true)) { + this.worldObj.setBlockState(snowPos, Blocks.SNOW_LAYER.getDefaultState(), 2); + } + } + } + } + TimeTracker.manager.stop("Ice"); + + ForgeEventFactory.onChunkPopulate(false, this, this.worldObj, this.rand, chunkX, chunkZ, hasPlacedVillageBlocks); + + BlockFalling.fallInstantly = false; + TimeTracker.manager.stop("RTG populate"); + populating = false; + populatingProvider = null; + } + + private void clearDecorations(int limit) { + if (WorldTypeRTG.chunkProvider != this) return; + Set toProcess = doableLocations(limit); + toProcess.forEach(this::removeFromDecorationList); + for (ChunkPos location : toProcess) { + doPopulate(location.chunkXPos, location.chunkZPos); + } + } + + private Set doableLocations(int limit) { + HashSet toProcess = new HashSet<>(); + int found = 0; + synchronized (toDecorate) { + for (ChunkPos pos : toDecorate) { + /* + Chunk existing; + existing = availableChunks.get(pos); + if (existing != null) { + if (!existing.isTerrainPopulated()) { + //continue; // not populated so let more "normal" systems handle it + } + } + */ + if (inGeneration.containsKey(pos)) continue; + toProcess.add(pos); + if (++found == limit) return toProcess; + } + } + return toProcess; + } + + @Override + public boolean generateStructures(@Nonnull Chunk chunkIn, int x, int z) { + boolean flag = false; + + if (ConfigRTG.generateOceanMonuments && this.mapFeaturesEnabled && chunkIn.getInhabitedTime() < 3600L) { + flag = this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, new ChunkPos(x, z)); + } + return flag; + } + + @Override + @Nonnull + public List getPossibleCreatures(@Nonnull EnumCreatureType creatureType, @Nonnull BlockPos pos) { + Biome biome = this.worldObj.getBiome(pos); + + if (this.mapFeaturesEnabled) { + if (creatureType == EnumCreatureType.MONSTER && this.scatteredFeatureGenerator.isSwampHut(pos)) { + return this.scatteredFeatureGenerator.getScatteredFeatureSpawnList(); + } + + if (creatureType == EnumCreatureType.MONSTER && ConfigRTG.generateOceanMonuments && this.oceanMonumentGenerator.isPositionInStructure(this.worldObj, pos)) { + return this.oceanMonumentGenerator.getScatteredFeatureSpawnList(); + } + } + return biome.getSpawnableList(creatureType); + } + + @Override + public BlockPos getStrongholdGen(@Nonnull World par1World, @Nonnull String par2Str, @Nonnull BlockPos blockPos) { + + if (!ConfigRTG.generateStrongholds) return null; + return "Stronghold".equals(par2Str) && this.strongholdGenerator != null ? this.strongholdGenerator.getClosestStrongholdPos(par1World, blockPos) : null; + } + + @Override + public void recreateStructures(@Nonnull Chunk chunk, int par1, int par2) { + + if (mapFeaturesEnabled) { + if (ConfigRTG.generateMineshafts) { + try { + mineshaftGenerator.generate(worldObj, par1, par2, new ChunkPrimer()); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + + if (ConfigRTG.generateStrongholds) { + try { + strongholdGenerator.generate(worldObj, par1, par2, new ChunkPrimer()); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + + if (ConfigRTG.generateVillages) { + try { + villageGenerator.generate(this.worldObj, par1, par2, new ChunkPrimer()); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + + if (ConfigRTG.generateScatteredFeatures) { + try { + scatteredFeatureGenerator.generate(this.worldObj, par1, par2, new ChunkPrimer()); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + + if (ConfigRTG.generateOceanMonuments) { + try { + oceanMonumentGenerator.generate(this.worldObj, par1, par2, new ChunkPrimer()); + } + catch (Exception e) { + if (ConfigRTG.crashOnStructureExceptions) { + throw new RuntimeException(e.getMessage()); + } + else { + Logger.fatal(e.getMessage(), e); + } + } + } + } + } + + private void decorateIfOtherwiseSurrounded(IChunkProvider world, ChunkPos pos, Direction fromNewChunk) { + + // check if this is the master provider + if (WorldTypeRTG.chunkProvider != this) return; + + // see if otherwise surrounded besides the new chunk + ChunkPos probe = new ChunkPos(pos.chunkXPos + fromNewChunk.xOffset, pos.chunkZPos + fromNewChunk.zOffset); + + // check to see if already decorated; shouldn't be but just in case + if (this.alreadyDecorated.contains(probe)) return; + // if an in-process chunk; we'll get a populate call later; + // if (this.inGeneration.containsKey(probe)) return; + + for (Direction checked : directions) { + if (checked == compass.opposite(fromNewChunk)) continue; // that's the new chunk + if (!chunkExists(true, probe.chunkXPos + checked.xOffset, probe.chunkZPos + checked.zOffset)) return;// that one's missing + } + // passed all checks + addToDecorationList(probe); + //this.doPopulate(probe.chunkXPos, probe.chunkZPos); + } + + private boolean chunkExists(boolean checkNeighbours, int cx, int cz) { + //if (chunkExists(cx,cz)) return true; + ChunkPos location = new ChunkPos(cx, cz); + if (inGeneration.containsKey(location)) return true; + if (toCheck.contains(location)) return true; + if (this.chunkMade.contains(location)) return true; + //if (world.chunkExists(cx, cz)) return true; + if (chunkLoader().chunkExists(worldObj, cx, cz)) return true; + //if (this.everGenerated.contains(location)) throw new RuntimeException("somehow lost "+location.toString()); + return false; + } + + private void addToDecorationList(ChunkPos toAdd) { + synchronized (toDecorate) { + toDecorate.add(toAdd); + } + } + + private AnvilChunkLoader chunkLoader() { + if (chunkLoader == null) { + ChunkProviderServer server = (ChunkProviderServer) (worldObj.getChunkProvider()); + chunkLoader = (AnvilChunkLoader) (server.chunkLoader); + } + return chunkLoader; + } + + /** + * @see IChunkProvider + * Loads or generates the chunk at the chunk location specified. + */ + @SuppressWarnings("unused") + public Chunk loadChunk(int par1, int par2) { + throw new RuntimeException(); +// return provideChunk(par1, par2); + } + + public Runnable clearOnServerClose() { + return this::clearToDecorateList; + } + + private void clearToDecorateList() { + if (WorldTypeRTG.chunkProvider != this) return; + if (populating) return;// in process, do later; + // we have to make a copy of the set to work on or we'll get errors + Set toProcess = doableLocations(0); + while (toProcess.size() > 0) { + toProcess.forEach(this::removeFromDecorationList); + for (ChunkPos location : toProcess) { + doPopulate(location.chunkXPos, location.chunkZPos); + } + // and loop because the decorating might have created other chunks to decorate; + toProcess = doableLocations(0); + } + } + + private void removeFromDecorationList(ChunkPos toAdd) { + synchronized (toDecorate) { + toDecorate.remove(toAdd); + } + } +} diff --git a/src/api/java/rtg/world/gen/LandscapeGenerator.java b/src/api/java/rtg/world/gen/LandscapeGenerator.java new file mode 100644 index 00000000..3c741179 --- /dev/null +++ b/src/api/java/rtg/world/gen/LandscapeGenerator.java @@ -0,0 +1,165 @@ +package rtg.world.gen; + +import net.minecraft.util.math.ChunkPos; +import net.minecraft.world.biome.Biome; +import rtg.util.*; +import rtg.world.biome.BiomeAnalyzer; +import rtg.world.biome.IBiomeProviderRTG; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.biome.realistic.RealisticBiomePatcher; + + +/** + * + * @author Zeno410 + */ +class LandscapeGenerator { + private final int sampleSize = 8; + private final int sampleArraySize; + private final int[] biomeData; + private float[] [] weightings; + private final OpenSimplexNoise simplex; + private final CellNoise cell; + private float [] weightedBiomes = new float [256]; + private BiomeAnalyzer analyzer = new BiomeAnalyzer(); + private TimedHashMap storage = new TimedHashMap<>(60 * 1000); + private RealisticBiomePatcher biomePatcher = new RealisticBiomePatcher(); + + LandscapeGenerator(OpenSimplexNoise simplex, CellNoise cell) { + sampleArraySize = sampleSize * 2 + 5; + biomeData = new int[sampleArraySize * sampleArraySize]; + this.simplex = simplex; + this.cell = cell; + setWeightings(); + } + + private void setWeightings() { + weightings = new float [sampleArraySize * sampleArraySize][256]; + for (int i = 0; i < 16; i++) { + for (int j=0; j<16; j++) { + TimeTracker.manager.start("Weighting"); + float limit = (float)Math.pow((56f*56f),.7); + // float limit = 56f; + + for (int mapX = 0 ; mapX < sampleArraySize; mapX ++) { + for (int mapZ = 0 ; mapZ < sampleArraySize; mapZ ++) { + float xDist = (i - chunkCoordinate(mapX)); + float zDist = (j - chunkCoordinate(mapZ)); + float distanceSquared = xDist*xDist + zDist*zDist; + //float distance = (float)Math.sqrt(distanceSquared); + float distance = (float)Math.pow(distanceSquared,.7); + float weight = 1f - distance/limit; + if (weight <0) weight = 0; + weightings[mapX*sampleArraySize + mapZ][i * 16 + j] = weight; + } + } + } + } + } + + private int chunkCoordinate(int biomeMapCoordinate) { + return (biomeMapCoordinate - sampleSize)*8; + } + + int getBiomeDataAt(IBiomeProviderRTG cmr, int cx, int cz) { + int cx2 = cx&15; + int cz2 = cz&15; + ChunkLandscape target = this.landscape(cmr, cx-cx2, cz-cz2); + return Biome.getIdForBiome(target.biome[cx2*16+cz2].baseBiome); + } + + /* + * All of the 'cx' and 'cz' parameters have been flipped when passing them. + * Prior to flipping, the terrain was being XZ-chunk-flipped. - WhichOnesPink + */ + synchronized ChunkLandscape landscape(IBiomeProviderRTG cmr, int cx, int cz) { + ChunkPos chunkPos = new ChunkPos(cx, cz); + ChunkLandscape preExisting = this.storage.get(chunkPos); + if (preExisting != null) return preExisting; + ChunkLandscape result = new ChunkLandscape(); + getNewerNoise(cmr, cx, cz, result); + int [] biomeIndices= cmr.getBiomesGens(cx, cz,16,16); + analyzer.newRepair(biomeIndices, result.biome, this.biomeData, this.sampleSize, result.noise, result.river); + //-cmr.getRiverStrength(cx * 16 + 7, cy * 16 + 7)); + storage.put(chunkPos, result); + return result; + } + + private synchronized void getNewerNoise(IBiomeProviderRTG cmr, int cx, int cz, ChunkLandscape landscape) { + // get area biome map + TimeTracker.manager.start("RTG Noise"); + TimeTracker.manager.start("Biome Layout"); + + for(int i = -sampleSize; i < sampleSize + 5; i++) { + for(int j = -sampleSize; j < sampleSize + 5; j++) { + biomeData[(i + sampleSize) * sampleArraySize + (j + sampleSize)] = + Biome.getIdForBiome(cmr.getBiomeDataAt(cx + ((i * 8)), cz + ((j * 8))).baseBiome); + } + } + + TimeTracker.manager.stop("Biome Layout"); + float river; + + // fill the old smallRender + for (int i = 0; i < 16; i++) { + for (int j=0; j<16; j++) { + TimeTracker.manager.start("Weighting"); + float totalWeight = 0; + for (int mapX = 0 ; mapX < sampleArraySize; mapX ++) { + for (int mapZ = 0 ; mapZ < sampleArraySize; mapZ ++) { + float weight = weightings[mapX*sampleArraySize + mapZ][i * 16 +j]; + if (weight > 0) { + totalWeight += weight; + weightedBiomes[biomeData[mapX*sampleArraySize + mapZ]] += weight; + } + } + } + // normalize biome weights + for (int biomeIndex = 0; biomeIndex < weightedBiomes.length; biomeIndex ++) { + weightedBiomes[biomeIndex] /= totalWeight; + } + + landscape.noise[i * 16 + j] = 0f; + + TimeTracker.manager.stop("Weighting"); + TimeTracker.manager.start("Generating"); + river = cmr.getRiverStrength(cx + i, cz + j); + landscape.river[i * 16 + j] = -river; + float totalBorder = 0f; + + for(int k = 0; k < 256; k++) + { + if(weightedBiomes[k] > 0f) + { + totalBorder += weightedBiomes[k]; + RealisticBiomeBase realisticBiome = RealisticBiomeBase.getBiome(k); + + // Do we need to patch the biome? + if (realisticBiome == null) { + realisticBiome = biomePatcher.getPatchedRealisticBiome( + "NULL biome (" + k + ") found when getting newer noise."); + } + + landscape.noise[i * 16 + j] += realisticBiome.rNoise(simplex, cell, cx + i, cz + j, weightedBiomes[k], river + 1f) * weightedBiomes[k]; + + // 0 for the next column + weightedBiomes[k] = 0f; + } + } + if (totalBorder <.999||totalBorder>1.001) throw new RuntimeException("" + totalBorder); + TimeTracker.manager.stop("Generating"); + } + } + + //fill biomes array with biomeData + + TimeTracker.manager.start("Biome Layout"); + for (int i = 0; i < 16; i++) { + for (int j=0; j<16; j++) { + landscape.biome[i*16+j] = cmr.getBiomeDataAt(cx + (((i-7) * 8+4)), cz + (((j-7) * 8+4))); + } + } + TimeTracker.manager.stop("Biome Layout"); + TimeTracker.manager.stop("RTG Noise"); + } +} diff --git a/src/api/java/rtg/world/gen/MapGenCavesRTG.java b/src/api/java/rtg/world/gen/MapGenCavesRTG.java new file mode 100644 index 00000000..e2bf7cad --- /dev/null +++ b/src/api/java/rtg/world/gen/MapGenCavesRTG.java @@ -0,0 +1,288 @@ +package rtg.world.gen; + +import java.util.Random; + +import com.google.common.base.Objects; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.MapGenCaves; +import rtg.api.biome.BiomeConfig; +import rtg.config.rtg.ConfigRTG; +import rtg.world.biome.realistic.RealisticBiomeBase; + +@SuppressWarnings({"NullableProblems", "WeakerAccess", "unused"}) +public class MapGenCavesRTG extends MapGenCaves +{ + protected static final IBlockState BLK_LAVA = Blocks.LAVA.getDefaultState(); + protected static final IBlockState BLK_AIR = Blocks.AIR.getDefaultState(); + protected static final IBlockState BLK_SANDSTONE = Blocks.SANDSTONE.getDefaultState(); + protected static final IBlockState BLK_RED_SANDSTONE = Blocks.RED_SANDSTONE.getDefaultState(); + private boolean enableCaves; + + protected void addRoom(long p_180703_1_, int p_180703_3_, int p_180703_4_, ChunkPrimer p_180703_5_, + double p_180703_6_, double p_180703_8_, double p_180703_10_) { + + this.addTunnel( + p_180703_1_, p_180703_3_, p_180703_4_, p_180703_5_, p_180703_6_, p_180703_8_, p_180703_10_, + 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + } + + protected void addTunnel(long p_180702_1_, int p_180702_3_, int p_180702_4_, ChunkPrimer p_180702_5_, + double p_180702_6_, double p_180702_8_, double p_180702_10_, + float p_180702_12_, float p_180702_13_, float p_180702_14_, + int p_180702_15_, int p_180702_16_, double p_180702_17_) { + + double d0 = (double) (p_180702_3_ * 16 + 8); + double d1 = (double) (p_180702_4_ * 16 + 8); + float f = 0.0F; + float f1 = 0.0F; + Random random = new Random(p_180702_1_); + + if (p_180702_16_ <= 0) { + int i = this.range * 16 - 16; + p_180702_16_ = i - random.nextInt(i / 4); + } + + boolean flag2 = false; + + if (p_180702_15_ == -1) { + p_180702_15_ = p_180702_16_ / 2; + flag2 = true; + } + + int j = random.nextInt(p_180702_16_ / 2) + p_180702_16_ / 4; + + for (boolean flag = random.nextInt(6) == 0; p_180702_15_ < p_180702_16_; ++p_180702_15_) { + double d2 = 1.5D + (double) (MathHelper.sin((float) p_180702_15_ * (float) Math.PI / (float) p_180702_16_) * p_180702_12_); + double d3 = d2 * p_180702_17_; + float f2 = MathHelper.cos(p_180702_14_); + float f3 = MathHelper.sin(p_180702_14_); + p_180702_6_ += (double) (MathHelper.cos(p_180702_13_) * f2); + p_180702_8_ += (double) f3; + p_180702_10_ += (double) (MathHelper.sin(p_180702_13_) * f2); + + if (flag) p_180702_14_ = p_180702_14_ * 0.92F; + else p_180702_14_ = p_180702_14_ * 0.7F; + + p_180702_14_ = p_180702_14_ + f1 * 0.1F; + p_180702_13_ += f * 0.1F; + f1 = f1 * 0.9F; + f = f * 0.75F; + f1 = f1 + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; + f = f + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; + + if (!flag2 && p_180702_15_ == j && p_180702_12_ > 1.0F && p_180702_16_ > 0) { + this.addTunnel( + random.nextLong(), p_180702_3_, p_180702_4_, p_180702_5_, p_180702_6_, p_180702_8_, p_180702_10_, + random.nextFloat() * 0.5F + 0.5F, p_180702_13_ - ((float) Math.PI / 2F), p_180702_14_ / 3.0F, + p_180702_15_, p_180702_16_, 1.0D); + this.addTunnel( + random.nextLong(), p_180702_3_, p_180702_4_, p_180702_5_, p_180702_6_, p_180702_8_, p_180702_10_, + random.nextFloat() * 0.5F + 0.5F, p_180702_13_ + ((float) Math.PI / 2F), p_180702_14_ / 3.0F, + p_180702_15_, p_180702_16_, 1.0D); + return; + } + + if (flag2 || random.nextInt(4) != 0) { + double d4 = p_180702_6_ - d0; + double d5 = p_180702_10_ - d1; + double d6 = (double) (p_180702_16_ - p_180702_15_); + double d7 = (double) (p_180702_12_ + 2.0F + 16.0F); + + if (d4 * d4 + d5 * d5 - d6 * d6 > d7 * d7) return; + + if (p_180702_6_ >= d0 - 16.0D - d2 * 2.0D && p_180702_10_ >= d1 - 16.0D - d2 * 2.0D && p_180702_6_ <= d0 + 16.0D + d2 * 2.0D && p_180702_10_ <= d1 + 16.0D + d2 * 2.0D) { + int k2 = MathHelper.floor_double(p_180702_6_ - d2) - p_180702_3_ * 16 - 1; + int k = MathHelper.floor_double(p_180702_6_ + d2) - p_180702_3_ * 16 + 1; + int l2 = MathHelper.floor_double(p_180702_8_ - d3) - 1; + int l = MathHelper.floor_double(p_180702_8_ + d3) + 1; + int i3 = MathHelper.floor_double(p_180702_10_ - d2) - p_180702_4_ * 16 - 1; + int i1 = MathHelper.floor_double(p_180702_10_ + d2) - p_180702_4_ * 16 + 1; + + if (k2 < 0) k2 = 0; + if (k > 16) k = 16; + if (l2 < 1) l2 = 1; + if (l > 248) l = 248; + if (i3 < 0) i3 = 0; + if (i1 > 16) i1 = 16; + + boolean flag3 = false; + + for (int j1 = k2; !flag3 && j1 < k; ++j1) { + for (int k1 = i3; !flag3 && k1 < i1; ++k1) { + for (int l1 = l + 1; !flag3 && l1 >= l2 - 1; --l1) { + if (l1 >= 0 && l1 < 256) { + if (isOceanBlock(p_180702_5_, j1, l1, k1, p_180702_3_, p_180702_4_)) flag3 = true; + if (l1 != l2 - 1 && j1 != k2 && j1 != k - 1 && k1 != i3 && k1 != i1 - 1) l1 = l2; + } + } + } + } + + if (!flag3) { + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); + + for (int j3 = k2; j3 < k; ++j3) { + double d10 = ((double) (j3 + p_180702_3_ * 16) + 0.5D - p_180702_6_) / d2; + + for (int i2 = i3; i2 < i1; ++i2) { + double d8 = ((double) (i2 + p_180702_4_ * 16) + 0.5D - p_180702_10_) / d2; + boolean flag1 = false; + + if (d10 * d10 + d8 * d8 < 1.0D) { + for (int j2 = l; j2 > l2; --j2) { + double d9 = ((double) (j2 - 1) + 0.5D - p_180702_8_) / d3; + + if (d9 > -0.7D && d10 * d10 + d9 * d9 + d8 * d8 < 1.0D) { + IBlockState iblockstate1 = p_180702_5_.getBlockState(j3, j2, i2); + IBlockState iblockstate2 = Objects.firstNonNull(p_180702_5_.getBlockState(j3, j2 + 1, i2), BLK_AIR); + + if (isTopBlock(p_180702_5_, j3, j2, i2, p_180702_3_, p_180702_4_)) flag1 = true; + + digBlock(p_180702_5_, j3, j2, i2, p_180702_3_, p_180702_4_, flag1, iblockstate1, iblockstate2); + } + } + } + } + } + if (flag2) break; + } + } + } + } + } + + protected boolean canReplaceBlock(IBlockState p_175793_1_, IBlockState p_175793_2_) { + return ( + p_175793_1_.getBlock() == Blocks.STONE || + p_175793_1_.getBlock() == Blocks.DIRT || + p_175793_1_.getBlock() == Blocks.GRASS || + p_175793_1_.getBlock() == Blocks.HARDENED_CLAY || + p_175793_1_.getBlock() == Blocks.STAINED_HARDENED_CLAY || + p_175793_1_.getBlock() == Blocks.SANDSTONE || + p_175793_1_.getBlock() == Blocks.RED_SANDSTONE || + p_175793_1_.getBlock() == Blocks.MYCELIUM || + p_175793_1_.getBlock() == Blocks.SNOW_LAYER || + p_175793_1_.getBlock() == Blocks.SAND || + p_175793_1_.getBlock() == Blocks.GRAVEL + ) && p_175793_2_.getMaterial() != Material.WATER; + } + + protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) { + // Return early if caves are disabled. + if (!ConfigRTG.enableCaves) return; + + // Use the global settings by default. + int caveDensity = ConfigRTG.caveDensity; + int caveFrequency = ConfigRTG.caveFrequency; + + // If the user has set biome-specific settings, let's use those instead. + Biome biome = worldIn.getBiome(new BlockPos(this.rand.nextInt(16) + chunkX * 16, 0, this.rand.nextInt(16) + chunkZ * 16)); + + RealisticBiomeBase realisticBiome = RealisticBiomeBase.getBiome(Biome.getIdForBiome(biome)); + + if (realisticBiome != null) { + caveDensity = (realisticBiome.config._int(BiomeConfig.caveDensityId) > -1) ? realisticBiome.config._int(BiomeConfig.caveDensityId) : caveDensity; + caveFrequency = (realisticBiome.config._int(BiomeConfig.caveFrequencyId) > -1) ? realisticBiome.config._int(BiomeConfig.caveFrequencyId) : caveFrequency; + } + + // Return early if caves are disabled. + if (caveDensity < 1 || caveFrequency < 1) return; + + caveDensity = (caveDensity < 1) ? 1 : ((caveDensity > 39) ? 39 : caveDensity); + caveDensity += 1; + + int i = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(caveDensity) + 1) + 1); + + caveFrequency = (caveFrequency < 1) ? 1 : ((caveFrequency > 39) ? 39 : caveFrequency); + caveFrequency += 1; + + if (this.rand.nextInt(caveFrequency) != 0) i = 0; + + for (int j = 0; j < i; ++j) { + double d0 = (double) (chunkX * 16 + this.rand.nextInt(16)); + double d1 = (double) this.rand.nextInt(this.rand.nextInt(120) + 8); + double d2 = (double) (chunkZ * 16 + this.rand.nextInt(16)); + int k = 1; + + if (this.rand.nextInt(4) == 0) { + this.addRoom(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2); + k += this.rand.nextInt(4); + } + + for (int l = 0; l < k; ++l) { + float f = this.rand.nextFloat() * ((float) Math.PI * 2F); + float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float f2 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); + + if (this.rand.nextInt(10) == 0) { + f2 *= this.rand.nextFloat() * this.rand.nextFloat() * 3.0F + 1.0F; + } + this.addTunnel(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2, f2, f, f1, 0, 0, 1.0D); + } + } + } + + protected boolean isOceanBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) { + net.minecraft.block.Block block = data.getBlockState(x, y, z).getBlock(); + return block == Blocks.FLOWING_WATER || block == Blocks.WATER; + } + + /** + * Digs out the current block, default implementation removes stone, filler, and top block + * Sets the block to lava if y is less then 10, and air other wise. + * If setting to air, it also checks to see if we've broken the surface and if so + * tries to make the floor the biome's top block + * + * @param data + * Block data array + * @param x + * local X position + * @param y + * local Y position + * @param z + * local Z position + * @param chunkX + * Chunk X position + * @param chunkZ + * Chunk Y position + * @param foundTop + * True if we've encountered the biome's top block. Ideally if we've broken the surface. + */ + protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop, IBlockState state, IBlockState up) { + net.minecraft.world.biome.Biome biome = worldObj.getBiome(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); + IBlockState top = biome.topBlock; + IBlockState filler = biome.fillerBlock; + + if (this.canReplaceBlock(state, up) || state.getBlock() == top.getBlock() || state.getBlock() == filler.getBlock()) { + if (y - 1 < 10) { + data.setBlockState(x, y, z, BLK_LAVA); + } else { + data.setBlockState(x, y, z, BLK_AIR); + + if (foundTop && data.getBlockState(x, y - 1, z).getBlock() == filler.getBlock()) { + data.setBlockState(x, y - 1, z, top.getBlock().getDefaultState()); + } + } + } + } + + //Exception biomes to make sure we generate like vanilla + private boolean isExceptionBiome(net.minecraft.world.biome.Biome biome) { + return biome == net.minecraft.init.Biomes.BEACH || biome == net.minecraft.init.Biomes.DESERT; + } + + //Determine if the block at the specified location is the top block for the biome, we take into account + //Vanilla bugs to make sure that we generate the map the same way vanilla does. + private boolean isTopBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) { + net.minecraft.world.biome.Biome biome = worldObj.getBiome(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); + IBlockState state = data.getBlockState(x, y, z); + return (isExceptionBiome(biome) ? state.getBlock() == Blocks.GRASS : state.getBlock() == biome.topBlock); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/MapGenRavineRTG.java b/src/api/java/rtg/world/gen/MapGenRavineRTG.java new file mode 100644 index 00000000..4aa7e670 --- /dev/null +++ b/src/api/java/rtg/world/gen/MapGenRavineRTG.java @@ -0,0 +1,300 @@ +package rtg.world.gen; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import net.minecraft.world.gen.MapGenRavine; + +import rtg.api.biome.BiomeConfig; +import rtg.config.rtg.ConfigRTG; +import rtg.world.biome.realistic.RealisticBiomeBase; + +public class MapGenRavineRTG extends MapGenRavine +{ + protected static final IBlockState FLOWING_LAVA = Blocks.FLOWING_LAVA.getDefaultState(); + protected static final IBlockState AIR = Blocks.AIR.getDefaultState(); + private final float[] rs = new float[1024]; + + private boolean enableRavines; + private int ravineFrequency; + + protected void addTunnel(long p_180707_1_, int p_180707_3_, int p_180707_4_, ChunkPrimer p_180707_5_, double p_180707_6_, double p_180707_8_, double p_180707_10_, float p_180707_12_, float p_180707_13_, float p_180707_14_, int p_180707_15_, int p_180707_16_, double p_180707_17_) + { + Random random = new Random(p_180707_1_); + double d0 = (double)(p_180707_3_ * 16 + 8); + double d1 = (double)(p_180707_4_ * 16 + 8); + float f = 0.0F; + float f1 = 0.0F; + + if (p_180707_16_ <= 0) + { + int i = this.range * 16 - 16; + p_180707_16_ = i - random.nextInt(i / 4); + } + + boolean flag1 = false; + + if (p_180707_15_ == -1) + { + p_180707_15_ = p_180707_16_ / 2; + flag1 = true; + } + + float f2 = 1.0F; + + for (int j = 0; j < 256; ++j) + { + if (j == 0 || random.nextInt(3) == 0) + { + f2 = 1.0F + random.nextFloat() * random.nextFloat(); + } + + this.rs[j] = f2 * f2; + } + + for (; p_180707_15_ < p_180707_16_; ++p_180707_15_) + { + double d9 = 1.5D + (double)(MathHelper.sin((float)p_180707_15_ * (float)Math.PI / (float)p_180707_16_) * p_180707_12_); + double d2 = d9 * p_180707_17_; + d9 = d9 * ((double)random.nextFloat() * 0.25D + 0.75D); + d2 = d2 * ((double)random.nextFloat() * 0.25D + 0.75D); + float f3 = MathHelper.cos(p_180707_14_); + float f4 = MathHelper.sin(p_180707_14_); + p_180707_6_ += (double)(MathHelper.cos(p_180707_13_) * f3); + p_180707_8_ += (double)f4; + p_180707_10_ += (double)(MathHelper.sin(p_180707_13_) * f3); + p_180707_14_ = p_180707_14_ * 0.7F; + p_180707_14_ = p_180707_14_ + f1 * 0.05F; + p_180707_13_ += f * 0.05F; + f1 = f1 * 0.8F; + f = f * 0.5F; + f1 = f1 + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F; + f = f + (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4.0F; + + if (flag1 || random.nextInt(4) != 0) + { + double d3 = p_180707_6_ - d0; + double d4 = p_180707_10_ - d1; + double d5 = (double)(p_180707_16_ - p_180707_15_); + double d6 = (double)(p_180707_12_ + 2.0F + 16.0F); + + if (d3 * d3 + d4 * d4 - d5 * d5 > d6 * d6) + { + return; + } + + if (p_180707_6_ >= d0 - 16.0D - d9 * 2.0D && p_180707_10_ >= d1 - 16.0D - d9 * 2.0D && p_180707_6_ <= d0 + 16.0D + d9 * 2.0D && p_180707_10_ <= d1 + 16.0D + d9 * 2.0D) + { + int k2 = MathHelper.floor_double(p_180707_6_ - d9) - p_180707_3_ * 16 - 1; + int k = MathHelper.floor_double(p_180707_6_ + d9) - p_180707_3_ * 16 + 1; + int l2 = MathHelper.floor_double(p_180707_8_ - d2) - 1; + int l = MathHelper.floor_double(p_180707_8_ + d2) + 1; + int i3 = MathHelper.floor_double(p_180707_10_ - d9) - p_180707_4_ * 16 - 1; + int i1 = MathHelper.floor_double(p_180707_10_ + d9) - p_180707_4_ * 16 + 1; + + if (k2 < 0) + { + k2 = 0; + } + + if (k > 16) + { + k = 16; + } + + if (l2 < 1) + { + l2 = 1; + } + + if (l > 248) + { + l = 248; + } + + if (i3 < 0) + { + i3 = 0; + } + + if (i1 > 16) + { + i1 = 16; + } + + boolean flag2 = false; + + for (int j1 = k2; !flag2 && j1 < k; ++j1) + { + for (int k1 = i3; !flag2 && k1 < i1; ++k1) + { + for (int l1 = l + 1; !flag2 && l1 >= l2 - 1; --l1) + { + if (l1 >= 0 && l1 < 256) + { + if (isOceanBlock(p_180707_5_, j1, l1, k1, p_180707_3_, p_180707_4_)) + { + flag2 = true; + } + + if (l1 != l2 - 1 && j1 != k2 && j1 != k - 1 && k1 != i3 && k1 != i1 - 1) + { + l1 = l2; + } + } + } + } + } + + if (!flag2) + { + for (int j3 = k2; j3 < k; ++j3) + { + double d10 = ((double)(j3 + p_180707_3_ * 16) + 0.5D - p_180707_6_) / d9; + + for (int i2 = i3; i2 < i1; ++i2) + { + double d7 = ((double)(i2 + p_180707_4_ * 16) + 0.5D - p_180707_10_) / d9; + boolean flag = false; + + if (d10 * d10 + d7 * d7 < 1.0D) + { + for (int j2 = l; j2 > l2; --j2) + { + double d8 = ((double)(j2 - 1) + 0.5D - p_180707_8_) / d2; + + if ((d10 * d10 + d7 * d7) * (double)this.rs[j2 - 1] + d8 * d8 / 6.0D < 1.0D) + { + if (isTopBlock(p_180707_5_, j3, j2, i2, p_180707_3_, p_180707_4_)) + { + flag = true; + } + + digBlock(p_180707_5_, j3, j2, i2, p_180707_3_, p_180707_4_, flag); + } + } + } + } + } + + if (flag1) + { + break; + } + } + } + } + } + } + + protected void recursiveGenerate(World worldIn, int chunkX, int chunkZ, int p_180701_4_, int p_180701_5_, ChunkPrimer chunkPrimerIn) + { + // Return early if ravines are disabled. + if (!ConfigRTG.enableRavines) { + return; + } + + // Use the global settings by default. + ravineFrequency = ConfigRTG.ravineFrequency; + + // If the user has set biome-specific settings, let's use those instead. + Biome biome = worldIn.getBiome(new BlockPos(this.rand.nextInt(16) + chunkX * 16, 0, this.rand.nextInt(16) + chunkZ * 16)); + + if (biome != null) { + + RealisticBiomeBase realisticBiome = RealisticBiomeBase.getBiome(Biome.getIdForBiome(biome)); + + if (realisticBiome != null) { + ravineFrequency = (realisticBiome.config._int(BiomeConfig.ravineFrequencyId) > -1) ? realisticBiome.config._int(BiomeConfig.ravineFrequencyId) : ravineFrequency; + } + } + + // Return early if ravines are disabled. + if (ravineFrequency < 1) { + return; + } + + if (this.rand.nextInt(ravineFrequency) == 0) { + + double d0 = (double)(chunkX * 16 + this.rand.nextInt(16)); + double d1 = (double)(this.rand.nextInt(this.rand.nextInt(40) + 8) + 20); + double d2 = (double)(chunkZ * 16 + this.rand.nextInt(16)); + int i = 1; + + for (int j = 0; j < 1; ++j) + { + float f = this.rand.nextFloat() * ((float)Math.PI * 2F); + float f1 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; + float f2 = (this.rand.nextFloat() * 2.0F + this.rand.nextFloat()) * 2.0F; + this.addTunnel(this.rand.nextLong(), p_180701_4_, p_180701_5_, chunkPrimerIn, d0, d1, d2, f2, f, f1, 0, 0, 3.0D); + } + } + } + protected boolean isOceanBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) + { + net.minecraft.block.Block block = data.getBlockState(x, y, z).getBlock(); + return block== Blocks.FLOWING_WATER || block == Blocks.WATER; + } + + //Exception biomes to make sure we generate like vanilla + private boolean isExceptionBiome(net.minecraft.world.biome.Biome biome) { + return biome == net.minecraft.init.Biomes.BEACH || + biome == net.minecraft.init.Biomes.DESERT || + biome == net.minecraft.init.Biomes.MUSHROOM_ISLAND || + biome == net.minecraft.init.Biomes.MUSHROOM_ISLAND_SHORE; + } + + //Determine if the block at the specified location is the top block for the biome, we take into account + //Vanilla bugs to make sure that we generate the map the same way vanilla does. + private boolean isTopBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ) + { + net.minecraft.world.biome.Biome biome = worldObj.getBiome(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); + IBlockState state = data.getBlockState(x, y, z); + return (isExceptionBiome(biome) ? state.getBlock() == Blocks.GRASS : state.getBlock() == biome.topBlock); + } + + /** + * Digs out the current block, default implementation removes stone, filler, and top block + * Sets the block to lava if y is less then 10, and air other wise. + * If setting to air, it also checks to see if we've broken the surface and if so + * tries to make the floor the biome's top block + * + * @param data Block data array + * @param x local X position + * @param y local Y position + * @param z local Z position + * @param chunkX Chunk X position + * @param chunkZ Chunk Y position + * @param foundTop True if we've encountered the biome's top block. Ideally if we've broken the surface. + */ + protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) + { + net.minecraft.world.biome.Biome biome = worldObj.getBiome(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16)); + IBlockState state = data.getBlockState(x, y, z); + IBlockState top = isExceptionBiome(biome) ? Blocks.GRASS.getDefaultState() : biome.topBlock; + IBlockState filler = isExceptionBiome(biome) ? Blocks.DIRT.getDefaultState() : biome.fillerBlock; + + if (state.getBlock() == Blocks.STONE || state.getBlock() == top.getBlock() || state.getBlock() == filler.getBlock()) + { + if (y - 1 < 10) + { + data.setBlockState(x, y, z, FLOWING_LAVA); + } + else + { + data.setBlockState(x, y, z, AIR); + + if (foundTop && data.getBlockState(x, y - 1, z).getBlock() == filler.getBlock()) + { + data.setBlockState(x, y - 1, z, top.getBlock().getDefaultState()); + } + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/WorldGenBlob.java b/src/api/java/rtg/world/gen/feature/WorldGenBlob.java new file mode 100644 index 00000000..597bcce7 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenBlob.java @@ -0,0 +1,180 @@ +package rtg.world.gen.feature; + +import java.util.Random; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.BoulderUtil; +import rtg.util.RandomUtil; + + +public class WorldGenBlob extends WorldGenerator { + + protected boolean water; + protected BoulderUtil boulderUtil; + private IBlockState blobBlock; + private int blobSize; + private boolean booShouldGenerate; + + public WorldGenBlob(IBlockState b, int s, Random rand) { + + super(false); + this.blobBlock = b; + this.blobSize = s; + booShouldGenerate = true; + this.water = true; + this.boulderUtil = new BoulderUtil(); + + if (blobBlock == Blocks.MOSSY_COBBLESTONE.getDefaultState() || blobBlock == Blocks.COBBLESTONE.getDefaultState()) { + if (!ConfigRTG.enableCobblestoneBoulders) { + booShouldGenerate = false; + } + else { + if (!shouldGenerateCobblestoneBoulder(rand)) { + booShouldGenerate = false; + } + } + } + } + + public WorldGenBlob(IBlockState b, int s, Random rand, boolean water) { + + this(b, s, rand); + this.water = water; + } + + public static boolean shouldGenerateCobblestoneBoulder(Random rand) { + + int chance = ConfigRTG.cobblestoneBoulderChance; + chance = (chance < 1) ? 1 : ((chance > 100) ? 100 : chance); + + int random = RandomUtil.getRandomInt(rand, 1, chance); + + boolean booGenerate = (random == 1) ? true : false; + + //Logger.info("Random = %d; Generate? = %b", random, booGenerate); + + return booGenerate; + } + + public void generate(World world, Random rand, int x, int y, int z, boolean honourConfig) { + + if (honourConfig) { + booShouldGenerate = true; + + if (!ConfigRTG.enableCobblestoneBoulders) { + booShouldGenerate = false; + } + else { + if (!shouldGenerateCobblestoneBoulder(rand)) { + booShouldGenerate = false; + } + } + } + + generate(world, rand, new BlockPos(x, y, z)); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + if (!booShouldGenerate) { + return false; + } + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + IBlockState boulderBlock = this.boulderUtil.getBoulderBlock(this.blobBlock, x, y, z); + + while (true) { + if (y > 3) { + label63: + { + if (!world.isAirBlock(new BlockPos(x, y - 1, z))) { + IBlockState block = world.getBlockState(new BlockPos(x, y - 1, z)); + + // Water check. + if (!this.water) { + + if (block.getMaterial() == Material.WATER) { + return false; + } + if (world.getBlockState(new BlockPos(x, y - 1, z - 1)).getMaterial() == Material.WATER) { + return false; + } + if (world.getBlockState(new BlockPos(x, y - 1, z + 1)).getMaterial() == Material.WATER) { + return false; + } + if (world.getBlockState(new BlockPos(x - 1, y - 1, z)).getMaterial() == Material.WATER) { + return false; + } + if (world.getBlockState(new BlockPos(x - 1, y - 1, z - 1)).getMaterial() == Material.WATER) { + return false; + } + if (world.getBlockState(new BlockPos(x - 1, y - 1, z + 1)).getMaterial() == Material.WATER) { + return false; + } + if (world.getBlockState(new BlockPos(x + 1, y - 1, z)).getMaterial() == Material.WATER) { + return false; + } + if (world.getBlockState(new BlockPos(x + 1, y - 1, z - 1)).getMaterial() == Material.WATER) { + return false; + } + if (world.getBlockState(new BlockPos(x + 1, y - 1, z + 1)).getMaterial() == Material.WATER) { + return false; + } + } + + if (block == Blocks.GRASS.getDefaultState() || block == Blocks.DIRT.getDefaultState() || block == Blocks.STONE.getDefaultState() || block == Blocks.GRAVEL.getDefaultState() || block == Blocks.SAND.getDefaultState()) { + break label63; + } + } + + --y; + continue; + } + } + + if (y <= 3) { + return false; + } + + int k2 = this.blobSize; + + for (int l = 0; k2 >= 0 && l < 3; ++l) { + int i1 = k2 + rand.nextInt(2); + int j1 = k2 + rand.nextInt(2); + int k1 = k2 + rand.nextInt(2); + float f = (float) (i1 + j1 + k1) * 0.333F + 0.5F; + + for (int l1 = x - i1; l1 <= x + i1; ++l1) { + for (int i2 = z - k1; i2 <= z + k1; ++i2) { + for (int j2 = y - j1; j2 <= y + j1; ++j2) { + float f1 = (float) (l1 - x); + float f2 = (float) (i2 - z); + float f3 = (float) (j2 - y); + + if (f1 * f1 + f2 * f2 + f3 * f3 <= f * f) { + world.setBlockState(new BlockPos(l1, j2, i2), boulderBlock, 2); + } + } + } + } + + x += -(k2 + 1) + rand.nextInt(2 + k2 * 2); + z += -(k2 + 1) + rand.nextInt(2 + k2 * 2); + y += 0 - rand.nextInt(2); + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/WorldGenBlock.java b/src/api/java/rtg/world/gen/feature/WorldGenBlock.java new file mode 100644 index 00000000..02a11ca2 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenBlock.java @@ -0,0 +1,82 @@ +package rtg.world.gen.feature; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class WorldGenBlock extends WorldGenerator { + + protected IBlockState placeBlock; + protected IBlockState replaceBlock; + protected IBlockState adjacentBlock; + protected int minAdjacents; + + public WorldGenBlock(IBlockState placeBlock, IBlockState replaceBlock, IBlockState adjacentBlock, int minAdjacents) { + + super(false); + + this.placeBlock = placeBlock; + this.replaceBlock = replaceBlock; + this.adjacentBlock = adjacentBlock; + this.minAdjacents = minAdjacents; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + IBlockState targetBlock = world.getBlockState(new BlockPos(x, y, z)); + + if (targetBlock != replaceBlock) { + //Logger.debug("Target block (%s) does not equal Replace block (%s)", targetBlock.getLocalizedName(), replaceBlock.getLocalizedName()); + return false; + } + + if (!isAdjacent(world, x, y, z)) { + //Logger.debug("Target block (%s) is not adjacent to %s", targetBlock.getLocalizedName(), this.adjacentBlock.getLocalizedName()); + return false; + } + + world.setBlockState(new BlockPos(x, y, z), placeBlock, 2); + + //Logger.debug("COBWEB at %d, %d, %d !!!", x, y, z); + + return true; + } + + protected boolean isAdjacent(World world, int x, int y, int z) { + + int adjacentCount = 0; + + if (world.getBlockState(new BlockPos(x + 1, y, z)) == this.adjacentBlock) { + adjacentCount++; + } + + if (world.getBlockState(new BlockPos(x - 1, y, z)) == this.adjacentBlock) { + adjacentCount++; + } + + if (world.getBlockState(new BlockPos(x, y + 1, z)) == this.adjacentBlock) { + adjacentCount++; + } + + if (world.getBlockState(new BlockPos(x, y - 1, z)) == this.adjacentBlock) { + adjacentCount++; + } + + if (world.getBlockState(new BlockPos(x, y, z + 1)) == this.adjacentBlock) { + adjacentCount++; + } + + if (world.getBlockState(new BlockPos(x, y, z - 1)) == this.adjacentBlock) { + adjacentCount++; + } + + return (adjacentCount > 0 && adjacentCount >= this.minAdjacents); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/WorldGenCacti.java b/src/api/java/rtg/world/gen/feature/WorldGenCacti.java new file mode 100644 index 00000000..faa85b65 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenCacti.java @@ -0,0 +1,66 @@ +package rtg.world.gen.feature; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class WorldGenCacti extends WorldGenerator { + + private boolean sand; + private int eHeight; + private IBlockState soilBlock; + + public WorldGenCacti(boolean sandOnly) { + + this(sandOnly, 0); + } + + public WorldGenCacti(boolean sandOnly, int extraHeight) { + + this(sandOnly, extraHeight, Blocks.SAND.getDefaultState()); + } + + public WorldGenCacti(boolean sandOnly, int extraHeight, IBlockState soilBlock) { + + sand = sandOnly; + eHeight = extraHeight; + this.soilBlock = soilBlock; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + IBlockState b; + //for (int l = 0; l < 10; ++l) + { + int i1 = x;// + rand.nextInt(8) - rand.nextInt(8); + int j1 = y + rand.nextInt(4) - rand.nextInt(4); + int k1 = z;// + rand.nextInt(8) - rand.nextInt(8); + + if (world.isAirBlock(new BlockPos(i1, j1, k1))) { + b = world.getBlockState(new BlockPos(i1, j1 - 1, k1)); + if (b == this.soilBlock || (!sand && (b == Blocks.GRASS.getDefaultState() || b == Blocks.DIRT.getDefaultState()))) { + int l1 = 1 + rand.nextInt(rand.nextInt(3) + 1); + if (b == Blocks.GRASS.getDefaultState() || b == Blocks.DIRT.getDefaultState()) { + world.setBlockState(new BlockPos(i1, j1 - 1, k1), this.soilBlock, 2); + } + + for (int i2 = 0; i2 < l1 + eHeight; ++i2) { + if (Blocks.CACTUS.canBlockStay(world, new BlockPos(i1, j1 + i2, k1))) { + world.setBlockState(new BlockPos(i1, j1 + i2, k1), Blocks.CACTUS.getDefaultState(), 2); + } + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/WorldGenCrops.java b/src/api/java/rtg/world/gen/feature/WorldGenCrops.java new file mode 100644 index 00000000..5be4f998 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenCrops.java @@ -0,0 +1,81 @@ +package rtg.world.gen.feature; + +import javax.annotation.ParametersAreNonnullByDefault; +import java.util.Random; + +import net.minecraft.block.*; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class WorldGenCrops extends WorldGenerator { + + private Block farmType; + private int farmSize; + private int farmDensity; + private int farmHeight; + + + /* + * 0 = potatoes, 1 = carrots, 2 = beetroot, 3 = wheat + */ + public WorldGenCrops(int type, int size, int density, int height) { + + farmType = type == 0 ? Blocks.POTATOES : type == 1 ? Blocks.CARROTS : type == 2 ? Blocks.BEETROOTS : Blocks.WHEAT; + farmSize = size; + farmDensity = density; + farmHeight = height; + } + + @ParametersAreNonnullByDefault + public boolean generate(World world, Random rand, BlockPos blockPos) { + + return this.generate(world, rand, blockPos.getX(), blockPos.getY(), blockPos.getZ()); + } + + public boolean generate(World world, Random rand, int x, int y, int z) { + + IBlockState b; + while (y > 0) { + b = world.getBlockState(new BlockPos(x, y, z)); + if (!world.isAirBlock(new BlockPos(x, y, z)) || b.getBlock().isLeaves(b, world, new BlockPos(x, y, z))) { + break; + } + y--; + } + + b = world.getBlockState(new BlockPos(x, y, z)); + if (b.getBlock() != Blocks.GRASS && b.getBlock() != Blocks.DIRT) { + return false; + } + + for (int j = 0; j < 4; j++) { + b = world.getBlockState(new BlockPos(j == 0 ? x - 1 : j == 1 ? x + 1 : x, y, j == 2 ? z - 1 : j == 3 ? z + 1 : z)); + if (b.getMaterial() != Material.GROUND && b.getMaterial() != Material.GRASS) { + return false; + } + } + + int maxGrowth = ((BlockCrops) farmType).getMaxAge() + 1; + + int rx, ry, rz; + for (int i = 0; i < farmDensity; i++) { + rx = rand.nextInt(farmSize) - 2; + ry = rand.nextInt(farmHeight) - 1; + rz = rand.nextInt(farmSize) - 2; + b = world.getBlockState(new BlockPos(x + rx, y + ry, z + rz)); + + if ((b.getBlock() == Blocks.GRASS || b.getBlock() == Blocks.DIRT) && world.isAirBlock(new BlockPos(x + rx, y + ry + 1, z + rz))) { + world.setBlockState(new BlockPos(x + rx, y + ry, z + rz), Blocks.FARMLAND.getDefaultState().withProperty(BlockFarmland.MOISTURE,rand.nextInt(8))); + world.setBlockState(new BlockPos(x + rx, y +ry + 1, z + rz), ((BlockCrops) farmType).withAge(rand.nextInt(maxGrowth))); + } + } + + world.setBlockState(new BlockPos(x, y, z), Blocks.WATER.getDefaultState()); + return true; + } +} diff --git a/src/api/java/rtg/world/gen/feature/WorldGenFlowersRTG.java b/src/api/java/rtg/world/gen/feature/WorldGenFlowersRTG.java new file mode 100644 index 00000000..d3648e9b --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenFlowersRTG.java @@ -0,0 +1,111 @@ +package rtg.world.gen.feature; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import rtg.util.BlockUtil; +import rtg.util.WorldUtil; + +public class WorldGenFlowersRTG extends WorldGenerator { + + private int[] flowers; + + /* + * FLOWER LIST: + * 0 Poppy + * 1 Blue Orchid + * 2 Allium + * 3 Azure Bluet + * 4 Red Tulip + * 5 Orange Tulip + * 6 White Tulip + * 7 Pink Tulip + * 8 Oxeye Daisy + * 9 Yellow Flower + * 10 Sunflower + * 11 Lilac + * 12 Double Tallgrass + * 13 Large Fern + * 14 Rose Bush + * 15 Peony + */ + public WorldGenFlowersRTG(int[] f) { + + flowers = f; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + int randomFlower = flowers[rand.nextInt(flowers.length)]; + + if (randomFlower > 9) { + //for (int l = 0; l < 64; ++l) + { + int i1 = x;// + rand.nextInt(8) - rand.nextInt(8); + int j1 = y;// + rand.nextInt(4) - rand.nextInt(4); + int k1 = z;// + rand.nextInt(8) - rand.nextInt(8); + + IBlockState doublePlant = BlockUtil.getStateFlower(randomFlower); + BlockPos doublePlantPos = new BlockPos(i1, j1, k1); + WorldUtil worldUtil = new WorldUtil(world); + + if (world.isAirBlock(doublePlantPos) + && (!world.provider.getHasNoSky() || j1 < 254) + && Blocks.DOUBLE_PLANT.canPlaceBlockAt(world, doublePlantPos)) { + + worldUtil.setDoublePlant(doublePlantPos, doublePlant); + } + } + } + else if (randomFlower == 9) { + //for (int l = 0; l < 64; ++l) + { + int i1 = x;// + rand.nextInt(8) - rand.nextInt(8); + int j1 = y;// + rand.nextInt(4) - rand.nextInt(4); + int k1 = z;// + rand.nextInt(8) - rand.nextInt(8); + + IBlockState flower = BlockUtil.getStateFlower(randomFlower); + BlockPos flowerPos = new BlockPos(i1, j1, k1); + + if (world.isAirBlock(flowerPos) + && (!world.provider.getHasNoSky() || j1 < 254) + && Blocks.YELLOW_FLOWER.canPlaceBlockAt(world, flowerPos) + && Blocks.YELLOW_FLOWER.canBlockStay(world, flowerPos, flower)) { + + world.setBlockState(flowerPos, flower, 2); + } + } + } + else { + //for (int l = 0; l < 64; ++l) + { + int i1 = x;// + rand.nextInt(8) - rand.nextInt(8); + int j1 = y;// + rand.nextInt(4) - rand.nextInt(4); + int k1 = z;// + rand.nextInt(8) - rand.nextInt(8); + + IBlockState flower = BlockUtil.getStateFlower(randomFlower); + BlockPos flowerPos = new BlockPos(i1, j1, k1); + + if (world.isAirBlock(flowerPos) + && (!world.provider.getHasNoSky() || j1 < 254) + && Blocks.RED_FLOWER.canPlaceBlockAt(world, flowerPos) + && Blocks.RED_FLOWER.canBlockStay(world, flowerPos, flower)) { + + world.setBlockState(flowerPos, flower, 2); + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/WorldGenGrass.java b/src/api/java/rtg/world/gen/feature/WorldGenGrass.java new file mode 100644 index 00000000..2662b759 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenGrass.java @@ -0,0 +1,129 @@ +package rtg.world.gen.feature; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class WorldGenGrass extends WorldGenerator { + + private IBlockState block; + private int metadata; + + public WorldGenGrass(IBlockState b, int m) { + + block = b.getBlock().getStateFromMeta(m); + metadata = m; + } + + protected IBlockState block() { + + return block; + } + + protected int metadata() { + + return metadata; + } + + protected void setBlock(Random random) { + + }// nothing needed + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + while (y > 0) { + if (!world.isAirBlock(new BlockPos(x, y, z)) || world.getBlockState(new BlockPos(x, y, z)).getBlock().isLeaves(world.getBlockState(new BlockPos(x, y, z)), world, new BlockPos(x, y, z))) { + break; + } + y--; + } + + setBlock(rand); + if (block() == Blocks.DOUBLE_PLANT.getStateFromMeta(metadata)) { + //for (int l = 0; l < 64; ++l) + { + int i1 = x;// + rand.nextInt(8) - rand.nextInt(8); + int j1 = y + rand.nextInt(4) - rand.nextInt(4); + int k1 = z;// + rand.nextInt(8) - rand.nextInt(8); + + if (world.isAirBlock(new BlockPos(i1, j1, k1)) && j1 < 254 && Blocks.DOUBLE_PLANT.canBlockStay(world, new BlockPos(i1, j1, k1), Blocks.DOUBLE_PLANT.getDefaultState())) { + world.setBlockState(new BlockPos(i1, j1, k1), Blocks.DOUBLE_PLANT.getStateFromMeta(metadata)); + } + } + } + else if (block() == Blocks.LEAVES) { + //for (int l = 0; l < 64; ++l) + { + int i1 = x;// + rand.nextInt(8) - rand.nextInt(8); + int j1 = y + rand.nextInt(4) - rand.nextInt(4); + int k1 = z;// + rand.nextInt(8) - rand.nextInt(8); + + if (world.isAirBlock(new BlockPos(i1, j1, k1)) && world.getBlockState(new BlockPos(i1, j1 - 1, k1)).getBlock() == Blocks.GRASS) { + world.setBlockState(new BlockPos(i1, j1, k1), block.getBlock().getStateFromMeta(metadata), 0); + } + } + } + else { + //for (int l = 0; l < 128; ++l) + { + int i1 = x;// + rand.nextInt(8) - rand.nextInt(8); + int j1 = y + rand.nextInt(4) - rand.nextInt(4); + int k1 = z;// + rand.nextInt(8) - rand.nextInt(8); + + if (world.isAirBlock(new BlockPos(i1, j1, k1)) && block.getBlock().canPlaceBlockAt(world, new BlockPos(i1, j1, k1))) { + world.setBlockState(new BlockPos(i1, j1, k1), block.getBlock().getStateFromMeta(metadata), 0); + } + } + } + return true; + } + + public static class SingleType extends WorldGenGrass { + + public SingleType(IBlockState b, int m) { + + super(b, m); + } + } + + public static class RandomType extends WorldGenGrass { + + private final IBlockState[] blocks; + private final byte[] metas; + private int index;// if it gets called without being set there's a bug in passing + + public RandomType(IBlockState[] b, byte[] m) { + + super(b[0], (int) m[0]);// temporary fake cal + blocks = b; + metas = m; + } + + @Override + protected IBlockState block() { + + return blocks[index]; + } + + @Override + protected int metadata() { + + return metas[index]; + } + + @Override + protected void setBlock(Random rand) { + + index = rand.nextInt(blocks.length); + } + + } +} diff --git a/src/api/java/rtg/world/gen/feature/WorldGenJungleCacti.java b/src/api/java/rtg/world/gen/feature/WorldGenJungleCacti.java new file mode 100644 index 00000000..072e1d27 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenJungleCacti.java @@ -0,0 +1,57 @@ +package rtg.world.gen.feature; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import rtg.util.BlockUtil; + +public class WorldGenJungleCacti extends WorldGenerator { + + private boolean sand; + private byte sandByte; + private int eHeight; + + public WorldGenJungleCacti(boolean sandOnly, int extraHeight, byte sandMeta) { + + sand = sandOnly; + eHeight = extraHeight; + sandByte = sandMeta; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + IBlockState b; + for (int l = 0; l < 10; ++l) { + int i1 = x + rand.nextInt(8) - rand.nextInt(8); + int j1 = y + rand.nextInt(4) - rand.nextInt(4); + int k1 = z + rand.nextInt(8) - rand.nextInt(8); + + if (world.isAirBlock(new BlockPos(i1, j1, k1))) { + b = world.getBlockState(new BlockPos(i1, j1 - 1, k1)); + if (b == Blocks.SAND.getDefaultState() || (!sand && (b == Blocks.GRASS.getDefaultState() || b == Blocks.DIRT.getDefaultState()))) { + int l1 = 1 + rand.nextInt(rand.nextInt(3) + 1); + if (b == Blocks.GRASS.getDefaultState() || b == Blocks.DIRT.getDefaultState()) { + world.setBlockState(new BlockPos(i1, j1 - 1, k1), BlockUtil.getStateSand(sandByte), 2); + } + + for (int i2 = 0; i2 < l1 + eHeight; ++i2) { + if (Blocks.CACTUS.canBlockStay(world, new BlockPos(i1, j1 + i2, k1))) { + world.setBlockState(new BlockPos(i1, j1 + i2, k1), Blocks.CACTUS.getDefaultState(), 2); + } + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/WorldGenJungleCane.java b/src/api/java/rtg/world/gen/feature/WorldGenJungleCane.java new file mode 100644 index 00000000..16d99b26 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenJungleCane.java @@ -0,0 +1,72 @@ +package rtg.world.gen.feature; + +import java.util.Random; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class WorldGenJungleCane extends WorldGenerator { + + private int height; + + public WorldGenJungleCane(int h) { + + height = h; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + IBlockState b; + while (y > 0) { + b = world.getBlockState(new BlockPos(x, y, z)); + if (!world.isAirBlock(new BlockPos(x, y, z)) || b.getBlock().isLeaves(b, world, new BlockPos(x, y, z))) { + break; + } + y--; + } + + b = world.getBlockState(new BlockPos(x, y, z)); + if (b != Blocks.GRASS.getDefaultState() && b != Blocks.DIRT.getDefaultState()) { + return false; + } + + int j, sx, sz, ra; + for (j = 0; j < 4; j++) { + b = world.getBlockState(new BlockPos(j == 0 ? x - 1 : j == 1 ? x + 1 : x, y, j == 2 ? z - 1 : j == 3 ? z + 1 : z)); + if (b.getMaterial() != Material.GROUND && b.getMaterial() != Material.GRASS) { + return false; + } + } + + for (j = 0; j < 4; j++) { + sx = j == 0 ? x - 1 : j == 1 ? x + 1 : x; + sz = j == 2 ? z - 1 : j == 3 ? z + 1 : z; + ra = rand.nextInt(height * 2 + 1) + height; + + b = world.getBlockState(new BlockPos(sx, y + 1, sz)); + if (b.getMaterial() == Material.AIR || b.getMaterial() == Material.VINE) { + for (int k = 0; k < ra; k++) { + b = world.getBlockState(new BlockPos(sx, y + 1 + k, sz)); + if (b.getMaterial() == Material.AIR || b.getMaterial() == Material.VINE) { + world.setBlockState(new BlockPos(sx, y + 1 + k, sz), Blocks.REEDS.getDefaultState(), 2); + } + else { + break; + } + } + } + } + + world.setBlockState(new BlockPos(x, y, z), Blocks.WATER.getDefaultState()); + + return true; + } +} diff --git a/src/api/java/rtg/world/gen/feature/WorldGenLayers.java b/src/api/java/rtg/world/gen/feature/WorldGenLayers.java new file mode 100644 index 00000000..7da26498 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenLayers.java @@ -0,0 +1,97 @@ +package rtg.world.gen.feature; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.block.BlockDirt; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + + +public class WorldGenLayers extends WorldGenerator { + + private IBlockState layerBlock; + private PropertyInteger layerProperty; + private int dropHeight; // The height (in blocks from y) from which we'll start trying to 'drop' layers on to the ground. + private int layerRange; + private int scatter; + private ArrayList validGroundBlocks; + + public WorldGenLayers(IBlockState block, PropertyInteger prop, int dropHeight, int range, int scatter) { + + super(false); + + this.layerBlock = block; + this.layerProperty = prop; + this.dropHeight = dropHeight; + this.layerRange = range; + this.scatter = scatter < 1 ? 1 : scatter; + + this.validGroundBlocks = new ArrayList(Arrays.asList( + Blocks.GRASS.getDefaultState(), + Blocks.DIRT.getDefaultState(), + Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.PODZOL), + Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT) + )); + } + + public WorldGenLayers(IBlockState block, PropertyInteger prop, int dropHeight, int range, int scatter, ArrayList validGroundBlocks) { + + this(block, prop, dropHeight, range, scatter); + + this.validGroundBlocks = validGroundBlocks; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + BlockPos.MutableBlockPos blockpos = new BlockPos.MutableBlockPos(); + + for (int x = pos.getX() - this.layerRange; x <= pos.getX() + this.layerRange; ++x) { + for (int z = pos.getZ() - this.layerRange; z <= pos.getZ() + this.layerRange; ++z) { + blockpos.setPos(x, pos.getY() + dropHeight, z); + + if (!world.isAirBlock(blockpos)) { + continue; + } + + blockpos.move(EnumFacing.DOWN); + + while (blockpos.getY() > 0 && world.isAirBlock(blockpos)) { + blockpos.move(EnumFacing.DOWN); + } + + blockpos.move(EnumFacing.UP); + + IBlockState state; + if (this.layerBlock.getBlock().canPlaceBlockAt(world, blockpos) && rand.nextInt(this.scatter) == 0) { + + state = world.getBlockState(new BlockPos(blockpos.getX(), blockpos.getY() - 1, blockpos.getZ())); + + if (this.validGroundBlocks.contains(state)) { + setBlockAndNotifyAdequately(world, blockpos, this.layerBlock); + } + } + else { + + blockpos.move(EnumFacing.DOWN); + state = world.getBlockState(new BlockPos(blockpos)); + + if (state.getBlock() == this.layerBlock.getBlock()) { + int layers = state.getValue(this.layerProperty).intValue(); + + setBlockAndNotifyAdequately(world, blockpos, layerBlock.withProperty(this.layerProperty, (layers & 7) + 1)); + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/WorldGenLog.java b/src/api/java/rtg/world/gen/feature/WorldGenLog.java new file mode 100644 index 00000000..81044db3 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenLog.java @@ -0,0 +1,169 @@ +package rtg.world.gen.feature; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.block.BlockLog; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import rtg.util.WorldUtil; + +public class WorldGenLog extends WorldGenerator { + + private IBlockState logBlock; + private IBlockState leavesBlock; + private int logLength; + private boolean generateLeaves; + + /** + * @param logBlock + * @param leavesBlock + * @param logLength + */ + public WorldGenLog(IBlockState logBlock, IBlockState leavesBlock, int logLength) { + + this.logBlock = logBlock; + this.leavesBlock = leavesBlock; + this.logLength = logLength; + + this.generateLeaves = false; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + return this.generate(world, rand, pos.getX(), pos.getY(), pos.getZ()); + } + + public boolean generate(World world, Random rand, int x, int y, int z) { + + IBlockState g = world.getBlockState(new BlockPos(x, y - 1, z)); + if (g.getMaterial() != Material.GROUND && g.getMaterial() != Material.GRASS && g.getMaterial() != Material.SAND && g.getMaterial() != Material.ROCK) { + return false; + } + + WorldUtil worldUtil = new WorldUtil(world); + int dir = rand.nextInt(2); // The direction of the log (0 = X; 1 = Z) + int i; + IBlockState b; + int air = 0; + + ArrayList aX = new ArrayList(); + ArrayList aY = new ArrayList(); + ArrayList aZ = new ArrayList(); + ArrayList aBlock = new ArrayList(); + for (i = 0; i < logLength; i++) { + b = world.getBlockState(new BlockPos(x - (dir == 0 ? 1 : 0), y, z - (dir == 1 ? 1 : 0))); + if (b.getMaterial() != Material.AIR && b.getMaterial() != Material.VINE && b.getMaterial() != Material.PLANTS) { + break; + } + + x -= dir == 0 ? 1 : 0; + z -= dir == 1 ? 1 : 0; + + if (airCheck(world, rand, x, y, z) > 0) { + return false; + } + } + + for (i = 0; i < logLength * 2; i++) { + b = world.getBlockState(new BlockPos(x + (dir == 0 ? 1 : 0), y, z + (dir == 1 ? 1 : 0))); + if (b.getMaterial() != Material.AIR && b.getMaterial() != Material.VINE && b.getMaterial() != Material.PLANTS) { + break; + } + + air += airCheck(world, rand, x, y, z); + if (air > 2) { + return false; + } + + /** + * Before we place the log block, let's make sure that there's an air block immediately above it. + * This is to ensure that the log doesn't override, for example, a 2-block tall plant, + * which some mods (like WAILA) have trouble handling. + * + * Also, to ensure that we don't have 'broken' logs, if one log block fails the check, + * then no logs actually get placed. + */ + if (!worldUtil.isBlockAbove(Blocks.AIR.getDefaultState(), 1, world, x, y, z, true)) { + //Logger.debug("Found non-air block above log at %d %d %d", x, y, z); + return false; + } + + // Store the log information instead of placing it straight away. + aX.add(x); + aY.add(y); + aZ.add(z); + + // If we can't rotate the log block for whatever reason, then just place it as it is. + try { + aBlock.add(logBlock.withProperty(BlockLog.LOG_AXIS, (dir == 0 ? BlockLog.EnumAxis.X : BlockLog.EnumAxis.Z))); + } + catch (Exception e) { + aBlock.add(logBlock); + } + + if (this.generateLeaves) { + addLeaves(world, rand, dir, x, y, z); + } + + x += dir == 0 ? 1 : 0; + z += dir == 1 ? 1 : 0; + } + + for (int i1 = 0; i1 < aBlock.size(); i1++) { + world.setBlockState(new BlockPos(aX.get(i1).intValue(), aY.get(i1).intValue(), aZ.get(i1).intValue()), aBlock.get(i1), 2); + } + + return true; + } + + private int airCheck(World world, Random rand, int x, int y, int z) { + + IBlockState b = world.getBlockState(new BlockPos(x, y - 1, z)); + if (b.getMaterial() == Material.AIR || b.getMaterial() == Material.VINE || b.getMaterial() == Material.WATER || b.getMaterial() == Material.PLANTS) { + b = world.getBlockState(new BlockPos(x, y - 2, z)); + if (b.getMaterial() == Material.AIR || b.getMaterial() == Material.VINE || b.getMaterial() == Material.WATER || b.getMaterial() == Material.PLANTS) { + return 99; + } + return 1; + } + + return 0; + } + + private void addLeaves(World world, Random rand, int dir, int x, int y, int z) { + + IBlockState b; + if (dir == 0) { + b = world.getBlockState(new BlockPos(x, y, z - 1)); + if ((b.getMaterial() == Material.AIR || b.getMaterial() == Material.VINE || b.getMaterial() == Material.PLANTS) && rand.nextInt(3) == 0) { + world.setBlockState(new BlockPos(x, y, z - 1), leavesBlock, 2); + } + b = world.getBlockState(new BlockPos(x, y, z + 1)); + if ((b.getMaterial() == Material.AIR || b.getMaterial() == Material.VINE || b.getMaterial() == Material.PLANTS) && rand.nextInt(3) == 0) { + world.setBlockState(new BlockPos(x, y, z + 1), leavesBlock, 2); + } + } + else { + b = world.getBlockState(new BlockPos(x - 1, y, z)); + if ((b.getMaterial() == Material.AIR || b.getMaterial() == Material.VINE || b.getMaterial() == Material.PLANTS) && rand.nextInt(3) == 0) { + world.setBlockState(new BlockPos(x - 1, y, z), leavesBlock, 2); + } + b = world.getBlockState(new BlockPos(x + 1, y, z)); + if ((b.getMaterial() == Material.AIR || b.getMaterial() == Material.VINE || b.getMaterial() == Material.PLANTS) && rand.nextInt(3) == 0) { + world.setBlockState(new BlockPos(x + 1, y, z), leavesBlock, 2); + } + } + + b = world.getBlockState(new BlockPos(x, y + 1, z)); + if ((b.getMaterial() == Material.AIR || b.getMaterial() == Material.VINE || b.getMaterial() == Material.PLANTS) && rand.nextInt(3) == 0) { + world.setBlockState(new BlockPos(x, y + 1, z), leavesBlock, 2); + } + } +} diff --git a/src/api/java/rtg/world/gen/feature/WorldGenPlantBlock.java b/src/api/java/rtg/world/gen/feature/WorldGenPlantBlock.java new file mode 100644 index 00000000..573f5020 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenPlantBlock.java @@ -0,0 +1,50 @@ +package rtg.world.gen.feature; + +/** + * @author Zeno410 + */ + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class WorldGenPlantBlock extends WorldGenerator { + + private IBlockState soilBlock; + private IBlockState plantBlock; + + public WorldGenPlantBlock(IBlockState plantBlock) { + + this.plantBlock = plantBlock; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + IBlockState b; + //for (int l = 0; l < 10; ++l) + { + int i1 = x;// + rand.nextInt(8) - rand.nextInt(8); + int j1 = y + rand.nextInt(4) - rand.nextInt(4); + int k1 = z;// + rand.nextInt(8) - rand.nextInt(8); + + if (world.isAirBlock(new BlockPos(i1, j1, k1)) || world.getBlockState(new BlockPos(x, y, z)).getBlock().isLeaves(world.getBlockState(new BlockPos(x, y, z)), world, new BlockPos(x, y, z))) { + b = world.getBlockState(new BlockPos(i1, j1 - 1, k1)); + if (b == Blocks.GRASS.getDefaultState() || b == Blocks.DIRT.getDefaultState()) { + if (plantBlock.getBlock().canPlaceBlockAt(world, new BlockPos(i1, j1, k1))) { + world.setBlockState(new BlockPos(i1, j1, k1), plantBlock, 2); + } + } + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/WorldGenPond.java b/src/api/java/rtg/world/gen/feature/WorldGenPond.java new file mode 100644 index 00000000..a3bd7e83 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenPond.java @@ -0,0 +1,318 @@ +package rtg.world.gen.feature; + +import java.util.Random; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.feature.WorldGenerator; + +/** + * @author Zeno410 + */ +public class WorldGenPond extends WorldGenerator { + + private IBlockState fill; + + /** + * @param fill + */ + public WorldGenPond(IBlockState fill) { + + this.fill = fill; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + x -= 8; + + for (z -= 8; y > 5 && world.isAirBlock(new BlockPos(x, y, z)); --y) { + ; + } + + if (y <= 4) { + return false; + } + else { + y -= 4; + boolean[] aboolean = new boolean[2048]; + int l = rand.nextInt(4) + 4; + int i1; + + for (i1 = 0; i1 < l; ++i1) { + double d0 = rand.nextDouble() * 6.0D + 3.0D; + double d1 = rand.nextDouble() * 4.0D + 2.0D; + double d2 = rand.nextDouble() * 6.0D + 3.0D; + double d3 = rand.nextDouble() * (16.0D - d0 - 2.0D) + 1.0D + d0 / 2.0D; + double d4 = rand.nextDouble() * (8.0D - d1 - 4.0D) + 2.0D + d1 / 2.0D; + double d5 = rand.nextDouble() * (16.0D - d2 - 2.0D) + 1.0D + d2 / 2.0D; + + for (int k1 = 1; k1 < 15; ++k1) { + for (int l1 = 1; l1 < 15; ++l1) { + for (int i2 = 1; i2 < 7; ++i2) { + double d6 = ((double) k1 - d3) / (d0 / 2.0D); + double d7 = ((double) i2 - d4) / (d1 / 2.0D); + double d8 = ((double) l1 - d5) / (d2 / 2.0D); + double d9 = d6 * d6 + d7 * d7 + d8 * d8; + + if (d9 < 1.0D) { + aboolean[(k1 * 16 + l1) * 8 + i2] = true; + } + } + } + } + } + + + int j1; + int j2; + boolean flag; + + // this algorithm can't put pond to the edge so we'll set all edges to not-pond + for (j1 = 0; j1 < 8; j1++) { + for (j2 = 0; j2 < 16; ++j2) { + i1 = 0; + aboolean[(i1 * 16 + j2) * 8 + j1] = false; + i1 = 15; + aboolean[(i1 * 16 + j2) * 8 + j1] = false; + } + for (i1 = 0; i1 < 16; ++i1) { + j2 = 0; + aboolean[(i1 * 16 + j2) * 8 + j1] = false; + j2 = 15; + aboolean[(i1 * 16 + j2) * 8 + j1] = false; + } + } + + // Zeno410 + // we're going to add some code to improve the sanity of the pond generation + // first let's make an array of what columns will be in the pond + + boolean[] willBePond = new boolean[256]; + + for (i1 = 1; i1 < 15; ++i1) { + for (j2 = 1; j2 < 15; ++j2) { + for (j1 = 0; j1 < 4; ++j1) //up to 4 because that becomes the material + { + if (aboolean[(i1 * 16 + j2) * 8 + j1]) { + willBePond[(i1 * 16 + j2)] = true; + } + } + } + } + + // now let's get the lake edges + boolean[] willBeShore = new boolean[256]; + + for (i1 = 1; i1 < 14; ++i1) { + for (j2 = 1; j2 < 14; ++j2) { + if (willBePond[(i1 * 16 + j2)]) { + continue; + } + if (j2 < 15 && willBePond[(i1 * 16 + j2 + 1)]) { + willBeShore[(i1 * 16 + j2)] = true; + } + if (j2 > 0 && willBePond[(i1 * 16 + j2 - 1)]) { + willBeShore[(i1 * 16 + j2)] = true; + } + if (i1 < 15 && willBePond[((i1 + 1) * 16 + j2)]) { + willBeShore[(i1 * 16 + j2)] = true; + } + if (i1 > 0 && willBePond[((i1 - 1) * 16 + j2)]) { + willBeShore[(i1 * 16 + j2)] = true; + } + } + } + + // now let's get the heights of the edges + int[] heightCounts = new int[257]; + int shoreBlockCount = 0; + for (i1 = 1; i1 < 15; ++i1) { + for (j2 = 1; j2 < 15; ++j2) { + if (willBeShore[(i1 * 16 + j2)]) { + int topHeight = world.getTopSolidOrLiquidBlock(new BlockPos(x + i1, 0, z + j2)).getY(); + if (topHeight < 1 || topHeight > 255) { + return false;//empty or too high column + } + heightCounts[topHeight] += 1; + shoreBlockCount++; + } + } + } + + // now get the median height and use for the lake level + // unless it's more than 1 above the lowest shore level; + int shoreSoFar = 0; + int lakeLevel = 0; + int bottomBlock = 257; + for (int height = 0; height < 257; height++) { + shoreSoFar += heightCounts[height]; + if (heightCounts[height] > 0) { + if (bottomBlock > height) { + bottomBlock = height; + } + } + if (shoreSoFar * 2 >= shoreBlockCount) { + lakeLevel = height; + //if (lakeLevel - bottomBlock > 2) return false; //it was going to be ugly + if (lakeLevel > bottomBlock) { + lakeLevel = bottomBlock; + } + continue; + } + } + + // set y to 3 below lake level so the top of the shore is the top of the lake level + y = lakeLevel - 4; + + //not if anything will be left floating + + for (i1 = 0; i1 < 16; ++i1) { + for (j2 = 0; j2 < 16; ++j2) { + if (willBePond[(i1 * 16 + j2)]) { + int top = world.getTopSolidOrLiquidBlock(new BlockPos(x + i1, 0, z + j2)).getY(); + if (top > lakeLevel + 4) { + return false; + } + } + } + } + + // make sure the shore is at lake level + for (i1 = 1; i1 < 15; ++i1) { + for (j2 = 1; j2 < 15; ++j2) { + if (willBeShore[(i1 * 16 + j2)]) { + int shoreHeight = world.getTopSolidOrLiquidBlock(new BlockPos(x + i1, 0, z + j2)).getY(); + if (shoreHeight < lakeLevel) { + Biome biomegenbase = world.getBiome(new BlockPos(x + i1, 0, z + j2)); + for (int height = shoreHeight; height < lakeLevel; height++) { + + + if (biomegenbase.topBlock == Blocks.MYCELIUM.getDefaultState()) { + world.setBlockState(new BlockPos(x + i1, height, z + j2), Blocks.MYCELIUM.getDefaultState(), 2); + } + else { + world.setBlockState(new BlockPos(x + i1, height, z + j2), Blocks.GRASS.getDefaultState(), 2); + } + } + } + } + } + } + + + for (i1 = 0; i1 < 16; ++i1) { + for (j2 = 0; j2 < 16; ++j2) { + for (j1 = 0; j1 < 8; ++j1) { + flag = !aboolean[(i1 * 16 + j2) * 8 + j1] && (i1 < 15 && aboolean[((i1 + 1) * 16 + j2) * 8 + j1] || i1 > 0 && aboolean[((i1 - 1) * 16 + j2) * 8 + j1] || j2 < 15 && aboolean[(i1 * 16 + j2 + 1) * 8 + j1] || j2 > 0 && aboolean[(i1 * 16 + (j2 - 1)) * 8 + j1] || j1 < 7 && aboolean[(i1 * 16 + j2) * 8 + j1 + 1] || j1 > 0 && aboolean[(i1 * 16 + j2) * 8 + (j1 - 1)]); + + if (flag) { + Material material = world.getBlockState(new BlockPos(x + i1, y + j1, z + j2)).getMaterial(); + + if (j1 >= 4 && material.isLiquid()) { + return false; + } + + if (j1 < 4 && !material.isSolid() && world.getBlockState(new BlockPos(x + i1, y + j1, z + j2)) != this.fill) { + return false; + } + } + } + } + } + + for (i1 = 0; i1 < 16; ++i1) { + for (j2 = 0; j2 < 16; ++j2) { + for (j1 = 0; j1 < 8; ++j1) { + if (j1 < 4) { + if (aboolean[(i1 * 16 + j2) * 8 + j1]) { + world.setBlockState(new BlockPos(x + i1, y + j1, z + j2), fill, 2); + } + } + else { + // air + if (willBePond[i1 * 16 + j2]) { + world.setBlockState(new BlockPos(x + i1, y + j1, z + j2), Blocks.AIR.getDefaultState(), 2); + } + } + + } + } + } + + for (i1 = 0; i1 < 16; ++i1) { + for (j2 = 0; j2 < 16; ++j2) { + for (j1 = 4; j1 < 8; ++j1) { + if (aboolean[(i1 * 16 + j2) * 8 + j1] && world.getBlockState(new BlockPos(x + i1, y + j1 - 1, z + j2)) == Blocks.DIRT.getDefaultState() && world.getLightFor(EnumSkyBlock.SKY, new BlockPos(x + i1, y + j1, z + j2)) > 0) { + Biome biomegenbase = world.getBiome(new BlockPos(x + i1, 0, z + j2)); + + if (biomegenbase.topBlock == Blocks.MYCELIUM.getDefaultState()) { + world.setBlockState(new BlockPos(x + i1, y + j1 - 1, z + j2), Blocks.MYCELIUM.getDefaultState(), 2); + } + else { + world.setBlockState(new BlockPos(x + i1, y + j1 - 1, z + j2), biomegenbase.topBlock, 2); + } + } + } + } + } + + if (this.fill.getMaterial() == Material.LAVA) { + for (i1 = 0; i1 < 16; ++i1) { + for (j2 = 0; j2 < 16; ++j2) { + for (j1 = 0; j1 < 8; ++j1) { + flag = !aboolean[(i1 * 16 + j2) * 8 + j1] && (i1 < 15 && aboolean[((i1 + 1) * 16 + j2) * 8 + j1] || i1 > 0 && aboolean[((i1 - 1) * 16 + j2) * 8 + j1] || j2 < 15 && aboolean[(i1 * 16 + j2 + 1) * 8 + j1] || j2 > 0 && aboolean[(i1 * 16 + (j2 - 1)) * 8 + j1] || j1 < 7 && aboolean[(i1 * 16 + j2) * 8 + j1 + 1] || j1 > 0 && aboolean[(i1 * 16 + j2) * 8 + (j1 - 1)]); + + if (flag && (j1 < 4 || rand.nextInt(2) != 0) && world.getBlockState(new BlockPos(x + i1, y + j1, z + j2)).getMaterial().isSolid()) { + world.setBlockState(new BlockPos(x + i1, y + j1, z + j2), Blocks.STONE.getDefaultState(), 2); + } + } + } + } + } + + if (this.fill.getMaterial() == Material.WATER) { + for (i1 = 0; i1 < 16; ++i1) { + for (j2 = 0; j2 < 16; ++j2) { + byte b0 = 4; + + if (world.canBlockFreezeWater(new BlockPos(x + i1, y + b0, z + j2))) { + world.setBlockState(new BlockPos(x + i1, y + b0, z + j2), Blocks.ICE.getDefaultState(), 2); + } + } + } + } + + // cut down shore above lake level + for (i1 = 1; i1 < 15; ++i1) { + for (j2 = 1; j2 < 15; ++j2) { + if (willBeShore[(i1 * 16 + j2)]) { + int shoreHeight = world.getTopSolidOrLiquidBlock(new BlockPos(x + i1, 0, z + j2)).getY(); + if (shoreHeight > lakeLevel) { + shoreHeight--; + Biome biomegenbase = world.getBiome(new BlockPos(x + i1, 0, z + j2)); + world.setBlockState(new BlockPos(x + i1, shoreHeight, z + j2), Blocks.AIR.getDefaultState(), 2); + shoreHeight--; + + if (biomegenbase.topBlock == Blocks.MYCELIUM.getDefaultState()) { + world.setBlockState(new BlockPos(x + i1, shoreHeight, z + j2), Blocks.MYCELIUM.getDefaultState(), 2); + } + else { + world.setBlockState(new BlockPos(x + i1, shoreHeight, z + j2), biomegenbase.topBlock, 2); + } + } + } + } + } + return true; + } + } +} diff --git a/src/api/java/rtg/world/gen/feature/WorldGenShrubRTG.java b/src/api/java/rtg/world/gen/feature/WorldGenShrubRTG.java new file mode 100644 index 00000000..d787ab3a --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenShrubRTG.java @@ -0,0 +1,100 @@ +package rtg.world.gen.feature; + +import java.util.Random; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import rtg.config.rtg.ConfigRTG; + +public class WorldGenShrubRTG extends WorldGenerator { + + private int varSize; + private IBlockState logBlock; + private IBlockState leaveBlock; + private boolean varSand; + + public WorldGenShrubRTG(int size, IBlockState log, IBlockState leav, boolean sand) { + + varSize = size; + varSand = sand; + + logBlock = log; + leaveBlock = leav; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + int width = varSize > 6 ? 6 : varSize; + int height = varSize > 3 ? 2 : 1; + + for (int i = 0; i < varSize; i++) { + int rX = rand.nextInt(width * 2) - width; + int rY = rand.nextInt(height); + int rZ = rand.nextInt(width * 2) - width; + + if (i == 0 && varSize > 4) { + buildLeaves(world, x + rX, y, z + rZ, 3); + } + else if (i == 1 && varSize > 2) { + buildLeaves(world, x + rX, y, z + rZ, 2); + } + else { + buildLeaves(world, x + rX, y + rY, z + rZ, 1); + } + } + return true; + } + + public void buildLeaves(World world, int x, int y, int z, int size) { + + IBlockState b = world.getBlockState(new BlockPos(x, y - 2, z)); + IBlockState b1 = world.getBlockState(new BlockPos(x, y - 1, z)); + + if ((b == Blocks.SAND.getDefaultState() || b1 == Blocks.SAND.getDefaultState()) && !ConfigRTG.allowTreesToGenerateOnSand) { + return; + } + + if (b.getMaterial() == Material.GRASS || b.getMaterial() == Material.GROUND || (varSand && b.getMaterial() == Material.SAND)) { + if (b1 != Blocks.WATER.getDefaultState()) { + if (!ConfigRTG.allowShrubsToGenerateBelowSurface) { + + if (b1.getMaterial() != Material.AIR && + b1.getMaterial() != Material.VINE && + b1.getMaterial() != Material.PLANTS && + b1 != Blocks.SNOW_LAYER.getDefaultState()) { + return; + } + } + + for (int i = -size; i <= size; i++) { + for (int j = -1; j <= 1; j++) { + for (int k = -size; k <= size; k++) { + if (Math.abs(i) + Math.abs(j) + Math.abs(k) <= size) { + buildBlock(world, x + i, y + j, z + k, leaveBlock); + } + } + } + } + world.setBlockState(new BlockPos(x, y - 1, z), logBlock, 0); + } + } + } + + public void buildBlock(World world, int x, int y, int z, IBlockState block) { + + IBlockState b = world.getBlockState(new BlockPos(x, y, z)); + if (b.getMaterial() == Material.AIR || b.getMaterial() == Material.VINE || b.getMaterial() == Material.PLANTS || b == Blocks.SNOW_LAYER) { + world.setBlockState(new BlockPos(x, y, z), block, 0); + } + } +} diff --git a/src/api/java/rtg/world/gen/feature/WorldGenVinesRTG.java b/src/api/java/rtg/world/gen/feature/WorldGenVinesRTG.java new file mode 100644 index 00000000..c9488851 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenVinesRTG.java @@ -0,0 +1,38 @@ +package rtg.world.gen.feature; + +import java.util.Random; + +import net.minecraft.block.BlockVine; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class WorldGenVinesRTG extends WorldGenerator { + + public boolean generate(World worldIn, Random rand, BlockPos position) { + + for (; position.getY() < 128; position = position.up()) { + if (worldIn.isAirBlock(position)) { + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL.facings()) { + if (Blocks.VINE.canPlaceBlockOnSide(worldIn, position, enumfacing)) { + IBlockState iblockstate = Blocks.VINE.getDefaultState() + .withProperty(BlockVine.NORTH, enumfacing == EnumFacing.SOUTH) + .withProperty(BlockVine.EAST, enumfacing == EnumFacing.WEST) + .withProperty(BlockVine.SOUTH, enumfacing == EnumFacing.NORTH) + .withProperty(BlockVine.WEST, enumfacing == EnumFacing.EAST); + worldIn.setBlockState(position, iblockstate, 2); + break; + } + } + } + else { + position = position.add(rand.nextInt(4) - rand.nextInt(4), 0, rand.nextInt(4) - rand.nextInt(4)); + } + } + + return true; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/WorldGenVolcano.java b/src/api/java/rtg/world/gen/feature/WorldGenVolcano.java new file mode 100644 index 00000000..0c2dd575 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenVolcano.java @@ -0,0 +1,217 @@ +package rtg.world.gen.feature; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.CellNoise; +import rtg.util.Logger; +import rtg.util.OpenSimplexNoise; +import rtg.util.TerrainMath; + + +public class WorldGenVolcano { + + // How much stretched the vent/mouth is + private static final float ventEccentricity = 8f; + private static final float ventRadius = 7f; + private static final int lavaHeight = 138 + 3 + (ConfigRTG.enableVolcanoEruptions ? 5 : 0); // + 3 to account for lava cone tip + private static final int baseVolcanoHeight = 142 + 8; + private static IBlockState volcanoBlock = getVolcanoBlock(ConfigRTG.volcanoBlockId, ConfigRTG.volcanoBlockMeta, ConfigRTG.volcanoBlock); + private static IBlockState volcanoPatchBlock = getVolcanoBlock(ConfigRTG.volcanoMix1BlockId, ConfigRTG.volcanoMix1BlockMeta, ConfigRTG.volcanoMix1Block); + private static IBlockState volcanoPatchBlock2 = getVolcanoBlock(ConfigRTG.volcanoMix2BlockId, ConfigRTG.volcanoMix2BlockMeta, ConfigRTG.volcanoMix2Block); + private static IBlockState volcanoPatchBlock3 = getVolcanoBlock(ConfigRTG.volcanoMix3BlockId, ConfigRTG.volcanoMix3BlockMeta, ConfigRTG.volcanoMix3Block); + private static IBlockState lavaBlock = ConfigRTG.enableVolcanoEruptions ? Blocks.FLOWING_LAVA.getDefaultState() : Blocks.LAVA.getDefaultState(); + + public static void build(ChunkPrimer primer, World world, Random mapRand, int baseX, int baseY, int chunkX, int chunkY, OpenSimplexNoise simplex, CellNoise cell, float[] noise) { + + int i, j; + float distanceEll, height, terrainHeight, obsidian; + IBlockState b; + + for (int x = 0; x < 16; x++) { + for (int z = 0; z < 16; z++) { + i = (chunkX * 16) + x; + j = (chunkY * 16) + z; + + // Distance in blocks from the center of the volcano + distanceEll = (float) TerrainMath.dis2Elliptic(i, j, baseX * 16, baseY * 16, + simplex.noise2(i / 250f, j / 250f) * ventEccentricity, + simplex.octave(1).noise2(i / 250f, j / 250f) * ventEccentricity); + + // Height above which obsidian is placed + obsidian = -5f + distanceEll; + obsidian += simplex.octave(1).noise2(i / 55f, j / 55f) * 12f; + obsidian += simplex.octave(2).noise2(i / 25f, j / 25f) * 5f; + obsidian += simplex.octave(3).noise2(i / 9f, j / 9f) * 3f; + + // Make the volcanoes "mouth" more interesting + float ventNoise = simplex.noise2(i / 12f, j / 12f) * 3f; + ventNoise += simplex.octave(1).noise2(i / 4f, j / 4f) * 1.5f; + + // Are we in the volcano's throat/conduit? + if (distanceEll < ventRadius + ventNoise) { + height = simplex.noise2(i / 5f, j / 5f) * 2f; + for (int y = 255; y > -1; y--) { + // Above lava + if (y > lavaHeight) { + if (primer.getBlockState(x, y, z) == Blocks.AIR.getDefaultState()) { + primer.setBlockState(x, y, z, Blocks.AIR.getDefaultState()); + } + } + // Below lava and above obsidian + else if (y > obsidian && y < (lavaHeight - 9) + height) { + primer.setBlockState(x, y, z, volcanoBlock); + } + // In lava + else if (y < lavaHeight + 1) { + if (distanceEll + y < lavaHeight + 3) // + 3 to cut the tip of the lava + { + primer.setBlockState(x, y, z, lavaBlock); + } + } + // Below obsidian + else if (y < obsidian + 1) { + if (primer.getBlockState(x, y, z) == Blocks.AIR.getDefaultState()) { + primer.setBlockState(x, y, z, Blocks.STONE.getDefaultState()); + } + else { + break; + } + } + } + } + else { + terrainHeight = baseVolcanoHeight - (float) Math.pow(distanceEll, 0.89f); + terrainHeight += simplex.octave(1).noise2(i / 112f, j / 112f) * 5.5f; + terrainHeight += simplex.octave(2).noise2(i / 46f, j / 46f) * 4.5f; + terrainHeight += simplex.octave(3).noise2(i / 16f, j / 16f) * 2.5f; + terrainHeight += simplex.octave(4).noise2(i / 5f, j / 5f) * 1f; + + if (terrainHeight > noise[x * 16 + z]) { + noise[x * 16 + z] = terrainHeight; + } + + for (int y = 255; y > -1; y--) { + if (y <= terrainHeight) { + b = primer.getBlockState(x, y, z); + + if (b == Blocks.AIR.getDefaultState() || b == Blocks.WATER.getDefaultState()) { + /************************************* + * WARNING: Spaghetti surfacing code * + *************************************/ + + if (y > obsidian) { + if (distanceEll > 10) { + + // Patches + if (distanceEll < 50 && isOnSurface(primer, x, y, z)) { + float patchNoise = simplex.noise2(i / 10f, j / 10f) * 1.3f; + patchNoise += simplex.octave(2).noise2(i / 30f, j / 30f) * .9; + patchNoise += simplex.octave(3).noise2(i / 5f, j / 5f) * .6; + if (patchNoise > .85) { + primer.setBlockState(x, y, z, volcanoPatchBlock); // Cobble + continue; + } + } + + if (distanceEll < 75 && isOnSurface(primer, x, y, z)) { + float patchNoise = simplex.noise2(i / 10f, j / 10f) * 1.3f; + patchNoise += simplex.octave(4).noise2(i / 30f, j / 30f) * .9; + patchNoise += simplex.octave(5).noise2(i / 5f, j / 5f) * .5; + if (patchNoise > .92) { + primer.setBlockState(x, y, z, volcanoPatchBlock2); // Gravel + continue; + } + } + if (distanceEll < 75 && isOnSurface(primer, x, y, z)) { + float patchNoise = simplex.noise2(i / 10f, j / 10f) * 1.3f; + patchNoise += simplex.octave(6).noise2(i / 30f, j / 30f) * .7; + patchNoise += simplex.octave(7).noise2(i / 5f, j / 5f) * .7; + if (patchNoise > .93) { + primer.setBlockState(x, y, z, volcanoPatchBlock3); // Coal block + continue; + } + } + } + + // Surfacing + if (distanceEll < 70 + simplex.noise2(x / 26f, y / 26f) * 5) { + if (mapRand.nextInt(20) == 0) { + + b = volcanoPatchBlock3; + } + else { + + b = volcanoBlock; + } + } + else if (distanceEll < 75 + simplex.noise2(x / 26f, y / 26f) * 5) { + // Jittering in the base, to smooth the transition + float powerNoise = simplex.octave(3).noise2(i / 40, j / 40f) * 2; + if (mapRand.nextInt(1 + (int) Math.pow(Math.abs(distanceEll - (75 + simplex.noise2(x / 26f, y / 26f) * 5)), 1.5 + powerNoise) + 1) == 0) { + if (mapRand.nextInt(20) == 0) { + + b = volcanoPatchBlock2; + } + else { + + b = Blocks.STONE.getDefaultState(); // Stone so that surfacing will run (so this usually becomes grass) + } + } + else { + b = volcanoBlock; + } + } + else { + b = Blocks.STONE.getDefaultState(); // Stone so that surfacing will run (so this usually becomes grass) + } + } + else { + b = Blocks.STONE.getDefaultState(); + } + } + else { + break; + } + + primer.setBlockState(x, y, z, b); + } + } + } + } + } + } + + private static boolean isOnSurface(ChunkPrimer primer, int x, int y, int z) { + + return primer.getBlockState(x, y + 1, z) == Blocks.AIR.getDefaultState(); + } + + public static int cta(int x, int y, int z) { + + return (x * 16 + z) * 256 + y; + } + + private static IBlockState getVolcanoBlock(String blockID, int blockMeta, IBlockState defaultBlock) { + + IBlockState volcanoBlock; + + try { + + volcanoBlock = Block.getBlockFromName(blockID).getStateFromMeta(blockMeta); + } + catch (Exception e) { + + Logger.warn("Invalid volcano block ID or meta value. Using default block instead."); + volcanoBlock = defaultBlock; + } + + return volcanoBlock; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/WorldGenWaterGrass.java b/src/api/java/rtg/world/gen/feature/WorldGenWaterGrass.java new file mode 100644 index 00000000..8ed3e46d --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/WorldGenWaterGrass.java @@ -0,0 +1,99 @@ +package rtg.world.gen.feature; + + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import rtg.util.BlockUtil; + +import java.util.Random; + +public class WorldGenWaterGrass extends WorldGenerator { + + private Block blockData; + private int varMetadata; + private int varMinHeight; + + public WorldGenWaterGrass(Block block, int metadata, int minHeight) { + + blockData = block; + varMetadata = metadata; + varMinHeight = minHeight; + } + + public boolean generate(World world, Random rand, BlockPos blockPos) { + + return this.generate(world, rand, blockPos.getX(), blockPos.getY(), blockPos.getZ()); + } + + public boolean generate(World world, Random rand, int x, int y, int z) { + + while (y > 0) { + if (!world.isAirBlock(new BlockPos(x, y, z)) || world.getBlockState(new BlockPos(x, y, z)).getBlock().isLeaves(world.getBlockState(new BlockPos(x, y, z)), world, new BlockPos(x, y, z))) { + break; + } + + if (y < varMinHeight) { + return false; + } + y--; + } + + Block b; + if (blockData == Blocks.DOUBLE_PLANT) { + int i1, j1, k1; + for (int l = 0; l < 32; ++l) { + i1 = x + rand.nextInt(8) - rand.nextInt(8); + j1 = y + rand.nextInt(2) - rand.nextInt(2); + k1 = z + rand.nextInt(8) - rand.nextInt(8); + + b = world.getBlockState(new BlockPos(i1, j1 - 1, k1)).getBlock(); + if (((b == Blocks.WATER && world.getBlockState(new BlockPos(i1, j1 - 2, k1)).getBlock() == Blocks.SAND) || b == Blocks.SAND) && world.getBlockState(new BlockPos(i1, j1, k1)).getBlock() == Blocks.AIR) { + world.setBlockState(new BlockPos(i1, j1 - 1, k1), Blocks.GRASS.getDefaultState(), 0); + } + + if (world.isAirBlock(new BlockPos(i1, j1, k1)) && j1 < 254 && Blocks.DOUBLE_PLANT.canPlaceBlockAt(world, new BlockPos(i1, j1, k1))) { + world.setBlockState(new BlockPos(i1, j1, k1), Blocks.DOUBLE_PLANT.getStateFromMeta(varMetadata)); + } + } + } + else if (blockData == Blocks.LEAVES) { + for (int l = 0; l < 64; ++l) { + int i1 = x + rand.nextInt(8) - rand.nextInt(8); + int j1 = y + rand.nextInt(4) - rand.nextInt(4); + int k1 = z + rand.nextInt(8) - rand.nextInt(8); + + b = world.getBlockState(new BlockPos(i1, j1 - 1, k1)).getBlock(); + if (((b == Blocks.WATER && world.getBlockState(new BlockPos(i1, j1 - 2, k1)).getBlock() == Blocks.SAND) || b == Blocks.SAND) && world.getBlockState(new BlockPos(i1, j1, k1)).getBlock() == Blocks.AIR) { + world.setBlockState(new BlockPos(i1, j1 - 1, k1), Blocks.GRASS.getDefaultState(), 0); + } + + if (world.isAirBlock(new BlockPos(i1, j1, k1)) && world.getBlockState(new BlockPos(i1, j1 - 1, k1)).getBlock() == Blocks.GRASS) { + world.setBlockState(new BlockPos(i1, j1, k1), BlockUtil.getStateLeaf(varMetadata), 0); + } + } + } + else { + for (int l = 0; l < 128; ++l) { + int i1 = x + rand.nextInt(8) - rand.nextInt(8); + int j1 = y + rand.nextInt(4) - rand.nextInt(4); + int k1 = z + rand.nextInt(8) - rand.nextInt(8); + + b = world.getBlockState(new BlockPos(i1, j1 - 1, k1)).getBlock(); + if (((b == Blocks.WATER && world.getBlockState(new BlockPos(i1, j1 - 2, k1)).getBlock() == Blocks.SAND) || b == Blocks.SAND) && world.getBlockState(new BlockPos(i1, j1, k1)).getBlock() == Blocks.AIR) { + world.setBlockState(new BlockPos(i1, j1 - 1, k1), Blocks.GRASS.getDefaultState(), 0); + } + + if (world.isAirBlock(new BlockPos(i1, j1, k1)) + //TODO replace this + // && block.canBlockStay(world, new BlockPos(i1, j1, k1)) + ) { + world.setBlockState(new BlockPos(i1, j1, k1), blockData.getStateFromMeta(varMetadata), 0); + } + } + } + return true; + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/abyssalcraft/WorldGenTreeACDarkwood.java b/src/api/java/rtg/world/gen/feature/tree/abyssalcraft/WorldGenTreeACDarkwood.java new file mode 100644 index 00000000..41dfc910 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/abyssalcraft/WorldGenTreeACDarkwood.java @@ -0,0 +1,160 @@ +package rtg.world.gen.feature.tree.abyssalcraft; + +import java.util.Random; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +import com.shinoow.abyssalcraft.api.block.ACBlocks; + +public class WorldGenTreeACDarkwood extends WorldGenerator { + + private int startHeight; + private int treeSize; + + private IBlockState dataLog; + private IBlockState dataLeaves; + + public WorldGenTreeACDarkwood(int start, int s, IBlockState log, IBlockState leaves) { + + startHeight = start; + treeSize = s; + dataLog = log; + dataLeaves = leaves; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + int startY = y; + + IBlockState g = world.getBlockState(new BlockPos(x, y - 1, z)); + if (g != ACBlocks.darklands_grass.getDefaultState()) { + return false; + } + + buildTrunk(world, rand, x + 1, y, z); + buildTrunk(world, rand, x - 1, y, z); + buildTrunk(world, rand, x, y, z + 1); + buildTrunk(world, rand, x, y, z - 1); + + int i; + for (i = 0; i < startHeight; i++) { + world.setBlockState(new BlockPos(x, y, z), dataLog, 2); + if (i > 5 && rand.nextInt(7) == 0) { + int dX = -1 + rand.nextInt(3); + int dZ = -1 + rand.nextInt(3); + + if (dX == 0 && dZ == 0) { + dX = -1 + rand.nextInt(3); + dZ = -1 + rand.nextInt(3); + } + + buildBranch(world, rand, x, y, z, dX, dZ, 1, 1); + } + + y++; + } + + int pX = 0; + int pZ = 0; + int j; + for (i = 0; i < treeSize; i++) { + if (rand.nextInt(i < treeSize - 12 && i > 2 ? 2 : 1) == 0 && i < treeSize - 2) { + int dX = -1 + rand.nextInt(3); + int dZ = -1 + rand.nextInt(3); + + if (dX == 0 && dZ == 0) { + dX = -1 + rand.nextInt(3); + dZ = -1 + rand.nextInt(3); + } + + if (pX == dX && rand.nextBoolean()) { + dX = -dX; + } + if (pZ == dZ && rand.nextBoolean()) { + dZ = -dZ; + } + + pX = dX; + pZ = dZ; + + buildBranch(world, rand, x, y, z, dX, dZ, + i < treeSize - 12 && i > 3 ? 3 : i < treeSize - 8 ? 2 : 1, + i < treeSize - 5 ? 2 : 1 + ); + } + world.setBlockState(new BlockPos(x, y, z), dataLog, 2); + + if (i < treeSize - 2) { + if (rand.nextBoolean()) { + buildLeaves(world, x, y, z + 1); + } + if (rand.nextBoolean()) { + buildLeaves(world, x, y, z - 1); + } + if (rand.nextBoolean()) { + buildLeaves(world, x + 1, y, z); + } + if (rand.nextBoolean()) { + buildLeaves(world, x - 1, y, z); + } + } + + y++; + } + + buildLeaves(world, x, y - 1, z + 1); + buildLeaves(world, x, y - 1, z - 1); + buildLeaves(world, x + 1, y - 1, z); + buildLeaves(world, x - 1, y - 1, z); + buildLeaves(world, x, y, z); + + return true; + } + + public void buildBranch(World world, Random rand, int x, int y, int z, int dX, int dZ, int logLength, int leaveSize) { + + if (logLength == 3 && Math.abs(dX) + Math.abs(dZ) == 2) { + logLength--; + } + + for (int i = -1; i <= 1; i++) { + for (int j = -1; j <= 1; j++) { + for (int k = 0; k < 2; k++) { + if (Math.abs(i) + Math.abs(j) + Math.abs(k) < leaveSize + 1) { + buildLeaves(world, x + i + (dX * logLength), y + k, z + j + (dZ * logLength)); + } + } + } + } + + for (int m = 1; m <= logLength; m++) { + world.setBlockState(new BlockPos(x + (dX * m), y, z + (dZ * m)), dataLog, 2); + } + } + + public void buildLeaves(World world, int x, int y, int z) { + + IBlockState b = world.getBlockState(new BlockPos(x, y, z)); + if (b.getMaterial() == Material.AIR) { + world.setBlockState(new BlockPos(x, y, z), dataLeaves, 2); + } + } + + public void buildTrunk(World world, Random rand, int x, int y, int z) { + + int h = (int) Math.ceil(startHeight / 4f); + h = h + rand.nextInt(h * 2); + for (int i = -1; i < h; i++) { + world.setBlockState(new BlockPos(x, y + i, z), dataLog, 2); + } + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java new file mode 100644 index 00000000..f9c1fa94 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTG.java @@ -0,0 +1,125 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +/** + * The base class for all RTG trees. + * + * @author WhichOnesPink + * @see RTG Tree Gallery + */ +public class TreeRTG extends WorldGenAbstractTree { + + public IBlockState logBlock; + public IBlockState leavesBlock; + public int trunkSize; + public int crownSize; + public boolean noLeaves; + + public IBlockState saplingBlock; + + public int generateFlag; + + public int minTrunkSize; + public int maxTrunkSize; + public int minCrownSize; + public int maxCrownSize; + + public ArrayList validGroundBlocks; + + public TreeRTG(boolean notify) { + + super(notify); + } + + public TreeRTG() { + + this(false); + + this.logBlock = Blocks.LOG.getDefaultState(); + this.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.trunkSize = 2; + this.crownSize = 4; + this.noLeaves = false; + + this.saplingBlock = Blocks.SAPLING.getDefaultState(); + + this.generateFlag = 2; + + // These need to default to zero as they're only used when generating trees from saplings. + this.minTrunkSize = 0; + this.maxTrunkSize = 0; + this.minCrownSize = 0; + this.maxCrownSize = 0; + + // Each tree sub-class is responsible for using (or not using) this list as part of its generation logic. + this.validGroundBlocks = new ArrayList(Arrays.asList( + Blocks.GRASS.getDefaultState(), + Blocks.DIRT.getDefaultState(), + Blocks.SAND.getDefaultState() + )); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + return false; + } + + public void buildTrunk(World world, Random rand, int x, int y, int z) { + + } + + public void buildBranch(World world, Random rand, int x, int y, int z, int dX, int dZ, int logLength, int leaveSize) { + + } + + public void buildLeaves(World world, int x, int y, int z) { + + if (this.noLeaves) { + return; + } + } + + public void buildLeaves(World world, Random rand, int x, int y, int z, int size) { + + } + + public TreeRTG setLogBlock(IBlockState logBlock) { + + this.logBlock = logBlock; + return this; + } + + public TreeRTG setLeavesBlock(IBlockState leavesBlock) { + + this.leavesBlock = leavesBlock; + return this; + } + + public TreeRTG setTrunkSize(int trunkSize) { + + this.trunkSize = trunkSize; + return this; + } + + public TreeRTG setCrownSize(int crownSize) { + + this.crownSize = crownSize; + return this; + } + + public TreeRTG setNoLeaves(boolean noLeaves) { + + this.noLeaves = noLeaves; + return this; + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaAbyssinica.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaAbyssinica.java new file mode 100644 index 00000000..c52e673a --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaAbyssinica.java @@ -0,0 +1,120 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import rtg.config.rtg.ConfigRTG; + + +/** + * Acacia Abyssinica (Flat-top Acacia) + */ +public class TreeRTGAcaciaAbyssinica extends TreeRTG { + + /** + * Acacia Abyssinica (Flat-top Acacia)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGAcaciaAbyssinica());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG2;
+ * decoTree.logMeta = (byte)0;
+ * decoTree.leavesBlock = Blocks.LEAVES2;
+ * decoTree.leavesMeta = (byte)0;
+ * decoTree.minTrunkSize = 6;
+ * decoTree.maxTrunkSize = 16;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGAcaciaAbyssinica() { + + super(); + + this.logBlock = Blocks.LOG2.getDefaultState(); + this.leavesBlock = Blocks.LEAVES2.getDefaultState(); + this.trunkSize = 12; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + IBlockState b = world.getBlockState(new BlockPos(x, y - 1, z)); + + if (b == Blocks.SAND.getDefaultState() && !ConfigRTG.allowTreesToGenerateOnSand) { + return false; + } + + if (b != Blocks.GRASS.getDefaultState() && b != Blocks.DIRT.getDefaultState()) { + return false; + } + + int h = this.trunkSize; + int bh = h - 6; + + for (int i = 0; i < h; i++) { + world.setBlockState(new BlockPos(x, y + i, z), this.logBlock, this.generateFlag); + } + genLeaves(world, rand, x, y + h, z); + + int sh, eh, dir; + float xd, yd, c; + + for (int a = 6 + rand.nextInt(3); a > -1; a--) { + sh = bh + rand.nextInt(4); + eh = h - (int) ((h - sh) * 1f); + dir = rand.nextInt(360); + xd = (float) Math.cos(dir * Math.PI / 180f) * 2f; + yd = (float) Math.sin(dir * Math.PI / 180f) * 2f; + c = 1; + + while (sh < h) { + world.setBlockState(new BlockPos(x + (int) (xd * c), y + sh, z + (int) (yd * c)), this.logBlock, this.generateFlag); + sh++; + c += 0.5f; + } + genLeaves(world, rand, x + (int) (xd * c), y + sh, z + (int) (yd * c)); + } + + return true; + } + + public void genLeaves(World world, Random rand, int x, int y, int z) { + + if (!this.noLeaves) { + + int i; + int j; + for (i = -2; i <= 2; i++) { + for (j = -2; j <= 2; j++) { + if (world.isAirBlock(new BlockPos(x + i, y + 1, z + j)) && Math.abs(i) + Math.abs(j) < 4) { + world.setBlockState(new BlockPos(x + i, y + 1, z + j), this.leavesBlock, this.generateFlag); + } + } + } + + for (i = -3; i <= 3; i++) { + for (j = -3; j <= 3; j++) { + if (world.isAirBlock(new BlockPos(x + i, y, z + j)) && Math.abs(i) + Math.abs(j) < 5) { + world.setBlockState(new BlockPos(x + i, y, z + j), this.leavesBlock, this.generateFlag); + } + } + } + } + + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaBucheri.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaBucheri.java new file mode 100644 index 00000000..6f726c29 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGAcaciaBucheri.java @@ -0,0 +1,120 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import rtg.config.rtg.ConfigRTG; + + +/** + * Acacia Bucheri (Bucher Acacia) + */ +public class TreeRTGAcaciaBucheri extends TreeRTG { + + /** + * Acacia Bucheri (Bucher Acacia)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGAcaciaBucheri());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG2;
+ * decoTree.logMeta = (byte)0;
+ * decoTree.leavesBlock = Blocks.LEAVES2;
+ * decoTree.leavesMeta = (byte)0;
+ * decoTree.minTrunkSize = 6;
+ * decoTree.maxTrunkSize = 16;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGAcaciaBucheri() { + + super(); + + this.logBlock = Blocks.LOG2.getDefaultState(); + this.leavesBlock = Blocks.LEAVES2.getDefaultState(); + this.trunkSize = 10; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + IBlockState b = world.getBlockState(new BlockPos(x, y - 1, z)); + + if (b == Blocks.SAND.getDefaultState() && !ConfigRTG.allowTreesToGenerateOnSand) { + return false; + } + + if (b != Blocks.GRASS.getDefaultState() && b != Blocks.DIRT.getDefaultState()) { + return false; + } + + int h = this.trunkSize; + int bh = h - 3; + + for (int i = 0; i < h; i++) { + world.setBlockState(new BlockPos(x, y + i, z), this.logBlock, this.generateFlag); + } + genLeaves(world, rand, x, y + h, z); + + int sh, eh, dir; + float xd, yd, c; + + for (int a = 1 + rand.nextInt(2); a > -1; a--) { + sh = bh + rand.nextInt(2); + eh = h - (int) ((h - sh) * 0.25f); + dir = rand.nextInt(360); + xd = (float) Math.cos(dir * Math.PI / 180f) * 2f; + yd = (float) Math.sin(dir * Math.PI / 180f) * 2f; + c = 1; + + while (sh < h) { + world.setBlockState(new BlockPos(x + (int) (xd * c), y + sh, z + (int) (yd * c)), this.logBlock, this.generateFlag); + sh++; + c += 0.5f; + } + genLeaves(world, rand, x + (int) (xd * c), y + sh, z + (int) (yd * c)); + } + + return true; + } + + public void genLeaves(World world, Random rand, int x, int y, int z) { + + if (!this.noLeaves) { + + int i; + int j; + for (i = -1; i <= 1; i++) { + for (j = -1; j <= 1; j++) { + if (world.isAirBlock(new BlockPos(x + i, y + 1, z + j))) { + world.setBlockState(new BlockPos(x + i, y + 1, z + j), this.leavesBlock, this.generateFlag); + } + } + } + + for (i = -2; i <= 2; i++) { + for (j = -2; j <= 2; j++) { + if (world.isAirBlock(new BlockPos(x + i, y, z + j)) && Math.abs(i) + Math.abs(j) < 4) { + world.setBlockState(new BlockPos(x + i, y, z + j), this.leavesBlock, this.generateFlag); + } + } + } + } + + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGBetulaPapyrifera.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGBetulaPapyrifera.java new file mode 100644 index 00000000..a7c06f66 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGBetulaPapyrifera.java @@ -0,0 +1,146 @@ +package rtg.world.gen.feature.tree.rtg; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import rtg.util.BlockUtil; + +import java.util.Random; + +/** + * Betula Papyrifera (Paper Birch) + */ +public class TreeRTGBetulaPapyrifera extends TreeRTG { + + /** + * Betula Papyrifera (Paper Birch)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGBetulaPapyrifera());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)2;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)2;
+ * decoTree.minTrunkSize = 6;
+ * decoTree.maxTrunkSize = 8;
+ * decoTree.minCrownSize = 8;
+ * decoTree.maxCrownSize = 24;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGBetulaPapyrifera() { + + super(); + + this.logBlock = BlockUtil.getStateLog(2); + this.leavesBlock = BlockUtil.getStateLeaf(2); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + IBlockState g = world.getBlockState(new BlockPos(x, y - 1, z)); + if (g != Blocks.GRASS.getDefaultState() && g != Blocks.DIRT.getDefaultState()) { + return false; + } + + int i; + for (i = 0; i < this.trunkSize; i++) { + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + y++; + } + + int pX = 0; + int pZ = 0; + for (i = 0; i < this.crownSize; i++) { + if (rand.nextInt(2) == 0 && i < this.crownSize - 2) { + int dX = -1 + rand.nextInt(3); + int dZ = -1 + rand.nextInt(3); + + if (dX == 0 && dZ == 0) { + dX = -1 + rand.nextInt(3); + dZ = -1 + rand.nextInt(3); + } + + if (pX == dX && rand.nextBoolean()) { + dX = -dX; + } + if (pZ == dZ && rand.nextBoolean()) { + dZ = -dZ; + } + + pX = dX; + pZ = dZ; + + buildBranch(world, rand, x, y, z, dX, dZ, 1, i < this.crownSize - 2 ? 2 : 1); //i < treeSize - 4 ? 2 : 1 + } + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + + if (i < this.crownSize - 2) { + if (rand.nextBoolean()) { + buildLeaves(world, x, y, z + 1); + } + if (rand.nextBoolean()) { + buildLeaves(world, x, y, z - 1); + } + if (rand.nextBoolean()) { + buildLeaves(world, x + 1, y, z); + } + if (rand.nextBoolean()) { + buildLeaves(world, x - 1, y, z); + } + } + + y++; + } + + buildLeaves(world, x, y - 1, z + 1); + buildLeaves(world, x, y - 1, z - 1); + buildLeaves(world, x + 1, y - 1, z); + buildLeaves(world, x - 1, y - 1, z); + buildLeaves(world, x, y, z); + + return true; + } + + public void buildBranch(World world, Random rand, int x, int y, int z, int dX, int dZ, int logLength, int leaveSize) { + + for (int i = -1; i <= 1; i++) { + for (int j = -1; j <= 1; j++) { + for (int k = 0; k < 2; k++) { + if (Math.abs(i) + Math.abs(j) + Math.abs(k) < leaveSize + 1) { + buildLeaves(world, x + i + (dX * logLength), y + k, z + j + (dZ * logLength)); + } + } + } + } + + for (int m = 1; m <= logLength; m++) { + world.setBlockState(new BlockPos(x + (dX * m), y, z + (dZ * m)), this.logBlock, this.generateFlag); + } + } + + public void buildLeaves(World world, int x, int y, int z) { + + if (!this.noLeaves) { + + IBlockState b = world.getBlockState(new BlockPos(x, y, z)); + if (b.getMaterial() == Material.AIR) { + world.setBlockState(new BlockPos(x, y, z), this.leavesBlock, this.generateFlag); + } + } + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaPentandra.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaPentandra.java new file mode 100644 index 00000000..718f4f22 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaPentandra.java @@ -0,0 +1,225 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.Random; + +import net.minecraft.block.BlockLog; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * Ceiba Pentandra (White Silk-Cotton Tree) + */ +public class TreeRTGCeibaPentandra extends TreeRTG { + + protected float length; + protected int branch; + protected float verStart; + protected float verRand; + protected IBlockState trunkLog; + + /** + * Ceiba Pentandra (White Silk-Cotton Tree)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves
+ * length, branch, verStart, verRand

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGCeibaPentandra(13f, 3, 0.32f, 0.1f));
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)0;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)0;
+ * decoTree.minTrunkSize = 3;
+ * decoTree.maxTrunkSize = 4;
+ * decoTree.minCrownSize = 10;
+ * decoTree.maxCrownSize = 24;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGCeibaPentandra() { + + super(); + + this.length = 13f; + this.branch = 3; + this.verStart = 0.32f; + this.verRand = 0.1f; + } + + /** + * Ceiba Pentandra (White Silk-Cotton Tree)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves
+ * length, branch, verStart, verRand

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGCeibaPentandra(13f, 3, 0.32f, 0.1f));
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)0;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)0;
+ * decoTree.minTrunkSize = 3;
+ * decoTree.maxTrunkSize = 4;
+ * decoTree.minCrownSize = 10;
+ * decoTree.maxCrownSize = 24;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGCeibaPentandra(float length, int branch, float verStart, float verRand) { + + this(); + + this.length = length; + this.branch = branch; + this.verStart = verStart; + this.verRand = verRand; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + try { + this.trunkLog = this.logBlock.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE); + } + catch (Exception e) { + this.trunkLog = this.logBlock; + } + + IBlockState b = world.getBlockState(new BlockPos(x, y - 1, z)); + if (b != Blocks.GRASS.getDefaultState() && b != Blocks.DIRT.getDefaultState()) { + return false; + } + + if (this.trunkSize > 0) { + for (int k = 0; k < 3; k++) { + generateBranch(world, rand, x, y + this.trunkSize, z, (120 * k) - 40 + rand.nextInt(80), 1.6f + rand.nextFloat() * 0.1f, this.trunkSize * 1.7f, 1f, true); + } + } + + for (int i = y + this.trunkSize; i < y + this.crownSize; i++) { + world.setBlockState(new BlockPos(x, i, z), this.logBlock, this.generateFlag); + } + + float horDir, verDir; + int eX, eY, eZ; + for (int j = 0; j < branch; j++) { + horDir = (120 * j) - 60 + rand.nextInt(120); + verDir = verStart + rand.nextFloat() * verRand; + generateBranch(world, rand, x, y + this.crownSize, z, horDir, verDir, length, 1f, false); + + eX = x + (int) (Math.cos(horDir * Math.PI / 180D) * verDir * length); + eZ = z + (int) (Math.sin(horDir * Math.PI / 180D) * verDir * length); + eY = y + this.crownSize + (int) ((1f - verDir) * length); + + for (int m = 0; m < 1; m++) { + generateLeaves(world, rand, eX, eY, eZ, 4f, 1.5f); + } + } + + return true; + } + + /* + * horDir = number between -180D and 180D + * verDir = number between 1F (horizontal) and 0F (vertical) + */ + public void generateBranch(World world, Random rand, float x, float y, float z, double horDir, float verDir, float length, float speed, boolean isTrunk) { + + if (verDir < 0f) { + verDir = -verDir; + } + + float c = 0f; + float velY = 1f - verDir; + + if (verDir > 1f) { + verDir = 1f - (verDir - 1f); + } + + float velX = (float) Math.cos(horDir * Math.PI / 180D) * verDir; + float velZ = (float) Math.sin(horDir * Math.PI / 180D) * verDir; + + while (c < length) { + + if (isTrunk) { + world.setBlockState(new BlockPos((int) x, (int) y, (int) z), this.trunkLog, this.generateFlag); + } + else { + world.setBlockState(new BlockPos((int) x, (int) y, (int) z), this.logBlock, this.generateFlag); + } + + x += velX; + y += velY; + z += velZ; + + c += speed; + } + } + + public void generateLeaves(World world, Random rand, int x, int y, int z, float size, float width) { + + float dist; + int i, j, k, s = (int) (size - 1f), w = (int) ((size - 1f) * width); + for (i = -w; i <= w; i++) { + for (j = -s; j <= s; j++) { + for (k = -w; k <= w; k++) { + dist = Math.abs((float) i / width) + (float) Math.abs(j) + Math.abs((float) k / width); + if (dist <= size - 0.5f || (dist <= size && rand.nextBoolean())) { + if (dist < 0.6f) { + world.setBlockState(new BlockPos(x + i, y + j, z + k), this.logBlock, this.generateFlag); + } + + if (!this.noLeaves) { + + if (world.isAirBlock(new BlockPos(x + i, y + j, z + k))) { + world.setBlockState(new BlockPos(x + i, y + j, z + k), this.leavesBlock, this.generateFlag); + } + } + } + } + } + } + } + + public TreeRTGCeibaPentandra setLength(float length) { + + this.length = length; + return this; + } + + public TreeRTGCeibaPentandra setBranch(int branch) { + + this.branch = branch; + return this; + } + + public TreeRTGCeibaPentandra setVerStart(float verStart) { + + this.verStart = verStart; + return this; + } + + public TreeRTGCeibaPentandra setVerRand(float verRand) { + + this.verRand = verRand; + return this; + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaRosea.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaRosea.java new file mode 100644 index 00000000..570d7043 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCeibaRosea.java @@ -0,0 +1,241 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.Random; + +import net.minecraft.block.BlockLog; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import rtg.config.rtg.ConfigRTG; + + +/** + * Ceiba Rosea (Spanish Pochote) + */ +public class TreeRTGCeibaRosea extends TreeRTG { + + protected float length; + protected int branch; + protected float verStart; + protected float verRand; + protected IBlockState trunkLog; + + /** + * Ceiba Rosea (Spanish Pochote)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves
+ * length, branch, verStart, verRand

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGCeibaRosea(16f, 5, 0.32f, 0.1f));
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)0;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)0;
+ * decoTree.minTrunkSize = 3;
+ * decoTree.maxTrunkSize = 4;
+ * decoTree.minCrownSize = 10;
+ * decoTree.maxCrownSize = 24;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGCeibaRosea() { + + super(); + + length = 16f; + branch = 5; + verStart = 0.32f; + verRand = 0.1f; + } + + /** + * Ceiba Rosea (Spanish Pochote)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves
+ * length, branch, verStart, verRand

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGCeibaRosea(16f, 5, 0.32f, 0.1f));
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)0;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)0;
+ * decoTree.minTrunkSize = 3;
+ * decoTree.maxTrunkSize = 4;
+ * decoTree.minCrownSize = 10;
+ * decoTree.maxCrownSize = 24;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGCeibaRosea(float length, int branch, float verStart, float verRand) { + + this(); + + this.length = length; + this.branch = branch; + this.verStart = verStart; + this.verRand = verRand; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + try { + this.trunkLog = this.logBlock.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE); + } + catch (Exception e) { + this.trunkLog = this.logBlock; + } + + IBlockState b = world.getBlockState(new BlockPos(x, y - 1, z)); + + if (b == Blocks.SAND.getDefaultState() && !ConfigRTG.allowTreesToGenerateOnSand) { + return false; + } + + if (b != Blocks.GRASS.getDefaultState() && b != Blocks.DIRT.getDefaultState() && b != Blocks.SAND.getDefaultState()) { + return false; + } + + float r = rand.nextFloat() * 360; + if (this.trunkSize > 0) { + for (int k = 0; k < 5; k++) { + generateBranch(world, rand, (float) x + 0.5f, y + this.trunkSize, (float) z + 0.5f, (120 * k) - 25 + rand.nextInt(50) + r, 1.6f + rand.nextFloat() * 0.1f, this.trunkSize * 1.8f, 1f, true); + } + } + + for (int i = y + this.trunkSize - 2; i < y + this.crownSize + 2; i++) { + world.setBlockState(new BlockPos(x, i, z), this.logBlock, this.generateFlag); + world.setBlockState(new BlockPos(x + 1, i, z + 1), this.logBlock, this.generateFlag); + } + + float horDir, verDir; + int eX, eY, eZ; + for (int j = 0; j < branch; j++) { + horDir = (80 * j) - 40 + rand.nextInt(80); + verDir = verStart + rand.nextFloat() * verRand; + generateBranch(world, rand, (float) x + 0.5f, y + this.crownSize, (float) z + 0.5f, horDir, verDir, length, 1f, false); + + eX = (int) (Math.cos(horDir * Math.PI / 180D) * verDir * length); + eZ = (int) (Math.sin(horDir * Math.PI / 180D) * verDir * length); + eY = (int) ((1f - verDir) * length); + + for (int m = 0; m < 2; m++) { + generateLeaves(world, rand, x + eX - 2 + rand.nextInt(5), y + this.crownSize + eY + rand.nextInt(2), z + eZ - 2 + rand.nextInt(5), 4f, 1.5f); + } + + eX *= 0.8f; + eY *= 0.8f; + eZ *= 0.8f; + + generateLeaves(world, rand, x + eX, y + this.crownSize + eY, z + eZ, 3f, 1.5f); + } + + return true; + } + + /* + * horDir = number between -180D and 180D + * verDir = number between 1F (horizontal) and 0F (vertical) + */ + public void generateBranch(World world, Random rand, float x, float y, float z, double horDir, float verDir, float length, float speed, boolean isTrunk) { + + if (verDir < 0f) { + verDir = -verDir; + } + + float c = 0f; + float velY = 1f - verDir; + + if (verDir > 1f) { + verDir = 1f - (verDir - 1f); + } + + float velX = (float) Math.cos(horDir * Math.PI / 180D) * verDir; + float velZ = (float) Math.sin(horDir * Math.PI / 180D) * verDir; + + while (c < length) { + + if (isTrunk) { + world.setBlockState(new BlockPos((int) x, (int) y, (int) z), this.trunkLog, this.generateFlag); + } + else { + world.setBlockState(new BlockPos((int) x, (int) y, (int) z), this.logBlock, this.generateFlag); + } + + x += velX; + y += velY; + z += velZ; + + c += speed; + } + } + + public void generateLeaves(World world, Random rand, float x, float y, float z, float size, float width) { + + float dist; + int i, j, k, s = (int) (size - 1f), w = (int) ((size - 1f) * width); + for (i = -w; i <= w; i++) { + for (j = -s + 1; j <= s; j++) { + for (k = -w; k <= w; k++) { + dist = Math.abs((float) i / width) + (float) Math.abs(j) + Math.abs((float) k / width); + if (dist <= size - 0.5f || (dist <= size && rand.nextBoolean())) { + if (dist < 1.3f) { + world.setBlockState(new BlockPos((int) x + i, (int) y + j, (int) z + k), this.logBlock, this.generateFlag); + } + + if (!this.noLeaves) { + + if (world.isAirBlock(new BlockPos((int) x + i, (int) y + j, (int) z + k))) { + world.setBlockState(new BlockPos((int) x + i, (int) y + j, (int) z + k), this.leavesBlock, this.generateFlag); + } + } + } + } + } + } + } + + public TreeRTGCeibaRosea setLength(float length) { + + this.length = length; + return this; + } + + public TreeRTGCeibaRosea setBranch(int branch) { + + this.branch = branch; + return this; + } + + public TreeRTGCeibaRosea setVerStart(float verStart) { + + this.verStart = verStart; + return this; + } + + public TreeRTGCeibaRosea setVerRand(float verRand) { + + this.verRand = verRand; + return this; + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCocosNucifera.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCocosNucifera.java new file mode 100644 index 00000000..08636578 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCocosNucifera.java @@ -0,0 +1,213 @@ +package rtg.world.gen.feature.tree.rtg; + +import net.minecraft.block.BlockLog; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import rtg.util.BlockUtil; + +import java.util.Random; + +/** + * Cocos Nucifera (Coconut Palm) + */ +public class TreeRTGCocosNucifera extends TreeRTG { + + protected IBlockState trunkLog; + + private static int leavesLength = 133; + private static int[] leaves = new int[]{ + 1, 0, 0, + 2, 0, 0, + 3, -1, 0, + 3, -2, 0, + -1, 0, 0, + -2, 0, 0, + -3, -1, 0, + -3, -2, 0, + 0, 0, 1, + 0, 0, 2, + 0, -1, 3, + 0, -2, 3, + 0, 0, -1, + 0, 0, -2, + 0, -1, -3, + 0, -2, -3, + 0, 1, 0, + 1, 1, 1, + -1, 1, -1, + -1, 1, 1, + 1, 1, -1, + 1, 2, 0, + -1, 2, 0, + 0, 2, 1, + 0, 2, -1, + 2, 3, 0, + 3, 3, 0, + 4, 2, 0, + -2, 3, 0, + -3, 3, 0, + -4, 2, 0, + 0, 3, 2, + 0, 3, 3, + 0, 2, 4, + 0, 3, -2, + 0, 3, -3, + 0, 2, -4, + 2, 2, -2, + -2, 2, 2, + -2, 2, -2, + 2, 2, 2, + 3, 2, -3, + -3, 2, 3, + -3, 2, -3, + 3, 2, 3 + }; + + private static int cocoasLength = 16; + private static int[] cocoas = new int[]{ + 2, 0, -2, 1, + 1, 1, -2, 0, + 0, 0, -2, -1, + 3, -1, -2, 0 + }; + + /** + * Cocos Nucifera (Coconut Palm)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGCocosNucifera());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)3;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)3;
+ * decoTree.minTrunkSize = 7;
+ * decoTree.maxTrunkSize = 8;
+ * decoTree.minCrownSize = 7;
+ * decoTree.maxCrownSize = 10;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGCocosNucifera() { + + super(); + + this.logBlock = BlockUtil.getStateLog(3); + this.leavesBlock = BlockUtil.getStateLeaf(3); + this.trunkSize = 8; + this.crownSize = 7; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + try { + this.trunkLog = this.logBlock.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE); + } + catch (Exception e) { + this.trunkLog = this.logBlock; + } + + IBlockState b = world.getBlockState(new BlockPos(x, y - 1, z)); + boolean validGroundBlock = false; + + for (int i = 0; i < this.validGroundBlocks.size(); i++) { + if (b == this.validGroundBlocks.get(i)) { + validGroundBlock = true; + break; + } + } + + if (!validGroundBlock) { + return false; + } + + double horDir = getRandomDir(rand); + float verDir = 0.3f + rand.nextFloat() * 0.4f; + float length = (float) (this.trunkSize + this.crownSize); + float posX = (float) x; + float posY = (float) y; + float posZ = (float) z; + float c = 0f; + float loss = 0f; + + if (verDir < 0f) { + verDir = -verDir; + } + + float velY = 1f - verDir; + + if (verDir > 1f) { + verDir = 1f - (verDir - 1f); + } + + float velX = (float) Math.cos(horDir * Math.PI / 180D) * verDir; + float velZ = (float) Math.sin(horDir * Math.PI / 180D) * verDir; + + while (c < length) { + + world.setBlockState(new BlockPos((int) posX, (int) posY, (int) posZ), this.trunkLog, this.generateFlag); + + if (c < length - 3) { + loss = Math.abs(velX) + Math.abs(velZ); + posX += velX *= 0.9f; + posZ += velZ *= 0.9f; + loss = loss - (Math.abs(velX) + Math.abs(velZ)); + posY += velY += loss; + } + else { + posY += velY; + } + + c += 1f; + } + + x = (int) posX; + y = (int) posY - 1; + z = (int) posZ; + + if (!this.noLeaves) { + + for (int j = 0; j < leavesLength; j += 3) { + world.setBlockState(new BlockPos(x + leaves[j], y + leaves[j + 1], z + leaves[j + 2]), this.leavesBlock, this.generateFlag); + } + } + + for (int k = 0; k < cocoasLength; k += 4) { + if (rand.nextInt(20) == 0) { + //TODO: cocoas[k + 0] + 8 (meta) + world.setBlockState(new BlockPos(x + cocoas[k + 1], y + cocoas[k + 2], z + cocoas[k + 3]), Blocks.COCOA.getDefaultState(), this.generateFlag); + } + } + + return true; + } + + public double getRandomDir(Random rand) { + + switch (rand.nextInt(4)) { + case 0: + return -180D; + case 1: + return -90D; + case 2: + return 0D; + case 3: + return 90D; + } + return 0D; + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCupressusSempervirens.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCupressusSempervirens.java new file mode 100644 index 00000000..af296df9 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGCupressusSempervirens.java @@ -0,0 +1,134 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * Cupressus Sempervirens (Italian Cypress) + */ +public class TreeRTGCupressusSempervirens extends TreeRTG { + + /** + * Cupressus Sempervirens (Italian Cypress)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGCupressusSempervirens());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)1;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)1;
+ * decoTree.minTrunkSize = 3;
+ * decoTree.maxTrunkSize = 6;
+ * decoTree.minCrownSize = 5;
+ * decoTree.maxCrownSize = 10;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGCupressusSempervirens() { + + super(); + + this.validGroundBlocks = new ArrayList(Arrays.asList(Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState())); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + IBlockState g = world.getBlockState(new BlockPos(x, y - 1, z)); + boolean validGroundBlock = false; + + for (int i = 0; i < this.validGroundBlocks.size(); i++) { + if (g == this.validGroundBlocks.get(i)) { + validGroundBlock = true; + break; + } + } + + if (!validGroundBlock) { + return false; + } + + int i, j, k; + for (i = 0; i < this.trunkSize; i++) { + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + y++; + } + + int small = (int) Math.ceil((double) (this.crownSize / 2)); + int large = small; + + for (i = 0; i < large; i++) { + if (!this.noLeaves) { + + for (j = -2; j <= 2; j++) { + for (k = -2; k <= 2; k++) { + if (Math.abs(j) + Math.abs(k) != 4 && ((j > -2 && k > -2 && j < 2 && k < 2) || rand.nextInt(4) != 0)) { + world.setBlockState(new BlockPos(x + j, y, z + k), this.leavesBlock, this.generateFlag); + } + } + } + } + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + y++; + } + + for (i = 0; i < small; i++) { + if (!this.noLeaves) { + + for (j = -1; j <= 1; j++) { + for (k = -1; k <= 1; k++) { + if (Math.abs(j) + Math.abs(k) < 2 || (rand.nextInt(4) != 0)) { + world.setBlockState(new BlockPos(x + j, y, z + k), this.leavesBlock, this.generateFlag); + } + } + } + + if (i == 0) { + world.setBlockState(new BlockPos(x + 1, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x - 1, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z + 1), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z - 1), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x + 2, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x - 2, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z + 2), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z - 2), this.leavesBlock, this.generateFlag); + } + } + + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + y++; + } + + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + + if (!this.noLeaves) { + world.setBlockState(new BlockPos(x + 1, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x - 1, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z + 1), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z - 1), this.leavesBlock, this.generateFlag); + + world.setBlockState(new BlockPos(x, y + 1, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y + 2, z), this.leavesBlock, this.generateFlag); + } + + return true; + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaPungens.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaPungens.java new file mode 100644 index 00000000..7f13659b --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaPungens.java @@ -0,0 +1,152 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.Random; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * Picea Pungens (Colorado Spruce) + */ +public class TreeRTGPiceaPungens extends TreeRTG { + + /** + * Picea Pungens (Colorado Spruce)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGPiceaPungens());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)1;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)1;
+ * decoTree.minTrunkSize = 2;
+ * decoTree.maxTrunkSize = 7;
+ * decoTree.minCrownSize = 6;
+ * decoTree.maxCrownSize = 17;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGPiceaPungens() { + + super(); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + IBlockState g = world.getBlockState(new BlockPos(x, y - 1, z)); + if (g != Blocks.GRASS.getDefaultState() && g != Blocks.DIRT.getDefaultState()) { + return false; + } + + int small = (int) Math.ceil((double) (this.crownSize / 2)); + int large = small; + + int i, j, k; + for (i = 0; i < this.trunkSize; i++) { + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + y++; + } + + for (i = 0; i < large; i++) { + if (!this.noLeaves) { + + for (j = -2; j <= 2; j++) { + for (k = -2; k <= 2; k++) { + if (Math.abs(j) + Math.abs(k) != 4 && ((j > -2 && k > -2 && j < 2 && k < 2) || rand.nextInt(4) != 0)) { + world.setBlockState(new BlockPos(x + j, y, z + k), this.leavesBlock, this.generateFlag); + } + } + } + } + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + y++; + } + + for (i = 0; i < small; i++) { + if (!this.noLeaves) { + + for (j = -1; j <= 1; j++) { + for (k = -1; k <= 1; k++) { + if (Math.abs(j) + Math.abs(k) < 2 || (rand.nextInt(4) != 0)) { + world.setBlockState(new BlockPos(x + j, y, z + k), this.leavesBlock, this.generateFlag); + } + } + } + + if (i == 0) { + world.setBlockState(new BlockPos(x + 1, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x - 1, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z + 1), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z - 1), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x + 2, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x - 2, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z + 2), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z - 2), this.leavesBlock, this.generateFlag); + } + } + + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + y++; + } + + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + + if (!this.noLeaves) { + + world.setBlockState(new BlockPos(x + 1, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x - 1, y, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z + 1), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y, z - 1), this.leavesBlock, this.generateFlag); + + world.setBlockState(new BlockPos(x, y + 1, z), this.leavesBlock, this.generateFlag); + world.setBlockState(new BlockPos(x, y + 2, z), this.leavesBlock, this.generateFlag); + } + + return true; + } + + @Override + public void buildBranch(World world, Random rand, int x, int y, int z, int dX, int dZ, int logLength, int leaveSize) { + + for (int i = -1; i <= 1; i++) { + for (int j = -1; j <= 1; j++) { + for (int k = 0; k < 2; k++) { + if (Math.abs(i) + Math.abs(j) + Math.abs(k) < leaveSize + 1) { + buildLeaves(world, x + i + (dX * logLength), y + k, z + j + (dZ * logLength)); + } + } + } + } + + for (int m = 1; m <= logLength; m++) { + world.setBlockState(new BlockPos(x + (dX * m), y, z + (dZ * m)), this.logBlock, this.generateFlag); + } + } + + @Override + public void buildLeaves(World world, int x, int y, int z) { + + if (!this.noLeaves) { + + IBlockState b = world.getBlockState(new BlockPos(x, y, z)); + if (b.getMaterial() == Material.AIR) { + world.setBlockState(new BlockPos(x, y, z), this.leavesBlock, this.generateFlag); + } + } + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaSitchensis.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaSitchensis.java new file mode 100644 index 00000000..f063c52f --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPiceaSitchensis.java @@ -0,0 +1,165 @@ +package rtg.world.gen.feature.tree.rtg; + +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import rtg.util.BlockUtil; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; + +/** + * Picea Sitchensis (Sitka Spruce) + */ +public class TreeRTGPiceaSitchensis extends TreeRTG { + + /** + * Picea Sitchensis (Sitka Spruce)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGPiceaSitchensis());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)1;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)1;
+ * decoTree.minTrunkSize = 4;
+ * decoTree.maxTrunkSize = 9;
+ * decoTree.minCrownSize = 5;
+ * decoTree.maxCrownSize = 14;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGPiceaSitchensis() { + + super(); + + this.logBlock = BlockUtil.getStateLog(1); + this.leavesBlock = BlockUtil.getStateLeaf(1); + this.trunkSize = 8; + this.crownSize = 10; + this.noLeaves = false; + + this.validGroundBlocks = new ArrayList(Arrays.asList(Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState())); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + IBlockState g = world.getBlockState(new BlockPos(x, y - 1, z)); + boolean validGroundBlock = false; + + for (int i = 0; i < this.validGroundBlocks.size(); i++) { + if (g == this.validGroundBlocks.get(i)) { + validGroundBlock = true; + break; + } + } + + if (!validGroundBlock) { + return false; + } + + int i; + for (i = 0; i < this.trunkSize; i++) { + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + y++; + } + + int pX = 0; + int pZ = 0; + for (i = 0; i < this.crownSize; i++) { + if (rand.nextInt(2) == 0 && i < this.crownSize - 2) { + int dX = -1 + rand.nextInt(3); + int dZ = -1 + rand.nextInt(3); + + if (dX == 0 && dZ == 0) { + dX = -1 + rand.nextInt(3); + dZ = -1 + rand.nextInt(3); + } + + if (pX == dX && rand.nextBoolean()) { + dX = -dX; + } + if (pZ == dZ && rand.nextBoolean()) { + dZ = -dZ; + } + + pX = dX; + pZ = dZ; + + buildBranch(world, rand, x, y, z, dX, dZ, i < this.crownSize - 10 ? 2 : 1, i < this.crownSize - 6 ? 2 : 1); + } + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + + if (i < this.crownSize - 2) { + if (rand.nextBoolean()) { + buildLeaves(world, x, y, z + 1); + } + if (rand.nextBoolean()) { + buildLeaves(world, x, y, z - 1); + } + if (rand.nextBoolean()) { + buildLeaves(world, x + 1, y, z); + } + if (rand.nextBoolean()) { + buildLeaves(world, x - 1, y, z); + } + } + + y++; + } + + buildLeaves(world, x, y - 1, z + 1); + buildLeaves(world, x, y - 1, z - 1); + buildLeaves(world, x + 1, y - 1, z); + buildLeaves(world, x - 1, y - 1, z); + buildLeaves(world, x, y, z); + + return true; + } + + @Override + public void buildBranch(World world, Random rand, int x, int y, int z, int dX, int dZ, int logLength, int leaveSize) { + + for (int i = -1; i <= 1; i++) { + for (int j = -1; j <= 1; j++) { + for (int k = 0; k < 2; k++) { + if (Math.abs(i) + Math.abs(j) + Math.abs(k) < leaveSize + 1) { + buildLeaves(world, x + i + (dX * logLength), y + k, z + j + (dZ * logLength)); + } + } + } + } + + for (int m = 1; m <= logLength; m++) { + world.setBlockState(new BlockPos(x + (dX * m), y, z + (dZ * m)), this.logBlock, this.generateFlag); + } + } + + @Override + public void buildLeaves(World world, int x, int y, int z) { + + if (!this.noLeaves) { + + IBlockState b = world.getBlockState(new BlockPos(x, y, z)); + if (b.getMaterial() == Material.AIR) { + world.setBlockState(new BlockPos(x, y, z), this.leavesBlock, this.generateFlag); + } + } + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusMonticola.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusMonticola.java new file mode 100644 index 00000000..33a7de01 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusMonticola.java @@ -0,0 +1,239 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLog; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import net.minecraftforge.common.IPlantable; + +/** + * Pinus Monticola (California Mountain Pine) + */ +public class TreeRTGPinusMonticola extends TreeRTG { + + protected IBlockState trunkLog; + + private int height; + + /** + * Pinus Monticola (California Mountain Pine)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGPinusMonticola());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)0;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)0;
+ * decoTree.minTrunkSize = 2;
+ * decoTree.maxTrunkSize = 3;
+ * decoTree.minCrownSize = 5;
+ * decoTree.maxCrownSize = 12;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGPinusMonticola() { + + super(); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + try { + this.trunkLog = this.logBlock.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE); + } + catch (Exception e) { + this.trunkLog = this.logBlock; + } + + this.height = this.trunkSize + this.crownSize; + + int l = rand.nextInt(this.height * 2) + this.height * 2; + int i1 = this.height + rand.nextInt(this.height); + int j1 = l - i1; + int k1 = 2 + rand.nextInt(2); + boolean flag = true; + + if (y >= 1 && y + l + 1 <= 256) { + int i2; + int l3; + + for (int l1 = y; l1 <= y + 1 + l && flag; ++l1) { + boolean flag1 = true; + + if (l1 - y < i1) { + l3 = 0; + } + else { + l3 = k1; + } + + for (i2 = x - l3; i2 <= x + l3 && flag; ++i2) { + for (int j2 = z - l3; j2 <= z + l3 && flag; ++j2) { + if (l1 >= 0 && l1 < 256) { + BlockPos pos2 = new BlockPos(new BlockPos(i2, l1, j2)); + IBlockState block = world.getBlockState(pos2); + + if (!block.getBlock().isAir(block, world, pos2) + && !block.getBlock().isLeaves(block, world, pos2) + && block != Blocks.SNOW_LAYER.getDefaultState()) { + flag = false; + } + } + else { + flag = false; + } + } + } + } + + if (!flag) { + return false; + } + else { + BlockPos pos3 = new BlockPos(x, y - 1, z); + IBlockState block1 = world.getBlockState(pos3); + + boolean isSoil = block1.getBlock().canSustainPlant(block1, world, pos3, EnumFacing.UP, (IPlantable) block1); + if (isSoil && y < 256 - l - 1) { + block1.getBlock().onPlantGrow(block1, world, pos3.down(), pos3); + l3 = rand.nextInt(2); + i2 = 1; + byte b0 = 0; + int k2; + int i4; + + for (i4 = 0; i4 <= j1; ++i4) { + k2 = y + l - i4; + + for (int l2 = x - l3; l2 <= x + l3; ++l2) { + int i3 = l2 - x; + + for (int j3 = z - l3; j3 <= z + l3; ++j3) { + int k3 = j3 - z; + BlockPos pos5 = new BlockPos(l2, k2, j3); + + if ((Math.abs(i3) != l3 || Math.abs(k3) != l3 || l3 <= 0) + && world.getBlockState(pos5).getBlock().canBeReplacedByLeaves(world.getBlockState(pos5), world, pos5)) { + if (!this.noLeaves) { + world.setBlockState(new BlockPos(l2, k2, j3), this.leavesBlock, this.generateFlag); + } + } + } + } + + if (l3 >= i2) { + l3 = b0; + b0 = 1; + ++i2; + + if (i2 > k1) { + i2 = k1; + } + } + else { + ++l3; + } + } + + i4 = rand.nextInt(3); + + for (k2 = 0; k2 < l - i4; ++k2) { + IBlockState block2 = world.getBlockState(new BlockPos(x, y + k2, z)); + BlockPos pos4 = new BlockPos(x, y + k2, z); + + if (block2.getBlock().isAir(block2, world, pos4) + || block2.getBlock().isLeaves(block2, world, pos4) + || block2 == Blocks.SNOW_LAYER.getDefaultState()) { + world.setBlockState(new BlockPos(x, y + k2, z), this.logBlock, this.generateFlag); + } + } + + if (this.height > 4) { + buildTrunk(world, rand, x, y, z); + } + + return true; + } + else { + return false; + } + } + } + else { + return false; + } + } + + @Override + public void buildTrunk(World world, Random rand, int x, int y, int z) { + + int[] pos = new int[]{0, 0, 1, 0, 0, 1, -1, 0, 0, -1}; + int sh; + Block b; + for (int t = 0; t < (pos.length / 2); t++) { + sh = rand.nextInt(4) + y - 2; + while (sh > y - 1) { + if (world.getBlockState(new BlockPos(x + pos[t * 2], sh, z + pos[t * 2 + 1])) == Blocks.GRASS.getDefaultState()) { + break; + } + + world.setBlockState(new BlockPos(x + pos[t * 2], sh, z + pos[t * 2 + 1]), this.trunkLog, this.generateFlag); + sh--; + } + } + } + + @Override + public void buildBranch(World world, Random rand, int x, int y, int z, int dX, int dZ, int logLength, int leaveSize) { + + if (logLength == 3 && Math.abs(dX) + Math.abs(dZ) == 2) { + logLength--; + } + + for (int i = -1; i <= 1; i++) { + for (int j = -1; j <= 1; j++) { + for (int k = 0; k < 2; k++) { + if (Math.abs(i) + Math.abs(j) + Math.abs(k) < leaveSize + 1) { + buildLeaves(world, x + i + (dX * logLength), y + k, z + j + (dZ * logLength)); + } + } + } + } + + for (int m = 1; m <= logLength; m++) { + world.setBlockState(new BlockPos(x + (dX * m), y, z + (dZ * m)), this.logBlock, this.generateFlag); + } + } + + @Override + public void buildLeaves(World world, int x, int y, int z) { + + if (!this.noLeaves) { + + IBlockState b = world.getBlockState(new BlockPos(x, y, z)); + if (b.getMaterial() == Material.AIR) { + world.setBlockState(new BlockPos(x, y, z), this.leavesBlock, this.generateFlag); + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusNigra.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusNigra.java new file mode 100644 index 00000000..3dd84e87 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusNigra.java @@ -0,0 +1,134 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.Random; + +import net.minecraft.block.BlockLog; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * Pinus Nigra (Austrian Pine) + */ +public class TreeRTGPinusNigra extends TreeRTG { + + protected IBlockState trunkLog; + + /** + * Pinus Nigra (Austrian Pine)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGPinusNigra());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)0;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)0;
+ * decoTree.minTrunkSize = 18;
+ * decoTree.maxTrunkSize = 27;
+ * decoTree.minCrownSize = 7;
+ * decoTree.maxCrownSize = 10;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGPinusNigra() { + + super(); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + try { + this.trunkLog = this.logBlock.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE); + } + catch (Exception e) { + this.trunkLog = this.logBlock; + } + + IBlockState g = world.getBlockState(new BlockPos(x, y - 1, z)); + if (g != Blocks.GRASS.getDefaultState() && g != Blocks.DIRT.getDefaultState()) { + return false; + } + + int height = this.trunkSize; + int leafheight = this.crownSize; + float branchIncrease = 0.25f; + + for (int i = 0; i <= height; i++) { + world.setBlockState(new BlockPos(x, y + i, z), this.logBlock, this.generateFlag); + } + buildLeaves(world, rand, x, y + height, z, 2); + buildTrunk(world, rand, x, y, z); + + int dir = 0, b; + float xd, yd, bl = 1f; + for (int j = height; j >= height - leafheight; j--) { + bl += branchIncrease; + dir += rand.nextInt(180) + 90; + dir -= dir > 360 ? 360 : 0; + xd = (float) Math.cos(dir * Math.PI / 180f); + yd = (float) Math.sin(dir * Math.PI / 180f); + + for (b = 0; b <= bl; b++) { + world.setBlockState(new BlockPos(x + (int) (b * xd), y + j, z + (int) (b * yd)), this.trunkLog, this.generateFlag); + } + buildLeaves(world, rand, x, y + j, z, 2); + buildLeaves(world, rand, x + (int) (b * xd), y + j, z + (int) (b * yd), 2); + } + + return true; + } + + @Override + public void buildLeaves(World world, Random rand, int x, int y, int z, int size) { + + if (!this.noLeaves) { + + int l; + int t = (int) Math.pow(size, 2); + for (int i = -size; i <= size; i++) { + for (int j = -size; j <= size; j++) { + for (int k = -size; k <= size; k++) { + l = i * i + j * j + k * k; + if (l <= t) { + if (world.isAirBlock(new BlockPos(x + i, y + j, z + k)) && (l < t / 2 || rand.nextBoolean())) { + world.setBlockState(new BlockPos(x + i, y + j, z + k), this.leavesBlock, this.generateFlag); + } + } + } + } + } + } + } + + @Override + public void buildTrunk(World world, Random rand, int x, int y, int z) { + + int[] pos = new int[]{0, 0, 1, 0, 0, 1, -1, 0, 0, -1}; + int sh; + for (int t = 0; t < 5; t++) { + sh = rand.nextInt(3) + y; + while (sh > y - 3) { + if (world.getBlockState(new BlockPos(x + pos[t * 2], sh, z + pos[t * 2 + 1])) == Blocks.DIRT.getDefaultState()) { + break; + } + + world.setBlockState(new BlockPos(x + pos[t * 2], sh, z + pos[t * 2 + 1]), this.trunkLog, this.generateFlag); + sh--; + } + } + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusPonderosa.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusPonderosa.java new file mode 100644 index 00000000..fa970d55 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGPinusPonderosa.java @@ -0,0 +1,207 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.block.BlockLog; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * Pinus Ponderosa (Ponderosa Pine) + */ +public class TreeRTGPinusPonderosa extends TreeRTG { + + protected IBlockState trunkLog; + + /** + * Pinus Ponderosa (Ponderosa Pine)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGPinusPonderosa());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)0;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)0;
+ * decoTree.minTrunkSize = 11;
+ * decoTree.maxTrunkSize = 21;
+ * decoTree.minCrownSize = 15;
+ * decoTree.maxCrownSize = 29;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGPinusPonderosa() { + + super(); + + this.validGroundBlocks = new ArrayList(Arrays.asList( + Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState() + )); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + try { + this.trunkLog = this.logBlock.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE); + } + catch (Exception e) { + this.trunkLog = this.logBlock; + } + + int startY = y; + + IBlockState g = world.getBlockState(new BlockPos(x, y - 1, z)); + boolean validGroundBlock = false; + + for (int i = 0; i < this.validGroundBlocks.size(); i++) { + if (g == this.validGroundBlocks.get(i)) { + validGroundBlock = true; + break; + } + } + + if (!validGroundBlock) { + return false; + } + + buildTrunk(world, rand, x + 1, y, z); + buildTrunk(world, rand, x - 1, y, z); + buildTrunk(world, rand, x, y, z + 1); + buildTrunk(world, rand, x, y, z - 1); + + int i; + for (i = 0; i < trunkSize; i++) { + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + if (i > 5 && rand.nextInt(7) == 0) { + int dX = -1 + rand.nextInt(3); + int dZ = -1 + rand.nextInt(3); + + if (dX == 0 && dZ == 0) { + dX = -1 + rand.nextInt(3); + dZ = -1 + rand.nextInt(3); + } + + buildBranch(world, rand, x, y, z, dX, dZ, 1, 1); + } + + y++; + } + + int pX = 0; + int pZ = 0; + int j; + for (i = 0; i < crownSize; i++) { + if (rand.nextInt(i < crownSize - 12 && i > 2 ? 2 : 1) == 0 && i < crownSize - 2) { + int dX = -1 + rand.nextInt(3); + int dZ = -1 + rand.nextInt(3); + + if (dX == 0 && dZ == 0) { + dX = -1 + rand.nextInt(3); + dZ = -1 + rand.nextInt(3); + } + + if (pX == dX && rand.nextBoolean()) { + dX = -dX; + } + if (pZ == dZ && rand.nextBoolean()) { + dZ = -dZ; + } + + pX = dX; + pZ = dZ; + + buildBranch(world, rand, x, y, z, dX, dZ, + i < crownSize - 12 && i > 3 ? 3 : i < crownSize - 8 ? 2 : 1, + i < crownSize - 5 ? 2 : 1 + ); + } + world.setBlockState(new BlockPos(x, y, z), this.logBlock, this.generateFlag); + + if (i < crownSize - 2) { + if (rand.nextBoolean()) { + buildLeaves(world, x, y, z + 1); + } + if (rand.nextBoolean()) { + buildLeaves(world, x, y, z - 1); + } + if (rand.nextBoolean()) { + buildLeaves(world, x + 1, y, z); + } + if (rand.nextBoolean()) { + buildLeaves(world, x - 1, y, z); + } + } + + y++; + } + + buildLeaves(world, x, y - 1, z + 1); + buildLeaves(world, x, y - 1, z - 1); + buildLeaves(world, x + 1, y - 1, z); + buildLeaves(world, x - 1, y - 1, z); + buildLeaves(world, x, y, z); + + return true; + } + + @Override + public void buildTrunk(World world, Random rand, int x, int y, int z) { + + int h = (int) Math.ceil(this.trunkSize / 4f); + h = h + rand.nextInt(h * 2); + for (int i = -1; i < h; i++) { + world.setBlockState(new BlockPos(x, y + i, z), this.trunkLog, this.generateFlag); + } + } + + @Override + public void buildBranch(World world, Random rand, int x, int y, int z, int dX, int dZ, int logLength, int leaveSize) { + + if (logLength == 3 && Math.abs(dX) + Math.abs(dZ) == 2) { + logLength--; + } + + for (int i = -1; i <= 1; i++) { + for (int j = -1; j <= 1; j++) { + for (int k = 0; k < 2; k++) { + if (Math.abs(i) + Math.abs(j) + Math.abs(k) < leaveSize + 1) { + buildLeaves(world, x + i + (dX * logLength), y + k, z + j + (dZ * logLength)); + } + } + } + } + + for (int m = 1; m <= logLength; m++) { + world.setBlockState(new BlockPos(x + (dX * m), y, z + (dZ * m)), this.logBlock, this.generateFlag); + } + } + + @Override + public void buildLeaves(World world, int x, int y, int z) { + + if (!this.noLeaves) { + + IBlockState b = world.getBlockState(new BlockPos(x, y, z)); + if (b.getMaterial() == Material.AIR) { + world.setBlockState(new BlockPos(x, y, z), this.leavesBlock, this.generateFlag); + } + } + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGQuercusRobur.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGQuercusRobur.java new file mode 100644 index 00000000..7a153e0f --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGQuercusRobur.java @@ -0,0 +1,412 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockLog; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; + +import com.google.common.collect.Lists; + +/** + * Quercus Robur (Pedunculate Oak) + */ +public class TreeRTGQuercusRobur extends TreeRTG { + + int heightLimit; + int height; + double heightAttenuation = 0.618D; + double branchSlope = 0.381D; + double scaleWidth = 1.0D; + double leafDensity = 1.0D; + int trunkSize = 1; + int heightLimitLimit = 12; + /** + * Sets the distance limit for how far away the generator will populate leaves from the base leaf node. + */ + int leafDistanceLimit = 4; + List field_175948_j; + private Random rand; + private World world; + private BlockPos basePos = BlockPos.ORIGIN; + + /** + * Quercus Robur (Pedunculate Oak)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGQuercusRobur());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)0;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)0;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGQuercusRobur() { + + super(); + + this.logBlock = Blocks.LOG.getDefaultState(); + this.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.trunkSize = 4; + this.crownSize = 8; + + this.validGroundBlocks = new ArrayList(Arrays.asList(Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState())); + } + + /** + * Generates a list of leaf nodes for the tree, to be populated by generateLeaves. + */ + void generateLeafNodeList() { + + this.heightLimit = this.trunkSize + this.crownSize; + + this.height = (int) ((double) this.heightLimit * this.heightAttenuation); + + if (this.height >= this.heightLimit) { + this.height = this.heightLimit - 1; + } + + int i = (int) (1.382D + Math.pow(this.leafDensity * (double) this.heightLimit / 13.0D, 2.0D)); + + if (i < 1) { + i = 1; + } + + int j = this.basePos.getY() + this.height; + int k = this.heightLimit - this.leafDistanceLimit; + this.field_175948_j = Lists.newArrayList(); + this.field_175948_j.add(new TreeRTGQuercusRobur.FoliageCoordinates(this.basePos.up(k), j)); + + for (; k >= 0; --k) { + float f = this.layerSize(k); + + if (f >= 0.0F) { + for (int l = 0; l < i; ++l) { + double d0 = this.scaleWidth * (double) f * ((double) this.rand.nextFloat() + 0.328D); + double d1 = (double) (this.rand.nextFloat() * 2.0F) * Math.PI; + double d2 = d0 * Math.sin(d1) + 0.5D; + double d3 = d0 * Math.cos(d1) + 0.5D; + BlockPos blockpos = this.basePos.add(d2, (double) (k - 1), d3); + BlockPos blockpos1 = blockpos.up(this.leafDistanceLimit); + + if (this.checkBlockLine(blockpos, blockpos1) == -1) { + int i1 = this.basePos.getX() - blockpos.getX(); + int j1 = this.basePos.getZ() - blockpos.getZ(); + double d4 = (double) blockpos.getY() - Math.sqrt((double) (i1 * i1 + j1 * j1)) * this.branchSlope; + int k1 = d4 > (double) j ? j : (int) d4; + BlockPos blockpos2 = new BlockPos(this.basePos.getX(), k1, this.basePos.getZ()); + + if (this.checkBlockLine(blockpos2, blockpos) == -1) { + this.field_175948_j.add(new TreeRTGQuercusRobur.FoliageCoordinates(blockpos, blockpos2.getY())); + } + } + } + } + } + } + + void func_181631_a(BlockPos p_181631_1_, float p_181631_2_, IBlockState p_181631_3_) { + + int i = (int) ((double) p_181631_2_ + 0.618D); + + for (int j = -i; j <= i; ++j) { + for (int k = -i; k <= i; ++k) { + if (Math.pow((double) Math.abs(j) + 0.5D, 2.0D) + Math.pow((double) Math.abs(k) + 0.5D, 2.0D) <= (double) (p_181631_2_ * p_181631_2_)) { + BlockPos blockpos = p_181631_1_.add(j, 0, k); + net.minecraft.block.state.IBlockState state = this.world.getBlockState(blockpos); + + if (state.getBlock().isAir(state, this.world, blockpos) || state.getBlock().isLeaves(state, this.world, blockpos)) { + this.setBlockAndNotifyAdequately(this.world, blockpos, p_181631_3_); + } + } + } + } + } + + /** + * Gets the rough size of a layer of the tree. + */ + float layerSize(int p_76490_1_) { + + if ((float) p_76490_1_ < (float) this.heightLimit * 0.3F) { + return -1.0F; + } + else { + float f = (float) this.heightLimit / 2.0F; + float f1 = f - (float) p_76490_1_; + float f2 = MathHelper.sqrt_float(f * f - f1 * f1); + + if (f1 == 0.0F) { + f2 = f; + } + else if (Math.abs(f1) >= f) { + return 0.0F; + } + + return f2 * 0.5F; + } + } + + float leafSize(int p_76495_1_) { + + return p_76495_1_ >= 0 && p_76495_1_ < this.leafDistanceLimit ? (p_76495_1_ != 0 && p_76495_1_ != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F; + } + + /** + * Generates the leaves surrounding an individual entry in the leafNodes list. + */ + void generateLeafNode(BlockPos pos) { + + for (int i = 0; i < this.leafDistanceLimit; ++i) { + this.func_181631_a(pos.up(i), this.leafSize(i), this.leavesBlock.withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false))); + } + } + + void func_175937_a(BlockPos p_175937_1_, BlockPos p_175937_2_, IBlockState p_175937_3_) { + + BlockPos blockpos = p_175937_2_.add(-p_175937_1_.getX(), -p_175937_1_.getY(), -p_175937_1_.getZ()); + int i = this.getGreatestDistance(blockpos); + float f = (float) blockpos.getX() / (float) i; + float f1 = (float) blockpos.getY() / (float) i; + float f2 = (float) blockpos.getZ() / (float) i; + + for (int j = 0; j <= i; ++j) { + BlockPos blockpos1 = p_175937_1_.add((double) (0.5F + (float) j * f), (double) (0.5F + (float) j * f1), (double) (0.5F + (float) j * f2)); + BlockLog.EnumAxis blocklog$enumaxis = this.func_175938_b(p_175937_1_, blockpos1); + this.setBlockAndNotifyAdequately(this.world, blockpos1, p_175937_3_.withProperty(BlockLog.LOG_AXIS, blocklog$enumaxis)); + } + } + + /** + * Returns the absolute greatest distance in the BlockPos object. + */ + private int getGreatestDistance(BlockPos posIn) { + + int i = MathHelper.abs_int(posIn.getX()); + int j = MathHelper.abs_int(posIn.getY()); + int k = MathHelper.abs_int(posIn.getZ()); + return k > i && k > j ? k : (j > i ? j : i); + } + + private BlockLog.EnumAxis func_175938_b(BlockPos p_175938_1_, BlockPos p_175938_2_) { + + BlockLog.EnumAxis blocklog$enumaxis = BlockLog.EnumAxis.Y; + int i = Math.abs(p_175938_2_.getX() - p_175938_1_.getX()); + int j = Math.abs(p_175938_2_.getZ() - p_175938_1_.getZ()); + int k = Math.max(i, j); + + if (k > 0) { + if (i == k) { + blocklog$enumaxis = BlockLog.EnumAxis.X; + } + else if (j == k) { + blocklog$enumaxis = BlockLog.EnumAxis.Z; + } + } + + return blocklog$enumaxis; + } + + /** + * Generates the leaf portion of the tree as specified by the leafNodes list. + */ + void generateLeaves() { + + for (TreeRTGQuercusRobur.FoliageCoordinates worldgenbigtree$foliagecoordinates : this.field_175948_j) { + this.generateLeafNode(worldgenbigtree$foliagecoordinates); + } + } + + /** + * Indicates whether or not a leaf node requires additional wood to be added to preserve integrity. + */ + boolean leafNodeNeedsBase(int p_76493_1_) { + + return (double) p_76493_1_ >= (double) this.heightLimit * 0.2D; + } + + /** + * Places the trunk for the big tree that is being generated. Able to generate double-sized trunks by changing a + * field that is always 1 to 2. + */ + void generateTrunk() { + + BlockPos blockpos = this.basePos; + BlockPos blockpos1 = this.basePos.up(this.height); + IBlockState block = this.logBlock; + this.func_175937_a(blockpos, blockpos1, block); + + if (this.trunkSize == 2) { + this.func_175937_a(blockpos.east(), blockpos1.east(), block); + this.func_175937_a(blockpos.east().south(), blockpos1.east().south(), block); + this.func_175937_a(blockpos.south(), blockpos1.south(), block); + } + } + + /** + * Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade. + */ + void generateLeafNodeBases() { + + for (TreeRTGQuercusRobur.FoliageCoordinates worldgenbigtree$foliagecoordinates : this.field_175948_j) { + int i = worldgenbigtree$foliagecoordinates.func_177999_q(); + BlockPos blockpos = new BlockPos(this.basePos.getX(), i, this.basePos.getZ()); + + if (!blockpos.equals(worldgenbigtree$foliagecoordinates) && this.leafNodeNeedsBase(i - this.basePos.getY())) { + this.func_175937_a(blockpos, worldgenbigtree$foliagecoordinates, this.logBlock); + } + } + } + + /** + * Checks a line of blocks in the world from the first coordinate to triplet to the second, returning the distance + * (in blocks) before a non-air, non-leaf block is encountered and/or the end is encountered. + */ + int checkBlockLine(BlockPos posOne, BlockPos posTwo) { + + BlockPos blockpos = posTwo.add(-posOne.getX(), -posOne.getY(), -posOne.getZ()); + int i = this.getGreatestDistance(blockpos); + float f = (float) blockpos.getX() / (float) i; + float f1 = (float) blockpos.getY() / (float) i; + float f2 = (float) blockpos.getZ() / (float) i; + + if (i == 0) { + return -1; + } + else { + for (int j = 0; j <= i; ++j) { + BlockPos blockpos1 = posOne.add((double) (0.5F + (float) j * f), (double) (0.5F + (float) j * f1), (double) (0.5F + (float) j * f2)); + + if (!this.isReplaceable(blockpos1)) { + + String replaceBlock = world.getBlockState(blockpos1).getBlock().getLocalizedName(); + + //Logger.debug("Block at %d %d %d (%s) is not replaceable.", blockpos1.getX(), blockpos1.getY(), blockpos1.getZ(), replaceBlock); + + return j; + } + } + + return -1; + } + } + + public void func_175904_e() { + + this.leafDistanceLimit = 5; + } + + public boolean generate(World worldIn, Random rand, BlockPos position) { + + this.world = worldIn; + this.basePos = position; + this.rand = new Random(rand.nextLong()); + + int x = position.getX(); + int y = position.getY(); + int z = position.getZ(); + + IBlockState g = world.getBlockState(new BlockPos(x, y - 1, z)); + boolean validGroundBlock = false; + + for (int i = 0; i < this.validGroundBlocks.size(); i++) { + if (g == this.validGroundBlocks.get(i)) { + validGroundBlock = true; + break; + } + } + + if (!validGroundBlock) { + return false; + } + + if (this.heightLimit == 0) { + this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit); + } + + if (!this.validTreeLocation()) { + this.world = null; //Fix vanilla Mem leak, holds latest world + return false; + } + else { + this.generateLeafNodeList(); + this.generateLeaves(); + this.generateTrunk(); + this.generateLeafNodeBases(); + this.world = null; //Fix vanilla Mem leak, holds latest world + return true; + } + } + + /** + * Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height + * limit, is valid. + */ + private boolean validTreeLocation() { + + BlockPos down = this.basePos.down(); + net.minecraft.block.state.IBlockState state = this.world.getBlockState(down); + boolean isSoil = state.getBlock().canSustainPlant(state, this.world, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling) Blocks.SAPLING)); + + if (!isSoil) { + //Logger.debug("Invalid tree location! Ground block is not soil."); + return false; + } + else { + int i = this.checkBlockLine(this.basePos, this.basePos.up(this.heightLimit - 1)); + + if (i == -1) { + return true; + } + else if (i < 6) { + //Logger.debug("Invalid tree location! checkBlockLine() == false"); + return false; + } + else { + this.heightLimit = i; + return true; + } + } + } + + private boolean isReplaceable(BlockPos pos) { + + IBlockState state = world.getBlockState(pos); + return state.getBlock().isAir(state, world, pos) + || state.getBlock().isLeaves(state, world, pos) + || state.getBlock() == Blocks.SAPLING + || state.getBlock().isWood(world, pos); + } + + static class FoliageCoordinates extends BlockPos { + + private final int field_178000_b; + + public FoliageCoordinates(BlockPos p_i45635_1_, int p_i45635_2_) { + + super(p_i45635_1_.getX(), p_i45635_1_.getY(), p_i45635_1_.getZ()); + this.field_178000_b = p_i45635_2_; + } + + public int func_177999_q() { + + return this.field_178000_b; + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGRhizophoraMucronata.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGRhizophoraMucronata.java new file mode 100644 index 00000000..ee8dff32 --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGRhizophoraMucronata.java @@ -0,0 +1,191 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.Random; + +import net.minecraft.block.BlockLog; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import rtg.config.rtg.ConfigRTG; + + +/** + * Rhizophora Mucronata (Asiatic Mangrove) + */ +public class TreeRTGRhizophoraMucronata extends TreeRTG { + + protected int minBranches; + protected int maxBranches; + protected float branchLength; + protected float verStart; + protected float verRand; + protected IBlockState trunkLog; + + /** + * Rhizophora Mucronata (Asiatic Mangrove)

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves
+ * minBranches, maxBranches, branchLength, verStart, verRand

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGRhizophoraMucronata(3, 4, 13f, 0.32f, 0.1f));
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)3;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)3;
+ * decoTree.minTrunkSize = 3;
+ * decoTree.maxTrunkSize = 4;
+ * decoTree.minCrownSize = 10;
+ * decoTree.maxCrownSize = 27;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGRhizophoraMucronata(int minBranches, int maxBranches, float branchLength, float verStart, float verRand) { + + this(); + + this.minBranches = minBranches; + this.maxBranches = maxBranches; + this.branchLength = branchLength; + this.verStart = verStart; + this.verRand = verRand; + } + + public TreeRTGRhizophoraMucronata() { + + super(); + + this.minBranches = 3; + this.maxBranches = 4; + this.branchLength = 13f; + this.verStart = 0.32f; + this.verRand = 0.1f; + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + try { + this.trunkLog = this.logBlock.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE); + } + catch (Exception e) { + this.trunkLog = this.logBlock; + } + + IBlockState b = world.getBlockState(new BlockPos(x, y - 1, z)); + + if (b == Blocks.SAND.getDefaultState() && !ConfigRTG.allowTreesToGenerateOnSand) { + return false; + } + + if (b != Blocks.GRASS.getDefaultState() && b != Blocks.DIRT.getDefaultState() && b != Blocks.SAND.getDefaultState()) { + if (!(b == Blocks.WATER.getDefaultState() && world.getBlockState(new BlockPos(x, y - 2, z)) == Blocks.SAND.getDefaultState() && world.getBlockState(new BlockPos(x, y, z)) == Blocks.AIR.getDefaultState())) { + return false; + } + } + + int branch = this.minBranches + rand.nextInt(this.maxBranches - this.minBranches + 1); + + if (this.trunkSize > 0) { + for (int k = 0; k < 3; k++) { + generateBranch(world, rand, x, y + this.trunkSize, z, (120 * k) - 40 + rand.nextInt(80), 1.6f + rand.nextFloat() * 0.1f, this.trunkSize * 2f, 1f, true); + } + } + + for (int i = y + this.trunkSize; i < y + this.crownSize; i++) { + world.setBlockState(new BlockPos(x, i, z), this.logBlock, this.generateFlag); + } + + float horDir, verDir; + int eX, eY, eZ; + for (int j = 0; j < branch; j++) { + horDir = (120 * j) - 60 + rand.nextInt(120); + verDir = verStart + rand.nextFloat() * verRand; + generateBranch(world, rand, x, y + this.crownSize, z, horDir, verDir, branchLength, 1f, false); + + eX = x + (int) (Math.cos(horDir * Math.PI / 180D) * verDir * branchLength); + eZ = z + (int) (Math.sin(horDir * Math.PI / 180D) * verDir * branchLength); + eY = y + this.crownSize + (int) ((1f - verDir) * branchLength); + + for (int m = 0; m < 1; m++) { + generateLeaves(world, rand, eX, eY, eZ, 4f, 1.2f); + } + } + + return true; + } + + /* + * horDir = number between -180D and 180D + * verDir = number between 1F (horizontal) and 0F (vertical) + */ + public void generateBranch(World world, Random rand, float x, float y, float z, double horDir, float verDir, float length, float speed, boolean isTrunk) { + + if (verDir < 0f) { + verDir = -verDir; + } + + float c = 0f; + float velY = 1f - verDir; + + if (verDir > 1f) { + verDir = 1f - (verDir - 1f); + } + + float velX = (float) Math.cos(horDir * Math.PI / 180D) * verDir; + float velZ = (float) Math.sin(horDir * Math.PI / 180D) * verDir; + + while (c < length) { + + if (isTrunk) { + world.setBlockState(new BlockPos((int)x, (int)y, (int)z), this.trunkLog, this.generateFlag); + } + else { + world.setBlockState(new BlockPos((int)x, (int)y, (int)z), this.logBlock, this.generateFlag); + } + + x += velX; + y += velY; + z += velZ; + + c += speed; + } + } + + public void generateLeaves(World world, Random rand, int x, int y, int z, float size, float width) { + + float dist; + int i, j, k, s = (int) (size - 1f), w = (int) ((size - 1f) * width); + for (i = -w; i <= w; i++) { + for (j = -s; j <= s; j++) { + for (k = -w; k <= w; k++) { + dist = Math.abs((float) i / width) + (float) Math.abs(j) + Math.abs((float) k / width); + if (dist <= size - 0.5f || (dist <= size && rand.nextBoolean())) { + if (dist < 0.6f) { + world.setBlockState(new BlockPos(x + i, y + j, z + k), this.logBlock, this.generateFlag); + } + + if (!this.noLeaves) { + + if (world.isAirBlock(new BlockPos(x + i, y + j, z + k))) { + world.setBlockState(new BlockPos(x + i, y + j, z + k), this.leavesBlock, this.generateFlag); + } + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGSalixMyrtilloides.java b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGSalixMyrtilloides.java new file mode 100644 index 00000000..d0a6f3ca --- /dev/null +++ b/src/api/java/rtg/world/gen/feature/tree/rtg/TreeRTGSalixMyrtilloides.java @@ -0,0 +1,171 @@ +package rtg.world.gen.feature.tree.rtg; + +import java.util.Random; + +import net.minecraft.block.BlockLog; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * Salix Myrtilloides (Swamp Willow) + */ +public class TreeRTGSalixMyrtilloides extends TreeRTG { + + protected IBlockState trunkLog; + + /** + * Salix Myrtilloides (Swamp Willow)
+ * Only spawns near water

+ * Relevant variables:
+ * logBlock, logMeta, leavesBlock, leavesMeta, trunkSize, crownSize, noLeaves

+ * DecoTree example:
+ * DecoTree decoTree = new DecoTree(new TreeRTGSalixMyrtilloides());
+ * decoTree.treeType = DecoTree.TreeType.RTG_TREE;
+ * decoTree.treeCondition = DecoTree.TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE;
+ * decoTree.distribution = new DecoTree.Distribution(100f, 6f, 0.8f);
+ * decoTree.treeConditionNoise = 0f;
+ * decoTree.treeConditionChance = 4;
+ * decoTree.logBlock = Blocks.LOG;
+ * decoTree.logMeta = (byte)0;
+ * decoTree.leavesBlock = Blocks.LEAVES;
+ * decoTree.leavesMeta = (byte)0;
+ * decoTree.noLeaves = false;
+ * this.addDeco(decoTree); + *

+ * + */ + public TreeRTGSalixMyrtilloides() { + + super(); + + this.setLogBlock(Blocks.LOG.getDefaultState()).setLeavesBlock(Blocks.LEAVES.getDefaultState()); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + try { + this.trunkLog = this.logBlock.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE); + } + catch (Exception e) { + this.trunkLog = this.logBlock; + } + + IBlockState cb; + boolean earth = false; + boolean water = false; + + for (int c1 = -2; c1 <= 2; c1++) { + for (int c3 = -2; c3 <= 2; c3++) { + for (int c2 = -1; c2 <= 1; c2++) { + cb = world.getBlockState(new BlockPos(x + c1, y + c2, z + c3)); + if (cb == Blocks.GRASS.getDefaultState()) { + earth = true; + } + else if (cb == Blocks.WATER.getDefaultState()) { + water = true; + } + } + } + } + + if (!(earth && water)) { + return false; + } + + int height = 13; + int leaveheight = 5; + int branches = 6; + int branchLenght = 6; + + for (int i = 0; i < height; i++) { + world.setBlockState(new BlockPos(x, y + i, z), this.logBlock, this.generateFlag); + } + createLeavesAroundBranch(world, rand, x, y + height, z, 3, 2); + createTrunk(world, rand, x, y, z); + + int dir = rand.nextInt((int) (360f / branches)); + int bl; + float xd, yd, hd, c; + boolean m; + for (int b = 0; b < branches; b++) { + c = 0; + hd = height - rand.nextFloat() * leaveheight - 2f; + dir += (int) (360f / branches); + xd = (float) Math.cos(dir * Math.PI / 180f); + yd = (float) Math.sin(dir * Math.PI / 180f); + m = false; + + while (c < branchLenght) { + if (c > branchLenght / 2 && !m) { + m = true; + createLeavesAroundBranch(world, rand, x + (int) (c * xd), y + (int) hd, z + (int) (c * yd), 2, 1); + } + c++; + hd += 0.5f; + + world.setBlockState( + new BlockPos(x + (int) (c * xd), y + (int) hd, z + (int) (c * yd)), this.trunkLog, this.generateFlag + ); + } + createLeavesAroundBranch(world, rand, x + (int) (c * xd), y + (int) hd, z + (int) (c * yd), 2, 1); + } + + return true; + } + + private void createLeavesAroundBranch(World world, Random rand, int x, int y, int z, int s, int c) { + + int l; + int t = (int) Math.pow(s, 2); + for (int i = -s; i <= s; i++) { + for (int j = -s; j <= s; j++) { + for (int k = -s; k <= s; k++) { + l = i * i + j * j + k * k; + if (l <= t) { + if (world.isAirBlock(new BlockPos(x + i, y + j, z + k)) && (l < t - c || rand.nextBoolean())) { + if (!this.noLeaves) { + + world.setBlockState(new BlockPos(x + i, y + j, z + k), this.leavesBlock, this.generateFlag); + if (j < -(s - 2) && rand.nextInt(3) != 0) { + createVine(world, rand, x + i, y + j, z + k); + } + } + } + } + } + } + } + } + + private void createVine(World world, Random rand, int x, int y, int z) { + + int r = rand.nextInt(3) + 5; + for (int i = -1; i > -r; i--) { + if (!world.isAirBlock(new BlockPos(x, y + i, z))) { + break; + } + world.setBlockState(new BlockPos(x, y + i, z), this.leavesBlock, this.generateFlag); + } + } + + private void createTrunk(World world, Random rand, int x, int y, int z) { + + int[] pos = new int[]{0, 0, 1, 0, 0, 1, -1, 0, 0, -1}; + int sh; + + for (int t = 0; t < 5; t++) { + sh = rand.nextInt(3) + y; + while (sh > y - 3) { + world.setBlockState(new BlockPos(x + pos[t * 2], sh, z + pos[t * 2 + 1]), this.trunkLog, this.generateFlag); + sh--; + } + } + } +} diff --git a/src/api/java/rtg/world/gen/genlayer/GenLayerNoRivers.java b/src/api/java/rtg/world/gen/genlayer/GenLayerNoRivers.java new file mode 100644 index 00000000..2149669f --- /dev/null +++ b/src/api/java/rtg/world/gen/genlayer/GenLayerNoRivers.java @@ -0,0 +1,30 @@ +package rtg.world.gen.genlayer; + +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.GenLayerRiverMix; + +/** + * A replacement for GenLayerRiverMix that doesn't place rivers + * + * @author Zeno410 + */ +public class GenLayerNoRivers extends GenLayerRiverMix { + + public GenLayerNoRivers(long par1, GenLayer par3GenLayer) { + + super(par1, par3GenLayer, par3GenLayer); + super.parent = par3GenLayer; + } + + @Override + public void initWorldGenSeed(long arg0) { + + parent.initWorldGenSeed(arg0); + } + + public int[] getInts(int x, int z, int xSize, int zSize) { + + return parent.getInts(x, z, xSize, zSize); + } + +} diff --git a/src/api/java/rtg/world/gen/genlayer/RiverRemover.java b/src/api/java/rtg/world/gen/genlayer/RiverRemover.java new file mode 100644 index 00000000..c557f235 --- /dev/null +++ b/src/api/java/rtg/world/gen/genlayer/RiverRemover.java @@ -0,0 +1,34 @@ +package rtg.world.gen.genlayer; + +import net.minecraft.world.gen.layer.GenLayer; +import net.minecraft.world.gen.layer.GenLayerRiverMix; +import net.minecraft.world.gen.layer.GenLayerVoronoiZoom; + +import rtg.util.Accessor; +import rtg.util.Logger; + +/** + * @author Zeno410 + */ +public class RiverRemover { + + private Accessor riverMixBiome = + new Accessor<>("field_75910_b", "biomePatternGeneratorChain"); + + public GenLayer[] riverLess(GenLayer[] vanilla) { + + try { + GenLayer riverMixParent = this.riverMixBiome.get((GenLayerRiverMix)vanilla[0]); + if (riverMixParent == null) { + return vanilla; + } + GenLayer withoutRivers = new GenLayerNoRivers(100L, riverMixParent); + GenLayerVoronoiZoom genlayervoronoizoom = new GenLayerVoronoiZoom(10L, withoutRivers); + return new GenLayer[]{withoutRivers, genlayervoronoizoom, withoutRivers}; + } + catch (Exception e) { + Logger.error("RiverRemover failed"); + return vanilla; + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/structure/MapGenScatteredFeatureRTG.java b/src/api/java/rtg/world/gen/structure/MapGenScatteredFeatureRTG.java new file mode 100644 index 00000000..0ebcddc3 --- /dev/null +++ b/src/api/java/rtg/world/gen/structure/MapGenScatteredFeatureRTG.java @@ -0,0 +1,238 @@ +package rtg.world.gen.structure; + +import java.util.*; +import java.util.Map.Entry; + +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.init.Biomes; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.structure.ComponentScatteredFeaturePieces; +import net.minecraft.world.gen.structure.MapGenScatteredFeature; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureStart; + +import net.minecraftforge.common.BiomeDictionary; + +import com.google.common.collect.Lists; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.Logger; + +/** + * Author: Choonster (https://github.com/Choonster) + * Source: https://github.com/Choonster/TestMod2/blob/1575b85ad8949381215f3aeb6ca76ea2368074de/src/main/java/com/choonster/testmod2/world/gen/structure/MapGenScatteredFeatureModBiomes.java + * Modified by: WhichOnesPink (https://github.com/whichonespink44) + *

+ * Allows scattered features (jungle/desert temples, witch huts) to spawn in modded biomes, equivalent to the vanilla biomes, + * i.e. any biome registered as JUNGLE, SANDY or SWAMP + * http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2471489-jungle-and-desert-temple-spawn-biome + *

+ * This class was modified by WhichOnesPink on 2015-11-05 to allow the spawning of scattered features ONLY + * in biomes that have been registered with multiple BiomeDictionary types that are shared by their vanilla counterparts. + * For example, desert temples don't generate in SANDY biomes - they are only allowed to generate in biomes that + * have been registered as HOT + DRY + SANDY. + *

+ * This class has also been modified to resolve a very specific use case involving Thaumcraft world gen: + * https://github.com/Team-RTG/Realistic-Terrain-Generation/issues/249 + */ +public class MapGenScatteredFeatureRTG extends MapGenScatteredFeature +{ + private static final List BIOMELIST = Arrays.asList(new Biome[] {Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.JUNGLE, Biomes.JUNGLE_HILLS, Biomes.SWAMPLAND, Biomes.ICE_PLAINS, Biomes.COLD_TAIGA}); + private final List scatteredFeatureSpawnList; + private int maxDistanceBetweenScatteredFeatures; + private final int minDistanceBetweenScatteredFeatures; + + public MapGenScatteredFeatureRTG() + { + int minDistance = ConfigRTG.minDistanceScatteredFeatures; + int maxDistance = ConfigRTG.maxDistanceScatteredFeatures; + + if (minDistance > maxDistance) { + minDistance = 8; + maxDistance = 32; + } + + this.scatteredFeatureSpawnList = Lists.newArrayList(); + this.maxDistanceBetweenScatteredFeatures = maxDistance; + this.minDistanceBetweenScatteredFeatures = minDistance; + this.scatteredFeatureSpawnList.add(new Biome.SpawnListEntry(EntityWitch.class, 1, 1, 1)); + } + + public MapGenScatteredFeatureRTG(Map p_i2061_1_) + { + this(); + + for (Entry entry : p_i2061_1_.entrySet()) + { + if (((String)entry.getKey()).equals("distance")) + { + this.maxDistanceBetweenScatteredFeatures = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.maxDistanceBetweenScatteredFeatures, 9); + } + } + } + + @Override + public String getStructureName() + { + return "Temple"; + } + + @Override + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) + { + int i = chunkX; + int j = chunkZ; + + if (chunkX < 0) + { + chunkX -= this.maxDistanceBetweenScatteredFeatures - 1; + } + + if (chunkZ < 0) + { + chunkZ -= this.maxDistanceBetweenScatteredFeatures - 1; + } + + int k = chunkX / this.maxDistanceBetweenScatteredFeatures; + int l = chunkZ / this.maxDistanceBetweenScatteredFeatures; + Random random = this.worldObj.setRandomSeed(k, l, 14357617); + k *= this.maxDistanceBetweenScatteredFeatures; + l *= this.maxDistanceBetweenScatteredFeatures; + k += random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + l += random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + + if (i == k && j == l) + { + BlockPos pos = new BlockPos(i * 16 + 8, 0, j * 16 + 8); + Biome biome = this.worldObj.getBiomeProvider().getBiome(pos); + + if (null == biome) { + Logger.error("MapGenScatteredFeatureRTG#canSpawnStructureAtCoords received a null biome at %d %d.", pos.getX(), pos.getZ()); + return false; + } + + //Desert temple. + if (canSpawnDesertTemple(biome)) { + return true; + } + + //Jungle temple. + if (canSpawnJungleTemple(biome)) { + return true; + } + + //Witch hut. + if (canSpawnWitchHut(biome)) { + return true; + } + + //Igloo. + if (canSpawnIgloo(biome)) { + return true; + } + } + + return false; + } + + @Override + protected StructureStart getStructureStart(int chunkX, int chunkZ) + { + return new MapGenScatteredFeatureRTG.Start(this.worldObj, this.rand, chunkX, chunkZ); + } + + @Override + public boolean isSwampHut(BlockPos p_175798_1_) + { + StructureStart structurestart = this.getStructureAt(p_175798_1_); + + if (structurestart != null && structurestart instanceof MapGenScatteredFeatureRTG.Start && !structurestart.getComponents().isEmpty()) + { + StructureComponent structurecomponent = (StructureComponent)structurestart.getComponents().get(0); + return structurecomponent instanceof ComponentScatteredFeaturePieces.SwampHut; + } + else + { + return false; + } + } + + @Override + public List getScatteredFeatureSpawnList() + { + return this.scatteredFeatureSpawnList; + } + + public static class Start extends StructureStart + { + public Start() + { + } + + public Start(World worldIn, Random random, int chunkX, int chunkZ) + { + this(worldIn, random, chunkX, chunkZ, worldIn.getBiome(new BlockPos(chunkX * 16 + 8, 0, chunkZ * 16 + 8))); + } + + public Start(World worldIn, Random random, int chunkX, int chunkZ, Biome biomeIn) + { + super(chunkX, chunkZ); + + if (null == biomeIn) { + Logger.error("MapGenScatteredFeatureRTG.Start received a null biome at %d %d.", chunkX * 16 + 8, chunkZ * 16 + 8); + return; + } + + LinkedList arrComponents = new LinkedList(); + + if (canSpawnDesertTemple(biomeIn)) { + ComponentScatteredFeaturePieces.DesertPyramid desertpyramid = new ComponentScatteredFeaturePieces.DesertPyramid(random, chunkX * 16, chunkZ * 16); + arrComponents.add(desertpyramid); + } + + if (canSpawnJungleTemple(biomeIn)) { + ComponentScatteredFeaturePieces.JunglePyramid junglepyramid = new ComponentScatteredFeaturePieces.JunglePyramid(random, chunkX * 16, chunkZ * 16); + arrComponents.add(junglepyramid); + } + + if (canSpawnWitchHut(biomeIn)) { + ComponentScatteredFeaturePieces.SwampHut swamphut = new ComponentScatteredFeaturePieces.SwampHut(random, chunkX * 16, chunkZ * 16); + arrComponents.add(swamphut); + } + + if (canSpawnIgloo(biomeIn)) { + ComponentScatteredFeaturePieces.Igloo igloo = new ComponentScatteredFeaturePieces.Igloo(random, chunkX * 16, chunkZ * 16); + arrComponents.add(igloo); + } + + this.components.clear(); + + if (arrComponents.size() > 0) { + this.components.add((StructureComponent) arrComponents.get(random.nextInt(arrComponents.size()))); + } + + Logger.debug("Scattered feature candidate at %d, %d", chunkX * 16, chunkZ * 16); + + this.updateBoundingBox(); + } + } + + private static boolean canSpawnDesertTemple(Biome b) { + return (BiomeDictionary.isBiomeOfType(b, BiomeDictionary.Type.HOT) && BiomeDictionary.isBiomeOfType(b, BiomeDictionary.Type.DRY) && BiomeDictionary.isBiomeOfType(b, BiomeDictionary.Type.SANDY)); + } + + private static boolean canSpawnJungleTemple(Biome b) { + return (BiomeDictionary.isBiomeOfType(b, BiomeDictionary.Type.HOT) && BiomeDictionary.isBiomeOfType(b, BiomeDictionary.Type.WET) && BiomeDictionary.isBiomeOfType(b, BiomeDictionary.Type.JUNGLE)); + } + + private static boolean canSpawnWitchHut(Biome b) { + return (BiomeDictionary.isBiomeOfType(b, BiomeDictionary.Type.WET) && BiomeDictionary.isBiomeOfType(b, BiomeDictionary.Type.SWAMP)); + } + + private static boolean canSpawnIgloo(Biome b) { + return (BiomeDictionary.isBiomeOfType(b, BiomeDictionary.Type.COLD) && BiomeDictionary.isBiomeOfType(b, BiomeDictionary.Type.SNOWY) && BiomeDictionary.isBiomeOfType(b, BiomeDictionary.Type.PLAINS)); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/structure/MapGenStrongholdRTG.java b/src/api/java/rtg/world/gen/structure/MapGenStrongholdRTG.java new file mode 100644 index 00000000..3c66ce95 --- /dev/null +++ b/src/api/java/rtg/world/gen/structure/MapGenStrongholdRTG.java @@ -0,0 +1,243 @@ +package rtg.world.gen.structure; + +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.structure.MapGenStronghold; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureStart; +import net.minecraft.world.gen.structure.StructureStrongholdPieces; + +import com.google.common.collect.Lists; + +import rtg.config.rtg.ConfigRTG; + +public class MapGenStrongholdRTG extends MapGenStronghold +{ + public final List allowedBiomes; + private boolean ranBiomeCheck; + private ChunkPos[] structureCoords; + private double distance; + private int spread; + + public MapGenStrongholdRTG() + { + int strongholdCount = ConfigRTG.strongholdCount; + double strongholdDistance = (double)ConfigRTG.strongholdDistance; + int strongholdSpread = ConfigRTG.strongholdSpread; + + this.structureCoords = new ChunkPos[strongholdCount]; // Count (Vanilla = 128) + this.distance = strongholdDistance; // Distance (Vanilla = 32.0D) + this.spread = strongholdSpread; // Spread (Vanilla = 3) + this.allowedBiomes = Lists.newArrayList(); + + for (Biome biome : Biome.REGISTRY) + { + if (biome != null && biome.getBaseHeight() > 0.0F && !net.minecraftforge.common.BiomeManager.strongHoldBiomesBlackList.contains(biome)) + { + this.allowedBiomes.add(biome); + } + } + + for (Biome biome : net.minecraftforge.common.BiomeManager.strongHoldBiomes) + { + if (!this.allowedBiomes.contains(biome)) + { + this.allowedBiomes.add(biome); + } + } + } + + public MapGenStrongholdRTG(Map p_i2068_1_) + { + this(); + + for (Entry entry : p_i2068_1_.entrySet()) + { + if (((String)entry.getKey()).equals("distance")) + { + this.distance = MathHelper.parseDoubleWithDefaultAndMax((String)entry.getValue(), this.distance, 1.0D); + } + else if (((String)entry.getKey()).equals("count")) + { + this.structureCoords = new ChunkPos[MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.structureCoords.length, 1)]; + } + else if (((String)entry.getKey()).equals("spread")) + { + this.spread = MathHelper.parseIntWithDefaultAndMax((String)entry.getValue(), this.spread, 1); + } + } + } + + public String getStructureName() + { + return "Stronghold"; + } + + public BlockPos getClosestStrongholdPos(World worldIn, BlockPos pos) + { + if (!this.ranBiomeCheck) + { + this.generatePositions(); + this.ranBiomeCheck = true; + } + + BlockPos blockpos = null; + BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(0, 0, 0); + double d0 = Double.MAX_VALUE; + + for (ChunkPos chunkpos : this.structureCoords) + { + blockpos$mutableblockpos.setPos((chunkpos.chunkXPos << 4) + 8, 32, (chunkpos.chunkZPos << 4) + 8); + double d1 = blockpos$mutableblockpos.distanceSq(pos); + + if (blockpos == null) + { + blockpos = new BlockPos(blockpos$mutableblockpos); + d0 = d1; + } + else if (d1 < d0) + { + blockpos = new BlockPos(blockpos$mutableblockpos); + d0 = d1; + } + } + + return blockpos; + } + + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) + { + if (!this.ranBiomeCheck) + { + this.generatePositions(); + this.ranBiomeCheck = true; + } + + for (ChunkPos chunkpos : this.structureCoords) + { + if (chunkX == chunkpos.chunkXPos && chunkZ == chunkpos.chunkZPos) + { + return true; + } + } + + return false; + } + + private void generatePositions() + { + this.initializeStructureData(this.worldObj); + int i = 0; + + for (StructureStart structurestart : this.structureMap.values()) + { + if (i < this.structureCoords.length) + { + this.structureCoords[i++] = new ChunkPos(structurestart.getChunkPosX(), structurestart.getChunkPosZ()); + } + } + + Random random = new Random(); + random.setSeed(this.worldObj.getSeed()); + double d1 = random.nextDouble() * Math.PI * 2.0D; + int j = 0; + int k = 0; + int l = this.structureMap.size(); + + if (l < this.structureCoords.length) + { + for (int i1 = 0; i1 < this.structureCoords.length; ++i1) + { + double d0 = 4.0D * this.distance + this.distance * (double)j * 6.0D + (random.nextDouble() - 0.5D) * this.distance * 2.5D; + int j1 = (int)Math.round(Math.cos(d1) * d0); + int k1 = (int)Math.round(Math.sin(d1) * d0); + BlockPos blockpos = this.worldObj.getBiomeProvider().findBiomePosition((j1 << 4) + 8, (k1 << 4) + 8, 112, this.allowedBiomes, random); + + if (blockpos != null) + { + j1 = blockpos.getX() >> 4; + k1 = blockpos.getZ() >> 4; + } + + if (i1 >= l) + { + this.structureCoords[i1] = new ChunkPos(j1, k1); + } + + d1 += (Math.PI * 2D) / (double)this.spread; + ++k; + + if (k == this.spread) + { + ++j; + k = 0; + this.spread += 2 * this.spread / (j + 1); + this.spread = Math.min(this.spread, this.structureCoords.length - i1); + d1 += random.nextDouble() * Math.PI * 2.0D; + } + } + } + } + + protected List getCoordList() + { + List list = Lists.newArrayList(); + + for (ChunkPos chunkpos : this.structureCoords) + { + if (chunkpos != null) + { + list.add(chunkpos.getCenterBlock(64)); + } + } + + return list; + } + + protected StructureStart getStructureStart(int chunkX, int chunkZ) + { + MapGenStronghold.Start mapgenstronghold$start; + + for (mapgenstronghold$start = new MapGenStronghold.Start(this.worldObj, this.rand, chunkX, chunkZ); mapgenstronghold$start.getComponents().isEmpty() || ((StructureStrongholdPieces.Stairs2)mapgenstronghold$start.getComponents().get(0)).strongholdPortalRoom == null; mapgenstronghold$start = new MapGenStronghold.Start(this.worldObj, this.rand, chunkX, chunkZ)) + { + ; + } + + return mapgenstronghold$start; + } + + public static class Start extends StructureStart + { + public Start() + { + } + + public Start(World worldIn, Random random, int chunkX, int chunkZ) + { + super(chunkX, chunkZ); + StructureStrongholdPieces.prepareStructurePieces(); + StructureStrongholdPieces.Stairs2 structurestrongholdpieces$stairs2 = new StructureStrongholdPieces.Stairs2(0, random, (chunkX << 4) + 2, (chunkZ << 4) + 2); + this.components.add(structurestrongholdpieces$stairs2); + structurestrongholdpieces$stairs2.buildComponent(structurestrongholdpieces$stairs2, this.components, random); + List list = structurestrongholdpieces$stairs2.pendingChildren; + + while (!list.isEmpty()) + { + int i = random.nextInt(list.size()); + StructureComponent structurecomponent = (StructureComponent)list.remove(i); + structurecomponent.buildComponent(structurestrongholdpieces$stairs2, this.components, random); + } + + this.updateBoundingBox(); + this.markAvailableHeight(worldIn, random, 10); + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/structure/MapGenVillageRTG.java b/src/api/java/rtg/world/gen/structure/MapGenVillageRTG.java new file mode 100644 index 00000000..84a0d233 --- /dev/null +++ b/src/api/java/rtg/world/gen/structure/MapGenVillageRTG.java @@ -0,0 +1,154 @@ +package rtg.world.gen.structure; + +import javax.annotation.Nonnull; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Random; + +import net.minecraft.init.Biomes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.structure.MapGenVillage; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureStart; +import net.minecraft.world.gen.structure.StructureVillagePieces; + +import rtg.api.biome.BiomeConfig; +import rtg.config.rtg.ConfigRTG; +import rtg.util.Logger; +import rtg.world.WorldTypeRTG; +import rtg.world.biome.BiomeProviderRTG; +import rtg.world.biome.realistic.RealisticBiomeBase; + +@SuppressWarnings({"WeakerAccess", "unused"}) +public class MapGenVillageRTG extends MapGenVillage +{ + public static List VILLAGE_SPAWN_BIOMES = Arrays.asList(Biomes.PLAINS, Biomes.DESERT, Biomes.SAVANNA, Biomes.TAIGA); + private int size; + private int distance; + private final int minTownSeparation; + + public MapGenVillageRTG() { + this.size = ConfigRTG.villageSize; // Vanilla = 0 + this.distance = ConfigRTG.maxDistanceVillages; // Vanille = 32 + this.minTownSeparation = ConfigRTG.minDistanceVillages; // Vanilla = 8 + } + + public MapGenVillageRTG(Map map) { + this(); + + for (Entry entry : map.entrySet()) { + if (entry.getKey().equals("size")) { + this.size = MathHelper.parseIntWithDefaultAndMax(entry.getValue(), this.size, 0); + } + else if (entry.getKey().equals("distance")) { + this.distance = MathHelper.parseIntWithDefaultAndMax(entry.getValue(), this.distance, 9); + } + } + } + + @Override @Nonnull + public String getStructureName() { + return "Village"; + } + + @Override + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) { + boolean canSpawnVillage = false; + int i = chunkX; + int j = chunkZ; + + if (chunkX < 0) chunkX -= this.distance - 1; + if (chunkZ < 0) chunkZ -= this.distance - 1; + + int k = chunkX / this.distance; + int l = chunkZ / this.distance; + Random random = this.worldObj.setRandomSeed(k, l, 10387312); + k = k * this.distance; + l = l * this.distance; + k = k + random.nextInt(this.distance - 8); + l = l + random.nextInt(this.distance - 8); + + if (i == k && j == l) { + + boolean booRTGWorld = worldObj.getWorldInfo().getTerrainType() instanceof WorldTypeRTG; + boolean booRTGChunkManager = worldObj.getBiomeProvider() instanceof BiomeProviderRTG; + + int worldX = i * 16 + 8; + int worldZ = j * 16 + 8; + + if (booRTGWorld && booRTGChunkManager) { + + BiomeProviderRTG cmr = (BiomeProviderRTG) worldObj.getBiomeProvider(); + //Why are we flipping XZ here? No idea, but it works. - Pink + RealisticBiomeBase realisticBiome = cmr.getBiomeDataAt(worldX, worldZ); + + if (realisticBiome.config.getPropertyById(BiomeConfig.allowVillagesId).valueBoolean) { + canSpawnVillage = true; + Logger.debug("Potential village in %s at %d %d", realisticBiome.baseBiome.getBiomeName(), worldX, worldZ); + } + } + else canSpawnVillage = this.worldObj.getBiomeProvider().areBiomesViable(worldX, worldZ, 0, VILLAGE_SPAWN_BIOMES); + } + return canSpawnVillage; + } + + public static class Start extends StructureStart + { + private boolean hasMoreThanTwoComponents; + + public Start() {} + + public Start(World worldIn, Random rand, int x, int z, int size) { + super(x, z); + List list = StructureVillagePieces.getStructureVillageWeightedPieceList(rand, size); + StructureVillagePieces.Start structurevillagepieces$start = new StructureVillagePieces.Start(worldIn.getBiomeProvider(), 0, rand, (x << 4) + 2, (z << 4) + 2, list, size); + this.components.add(structurevillagepieces$start); + structurevillagepieces$start.buildComponent(structurevillagepieces$start, this.components, rand); + List list1 = structurevillagepieces$start.pendingRoads; + List list2 = structurevillagepieces$start.pendingHouses; + + while (!list1.isEmpty() || !list2.isEmpty()) { + if (list1.isEmpty()) { + int i = rand.nextInt(list2.size()); + StructureComponent structurecomponent = list2.remove(i); + structurecomponent.buildComponent(structurevillagepieces$start, this.components, rand); + } + else { + int j = rand.nextInt(list1.size()); + StructureComponent structurecomponent2 = list1.remove(j); + structurecomponent2.buildComponent(structurevillagepieces$start, this.components, rand); + } + } + + this.updateBoundingBox(); + int k = 0; + + for (StructureComponent structurecomponent1 : this.components) { + if (!(structurecomponent1 instanceof StructureVillagePieces.Road)) ++k; + } + this.hasMoreThanTwoComponents = k > 2; + } + + @Override + public boolean isSizeableStructure() { + return this.hasMoreThanTwoComponents; + } + + @Override + public void writeToNBT(NBTTagCompound tagCompound) { + super.writeToNBT(tagCompound); + tagCompound.setBoolean("Valid", this.hasMoreThanTwoComponents); + } + + @Override + public void readFromNBT(NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); + this.hasMoreThanTwoComponents = tagCompound.getBoolean("Valid"); + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/structure/StructureOceanMonumentRTG.java b/src/api/java/rtg/world/gen/structure/StructureOceanMonumentRTG.java new file mode 100644 index 00000000..630ca151 --- /dev/null +++ b/src/api/java/rtg/world/gen/structure/StructureOceanMonumentRTG.java @@ -0,0 +1,276 @@ +package rtg.world.gen.structure; + +import java.util.*; +import java.util.Map.Entry; +import javax.annotation.Nonnull; +import javax.annotation.ParametersAreNonnullByDefault; + +import net.minecraft.crash.CrashReport; +import net.minecraft.crash.CrashReportCategory; +import net.minecraft.entity.monster.EntityGuardian; +import net.minecraft.init.Biomes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ReportedException; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.layer.IntCache; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureOceanMonument; +import net.minecraft.world.gen.structure.StructureOceanMonumentPieces; +import net.minecraft.world.gen.structure.StructureStart; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.Logger; +import rtg.world.WorldTypeRTG; +import rtg.world.biome.BiomeProviderRTG; + +@SuppressWarnings({"WeakerAccess", "unused"}) +public class StructureOceanMonumentRTG extends StructureOceanMonument +{ + private int spacing; + private int separation; + public static final List WATER_BIOMES = Arrays.asList(Biomes.OCEAN, Biomes.DEEP_OCEAN); + public static final List SPAWN_BIOMES = Collections.singletonList(Biomes.DEEP_OCEAN); + private static final List MONUMENT_ENEMIES = Lists.newArrayList(); + + public StructureOceanMonumentRTG() + { + this.spacing = ConfigRTG.oceanMonumentSpacing; // Vanilla = 32 + this.separation = ConfigRTG.oceanMonumentSeparation; // Vanilla = 5 + } + + public StructureOceanMonumentRTG(Map p_i45608_1_) + { + this(); + + for (Entry entry : p_i45608_1_.entrySet()) + { + if (entry.getKey().equals("spacing")) + { + this.spacing = MathHelper.parseIntWithDefaultAndMax(entry.getValue(), this.spacing, 1); + } + else if (entry.getKey().equals("separation")) + { + this.separation = MathHelper.parseIntWithDefaultAndMax(entry.getValue(), this.separation, 1); + } + } + } + + @Override @Nonnull + public String getStructureName() + { + return "Monument"; + } + + protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) + { + int i = chunkX; + int j = chunkZ; + + if (chunkX < 0) + { + chunkX -= this.spacing - 1; + } + + if (chunkZ < 0) + { + chunkZ -= this.spacing - 1; + } + + int k = chunkX / this.spacing; + int l = chunkZ / this.spacing; + Random random = this.worldObj.setRandomSeed(k, l, 10387313); + k = k * this.spacing; + l = l * this.spacing; + k = k + (random.nextInt(this.spacing - this.separation) + random.nextInt(this.spacing - this.separation)) / 2; + l = l + (random.nextInt(this.spacing - this.separation) + random.nextInt(this.spacing - this.separation)) / 2; + + if (i == k && j == l) + { + int x = i * 16 + 8; + int z = j * 16 + 8; + + if (this.worldObj.getBiomeProvider().getBiome(new BlockPos(x, 64, z), Biomes.DEFAULT) != Biomes.DEEP_OCEAN) { + return false; + } + + if (!this.areBiomesViable(x, z, 16, SPAWN_BIOMES)) + { + return false; + } + + boolean flag = this.areBiomesViable(x, z, 29, WATER_BIOMES); + + if (flag) + { + Logger.debug("Ocean monument candidate at %d, %d", x, z); + return true; + } + } + + return false; + } + + public boolean areBiomesViable(int x, int z, int radius, List allowed) + { + // Are we in an RTG world? + if (!(this.worldObj.getWorldInfo().getTerrainType() instanceof WorldTypeRTG)) { + //Logger.debug("Could not generate ocean monument. This is not an RTG world."); + return false; + } + + // Do we have RTG's chunk manager? + if (!(this.worldObj.getBiomeProvider() instanceof BiomeProviderRTG)) { + //Logger.debug("Could not generate ocean monument. Incompatible chunk manager detected."); + return false; + } + + IntCache.resetIntCache(); + int i = x - radius >> 2; + int j = z - radius >> 2; + int k = x + radius >> 2; + int l = z + radius >> 2; + int i1 = k - i + 1; + int j1 = l - j + 1; + + BiomeProviderRTG cmr = (BiomeProviderRTG) this.worldObj.getBiomeProvider(); + int[] aint = cmr.getBiomesGens(i, j, i1, j1); + + try + { + for (int k1 = 0; k1 < i1 * j1; ++k1) + { + Biome biome = Biome.getBiome(aint[k1]); + + if (!allowed.contains(biome)) + { + //Logger.debug("Could not generate ocean monument. Biome (%d) nearby.", BiomeUtils.getId(biome)); + return false; + } + } + + return true; + } + catch (Throwable throwable) + { + CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Invalid Biome id"); + CrashReportCategory crashreportcategory = crashreport.makeCategory("Layer"); + crashreportcategory.addCrashSection("Layer", Arrays.toString(aint)); + crashreportcategory.addCrashSection("x", x); + crashreportcategory.addCrashSection("z", z); + crashreportcategory.addCrashSection("radius", radius); + crashreportcategory.addCrashSection("allowed", allowed); + throw new ReportedException(crashreport); + } + } + + @Override @Nonnull + protected StructureStart getStructureStart(int chunkX, int chunkZ) + { + return new StructureOceanMonumentRTG.StartMonument(this.worldObj, this.rand, chunkX, chunkZ); + } + + @Override @Nonnull + public List getScatteredFeatureSpawnList() + { + return MONUMENT_ENEMIES; + } + + static + { + MONUMENT_ENEMIES.add(new Biome.SpawnListEntry(EntityGuardian.class, 1, 2, 4)); + } + + public static class StartMonument extends StructureStart + { + private final Set processed = Sets.newHashSet(); + private boolean wasCreated; + + public StartMonument() {} + + public StartMonument(World worldIn, Random random, int chunkX, int chunkZ) + { + super(chunkX, chunkZ); + this.create(worldIn, random, chunkX, chunkZ); + } + + private void create(World worldIn, Random random, int chunkX, int chunkZ) + { + random.setSeed(worldIn.getSeed()); + long i = random.nextLong(); + long j = random.nextLong(); + long k = (long)chunkX * i; + long l = (long)chunkZ * j; + random.setSeed(k ^ l ^ worldIn.getSeed()); + int i1 = chunkX * 16 + 8 - 29; + int j1 = chunkZ * 16 + 8 - 29; + EnumFacing enumfacing = EnumFacing.Plane.HORIZONTAL.random(random); + this.components.add(new StructureOceanMonumentPieces.MonumentBuilding(random, i1, j1, enumfacing)); + this.updateBoundingBox(); + this.wasCreated = true; + } + + @Override @ParametersAreNonnullByDefault + public void generateStructure(World worldIn, Random rand, StructureBoundingBox structurebb) + { + if (!this.wasCreated) + { + this.components.clear(); + this.create(worldIn, rand, this.getChunkPosX(), this.getChunkPosZ()); + } + + super.generateStructure(worldIn, rand, structurebb); + } + + public boolean isValidForPostProcess(ChunkPos pair) + { + return !this.processed.contains(pair) && super.isValidForPostProcess(pair); + } + + public void notifyPostProcessAt(ChunkPos pair) + { + super.notifyPostProcessAt(pair); + this.processed.add(pair); + } + + public void writeToNBT(NBTTagCompound tagCompound) + { + super.writeToNBT(tagCompound); + NBTTagList nbttaglist = new NBTTagList(); + + for (ChunkPos chunkpos : this.processed) + { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setInteger("X", chunkpos.chunkXPos); + nbttagcompound.setInteger("Z", chunkpos.chunkZPos); + nbttaglist.appendTag(nbttagcompound); + } + + tagCompound.setTag("Processed", nbttaglist); + } + + public void readFromNBT(NBTTagCompound tagCompound) + { + super.readFromNBT(tagCompound); + + if (tagCompound.hasKey("Processed", 9)) + { + NBTTagList nbttaglist = tagCompound.getTagList("Processed", 10); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound = nbttaglist.getCompoundTagAt(i); + this.processed.add(new ChunkPos(nbttagcompound.getInteger("X"), nbttagcompound.getInteger("Z"))); + } + } + } + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/surface/SurfaceBase.java b/src/api/java/rtg/world/gen/surface/SurfaceBase.java new file mode 100644 index 00000000..aa58f61d --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceBase.java @@ -0,0 +1,151 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.config.rtg.ConfigRTG; +import rtg.util.CellNoise; +import rtg.util.ModPresenceTester; +import rtg.util.OpenSimplexNoise; +import rtg.util.UBColumnCache; + +public class SurfaceBase { + + private final static ModPresenceTester undergroundBiomesMod = new ModPresenceTester("UndergroundBiomes"); + // create UBColumnCache only if UB is present + private static UBColumnCache ubColumnCache = undergroundBiomesMod.present() ? new UBColumnCache() : null; + protected IBlockState topBlock; + protected IBlockState fillerBlock; + protected BiomeConfig biomeConfig; + + public SurfaceBase(BiomeConfig config, Block top, byte topByte, Block fill, byte fillByte) { + + this(config, top.getStateFromMeta(topByte), fill.getStateFromMeta(fillByte)); + } + + public SurfaceBase(BiomeConfig config, Block top, Block fill) { + + this(config, top.getDefaultState(), fill.getDefaultState()); + } + + public SurfaceBase(BiomeConfig config, IBlockState top, IBlockState fill) { + + if (config == null) { + throw new RuntimeException("Biome config in SurfaceBase is NULL."); + } + + biomeConfig = config; + + topBlock = top; + fillerBlock = fill; + + this.assignUserConfigs(config, top, fill); + } + + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + } + + protected IBlockState getShadowStoneBlock(World world, int i, int j, int x, int y, int k) { + + if ((undergroundBiomesMod.present()) && ConfigRTG.enableUBCStoneShadowing) { + + return Blocks.STONE.getDefaultState(); + } + else { + + return Block.getBlockFromName(ConfigRTG.shadowStoneBlockId).getStateFromMeta(ConfigRTG.shadowStoneBlockByte); + } + } + + protected IBlockState getShadowDesertBlock(World world, int i, int j, int x, int y, int k) { + + if ((undergroundBiomesMod.present()) && ConfigRTG.enableUBCDesertShadowing) { + + return Blocks.STONE.getDefaultState(); + } + else { + + return Block.getBlockFromName(ConfigRTG.shadowDesertBlockId).getStateFromMeta(ConfigRTG.shadowDesertBlockByte); + } + } + + protected IBlockState hcStone(World world, int i, int j, int x, int y, int k) { + + return Blocks.STONE.getDefaultState(); + } + + protected IBlockState hcCobble(World world, int worldX, int worldZ, int chunkX, int chunkZ, int worldY) { + + return Blocks.COBBLESTONE.getDefaultState(); + } + + public IBlockState getTopBlock() { + + return this.topBlock; + } + + public IBlockState getFillerBlock() { + + return this.fillerBlock; + } + + private void assignUserConfigs(BiomeConfig config, IBlockState top, IBlockState fill) { + + String userTopBlock = config._string(BiomeConfig.surfaceTopBlockId); + String userTopBlockMeta = config._string(BiomeConfig.surfaceTopBlockMetaId); + try { + if (Block.getBlockFromName(userTopBlock) != null) { + topBlock = Block.getBlockFromName(userTopBlock).getStateFromMeta(Byte.valueOf(userTopBlockMeta)); + } + else { + topBlock = top; + } + } + catch (Exception e) { + topBlock = top; + } + + String userFillerBlock = config._string(BiomeConfig.surfaceFillerBlockId); + String userFillerBlockMeta = config._string(BiomeConfig.surfaceFillerBlockMetaId); + try { + if (Block.getBlockFromName(userFillerBlock) != null) { + fillerBlock = Block.getBlockFromName(userFillerBlock).getStateFromMeta(Integer.parseInt(userFillerBlockMeta)); + } + else { + fillerBlock = fill; + } + } + catch (Exception e) { + fillerBlock = fill; + } + } + + protected IBlockState getConfigBlock(BiomeConfig config, String propertyId, String propertyMeta, IBlockState blockDefault) { + + IBlockState blockReturn = blockDefault; + String userBlockId = config._string(propertyId); + String userBlockMeta = config._string(propertyMeta); + + try { + if (Block.getBlockFromName(userBlockId) != null) { + blockReturn = Block.getBlockFromName(userBlockId).getStateFromMeta(Integer.parseInt(userBlockMeta)); + } + else { + blockReturn = blockDefault; + } + } + catch (Exception e) { + blockReturn = blockDefault; + } + + return blockReturn; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/surface/SurfaceCanyon.java b/src/api/java/rtg/world/gen/surface/SurfaceCanyon.java new file mode 100644 index 00000000..bcdfa1b0 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceCanyon.java @@ -0,0 +1,107 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CanyonColour; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceCanyon extends SurfaceBase { + + private int grassRaise = 0; + + public SurfaceCanyon(BiomeConfig config, IBlockState top, IBlockState fill, int grassHeight) { + + super(config, top, fill); + grassRaise = grassHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.3f; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth > -1 && depth < 12) { + if (cliff) { + primer.setBlockState(x, k, y, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + else { + if (depth > 4) { + primer.setBlockState(x, k, y, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + else if (k > 74 + grassRaise) { + if (rand.nextInt(5) == 0) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else { + if (depth == 0) { + primer.setBlockState(x, k, y, topBlock); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + else if (k < 62) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else if (k < 62 + grassRaise) { + if (depth == 0) { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + } + else if (k < 75 + grassRaise) { + if (depth == 0) { + int r = (int) ((k - (62 + grassRaise)) / 2f); + if (rand.nextInt(r + 1) == 0) { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + else if (rand.nextInt((int) (r / 2f) + 1) == 0) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + else { + if (depth == 0) { + primer.setBlockState(x, k, y, topBlock); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + else if (k > 63) { + primer.setBlockState(x, k, y, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceDesert.java b/src/api/java/rtg/world/gen/surface/SurfaceDesert.java new file mode 100644 index 00000000..1245b7d7 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceDesert.java @@ -0,0 +1,68 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceDesert extends SurfaceBase { + + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + private IBlockState bottomBlock; + + public SurfaceDesert(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState bottom, IBlockState cliff1, IBlockState cliff2) { + + super(config, top, filler); + + bottomBlock = bottom; + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 2.8f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, y, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, y, cliffBlock1); + } + } + else if (depth < 6) { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, bottomBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceDesertMountain.java b/src/api/java/rtg/world/gen/surface/SurfaceDesertMountain.java new file mode 100644 index 00000000..180b5308 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceDesertMountain.java @@ -0,0 +1,106 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceDesertMountain extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceDesertMountain(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceDesertMountain(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceDesertOasis.java b/src/api/java/rtg/world/gen/surface/SurfaceDesertOasis.java new file mode 100644 index 00000000..f6c924c6 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceDesertOasis.java @@ -0,0 +1,90 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceDesertOasis extends SurfaceBase { + + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + private byte sandMetadata; + private int cliffType; + + public SurfaceDesertOasis(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState cliff1, IBlockState cliff2, byte metadata, int cliff) { + + super(config, top, filler); + + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + sandMetadata = metadata; + cliffType = cliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f ? true : false; + boolean dirt = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (cliffType == 1) { + if (depth < 6) { + primer.setBlockState(x, k, z, cliffBlock1.getBlock().getDefaultState()); + } + } + else { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, z, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, z, cliffBlock1); + } + } + } + else if (depth < 6) { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / 12f, j / 12f) > -0.3f + ((k - 61f) / 15f)) { + dirt = true; + primer.setBlockState(x, k, z, topBlock); + } + else { + primer.setBlockState(x, k, z, BlockUtil.getStateSand(sandMetadata)); + } + } + else if (depth < 4) { + if (dirt) { + primer.setBlockState(x, k, z, fillerBlock); + } + else { + primer.setBlockState(x, k, z, BlockUtil.getStateSand(sandMetadata)); + } + } + else if (!dirt) { + primer.setBlockState(x, k, z, Blocks.SANDSTONE.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceDuneValley.java b/src/api/java/rtg/world/gen/surface/SurfaceDuneValley.java new file mode 100644 index 00000000..af4879e2 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceDuneValley.java @@ -0,0 +1,77 @@ +package rtg.world.gen.surface; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +import java.util.Random; + +public class SurfaceDuneValley extends SurfaceBase { + + private float valley; + private boolean dirt; + private boolean mix; + + public SurfaceDuneValley(BiomeConfig config, IBlockState top, IBlockState fill, float valleySize, boolean d, boolean m) { + + super(config, top, fill); + + valley = valleySize; + dirt = d; + mix = m; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float h = (simplex.noise2(i / valley, j / valley) + 0.25f) * 65f; + h = h < 1f ? 1f : h; + float m = simplex.noise2(i / 12f, j / 12f); + boolean sand = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + if (k > 90f + simplex.noise2(i / 24f, j / 24f) * 10f - h || (m < -0.28f && mix)) { + primer.setBlockState(x, k, z, Blocks.SAND.getDefaultState()); + //base[x * 16 + y] = RealisticBiomeVanillaBase.vanillaDesert; + sand = true; + } + else if (dirt && m < 0.22f || k < 62) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 6) { + if (sand) { + if (depth < 4) { + primer.setBlockState(x, k, z, Blocks.SAND.getDefaultState()); + } + else { + primer.setBlockState(x, k, z, Blocks.SANDSTONE.getDefaultState()); + } + } + else { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceGeneric.java b/src/api/java/rtg/world/gen/surface/SurfaceGeneric.java new file mode 100644 index 00000000..b3edfc98 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceGeneric.java @@ -0,0 +1,44 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class SurfaceGeneric extends SurfaceBase { + + public SurfaceGeneric(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceGrassCanyon.java b/src/api/java/rtg/world/gen/surface/SurfaceGrassCanyon.java new file mode 100644 index 00000000..4fa02894 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceGrassCanyon.java @@ -0,0 +1,67 @@ +package rtg.world.gen.surface; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockStainedGlass; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.item.EnumDyeColor; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +import java.util.Random; + +public class SurfaceGrassCanyon extends SurfaceBase { + + private byte claycolor; + + public SurfaceGrassCanyon(BiomeConfig config, IBlockState top, IBlockState fill, byte clayByte) { + + super(config, top, fill); + claycolor = clayByte; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth > -1 && depth < 12) { + if (cliff) { + primer.setBlockState(x, k, z, BlockUtil.getStateClay(claycolor)); + } + else { + if (depth > 4) { + primer.setBlockState(x, k, z, BlockUtil.getStateClay(claycolor)); + } + else { + if (depth == 0) { + primer.setBlockState(x, k, z, topBlock); + } + else { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + } + else if (k > 63) { + primer.setBlockState(x, k, z, BlockUtil.getStateClay(claycolor)); + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceGrassland.java b/src/api/java/rtg/world/gen/surface/SurfaceGrassland.java new file mode 100644 index 00000000..d53ca500 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceGrassland.java @@ -0,0 +1,63 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceGrassland extends SurfaceBase { + + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + + public SurfaceGrassland(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState cliff1, IBlockState cliff2) { + + super(config, top, filler); + + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, y, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, y, cliffBlock1); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceGrasslandMix1.java b/src/api/java/rtg/world/gen/surface/SurfaceGrasslandMix1.java new file mode 100644 index 00000000..d92fa571 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceGrasslandMix1.java @@ -0,0 +1,76 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceGrasslandMix1 extends SurfaceBase { + + private IBlockState mixBlock; + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + private float width; + private float height; + + public SurfaceGrasslandMix1(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, IBlockState cliff1, IBlockState cliff2, float mixWidth, float mixHeight) { + + super(config, top, filler); + + mixBlock = mix; + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + + width = mixWidth; + height = mixHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, y, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, y, cliffBlock1); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) > height) // > 0.27f, i / 12f + { + primer.setBlockState(x, k, y, mixBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceGrasslandMixBig.java b/src/api/java/rtg/world/gen/surface/SurfaceGrasslandMixBig.java new file mode 100644 index 00000000..1e3ae496 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceGrasslandMixBig.java @@ -0,0 +1,88 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceGrasslandMixBig extends SurfaceBase { + + private IBlockState mixBlockTop; + private IBlockState mixBlockFill; + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + private float width; + private float height; + private float smallW; + private float smallS; + + public SurfaceGrasslandMixBig(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFill, IBlockState cliff1, IBlockState cliff2, float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + mixBlockTop = mixTop; + mixBlockFill = mixFill; + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + + width = mixWidth; + height = mixHeight; + smallW = smallWidth; + smallS = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, y, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, y, cliffBlock1); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) + simplex.noise2(i / smallW, j / smallW) * smallS > height) { + primer.setBlockState(x, k, y, mixBlockTop); + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, mixBlockFill); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceIslandMountainStone.java b/src/api/java/rtg/world/gen/surface/SurfaceIslandMountainStone.java new file mode 100644 index 00000000..527287fc --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceIslandMountainStone.java @@ -0,0 +1,98 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceIslandMountainStone extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceIslandMountainStone(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceIslandMountainStone(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceMarshFix.java b/src/api/java/rtg/world/gen/surface/SurfaceMarshFix.java new file mode 100644 index 00000000..21603152 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceMarshFix.java @@ -0,0 +1,63 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceMarshFix extends SurfaceBase { + + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + + public SurfaceMarshFix(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState cliff1, IBlockState cliff2) { + + super(config, top, filler); + + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, y, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, y, cliffBlock1); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceMesa.java b/src/api/java/rtg/world/gen/surface/SurfaceMesa.java new file mode 100644 index 00000000..40d05b48 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceMesa.java @@ -0,0 +1,113 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CanyonColour; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceMesa extends SurfaceBase { + + private int[] claycolor = new int[100]; + + public SurfaceMesa(BiomeConfig config, Block top, byte topByte, Block fill, byte fillByte) { + + super(config, top, fill); + + int[] c = new int[]{1, 8, 0}; + OpenSimplexNoise simplex = new OpenSimplexNoise(2L); + + float n; + for (int i = 0; i < 100; i++) { + n = simplex.noise1(i / 3f) * 3f + simplex.noise1(i / 1f) * 0.3f + 1.5f; + n = n >= 3f ? 2.9f : n < 0f ? 0f : n; + claycolor[i] = c[(int) n]; + } + } + + public byte getClayColorForHeight(int k) { + + k -= 60; + k = k < 0 ? 0 : k > 99 ? 99 : k; + return (byte) claycolor[k]; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.3f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth > -1 && depth < 12) { + if (cliff) { + primer.setBlockState(x, k, y, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + else { + if (depth > 4) { + primer.setBlockState(x, k, y, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + else if (k > 77) { + if (rand.nextInt(5) == 0) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else { + if (depth == 0) { + primer.setBlockState(x, k, y, topBlock); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + else if (k < 69) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else if (k < 78) { + if (depth == 0) { + if (k < 72 && rand.nextInt(k - 69 + 1) == 0) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else if (rand.nextInt(5) == 0) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + else { + if (depth == 0) { + primer.setBlockState(x, k, y, topBlock); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + else if (k > 63) { + primer.setBlockState(x, k, y, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceMountainPolar.java b/src/api/java/rtg/world/gen/surface/SurfaceMountainPolar.java new file mode 100644 index 00000000..460a2d66 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceMountainPolar.java @@ -0,0 +1,28 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class SurfaceMountainPolar extends SurfaceBase { + + private float min; + + public SurfaceMountainPolar(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/surface/SurfaceMountainSnow.java b/src/api/java/rtg/world/gen/surface/SurfaceMountainSnow.java new file mode 100644 index 00000000..0aa078b9 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceMountainSnow.java @@ -0,0 +1,121 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceMountainSnow extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float iCliff = 0.3f; + private float iHeight = 100f; + private float iStrength = 50f; + private float cCliff = 1.5f; + + public SurfaceMountainSnow(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceMountainSnow(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float snowCliff, float snowHeight, float snowStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + iCliff = snowCliff; + iHeight = snowHeight; + iStrength = snowStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < iCliff + ((k - iHeight) / iStrength) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceMountainStone.java b/src/api/java/rtg/world/gen/surface/SurfaceMountainStone.java new file mode 100644 index 00000000..f5bc0819 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceMountainStone.java @@ -0,0 +1,106 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceMountainStone extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceMountainStone(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceMountainStone(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceMountainStoneMix1.java b/src/api/java/rtg/world/gen/surface/SurfaceMountainStoneMix1.java new file mode 100644 index 00000000..5fddec94 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceMountainStoneMix1.java @@ -0,0 +1,112 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceMountainStoneMix1 extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mix; + private float mixHeight; + + public SurfaceMountainStoneMix1(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff, IBlockState mixBlock, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mix = mixBlock; + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mix); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfacePolar.java b/src/api/java/rtg/world/gen/surface/SurfacePolar.java new file mode 100644 index 00000000..fd0e94ab --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfacePolar.java @@ -0,0 +1,76 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.SnowHeightCalculator; + +public class SurfacePolar extends SurfaceBase { + + public SurfacePolar(BiomeConfig config, IBlockState top, IBlockState fill) { + + super(config, top, fill); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + boolean water = false; + boolean riverPaint = false; + boolean grass = false; + + if (river > 0.05f && river + (simplex.noise2(i / 10f, j / 10f) * 0.1f) > 0.86f) { + riverPaint = true; + + if (simplex.noise2(i / 12f, j / 12f) > 0.25f) { + grass = true; + } + } + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (riverPaint) { + if (grass && depth < 4) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else if (depth == 0) { + if (rand.nextInt(2) == 0) { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + } + } + else if (depth > -1 && depth < 9) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + if (depth == 0 && k > 61 && k < 254) { + SnowHeightCalculator.calc(x, k, y, primer, noise); + } + } + } + else if (!water && b == Blocks.WATER) { + primer.setBlockState(x, k, y, Blocks.ICE.getDefaultState()); + water = true; + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceRedDesert.java b/src/api/java/rtg/world/gen/surface/SurfaceRedDesert.java new file mode 100644 index 00000000..b5f91378 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceRedDesert.java @@ -0,0 +1,63 @@ +package rtg.world.gen.surface; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +import java.util.Random; + +public class SurfaceRedDesert extends SurfaceBase { + + private IBlockState cliffBlock1; + private IBlockState bottomBlock; + + public SurfaceRedDesert(BiomeConfig config) { + + super(config, BlockUtil.getStateSand(1), BlockUtil.getStateSand(1)); + + bottomBlock = Blocks.SANDSTONE.getDefaultState(); + cliffBlock1 = BlockUtil.getStateClay(14); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth < 6) { + primer.setBlockState(x, k, z, cliffBlock1); + } + } + else if (depth < 6) { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, z, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + else { + primer.setBlockState(x, k, z, bottomBlock.getBlock().getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceRiverBOPCrag.java b/src/api/java/rtg/world/gen/surface/SurfaceRiverBOPCrag.java new file mode 100644 index 00000000..94d7f861 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceRiverBOPCrag.java @@ -0,0 +1,73 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceRiverBOPCrag extends SurfaceBase { + + private IBlockState topBlock; + private IBlockState fillerBlock; + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + + public SurfaceRiverBOPCrag(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState cliff1, IBlockState cliff2) { + + super(config, top, filler); + + topBlock = top; + fillerBlock = filler; + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, y, rand.nextInt(3) == 0 ? cliffBlock1 : cliffBlock2); + } + else if (depth < 10) { + primer.setBlockState(x, k, y, cliffBlock1); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceRiverOasis.java b/src/api/java/rtg/world/gen/surface/SurfaceRiverOasis.java new file mode 100644 index 00000000..82708a62 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceRiverOasis.java @@ -0,0 +1,48 @@ +package rtg.world.gen.surface; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class SurfaceRiverOasis extends SurfaceBase { + + public SurfaceRiverOasis(BiomeConfig config) { + + super(config, Blocks.GRASS, (byte) 0, Blocks.DIRT, (byte) 0); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + if (river > 0.05f && river + (simplex.noise2(i / 10f, j / 10f) * 0.15f) > 0.8f) { + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b != Blocks.WATER) { + depth++; + + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else if (depth > 4) { + return; + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/SurfaceTundra.java b/src/api/java/rtg/world/gen/surface/SurfaceTundra.java new file mode 100644 index 00000000..4d85a0ca --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/SurfaceTundra.java @@ -0,0 +1,92 @@ +package rtg.world.gen.surface; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +import java.util.Random; + +public class SurfaceTundra extends SurfaceBase { + + public SurfaceTundra(BiomeConfig config, IBlockState top, IBlockState fill) { + + super(config, top, fill); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float p = simplex.noise2(i / 8f, j / 8f) * 0.5f; + float c = CliffCalculator.calc(x, z, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + if (c > 0.45f && c > 1.5f - ((k - 60f) / 65f) + p) { + cliff = 1; + } + if (c > 1.5f) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < 0.3f + ((k - 100f) / 50f) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, z, hcCobble(world, i, j, x, z, k)); + } + else { + + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else if (simplex.noise2(i / 50f, j / 50f) + p * 0.6f > 0.24f) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(2)); + } + else { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, z, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACBase.java b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACBase.java new file mode 100644 index 00000000..e56fbda0 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACBase.java @@ -0,0 +1,29 @@ +package rtg.world.gen.surface.abyssalcraft; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.world.World; + +import com.shinoow.abyssalcraft.api.block.ACBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceACBase extends SurfaceBase { + + public SurfaceACBase(BiomeConfig config, IBlockState top, IBlockState fill) { + + super(config, top, fill); + } + + @Override + protected IBlockState hcStone(World world, int i, int j, int x, int y, int k) { + + return ACBlocks.darkstone.getDefaultState(); + } + + @Override + protected IBlockState hcCobble(World world, int worldX, int worldZ, int chunkX, int chunkZ, int worldY) { + + return ACBlocks.darkstone_cobblestone.getDefaultState(); + } +} diff --git a/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACCoraliumInfestedSwamp.java b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACCoraliumInfestedSwamp.java new file mode 100644 index 00000000..ab1c3b46 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACCoraliumInfestedSwamp.java @@ -0,0 +1,64 @@ +package rtg.world.gen.surface.abyssalcraft; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceACCoraliumInfestedSwamp extends SurfaceACBase { + + public SurfaceACCoraliumInfestedSwamp(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklands.java b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklands.java new file mode 100644 index 00000000..dbdee87b --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklands.java @@ -0,0 +1,115 @@ +package rtg.world.gen.surface.abyssalcraft; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaForestHills; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceACDarklands extends SurfaceACBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceACDarklands(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaForestHills.surfaceMixBlockId, BiomeConfigVanillaForestHills.surfaceMixBlockMetaId, mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsForest.java b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsForest.java new file mode 100644 index 00000000..5c671881 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsForest.java @@ -0,0 +1,115 @@ +package rtg.world.gen.surface.abyssalcraft; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaForest; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceACDarklandsForest extends SurfaceACBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceACDarklandsForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaForest.surfaceMixBlockId, BiomeConfigVanillaForest.surfaceMixBlockMetaId, mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsHighland.java b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsHighland.java new file mode 100644 index 00000000..42d8e8d2 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsHighland.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.abyssalcraft; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaExtremeHills; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceACDarklandsHighland extends SurfaceACBase { + + private IBlockState mixBlockTop; + private byte mixBlockTopMeta; + private IBlockState mixBlockFill; + private byte mixBlockFillMeta; + private float width; + private float height; + private float smallW; + private float smallS; + + public SurfaceACDarklandsHighland(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFill, float mixWidth, + float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + mixBlockTop = this.getConfigBlock(config, BiomeConfigVanillaExtremeHills.surfaceMixBlockId, BiomeConfigVanillaExtremeHills.surfaceMixBlockMetaId, mixTop); + + mixBlockFill = this.getConfigBlock(config, BiomeConfigVanillaExtremeHills.surfaceMixFillerBlockId, BiomeConfigVanillaExtremeHills.surfaceMixFillerBlockMetaId, mixFill); + + width = mixWidth; + height = mixHeight; + smallW = smallWidth; + smallS = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) + simplex.noise2(i / smallW, j / smallW) * smallS > height) { + primer.setBlockState(x, k, y, mixBlockTop); + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, mixBlockFill); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsMountains.java b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsMountains.java new file mode 100644 index 00000000..ff8ed63f --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsMountains.java @@ -0,0 +1,126 @@ +package rtg.world.gen.surface.abyssalcraft; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import com.shinoow.abyssalcraft.api.block.ACBlocks; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceACDarklandsMountains extends SurfaceACBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float iCliff = 0.3f; + private float iHeight = 100f; + private float iStrength = 50f; + private float cCliff = 1.5f; + + public SurfaceACDarklandsMountains(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceACDarklandsMountains(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float snowCliff, float snowHeight, float snowStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + iCliff = snowCliff; + iHeight = snowHeight; + iStrength = snowStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < iCliff + ((k - iHeight) / iStrength) + p) { + cliff = 3; + } + + if (cliff == 1 || cliff == 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, ACBlocks.darklands_grass.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1 || cliff == 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsPlains.java b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsPlains.java new file mode 100644 index 00000000..ec98b24a --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/abyssalcraft/SurfaceACDarklandsPlains.java @@ -0,0 +1,64 @@ +package rtg.world.gen.surface.abyssalcraft; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; + +public class SurfaceACDarklandsPlains extends SurfaceACBase { + + public SurfaceACDarklandsPlains(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARBambooGrove.java b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARBambooGrove.java new file mode 100644 index 00000000..0ff8fb06 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARBambooGrove.java @@ -0,0 +1,132 @@ +package rtg.world.gen.surface.agriculturalrevolution; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceARBambooGrove extends SurfaceBase { + + private boolean beach; + private IBlockState beachBlock; + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mix; + private float mixHeight; + + public SurfaceARBambooGrove(BiomeConfig config, IBlockState top, IBlockState fill, boolean genBeach, IBlockState genBeachBlock, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mixBlock, float mixSize) { + + super(config, top, fill); + beach = genBeach; + beachBlock = genBeachBlock; + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mix = mixBlock; + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean gravel = false; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + if (k < 63) { + if (beach) { + gravel = true; + } + } + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (beach) { + primer.setBlockState(x, k, y, beachBlock); + gravel = true; + } + else if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mix); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (gravel) { + primer.setBlockState(x, k, y, beachBlock); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARCoralReef.java b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARCoralReef.java new file mode 100644 index 00000000..39a64f83 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARCoralReef.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.agriculturalrevolution; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceARCoralReef extends SurfaceBase { + + public SurfaceARCoralReef(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARDeepReef.java b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARDeepReef.java new file mode 100644 index 00000000..d60127b6 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARDeepReef.java @@ -0,0 +1,63 @@ +package rtg.world.gen.surface.agriculturalrevolution; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceARDeepReef extends SurfaceBase { + + private IBlockState mixBlock; + private float width; + private float height; + private float mixCheck; + + public SurfaceARDeepReef(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler); + + mixBlock = mix; + + width = mixWidth; + height = mixHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0 && k > 0 && k < 63) { + mixCheck = simplex.noise2(i / width, j / width); + + if (mixCheck > height) { + primer.setBlockState(x, k, y, mixBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4 && k < 63) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARKelpForest.java b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARKelpForest.java new file mode 100644 index 00000000..3420acfb --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARKelpForest.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.agriculturalrevolution; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceARKelpForest extends SurfaceBase { + + public SurfaceARKelpForest(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceAROrchard.java b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceAROrchard.java new file mode 100644 index 00000000..c5c64573 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceAROrchard.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.agriculturalrevolution; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceAROrchard extends SurfaceBase { + + public SurfaceAROrchard(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARTropicalHills.java b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARTropicalHills.java new file mode 100644 index 00000000..43126d61 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/agriculturalrevolution/SurfaceARTropicalHills.java @@ -0,0 +1,117 @@ +package rtg.world.gen.surface.agriculturalrevolution; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceARTropicalHills extends SurfaceBase { + + private boolean beach; + private IBlockState beachBlock; + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceARTropicalHills(BiomeConfig config, IBlockState top, IBlockState fill, boolean genBeach, IBlockState genBeachBlock, float minCliff) { + + super(config, top, fill); + beach = genBeach; + beachBlock = genBeachBlock; + min = minCliff; + } + + public SurfaceARTropicalHills(BiomeConfig config, IBlockState top, IBlockState fill, boolean genBeach, IBlockState genBeachBlock, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, genBeach, genBeachBlock, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean gravel = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + if (k < 63) { + if (beach) { + gravel = true; + } + } + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + primer.setBlockState(x, k, y, Blocks.SANDSTONE.getDefaultState()); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, Blocks.SANDSTONE.getDefaultState()); + } + else if (k < 63) { + if (beach) { + primer.setBlockState(x, k, y, beachBlock); + gravel = true; + } + else if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, Blocks.SANDSTONE.getDefaultState()); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, Blocks.SANDSTONE.getDefaultState()); + } + else if (gravel) { + primer.setBlockState(x, k, y, beachBlock); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/betteragriculture/SurfaceBAFarmlandBiome.java b/src/api/java/rtg/world/gen/surface/betteragriculture/SurfaceBAFarmlandBiome.java new file mode 100644 index 00000000..df5675fe --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/betteragriculture/SurfaceBAFarmlandBiome.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.betteragriculture; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBAFarmlandBiome extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBAFarmlandBiome(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPAlps.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPAlps.java new file mode 100644 index 00000000..29317bd4 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPAlps.java @@ -0,0 +1,123 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPAlps extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float iCliff = 0.3f; + private float iHeight = 100f; + private float iStrength = 50f; + private float cCliff = 1.5f; + + public SurfaceBOPAlps(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceBOPAlps(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float snowCliff, float snowHeight, float snowStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + iCliff = snowCliff; + iHeight = snowHeight; + iStrength = snowStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < iCliff + ((k - iHeight) / iStrength) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBambooForest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBambooForest.java new file mode 100644 index 00000000..288426c5 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBambooForest.java @@ -0,0 +1,115 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPBambooForest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mix; + private float mixHeight; + + public SurfaceBOPBambooForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mixBlock, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mix = mixBlock; + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mix); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBayou.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBayou.java new file mode 100644 index 00000000..c0f6df5a --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBayou.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPBayou extends SurfaceBase { + + public SurfaceBOPBayou(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBog.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBog.java new file mode 100644 index 00000000..5e6e4ea1 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBog.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPBog extends SurfaceBase { + + public SurfaceBOPBog(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBorealForest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBorealForest.java new file mode 100644 index 00000000..b568a75b --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBorealForest.java @@ -0,0 +1,115 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPBorealForest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mix; + private float mixHeight; + + public SurfaceBOPBorealForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mixBlock, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mix = mixBlock; + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mix); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBrushland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBrushland.java new file mode 100644 index 00000000..3dfa09cf --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPBrushland.java @@ -0,0 +1,81 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPBrushland extends SurfaceBase { + + private IBlockState mixBlock; + private float width; + private float height; + + public SurfaceBOPBrushland(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler); + + mixBlock = mix; + + width = mixWidth; + height = mixHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) > height) // > 0.27f, i / 12f + { + primer.setBlockState(x, k, y, mixBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPChaparral.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPChaparral.java new file mode 100644 index 00000000..4e6bd849 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPChaparral.java @@ -0,0 +1,81 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPChaparral extends SurfaceBase { + + private IBlockState mixBlock; + private float width; + private float height; + + public SurfaceBOPChaparral(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler); + + mixBlock = mix; + + width = mixWidth; + height = mixHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) > height) // > 0.27f, i / 12f + { + primer.setBlockState(x, k, y, mixBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPCherryBlossomGrove.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPCherryBlossomGrove.java new file mode 100644 index 00000000..43e739ba --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPCherryBlossomGrove.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPCherryBlossomGrove extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPCherryBlossomGrove(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPColdDesert.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPColdDesert.java new file mode 100644 index 00000000..b9b4afca --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPColdDesert.java @@ -0,0 +1,95 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.SnowHeightCalculator; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPColdDesert extends SurfaceBase { + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPColdDesert(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + boolean water = false; + boolean riverPaint = false; + boolean grass = false; + + if (river > 0.05f && river + (simplex.noise2(i / 10f, j / 10f) * 0.1f) > 0.86f) { + riverPaint = true; + + if (simplex.noise2(i / 12f, j / 12f) > 0.25f) { + grass = true; + } + } + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (riverPaint) { + if (grass && depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + else if (depth == 0) { + if (rand.nextInt(2) == 0) { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + } + } + else if (depth > -1 && depth < 9) { + primer.setBlockState(x, k, y, topBlock); + + if (depth == 0 && k > 61 && k < 254) { + SnowHeightCalculator.calc(x, k, y, primer, noise); + } + } + } + else if (!water && b == Blocks.WATER) { + primer.setBlockState(x, k, y, Blocks.ICE.getDefaultState()); + water = true; + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPConiferousForest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPConiferousForest.java new file mode 100644 index 00000000..83161e7d --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPConiferousForest.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPConiferousForest extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPConiferousForest(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPCoralReef.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPCoralReef.java new file mode 100644 index 00000000..df3fcc35 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPCoralReef.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPCoralReef extends SurfaceBase { + + public SurfaceBOPCoralReef(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPCrag.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPCrag.java new file mode 100644 index 00000000..ded728e7 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPCrag.java @@ -0,0 +1,79 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPCrag extends SurfaceBase { + + private IBlockState cliffBlock1; + + public SurfaceBOPCrag(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState cliff1) { + + super(config, top, filler); + + cliffBlock1 = cliff1; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (k > 50) { + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, cliffBlock1); + } + else { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, cliffBlock1); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPDeadForest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPDeadForest.java new file mode 100644 index 00000000..6afb8efb --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPDeadForest.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPDeadForest extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPDeadForest(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPDeadSwamp.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPDeadSwamp.java new file mode 100644 index 00000000..0367eb75 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPDeadSwamp.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPDeadSwamp extends SurfaceBase { + + public SurfaceBOPDeadSwamp(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPEucalyptusForest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPEucalyptusForest.java new file mode 100644 index 00000000..44b65dba --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPEucalyptusForest.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPEucalyptusForest extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPEucalyptusForest(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPFen.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPFen.java new file mode 100644 index 00000000..a7d531da --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPFen.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPFen extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPFen(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPFlowerField.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPFlowerField.java new file mode 100644 index 00000000..b03a81e8 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPFlowerField.java @@ -0,0 +1,115 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPFlowerField extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mix; + private float mixHeight; + + public SurfaceBOPFlowerField(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mixBlock, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mix = mixBlock; + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mix); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPFlowerIsland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPFlowerIsland.java new file mode 100644 index 00000000..f132cf99 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPFlowerIsland.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPFlowerIsland extends SurfaceBase { + + public SurfaceBOPFlowerIsland(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGlacier.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGlacier.java new file mode 100644 index 00000000..a8694312 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGlacier.java @@ -0,0 +1,90 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPGlacier extends SurfaceBase { + + private IBlockState mixBlockTop; + private IBlockState mixBlockFill; + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + private float width; + private float height; + private float smallW; + private float smallS; + + public SurfaceBOPGlacier(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFill, IBlockState cliff1, IBlockState cliff2, float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + mixBlockTop = mixTop; + mixBlockFill = mixFill; + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + + width = mixWidth; + height = mixHeight; + smallW = smallWidth; + smallS = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, y, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, y, cliffBlock1); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) + simplex.noise2(i / smallW, j / smallW) * smallS > height) { + primer.setBlockState(x, k, y, mixBlockTop); + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, mixBlockFill); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGrassland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGrassland.java new file mode 100644 index 00000000..e2bf5076 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGrassland.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPGrassland extends SurfaceBase { + + public SurfaceBOPGrassland(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGravelBeach.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGravelBeach.java new file mode 100644 index 00000000..af5b17d1 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGravelBeach.java @@ -0,0 +1,92 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPGravelBeach extends SurfaceBase { + + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + private byte sandMetadata; + private int cliffType; + + public SurfaceBOPGravelBeach(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState cliff1, IBlockState cliff2, byte metadata, int cliff) { + + super(config, top, filler); + + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + sandMetadata = metadata; + cliffType = cliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f ? true : false; + boolean dirt = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (cliffType == 1) { + if (depth < 6) { + primer.setBlockState(x, k, z, cliffBlock1.getBlock().getDefaultState()); + } + } + else { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, z, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, z, cliffBlock1); + } + } + } + else if (depth < 6) { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / 12f, j / 12f) > -0.3f + ((k - 61f) / 15f)) { + dirt = true; + primer.setBlockState(x, k, z, topBlock); + } + else { + primer.setBlockState(x, k, z, BlockUtil.getStateSand(sandMetadata)); + } + } + else if (depth < 4) { + if (dirt) { + primer.setBlockState(x, k, z, fillerBlock); + } + else { + primer.setBlockState(x, k, z, BlockUtil.getStateSand(sandMetadata)); + } + } + else if (!dirt) { + primer.setBlockState(x, k, z, Blocks.SANDSTONE.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGrove.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGrove.java new file mode 100644 index 00000000..89603145 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPGrove.java @@ -0,0 +1,114 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPGrove extends SurfaceBase { + + public byte mixByte = (byte) 0; + private float min; + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + private IBlockState mix; + private float mixHeight; + + public SurfaceBOPGrove(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mixBlock, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mix = mixBlock; + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mix); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPHeathland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPHeathland.java new file mode 100644 index 00000000..62cf2c55 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPHeathland.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPHeathland extends SurfaceBase { + + public SurfaceBOPHeathland(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPHighland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPHighland.java new file mode 100644 index 00000000..4ddf59d4 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPHighland.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPHighland extends SurfaceBase { + + public SurfaceBOPHighland(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPKelpForest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPKelpForest.java new file mode 100644 index 00000000..24382469 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPKelpForest.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPKelpForest extends SurfaceBase { + + public SurfaceBOPKelpForest(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLandOfLakes.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLandOfLakes.java new file mode 100644 index 00000000..038d2aee --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLandOfLakes.java @@ -0,0 +1,115 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPLandOfLakes extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mix; + private float mixHeight; + + public SurfaceBOPLandOfLakes(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mixBlock, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mix = mixBlock; + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mix); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLavenderFields.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLavenderFields.java new file mode 100644 index 00000000..68a4d51b --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLavenderFields.java @@ -0,0 +1,115 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPLavenderFields extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mix; + private float mixHeight; + + public SurfaceBOPLavenderFields(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mixBlock, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mix = mixBlock; + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mix); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLushDesert.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLushDesert.java new file mode 100644 index 00000000..43320f4d --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLushDesert.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPLushDesert extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPLushDesert(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 3.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLushSwamp.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLushSwamp.java new file mode 100644 index 00000000..c9fa2ccb --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPLushSwamp.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPLushSwamp extends SurfaceBase { + + public SurfaceBOPLushSwamp(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMangrove.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMangrove.java new file mode 100644 index 00000000..680df8d6 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMangrove.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPMangrove extends SurfaceBase { + + public SurfaceBOPMangrove(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMapleWoods.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMapleWoods.java new file mode 100644 index 00000000..55d68d1d --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMapleWoods.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPMapleWoods extends SurfaceBase { + + public SurfaceBOPMapleWoods(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMarsh.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMarsh.java new file mode 100644 index 00000000..af0e2af9 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMarsh.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPMarsh extends SurfaceBase { + + public SurfaceBOPMarsh(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMeadow.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMeadow.java new file mode 100644 index 00000000..e9677c0c --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMeadow.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPMeadow extends SurfaceBase { + + public SurfaceBOPMeadow(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMoor.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMoor.java new file mode 100644 index 00000000..e2eaf53a --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMoor.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPMoor extends SurfaceBase { + + public SurfaceBOPMoor(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMountainFoothills.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMountainFoothills.java new file mode 100644 index 00000000..b09cf148 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMountainFoothills.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPMountainFoothills extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPMountainFoothills(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMountainPeaks.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMountainPeaks.java new file mode 100644 index 00000000..efc6ce79 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMountainPeaks.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPMountainPeaks extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPMountainPeaks(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMysticGrove.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMysticGrove.java new file mode 100644 index 00000000..7beabbbe --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPMysticGrove.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPMysticGrove extends SurfaceBase { + + public SurfaceBOPMysticGrove(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOasis.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOasis.java new file mode 100644 index 00000000..f077e67c --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOasis.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPOasis extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPOasis(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOminousWoods.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOminousWoods.java new file mode 100644 index 00000000..3be4a117 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOminousWoods.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPOminousWoods extends SurfaceBase { + + public SurfaceBOPOminousWoods(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOrchard.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOrchard.java new file mode 100644 index 00000000..3bdff66b --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOrchard.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPOrchard extends SurfaceBase { + + public SurfaceBOPOrchard(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOriginIsland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOriginIsland.java new file mode 100644 index 00000000..2a60eba5 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOriginIsland.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPOriginIsland extends SurfaceBase { + + public SurfaceBOPOriginIsland(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOutback.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOutback.java new file mode 100644 index 00000000..f59073ba --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOutback.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPOutback extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPOutback(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 4.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOvergrownCliffs.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOvergrownCliffs.java new file mode 100644 index 00000000..029b5b7f --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPOvergrownCliffs.java @@ -0,0 +1,108 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPOvergrownCliffs extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceBOPOvergrownCliffs(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceBOPOvergrownCliffs(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPPrairie.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPPrairie.java new file mode 100644 index 00000000..c8842416 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPPrairie.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPPrairie extends SurfaceBase { + + public SurfaceBOPPrairie(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPQuagmire.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPQuagmire.java new file mode 100644 index 00000000..d323c35d --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPQuagmire.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPQuagmire extends SurfaceBase { + + public SurfaceBOPQuagmire(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPRainforest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPRainforest.java new file mode 100644 index 00000000..fff9b8df --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPRainforest.java @@ -0,0 +1,108 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPRainforest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceBOPRainforest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceBOPRainforest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPRedwoodForest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPRedwoodForest.java new file mode 100644 index 00000000..7a991089 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPRedwoodForest.java @@ -0,0 +1,108 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPRedwoodForest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceBOPRedwoodForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceBOPRedwoodForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSacredSprings.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSacredSprings.java new file mode 100644 index 00000000..89b8ca8d --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSacredSprings.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPSacredSprings extends SurfaceBase { + + public SurfaceBOPSacredSprings(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSeasonalForest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSeasonalForest.java new file mode 100644 index 00000000..23eccbc5 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSeasonalForest.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPSeasonalForest extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPSeasonalForest(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPShield.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPShield.java new file mode 100644 index 00000000..2346c849 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPShield.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPShield extends SurfaceBase { + + public SurfaceBOPShield(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPShrubland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPShrubland.java new file mode 100644 index 00000000..11b98873 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPShrubland.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPShrubland extends SurfaceBase { + + public SurfaceBOPShrubland(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSnowyConiferousForest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSnowyConiferousForest.java new file mode 100644 index 00000000..c709baa5 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSnowyConiferousForest.java @@ -0,0 +1,123 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPSnowyConiferousForest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float iCliff = 0.3f; + private float iHeight = 100f; + private float iStrength = 50f; + private float cCliff = 1.5f; + + public SurfaceBOPSnowyConiferousForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceBOPSnowyConiferousForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float snowCliff, float snowHeight, float snowStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + iCliff = snowCliff; + iHeight = snowHeight; + iStrength = snowStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < iCliff + ((k - iHeight) / iStrength) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSnowyForest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSnowyForest.java new file mode 100644 index 00000000..729538bb --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSnowyForest.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPSnowyForest extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPSnowyForest(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSteppe.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSteppe.java new file mode 100644 index 00000000..2c3531a3 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPSteppe.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPSteppe extends SurfaceBase { + + public SurfaceBOPSteppe(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTemperateRainforest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTemperateRainforest.java new file mode 100644 index 00000000..38d7bfff --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTemperateRainforest.java @@ -0,0 +1,108 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPTemperateRainforest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceBOPTemperateRainforest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceBOPTemperateRainforest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTropicalIsland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTropicalIsland.java new file mode 100644 index 00000000..bd86e19a --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTropicalIsland.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPTropicalIsland extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPTropicalIsland(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTropicalRainforest.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTropicalRainforest.java new file mode 100644 index 00000000..25904728 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTropicalRainforest.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPTropicalRainforest extends SurfaceBase { + + public SurfaceBOPTropicalRainforest(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTundra.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTundra.java new file mode 100644 index 00000000..fe9190ff --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPTundra.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPTundra extends SurfaceBase { + + public SurfaceBOPTundra(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPVolcanicIsland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPVolcanicIsland.java new file mode 100644 index 00000000..ee9245a4 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPVolcanicIsland.java @@ -0,0 +1,96 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPVolcanicIsland extends SurfaceBase { + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPVolcanicIsland(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPWasteland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPWasteland.java new file mode 100644 index 00000000..ab36a0a4 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPWasteland.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPWasteland extends SurfaceBase { + + public SurfaceBOPWasteland(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPWetland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPWetland.java new file mode 100644 index 00000000..22b3fdfa --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPWetland.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPWetland extends SurfaceBase { + + public SurfaceBOPWetland(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPWoodland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPWoodland.java new file mode 100644 index 00000000..9114bc6c --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPWoodland.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPWoodland extends SurfaceBase { + + public SurfaceBOPWoodland(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPXericShrubland.java b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPXericShrubland.java new file mode 100644 index 00000000..2df04e1a --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesoplenty/SurfaceBOPXericShrubland.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.biomesoplenty; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBOPXericShrubland extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBOPXericShrubland(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 2.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGAutumnForest.java b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGAutumnForest.java new file mode 100644 index 00000000..f5fd01f2 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGAutumnForest.java @@ -0,0 +1,101 @@ +package rtg.world.gen.surface.biomesyougo; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesyougo.config.BiomeConfigBYGAutumnForest; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBYGAutumnForest extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceBYGAutumnForest(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = this.getConfigBlock(config, + BiomeConfigBYGAutumnForest.surfaceMixBlockId, BiomeConfigBYGAutumnForest.surfaceMixBlockMetaId, + mixTop + ); + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGBirchPlains.java b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGBirchPlains.java new file mode 100644 index 00000000..47010efb --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGBirchPlains.java @@ -0,0 +1,118 @@ +package rtg.world.gen.surface.biomesyougo; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesyougo.config.BiomeConfigBYGBirchPlains; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBYGBirchPlains extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceBYGBirchPlains(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigBYGBirchPlains.surfaceMixBlockId, + BiomeConfigBYGBirchPlains.surfaceMixBlockMetaId, + mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGFrozenTundra.java b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGFrozenTundra.java new file mode 100644 index 00000000..8fa5394c --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGFrozenTundra.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.biomesyougo; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBYGFrozenTundra extends SurfaceBase { + + public SurfaceBYGFrozenTundra(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGLushForest.java b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGLushForest.java new file mode 100644 index 00000000..4847804c --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGLushForest.java @@ -0,0 +1,118 @@ +package rtg.world.gen.surface.biomesyougo; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.biomesyougo.config.BiomeConfigBYGLushForest; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBYGLushForest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceBYGLushForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigBYGLushForest.surfaceMixBlockId, + BiomeConfigBYGLushForest.surfaceMixBlockMetaId, + mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGRedDesert.java b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGRedDesert.java new file mode 100644 index 00000000..fd8e4783 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGRedDesert.java @@ -0,0 +1,115 @@ +package rtg.world.gen.surface.biomesyougo; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBYGRedDesert extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceBYGRedDesert(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = mix; + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGRedRockMountains.java b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGRedRockMountains.java new file mode 100644 index 00000000..f2ef6efb --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGRedRockMountains.java @@ -0,0 +1,144 @@ +package rtg.world.gen.surface.biomesyougo; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBYGRedRockMountains extends SurfaceBase +{ + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private static IBlockState redRockStone = Block.getBlockFromName("BiomesYouGo:RedRock").getDefaultState(); + private static IBlockState redRockCobble = Block.getBlockFromName("BiomesYouGo:RedRockCobblestone").getDefaultState(); + private static IBlockState redClay = BlockUtil.getStateClay(14); + + public SurfaceBYGRedRockMountains(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) + { + super(config, top, fill); + min = minCliff; + } + + public SurfaceBYGRedRockMountains(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) + { + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if(depth == 0) + { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if(c > min && c > sCliff - ((k - sHeight) / sStrength) + p) + { + cliff = 1; + } + if(c > cCliff) + { + cliff = 2; + } + + if(cliff == 1) + { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if(cliff == 2) + { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if(k < 63) + { + if(k < 62) + { + primer.setBlockState(x, k, y, fillerBlock); + } + else + { + primer.setBlockState(x, k, y, topBlock); + } + } + else + { + primer.setBlockState(x, k, y, topBlock); + } + } + else if(depth < 6) + { + if(cliff == 1) + { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if(cliff == 2) + { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else + { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + + @Override + protected IBlockState hcStone(World world, int i, int j, int x, int y, int k) { + //return redRockStone; + return Blocks.STONE.getDefaultState(); + } + + @Override + protected IBlockState hcCobble(World world, int worldX, int worldZ, int chunkX, int chunkZ, int worldY) { + //return redRockCobble; + return Blocks.COBBLESTONE.getDefaultState(); + } + + @Override + protected IBlockState getShadowStoneBlock(World world, int i, int j, int x, int y, int k) { + //return redClay; + return redRockStone; + } +} diff --git a/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGWillowSwamps.java b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGWillowSwamps.java new file mode 100644 index 00000000..2d1962cf --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/biomesyougo/SurfaceBYGWillowSwamps.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.biomesyougo; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceBYGWillowSwamps extends SurfaceBase { + + public SurfaceBYGWillowSwamps(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/flowercraft/SurfaceFCPhantasia.java b/src/api/java/rtg/world/gen/surface/flowercraft/SurfaceFCPhantasia.java new file mode 100644 index 00000000..89b3d2bd --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/flowercraft/SurfaceFCPhantasia.java @@ -0,0 +1,66 @@ +package rtg.world.gen.surface.flowercraft; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceFCPhantasia extends SurfaceBase { + + public SurfaceFCPhantasia(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/mithwoodforest/SurfaceMFMithwoodForest.java b/src/api/java/rtg/world/gen/surface/mithwoodforest/SurfaceMFMithwoodForest.java new file mode 100644 index 00000000..82f8f222 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/mithwoodforest/SurfaceMFMithwoodForest.java @@ -0,0 +1,119 @@ +package rtg.world.gen.surface.mithwoodforest; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaForest; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceMFMithwoodForest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceMFMithwoodForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaForest.surfaceMixBlockId, + BiomeConfigVanillaForest.surfaceMixBlockMetaId, + mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + +} diff --git a/src/api/java/rtg/world/gen/surface/sugiforest/SurfaceSFSugiForest.java b/src/api/java/rtg/world/gen/surface/sugiforest/SurfaceSFSugiForest.java new file mode 100644 index 00000000..9535d119 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/sugiforest/SurfaceSFSugiForest.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.sugiforest; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceSFSugiForest extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceSFSugiForest(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBeach.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBeach.java new file mode 100644 index 00000000..dcb69667 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBeach.java @@ -0,0 +1,100 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaBeach extends SurfaceBase { + + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + private byte sandMetadata; + private int cliffType; + + public SurfaceVanillaBeach(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState cliff1, IBlockState cliff2, byte metadata, int cliff) { + + super(config, Blocks.DIRT, Blocks.DIRT); + + cliffBlock1 = Blocks.DIRT.getDefaultState(); + cliffBlock2 = Blocks.STONE.getDefaultState(); + sandMetadata = metadata; + cliffType = cliff; + } + + @SuppressWarnings("unused") + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f ? true : false; + boolean dirt = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (cliffType == 1) { + if (depth < 6) { + primer.setBlockState(x, k, z, cliffBlock1.getBlock().getDefaultState()); + } + } + else { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, z, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, z, cliffBlock1); + } + } + } + else if (depth < 6) { + if (depth == 0 && k > 61 && k < 64) { + //if(simplex.noise2(i / 12f, j / 12f) > -0.3f + ((k - 61f) / 15f)) + if (false) { + dirt = true; + primer.setBlockState(x, k, z, topBlock); + } + else { + primer.setBlockState(x, k, z, BlockUtil.getStateSand(sandMetadata)); + } + } + else if (depth < 4) { + if (dirt) { + primer.setBlockState(x, k, z, fillerBlock); + } + else { + if (k > 61 && k < 69) { + primer.setBlockState(x, k, z, BlockUtil.getStateSand(sandMetadata)); + } + } + } + else if (!dirt) { + if (k > 56 && k < 68) { // one lower for under sand and 4 deeper + primer.setBlockState(x, k, z, Blocks.SANDSTONE.getDefaultState()); + } + else { + primer.setBlockState(x, k, z, Blocks.STONE.getDefaultState()); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForest.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForest.java new file mode 100644 index 00000000..d997f00a --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForest.java @@ -0,0 +1,118 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaBirchForest; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaBirchForest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceVanillaBirchForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaBirchForest.surfaceMixBlockId, + BiomeConfigVanillaBirchForest.surfaceMixBlockMetaId, + mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForestHills.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForestHills.java new file mode 100644 index 00000000..8f6fbdff --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForestHills.java @@ -0,0 +1,118 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaBirchForestHills; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaBirchForestHills extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceVanillaBirchForestHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaBirchForestHills.surfaceMixBlockId, + BiomeConfigVanillaBirchForestHills.surfaceMixBlockMetaId, + mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForestHillsM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForestHillsM.java new file mode 100644 index 00000000..47031871 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForestHillsM.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaBirchForestHillsM extends SurfaceBase { + + public SurfaceVanillaBirchForestHillsM(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForestM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForestM.java new file mode 100644 index 00000000..d4a97bfa --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaBirchForestM.java @@ -0,0 +1,117 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaBirchForestM; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaBirchForestM extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceVanillaBirchForestM(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaBirchForestM.surfaceMixBlockId, + BiomeConfigVanillaBirchForestM.surfaceMixBlockMetaId, mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdBeach.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdBeach.java new file mode 100644 index 00000000..088b4930 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdBeach.java @@ -0,0 +1,97 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaColdBeach extends SurfaceBase { + + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + private byte sandMetadata; + private int cliffType; + + public SurfaceVanillaColdBeach(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState cliff1, IBlockState cliff2, byte metadata, int cliff) { + + super(config, top, filler); + + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + sandMetadata = metadata; + cliffType = cliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f ? true : false; + boolean dirt = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (cliffType == 1) { + if (depth < 6) { + primer.setBlockState(x, k, z, cliffBlock1.getBlock().getDefaultState()); + } + } + else { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, z, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, z, cliffBlock1); + } + } + } + else if (depth < 6) { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / 12f, j / 12f) > -0.3f + ((k - 61f) / 15f)) { + dirt = true; + primer.setBlockState(x, k, z, topBlock); + } + else { + if (k < 69) { + primer.setBlockState(x, k, z, BlockUtil.getStateSand(sandMetadata)); + } // else probably steep shore so leave stone + + } + } + else if (depth < 4) { + if (dirt) { + primer.setBlockState(x, k, z, fillerBlock); + } + else { + if (k < 69) { + primer.setBlockState(x, k, z, BlockUtil.getStateSand(sandMetadata)); + } + } + } + else if (!dirt) { + primer.setBlockState(x, k, z, Blocks.SANDSTONE.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdTaiga.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdTaiga.java new file mode 100644 index 00000000..b5731a69 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdTaiga.java @@ -0,0 +1,94 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaColdTaiga extends SurfaceBase { + + public SurfaceVanillaColdTaiga(BiomeConfig config, IBlockState top, IBlockState fill) { + + super(config, top, fill); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float p = simplex.noise2(i / 8f, j / 8f) * 0.5f; + float c = CliffCalculator.calc(x, z, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + if (c > 0.45f && c > 1.5f - ((k - 60f) / 65f) + p) { + cliff = 1; + } + if (c > 1.5f) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < 0.3f + ((k - 100f) / 50f) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, z, hcCobble(world, i, j, x, z, k)); + } + else { + + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else if (simplex.noise2(i / 50f, j / 50f) + p * 0.6f > 0.24f) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(2)); + } + else { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, z, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdTaigaHills.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdTaigaHills.java new file mode 100644 index 00000000..a249ee7c --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdTaigaHills.java @@ -0,0 +1,124 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaColdTaigaHills extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float iCliff = 0.3f; + private float iHeight = 100f; + private float iStrength = 50f; + private float cCliff = 1.5f; + + public SurfaceVanillaColdTaigaHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceVanillaColdTaigaHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float snowCliff, float snowHeight, float snowStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + iCliff = snowCliff; + iHeight = snowHeight; + iStrength = snowStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < iCliff + ((k - iHeight) / iStrength) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdTaigaM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdTaigaM.java new file mode 100644 index 00000000..93103b2f --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaColdTaigaM.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaColdTaigaM extends SurfaceBase { + + public SurfaceVanillaColdTaigaM(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDeepOcean.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDeepOcean.java new file mode 100644 index 00000000..bef7fcb5 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDeepOcean.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaDeepOcean; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaDeepOcean extends SurfaceBase { + + private IBlockState mixBlock; + private float width; + private float height; + private float mixCheck; + + public SurfaceVanillaDeepOcean(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler); + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaDeepOcean.surfaceMixBlockId, + BiomeConfigVanillaDeepOcean.surfaceMixBlockMetaId, mix); + + width = mixWidth; + height = mixHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0 && k > 0 && k < 63) { + mixCheck = simplex.noise2(i / width, j / width); + + if (mixCheck > height) { + primer.setBlockState(x, k, y, mixBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4 && k < 63) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDesert.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDesert.java new file mode 100644 index 00000000..ab0b6e66 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDesert.java @@ -0,0 +1,67 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaDesert extends SurfaceBase { + + public SurfaceVanillaDesert(BiomeConfig config, IBlockState top, IBlockState fill) { + + super(config, top, fill); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + boolean water = false; + boolean riverPaint = false; + boolean grass = false; + + if (river > 0.05f && river + (simplex.noise2(i / 10f, j / 10f) * 0.1f) > 0.86f) { + riverPaint = true; + + if (simplex.noise2(i / 12f, j / 12f) > 0.25f) { + grass = true; + } + } + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (riverPaint) { + if (grass && depth < 4) { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + else if (depth == 0) { + primer.setBlockState(x, k, y, rand.nextInt(2) == 0 ? Blocks.SAND.getDefaultState() : Blocks.SANDSTONE.getDefaultState()); + } + } + else if (depth > -1 && depth < 9) { + primer.setBlockState(x, k, y, Blocks.SAND.getDefaultState()); + if (depth == 0 && k > 61 && k < 254) { + ; + } + } + } + + + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDesertHills.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDesertHills.java new file mode 100644 index 00000000..ae72b736 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDesertHills.java @@ -0,0 +1,100 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaDesertHills extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceVanillaDesertHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceVanillaDesertHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + primer.setBlockState(x, k, y, Blocks.SANDSTONE.getDefaultState()); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, Blocks.SANDSTONE.getDefaultState()); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, Blocks.SANDSTONE.getDefaultState()); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, Blocks.SANDSTONE.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDesertM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDesertM.java new file mode 100644 index 00000000..f36f5208 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaDesertM.java @@ -0,0 +1,100 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaDesertM extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceVanillaDesertM(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceVanillaDesertM(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + primer.setBlockState(x, k, y, rand.nextInt(3) == 0 ? Blocks.SANDSTONE.getDefaultState() : Blocks.SAND.getDefaultState()); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowDesertBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, Blocks.SAND.getDefaultState()); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowDesertBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHills.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHills.java new file mode 100644 index 00000000..f1c9ac68 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHills.java @@ -0,0 +1,98 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaExtremeHills; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaExtremeHills extends SurfaceBase { + + private IBlockState mixBlockTop; + private IBlockState mixBlockFill; + private float width; + private float height; + private float smallW; + private float smallS; + + public SurfaceVanillaExtremeHills(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFill, float mixWidth, + float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + mixBlockTop = this.getConfigBlock(config, BiomeConfigVanillaExtremeHills.surfaceMixBlockId, BiomeConfigVanillaExtremeHills.surfaceMixBlockMetaId, + mixTop); + mixBlockFill = this.getConfigBlock(config, BiomeConfigVanillaExtremeHills.surfaceMixFillerBlockId, + BiomeConfigVanillaExtremeHills.surfaceMixFillerBlockMetaId, + mixFill); + + width = mixWidth; + height = mixHeight; + smallW = smallWidth; + smallS = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) + simplex.noise2(i / smallW, j / smallW) * smallS > height) { + primer.setBlockState(x, k, y, mixBlockTop); + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, mixBlockFill); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsEdge.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsEdge.java new file mode 100644 index 00000000..02470e0e --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsEdge.java @@ -0,0 +1,100 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaExtremeHillsEdge; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaExtremeHillsEdge extends SurfaceBase { + + private IBlockState mixBlockTop; + private IBlockState mixBlockFill; + private float width; + private float height; + private float smallW; + private float smallS; + + public SurfaceVanillaExtremeHillsEdge(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFill, float mixWidth, + float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + mixBlockTop = this.getConfigBlock(config, BiomeConfigVanillaExtremeHillsEdge.surfaceMixBlockId, + BiomeConfigVanillaExtremeHillsEdge.surfaceMixBlockMetaId, + mixTop); + + mixBlockFill = this.getConfigBlock(config, BiomeConfigVanillaExtremeHillsEdge.surfaceMixFillerBlockId, + BiomeConfigVanillaExtremeHillsEdge.surfaceMixFillerBlockMetaId, mixFill + ); + + width = mixWidth; + height = mixHeight; + smallW = smallWidth; + smallS = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) + simplex.noise2(i / smallW, j / smallW) * smallS > height) { + primer.setBlockState(x, k, y, mixBlockTop); + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, mixBlockFill); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsM.java new file mode 100644 index 00000000..8613d69f --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsM.java @@ -0,0 +1,100 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaExtremeHillsM; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaExtremeHillsM extends SurfaceBase { + + private IBlockState mixBlockTop; + private IBlockState mixBlockFill; + private float width; + private float height; + private float smallW; + private float smallS; + + public SurfaceVanillaExtremeHillsM(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFill, float mixWidth, + float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + mixBlockTop = this.getConfigBlock(config, BiomeConfigVanillaExtremeHillsM.surfaceMixBlockId, + BiomeConfigVanillaExtremeHillsM.surfaceMixBlockMetaId, + mixTop); + + mixBlockFill = this.getConfigBlock(config, BiomeConfigVanillaExtremeHillsM.surfaceMixFillerBlockId, + BiomeConfigVanillaExtremeHillsM.surfaceMixFillerBlockMetaId, + mixFill); + + width = mixWidth; + height = mixHeight; + smallW = smallWidth; + smallS = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) + simplex.noise2(i / smallW, j / smallW) * smallS > height) { + primer.setBlockState(x, k, y, mixBlockTop); + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, mixBlockFill); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsPlus.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsPlus.java new file mode 100644 index 00000000..0e7da5d3 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsPlus.java @@ -0,0 +1,118 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaExtremeHillsPlus; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaExtremeHillsPlus extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceVanillaExtremeHillsPlus(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaExtremeHillsPlus.surfaceMixBlockId, + BiomeConfigVanillaExtremeHillsPlus.surfaceMixBlockMetaId, + mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsPlusM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsPlusM.java new file mode 100644 index 00000000..e0200f6c --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaExtremeHillsPlusM.java @@ -0,0 +1,117 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaExtremeHillsPlusM; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaExtremeHillsPlusM extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceVanillaExtremeHillsPlusM(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaExtremeHillsPlusM.surfaceMixBlockId, + BiomeConfigVanillaExtremeHillsPlusM.surfaceMixBlockMetaId, mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaFlowerForest.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaFlowerForest.java new file mode 100644 index 00000000..96ac43df --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaFlowerForest.java @@ -0,0 +1,117 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaFlowerForest; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaFlowerForest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceVanillaFlowerForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaFlowerForest.surfaceMixBlockId, + BiomeConfigVanillaFlowerForest.surfaceMixBlockMetaId, mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaForest.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaForest.java new file mode 100644 index 00000000..9c67c5ba --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaForest.java @@ -0,0 +1,118 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaForest; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaForest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceVanillaForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaForest.surfaceMixBlockId, + BiomeConfigVanillaForest.surfaceMixBlockMetaId, + mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaForestHills.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaForestHills.java new file mode 100644 index 00000000..1250e62e --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaForestHills.java @@ -0,0 +1,116 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaForestHills; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaForestHills extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceVanillaForestHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaForestHills.surfaceMixBlockId, BiomeConfigVanillaForestHills.surfaceMixBlockMetaId, mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaFrozenOcean.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaFrozenOcean.java new file mode 100644 index 00000000..2f9a8a53 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaFrozenOcean.java @@ -0,0 +1,72 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaFrozenOcean; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaFrozenOcean extends SurfaceBase { + + private final int sandMetadata = 0; + private IBlockState mixBlock; + private float width; + private float height; + private float mixCheck; + + public SurfaceVanillaFrozenOcean(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler); + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaFrozenOcean.surfaceMixBlockId, BiomeConfigVanillaFrozenOcean.surfaceMixBlockMetaId, + mix); + + width = mixWidth; + height = mixHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0 && k > 0 && k < 63) { + mixCheck = simplex.noise2(i / width, j / width); + + if (mixCheck > height) // > 0.27f, i / 12f + { + primer.setBlockState(x, k, y, mixBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4 && k < 63) { + primer.setBlockState(x, k, y, fillerBlock); + } + + else if (depth == 0 && k < 69) { + primer.setBlockState(x, k, y, BlockUtil.getStateSand(sandMetadata)); + + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaFrozenRiver.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaFrozenRiver.java new file mode 100644 index 00000000..4579d9f7 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaFrozenRiver.java @@ -0,0 +1,49 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaFrozenRiver extends SurfaceBase { + + public SurfaceVanillaFrozenRiver(BiomeConfig config) { + + super(config, Blocks.GRASS, (byte) 0, Blocks.DIRT, (byte) 0); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + if (river > 0.05f && river + (simplex.noise2(i / 10f, j / 10f) * 0.15f) > 0.8f) { + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b != Blocks.WATER) { + depth++; + + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else if (depth > 4) { + return; + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaIceMountains.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaIceMountains.java new file mode 100644 index 00000000..92913ad8 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaIceMountains.java @@ -0,0 +1,96 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaIceMountains; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaIceMountains extends SurfaceBase { + + private IBlockState mixBlockTop; + private IBlockState mixBlockFill; + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + private float width; + private float height; + private float smallW; + private float smallS; + + public SurfaceVanillaIceMountains(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFill, IBlockState cliff1, IBlockState cliff2, float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + mixBlockTop = this.getConfigBlock(config, BiomeConfigVanillaIceMountains.surfaceMixBlockId, + BiomeConfigVanillaIceMountains.surfaceMixBlockMetaId, + mixTop); + + mixBlockFill = this.getConfigBlock(config, BiomeConfigVanillaIceMountains.surfaceMixFillerBlockId, + BiomeConfigVanillaIceMountains.surfaceMixFillerBlockMetaId, + mixFill); + + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + + width = mixWidth; + height = mixHeight; + smallW = smallWidth; + smallS = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, y, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, y, cliffBlock1); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) + simplex.noise2(i / smallW, j / smallW) * smallS > height) { + primer.setBlockState(x, k, y, mixBlockTop); + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, mixBlockFill); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaIcePlains.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaIcePlains.java new file mode 100644 index 00000000..f5cd3126 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaIcePlains.java @@ -0,0 +1,70 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaIcePlains extends SurfaceBase +{ + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + + public SurfaceVanillaIcePlains(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState cliff1, IBlockState cliff2) + { + super(config, top, filler); + + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if(cliff) + { + if(depth > -1 && depth < 2) + { + primer.setBlockState(x, k, y, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) + { + primer.setBlockState(x, k, y, cliffBlock1); + } + } + else + { + if(depth == 0 && k > 61) + { + primer.setBlockState(x, k, y, topBlock); + } + else if(depth < 4) + { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaIcePlainsSpikes.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaIcePlainsSpikes.java new file mode 100644 index 00000000..8f6fae96 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaIcePlainsSpikes.java @@ -0,0 +1,64 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaIcePlainsSpikes extends SurfaceBase { + + private IBlockState cliffBlock1; + private IBlockState cliffBlock2; + + public SurfaceVanillaIcePlainsSpikes(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState cliff1, IBlockState cliff2) { + + super(config, top, filler); + + cliffBlock1 = cliff1; + cliffBlock2 = cliff2; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + primer.setBlockState(x, k, y, rand.nextInt(3) == 0 ? cliffBlock2 : cliffBlock1); + } + else if (depth < 10) { + primer.setBlockState(x, k, y, cliffBlock1); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungle.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungle.java new file mode 100644 index 00000000..0319ede9 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungle.java @@ -0,0 +1,118 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaJungle; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaJungle extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceVanillaJungle(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaJungle.surfaceMixBlockId, + BiomeConfigVanillaJungle.surfaceMixBlockMetaId, + mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixHeight) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleEdge.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleEdge.java new file mode 100644 index 00000000..a19bb38e --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleEdge.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaJungleEdge extends SurfaceBase { + + public SurfaceVanillaJungleEdge(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleEdgeM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleEdgeM.java new file mode 100644 index 00000000..76a8ff0c --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleEdgeM.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaJungleEdgeM extends SurfaceBase { + + public SurfaceVanillaJungleEdgeM(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleHills.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleHills.java new file mode 100644 index 00000000..b61af8fa --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleHills.java @@ -0,0 +1,109 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaJungleHills extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceVanillaJungleHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceVanillaJungleHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleM.java new file mode 100644 index 00000000..0beb0579 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaJungleM.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaJungleM extends SurfaceBase { + + public SurfaceVanillaJungleM(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMegaSpruceTaiga.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMegaSpruceTaiga.java new file mode 100644 index 00000000..e8accb04 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMegaSpruceTaiga.java @@ -0,0 +1,94 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaMegaSpruceTaiga extends SurfaceBase { + + public SurfaceVanillaMegaSpruceTaiga(BiomeConfig config, IBlockState top, IBlockState fill) { + + super(config, top, fill); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float p = simplex.noise2(i / 8f, j / 8f) * 0.5f; + float c = CliffCalculator.calc(x, z, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + if (c > 0.45f && c > 1.5f - ((k - 60f) / 65f) + p) { + cliff = 1; + } + if (c > 1.5f) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < 0.3f + ((k - 100f) / 50f) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, z, hcCobble(world, i, j, x, z, k)); + } + else { + + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else if (simplex.noise2(i / 50f, j / 50f) + p * 0.6f > 0.24f) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(2)); + } + else { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, z, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMegaTaiga.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMegaTaiga.java new file mode 100644 index 00000000..827bb1e4 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMegaTaiga.java @@ -0,0 +1,94 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaMegaTaiga extends SurfaceBase { + + public SurfaceVanillaMegaTaiga(BiomeConfig config, IBlockState top, IBlockState fill) { + + super(config, top, fill); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float p = simplex.noise2(i / 8f, j / 8f) * 0.5f; + float c = CliffCalculator.calc(x, z, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + if (c > 0.45f && c > 1.5f - ((k - 60f) / 65f) + p) { + cliff = 1; + } + if (c > 1.5f) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < 0.3f + ((k - 100f) / 50f) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, z, hcCobble(world, i, j, x, z, k)); + } + else { + + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else if (simplex.noise2(i / 50f, j / 50f) + p * 0.6f > 0.24f) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(2)); + } + else { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, z, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMegaTaigaHills.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMegaTaigaHills.java new file mode 100644 index 00000000..5e6852e9 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMegaTaigaHills.java @@ -0,0 +1,124 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaMegaTaigaHills extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float iCliff = 0.3f; + private float iHeight = 100f; + private float iStrength = 50f; + private float cCliff = 1.5f; + + public SurfaceVanillaMegaTaigaHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceVanillaMegaTaigaHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float snowCliff, float snowHeight, float snowStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + iCliff = snowCliff; + iHeight = snowHeight; + iStrength = snowStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < iCliff + ((k - iHeight) / iStrength) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesa.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesa.java new file mode 100644 index 00000000..4152e94d --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesa.java @@ -0,0 +1,83 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.*; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaMesa extends SurfaceBase { + + private int grassRaise = 0; + + public SurfaceVanillaMesa(BiomeConfig config, IBlockState top, IBlockState fill, int grassHeight) { + + super(config, top, fill); + grassRaise = grassHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f; + Block b; + + for(int k = 255; k > -1; k--) + { + b = primer.getBlockState(x, k, z).getBlock(); + if(b == Blocks.AIR) + { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + primer.setBlockState(x, k, z, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + else { + + if (k > 74 + grassRaise) + { + if (depth == 0) { + if (rand.nextInt(5) == 0) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + } + else if (depth == 0 && k > 61) { + int r = (int)((k - (62 + grassRaise)) / 2f); + if(rand.nextInt(r + 2) == 0) + { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + else if(rand.nextInt((int)(r / 2f) + 2) == 0) + { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else + { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaBryce.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaBryce.java new file mode 100644 index 00000000..4c30a328 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaBryce.java @@ -0,0 +1,104 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.*; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaMesaBryce extends SurfaceBase { + + private int grassRaise = 0; + + public SurfaceVanillaMesaBryce(BiomeConfig config, IBlockState top, IBlockState fill, int grassHeight) { + + super(config, top, fill); + grassRaise = grassHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth > -1 && depth < 12) { + if (cliff) { + primer.setBlockState(x, k, z, CanyonColour.MESA_BRYCE.getBlockForHeight(i, k, j)); + } + else { + if (depth > 4) { + primer.setBlockState(x, k, z, CanyonColour.MESA_BRYCE.getBlockForHeight(i, k, j)); + } + else if (k > 74 + grassRaise) { + if (rand.nextInt(5) == 0) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else { + if (depth == 0) { + primer.setBlockState(x, k, z, topBlock); + } + else { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + else if (k < 62) { + primer.setBlockState(x, k, z, Blocks.DIRT.getDefaultState()); + } + else if (k < 62 + grassRaise) { + if (depth == 0) { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + else { + primer.setBlockState(x, k, z, Blocks.DIRT.getDefaultState()); + } + } + else if (k < 75 + grassRaise) { + if (depth == 0) { + int r = (int) ((k - (62 + grassRaise)) / 2f); + if (rand.nextInt(r + 1) == 0) { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + else if (rand.nextInt((int) (r / 2f) + 1) == 0) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else { + primer.setBlockState(x, k, z, topBlock); + } + } + else { + primer.setBlockState(x, k, z, fillerBlock); + } + } + else { + if (depth == 0) { + primer.setBlockState(x, k, z, topBlock); + } + else { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + } + else if (k > 63) { + primer.setBlockState(x, k, z, CanyonColour.MESA_BRYCE.getBlockForHeight(i, k, j)); + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateau.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateau.java new file mode 100644 index 00000000..9046c378 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateau.java @@ -0,0 +1,82 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.*; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaMesaPlateau extends SurfaceBase +{ + private int grassRaise = 0; + + public SurfaceVanillaMesaPlateau(BiomeConfig config, IBlockState top, IBlockState fill, int grassHeight) + { + super(config, top, fill); + + grassRaise = grassHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f; + Block b; + + for(int k = 255; k > -1; k--) + { + b = primer.getBlockState(x, k, z).getBlock(); + if(b == Blocks.AIR) + { + depth = -1; + } + else if(b == Blocks.STONE) + { + depth++; + + if (cliff) { + primer.setBlockState(x, k, z, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + else { + + if (k > 74 + grassRaise) + { + if(depth == 0) + { + primer.setBlockState(x, k, z, BlockUtil.getStateClay(1)); + } + else + { + primer.setBlockState(x, k, z, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + } + else if (depth == 0 && k > 61) { + int r = (int)((k - (62 + grassRaise)) / 2f); + if(rand.nextInt(r + 2) == 0) + { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + else if(rand.nextInt((int)(r / 2f) + 2) == 0) + { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else + { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateauF.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateauF.java new file mode 100644 index 00000000..15e2f627 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateauF.java @@ -0,0 +1,92 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.*; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaMesaPlateauF extends SurfaceBase { + + private int grassRaise = 0; + + public SurfaceVanillaMesaPlateauF(BiomeConfig config, IBlockState top, IBlockState fill, int grassHeight) { + + super(config, top, fill); + grassRaise = grassHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f; + + for (int k = 255; k > -1; k--) { + + Block b = primer.getBlockState(x, k, z).getBlock(); + + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + + depth++; + + if (cliff) { + primer.setBlockState(x, k, z, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + else { + + if (k > 74 + grassRaise) + { + if(depth == 0) + { + int r = (int)((k - (62 + grassRaise)) / 2f); + if(rand.nextInt(r + 2) == 0) + { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + else if(rand.nextInt((int)(r / 2f) + 2) == 0) + { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else + { + primer.setBlockState(x, k, z, topBlock); + } + } + else + { + primer.setBlockState(x, k, z, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + } + else if (depth == 0 && k > 61) { + int r = (int)((k - (62 + grassRaise)) / 2f); + if(rand.nextInt(r + 1) == 0) + { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + else if(rand.nextInt((int)(r / 2f) + 1) == 0) + { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else + { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateauFM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateauFM.java new file mode 100644 index 00000000..929324ba --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateauFM.java @@ -0,0 +1,83 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.*; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaMesaPlateauFM extends SurfaceBase { + + private int grassRaise = 0; + + public SurfaceVanillaMesaPlateauFM(BiomeConfig config, IBlockState top, IBlockState fill, int grassHeight) { + + super(config, top, fill); + grassRaise = grassHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f; + Block b; + + for(int k = 255; k > -1; k--) + { + b = primer.getBlockState(x, k, z).getBlock(); + if(b == Blocks.AIR) + { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + primer.setBlockState(x, k, z, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + else { + + if (k > 74 + grassRaise) + { + if (depth == 0) { + if (rand.nextInt(5) == 0) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + } + else if (depth == 0 && k > 61) { + int r = (int)((k - (62 + grassRaise)) / 2f); + if(rand.nextInt(r + 2) == 0) + { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + else if(rand.nextInt((int)(r / 2f) + 2) == 0) + { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else + { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateauM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateauM.java new file mode 100644 index 00000000..e8d40225 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMesaPlateauM.java @@ -0,0 +1,73 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.*; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaMesaPlateauM extends SurfaceBase { + + private int grassRaise = 0; + + public SurfaceVanillaMesaPlateauM(BiomeConfig config, IBlockState top, IBlockState fill, int grassHeight) { + + super(config, top, fill); + grassRaise = grassHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f; + + for (int k = 255; k > -1; k--) { + + Block b = primer.getBlockState(x, k, z).getBlock(); + + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + + depth++; + + if (cliff) { + primer.setBlockState(x, k, z, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + else { + + if (k > 74 + grassRaise) + { + primer.setBlockState(x, k, z, CanyonColour.MESA.getBlockForHeight(i, k, j)); + } + else if (depth == 0 && k > 61) { + int r = (int)((k - (62 + grassRaise)) / 2f); + if(rand.nextInt(r + 2) == 0) + { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + else if(rand.nextInt((int)(r / 2f) + 2) == 0) + { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else + { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMushroomIsland.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMushroomIsland.java new file mode 100644 index 00000000..3ccc243f --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMushroomIsland.java @@ -0,0 +1,99 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaMushroomIsland extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceVanillaMushroomIsland(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceVanillaMushroomIsland(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMushroomIslandShore.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMushroomIslandShore.java new file mode 100644 index 00000000..c817a271 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaMushroomIslandShore.java @@ -0,0 +1,99 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaMushroomIslandShore extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceVanillaMushroomIslandShore(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceVanillaMushroomIslandShore(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaOcean.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaOcean.java new file mode 100644 index 00000000..d06abbb6 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaOcean.java @@ -0,0 +1,71 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaOcean; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaOcean extends SurfaceBase { + + private final int sandMetadata = 0; + private IBlockState mixBlock; + private float width; + private float height; + private float mixCheck; + + public SurfaceVanillaOcean(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler); + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaOcean.surfaceMixBlockId, BiomeConfigVanillaOcean.surfaceMixBlockMetaId, mix); + + width = mixWidth; + height = mixHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0 && k > 0 && k < 63) { + mixCheck = simplex.noise2(i / width, j / width); + + if (mixCheck > height) // > 0.27f, i / 12f + { + primer.setBlockState(x, k, y, mixBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4 && k < 63) { + primer.setBlockState(x, k, y, fillerBlock); + } + + else if (depth == 0 && k < 69) { + primer.setBlockState(x, k, y, BlockUtil.getStateSand(sandMetadata)); + + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaPlains.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaPlains.java new file mode 100644 index 00000000..1deee8c3 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaPlains.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaPlains extends SurfaceBase { + + public SurfaceVanillaPlains(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRedwoodTaigaHills.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRedwoodTaigaHills.java new file mode 100644 index 00000000..2814ea83 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRedwoodTaigaHills.java @@ -0,0 +1,124 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaRedwoodTaigaHills extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float iCliff = 0.3f; + private float iHeight = 100f; + private float iStrength = 50f; + private float cCliff = 1.5f; + + public SurfaceVanillaRedwoodTaigaHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceVanillaRedwoodTaigaHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float snowCliff, float snowHeight, float snowStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + iCliff = snowCliff; + iHeight = snowHeight; + iStrength = snowStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < iCliff + ((k - iHeight) / iStrength) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRiver.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRiver.java new file mode 100644 index 00000000..809b14c0 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRiver.java @@ -0,0 +1,49 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaRiver extends SurfaceBase { + + public SurfaceVanillaRiver(BiomeConfig config) { + + super(config, Blocks.GRASS, (byte) 0, Blocks.DIRT, (byte) 0); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + if (river > 0.05f && river + (simplex.noise2(i / 10f, j / 10f) * 0.15f) > 0.8f) { + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b != Blocks.WATER) { + depth++; + + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else if (depth > 4) { + return; + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRoofedForest.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRoofedForest.java new file mode 100644 index 00000000..5fee42d8 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRoofedForest.java @@ -0,0 +1,119 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaRoofedForest; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaRoofedForest extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + private float mixHeight; + + public SurfaceVanillaRoofedForest(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix, float mixSize) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaRoofedForest.surfaceMixBlockId, BiomeConfigVanillaRoofedForest.surfaceMixBlockMetaId, + mix); + mixHeight = mixSize; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + // varying clay densities; + float mixModifier = mixHeight + simplex.noise2(((float) i) / 800f, ((float) j) / 800f); + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (simplex.noise2(i / 12f, j / 12f) > mixModifier) { + primer.setBlockState(x, k, y, mixBlock); + m = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRoofedForestM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRoofedForestM.java new file mode 100644 index 00000000..4d80df46 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaRoofedForestM.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaRoofedForestM extends SurfaceBase { + + public SurfaceVanillaRoofedForestM(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavanna.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavanna.java new file mode 100644 index 00000000..162c6d23 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavanna.java @@ -0,0 +1,82 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaSavanna; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaSavanna extends SurfaceBase { + + private IBlockState mixBlock; + private float width; + private float height; + + public SurfaceVanillaSavanna(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler); + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaSavanna.surfaceMixBlockId, BiomeConfigVanillaSavanna.surfaceMixBlockMetaId, mix); + + width = mixWidth; + height = mixHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) > height) // > 0.27f, i / 12f + { + primer.setBlockState(x, k, y, mixBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavannaM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavannaM.java new file mode 100644 index 00000000..b599e17b --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavannaM.java @@ -0,0 +1,134 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.api.biome.vanilla.config.BiomeConfigVanillaSavannaM; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaSavannaM extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + private IBlockState mixBlock; + + public SurfaceVanillaSavannaM(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float clayCliff, IBlockState mix) { + + super(config, top, fill); + min = minCliff; + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + + mixBlock = this.getConfigBlock(config, BiomeConfigVanillaSavannaM.surfaceMixBlockId, + BiomeConfigVanillaSavannaM.surfaceMixBlockMetaId, mix); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + boolean m = false; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (k > 74) + { + if (depth == 0) { + if (rand.nextInt(5) == 0) { + primer.setBlockState(x, k, y, mixBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + else if (depth == 0 && k > 61) { + int r = (int)((k - 62) / 2f); + if(rand.nextInt(r + 2) == 0) + { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + else if(rand.nextInt((int)(r / 2f) + 2) == 0) + { + primer.setBlockState(x, k, y, mixBlock); + } + else + { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavannaPlateau.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavannaPlateau.java new file mode 100644 index 00000000..d1db45c4 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavannaPlateau.java @@ -0,0 +1,101 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.config.rtg.ConfigRTG; +import rtg.util.*; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaSavannaPlateau extends SurfaceBase { + + private int grassRaise = 0; + + public SurfaceVanillaSavannaPlateau(BiomeConfig config, IBlockState top, IBlockState fill, int grassHeight) { + + super(config, top, fill); + grassRaise = grassHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f; + Block b; + + for(int k = 255; k > -1; k--) + { + b = primer.getBlockState(x, k, z).getBlock(); + if(b == Blocks.AIR) + { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (!ConfigRTG.stoneSavannas) { + primer.setBlockState(x, k, z, CanyonColour.SAVANNA.getBlockForHeight(i, k, j)); + } + else { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, z, hcCobble(world, i, j, x, z, k)); + } + else { + + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + } + } + else { + + if (k > 74 + grassRaise) + { + if (depth == 0) { + if (rand.nextInt(5) == 0) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + } + else if (depth == 0 && k > 61) { + int r = (int)((k - (62 + grassRaise)) / 2f); + if(rand.nextInt(r + 2) == 0) + { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + else if(rand.nextInt((int)(r / 2f) + 2) == 0) + { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else + { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavannaPlateauM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavannaPlateauM.java new file mode 100644 index 00000000..17188cb0 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSavannaPlateauM.java @@ -0,0 +1,100 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.*; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaSavannaPlateauM extends SurfaceBase { + + private int grassRaise = 0; + + public SurfaceVanillaSavannaPlateauM(BiomeConfig config, IBlockState top, IBlockState fill, int grassHeight) { + + super(config, top, fill); + grassRaise = grassHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, z, noise); + boolean cliff = c > 1.3f; + Block b; + + for(int k = 255; k > -1; k--) + { + b = primer.getBlockState(x, k, z).getBlock(); + if(b == Blocks.AIR) + { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { +// if (!ConfigRTG.stoneSavannas) { + primer.setBlockState(x, k, z, CanyonColour.SAVANNA.getBlockForHeight(i, k, j)); +// } +// else { +// if (depth > -1 && depth < 2) { +// if (rand.nextInt(3) == 0) { +// +// primer.setBlockState(x, k, z, hcCobble(world, i, j, x, y, k)); +// } +// else { +// +// primer.setBlockState(x, k, z, hcStone(world, i, j, x, y, k)); +// } +// } +// else if (depth < 10) { +// primer.setBlockState(x, k, z, hcStone(world, i, j, x, y, k)); +// } +// } + } + else { + + if (k > 74 + grassRaise) + { + if (depth == 0) { + if (rand.nextInt(5) == 0) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + } + else if (depth == 0 && k > 61) { + int r = (int)((k - (62 + grassRaise)) / 2f); + if(rand.nextInt(r + 2) == 0) + { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + else if(rand.nextInt((int)(r / 2f) + 2) == 0) + { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(1)); + } + else + { + primer.setBlockState(x, k, z, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, z, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaStoneBeach.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaStoneBeach.java new file mode 100644 index 00000000..0debcb92 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaStoneBeach.java @@ -0,0 +1,107 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaStoneBeach extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float cCliff = 1.5f; + + public SurfaceVanillaStoneBeach(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceVanillaStoneBeach(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSunflowerPlains.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSunflowerPlains.java new file mode 100644 index 00000000..8504a3db --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSunflowerPlains.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaSunflowerPlains extends SurfaceBase { + + public SurfaceVanillaSunflowerPlains(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSwampland.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSwampland.java new file mode 100644 index 00000000..199c3823 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSwampland.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaSwampland extends SurfaceBase { + + public SurfaceVanillaSwampland(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSwamplandM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSwamplandM.java new file mode 100644 index 00000000..61a747e0 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaSwamplandM.java @@ -0,0 +1,65 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaSwamplandM extends SurfaceBase { + + public SurfaceVanillaSwamplandM(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff && k > 64) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaTaiga.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaTaiga.java new file mode 100644 index 00000000..41d81853 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaTaiga.java @@ -0,0 +1,94 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaTaiga extends SurfaceBase { + + public SurfaceVanillaTaiga(BiomeConfig config, IBlockState top, IBlockState fill) { + + super(config, top, fill); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float p = simplex.noise2(i / 8f, j / 8f) * 0.5f; + float c = CliffCalculator.calc(x, z, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + if (c > 0.45f && c > 1.5f - ((k - 60f) / 65f) + p) { + cliff = 1; + } + if (c > 1.5f) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < 0.3f + ((k - 100f) / 50f) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, z, hcCobble(world, i, j, x, z, k)); + } + else { + + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else if (simplex.noise2(i / 50f, j / 50f) + p * 0.6f > 0.24f) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(2)); + } + else { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, z, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaTaigaHills.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaTaigaHills.java new file mode 100644 index 00000000..16c16849 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaTaigaHills.java @@ -0,0 +1,124 @@ +package rtg.world.gen.surface.vanilla; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceVanillaTaigaHills extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float iCliff = 0.3f; + private float iHeight = 100f; + private float iStrength = 50f; + private float cCliff = 1.5f; + + public SurfaceVanillaTaigaHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceVanillaTaigaHills(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, + float stoneHeight, float stoneStrength, float snowCliff, float snowHeight, float snowStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + iCliff = snowCliff; + iHeight = snowHeight; + iStrength = snowStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < iCliff + ((k - iHeight) / iStrength) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaTaigaM.java b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaTaigaM.java new file mode 100644 index 00000000..89e183e4 --- /dev/null +++ b/src/api/java/rtg/world/gen/surface/vanilla/SurfaceVanillaTaigaM.java @@ -0,0 +1,94 @@ +package rtg.world.gen.surface.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +import java.util.Random; + +public class SurfaceVanillaTaigaM extends SurfaceBase { + + public SurfaceVanillaTaigaM(BiomeConfig config, IBlockState top, IBlockState fill) { + + super(config, top, fill); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int z, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float p = simplex.noise2(i / 8f, j / 8f) * 0.5f; + float c = CliffCalculator.calc(x, z, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, z).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + if (c > 0.45f && c > 1.5f - ((k - 60f) / 65f) + p) { + cliff = 1; + } + if (c > 1.5f) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < 0.3f + ((k - 100f) / 50f) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, z, hcCobble(world, i, j, x, z, k)); + } + else { + + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else if (simplex.noise2(i / 50f, j / 50f) + p * 0.6f > 0.24f) { + primer.setBlockState(x, k, z, BlockUtil.getStateDirt(2)); + } + else { + primer.setBlockState(x, k, z, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, z, hcStone(world, i, j, x, z, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, z, getShadowStoneBlock(world, i, j, x, z, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, z, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, z, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/api/java/rtg/world/gen/terrain/AdjustableSpikeEffect.java b/src/api/java/rtg/world/gen/terrain/AdjustableSpikeEffect.java new file mode 100644 index 00000000..4fbf57dd --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/AdjustableSpikeEffect.java @@ -0,0 +1,32 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public class AdjustableSpikeEffect extends HeightEffect { + + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + // a trio of parameters frequently used together + public float height = Integer.MAX_VALUE; + ; + public float wavelength = 0; + public float minimumSimplex = Integer.MAX_VALUE;// normal range is -1 to 1; + //usually numbers above 0 are often preferred to avoid dead basins + public int octave; + public float power = 1.6f;// usually a range of 1 to 2 + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + float noise = simplex.octave(octave).noise2((float) x / wavelength, (float) y / wavelength); + if (noise < minimumSimplex) { + noise = minimumSimplex; + } + noise = 1f - (1f - noise) / (1f - minimumSimplex); + noise = TerrainBase.unsignedPower(noise, power); + return noise * height; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/BlendedHillEffect.java b/src/api/java/rtg/world/gen/terrain/BlendedHillEffect.java new file mode 100644 index 00000000..e1c12d69 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/BlendedHillEffect.java @@ -0,0 +1,34 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public class BlendedHillEffect extends HeightEffect { + // similar to HillockEffect except that the transition is smooth + // and it can pass through a subordinate effect after multiply by the BlendedHill noise + + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + // a trio of parameters frequently used together + public float height = Integer.MAX_VALUE; + ; + public float wavelength = 0; + public float hillBottomSimplexValue = Integer.MAX_VALUE;// normal range is -1 to 1; + //usually numbers above 0 are often preferred to avoid dead basins + public int octave; + public HeightEffect subordinate; + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + float noise = simplex.octave(octave).noise2(x / wavelength, y / wavelength); + noise = TerrainBase.blendedHillHeight(noise, hillBottomSimplexValue); + if (subordinate == null) { + return noise * height; + } + return noise * (height + subordinate.added(simplex, cell, x, y)); + } + +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/BumpyHillsEffect.java b/src/api/java/rtg/world/gen/terrain/BumpyHillsEffect.java new file mode 100644 index 00000000..984ec15a --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/BumpyHillsEffect.java @@ -0,0 +1,36 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * This creates an effect of scattered hills with irregular surfaces + * + * @author Zeno410 + */ +public class BumpyHillsEffect extends HeightEffect { + + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + // a trio of parameters frequently used together + public float hillHeight = Integer.MAX_VALUE; + ; + public float hillWavelength = 0; + public float spikeHeight = Integer.MAX_VALUE; + ; + public float spikeWavelength = 0; + + + // octaves are standardized so they don't need to be set + public int hillOctave = 0;// + public int spikeOctave = 2;// + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + float noise = simplex.octave(hillOctave).noise2(x / hillWavelength, y / hillWavelength); + noise = TerrainBase.blendedHillHeight(noise); + float spikeNoise = simplex.octave(spikeOctave).noise2(x / spikeWavelength, y / spikeWavelength); + spikeNoise = TerrainBase.blendedHillHeight(spikeNoise * noise); + return noise * hillHeight + spikeNoise * spikeHeight; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/FunctionalTerrainBase.java b/src/api/java/rtg/world/gen/terrain/FunctionalTerrainBase.java new file mode 100644 index 00000000..3244531e --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/FunctionalTerrainBase.java @@ -0,0 +1,19 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public class FunctionalTerrainBase extends TerrainBase { + + protected HeightEffect height; + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return riverized(height.added(simplex, cell, x, y) + base, river); + } + +} diff --git a/src/api/java/rtg/world/gen/terrain/GroundEffect.java b/src/api/java/rtg/world/gen/terrain/GroundEffect.java new file mode 100644 index 00000000..dd08ccf9 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/GroundEffect.java @@ -0,0 +1,24 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public class GroundEffect extends HeightEffect { + + // the standard ground effect + private final float amplitude; + + public GroundEffect(float amplitude) { + + this.amplitude = amplitude; + } + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + return TerrainBase.groundNoise(x, y, amplitude, simplex); + } + +} diff --git a/src/api/java/rtg/world/gen/terrain/HeightEffect.java b/src/api/java/rtg/world/gen/terrain/HeightEffect.java new file mode 100644 index 00000000..840f0ce4 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/HeightEffect.java @@ -0,0 +1,39 @@ +/* + * Available under the Lesser GPL License 3.0 + */ + +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public abstract class HeightEffect { + + public abstract float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y); + + public HeightEffect plus(HeightEffect added) { + + return new SummedHeightEffects(this, added); + } + + private class SummedHeightEffects extends HeightEffect { + + private final HeightEffect one; + private final HeightEffect two; + + public SummedHeightEffects(HeightEffect one, HeightEffect two) { + + this.one = one; + this.two = two; + } + + @Override + public float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + return one.added(simplex, cell, x, y) + two.added(simplex, cell, x, y); + } + } +} diff --git a/src/api/java/rtg/world/gen/terrain/HeightVariation.java b/src/api/java/rtg/world/gen/terrain/HeightVariation.java new file mode 100644 index 00000000..1cfdca12 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/HeightVariation.java @@ -0,0 +1,22 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public class HeightVariation extends HeightEffect { + + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + public float height = Integer.MAX_VALUE; + public float wavelength = 0; + public int octave = -1; + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + return simplex.octave(octave).noise2(x / wavelength, y / wavelength) * height; + } + +} diff --git a/src/api/java/rtg/world/gen/terrain/HillockEffect.java b/src/api/java/rtg/world/gen/terrain/HillockEffect.java new file mode 100644 index 00000000..3e1d0215 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/HillockEffect.java @@ -0,0 +1,32 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public class HillockEffect extends HeightEffect { + + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + // a trio of parameters frequently used together + public float height = Integer.MAX_VALUE; + ; + public float wavelength = 0; + public float minimumSimplex = Integer.MAX_VALUE;// normal range is -1 to 1; + //usually numbers above 0 are often preferred to avoid dead basins + public int octave; + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + float noise = simplex.octave(octave).noise2(x / wavelength, y / wavelength); + if (noise < minimumSimplex) { + noise = 0; + } + else { + noise = (noise - minimumSimplex) / (1f - minimumSimplex); + } + return noise * height; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/HillsEverywhereEffect.java b/src/api/java/rtg/world/gen/terrain/HillsEverywhereEffect.java new file mode 100644 index 00000000..c7172ad3 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/HillsEverywhereEffect.java @@ -0,0 +1,35 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public class HillsEverywhereEffect extends HeightEffect { + // this multiplies an existing heightEffect by the absolute value of a blended simplex call + // and adds a height of its own + + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + // a trio of parameters frequently used together + public float height = Integer.MAX_VALUE; + ; + public float wavelength = 3; + public float hillBottomSimplexValue = 0.2f;// normal range is -1 to 1; + //usually numbers above 0 are often preferred to avoid dead basins + public int octave; + public HeightEffect modified; + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + float noise = simplex.octave(octave).noise2(x / wavelength, y / wavelength); + noise = Math.abs(noise); + noise = TerrainBase.blendedHillHeight(noise, hillBottomSimplexValue); + if (modified == null) { + return noise * height; + } + return noise * (height + modified.added(simplex, cell, x, y)); + } + +} diff --git a/src/api/java/rtg/world/gen/terrain/JitterEffect.java b/src/api/java/rtg/world/gen/terrain/JitterEffect.java new file mode 100644 index 00000000..4a0940fd --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/JitterEffect.java @@ -0,0 +1,45 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.SimplexOctave; + +/** + * This class returns a height effect with a jitter on the position. + * + * @author Zeno410 + */ +public class JitterEffect extends HeightEffect { + + public float amplitude = Integer.MAX_VALUE; + public float wavelength = 0; + public HeightEffect jittered; + private SimplexOctave.Disk jitter = new SimplexOctave.Disk(); + private boolean running = false;// this is to check for re-entrancy because this isn't re-entrant + + public JitterEffect() { + + } + + public JitterEffect(float amplitude, float wavelength, HeightEffect toJitter) { + + this.amplitude = amplitude; + this.wavelength = wavelength; + this.jittered = toJitter; + } + + @Override + public float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + if (running) { + throw new RuntimeException(); + } + running = true; + simplex.riverJitter().evaluateNoise((float) x / wavelength, (float) y / wavelength, jitter); + int pX = (int) Math.round(x + jitter.deltax() * amplitude); + int pY = (int) Math.round(y + jitter.deltay() * amplitude); + running = false; + return jittered.added(simplex, cell, pX, pY); + } + +} diff --git a/src/api/java/rtg/world/gen/terrain/LonelyMountainEffect.java b/src/api/java/rtg/world/gen/terrain/LonelyMountainEffect.java new file mode 100644 index 00000000..55a3df53 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/LonelyMountainEffect.java @@ -0,0 +1,40 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public class LonelyMountainEffect extends HeightEffect { + + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + // a trio of parameters frequently used together + public float mountainHeight = Integer.MAX_VALUE; + ; + public float mountainWavelength = 0; + public float spikeHeight = Integer.MAX_VALUE; + ; + public float spikeWavelength = 0; + // octaves are standardized so they don't need to be set + public int hillOctave = 0;// + ; + public int spikeOctave = 2;// + private float adjustedBottom = TerrainBase.blendedHillHeight(0, 0f); + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + float noise = simplex.octave(hillOctave).noise2(x / mountainWavelength, y / mountainWavelength); + noise = Math.abs(noise); + noise = TerrainBase.blendedHillHeight(noise, 0f); + //transform to be more mountainous + noise = TerrainBase.unsignedPower(noise, 1.7f); + noise = 1f - (1f - noise) / (1f - adjustedBottom); + float spikeNoise = simplex.octave(spikeOctave).noise2((float) x / spikeWavelength, (float) y / spikeWavelength); + spikeNoise = Math.abs(noise); + spikeNoise = TerrainBase.blendedHillHeight(noise, 0f); + spikeNoise *= noise; + return noise * mountainHeight + spikeNoise * spikeHeight; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/MountainsWithPassesEffect.java b/src/api/java/rtg/world/gen/terrain/MountainsWithPassesEffect.java new file mode 100644 index 00000000..ad1b13ca --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/MountainsWithPassesEffect.java @@ -0,0 +1,45 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public class MountainsWithPassesEffect extends HeightEffect { + + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + // a trio of parameters frequently used together + public float mountainHeight = Integer.MAX_VALUE; + ; + public float mountainWavelength = 0; + public float spikeHeight = Integer.MAX_VALUE; + ; + public float spikeWavelength = 0; + // octaves are standardized so they don't need to be set + public int hillOctave = 0;// + ; + public int spikeOctave = 2;// + private float adjustedBottom = TerrainBase.blendedHillHeight(0, .2f); + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + float noise = simplex.octave(hillOctave).noise2(x / mountainWavelength, y / mountainWavelength); + noise = Math.abs(noise); + noise = TerrainBase.blendedHillHeight(noise, 0.2f); + noise = 1f - (1f - noise) / (1f - adjustedBottom); + float spikeNoise = simplex.octave(spikeOctave).noise2(x / spikeWavelength, y / spikeWavelength); + spikeNoise = Math.abs(noise); + spikeNoise = TerrainBase.blendedHillHeight(noise, 0.1f); + spikeNoise *= spikeNoise; + spikeNoise = TerrainBase.blendedHillHeight(spikeNoise * noise); + if (noise > 1.01) { + throw new RuntimeException(); + } + if (spikeNoise > 1.01) { + throw new RuntimeException(); + } + return noise * mountainHeight + spikeNoise * spikeHeight; + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/PlateauEffect.java b/src/api/java/rtg/world/gen/terrain/PlateauEffect.java new file mode 100644 index 00000000..6ea8abdc --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/PlateauEffect.java @@ -0,0 +1,43 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public class PlateauEffect extends HeightEffect { + // similar to HillockEffect except that the transition is smooth + // and it can pass through a subordinate effect after multiply by the BlendedHill noise + + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + // a trio of parameters frequently used together + public float height = Integer.MAX_VALUE; + ; + public float wavelength = 0; + public float bottomSimplexValue = Integer.MAX_VALUE;// normal range is -1 to 1; + //usually numbers above 0 are often preferred to avoid dead basins + public float topSimplexValue = Integer.MIN_VALUE; + public int octave; + public HeightEffect subordinate; + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + float noise = simplex.octave(octave).noise2(x / wavelength, y / wavelength); + if (noise > topSimplexValue) { + noise = 1f; + } + else if (noise < bottomSimplexValue) { + noise = 0f; + } + else { + noise = (noise - bottomSimplexValue) / (topSimplexValue - bottomSimplexValue); + } + if (subordinate == null) { + return noise * height; + } + float added = subordinate.added(simplex, cell, x, y); + return noise * (height + added); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/RaiseEffect.java b/src/api/java/rtg/world/gen/terrain/RaiseEffect.java new file mode 100644 index 00000000..59a3f915 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/RaiseEffect.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * // just adds a constant increase + * + * @author Zeno410 + */ +public class RaiseEffect extends HeightEffect { + + // just adds a number + public final float height; + + public RaiseEffect(float height) { + + this.height = height; + } + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + return height; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/ScatteredMountainsEffect.java b/src/api/java/rtg/world/gen/terrain/ScatteredMountainsEffect.java new file mode 100644 index 00000000..49ecb843 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/ScatteredMountainsEffect.java @@ -0,0 +1,39 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * This creates steep mountains in ranges, leaving most land minimally affected + * + * @author Zeno410 + */ +public class ScatteredMountainsEffect extends HeightEffect { + + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + // a trio of parameters frequently used together + public float mountainHeight = Integer.MAX_VALUE; + ; + public float mountainWavelength = 0; + public float spikeHeight = Integer.MAX_VALUE; + ; + public float spikeWavelength = 0; + // octaves are standardized so they don't need to be set + public int hillOctave = 0;// + ; + public int spikeOctave = 2;// + private float adjustedBottom = TerrainBase.blendedHillHeight(0, 0f); + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + float noise = simplex.octave(hillOctave).noise2(x / mountainWavelength, y / mountainWavelength); + noise = TerrainBase.blendedHillHeight(noise, 0f); + float spikeNoise = simplex.octave(spikeOctave).noise2(x / spikeWavelength, y / spikeWavelength); + spikeNoise = Math.abs(noise); + spikeNoise = TerrainBase.blendedHillHeight(noise, 0f); + spikeNoise *= spikeNoise; + spikeNoise = TerrainBase.blendedHillHeight(spikeNoise * noise); + return noise * mountainHeight + spikeNoise * spikeHeight; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/SpikeEffect.java b/src/api/java/rtg/world/gen/terrain/SpikeEffect.java new file mode 100644 index 00000000..96fd03b7 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/SpikeEffect.java @@ -0,0 +1,31 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * @author Zeno410 + */ +public class SpikeEffect extends HeightEffect { + + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + // a trio of parameters frequently used together + public float height = Integer.MAX_VALUE; + ; + public float wavelength = 0; + public float minimumSimplex = Integer.MAX_VALUE;// normal range is -1 to 1; + //usually numbers above 0 are often preferred to avoid dead basins + public int octave; + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + float noise = simplex.octave(octave).noise2(x / wavelength, y / wavelength); + if (noise < minimumSimplex) { + noise = minimumSimplex; + } + noise = 1f - (1f - noise) / (1f - minimumSimplex); + noise *= noise; + return noise * height; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainBase.java b/src/api/java/rtg/world/gen/terrain/TerrainBase.java new file mode 100644 index 00000000..bde841fb --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainBase.java @@ -0,0 +1,773 @@ +package rtg.world.gen.terrain; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainBase { + + public static final float minimumOceanFloor = 30.01f; // The lowest Y coord an ocean floor is allowed to be. + public static final float minimumDuneHeight = 21f; // The strength factor to which the dune height config option is added. + protected final float minOceanFloor; // The lowest Y coord an ocean floor is allowed to be. + protected final float minDuneHeight; // The strength factor to which the dune height config option is added. + protected final float groundNoiseAmplitudeHills; + protected final float groundVariation; + protected final float rollingHillsMaxHeight; + protected float base; // added as most terrains have this; + protected float groundNoise; + + public TerrainBase() { + + this(68f);// default to marginally above sea level; + } + + public TerrainBase(float base) { + + this.base = base; + this.minOceanFloor = minimumOceanFloor; + this.minDuneHeight = minimumDuneHeight; + this.groundVariation = 2f; + this.groundNoise = this.base; + this.groundNoiseAmplitudeHills = 6f; + this.rollingHillsMaxHeight = 80f; + } + + public static final float blendedHillHeight(float simplex) { + // this takes a simplex supposed to vary from -1 to 1 + // and produces an output which varies from 0 to 1 non-linearly + // with the value of 0 mapped to about 0.15 and smooth transition + // the purpose is to make hills above plains without significant deadvalleys + float result = simplex + 1; + result = result * result * result + 10; + result = (float) Math.pow(result, .33333333333333); + result = result / 0.46631f;// this is the different between the values for -1 and 1, + //so normalizing to a distance of 1 + result = result - 4.62021f;// subtracting the result for input -1 so we actually get 0 to 1 + return result; + } + + public static final float blendedHillHeight(float simplex, float turnAt) { + // like blendedHillHeight, but the effect of zero occurs at the turnAt parameter instead + float adjusted = (1f - (1f - simplex) / (1f - turnAt)); + return blendedHillHeight(adjusted); + } + + public static final float borderAdjusted(float effect, float border, float allAbove, float noneBelow) { + // this routine adjusts an effect to ignore the border variable above allAbove + // and interpolated down to 0 at noneBelow + if (border < noneBelow) { + return 0; + } + if (border >= 1f) { + return effect; + } + // adjust effect for border + float adjusted = effect / border; + if (border > allAbove) { + return adjusted; + } + // return interpolated value + return adjusted * (border - noneBelow) / (allAbove - noneBelow); + } + + public static final float above(float limited, float limit) { + + if (limited > limit) { + return limited - limit; + } + return 0f; + } + + public static final float stretched(float toStretch) { + + if (toStretch > 0) { + return (float) Math.sqrt(toStretch); + } + //(else) + return (-1f) * (float) Math.sqrt((-1f) * toStretch); + } + + public static final float unsignedPower(float number, float power) { + + if (number > 0) { + return (float) Math.pow(number, power); + } + //(else) + return (-1f) * (float) Math.pow((-1f) * number, power); + } + + public static float hills(float x, float y, float hillStrength, OpenSimplexNoise simplex, float river) { + + float m = simplex.noise2(x / 150f, y / 150f); + m = blendedHillHeight(m, 0.2f); + + float sm = simplex.octave(2).noise2(x / 55, y / 55);// there are artifacts if this is close to a multiple of 16 + sm = blendedHillHeight(sm, 0.2f); + //sm = sm*0.8f; + sm *= sm * m; + m += sm / 3f; + + return m * hillStrength; + } + + public static float groundNoise(int x, int y, float amplitude, OpenSimplexNoise simplex) { + + float h = blendedHillHeight(simplex.noise2((float) x / 49f, (float) y / 49f), 0.2f) * amplitude; + h += blendedHillHeight(simplex.octave(1).noise2((float) x / 23f, (float) y / 23f), 0.2f) * amplitude / 2f; + h += blendedHillHeight(simplex.octave(2).noise2((float) x / 11f, (float) y / 11f), 0.2f) * amplitude / 4f; + return h; + } + + public static float groundNoise(float x, float y, float amplitude, OpenSimplexNoise simplex) { + + float h = blendedHillHeight(simplex.noise2(x / 49f, y / 49f), 0.2f) * amplitude; + h += blendedHillHeight(simplex.octave(1).noise2(x / 23f, y / 23f), 0.2f) * amplitude / 2f; + h += blendedHillHeight(simplex.octave(2).noise2(x / 11f, y / 11f), 0.2f) * amplitude / 4f; + return h; + } + + public static float getTerrainBase() { + + return 68f; + } + + public static float getTerrainBase(float river) { + + return 62f + 6f * river; + } + + public static float riverized(float height, float river) { + + if (height < 62.95f) { + return height; + } + return 62.95f + (height - 62.95f) * river; + } + + public static float terrainBeach(int x, int y, OpenSimplexNoise simplex, float river, float pitch1, float pitch2, float baseHeight) { + + float h = simplex.noise2(x / pitch1, y / pitch1) * 40f * river; + h *= h / pitch2; + + if (h < 1f) { + h = 1f; + } + + if (h < 4f) { + h += (simplex.noise2(x / 50f, y / 50f) + simplex.noise2(x / 15f, y / 15f)) * (4f - h); + } + + return baseHeight + h; + } + + public static float terrainBryce(int x, int y, OpenSimplexNoise simplex, float river, float height, float border) { + + float b = 0; + float n; + float sn = simplex.noise2(x / 2f, y / 2f) * 0.5f + 0.5f; + sn += simplex.noise2(x, y) * 0.2 + 0.2; + sn += simplex.noise2(x / 4f, y / 4f) * 4f + 4f; + sn += simplex.noise2(x / 8f, y / 8f) * 2f + 2f; + n = height / sn * 2; + n += simplex.noise2(x / 64f, y / 64f) * 4f; + n = (sn < 6) ? n : 0f; + b += n; + return riverized(getTerrainBase() + b, river); + } + + public static float terrainCanyon(int x, int y, OpenSimplexNoise simplex, float river, float[] height, float border, float strength, int heightLength, boolean booRiver) { + //float b = simplex.noise2(x / cWidth, y / cWidth) * cHeigth * river; + //b *= b / cStrength; + //river *= 1.3f; + //river = river > 1f ? 1f : river; + float r = simplex.noise2(x / 100f, y / 100f) * 50f * river; + r = r < -7.4f ? -7.4f : r > 7.4f ? 7.4f : r; + float b = (17f + r) * river; + + float hn = simplex.noise2(x / 12f, y / 12f) * 0.5f; + float sb = 0f; + if (b > 0f) { + sb = b; + sb = sb < 0f ? 0f : sb > 7f ? 7f : sb; + sb = hn * sb * river; + } + b += sb; + + float cTotal = 0f; + float cTemp = 0f; + + for (int i = 0; i < heightLength; i += 2) { + cTemp = 0; + if (b > height[i] && border > 0.6f + (height[i] * 0.015f) + hn * 0.2f) { + cTemp = b > height[i] + height[i + 1] ? height[i + 1] : b - height[i]; + cTemp *= strength; + } + cTotal += cTemp; + } + + + float bn = 0f; + if (booRiver) { + if (b < 5f) { + bn = 5f - b; + for (int i = 0; i < 3; i++) { + bn *= bn / 4.5f; + } + } + } + else if (b < 5f) { + bn = (simplex.noise2(x / 7f, y / 7f) * 1.3f + simplex.noise2(x / 15f, y / 15f) * 2f) * (5f - b) * 0.2f; + } + + b += cTotal - bn; + + return getTerrainBase(river) + b; + } + + public static float terrainDunes(int x, int y, OpenSimplexNoise simplex, CellNoise cell, float river) { + + float st = (simplex.noise2(x / 160f, y / 160f) + 0.38f) * (minimumDuneHeight + (float) ConfigRTG.duneHeight); + st = st < 0.2f ? 0.2f : st; + + float h = simplex.noise2(x / 60f, y / 60f) * st * 2f; + h = h > 0f ? -h : h; + h += st; + h *= h / 50f; + h += st; + + if (h < 10f) { + float d = (h - 10f) / 2f; + d = d > 4f ? 4f : d; + h += cell.noise(x / 25D, y / 25D, 1D) * d; + h += simplex.noise2(x / 30f, y / 30f) * d; + h += simplex.noise2(x / 14f, y / 14f) * d * 0.5f; + } + + return 70f + (h * river); + } + + public static float terrainDuneValley(float x, float y, OpenSimplexNoise simplex, CellNoise cell, float river, float valley, float hFactor, float baseHeight) { + + float h = (simplex.noise2(x / valley, y / valley) + 0.25f) * hFactor * river; + h = h < 1f ? 1f : h; + + float r = (float) simplex.noise(x / 50D, y / 50D, 1D); + r += blendedHillHeight(r); + r = r * h * 2; // so, 0 to 3 times h + h += r; + + h += blendedHillHeight(simplex.noise2(x / 40f, y / 40f)) * 8; + h += blendedHillHeight(simplex.noise2(x / 14f, y / 14f)) * 2; + + h = h * river; + + if (river < 1) { + return (63f + (baseHeight - 63f) * river) + h; + } + return baseHeight + h; + } + + public static float terrainFlatLakes(int x, int y, OpenSimplexNoise simplex, float river, float hMax, float baseHeight) { + /*float h = simplex.noise2(x / 300f, y / 300f) * 40f * river; + h = h > hMax ? hMax : h; + h += simplex.noise2(x / 50f, y / 50f) * (12f - h) * 0.4f; + h += simplex.noise2(x / 15f, y / 15f) * (12f - h) * 0.15f;*/ + + float ruggedNoise = simplex.octave(1).noise2(x / VariableRuggednessEffect.STANDARD_RUGGEDNESS_WAVELENGTH + , y / VariableRuggednessEffect.STANDARD_RUGGEDNESS_WAVELENGTH); + + ruggedNoise = blendedHillHeight(ruggedNoise); + float h = groundNoise(x, y, 2f * (ruggedNoise + 1f), simplex);// ground noise + float hillNoise = (float) simplex.noise(x / 60f, y / 60f); + hillNoise *= hillNoise * hMax * ruggedNoise; + return riverized(baseHeight + h, river); + } + + public static float terrainForest(int x, int y, OpenSimplexNoise simplex, float river, float baseHeight) { + + float h = simplex.noise2(x / 100f, y / 100f) * 8; + h += simplex.noise2(x / 30f, y / 30f) * 4; + h += simplex.noise2(x / 15f, y / 15f) * 2; + h += simplex.noise2(x / 7f, y / 7f); + + return riverized(baseHeight + 20f + h, river); + } + + public static float terrainGrasslandFlats(int x, int y, OpenSimplexNoise simplex, float river, float mPitch, float lPitch, float baseHeight) { + + float h = simplex.noise2(x / 100f, y / 100f) * 7; + h += simplex.noise2(x / 20f, y / 20f) * 2; + + float m = simplex.noise2(x / 180f, y / 180f) * 35f * river; + m *= m / mPitch; + + float sm = blendedHillHeight(simplex.noise2(x / 30f, y / 30f)) * 8f; + sm *= m / 20f > 3.75f ? 3.75f : m / 20f; + m += sm; + + return riverized(baseHeight + h + m, river); + } + + public static float terrainGrasslandHills(int x, int y, OpenSimplexNoise simplex, CellNoise cell, float river, float vWidth, float vHeight, float hWidth, float hHeight, float bHeight) { + + float h = simplex.noise2(x / vWidth, y / vWidth); + h = blendedHillHeight(h, 0.3f); + + float m = simplex.octave(1).noise2(x / hWidth, y / hWidth); + m = blendedHillHeight(m, 0.3f) * h; + m *= m; + + h *= vHeight * river; + m *= hHeight * river; + + h += TerrainBase.groundNoise(x, y, 4f, simplex); + + return riverized(bHeight, river) + h + m; + } + + public static float terrainGrasslandMountains(int x, int y, OpenSimplexNoise simplex, CellNoise cell, float river, float hFactor, float mFactor, float baseHeight) { + + float h = simplex.noise2(x / 100f, y / 100f) * hFactor; + h += simplex.noise2(x / 20f, y / 20f) * 2; + + float m = simplex.noise2(x / 230f, y / 230f) * mFactor * river; + m *= m / 35f; + m = m > 70f ? 70f + (m - 70f) / 2.5f : m; + + float c = (float) simplex.octave(4).noise(x / 30f, y / 30f, 1D) * (m * 0.30f); + + float sm = simplex.noise2(x / 30f, y / 30f) * 8f + simplex.noise2(x / 8f, y / 8f); + sm *= m / 20f > 2.5f ? 2.5f : m / 20f; + m += sm; + + m += c; + + return riverized(baseHeight + h + m, river); + } + + public static float terrainHighland(float x, float y, OpenSimplexNoise simplex, CellNoise cell, float river, float start, float width, float height, float baseAdjust) { + + float h = simplex.noise2(x / width, y / width) * height * river; //-140 to 140 + h = h < start ? start + ((h - start) / 4.5f) : h; + + if (h < 0f) { + h = 0;//0 to 140 + } + if (h > 0f) { + float st = h * 1.5f > 15f ? 15f : h * 1.5f;// 0 to 15 + h += simplex.octave(4).noise(x / 70D, y / 70D, 1D) * st;// 0 to 155 + h = h * river; + } + + h += blendedHillHeight(simplex.noise2(x / 20f, y / 20f), 0f) * 4f; + h += blendedHillHeight(simplex.noise2(x / 12f, y / 12f), 0f) * 2f; + h += blendedHillHeight(simplex.noise2(x / 5f, y / 5f), 0f) * 1f; + + if (h < 0) { + h = h / 2f; + } + + if (h < -3) { + h = (h + 3f) / 2f - 3f; + } + + return getTerrainBase(river) + (h + baseAdjust) * river; + } + + public static float terrainLonelyMountain(int x, int y, OpenSimplexNoise simplex, CellNoise cell, float river, float strength, float width, float terrainHeight) { + + float h = blendedHillHeight(simplex.noise2(x / 20f, y / 20f), 0) * 3; + h += blendedHillHeight(simplex.noise2(x / 7f, y / 7f), 0) * 1.3f; + + float m = simplex.noise2(x / width, y / width) * strength * river; + m *= m / 35f; + m = m > 70f ? 70f + (m - 70f) / 2.5f : m; + + float st = m * 0.7f; + st = st > 20f ? 20f : st; + float c = (float) simplex.octave(4).noise(x / 30f, y / 30f, 1D) * (5f + st); + + float sm = simplex.noise2(x / 30f, y / 30f) * 8f + simplex.noise2(x / 8f, y / 8f); + sm *= (m + 10f) / 20f > 2.5f ? 2.5f : (m + 10f) / 20f; + m += sm; + + m += c; + + // the parameters can "blow through the ceiling" so pull more extreme values down a bit + // this should allow a height parameter up to about 120 + if (m > 90) { + m = 90f + (m - 90f) * .75f; + if (m > 110) { + m = 110f + (m - 110f) * .75f; + } + } + return riverized(terrainHeight + h + m, river); + } + + public static float terrainMarsh(int x, int y, OpenSimplexNoise simplex, float baseHeight) { + + float h = simplex.noise2(x / 130f, y / 130f) * 20f; + + h += simplex.noise2(x / 12f, y / 12f) * 2f; + h += simplex.noise2(x / 18f, y / 18f) * 4f; + + h = h < 8f ? 0f : h - 8f; + + if (h == 0f) { + h += simplex.noise2(x / 20f, y / 20f) + simplex.noise2(x / 5f, y / 5f); + h *= 2f; + } + + return baseHeight + h; + } + + public static float terrainMesa(int x, int y, OpenSimplexNoise simplex, float river, float border) { + + float b = simplex.noise2(x / 130f, y / 130f) * 50f * river; + b *= b / 40f; + + float hn = simplex.noise2(x / 12f, y / 12f); + + float sb = 0f; + if (b > 2f) { + sb = (b - 2f) / 2f; + sb = sb < 0f ? 0f : sb > 5.5f ? 5.5f : sb; + sb = hn * sb; + } + b += sb; + + b = b < 0.1f ? 0.1f : b; + + float c1 = 0f; + if (b > 1f) { + c1 = b > 5.5f ? 4.5f : b - 1f; + c1 *= 3; + } + + float c2 = 0f; + if (b > 5.5f && border > 0.95f + hn * 0.09f) { + c2 = b > 6f ? 0.5f : b - 5.5f; + c2 *= 35; + } + + float bn = 0f; + if (b < 7f) { + float bnh = 5f - b; + bn += simplex.noise2(x / 70f, y / 70f) * (bnh * 0.4f); + bn += simplex.noise2(x / 20f, y / 20f) * (bnh * 0.3f); + } + + float w = simplex.noise2(x / 80f, y / 80f) * 25f; + w *= w / 25f; + + b += c1 + c2 + bn - w; + + return 74f + b; + } + + public static float terrainMountainRiver(int x, int y, OpenSimplexNoise simplex, CellNoise cell, float river, float hPitch, float baseHeight) { + + float h = simplex.noise2(x / hPitch, y / hPitch) * 135f * river; + h *= h / 32f; + h = h > 150f ? 150f : h; + + /*float bn = 0f; + if(h < 1f) + { + bn = 1f - h; + for(int i = 0; i < 3; i++) + { + bn *= bn * 1.25f; + } + + bn = bn > 3f ? 3f : bn; + }*/ + + if (h < 10f) { + h += simplex.noise2(x / 14f, y / 14f) * (10f - h) * 0.2f; + } + + if (h > 10f) { + float d = (h - 10f) / 2f > 8f ? 8f : (h - 10f) / 2f; + h += simplex.noise2(x / 35f, y / 35f) * d; + h += simplex.noise2(x / 60f, y / 60f) * d * 0.5f; + + if (h > 35f) { + float d2 = (h - 35f) / 1.5f > 30f ? 30f : (h - 35f) / 1.5f; + h += simplex.octave(4).noise(x / 25D, y / 25D, 1D) * d2; + } + } + + if (h > 2f) { + float d = (h - 2f) / 2f > 4f ? 4f : (h - 2f) / 2f; + h += simplex.noise2(x / 28f, y / 28f) * d; + h += simplex.noise2(x / 18f, y / 18f) * (d / 2f); + h += simplex.noise2(x / 8f, y / 8f) * (d / 2f); + } + + return riverized(h + baseHeight, river);// - bn; + } + + public static float terrainMountainSpikes(int x, int y, OpenSimplexNoise simplex, CellNoise cell, float river) { + + float b = (12f + (simplex.noise2(x / 300f, y / 300f) * 6f)); + float h = (float) simplex.octave(4).noise(x / 200D, y / 200D, 1D) * b * river; + h *= h * 1.5f; + h = h > 155f ? 155f : h; + + if (h > 2f) { + float d = (h - 2f) / 2f > 8f ? 8f : (h - 2f) / 2f; + h += simplex.noise2(x / 30f, y / 30f) * d; + h += simplex.noise2(x / 50f, y / 50f) * d * 0.5f; + + if (h > 35f) { + float d2 = (h - 35f) / 1.5f > 30f ? 30f : (h - 35f) / 1.5f; + h += simplex.octave(4).noise(x / 25D, y / 25D, 1D) * d2; + } + } + + h += simplex.noise2(x / 18f, y / 18f) * 3; + h += simplex.noise2(x / 8f, y / 8f) * 2; + + return 45f + h + (b * 2); + } + + public static float terrainOcean(int x, int y, OpenSimplexNoise simplex, float river, float averageFloor) { + + float h = simplex.noise2(x / 300f, y / 300f) * 40f * river; + h = h > 3f ? 3f : h; + h += simplex.noise2(x / 50f, y / 50f) * (12f - h) * 0.4f; + h += simplex.noise2(x / 15f, y / 15f) * (12f - h) * 0.15f; + + float floNoise = averageFloor + h; + floNoise = floNoise < minimumOceanFloor ? minimumOceanFloor : floNoise; + + return floNoise; + } + + public static float terrainOceanCanyon(int x, int y, OpenSimplexNoise simplex, float river, float[] height, float border, float strength, int heightLength, boolean booRiver) { + //float b = simplex.noise2(x / cWidth, y / cWidth) * cHeigth * river; + //b *= b / cStrength; + river *= 1.3f; + river = river > 1f ? 1f : river; + float r = simplex.noise2(x / 100f, y / 100f) * 50f; + r = r < -7.4f ? -7.4f : r > 7.4f ? 7.4f : r; + float b = (17f + r) * river; + + float hn = simplex.noise2(x / 12f, y / 12f) * 0.5f; + float sb = 0f; + if (b > 0f) { + sb = b; + sb = sb < 0f ? 0f : sb > 7f ? 7f : sb; + sb = hn * sb; + } + b += sb; + + float cTotal = 0f; + float cTemp = 0f; + + for (int i = 0; i < heightLength; i += 2) { + cTemp = 0; + if (b > height[i] && border > 0.6f + (height[i] * 0.015f) + hn * 0.2f) { + cTemp = b > height[i] + height[i + 1] ? height[i + 1] : b - height[i]; + cTemp *= strength; + } + cTotal += cTemp; + } + + + float bn = 0f; + if (booRiver) { + if (b < 5f) { + bn = 5f - b; + for (int i = 0; i < 3; i++) { + bn *= bn / 4.5f; + } + } + } + else if (b < 5f) { + bn = (simplex.noise2(x / 7f, y / 7f) * 1.3f + simplex.noise2(x / 15f, y / 15f) * 2f) * (5f - b) * 0.2f; + } + + b += cTotal - bn; + + float floNoise = 30f + b; + floNoise = floNoise < minimumOceanFloor ? minimumOceanFloor : floNoise; + + return floNoise; + } + + public static float terrainPlains(int x, int y, OpenSimplexNoise simplex, float river, float stPitch, float stFactor, float hPitch, float hDivisor, float baseHeight) { + + float floNoise; + float st = (simplex.noise2(x / stPitch, y / stPitch) + 0.38f) * stFactor * river; + st = st < 0.2f ? 0.2f : st; + + float h = simplex.noise2(x / hPitch, y / hPitch) * st * 2f; + h = h > 0f ? -h : h; + h += st; + h *= h / hDivisor; + h += st; + + floNoise = riverized(baseHeight + h, river); + return floNoise; + } + + public static float terrainPlateau(float x, float y, OpenSimplexNoise simplex, float river, float[] height, float border, float strength, int heightLength, float selectorWaveLength, boolean isM) { + + river = river > 1f ? 1f : river; + float border2 = border * 4 - 2.5f; + border2 = border2 > 1f ? 1f : (border2 < 0f) ? 0f : border2; + float b = simplex.noise2(x / 40f, y / 40f) * 1.5f; + + float sn = simplex.noise2(x / selectorWaveLength, y / selectorWaveLength) * 0.5f + 0.5f; + sn *= border2; + sn *= river; + sn += simplex.noise2(x / 4f, y / 4f) * 0.01f + 0.01f; + sn += simplex.noise2(x / 2f, y / 2f) * 0.01f + 0.01f; + float n, hn, stepUp; + for (int i = 0; i < heightLength; i += 2) { + n = (sn - height[i + 1]) / (1 - height[i + 1]); + n = n * strength; + n = (n < 0f) ? 0f : (n > 1f) ? 1f : n; + hn = height[i] * 0.5f * ((sn * 2f) - 0.4f); + hn = (hn < 0) ? 0f : hn; + stepUp = 0f; + if (sn > height[i + 1]) { + stepUp += (height[i] * n); + if (isM) { + stepUp += simplex.noise2(x / 20f, y / 20f) * 3f * n; + stepUp += simplex.noise2(x / 12f, y / 12f) * 2f * n; + stepUp += simplex.noise2(x / 5f, y / 5f) * 1f * n; + } + } + if (i == 0 && stepUp < hn) { + b += hn; + } + stepUp = (stepUp < 0) ? 0f : stepUp; + b += stepUp; + } + if (isM) { + b += simplex.noise2(x / 12, y / 12) * sn; + } + //Counteracts smoothing + b /= border; + + return riverized(getTerrainBase(), river) + b; + } + + public static float terrainPolar(int x, int y, OpenSimplexNoise simplex, float river) { + + float st = (simplex.noise2(x / 160f, y / 160f) + 0.38f) * (minimumDuneHeight + (float) ConfigRTG.duneHeight) * river; + st = st < 0.2f ? 0.2f : st; + + float h = simplex.noise2(x / 60f, y / 60f) * st * 2f; + h = h > 0f ? -h : h; + h += st; + h *= h / 50f; + h += st; + if (river < 1) { + return 62f + (8f * river) + h; + } + return 70f + h; + } + + public static float terrainPolar(float x, float y, OpenSimplexNoise simplex, float river, float stPitch, float stFactor, float hPitch, float hDivisor, float baseHeight) { + + float floNoise; + float st = (simplex.noise2(x / stPitch, y / stPitch) + 0.38f) * stFactor * river; + st = st < 0.1f ? 0.1f : st; + + float h = simplex.noise2(x / hPitch, y / hPitch) * st * 2f; + h = h > 0f ? -h : h; + h += st; + h *= h / hDivisor; + h += st; + + floNoise = riverized(baseHeight + h, river); + return floNoise; + } + + public static float terrainRollingHills(int x, int y, OpenSimplexNoise simplex, float river, float hillStrength, float addedHeight, float groundNoise, float groundNoiseAmplitudeHills, float lift) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + float m = hills(x, y, hillStrength, simplex, river); + + float floNoise = addedHeight + groundNoise + m; + + return riverized(floNoise + lift, river); + } + + public static float terrainRollingHills(int x, int y, OpenSimplexNoise simplex, float river, float hillStrength, float groundNoise, float groundNoiseAmplitudeHills, float baseHeight) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + float m = hills(x, y, hillStrength, simplex, river); + + float floNoise = groundNoise + m; + + return riverized(floNoise + baseHeight, river); + } + + public static float terrainSwampMountain(int x, int y, OpenSimplexNoise simplex, CellNoise cell, float river, float width, float heigth, float hMax, float hDivisor, float baseHeight) { + + float h = simplex.noise2(x / width, y / width) * heigth * river; + h *= h / hDivisor; + h = h > hMax ? hMax : h; + + if (h < 14f) { + h += simplex.noise2(x / 25f, y / 25f) * (14f - h) * 0.8f; + } + + if (h < 6) { + h = 6f - ((6f - h) * 0.07f) + simplex.noise2(x / 20f, y / 20f) + simplex.noise2(x / 5f, y / 5f); + } + + if (h > 10f) { + float d = (h - 10f) / 2f > 8f ? 8f : (h - 10f) / 2f; + h += simplex.noise2(x / 35f, y / 35f) * d; + h += simplex.noise2(x / 60f, y / 60f) * d * 0.5f; + + if (h > 35f) { + float d2 = (h - 35f) / 1.5f > 30f ? 30f : (h - 35f) / 1.5f; + h += simplex.octave(4).noise(x / 25D, y / 25D, 1D) * d2; + } + } + + if (h > 2f) { + float d = (h - 2f) / 2f > 4f ? 4f : (h - 2f) / 2f; + h += simplex.noise2(x / 28f, y / 28f) * d; + h += simplex.noise2(x / 18f, y / 18f) * (d / 2f); + h += simplex.noise2(x / 8f, y / 8f) * (d / 2f); + } + + return riverized(h + baseHeight, river); + } + + public static float terrainVolcano(int x, int y, OpenSimplexNoise simplex, CellNoise cell, float border, float baseHeight) { + + float st = 15f - ((cell.noise(x / 500D, y / 500D, 1D) * 42f) + (simplex.noise2(x / 30f, y / 30f) * 2f)); + + st = st < 0f ? 0f : st; + + float h = st; + h = h < 0f ? 0f : h; + h += (h * 0.4f) * ((h * 0.4f) * 2f); + + if (h > 10f) { + float d2 = (h - 10f) / 1.5f > 30f ? 30f : (h - 10f) / 1.5f; + h += cell.noise(x / 25D, y / 25D, 1D) * d2; + } + + h += simplex.noise2(x / 18f, y / 18f) * 3; + h += simplex.noise2(x / 8f, y / 8f) * 2; + + return baseHeight + h * border; + } + + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return 70f; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainBeach.java b/src/api/java/rtg/world/gen/terrain/TerrainBeach.java new file mode 100644 index 00000000..87d7c567 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainBeach.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainBeach extends TerrainBase { + + public TerrainBeach() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainBeach(x, y, simplex, river, 180f, 35f, 60f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainCanyon.java b/src/api/java/rtg/world/gen/terrain/TerrainCanyon.java new file mode 100644 index 00000000..56d8142c --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainCanyon.java @@ -0,0 +1,100 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainCanyon extends TerrainBase { + + private boolean booRiver; + private float[] height; + private int heightLength; + private float strength; + private float cWidth; + private float cHeigth; + private float cStrength; + private float base; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainCanyon(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + + booRiver = riverGen; + height = new float[]{5.0f, 0.5f, 12.5f, 0.5f, 18.0f, 0.5f}; + strength = heightStrength; + heightLength = height.length; + cWidth = canyonWidth; + cHeigth = canyonHeight; + cStrength = canyonStrength; + base = baseHeight; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //float b = simplex.noise2(x / cWidth, y / cWidth) * cHeigth * river; + //b *= b / cStrength; + river *= 1.3f; + river = river > 1f ? 1f : river; + float r = simplex.noise2(x / 100f, y / 100f) * 50f; + r = r < -7.4f ? -7.4f : r > 7.4f ? 7.4f : r; + float b = (17f + r) * river; + + float hn = simplex.noise2(x / 12f, y / 12f) * 0.5f; + float sb = 0f; + if (b > 0f) { + sb = b; + sb = sb < 0f ? 0f : sb > 7f ? 7f : sb; + sb = hn * sb; + } + b += sb; + + float cTotal = 0f; + float cTemp = 0f; + + for (int i = 0; i < heightLength; i += 2) { + cTemp = 0; + if (b > height[i] && border > 0.6f + (height[i] * 0.015f) + hn * 0.2f) { + cTemp = b > height[i] + height[i + 1] ? height[i + 1] : b - height[i]; + cTemp *= strength; + } + cTotal += cTemp; + } + + + float bn = 0f; + if (booRiver) { + if (b < 5f) { + bn = 5f - b; + for (int i = 0; i < 3; i++) { + bn *= bn / 4.5f; + } + } + } + else if (b < 5f) { + bn = (simplex.noise2(x / 7f, y / 7f) * 1.3f + simplex.noise2(x / 15f, y / 15f) * 2f) * (5f - b) * 0.2f; + } + + b += cTotal - bn; + + return base + b; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainDuneValley.java b/src/api/java/rtg/world/gen/terrain/TerrainDuneValley.java new file mode 100644 index 00000000..76da7f1d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainDuneValley.java @@ -0,0 +1,20 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainDuneValley extends TerrainBase { + + private float valley; + + public TerrainDuneValley(float valleySize) { + + valley = valleySize; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainDuneValley(x, y, simplex, cell, river, valley, 65f, 70f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainDunes.java b/src/api/java/rtg/world/gen/terrain/TerrainDunes.java new file mode 100644 index 00000000..cab8f9ac --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainDunes.java @@ -0,0 +1,34 @@ +package rtg.world.gen.terrain; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainDunes extends TerrainBase { + + public TerrainDunes() { + + } + + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + float st = (simplex.noise2(x / 160f, y / 160f) + 0.38f) * (minDuneHeight + (float) ConfigRTG.duneHeight); + st = st < 0.2f ? 0.2f : st; + + float h = simplex.noise2(x / 60f, y / 60f) * st * 2f; + h = h > 0f ? -h : h; + h += st; + h *= h / 50f; + h += st; + + if (h < 10f) { + float d = (h - 10f) / 2f; + d = d > 4f ? 4f : d; + h += cell.noise(x / 25D, y / 25D, 1D) * d; + h += simplex.noise2(x / 30f, y / 30f) * d; + h += simplex.noise2(x / 14f, y / 14f) * d * 0.5f; + } + + return 70f + (h * river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainFlatLakes.java b/src/api/java/rtg/world/gen/terrain/TerrainFlatLakes.java new file mode 100644 index 00000000..004c8fd8 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainFlatLakes.java @@ -0,0 +1,16 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainFlatLakes extends TerrainBase { + + public TerrainFlatLakes() { + + } + + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainFlatLakes(x, y, simplex, river, 3f, 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainForest.java b/src/api/java/rtg/world/gen/terrain/TerrainForest.java new file mode 100644 index 00000000..d3311594 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainForest.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainForest extends TerrainBase { + + public TerrainForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainForest(x, y, simplex, river, 70f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainGrasslandFlats.java b/src/api/java/rtg/world/gen/terrain/TerrainGrasslandFlats.java new file mode 100644 index 00000000..25738954 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainGrasslandFlats.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainGrasslandFlats extends TerrainBase { + + public TerrainGrasslandFlats() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainGrasslandFlats(x, y, simplex, river, 40f, 25f, 68f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainGrasslandHills.java b/src/api/java/rtg/world/gen/terrain/TerrainGrasslandHills.java new file mode 100644 index 00000000..847318e4 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainGrasslandHills.java @@ -0,0 +1,36 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + + +public class TerrainGrasslandHills extends TerrainBase { + + private float hHeight; + private float hWidth; + private float vHeight; + private float vWidth; + private float lHeight; + private float lWidth; + private float bHeight; + + public TerrainGrasslandHills(float hillHeight, float hillWidth, float varHeight, float varWidth, float lakeHeight, float lakeWidth, float baseHeight) { + + hHeight = hillHeight; + hWidth = hillWidth; + + vHeight = varHeight; + vWidth = varWidth; + + lHeight = lakeHeight; + lWidth = lakeWidth; + + bHeight = baseHeight; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainGrasslandHills(x, y, simplex, cell, river, vWidth, vHeight, hWidth, hHeight, bHeight); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainGrasslandMountains.java b/src/api/java/rtg/world/gen/terrain/TerrainGrasslandMountains.java new file mode 100644 index 00000000..ea4fe8df --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainGrasslandMountains.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainGrasslandMountains extends TerrainBase { + + public TerrainGrasslandMountains() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainGrasslandMountains(x, y, simplex, cell, river, 7f, 120f, 68f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainHighland.java b/src/api/java/rtg/world/gen/terrain/TerrainHighland.java new file mode 100644 index 00000000..513d9c77 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainHighland.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainHighland extends TerrainBase { + + private float start; + private float height; + private float width; + + public TerrainHighland(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainLonelyMountain.java b/src/api/java/rtg/world/gen/terrain/TerrainLonelyMountain.java new file mode 100644 index 00000000..7dcfa54f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainLonelyMountain.java @@ -0,0 +1,23 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainLonelyMountain extends TerrainBase { + + private float width; + private float strength; + + public TerrainLonelyMountain(float mountainWidth, float mountainStrength, float height) { + + width = mountainWidth; + strength = mountainStrength; + base = height; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainLonelyMountain(x, y, simplex, cell, river, strength, width, base); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainMarsh.java b/src/api/java/rtg/world/gen/terrain/TerrainMarsh.java new file mode 100644 index 00000000..de75f81d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainMarsh.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + + +public class TerrainMarsh extends TerrainBase { + + public TerrainMarsh() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainMarsh(x, y, simplex, 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainMesa.java b/src/api/java/rtg/world/gen/terrain/TerrainMesa.java new file mode 100644 index 00000000..8493115e --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainMesa.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainMesa extends TerrainBase { + + public TerrainMesa() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainMesa(x, y, simplex, river, border); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainMountain.java b/src/api/java/rtg/world/gen/terrain/TerrainMountain.java new file mode 100644 index 00000000..392f456f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainMountain.java @@ -0,0 +1,36 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainMountain extends TerrainBase { + + public TerrainMountain() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + float h = simplex.noise2(x / 300f, y / 300f) * 135f * river; + h *= h / 32f; + h = h > 150f ? 150f : h; + + if (h > 10f) { + float d = (h - 10f) / 2f > 8f ? 8f : (h - 10f) / 2f; + h += simplex.noise2(x / 35f, y / 35f) * d; + h += simplex.noise2(x / 60f, y / 60f) * d * 0.5f; + + if (h > 35f) { + float d2 = (h - 35f) / 1.5f > 30f ? 30f : (h - 35f) / 1.5f; + h += cell.noise(x / 25D, y / 25D, 1D) * d2; + } + } + + h += simplex.noise2(x / 28f, y / 28f) * 4; + h += simplex.noise2(x / 18f, y / 18f) * 2; + h += simplex.noise2(x / 8f, y / 8f) * 2; + + return h + 67f; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainMountainRiver.java b/src/api/java/rtg/world/gen/terrain/TerrainMountainRiver.java new file mode 100644 index 00000000..460ff28e --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainMountainRiver.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainMountainRiver extends TerrainBase { + + public TerrainMountainRiver() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainMountainRiver(x, y, simplex, cell, river, 300f, 67f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainMountainSpikes.java b/src/api/java/rtg/world/gen/terrain/TerrainMountainSpikes.java new file mode 100644 index 00000000..9ba939a4 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainMountainSpikes.java @@ -0,0 +1,36 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainMountainSpikes extends TerrainBase { + + public TerrainMountainSpikes() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + float b = (12f + (simplex.noise2(x / 300f, y / 300f) * 6f)); + float h = cell.noise(x / 200D, y / 200D, 1D) * b * river; + h *= h * 1.5f; + h = h > 155f ? 155f : h; + + if (h > 2f) { + float d = (h - 2f) / 2f > 8f ? 8f : (h - 2f) / 2f; + h += simplex.noise2(x / 30f, y / 30f) * d; + h += simplex.noise2(x / 50f, y / 50f) * d * 0.5f; + + if (h > 35f) { + float d2 = (h - 35f) / 1.5f > 30f ? 30f : (h - 35f) / 1.5f; + h += cell.noise(x / 25D, y / 25D, 1D) * d2; + } + } + + h += simplex.noise2(x / 18f, y / 18f) * 3; + h += simplex.noise2(x / 8f, y / 8f) * 2; + + return 45f + h + (b * 2); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainOcean.java b/src/api/java/rtg/world/gen/terrain/TerrainOcean.java new file mode 100644 index 00000000..338bfcef --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainOcean.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainOcean extends TerrainBase { + + public TerrainOcean() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + float h = simplex.noise2(x / 300f, y / 300f) * 40f * river; + h = h > 3f ? 3f : h; + h += simplex.noise2(x / 50f, y / 50f) * (12f - h) * 0.4f; + h += simplex.noise2(x / 15f, y / 15f) * (12f - h) * 0.15f; + + float floNoise = 50f + h; + floNoise = floNoise < minimumOceanFloor ? minimumOceanFloor : floNoise; + + return floNoise; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainOceanCanyon.java b/src/api/java/rtg/world/gen/terrain/TerrainOceanCanyon.java new file mode 100644 index 00000000..2528e47c --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainOceanCanyon.java @@ -0,0 +1,103 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainOceanCanyon extends TerrainBase { + + private boolean booRiver; + private float[] height; + private int heightLength; + private float strength; + private float cWidth; + private float cHeigth; + private float cStrength; + private float base; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainOceanCanyon(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + + booRiver = riverGen; + height = new float[]{5.0f, 0.5f, 12.5f, 0.5f, 18.0f, 0.5f}; + strength = heightStrength; + heightLength = height.length; + cWidth = canyonWidth; + cHeigth = canyonHeight; + cStrength = canyonStrength; + base = baseHeight; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //float b = simplex.noise2(x / cWidth, y / cWidth) * cHeigth * river; + //b *= b / cStrength; + river *= 1.3f; + river = river > 1f ? 1f : river; + float r = simplex.noise2(x / 100f, y / 100f) * 50f; + r = r < -7.4f ? -7.4f : r > 7.4f ? 7.4f : r; + float b = (17f + r) * river; + + float hn = simplex.noise2(x / 12f, y / 12f) * 0.5f; + float sb = 0f; + if (b > 0f) { + sb = b; + sb = sb < 0f ? 0f : sb > 7f ? 7f : sb; + sb = hn * sb; + } + b += sb; + + float cTotal = 0f; + float cTemp = 0f; + + for (int i = 0; i < heightLength; i += 2) { + cTemp = 0; + if (b > height[i] && border > 0.6f + (height[i] * 0.015f) + hn * 0.2f) { + cTemp = b > height[i] + height[i + 1] ? height[i + 1] : b - height[i]; + cTemp *= strength; + } + cTotal += cTemp; + } + + + float bn = 0f; + if (booRiver) { + if (b < 5f) { + bn = 5f - b; + for (int i = 0; i < 3; i++) { + bn *= bn / 4.5f; + } + } + } + else if (b < 5f) { + bn = (simplex.noise2(x / 7f, y / 7f) * 1.3f + simplex.noise2(x / 15f, y / 15f) * 2f) * (5f - b) * 0.2f; + } + + b += cTotal - bn; + + float floNoise = base + b; + floNoise = floNoise < minimumOceanFloor ? minimumOceanFloor : floNoise; + + return floNoise; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainPlains.java b/src/api/java/rtg/world/gen/terrain/TerrainPlains.java new file mode 100644 index 00000000..91f14428 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainPlains.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainPlains extends TerrainBase { + + public TerrainPlains() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 66f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainPolar.java b/src/api/java/rtg/world/gen/terrain/TerrainPolar.java new file mode 100644 index 00000000..9ab777d6 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainPolar.java @@ -0,0 +1,27 @@ +package rtg.world.gen.terrain; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainPolar extends TerrainBase { + + public TerrainPolar() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + float st = (simplex.noise2(x / 160f, y / 160f) + 0.38f) * (minDuneHeight + (float) ConfigRTG.duneHeight) * river; + st = st < 0.2f ? 0.2f : st; + + float h = simplex.noise2(x / 60f, y / 60f) * st * 2f; + h = h > 0f ? -h : h; + h += st; + h *= h / 50f; + h += st; + + return 70f + h; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainRollingHills.java b/src/api/java/rtg/world/gen/terrain/TerrainRollingHills.java new file mode 100644 index 00000000..07c96db8 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainRollingHills.java @@ -0,0 +1,32 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainRollingHills extends TerrainBase { + + private float minHeight = 63f; + private float maxHeight = 80f; + private float hillStrength = 30f; + + // 63f, 80f, 30f + + public TerrainRollingHills(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + float m = hills(x, y, hillStrength, simplex, river); + + float floNoise = riverized(minHeight + groundNoise, river) + m; + + return floNoise + 0f; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainSwampMountain.java b/src/api/java/rtg/world/gen/terrain/TerrainSwampMountain.java new file mode 100644 index 00000000..772b6156 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainSwampMountain.java @@ -0,0 +1,22 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainSwampMountain extends TerrainBase { + + private float heigth; + private float width; + + public TerrainSwampMountain(float mountainHeight, float mountainWidth) { + + heigth = mountainHeight; + width = mountainWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainSwampMountain(x, y, simplex, cell, river, width, heigth, 150f, 32f, 56f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/TerrainVolcano.java b/src/api/java/rtg/world/gen/terrain/TerrainVolcano.java new file mode 100644 index 00000000..583a190f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/TerrainVolcano.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +public class TerrainVolcano extends TerrainBase { + + public TerrainVolcano() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainVolcano(x, y, simplex, cell, border, 70f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/VariableRuggednessEffect.java b/src/api/java/rtg/world/gen/terrain/VariableRuggednessEffect.java new file mode 100644 index 00000000..5b58ad2d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/VariableRuggednessEffect.java @@ -0,0 +1,62 @@ +package rtg.world.gen.terrain; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; + +/** + * This provides a standard "ruggedness switch" between a rugged terrain and a smooth one + * it has its wavelength standardized to provide cooperation between adjacent terrains + * + * @author Zeno410 + */ +public class VariableRuggednessEffect extends HeightEffect { + + public static float STANDARD_RUGGEDNESS_WAVELENGTH = 200f; + public static int STANDARD_RUGGEDNESS_OCTAVE = 1; + // not going to bother to set up a creator shell to make sure everything is set + // set defaults to absurd values to crash if they're not set + public HeightEffect smoothTerrain; + public HeightEffect ruggedTerrain; + public float startTransition = Integer.MAX_VALUE; + public float transitionWidth = 0; + public int octave = 1;// this is the standard "ruggedness octave" + public float wavelength;// standard ruggedness wavelength + + public VariableRuggednessEffect() { + + } + + public VariableRuggednessEffect(HeightEffect smoothTerrain, HeightEffect ruggedTerrain, + float startTransition, float transitionWidth, float wavelength) { + + this.smoothTerrain = smoothTerrain; + this.ruggedTerrain = ruggedTerrain; + this.startTransition = startTransition; + this.transitionWidth = transitionWidth; + this.wavelength = wavelength; + } + + public VariableRuggednessEffect(HeightEffect smoothTerrain, HeightEffect ruggedTerrain, + float startTransition, float transitionWidth) { + + this(smoothTerrain, ruggedTerrain, startTransition, transitionWidth, STANDARD_RUGGEDNESS_WAVELENGTH); + + } + + public final float added(OpenSimplexNoise simplex, CellNoise cell, float x, float y) { + + float choice = simplex.octave(octave).noise2((float) x / wavelength, (float) y / wavelength); + if (choice <= startTransition) { + return smoothTerrain.added(simplex, cell, x, y); + } + if (choice >= startTransition + transitionWidth) { + return ruggedTerrain.added(simplex, cell, x, y); + } + // otherwise in the transition zone; + float smooth = smoothTerrain.added(simplex, cell, x, y); + float rugged = ruggedTerrain.added(simplex, cell, x, y); + return ((choice - startTransition) * rugged + (startTransition + transitionWidth - choice) * smooth) / + transitionWidth; + } + +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACCoraliumInfestedSwamp.java b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACCoraliumInfestedSwamp.java new file mode 100644 index 00000000..0ba5c958 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACCoraliumInfestedSwamp.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.abyssalcraft; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainACCoraliumInfestedSwamp extends TerrainBase { + + public TerrainACCoraliumInfestedSwamp() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainMarsh(x, y, simplex, 61.5f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklands.java b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklands.java new file mode 100644 index 00000000..00d83536 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklands.java @@ -0,0 +1,28 @@ +package rtg.world.gen.terrain.abyssalcraft; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainACDarklands extends TerrainBase { + + private float hillStrength = 40f; + + public TerrainACDarklands() { + + this(72f, 40f); + } + + public TerrainACDarklands(float bh, float hs) { + + base = bh; + hillStrength = hs; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, 10f, 68f, hillStrength, base - 62f); + + } +} diff --git a/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsForest.java b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsForest.java new file mode 100644 index 00000000..8d3f6c0d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsForest.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.abyssalcraft; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainACDarklandsForest extends TerrainBase { + + private float hillStrength = 10f;// this needs to be linked to the + + public TerrainACDarklandsForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundVariation, simplex); + + float m = hills(x, y, hillStrength, simplex, river); + + float floNoise = 65f + groundNoise + m; + + return riverized(floNoise, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsHighland.java b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsHighland.java new file mode 100644 index 00000000..78821b2a --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsHighland.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.abyssalcraft; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainACDarklandsHighland extends TerrainBase { + + private float start; + private float height; + private float width; + + public TerrainACDarklandsHighland(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, base); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsMountains.java b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsMountains.java new file mode 100644 index 00000000..87d9b184 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsMountains.java @@ -0,0 +1,42 @@ +package rtg.world.gen.terrain.abyssalcraft; + +import rtg.world.gen.terrain.FunctionalTerrainBase; +import rtg.world.gen.terrain.HeightVariation; +import rtg.world.gen.terrain.JitterEffect; +import rtg.world.gen.terrain.MountainsWithPassesEffect; + +public class TerrainACDarklandsMountains extends FunctionalTerrainBase { + + private float width; + private float strength; + private float spikeWidth = 40; + private float spikeHeight = 60; + + public TerrainACDarklandsMountains(float mountainWidth, float mountainStrength) { + + this(mountainWidth, mountainStrength, 90f); + } + + public TerrainACDarklandsMountains(float mountainWidth, float mountainStrength, float baseHeight) { + + width = mountainWidth; + strength = mountainStrength; + base = baseHeight; + MountainsWithPassesEffect mountainEffect = new MountainsWithPassesEffect(); + mountainEffect.mountainHeight = strength; + mountainEffect.mountainWavelength = width; + mountainEffect.spikeHeight = this.spikeHeight; + mountainEffect.spikeWavelength = this.spikeWidth; + + this.height = new JitterEffect(6f, 10f, mountainEffect); + height = new JitterEffect(2f, 6f, height); + + HeightVariation passHeight = new HeightVariation(); + passHeight.height = 15; + passHeight.octave = 4; + passHeight.wavelength = 70; + + height = height.plus(passHeight); + + } +} diff --git a/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsPlains.java b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsPlains.java new file mode 100644 index 00000000..54c2b879 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/abyssalcraft/TerrainACDarklandsPlains.java @@ -0,0 +1,21 @@ +package rtg.world.gen.terrain.abyssalcraft; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.GroundEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainACDarklandsPlains extends TerrainBase { + + private GroundEffect groundEffect = new GroundEffect(4f); + + public TerrainACDarklandsPlains() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 66f); + return riverized(65f + groundEffect.added(simplex, cell, x, y), river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARBambooGrove.java b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARBambooGrove.java new file mode 100644 index 00000000..71ae87c6 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARBambooGrove.java @@ -0,0 +1,64 @@ +package rtg.world.gen.terrain.agriculturalrevolution; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.*; + +public class TerrainARBambooGrove extends TerrainBase { + + /* Basic idea: High hilly terrain mixed with ground-noisy flats + * using a transition that also generates the hills + */ + + private float hillockWavelength = 30; + private float hillockBoost = 5; + private float hillockVariance = 10; + private float hillockSpikeWidth = 8; + private float hillockSpikeHeight = 4; + private float terrainBase = 68; + + private JitterEffect biomeHeight;// this includes the base + + + public TerrainARBambooGrove() { + // bumpy hills on top + BumpyHillsEffect onTop = new BumpyHillsEffect(); + onTop.hillHeight = hillockVariance; + onTop.hillWavelength = hillockWavelength; + onTop.spikeHeight = hillockSpikeHeight; + onTop.spikeWavelength = hillockSpikeWidth; + onTop.hillOctave = 1;// same octave as variableRuggedness + + // plus raised a bit + HeightEffect hillLevel = onTop.plus(new RaiseEffect(hillockBoost + terrainBase)); + + // but only + VariableRuggednessEffect hills = new VariableRuggednessEffect(); + hills.ruggedTerrain = hillLevel; + hills.smoothTerrain = new RaiseEffect(terrainBase); + hills.octave = 1;// just to make it clear; + hills.startTransition = 0.1f; + hills.transitionWidth = 0.35f; + hills.wavelength = hillockWavelength; + + HeightEffect unJittered = hills.plus(new GroundEffect(6f)); + + // and lets scramble it a bit + + biomeHeight = new JitterEffect(); + biomeHeight.amplitude = 2; + biomeHeight.wavelength = 5; + biomeHeight.jittered = unJittered; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + float result = biomeHeight.added(simplex, cell, x, y); + if (result < 60) { + throw new RuntimeException(); + } + return result; + //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 80f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARCoralReef.java b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARCoralReef.java new file mode 100644 index 00000000..45111264 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARCoralReef.java @@ -0,0 +1,57 @@ +package rtg.world.gen.terrain.agriculturalrevolution; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainARCoralReef extends TerrainBase { + + private boolean booRiver; + private float[] height; + private int heightLength; + private float strength; + private float cWidth; + private float cHeigth; + private float cStrength; + private float base; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainARCoralReef(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + + booRiver = riverGen; + height = new float[]{5.0f, 0.5f, 12.5f, 0.5f}; + strength = heightStrength; + heightLength = height.length; + cWidth = canyonWidth; + cHeigth = canyonHeight; + cStrength = canyonStrength; + base = baseHeight; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainOceanCanyon(x, y, simplex, river, height, border, strength, heightLength, booRiver); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARDeepReef.java b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARDeepReef.java new file mode 100644 index 00000000..9d66fbe8 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARDeepReef.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.agriculturalrevolution; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainARDeepReef extends TerrainBase { + + public TerrainARDeepReef() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainOcean(x, y, simplex, river, 40f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARKelpForest.java b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARKelpForest.java new file mode 100644 index 00000000..caf7943d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARKelpForest.java @@ -0,0 +1,57 @@ +package rtg.world.gen.terrain.agriculturalrevolution; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainARKelpForest extends TerrainBase { + + private boolean booRiver; + private float[] height; + private int heightLength; + private float strength; + private float cWidth; + private float cHeigth; + private float cStrength; + private float base; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainARKelpForest(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + + booRiver = riverGen; + height = new float[]{5.0f, 0.5f, 12.5f, 0.5f}; + strength = heightStrength; + heightLength = height.length; + cWidth = canyonWidth; + cHeigth = canyonHeight; + cStrength = canyonStrength; + base = baseHeight; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainOceanCanyon(x, y, simplex, river, height, border, strength, heightLength, booRiver); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainAROrchard.java b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainAROrchard.java new file mode 100644 index 00000000..1f4448c5 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainAROrchard.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.agriculturalrevolution; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainAROrchard extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + public TerrainAROrchard(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 4f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARTropicalHills.java b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARTropicalHills.java new file mode 100644 index 00000000..ba6a8b36 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/agriculturalrevolution/TerrainARTropicalHills.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.agriculturalrevolution; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainARTropicalHills extends TerrainBase { + + private float start; + private float height; + private float width; + + public TerrainARTropicalHills(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) + { + return terrainHighland(x, y, simplex, cell, river, start, width, height, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/betteragriculture/TerrainBAFarmlandBiome.java b/src/api/java/rtg/world/gen/terrain/betteragriculture/TerrainBAFarmlandBiome.java new file mode 100644 index 00000000..691f617d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/betteragriculture/TerrainBAFarmlandBiome.java @@ -0,0 +1,28 @@ +package rtg.world.gen.terrain.betteragriculture; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBAFarmlandBiome extends TerrainBase { + + private float baseHeight = 67f; + private float peakyHillWavelength = 15f; + private float peakyHillStrength = 5f; + private float smoothHillWavelength = 20f; + private float smoothHillStrength = 20f; + + public TerrainBAFarmlandBiome() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + float h = terrainGrasslandHills(x, y, simplex, cell, river, peakyHillWavelength, peakyHillStrength, smoothHillWavelength, smoothHillStrength, baseHeight); + + return riverized(groundNoise + h, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPAlps.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPAlps.java new file mode 100644 index 00000000..8eb0cfaa --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPAlps.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPAlps extends TerrainBase { + + // the BoP version has steep slopes and a flat area on top. The RTG version will + private float start = 0f;// this puts a minimum on "ruggedness" on the top. We want to allow flats + private float height = 40f; // sets the variability range + private float width = 80f; // width of irregularity noise on top. We want low, for a lot of features. + + public TerrainBOPAlps() { + + base = 120f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, base - 62f); + //return terrainMountainRiver(x, y, simplex, cell, river, 300f, 67f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBambooForest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBambooForest.java new file mode 100644 index 00000000..4d523b3c --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBambooForest.java @@ -0,0 +1,64 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.*; + +public class TerrainBOPBambooForest extends TerrainBase { + + /* Basic idea: High hilly terrain mixed with ground-noisy flats + * using a transition that also generates the hills + */ + + private float hillockWavelength = 30; + private float hillockBoost = 5; + private float hillockVariance = 10; + private float hillockSpikeWidth = 8; + private float hillockSpikeHeight = 4; + private float terrainBase = 68; + + private JitterEffect biomeHeight;// this includes the base + + + public TerrainBOPBambooForest() { + // bumpy hills on top + BumpyHillsEffect onTop = new BumpyHillsEffect(); + onTop.hillHeight = hillockVariance; + onTop.hillWavelength = hillockWavelength; + onTop.spikeHeight = hillockSpikeHeight; + onTop.spikeWavelength = hillockSpikeWidth; + onTop.hillOctave = 1;// same octave as variableRuggedness + + // plus raised a bit + HeightEffect hillLevel = onTop.plus(new RaiseEffect(hillockBoost + terrainBase)); + + // but only + VariableRuggednessEffect hills = new VariableRuggednessEffect(); + hills.ruggedTerrain = hillLevel; + hills.smoothTerrain = new RaiseEffect(terrainBase); + hills.octave = 1;// just to make it clear; + hills.startTransition = 0.1f; + hills.transitionWidth = 0.35f; + hills.wavelength = hillockWavelength; + + HeightEffect unJittered = hills.plus(new GroundEffect(6f)); + + // and lets scramble it a bit + + biomeHeight = new JitterEffect(); + biomeHeight.amplitude = 2; + biomeHeight.wavelength = 5; + biomeHeight.jittered = unJittered; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + float result = biomeHeight.added(simplex, cell, x, y); + if (result < 60) { + throw new RuntimeException(); + } + return result; + //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 80f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBayou.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBayou.java new file mode 100644 index 00000000..20a7b7ff --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBayou.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPBayou extends TerrainBase { + + public TerrainBOPBayou() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 80f, 1f, 40f, 20f, 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBog.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBog.java new file mode 100644 index 00000000..31aacaa2 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBog.java @@ -0,0 +1,45 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.HeightVariation; +import rtg.world.gen.terrain.HillockEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPBog extends TerrainBase { + + private final float bottom = 58f; + private final HeightVariation bottomVariation; + private final HillockEffect smallHills; + private final HillockEffect mediumHills; + + // surprisingly the BoP version is mostly above water and kind of hilly + public TerrainBOPBog() { + + bottomVariation = new HeightVariation(); + bottomVariation.height = 2; + bottomVariation.octave = 0; + bottomVariation.wavelength = 40; + + smallHills = new HillockEffect(); + smallHills.height = 6; + smallHills.wavelength = 15; + smallHills.minimumSimplex = 0.2f; + smallHills.octave = 1; + + mediumHills = new HillockEffect(); + mediumHills.height = 12; + mediumHills.wavelength = 25; + mediumHills.minimumSimplex = 0.2f; + mediumHills.octave = 2; + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + float increment = bottomVariation.added(simplex, cell, x, y) + smallHills.added(simplex, cell, x, y); + increment += mediumHills.added(simplex, cell, x, y); + return riverized(bottom + increment, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBorealForest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBorealForest.java new file mode 100644 index 00000000..560b2ec0 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBorealForest.java @@ -0,0 +1,43 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.BumpyHillsEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPBorealForest extends TerrainBase { + + private float baseHeight = 64f; + private float hillStrength = 50f; + private BumpyHillsEffect hillEffect; + private float hillWidth = 60f; + private float hillBumpyness = 10f; + private float hillBumpynessWidth = 20f; + + public TerrainBOPBorealForest() { + + hillEffect = new BumpyHillsEffect(); + hillEffect.hillHeight = hillStrength; + hillEffect.hillWavelength = hillWidth; + hillEffect.spikeHeight = hillBumpyness; + hillEffect.spikeWavelength = this.hillBumpynessWidth; + } + + public TerrainBOPBorealForest(float bh, float hs) { + + this(); + baseHeight = bh; + hillStrength = hs; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + + float m = hillEffect.added(simplex, cell, x, y); + + return riverized(baseHeight, river) + (groundNoise + m) * river; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBrushland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBrushland.java new file mode 100644 index 00000000..6a9c846c --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPBrushland.java @@ -0,0 +1,31 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPBrushland extends TerrainBase { + + private float baseHeight = 76f; + private float hillStrength = 20f; + + public TerrainBOPBrushland() { + + } + + public TerrainBOPBrushland(float bh, float hs) { + + baseHeight = bh; + hillStrength = hs; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + float m = hills(x, y, hillStrength, simplex, river); + + return baseHeight + groundNoise + m; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPChaparral.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPChaparral.java new file mode 100644 index 00000000..4899983f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPChaparral.java @@ -0,0 +1,45 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.SimplexOctave; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPChaparral extends TerrainBase { + + private float baseHeight = 76f; + private float peakyHillWavelength = 40f; + private float peakyHillStrength = 40f; + private float smoothHillWavelength = 60f; + private float smoothHillStrength = 30f; + + + private SimplexOctave.Derivative jitter = new SimplexOctave.Derivative(); + private float wavelength = 10f;// of jitter + private float amplitude = 2f;// of jitter + + public TerrainBOPChaparral() { + + } + + public TerrainBOPChaparral(float bh, float hs) { + + baseHeight = bh; + peakyHillStrength = hs; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + //float m = hills(x, y, peakyHillStrength, simplex, river); + + simplex.riverJitter().evaluateNoise((float) x / wavelength, (float) y / wavelength, jitter); + int pX = (int) Math.round(x + jitter.deltax() * amplitude); + int pY = (int) Math.round(y + jitter.deltay() * amplitude); + float h = this.terrainGrasslandHills(pX, pY, simplex, cell, river, peakyHillWavelength, peakyHillStrength, smoothHillWavelength, smoothHillStrength, baseHeight); + + return groundNoise + h; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPCherryBlossomGrove.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPCherryBlossomGrove.java new file mode 100644 index 00000000..9b476f1c --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPCherryBlossomGrove.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPCherryBlossomGrove extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + public TerrainBOPCherryBlossomGrove(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 0f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPColdDesert.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPColdDesert.java new file mode 100644 index 00000000..a1c0925c --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPColdDesert.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPColdDesert extends TerrainBase { + + private float ruggedness = 3f; + private float ruggednessWavelength = 100f; + private float heightPitch = 35f;// the ruggedness parameter will multiply this by 0.2 + private float heightDivisor = 1f; + + public TerrainBOPColdDesert() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + float result = terrainPlains(x, y, simplex, river, ruggednessWavelength, ruggedness, heightPitch, heightDivisor, base); + // no indentations; cutoff is not noticeable with these low slopes + return result > base ? result : base; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPConiferousForest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPConiferousForest.java new file mode 100644 index 00000000..eab6fad7 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPConiferousForest.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPConiferousForest extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + + public TerrainBOPConiferousForest(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 0f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPCoralReef.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPCoralReef.java new file mode 100644 index 00000000..274db55d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPCoralReef.java @@ -0,0 +1,57 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPCoralReef extends TerrainBase { + + private boolean booRiver; + private float[] height; + private int heightLength; + private float strength; + private float cWidth; + private float cHeigth; + private float cStrength; + private float base; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainBOPCoralReef(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + + booRiver = riverGen; + height = new float[]{5.0f, 0.5f, 12.5f, 0.5f}; + strength = heightStrength; + heightLength = height.length; + cWidth = canyonWidth; + cHeigth = canyonHeight; + cStrength = canyonStrength; + base = baseHeight; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainOceanCanyon(x, y, simplex, river, height, border, strength, heightLength, booRiver); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPCrag.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPCrag.java new file mode 100644 index 00000000..6cd3557b --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPCrag.java @@ -0,0 +1,66 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.SimplexOctave; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPCrag extends TerrainBase { + + private float pointHeightVariation = 20f; + private float pointHeightWavelength = 400f;// deep variation + private float pointHeight = 50; + private float pointWavelength = 50; + + public TerrainBOPCrag(float baseHeight) { + + base = baseHeight; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + // need a little jitter to the points + SimplexOctave.Derivative jitter = new SimplexOctave.Derivative(); + simplex.riverJitter().evaluateNoise((float) x / 20.0, (float) y / 20.0, jitter); + double pX = x + jitter.deltax() * 1f; + double pY = y + jitter.deltay() * 1f; + + // restrict the points to in the biome. + double multiplier = (border - 0.5) * 10.0; + if (multiplier < 0) { + multiplier = 0; + } + if (multiplier > 1) { + multiplier = 1; + } + double[] points = cell.octave(1).eval((float) pX / pointWavelength, (float) pY / pointWavelength); + float raise = (float) ((points[1] - points[0]) / points[1]); + raise = raise * 3f; + raise -= 0.2f; + if (raise < 0) { + raise = 0; + } + if (raise > 1) { + raise = 1; + } + float topHeight = (float) (pointHeight + + pointHeightVariation * simplex.noise((float) x / pointHeightWavelength, (float) y / pointHeightWavelength)); + + float p = raise * topHeight; + if (border >= 1f) { + return base + p; + } + if (border > 0.65) { + // we need to adjust for the border adjustments to the height to make the base work + // it actaully doesn't always help + float missingBase = (1f - border) * (base - 70f); // shortfall at the top + float pStretch = (topHeight + missingBase) / topHeight; + p = p * pStretch; + p = borderAdjusted(p, border, 0.75f, 0.65f); + return base + p; + } + return base; + //return terrainCanyon(x, y, simplex, river, height, border, strength, heightLength, booRiver); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPDeadForest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPDeadForest.java new file mode 100644 index 00000000..dbed9e43 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPDeadForest.java @@ -0,0 +1,30 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPDeadForest extends TerrainBase { + + private float minHeight = 58f; + private float maxHeight = 120f; + private float hillStrength = 30f; + private float deadForestGroundAmplitude = 10f; + + public TerrainBOPDeadForest() { + + } + + public TerrainBOPDeadForest(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, deadForestGroundAmplitude, 0f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPDeadSwamp.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPDeadSwamp.java new file mode 100644 index 00000000..b6f954c3 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPDeadSwamp.java @@ -0,0 +1,30 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.HeightEffect; +import rtg.world.gen.terrain.HeightVariation; +import rtg.world.gen.terrain.JitterEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPDeadSwamp extends TerrainBase { + + private HeightEffect height; + + public TerrainBOPDeadSwamp() { + + HeightVariation waterLand = new HeightVariation(); + waterLand.height = 2f; + waterLand.wavelength = 40f; + waterLand.octave = 0; + + height = new JitterEffect(5f, 10f, waterLand); + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return 62f + height.added(simplex, cell, x, y); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPEucalyptusForest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPEucalyptusForest.java new file mode 100644 index 00000000..642416a6 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPEucalyptusForest.java @@ -0,0 +1,28 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPEucalyptusForest extends TerrainBase { + + private float baseHeight = 76f; + private float peakyHillWavelength = 40f; + private float peakyHillStrength = 20f; + private float smoothHillWavelength = 20f; + private float smoothHillStrength = 10f; + + public TerrainBOPEucalyptusForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + float h = terrainGrasslandHills(x, y, simplex, cell, river, peakyHillWavelength, peakyHillStrength, smoothHillWavelength, smoothHillStrength, baseHeight); + + return riverized(groundNoise + h, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPFen.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPFen.java new file mode 100644 index 00000000..7ca9c8ba --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPFen.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPFen extends TerrainBase { + + public TerrainBOPFen() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainMarsh(x, y, simplex, 61.5f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPFlowerField.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPFlowerField.java new file mode 100644 index 00000000..aa17023a --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPFlowerField.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPFlowerField extends TerrainBase { + + public TerrainBOPFlowerField() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 80f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPFlowerIsland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPFlowerIsland.java new file mode 100644 index 00000000..01dd4cbf --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPFlowerIsland.java @@ -0,0 +1,27 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPFlowerIsland extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + // 63f, 80f, 30f + + public TerrainBOPFlowerIsland(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 4f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGlacier.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGlacier.java new file mode 100644 index 00000000..83d31b34 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGlacier.java @@ -0,0 +1,24 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPGlacier extends TerrainBase { + + private float width; + private float strength; + + public TerrainBOPGlacier(float mountainWidth, float mountainStrength, float height) { + + width = mountainWidth; + strength = mountainStrength; + base = height; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainLonelyMountain(x, y, simplex, cell, river, strength, width, base); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGrassland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGrassland.java new file mode 100644 index 00000000..60767860 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGrassland.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPGrassland extends TerrainBase { + + public TerrainBOPGrassland() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 66f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGravelBeach.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGravelBeach.java new file mode 100644 index 00000000..1f3d1e2e --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGravelBeach.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPGravelBeach extends TerrainBase { + + public TerrainBOPGravelBeach() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainBeach(x, y, simplex, river, 180f, 35f, 60f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGrove.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGrove.java new file mode 100644 index 00000000..0a596f8b --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPGrove.java @@ -0,0 +1,27 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPGrove extends TerrainBase { + + private float baseHeight = 64f; + private float peakyHillWavelength = 40f; + private float peakyHillStrength = 5f; + private float smoothHillWavelength = 20f; + private float smoothHillStrength = 10f; + + public TerrainBOPGrove() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + // no ground noise + + float h = this.terrainGrasslandHills(x, y, simplex, cell, river, smoothHillWavelength, smoothHillStrength, peakyHillWavelength, peakyHillStrength, baseHeight); + + return h; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPHeathland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPHeathland.java new file mode 100644 index 00000000..4a61b47e --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPHeathland.java @@ -0,0 +1,30 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.HillockEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPHeathland extends TerrainBase { + + private float baseHeight = 66f; + private HillockEffect hills; + + public TerrainBOPHeathland() { + + hills = new HillockEffect(); + hills.height = 25; + hills.minimumSimplex = 0.3f; + hills.octave = 0; + hills.wavelength = 50f; + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + float added = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + added += hills.added(simplex, cell, x, y); + return riverized(baseHeight + added, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPHighland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPHighland.java new file mode 100644 index 00000000..05f4febc --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPHighland.java @@ -0,0 +1,34 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.BumpyHillsEffect; +import rtg.world.gen.terrain.JitterEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPHighland extends TerrainBase { + + private float baseHeight = 90f; + private BumpyHillsEffect onTop = new BumpyHillsEffect(); + private JitterEffect withJitter; + + public TerrainBOPHighland() { + + onTop.hillHeight = 30; + onTop.hillWavelength = 60; + onTop.spikeHeight = 20; + onTop.spikeWavelength = 10; + + withJitter = new JitterEffect(); + withJitter.amplitude = 2; + withJitter.wavelength = 5; + withJitter.jittered = onTop; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return riverized(baseHeight + withJitter.added(simplex, cell, x, y) + this.groundNoise(x, y, 6, simplex), river); + //return terrainGrasslandMountains(x, y, simplex, cell, river, 4f, 80f, 68f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPKelpForest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPKelpForest.java new file mode 100644 index 00000000..eb2c640e --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPKelpForest.java @@ -0,0 +1,57 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPKelpForest extends TerrainBase { + + private boolean booRiver; + private float[] height; + private int heightLength; + private float strength; + private float cWidth; + private float cHeigth; + private float cStrength; + private float base; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainBOPKelpForest(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + + booRiver = riverGen; + height = new float[]{5.0f, 0.5f, 12.5f, 0.5f}; + strength = heightStrength; + heightLength = height.length; + cWidth = canyonWidth; + cHeigth = canyonHeight; + cStrength = canyonStrength; + base = baseHeight; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainOceanCanyon(x, y, simplex, river, height, border, strength, heightLength, booRiver); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLandOfLakes.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLandOfLakes.java new file mode 100644 index 00000000..d1d0c459 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLandOfLakes.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPLandOfLakes extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + public TerrainBOPLandOfLakes(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 0f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLavenderFields.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLavenderFields.java new file mode 100644 index 00000000..4699fe88 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLavenderFields.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPLavenderFields extends TerrainBase { + + public TerrainBOPLavenderFields() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 80f, 66f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLushDesert.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLushDesert.java new file mode 100644 index 00000000..e4b0dac1 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLushDesert.java @@ -0,0 +1,51 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.*; + +public class TerrainBOPLushDesert extends TerrainBase { + + private float minHeight; + private float mesaWavelength; + private float hillStrength; + private float topBumpinessHeight = 2; + private float topBumpinessWavelength = 15; + private HeightEffect height; + private HeightEffect groundEffect; + + + public TerrainBOPLushDesert(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.mesaWavelength = maxHeight; + this.hillStrength = hillStrength; + + groundEffect = new GroundEffect(3f); + + // this is variation in what's added to the top. Set to vary with the "standard" ruggedness + HeightVariation topVariation = new HeightVariation(); + topVariation.height = hillStrength; + topVariation.octave = 1; + topVariation.wavelength = VariableRuggednessEffect.STANDARD_RUGGEDNESS_WAVELENGTH; + + + // create some bumpiness to disguise the cliff heights + HeightVariation topBumpiness = new HeightVariation(); + topBumpiness.height = topBumpinessHeight; + topBumpiness.wavelength = topBumpinessWavelength; + topBumpiness.octave = 3; + + // now make the top only show up on mesa + height = new VariableRuggednessEffect(new RaiseEffect(0f), topVariation.plus(topBumpiness).plus(new RaiseEffect(hillStrength)) + , 0.3f, 0.15f, mesaWavelength); + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return riverized(minHeight + groundEffect.added(simplex, cell, x, y), river) + height.added(simplex, cell, x, y); + //return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 4f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLushSwamp.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLushSwamp.java new file mode 100644 index 00000000..2f95ff3c --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPLushSwamp.java @@ -0,0 +1,19 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPLushSwamp extends TerrainBase { + + public TerrainBOPLushSwamp() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainMarsh(x, y, simplex, 61.5f); + //return terrainBeach(x, y, simplex, river, 180f, 35f, 60f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMangrove.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMangrove.java new file mode 100644 index 00000000..765ae9be --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMangrove.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPMangrove extends TerrainBase +{ + public TerrainBOPMangrove() + { + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) + { + return terrainBeach(x, y, simplex, river, 180f, 35f, 60f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMapleWoods.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMapleWoods.java new file mode 100644 index 00000000..1da98258 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMapleWoods.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPMapleWoods extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + public TerrainBOPMapleWoods(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMarsh.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMarsh.java new file mode 100644 index 00000000..e43e6559 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMarsh.java @@ -0,0 +1,32 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.HeightVariation; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPMarsh extends TerrainBase { + + private float baseHeight = 62f; + private HeightVariation variation; + private HeightVariation smallVariation; + + public TerrainBOPMarsh() { + + variation = new HeightVariation(); + variation.height = 1.5f; + variation.wavelength = 20; + variation.octave = 0; + + smallVariation = new HeightVariation(); + smallVariation.height = 1.5f; + smallVariation.wavelength = 10; + smallVariation.octave = 0; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return baseHeight + variation.added(simplex, cell, x, y) + smallVariation.added(simplex, cell, x, y); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMeadow.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMeadow.java new file mode 100644 index 00000000..be5ea93e --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMeadow.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPMeadow extends TerrainBase { + + public TerrainBOPMeadow() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 66f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMoor.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMoor.java new file mode 100644 index 00000000..5df0d742 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMoor.java @@ -0,0 +1,29 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPMoor extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + private float lift; + + // 63f, 80f, 30f + + public TerrainBOPMoor(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + lift = minHeight - 62f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, lift); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMountainFoothills.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMountainFoothills.java new file mode 100644 index 00000000..99075d30 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMountainFoothills.java @@ -0,0 +1,31 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPMountainFoothills extends TerrainBase { + + private float baseHeight = 76f; + private float hillStrength = 30f; + + public TerrainBOPMountainFoothills() { + + } + + public TerrainBOPMountainFoothills(float bh, float hs) { + + baseHeight = bh; + hillStrength = hs; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + float m = hills(x, y, hillStrength, simplex, river); + + return riverized(baseHeight + groundNoise, river) + m; + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMountainPeaks.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMountainPeaks.java new file mode 100644 index 00000000..754b32b7 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMountainPeaks.java @@ -0,0 +1,46 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.HeightEffect; +import rtg.world.gen.terrain.JitterEffect; +import rtg.world.gen.terrain.MountainsWithPassesEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPMountainPeaks extends TerrainBase { + + private float width; + private float strength; + private float terrainHeight; + private float spikeWidth = 30; + private float spikeHeight = 50; + private HeightEffect heightEffect; + + public TerrainBOPMountainPeaks(float mountainWidth, float mountainStrength) { + + this(mountainWidth, mountainStrength, 90f); + } + + public TerrainBOPMountainPeaks(float mountainWidth, float mountainStrength, float height) { + + width = mountainWidth; + strength = mountainStrength; + terrainHeight = height; + MountainsWithPassesEffect mountainEffect = new MountainsWithPassesEffect(); + mountainEffect.mountainHeight = strength; + mountainEffect.mountainWavelength = width; + mountainEffect.spikeHeight = this.spikeHeight; + mountainEffect.spikeWavelength = this.spikeWidth; + + + heightEffect = new JitterEffect(7f, 10f, mountainEffect); + heightEffect = new JitterEffect(3f, 6f, heightEffect); + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return riverized(heightEffect.added(simplex, cell, x, y) + terrainHeight, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMysticGrove.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMysticGrove.java new file mode 100644 index 00000000..6f239305 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPMysticGrove.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPMysticGrove extends TerrainBase { + + public TerrainBOPMysticGrove() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 66f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOasis.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOasis.java new file mode 100644 index 00000000..a4172e38 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOasis.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPOasis extends TerrainBase { + + public TerrainBOPOasis() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 100f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOminousWoods.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOminousWoods.java new file mode 100644 index 00000000..b46ead47 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOminousWoods.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPOminousWoods extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + public TerrainBOPOminousWoods(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 0f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOrchard.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOrchard.java new file mode 100644 index 00000000..25d1393d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOrchard.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPOrchard extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + public TerrainBOPOrchard(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 4f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOriginIsland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOriginIsland.java new file mode 100644 index 00000000..d984ee88 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOriginIsland.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPOriginIsland extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + public TerrainBOPOriginIsland(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 0f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOutback.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOutback.java new file mode 100644 index 00000000..245bcccf --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOutback.java @@ -0,0 +1,56 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.*; + +public class TerrainBOPOutback extends TerrainBase { + + private float minHeight; + private float mesaWavelength; + private float hillStrength; + private float topBumpinessHeight = 4; + private float topBumpinessWavelength = 25; + private HeightEffect height; + private HeightEffect groundEffect; + + + public TerrainBOPOutback(float minHeight, float wavelength, float hillStrength) { + + this.minHeight = minHeight; + this.mesaWavelength = wavelength; + this.hillStrength = hillStrength; + + groundEffect = new GroundEffect(4f); + + // this is variation in what's added to the top. Set to vary with the "standard" ruggedness + HeightVariation topVariation = new HeightVariation(); + topVariation.height = hillStrength / 2; + topVariation.octave = 1; + topVariation.wavelength = VariableRuggednessEffect.STANDARD_RUGGEDNESS_WAVELENGTH; + + + // create some bumpiness to disguise the cliff heights + HeightVariation topBumpiness = new HeightVariation(); + topBumpiness.height = topBumpinessHeight; + topBumpiness.wavelength = topBumpinessWavelength; + topBumpiness.octave = 3; + + + // now make the top only show up on mesa + HeightEffect mesaTops = new VariableRuggednessEffect(new RaiseEffect(0f), topVariation.plus(new RaiseEffect(hillStrength)).plus(topBumpiness) + , 0.3f, 0.15f, mesaWavelength); + + // and make the mesa Tops only show up part of the time, but most of the time, + // using the standard ruggedness wavelength + height = new VariableRuggednessEffect(new RaiseEffect(0f), mesaTops, -0.3f, .06f); + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return riverized(minHeight + groundEffect.added(simplex, cell, x, y), river) + height.added(simplex, cell, x, y); + //return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 4f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOvergrownCliffs.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOvergrownCliffs.java new file mode 100644 index 00000000..29685aa4 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPOvergrownCliffs.java @@ -0,0 +1,42 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPOvergrownCliffs extends TerrainBase { + + private float width; + private float strength; + private float lakeDepth; + private float lakeWidth; + private float terrainHeight; + + /* + * width = 230f + * strength = 120f + * lake = 50f; + * + * 230f, 120f, 50f + */ + + public TerrainBOPOvergrownCliffs(float mountainWidth, float mountainStrength, float depthLake) { + + this(mountainWidth, mountainStrength, depthLake, 260f, 68f); + } + + public TerrainBOPOvergrownCliffs(float mountainWidth, float mountainStrength, float depthLake, float widthLake, float height) { + + width = mountainWidth; + strength = mountainStrength; + lakeDepth = depthLake; + lakeWidth = widthLake; + terrainHeight = height; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainLonelyMountain(x, y, simplex, cell, river, strength, width, terrainHeight); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPPrairie.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPPrairie.java new file mode 100644 index 00000000..9183e7c4 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPPrairie.java @@ -0,0 +1,27 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPPrairie extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + // 63f, 80f, 30f + + public TerrainBOPPrairie(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return this.terrainPlains(x, y, simplex, river, 200f, 1f, 30f, 1f, maxHeight); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPQuagmire.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPQuagmire.java new file mode 100644 index 00000000..447e9892 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPQuagmire.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPQuagmire extends TerrainBase { + + public TerrainBOPQuagmire() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainMarsh(x, y, simplex, 61.5f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPRainforest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPRainforest.java new file mode 100644 index 00000000..27c6bb85 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPRainforest.java @@ -0,0 +1,23 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPRainforest extends TerrainBase { + + private float heigth; + private float width; + + public TerrainBOPRainforest(float mountainHeight, float mountainWidth) { + + heigth = mountainHeight; + width = mountainWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainSwampMountain(x, y, simplex, cell, river, width, heigth, 140f, 39f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPRedwoodForest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPRedwoodForest.java new file mode 100644 index 00000000..f103132e --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPRedwoodForest.java @@ -0,0 +1,27 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPRedwoodForest extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + // 63f, 80f, 30f + + public TerrainBOPRedwoodForest(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 0f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSacredSprings.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSacredSprings.java new file mode 100644 index 00000000..d626b8fd --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSacredSprings.java @@ -0,0 +1,28 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPSacredSprings extends TerrainBase { + + private float width; + private float strength; + private float lakeDepth; + private float lakeWidth; + private float terrainHeight; + + public TerrainBOPSacredSprings(float mountainWidth, float mountainStrength, float height) { + + width = mountainWidth; + strength = mountainStrength; + terrainHeight = height; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainLonelyMountain(x, y, simplex, cell, river, strength, width, terrainHeight); + + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSeasonalForest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSeasonalForest.java new file mode 100644 index 00000000..44873f0f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSeasonalForest.java @@ -0,0 +1,27 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPSeasonalForest extends TerrainBase { + + private float start; + private float height; + private float base; + private float width; + + public TerrainBOPSeasonalForest(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, 0f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPShield.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPShield.java new file mode 100644 index 00000000..12a0cf2d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPShield.java @@ -0,0 +1,28 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +// this biome also changes the lake generation in RealisticBiomeBase +public class TerrainBOPShield extends TerrainBase { + + private float start; + private float height; + private float base; + private float width; + + public TerrainBOPShield(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 64f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPShrubland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPShrubland.java new file mode 100644 index 00000000..f3536fa8 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPShrubland.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPShrubland extends TerrainBase { + + public TerrainBOPShrubland() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 100f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSnowyConiferousForest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSnowyConiferousForest.java new file mode 100644 index 00000000..44a31c6e --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSnowyConiferousForest.java @@ -0,0 +1,27 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPSnowyConiferousForest extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + // 63f, 80f, 30f + + public TerrainBOPSnowyConiferousForest(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills + 2f, 4f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSnowyForest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSnowyForest.java new file mode 100644 index 00000000..0131ad3f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSnowyForest.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPSnowyForest extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + public TerrainBOPSnowyForest(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 4f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSteppe.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSteppe.java new file mode 100644 index 00000000..34c417a9 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPSteppe.java @@ -0,0 +1,27 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPSteppe extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + // 63f, 80f, 30f + + public TerrainBOPSteppe(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainRollingHills(x, y, simplex, river, hillStrength, maxHeight, groundNoise, groundNoiseAmplitudeHills, 4f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTemperateRainforest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTemperateRainforest.java new file mode 100644 index 00000000..d933fb4c --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTemperateRainforest.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPTemperateRainforest extends TerrainBase { + + public TerrainBOPTemperateRainforest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 100f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTropicalIsland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTropicalIsland.java new file mode 100644 index 00000000..1d621719 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTropicalIsland.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPTropicalIsland extends TerrainBase { + + public TerrainBOPTropicalIsland() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainBeach(x, y, simplex, river, 160f, 30f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTropicalRainforest.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTropicalRainforest.java new file mode 100644 index 00000000..3842a19d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTropicalRainforest.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPTropicalRainforest extends TerrainBase { + + private float start; + private float height; + private float width; + + public TerrainBOPTropicalRainforest(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTundra.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTundra.java new file mode 100644 index 00000000..0690c618 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPTundra.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPTundra extends TerrainBase { + + public TerrainBOPTundra() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 100f, 66f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPVolcanicIsland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPVolcanicIsland.java new file mode 100644 index 00000000..931e2ab1 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPVolcanicIsland.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPVolcanicIsland extends TerrainBase { + + public TerrainBOPVolcanicIsland() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainVolcano(x, y, simplex, cell, border, 70f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPWasteland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPWasteland.java new file mode 100644 index 00000000..4a7da375 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPWasteland.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPWasteland extends TerrainBase { + + public TerrainBOPWasteland() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 100f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPWetland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPWetland.java new file mode 100644 index 00000000..426ed33f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPWetland.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPWetland extends TerrainBase { + + public TerrainBOPWetland() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainMarsh(x, y, simplex, 61.5f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPWoodland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPWoodland.java new file mode 100644 index 00000000..688ee258 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPWoodland.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBOPWoodland extends TerrainBase { + + private float start; + private float height; + private float width; + + public TerrainBOPWoodland(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPXericShrubland.java b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPXericShrubland.java new file mode 100644 index 00000000..3dcf8e59 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesoplenty/TerrainBOPXericShrubland.java @@ -0,0 +1,54 @@ +package rtg.world.gen.terrain.biomesoplenty; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.*; + +public class TerrainBOPXericShrubland extends TerrainBase { + + private float minHeight; + private float mesaWavelength; + private float hillStrength; + private float topBumpinessHeight = 3; + private float topBumpinessWavelength = 10; + private HeightEffect height; + private HeightEffect groundEffect; + + private float jitterAmplitude = 4f; + private float jitterWavelength = 15f; + + public TerrainBOPXericShrubland() { + + this.minHeight = 65f; + this.mesaWavelength = 24f; + this.hillStrength = 5f; + + groundEffect = new GroundEffect(3f); + + // this is variation in what's added to the top. Set to vary with the "standard" ruggedness + HeightVariation topVariation = new HeightVariation(); + topVariation.height = hillStrength; + topVariation.octave = 1; + topVariation.wavelength = VariableRuggednessEffect.STANDARD_RUGGEDNESS_WAVELENGTH; + + + // create some bumpiness to disguise the cliff heights + HeightVariation topBumpiness = new HeightVariation(); + topBumpiness.height = topBumpinessHeight; + topBumpiness.wavelength = topBumpinessWavelength; + topBumpiness.octave = 3; + + // now make the top only show up on mesa + height = new VariableRuggednessEffect(new RaiseEffect(0f), topVariation.plus(topBumpiness).plus(new RaiseEffect(hillStrength)) + , 0.4f, 0.3f, mesaWavelength); + + height = new JitterEffect(jitterAmplitude, jitterWavelength, height); + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return riverized(minHeight + groundEffect.added(simplex, cell, x, y), river) + height.added(simplex, cell, x, y); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGAutumnForest.java b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGAutumnForest.java new file mode 100644 index 00000000..db32a692 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGAutumnForest.java @@ -0,0 +1,28 @@ +package rtg.world.gen.terrain.biomesyougo; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBYGAutumnForest extends TerrainBase { + + private float baseHeight = 72f; + private float peakyHillWavelength = 40f; + private float peakyHillStrength = 10f; + private float smoothHillWavelength = 20f; + private float smoothHillStrength = 20f; + + public TerrainBYGAutumnForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + float h = terrainGrasslandHills(x, y, simplex, cell, river, peakyHillWavelength, peakyHillStrength, smoothHillWavelength, smoothHillStrength, baseHeight); + + return riverized(groundNoise + h, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGBirchPlains.java b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGBirchPlains.java new file mode 100644 index 00000000..0bb4b14b --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGBirchPlains.java @@ -0,0 +1,22 @@ +package rtg.world.gen.terrain.biomesyougo; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.GroundEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBYGBirchPlains extends TerrainBase { + + + private GroundEffect groundEffect = new GroundEffect(4f); + + public TerrainBYGBirchPlains() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 80f, 65f); + return riverized(65f + groundEffect.added(simplex, cell, x, y), river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGFrozenTundra.java b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGFrozenTundra.java new file mode 100644 index 00000000..14a5db4f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGFrozenTundra.java @@ -0,0 +1,24 @@ +package rtg.world.gen.terrain.biomesyougo; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBYGFrozenTundra extends TerrainBase { + + private float start = 0f;// this puts a minimum on "ruggedness" on the top. We want to allow flats + private float height = 30f; // sets the variability range + private float width = 90f; // width of irregularity noise on top. We want low, for a lot of features. + + public TerrainBYGFrozenTundra() { + + base = 110f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, base - 62f); + //return terrainMountainRiver(x, y, simplex, cell, river, 300f, 67f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGLushForest.java b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGLushForest.java new file mode 100644 index 00000000..ea3c0de5 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGLushForest.java @@ -0,0 +1,22 @@ +package rtg.world.gen.terrain.biomesyougo; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.GroundEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBYGLushForest extends TerrainBase { + + + private GroundEffect groundEffect = new GroundEffect(4f); + + public TerrainBYGLushForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 80f, 65f); + return riverized(65f + groundEffect.added(simplex, cell, x, y), river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGRedDesert.java b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGRedDesert.java new file mode 100644 index 00000000..c088ffbe --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGRedDesert.java @@ -0,0 +1,30 @@ +package rtg.world.gen.terrain.biomesyougo; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBYGRedDesert extends TerrainBase { + + public TerrainBYGRedDesert() { + + super(64); + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //return terrainPolar(x, y, simplex, river); + float duneHeight = (minDuneHeight + (float) ConfigRTG.duneHeight); + + duneHeight *= (1f + simplex.octave(2).noise2((float) x / 330f, (float) y / 330f)) / 2f; + + float stPitch = 200f; // The higher this is, the more smoothly dunes blend with the terrain + float stFactor = duneHeight; + float hPitch = 70; // Dune scale + float hDivisor = 40; + + return terrainPolar(x, y, simplex, river, stPitch, stFactor, hPitch, hDivisor, base) + + groundNoise(x, y, 1f, simplex); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGRedRockMountains.java b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGRedRockMountains.java new file mode 100644 index 00000000..c3dda4e4 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGRedRockMountains.java @@ -0,0 +1,62 @@ +package rtg.world.gen.terrain.biomesyougo; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.util.SimplexOctave; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBYGRedRockMountains extends TerrainBase +{ + private float width; + private float strength; + private float terrainHeight; + + private int wavelength = 39; + private SimplexOctave.Disk jitter = new SimplexOctave.Disk(); + private double amplitude = 12; + + public TerrainBYGRedRockMountains(float mountainWidth, float mountainStrength, float height) + { + width = mountainWidth; + strength = mountainStrength; + terrainHeight = height; + + // experimentation + terrainHeight = 30; + width = 120; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) + { + simplex.riverJitter().evaluateNoise((float)x / wavelength, (float)y / wavelength, jitter); + float pX = (float)((float)x + jitter.deltax() * amplitude); + float pY = (float)((float)y + jitter.deltay() * amplitude); + + float h = simplex.noise2(pX / 19f, pY / 19f); + h = h*h*2f; + float h2 = simplex.noise2(pX / 13f, pY / 13f); + h2 = h2 * h2 * 1.3f; + h = Math.max(h, h2); + h += h2; + float h3 = simplex.noise2( pX / 53f, pY /53f); + h3= h3*h3*5f; + h+= h3; + + float m = unsignedPower(simplex.noise2(pX / width, pY / width),1.4f) * strength * river; + // invert y and x for complexity + float m2 = unsignedPower(simplex.noise2(pY / (width*1.5f), pX / (width*1.5f)),1.4f) * strength * river; + + m = Math.max(m, m2); + + // intensify ruggedness at height + h = m>10? h * m/10: h; + + m = above(m,-50f); + + + return terrainHeight + h + m; + + + } +} diff --git a/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGWillowSwamps.java b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGWillowSwamps.java new file mode 100644 index 00000000..4820b9f3 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/biomesyougo/TerrainBYGWillowSwamps.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.biomesyougo; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainBYGWillowSwamps extends TerrainBase { + + public TerrainBYGWillowSwamps() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainMarsh(x, y, simplex, 61.5f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/flowercraft/TerrainFCPhantasia.java b/src/api/java/rtg/world/gen/terrain/flowercraft/TerrainFCPhantasia.java new file mode 100644 index 00000000..c1ff3921 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/flowercraft/TerrainFCPhantasia.java @@ -0,0 +1,21 @@ +package rtg.world.gen.terrain.flowercraft; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.GroundEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainFCPhantasia extends TerrainBase { + + private GroundEffect groundEffect = new GroundEffect(4f); + + public TerrainFCPhantasia() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 66f); + return riverized(65f + groundEffect.added(simplex, cell, x, y), river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/mithwoodforest/TerrainMFMithwoodForest.java b/src/api/java/rtg/world/gen/terrain/mithwoodforest/TerrainMFMithwoodForest.java new file mode 100644 index 00000000..293a3f54 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/mithwoodforest/TerrainMFMithwoodForest.java @@ -0,0 +1,22 @@ +package rtg.world.gen.terrain.mithwoodforest; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainMFMithwoodForest extends TerrainBase { + + public TerrainMFMithwoodForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + float h = terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 80f, 65f); + + return riverized(groundNoise + h, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/sugiforest/TerrainSFSugiForest.java b/src/api/java/rtg/world/gen/terrain/sugiforest/TerrainSFSugiForest.java new file mode 100644 index 00000000..ac6dee09 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/sugiforest/TerrainSFSugiForest.java @@ -0,0 +1,28 @@ +package rtg.world.gen.terrain.sugiforest; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainSFSugiForest extends TerrainBase { + + private float baseHeight = 72f; + private float peakyHillWavelength = 40f; + private float peakyHillStrength = 10f; + private float smoothHillWavelength = 20f; + private float smoothHillStrength = 20f; + + public TerrainSFSugiForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundNoiseAmplitudeHills, simplex); + + float h = terrainGrasslandHills(x, y, simplex, cell, river, peakyHillWavelength, peakyHillStrength, smoothHillWavelength, smoothHillStrength, baseHeight); + + return riverized(groundNoise + h, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBeach.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBeach.java new file mode 100644 index 00000000..4eb9bf7b --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBeach.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaBeach extends TerrainBase { + + public TerrainVanillaBeach() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainBeach(x, y, simplex, river, 180f, 35f, 63f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForest.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForest.java new file mode 100644 index 00000000..a3ea5c57 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForest.java @@ -0,0 +1,22 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.GroundEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaBirchForest extends TerrainBase { + + + private GroundEffect groundEffect = new GroundEffect(4f); + + public TerrainVanillaBirchForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 80f, 65f); + return riverized(65f + groundEffect.added(simplex, cell, x, y), river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForestHills.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForestHills.java new file mode 100644 index 00000000..ef315f1f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForestHills.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaBirchForestHills extends TerrainBase { + + private float hillStrength = 35f; + + public TerrainVanillaBirchForestHills() { + + } + + public TerrainVanillaBirchForestHills(float bh, float hs) { + + base = bh; + hillStrength = hs; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, 10f, 68f, hillStrength, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForestHillsM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForestHillsM.java new file mode 100644 index 00000000..286b7e88 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForestHillsM.java @@ -0,0 +1,20 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaBirchForestHillsM extends TerrainBase { + + private float hillStrength = 70f; + + public TerrainVanillaBirchForestHillsM() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, 10f, 68f, hillStrength, 10f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForestM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForestM.java new file mode 100644 index 00000000..f6b67a76 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaBirchForestM.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaBirchForestM extends TerrainBase { + + public TerrainVanillaBirchForestM() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 80f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdBeach.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdBeach.java new file mode 100644 index 00000000..e2af368a --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdBeach.java @@ -0,0 +1,9 @@ +package rtg.world.gen.terrain.vanilla; + + +public class TerrainVanillaColdBeach extends TerrainVanillaBeach { + + public TerrainVanillaColdBeach() { + + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdTaiga.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdTaiga.java new file mode 100644 index 00000000..be993b24 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdTaiga.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaColdTaiga extends TerrainBase { + + public TerrainVanillaColdTaiga() { + + } + + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainFlatLakes(x, y, simplex, river, 13f, 66f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdTaigaHills.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdTaigaHills.java new file mode 100644 index 00000000..21c5aeb0 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdTaigaHills.java @@ -0,0 +1,19 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaColdTaigaHills extends TerrainBase { + + public TerrainVanillaColdTaigaHills() { + + base = 72f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, 10f, 68f, 35f, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdTaigaM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdTaigaM.java new file mode 100644 index 00000000..06e16b6f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaColdTaigaM.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaColdTaigaM extends TerrainBase { + + public TerrainVanillaColdTaigaM() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainGrasslandMountains(x, y, simplex, cell, river, 4f, 80f, 68f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDeepOcean.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDeepOcean.java new file mode 100644 index 00000000..dd7acac3 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDeepOcean.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaDeepOcean extends TerrainBase { + + public TerrainVanillaDeepOcean() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainOcean(x, y, simplex, river, 40f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDesert.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDesert.java new file mode 100644 index 00000000..9265d44d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDesert.java @@ -0,0 +1,30 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.config.rtg.ConfigRTG; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaDesert extends TerrainBase { + + public TerrainVanillaDesert() { + + super(64); + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //return terrainPolar(x, y, simplex, river); + float duneHeight = (minDuneHeight + (float) ConfigRTG.duneHeight); + + duneHeight *= (1f + simplex.octave(2).noise2((float) x / 330f, (float) y / 330f)) / 2f; + + float stPitch = 200f; // The higher this is, the more smoothly dunes blend with the terrain + float stFactor = duneHeight; + float hPitch = 70; // Dune scale + float hDivisor = 40; + + return terrainPolar(x, y, simplex, river, stPitch, stFactor, hPitch, hDivisor, base) + + groundNoise(x, y, 1f, simplex); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDesertHills.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDesertHills.java new file mode 100644 index 00000000..b200bba9 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDesertHills.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaDesertHills extends TerrainBase { + + private float start; + private float height; + private float width; + + public TerrainVanillaDesertHills(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) + { + return terrainHighland(x, y, simplex, cell, river, start, width, height, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDesertM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDesertM.java new file mode 100644 index 00000000..92bdf437 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaDesertM.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaDesertM extends TerrainBase { + + private float start; + private float height; + private float width; + + public TerrainVanillaDesertM(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, 10f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHills.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHills.java new file mode 100644 index 00000000..1118650a --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHills.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaExtremeHills extends TerrainBase { + + private float start; + private float height; + private float width; + + public TerrainVanillaExtremeHills(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, base); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsEdge.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsEdge.java new file mode 100644 index 00000000..62fb2893 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsEdge.java @@ -0,0 +1,27 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaExtremeHillsEdge extends TerrainBase { + + private float start; + private float height; + private float base; + private float width; + + public TerrainVanillaExtremeHillsEdge(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, 10f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsM.java new file mode 100644 index 00000000..46e705db --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsM.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaExtremeHillsM extends TerrainBase { + + private float start; + private float height; + private float width; + + public TerrainVanillaExtremeHillsM(float hillStart, float landHeight, float baseHeight, float hillWidth) { + + start = hillStart; + height = landHeight; + base = baseHeight; + width = hillWidth; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsPlus.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsPlus.java new file mode 100644 index 00000000..1ed6880a --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsPlus.java @@ -0,0 +1,39 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.HeightEffect; +import rtg.world.gen.terrain.JitterEffect; +import rtg.world.gen.terrain.MountainsWithPassesEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaExtremeHillsPlus extends TerrainBase { + + private float width; + private float strength; + private float spikeWidth = 40; + private float spikeHeight = 70; + private HeightEffect heightEffect; + + public TerrainVanillaExtremeHillsPlus(float mountainWidth, float mountainStrength, float height) { + + width = mountainWidth; + strength = mountainStrength; + base = height; + MountainsWithPassesEffect mountainEffect = new MountainsWithPassesEffect(); + mountainEffect.mountainHeight = strength; + mountainEffect.mountainWavelength = width; + mountainEffect.spikeHeight = this.spikeHeight; + mountainEffect.spikeWavelength = this.spikeWidth; + + heightEffect = new JitterEffect(7f, 10f, mountainEffect); + heightEffect = new JitterEffect(3f, 6f, heightEffect); + //this(mountainWidth, mountainStrength, depthLake, 260f, 68f); + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return riverized(heightEffect.added(simplex, cell, x, y) + base, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsPlusM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsPlusM.java new file mode 100644 index 00000000..d0188ba2 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaExtremeHillsPlusM.java @@ -0,0 +1,24 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaExtremeHillsPlusM extends TerrainBase { + + private float width; + private float strength; + + public TerrainVanillaExtremeHillsPlusM(float mountainWidth, float mountainStrength, float height) { + + width = mountainWidth; + strength = mountainStrength; + base = height; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainLonelyMountain(x, y, simplex, cell, river, strength, width, base); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaFlowerForest.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaFlowerForest.java new file mode 100644 index 00000000..bb559044 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaFlowerForest.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaFlowerForest extends TerrainBase { + + public TerrainVanillaFlowerForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 80f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaForest.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaForest.java new file mode 100644 index 00000000..6119c83d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaForest.java @@ -0,0 +1,26 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaForest extends TerrainBase { + + private float hillStrength = 10f;// this needs to be linked to the + + public TerrainVanillaForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundVariation, simplex); + + float m = hills(x, y, hillStrength, simplex, river); + + float floNoise = 65f + groundNoise + m; + + return riverized(floNoise, river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaForestHills.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaForestHills.java new file mode 100644 index 00000000..575da678 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaForestHills.java @@ -0,0 +1,28 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaForestHills extends TerrainBase { + + private float hillStrength = 30f; + + public TerrainVanillaForestHills() { + + this(72f, 30f); + } + + public TerrainVanillaForestHills(float bh, float hs) { + + base = bh; + hillStrength = hs; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, 10f, 68f, hillStrength, base - 62f); + + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaFrozenOcean.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaFrozenOcean.java new file mode 100644 index 00000000..d0594c8b --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaFrozenOcean.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaFrozenOcean extends TerrainBase { + + public TerrainVanillaFrozenOcean() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainOcean(x, y, simplex, river, 50f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaFrozenRiver.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaFrozenRiver.java new file mode 100644 index 00000000..15eb06f2 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaFrozenRiver.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaFrozenRiver extends TerrainBase { + + public TerrainVanillaFrozenRiver() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainFlatLakes(x, y, simplex, river, 3f, 60f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaIceMountains.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaIceMountains.java new file mode 100644 index 00000000..d83098c1 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaIceMountains.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaIceMountains extends TerrainBase { + + private float width; + private float strength; + private float terrainHeight; + + public TerrainVanillaIceMountains(float mountainWidth, float mountainStrength, float height) { + + width = mountainWidth; + strength = mountainStrength; + terrainHeight = height; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainLonelyMountain(x, y, simplex, cell, river, strength, width, terrainHeight); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaIcePlains.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaIcePlains.java new file mode 100644 index 00000000..1c116e83 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaIcePlains.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaIcePlains extends TerrainBase { + + public TerrainVanillaIcePlains() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaIcePlainsSpikes.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaIcePlainsSpikes.java new file mode 100644 index 00000000..6e337ed4 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaIcePlainsSpikes.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaIcePlainsSpikes extends TerrainBase { + + public TerrainVanillaIcePlainsSpikes() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 65f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungle.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungle.java new file mode 100644 index 00000000..f7621326 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungle.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaJungle extends TerrainBase { + + public TerrainVanillaJungle() { + + } + + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainFlatLakes(x, y, simplex, river, 3f, 66f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleEdge.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleEdge.java new file mode 100644 index 00000000..96e91607 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleEdge.java @@ -0,0 +1,21 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.GroundEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaJungleEdge extends TerrainBase { + + private GroundEffect groundEffect = new GroundEffect(4f); + + public TerrainVanillaJungleEdge() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return riverized(65f + groundEffect.added(simplex, cell, x, y), river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleEdgeM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleEdgeM.java new file mode 100644 index 00000000..7b90d830 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleEdgeM.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaJungleEdgeM extends TerrainBase { + + public TerrainVanillaJungleEdgeM() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainGrasslandMountains(x, y, simplex, cell, river, 4f, 80f, 68f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleHills.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleHills.java new file mode 100644 index 00000000..ea105f55 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleHills.java @@ -0,0 +1,22 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaJungleHills extends TerrainBase { + + private float hillStrength = 40f; + + public TerrainVanillaJungleHills(float bh, float hs) { + + base = bh; + hillStrength = hs; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, 10f, 68f, hillStrength, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleM.java new file mode 100644 index 00000000..1b3a0c6b --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaJungleM.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaJungleM extends TerrainBase { + + public TerrainVanillaJungleM() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainGrasslandMountains(x, y, simplex, cell, river, 4f, 80f, 68f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMegaSpruceTaiga.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMegaSpruceTaiga.java new file mode 100644 index 00000000..17c3d277 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMegaSpruceTaiga.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaMegaSpruceTaiga extends TerrainBase { + + public TerrainVanillaMegaSpruceTaiga() { + + } + + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainFlatLakes(x, y, simplex, river, 14f, 66f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMegaTaiga.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMegaTaiga.java new file mode 100644 index 00000000..1124e984 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMegaTaiga.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaMegaTaiga extends TerrainBase { + + public TerrainVanillaMegaTaiga() { + + } + + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainFlatLakes(x, y, simplex, river, 13f, 66f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMegaTaigaHills.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMegaTaigaHills.java new file mode 100644 index 00000000..b3381a1c --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMegaTaigaHills.java @@ -0,0 +1,21 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaMegaTaigaHills extends TerrainBase { + + private float hillStrength = 40f; + + public TerrainVanillaMegaTaigaHills() { + + base = 72f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, 10f, 68f, hillStrength, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesa.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesa.java new file mode 100644 index 00000000..733d65ad --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesa.java @@ -0,0 +1,21 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.GroundEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaMesa extends TerrainBase { + + private GroundEffect groundEffect = new GroundEffect(4f); + + public TerrainVanillaMesa() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return riverized(68f + groundEffect.added(simplex, cell, x, y), river); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaBryce.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaBryce.java new file mode 100644 index 00000000..a75332a5 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaBryce.java @@ -0,0 +1,50 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaMesaBryce extends TerrainBase { + + private float height; + private float density; + private float base; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainVanillaMesaBryce(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + /** + * Values come in pairs per layer. First is how high to step up. + * Second is a value between 0 and 1, signifying when to step up. + */ + height = 20f; + density = 0.7f; + base = 69f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainBryce(x, y, simplex, river, height, border); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateau.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateau.java new file mode 100644 index 00000000..54361634 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateau.java @@ -0,0 +1,53 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaMesaPlateau extends TerrainBase { + + private float[] height; + private int heightLength; + private float strength; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainVanillaMesaPlateau(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + /** Values come in pairs per layer. First is how high to step up. + * Second is a value between 0 and 1, signifying when to step up. + */ + height = new float[]{32.0f, 0.4f}; + /** + * lower values = smoother. + */ + strength = 10f; + heightLength = height.length; + base = 69f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlateau(x, y, simplex, river, height, border, strength, heightLength, 100f, false); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateauF.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateauF.java new file mode 100644 index 00000000..7f929767 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateauF.java @@ -0,0 +1,50 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaMesaPlateauF extends TerrainBase { + + private float[] height; + private int heightLength; + private float strength; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainVanillaMesaPlateauF(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + /** Values come in pairs per layer. First is how high to step up. + * Second is a value between 0 and 1, signifying when to step up. + */ + height = new float[]{24.0f, 0.4f}; + strength = 10f; + heightLength = height.length; + base = 69f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlateau(x, y, simplex, river, height, border, strength, heightLength, 100f, false); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateauFM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateauFM.java new file mode 100644 index 00000000..53a04777 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateauFM.java @@ -0,0 +1,52 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaMesaPlateauFM extends TerrainBase { + + private float[] height; + private int heightLength; + private float strength; + private float base; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainVanillaMesaPlateauFM(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + /** + * Values come in pairs per layer. First is how high to step up. + * Second is a value between 0 and 1, signifying when to step up. + */ + height = new float[]{18.5f, 0.4f}; + strength = 20f; + heightLength = height.length; + base = 69f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlateau(x, y, simplex, river, height, border, strength, heightLength, 100f, false); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateauM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateauM.java new file mode 100644 index 00000000..a36783d4 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMesaPlateauM.java @@ -0,0 +1,53 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaMesaPlateauM extends TerrainBase { + + private float[] height; + private int heightLength; + private float strength; + private float base; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainVanillaMesaPlateauM(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + /** + * Values come in pairs per layer. First is how high to step up. + * Second is a value between 0 and 1, signifying when to step up. + */ + height = new float[]{18.5f, 0.4f}; + strength = 20f; + heightLength = height.length; + base = 69f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + river *= 0.5f; + return terrainPlateau(x, y, simplex, river, height, border, strength, heightLength, 50f, true); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMushroomIsland.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMushroomIsland.java new file mode 100644 index 00000000..5cbf26f3 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMushroomIsland.java @@ -0,0 +1,21 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaMushroomIsland extends TerrainBase { + + private float heigth; + private float width; + + public TerrainVanillaMushroomIsland() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainGrasslandFlats(x, y, simplex, river, 40f, 25f, 68f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMushroomIslandShore.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMushroomIslandShore.java new file mode 100644 index 00000000..2c50c61f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaMushroomIslandShore.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaMushroomIslandShore extends TerrainBase { + + public TerrainVanillaMushroomIslandShore() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainMarsh(x, y, simplex, 61.5f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaOcean.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaOcean.java new file mode 100644 index 00000000..b2962370 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaOcean.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaOcean extends TerrainBase { + + public TerrainVanillaOcean() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainOcean(x, y, simplex, river, 50f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaPlains.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaPlains.java new file mode 100644 index 00000000..6087ef52 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaPlains.java @@ -0,0 +1,21 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.GroundEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaPlains extends TerrainBase { + + private GroundEffect groundEffect = new GroundEffect(4f); + + public TerrainVanillaPlains() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 66f); + return riverized(65f + groundEffect.added(simplex, cell, x, y), river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRedwoodTaigaHills.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRedwoodTaigaHills.java new file mode 100644 index 00000000..0160231d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRedwoodTaigaHills.java @@ -0,0 +1,21 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaRedwoodTaigaHills extends TerrainBase { + + private float hillStrength = 40f; + + public TerrainVanillaRedwoodTaigaHills() { + + base = 72f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, 10f, 68f, hillStrength, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRiver.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRiver.java new file mode 100644 index 00000000..d9a16b04 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRiver.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaRiver extends TerrainBase { + + public TerrainVanillaRiver() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainFlatLakes(x, y, simplex, river, 3f, 60f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRoofedForest.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRoofedForest.java new file mode 100644 index 00000000..6afd6b65 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRoofedForest.java @@ -0,0 +1,21 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.GroundEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaRoofedForest extends TerrainBase { + + private GroundEffect groundEffect = new GroundEffect(4f); + + public TerrainVanillaRoofedForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 80f, 65f) + return riverized(65f + groundEffect.added(simplex, cell, x, y), river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRoofedForestM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRoofedForestM.java new file mode 100644 index 00000000..c4256fa1 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaRoofedForestM.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaRoofedForestM extends TerrainBase { + + public TerrainVanillaRoofedForestM() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainGrasslandMountains(x, y, simplex, cell, river, 4f, 50f, 68f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavanna.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavanna.java new file mode 100644 index 00000000..d71e2414 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavanna.java @@ -0,0 +1,21 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.GroundEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaSavanna extends TerrainBase { + + private GroundEffect groundEffect = new GroundEffect(4f); + + public TerrainVanillaSavanna() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 100f, 66f); + return riverized(65f + groundEffect.added(simplex, cell, x, y), river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavannaM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavannaM.java new file mode 100644 index 00000000..c1ec3816 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavannaM.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaSavannaM extends TerrainBase { + + public TerrainVanillaSavannaM() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainGrasslandMountains(x, y, simplex, cell, river, 4f, 90f, 67f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavannaPlateau.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavannaPlateau.java new file mode 100644 index 00000000..90457c75 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavannaPlateau.java @@ -0,0 +1,57 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaSavannaPlateau extends TerrainBase { + + private boolean booRiver; + private float[] height; + private int heightLength; + private float strength; + private float smooth; + private float cWidth; + private float cHeigth; + private float cStrength; + private float base; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainVanillaSavannaPlateau(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + + booRiver = true; + /** Values come in pairs per layer. First is how high to step up. + * Second is a value between 0 and 1, signifying when to step up. + */ + height = new float[]{12.0f, 0.5f, 8f, 0.7f}; + strength = 10f; + heightLength = height.length; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlateau(x, y, simplex, river, height, border, strength, heightLength, 50f, true); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavannaPlateauM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavannaPlateauM.java new file mode 100644 index 00000000..81b1d8a2 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSavannaPlateauM.java @@ -0,0 +1,50 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaSavannaPlateauM extends TerrainBase { + + private float[] height; + private int heightLength; + private float strength; + + /* + * Example parameters: + * + * allowed to generate rivers? + * riverGen = true + * + * canyon jump heights + * heightArray = new float[]{2.0f, 0.5f, 6.5f, 0.5f, 14.0f, 0.5f, 19.0f, 0.5f} + * + * strength of canyon jump heights + * heightStrength = 35f + * + * canyon width (cliff to cliff) + * canyonWidth = 160f + * + * canyon heigth (total heigth) + * canyonHeight = 60f + * + * canyon strength + * canyonStrength = 40f + * + */ + public TerrainVanillaSavannaPlateauM(boolean riverGen, float heightStrength, float canyonWidth, float canyonHeight, float canyonStrength, float baseHeight) { + /** + * Values come in pairs per layer. First is how high to step up. + * Second is a value between 0 and 1, signifying when to step up. + */ + height = new float[]{18f, 0.4f, 12f, 0.6f, 8f, 0.8f}; + strength = 10f; + heightLength = height.length; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainPlateau(x, y, simplex, river, height, border, strength, heightLength, 50f, true); + } +} \ No newline at end of file diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaStoneBeach.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaStoneBeach.java new file mode 100644 index 00000000..a270876f --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaStoneBeach.java @@ -0,0 +1,9 @@ +package rtg.world.gen.terrain.vanilla; + + +public class TerrainVanillaStoneBeach extends TerrainVanillaBeach { + + public TerrainVanillaStoneBeach() { + + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSunflowerPlains.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSunflowerPlains.java new file mode 100644 index 00000000..5e37842d --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSunflowerPlains.java @@ -0,0 +1,21 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.GroundEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaSunflowerPlains extends TerrainBase { + + private GroundEffect groundEffect = new GroundEffect(4f); + + public TerrainVanillaSunflowerPlains() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + //return terrainPlains(x, y, simplex, river, 160f, 10f, 60f, 200f, 65f); + return riverized(65f + groundEffect.added(simplex, cell, x, y), river); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSwampland.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSwampland.java new file mode 100644 index 00000000..cc4eccc7 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSwampland.java @@ -0,0 +1,18 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaSwampland extends TerrainBase { + + public TerrainVanillaSwampland() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainMarsh(x, y, simplex, 61.5f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSwamplandM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSwamplandM.java new file mode 100644 index 00000000..fd4f8a80 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaSwamplandM.java @@ -0,0 +1,25 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaSwamplandM extends TerrainBase { + + private float width; + private float strength; + private float terrainHeight; + + public TerrainVanillaSwamplandM(float mountainWidth, float mountainStrength, float height) { + + width = mountainWidth; + strength = mountainStrength; + terrainHeight = height; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainLonelyMountain(x, y, simplex, cell, river, strength, width, terrainHeight); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaTaiga.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaTaiga.java new file mode 100644 index 00000000..ead8bf23 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaTaiga.java @@ -0,0 +1,17 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaTaiga extends TerrainBase { + + public TerrainVanillaTaiga() { + + } + + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainFlatLakes(x, y, simplex, river, 8f, 68f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaTaigaHills.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaTaigaHills.java new file mode 100644 index 00000000..7d92d196 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaTaigaHills.java @@ -0,0 +1,27 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaTaigaHills extends TerrainBase { + + private float hillStrength = 30f; + + public TerrainVanillaTaigaHills() { + + this(72f, 30f); + } + + public TerrainVanillaTaigaHills(float bh, float hs) { + + base = bh; + hillStrength = hs; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, 10f, 68f, hillStrength, base - 62f); + } +} diff --git a/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaTaigaM.java b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaTaigaM.java new file mode 100644 index 00000000..09a6b5a6 --- /dev/null +++ b/src/api/java/rtg/world/gen/terrain/vanilla/TerrainVanillaTaigaM.java @@ -0,0 +1,36 @@ +package rtg.world.gen.terrain.vanilla; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainVanillaTaigaM extends TerrainBase { + + private float hHeight; + private float hWidth; + private float vHeight; + private float vWidth; + private float lHeight; + private float lWidth; + private float bHeight; + + public TerrainVanillaTaigaM(float hillHeight, float hillWidth, float varHeight, float varWidth, float lakeHeight, float lakeWidth, float baseHeight) { + + hHeight = hillHeight; + hWidth = hillWidth; + + vHeight = varHeight; + vWidth = varWidth; + + lHeight = lakeHeight; + lWidth = lakeWidth; + + bHeight = baseHeight; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainGrasslandHills(x, y, simplex, cell, river, vWidth, vHeight, hWidth, hHeight, bHeight); + } +} diff --git a/src/api/resources/assets/rtg/lang/da_DK.lang b/src/api/resources/assets/rtg/lang/da_DK.lang new file mode 100644 index 00000000..0ec8ba0e --- /dev/null +++ b/src/api/resources/assets/rtg/lang/da_DK.lang @@ -0,0 +1,8 @@ +generator.RTG=Realistisk + +warning.rtgStartup1=Realistisk Terrain Generation bruger et tilpasset verden type. +warning.rtgStartup2=Hvis du vil have realistiske terræn, holde klikke på knappen World Type +warning.rtgStartup3=under Flere verden Options indtil det viser "Realistisk". +warning.rtgStartup4=Verdens type kan bruges på servere ved at ændre "niveau-type" i +warning.rtgStartup5=server.properties til 'RTG "(uden anførselstegn). +warning.rtgStartup6=Denne meddelelse vises kun én gang. diff --git a/src/api/resources/assets/rtg/lang/de_DE.lang b/src/api/resources/assets/rtg/lang/de_DE.lang new file mode 100644 index 00000000..b2b65c80 --- /dev/null +++ b/src/api/resources/assets/rtg/lang/de_DE.lang @@ -0,0 +1,8 @@ +generator.RTG=Realistisch + +warning.rtgStartup1=Realistische Terrain-Generation verwendet einen benutzerdefinierten Welt-Typ. +warning.rtgStartup2=Wenn du realistisches Terrain willst, klicke mehrmals den 'World Type'-Button +warning.rtgStartup3=unter 'Weitere Welt'-Optionen, bis er 'Realistisch' anzeigt. +warning.rtgStartup4=Der Welt-Typ kann auf Servern verwendet werden, indem in server.properties +warning.rtgStartup5=der 'level-type' auf 'RTG' (ohne Anführungszeichen) gesetzt wird. +warning.rtgStartup6=Diese Meldung wird nur einmal angezeigt. diff --git a/src/api/resources/assets/rtg/lang/en_GB.lang b/src/api/resources/assets/rtg/lang/en_GB.lang new file mode 100644 index 00000000..362d5423 --- /dev/null +++ b/src/api/resources/assets/rtg/lang/en_GB.lang @@ -0,0 +1,8 @@ +generator.RTG=Realistic + +warning.rtgStartup1=Realistic Terrain Generation uses a custom world type. +warning.rtgStartup2=If you want realistic terrain, keep clicking the 'World Type' button +warning.rtgStartup3=under 'More World Options' until it displays 'Realistic'. +warning.rtgStartup4=The world type can be used on servers by changing the 'level-type' in +warning.rtgStartup5=server.properties to 'RTG' (without quotes). +warning.rtgStartup6=This message will only display once. diff --git a/src/api/resources/assets/rtg/lang/en_US.lang b/src/api/resources/assets/rtg/lang/en_US.lang new file mode 100644 index 00000000..362d5423 --- /dev/null +++ b/src/api/resources/assets/rtg/lang/en_US.lang @@ -0,0 +1,8 @@ +generator.RTG=Realistic + +warning.rtgStartup1=Realistic Terrain Generation uses a custom world type. +warning.rtgStartup2=If you want realistic terrain, keep clicking the 'World Type' button +warning.rtgStartup3=under 'More World Options' until it displays 'Realistic'. +warning.rtgStartup4=The world type can be used on servers by changing the 'level-type' in +warning.rtgStartup5=server.properties to 'RTG' (without quotes). +warning.rtgStartup6=This message will only display once. diff --git a/src/api/resources/assets/rtg/lang/es_ES.lang b/src/api/resources/assets/rtg/lang/es_ES.lang new file mode 100644 index 00000000..a8a62b9b --- /dev/null +++ b/src/api/resources/assets/rtg/lang/es_ES.lang @@ -0,0 +1,8 @@ +generator.RTG=Realista + +warning.rtgStartup1=Realista Terreno generación utiliza un tipo de encargo mundo. +warning.rtgStartup2=Si quieres terreno realista, seguir haciendo clic en el botón Tipo de Mundo +warning.rtgStartup3=en Más Opciones Mundial hasta que aparezca esa 'Realista'. +warning.rtgStartup4=El tipo de mundo se puede utilizar en los servidores cambiando el 'nivel de tipo' en +warning.rtgStartup5=server.properties a 'RTG' (sin comillas). +warning.rtgStartup6=Este mensaje sólo se mostrará una vez. diff --git a/src/api/resources/assets/rtg/lang/fr_FR.lang b/src/api/resources/assets/rtg/lang/fr_FR.lang new file mode 100644 index 00000000..665e9ebb --- /dev/null +++ b/src/api/resources/assets/rtg/lang/fr_FR.lang @@ -0,0 +1,8 @@ +generator.RTG=Réaliste + +warning.rtgStartup1=Réaliste Generation Terrain utilise un type de monde personnalisé. +warning.rtgStartup2=Si vous voulez un terrain réaliste, garder en cliquant sur le bouton Type du Monde +warning.rtgStartup3=sous Plus d'options du monde jusqu'à ce qu'il affiche 'Réaliste'. +warning.rtgStartup4=Le type de monde peut être utilisé sur les serveurs en changeant le type de niveau dans +warning.rtgStartup5=server.properties à « RTG »(sans les guillemets). +warning.rtgStartup6=Ce message n'affichera une fois. diff --git a/src/api/resources/assets/rtg/lang/hu_HU.lang b/src/api/resources/assets/rtg/lang/hu_HU.lang new file mode 100644 index 00000000..98191b3e --- /dev/null +++ b/src/api/resources/assets/rtg/lang/hu_HU.lang @@ -0,0 +1,8 @@ +generator.RTG=Valósághű + +warning.rtgStartup1= A Realistic Terrain Generation egy egyéni világbeállítást használ. +warning.rtgStartup2=Ha valósághű domborzatot szeretnél, nyomd meg a 'Világ típusa' gombot +warning.rtgStartup3=a 'További világbeállítások...' alatt, amíg azt írja ki, hogy 'Valósághű'. +warning.rtgStartup4=Ez ba világtípus használható szervereken is a 'level-type' 'RTG'-re +warning.rtgStartup5=való megváltoztatásával (idézőjelek nélkül) a server.properties fájlban. +warning.rtgStartup6=Ez az üzenet csak egyszer fog megjelenni. diff --git a/src/api/resources/assets/rtg/lang/it_IT.lang b/src/api/resources/assets/rtg/lang/it_IT.lang new file mode 100644 index 00000000..310cd898 --- /dev/null +++ b/src/api/resources/assets/rtg/lang/it_IT.lang @@ -0,0 +1,8 @@ +generator.RTG=Realistico + +warning.rtgStartup1=Realistico Terreno generazione utilizza un tipo di mondo personalizzato. +warning.rtgStartup2=Se si desidera terreno realistico, continuare a fare clic sul pulsante 'Tipo Mondiale' +warning.rtgStartup3=sotto 'Altre opzioni mondo' fino a quando mostra 'Realistico'. +warning.rtgStartup4=Il tipo di mondo può essere utilizzato su server modificando il 'livello di tipo' in +warning.rtgStartup5=server.properties a 'RTG' (senza virgolette). +warning.rtgStartup6=Questo messaggio verrà visualizzato solo una volta. diff --git a/src/api/resources/assets/rtg/lang/ko_KR.lang b/src/api/resources/assets/rtg/lang/ko_KR.lang new file mode 100644 index 00000000..e95c494e --- /dev/null +++ b/src/api/resources/assets/rtg/lang/ko_KR.lang @@ -0,0 +1,8 @@ +generator.RTG=현실적인 바이옴 + +warning.rtgStartup1=현실적인 지형 생성 사용자 지정 세계 유형을 사용합니다. +warning.rtgStartup2=당신이 실제 지형을 원한다면, 그것은 '현실'이 표시 될 때까지 +warning.rtgStartup3='더 월드 옵션'에서 '세계 유형'버튼을 클릭 유지. +warning.rtgStartup4=세계 유형 따옴표없이 'RTG'에 +warning.rtgStartup5=server.properties에서 '레벨 형'변경하여 서버에서 이용 될 수있다. +warning.rtgStartup6=이 메시지는 한 번만 표시됩니다. diff --git a/src/api/resources/assets/rtg/lang/pt_PT.lang b/src/api/resources/assets/rtg/lang/pt_PT.lang new file mode 100644 index 00000000..3672aed1 --- /dev/null +++ b/src/api/resources/assets/rtg/lang/pt_PT.lang @@ -0,0 +1,8 @@ +generator.RTG=Realista + +warning.rtgStartup1=Realistic Terrain geração usa um tipo de mundo personalizado. +warning.rtgStartup2=Se você quiser terreno realista, continue clicando no botão Tipo de Mundo +warning.rtgStartup3=em Mais Opções Mundo até que ele exibe "Realista". +warning.rtgStartup4=O tipo de mundo pode ser usado em servidores, alterando o "tipo nível 'em +warning.rtgStartup5=server.properties para" RTG "(sem aspas). +warning.rtgStartup6=Esta mensagem só será exibida uma vez. diff --git a/src/api/resources/assets/rtg/lang/ru_RU.lang b/src/api/resources/assets/rtg/lang/ru_RU.lang new file mode 100644 index 00000000..a609c2c9 --- /dev/null +++ b/src/api/resources/assets/rtg/lang/ru_RU.lang @@ -0,0 +1,8 @@ +generator.RTG=Реалистичный + +warning.rtgStartup1=Реалистичный Генератор Ландшафта использует свой тип мира. +warning.rtgStartup2=Если вы хотите реалистичный рельеф местности, продолжайте нажимать кнопку World Type +warning.rtgStartup3=в разделе Дополнительные параметры мира, пока не появится «Реалистичный». +warning.rtgStartup4=Этот тип мира может использоваться на серверах за счет изменения значения параметра 'level-type' в +warning.rtgStartup5=server.properties к "RTG" (без кавычек). +warning.rtgStartup6=Это сообщение будет отображаться только один раз. diff --git a/src/api/resources/assets/rtg/lang/zh_CN.lang b/src/api/resources/assets/rtg/lang/zh_CN.lang new file mode 100644 index 00000000..50c13f7b --- /dev/null +++ b/src/api/resources/assets/rtg/lang/zh_CN.lang @@ -0,0 +1,8 @@ +generator.RTG=真实世界生成 + +warning.rtgStartup1=真实感地形生成使用自定义的世界类型。 +warning.rtgStartup2=如果你想真实的地形,继续点击下“更多的世 +warning.rtgStartup3=界选项”直到显示“现实主义”的“世界型”按钮。 +warning.rtgStartup4=世界类型可以在服务器上通过 +warning.rtgStartup5=server.properties为“RTG”(不带引号)改变“水平型”一起使用。 +warning.rtgStartup6=此消息将只显示一次。 diff --git a/src/api/resources/assets/rtg/logo.png b/src/api/resources/assets/rtg/logo.png new file mode 100644 index 00000000..8b2babaa Binary files /dev/null and b/src/api/resources/assets/rtg/logo.png differ diff --git a/src/api/resources/assets/rtg/textures/gui/rtg-logo-worldtype.png b/src/api/resources/assets/rtg/textures/gui/rtg-logo-worldtype.png new file mode 100644 index 00000000..59c5e092 Binary files /dev/null and b/src/api/resources/assets/rtg/textures/gui/rtg-logo-worldtype.png differ diff --git a/src/main/java/appalachia/Appalachia.java b/src/main/java/appalachia/Appalachia.java index cb697fba..bcc1bb17 100644 --- a/src/main/java/appalachia/Appalachia.java +++ b/src/main/java/appalachia/Appalachia.java @@ -1,6 +1,5 @@ package appalachia; - import java.io.File; import net.minecraftforge.fml.common.Mod; @@ -10,44 +9,88 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.registry.GameRegistry; +import appalachia.biome.AppalachiaBiomeManager; +import appalachia.block.BlockManager; +import appalachia.client.sound.SoundManager; import appalachia.config.ConfigManager; import appalachia.event.EventManager; +import appalachia.item.ItemManager; +import appalachia.proxy.ClientProxy; import appalachia.proxy.CommonProxy; +import appalachia.rtg.config.BiomeConfigManagerAPL; +import appalachia.rtg.config.ConfigManagerAPL; +import appalachia.rtg.world.biome.realistic.appalachia.RealisticBiomeAPLBase; +import appalachia.world.AppalachiaWorldGenerator; import appalachia.reference.ModInfo; -import static appalachia.reference.ModInfo.*; -@Mod(modid = ModInfo.MOD_ID, name = MOD_NAME, version = MOD_VERSION, dependencies = "required-after:Forge@[" + FORGE_DEP + ",)", acceptableRemoteVersions = "*") +@SuppressWarnings({"WeakerAccess", "unused"}) +@Mod( + modid = ModInfo.MOD_ID, + name = ModInfo.MOD_NAME, + version = ModInfo.MOD_VERSION, + dependencies = "required-after:Forge@[" + ModInfo.MCF_MINVER + "," + ModInfo.MCF_MAXVER + ");required-before:RTG@[" + ModInfo.RTG_MINVER + "," + ModInfo.RTG_MAXVER + ")", + acceptableRemoteVersions = "*" +) public class Appalachia { - @Instance(MOD_ID) + @Instance(ModInfo.MOD_ID) public static Appalachia instance; public static String configPath; public static EventManager eventMgr; - @SidedProxy(serverSide = ModInfo.PROXY_COMMON, clientSide = ModInfo.PROXY_CLIENT) + @SidedProxy(clientSide = ClientProxy.LOCATION, serverSide = CommonProxy.LOCATION) public static CommonProxy proxy; private ConfigManager configManager = new ConfigManager(); @EventHandler - public void fmlLifeCycleEvent(FMLPreInitializationEvent event) { + public void initPre(FMLPreInitializationEvent event) { instance = this; configPath = event.getModConfigurationDirectory() + File.separator + ModInfo.CONFIG_DIRECTORY + File.separator; ConfigManager.init(configPath); + BlockManager.registerBlocks(); + ItemManager.registerItems(); + SoundManager.registerSounds(); + + if (event.getSide().isClient()) { + BlockManager.registerModels(); + ItemManager.registerModels(); + } + + AppalachiaBiomeManager.registerBiomes(); + + proxy.preInit(event); + + BiomeConfigManagerAPL.initBiomeConfigs(); + ConfigManagerAPL.init(event.getModConfigurationDirectory() + File.separator + rtg.reference.ModInfo.CONFIG_DIRECTORY + File.separator); + } + + @EventHandler + public void init(FMLInitializationEvent event) { + eventMgr = new EventManager(); eventMgr.registerEventHandlers(); + + BlockManager.addRecipes(); + GameRegistry.registerWorldGenerator(new AppalachiaWorldGenerator(), 0); + AppalachiaBiomeManager.doBiomeCheck(); + + proxy.init(event); } @EventHandler - public void fmlLifeCycleEvent(FMLInitializationEvent event) {} + public void initPost(FMLPostInitializationEvent event) { - @EventHandler - public void fmlLifeCycle(FMLPostInitializationEvent event) { + RealisticBiomeAPLBase.addBiomes(); + + //RealisticBiomePresenceTester.doBiomeCheck(); + proxy.postInit(event); } } diff --git a/src/main/java/appalachia/api/.gitkeep b/src/main/java/appalachia/api/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/main/java/appalachia/api/AppalachiaAPI.java b/src/main/java/appalachia/api/AppalachiaAPI.java new file mode 100644 index 00000000..ae2af5f3 --- /dev/null +++ b/src/main/java/appalachia/api/AppalachiaAPI.java @@ -0,0 +1,9 @@ +package appalachia.api; + +import java.util.Random; + +public class AppalachiaAPI { + + public static final String API_VERSION = "0.0.1"; + public static Random rand = new Random(4444); +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/AppalachiaBiomeTypes.java b/src/main/java/appalachia/api/AppalachiaBiomeTypes.java new file mode 100644 index 00000000..3c290124 --- /dev/null +++ b/src/main/java/appalachia/api/AppalachiaBiomeTypes.java @@ -0,0 +1,10 @@ +package appalachia.api; + +import net.minecraftforge.common.BiomeDictionary; + +public class AppalachiaBiomeTypes { + + public static final BiomeDictionary.Type AUTUMN = BiomeDictionary.Type.getType("AUTUMN"); + public static final BiomeDictionary.Type BLUERIDGE = BiomeDictionary.Type.getType("BLUERIDGE"); + +} diff --git a/src/main/java/appalachia/api/AppalachiaBiomes.java b/src/main/java/appalachia/api/AppalachiaBiomes.java new file mode 100644 index 00000000..9bb99615 --- /dev/null +++ b/src/main/java/appalachia/api/AppalachiaBiomes.java @@ -0,0 +1,108 @@ +package appalachia.api; + +import net.minecraft.world.biome.Biome; + +public class AppalachiaBiomes { + + public static Biome appalachianMountains; + public static Biome blueRidgeForest; + public static Biome blueRidgeHills; + public static Biome blueRidgeMountains; + public static Biome blueRidgeBeach; + public static Biome blueRidgeRiver; + public static Biome prairie; + public static Biome smokyMountains; + + public static Biome blueRidgeForestAutumn; + public static Biome blueRidgeHillsAutumn; + public static Biome blueRidgeMountainsAutumn; + + public static enum AppalachiaBiomeProps { + // BH HV Temp Rain H2OColour Snow? + APPALACHIAN_MOUNTAINS("Appalachian Mountains", 1.0F, 0.5F, 0.2F, 0.3F, 16777215, false), + + BLUE_RIDGE_FOREST_AUTUMN("Autumn Blue Ridge Forest", 0.1F, 0.1F, 0.34F, 0.8F, 16777215, false), + BLUE_RIDGE_HILLS_AUTUMN("Autumn Blue Ridge Hills", 0.15F, 0.15F, 0.34F, 0.8F, 16777215, false), + BLUE_RIDGE_MOUNTAINS_AUTUMN("Autumn Blue Ridge Mountains", 0.2F, 0.2F, 0.34F, 0.8F, 16777215, false), + + BLUE_RIDGE_FOREST("Blue Ridge Forest", 0.1F, 0.1F, 0.34F, 0.8F, 16777215, false), + BLUE_RIDGE_HILLS("Blue Ridge Hills", 0.15F, 0.15F, 0.34F, 0.8F, 16777215, false), + BLUE_RIDGE_MOUNTAINS("Blue Ridge Mountains", 0.2F, 0.2F, 0.34F, 0.8F, 16777215, false), + BLUE_RIDGE_BEACH("Blue Ridge Beach", 0.1F, 0.05F, 0.34F, 0.8F, 16777215, false), + BLUE_RIDGE_RIVER("Blue Ridge River", 0.1F, 0.05F, 0.34F, 0.8F, 16777215, false), + + PRAIRIE("Prairie", 0.125F, 0.05F, 0.8F, 0.4F, 16777215, false), + SMOKY_MOUNTAINS("Smoky Mountains", 1.0F, 0.5F, 0.2F, 0.3F, 16777215, false); + + private final String biomeName; + private final float baseHeight; + private final float heightVariation; + private final float temperature; + private final float rainfall; + private final int waterColour; + private final boolean snowEnabled; + private final Biome.BiomeProperties props; + + AppalachiaBiomeProps(String biomeName, float baseHeight, float heightVariation, float temperature, float rainfall, int waterColour, boolean snowEnabled) { + + this.biomeName = biomeName; + this.baseHeight = baseHeight; + this.heightVariation = heightVariation; + this.temperature = temperature; + this.rainfall = rainfall; + this.waterColour = waterColour; + this.snowEnabled = snowEnabled; + + this.props = new Biome.BiomeProperties(this.biomeName) + .setBaseHeight(this.baseHeight) + .setHeightVariation(this.heightVariation) + .setTemperature(this.temperature) + .setRainfall(this.rainfall) + .setWaterColor(this.waterColour); + + if (this.snowEnabled) { + this.props.setSnowEnabled(); + } + } + + public String getBiomeName() { + + return this.biomeName; + } + + public float getBaseHeight() { + + return this.baseHeight; + } + + public float getHeightVariation() { + + return this.heightVariation; + } + + public float getTemperature() { + + return this.temperature; + } + + public float getRainfall() { + + return this.rainfall; + } + + public int getWaterColour() { + + return this.waterColour; + } + + public boolean getSnowEnabled() { + + return this.snowEnabled; + } + + public Biome.BiomeProperties getProps() { + + return this.props; + } + } +} diff --git a/src/main/java/appalachia/api/AppalachiaBlocks.java b/src/main/java/appalachia/api/AppalachiaBlocks.java new file mode 100644 index 00000000..9a29b52c --- /dev/null +++ b/src/main/java/appalachia/api/AppalachiaBlocks.java @@ -0,0 +1,100 @@ +package appalachia.api; + +import net.minecraft.block.Block; + +public class AppalachiaBlocks { + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Logs + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static Block log_autumn_grey; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Planks + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static Block planks_autumn_grey; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Slabs + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static Block slab_autumn_grey; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Stairs + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static Block stairs_autumn_grey; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Fences + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static Block fence_autumn_grey; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Fence Gates + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static Block fence_gate_autumn_grey; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Leaves + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static Block leaves_autumn_red; + public static Block leaves_autumn_orange; + public static Block leaves_autumn_yellow; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Fallen Leaves + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static Block leaves_oak_fallen; + public static Block leaves_autumn_red_fallen; + public static Block leaves_autumn_orange_fallen; + public static Block leaves_autumn_yellow_fallen; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Saplings + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static Block sapling_quercus_robur; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + public static Block fence_gate_blueridge_01; + public static Block fence_gate_blueridge_02; + public static Block fence_gate_blueridge_03; + + + public static Block fence_blueridge_01; + public static Block fence_blueridge_02; + public static Block fence_blueridge_03; + + + public static Block log_blueridge_01; + public static Block log_blueridge_02; + public static Block log_blueridge_03; + + + public static Block planks_blueridge_01; + public static Block planks_blueridge_02; + public static Block planks_blueridge_03; + + + public static Block slab_blueridge_01; + public static Block slab_blueridge_02; + public static Block slab_blueridge_03; + + + public static Block stairs_blueridge_01; + public static Block stairs_blueridge_02; + public static Block stairs_blueridge_03; + + +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/AppalachiaItems.java b/src/main/java/appalachia/api/AppalachiaItems.java new file mode 100644 index 00000000..d4601d06 --- /dev/null +++ b/src/main/java/appalachia/api/AppalachiaItems.java @@ -0,0 +1,5 @@ +package appalachia.api; + +public class AppalachiaItems { + +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/AppalachiaSounds.java b/src/main/java/appalachia/api/AppalachiaSounds.java new file mode 100644 index 00000000..e11eddaa --- /dev/null +++ b/src/main/java/appalachia/api/AppalachiaSounds.java @@ -0,0 +1,46 @@ +package appalachia.api; + +import net.minecraft.util.SoundEvent; + +public class AppalachiaSounds { + + public static SoundEvent entity_blackbear_idle1; + public static SoundEvent entity_blackbear_idle2; + public static SoundEvent entity_blackbear_idle3; + public static SoundEvent entity_blackbear_idle4; + public static SoundEvent entity_blackbear_step1; + public static SoundEvent entity_blackbear_step2; + public static SoundEvent entity_blackbear_step3; + public static SoundEvent entity_blackbear_step4; + public static SoundEvent entity_blackbear_hurt1; + public static SoundEvent entity_blackbear_hurt2; + public static SoundEvent entity_blackbear_hurt3; + public static SoundEvent entity_blackbear_hurt4; + public static SoundEvent entity_blackbear_warning1; + public static SoundEvent entity_blackbear_warning2; + public static SoundEvent entity_blackbear_warning3; + public static SoundEvent entity_blackbear_death1; + public static SoundEvent entity_blackbear_death2; + public static SoundEvent entity_blackbear_death3; + public static SoundEvent entity_blackbear_baby_idle1; + public static SoundEvent entity_blackbear_baby_idle2; + public static SoundEvent entity_blackbear_baby_idle3; + public static SoundEvent entity_blackbear_baby_idle4; + + public static SoundEvent[] entity_blackbear_idle; + public static SoundEvent[] entity_blackbear_step; + public static SoundEvent[] entity_blackbear_hurt; + public static SoundEvent[] entity_blackbear_warning; + public static SoundEvent[] entity_blackbear_death; + public static SoundEvent[] entity_blackbear_baby_idle; + + public static SoundEvent getRandomSound(SoundEvent[] sounds) { + + if (sounds.length > 0) { + return sounds[AppalachiaAPI.rand.nextInt(sounds.length)]; + } + else { + throw new RuntimeException("Can't get random sound when there are no sounds."); + } + } +} diff --git a/src/main/java/appalachia/api/biome/AppalachiaBiome.java b/src/main/java/appalachia/api/biome/AppalachiaBiome.java new file mode 100644 index 00000000..d18a9cee --- /dev/null +++ b/src/main/java/appalachia/api/biome/AppalachiaBiome.java @@ -0,0 +1,88 @@ +package appalachia.api.biome; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.entity.passive.EntityRabbit; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import appalachia.rtg.world.gen.feature.tree.rtg.AppalachiaTree; + +import rtg.util.OpenSimplexNoise; + +public class AppalachiaBiome extends Biome implements IAppalachiaBiome { + + public ArrayList appalachiaTrees; + public OpenSimplexNoise simplex = new OpenSimplexNoise(4444); + + public static final int leafColours[] = { + 15924992, 16776960, 16773632, 16770560, 16767232, 16763904, + 16760576, 16757504, 16754176, 16750848, 16747520, 16744448, + 16741120, 16737792, 16734464, 16731392, 16728064, 16724736, 16721408 + }; + + public AppalachiaBiome(BiomeProperties props) { + + super(props); + + topBlock = Blocks.GRASS.getDefaultState(); + fillerBlock = Blocks.DIRT.getDefaultState(); + + theBiomeDecorator.treesPerChunk = 3; + theBiomeDecorator.grassPerChunk = 4; + theBiomeDecorator.flowersPerChunk = 2; + theBiomeDecorator.generateLakes = false; + + this.spawnableCreatureList.clear(); + this.spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 20, 1, 4)); + + appalachiaTrees = new ArrayList(); + this.addTreesToBiome(); + } + + @Override + public void decorate(World world, Random rand, BlockPos pos) { + + super.decorate(world, rand, pos); + } + + @Override + public WorldGenAbstractTree genBigTreeChance(Random rand) { + + return rand.nextInt(3) == 0 ? TREE_FEATURE : rand.nextInt(5) == 0 ? BIG_TREE_FEATURE : TREE_FEATURE; + } + + /** + * Adds a tree to the list of Appalachia trees associated with this biome. + * The 'allowed' parameter allows us to pass biome config booleans dynamically when configuring the trees in the biome. + * + * @param tree + * @param allowed + */ + public void addTree(AppalachiaTree tree, boolean allowed) { + + if (allowed) { + + this.appalachiaTrees.add(tree); + } + } + + /** + * Convenience method for addTree() where 'allowed' is assumed to be true. + * + * @param tree + */ + public void addTree(AppalachiaTree tree) { + + this.addTree(tree, true); + } + + @Override + public void addTreesToBiome() { + + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/BiomeAppalachianMountains.java b/src/main/java/appalachia/api/biome/BiomeAppalachianMountains.java new file mode 100644 index 00000000..d01adea8 --- /dev/null +++ b/src/main/java/appalachia/api/biome/BiomeAppalachianMountains.java @@ -0,0 +1,72 @@ +package appalachia.api.biome; + +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeDecorator; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.api.biome.decorator.DecoratorAppalachianMountains; + +public class BiomeAppalachianMountains extends AppalachiaBiome implements IAppalachiaBiome { + + public static BiomeDictionary.Type[] biomeTypes; + + public BiomeAppalachianMountains(BiomeProperties props) { + + super(props); + topBlock = Blocks.GRASS.getDefaultState(); + fillerBlock = Blocks.DIRT.getDefaultState(); + theBiomeDecorator.treesPerChunk = 1; + + biomeTypes = new BiomeDictionary.Type[]{BiomeDictionary.Type.HILLS, BiomeDictionary.Type.MOUNTAIN}; + } + + @Override + public BiomeDecorator createBiomeDecorator() { + + return new DecoratorAppalachianMountains(); + } + + @Override + public void decorate(World world, Random rand, BlockPos pos) { + + super.decorate(world, rand, pos); + } + + @Override + public WorldGenAbstractTree genBigTreeChance(Random rand) { + + return rand.nextInt(3) == 0 ? TREE_FEATURE : rand.nextInt(5) == 0 ? BIG_TREE_FEATURE : TREE_FEATURE; + } + +// @Override +// @SideOnly(Side.CLIENT) +// public int getSkyColorByTemp(float temp) +// { +// double noise = GRASS_COLOR_NOISE.getValue((double)temp * 0.0225D, (double)temp * 0.0225D); +// return noise < -0.7D ? 0xD4DB55 : (noise < -0.3D ? 0xBBDD54 : 0xA3E053); +// } + + @Override + @SideOnly(Side.CLIENT) + public int getGrassColorAtPos(BlockPos pos) { + + double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D); + return noise < -0.1D ? 13741418 : 13018487; + } + + @Override + @SideOnly(Side.CLIENT) + public int getFoliageColorAtPos(BlockPos pos) { + + double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D); + return noise < -0.1D ? 13741418 : 13018487; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/BiomePrairie.java b/src/main/java/appalachia/api/biome/BiomePrairie.java new file mode 100644 index 00000000..e26a78d6 --- /dev/null +++ b/src/main/java/appalachia/api/biome/BiomePrairie.java @@ -0,0 +1,80 @@ +package appalachia.api.biome; + +import java.util.Random; + +import net.minecraft.entity.passive.EntityCow; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.entity.passive.EntityRabbit; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeDecorator; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import net.minecraftforge.common.BiomeDictionary; + +import appalachia.api.biome.decorator.DecoratorPrairie; + +public class BiomePrairie extends AppalachiaBiome implements IAppalachiaBiome { + + public static BiomeDictionary.Type[] biomeTypes; + + public BiomePrairie(BiomeProperties props) { + + super(props); + topBlock = Blocks.GRASS.getDefaultState(); + fillerBlock = Blocks.DIRT.getDefaultState(); + theBiomeDecorator.treesPerChunk = 1; + + spawnableCreatureList.clear(); + spawnableCreatureList.add(new SpawnListEntry(EntitySheep.class, 60, 1, 5)); + spawnableCreatureList.add(new SpawnListEntry(EntityRabbit.class, 60, 1, 5)); + spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 60, 1, 5)); + spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 60, 1, 3)); + + biomeTypes = new BiomeDictionary.Type[]{BiomeDictionary.Type.PLAINS}; + } + + @Override + public BiomeDecorator createBiomeDecorator() { + + return new DecoratorPrairie(); + } + + @Override + public void decorate(World world, Random rand, BlockPos pos) { + + super.decorate(world, rand, pos); + } + + @Override + public WorldGenAbstractTree genBigTreeChance(Random rand) { + + return rand.nextInt(3) == 0 ? TREE_FEATURE : rand.nextInt(5) == 0 ? BIG_TREE_FEATURE : TREE_FEATURE; + } + +// @Override +// @SideOnly(Side.CLIENT) +// public int getSkyColorByTemp(float temp) +// { +// double noise = GRASS_COLOR_NOISE.getValue((double)temp * 0.0225D, (double)temp * 0.0225D); +// return noise < -0.7D ? 0xD4DB55 : (noise < -0.3D ? 0xBBDD54 : 0xA3E053); +// } + +// @Override +// @SideOnly(Side.CLIENT) +// public int getGrassColorAtPos(BlockPos pos) +// { +// double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D); +// return noise < -0.1D ? 13741418 : 13018487; +// } + +// @Override +// @SideOnly(Side.CLIENT) +// public int getFoliageColorAtPos(BlockPos pos) +// { +// double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D); +// return noise < -0.1D ? 13741418 : 13018487; +// } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/BiomeSmokyMountains.java b/src/main/java/appalachia/api/biome/BiomeSmokyMountains.java new file mode 100644 index 00000000..58fd28ba --- /dev/null +++ b/src/main/java/appalachia/api/biome/BiomeSmokyMountains.java @@ -0,0 +1,72 @@ +package appalachia.api.biome; + +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeDecorator; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.api.biome.decorator.DecoratorSmokyMountains; + +public class BiomeSmokyMountains extends AppalachiaBiome implements IAppalachiaBiome { + + public static BiomeDictionary.Type[] biomeTypes; + + public BiomeSmokyMountains(BiomeProperties props) { + + super(props); + topBlock = Blocks.GRASS.getDefaultState(); + fillerBlock = Blocks.DIRT.getDefaultState(); + theBiomeDecorator.treesPerChunk = 1; + + biomeTypes = new BiomeDictionary.Type[]{BiomeDictionary.Type.MOUNTAIN}; + } + + @Override + public BiomeDecorator createBiomeDecorator() { + + return new DecoratorSmokyMountains(); + } + + @Override + public void decorate(World world, Random rand, BlockPos pos) { + + super.decorate(world, rand, pos); + } + + @Override + public WorldGenAbstractTree genBigTreeChance(Random rand) { + + return rand.nextInt(3) == 0 ? TREE_FEATURE : rand.nextInt(5) == 0 ? BIG_TREE_FEATURE : TREE_FEATURE; + } + +// @Override +// @SideOnly(Side.CLIENT) +// public int getSkyColorByTemp(float temp) +// { +// double noise = GRASS_COLOR_NOISE.getValue((double)temp * 0.0225D, (double)temp * 0.0225D); +// return noise < -0.7D ? 0xD4DB55 : (noise < -0.3D ? 0xBBDD54 : 0xA3E053); +// } + + @Override + @SideOnly(Side.CLIENT) + public int getGrassColorAtPos(BlockPos pos) { + + double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D); + return noise < -0.1D ? 13741418 : 13018487; + } + + @Override + @SideOnly(Side.CLIENT) + public int getFoliageColorAtPos(BlockPos pos) { + + double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D); + return noise < -0.1D ? 13741418 : 13018487; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/IAppalachiaBiome.java b/src/main/java/appalachia/api/biome/IAppalachiaBiome.java new file mode 100644 index 00000000..10da41a8 --- /dev/null +++ b/src/main/java/appalachia/api/biome/IAppalachiaBiome.java @@ -0,0 +1,7 @@ +package appalachia.api.biome; + + +public interface IAppalachiaBiome { + + public void addTreesToBiome(); +} diff --git a/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidge.java b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidge.java new file mode 100644 index 00000000..ddffed53 --- /dev/null +++ b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidge.java @@ -0,0 +1,78 @@ +package appalachia.api.biome.blueridge; + +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeDecorator; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.api.AppalachiaBiomeTypes; +import appalachia.api.biome.AppalachiaBiome; +import appalachia.api.biome.IAppalachiaBiome; +import appalachia.entity.monster.EntityBlackBear; + +public abstract class BiomeBlueRidge extends AppalachiaBiome implements IAppalachiaBiome { + + public static BiomeDictionary.Type[] biomeTypes; + + public BiomeBlueRidge(BiomeProperties props) { + + super(props); + topBlock = Blocks.GRASS.getDefaultState(); + fillerBlock = Blocks.DIRT.getDefaultState(); + theBiomeDecorator.treesPerChunk = 10; + + this.spawnableCreatureList.add(new SpawnListEntry(EntityBlackBear.class, 7, 1, 2)); + + biomeTypes = new BiomeDictionary.Type[]{ + BiomeDictionary.Type.FOREST, + BiomeDictionary.Type.DENSE, + AppalachiaBiomeTypes.BLUERIDGE + }; + } + + @Override + public abstract BiomeDecorator createBiomeDecorator(); + + @Override + public void decorate(World world, Random rand, BlockPos pos) { + + super.decorate(world, rand, pos); + } + + @Override + public WorldGenAbstractTree genBigTreeChance(Random rand) { + + return rand.nextInt(3) == 0 ? TREE_FEATURE : rand.nextInt(5) == 0 ? BIG_TREE_FEATURE : TREE_FEATURE; + } + +// @Override +// @SideOnly(Side.CLIENT) +// public int getSkyColorByTemp(float temp) +// { +// return 0x347db0; +// } + + @Override + @SideOnly(Side.CLIENT) + public int getGrassColorAtPos(BlockPos pos) { + + double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D); + //return noise < -0.1D ? 0x9c752a : 0x967129; // Brown. + return noise < -0.1D ? 0x968c29 : 0x968129; + } + + @Override + @SideOnly(Side.CLIENT) + public int getFoliageColorAtPos(BlockPos pos) { + + double noise = GRASS_COLOR_NOISE.getValue((double)pos.getX() * 0.0225D, (double)pos.getZ() * 0.0225D); + return noise < -0.1D ? 0x968129 : 0x968c29; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeBeach.java b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeBeach.java new file mode 100644 index 00000000..69be6887 --- /dev/null +++ b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeBeach.java @@ -0,0 +1,30 @@ +package appalachia.api.biome.blueridge; + +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.BiomeDecorator; + +import net.minecraftforge.common.BiomeDictionary; + +import appalachia.api.AppalachiaBiomeTypes; +import appalachia.api.biome.IAppalachiaBiome; +import appalachia.api.biome.decorator.blueridge.DecoratorBlueRidgeBeach; + +public class BiomeBlueRidgeBeach extends BiomeBlueRidge implements IAppalachiaBiome { + + public BiomeBlueRidgeBeach(BiomeProperties props) { + + super(props); + + this.topBlock = Blocks.GRAVEL.getDefaultState(); + + biomeTypes = new BiomeDictionary.Type[]{ + BiomeDictionary.Type.BEACH, + AppalachiaBiomeTypes.BLUERIDGE + }; + } + + @Override + public BiomeDecorator createBiomeDecorator() { + return new DecoratorBlueRidgeBeach(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeForest.java b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeForest.java new file mode 100644 index 00000000..49933a77 --- /dev/null +++ b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeForest.java @@ -0,0 +1,28 @@ +package appalachia.api.biome.blueridge; + +import net.minecraft.world.biome.BiomeDecorator; + +import net.minecraftforge.common.BiomeDictionary; + +import appalachia.api.AppalachiaBiomeTypes; +import appalachia.api.biome.IAppalachiaBiome; +import appalachia.api.biome.decorator.blueridge.DecoratorBlueRidgeForest; + +public class BiomeBlueRidgeForest extends BiomeBlueRidge implements IAppalachiaBiome { + + public BiomeBlueRidgeForest(BiomeProperties props) { + + super(props); + + biomeTypes = new BiomeDictionary.Type[]{ + BiomeDictionary.Type.FOREST, + BiomeDictionary.Type.DENSE, + AppalachiaBiomeTypes.BLUERIDGE + }; + } + + @Override + public BiomeDecorator createBiomeDecorator() { + return new DecoratorBlueRidgeForest(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeHills.java b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeHills.java new file mode 100644 index 00000000..6e8814eb --- /dev/null +++ b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeHills.java @@ -0,0 +1,29 @@ +package appalachia.api.biome.blueridge; + +import net.minecraft.world.biome.BiomeDecorator; + +import net.minecraftforge.common.BiomeDictionary; + +import appalachia.api.AppalachiaBiomeTypes; +import appalachia.api.biome.IAppalachiaBiome; +import appalachia.api.biome.decorator.blueridge.DecoratorBlueRidgeHills; + +public class BiomeBlueRidgeHills extends BiomeBlueRidge implements IAppalachiaBiome { + + public BiomeBlueRidgeHills(BiomeProperties props) { + + super(props); + + biomeTypes = new BiomeDictionary.Type[]{ + BiomeDictionary.Type.FOREST, + BiomeDictionary.Type.DENSE, + BiomeDictionary.Type.HILLS, + AppalachiaBiomeTypes.BLUERIDGE + }; + } + + @Override + public BiomeDecorator createBiomeDecorator() { + return new DecoratorBlueRidgeHills(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeMountains.java b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeMountains.java new file mode 100644 index 00000000..447e221c --- /dev/null +++ b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeMountains.java @@ -0,0 +1,30 @@ +package appalachia.api.biome.blueridge; + +import net.minecraft.world.biome.BiomeDecorator; + +import net.minecraftforge.common.BiomeDictionary; + +import appalachia.api.AppalachiaBiomeTypes; +import appalachia.api.biome.IAppalachiaBiome; +import appalachia.api.biome.decorator.blueridge.DecoratorBlueRidgeMountains; + +public class BiomeBlueRidgeMountains extends BiomeBlueRidge implements IAppalachiaBiome { + + public BiomeBlueRidgeMountains(BiomeProperties props) { + + super(props); + + biomeTypes = new BiomeDictionary.Type[]{ + BiomeDictionary.Type.HILLS, + BiomeDictionary.Type.MOUNTAIN, + BiomeDictionary.Type.FOREST, + BiomeDictionary.Type.DENSE, + AppalachiaBiomeTypes.BLUERIDGE + }; + } + + @Override + public BiomeDecorator createBiomeDecorator() { + return new DecoratorBlueRidgeMountains(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeRiver.java b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeRiver.java new file mode 100644 index 00000000..cb8c3d1a --- /dev/null +++ b/src/main/java/appalachia/api/biome/blueridge/BiomeBlueRidgeRiver.java @@ -0,0 +1,28 @@ +package appalachia.api.biome.blueridge; + +import net.minecraft.world.biome.BiomeDecorator; + +import net.minecraftforge.common.BiomeDictionary; + +import appalachia.api.AppalachiaBiomeTypes; +import appalachia.api.biome.IAppalachiaBiome; +import appalachia.api.biome.decorator.blueridge.DecoratorBlueRidgeRiver; + +public class BiomeBlueRidgeRiver extends BiomeBlueRidge implements IAppalachiaBiome { + + public BiomeBlueRidgeRiver(BiomeProperties props) { + + super(props); + + biomeTypes = new BiomeDictionary.Type[]{ + BiomeDictionary.Type.RIVER, + BiomeDictionary.Type.WATER, + AppalachiaBiomeTypes.BLUERIDGE + }; + } + + @Override + public BiomeDecorator createBiomeDecorator() { + return new DecoratorBlueRidgeRiver(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/blueridge/autumn/BiomeBlueRidgeForestAutumn.java b/src/main/java/appalachia/api/biome/blueridge/autumn/BiomeBlueRidgeForestAutumn.java new file mode 100644 index 00000000..3d82b59b --- /dev/null +++ b/src/main/java/appalachia/api/biome/blueridge/autumn/BiomeBlueRidgeForestAutumn.java @@ -0,0 +1,41 @@ +package appalachia.api.biome.blueridge.autumn; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.biome.BiomeDecorator; + +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.api.AppalachiaBiomeTypes; +import appalachia.api.biome.IAppalachiaBiome; +import appalachia.api.biome.blueridge.BiomeBlueRidgeForest; +import appalachia.api.biome.decorator.blueridge.DecoratorBlueRidgeForestAutumn; + +public class BiomeBlueRidgeForestAutumn extends BiomeBlueRidgeForest implements IAppalachiaBiome { + + public BiomeBlueRidgeForestAutumn(BiomeProperties props) { + + super(props); + + biomeTypes = new BiomeDictionary.Type[]{ + BiomeDictionary.Type.FOREST, + BiomeDictionary.Type.DENSE, + AppalachiaBiomeTypes.AUTUMN, + AppalachiaBiomeTypes.BLUERIDGE + }; + } + + @Override + public BiomeDecorator createBiomeDecorator() { + return new DecoratorBlueRidgeForestAutumn(); + } + + @Override + @SideOnly(Side.CLIENT) + public int getFoliageColorAtPos(BlockPos pos) { + + int noise = (int) (simplex.noise(pos.getX()/16, pos.getZ()/16)*9+9); + return leafColours[noise]; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/blueridge/autumn/BiomeBlueRidgeHillsAutumn.java b/src/main/java/appalachia/api/biome/blueridge/autumn/BiomeBlueRidgeHillsAutumn.java new file mode 100644 index 00000000..ad8da32d --- /dev/null +++ b/src/main/java/appalachia/api/biome/blueridge/autumn/BiomeBlueRidgeHillsAutumn.java @@ -0,0 +1,42 @@ +package appalachia.api.biome.blueridge.autumn; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.biome.BiomeDecorator; + +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.api.AppalachiaBiomeTypes; +import appalachia.api.biome.IAppalachiaBiome; +import appalachia.api.biome.blueridge.BiomeBlueRidgeHills; +import appalachia.api.biome.decorator.blueridge.DecoratorBlueRidgeHillsAutumn; + +public class BiomeBlueRidgeHillsAutumn extends BiomeBlueRidgeHills implements IAppalachiaBiome { + + public BiomeBlueRidgeHillsAutumn(BiomeProperties props) { + + super(props); + + biomeTypes = new BiomeDictionary.Type[]{ + BiomeDictionary.Type.FOREST, + BiomeDictionary.Type.DENSE, + BiomeDictionary.Type.HILLS, + AppalachiaBiomeTypes.BLUERIDGE, + AppalachiaBiomeTypes.AUTUMN + }; + } + + @Override + public BiomeDecorator createBiomeDecorator() { + return new DecoratorBlueRidgeHillsAutumn(); + } + + @Override + @SideOnly(Side.CLIENT) + public int getFoliageColorAtPos(BlockPos pos) { + + int noise = (int) (simplex.noise(pos.getX()/16, pos.getZ()/16)*9+9); + return leafColours[noise]; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/blueridge/autumn/BiomeBlueRidgeMountainsAutumn.java b/src/main/java/appalachia/api/biome/blueridge/autumn/BiomeBlueRidgeMountainsAutumn.java new file mode 100644 index 00000000..ff80d157 --- /dev/null +++ b/src/main/java/appalachia/api/biome/blueridge/autumn/BiomeBlueRidgeMountainsAutumn.java @@ -0,0 +1,43 @@ +package appalachia.api.biome.blueridge.autumn; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.biome.BiomeDecorator; + +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.api.AppalachiaBiomeTypes; +import appalachia.api.biome.IAppalachiaBiome; +import appalachia.api.biome.blueridge.BiomeBlueRidgeMountains; +import appalachia.api.biome.decorator.blueridge.DecoratorBlueRidgeMountainsAutumn; + +public class BiomeBlueRidgeMountainsAutumn extends BiomeBlueRidgeMountains implements IAppalachiaBiome { + + public BiomeBlueRidgeMountainsAutumn(BiomeProperties props) { + + super(props); + + biomeTypes = new BiomeDictionary.Type[]{ + BiomeDictionary.Type.HILLS, + BiomeDictionary.Type.MOUNTAIN, + BiomeDictionary.Type.FOREST, + BiomeDictionary.Type.DENSE, + AppalachiaBiomeTypes.BLUERIDGE, + AppalachiaBiomeTypes.AUTUMN + }; + } + + @Override + public BiomeDecorator createBiomeDecorator() { + return new DecoratorBlueRidgeMountainsAutumn(); + } + + @Override + @SideOnly(Side.CLIENT) + public int getFoliageColorAtPos(BlockPos pos) { + + int noise = (int) (simplex.noise(pos.getX()/16, pos.getZ()/16)*9+9); + return leafColours[noise]; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/AppalachiaDecorator.java b/src/main/java/appalachia/api/biome/decorator/AppalachiaDecorator.java new file mode 100644 index 00000000..475ea9db --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/AppalachiaDecorator.java @@ -0,0 +1,338 @@ +package appalachia.api.biome.decorator; + +import java.util.Random; + +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockStone; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.biome.BiomeDecorator; +import net.minecraft.world.gen.ChunkProviderSettings; +import net.minecraft.world.gen.feature.*; + +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; +import net.minecraftforge.event.terraingen.TerrainGen; + +public class AppalachiaDecorator extends BiomeDecorator { + + public boolean generatePonds; + + public AppalachiaDecorator() { + + this.generateLakes = false; + this.generatePonds = false; + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + if (this.decorating) { + throw new RuntimeException("Already decorating"); + } + else { + this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(worldIn.getWorldInfo().getGeneratorOptions()).build(); + this.chunkPos = pos; + this.dirtGen = new WorldGenMinable(Blocks.DIRT.getDefaultState(), this.chunkProviderSettings.dirtSize); + this.gravelGen = new WorldGenMinable(Blocks.GRAVEL.getDefaultState(), this.chunkProviderSettings.gravelSize); + this.graniteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), this.chunkProviderSettings.graniteSize); + this.dioriteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), this.chunkProviderSettings.dioriteSize); + this.andesiteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), this.chunkProviderSettings.andesiteSize); + this.coalGen = new WorldGenMinable(Blocks.COAL_ORE.getDefaultState(), this.chunkProviderSettings.coalSize); + this.ironGen = new WorldGenMinable(Blocks.IRON_ORE.getDefaultState(), this.chunkProviderSettings.ironSize); + this.goldGen = new WorldGenMinable(Blocks.GOLD_ORE.getDefaultState(), this.chunkProviderSettings.goldSize); + this.redstoneGen = new WorldGenMinable(Blocks.REDSTONE_ORE.getDefaultState(), this.chunkProviderSettings.redstoneSize); + this.diamondGen = new WorldGenMinable(Blocks.DIAMOND_ORE.getDefaultState(), this.chunkProviderSettings.diamondSize); + this.lapisGen = new WorldGenMinable(Blocks.LAPIS_ORE.getDefaultState(), this.chunkProviderSettings.lapisSize); + this.generateOres(worldIn, random); + this.decorating = false; + } + } + + protected void generateSand(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.SAND)) { + for (int i = 0; i < this.sandPerChunk2; ++i) { + int j = random.nextInt(16) + 8; + int k = random.nextInt(16) + 8; + this.sandGen.generate(worldIn, random, worldIn.getTopSolidOrLiquidBlock(this.chunkPos.add(j, 0, k))); + } + } + } + + protected void generateClay(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.CLAY)) { + for (int i1 = 0; i1 < this.clayPerChunk; ++i1) { + int l1 = random.nextInt(16) + 8; + int i6 = random.nextInt(16) + 8; + this.clayGen.generate(worldIn, random, worldIn.getTopSolidOrLiquidBlock(this.chunkPos.add(l1, 0, i6))); + } + } + } + + protected void generateGravelAsSand(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.SAND_PASS2)) { + for (int j1 = 0; j1 < this.sandPerChunk; ++j1) { + int i2 = random.nextInt(16) + 8; + int j6 = random.nextInt(16) + 8; + this.gravelAsSandGen.generate(worldIn, random, worldIn.getTopSolidOrLiquidBlock(this.chunkPos.add(i2, 0, j6))); + } + } + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + int k1 = this.treesPerChunk; + + if (random.nextFloat() < this.field_189870_A) { + ++k1; + } + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.TREE)) { + for (int j2 = 0; j2 < k1; ++j2) { + int k6 = random.nextInt(16) + 8; + int l = random.nextInt(16) + 8; + WorldGenAbstractTree worldgenabstracttree = biomeIn.genBigTreeChance(random); + worldgenabstracttree.setDecorationDefaults(); + BlockPos blockpos = worldIn.getHeight(this.chunkPos.add(k6, 0, l)); + + if (worldgenabstracttree.generate(worldIn, random, blockpos)) { + worldgenabstracttree.generateSaplings(worldIn, random, blockpos); + } + } + } + } + + protected void generateBigMushrooms(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM)) { + for (int k2 = 0; k2 < this.bigMushroomsPerChunk; ++k2) { + int l6 = random.nextInt(16) + 8; + int k10 = random.nextInt(16) + 8; + this.bigMushroomGen.generate(worldIn, random, worldIn.getHeight(this.chunkPos.add(l6, 0, k10))); + } + } + } + + protected void generateFlowers(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.FLOWERS)) { + for (int l2 = 0; l2 < this.flowersPerChunk; ++l2) { + int i7 = random.nextInt(16) + 8; + int l10 = random.nextInt(16) + 8; + int j14 = worldIn.getHeight(this.chunkPos.add(i7, 0, l10)).getY() + 32; + + if (j14 > 0) { + int k17 = random.nextInt(j14); + BlockPos blockpos1 = this.chunkPos.add(i7, k17, l10); + BlockFlower.EnumFlowerType blockflower$enumflowertype = biomeIn.pickRandomFlower(random, blockpos1); + BlockFlower blockflower = blockflower$enumflowertype.getBlockType().getBlock(); + + if (blockflower.getDefaultState().getMaterial() != Material.AIR) { + this.yellowFlowerGen.setGeneratedBlock(blockflower, blockflower$enumflowertype); + this.yellowFlowerGen.generate(worldIn, random, blockpos1); + } + } + } + } + } + + protected void generateGrass(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.GRASS)) { + for (int i3 = 0; i3 < this.grassPerChunk; ++i3) { + int j7 = random.nextInt(16) + 8; + int i11 = random.nextInt(16) + 8; + int k14 = worldIn.getHeight(this.chunkPos.add(j7, 0, i11)).getY() * 2; + + if (k14 > 0) { + int l17 = random.nextInt(k14); + biomeIn.getRandomWorldGenForGrass(random).generate(worldIn, random, this.chunkPos.add(j7, l17, i11)); + } + } + } + } + + protected void generateDeadBushes(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH)) { + for (int j3 = 0; j3 < this.deadBushPerChunk; ++j3) { + int k7 = random.nextInt(16) + 8; + int j11 = random.nextInt(16) + 8; + int l14 = worldIn.getHeight(this.chunkPos.add(k7, 0, j11)).getY() * 2; + + if (l14 > 0) { + int i18 = random.nextInt(l14); + (new WorldGenDeadBush()).generate(worldIn, random, this.chunkPos.add(k7, i18, j11)); + } + } + } + } + + protected void generateLilypads(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.LILYPAD)) { + for (int k3 = 0; k3 < this.waterlilyPerChunk; ++k3) { + int l7 = random.nextInt(16) + 8; + int k11 = random.nextInt(16) + 8; + int i15 = worldIn.getHeight(this.chunkPos.add(l7, 0, k11)).getY() * 2; + + if (i15 > 0) { + int j18 = random.nextInt(i15); + BlockPos blockpos4; + BlockPos blockpos7; + + for (blockpos4 = this.chunkPos.add(l7, j18, k11); blockpos4.getY() > 0; blockpos4 = blockpos7) { + blockpos7 = blockpos4.down(); + + if (!worldIn.isAirBlock(blockpos7)) { + break; + } + } + + this.waterlilyGen.generate(worldIn, random, blockpos4); + } + } + } + } + + protected void generateMushrooms(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.SHROOM)) { + for (int l3 = 0; l3 < this.mushroomsPerChunk; ++l3) { + if (random.nextInt(4) == 0) { + int i8 = random.nextInt(16) + 8; + int l11 = random.nextInt(16) + 8; + BlockPos blockpos2 = worldIn.getHeight(this.chunkPos.add(i8, 0, l11)); + this.mushroomBrownGen.generate(worldIn, random, blockpos2); + } + + if (random.nextInt(8) == 0) { + int j8 = random.nextInt(16) + 8; + int i12 = random.nextInt(16) + 8; + int j15 = worldIn.getHeight(this.chunkPos.add(j8, 0, i12)).getY() * 2; + + if (j15 > 0) { + int k18 = random.nextInt(j15); + BlockPos blockpos5 = this.chunkPos.add(j8, k18, i12); + this.mushroomRedGen.generate(worldIn, random, blockpos5); + } + } + } + + if (random.nextInt(4) == 0) { + int i4 = random.nextInt(16) + 8; + int k8 = random.nextInt(16) + 8; + int j12 = worldIn.getHeight(this.chunkPos.add(i4, 0, k8)).getY() * 2; + + if (j12 > 0) { + int k15 = random.nextInt(j12); + this.mushroomBrownGen.generate(worldIn, random, this.chunkPos.add(i4, k15, k8)); + } + } + + if (random.nextInt(8) == 0) { + int j4 = random.nextInt(16) + 8; + int l8 = random.nextInt(16) + 8; + int k12 = worldIn.getHeight(this.chunkPos.add(j4, 0, l8)).getY() * 2; + + if (k12 > 0) { + int l15 = random.nextInt(k12); + this.mushroomRedGen.generate(worldIn, random, this.chunkPos.add(j4, l15, l8)); + } + } + } + } + + protected void generateReeds(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.REED)) { + for (int k4 = 0; k4 < this.reedsPerChunk; ++k4) { + int i9 = random.nextInt(16) + 8; + int l12 = random.nextInt(16) + 8; + int i16 = worldIn.getHeight(this.chunkPos.add(i9, 0, l12)).getY() * 2; + + if (i16 > 0) { + int l18 = random.nextInt(i16); + this.reedGen.generate(worldIn, random, this.chunkPos.add(i9, l18, l12)); + } + } + + for (int l4 = 0; l4 < 10; ++l4) { + int j9 = random.nextInt(16) + 8; + int i13 = random.nextInt(16) + 8; + int j16 = worldIn.getHeight(this.chunkPos.add(j9, 0, i13)).getY() * 2; + + if (j16 > 0) { + int i19 = random.nextInt(j16); + this.reedGen.generate(worldIn, random, this.chunkPos.add(j9, i19, i13)); + } + } + } + } + + protected void generatePumpkins(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.PUMPKIN)) { + if (random.nextInt(32) == 0) { + int i5 = random.nextInt(16) + 8; + int k9 = random.nextInt(16) + 8; + int j13 = worldIn.getHeight(this.chunkPos.add(i5, 0, k9)).getY() * 2; + + if (j13 > 0) { + int k16 = random.nextInt(j13); + (new WorldGenPumpkin()).generate(worldIn, random, this.chunkPos.add(i5, k16, k9)); + } + } + } + } + + protected void generateCacti(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.CACTUS)) { + for (int j5 = 0; j5 < this.cactiPerChunk; ++j5) { + int l9 = random.nextInt(16) + 8; + int k13 = random.nextInt(16) + 8; + int l16 = worldIn.getHeight(this.chunkPos.add(l9, 0, k13)).getY() * 2; + + if (l16 > 0) { + int j19 = random.nextInt(l16); + this.cactusGen.generate(worldIn, random, this.chunkPos.add(l9, j19, k13)); + } + } + } + } + + protected void generateLakes(Biome biomeIn, World worldIn, Random random) { + + if (this.generateLakes) { + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.LAKE_WATER)) { + for (int k5 = 0; k5 < 50; ++k5) { + int i10 = random.nextInt(16) + 8; + int l13 = random.nextInt(16) + 8; + int i17 = random.nextInt(248) + 8; + + if (i17 > 0) { + int k19 = random.nextInt(i17); + BlockPos blockpos6 = this.chunkPos.add(i10, k19, l13); + (new WorldGenLiquids(Blocks.FLOWING_WATER)).generate(worldIn, random, blockpos6); + } + } + } + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.LAKE_LAVA)) { + for (int l5 = 0; l5 < 20; ++l5) { + int j10 = random.nextInt(16) + 8; + int i14 = random.nextInt(16) + 8; + int j17 = random.nextInt(random.nextInt(random.nextInt(240) + 8) + 8); + BlockPos blockpos3 = this.chunkPos.add(j10, j17, i14); + (new WorldGenLiquids(Blocks.FLOWING_LAVA)).generate(worldIn, random, blockpos3); + } + } + } + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/DecoratorAppalachianMountains.java b/src/main/java/appalachia/api/biome/decorator/DecoratorAppalachianMountains.java new file mode 100644 index 00000000..d5db5e8e --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/DecoratorAppalachianMountains.java @@ -0,0 +1,50 @@ +package appalachia.api.biome.decorator; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; +import net.minecraftforge.event.terraingen.TerrainGen; + +import appalachia.rtg.world.gen.feature.tree.rtg.TreeQuercusRobur; + +public class DecoratorAppalachianMountains extends AppalachiaDecorator { + + public DecoratorAppalachianMountains() { + + super(); + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldIn, random, chunkPos)); + super.decorate(worldIn, random, biome, pos); + //this.generateTrees(biome, worldIn, random); + //this.generateFlowers(biome, worldIn, random); + //this.generateGrass(biome, worldIn, random); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldIn, random, chunkPos)); + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.TREE)) { + + TreeQuercusRobur tree = new TreeQuercusRobur(false); + + for (int j2 = 0; j2 < treesPerChunk; ++j2) { + + int k6 = random.nextInt(16) + 8; + int l = random.nextInt(16) + 8; + + BlockPos blockpos = worldIn.getHeight(this.chunkPos.add(k6, 0, l)); + + tree.generate(worldIn, random, blockpos); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/DecoratorPrairie.java b/src/main/java/appalachia/api/biome/decorator/DecoratorPrairie.java new file mode 100644 index 00000000..0c21603f --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/DecoratorPrairie.java @@ -0,0 +1,50 @@ +package appalachia.api.biome.decorator; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; +import net.minecraftforge.event.terraingen.TerrainGen; + +import appalachia.rtg.world.gen.feature.tree.rtg.TreeQuercusRobur; + +public class DecoratorPrairie extends AppalachiaDecorator { + + public DecoratorPrairie() { + + super(); + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldIn, random, chunkPos)); + super.decorate(worldIn, random, biome, pos); + //this.generateTrees(biome, worldIn, random); + //this.generateFlowers(biome, worldIn, random); + //this.generateGrass(biome, worldIn, random); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldIn, random, chunkPos)); + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.TREE)) { + + TreeQuercusRobur tree = new TreeQuercusRobur(false); + + for (int j2 = 0; j2 < treesPerChunk; ++j2) { + + int k6 = random.nextInt(16) + 8; + int l = random.nextInt(16) + 8; + + BlockPos blockpos = worldIn.getHeight(this.chunkPos.add(k6, 0, l)); + + tree.generate(worldIn, random, blockpos); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/DecoratorSmokyMountains.java b/src/main/java/appalachia/api/biome/decorator/DecoratorSmokyMountains.java new file mode 100644 index 00000000..9c7162eb --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/DecoratorSmokyMountains.java @@ -0,0 +1,50 @@ +package appalachia.api.biome.decorator; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; +import net.minecraftforge.event.terraingen.TerrainGen; + +import appalachia.rtg.world.gen.feature.tree.rtg.TreeQuercusRobur; + +public class DecoratorSmokyMountains extends AppalachiaDecorator { + + public DecoratorSmokyMountains() { + + super(); + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldIn, random, chunkPos)); + super.decorate(worldIn, random, biome, pos); + //this.generateTrees(biome, worldIn, random); + //this.generateFlowers(biome, worldIn, random); + //this.generateGrass(biome, worldIn, random); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldIn, random, chunkPos)); + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + if (TerrainGen.decorate(worldIn, random, chunkPos, DecorateBiomeEvent.Decorate.EventType.TREE)) { + + TreeQuercusRobur tree = new TreeQuercusRobur(false); + + for (int j2 = 0; j2 < treesPerChunk; ++j2) { + + int k6 = random.nextInt(16) + 8; + int l = random.nextInt(16) + 8; + + BlockPos blockpos = worldIn.getHeight(this.chunkPos.add(k6, 0, l)); + + tree.generate(worldIn, random, blockpos); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeBeach.java b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeBeach.java new file mode 100644 index 00000000..1d2599cd --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeBeach.java @@ -0,0 +1,35 @@ +package appalachia.api.biome.decorator.blueridge; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; + +import appalachia.api.biome.decorator.AppalachiaDecorator; + +public class DecoratorBlueRidgeBeach extends AppalachiaDecorator { + + public DecoratorBlueRidgeBeach() { + + super(); + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldIn, random, chunkPos)); + super.decorate(worldIn, random, biome, pos); + //this.generateTrees(biome, worldIn, random); + //this.generateFlowers(biome, worldIn, random); + //this.generateGrass(biome, worldIn, random); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldIn, random, chunkPos)); + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeForest.java b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeForest.java new file mode 100644 index 00000000..8c2dbc5a --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeForest.java @@ -0,0 +1,35 @@ +package appalachia.api.biome.decorator.blueridge; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; + +import appalachia.api.biome.decorator.AppalachiaDecorator; + +public class DecoratorBlueRidgeForest extends AppalachiaDecorator { + + public DecoratorBlueRidgeForest() { + + super(); + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldIn, random, chunkPos)); + super.decorate(worldIn, random, biome, pos); + //this.generateTrees(biome, worldIn, random); + //this.generateFlowers(biome, worldIn, random); + //this.generateGrass(biome, worldIn, random); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldIn, random, chunkPos)); + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeForestAutumn.java b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeForestAutumn.java new file mode 100644 index 00000000..6c516b38 --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeForestAutumn.java @@ -0,0 +1,36 @@ +package appalachia.api.biome.decorator.blueridge; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; + +import appalachia.api.biome.decorator.AppalachiaDecorator; + +public class DecoratorBlueRidgeForestAutumn extends AppalachiaDecorator { + + + public DecoratorBlueRidgeForestAutumn() { + + super(); + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldIn, random, pos)); + super.decorate(worldIn, random, biome, pos); + //this.generateTrees(biome, worldIn, random); + //this.generateFlowers(biome, worldIn, random); + //this.generateGrass(biome, worldIn, random); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldIn, random, pos)); + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeHills.java b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeHills.java new file mode 100644 index 00000000..d0018fac --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeHills.java @@ -0,0 +1,35 @@ +package appalachia.api.biome.decorator.blueridge; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; + +import appalachia.api.biome.decorator.AppalachiaDecorator; + +public class DecoratorBlueRidgeHills extends AppalachiaDecorator { + + public DecoratorBlueRidgeHills() { + + super(); + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldIn, random, chunkPos)); + super.decorate(worldIn, random, biome, pos); + //this.generateTrees(biome, worldIn, random); + //this.generateFlowers(biome, worldIn, random); + //this.generateGrass(biome, worldIn, random); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldIn, random, chunkPos)); + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeHillsAutumn.java b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeHillsAutumn.java new file mode 100644 index 00000000..35f7f688 --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeHillsAutumn.java @@ -0,0 +1,35 @@ +package appalachia.api.biome.decorator.blueridge; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; + +import appalachia.api.biome.decorator.AppalachiaDecorator; + +public class DecoratorBlueRidgeHillsAutumn extends AppalachiaDecorator { + + public DecoratorBlueRidgeHillsAutumn() { + + super(); + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldIn, random, chunkPos)); + super.decorate(worldIn, random, biome, pos); + //this.generateTrees(biome, worldIn, random); + //this.generateFlowers(biome, worldIn, random); + //this.generateGrass(biome, worldIn, random); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldIn, random, chunkPos)); + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeMountains.java b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeMountains.java new file mode 100644 index 00000000..2d8e217e --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeMountains.java @@ -0,0 +1,35 @@ +package appalachia.api.biome.decorator.blueridge; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; + +import appalachia.api.biome.decorator.AppalachiaDecorator; + +public class DecoratorBlueRidgeMountains extends AppalachiaDecorator { + + public DecoratorBlueRidgeMountains() { + + super(); + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldIn, random, chunkPos)); + super.decorate(worldIn, random, biome, pos); + //this.generateTrees(biome, worldIn, random); + //this.generateFlowers(biome, worldIn, random); + //this.generateGrass(biome, worldIn, random); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldIn, random, chunkPos)); + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeMountainsAutumn.java b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeMountainsAutumn.java new file mode 100644 index 00000000..e21f8fe3 --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeMountainsAutumn.java @@ -0,0 +1,35 @@ +package appalachia.api.biome.decorator.blueridge; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; + +import appalachia.api.biome.decorator.AppalachiaDecorator; + +public class DecoratorBlueRidgeMountainsAutumn extends AppalachiaDecorator { + + public DecoratorBlueRidgeMountainsAutumn() { + + super(); + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldIn, random, chunkPos)); + super.decorate(worldIn, random, biome, pos); + //this.generateTrees(biome, worldIn, random); + //this.generateFlowers(biome, worldIn, random); + //this.generateGrass(biome, worldIn, random); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldIn, random, chunkPos)); + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeRiver.java b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeRiver.java new file mode 100644 index 00000000..7fbf6b53 --- /dev/null +++ b/src/main/java/appalachia/api/biome/decorator/blueridge/DecoratorBlueRidgeRiver.java @@ -0,0 +1,35 @@ +package appalachia.api.biome.decorator.blueridge; + +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; + +import appalachia.api.biome.decorator.AppalachiaDecorator; + +public class DecoratorBlueRidgeRiver extends AppalachiaDecorator { + + public DecoratorBlueRidgeRiver() { + + super(); + } + + @Override + public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(worldIn, random, chunkPos)); + super.decorate(worldIn, random, biome, pos); + //this.generateTrees(biome, worldIn, random); + //this.generateFlowers(biome, worldIn, random); + //this.generateGrass(biome, worldIn, random); + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(worldIn, random, chunkPos)); + } + + protected void generateTrees(Biome biomeIn, World worldIn, Random random) { + + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/api/block/IAppalachiaBlockLeavesFallen.java b/src/main/java/appalachia/api/block/IAppalachiaBlockLeavesFallen.java new file mode 100644 index 00000000..f3ceba1f --- /dev/null +++ b/src/main/java/appalachia/api/block/IAppalachiaBlockLeavesFallen.java @@ -0,0 +1,9 @@ +package appalachia.api.block; + + +import net.minecraft.block.properties.PropertyInteger; + +public interface IAppalachiaBlockLeavesFallen { + + public static final PropertyInteger LAYERS = PropertyInteger.create("layers", 1, 8); +} diff --git a/src/main/java/appalachia/api/util/Simplex.java b/src/main/java/appalachia/api/util/Simplex.java new file mode 100644 index 00000000..7e2281f7 --- /dev/null +++ b/src/main/java/appalachia/api/util/Simplex.java @@ -0,0 +1,391 @@ +package appalachia.api.util; + +import java.util.Random; + +/* + * A speed-improved simplex noise algorithm for 2D, 3D and 4D in Java. + * + * Based on example code by Stefan Gustavson (stegu@itn.liu.se). + * Optimisations by Peter Eastman (peastman@drizzle.stanford.edu). + * Better rank ordering method by Stefan Gustavson in 2012. + * + * This could be speeded up even further, but it's useful as it is. + * + * Version 2012-03-09 + * + * This code was placed in the public domain by its original author, + * Stefan Gustavson. You may use it as you see fit, but + * attribution is appreciated. + * + */ + +public class Simplex { // Simplex noise in 2D, 3D and 4D + + + + public static int RANDOMSEED=0; + private static int NUMBEROFSWAPS=400; + + private static Grad grad3[] = {new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0), + new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1), + new Grad(0,1,1),new Grad(0,-1,1),new Grad(0,1,-1),new Grad(0,-1,-1)}; + + private static Grad grad4[]= {new Grad(0,1,1,1),new Grad(0,1,1,-1),new Grad(0,1,-1,1),new Grad(0,1,-1,-1), + new Grad(0,-1,1,1),new Grad(0,-1,1,-1),new Grad(0,-1,-1,1),new Grad(0,-1,-1,-1), + new Grad(1,0,1,1),new Grad(1,0,1,-1),new Grad(1,0,-1,1),new Grad(1,0,-1,-1), + new Grad(-1,0,1,1),new Grad(-1,0,1,-1),new Grad(-1,0,-1,1),new Grad(-1,0,-1,-1), + new Grad(1,1,0,1),new Grad(1,1,0,-1),new Grad(1,-1,0,1),new Grad(1,-1,0,-1), + new Grad(-1,1,0,1),new Grad(-1,1,0,-1),new Grad(-1,-1,0,1),new Grad(-1,-1,0,-1), + new Grad(1,1,1,0),new Grad(1,1,-1,0),new Grad(1,-1,1,0),new Grad(1,-1,-1,0), + new Grad(-1,1,1,0),new Grad(-1,1,-1,0),new Grad(-1,-1,1,0),new Grad(-1,-1,-1,0)}; + + private static short p_supply[] = {151,160,137,91,90,15, //this contains all the numbers between 0 and 255, these are put in a random order depending upon the seed + 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, + 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, + 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, + 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244, + 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196, + 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123, + 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42, + 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9, + 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228, + 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107, + 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, + 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180}; + + private short p[]=new short[p_supply.length]; + + // To remove the need for index wrapping, double the permutation table length + private short perm[] = new short[512]; + private short permMod12[] = new short[512]; + public Simplex(int seed) { + p=p_supply.clone(); + + if (seed==RANDOMSEED){ + Random rand=new Random(); + seed=rand.nextInt(); + } + + //the random for the swaps + Random rand=new Random(seed); + + //the seed determines the swaps that occur between the default order and the order we're actually going to use + for(int i=0;iy0) {i1=1; j1=0;} // lower triangle, XY order: (0,0)->(1,0)->(1,1) + else {i1=0; j1=1;} // upper triangle, YX order: (0,0)->(0,1)->(1,1) + // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and + // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where + // c = (3-sqrt(3))/6 + double x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords + double y1 = y0 - j1 + G2; + double x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords + double y2 = y0 - 1.0 + 2.0 * G2; + // Work out the hashed gradient indices of the three simplex corners + int ii = i & 255; + int jj = j & 255; + int gi0 = permMod12[ii+perm[jj]]; + int gi1 = permMod12[ii+i1+perm[jj+j1]]; + int gi2 = permMod12[ii+1+perm[jj+1]]; + // Calculate the contribution from the three corners + double t0 = 0.5 - x0*x0-y0*y0; + if(t0<0) n0 = 0.0; + else { + t0 *= t0; + n0 = t0 * t0 * dot(grad3[gi0], x0, y0); // (x,y) of grad3 used for 2D gradient + } + double t1 = 0.5 - x1*x1-y1*y1; + if(t1<0) n1 = 0.0; + else { + t1 *= t1; + n1 = t1 * t1 * dot(grad3[gi1], x1, y1); + } + double t2 = 0.5 - x2*x2-y2*y2; + if(t2<0) n2 = 0.0; + else { + t2 *= t2; + n2 = t2 * t2 * dot(grad3[gi2], x2, y2); + } + // Add contributions from each corner to get the final noise value. + // The result is scaled to return values in the interval [-1,1]. + return 70.0 * (n0 + n1 + n2); + } + + + // 3D simplex noise + public double noise(double xin, double yin, double zin) { + double n0, n1, n2, n3; // Noise contributions from the four corners + // Skew the input space to determine which simplex cell we're in + double s = (xin+yin+zin)*F3; // Very nice and simple skew factor for 3D + int i = fastfloor(xin+s); + int j = fastfloor(yin+s); + int k = fastfloor(zin+s); + double t = (i+j+k)*G3; + double X0 = i-t; // Unskew the cell origin back to (x,y,z) space + double Y0 = j-t; + double Z0 = k-t; + double x0 = xin-X0; // The x,y,z distances from the cell origin + double y0 = yin-Y0; + double z0 = zin-Z0; + // For the 3D case, the simplex shape is a slightly irregular tetrahedron. + // Determine which simplex we are in. + int i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords + int i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords + if(x0>=y0) { + if(y0>=z0) + { i1=1; j1=0; k1=0; i2=1; j2=1; k2=0; } // X Y Z order + else if(x0>=z0) { i1=1; j1=0; k1=0; i2=1; j2=0; k2=1; } // X Z Y order + else { i1=0; j1=0; k1=1; i2=1; j2=0; k2=1; } // Z X Y order + } + else { // x0 y0) rankx++; else ranky++; + if(x0 > z0) rankx++; else rankz++; + if(x0 > w0) rankx++; else rankw++; + if(y0 > z0) ranky++; else rankz++; + if(y0 > w0) ranky++; else rankw++; + if(z0 > w0) rankz++; else rankw++; + int i1, j1, k1, l1; // The integer offsets for the second simplex corner + int i2, j2, k2, l2; // The integer offsets for the third simplex corner + int i3, j3, k3, l3; // The integer offsets for the fourth simplex corner + // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order. + // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0; + j1 = ranky >= 3 ? 1 : 0; + k1 = rankz >= 3 ? 1 : 0; + l1 = rankw >= 3 ? 1 : 0; + // Rank 2 denotes the second largest coordinate. + i2 = rankx >= 2 ? 1 : 0; + j2 = ranky >= 2 ? 1 : 0; + k2 = rankz >= 2 ? 1 : 0; + l2 = rankw >= 2 ? 1 : 0; + // Rank 1 denotes the second smallest coordinate. + i3 = rankx >= 1 ? 1 : 0; + j3 = ranky >= 1 ? 1 : 0; + k3 = rankz >= 1 ? 1 : 0; + l3 = rankw >= 1 ? 1 : 0; + // The fifth corner has all coordinate offsets = 1, so no need to compute that. + double x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords + double y1 = y0 - j1 + G4; + double z1 = z0 - k1 + G4; + double w1 = w0 - l1 + G4; + double x2 = x0 - i2 + 2.0*G4; // Offsets for third corner in (x,y,z,w) coords + double y2 = y0 - j2 + 2.0*G4; + double z2 = z0 - k2 + 2.0*G4; + double w2 = w0 - l2 + 2.0*G4; + double x3 = x0 - i3 + 3.0*G4; // Offsets for fourth corner in (x,y,z,w) coords + double y3 = y0 - j3 + 3.0*G4; + double z3 = z0 - k3 + 3.0*G4; + double w3 = w0 - l3 + 3.0*G4; + double x4 = x0 - 1.0 + 4.0*G4; // Offsets for last corner in (x,y,z,w) coords + double y4 = y0 - 1.0 + 4.0*G4; + double z4 = z0 - 1.0 + 4.0*G4; + double w4 = w0 - 1.0 + 4.0*G4; + // Work out the hashed gradient indices of the five simplex corners + int ii = i & 255; + int jj = j & 255; + int kk = k & 255; + int ll = l & 255; + int gi0 = perm[ii+perm[jj+perm[kk+perm[ll]]]] % 32; + int gi1 = perm[ii+i1+perm[jj+j1+perm[kk+k1+perm[ll+l1]]]] % 32; + int gi2 = perm[ii+i2+perm[jj+j2+perm[kk+k2+perm[ll+l2]]]] % 32; + int gi3 = perm[ii+i3+perm[jj+j3+perm[kk+k3+perm[ll+l3]]]] % 32; + int gi4 = perm[ii+1+perm[jj+1+perm[kk+1+perm[ll+1]]]] % 32; + // Calculate the contribution from the five corners + double t0 = 0.6 - x0*x0 - y0*y0 - z0*z0 - w0*w0; + if(t0<0) n0 = 0.0; + else { + t0 *= t0; + n0 = t0 * t0 * dot(grad4[gi0], x0, y0, z0, w0); + } + double t1 = 0.6 - x1*x1 - y1*y1 - z1*z1 - w1*w1; + if(t1<0) n1 = 0.0; + else { + t1 *= t1; + n1 = t1 * t1 * dot(grad4[gi1], x1, y1, z1, w1); + } + double t2 = 0.6 - x2*x2 - y2*y2 - z2*z2 - w2*w2; + if(t2<0) n2 = 0.0; + else { + t2 *= t2; + n2 = t2 * t2 * dot(grad4[gi2], x2, y2, z2, w2); + } + double t3 = 0.6 - x3*x3 - y3*y3 - z3*z3 - w3*w3; + if(t3<0) n3 = 0.0; + else { + t3 *= t3; + n3 = t3 * t3 * dot(grad4[gi3], x3, y3, z3, w3); + } + double t4 = 0.6 - x4*x4 - y4*y4 - z4*z4 - w4*w4; + if(t4<0) n4 = 0.0; + else { + t4 *= t4; + n4 = t4 * t4 * dot(grad4[gi4], x4, y4, z4, w4); + } + // Sum up and scale the result to cover the range [-1,1] + return 27.0 * (n0 + n1 + n2 + n3 + n4); + } + + // Inner class to speed upp gradient computations + // (array access is a lot slower than member access) + private static class Grad + { + double x, y, z, w; + + Grad(double x, double y, double z) + { + this.x = x; + this.y = y; + this.z = z; + } + + Grad(double x, double y, double z, double w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + } + +} \ No newline at end of file diff --git a/src/main/java/appalachia/biome/AppalachiaBiomeManager.java b/src/main/java/appalachia/biome/AppalachiaBiomeManager.java new file mode 100644 index 00000000..bf7aba5d --- /dev/null +++ b/src/main/java/appalachia/biome/AppalachiaBiomeManager.java @@ -0,0 +1,254 @@ +package appalachia.biome; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.common.BiomeManager; +import net.minecraftforge.fml.common.registry.GameRegistry; + +import appalachia.api.biome.*; +import appalachia.api.biome.blueridge.*; +import appalachia.api.biome.blueridge.autumn.BiomeBlueRidgeForestAutumn; +import appalachia.api.biome.blueridge.autumn.BiomeBlueRidgeHillsAutumn; +import appalachia.api.biome.blueridge.autumn.BiomeBlueRidgeMountainsAutumn; +import appalachia.config.ConfigAppalachia; +import appalachia.util.BiomeUtils; +import appalachia.util.Logger; +import static appalachia.api.AppalachiaBiomes.*; +import static appalachia.reference.ModInfo.MOD_ID; + +public class AppalachiaBiomeManager { + + + public AppalachiaBiomeManager() { + + } + + public static void registerBiomes() { + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Appalachian Mountains + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +// appalachianMountains = new BiomeAppalachianMountains(AppalachiaBiomeProps.APPALACHIAN_MOUNTAINS.getProps()); +// registerBiomeWithTypes( +// appalachianMountains, +// "appalachianmountains", +// ConfigAppalachia.biomeWeight_AppalachianMountains, +// BiomeManager.BiomeType.COOL, +// BiomeAppalachianMountains.biomeTypes +// ); +// BiomeManager.addSpawnBiome(appalachianMountains); +// BiomeManager.addVillageBiome(appalachianMountains, true); +// BiomeManager.addStrongholdBiome(appalachianMountains); +// Biome.EXPLORATION_BIOMES_LIST.add(appalachianMountains); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Blue Ridge Forest + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + blueRidgeForest = new BiomeBlueRidgeForest(AppalachiaBiomeProps.BLUE_RIDGE_FOREST.getProps()); + registerBiomeWithTypes( + blueRidgeForest, + "blueridgeforest", + ConfigAppalachia.biomeWeight_BlueRidgeForest, + BiomeManager.BiomeType.COOL, + BiomeBlueRidgeForest.biomeTypes + ); + BiomeManager.addSpawnBiome(blueRidgeForest); + BiomeManager.addVillageBiome(blueRidgeForest, true); + BiomeManager.addStrongholdBiome(blueRidgeForest); + Biome.EXPLORATION_BIOMES_LIST.add(blueRidgeForest); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Blue Ridge Hills + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + blueRidgeHills = new BiomeBlueRidgeHills(AppalachiaBiomeProps.BLUE_RIDGE_HILLS.getProps()); + registerBiomeWithTypes( + blueRidgeHills, + "blueridgehills", + ConfigAppalachia.biomeWeight_BlueRidgeHills, + BiomeManager.BiomeType.COOL, + BiomeBlueRidgeHills.biomeTypes + ); + BiomeManager.addSpawnBiome(blueRidgeHills); + BiomeManager.addVillageBiome(blueRidgeHills, true); + BiomeManager.addStrongholdBiome(blueRidgeHills); + Biome.EXPLORATION_BIOMES_LIST.add(blueRidgeHills); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Blue Ridge Mountains + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + blueRidgeMountains = new BiomeBlueRidgeMountains(AppalachiaBiomeProps.BLUE_RIDGE_MOUNTAINS.getProps()); + registerBiomeWithTypes( + blueRidgeMountains, + "blueridgemountains", + ConfigAppalachia.biomeWeight_BlueRidgeMountains, + BiomeManager.BiomeType.COOL, + BiomeBlueRidgeMountains.biomeTypes + ); + BiomeManager.addSpawnBiome(blueRidgeMountains); + BiomeManager.addVillageBiome(blueRidgeMountains, true); + BiomeManager.addStrongholdBiome(blueRidgeMountains); + Biome.EXPLORATION_BIOMES_LIST.add(blueRidgeMountains); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Autumn Blue Ridge Forest + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + blueRidgeForestAutumn = new BiomeBlueRidgeForestAutumn(AppalachiaBiomeProps.BLUE_RIDGE_FOREST_AUTUMN.getProps()); + registerBiomeWithTypes( + blueRidgeForestAutumn, + "blueridgeforestautumn", + ConfigAppalachia.biomeWeight_BlueRidgeForestAutumn, + BiomeManager.BiomeType.COOL, + BiomeBlueRidgeForestAutumn.biomeTypes + ); + BiomeManager.addSpawnBiome(blueRidgeForestAutumn); + BiomeManager.addVillageBiome(blueRidgeForestAutumn, true); + BiomeManager.addStrongholdBiome(blueRidgeForestAutumn); + Biome.EXPLORATION_BIOMES_LIST.add(blueRidgeForestAutumn); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Autumn Blue Ridge Hills + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + blueRidgeHillsAutumn = new BiomeBlueRidgeHillsAutumn(AppalachiaBiomeProps.BLUE_RIDGE_HILLS_AUTUMN.getProps()); + registerBiomeWithTypes( + blueRidgeHillsAutumn, + "blueridgehillsautumn", + ConfigAppalachia.biomeWeight_BlueRidgeHillsAutumn, + BiomeManager.BiomeType.COOL, + BiomeBlueRidgeHillsAutumn.biomeTypes + ); + BiomeManager.addSpawnBiome(blueRidgeHillsAutumn); + BiomeManager.addVillageBiome(blueRidgeHillsAutumn, true); + BiomeManager.addStrongholdBiome(blueRidgeHillsAutumn); + Biome.EXPLORATION_BIOMES_LIST.add(blueRidgeHillsAutumn); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Autumn Blue Ridge Mountains + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + blueRidgeMountainsAutumn = new BiomeBlueRidgeMountainsAutumn(AppalachiaBiomeProps.BLUE_RIDGE_MOUNTAINS_AUTUMN.getProps()); + registerBiomeWithTypes( + blueRidgeMountainsAutumn, + "blueridgemountainsautumn", + ConfigAppalachia.biomeWeight_BlueRidgeMountainsAutumn, + BiomeManager.BiomeType.COOL, + BiomeBlueRidgeMountainsAutumn.biomeTypes + ); + BiomeManager.addSpawnBiome(blueRidgeMountainsAutumn); + BiomeManager.addVillageBiome(blueRidgeMountainsAutumn, true); + BiomeManager.addStrongholdBiome(blueRidgeMountainsAutumn); + Biome.EXPLORATION_BIOMES_LIST.add(blueRidgeMountainsAutumn); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Blue Ridge Beach + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + blueRidgeBeach = new BiomeBlueRidgeBeach(AppalachiaBiomeProps.BLUE_RIDGE_BEACH.getProps()); + registerBiomeWithTypes( + blueRidgeBeach, + "blueridgebeach", + ConfigAppalachia.biomeWeight_BlueRidgeBeach, + BiomeManager.BiomeType.COOL, + BiomeBlueRidgeBeach.biomeTypes + ); + BiomeManager.addSpawnBiome(blueRidgeBeach); + Biome.EXPLORATION_BIOMES_LIST.add(blueRidgeForest); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Blue Ridge River + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + blueRidgeRiver = new BiomeBlueRidgeRiver(AppalachiaBiomeProps.BLUE_RIDGE_RIVER.getProps()); + registerBiomeWithTypes( + blueRidgeRiver, + "blueridgeriver", + ConfigAppalachia.biomeWeight_BlueRidgeRiver, + BiomeManager.BiomeType.COOL, + BiomeBlueRidgeRiver.biomeTypes + ); + Biome.EXPLORATION_BIOMES_LIST.add(blueRidgeRiver); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Prairie + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +// prairie = new BiomePrairie(AppalachiaBiomeProps.PRAIRIE.getProps()); +// registerBiomeWithTypes( +// prairie, +// "prairie", +// ConfigAppalachia.biomeWeight_Prairie, +// BiomeManager.BiomeType.WARM, +// BiomePrairie.biomeTypes +// ); +// BiomeManager.addSpawnBiome(prairie); +// BiomeManager.addVillageBiome(prairie, true); +// BiomeManager.addStrongholdBiome(prairie); +// Biome.EXPLORATION_BIOMES_LIST.add(prairie); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Smoky Mountains + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +// smokyMountains = new BiomeSmokyMountains(AppalachiaBiomeProps.SMOKY_MOUNTAINS.getProps()); +// registerBiomeWithTypes( +// smokyMountains, +// "smokymountains", +// ConfigAppalachia.biomeWeight_SmokyMountains, +// BiomeManager.BiomeType.COOL, +// BiomeSmokyMountains.biomeTypes +// ); +// BiomeManager.addSpawnBiome(smokyMountains); +// BiomeManager.addVillageBiome(smokyMountains, true); +// BiomeManager.addStrongholdBiome(smokyMountains); +// Biome.EXPLORATION_BIOMES_LIST.add(smokyMountains); + } + + public static void doBiomeCheck() { + + Biome[] b = BiomeUtils.getRegisteredBiomes(); + + for (int i = 0; i < 256; i++) { + if (b[i] != null) { + Biome biome = b[i]; + int biomeId = BiomeUtils.getId(b[i]); + String biomeName = BiomeUtils.getName(b[i]); + String biomeClass = b[i].getBiomeClass().getName(); + + Logger.info("Biome (" + biomeId + ") " + biomeName + " from " + biomeClass); + + switch (biomeId) { + + case 8: // The Nether + case 9: // The End + case 127: // The Void + + // Do nothing. + break; + + default: + + if (biome instanceof AppalachiaBiome) { + + Logger.info("SUCCESS! %s (%d) was found.", biome.getBiomeName(), BiomeUtils.getId(biome)); + } + + break; + } + } + } + } + + private static void registerBiomeWithTypes(Biome biome, String name, int weight, BiomeManager.BiomeType btype, BiomeDictionary.Type... types) { + + GameRegistry.register(biome.setRegistryName(new ResourceLocation(MOD_ID, name))); + BiomeDictionary.registerBiomeType(biome, types); + BiomeManager.addBiome(btype, new BiomeManager.BiomeEntry(biome, weight)); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/BlockManager.java b/src/main/java/appalachia/block/BlockManager.java new file mode 100644 index 00000000..da76f917 --- /dev/null +++ b/src/main/java/appalachia/block/BlockManager.java @@ -0,0 +1,516 @@ +package appalachia.block; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockSapling; +import net.minecraft.client.renderer.block.statemap.StateMap; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.fencegates.*; +import appalachia.block.fences.*; +import appalachia.block.leaves.AppalachiaBlockLeaves; +import appalachia.block.leaves.BlockLeavesAutumnOrange; +import appalachia.block.leaves.BlockLeavesAutumnRed; +import appalachia.block.leaves.BlockLeavesAutumnYellow; +import appalachia.block.leaves.fallen.*; +import appalachia.block.logs.*; +import appalachia.block.planks.*; +import appalachia.block.saplings.AppalachiaBlockSapling; +import appalachia.block.saplings.BlockSaplingQuercusRobur; +import appalachia.block.slabs.*; +import appalachia.block.stairs.*; +import appalachia.item.ItemManager; +import appalachia.item.leaves.fallen.AppalachiaItemLeavesFallen; +import appalachia.item.slabs.AppalachiaItemSlab; + +public class BlockManager { + + public static ArrayList appalachiaBlocks = new ArrayList() { + + }; + public static ArrayList appalachiaLogs = new ArrayList() { + + }; + public static ArrayList appalachiaPlanks = new ArrayList() { + + }; + public static ArrayList appalachiaSlabs = new ArrayList() { + + }; + public static ArrayList appalachiaStairs = new ArrayList() { + + }; + public static ArrayList appalachiaFences = new ArrayList() { + + }; + public static ArrayList appalachiaFenceGates = new ArrayList() { + + }; + public static ArrayList appalachiaLeaves = new ArrayList() { + + }; + public static ArrayList appalachiaLeavesFallen = new ArrayList() { + + }; + public static ArrayList appalachiaSaplings = new ArrayList() { + + }; + + public static void registerBlocks() { + + //Logs. + AppalachiaBlocks.log_autumn_grey = new BlockLogAutumnGrey(); + + AppalachiaBlocks.log_blueridge_01 = new BlockLogBlueRidge01(); + AppalachiaBlocks.log_blueridge_02 = new BlockLogBlueRidge02(); + AppalachiaBlocks.log_blueridge_03 = new BlockLogBlueRidge03(); + + addLogs(); + + //Planks. + AppalachiaBlocks.planks_autumn_grey = new BlockPlanksAutumnGrey(); + + AppalachiaBlocks.planks_blueridge_01 = new BlockPlanksBlueRidge01(); + AppalachiaBlocks.planks_blueridge_02 = new BlockPlanksBlueRidge02(); + AppalachiaBlocks.planks_blueridge_03 = new BlockPlanksBlueRidge03(); + + addPlanks(); + + //Slabs. + AppalachiaBlocks.slab_autumn_grey = new BlockSlabAutumnGrey(); + + AppalachiaBlocks.slab_blueridge_01 = new BlockSlabBlueRidge01(); + AppalachiaBlocks.slab_blueridge_02 = new BlockSlabBlueRidge02(); + AppalachiaBlocks.slab_blueridge_03 = new BlockSlabBlueRidge03(); + + addSlabs(); + + //Stairs. + AppalachiaBlocks.stairs_autumn_grey = new BlockStairsAutumnGrey(); + + AppalachiaBlocks.stairs_blueridge_01 = new BlockStairsBlueRidge01(); + AppalachiaBlocks.stairs_blueridge_02 = new BlockStairsBlueRidge02(); + AppalachiaBlocks.stairs_blueridge_03 = new BlockStairsBlueRidge03(); + + addStairs(); + + //Fences. + AppalachiaBlocks.fence_autumn_grey = new BlockFenceAutumnGrey(); + + AppalachiaBlocks.fence_blueridge_01 = new BlockFenceBlueRidge01(); + AppalachiaBlocks.fence_blueridge_02 = new BlockFenceBlueRidge02(); + AppalachiaBlocks.fence_blueridge_03 = new BlockFenceBlueRidge03(); + + addFences(); + + //Fence gates. + AppalachiaBlocks.fence_gate_autumn_grey = new BlockFenceGateAutumnGrey(); + + AppalachiaBlocks.fence_gate_blueridge_01 = new BlockFenceGateBlueRidge01(); + AppalachiaBlocks.fence_gate_blueridge_02 = new BlockFenceGateBlueRidge02(); + AppalachiaBlocks.fence_gate_blueridge_03 = new BlockFenceGateBlueRidge03(); + + addFenceGates(); + + //Leaves. + AppalachiaBlocks.leaves_autumn_orange = new BlockLeavesAutumnOrange(); + AppalachiaBlocks.leaves_autumn_red = new BlockLeavesAutumnRed(); + AppalachiaBlocks.leaves_autumn_yellow = new BlockLeavesAutumnYellow(); + addLeaves(); + + //Fallen leaves. + AppalachiaBlocks.leaves_oak_fallen = new BlockLeavesOakFallen(); + AppalachiaBlocks.leaves_autumn_orange_fallen = new BlockLeavesAutumnOrangeFallen(); + AppalachiaBlocks.leaves_autumn_red_fallen = new BlockLeavesAutumnRedFallen(); + AppalachiaBlocks.leaves_autumn_yellow_fallen = new BlockLeavesAutumnYellowFallen(); + addFallenLeaves(); + + //Saplings. + AppalachiaBlocks.sapling_quercus_robur = new BlockSaplingQuercusRobur(); + addSaplings(); + + addAppalachiaBlocks(); + + registerBlocksAndItemBlocks(); + registerOres(); + setFireInfo(); + } + + /* + * ALPHABETICAL ORDER MATTERS WHEN ADDING INDIVIDUAL BLOCKS TO THE BLOCK LISTS!!! + * For example... + * addShapedRecipes() loops through the planks and uses the same index to get() the associated slabs, stairs, fences, and fence gates. + * addShapelessRecipes() loops through the logs and uses the same index to get() the associated planks. + */ + + private static void addLogs() { + + appalachiaLogs.add(AppalachiaBlocks.log_autumn_grey); + + appalachiaLogs.add(AppalachiaBlocks.log_blueridge_01); + appalachiaLogs.add(AppalachiaBlocks.log_blueridge_02); + appalachiaLogs.add(AppalachiaBlocks.log_blueridge_03); + } + + private static void addPlanks() { + + appalachiaPlanks.add(AppalachiaBlocks.planks_autumn_grey); + + appalachiaPlanks.add(AppalachiaBlocks.planks_blueridge_01); + appalachiaPlanks.add(AppalachiaBlocks.planks_blueridge_02); + appalachiaPlanks.add(AppalachiaBlocks.planks_blueridge_03); + } + + private static void addSlabs() { + + appalachiaSlabs.add(AppalachiaBlocks.slab_autumn_grey); + + appalachiaSlabs.add(AppalachiaBlocks.slab_blueridge_01); + appalachiaSlabs.add(AppalachiaBlocks.slab_blueridge_02); + appalachiaSlabs.add(AppalachiaBlocks.slab_blueridge_03); + } + + private static void addStairs() { + + appalachiaStairs.add(AppalachiaBlocks.stairs_autumn_grey); + + appalachiaStairs.add(AppalachiaBlocks.stairs_blueridge_01); + appalachiaStairs.add(AppalachiaBlocks.stairs_blueridge_02); + appalachiaStairs.add(AppalachiaBlocks.stairs_blueridge_03); + } + + private static void addFences() { + + appalachiaFences.add(AppalachiaBlocks.fence_autumn_grey); + + appalachiaFences.add(AppalachiaBlocks.fence_blueridge_01); + appalachiaFences.add(AppalachiaBlocks.fence_blueridge_02); + appalachiaFences.add(AppalachiaBlocks.fence_blueridge_03); + } + + private static void addFenceGates() { + + appalachiaFenceGates.add(AppalachiaBlocks.fence_gate_autumn_grey); + + appalachiaFenceGates.add(AppalachiaBlocks.fence_gate_blueridge_01); + appalachiaFenceGates.add(AppalachiaBlocks.fence_gate_blueridge_02); + appalachiaFenceGates.add(AppalachiaBlocks.fence_gate_blueridge_03); + } + + private static void addLeaves() { + + appalachiaLeaves.add(AppalachiaBlocks.leaves_autumn_orange); + appalachiaLeaves.add(AppalachiaBlocks.leaves_autumn_red); + appalachiaLeaves.add(AppalachiaBlocks.leaves_autumn_yellow); + } + + private static void addFallenLeaves() { + + appalachiaLeavesFallen.add(AppalachiaBlocks.leaves_oak_fallen); + appalachiaLeavesFallen.add(AppalachiaBlocks.leaves_autumn_orange_fallen); + appalachiaLeavesFallen.add(AppalachiaBlocks.leaves_autumn_red_fallen); + appalachiaLeavesFallen.add(AppalachiaBlocks.leaves_autumn_yellow_fallen); + } + + private static void addSaplings() { + + appalachiaSaplings.add(AppalachiaBlocks.sapling_quercus_robur); + } + + private static void addAppalachiaBlocks() { + + for (int i = 0; i < appalachiaLogs.size(); i++) { + appalachiaBlocks.add(appalachiaLogs.get(i)); + } + + for (int i = 0; i < appalachiaPlanks.size(); i++) { + appalachiaBlocks.add(appalachiaPlanks.get(i)); + } + + for (int i = 0; i < appalachiaSlabs.size(); i++) { + appalachiaBlocks.add(appalachiaSlabs.get(i)); + } + + for (int i = 0; i < appalachiaStairs.size(); i++) { + appalachiaBlocks.add(appalachiaStairs.get(i)); + } + + for (int i = 0; i < appalachiaFences.size(); i++) { + appalachiaBlocks.add(appalachiaFences.get(i)); + } + + for (int i = 0; i < appalachiaFenceGates.size(); i++) { + appalachiaBlocks.add(appalachiaFenceGates.get(i)); + } + + for (int i = 0; i < appalachiaLeaves.size(); i++) { + appalachiaBlocks.add(appalachiaLeaves.get(i)); + } + + for (int i = 0; i < appalachiaLeavesFallen.size(); i++) { + appalachiaBlocks.add(appalachiaLeavesFallen.get(i)); + } + + for (int i = 0; i < appalachiaSaplings.size(); i++) { + appalachiaBlocks.add(appalachiaSaplings.get(i)); + } + } + + private static void registerBlocksAndItemBlocks() { + + for (int i = 0; i < appalachiaLogs.size(); i++) { + AppalachiaBlockLog block = (AppalachiaBlockLog)appalachiaLogs.get(i); + block.setRegistryName(block.registryName()); + GameRegistry.register(block); + GameRegistry.register(new ItemBlock(block), block.getRegistryName()); + } + + for (int i = 0; i < appalachiaPlanks.size(); i++) { + AppalachiaBlockPlanks block = (AppalachiaBlockPlanks)appalachiaPlanks.get(i); + block.setRegistryName(block.registryName()); + GameRegistry.register(block); + GameRegistry.register(new ItemBlock(block), block.getRegistryName()); + } + + for (int i = 0; i < appalachiaSlabs.size(); i++) { + AppalachiaBlockSlab block = (AppalachiaBlockSlab)appalachiaSlabs.get(i); + AppalachiaBlockPlanks planks = (AppalachiaBlockPlanks)appalachiaPlanks.get(i); + block.setRegistryName(block.registryName()); + GameRegistry.register(block); + GameRegistry.register(new AppalachiaItemSlab(block, planks.getDefaultState()), block.getRegistryName()); + } + + for (int i = 0; i < appalachiaStairs.size(); i++) { + AppalachiaBlockStairs block = (AppalachiaBlockStairs)appalachiaStairs.get(i); + block.setRegistryName(block.registryName()); + GameRegistry.register(block); + GameRegistry.register(new ItemBlock(block), block.getRegistryName()); + } + + for (int i = 0; i < appalachiaFences.size(); i++) { + AppalachiaBlockFence block = (AppalachiaBlockFence)appalachiaFences.get(i); + block.setRegistryName(block.registryName()); + GameRegistry.register(block); + GameRegistry.register(new ItemBlock(block), block.getRegistryName()); + } + + for (int i = 0; i < appalachiaFenceGates.size(); i++) { + AppalachiaBlockFenceGate block = (AppalachiaBlockFenceGate)appalachiaFenceGates.get(i); + block.setRegistryName(block.registryName()); + GameRegistry.register(block); + GameRegistry.register(new ItemBlock(block), block.getRegistryName()); + } + + for (int i = 0; i < appalachiaLeaves.size(); i++) { + AppalachiaBlockLeaves block = (AppalachiaBlockLeaves)appalachiaLeaves.get(i); + block.setRegistryName(block.registryName()); + GameRegistry.register(block); + GameRegistry.register(new ItemBlock(block), block.getRegistryName()); + } + + for (int i = 0; i < appalachiaLeavesFallen.size(); i++) { + AppalachiaBlockLeavesFallen block = (AppalachiaBlockLeavesFallen)appalachiaLeavesFallen.get(i); + block.setRegistryName(block.registryName()); + GameRegistry.register(block); + GameRegistry.register(new AppalachiaItemLeavesFallen(block), block.getRegistryName()); + } + + for (int i = 0; i < appalachiaSaplings.size(); i++) { + AppalachiaBlockSapling block = (AppalachiaBlockSapling)appalachiaSaplings.get(i); + block.setRegistryName(block.registryName()); + GameRegistry.register(block); + GameRegistry.register(new ItemBlock(block), block.getRegistryName()); + } + } + + private static void registerOres() { + + for (int i = 0; i < appalachiaLogs.size(); i++) { + OreDictionary.registerOre("logWood", new ItemStack(appalachiaLogs.get(i), 1, OreDictionary.WILDCARD_VALUE)); + } + + for (int i = 0; i < appalachiaPlanks.size(); i++) { + OreDictionary.registerOre("plankWood", new ItemStack(appalachiaPlanks.get(i), 1, OreDictionary.WILDCARD_VALUE)); + } + + for (int i = 0; i < appalachiaSlabs.size(); i++) { + OreDictionary.registerOre("slabWood", new ItemStack(appalachiaSlabs.get(i), 1, OreDictionary.WILDCARD_VALUE)); + } + + for (int i = 0; i < appalachiaStairs.size(); i++) { + OreDictionary.registerOre("stairWood", new ItemStack(appalachiaStairs.get(i), 1, OreDictionary.WILDCARD_VALUE)); + } + + for (int i = 0; i < appalachiaFences.size(); i++) { + OreDictionary.registerOre("fenceWood", new ItemStack(appalachiaFences.get(i), 1, OreDictionary.WILDCARD_VALUE)); + } + + for (int i = 0; i < appalachiaFenceGates.size(); i++) { + OreDictionary.registerOre("fenceGateWood", new ItemStack(appalachiaFenceGates.get(i), 1, OreDictionary.WILDCARD_VALUE)); + } + + for (int i = 0; i < appalachiaLeaves.size(); i++) { + OreDictionary.registerOre("treeLeaves", new ItemStack(appalachiaLeaves.get(i), 1, OreDictionary.WILDCARD_VALUE)); + } + + for (int i = 0; i < appalachiaLeavesFallen.size(); i++) { + OreDictionary.registerOre("treeLeavesFallen", new ItemStack(appalachiaLeavesFallen.get(i), 1, OreDictionary.WILDCARD_VALUE)); + } + + for (int i = 0; i < appalachiaSaplings.size(); i++) { + OreDictionary.registerOre("treeSapling", new ItemStack(appalachiaSaplings.get(i), 1, OreDictionary.WILDCARD_VALUE)); + } + } + + private static void setFireInfo() { + + for (int i = 0; i < appalachiaLogs.size(); i++) { + Blocks.FIRE.setFireInfo(appalachiaLogs.get(i), 5, 5); + } + + for (int i = 0; i < appalachiaPlanks.size(); i++) { + Blocks.FIRE.setFireInfo(appalachiaPlanks.get(i), 5, 20); + } + + for (int i = 0; i < appalachiaSlabs.size(); i++) { + Blocks.FIRE.setFireInfo(appalachiaSlabs.get(i), 5, 20); + } + + for (int i = 0; i < appalachiaStairs.size(); i++) { + Blocks.FIRE.setFireInfo(appalachiaStairs.get(i), 5, 20); + } + + for (int i = 0; i < appalachiaFences.size(); i++) { + Blocks.FIRE.setFireInfo(appalachiaFences.get(i), 5, 20); + } + + for (int i = 0; i < appalachiaFenceGates.size(); i++) { + Blocks.FIRE.setFireInfo(appalachiaFenceGates.get(i), 5, 20); + } + + for (int i = 0; i < appalachiaLeaves.size(); i++) { + Blocks.FIRE.setFireInfo(appalachiaLeaves.get(i), 30, 60); + } + + for (int i = 0; i < appalachiaLeavesFallen.size(); i++) { + Blocks.FIRE.setFireInfo(appalachiaLeavesFallen.get(i), 30, 60); + } + + for (int i = 0; i < appalachiaSaplings.size(); i++) { + Blocks.FIRE.setFireInfo(appalachiaSaplings.get(i), 20, 60); + } + } + + public static void addRecipes() { + + addShapedRecipes(); + addShapelessRecipes(); + addSmeltingRecipes(); + } + + private static void addShapedRecipes() { + + for (int i = 0; i < appalachiaPlanks.size(); i++) { + + GameRegistry.addRecipe(new ItemStack(appalachiaSlabs.get(i), 6), "###", '#', appalachiaPlanks.get(i)); + GameRegistry.addRecipe(new ItemStack(appalachiaStairs.get(i), 4), " #", " ##", "###", '#', appalachiaPlanks.get(i)); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(appalachiaFences.get(i), 3), "#S#", "#S#", 'S', "stickWood", '#', appalachiaPlanks.get(i))); + GameRegistry.addRecipe(new ShapedOreRecipe(appalachiaFenceGates.get(i), "S#S", "S#S", 'S', "stickWood", '#', appalachiaPlanks.get(i))); + } + } + + private static void addShapelessRecipes() { + + for (int i = 0; i < appalachiaLogs.size(); i++) { + GameRegistry.addShapelessRecipe(new ItemStack(appalachiaPlanks.get(i), 4), new ItemStack(appalachiaLogs.get(i), 1, OreDictionary.WILDCARD_VALUE)); + } + + for (int i = 0; i < appalachiaSaplings.size(); i++) { + GameRegistry.addShapelessRecipe(new ItemStack(Items.STICK), new ItemStack(appalachiaSaplings.get(i))); + } + } + + private static void addSmeltingRecipes() { + + for (int i = 0; i < appalachiaLogs.size(); i++) { + GameRegistry.addSmelting(appalachiaLogs.get(i), new ItemStack(Items.COAL, 1, 1), 0.15F); + } + } + + @SideOnly(Side.CLIENT) + public static void registerModels() { + + for (int i = 0; i < appalachiaLogs.size(); i++) { + registerModel(appalachiaLogs.get(i)); + ModelLoader.setCustomStateMapper(appalachiaLogs.get(i), new StateMap.Builder().ignore(AppalachiaBlockLog.VARIANT).build()); + } + + for (int i = 0; i < appalachiaPlanks.size(); i++) { + registerModel(appalachiaPlanks.get(i)); + ModelLoader.setCustomStateMapper(appalachiaPlanks.get(i), new StateMap.Builder().ignore(AppalachiaBlockPlanks.DOUBLE).build()); + } + + for (int i = 0; i < appalachiaSlabs.size(); i++) { + registerModel(appalachiaSlabs.get(i)); + } + + for (int i = 0; i < appalachiaStairs.size(); i++) { + registerModel(appalachiaStairs.get(i)); + } + + for (int i = 0; i < appalachiaFences.size(); i++) { + registerModel(appalachiaFences.get(i)); + } + + for (int i = 0; i < appalachiaFenceGates.size(); i++) { + registerModel(appalachiaFenceGates.get(i)); + ModelLoader.setCustomStateMapper(appalachiaFenceGates.get(i), new StateMap.Builder().ignore(AppalachiaBlockFenceGate.POWERED).build()); + } + + for (int i = 0; i < appalachiaLeaves.size(); i++) { + registerModel(appalachiaLeaves.get(i)); + ModelLoader.setCustomStateMapper(appalachiaLeaves.get(i), new StateMap.Builder().ignore(BlockLeaves.DECAYABLE, BlockLeaves.CHECK_DECAY).build()); + } + + for (int i = 0; i < appalachiaLeavesFallen.size(); i++) { + registerModel(appalachiaLeavesFallen.get(i)); + } + + for (int i = 0; i < appalachiaSaplings.size(); i++) { + registerModel(appalachiaSaplings.get(i)); + ModelLoader.setCustomStateMapper(appalachiaSaplings.get(i), new StateMap.Builder().ignore(BlockSapling.TYPE, BlockSapling.STAGE).build()); + } + } + + @SideOnly(Side.CLIENT) + private static void registerModel(Block block, String modelName) { + + ItemManager.registerModel(Item.getItemFromBlock(block), modelName); + } + + @SideOnly(Side.CLIENT) + private static void registerModel(Block block) { + + ItemManager.registerModel(Item.getItemFromBlock(block)); + } + + @SideOnly(Side.CLIENT) + private static void registerModelWithMeta(Block block, String... modelName) { + + ItemManager.registerModelWithMeta(Item.getItemFromBlock(block), modelName); + } +} diff --git a/src/main/java/appalachia/block/IAppalachiaBlock.java b/src/main/java/appalachia/block/IAppalachiaBlock.java new file mode 100644 index 00000000..fa242671 --- /dev/null +++ b/src/main/java/appalachia/block/IAppalachiaBlock.java @@ -0,0 +1,7 @@ +package appalachia.block; + + +public interface IAppalachiaBlock { + + public String registryName(); +} diff --git a/src/main/java/appalachia/block/fencegates/AppalachiaBlockFenceGate.java b/src/main/java/appalachia/block/fencegates/AppalachiaBlockFenceGate.java new file mode 100644 index 00000000..7156da91 --- /dev/null +++ b/src/main/java/appalachia/block/fencegates/AppalachiaBlockFenceGate.java @@ -0,0 +1,31 @@ +package appalachia.block.fencegates; + +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.SoundType; + +import appalachia.block.IAppalachiaBlock; +import appalachia.gui.AppalachiaTabs; + +public class AppalachiaBlockFenceGate extends BlockFenceGate implements IAppalachiaBlock { + + private String slug; + + public AppalachiaBlockFenceGate(String unlocalizedName) { + + super(BlockPlanks.EnumType.BIRCH); + this.setUnlocalizedName(unlocalizedName); + this.setHardness(1.75F); + this.setResistance(4.75F); + this.setSoundType(SoundType.WOOD); + this.setHarvestLevel("axe", 0); + this.setCreativeTab(AppalachiaTabs.tabBlock); + this.slug = unlocalizedName; + } + + @Override + public String registryName() { + + return String.join("_", this.slug.split("\\.")); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/fencegates/BlockFenceGateAutumnGrey.java b/src/main/java/appalachia/block/fencegates/BlockFenceGateAutumnGrey.java new file mode 100644 index 00000000..55177eb4 --- /dev/null +++ b/src/main/java/appalachia/block/fencegates/BlockFenceGateAutumnGrey.java @@ -0,0 +1,17 @@ +package appalachia.block.fencegates; + +import appalachia.block.IAppalachiaBlock; + +public class BlockFenceGateAutumnGrey extends AppalachiaBlockFenceGate implements IAppalachiaBlock { + + public BlockFenceGateAutumnGrey() { + + super("fence.gate.autumn.grey"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/fencegates/BlockFenceGateBlueRidge01.java b/src/main/java/appalachia/block/fencegates/BlockFenceGateBlueRidge01.java new file mode 100644 index 00000000..b8ee28d7 --- /dev/null +++ b/src/main/java/appalachia/block/fencegates/BlockFenceGateBlueRidge01.java @@ -0,0 +1,17 @@ +package appalachia.block.fencegates; + +import appalachia.block.IAppalachiaBlock; + +public class BlockFenceGateBlueRidge01 extends AppalachiaBlockFenceGate implements IAppalachiaBlock { + + public BlockFenceGateBlueRidge01() { + + super("fence.gate.blueridge.01"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/fencegates/BlockFenceGateBlueRidge02.java b/src/main/java/appalachia/block/fencegates/BlockFenceGateBlueRidge02.java new file mode 100644 index 00000000..aaa549c5 --- /dev/null +++ b/src/main/java/appalachia/block/fencegates/BlockFenceGateBlueRidge02.java @@ -0,0 +1,17 @@ +package appalachia.block.fencegates; + +import appalachia.block.IAppalachiaBlock; + +public class BlockFenceGateBlueRidge02 extends AppalachiaBlockFenceGate implements IAppalachiaBlock { + + public BlockFenceGateBlueRidge02() { + + super("fence.gate.blueridge.02"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/fencegates/BlockFenceGateBlueRidge03.java b/src/main/java/appalachia/block/fencegates/BlockFenceGateBlueRidge03.java new file mode 100644 index 00000000..369dd248 --- /dev/null +++ b/src/main/java/appalachia/block/fencegates/BlockFenceGateBlueRidge03.java @@ -0,0 +1,17 @@ +package appalachia.block.fencegates; + +import appalachia.block.IAppalachiaBlock; + +public class BlockFenceGateBlueRidge03 extends AppalachiaBlockFenceGate implements IAppalachiaBlock { + + public BlockFenceGateBlueRidge03() { + + super("fence.gate.blueridge.03"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/fences/AppalachiaBlockFence.java b/src/main/java/appalachia/block/fences/AppalachiaBlockFence.java new file mode 100644 index 00000000..0adc8631 --- /dev/null +++ b/src/main/java/appalachia/block/fences/AppalachiaBlockFence.java @@ -0,0 +1,32 @@ +package appalachia.block.fences; + +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; + +import appalachia.block.IAppalachiaBlock; +import appalachia.gui.AppalachiaTabs; + +public class AppalachiaBlockFence extends BlockFence implements IAppalachiaBlock { + + private String slug; + + public AppalachiaBlockFence(String unlocalizedName) { + + super(Material.WOOD, BlockPlanks.EnumType.BIRCH.getMapColor()); + this.setUnlocalizedName(unlocalizedName); + this.setHardness(1.75F); + this.setResistance(4.75F); + this.setSoundType(SoundType.WOOD); + this.setHarvestLevel("axe", 0); + this.setCreativeTab(AppalachiaTabs.tabBlock); + this.slug = unlocalizedName; + } + + @Override + public String registryName() { + + return String.join("_", this.slug.split("\\.")); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/fences/BlockFenceAutumnGrey.java b/src/main/java/appalachia/block/fences/BlockFenceAutumnGrey.java new file mode 100644 index 00000000..0ab28cc7 --- /dev/null +++ b/src/main/java/appalachia/block/fences/BlockFenceAutumnGrey.java @@ -0,0 +1,17 @@ +package appalachia.block.fences; + +import appalachia.block.IAppalachiaBlock; + +public class BlockFenceAutumnGrey extends AppalachiaBlockFence implements IAppalachiaBlock { + + public BlockFenceAutumnGrey() { + + super("fence.autumn.grey"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/fences/BlockFenceBlueRidge01.java b/src/main/java/appalachia/block/fences/BlockFenceBlueRidge01.java new file mode 100644 index 00000000..ce687730 --- /dev/null +++ b/src/main/java/appalachia/block/fences/BlockFenceBlueRidge01.java @@ -0,0 +1,17 @@ +package appalachia.block.fences; + +import appalachia.block.IAppalachiaBlock; + +public class BlockFenceBlueRidge01 extends AppalachiaBlockFence implements IAppalachiaBlock { + + public BlockFenceBlueRidge01() { + + super("fence.blueridge.01"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/fences/BlockFenceBlueRidge02.java b/src/main/java/appalachia/block/fences/BlockFenceBlueRidge02.java new file mode 100644 index 00000000..914c97b9 --- /dev/null +++ b/src/main/java/appalachia/block/fences/BlockFenceBlueRidge02.java @@ -0,0 +1,17 @@ +package appalachia.block.fences; + +import appalachia.block.IAppalachiaBlock; + +public class BlockFenceBlueRidge02 extends AppalachiaBlockFence implements IAppalachiaBlock { + + public BlockFenceBlueRidge02() { + + super("fence.blueridge.02"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/fences/BlockFenceBlueRidge03.java b/src/main/java/appalachia/block/fences/BlockFenceBlueRidge03.java new file mode 100644 index 00000000..37e4d488 --- /dev/null +++ b/src/main/java/appalachia/block/fences/BlockFenceBlueRidge03.java @@ -0,0 +1,17 @@ +package appalachia.block.fences; + +import appalachia.block.IAppalachiaBlock; + +public class BlockFenceBlueRidge03 extends AppalachiaBlockFence implements IAppalachiaBlock { + + public BlockFenceBlueRidge03() { + + super("fence.blueridge.03"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/leaves/AppalachiaBlockLeaves.java b/src/main/java/appalachia/block/leaves/AppalachiaBlockLeaves.java new file mode 100644 index 00000000..0040a799 --- /dev/null +++ b/src/main/java/appalachia/block/leaves/AppalachiaBlockLeaves.java @@ -0,0 +1,119 @@ +package appalachia.block.leaves; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockPlanks.EnumType; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.IAppalachiaBlock; +import appalachia.gui.AppalachiaTabs; +import com.google.common.collect.Lists; + +public class AppalachiaBlockLeaves extends BlockLeaves implements IAppalachiaBlock { + + private String slug; + + public AppalachiaBlockLeaves(String unlocalizedName) { + + super(); + this.setUnlocalizedName(unlocalizedName); + this.setHarvestLevel("axe", 0); + this.setCreativeTab(AppalachiaTabs.tabDecoration); + this.setDefaultState(blockState.getBaseState().withProperty(DECAYABLE, Boolean.valueOf(true)).withProperty(CHECK_DECAY, Boolean.valueOf(true))); + this.leavesFancy = true; + this.slug = unlocalizedName; + } + + @Override + public String registryName() { + + return String.join("_", this.slug.split("\\.")); + } + + @Override + protected BlockStateContainer createBlockState() { + + return new BlockStateContainer(this, new IProperty[]{DECAYABLE, CHECK_DECAY}); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + + return getDefaultState().withProperty(DECAYABLE, Boolean.valueOf((meta & 4) == 0)).withProperty(CHECK_DECAY, Boolean.valueOf((meta & 8) > 0)); + } + + @Override + public int getMetaFromState(IBlockState state) { + + int meta = 0; + + if (!state.getValue(DECAYABLE).booleanValue()) { + meta |= 4; + } + + if (state.getValue(CHECK_DECAY).booleanValue()) { + meta |= 8; + } + + return meta; + } + + @Override + public EnumType getWoodType(int meta) { + + return null; + } + + @SideOnly(Side.CLIENT) + @Override + public void setGraphicsLevel(boolean fancy) { + + super.setGraphicsLevel(true); + } + + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + + return Item.getItemFromBlock(AppalachiaBlocks.sapling_quercus_robur); + } + + @Override + public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity tile, ItemStack stack) { + + if (!world.isRemote && stack != null && stack.getItem() == Items.SHEARS) { + player.addStat(StatList.getBlockStats(this)); + } + else { + super.harvestBlock(world, player, pos, state, tile, stack); + } + } + + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos) { + + return item != null; + } + + @Override + public List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) { + + return Lists.newArrayList(new ItemStack(this)); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/leaves/BlockLeavesAutumnOrange.java b/src/main/java/appalachia/block/leaves/BlockLeavesAutumnOrange.java new file mode 100644 index 00000000..f04cd471 --- /dev/null +++ b/src/main/java/appalachia/block/leaves/BlockLeavesAutumnOrange.java @@ -0,0 +1,17 @@ +package appalachia.block.leaves; + +import appalachia.block.IAppalachiaBlock; + +public class BlockLeavesAutumnOrange extends AppalachiaBlockLeaves implements IAppalachiaBlock { + + public BlockLeavesAutumnOrange() { + + super("leaves.autumn.orange"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/leaves/BlockLeavesAutumnRed.java b/src/main/java/appalachia/block/leaves/BlockLeavesAutumnRed.java new file mode 100644 index 00000000..ba5237ad --- /dev/null +++ b/src/main/java/appalachia/block/leaves/BlockLeavesAutumnRed.java @@ -0,0 +1,17 @@ +package appalachia.block.leaves; + +import appalachia.block.IAppalachiaBlock; + +public class BlockLeavesAutumnRed extends AppalachiaBlockLeaves implements IAppalachiaBlock { + + public BlockLeavesAutumnRed() { + + super("leaves.autumn.red"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/leaves/BlockLeavesAutumnYellow.java b/src/main/java/appalachia/block/leaves/BlockLeavesAutumnYellow.java new file mode 100644 index 00000000..0da51471 --- /dev/null +++ b/src/main/java/appalachia/block/leaves/BlockLeavesAutumnYellow.java @@ -0,0 +1,17 @@ +package appalachia.block.leaves; + +import appalachia.block.IAppalachiaBlock; + +public class BlockLeavesAutumnYellow extends AppalachiaBlockLeaves implements IAppalachiaBlock { + + public BlockLeavesAutumnYellow() { + + super("leaves.autumn.yellow"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/leaves/fallen/AppalachiaBlockLeavesFallen.java b/src/main/java/appalachia/block/leaves/fallen/AppalachiaBlockLeavesFallen.java new file mode 100644 index 00000000..c6ffafca --- /dev/null +++ b/src/main/java/appalachia/block/leaves/fallen/AppalachiaBlockLeavesFallen.java @@ -0,0 +1,258 @@ +package appalachia.block.leaves.fallen; + +import java.util.List; +import java.util.Random; +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.color.IBlockColor; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +import net.minecraftforge.common.IShearable; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.api.block.IAppalachiaBlockLeavesFallen; +import appalachia.api.util.Simplex; +import appalachia.block.IAppalachiaBlock; +import appalachia.gui.AppalachiaTabs; +import com.google.common.collect.Lists; + +public class AppalachiaBlockLeavesFallen extends Block implements IAppalachiaBlock, IShearable, IAppalachiaBlockLeavesFallen { + //public static final PropertyInteger LAYERS = PropertyInteger.create("layers", 1, 8); + + public static final AxisAlignedBB[] FALLEN_AABB = new AxisAlignedBB[] + { + new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.0D, 1.0D), + new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D), + new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.25D, 1.0D), + new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.375D, 1.0D), + new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.5D, 1.0D), + new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.625D, 1.0D), + new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D), + new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.875D, 1.0D), + new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D) + }; + + private String slug; + + public AppalachiaBlockLeavesFallen(String unlocalizedName) { + + super(Material.LEAVES); + this.setUnlocalizedName(unlocalizedName); + this.setHardness(0.1F); + this.setLightOpacity(1); + this.setSoundType(SoundType.PLANT); + this.setCreativeTab(AppalachiaTabs.tabDecoration); + this.setDefaultState(blockState.getBaseState().withProperty(LAYERS, Integer.valueOf(1))); + this.slug = unlocalizedName; + } + + @Override + public String registryName() { + + return String.join("_", this.slug.split("\\.")); + } + + @Override + protected BlockStateContainer createBlockState() { + + return new BlockStateContainer(this, new IProperty[]{LAYERS}); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + + if (meta >= 8) { + return getDefaultState().withProperty(LAYERS, Integer.valueOf((meta - 8 & 7) + 1)); + } + + return getDefaultState().withProperty(LAYERS, Integer.valueOf((meta & 7) + 1)); + } + + @Override + public int getMetaFromState(IBlockState state) { + + int meta = state.getValue(LAYERS).intValue() - 1; + + return meta; + } + + @Override + public void harvestBlock(World world, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity tile, ItemStack stack) { + + super.harvestBlock(world, player, pos, state, tile, stack); + + world.setBlockToAir(pos); + } + + @Override + public boolean isShearable(ItemStack item, IBlockAccess world, BlockPos pos) { + + return item != null; + } + + @Override + public List onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) { + + return Lists.newArrayList(new ItemStack(this, world.getBlockState(pos).getValue(LAYERS).intValue())); + } + + @SideOnly(Side.CLIENT) + @Override + public BlockRenderLayer getBlockLayer() { + + return BlockRenderLayer.CUTOUT_MIPPED; + } + + @Override + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + + return FALLEN_AABB[state.getValue(LAYERS).intValue()]; + } + + @Override + public boolean isFullyOpaque(IBlockState state) { + + return state.getValue(LAYERS).intValue() == 7; + } + + @SideOnly(Side.CLIENT) + @Override + public boolean shouldSideBeRendered(IBlockState state, IBlockAccess source, BlockPos pos, EnumFacing side) { + + if (side == EnumFacing.UP) { + return true; + } + else { + IBlockState blockState = source.getBlockState(pos.offset(side)); + + return blockState.getBlock() == this && blockState.getValue(LAYERS).intValue() >= state.getValue(LAYERS).intValue() || super.shouldSideBeRendered(state, source, pos, side); + } + } + + @Override + public boolean isOpaqueCube(IBlockState state) { + + return false; + } + + @Override + public boolean isFullCube(IBlockState state) { + + return false; + } + + @Override + public boolean isVisuallyOpaque() { + + return false; + } + + @Override + public float getBlockHardness(IBlockState state, World world, BlockPos pos) { + + float hardness = super.getBlockHardness(state, world, pos); + + if (!state.getProperties().containsKey(LAYERS)) { + return hardness; + } + + int layers = state.getValue(LAYERS).intValue(); + + if (layers >= 6) { + return hardness * 2.0F; + } + + if (layers >= 3) { + return hardness * 1.5F; + } + + return hardness; + } + + @Override + public boolean isReplaceable(IBlockAccess source, BlockPos pos) { + + return source.getBlockState(pos).getValue(LAYERS).intValue() == 1; + } + + @Override + public boolean isPassable(IBlockAccess world, BlockPos pos) { + + return world.getBlockState(pos).getValue(LAYERS).intValue() < 5; + } + + @Override + public int quantityDropped(Random random) { + + return 0; + } + + @Override + public boolean canPlaceBlockAt(World world, BlockPos pos) { + + IBlockState state = world.getBlockState(pos.down()); + Block block = state.getBlock(); + + return block != this && block.isLeaves(state, world, pos.down()) && state.isFullCube() || block == this && state.getValue(LAYERS).intValue() == 8 || state.isOpaqueCube() && state.getMaterial().blocksMovement(); + } + + @Override + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block) { + + checkAndDropBlock(world, pos, state); + } + + private boolean checkAndDropBlock(World world, BlockPos pos, IBlockState state) { + + if (!canPlaceBlockAt(world, pos)) { + world.setBlockToAir(pos); + + return false; + } + + return true; + } + + public static class ColourHandler implements IBlockColor { + + private static final int leafColours[] = { + 15924992, 16776960, 16773632, 16770560, 16767232, 16763904, + 16760576, 16757504, 16754176, 16750848, 16747520, 16744448, + 16741120, 16737792, 16734464, 16731392, 16728064, 16724736, 16721408 + }; + + private Simplex simplex = new Simplex(17781); + + public ColourHandler() { + + } + + public int colorMultiplier(IBlockState state, @Nullable IBlockAccess worldIn, @Nullable BlockPos pos, int tintIndex) + { + //return BiomeColorHelper.getFoliageColorAtPos(worldIn, pos); + + if (pos == null) { + return 16750848; + } + + int noise = (int) (simplex.noise(pos.getX()/5, pos.getZ()/5)*9+9); + + return leafColours[noise]; + } + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/leaves/fallen/BlockLeavesAutumnOrangeFallen.java b/src/main/java/appalachia/block/leaves/fallen/BlockLeavesAutumnOrangeFallen.java new file mode 100644 index 00000000..7211589a --- /dev/null +++ b/src/main/java/appalachia/block/leaves/fallen/BlockLeavesAutumnOrangeFallen.java @@ -0,0 +1,19 @@ +package appalachia.block.leaves.fallen; + +import net.minecraftforge.common.IShearable; + +import appalachia.block.IAppalachiaBlock; + +public class BlockLeavesAutumnOrangeFallen extends AppalachiaBlockLeavesFallen implements IAppalachiaBlock, IShearable { + + public BlockLeavesAutumnOrangeFallen() { + + super("leaves.autumn.orange.fallen"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/leaves/fallen/BlockLeavesAutumnRedFallen.java b/src/main/java/appalachia/block/leaves/fallen/BlockLeavesAutumnRedFallen.java new file mode 100644 index 00000000..cb647b54 --- /dev/null +++ b/src/main/java/appalachia/block/leaves/fallen/BlockLeavesAutumnRedFallen.java @@ -0,0 +1,19 @@ +package appalachia.block.leaves.fallen; + +import net.minecraftforge.common.IShearable; + +import appalachia.block.IAppalachiaBlock; + +public class BlockLeavesAutumnRedFallen extends AppalachiaBlockLeavesFallen implements IAppalachiaBlock, IShearable { + + public BlockLeavesAutumnRedFallen() { + + super("leaves.autumn.red.fallen"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/leaves/fallen/BlockLeavesAutumnYellowFallen.java b/src/main/java/appalachia/block/leaves/fallen/BlockLeavesAutumnYellowFallen.java new file mode 100644 index 00000000..16a8ce17 --- /dev/null +++ b/src/main/java/appalachia/block/leaves/fallen/BlockLeavesAutumnYellowFallen.java @@ -0,0 +1,19 @@ +package appalachia.block.leaves.fallen; + +import net.minecraftforge.common.IShearable; + +import appalachia.block.IAppalachiaBlock; + +public class BlockLeavesAutumnYellowFallen extends AppalachiaBlockLeavesFallen implements IAppalachiaBlock, IShearable { + + public BlockLeavesAutumnYellowFallen() { + + super("leaves.autumn.yellow.fallen"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/leaves/fallen/BlockLeavesOakFallen.java b/src/main/java/appalachia/block/leaves/fallen/BlockLeavesOakFallen.java new file mode 100644 index 00000000..422be936 --- /dev/null +++ b/src/main/java/appalachia/block/leaves/fallen/BlockLeavesOakFallen.java @@ -0,0 +1,21 @@ +package appalachia.block.leaves.fallen; + +import net.minecraftforge.common.IShearable; + +import appalachia.block.IAppalachiaBlock; + +public class BlockLeavesOakFallen extends AppalachiaBlockLeavesFallen implements IAppalachiaBlock, IShearable { + + public BlockLeavesOakFallen() { + + super("leaves.oak.fallen"); + } + + @Override + public String registryName() { + + return super.registryName(); + } + + +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/logs/AppalachiaBlockLog.java b/src/main/java/appalachia/block/logs/AppalachiaBlockLog.java new file mode 100644 index 00000000..da18bd10 --- /dev/null +++ b/src/main/java/appalachia/block/logs/AppalachiaBlockLog.java @@ -0,0 +1,146 @@ +package appalachia.block.logs; + +import net.minecraft.block.BlockLog; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.util.IStringSerializable; + +import appalachia.block.IAppalachiaBlock; +import appalachia.gui.AppalachiaTabs; + +public class AppalachiaBlockLog extends BlockLog implements IAppalachiaBlock { + + public static final PropertyEnum VARIANT = PropertyEnum.create("variant", EnumType.class); + + private String slug; + + public AppalachiaBlockLog(String unlocalizedName) { + + super(); + this.setUnlocalizedName(unlocalizedName); + this.setHarvestLevel("axe", 0); + this.setDefaultState(blockState.getBaseState().withProperty(VARIANT, EnumType.NORMAL).withProperty(LOG_AXIS, EnumAxis.Y)); + this.setCreativeTab(AppalachiaTabs.tabBlock); + this.slug = unlocalizedName; + } + + @Override + public String registryName() { + + return String.join("_", this.slug.split("\\.")); + } + + @Override + protected BlockStateContainer createBlockState() { + + return new BlockStateContainer(this, new IProperty[]{VARIANT, LOG_AXIS}); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + + IBlockState state = getDefaultState().withProperty(VARIANT, EnumType.NORMAL); + + switch (meta & 12) { + case 0: + state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.Y); + break; + case 4: + state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.X); + break; + case 8: + state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.Z); + break; + default: + state = state.withProperty(LOG_AXIS, BlockLog.EnumAxis.NONE); + } + + return state; + } + + @Override + public int getMetaFromState(IBlockState state) { + + int meta = 0; + + meta = meta | state.getValue(VARIANT).getMetadata(); + + switch (state.getValue(LOG_AXIS)) { + case X: + meta |= 4; + break; + case Z: + meta |= 8; + break; + case NONE: + meta |= 12; + break; + default: + } + + return meta; + } + + @Override + public MapColor getMapColor(IBlockState state) { + + return BlockPlanks.EnumType.BIRCH.getMapColor(); + } + + @Override + public int getLightValue(IBlockState state) { + + return super.getLightValue(state); + } + + public enum EnumType implements IStringSerializable { + NORMAL(0, "normal"); + + private static final EnumType[] META_LOOKUP = new EnumType[values().length]; + + private final int meta; + private final String name; + + static { + for (EnumType type : values()) { + META_LOOKUP[type.getMetadata()] = type; + } + } + + private EnumType(int meta, String name) { + + this.meta = meta; + this.name = name; + } + + public int getMetadata() { + + return meta; + } + + @Override + public String getName() { + + return name; + } + + @Override + public String toString() { + + return name; + } + + public static EnumType byMetadata(int meta) { + + if (meta < 0 || meta >= META_LOOKUP.length) { + meta = 0; + } + + return META_LOOKUP[meta]; + } + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/logs/BlockLogAutumnGrey.java b/src/main/java/appalachia/block/logs/BlockLogAutumnGrey.java new file mode 100644 index 00000000..c0cbc0e2 --- /dev/null +++ b/src/main/java/appalachia/block/logs/BlockLogAutumnGrey.java @@ -0,0 +1,17 @@ +package appalachia.block.logs; + +import appalachia.block.IAppalachiaBlock; + +public class BlockLogAutumnGrey extends AppalachiaBlockLog implements IAppalachiaBlock { + + public BlockLogAutumnGrey() { + + super("log.autumn.grey"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/logs/BlockLogBlueRidge01.java b/src/main/java/appalachia/block/logs/BlockLogBlueRidge01.java new file mode 100644 index 00000000..c6ed0c58 --- /dev/null +++ b/src/main/java/appalachia/block/logs/BlockLogBlueRidge01.java @@ -0,0 +1,17 @@ +package appalachia.block.logs; + +import appalachia.block.IAppalachiaBlock; + +public class BlockLogBlueRidge01 extends AppalachiaBlockLog implements IAppalachiaBlock { + + public BlockLogBlueRidge01() { + + super("log.blueridge.01"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/logs/BlockLogBlueRidge02.java b/src/main/java/appalachia/block/logs/BlockLogBlueRidge02.java new file mode 100644 index 00000000..a79d391c --- /dev/null +++ b/src/main/java/appalachia/block/logs/BlockLogBlueRidge02.java @@ -0,0 +1,17 @@ +package appalachia.block.logs; + +import appalachia.block.IAppalachiaBlock; + +public class BlockLogBlueRidge02 extends AppalachiaBlockLog implements IAppalachiaBlock { + + public BlockLogBlueRidge02() { + + super("log.blueridge.02"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/logs/BlockLogBlueRidge03.java b/src/main/java/appalachia/block/logs/BlockLogBlueRidge03.java new file mode 100644 index 00000000..e76df57a --- /dev/null +++ b/src/main/java/appalachia/block/logs/BlockLogBlueRidge03.java @@ -0,0 +1,17 @@ +package appalachia.block.logs; + +import appalachia.block.IAppalachiaBlock; + +public class BlockLogBlueRidge03 extends AppalachiaBlockLog implements IAppalachiaBlock { + + public BlockLogBlueRidge03() { + + super("log.blueridge.03"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/planks/AppalachiaBlockPlanks.java b/src/main/java/appalachia/block/planks/AppalachiaBlockPlanks.java new file mode 100644 index 00000000..2dfc1cc1 --- /dev/null +++ b/src/main/java/appalachia/block/planks/AppalachiaBlockPlanks.java @@ -0,0 +1,64 @@ +package appalachia.block.planks; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; + +import appalachia.block.IAppalachiaBlock; +import appalachia.gui.AppalachiaTabs; + +public class AppalachiaBlockPlanks extends Block implements IAppalachiaBlock { + + public static final PropertyBool DOUBLE = PropertyBool.create("double"); + + private String slug; + + public AppalachiaBlockPlanks(String unlocalizedName) { + + super(Material.WOOD); + this.setUnlocalizedName(unlocalizedName); + this.setHardness(1.75F); + this.setResistance(4.75F); + this.setSoundType(SoundType.WOOD); + this.setHarvestLevel("axe", 0); + this.setCreativeTab(AppalachiaTabs.tabBlock); + this.setDefaultState(blockState.getBaseState().withProperty(DOUBLE, Boolean.valueOf(false))); + this.slug = unlocalizedName; + } + + @Override + public String registryName() { + + return String.join("_", this.slug.split("\\.")); + } + + @Override + protected BlockStateContainer createBlockState() { + + return new BlockStateContainer(this, new IProperty[]{DOUBLE}); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + + return getDefaultState().withProperty(DOUBLE, Boolean.valueOf(meta == 1)); + } + + @Override + public int getMetaFromState(IBlockState state) { + + return state.getValue(DOUBLE).booleanValue() ? 1 : 0; + } + + @Override + public int quantityDropped(IBlockState state, int fortune, Random random) { + + return state.getValue(DOUBLE).booleanValue() ? 2 : 1; + } +} diff --git a/src/main/java/appalachia/block/planks/BlockPlanksAutumnGrey.java b/src/main/java/appalachia/block/planks/BlockPlanksAutumnGrey.java new file mode 100644 index 00000000..61ce9686 --- /dev/null +++ b/src/main/java/appalachia/block/planks/BlockPlanksAutumnGrey.java @@ -0,0 +1,29 @@ +package appalachia.block.planks; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.Item; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.IAppalachiaBlock; + +public class BlockPlanksAutumnGrey extends AppalachiaBlockPlanks implements IAppalachiaBlock { + + public BlockPlanksAutumnGrey() { + + super("planks.autumn.grey"); + } + + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + + return Item.getItemFromBlock(state.getValue(DOUBLE).booleanValue() ? AppalachiaBlocks.slab_autumn_grey : this); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/planks/BlockPlanksBlueRidge01.java b/src/main/java/appalachia/block/planks/BlockPlanksBlueRidge01.java new file mode 100644 index 00000000..632ec0ba --- /dev/null +++ b/src/main/java/appalachia/block/planks/BlockPlanksBlueRidge01.java @@ -0,0 +1,29 @@ +package appalachia.block.planks; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.Item; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.IAppalachiaBlock; + +public class BlockPlanksBlueRidge01 extends AppalachiaBlockPlanks implements IAppalachiaBlock { + + public BlockPlanksBlueRidge01() { + + super("planks.blueridge.01"); + } + + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + + return Item.getItemFromBlock(state.getValue(DOUBLE).booleanValue() ? AppalachiaBlocks.slab_blueridge_01 : this); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/planks/BlockPlanksBlueRidge02.java b/src/main/java/appalachia/block/planks/BlockPlanksBlueRidge02.java new file mode 100644 index 00000000..50670dfc --- /dev/null +++ b/src/main/java/appalachia/block/planks/BlockPlanksBlueRidge02.java @@ -0,0 +1,29 @@ +package appalachia.block.planks; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.Item; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.IAppalachiaBlock; + +public class BlockPlanksBlueRidge02 extends AppalachiaBlockPlanks implements IAppalachiaBlock { + + public BlockPlanksBlueRidge02() { + + super("planks.blueridge.02"); + } + + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + + return Item.getItemFromBlock(state.getValue(DOUBLE).booleanValue() ? AppalachiaBlocks.slab_blueridge_02 : this); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/planks/BlockPlanksBlueRidge03.java b/src/main/java/appalachia/block/planks/BlockPlanksBlueRidge03.java new file mode 100644 index 00000000..87757d47 --- /dev/null +++ b/src/main/java/appalachia/block/planks/BlockPlanksBlueRidge03.java @@ -0,0 +1,29 @@ +package appalachia.block.planks; + +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.Item; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.IAppalachiaBlock; + +public class BlockPlanksBlueRidge03 extends AppalachiaBlockPlanks implements IAppalachiaBlock { + + public BlockPlanksBlueRidge03() { + + super("planks.blueridge.03"); + } + + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + + return Item.getItemFromBlock(state.getValue(DOUBLE).booleanValue() ? AppalachiaBlocks.slab_blueridge_03 : this); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/saplings/AppalachiaBlockSapling.java b/src/main/java/appalachia/block/saplings/AppalachiaBlockSapling.java new file mode 100644 index 00000000..1801fded --- /dev/null +++ b/src/main/java/appalachia/block/saplings/AppalachiaBlockSapling.java @@ -0,0 +1,162 @@ +package appalachia.block.saplings; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.BlockBush; +import net.minecraft.block.IGrowable; +import net.minecraft.block.SoundType; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyInteger; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.event.terraingen.TerrainGen; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.rtg.world.gen.feature.tree.rtg.AppalachiaTree; +import appalachia.block.IAppalachiaBlock; +import appalachia.gui.AppalachiaTabs; +import appalachia.api.biome.AppalachiaBiome; + +public class AppalachiaBlockSapling extends BlockBush implements IGrowable, IAppalachiaBlock { + + public static final PropertyInteger STAGE = PropertyInteger.create("stage", 0, 1); + protected static final AxisAlignedBB SAPLING_AABB = new AxisAlignedBB(0.09999999403953552D, 0.0D, 0.09999999403953552D, 0.8999999761581421D, 0.800000011920929D, 0.8999999761581421D); + + private String slug; + + public AppalachiaBlockSapling(String unlocalizedName) { + + this.setUnlocalizedName(unlocalizedName); + this.setSoundType(SoundType.PLANT); + this.setDefaultState(this.blockState.getBaseState().withProperty(STAGE, Integer.valueOf(0))); + this.setCreativeTab(AppalachiaTabs.tabDecoration); + this.slug = unlocalizedName; + } + + @Override + public String registryName() { + + return String.join("_", this.slug.split("\\.")); + } + + public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { + + return SAPLING_AABB; + } + + @Override + public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { + + if (!worldIn.isRemote) { + super.updateTick(worldIn, pos, state, rand); + + if (worldIn.getLightFromNeighbors(pos.up()) >= 9 && rand.nextInt(7) == 0) { + this.grow(worldIn, pos, state, rand); + } + } + } + + public void grow(World worldIn, BlockPos pos, IBlockState state, Random rand) { + + if (((Integer)state.getValue(STAGE)).intValue() == 0) { + worldIn.setBlockState(pos, state.cycleProperty(STAGE), 4); + } + else { + this.generateTree(worldIn, pos, state, rand); + } + } + + public void generateTree(World worldIn, BlockPos pos, IBlockState state, Random rand) { + + if (!TerrainGen.saplingGrowTree(worldIn, rand, pos)) { + return; + } + + Biome biomeIn = worldIn.getBiome(pos); + + if (biomeIn instanceof AppalachiaBiome) { + + AppalachiaBiome biome = (AppalachiaBiome)biomeIn; + + if (biome.appalachiaTrees.size() > 0) { + + AppalachiaTree tree = biome.appalachiaTrees.get(rand.nextInt(biome.appalachiaTrees.size())); + + if (tree.saplingBlock.getBlock() == state.getBlock()) { + + IBlockState iblockstate2 = Blocks.AIR.getDefaultState(); + worldIn.setBlockState(pos, iblockstate2, 4); + + tree.generateFromSapling = true; + if (!tree.generate(worldIn, rand, pos)) { + worldIn.setBlockState(pos, state, 4); + } + tree.generateFromSapling = false; + } + } + } + } + + @Override + public int damageDropped(IBlockState state) { + + return 0; + } + + @SideOnly(Side.CLIENT) + @Override + public void getSubBlocks(Item itemIn, CreativeTabs tab, List list) { + + list.add(new ItemStack(itemIn)); + } + + @Override + public boolean canGrow(World worldIn, BlockPos pos, IBlockState state, boolean isClient) { + + return true; + } + + @Override + public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) { + + return (double)worldIn.rand.nextFloat() < 0.45D; + } + + @Override + public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) { + + this.grow(worldIn, pos, state, rand); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + + return this.getDefaultState().withProperty(STAGE, Integer.valueOf((meta & 8) >> 3)); + } + + @Override + public int getMetaFromState(IBlockState state) { + + int i = 0; + i = i | ((Integer)state.getValue(STAGE)).intValue() << 3; + return i; + } + + @Override + protected BlockStateContainer createBlockState() { + + return new BlockStateContainer(this, new IProperty[]{STAGE}); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/saplings/BlockSaplingQuercusRobur.java b/src/main/java/appalachia/block/saplings/BlockSaplingQuercusRobur.java new file mode 100644 index 00000000..d5fbbe1f --- /dev/null +++ b/src/main/java/appalachia/block/saplings/BlockSaplingQuercusRobur.java @@ -0,0 +1,17 @@ +package appalachia.block.saplings; + +import appalachia.block.IAppalachiaBlock; + +public class BlockSaplingQuercusRobur extends AppalachiaBlockSapling implements IAppalachiaBlock { + + public BlockSaplingQuercusRobur() { + + super("sapling.quercus.robur"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/slabs/AppalachiaBlockSlab.java b/src/main/java/appalachia/block/slabs/AppalachiaBlockSlab.java new file mode 100644 index 00000000..7c0eefbf --- /dev/null +++ b/src/main/java/appalachia/block/slabs/AppalachiaBlockSlab.java @@ -0,0 +1,79 @@ +package appalachia.block.slabs; + +import net.minecraft.block.BlockSlab; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.properties.IProperty; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.ItemStack; + +import appalachia.block.IAppalachiaBlock; +import appalachia.gui.AppalachiaTabs; + +public class AppalachiaBlockSlab extends BlockSlab implements IAppalachiaBlock { + + private String slug; + + public AppalachiaBlockSlab(String unlocalizedName) { + + super(Material.WOOD); + this.setUnlocalizedName(unlocalizedName); + this.setHardness(1.75F); + this.setResistance(4.75F); + this.setSoundType(SoundType.WOOD); + this.setHarvestLevel("axe", 0); + this.setCreativeTab(AppalachiaTabs.tabBlock); + this.setDefaultState(blockState.getBaseState().withProperty(HALF, EnumBlockHalf.BOTTOM)); + this.useNeighborBrightness = true; + this.slug = unlocalizedName; + } + + @Override + public String registryName() { + + return String.join("_", this.slug.split("\\.")); + } + + @Override + protected BlockStateContainer createBlockState() { + + return new BlockStateContainer(this, new IProperty[]{HALF}); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + + return getDefaultState().withProperty(HALF, meta == 0 ? EnumBlockHalf.BOTTOM : EnumBlockHalf.TOP); + } + + @Override + public int getMetaFromState(IBlockState state) { + + return state.getValue(HALF) == EnumBlockHalf.TOP ? 1 : 0; + } + + @Override + public String getUnlocalizedName(int meta) { + + return getUnlocalizedName(); + } + + @Override + public boolean isDouble() { + + return false; + } + + @Override + public IProperty getVariantProperty() { + + return null; + } + + @Override + public Comparable getTypeForItem(ItemStack stack) { + + return null; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/slabs/BlockSlabAutumnGrey.java b/src/main/java/appalachia/block/slabs/BlockSlabAutumnGrey.java new file mode 100644 index 00000000..76d1709d --- /dev/null +++ b/src/main/java/appalachia/block/slabs/BlockSlabAutumnGrey.java @@ -0,0 +1,17 @@ +package appalachia.block.slabs; + +import appalachia.block.IAppalachiaBlock; + +public class BlockSlabAutumnGrey extends AppalachiaBlockSlab implements IAppalachiaBlock { + + public BlockSlabAutumnGrey() { + + super("slab.autumn.grey"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/slabs/BlockSlabBlueRidge01.java b/src/main/java/appalachia/block/slabs/BlockSlabBlueRidge01.java new file mode 100644 index 00000000..f075eab7 --- /dev/null +++ b/src/main/java/appalachia/block/slabs/BlockSlabBlueRidge01.java @@ -0,0 +1,17 @@ +package appalachia.block.slabs; + +import appalachia.block.IAppalachiaBlock; + +public class BlockSlabBlueRidge01 extends AppalachiaBlockSlab implements IAppalachiaBlock { + + public BlockSlabBlueRidge01() { + + super("slab.blueridge.01"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/slabs/BlockSlabBlueRidge02.java b/src/main/java/appalachia/block/slabs/BlockSlabBlueRidge02.java new file mode 100644 index 00000000..73a978ce --- /dev/null +++ b/src/main/java/appalachia/block/slabs/BlockSlabBlueRidge02.java @@ -0,0 +1,17 @@ +package appalachia.block.slabs; + +import appalachia.block.IAppalachiaBlock; + +public class BlockSlabBlueRidge02 extends AppalachiaBlockSlab implements IAppalachiaBlock { + + public BlockSlabBlueRidge02() { + + super("slab.blueridge.02"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/slabs/BlockSlabBlueRidge03.java b/src/main/java/appalachia/block/slabs/BlockSlabBlueRidge03.java new file mode 100644 index 00000000..cb3b2ca9 --- /dev/null +++ b/src/main/java/appalachia/block/slabs/BlockSlabBlueRidge03.java @@ -0,0 +1,17 @@ +package appalachia.block.slabs; + +import appalachia.block.IAppalachiaBlock; + +public class BlockSlabBlueRidge03 extends AppalachiaBlockSlab implements IAppalachiaBlock { + + public BlockSlabBlueRidge03() { + + super("slab.blueridge.03"); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/stairs/AppalachiaBlockStairs.java b/src/main/java/appalachia/block/stairs/AppalachiaBlockStairs.java new file mode 100644 index 00000000..e6b41f64 --- /dev/null +++ b/src/main/java/appalachia/block/stairs/AppalachiaBlockStairs.java @@ -0,0 +1,28 @@ +package appalachia.block.stairs; + +import net.minecraft.block.BlockStairs; +import net.minecraft.block.state.IBlockState; + +import appalachia.block.IAppalachiaBlock; +import appalachia.gui.AppalachiaTabs; + +public class AppalachiaBlockStairs extends BlockStairs implements IAppalachiaBlock { + + private String slug; + + public AppalachiaBlockStairs(String unlocalizedName, IBlockState blockstate) { + + super(blockstate); + this.setUnlocalizedName(unlocalizedName); + this.setHarvestLevel("axe", 0); + this.setCreativeTab(AppalachiaTabs.tabBlock); + this.useNeighborBrightness = true; + this.slug = unlocalizedName; + } + + @Override + public String registryName() { + + return String.join("_", this.slug.split("\\.")); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/stairs/BlockStairsAutumnGrey.java b/src/main/java/appalachia/block/stairs/BlockStairsAutumnGrey.java new file mode 100644 index 00000000..988921c8 --- /dev/null +++ b/src/main/java/appalachia/block/stairs/BlockStairsAutumnGrey.java @@ -0,0 +1,18 @@ +package appalachia.block.stairs; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.IAppalachiaBlock; + +public class BlockStairsAutumnGrey extends AppalachiaBlockStairs implements IAppalachiaBlock { + + public BlockStairsAutumnGrey() { + + super("stairs.autumn.grey", AppalachiaBlocks.planks_autumn_grey.getDefaultState()); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/stairs/BlockStairsBlueRidge01.java b/src/main/java/appalachia/block/stairs/BlockStairsBlueRidge01.java new file mode 100644 index 00000000..65036998 --- /dev/null +++ b/src/main/java/appalachia/block/stairs/BlockStairsBlueRidge01.java @@ -0,0 +1,18 @@ +package appalachia.block.stairs; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.IAppalachiaBlock; + +public class BlockStairsBlueRidge01 extends AppalachiaBlockStairs implements IAppalachiaBlock { + + public BlockStairsBlueRidge01() { + + super("stairs.blueridge.01", AppalachiaBlocks.planks_blueridge_01.getDefaultState()); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/stairs/BlockStairsBlueRidge02.java b/src/main/java/appalachia/block/stairs/BlockStairsBlueRidge02.java new file mode 100644 index 00000000..c70027e9 --- /dev/null +++ b/src/main/java/appalachia/block/stairs/BlockStairsBlueRidge02.java @@ -0,0 +1,18 @@ +package appalachia.block.stairs; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.IAppalachiaBlock; + +public class BlockStairsBlueRidge02 extends AppalachiaBlockStairs implements IAppalachiaBlock { + + public BlockStairsBlueRidge02() { + + super("stairs.blueridge.02", AppalachiaBlocks.planks_blueridge_02.getDefaultState()); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/block/stairs/BlockStairsBlueRidge03.java b/src/main/java/appalachia/block/stairs/BlockStairsBlueRidge03.java new file mode 100644 index 00000000..a35194fa --- /dev/null +++ b/src/main/java/appalachia/block/stairs/BlockStairsBlueRidge03.java @@ -0,0 +1,18 @@ +package appalachia.block.stairs; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.IAppalachiaBlock; + +public class BlockStairsBlueRidge03 extends AppalachiaBlockStairs implements IAppalachiaBlock { + + public BlockStairsBlueRidge03() { + + super("stairs.blueridge.03", AppalachiaBlocks.planks_blueridge_03.getDefaultState()); + } + + @Override + public String registryName() { + + return super.registryName(); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/client/model/ModelBlackBear.java b/src/main/java/appalachia/client/model/ModelBlackBear.java new file mode 100644 index 00000000..b886a6f6 --- /dev/null +++ b/src/main/java/appalachia/client/model/ModelBlackBear.java @@ -0,0 +1,111 @@ +package appalachia.client.model; + +import net.minecraft.client.model.ModelQuadruped; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; + +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.entity.monster.EntityBlackBear; + +@SideOnly(Side.CLIENT) +public class ModelBlackBear extends ModelQuadruped +{ + public ModelBlackBear() + { + super(12, 0.0F); + this.textureWidth = 128; + this.textureHeight = 64; + this.head = new ModelRenderer(this, 0, 0); + this.head.addBox(-3.5F, -3.0F, -3.0F, 7, 7, 7, 0.0F); + this.head.setRotationPoint(0.0F, 10.0F, -16.0F); + this.head.setTextureOffset(0, 44).addBox(-2.5F, 1.0F, -6.0F, 5, 3, 3, 0.0F); + this.head.setTextureOffset(26, 0).addBox(-4.5F, -4.0F, -1.0F, 2, 2, 1, 0.0F); + ModelRenderer modelrenderer = this.head.setTextureOffset(26, 0); + modelrenderer.mirror = true; + modelrenderer.addBox(2.5F, -4.0F, -1.0F, 2, 2, 1, 0.0F); + this.body = new ModelRenderer(this); + this.body.setTextureOffset(0, 19).addBox(-5.0F, -13.0F, -7.0F, 14, 14, 11, 0.0F); + this.body.setTextureOffset(39, 0).addBox(-4.0F, -25.0F, -7.0F, 12, 12, 10, 0.0F); + this.body.setRotationPoint(-2.0F, 9.0F, 12.0F); + int i = 10; + this.leg1 = new ModelRenderer(this, 50, 22); + this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 10, 8, 0.0F); + this.leg1.setRotationPoint(-3.5F, 14.0F, 6.0F); + this.leg2 = new ModelRenderer(this, 50, 22); + this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 10, 8, 0.0F); + this.leg2.setRotationPoint(3.5F, 14.0F, 6.0F); + this.leg3 = new ModelRenderer(this, 50, 40); + this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 10, 6, 0.0F); + this.leg3.setRotationPoint(-2.5F, 14.0F, -7.0F); + this.leg4 = new ModelRenderer(this, 50, 40); + this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 10, 6, 0.0F); + this.leg4.setRotationPoint(2.5F, 14.0F, -7.0F); + --this.leg1.rotationPointX; + ++this.leg2.rotationPointX; + this.leg1.rotationPointZ += 0.0F; + this.leg2.rotationPointZ += 0.0F; + --this.leg3.rotationPointX; + ++this.leg4.rotationPointX; + --this.leg3.rotationPointZ; + --this.leg4.rotationPointZ; + this.childZOffset += 2.0F; + } + + public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) + { + this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn); + + if (this.isChild) + { + float f = 2.0F; + this.childYOffset = 16.0F; + this.childZOffset = 4.0F; + GlStateManager.pushMatrix(); + GlStateManager.scale(0.6666667F, 0.6666667F, 0.6666667F); + GlStateManager.translate(0.0F, this.childYOffset * scale, this.childZOffset * scale); + this.head.render(scale); + GlStateManager.popMatrix(); + GlStateManager.pushMatrix(); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + GlStateManager.translate(0.0F, 24.0F * scale, 0.0F); + this.body.render(scale); + this.leg1.render(scale); + this.leg2.render(scale); + this.leg3.render(scale); + this.leg4.render(scale); + GlStateManager.popMatrix(); + } + else + { + this.head.render(scale); + this.body.render(scale); + this.leg1.render(scale); + this.leg2.render(scale); + this.leg3.render(scale); + this.leg4.render(scale); + } + } + + public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) + { + super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn); + float f = ageInTicks - (float)entityIn.ticksExisted; + float f1 = ((EntityBlackBear)entityIn).func_189795_r(f); + f1 = f1 * f1; + float f2 = 1.0F - f1; + this.body.rotateAngleX = ((float)Math.PI / 2F) - f1 * (float)Math.PI * 0.35F; + this.body.rotationPointY = 9.0F * f2 + 11.0F * f1; + this.leg3.rotationPointY = 14.0F * f2 + -6.0F * f1; + this.leg3.rotationPointZ = -8.0F * f2 + -4.0F * f1; + this.leg3.rotateAngleX -= f1 * (float)Math.PI * 0.45F; + this.leg4.rotationPointY = this.leg3.rotationPointY; + this.leg4.rotationPointZ = this.leg3.rotationPointZ; + this.leg4.rotateAngleX -= f1 * (float)Math.PI * 0.45F; + this.head.rotationPointY = 10.0F * f2 + -12.0F * f1; + this.head.rotationPointZ = -16.0F * f2 + -3.0F * f1; + this.head.rotateAngleX += f1 * (float)Math.PI * 0.15F; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/client/renderer/entity/RenderBlackBear.java b/src/main/java/appalachia/client/renderer/entity/RenderBlackBear.java new file mode 100644 index 00000000..f1586b52 --- /dev/null +++ b/src/main/java/appalachia/client/renderer/entity/RenderBlackBear.java @@ -0,0 +1,57 @@ +package appalachia.client.renderer.entity; + +import javax.annotation.Nonnull; + +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.util.ResourceLocation; + +import net.minecraftforge.fml.client.registry.IRenderFactory; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.client.model.ModelBlackBear; +import appalachia.entity.monster.EntityBlackBear; +import appalachia.reference.ModInfo; + +@SideOnly(Side.CLIENT) +public class RenderBlackBear extends RenderLiving +{ + private ResourceLocation mobTexture = new ResourceLocation("" + ModInfo.MOD_ID + ":textures/entity/bear/blackbear.png"); + public static final Factory FACTORY = new Factory(); + + + public RenderBlackBear(RenderManager rendermanagerIn) { + super(rendermanagerIn, new ModelBlackBear(), 0.7F); + } + + @Override + @Nonnull + protected ResourceLocation getEntityTexture(@Nonnull EntityBlackBear entity) { + return mobTexture; + } + + @Override + public void doRender(EntityBlackBear entity, double x, double y, double z, float entityYaw, float partialTicks) + { + super.doRender(entity, x, y, z, entityYaw, partialTicks); + } + + @Override + protected void preRenderCallback(EntityBlackBear entitylivingbaseIn, float partialTickTime) + { + GlStateManager.scale(1.2F, 1.2F, 1.2F); + super.preRenderCallback(entitylivingbaseIn, partialTickTime); + } + + public static class Factory implements IRenderFactory { + + @Override + public Render createRenderFor(RenderManager manager) { + return new RenderBlackBear(manager); + } + + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/client/sound/SoundManager.java b/src/main/java/appalachia/client/sound/SoundManager.java new file mode 100644 index 00000000..e85e181d --- /dev/null +++ b/src/main/java/appalachia/client/sound/SoundManager.java @@ -0,0 +1,71 @@ +package appalachia.client.sound; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; + +import net.minecraftforge.fml.common.registry.GameRegistry; + +import appalachia.reference.ModInfo; +import static appalachia.api.AppalachiaSounds.*; + +public class SoundManager +{ + public static void registerSounds() + { + entity_blackbear_idle1 = registerSound("entity.blackbear.idle1"); + entity_blackbear_idle2 = registerSound("entity.blackbear.idle2"); + entity_blackbear_idle3 = registerSound("entity.blackbear.idle3"); + entity_blackbear_idle4 = registerSound("entity.blackbear.idle4"); + entity_blackbear_step1 = registerSound("entity.blackbear.step1"); + entity_blackbear_step2 = registerSound("entity.blackbear.step2"); + entity_blackbear_step3 = registerSound("entity.blackbear.step3"); + entity_blackbear_step4 = registerSound("entity.blackbear.step4"); + entity_blackbear_hurt1 = registerSound("entity.blackbear.hurt1"); + entity_blackbear_hurt2 = registerSound("entity.blackbear.hurt2"); + entity_blackbear_hurt3 = registerSound("entity.blackbear.hurt3"); + entity_blackbear_hurt4 = registerSound("entity.blackbear.hurt4"); + entity_blackbear_warning1 = registerSound("entity.blackbear.warning1"); + entity_blackbear_warning2 = registerSound("entity.blackbear.warning2"); + entity_blackbear_warning3 = registerSound("entity.blackbear.warning3"); + entity_blackbear_death1 = registerSound("entity.blackbear.death1"); + entity_blackbear_death2 = registerSound("entity.blackbear.death2"); + entity_blackbear_death3 = registerSound("entity.blackbear.death3"); + entity_blackbear_baby_idle1 = registerSound("entity.blackbear_baby.idle1"); + entity_blackbear_baby_idle2 = registerSound("entity.blackbear_baby.idle2"); + entity_blackbear_baby_idle3 = registerSound("entity.blackbear_baby.idle3"); + entity_blackbear_baby_idle4 = registerSound("entity.blackbear_baby.idle4"); + + entity_blackbear_idle = new SoundEvent[]{ + entity_blackbear_idle1, entity_blackbear_idle2, entity_blackbear_idle3, entity_blackbear_idle4 + }; + + entity_blackbear_step = new SoundEvent[]{ + entity_blackbear_step1, entity_blackbear_step2, entity_blackbear_step3, entity_blackbear_step4 + }; + + entity_blackbear_hurt = new SoundEvent[]{ + entity_blackbear_hurt1, entity_blackbear_hurt2, entity_blackbear_hurt3, entity_blackbear_hurt4 + }; + + entity_blackbear_warning = new SoundEvent[]{ + entity_blackbear_warning1, entity_blackbear_warning2, entity_blackbear_warning3 + }; + + entity_blackbear_death = new SoundEvent[]{ + entity_blackbear_death1, entity_blackbear_death2, entity_blackbear_death3 + }; + + entity_blackbear_baby_idle = new SoundEvent[]{ + entity_blackbear_baby_idle1, entity_blackbear_baby_idle2, entity_blackbear_baby_idle3, entity_blackbear_baby_idle4 + }; + } + + private static SoundEvent registerSound(String soundName) + { + ResourceLocation location = new ResourceLocation(ModInfo.MOD_ID, soundName); + SoundEvent event = new SoundEvent(location); + GameRegistry.register(event, location); + + return event; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/config/ConfigAppalachia.java b/src/main/java/appalachia/config/ConfigAppalachia.java new file mode 100644 index 00000000..9718ff06 --- /dev/null +++ b/src/main/java/appalachia/config/ConfigAppalachia.java @@ -0,0 +1,122 @@ +package appalachia.config; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +import appalachia.util.Logger; + + +public class ConfigAppalachia { + + public static Configuration config; + public static int biomeIDCounter = 40; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Biome IDs + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static int biomeID_AppalachianMountains = biomeIDCounter++; + public static int biomeID_BlueRidgeMountains = biomeIDCounter++; + public static int biomeID_BlueRidgeForest = biomeIDCounter++; + public static int biomeID_BlueRidgeHills = biomeIDCounter++; + public static int biomeID_BlueRidgeBeach = biomeIDCounter++; + public static int biomeID_BlueRidgeRiver = biomeIDCounter++; + public static int biomeID_Prairie = biomeIDCounter++; + public static int biomeID_SmokyMountains = biomeIDCounter++; + + public static int biomeID_BlueRidgeForestAutumn = biomeIDCounter++; + public static int biomeID_BlueRidgeHillsAutumn = biomeIDCounter++; + public static int biomeID_BlueRidgeMountainsAutumn = biomeIDCounter++; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Biome Weights + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static int biomeWeight_AppalachianMountains = 20; + public static int biomeWeight_BlueRidgeMountains = 20; + public static int biomeWeight_BlueRidgeForest = 20; + public static int biomeWeight_BlueRidgeHills = 20; + public static int biomeWeight_BlueRidgeBeach = 0; + public static int biomeWeight_BlueRidgeRiver = 0; + public static int biomeWeight_Prairie = 20; + public static int biomeWeight_SmokyMountains = 20; + + public static int biomeWeight_BlueRidgeForestAutumn = 20; + public static int biomeWeight_BlueRidgeHillsAutumn = 20; + public static int biomeWeight_BlueRidgeMountainsAutumn = 20; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Debugging + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static boolean enableDebugging = false; + + public static boolean allowTreesToGenerateOnSand = false; + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + + config.load(); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Biome IDs + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + biomeID_AppalachianMountains = config.getInt("Appalachian Mountains Biome ID", "Biome IDs", biomeID_AppalachianMountains, 0, 255, ""); + biomeID_BlueRidgeMountains = config.getInt("Blue Ridge Mountains Biome ID", "Biome IDs", biomeID_BlueRidgeMountains, 0, 255, ""); + biomeID_BlueRidgeForest = config.getInt("Blue Ridge Forest Biome ID", "Biome IDs", biomeID_BlueRidgeForest, 0, 255, ""); + biomeID_BlueRidgeHills = config.getInt("Blue Ridge Hills Biome ID", "Biome IDs", biomeID_BlueRidgeHills, 0, 255, ""); + biomeID_BlueRidgeBeach = config.getInt("Blue Ridge Beach Biome ID", "Biome IDs", biomeID_BlueRidgeBeach, 0, 255, ""); + biomeID_BlueRidgeRiver = config.getInt("Blue Ridge River Biome ID", "Biome IDs", biomeID_BlueRidgeRiver, 0, 255, ""); + biomeID_Prairie = config.getInt("Prairie Biome ID", "Biome IDs", biomeID_Prairie, 0, 255, ""); + biomeID_SmokyMountains = config.getInt("Smoky Mountains Biome ID", "Biome IDs", biomeID_SmokyMountains, 0, 255, ""); + + biomeID_BlueRidgeForestAutumn = config.getInt("Autumn Blue Ridge Forest Biome ID", "Biome IDs", biomeID_BlueRidgeForestAutumn, 0, 255, ""); + biomeID_BlueRidgeHillsAutumn = config.getInt("Autumn Blue Ridge Hills Biome ID", "Biome IDs", biomeID_BlueRidgeHillsAutumn, 0, 255, ""); + biomeID_BlueRidgeMountainsAutumn = config.getInt("Autumn Blue Ridge Mountains Biome ID", "Biome IDs", biomeID_BlueRidgeMountainsAutumn, 0, 255, ""); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Biome Weights + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + biomeWeight_AppalachianMountains = config.getInt("Appalachian Mountains Biome Weight", "Biome Weights", biomeWeight_AppalachianMountains, 0, Integer.MAX_VALUE, ""); + biomeWeight_BlueRidgeMountains = config.getInt("Blue Ridge Mountains Biome Weight", "Biome Weights", biomeWeight_BlueRidgeMountains, 0, Integer.MAX_VALUE, ""); + biomeWeight_BlueRidgeForest = config.getInt("Blue Ridge Forest Biome Weight", "Biome Weights", biomeWeight_BlueRidgeForest, 0, Integer.MAX_VALUE, ""); + biomeWeight_BlueRidgeHills = config.getInt("Blue Ridge Hills Biome Weight", "Biome Weights", biomeWeight_BlueRidgeHills, 0, Integer.MAX_VALUE, ""); + biomeWeight_BlueRidgeBeach = config.getInt("Blue Ridge Beach Biome Weight", "Biome Weights", biomeWeight_BlueRidgeBeach, 0, Integer.MAX_VALUE, ""); + biomeWeight_BlueRidgeRiver = config.getInt("Blue Ridge River Biome Weight", "Biome Weights", biomeWeight_BlueRidgeRiver, 0, Integer.MAX_VALUE, ""); + biomeWeight_Prairie = config.getInt("Prairie Biome Weight", "Biome Weights", biomeWeight_Prairie, 0, Integer.MAX_VALUE, ""); + biomeWeight_SmokyMountains = config.getInt("Smoky Mountains Biome Weight", "Biome Weights", biomeWeight_SmokyMountains, 0, Integer.MAX_VALUE, ""); + + biomeWeight_BlueRidgeForestAutumn = config.getInt("Autumn Blue Ridge Forest Biome Weight", "Biome Weights", biomeWeight_BlueRidgeForestAutumn, 0, Integer.MAX_VALUE, ""); + biomeWeight_BlueRidgeHillsAutumn = config.getInt("Autumn Blue Ridge Hills Biome Weight", "Biome Weights", biomeWeight_BlueRidgeHillsAutumn, 0, Integer.MAX_VALUE, ""); + biomeWeight_BlueRidgeMountainsAutumn = config.getInt("Autumn Blue Ridge Mountains Biome Weight", "Biome Weights", biomeWeight_BlueRidgeMountainsAutumn, 0, Integer.MAX_VALUE, ""); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Debugging + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + enableDebugging = config.getBoolean("Enable Debugging", "Debugging", enableDebugging, "WARNING: This should only be enabled if you know what you're doing." + Configuration.NEW_LINE); + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + } + catch (Exception e) { + + Logger.error("Appalachia had a problem loading Appalachia configuration."); + } + finally { + + if (config.hasChanged()) { + config.save(); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/config/ConfigManager.java b/src/main/java/appalachia/config/ConfigManager.java index 5725496e..2251632d 100644 --- a/src/main/java/appalachia/config/ConfigManager.java +++ b/src/main/java/appalachia/config/ConfigManager.java @@ -2,8 +2,6 @@ import java.io.File; -import appalachia.config.appalachia.ConfigAppalachia; - public class ConfigManager { public static File appalachiaConfigFile; diff --git a/src/main/java/appalachia/config/appalachia/ConfigAppalachia.java b/src/main/java/appalachia/config/appalachia/ConfigAppalachia.java deleted file mode 100644 index f9855e6e..00000000 --- a/src/main/java/appalachia/config/appalachia/ConfigAppalachia.java +++ /dev/null @@ -1,51 +0,0 @@ -package appalachia.config.appalachia; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; - -import appalachia.util.Logger; - - -public class ConfigAppalachia { - - public static Configuration config; - - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // Debugging - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - public static boolean enableDebugging = false; - - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - public static void init(File configFile) { - - config = new Configuration(configFile); - - try { - - config.load(); - - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // Debugging - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - enableDebugging = config.getBoolean("Enable Debugging", "Debugging", enableDebugging, "WARNING: This should only be enabled if you know what you're doing." + Configuration.NEW_LINE); - - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - } - catch (Exception e) { - - Logger.error("Appalachia had a problem loading Appalachia configuration."); - } - finally { - - if (config.hasChanged()) { - config.save(); - } - } - } -} \ No newline at end of file diff --git a/src/main/java/appalachia/entity/EntityManager.java b/src/main/java/appalachia/entity/EntityManager.java new file mode 100644 index 00000000..8720ee3a --- /dev/null +++ b/src/main/java/appalachia/entity/EntityManager.java @@ -0,0 +1,32 @@ +package appalachia.entity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.fml.common.registry.EntityRegistry; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.Appalachia; +import appalachia.client.renderer.entity.RenderBlackBear; +import appalachia.entity.monster.EntityBlackBear; + +public class EntityManager +{ + public static void registerEntities() { + + int id = 1; + + EntityRegistry.registerModEntity(EntityBlackBear.class, "BlackBear", id++, Appalachia.instance, 64, 3, true, 0x000000, 0x80511a); + + // We want our mob to spawn in Plains and ice plains biomes. If you don't add this then it will not spawn automatically + // but you can of course still make it spawn manually + //EntityRegistry.addSpawn(EntityWeirdZombie.class, 100, 3, 5, EnumCreatureType.MONSTER, Biomes.PLAINS, Biomes.ICE_PLAINS); + + // This is the loot table for our mob + //LootTableList.register(EntityPolarBear.LOOT); + } + + @SideOnly(Side.CLIENT) + public static void registerModels() { + RenderingRegistry.registerEntityRenderingHandler(EntityBlackBear.class, RenderBlackBear.FACTORY); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/entity/monster/EntityBlackBear.java b/src/main/java/appalachia/entity/monster/EntityBlackBear.java new file mode 100644 index 00000000..e84b4d3d --- /dev/null +++ b/src/main/java/appalachia/entity/monster/EntityBlackBear.java @@ -0,0 +1,367 @@ +package appalachia.entity.monster; + +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.entity.*; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.datasync.DataParameter; +import net.minecraft.network.datasync.DataSerializers; +import net.minecraft.network.datasync.EntityDataManager; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.World; +import net.minecraft.world.storage.loot.LootTableList; + +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.api.AppalachiaSounds; + +public class EntityBlackBear extends EntityAnimal +{ + private static final DataParameter IS_STANDING = EntityDataManager.createKey(EntityBlackBear.class, DataSerializers.BOOLEAN); + private float field_189799_by; + private float field_189800_bz; + private int field_189797_bB; + + public EntityBlackBear(World worldIn) + { + super(worldIn); + this.setSize(1.3F, 1.4F); + } + + @Override + public EntityAgeable createChild(EntityAgeable ageable) + { + return new EntityBlackBear(this.worldObj); + } + + @Override + public boolean isBreedingItem(ItemStack stack) + { + return false; + } + + @Override + protected void initEntityAI() + { + super.initEntityAI(); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityBlackBear.AIMeleeAttack()); + this.tasks.addTask(1, new EntityBlackBear.AIPanic()); + this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D)); + this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + this.tasks.addTask(7, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityBlackBear.AIHurtByTarget()); + this.targetTasks.addTask(2, new EntityBlackBear.AIAttackPlayer()); + } + + @Override + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D); + this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(20.0D); + this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE); + this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0D); + } + + @Override + protected SoundEvent getAmbientSound() + { + if (this.isChild()) { + return AppalachiaSounds.getRandomSound(AppalachiaSounds.entity_blackbear_baby_idle); + } + else { + return AppalachiaSounds.getRandomSound(AppalachiaSounds.entity_blackbear_idle); + } + } + + @Override + protected SoundEvent getHurtSound() + { + return AppalachiaSounds.getRandomSound(AppalachiaSounds.entity_blackbear_hurt); + } + + @Override + protected SoundEvent getDeathSound() + { + return AppalachiaSounds.getRandomSound(AppalachiaSounds.entity_blackbear_death); + } + + @Override + protected void playStepSound(BlockPos pos, Block blockIn) + { + this.playSound(AppalachiaSounds.getRandomSound(AppalachiaSounds.entity_blackbear_step), 0.15F, 1.0F); + } + + protected void playWarningSound() + { + if (this.field_189797_bB <= 0) + { + this.playSound(AppalachiaSounds.getRandomSound(AppalachiaSounds.entity_blackbear_warning), 1.0F, 1.0F); + this.field_189797_bB = 40; + } + } + + @Nullable + @Override + protected ResourceLocation getLootTable() + { + return LootTableList.ENTITIES_POLAR_BEAR; + } + + @Override + protected void entityInit() + { + super.entityInit(); + this.dataManager.register(IS_STANDING, Boolean.valueOf(false)); + } + + @Override + public void readEntityFromNBT(NBTTagCompound compound) + { + super.readEntityFromNBT(compound); + } + + @Override + public void writeEntityToNBT(NBTTagCompound compound) + { + super.writeEntityToNBT(compound); + } + + @Override + public void onUpdate() + { + super.onUpdate(); + + if (this.worldObj.isRemote) + { + this.field_189799_by = this.field_189800_bz; + + if (this.isStanding()) + { + this.field_189800_bz = MathHelper.clamp_float(this.field_189800_bz + 1.0F, 0.0F, 6.0F); + } + else + { + this.field_189800_bz = MathHelper.clamp_float(this.field_189800_bz - 1.0F, 0.0F, 6.0F); + } + } + + if (this.field_189797_bB > 0) + { + --this.field_189797_bB; + } + } + + @Override + public boolean attackEntityAsMob(Entity entityIn) + { + boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), (float)((int)this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue())); + + if (flag) + { + this.applyEnchantments(this, entityIn); + } + + return flag; + } + + public boolean isStanding() + { + return ((Boolean)this.dataManager.get(IS_STANDING)).booleanValue(); + } + + public void setStanding(boolean standing) + { + this.dataManager.set(IS_STANDING, Boolean.valueOf(standing)); + } + + @SideOnly(Side.CLIENT) + public float func_189795_r(float p_189795_1_) + { + return (this.field_189799_by + (this.field_189800_bz - this.field_189799_by) * p_189795_1_) / 6.0F; + } + + @Override + protected float func_189749_co() + { + return 0.98F; + } + + @Override + public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) + { + if (livingdata instanceof EntityBlackBear.GroupData) + { + if (((EntityBlackBear.GroupData)livingdata).field_190101_a) + { + this.setGrowingAge(-24000); + } + } + else + { + EntityBlackBear.GroupData entityblackbear$groupdata = new EntityBlackBear.GroupData(); + entityblackbear$groupdata.field_190101_a = true; + livingdata = entityblackbear$groupdata; + } + + return (IEntityLivingData)livingdata; + } + + class AIAttackPlayer extends EntityAINearestAttackableTarget + { + public AIAttackPlayer() + { + super(EntityBlackBear.this, EntityPlayer.class, 20, true, true, null); + } + + @Override + public boolean shouldExecute() + { + if (EntityBlackBear.this.isChild()) + { + return false; + } + else + { + if (super.shouldExecute()) + { + for (EntityBlackBear entityblackbear : EntityBlackBear.this.worldObj.getEntitiesWithinAABB(EntityBlackBear.class, EntityBlackBear.this.getEntityBoundingBox().expand(8.0D, 4.0D, 8.0D))) + { + if (entityblackbear.isChild()) + { + return true; + } + } + } + + EntityBlackBear.this.setAttackTarget((EntityLivingBase)null); + return false; + } + } + + @Override + protected double getTargetDistance() + { + return super.getTargetDistance() * 0.5D; + } + } + + class AIHurtByTarget extends EntityAIHurtByTarget + { + public AIHurtByTarget() + { + super(EntityBlackBear.this, false, new Class[0]); + } + + @Override + public void startExecuting() + { + super.startExecuting(); + + if (EntityBlackBear.this.isChild()) + { + this.func_190105_f(); + this.resetTask(); + } + } + + @Override + protected void setEntityAttackTarget(EntityCreature creatureIn, EntityLivingBase entityLivingBaseIn) + { + if (creatureIn instanceof EntityBlackBear && !((EntityBlackBear)creatureIn).isChild()) + { + super.setEntityAttackTarget(creatureIn, entityLivingBaseIn); + } + } + } + + class AIMeleeAttack extends EntityAIAttackMelee + { + public AIMeleeAttack() + { + super(EntityBlackBear.this, 1.25D, true); + } + + @Override + protected void func_190102_a(EntityLivingBase p_190102_1_, double p_190102_2_) + { + double d0 = this.getAttackReachSqr(p_190102_1_); + + if (p_190102_2_ <= d0 && this.attackTick <= 0) + { + this.attackTick = 20; + this.attacker.attackEntityAsMob(p_190102_1_); + EntityBlackBear.this.setStanding(false); + } + else if (p_190102_2_ <= d0 * 2.0D) + { + if (this.attackTick <= 0) + { + EntityBlackBear.this.setStanding(false); + this.attackTick = 20; + } + + if (this.attackTick <= 10) + { + EntityBlackBear.this.setStanding(true); + EntityBlackBear.this.playWarningSound(); + } + } + else + { + this.attackTick = 20; + EntityBlackBear.this.setStanding(false); + } + } + + @Override + public void resetTask() + { + EntityBlackBear.this.setStanding(false); + super.resetTask(); + } + + @Override + protected double getAttackReachSqr(EntityLivingBase attackTarget) + { + return (double)(4.0F + attackTarget.width); + } + } + + class AIPanic extends EntityAIPanic + { + public AIPanic() + { + super(EntityBlackBear.this, 2.0D); + } + + @Override + public boolean shouldExecute() + { + return !EntityBlackBear.this.isChild() && !EntityBlackBear.this.isBurning() ? false : super.shouldExecute(); + } + } + + static class GroupData implements IEntityLivingData + { + public boolean field_190101_a; + + private GroupData() + { + } + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/event/EventManager.java b/src/main/java/appalachia/event/EventManager.java index 9901d897..6acbdc25 100644 --- a/src/main/java/appalachia/event/EventManager.java +++ b/src/main/java/appalachia/event/EventManager.java @@ -1,9 +1,19 @@ package appalachia.event; +import java.util.Random; + +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.biome.Biome; + import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; +import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.Event; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import appalachia.api.AppalachiaAPI; +import appalachia.api.biome.decorator.AppalachiaDecorator; import appalachia.util.Logger; @@ -11,6 +21,8 @@ public class EventManager { // Event handlers. private final WorldEventAppalachia WORLD_EVENT_HANDLER = new WorldEventAppalachia(); + private final DecorateBiomeEventAppalachia DECORATE_BIOME_EVENT_HANDLER = new DecorateBiomeEventAppalachia(); + private final PopulateChunkEventAppalachia POPULATE_CHUNK_EVENT_HANDLER = new PopulateChunkEventAppalachia(); private long worldSeed; @@ -35,6 +47,9 @@ public void onWorldLoad(WorldEvent.Load event) { worldSeed = event.getWorld().getSeed(); Logger.info("World Seed: " + worldSeed); } + + // Use the world seed to set the global random. + AppalachiaAPI.rand = new Random(worldSeed); } @SubscribeEvent @@ -45,6 +60,63 @@ public void onWorldUnload(WorldEvent.Unload event) { } } + public class DecorateBiomeEventAppalachia { + + DecorateBiomeEventAppalachia() { + + logEventMessage("Initialising DecorateBiomeEventAppalachia..."); + } + + @SubscribeEvent + public void onBiomeDecorate(DecorateBiomeEvent.Decorate event) { + + switch (event.getType()) { + // Prevent all flowing liquids (waterfalls/lavafalls) from generating, no exceptions. + case LAKE_WATER: + case LAKE_LAVA: + + event.setResult(Event.Result.DENY); + + default: + break; + } + } + } + + public class PopulateChunkEventAppalachia { + + PopulateChunkEventAppalachia() { + + logEventMessage("Initialising PopulateChunkEventAppalachia..."); + } + + @SubscribeEvent + public void onPopulate(PopulateChunkEvent.Populate event) { + + switch (event.getType()) { + + // Prevent ponds from generating, depending on the biome. + case LAKE: + case LAVA: + + Biome biome = event.getWorld().getBiome(new BlockPos(event.getChunkX() * 16 + 8, 0, event.getChunkZ() * 16 + 8)); + + if (biome.theBiomeDecorator instanceof AppalachiaDecorator) { + + AppalachiaDecorator decorator = (AppalachiaDecorator)biome.theBiomeDecorator; + + if (!decorator.generatePonds) { + event.setResult(Event.Result.DENY); + return; + } + } + + default: + break; + } + } + } + /* * This method registers most of Appalachia's event handlers. */ @@ -53,11 +125,14 @@ public void registerEventHandlers() { logEventMessage("Registering Appalachia's event handlers..."); MinecraftForge.EVENT_BUS.register(WORLD_EVENT_HANDLER); + MinecraftForge.TERRAIN_GEN_BUS.register(DECORATE_BIOME_EVENT_HANDLER); + MinecraftForge.TERRAIN_GEN_BUS.register(POPULATE_CHUNK_EVENT_HANDLER); logEventMessage("Appalachia's event handlers have been registered successfully."); } private static void logEventMessage(String message) { + Logger.debug("Appalachia Event System: " + message); } } \ No newline at end of file diff --git a/src/main/java/appalachia/gui/AppalachiaTabs.java b/src/main/java/appalachia/gui/AppalachiaTabs.java new file mode 100644 index 00000000..3169852c --- /dev/null +++ b/src/main/java/appalachia/gui/AppalachiaTabs.java @@ -0,0 +1,27 @@ +package appalachia.gui; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +import appalachia.api.AppalachiaBlocks; + +public class AppalachiaTabs { + + public static final CreativeTabs tabBlock = new CreativeTabs("appalachiablocks") { + + @Override + public Item getTabIconItem() { + + return Item.getItemFromBlock(AppalachiaBlocks.log_autumn_grey); + } + }; + + public static final CreativeTabs tabDecoration = new CreativeTabs("appalachiadecorations") { + + @Override + public Item getTabIconItem() { + + return Item.getItemFromBlock(AppalachiaBlocks.leaves_autumn_red); + } + }; +} diff --git a/src/main/java/appalachia/item/ItemManager.java b/src/main/java/appalachia/item/ItemManager.java new file mode 100644 index 00000000..15f61bae --- /dev/null +++ b/src/main/java/appalachia/item/ItemManager.java @@ -0,0 +1,55 @@ +package appalachia.item; + +import java.util.List; + +import net.minecraft.client.renderer.block.model.ModelBakery; +import net.minecraft.client.renderer.block.model.ModelResourceLocation; +import net.minecraft.item.Item; +import net.minecraft.util.ResourceLocation; + +import net.minecraftforge.client.model.ModelLoader; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.reference.ModInfo; +import com.google.common.collect.Lists; + +public class ItemManager { + + public static void registerItems() { + + } + + @SideOnly(Side.CLIENT) + public static void registerModels() { + + } + + @SideOnly(Side.CLIENT) + public static void registerModel(Item item, String modelName) { + + ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(ModInfo.MOD_ID + ":" + modelName, "inventory")); + } + + @SideOnly(Side.CLIENT) + public static void registerModel(Item item) { + + registerModel(item, item.getRegistryName().getResourcePath()); + } + + @SideOnly(Side.CLIENT) + public static void registerModelWithMeta(Item item, String... modelName) { + + List models = Lists.newArrayList(); + + for (String model : modelName) { + models.add(new ModelResourceLocation(ModInfo.MOD_ID + ":" + model, "inventory")); + } + + ModelBakery.registerItemVariants(item, models.toArray(new ResourceLocation[models.size()])); + + for (int i = 0; i < models.size(); ++i) { + ModelLoader.setCustomModelResourceLocation(item, i, models.get(i)); + } + } +} diff --git a/src/main/java/appalachia/item/leaves/fallen/AppalachiaItemLeavesFallen.java b/src/main/java/appalachia/item/leaves/fallen/AppalachiaItemLeavesFallen.java new file mode 100644 index 00000000..05cd1fa4 --- /dev/null +++ b/src/main/java/appalachia/item/leaves/fallen/AppalachiaItemLeavesFallen.java @@ -0,0 +1,81 @@ +package appalachia.item.leaves.fallen; + +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import appalachia.block.leaves.fallen.AppalachiaBlockLeavesFallen; + +public class AppalachiaItemLeavesFallen extends ItemBlock { + + public AppalachiaItemLeavesFallen(Block block) { + + super(block); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { + + if (stack.stackSize != 0 && player.canPlayerEdit(pos, facing, stack)) { + IBlockState state = world.getBlockState(pos); + Block block = state.getBlock(); + BlockPos blockpos = pos; + + if ((facing != EnumFacing.UP || block != this.block) && !block.isReplaceable(world, pos)) { + blockpos = pos.offset(facing); + state = world.getBlockState(blockpos); + block = state.getBlock(); + } + + if (block == this.block) { + int i = state.getValue(((AppalachiaBlockLeavesFallen)this.block).LAYERS).intValue(); + + if (i <= 7) { + IBlockState blockState = state.withProperty(((AppalachiaBlockLeavesFallen)this.block).LAYERS, Integer.valueOf(i + 1)); + AxisAlignedBB box = blockState.getSelectedBoundingBox(world, blockpos); + + if (box != Block.NULL_AABB && world.checkNoEntityCollision(box.offset(blockpos)) && world.setBlockState(blockpos, blockState, 10)) { + SoundType sound = this.block.getSoundType(); + + world.playSound(player, blockpos, sound.getPlaceSound(), SoundCategory.BLOCKS, (sound.getVolume() + 1.0F) / 2.0F, sound.getPitch() * 0.8F); + + --stack.stackSize; + + return EnumActionResult.SUCCESS; + } + } + } + + return super.onItemUse(stack, player, world, blockpos, hand, facing, hitX, hitY, hitZ); + } + else { + return EnumActionResult.FAIL; + } + } + + @Override + public int getMetadata(int damage) { + + return damage; + } + + @Override + public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) { + + IBlockState state = world.getBlockState(pos); + + return state.getBlock() != block || state.getValue(((AppalachiaBlockLeavesFallen)this.block).LAYERS).intValue() > 7 ? super.canPlaceBlockOnSide(world, pos, side, player, stack) : true; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/item/slabs/AppalachiaItemSlab.java b/src/main/java/appalachia/item/slabs/AppalachiaItemSlab.java new file mode 100644 index 00000000..b7e8189d --- /dev/null +++ b/src/main/java/appalachia/item/slabs/AppalachiaItemSlab.java @@ -0,0 +1,116 @@ +package appalachia.item.slabs; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.SoundType; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.planks.AppalachiaBlockPlanks; + +public class AppalachiaItemSlab extends ItemBlock { + + protected IBlockState fullBlock; + + public AppalachiaItemSlab(Block block) { + + super(block); + this.fullBlock = AppalachiaBlocks.planks_autumn_grey.getDefaultState(); + } + + public AppalachiaItemSlab(Block block, IBlockState fullBlock) { + + this(block); + this.fullBlock = fullBlock; + } + + protected IBlockState getFullBlock() { + + return this.fullBlock.withProperty(AppalachiaBlockPlanks.DOUBLE, Boolean.valueOf(true)); + } + + @Override + public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) { + + if (stack.stackSize > 0 && player.canPlayerEdit(pos.offset(side), side, stack)) { + IBlockState state = world.getBlockState(pos); + + if (state.getBlock() == block) { + BlockSlab.EnumBlockHalf half = state.getValue(BlockSlab.HALF); + + if (side == EnumFacing.UP && half == BlockSlab.EnumBlockHalf.BOTTOM || side == EnumFacing.DOWN && half == BlockSlab.EnumBlockHalf.TOP) { + IBlockState blockstate = getFullBlock(); + AxisAlignedBB box = blockstate.getSelectedBoundingBox(world, pos); + + if (box != Block.NULL_AABB && world.checkNoEntityCollision(box.offset(pos)) && world.setBlockState(pos, blockstate, 11)) { + SoundType sound = blockstate.getBlock().getSoundType(); + + world.playSound(player, pos, sound.getPlaceSound(), SoundCategory.BLOCKS, (sound.getVolume() + 1.0F) / 2.0F, sound.getPitch() * 0.8F); + + --stack.stackSize; + } + + return EnumActionResult.SUCCESS; + } + } + + return tryPlace(player, stack, world, pos.offset(side)) ? EnumActionResult.SUCCESS : super.onItemUse(stack, player, world, pos, hand, side, hitX, hitY, hitZ); + } + + return EnumActionResult.FAIL; + } + + @SideOnly(Side.CLIENT) + @Override + public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack) { + + BlockPos blockpos = pos; + IBlockState state = world.getBlockState(pos); + + if (state.getBlock() == block) { + boolean flag = state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP; + + if (side == EnumFacing.UP && !flag || side == EnumFacing.DOWN && flag) { + return true; + } + } + + pos = pos.offset(side); + state = world.getBlockState(pos); + + return state.getBlock() == block || super.canPlaceBlockOnSide(world, blockpos, side, player, stack); + } + + protected boolean tryPlace(EntityPlayer player, ItemStack stack, World world, BlockPos pos) { + + if (world.getBlockState(pos).getBlock() == block) { + IBlockState state = getFullBlock(); + AxisAlignedBB box = state.getSelectedBoundingBox(world, pos); + + if (box != Block.NULL_AABB && world.checkNoEntityCollision(box.offset(pos)) && world.setBlockState(pos, state, 11)) { + SoundType sound = state.getBlock().getSoundType(); + + world.playSound(player, pos, sound.getPlaceSound(), SoundCategory.BLOCKS, (sound.getVolume() + 1.0F) / 2.0F, sound.getPitch() * 0.8F); + + --stack.stackSize; + } + + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/item/slabs/ItemSlabAutumnGrey.java b/src/main/java/appalachia/item/slabs/ItemSlabAutumnGrey.java new file mode 100644 index 00000000..db1e48c1 --- /dev/null +++ b/src/main/java/appalachia/item/slabs/ItemSlabAutumnGrey.java @@ -0,0 +1,21 @@ +package appalachia.item.slabs; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.planks.BlockPlanksAutumnGrey; + +public class ItemSlabAutumnGrey extends AppalachiaItemSlab { + + public ItemSlabAutumnGrey(Block block) { + + super(block); + } + + @Override + protected IBlockState getFullBlock() { + + return AppalachiaBlocks.planks_autumn_grey.getDefaultState().withProperty(BlockPlanksAutumnGrey.DOUBLE, Boolean.valueOf(true)); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/item/slabs/ItemSlabBlueRidge01.java b/src/main/java/appalachia/item/slabs/ItemSlabBlueRidge01.java new file mode 100644 index 00000000..20a400b8 --- /dev/null +++ b/src/main/java/appalachia/item/slabs/ItemSlabBlueRidge01.java @@ -0,0 +1,21 @@ +package appalachia.item.slabs; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.planks.BlockPlanksBlueRidge01; + +public class ItemSlabBlueRidge01 extends AppalachiaItemSlab { + + public ItemSlabBlueRidge01(Block block) { + + super(block); + } + + @Override + protected IBlockState getFullBlock() { + + return AppalachiaBlocks.planks_blueridge_01.getDefaultState().withProperty(BlockPlanksBlueRidge01.DOUBLE, Boolean.valueOf(true)); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/item/slabs/ItemSlabBlueRidge02.java b/src/main/java/appalachia/item/slabs/ItemSlabBlueRidge02.java new file mode 100644 index 00000000..d51e131d --- /dev/null +++ b/src/main/java/appalachia/item/slabs/ItemSlabBlueRidge02.java @@ -0,0 +1,21 @@ +package appalachia.item.slabs; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.planks.BlockPlanksBlueRidge02; + +public class ItemSlabBlueRidge02 extends AppalachiaItemSlab { + + public ItemSlabBlueRidge02(Block block) { + + super(block); + } + + @Override + protected IBlockState getFullBlock() { + + return AppalachiaBlocks.planks_blueridge_02.getDefaultState().withProperty(BlockPlanksBlueRidge02.DOUBLE, Boolean.valueOf(true)); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/item/slabs/ItemSlabBlueRidge03.java b/src/main/java/appalachia/item/slabs/ItemSlabBlueRidge03.java new file mode 100644 index 00000000..3ca7df7b --- /dev/null +++ b/src/main/java/appalachia/item/slabs/ItemSlabBlueRidge03.java @@ -0,0 +1,21 @@ +package appalachia.item.slabs; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.planks.BlockPlanksBlueRidge03; + +public class ItemSlabBlueRidge03 extends AppalachiaItemSlab { + + public ItemSlabBlueRidge03(Block block) { + + super(block); + } + + @Override + protected IBlockState getFullBlock() { + + return AppalachiaBlocks.planks_blueridge_03.getDefaultState().withProperty(BlockPlanksBlueRidge03.DOUBLE, Boolean.valueOf(true)); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/proxy/ClientProxy.java b/src/main/java/appalachia/proxy/ClientProxy.java index 91052b6f..5f31d65f 100644 --- a/src/main/java/appalachia/proxy/ClientProxy.java +++ b/src/main/java/appalachia/proxy/ClientProxy.java @@ -1,21 +1,35 @@ package appalachia.proxy; +import net.minecraft.client.Minecraft; + import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import appalachia.api.AppalachiaBlocks; +import appalachia.block.leaves.fallen.AppalachiaBlockLeavesFallen; +import appalachia.entity.EntityManager; -public class ClientProxy extends appalachia.proxy.CommonProxy { +public class ClientProxy extends CommonProxy { + + public static final String LOCATION = "appalachia.proxy.ClientProxy"; @Override public void preInit(FMLPreInitializationEvent event) { super.preInit(event); + + EntityManager.registerModels(); } @Override public void init(FMLInitializationEvent event) { super.init(event); + + registerColorHandlers(); } @Override @@ -23,4 +37,9 @@ public void postInit(FMLPostInitializationEvent event) { super.postInit(event); } + + @SideOnly(Side.CLIENT) + public static void registerColorHandlers(){ + Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(new AppalachiaBlockLeavesFallen.ColourHandler(), AppalachiaBlocks.leaves_oak_fallen); + } } diff --git a/src/main/java/appalachia/proxy/CommonProxy.java b/src/main/java/appalachia/proxy/CommonProxy.java index d081edbe..24d36824 100644 --- a/src/main/java/appalachia/proxy/CommonProxy.java +++ b/src/main/java/appalachia/proxy/CommonProxy.java @@ -4,10 +4,15 @@ import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import appalachia.entity.EntityManager; + public class CommonProxy { + public static final String LOCATION = "appalachia.proxy.CommonProxy"; + public void preInit(FMLPreInitializationEvent event) { + EntityManager.registerEntities(); } public void init(FMLInitializationEvent event) { @@ -17,4 +22,6 @@ public void init(FMLInitializationEvent event) { public void postInit(FMLPostInitializationEvent event) { } + + public void registerRenderers() {} } \ No newline at end of file diff --git a/src/main/java/appalachia/reference/ModInfo.java b/src/main/java/appalachia/reference/ModInfo.java index 53ec4197..935877f7 100644 --- a/src/main/java/appalachia/reference/ModInfo.java +++ b/src/main/java/appalachia/reference/ModInfo.java @@ -1,17 +1,14 @@ package appalachia.reference; -import net.minecraftforge.common.ForgeVersion; -public class ModInfo { - public static final String MOD_ID = "@MOD_ID@"; - public static final String MOD_NAME = "@MOD_NAME@"; +public class ModInfo +{ + public static final String MOD_ID = "appalachia"; // DO NOT MODIFY! This gets replaced during gradle build. + public static final String MOD_NAME = "Appalachia"; // DO NOT MODIFY! This gets replaced during gradle build. public static final String MOD_VERSION = "@MOD_VERSION@"; - public static final String FORGE_DEP = "" + ForgeVersion.majorVersion + '.' - + ForgeVersion.minorVersion + '.' - + ForgeVersion.revisionVersion + '.' - + ForgeVersion.buildVersion; - public static final String MOD_DEPS = ""; - public static final String PROXY_COMMON = "appalachia.proxy.CommonProxy"; - public static final String PROXY_CLIENT = "appalachia.proxy.ClientProxy"; - public static final String CONFIG_DIRECTORY = "Appalachia"; + public static final String MCF_MINVER = "0.0-MCF+MINVER"; + public static final String MCF_MAXVER = "9001.0-MCF+MAXVER"; + public static final String RTG_MINVER = "0.0-RTG+MINVER"; + public static final String RTG_MAXVER = "9001.0-RTG+MINVER"; + public static final String CONFIG_DIRECTORY = MOD_NAME; } diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPL.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPL.java new file mode 100644 index 00000000..53dad68f --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPL.java @@ -0,0 +1,38 @@ +package appalachia.rtg.api.biome.appalachia.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigAPL { + + public static BiomeConfig biomeConfigAPLAppalachianMountains; + public static BiomeConfig biomeConfigAPLBlueRidgeForest; + public static BiomeConfig biomeConfigAPLBlueRidgeHills; + public static BiomeConfig biomeConfigAPLBlueRidgeBeach; + public static BiomeConfig biomeConfigAPLBlueRidgeRiver; + public static BiomeConfig biomeConfigAPLBlueRidgeMountains; + public static BiomeConfig biomeConfigAPLPrairie; + public static BiomeConfig biomeConfigAPLSmokyMountains; + + public static BiomeConfig biomeConfigAPLBlueRidgeForestAutumn; + public static BiomeConfig biomeConfigAPLBlueRidgeHillsAutumn; + public static BiomeConfig biomeConfigAPLBlueRidgeMountainsAutumn; + + public static BiomeConfig[] getBiomeConfigs() { + + BiomeConfig[] biomeConfigs = new BiomeConfig[]{ + biomeConfigAPLAppalachianMountains, + biomeConfigAPLBlueRidgeForest, + biomeConfigAPLBlueRidgeHills, + biomeConfigAPLBlueRidgeBeach, + biomeConfigAPLBlueRidgeRiver, + biomeConfigAPLBlueRidgeMountains, + biomeConfigAPLPrairie, + biomeConfigAPLSmokyMountains, + biomeConfigAPLBlueRidgeForestAutumn, + biomeConfigAPLBlueRidgeHillsAutumn, + biomeConfigAPLBlueRidgeMountainsAutumn + }; + + return biomeConfigs; + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLAppalachianMountains.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLAppalachianMountains.java new file mode 100644 index 00000000..ace9a43f --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLAppalachianMountains.java @@ -0,0 +1,10 @@ +package appalachia.rtg.api.biome.appalachia.config; + + +public class BiomeConfigAPLAppalachianMountains extends BiomeConfigAPLBase { + + public BiomeConfigAPLAppalachianMountains() { + + super("appalachianmountains"); + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBase.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBase.java new file mode 100644 index 00000000..1247a541 --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBase.java @@ -0,0 +1,11 @@ +package appalachia.rtg.api.biome.appalachia.config; + +import rtg.api.biome.BiomeConfig; + +public class BiomeConfigAPLBase extends BiomeConfig { + + public BiomeConfigAPLBase(String biomeSlug) { + + super("appalachia", biomeSlug); + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeBeach.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeBeach.java new file mode 100644 index 00000000..5483947e --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeBeach.java @@ -0,0 +1,21 @@ +package appalachia.rtg.api.biome.appalachia.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigAPLBlueRidgeBeach extends BiomeConfigAPLBase { + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigAPLBlueRidgeBeach() { + + super("blueridgebeach"); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, BiomeConfigProperty.Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, BiomeConfigProperty.Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeForest.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeForest.java new file mode 100644 index 00000000..9c99458a --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeForest.java @@ -0,0 +1,26 @@ +package appalachia.rtg.api.biome.appalachia.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigAPLBlueRidgeForest extends BiomeConfigAPLBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigAPLBlueRidgeForest() { + + super("blueridgeforest"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, BiomeConfigProperty.Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, BiomeConfigProperty.Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeForestAutumn.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeForestAutumn.java new file mode 100644 index 00000000..7fb8a591 --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeForestAutumn.java @@ -0,0 +1,26 @@ +package appalachia.rtg.api.biome.appalachia.config; + +import rtg.api.biome.BiomeConfigProperty; + + +public class BiomeConfigAPLBlueRidgeForestAutumn extends BiomeConfigAPLBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigAPLBlueRidgeForestAutumn() { + + super("blueridgeforestautumn"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, BiomeConfigProperty.Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, BiomeConfigProperty.Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeHills.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeHills.java new file mode 100644 index 00000000..02b007aa --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeHills.java @@ -0,0 +1,26 @@ +package appalachia.rtg.api.biome.appalachia.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigAPLBlueRidgeHills extends BiomeConfigAPLBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigAPLBlueRidgeHills() { + + super("blueridgehills"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, BiomeConfigProperty.Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, BiomeConfigProperty.Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeHillsAutumn.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeHillsAutumn.java new file mode 100644 index 00000000..9ff19111 --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeHillsAutumn.java @@ -0,0 +1,26 @@ +package appalachia.rtg.api.biome.appalachia.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigAPLBlueRidgeHillsAutumn extends BiomeConfigAPLBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigAPLBlueRidgeHillsAutumn() { + + super("blueridgehillsautumn"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, BiomeConfigProperty.Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, BiomeConfigProperty.Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeMountains.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeMountains.java new file mode 100644 index 00000000..db6144ca --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeMountains.java @@ -0,0 +1,26 @@ +package appalachia.rtg.api.biome.appalachia.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigAPLBlueRidgeMountains extends BiomeConfigAPLBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigAPLBlueRidgeMountains() { + + super("blueridgemountains"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, BiomeConfigProperty.Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, BiomeConfigProperty.Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeMountainsAutumn.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeMountainsAutumn.java new file mode 100644 index 00000000..b94c9ba5 --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeMountainsAutumn.java @@ -0,0 +1,26 @@ +package appalachia.rtg.api.biome.appalachia.config; + + +import rtg.api.biome.BiomeConfigProperty; + +public class BiomeConfigAPLBlueRidgeMountainsAutumn extends BiomeConfigAPLBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public static final String surfaceMixBlockId = "surfaceMixBlock"; + public static final String surfaceMixBlockName = "RTG Surface: Mix Block"; + + public static final String surfaceMixBlockMetaId = "surfaceMixBlockMeta"; + public static final String surfaceMixBlockMetaName = "RTG Surface: Mix Block Meta"; + + public BiomeConfigAPLBlueRidgeMountainsAutumn() { + + super("blueridgemountainsautumn"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, BiomeConfigProperty.Type.BOOLEAN, decorationLogsName, "", true)); + + this.addProperty(new BiomeConfigProperty(surfaceMixBlockId, BiomeConfigProperty.Type.STRING, surfaceMixBlockName, "", "")); + this.addProperty(new BiomeConfigProperty(surfaceMixBlockMetaId, BiomeConfigProperty.Type.STRING, surfaceMixBlockMetaName, "", "")); + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeRiver.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeRiver.java new file mode 100644 index 00000000..0c4be6a9 --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLBlueRidgeRiver.java @@ -0,0 +1,10 @@ +package appalachia.rtg.api.biome.appalachia.config; + + +public class BiomeConfigAPLBlueRidgeRiver extends BiomeConfigAPLBase { + + public BiomeConfigAPLBlueRidgeRiver() { + + super("blueridgeriver"); + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLPrairie.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLPrairie.java new file mode 100644 index 00000000..5627d464 --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLPrairie.java @@ -0,0 +1,10 @@ +package appalachia.rtg.api.biome.appalachia.config; + + +public class BiomeConfigAPLPrairie extends BiomeConfigAPLBase { + + public BiomeConfigAPLPrairie() { + + super("prairie"); + } +} diff --git a/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLSmokyMountains.java b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLSmokyMountains.java new file mode 100644 index 00000000..8941a016 --- /dev/null +++ b/src/main/java/appalachia/rtg/api/biome/appalachia/config/BiomeConfigAPLSmokyMountains.java @@ -0,0 +1,18 @@ +package appalachia.rtg.api.biome.appalachia.config; + +import rtg.api.biome.BiomeConfigProperty; +import rtg.api.biome.BiomeConfigProperty.Type; + + +public class BiomeConfigAPLSmokyMountains extends BiomeConfigAPLBase { + + public static final String decorationLogsId = "decorationLogs"; + public static final String decorationLogsName = "RTG Decoration: Logs"; + + public BiomeConfigAPLSmokyMountains() { + + super("smokymountains"); + + this.addProperty(new BiomeConfigProperty(decorationLogsId, Type.BOOLEAN, decorationLogsName, "", true)); + } +} diff --git a/src/main/java/appalachia/rtg/config/BiomeConfigManagerAPL.java b/src/main/java/appalachia/rtg/config/BiomeConfigManagerAPL.java new file mode 100644 index 00000000..68498c59 --- /dev/null +++ b/src/main/java/appalachia/rtg/config/BiomeConfigManagerAPL.java @@ -0,0 +1,27 @@ +package appalachia.rtg.config; + +import appalachia.rtg.api.biome.appalachia.config.*; + + +public class BiomeConfigManagerAPL { + + public static void initBiomeConfigs() { + + initBiomeConfigsAPL(); + } + + public static void initBiomeConfigsAPL() { + + BiomeConfigAPL.biomeConfigAPLAppalachianMountains = new BiomeConfigAPLAppalachianMountains(); + BiomeConfigAPL.biomeConfigAPLBlueRidgeForestAutumn = new BiomeConfigAPLBlueRidgeForestAutumn(); + BiomeConfigAPL.biomeConfigAPLBlueRidgeForest = new BiomeConfigAPLBlueRidgeForest(); + BiomeConfigAPL.biomeConfigAPLBlueRidgeHillsAutumn = new BiomeConfigAPLBlueRidgeHillsAutumn(); + BiomeConfigAPL.biomeConfigAPLBlueRidgeHills = new BiomeConfigAPLBlueRidgeHills(); + BiomeConfigAPL.biomeConfigAPLBlueRidgeBeach = new BiomeConfigAPLBlueRidgeBeach(); + BiomeConfigAPL.biomeConfigAPLBlueRidgeRiver = new BiomeConfigAPLBlueRidgeRiver(); + BiomeConfigAPL.biomeConfigAPLBlueRidgeMountains = new BiomeConfigAPLBlueRidgeMountains(); + BiomeConfigAPL.biomeConfigAPLBlueRidgeMountainsAutumn = new BiomeConfigAPLBlueRidgeMountainsAutumn(); + BiomeConfigAPL.biomeConfigAPLPrairie = new BiomeConfigAPLPrairie(); + BiomeConfigAPL.biomeConfigAPLSmokyMountains = new BiomeConfigAPLSmokyMountains(); + } +} diff --git a/src/main/java/appalachia/rtg/config/ConfigManagerAPL.java b/src/main/java/appalachia/rtg/config/ConfigManagerAPL.java new file mode 100644 index 00000000..3b98385c --- /dev/null +++ b/src/main/java/appalachia/rtg/config/ConfigManagerAPL.java @@ -0,0 +1,17 @@ +package appalachia.rtg.config; + +import java.io.File; + +import appalachia.rtg.config.appalachia.ConfigAPL; + +public class ConfigManagerAPL { + + public static File aplConfigFile; + + public static void init(String configpath) { + + aplConfigFile = new File(configpath + "biomes/appalachia.cfg"); + + ConfigAPL.init(aplConfigFile); + } +} diff --git a/src/main/java/appalachia/rtg/config/appalachia/ConfigAPL.java b/src/main/java/appalachia/rtg/config/appalachia/ConfigAPL.java new file mode 100644 index 00000000..6af0483b --- /dev/null +++ b/src/main/java/appalachia/rtg/config/appalachia/ConfigAPL.java @@ -0,0 +1,34 @@ +package appalachia.rtg.config.appalachia; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; + +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPL; + +import rtg.config.BiomeConfigManager; +import rtg.util.Logger; + +public class ConfigAPL { + + public static Configuration config; + + public static void init(File configFile) { + + config = new Configuration(configFile); + + try { + config.load(); + + BiomeConfigManager.setBiomeConfigsFromUserConfigs(BiomeConfigAPL.getBiomeConfigs(), config); + } + catch (Exception e) { + Logger.error("RTG had a problem loading APL configuration."); + } + finally { + if (config.hasChanged()) { + config.save(); + } + } + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/deco/collection/DecoCollectionBlueRidgeForest.java b/src/main/java/appalachia/rtg/world/biome/deco/collection/DecoCollectionBlueRidgeForest.java new file mode 100644 index 00000000..fdbdee9c --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/deco/collection/DecoCollectionBlueRidgeForest.java @@ -0,0 +1,264 @@ +package appalachia.rtg.world.biome.deco.collection; + +import net.minecraft.init.Blocks; +import net.minecraft.world.gen.feature.WorldGenTrees; +import net.minecraft.world.gen.feature.WorldGenerator; + +import appalachia.api.AppalachiaBlocks; +import appalachia.api.block.IAppalachiaBlockLeavesFallen; +import appalachia.rtg.world.gen.feature.tree.rtg.AppalachiaTree; +import appalachia.rtg.world.gen.feature.tree.rtg.TreeAbiesGrandis; +import appalachia.rtg.world.gen.feature.tree.rtg.TreeAcerRubrum; + +import rtg.util.BlockUtil; +import rtg.world.biome.deco.*; +import rtg.world.biome.deco.DecoFallenTree.LogCondition; +import rtg.world.biome.deco.DecoTree.TreeCondition; +import rtg.world.biome.deco.DecoTree.TreeType; +import rtg.world.biome.deco.collection.DecoCollectionBase; +import rtg.world.biome.deco.helper.DecoHelper5050; +import rtg.world.biome.deco.helper.DecoHelperRandomSplit; +import rtg.world.gen.feature.tree.rtg.TreeRTG; +import rtg.world.gen.feature.tree.rtg.TreeRTGBetulaPapyrifera; +import rtg.world.gen.feature.tree.rtg.TreeRTGPiceaSitchensis; +import rtg.world.gen.feature.tree.rtg.TreeRTGPinusPonderosa; + + +/** + * @author WhichOnesPink + */ +public class DecoCollectionBlueRidgeForest extends DecoCollectionBase { + + protected static int treeMaxY = 220; + protected static int shrubMaxY = 220; + + public DecoCollectionBlueRidgeForest(boolean fallenTrees) { + + AppalachiaTree aplGrandFirTreeOak = new TreeAbiesGrandis(); + aplGrandFirTreeOak.logBlock = AppalachiaBlocks.log_blueridge_01.getDefaultState(); + aplGrandFirTreeOak.leavesBlock = Blocks.LEAVES.getDefaultState(); + aplGrandFirTreeOak.minTrunkSize = 10; + aplGrandFirTreeOak.maxTrunkSize = 20; + aplGrandFirTreeOak.minCrownSize = 15; + aplGrandFirTreeOak.maxCrownSize = 30; + DecoTree oakFir = new DecoTree(aplGrandFirTreeOak); + oakFir.loops = 1; + oakFir.treeType = TreeType.RTG_TREE; + oakFir.distribution.noiseDivisor = 100f; + oakFir.distribution.noiseFactor = 6f; + oakFir.distribution.noiseAddend = 0.8f; + oakFir.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + oakFir.treeConditionNoise = -0.5f; + oakFir.treeConditionChance = 2; + oakFir.maxY = treeMaxY; + AppalachiaTree aplGrandFirTreeChestnut = new TreeAbiesGrandis(); + aplGrandFirTreeChestnut.logBlock = AppalachiaBlocks.log_blueridge_03.getDefaultState(); + aplGrandFirTreeChestnut.leavesBlock = Blocks.LEAVES.getDefaultState(); + aplGrandFirTreeChestnut.minTrunkSize = 10; + aplGrandFirTreeChestnut.maxTrunkSize = 20; + aplGrandFirTreeChestnut.minCrownSize = 15; + aplGrandFirTreeChestnut.maxCrownSize = 30; + DecoTree chestnutFir = new DecoTree(aplGrandFirTreeChestnut); + chestnutFir.loops = 1; + chestnutFir.treeType = TreeType.RTG_TREE; + chestnutFir.distribution.noiseDivisor = 100f; + chestnutFir.distribution.noiseFactor = 6f; + chestnutFir.distribution.noiseAddend = 0.8f; + chestnutFir.treeCondition = TreeCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + chestnutFir.treeConditionNoise = -0.5f; + chestnutFir.treeConditionChance = 2; + chestnutFir.maxY = treeMaxY; + DecoHelper5050 firTrees = new DecoHelper5050(oakFir, chestnutFir); + this.addDeco(firTrees); + + AppalachiaTree aplRedMaple = new TreeAcerRubrum(); + aplRedMaple.logBlock = AppalachiaBlocks.log_blueridge_02.getDefaultState(); + aplRedMaple.leavesBlock = Blocks.LEAVES.getDefaultState(); + aplRedMaple.minTrunkSize = 4; + aplRedMaple.maxTrunkSize = 8; + aplRedMaple.minCrownSize = 8; + aplRedMaple.maxCrownSize = 12; + DecoTree oakMaple = new DecoTree(aplRedMaple); + oakMaple.loops = 1; + oakMaple.treeType = TreeType.RTG_TREE; + oakMaple.distribution.noiseDivisor = 100f; + oakMaple.distribution.noiseFactor = 6f; + oakMaple.distribution.noiseAddend = 0.8f; + oakMaple.treeCondition = TreeCondition.NOISE_LESSER_AND_RANDOM_CHANCE; + oakMaple.treeConditionNoise = 0.2f; + oakMaple.treeConditionChance = 1; + oakMaple.maxY = treeMaxY; + this.addDeco(oakMaple); + + TreeRTG papyriferaTreeOak = new TreeRTGBetulaPapyrifera(); + papyriferaTreeOak.logBlock = AppalachiaBlocks.log_blueridge_01.getDefaultState(); + papyriferaTreeOak.leavesBlock = Blocks.LEAVES.getDefaultState(); + papyriferaTreeOak.minTrunkSize = 4; + papyriferaTreeOak.maxTrunkSize = 8; + papyriferaTreeOak.minCrownSize = 6; + papyriferaTreeOak.maxCrownSize = 16; + this.addTree(papyriferaTreeOak); + DecoTree paperOak = new DecoTree(papyriferaTreeOak); + paperOak.strengthFactorForLoops = 8f; + paperOak.treeType = TreeType.RTG_TREE; + paperOak.treeCondition = TreeCondition.RANDOM_CHANCE; + paperOak.treeConditionChance = 1; + paperOak.maxY = treeMaxY; + TreeRTG papyriferaTreeSpruce = new TreeRTGBetulaPapyrifera(); + papyriferaTreeSpruce.logBlock = AppalachiaBlocks.log_blueridge_03.getDefaultState(); + papyriferaTreeSpruce.leavesBlock = BlockUtil.getStateLeaf(3); + papyriferaTreeSpruce.minTrunkSize = 4; + papyriferaTreeSpruce.maxTrunkSize = 8; + papyriferaTreeSpruce.minCrownSize = 6; + papyriferaTreeSpruce.maxCrownSize = 16; + this.addTree(papyriferaTreeSpruce); + DecoTree paperSpruce = new DecoTree(papyriferaTreeSpruce); + paperSpruce.strengthFactorForLoops = 8f; + paperSpruce.treeType = TreeType.RTG_TREE; + paperSpruce.treeCondition = TreeCondition.RANDOM_CHANCE; + paperSpruce.treeConditionChance = 1; + paperSpruce.maxY = treeMaxY; + DecoHelper5050 decoPaper = new DecoHelper5050(paperOak, paperSpruce); + this.addDeco(decoPaper); + + TreeRTG ponderosaOakTree = new TreeRTGPinusPonderosa(); + ponderosaOakTree.logBlock = AppalachiaBlocks.log_blueridge_01.getDefaultState(); + ponderosaOakTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + ponderosaOakTree.minTrunkSize = 11; + ponderosaOakTree.maxTrunkSize = 21; + ponderosaOakTree.minCrownSize = 15; + ponderosaOakTree.maxCrownSize = 29; + this.addTree(ponderosaOakTree); + DecoTree oakPines = new DecoTree(ponderosaOakTree); + oakPines.strengthFactorForLoops = 10f; + oakPines.treeType = TreeType.RTG_TREE; + oakPines.distribution.noiseDivisor = 100f; + oakPines.distribution.noiseFactor = 6f; + oakPines.distribution.noiseAddend = 0.8f; + oakPines.treeCondition = TreeCondition.NOISE_LESSER_AND_RANDOM_CHANCE; + oakPines.treeConditionNoise = 0.2f; + oakPines.treeConditionChance = 1; + oakPines.maxY = 85; + TreeRTG ponderosaChestnutTree = new TreeRTGPinusPonderosa(); + ponderosaChestnutTree.logBlock = AppalachiaBlocks.log_blueridge_03.getDefaultState(); + ponderosaChestnutTree.leavesBlock = Blocks.LEAVES.getStateFromMeta(3); + ponderosaChestnutTree.minTrunkSize = 11; + ponderosaChestnutTree.maxTrunkSize = 21; + ponderosaChestnutTree.minCrownSize = 15; + ponderosaChestnutTree.maxCrownSize = 29; + this.addTree(ponderosaChestnutTree); + DecoTree chestnutPines = new DecoTree(ponderosaChestnutTree); + chestnutPines.strengthFactorForLoops = 10f; + chestnutPines.treeType = TreeType.RTG_TREE; + chestnutPines.distribution.noiseDivisor = 100f; + chestnutPines.distribution.noiseFactor = 6f; + chestnutPines.distribution.noiseAddend = 0.8f; + chestnutPines.treeCondition = TreeCondition.NOISE_LESSER_AND_RANDOM_CHANCE; + chestnutPines.treeConditionNoise = 0.2f; + chestnutPines.treeConditionChance = 1; + chestnutPines.maxY = 85; + DecoHelper5050 decoPines = new DecoHelper5050(oakPines, chestnutPines); + this.addDeco(decoPines); + + TreeRTG sitchensisTree = new TreeRTGPiceaSitchensis(); + sitchensisTree.logBlock = AppalachiaBlocks.log_blueridge_01.getDefaultState(); + sitchensisTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + sitchensisTree.minTrunkSize = 4; + sitchensisTree.maxTrunkSize = 10; + sitchensisTree.minCrownSize = 6; + sitchensisTree.maxCrownSize = 14; + this.addTree(sitchensisTree); + DecoTree oakPine = new DecoTree(sitchensisTree); + oakPine.strengthFactorForLoops = 8f; + oakPine.treeType = TreeType.RTG_TREE; + oakPine.treeCondition = TreeCondition.RANDOM_CHANCE; + oakPine.treeConditionChance = 1; + oakPine.maxY = treeMaxY; + WorldGenerator vanillaTreeDefinition = new WorldGenTrees(false); + DecoTree vanillaTrees = new DecoTree(vanillaTreeDefinition); + vanillaTrees.strengthFactorForLoops = 3f; + vanillaTrees.treeType = TreeType.WORLDGEN; + vanillaTrees.treeCondition = TreeCondition.RANDOM_CHANCE; + vanillaTrees.treeConditionChance = 2; + vanillaTrees.maxY = treeMaxY; + DecoHelperRandomSplit decoHelperRandomSplit = new DecoHelperRandomSplit(); + decoHelperRandomSplit.decos = new DecoBase[]{oakPine, vanillaTrees}; + decoHelperRandomSplit.chances = new int[]{12, 4}; + this.addDeco(decoHelperRandomSplit); + + // Add some fallen trees of the oak and spruce variety (50/50 distribution). + DecoFallenTree decoFallenOak = new DecoFallenTree(); + decoFallenOak.logCondition = LogCondition.RANDOM_CHANCE; + decoFallenOak.logConditionChance = 16; + decoFallenOak.maxY = 80; + decoFallenOak.logBlock = AppalachiaBlocks.log_blueridge_01.getDefaultState(); + decoFallenOak.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenOak.minSize = 3; + decoFallenOak.maxSize = 6; + DecoFallenTree decoFallenSpruce = new DecoFallenTree(); + decoFallenSpruce.logCondition = LogCondition.RANDOM_CHANCE; + decoFallenSpruce.logConditionChance = 24; + decoFallenSpruce.maxY = 80; + decoFallenSpruce.logBlock = AppalachiaBlocks.log_blueridge_03.getDefaultState(); + decoFallenSpruce.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenSpruce.minSize = 3; + decoFallenSpruce.maxSize = 6; + DecoHelper5050 decoFallenTree = new DecoHelper5050(decoFallenOak, decoFallenSpruce); + this.addDeco(decoFallenTree, fallenTrees); + + // Shrubs to fill in the blanks. + DecoShrub decoShrubOak = new DecoShrub(); + decoShrubOak.size = 1; + decoShrubOak.minY = 64; + decoShrubOak.maxY = shrubMaxY; + decoShrubOak.strengthFactor = 8f; + decoShrubOak.chance = 2; + this.addDeco(decoShrubOak); + + DecoBoulder decoBoulder1 = new DecoBoulder(); + decoBoulder1.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder1.maxY = 80; + decoBoulder1.chance = 16; + decoBoulder1.strengthFactor = 1f; + this.addDeco(decoBoulder1); + + // Fallen leaves. + DecoLayer decoFallenLeaves = new DecoLayer(AppalachiaBlocks.leaves_oak_fallen.getDefaultState(), IAppalachiaBlockLeavesFallen.LAYERS); + decoFallenLeaves.loops = 7; + this.addDeco(decoFallenLeaves); + + // Only 1-block-tall flowers so we can see the trees better. + // And only white ones because they go with everything. + DecoFlowersRTG decoFlowers1 = new DecoFlowersRTG(); + decoFlowers1.flowers = new int[]{3, 6}; + decoFlowers1.maxY = shrubMaxY; + decoFlowers1.strengthFactor = 6f; + this.addDeco(decoFlowers1); + + // Very rare 2-block-tall flowers. (TODO: Replace these with Appalachian flora.) + DecoFlowersRTG decoFlowers2 = new DecoFlowersRTG(); + decoFlowers2.flowers = new int[]{12, 13}; + decoFlowers2.minY = 63; + decoFlowers2.maxY = 180; + decoFlowers2.loops = 3; + this.addDeco(decoFlowers2); + + // Ferns. + DecoGrass decoFern = new DecoGrass(2); + decoFern.minY = 63; + decoFern.maxY = shrubMaxY; + decoFern.loops = 2; + this.addDeco(decoFern); + + // A combo-deal of grass and vines. (This could probably be pulled out into individual decos.) + DecoJungleGrassVines decoJungleGrassVines = new DecoJungleGrassVines(); + this.addDeco(decoJungleGrassVines); + + // Grass filler. + DecoGrass decoGrass = new DecoGrass(); + decoGrass.minY = 63; + decoGrass.maxY = shrubMaxY; + decoGrass.strengthFactor = 12f; + this.addDeco(decoGrass); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLAppalachianMountains.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLAppalachianMountains.java new file mode 100644 index 00000000..d769c1d1 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLAppalachianMountains.java @@ -0,0 +1,30 @@ +package appalachia.rtg.world.biome.realistic.appalachia; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.world.gen.surface.appalachia.SurfaceAPLAppalachianMountains; +import appalachia.rtg.world.gen.terrain.appalachia.TerrainAPLAppalachianMountains; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; + +public class RealisticBiomeAPLAppalachianMountains extends RealisticBiomeAPLBase { + + public static Biome biome = AppalachiaBiomes.appalachianMountains; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeAPLAppalachianMountains(BiomeConfig config) { + + super(config, biome, river, + new TerrainAPLAppalachianMountains(), + new SurfaceAPLAppalachianMountains(config, biome.topBlock, biome.fillerBlock, 0.45f) + ); + + this.noLakes = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLBase.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLBase.java new file mode 100644 index 00000000..9199d3ff --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLBase.java @@ -0,0 +1,85 @@ +package appalachia.rtg.world.biome.realistic.appalachia; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import net.minecraftforge.fml.common.Loader; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPL; +import appalachia.rtg.world.biome.realistic.appalachia.blueridge.*; +import appalachia.rtg.world.biome.realistic.appalachia.blueridge.autumn.RealisticBiomeAPLBlueRidgeForestAutumn; +import appalachia.rtg.world.biome.realistic.appalachia.blueridge.autumn.RealisticBiomeAPLBlueRidgeHillsAutumn; +import appalachia.rtg.world.biome.realistic.appalachia.blueridge.autumn.RealisticBiomeAPLBlueRidgeMountainsAutumn; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.realistic.RealisticBiomeBase; +import rtg.world.gen.surface.SurfaceBase; +import rtg.world.gen.terrain.TerrainBase; + +public class RealisticBiomeAPLBase extends RealisticBiomeBase { + + public static RealisticBiomeBase aplAppalachianMountains; + public static RealisticBiomeBase aplBlueRidgeForestAutumn; + public static RealisticBiomeBase aplBlueRidgeHillsAutumn; + public static RealisticBiomeBase aplBlueRidgeMountainsAutumn; + public static RealisticBiomeBase aplBlueRidgeForest; + public static RealisticBiomeBase aplBlueRidgeHills; + public static RealisticBiomeBase aplBlueRidgeBeach; + public static RealisticBiomeBase aplBlueRidgeRiver; + public static RealisticBiomeBase aplBlueRidgeMountains; + public static RealisticBiomeBase aplPrairie; + public static RealisticBiomeBase aplSmokyMountains; + + public RealisticBiomeAPLBase(BiomeConfig config, Biome b, Biome riverbiome, TerrainBase t, SurfaceBase s) { + + super(config, b, riverbiome, t, s); + + this.waterSurfaceLakeChance = 0; + this.lavaSurfaceLakeChance = 0; + } + + public static void addBiomes() { + + if (Loader.isModLoaded("appalachia")) { + if (AppalachiaBiomes.appalachianMountains != null) { + aplAppalachianMountains = new RealisticBiomeAPLAppalachianMountains(BiomeConfigAPL.biomeConfigAPLAppalachianMountains); + } + if (AppalachiaBiomes.blueRidgeForestAutumn != null) { + aplBlueRidgeForestAutumn = new RealisticBiomeAPLBlueRidgeForestAutumn(BiomeConfigAPL.biomeConfigAPLBlueRidgeForestAutumn); + } + if (AppalachiaBiomes.blueRidgeHillsAutumn != null) { + aplBlueRidgeHillsAutumn = new RealisticBiomeAPLBlueRidgeHillsAutumn(BiomeConfigAPL.biomeConfigAPLBlueRidgeHillsAutumn); + } + if (AppalachiaBiomes.blueRidgeMountainsAutumn != null) { + aplBlueRidgeMountainsAutumn = new RealisticBiomeAPLBlueRidgeMountainsAutumn(BiomeConfigAPL.biomeConfigAPLBlueRidgeMountainsAutumn); + } + if (AppalachiaBiomes.blueRidgeForest != null) { + aplBlueRidgeForest = new RealisticBiomeAPLBlueRidgeForest(BiomeConfigAPL.biomeConfigAPLBlueRidgeForest); + } + if (AppalachiaBiomes.blueRidgeHills != null) { + aplBlueRidgeHills = new RealisticBiomeAPLBlueRidgeHills(BiomeConfigAPL.biomeConfigAPLBlueRidgeHills); + } + if (AppalachiaBiomes.blueRidgeBeach != null) { + aplBlueRidgeBeach = new RealisticBiomeAPLBlueRidgeBeach(BiomeConfigAPL.biomeConfigAPLBlueRidgeBeach); + } + if (AppalachiaBiomes.blueRidgeRiver != null) { + aplBlueRidgeRiver = new RealisticBiomeAPLBlueRidgeRiver(BiomeConfigAPL.biomeConfigAPLBlueRidgeRiver); + } + if (AppalachiaBiomes.blueRidgeMountains != null) { + aplBlueRidgeMountains = new RealisticBiomeAPLBlueRidgeMountains(BiomeConfigAPL.biomeConfigAPLBlueRidgeMountains); + } + if (AppalachiaBiomes.prairie != null) { + aplPrairie = new RealisticBiomeAPLPrairie(BiomeConfigAPL.biomeConfigAPLPrairie); + } + if (AppalachiaBiomes.smokyMountains != null) { + aplSmokyMountains = new RealisticBiomeAPLSmokyMountains(BiomeConfigAPL.biomeConfigAPLSmokyMountains); + } + } + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.STONE_BEACH); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLPrairie.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLPrairie.java new file mode 100644 index 00000000..a6485a42 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLPrairie.java @@ -0,0 +1,33 @@ +package appalachia.rtg.world.biome.realistic.appalachia; + +import net.minecraft.init.Biomes; +import net.minecraft.world.biome.Biome; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.world.gen.surface.appalachia.SurfaceAPLPrairie; +import appalachia.rtg.world.gen.terrain.appalachia.TerrainAPLPrairie; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.DecoBaseBiomeDecorations; + +public class RealisticBiomeAPLPrairie extends RealisticBiomeAPLBase { + + public static Biome biome = AppalachiaBiomes.prairie; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeAPLPrairie(BiomeConfig config) { + + super(config, biome, river, + new TerrainAPLPrairie(65f, 80f, 25f), + new SurfaceAPLPrairie(config, biome.topBlock, biome.fillerBlock) + ); + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(Biomes.BEACH); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLSmokyMountains.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLSmokyMountains.java new file mode 100644 index 00000000..dcd7f1cf --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/RealisticBiomeAPLSmokyMountains.java @@ -0,0 +1,73 @@ +package appalachia.rtg.world.biome.realistic.appalachia; + +import net.minecraft.init.Biomes; +import net.minecraft.init.Blocks; +import net.minecraft.world.biome.Biome; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLSmokyMountains; +import appalachia.rtg.world.gen.surface.appalachia.SurfaceAPLSmokyMountains; +import appalachia.rtg.world.gen.terrain.appalachia.TerrainAPLSmokyMountains; + +import rtg.api.biome.BiomeConfig; +import rtg.world.biome.deco.*; + +public class RealisticBiomeAPLSmokyMountains extends RealisticBiomeAPLBase { + + public static Biome biome = AppalachiaBiomes.smokyMountains; + public static Biome river = Biomes.RIVER; + + public RealisticBiomeAPLSmokyMountains(BiomeConfig config) { + + super(config, biome, river, + new TerrainAPLSmokyMountains(120f, 100f), + new SurfaceAPLSmokyMountains(config, + biome.topBlock, //Block top + biome.fillerBlock, //Block filler, + biome.topBlock, //IBlockState mixTop, + biome.fillerBlock, //IBlockState mixFill, + 80f, //float mixWidth, + -0.15f, //float mixHeight, + 10f, //float smallWidth, + 0.5f //float smallStrength + ) + ); + + this.noLakes = true; + this.noWaterFeatures = true; + + DecoBaseBiomeDecorations decoBaseBiomeDecorations = new DecoBaseBiomeDecorations(); + this.addDeco(decoBaseBiomeDecorations); + + DecoBoulder decoBoulder = new DecoBoulder(); + decoBoulder.boulderBlock = Blocks.COBBLESTONE.getDefaultState(); + decoBoulder.maxY = 90; + decoBoulder.chance = 16; + decoBoulder.strengthFactor = 3f; + this.addDeco(decoBoulder); + + DecoFallenTree decoFallenTree = new DecoFallenTree(); + decoFallenTree.distribution.noiseDivisor = 100f; + decoFallenTree.distribution.noiseFactor = 6f; + decoFallenTree.distribution.noiseAddend = 0.8f; + decoFallenTree.logCondition = DecoFallenTree.LogCondition.NOISE_GREATER_AND_RANDOM_CHANCE; + decoFallenTree.logConditionNoise = 0f; + decoFallenTree.logConditionChance = 6; + decoFallenTree.logBlock = Blocks.LOG.getDefaultState(); + decoFallenTree.leavesBlock = Blocks.LEAVES.getDefaultState(); + decoFallenTree.minSize = 3; + decoFallenTree.maxSize = 6; + this.addDeco(decoFallenTree, this.config._boolean(BiomeConfigAPLSmokyMountains.decorationLogsId)); + + DecoShrub decoShrub = new DecoShrub(); + decoShrub.maxY = 110; + decoShrub.strengthFactor = 2f; + decoShrub.chance = 10; + this.addDeco(decoShrub); + + DecoGrass decoGrass = new DecoGrass(); + decoGrass.maxY = 128; + decoGrass.strengthFactor = 3f; + this.addDeco(decoGrass); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeBeach.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeBeach.java new file mode 100644 index 00000000..9a70d2f0 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeBeach.java @@ -0,0 +1,30 @@ +package appalachia.rtg.world.biome.realistic.appalachia.blueridge; + +import net.minecraft.world.biome.Biome; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.world.biome.realistic.appalachia.RealisticBiomeAPLBase; +import appalachia.rtg.world.gen.surface.appalachia.SurfaceAPLBlueRidgeBeach; +import appalachia.rtg.world.gen.terrain.appalachia.TerrainAPLBlueRidgeBeach; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; + +public class RealisticBiomeAPLBlueRidgeBeach extends RealisticBiomeAPLBase { + + public static Biome biome = AppalachiaBiomes.blueRidgeBeach; + public static Biome river = AppalachiaBiomes.blueRidgeRiver; + + public RealisticBiomeAPLBlueRidgeBeach(BiomeConfig config) { + + super(config, biome, river, + new TerrainAPLBlueRidgeBeach(), + new SurfaceAPLBlueRidgeBeach(config, biome.topBlock, biome.fillerBlock, BlockUtil.getStateDirt(2), 12f, 0.27f) + ); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(AppalachiaBiomes.blueRidgeBeach); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeForest.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeForest.java new file mode 100644 index 00000000..29d69ba6 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeForest.java @@ -0,0 +1,34 @@ +package appalachia.rtg.world.biome.realistic.appalachia.blueridge; + +import net.minecraft.world.biome.Biome; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeForest; +import appalachia.rtg.world.biome.deco.collection.DecoCollectionBlueRidgeForest; +import appalachia.rtg.world.biome.realistic.appalachia.RealisticBiomeAPLBase; +import appalachia.rtg.world.gen.surface.appalachia.SurfaceAPLBlueRidgeForest; +import appalachia.rtg.world.gen.terrain.appalachia.TerrainAPLBlueRidgeForest; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; + +public class RealisticBiomeAPLBlueRidgeForest extends RealisticBiomeAPLBase { + + public static Biome biome = AppalachiaBiomes.blueRidgeForest; + public static Biome river = AppalachiaBiomes.blueRidgeRiver; + + public RealisticBiomeAPLBlueRidgeForest(BiomeConfig config) { + + super(config, biome, river, + new TerrainAPLBlueRidgeForest(), + new SurfaceAPLBlueRidgeForest(config, biome.topBlock, biome.fillerBlock, BlockUtil.getStateDirt(2), 12f, 0.27f) + ); + + this.addDecoCollection(new DecoCollectionBlueRidgeForest(this.config._boolean(BiomeConfigAPLBlueRidgeForest.decorationLogsId))); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(AppalachiaBiomes.blueRidgeBeach); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeHills.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeHills.java new file mode 100644 index 00000000..6b72c7f6 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeHills.java @@ -0,0 +1,34 @@ +package appalachia.rtg.world.biome.realistic.appalachia.blueridge; + +import net.minecraft.world.biome.Biome; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeHills; +import appalachia.rtg.world.biome.deco.collection.DecoCollectionBlueRidgeForest; +import appalachia.rtg.world.biome.realistic.appalachia.RealisticBiomeAPLBase; +import appalachia.rtg.world.gen.surface.appalachia.SurfaceAPLBlueRidgeHills; +import appalachia.rtg.world.gen.terrain.appalachia.TerrainAPLBlueRidgeHills; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; + +public class RealisticBiomeAPLBlueRidgeHills extends RealisticBiomeAPLBase { + + public static Biome biome = AppalachiaBiomes.blueRidgeHills; + public static Biome river = AppalachiaBiomes.blueRidgeRiver; + + public RealisticBiomeAPLBlueRidgeHills(BiomeConfig config) { + + super(config, biome, river, + new TerrainAPLBlueRidgeHills(), + new SurfaceAPLBlueRidgeHills(config, biome.topBlock, biome.fillerBlock, BlockUtil.getStateDirt(2), 12f, 0.27f) + ); + + this.addDecoCollection(new DecoCollectionBlueRidgeForest(this.config._boolean(BiomeConfigAPLBlueRidgeHills.decorationLogsId))); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(AppalachiaBiomes.blueRidgeBeach); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeMountains.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeMountains.java new file mode 100644 index 00000000..122baad2 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeMountains.java @@ -0,0 +1,36 @@ +package appalachia.rtg.world.biome.realistic.appalachia.blueridge; + +import net.minecraft.world.biome.Biome; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeMountains; +import appalachia.rtg.world.biome.deco.collection.DecoCollectionBlueRidgeForest; +import appalachia.rtg.world.biome.realistic.appalachia.RealisticBiomeAPLBase; +import appalachia.rtg.world.gen.surface.appalachia.SurfaceAPLBlueRidgeMountains; +import appalachia.rtg.world.gen.terrain.appalachia.TerrainAPLBlueRidgeMountains; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; + +public class RealisticBiomeAPLBlueRidgeMountains extends RealisticBiomeAPLBase { + + public static Biome biome = AppalachiaBiomes.blueRidgeMountains; + public static Biome river = AppalachiaBiomes.blueRidgeRiver; + + public RealisticBiomeAPLBlueRidgeMountains(BiomeConfig config) { + + super(config, biome, river, + new TerrainAPLBlueRidgeMountains(120f, 100f), + new SurfaceAPLBlueRidgeMountains(config, biome.topBlock, biome.fillerBlock, BlockUtil.getStateDirt(2), 12f, 0.27f) + ); + + this.noWaterFeatures = true; + + this.addDecoCollection(new DecoCollectionBlueRidgeForest(this.config._boolean(BiomeConfigAPLBlueRidgeMountains.decorationLogsId))); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(AppalachiaBiomes.blueRidgeBeach); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeRiver.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeRiver.java new file mode 100644 index 00000000..8d503bbe --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/RealisticBiomeAPLBlueRidgeRiver.java @@ -0,0 +1,29 @@ +package appalachia.rtg.world.biome.realistic.appalachia.blueridge; + +import net.minecraft.world.biome.Biome; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.world.biome.realistic.appalachia.RealisticBiomeAPLBase; +import appalachia.rtg.world.gen.surface.appalachia.SurfaceAPLBlueRidgeRiver; +import appalachia.rtg.world.gen.terrain.appalachia.TerrainAPLBlueRidgeRiver; + +import rtg.api.biome.BiomeConfig; + +public class RealisticBiomeAPLBlueRidgeRiver extends RealisticBiomeAPLBase { + + public static Biome biome = AppalachiaBiomes.blueRidgeRiver; + public static Biome river = AppalachiaBiomes.blueRidgeRiver; + + public RealisticBiomeAPLBlueRidgeRiver(BiomeConfig config) { + + super(config, biome, river, + new TerrainAPLBlueRidgeRiver(), + new SurfaceAPLBlueRidgeRiver(config) + ); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(AppalachiaBiomes.blueRidgeBeach); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/autumn/RealisticBiomeAPLBlueRidgeForestAutumn.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/autumn/RealisticBiomeAPLBlueRidgeForestAutumn.java new file mode 100644 index 00000000..31c86f1a --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/autumn/RealisticBiomeAPLBlueRidgeForestAutumn.java @@ -0,0 +1,34 @@ +package appalachia.rtg.world.biome.realistic.appalachia.blueridge.autumn; + +import net.minecraft.world.biome.Biome; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeForestAutumn; +import appalachia.rtg.world.biome.deco.collection.DecoCollectionBlueRidgeForest; +import appalachia.rtg.world.biome.realistic.appalachia.RealisticBiomeAPLBase; +import appalachia.rtg.world.gen.surface.appalachia.SurfaceAPLBlueRidgeForestAutumn; +import appalachia.rtg.world.gen.terrain.appalachia.TerrainAPLBlueRidgeForestAutumn; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; + +public class RealisticBiomeAPLBlueRidgeForestAutumn extends RealisticBiomeAPLBase { + + public static Biome biome = AppalachiaBiomes.blueRidgeForestAutumn; + public static Biome river = AppalachiaBiomes.blueRidgeRiver; + + public RealisticBiomeAPLBlueRidgeForestAutumn(BiomeConfig config) { + + super(config, biome, river, + new TerrainAPLBlueRidgeForestAutumn(), + new SurfaceAPLBlueRidgeForestAutumn(config, biome.topBlock, biome.fillerBlock, BlockUtil.getStateDirt(2), 12f, 0.27f) + ); + + this.addDecoCollection(new DecoCollectionBlueRidgeForest(this.config._boolean(BiomeConfigAPLBlueRidgeForestAutumn.decorationLogsId))); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(AppalachiaBiomes.blueRidgeBeach); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/autumn/RealisticBiomeAPLBlueRidgeHillsAutumn.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/autumn/RealisticBiomeAPLBlueRidgeHillsAutumn.java new file mode 100644 index 00000000..4ac72ab1 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/autumn/RealisticBiomeAPLBlueRidgeHillsAutumn.java @@ -0,0 +1,34 @@ +package appalachia.rtg.world.biome.realistic.appalachia.blueridge.autumn; + +import net.minecraft.world.biome.Biome; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeHillsAutumn; +import appalachia.rtg.world.biome.deco.collection.DecoCollectionBlueRidgeForest; +import appalachia.rtg.world.biome.realistic.appalachia.RealisticBiomeAPLBase; +import appalachia.rtg.world.gen.surface.appalachia.SurfaceAPLBlueRidgeHillsAutumn; +import appalachia.rtg.world.gen.terrain.appalachia.TerrainAPLBlueRidgeHillsAutumn; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; + +public class RealisticBiomeAPLBlueRidgeHillsAutumn extends RealisticBiomeAPLBase { + + public static Biome biome = AppalachiaBiomes.blueRidgeHillsAutumn; + public static Biome river = AppalachiaBiomes.blueRidgeRiver; + + public RealisticBiomeAPLBlueRidgeHillsAutumn(BiomeConfig config) { + + super(config, biome, river, + new TerrainAPLBlueRidgeHillsAutumn(), + new SurfaceAPLBlueRidgeHillsAutumn(config, biome.topBlock, biome.fillerBlock, BlockUtil.getStateDirt(2), 12f, 0.27f) + ); + + this.addDecoCollection(new DecoCollectionBlueRidgeForest(this.config._boolean(BiomeConfigAPLBlueRidgeHillsAutumn.decorationLogsId))); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(AppalachiaBiomes.blueRidgeBeach); + } +} diff --git a/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/autumn/RealisticBiomeAPLBlueRidgeMountainsAutumn.java b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/autumn/RealisticBiomeAPLBlueRidgeMountainsAutumn.java new file mode 100644 index 00000000..4b1cf48e --- /dev/null +++ b/src/main/java/appalachia/rtg/world/biome/realistic/appalachia/blueridge/autumn/RealisticBiomeAPLBlueRidgeMountainsAutumn.java @@ -0,0 +1,36 @@ +package appalachia.rtg.world.biome.realistic.appalachia.blueridge.autumn; + +import net.minecraft.world.biome.Biome; + +import appalachia.api.AppalachiaBiomes; +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeMountainsAutumn; +import appalachia.rtg.world.biome.deco.collection.DecoCollectionBlueRidgeForest; +import appalachia.rtg.world.biome.realistic.appalachia.RealisticBiomeAPLBase; +import appalachia.rtg.world.gen.surface.appalachia.SurfaceAPLBlueRidgeMountainsAutumn; +import appalachia.rtg.world.gen.terrain.appalachia.TerrainAPLBlueRidgeMountainsAutumn; + +import rtg.api.biome.BiomeConfig; +import rtg.util.BlockUtil; + +public class RealisticBiomeAPLBlueRidgeMountainsAutumn extends RealisticBiomeAPLBase { + + public static Biome biome = AppalachiaBiomes.blueRidgeMountainsAutumn; + public static Biome river = AppalachiaBiomes.blueRidgeRiver; + + public RealisticBiomeAPLBlueRidgeMountainsAutumn(BiomeConfig config) { + + super(config, biome, river, + new TerrainAPLBlueRidgeMountainsAutumn(120f, 100f), + new SurfaceAPLBlueRidgeMountainsAutumn(config, biome.topBlock, biome.fillerBlock, BlockUtil.getStateDirt(2), 12f, 0.27f) + ); + + this.noWaterFeatures = true; + + this.addDecoCollection(new DecoCollectionBlueRidgeForest(this.config._boolean(BiomeConfigAPLBlueRidgeMountainsAutumn.decorationLogsId))); + } + + @Override + public Biome beachBiome() { + return this.beachBiome(AppalachiaBiomes.blueRidgeBeach); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/AppalachiaTree.java b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/AppalachiaTree.java new file mode 100644 index 00000000..7f0c6480 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/AppalachiaTree.java @@ -0,0 +1,92 @@ +package appalachia.rtg.world.gen.feature.tree.rtg; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import appalachia.api.AppalachiaBlocks; + +import rtg.world.gen.feature.tree.rtg.TreeRTG; + +public class AppalachiaTree extends TreeRTG { + + public IBlockState fallenLeavesBlock; + public boolean generateFromSapling; + + public AppalachiaTree(boolean notify) { + super(notify); + } + + public AppalachiaTree() { + + this(false); + + this.logBlock = Blocks.LOG.getDefaultState(); + this.leavesBlock = Blocks.LEAVES.getDefaultState(); + this.fallenLeavesBlock = AppalachiaBlocks.leaves_autumn_red_fallen.getDefaultState(); + this.saplingBlock = AppalachiaBlocks.sapling_quercus_robur.getDefaultState(); + + this.minTrunkSize = -1; + this.maxTrunkSize = -1; + this.trunkSize = 2; + this.minCrownSize = -1; + this.maxCrownSize = -1; + this.crownSize = 4; + + this.noLeaves = false; + this.generateFromSapling = false; + + this.validGroundBlocks = new ArrayList(Arrays.asList( + Blocks.GRASS.getDefaultState(), + Blocks.DIRT.getDefaultState(), + Blocks.DIRT.getStateFromMeta(1), + Blocks.DIRT.getStateFromMeta(2) + )); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + return false; + } + + @Override + protected void setBlockAndNotifyAdequately(World worldIn, BlockPos pos, IBlockState state) { + + if (this.generateFromSapling) { + worldIn.setBlockState(pos, state, 3); + } + else { + worldIn.setBlockState(pos, state, 2); + } + } + + protected boolean isValidGroundBlock(World world, Random rand, BlockPos pos, int depth) { + + for (int d = 1; d <= depth; d++) { + IBlockState g = world.getBlockState(new BlockPos(pos.getX(), pos.getY() - d, pos.getZ())); + + for (int i = 0; i < this.validGroundBlocks.size(); i++) { + if (g == this.validGroundBlocks.get(i)) { + return true; + } + } + } + + return false; + } + + protected boolean isValidGroundBlock(World world, Random rand, BlockPos pos) { + + return this.isValidGroundBlock(world, rand, pos, 1); + } + + protected int getSizeFromMinMax(Random rand, int min, int max) { + return min + rand.nextInt(max - min + 1); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeAbiesGrandis.java b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeAbiesGrandis.java new file mode 100644 index 00000000..7f456213 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeAbiesGrandis.java @@ -0,0 +1,922 @@ +package appalachia.rtg.world.gen.feature.tree.rtg; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockLog; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * Abies Grandis (Grand Fir) + *

+ * This tree was designed by Lentebriesje and released as part of the 'Custom Tree Repository' project + * on Planet Minecraft (http://www.planetminecraft.com/project/native-trees-of-europe-template-repository-1779952/). + * It was converted into Java from its original schematic using the 'Schematic To Java Converter [For Modders]' program + * by ThisIsMika (http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/2193206-schematic-to-java-converter-for-modders). + * It has been modified slightly by WhichOnesPink to allow for random variation when generating in the world. + */ +public class TreeAbiesGrandis extends AppalachiaTree { + + World world; + Random rand; + + public TreeAbiesGrandis() { + + super(); + + this.validGroundBlocks = new ArrayList(Arrays.asList(Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState())); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + this.crownSize = this.getSizeFromMinMax(rand, this.minCrownSize, this.maxCrownSize); + this.trunkSize = this.getSizeFromMinMax(rand, this.minTrunkSize, this.maxTrunkSize); + + this.world = world; + this.rand = rand; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + ArrayList groundPos = new ArrayList() { + + }; + groundPos.add(new BlockPos(x + 11, y, z + 2)); + groundPos.add(new BlockPos(x + 7, y, z + 3)); + groundPos.add(new BlockPos(x + 5, y, z + 4)); + groundPos.add(new BlockPos(x + 11, y, z + 5)); + groundPos.add(new BlockPos(x + 8, y, z + 6)); + groundPos.add(new BlockPos(x + 6, y, z + 7)); + groundPos.add(new BlockPos(x + 10, y, z + 8)); + groundPos.add(new BlockPos(x + 8, y, z + 9)); + + for (int i = 0; i < groundPos.size(); i++) { + if (!isValidGroundBlock(world, rand, groundPos.get(i), 2)) { + return false; + } + } + + IBlockState leaves = this.leavesBlock.withProperty(BlockLeaves.CHECK_DECAY, false); + //IBlockState leaves = this.leavesBlock.withProperty(BlockLeaves.DECAYABLE, false); + int currentY = y - 2; + + this.spawn(world, x, currentY, z, this.logBlock, leaves); + + return true; + } + + protected void spawn(World world, int x, int y, int z, IBlockState log, IBlockState leaves) { + + int currentY = y; + + this.setBlockState(new BlockPos(x + 11, currentY, z + 2), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 11, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 10, currentY, z + 8), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 8, currentY, z + 9), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 10, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 11, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 10, currentY, z + 8), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 9, currentY, z + 9), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + currentY++; + + this.setBlockState(new BlockPos(x + 10, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 10, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 9, currentY, z + 8), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + currentY++; + + this.setBlockState(new BlockPos(x + 10, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 10, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 9, currentY, z + 8), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + currentY++; + + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + currentY++; + + for (int t = 0; t < this.trunkSize; t++) { + + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + currentY++; + } + + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 5, 4, 4); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 5, 4, 4); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 3, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 7, 4, 4); + this.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 8, 4, 4); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 5, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 8), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 10), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 10), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 11, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 12, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 11, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 8, 4, 4); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 11, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 11, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + currentY++; + + this.setBlockState(new BlockPos(x + 11, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 11, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 11, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 10, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 5, 4, 4); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, currentY, z + 6, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 8), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 9), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 10), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 11), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 11), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 9, 4, 4); + currentY++; + + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + currentY++; + + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 12, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 13, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 11, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 12, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 13, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 13, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 15, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 13, currentY, z + 7), log); + this.setBlockState(new BlockPos(x + 14, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 15, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 13, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 14, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 13, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 14, currentY, z + 9), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 12, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, currentY, z + 5, 4, 4); + this.setBlockState(new BlockPos(x + 11, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 11, currentY, z + 5, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 12, currentY, z + 6, 4, 4); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 13, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 13, currentY, z + 7, 4, 4); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 2, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 0, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 8), log); + this.setBlockState(new BlockPos(x + 4, currentY, z + 8), log); + this.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 8), log); + this.setBlockState(new BlockPos(x + 0, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 0, currentY, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 1, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 9), log); + this.setBlockState(new BlockPos(x + 4, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 9), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 0, currentY, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 0, currentY, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, currentY, z + 10), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 10), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 10), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 10), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 11), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 11), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 11), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 11), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 11), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 11), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 12), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 9, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 10), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 10), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 11, 4, 4); + this.setBlockState(new BlockPos(x + 9, currentY, z + 11), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 3, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 1, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 7), log); + this.setBlockState(new BlockPos(x + 3, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 7, 4, 4); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 12, currentY, z + 0), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 2), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 2), log); + this.setBlockState(new BlockPos(x + 11, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + currentY++; + + this.setBlockState(new BlockPos(x + 8, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 2, 4, 4); + this.setBlockState(new BlockPos(x + 10, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 10, currentY, z + 2, 4, 4); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + currentY++; + + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 7, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 7, 4, 4); + this.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 8, 4, 4); + this.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 8, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 8, 4, 4); + currentY++; + + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 11, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 12, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 5, 4, 4); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 4, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 8), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 10), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 10), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 10), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 10), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 9, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), log); + this.setBlockState(new BlockPos(x + 11, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 11, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 7, 4, 4); + this.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 8, 4, 4); + currentY++; + + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 5, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 7, 4, 4); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 7), log); + this.setBlockState(new BlockPos(x + 10, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 11, currentY, z + 9), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 0), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 7, 4, 4); + this.setBlockState(new BlockPos(x + 9, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 7, 4, 4); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + currentY++; + + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + currentY++; + + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 6, 4, 4); + currentY++; + } + + protected void setBlockState(BlockPos pos, IBlockState state) { + + this.setBlockAndNotifyAdequately(this.world, pos, state); + } + + private void setBlockMetadataWithNotify(int x, int y, int z, int meta1, int meta2) { + + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeAcerRubrum.java b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeAcerRubrum.java new file mode 100644 index 00000000..974997df --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeAcerRubrum.java @@ -0,0 +1,597 @@ +package appalachia.rtg.world.gen.feature.tree.rtg; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * Acer Rubrum (Red Maple) + *

+ * This tree was designed by Lentebriesje and released as part of the 'Custom Tree Repository' project + * on Planet Minecraft (http://www.planetminecraft.com/project/native-trees-of-europe-template-repository-1779952/). + * It was converted into Java from its original schematic using the 'Schematic To Java Converter [For Modders]' program + * by ThisIsMika (http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/2193206-schematic-to-java-converter-for-modders). + * It has been modified slightly by WhichOnesPink to allow for random variation when generating in the world. + */ +public class TreeAcerRubrum extends AppalachiaTree { + + public TreeAcerRubrum() { + + super(); + + this.validGroundBlocks = new ArrayList(Arrays.asList(Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState())); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + if (!isValidGroundBlock(world, rand, new BlockPos(x + 5, y + 0, z + 5))) { + return false; + } + + IBlockState leaves = this.leavesBlock.withProperty(BlockLeaves.CHECK_DECAY, false); + int currentY = y; + + for (int i = 0; i < this.trunkSize; i++) { + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 5, 12, 12); + currentY++; + } + + world.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 7, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 8, 4, 4); + world.setBlockState(new BlockPos(x + 6, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 9, 4, 4); + currentY++; + + world.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 1, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 4), this.logBlock); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 6), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 7), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 7, 4, 4); + world.setBlockState(new BlockPos(x + 4, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 8, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 8, 4, 4); + world.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 8, 4, 4); + world.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 8, 4, 4); + world.setBlockState(new BlockPos(x + 3, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 9, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 9, 4, 4); + world.setBlockState(new BlockPos(x + 6, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 9, 4, 4); + world.setBlockState(new BlockPos(x + 7, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 9, 4, 4); + currentY++; + + world.setBlockState(new BlockPos(x + 4, currentY, z + 0), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 0, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 0), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 0, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 9, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 10, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 10, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 3), this.logBlock); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 0, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 0, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 4), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 10, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 0, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 0, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 1, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 7, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 7, 4, 4); + world.setBlockState(new BlockPos(x + 3, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 8, 4, 4); + world.setBlockState(new BlockPos(x + 4, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 8, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 8), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 8, 4, 4); + world.setBlockState(new BlockPos(x + 4, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 9, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 9, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 10, 4, 4); + world.setBlockState(new BlockPos(x + 6, currentY, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 10, 4, 4); + currentY++; + + world.setBlockState(new BlockPos(x + 3, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 3), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 3), this.logBlock); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 10, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 10, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 1, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 0, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 0, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 1, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 6), this.logBlock); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 8, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 8, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 9, 4, 4); + world.setBlockState(new BlockPos(x + 4, currentY, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 10, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 10, 4, 4); + currentY++; + + world.setBlockState(new BlockPos(x + 5, currentY, z + 0), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 0, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 2), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 1, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 10, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 10, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 1, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 1, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 6), this.logBlock); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 1, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 7), this.logBlock); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 8, 4, 4); + world.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 9, 4, 4); + currentY++; + + world.setBlockState(new BlockPos(x + 5, currentY, z + 0), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 0, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 0), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 0, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 2), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 1, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 7), this.logBlock); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 7), this.logBlock); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 9, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 9, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 9, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 9, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 9, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 9, 12, 12); + currentY++; + + world.setBlockState(new BlockPos(x + 4, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), this.logBlock); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 9, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 8, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 9, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 9, 12, 12); + currentY++; + + world.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 1, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 2, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 4, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), this.logBlock); + world.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 7, 12, 12); + world.setBlockState(new BlockPos(x + 2, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 8, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 8, 12, 12); + currentY++; + + world.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 3, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), this.logBlock); + world.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 5, 12, 12); + world.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 6, 12, 12); + world.setBlockState(new BlockPos(x + 4, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 7, 12, 12); + currentY++; + + world.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 3, 4, 4); + world.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 4, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 4, 4, 4); + world.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 5, 4, 4); + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 5, 4, 4); + world.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 5, 4, 4); + world.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 6, 4, 4); + world.setBlockState(new BlockPos(x + 4, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 7, 4, 4); + currentY++; + + world.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 5, 4, 4); + currentY++; + + return true; + } + + private void setBlockMetadataWithNotify(int x, int y, int z, int meta1, int meta2) { + + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeAcerSaccharum.java b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeAcerSaccharum.java new file mode 100644 index 00000000..f9ee3bcf --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeAcerSaccharum.java @@ -0,0 +1,1565 @@ +package appalachia.rtg.world.gen.feature.tree.rtg; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * Acer Saccharum (Sugar Maple) + *

+ * This tree was designed by Lentebriesje and released as part of the 'Custom Tree Repository' project + * on Planet Minecraft (http://www.planetminecraft.com/project/native-trees-of-europe-template-repository-1779952/). + * It was converted into Java from its original schematic using the 'Schematic To Java Converter [For Modders]' program + * by ThisIsMika (http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/2193206-schematic-to-java-converter-for-modders). + * It has been modified slightly by WhichOnesPink to allow for random variation when generating in the world. + */ +public class TreeAcerSaccharum extends AppalachiaTree { + + World world; + Random rand; + + public TreeAcerSaccharum() { + + super(); + + this.validGroundBlocks = new ArrayList(Arrays.asList(Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState())); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + if (rand.nextInt(4) != 0) { + return false; + } + + this.world = world; + this.rand = rand; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + if (!isValidGroundBlock(world, rand, new BlockPos(x + 13, y + 0, z + 9))) { + return false; + } + + if (!isValidGroundBlock(world, rand, new BlockPos(x + 15, y + 0, z + 10))) { + return false; + } + + if (!isValidGroundBlock(world, rand, new BlockPos(x + 12, y + 0, z + 11))) { + return false; + } + + IBlockState leaves = this.leavesBlock.withProperty(BlockLeaves.CHECK_DECAY, false); + //IBlockState leaves = this.leavesBlock.withProperty(BlockLeaves.DECAYABLE, false); + int currentY = y - 1; + + this.spawn(world, x, currentY, z, this.logBlock, leaves); + + return true; + } + + protected void spawn(World world, int x, int y, int z, IBlockState log, IBlockState leaves) { + + this.setBlockState(new BlockPos(x + 13, y + 0, z + 9), log); + this.setBlockState(new BlockPos(x + 15, y + 0, z + 10), log); + this.setBlockState(new BlockPos(x + 12, y + 0, z + 11), log); + this.setBlockState(new BlockPos(x + 13, y + 1, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 1, z + 9), log); + this.setBlockState(new BlockPos(x + 13, y + 1, z + 10), log); + this.setBlockState(new BlockPos(x + 15, y + 1, z + 10), log); + this.setBlockState(new BlockPos(x + 12, y + 1, z + 11), log); + this.setBlockState(new BlockPos(x + 13, y + 2, z + 8), log); + this.setBlockState(new BlockPos(x + 13, y + 2, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 2, z + 9), log); + this.setBlockState(new BlockPos(x + 13, y + 2, z + 10), log); + this.setBlockState(new BlockPos(x + 14, y + 2, z + 10), log); + this.setBlockState(new BlockPos(x + 15, y + 2, z + 10), log); + this.setBlockState(new BlockPos(x + 12, y + 2, z + 11), log); + this.setBlockState(new BlockPos(x + 13, y + 3, z + 8), log); + this.setBlockState(new BlockPos(x + 13, y + 3, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 3, z + 9), log); + this.setBlockState(new BlockPos(x + 13, y + 3, z + 10), log); + this.setBlockState(new BlockPos(x + 14, y + 3, z + 10), log); + this.setBlockState(new BlockPos(x + 15, y + 3, z + 10), log); + this.setBlockState(new BlockPos(x + 12, y + 3, z + 11), log); + this.setBlockState(new BlockPos(x + 13, y + 4, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 4, z + 9), log); + this.setBlockState(new BlockPos(x + 13, y + 4, z + 10), log); + this.setBlockState(new BlockPos(x + 14, y + 4, z + 10), log); + this.setBlockState(new BlockPos(x + 13, y + 5, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 5, z + 9), log); + this.setBlockState(new BlockPos(x + 13, y + 5, z + 10), log); + this.setBlockState(new BlockPos(x + 14, y + 5, z + 10), log); + this.setBlockState(new BlockPos(x + 13, y + 6, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 6, z + 9), log); + this.setBlockState(new BlockPos(x + 13, y + 6, z + 10), log); + this.setBlockState(new BlockPos(x + 14, y + 6, z + 10), log); + this.setBlockState(new BlockPos(x + 13, y + 7, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 7, z + 9), log); + this.setBlockState(new BlockPos(x + 10, y + 7, z + 10), leaves); + this.setBlockState(new BlockPos(x + 12, y + 7, z + 10), leaves); + this.setBlockState(new BlockPos(x + 13, y + 7, z + 10), log); + this.setBlockState(new BlockPos(x + 14, y + 7, z + 10), log); + this.setBlockState(new BlockPos(x + 11, y + 7, z + 11), leaves); + this.setBlockState(new BlockPos(x + 10, y + 8, z + 8), leaves); + this.setBlockState(new BlockPos(x + 11, y + 8, z + 9), leaves); + this.setBlockState(new BlockPos(x + 13, y + 8, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 8, z + 9), log); + this.setBlockState(new BlockPos(x + 10, y + 8, z + 10), leaves); + this.setBlockState(new BlockPos(x + 13, y + 8, z + 10), log); + this.setBlockState(new BlockPos(x + 14, y + 8, z + 10), log); + this.setBlockState(new BlockPos(x + 17, y + 8, z + 11), leaves); + this.setBlockState(new BlockPos(x + 17, y + 9, z + 7), leaves); + this.setBlockState(new BlockPos(x + 15, y + 9, z + 8), leaves); + this.setBlockState(new BlockPos(x + 19, y + 9, z + 8), leaves); + this.setBlockState(new BlockPos(x + 9, y + 9, z + 9), leaves); + this.setBlockState(new BlockPos(x + 11, y + 9, z + 9), leaves); + this.setBlockState(new BlockPos(x + 13, y + 9, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 9, z + 9), log); + this.setBlockState(new BlockPos(x + 20, y + 9, z + 9), leaves); + this.setBlockState(new BlockPos(x + 8, y + 9, z + 10), leaves); + this.setBlockState(new BlockPos(x + 11, y + 9, z + 10), leaves); + this.setBlockState(new BlockPos(x + 12, y + 9, z + 10), log); + this.setBlockState(new BlockPos(x + 13, y + 9, z + 10), log); + this.setBlockState(new BlockPos(x + 14, y + 9, z + 10), log); + this.setBlockState(new BlockPos(x + 16, y + 9, z + 10), leaves); + this.setBlockState(new BlockPos(x + 13, y + 9, z + 11), leaves); + this.setBlockState(new BlockPos(x + 17, y + 9, z + 13), leaves); + this.setBlockState(new BlockPos(x + 14, y + 9, z + 15), leaves); + this.setBlockState(new BlockPos(x + 15, y + 9, z + 15), leaves); + this.setBlockState(new BlockPos(x + 15, y + 10, z + 7), leaves); + this.setBlockState(new BlockPos(x + 20, y + 10, z + 7), leaves); + this.setBlockState(new BlockPos(x + 12, y + 10, z + 8), leaves); + this.setBlockState(new BlockPos(x + 14, y + 10, z + 8), leaves); + this.setBlockState(new BlockPos(x + 17, y + 10, z + 8), leaves); + this.setBlockState(new BlockPos(x + 20, y + 10, z + 8), leaves); + this.setBlockState(new BlockPos(x + 21, y + 10, z + 8), leaves); + this.setBlockState(new BlockPos(x + 11, y + 10, z + 9), leaves); + this.setBlockState(new BlockPos(x + 13, y + 10, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 10, z + 9), log); + this.setBlockState(new BlockPos(x + 17, y + 10, z + 9), leaves); + this.setBlockState(new BlockPos(x + 9, y + 10, z + 10), leaves); + this.setBlockState(new BlockPos(x + 11, y + 10, z + 10), log); + this.setBlockState(new BlockPos(x + 12, y + 10, z + 10), log); + this.setBlockState(new BlockPos(x + 13, y + 10, z + 10), log); + this.setBlockState(new BlockPos(x + 14, y + 10, z + 10), log); + this.setBlockState(new BlockPos(x + 7, y + 10, z + 11), leaves); + this.setBlockState(new BlockPos(x + 13, y + 10, z + 11), log); + this.setBlockState(new BlockPos(x + 17, y + 10, z + 11), leaves); + this.setBlockState(new BlockPos(x + 19, y + 10, z + 11), leaves); + this.setBlockState(new BlockPos(x + 9, y + 10, z + 12), leaves); + this.setBlockState(new BlockPos(x + 11, y + 10, z + 12), leaves); + this.setBlockState(new BlockPos(x + 17, y + 10, z + 13), leaves); + this.setBlockState(new BlockPos(x + 16, y + 10, z + 14), leaves); + this.setBlockState(new BlockPos(x + 16, y + 10, z + 15), leaves); + this.setBlockState(new BlockPos(x + 12, y + 10, z + 16), leaves); + this.setBlockState(new BlockPos(x + 13, y + 10, z + 18), leaves); + this.setBlockState(new BlockPos(x + 17, y + 11, z + 5), leaves); + this.setBlockState(new BlockPos(x + 11, y + 11, z + 7), leaves); + this.setBlockState(new BlockPos(x + 20, y + 11, z + 8), leaves); + this.setBlockState(new BlockPos(x + 6, y + 11, z + 9), leaves); + this.setBlockState(new BlockPos(x + 11, y + 11, z + 9), leaves); + this.setBlockState(new BlockPos(x + 13, y + 11, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 11, z + 9), log); + this.setBlockState(new BlockPos(x + 8, y + 11, z + 10), leaves); + this.setBlockState(new BlockPos(x + 9, y + 11, z + 10), leaves); + this.setBlockState(new BlockPos(x + 10, y + 11, z + 10), log); + this.setBlockState(new BlockPos(x + 13, y + 11, z + 10), log); + this.setBlockState(new BlockPos(x + 14, y + 11, z + 10), log); + this.setBlockState(new BlockPos(x + 9, y + 11, z + 11), leaves); + this.setBlockState(new BlockPos(x + 17, y + 11, z + 11), leaves); + this.setBlockState(new BlockPos(x + 18, y + 11, z + 11), leaves); + this.setBlockState(new BlockPos(x + 7, y + 11, z + 12), leaves); + this.setBlockState(new BlockPos(x + 13, y + 11, z + 12), log); + this.setBlockState(new BlockPos(x + 14, y + 11, z + 12), leaves); + this.setBlockState(new BlockPos(x + 15, y + 11, z + 12), leaves); + this.setBlockState(new BlockPos(x + 18, y + 11, z + 12), leaves); + this.setBlockState(new BlockPos(x + 16, y + 11, z + 13), leaves); + this.setBlockState(new BlockPos(x + 14, y + 11, z + 14), leaves); + this.setBlockState(new BlockPos(x + 15, y + 11, z + 14), leaves); + this.setBlockState(new BlockPos(x + 17, y + 11, z + 14), leaves); + this.setBlockState(new BlockPos(x + 19, y + 11, z + 14), leaves); + this.setBlockState(new BlockPos(x + 5, y + 11, z + 15), leaves); + spawn1(world, x, y, z, log, leaves); + } + + protected void spawn1(World world, int x, int y, int z, IBlockState log, IBlockState leaves) { + + this.setBlockState(new BlockPos(x + 6, y + 11, z + 15), leaves); + this.setBlockState(new BlockPos(x + 17, y + 11, z + 15), leaves); + this.setBlockState(new BlockPos(x + 15, y + 11, z + 18), leaves); + this.setBlockState(new BlockPos(x + 16, y + 11, z + 18), leaves); + this.setBlockState(new BlockPos(x + 17, y + 12, z + 5), leaves); + this.setBlockState(new BlockPos(x + 15, y + 12, z + 7), leaves); + this.setBlockState(new BlockPos(x + 18, y + 12, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, y + 12, z + 8), leaves); + this.setBlockState(new BlockPos(x + 11, y + 12, z + 8), leaves); + this.setBlockState(new BlockPos(x + 12, y + 12, z + 8), log); + this.setBlockState(new BlockPos(x + 14, y + 12, z + 8), leaves); + this.setBlockState(new BlockPos(x + 15, y + 12, z + 8), leaves); + this.setBlockState(new BlockPos(x + 16, y + 12, z + 8), leaves); + this.setBlockState(new BlockPos(x + 17, y + 12, z + 8), leaves); + this.setBlockState(new BlockPos(x + 19, y + 12, z + 8), leaves); + this.setBlockState(new BlockPos(x + 20, y + 12, z + 8), leaves); + this.setBlockState(new BlockPos(x + 9, y + 12, z + 9), leaves); + this.setBlockState(new BlockPos(x + 12, y + 12, z + 9), leaves); + this.setBlockState(new BlockPos(x + 14, y + 12, z + 9), log); + this.setBlockState(new BlockPos(x + 8, y + 12, z + 10), leaves); + this.setBlockState(new BlockPos(x + 10, y + 12, z + 10), leaves); + this.setBlockState(new BlockPos(x + 13, y + 12, z + 10), log); + this.setBlockState(new BlockPos(x + 14, y + 12, z + 10), log); + this.setBlockState(new BlockPos(x + 15, y + 12, z + 10), leaves); + this.setBlockState(new BlockPos(x + 17, y + 12, z + 10), leaves); + this.setBlockState(new BlockPos(x + 18, y + 12, z + 10), leaves); + this.setBlockState(new BlockPos(x + 20, y + 12, z + 10), leaves); + this.setBlockState(new BlockPos(x + 5, y + 12, z + 11), leaves); + this.setBlockState(new BlockPos(x + 9, y + 12, z + 11), log); + this.setBlockState(new BlockPos(x + 10, y + 12, z + 11), leaves); + this.setBlockState(new BlockPos(x + 11, y + 12, z + 11), leaves); + this.setBlockState(new BlockPos(x + 19, y + 12, z + 11), leaves); + this.setBlockState(new BlockPos(x + 8, y + 12, z + 12), leaves); + this.setBlockState(new BlockPos(x + 16, y + 12, z + 12), leaves); + this.setBlockState(new BlockPos(x + 17, y + 12, z + 12), leaves); + this.setBlockState(new BlockPos(x + 19, y + 12, z + 12), leaves); + this.setBlockState(new BlockPos(x + 20, y + 12, z + 12), leaves); + this.setBlockState(new BlockPos(x + 8, y + 12, z + 13), leaves); + this.setBlockState(new BlockPos(x + 13, y + 12, z + 13), log); + this.setBlockState(new BlockPos(x + 17, y + 12, z + 13), leaves); + this.setBlockState(new BlockPos(x + 13, y + 12, z + 14), leaves); + this.setBlockState(new BlockPos(x + 14, y + 12, z + 14), leaves); + this.setBlockState(new BlockPos(x + 16, y + 12, z + 14), leaves); + this.setBlockState(new BlockPos(x + 17, y + 12, z + 14), leaves); + this.setBlockState(new BlockPos(x + 6, y + 12, z + 15), leaves); + this.setBlockState(new BlockPos(x + 15, y + 12, z + 15), leaves); + this.setBlockState(new BlockPos(x + 17, y + 12, z + 15), leaves); + this.setBlockState(new BlockPos(x + 6, y + 12, z + 16), leaves); + this.setBlockState(new BlockPos(x + 12, y + 12, z + 16), leaves); + this.setBlockState(new BlockPos(x + 13, y + 12, z + 16), leaves); + this.setBlockState(new BlockPos(x + 15, y + 12, z + 16), leaves); + this.setBlockState(new BlockPos(x + 16, y + 12, z + 16), leaves); + this.setBlockState(new BlockPos(x + 18, y + 12, z + 16), leaves); + this.setBlockState(new BlockPos(x + 8, y + 12, z + 17), leaves); + this.setBlockState(new BlockPos(x + 12, y + 12, z + 17), leaves); + this.setBlockState(new BlockPos(x + 14, y + 12, z + 17), leaves); + this.setBlockState(new BlockPos(x + 16, y + 12, z + 17), leaves); + this.setBlockState(new BlockPos(x + 9, y + 12, z + 18), leaves); + this.setBlockState(new BlockPos(x + 12, y + 12, z + 18), leaves); + this.setBlockState(new BlockPos(x + 13, y + 12, z + 18), leaves); + this.setBlockState(new BlockPos(x + 14, y + 12, z + 18), leaves); + this.setBlockState(new BlockPos(x + 14, y + 12, z + 19), leaves); + this.setBlockState(new BlockPos(x + 18, y + 13, z + 5), leaves); + this.setBlockState(new BlockPos(x + 16, y + 13, z + 6), leaves); + this.setBlockState(new BlockPos(x + 17, y + 13, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, y + 13, z + 7), leaves); + this.setBlockState(new BlockPos(x + 12, y + 13, z + 7), leaves); + this.setBlockState(new BlockPos(x + 13, y + 13, z + 7), leaves); + this.setBlockState(new BlockPos(x + 18, y + 13, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 8), leaves); + this.setBlockState(new BlockPos(x + 9, y + 13, z + 8), leaves); + this.setBlockState(new BlockPos(x + 10, y + 13, z + 8), leaves); + this.setBlockState(new BlockPos(x + 12, y + 13, z + 8), log); + this.setBlockState(new BlockPos(x + 14, y + 13, z + 8), leaves); + this.setBlockState(new BlockPos(x + 15, y + 13, z + 8), leaves); + this.setBlockState(new BlockPos(x + 17, y + 13, z + 8), leaves); + this.setBlockState(new BlockPos(x + 19, y + 13, z + 8), leaves); + this.setBlockState(new BlockPos(x + 20, y + 13, z + 8), leaves); + this.setBlockState(new BlockPos(x + 9, y + 13, z + 9), leaves); + this.setBlockState(new BlockPos(x + 14, y + 13, z + 9), leaves); + this.setBlockState(new BlockPos(x + 15, y + 13, z + 9), log); + this.setBlockState(new BlockPos(x + 17, y + 13, z + 9), leaves); + this.setBlockState(new BlockPos(x + 18, y + 13, z + 9), leaves); + this.setBlockState(new BlockPos(x + 20, y + 13, z + 9), leaves); + this.setBlockState(new BlockPos(x + 5, y + 13, z + 10), leaves); + this.setBlockState(new BlockPos(x + 8, y + 13, z + 10), leaves); + this.setBlockState(new BlockPos(x + 9, y + 13, z + 10), leaves); + this.setBlockState(new BlockPos(x + 13, y + 13, z + 10), log); + this.setBlockState(new BlockPos(x + 16, y + 13, z + 10), leaves); + this.setBlockState(new BlockPos(x + 18, y + 13, z + 10), leaves); + this.setBlockState(new BlockPos(x + 5, y + 13, z + 11), leaves); + this.setBlockState(new BlockPos(x + 7, y + 13, z + 11), leaves); + this.setBlockState(new BlockPos(x + 8, y + 13, z + 11), log); + this.setBlockState(new BlockPos(x + 11, y + 13, z + 11), leaves); + this.setBlockState(new BlockPos(x + 12, y + 13, z + 11), leaves); + this.setBlockState(new BlockPos(x + 13, y + 13, z + 11), leaves); + this.setBlockState(new BlockPos(x + 15, y + 13, z + 11), log); + this.setBlockState(new BlockPos(x + 17, y + 13, z + 11), leaves); + this.setBlockState(new BlockPos(x + 7, y + 13, z + 12), leaves); + this.setBlockState(new BlockPos(x + 8, y + 13, z + 12), leaves); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 13), leaves); + this.setBlockState(new BlockPos(x + 13, y + 13, z + 13), log); + this.setBlockState(new BlockPos(x + 14, y + 13, z + 13), leaves); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 14), leaves); + this.setBlockState(new BlockPos(x + 13, y + 13, z + 14), leaves); + this.setBlockState(new BlockPos(x + 17, y + 13, z + 14), leaves); + this.setBlockState(new BlockPos(x + 8, y + 13, z + 15), leaves); + this.setBlockState(new BlockPos(x + 13, y + 13, z + 15), leaves); + this.setBlockState(new BlockPos(x + 14, y + 13, z + 15), leaves); + this.setBlockState(new BlockPos(x + 15, y + 13, z + 15), leaves); + this.setBlockState(new BlockPos(x + 16, y + 13, z + 15), leaves); + this.setBlockState(new BlockPos(x + 17, y + 13, z + 15), leaves); + this.setBlockState(new BlockPos(x + 8, y + 13, z + 16), leaves); + this.setBlockState(new BlockPos(x + 11, y + 13, z + 16), leaves); + this.setBlockState(new BlockPos(x + 12, y + 13, z + 16), leaves); + this.setBlockState(new BlockPos(x + 13, y + 13, z + 16), leaves); + this.setBlockState(new BlockPos(x + 14, y + 13, z + 16), leaves); + this.setBlockState(new BlockPos(x + 4, y + 13, z + 17), leaves); + this.setBlockState(new BlockPos(x + 7, y + 13, z + 17), leaves); + this.setBlockState(new BlockPos(x + 12, y + 13, z + 17), leaves); + this.setBlockState(new BlockPos(x + 16, y + 13, z + 17), leaves); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 18), leaves); + this.setBlockState(new BlockPos(x + 8, y + 13, z + 19), leaves); + this.setBlockState(new BlockPos(x + 9, y + 13, z + 19), leaves); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 1), leaves); + this.setBlockState(new BlockPos(x + 17, y + 14, z + 2), leaves); + this.setBlockState(new BlockPos(x + 15, y + 14, z + 3), leaves); + this.setBlockState(new BlockPos(x + 16, y + 14, z + 4), leaves); + this.setBlockState(new BlockPos(x + 12, y + 14, z + 5), leaves); + this.setBlockState(new BlockPos(x + 15, y + 14, z + 5), leaves); + this.setBlockState(new BlockPos(x + 17, y + 14, z + 5), leaves); + this.setBlockState(new BlockPos(x + 12, y + 14, z + 6), leaves); + this.setBlockState(new BlockPos(x + 14, y + 14, z + 6), leaves); + this.setBlockState(new BlockPos(x + 15, y + 14, z + 6), leaves); + this.setBlockState(new BlockPos(x + 17, y + 14, z + 6), leaves); + this.setBlockState(new BlockPos(x + 10, y + 14, z + 7), leaves); + this.setBlockState(new BlockPos(x + 14, y + 14, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 8), leaves); + this.setBlockState(new BlockPos(x + 12, y + 14, z + 8), log); + this.setBlockState(new BlockPos(x + 14, y + 14, z + 8), leaves); + this.setBlockState(new BlockPos(x + 16, y + 14, z + 8), leaves); + this.setBlockState(new BlockPos(x + 19, y + 14, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 9), leaves); + this.setBlockState(new BlockPos(x + 14, y + 14, z + 9), leaves); + this.setBlockState(new BlockPos(x + 15, y + 14, z + 9), log); + this.setBlockState(new BlockPos(x + 16, y + 14, z + 9), leaves); + this.setBlockState(new BlockPos(x + 17, y + 14, z + 9), leaves); + this.setBlockState(new BlockPos(x + 14, y + 14, z + 10), leaves); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 11), leaves); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 11), leaves); + this.setBlockState(new BlockPos(x + 13, y + 14, z + 11), log); + this.setBlockState(new BlockPos(x + 15, y + 14, z + 11), log); + this.setBlockState(new BlockPos(x + 17, y + 14, z + 11), leaves); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 12), leaves); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 12), log); + this.setBlockState(new BlockPos(x + 10, y + 14, z + 12), leaves); + this.setBlockState(new BlockPos(x + 15, y + 14, z + 12), leaves); + this.setBlockState(new BlockPos(x + 16, y + 14, z + 12), leaves); + this.setBlockState(new BlockPos(x + 19, y + 14, z + 12), leaves); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 13), leaves); + this.setBlockState(new BlockPos(x + 8, y + 14, z + 13), leaves); + this.setBlockState(new BlockPos(x + 10, y + 14, z + 13), leaves); + this.setBlockState(new BlockPos(x + 13, y + 14, z + 13), leaves); + this.setBlockState(new BlockPos(x + 16, y + 14, z + 13), leaves); + this.setBlockState(new BlockPos(x + 3, y + 14, z + 14), leaves); + this.setBlockState(new BlockPos(x + 8, y + 14, z + 14), leaves); + this.setBlockState(new BlockPos(x + 9, y + 14, z + 14), leaves); + this.setBlockState(new BlockPos(x + 10, y + 14, z + 14), leaves); + this.setBlockState(new BlockPos(x + 14, y + 14, z + 14), log); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 15), leaves); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 15), leaves); + this.setBlockState(new BlockPos(x + 12, y + 14, z + 15), leaves); + this.setBlockState(new BlockPos(x + 14, y + 14, z + 15), leaves); + this.setBlockState(new BlockPos(x + 17, y + 14, z + 15), leaves); + this.setBlockState(new BlockPos(x + 3, y + 14, z + 16), leaves); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 16), leaves); + this.setBlockState(new BlockPos(x + 9, y + 14, z + 16), leaves); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 17), leaves); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 17), leaves); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 18), leaves); + this.setBlockState(new BlockPos(x + 9, y + 14, z + 18), leaves); + this.setBlockState(new BlockPos(x + 13, y + 14, z + 18), leaves); + this.setBlockState(new BlockPos(x + 15, y + 14, z + 18), leaves); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 19), leaves); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 19), leaves); + this.setBlockState(new BlockPos(x + 11, y + 14, z + 19), leaves); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 0), leaves); + this.setBlockState(new BlockPos(x + 15, y + 15, z + 0), leaves); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 1), leaves); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 1), leaves); + this.setBlockState(new BlockPos(x + 15, y + 15, z + 1), leaves); + this.setBlockState(new BlockPos(x + 8, y + 15, z + 2), leaves); + this.setBlockState(new BlockPos(x + 15, y + 15, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, y + 15, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, y + 15, z + 3), leaves); + this.setBlockState(new BlockPos(x + 13, y + 15, z + 3), leaves); + this.setBlockState(new BlockPos(x + 15, y + 15, z + 3), leaves); + this.setBlockState(new BlockPos(x + 18, y + 15, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 4), leaves); + this.setBlockState(new BlockPos(x + 15, y + 15, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, y + 15, z + 5), leaves); + this.setBlockState(new BlockPos(x + 15, y + 15, z + 5), leaves); + this.setBlockState(new BlockPos(x + 16, y + 15, z + 5), leaves); + this.setBlockState(new BlockPos(x + 18, y + 15, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 6), leaves); + this.setBlockState(new BlockPos(x + 10, y + 15, z + 6), leaves); + this.setBlockState(new BlockPos(x + 11, y + 15, z + 6), leaves); + this.setBlockState(new BlockPos(x + 13, y + 15, z + 6), leaves); + this.setBlockState(new BlockPos(x + 16, y + 15, z + 6), leaves); + this.setBlockState(new BlockPos(x + 17, y + 15, z + 6), leaves); + this.setBlockState(new BlockPos(x + 18, y + 15, z + 6), leaves); + this.setBlockState(new BlockPos(x + 19, y + 15, z + 6), leaves); + this.setBlockState(new BlockPos(x + 8, y + 15, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, y + 15, z + 7), leaves); + this.setBlockState(new BlockPos(x + 12, y + 15, z + 7), leaves); + this.setBlockState(new BlockPos(x + 20, y + 15, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 8), leaves); + this.setBlockState(new BlockPos(x + 11, y + 15, z + 8), log); + this.setBlockState(new BlockPos(x + 12, y + 15, z + 8), leaves); + this.setBlockState(new BlockPos(x + 13, y + 15, z + 8), leaves); + this.setBlockState(new BlockPos(x + 16, y + 15, z + 8), log); + this.setBlockState(new BlockPos(x + 12, y + 15, z + 10), leaves); + this.setBlockState(new BlockPos(x + 14, y + 15, z + 10), leaves); + this.setBlockState(new BlockPos(x + 3, y + 15, z + 11), leaves); + this.setBlockState(new BlockPos(x + 4, y + 15, z + 11), leaves); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 11), leaves); + this.setBlockState(new BlockPos(x + 10, y + 15, z + 11), leaves); + this.setBlockState(new BlockPos(x + 13, y + 15, z + 11), log); + this.setBlockState(new BlockPos(x + 15, y + 15, z + 11), leaves); + this.setBlockState(new BlockPos(x + 19, y + 15, z + 11), leaves); + this.setBlockState(new BlockPos(x + 3, y + 15, z + 12), leaves); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 12), leaves); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 12), log); + this.setBlockState(new BlockPos(x + 13, y + 15, z + 12), leaves); + this.setBlockState(new BlockPos(x + 16, y + 15, z + 12), log); + this.setBlockState(new BlockPos(x + 17, y + 15, z + 12), leaves); + this.setBlockState(new BlockPos(x + 19, y + 15, z + 12), leaves); + this.setBlockState(new BlockPos(x + 4, y + 15, z + 13), leaves); + this.setBlockState(new BlockPos(x + 5, y + 15, z + 13), leaves); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 13), leaves); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 13), leaves); + this.setBlockState(new BlockPos(x + 9, y + 15, z + 13), leaves); + this.setBlockState(new BlockPos(x + 10, y + 15, z + 13), leaves); + this.setBlockState(new BlockPos(x + 14, y + 15, z + 13), leaves); + this.setBlockState(new BlockPos(x + 16, y + 15, z + 13), leaves); + this.setBlockState(new BlockPos(x + 18, y + 15, z + 13), leaves); + this.setBlockState(new BlockPos(x + 4, y + 15, z + 14), leaves); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 14), leaves); + this.setBlockState(new BlockPos(x + 14, y + 15, z + 14), leaves); + this.setBlockState(new BlockPos(x + 11, y + 15, z + 15), leaves); + this.setBlockState(new BlockPos(x + 14, y + 15, z + 15), log); + this.setBlockState(new BlockPos(x + 15, y + 15, z + 15), leaves); + this.setBlockState(new BlockPos(x + 16, y + 15, z + 15), leaves); + this.setBlockState(new BlockPos(x + 5, y + 15, z + 16), leaves); + this.setBlockState(new BlockPos(x + 8, y + 15, z + 16), leaves); + this.setBlockState(new BlockPos(x + 11, y + 15, z + 16), leaves); + this.setBlockState(new BlockPos(x + 12, y + 15, z + 16), leaves); + this.setBlockState(new BlockPos(x + 13, y + 15, z + 16), leaves); + this.setBlockState(new BlockPos(x + 15, y + 15, z + 16), leaves); + this.setBlockState(new BlockPos(x + 4, y + 15, z + 17), leaves); + this.setBlockState(new BlockPos(x + 8, y + 15, z + 17), leaves); + this.setBlockState(new BlockPos(x + 11, y + 15, z + 17), leaves); + this.setBlockState(new BlockPos(x + 12, y + 15, z + 17), leaves); + this.setBlockState(new BlockPos(x + 13, y + 15, z + 17), leaves); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 18), leaves); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 18), leaves); + this.setBlockState(new BlockPos(x + 11, y + 15, z + 18), leaves); + this.setBlockState(new BlockPos(x + 15, y + 15, z + 18), leaves); + this.setBlockState(new BlockPos(x + 8, y + 15, z + 19), leaves); + this.setBlockState(new BlockPos(x + 10, y + 15, z + 19), leaves); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 20), leaves); + this.setBlockState(new BlockPos(x + 17, y + 16, z + 0), leaves); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 1), leaves); + this.setBlockState(new BlockPos(x + 8, y + 16, z + 1), leaves); + this.setBlockState(new BlockPos(x + 13, y + 16, z + 1), leaves); + this.setBlockState(new BlockPos(x + 17, y + 16, z + 1), leaves); + this.setBlockState(new BlockPos(x + 8, y + 16, z + 2), leaves); + this.setBlockState(new BlockPos(x + 9, y + 16, z + 2), leaves); + this.setBlockState(new BlockPos(x + 12, y + 16, z + 2), leaves); + this.setBlockState(new BlockPos(x + 17, y + 16, z + 2), leaves); + this.setBlockState(new BlockPos(x + 18, y + 16, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, y + 16, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, y + 16, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, y + 16, z + 3), leaves); + this.setBlockState(new BlockPos(x + 13, y + 16, z + 3), leaves); + this.setBlockState(new BlockPos(x + 18, y + 16, z + 3), leaves); + this.setBlockState(new BlockPos(x + 17, y + 16, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, y + 16, z + 5), leaves); + this.setBlockState(new BlockPos(x + 18, y + 16, z + 5), leaves); + this.setBlockState(new BlockPos(x + 19, y + 16, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 6), leaves); + this.setBlockState(new BlockPos(x + 15, y + 16, z + 6), leaves); + this.setBlockState(new BlockPos(x + 16, y + 16, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 7), leaves); + this.setBlockState(new BlockPos(x + 9, y + 16, z + 7), leaves); + this.setBlockState(new BlockPos(x + 14, y + 16, z + 7), leaves); + this.setBlockState(new BlockPos(x + 16, y + 16, z + 7), leaves); + this.setBlockState(new BlockPos(x + 17, y + 16, z + 7), log); + this.setBlockState(new BlockPos(x + 18, y + 16, z + 7), leaves); + this.setBlockState(new BlockPos(x + 11, y + 16, z + 8), log); + this.setBlockState(new BlockPos(x + 12, y + 16, z + 8), leaves); + this.setBlockState(new BlockPos(x + 16, y + 16, z + 8), log); + this.setBlockState(new BlockPos(x + 17, y + 16, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, y + 16, z + 9), leaves); + this.setBlockState(new BlockPos(x + 11, y + 16, z + 9), leaves); + this.setBlockState(new BlockPos(x + 12, y + 16, z + 9), leaves); + this.setBlockState(new BlockPos(x + 16, y + 16, z + 9), leaves); + this.setBlockState(new BlockPos(x + 17, y + 16, z + 9), leaves); + this.setBlockState(new BlockPos(x + 18, y + 16, z + 9), leaves); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 10), leaves); + this.setBlockState(new BlockPos(x + 16, y + 16, z + 10), leaves); + this.setBlockState(new BlockPos(x + 2, y + 16, z + 11), leaves); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 11), leaves); + this.setBlockState(new BlockPos(x + 9, y + 16, z + 11), leaves); + this.setBlockState(new BlockPos(x + 12, y + 16, z + 11), log); + this.setBlockState(new BlockPos(x + 14, y + 16, z + 11), leaves); + this.setBlockState(new BlockPos(x + 2, y + 16, z + 12), leaves); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 12), log); + this.setBlockState(new BlockPos(x + 9, y + 16, z + 12), leaves); + this.setBlockState(new BlockPos(x + 14, y + 16, z + 12), leaves); + this.setBlockState(new BlockPos(x + 16, y + 16, z + 12), log); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 13), leaves); + this.setBlockState(new BlockPos(x + 11, y + 16, z + 13), leaves); + this.setBlockState(new BlockPos(x + 5, y + 16, z + 14), leaves); + this.setBlockState(new BlockPos(x + 11, y + 16, z + 14), leaves); + this.setBlockState(new BlockPos(x + 13, y + 16, z + 14), leaves); + this.setBlockState(new BlockPos(x + 14, y + 16, z + 14), leaves); + this.setBlockState(new BlockPos(x + 16, y + 16, z + 14), leaves); + this.setBlockState(new BlockPos(x + 18, y + 16, z + 14), leaves); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 15), leaves); + this.setBlockState(new BlockPos(x + 11, y + 16, z + 15), leaves); + this.setBlockState(new BlockPos(x + 13, y + 16, z + 15), leaves); + this.setBlockState(new BlockPos(x + 13, y + 16, z + 16), log); + this.setBlockState(new BlockPos(x + 8, y + 16, z + 17), leaves); + this.setBlockState(new BlockPos(x + 9, y + 16, z + 17), leaves); + this.setBlockState(new BlockPos(x + 11, y + 16, z + 17), leaves); + this.setBlockState(new BlockPos(x + 12, y + 16, z + 17), leaves); + this.setBlockState(new BlockPos(x + 11, y + 16, z + 19), leaves); + this.setBlockState(new BlockPos(x + 13, y + 16, z + 19), leaves); + this.setBlockState(new BlockPos(x + 14, y + 16, z + 19), leaves); + this.setBlockState(new BlockPos(x + 15, y + 16, z + 19), leaves); + this.setBlockState(new BlockPos(x + 8, y + 16, z + 20), leaves); + this.setBlockState(new BlockPos(x + 8, y + 17, z + 0), leaves); + this.setBlockState(new BlockPos(x + 13, y + 17, z + 0), leaves); + this.setBlockState(new BlockPos(x + 14, y + 17, z + 0), leaves); + this.setBlockState(new BlockPos(x + 15, y + 17, z + 0), leaves); + this.setBlockState(new BlockPos(x + 16, y + 17, z + 0), leaves); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 1), leaves); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 2), leaves); + this.setBlockState(new BlockPos(x + 12, y + 17, z + 2), leaves); + this.setBlockState(new BlockPos(x + 13, y + 17, z + 2), leaves); + this.setBlockState(new BlockPos(x + 14, y + 17, z + 2), leaves); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, y + 17, z + 3), leaves); + this.setBlockState(new BlockPos(x + 14, y + 17, z + 4), leaves); + this.setBlockState(new BlockPos(x + 15, y + 17, z + 4), leaves); + this.setBlockState(new BlockPos(x + 16, y + 17, z + 4), leaves); + this.setBlockState(new BlockPos(x + 17, y + 17, z + 4), leaves); + this.setBlockState(new BlockPos(x + 19, y + 17, z + 4), leaves); + this.setBlockState(new BlockPos(x + 20, y + 17, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, y + 17, z + 6), leaves); + this.setBlockState(new BlockPos(x + 14, y + 17, z + 6), leaves); + this.setBlockState(new BlockPos(x + 18, y + 17, z + 6), log); + this.setBlockState(new BlockPos(x + 19, y + 17, z + 6), leaves); + this.setBlockState(new BlockPos(x + 19, y + 17, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, y + 17, z + 8), leaves); + this.setBlockState(new BlockPos(x + 9, y + 17, z + 8), leaves); + this.setBlockState(new BlockPos(x + 11, y + 17, z + 8), log); + this.setBlockState(new BlockPos(x + 16, y + 17, z + 8), log); + this.setBlockState(new BlockPos(x + 20, y + 17, z + 8), leaves); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 9), leaves); + this.setBlockState(new BlockPos(x + 5, y + 17, z + 9), leaves); + this.setBlockState(new BlockPos(x + 15, y + 17, z + 9), leaves); + this.setBlockState(new BlockPos(x + 19, y + 17, z + 9), leaves); + this.setBlockState(new BlockPos(x + 2, y + 17, z + 10), leaves); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 10), leaves); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 10), leaves); + this.setBlockState(new BlockPos(x + 7, y + 17, z + 10), leaves); + this.setBlockState(new BlockPos(x + 8, y + 17, z + 10), leaves); + this.setBlockState(new BlockPos(x + 11, y + 17, z + 10), leaves); + this.setBlockState(new BlockPos(x + 16, y + 17, z + 10), leaves); + this.setBlockState(new BlockPos(x + 18, y + 17, z + 10), leaves); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 11), leaves); + this.setBlockState(new BlockPos(x + 5, y + 17, z + 11), log); + this.setBlockState(new BlockPos(x + 12, y + 17, z + 11), log); + this.setBlockState(new BlockPos(x + 15, y + 17, z + 11), leaves); + this.setBlockState(new BlockPos(x + 18, y + 17, z + 11), leaves); + this.setBlockState(new BlockPos(x + 5, y + 17, z + 12), leaves); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 12), log); + this.setBlockState(new BlockPos(x + 12, y + 17, z + 12), log); + this.setBlockState(new BlockPos(x + 16, y + 17, z + 12), log); + this.setBlockState(new BlockPos(x + 12, y + 17, z + 13), log); + this.setBlockState(new BlockPos(x + 16, y + 17, z + 13), leaves); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 14), leaves); + this.setBlockState(new BlockPos(x + 7, y + 17, z + 14), leaves); + this.setBlockState(new BlockPos(x + 10, y + 17, z + 14), leaves); + this.setBlockState(new BlockPos(x + 13, y + 17, z + 14), leaves); + this.setBlockState(new BlockPos(x + 14, y + 17, z + 14), leaves); + this.setBlockState(new BlockPos(x + 17, y + 17, z + 14), leaves); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 15), leaves); + this.setBlockState(new BlockPos(x + 13, y + 17, z + 15), leaves); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 16), leaves); + this.setBlockState(new BlockPos(x + 5, y + 17, z + 16), leaves); + this.setBlockState(new BlockPos(x + 7, y + 17, z + 16), leaves); + this.setBlockState(new BlockPos(x + 14, y + 17, z + 16), leaves); + this.setBlockState(new BlockPos(x + 8, y + 17, z + 17), leaves); + this.setBlockState(new BlockPos(x + 9, y + 17, z + 17), leaves); + this.setBlockState(new BlockPos(x + 10, y + 17, z + 17), leaves); + this.setBlockState(new BlockPos(x + 13, y + 17, z + 17), log); + this.setBlockState(new BlockPos(x + 16, y + 17, z + 17), leaves); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 19), leaves); + this.setBlockState(new BlockPos(x + 8, y + 17, z + 19), leaves); + this.setBlockState(new BlockPos(x + 9, y + 17, z + 20), leaves); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 0), leaves); + this.setBlockState(new BlockPos(x + 13, y + 18, z + 0), leaves); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 1), leaves); + this.setBlockState(new BlockPos(x + 10, y + 18, z + 1), leaves); + this.setBlockState(new BlockPos(x + 18, y + 18, z + 1), leaves); + this.setBlockState(new BlockPos(x + 5, y + 18, z + 2), leaves); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 2), leaves); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 2), leaves); + this.setBlockState(new BlockPos(x + 9, y + 18, z + 2), leaves); + this.setBlockState(new BlockPos(x + 14, y + 18, z + 2), leaves); + this.setBlockState(new BlockPos(x + 16, y + 18, z + 2), leaves); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, y + 18, z + 3), leaves); + this.setBlockState(new BlockPos(x + 15, y + 18, z + 3), leaves); + this.setBlockState(new BlockPos(x + 17, y + 18, z + 3), leaves); + this.setBlockState(new BlockPos(x + 18, y + 18, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 5), leaves); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 5), leaves); + this.setBlockState(new BlockPos(x + 12, y + 18, z + 5), leaves); + this.setBlockState(new BlockPos(x + 17, y + 18, z + 5), log); + this.setBlockState(new BlockPos(x + 19, y + 18, z + 5), leaves); + this.setBlockState(new BlockPos(x + 21, y + 18, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 6), leaves); + this.setBlockState(new BlockPos(x + 11, y + 18, z + 6), leaves); + this.setBlockState(new BlockPos(x + 12, y + 18, z + 6), leaves); + this.setBlockState(new BlockPos(x + 13, y + 18, z + 6), leaves); + this.setBlockState(new BlockPos(x + 16, y + 18, z + 6), leaves); + this.setBlockState(new BlockPos(x + 18, y + 18, z + 6), log); + this.setBlockState(new BlockPos(x + 10, y + 18, z + 7), leaves); + this.setBlockState(new BlockPos(x + 11, y + 18, z + 7), log); + this.setBlockState(new BlockPos(x + 13, y + 18, z + 7), leaves); + this.setBlockState(new BlockPos(x + 14, y + 18, z + 7), leaves); + this.setBlockState(new BlockPos(x + 18, y + 18, z + 7), leaves); + this.setBlockState(new BlockPos(x + 4, y + 18, z + 8), leaves); + this.setBlockState(new BlockPos(x + 12, y + 18, z + 8), leaves); + this.setBlockState(new BlockPos(x + 13, y + 18, z + 8), leaves); + this.setBlockState(new BlockPos(x + 14, y + 18, z + 8), leaves); + this.setBlockState(new BlockPos(x + 17, y + 18, z + 8), log); + this.setBlockState(new BlockPos(x + 4, y + 18, z + 9), leaves); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 9), leaves); + this.setBlockState(new BlockPos(x + 2, y + 18, z + 10), leaves); + this.setBlockState(new BlockPos(x + 4, y + 18, z + 10), log); + this.setBlockState(new BlockPos(x + 11, y + 18, z + 10), leaves); + this.setBlockState(new BlockPos(x + 5, y + 18, z + 11), leaves); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 11), leaves); + this.setBlockState(new BlockPos(x + 12, y + 18, z + 11), log); + this.setBlockState(new BlockPos(x + 16, y + 18, z + 11), leaves); + this.setBlockState(new BlockPos(x + 17, y + 18, z + 11), leaves); + this.setBlockState(new BlockPos(x + 18, y + 18, z + 11), leaves); + this.setBlockState(new BlockPos(x + 20, y + 18, z + 11), leaves); + this.setBlockState(new BlockPos(x + 17, y + 18, z + 12), log); + this.setBlockState(new BlockPos(x + 18, y + 18, z + 12), leaves); + this.setBlockState(new BlockPos(x + 20, y + 18, z + 12), leaves); + this.setBlockState(new BlockPos(x + 5, y + 18, z + 13), log); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 13), leaves); + this.setBlockState(new BlockPos(x + 15, y + 18, z + 13), log); + this.setBlockState(new BlockPos(x + 20, y + 18, z + 13), leaves); + this.setBlockState(new BlockPos(x + 11, y + 18, z + 14), log); + this.setBlockState(new BlockPos(x + 13, y + 18, z + 14), leaves); + this.setBlockState(new BlockPos(x + 14, y + 18, z + 14), leaves); + this.setBlockState(new BlockPos(x + 15, y + 18, z + 14), leaves); + this.setBlockState(new BlockPos(x + 16, y + 18, z + 14), leaves); + this.setBlockState(new BlockPos(x + 18, y + 18, z + 14), leaves); + this.setBlockState(new BlockPos(x + 20, y + 18, z + 14), leaves); + this.setBlockState(new BlockPos(x + 4, y + 18, z + 15), leaves); + this.setBlockState(new BlockPos(x + 5, y + 18, z + 15), leaves); + this.setBlockState(new BlockPos(x + 13, y + 18, z + 15), leaves); + this.setBlockState(new BlockPos(x + 14, y + 18, z + 15), leaves); + this.setBlockState(new BlockPos(x + 19, y + 18, z + 15), leaves); + this.setBlockState(new BlockPos(x + 3, y + 18, z + 16), leaves); + this.setBlockState(new BlockPos(x + 4, y + 18, z + 16), leaves); + this.setBlockState(new BlockPos(x + 5, y + 18, z + 16), leaves); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 16), leaves); + this.setBlockState(new BlockPos(x + 11, y + 18, z + 16), leaves); + this.setBlockState(new BlockPos(x + 12, y + 18, z + 16), leaves); + this.setBlockState(new BlockPos(x + 13, y + 18, z + 16), leaves); + this.setBlockState(new BlockPos(x + 14, y + 18, z + 16), leaves); + this.setBlockState(new BlockPos(x + 20, y + 18, z + 16), leaves); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 17), leaves); + this.setBlockState(new BlockPos(x + 13, y + 18, z + 17), log); + this.setBlockState(new BlockPos(x + 15, y + 18, z + 17), leaves); + this.setBlockState(new BlockPos(x + 16, y + 18, z + 17), leaves); + this.setBlockState(new BlockPos(x + 5, y + 18, z + 18), leaves); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 18), leaves); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 18), leaves); + this.setBlockState(new BlockPos(x + 16, y + 18, z + 18), leaves); + this.setBlockState(new BlockPos(x + 18, y + 18, z + 18), leaves); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 19), leaves); + this.setBlockState(new BlockPos(x + 12, y + 18, z + 19), leaves); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 20), leaves); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 20), leaves); + this.setBlockState(new BlockPos(x + 10, y + 18, z + 20), leaves); + this.setBlockState(new BlockPos(x + 13, y + 18, z + 20), leaves); + this.setBlockState(new BlockPos(x + 8, y + 19, z + 1), leaves); + this.setBlockState(new BlockPos(x + 8, y + 19, z + 2), leaves); + this.setBlockState(new BlockPos(x + 18, y + 19, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, y + 19, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, y + 19, z + 3), leaves); + this.setBlockState(new BlockPos(x + 19, y + 19, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, y + 19, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, y + 19, z + 4), leaves); + this.setBlockState(new BlockPos(x + 16, y + 19, z + 4), log); + this.setBlockState(new BlockPos(x + 10, y + 19, z + 5), leaves); + this.setBlockState(new BlockPos(x + 11, y + 19, z + 5), leaves); + this.setBlockState(new BlockPos(x + 17, y + 19, z + 5), leaves); + this.setBlockState(new BlockPos(x + 19, y + 19, z + 5), log); + this.setBlockState(new BlockPos(x + 10, y + 19, z + 6), leaves); + this.setBlockState(new BlockPos(x + 16, y + 19, z + 6), leaves); + this.setBlockState(new BlockPos(x + 20, y + 19, z + 6), leaves); + this.setBlockState(new BlockPos(x + 21, y + 19, z + 6), leaves); + this.setBlockState(new BlockPos(x + 11, y + 19, z + 7), log); + this.setBlockState(new BlockPos(x + 14, y + 19, z + 7), leaves); + this.setBlockState(new BlockPos(x + 17, y + 19, z + 7), leaves); + this.setBlockState(new BlockPos(x + 2, y + 19, z + 8), leaves); + this.setBlockState(new BlockPos(x + 9, y + 19, z + 8), leaves); + this.setBlockState(new BlockPos(x + 17, y + 19, z + 8), log); + this.setBlockState(new BlockPos(x + 4, y + 19, z + 9), leaves); + this.setBlockState(new BlockPos(x + 18, y + 19, z + 9), leaves); + this.setBlockState(new BlockPos(x + 20, y + 19, z + 9), leaves); + this.setBlockState(new BlockPos(x + 4, y + 19, z + 10), log); + this.setBlockState(new BlockPos(x + 7, y + 19, z + 10), leaves); + this.setBlockState(new BlockPos(x + 2, y + 19, z + 11), leaves); + this.setBlockState(new BlockPos(x + 18, y + 19, z + 11), log); + this.setBlockState(new BlockPos(x + 20, y + 19, z + 11), leaves); + this.setBlockState(new BlockPos(x + 12, y + 19, z + 12), log); + this.setBlockState(new BlockPos(x + 18, y + 19, z + 12), leaves); + this.setBlockState(new BlockPos(x + 4, y + 19, z + 13), leaves); + this.setBlockState(new BlockPos(x + 5, y + 19, z + 13), log); + this.setBlockState(new BlockPos(x + 15, y + 19, z + 13), log); + this.setBlockState(new BlockPos(x + 17, y + 19, z + 13), leaves); + this.setBlockState(new BlockPos(x + 21, y + 19, z + 13), leaves); + this.setBlockState(new BlockPos(x + 2, y + 19, z + 14), leaves); + this.setBlockState(new BlockPos(x + 5, y + 19, z + 14), leaves); + this.setBlockState(new BlockPos(x + 6, y + 19, z + 14), leaves); + this.setBlockState(new BlockPos(x + 12, y + 19, z + 14), leaves); + this.setBlockState(new BlockPos(x + 16, y + 19, z + 14), leaves); + this.setBlockState(new BlockPos(x + 18, y + 19, z + 14), leaves); + this.setBlockState(new BlockPos(x + 3, y + 19, z + 15), leaves); + this.setBlockState(new BlockPos(x + 4, y + 19, z + 15), leaves); + this.setBlockState(new BlockPos(x + 11, y + 19, z + 15), log); + this.setBlockState(new BlockPos(x + 21, y + 19, z + 15), leaves); + this.setBlockState(new BlockPos(x + 2, y + 19, z + 16), leaves); + this.setBlockState(new BlockPos(x + 17, y + 19, z + 16), leaves); + this.setBlockState(new BlockPos(x + 18, y + 19, z + 16), leaves); + this.setBlockState(new BlockPos(x + 20, y + 19, z + 16), leaves); + this.setBlockState(new BlockPos(x + 8, y + 19, z + 17), leaves); + this.setBlockState(new BlockPos(x + 10, y + 19, z + 17), leaves); + this.setBlockState(new BlockPos(x + 15, y + 19, z + 17), leaves); + this.setBlockState(new BlockPos(x + 19, y + 19, z + 17), leaves); + this.setBlockState(new BlockPos(x + 3, y + 19, z + 18), leaves); + this.setBlockState(new BlockPos(x + 6, y + 19, z + 18), leaves); + this.setBlockState(new BlockPos(x + 9, y + 19, z + 18), leaves); + this.setBlockState(new BlockPos(x + 14, y + 19, z + 18), leaves); + this.setBlockState(new BlockPos(x + 18, y + 19, z + 18), leaves); + this.setBlockState(new BlockPos(x + 19, y + 19, z + 18), leaves); + this.setBlockState(new BlockPos(x + 4, y + 19, z + 19), leaves); + this.setBlockState(new BlockPos(x + 15, y + 19, z + 19), leaves); + this.setBlockState(new BlockPos(x + 19, y + 19, z + 19), leaves); + this.setBlockState(new BlockPos(x + 11, y + 19, z + 20), leaves); + this.setBlockState(new BlockPos(x + 12, y + 19, z + 20), leaves); + this.setBlockState(new BlockPos(x + 9, y + 19, z + 23), leaves); + this.setBlockState(new BlockPos(x + 8, y + 20, z + 1), leaves); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 1), leaves); + this.setBlockState(new BlockPos(x + 10, y + 20, z + 1), leaves); + this.setBlockState(new BlockPos(x + 14, y + 20, z + 1), leaves); + this.setBlockState(new BlockPos(x + 16, y + 20, z + 1), leaves); + this.setBlockState(new BlockPos(x + 14, y + 20, z + 2), leaves); + this.setBlockState(new BlockPos(x + 19, y + 20, z + 2), leaves); + this.setBlockState(new BlockPos(x + 6, y + 20, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, y + 20, z + 3), leaves); + this.setBlockState(new BlockPos(x + 15, y + 20, z + 3), log); + this.setBlockState(new BlockPos(x + 18, y + 20, z + 3), leaves); + this.setBlockState(new BlockPos(x + 21, y + 20, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, y + 20, z + 4), leaves); + this.setBlockState(new BlockPos(x + 10, y + 20, z + 4), leaves); + this.setBlockState(new BlockPos(x + 15, y + 20, z + 4), leaves); + this.setBlockState(new BlockPos(x + 17, y + 20, z + 4), leaves); + this.setBlockState(new BlockPos(x + 19, y + 20, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, y + 20, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 5), leaves); + this.setBlockState(new BlockPos(x + 12, y + 20, z + 5), leaves); + this.setBlockState(new BlockPos(x + 18, y + 20, z + 5), leaves); + this.setBlockState(new BlockPos(x + 19, y + 20, z + 5), log); + this.setBlockState(new BlockPos(x + 22, y + 20, z + 5), leaves); + this.setBlockState(new BlockPos(x + 4, y + 20, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, y + 20, z + 6), leaves); + this.setBlockState(new BlockPos(x + 11, y + 20, z + 6), log); + this.setBlockState(new BlockPos(x + 12, y + 20, z + 6), leaves); + this.setBlockState(new BlockPos(x + 15, y + 20, z + 6), leaves); + this.setBlockState(new BlockPos(x + 18, y + 20, z + 6), leaves); + this.setBlockState(new BlockPos(x + 20, y + 20, z + 6), leaves); + this.setBlockState(new BlockPos(x + 21, y + 20, z + 6), leaves); + this.setBlockState(new BlockPos(x + 2, y + 20, z + 7), leaves); + this.setBlockState(new BlockPos(x + 3, y + 20, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 7), leaves); + this.setBlockState(new BlockPos(x + 11, y + 20, z + 7), log); + this.setBlockState(new BlockPos(x + 17, y + 20, z + 7), leaves); + this.setBlockState(new BlockPos(x + 18, y + 20, z + 7), log); + this.setBlockState(new BlockPos(x + 20, y + 20, z + 7), leaves); + this.setBlockState(new BlockPos(x + 3, y + 20, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 8), leaves); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 8), leaves); + this.setBlockState(new BlockPos(x + 11, y + 20, z + 8), leaves); + this.setBlockState(new BlockPos(x + 18, y + 20, z + 8), leaves); + this.setBlockState(new BlockPos(x + 19, y + 20, z + 8), leaves); + this.setBlockState(new BlockPos(x + 4, y + 20, z + 9), log); + this.setBlockState(new BlockPos(x + 5, y + 20, z + 9), leaves); + this.setBlockState(new BlockPos(x + 18, y + 20, z + 10), leaves); + this.setBlockState(new BlockPos(x + 2, y + 20, z + 11), leaves); + this.setBlockState(new BlockPos(x + 15, y + 20, z + 11), leaves); + this.setBlockState(new BlockPos(x + 17, y + 20, z + 11), leaves); + this.setBlockState(new BlockPos(x + 18, y + 20, z + 11), log); + this.setBlockState(new BlockPos(x + 21, y + 20, z + 11), leaves); + this.setBlockState(new BlockPos(x + 3, y + 20, z + 12), leaves); + this.setBlockState(new BlockPos(x + 12, y + 20, z + 12), log); + this.setBlockState(new BlockPos(x + 20, y + 20, z + 12), leaves); + this.setBlockState(new BlockPos(x + 15, y + 20, z + 13), log); + this.setBlockState(new BlockPos(x + 18, y + 20, z + 13), leaves); + this.setBlockState(new BlockPos(x + 19, y + 20, z + 13), leaves); + this.setBlockState(new BlockPos(x + 20, y + 20, z + 13), leaves); + this.setBlockState(new BlockPos(x + 21, y + 20, z + 13), leaves); + this.setBlockState(new BlockPos(x + 2, y + 20, z + 14), leaves); + this.setBlockState(new BlockPos(x + 4, y + 20, z + 14), log); + this.setBlockState(new BlockPos(x + 5, y + 20, z + 14), leaves); + this.setBlockState(new BlockPos(x + 6, y + 20, z + 14), leaves); + this.setBlockState(new BlockPos(x + 17, y + 20, z + 14), leaves); + this.setBlockState(new BlockPos(x + 18, y + 20, z + 14), leaves); + this.setBlockState(new BlockPos(x + 1, y + 20, z + 15), leaves); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 15), leaves); + this.setBlockState(new BlockPos(x + 11, y + 20, z + 15), log); + this.setBlockState(new BlockPos(x + 12, y + 20, z + 15), leaves); + this.setBlockState(new BlockPos(x + 17, y + 20, z + 15), leaves); + this.setBlockState(new BlockPos(x + 18, y + 20, z + 15), leaves); + this.setBlockState(new BlockPos(x + 20, y + 20, z + 15), leaves); + this.setBlockState(new BlockPos(x + 21, y + 20, z + 15), leaves); + this.setBlockState(new BlockPos(x + 3, y + 20, z + 16), leaves); + this.setBlockState(new BlockPos(x + 5, y + 20, z + 16), leaves); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 16), leaves); + this.setBlockState(new BlockPos(x + 8, y + 20, z + 16), leaves); + this.setBlockState(new BlockPos(x + 18, y + 20, z + 16), leaves); + this.setBlockState(new BlockPos(x + 4, y + 20, z + 17), leaves); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 17), leaves); + this.setBlockState(new BlockPos(x + 17, y + 20, z + 17), leaves); + this.setBlockState(new BlockPos(x + 21, y + 20, z + 17), leaves); + this.setBlockState(new BlockPos(x + 6, y + 20, z + 18), leaves); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 18), leaves); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 18), leaves); + this.setBlockState(new BlockPos(x + 10, y + 20, z + 18), leaves); + this.setBlockState(new BlockPos(x + 13, y + 20, z + 18), leaves); + this.setBlockState(new BlockPos(x + 3, y + 20, z + 19), leaves); + this.setBlockState(new BlockPos(x + 15, y + 20, z + 19), leaves); + this.setBlockState(new BlockPos(x + 16, y + 20, z + 19), leaves); + this.setBlockState(new BlockPos(x + 19, y + 20, z + 19), leaves); + this.setBlockState(new BlockPos(x + 6, y + 20, z + 20), leaves); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 20), leaves); + this.setBlockState(new BlockPos(x + 11, y + 20, z + 20), leaves); + this.setBlockState(new BlockPos(x + 19, y + 20, z + 20), leaves); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 23), leaves); + this.setBlockState(new BlockPos(x + 15, y + 21, z + 0), leaves); + this.setBlockState(new BlockPos(x + 13, y + 21, z + 1), leaves); + this.setBlockState(new BlockPos(x + 15, y + 21, z + 1), leaves); + this.setBlockState(new BlockPos(x + 8, y + 21, z + 2), leaves); + this.setBlockState(new BlockPos(x + 15, y + 21, z + 2), leaves); + this.setBlockState(new BlockPos(x + 17, y + 21, z + 2), leaves); + this.setBlockState(new BlockPos(x + 18, y + 21, z + 2), leaves); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 3), leaves); + this.setBlockState(new BlockPos(x + 10, y + 21, z + 3), leaves); + this.setBlockState(new BlockPos(x + 13, y + 21, z + 3), leaves); + this.setBlockState(new BlockPos(x + 14, y + 21, z + 3), leaves); + this.setBlockState(new BlockPos(x + 15, y + 21, z + 3), log); + this.setBlockState(new BlockPos(x + 20, y + 21, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 4), leaves); + this.setBlockState(new BlockPos(x + 9, y + 21, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, y + 21, z + 5), leaves); + this.setBlockState(new BlockPos(x + 11, y + 21, z + 5), log); + this.setBlockState(new BlockPos(x + 9, y + 21, z + 6), leaves); + this.setBlockState(new BlockPos(x + 2, y + 21, z + 7), leaves); + this.setBlockState(new BlockPos(x + 3, y + 21, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, y + 21, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, y + 21, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, y + 21, z + 7), log); + this.setBlockState(new BlockPos(x + 11, y + 21, z + 7), leaves); + this.setBlockState(new BlockPos(x + 16, y + 21, z + 7), leaves); + this.setBlockState(new BlockPos(x + 18, y + 21, z + 7), log); + this.setBlockState(new BlockPos(x + 21, y + 21, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, y + 21, z + 8), leaves); + this.setBlockState(new BlockPos(x + 11, y + 21, z + 8), leaves); + this.setBlockState(new BlockPos(x + 17, y + 21, z + 8), leaves); + this.setBlockState(new BlockPos(x + 1, y + 21, z + 9), leaves); + this.setBlockState(new BlockPos(x + 4, y + 21, z + 9), log); + this.setBlockState(new BlockPos(x + 5, y + 21, z + 9), leaves); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 9), leaves); + this.setBlockState(new BlockPos(x + 20, y + 21, z + 9), leaves); + this.setBlockState(new BlockPos(x + 3, y + 21, z + 10), leaves); + this.setBlockState(new BlockPos(x + 5, y + 21, z + 10), leaves); + this.setBlockState(new BlockPos(x + 17, y + 21, z + 10), leaves); + this.setBlockState(new BlockPos(x + 3, y + 21, z + 11), leaves); + this.setBlockState(new BlockPos(x + 5, y + 21, z + 11), leaves); + this.setBlockState(new BlockPos(x + 13, y + 21, z + 11), log); + this.setBlockState(new BlockPos(x + 19, y + 21, z + 11), leaves); + this.setBlockState(new BlockPos(x + 5, y + 21, z + 12), leaves); + this.setBlockState(new BlockPos(x + 15, y + 21, z + 12), leaves); + this.setBlockState(new BlockPos(x + 21, y + 21, z + 12), leaves); + this.setBlockState(new BlockPos(x + 11, y + 21, z + 13), log); + this.setBlockState(new BlockPos(x + 3, y + 21, z + 14), leaves); + this.setBlockState(new BlockPos(x + 4, y + 21, z + 14), log); + this.setBlockState(new BlockPos(x + 15, y + 21, z + 14), log); + this.setBlockState(new BlockPos(x + 18, y + 21, z + 14), leaves); + this.setBlockState(new BlockPos(x + 19, y + 21, z + 14), leaves); + this.setBlockState(new BlockPos(x + 20, y + 21, z + 14), leaves); + this.setBlockState(new BlockPos(x + 21, y + 21, z + 14), leaves); + this.setBlockState(new BlockPos(x + 4, y + 21, z + 15), leaves); + this.setBlockState(new BlockPos(x + 2, y + 21, z + 16), leaves); + this.setBlockState(new BlockPos(x + 6, y + 21, z + 16), leaves); + this.setBlockState(new BlockPos(x + 8, y + 21, z + 16), leaves); + this.setBlockState(new BlockPos(x + 10, y + 21, z + 16), log); + this.setBlockState(new BlockPos(x + 15, y + 21, z + 16), leaves); + this.setBlockState(new BlockPos(x + 18, y + 21, z + 16), leaves); + this.setBlockState(new BlockPos(x + 3, y + 21, z + 17), leaves); + this.setBlockState(new BlockPos(x + 4, y + 21, z + 17), leaves); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 17), leaves); + this.setBlockState(new BlockPos(x + 14, y + 21, z + 17), leaves); + this.setBlockState(new BlockPos(x + 16, y + 21, z + 17), leaves); + this.setBlockState(new BlockPos(x + 19, y + 21, z + 17), leaves); + this.setBlockState(new BlockPos(x + 21, y + 21, z + 17), leaves); + this.setBlockState(new BlockPos(x + 15, y + 21, z + 18), leaves); + this.setBlockState(new BlockPos(x + 19, y + 21, z + 18), leaves); + this.setBlockState(new BlockPos(x + 21, y + 21, z + 18), leaves); + this.setBlockState(new BlockPos(x + 4, y + 21, z + 19), leaves); + this.setBlockState(new BlockPos(x + 18, y + 21, z + 19), leaves); + this.setBlockState(new BlockPos(x + 20, y + 21, z + 19), leaves); + this.setBlockState(new BlockPos(x + 9, y + 21, z + 20), leaves); + this.setBlockState(new BlockPos(x + 9, y + 21, z + 22), leaves); + this.setBlockState(new BlockPos(x + 10, y + 21, z + 22), leaves); + this.setBlockState(new BlockPos(x + 14, y + 22, z + 0), leaves); + this.setBlockState(new BlockPos(x + 15, y + 22, z + 0), leaves); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 2), leaves); + this.setBlockState(new BlockPos(x + 12, y + 22, z + 2), leaves); + this.setBlockState(new BlockPos(x + 14, y + 22, z + 2), leaves); + this.setBlockState(new BlockPos(x + 10, y + 22, z + 3), leaves); + this.setBlockState(new BlockPos(x + 14, y + 22, z + 3), leaves); + this.setBlockState(new BlockPos(x + 17, y + 22, z + 3), leaves); + this.setBlockState(new BlockPos(x + 18, y + 22, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 4), leaves); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 4), log); + this.setBlockState(new BlockPos(x + 12, y + 22, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 5), leaves); + this.setBlockState(new BlockPos(x + 8, y + 22, z + 5), leaves); + this.setBlockState(new BlockPos(x + 10, y + 22, z + 5), leaves); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 5), leaves); + this.setBlockState(new BlockPos(x + 16, y + 22, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 6), leaves); + this.setBlockState(new BlockPos(x + 21, y + 22, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, y + 22, z + 7), log); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 7), leaves); + this.setBlockState(new BlockPos(x + 16, y + 22, z + 7), leaves); + this.setBlockState(new BlockPos(x + 18, y + 22, z + 7), log); + this.setBlockState(new BlockPos(x + 19, y + 22, z + 7), leaves); + this.setBlockState(new BlockPos(x + 0, y + 22, z + 8), leaves); + this.setBlockState(new BlockPos(x + 1, y + 22, z + 8), leaves); + this.setBlockState(new BlockPos(x + 3, y + 22, z + 8), log); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 8), leaves); + this.setBlockState(new BlockPos(x + 15, y + 22, z + 8), leaves); + this.setBlockState(new BlockPos(x + 18, y + 22, z + 8), leaves); + this.setBlockState(new BlockPos(x + 2, y + 22, z + 9), leaves); + this.setBlockState(new BlockPos(x + 3, y + 22, z + 9), leaves); + this.setBlockState(new BlockPos(x + 4, y + 22, z + 9), leaves); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 9), leaves); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 9), leaves); + this.setBlockState(new BlockPos(x + 18, y + 22, z + 9), leaves); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 10), leaves); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 10), leaves); + this.setBlockState(new BlockPos(x + 18, y + 22, z + 10), leaves); + this.setBlockState(new BlockPos(x + 4, y + 22, z + 11), leaves); + this.setBlockState(new BlockPos(x + 13, y + 22, z + 11), log); + this.setBlockState(new BlockPos(x + 16, y + 22, z + 11), leaves); + this.setBlockState(new BlockPos(x + 4, y + 22, z + 12), leaves); + this.setBlockState(new BlockPos(x + 17, y + 22, z + 12), leaves); + this.setBlockState(new BlockPos(x + 20, y + 22, z + 12), leaves); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 13), log); + this.setBlockState(new BlockPos(x + 16, y + 22, z + 13), leaves); + this.setBlockState(new BlockPos(x + 17, y + 22, z + 13), leaves); + this.setBlockState(new BlockPos(x + 18, y + 22, z + 13), leaves); + this.setBlockState(new BlockPos(x + 19, y + 22, z + 13), leaves); + this.setBlockState(new BlockPos(x + 1, y + 22, z + 14), leaves); + this.setBlockState(new BlockPos(x + 4, y + 22, z + 14), log); + this.setBlockState(new BlockPos(x + 5, y + 22, z + 14), leaves); + this.setBlockState(new BlockPos(x + 15, y + 22, z + 14), log); + this.setBlockState(new BlockPos(x + 18, y + 22, z + 14), leaves); + this.setBlockState(new BlockPos(x + 1, y + 22, z + 15), leaves); + this.setBlockState(new BlockPos(x + 5, y + 22, z + 15), leaves); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 15), leaves); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 15), leaves); + this.setBlockState(new BlockPos(x + 8, y + 22, z + 15), leaves); + this.setBlockState(new BlockPos(x + 15, y + 22, z + 15), leaves); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 16), leaves); + this.setBlockState(new BlockPos(x + 10, y + 22, z + 16), log); + this.setBlockState(new BlockPos(x + 19, y + 22, z + 16), leaves); + this.setBlockState(new BlockPos(x + 20, y + 22, z + 16), leaves); + this.setBlockState(new BlockPos(x + 3, y + 22, z + 17), leaves); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 17), leaves); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 17), leaves); + this.setBlockState(new BlockPos(x + 12, y + 22, z + 17), leaves); + this.setBlockState(new BlockPos(x + 14, y + 22, z + 17), leaves); + this.setBlockState(new BlockPos(x + 15, y + 22, z + 17), leaves); + this.setBlockState(new BlockPos(x + 16, y + 22, z + 17), leaves); + this.setBlockState(new BlockPos(x + 18, y + 22, z + 17), leaves); + this.setBlockState(new BlockPos(x + 5, y + 22, z + 18), leaves); + this.setBlockState(new BlockPos(x + 8, y + 22, z + 18), leaves); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 18), leaves); + this.setBlockState(new BlockPos(x + 13, y + 22, z + 18), leaves); + this.setBlockState(new BlockPos(x + 16, y + 22, z + 18), leaves); + this.setBlockState(new BlockPos(x + 12, y + 22, z + 19), leaves); + this.setBlockState(new BlockPos(x + 5, y + 22, z + 20), leaves); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 20), leaves); + this.setBlockState(new BlockPos(x + 13, y + 22, z + 20), leaves); + this.setBlockState(new BlockPos(x + 15, y + 22, z + 20), leaves); + this.setBlockState(new BlockPos(x + 18, y + 22, z + 20), leaves); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 21), leaves); + this.setBlockState(new BlockPos(x + 12, y + 23, z + 1), leaves); + this.setBlockState(new BlockPos(x + 10, y + 23, z + 2), leaves); + this.setBlockState(new BlockPos(x + 13, y + 23, z + 2), leaves); + this.setBlockState(new BlockPos(x + 16, y + 23, z + 2), leaves); + this.setBlockState(new BlockPos(x + 8, y + 23, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 4), leaves); + this.setBlockState(new BlockPos(x + 9, y + 23, z + 4), leaves); + this.setBlockState(new BlockPos(x + 10, y + 23, z + 4), leaves); + this.setBlockState(new BlockPos(x + 11, y + 23, z + 4), log); + this.setBlockState(new BlockPos(x + 14, y + 23, z + 4), leaves); + this.setBlockState(new BlockPos(x + 15, y + 23, z + 4), leaves); + this.setBlockState(new BlockPos(x + 16, y + 23, z + 4), leaves); + this.setBlockState(new BlockPos(x + 17, y + 23, z + 4), leaves); + this.setBlockState(new BlockPos(x + 19, y + 23, z + 4), leaves); + this.setBlockState(new BlockPos(x + 20, y + 23, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, y + 23, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, y + 23, z + 5), leaves); + this.setBlockState(new BlockPos(x + 10, y + 23, z + 5), leaves); + this.setBlockState(new BlockPos(x + 19, y + 23, z + 5), leaves); + this.setBlockState(new BlockPos(x + 20, y + 23, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, y + 23, z + 6), leaves); + this.setBlockState(new BlockPos(x + 9, y + 23, z + 6), leaves); + this.setBlockState(new BlockPos(x + 11, y + 23, z + 6), leaves); + this.setBlockState(new BlockPos(x + 18, y + 23, z + 6), leaves); + this.setBlockState(new BlockPos(x + 3, y + 23, z + 7), leaves); + this.setBlockState(new BlockPos(x + 4, y + 23, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, y + 23, z + 7), leaves); + this.setBlockState(new BlockPos(x + 9, y + 23, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, y + 23, z + 7), log); + this.setBlockState(new BlockPos(x + 11, y + 23, z + 7), leaves); + this.setBlockState(new BlockPos(x + 12, y + 23, z + 7), leaves); + this.setBlockState(new BlockPos(x + 15, y + 23, z + 7), leaves); + this.setBlockState(new BlockPos(x + 18, y + 23, z + 7), leaves); + this.setBlockState(new BlockPos(x + 1, y + 23, z + 8), leaves); + this.setBlockState(new BlockPos(x + 2, y + 23, z + 8), leaves); + this.setBlockState(new BlockPos(x + 3, y + 23, z + 8), log); + this.setBlockState(new BlockPos(x + 4, y + 23, z + 8), leaves); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 8), leaves); + this.setBlockState(new BlockPos(x + 18, y + 23, z + 8), leaves); + this.setBlockState(new BlockPos(x + 20, y + 23, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, y + 23, z + 9), leaves); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 9), leaves); + this.setBlockState(new BlockPos(x + 8, y + 23, z + 9), leaves); + this.setBlockState(new BlockPos(x + 17, y + 23, z + 9), leaves); + this.setBlockState(new BlockPos(x + 19, y + 23, z + 9), leaves); + this.setBlockState(new BlockPos(x + 1, y + 23, z + 10), leaves); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 10), leaves); + this.setBlockState(new BlockPos(x + 13, y + 23, z + 10), log); + this.setBlockState(new BlockPos(x + 17, y + 23, z + 10), leaves); + this.setBlockState(new BlockPos(x + 18, y + 23, z + 10), leaves); + this.setBlockState(new BlockPos(x + 2, y + 23, z + 11), leaves); + this.setBlockState(new BlockPos(x + 15, y + 23, z + 11), leaves); + this.setBlockState(new BlockPos(x + 16, y + 23, z + 11), leaves); + this.setBlockState(new BlockPos(x + 17, y + 23, z + 11), leaves); + this.setBlockState(new BlockPos(x + 19, y + 23, z + 11), leaves); + this.setBlockState(new BlockPos(x + 21, y + 23, z + 11), leaves); + this.setBlockState(new BlockPos(x + 15, y + 23, z + 12), leaves); + this.setBlockState(new BlockPos(x + 18, y + 23, z + 12), leaves); + this.setBlockState(new BlockPos(x + 2, y + 23, z + 13), leaves); + this.setBlockState(new BlockPos(x + 4, y + 23, z + 13), leaves); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 13), leaves); + this.setBlockState(new BlockPos(x + 11, y + 23, z + 13), log); + this.setBlockState(new BlockPos(x + 16, y + 23, z + 13), leaves); + this.setBlockState(new BlockPos(x + 18, y + 23, z + 13), leaves); + this.setBlockState(new BlockPos(x + 2, y + 23, z + 14), leaves); + this.setBlockState(new BlockPos(x + 5, y + 23, z + 14), leaves); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 14), leaves); + this.setBlockState(new BlockPos(x + 15, y + 23, z + 14), log); + this.setBlockState(new BlockPos(x + 17, y + 23, z + 14), leaves); + this.setBlockState(new BlockPos(x + 18, y + 23, z + 14), leaves); + this.setBlockState(new BlockPos(x + 3, y + 23, z + 15), leaves); + this.setBlockState(new BlockPos(x + 4, y + 23, z + 15), leaves); + this.setBlockState(new BlockPos(x + 5, y + 23, z + 15), leaves); + this.setBlockState(new BlockPos(x + 13, y + 23, z + 15), leaves); + this.setBlockState(new BlockPos(x + 15, y + 23, z + 15), leaves); + this.setBlockState(new BlockPos(x + 16, y + 23, z + 15), leaves); + this.setBlockState(new BlockPos(x + 3, y + 23, z + 16), leaves); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 16), leaves); + this.setBlockState(new BlockPos(x + 9, y + 23, z + 16), leaves); + this.setBlockState(new BlockPos(x + 13, y + 23, z + 16), leaves); + this.setBlockState(new BlockPos(x + 15, y + 23, z + 16), leaves); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 17), leaves); + this.setBlockState(new BlockPos(x + 10, y + 23, z + 17), leaves); + this.setBlockState(new BlockPos(x + 11, y + 23, z + 17), log); + this.setBlockState(new BlockPos(x + 12, y + 23, z + 17), leaves); + this.setBlockState(new BlockPos(x + 18, y + 23, z + 17), leaves); + this.setBlockState(new BlockPos(x + 12, y + 23, z + 18), leaves); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 19), leaves); + this.setBlockState(new BlockPos(x + 8, y + 23, z + 19), leaves); + this.setBlockState(new BlockPos(x + 10, y + 23, z + 19), leaves); + this.setBlockState(new BlockPos(x + 13, y + 23, z + 19), leaves); + this.setBlockState(new BlockPos(x + 15, y + 23, z + 19), leaves); + this.setBlockState(new BlockPos(x + 9, y + 23, z + 21), leaves); + this.setBlockState(new BlockPos(x + 14, y + 23, z + 21), leaves); + this.setBlockState(new BlockPos(x + 13, y + 23, z + 22), leaves); + this.setBlockState(new BlockPos(x + 10, y + 24, z + 3), leaves); + this.setBlockState(new BlockPos(x + 15, y + 24, z + 3), leaves); + this.setBlockState(new BlockPos(x + 13, y + 24, z + 4), leaves); + this.setBlockState(new BlockPos(x + 9, y + 24, z + 5), leaves); + this.setBlockState(new BlockPos(x + 10, y + 24, z + 5), leaves); + this.setBlockState(new BlockPos(x + 11, y + 24, z + 5), leaves); + this.setBlockState(new BlockPos(x + 19, y + 24, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, y + 24, z + 6), leaves); + this.setBlockState(new BlockPos(x + 10, y + 24, z + 6), log); + this.setBlockState(new BlockPos(x + 13, y + 24, z + 6), leaves); + this.setBlockState(new BlockPos(x + 16, y + 24, z + 6), leaves); + this.setBlockState(new BlockPos(x + 20, y + 24, z + 6), leaves); + this.setBlockState(new BlockPos(x + 2, y + 24, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, y + 24, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, y + 24, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 7), leaves); + this.setBlockState(new BlockPos(x + 16, y + 24, z + 7), leaves); + this.setBlockState(new BlockPos(x + 18, y + 24, z + 7), leaves); + this.setBlockState(new BlockPos(x + 1, y + 24, z + 8), leaves); + this.setBlockState(new BlockPos(x + 3, y + 24, z + 8), leaves); + this.setBlockState(new BlockPos(x + 4, y + 24, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, y + 24, z + 8), leaves); + this.setBlockState(new BlockPos(x + 13, y + 24, z + 8), leaves); + this.setBlockState(new BlockPos(x + 18, y + 24, z + 8), leaves); + this.setBlockState(new BlockPos(x + 4, y + 24, z + 9), leaves); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 9), leaves); + this.setBlockState(new BlockPos(x + 18, y + 24, z + 9), leaves); + this.setBlockState(new BlockPos(x + 13, y + 24, z + 10), log); + this.setBlockState(new BlockPos(x + 18, y + 24, z + 10), leaves); + this.setBlockState(new BlockPos(x + 18, y + 24, z + 11), leaves); + this.setBlockState(new BlockPos(x + 5, y + 24, z + 12), leaves); + this.setBlockState(new BlockPos(x + 15, y + 24, z + 12), leaves); + this.setBlockState(new BlockPos(x + 16, y + 24, z + 12), leaves); + this.setBlockState(new BlockPos(x + 4, y + 24, z + 13), leaves); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 13), leaves); + this.setBlockState(new BlockPos(x + 15, y + 24, z + 13), leaves); + this.setBlockState(new BlockPos(x + 18, y + 24, z + 13), leaves); + this.setBlockState(new BlockPos(x + 19, y + 24, z + 13), leaves); + this.setBlockState(new BlockPos(x + 20, y + 24, z + 13), leaves); + this.setBlockState(new BlockPos(x + 4, y + 24, z + 14), leaves); + this.setBlockState(new BlockPos(x + 5, y + 24, z + 14), leaves); + this.setBlockState(new BlockPos(x + 10, y + 24, z + 14), log); + this.setBlockState(new BlockPos(x + 16, y + 24, z + 14), log); + this.setBlockState(new BlockPos(x + 18, y + 24, z + 14), leaves); + this.setBlockState(new BlockPos(x + 3, y + 24, z + 15), leaves); + this.setBlockState(new BlockPos(x + 4, y + 24, z + 15), leaves); + this.setBlockState(new BlockPos(x + 8, y + 24, z + 15), leaves); + this.setBlockState(new BlockPos(x + 13, y + 24, z + 15), leaves); + this.setBlockState(new BlockPos(x + 14, y + 24, z + 15), leaves); + this.setBlockState(new BlockPos(x + 15, y + 24, z + 15), leaves); + this.setBlockState(new BlockPos(x + 18, y + 24, z + 15), leaves); + this.setBlockState(new BlockPos(x + 19, y + 24, z + 15), leaves); + this.setBlockState(new BlockPos(x + 6, y + 24, z + 16), leaves); + this.setBlockState(new BlockPos(x + 12, y + 24, z + 16), leaves); + this.setBlockState(new BlockPos(x + 17, y + 24, z + 16), leaves); + this.setBlockState(new BlockPos(x + 18, y + 24, z + 16), leaves); + this.setBlockState(new BlockPos(x + 5, y + 24, z + 17), leaves); + this.setBlockState(new BlockPos(x + 8, y + 24, z + 17), leaves); + this.setBlockState(new BlockPos(x + 10, y + 24, z + 17), leaves); + this.setBlockState(new BlockPos(x + 11, y + 24, z + 17), log); + this.setBlockState(new BlockPos(x + 12, y + 24, z + 17), leaves); + this.setBlockState(new BlockPos(x + 17, y + 24, z + 17), leaves); + this.setBlockState(new BlockPos(x + 4, y + 24, z + 18), leaves); + this.setBlockState(new BlockPos(x + 13, y + 24, z + 18), leaves); + this.setBlockState(new BlockPos(x + 14, y + 24, z + 18), leaves); + this.setBlockState(new BlockPos(x + 15, y + 24, z + 18), leaves); + this.setBlockState(new BlockPos(x + 18, y + 24, z + 18), leaves); + this.setBlockState(new BlockPos(x + 11, y + 24, z + 19), leaves); + this.setBlockState(new BlockPos(x + 13, y + 24, z + 19), leaves); + this.setBlockState(new BlockPos(x + 14, y + 24, z + 19), leaves); + this.setBlockState(new BlockPos(x + 15, y + 24, z + 21), leaves); + this.setBlockState(new BlockPos(x + 12, y + 25, z + 3), leaves); + this.setBlockState(new BlockPos(x + 11, y + 25, z + 4), leaves); + this.setBlockState(new BlockPos(x + 13, y + 25, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, y + 25, z + 5), leaves); + this.setBlockState(new BlockPos(x + 10, y + 25, z + 6), log); + this.setBlockState(new BlockPos(x + 5, y + 25, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, y + 25, z + 7), leaves); + this.setBlockState(new BlockPos(x + 11, y + 25, z + 7), leaves); + this.setBlockState(new BlockPos(x + 18, y + 25, z + 7), leaves); + this.setBlockState(new BlockPos(x + 2, y + 25, z + 8), leaves); + this.setBlockState(new BlockPos(x + 3, y + 25, z + 8), leaves); + this.setBlockState(new BlockPos(x + 4, y + 25, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, y + 25, z + 8), leaves); + this.setBlockState(new BlockPos(x + 6, y + 25, z + 8), leaves); + this.setBlockState(new BlockPos(x + 11, y + 25, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, y + 25, z + 9), leaves); + this.setBlockState(new BlockPos(x + 6, y + 25, z + 9), leaves); + this.setBlockState(new BlockPos(x + 13, y + 25, z + 9), log); + this.setBlockState(new BlockPos(x + 17, y + 25, z + 9), leaves); + this.setBlockState(new BlockPos(x + 18, y + 25, z + 9), leaves); + this.setBlockState(new BlockPos(x + 6, y + 25, z + 10), leaves); + this.setBlockState(new BlockPos(x + 15, y + 25, z + 10), leaves); + this.setBlockState(new BlockPos(x + 16, y + 25, z + 10), leaves); + this.setBlockState(new BlockPos(x + 17, y + 25, z + 11), leaves); + this.setBlockState(new BlockPos(x + 7, y + 25, z + 13), leaves); + this.setBlockState(new BlockPos(x + 15, y + 25, z + 13), leaves); + this.setBlockState(new BlockPos(x + 17, y + 25, z + 13), leaves); + this.setBlockState(new BlockPos(x + 18, y + 25, z + 13), leaves); + this.setBlockState(new BlockPos(x + 4, y + 25, z + 14), leaves); + this.setBlockState(new BlockPos(x + 8, y + 25, z + 14), leaves); + this.setBlockState(new BlockPos(x + 10, y + 25, z + 14), log); + this.setBlockState(new BlockPos(x + 16, y + 25, z + 14), log); + this.setBlockState(new BlockPos(x + 4, y + 25, z + 15), leaves); + this.setBlockState(new BlockPos(x + 8, y + 25, z + 15), leaves); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 15), leaves); + this.setBlockState(new BlockPos(x + 12, y + 25, z + 15), leaves); + this.setBlockState(new BlockPos(x + 15, y + 25, z + 15), leaves); + this.setBlockState(new BlockPos(x + 18, y + 25, z + 15), leaves); + this.setBlockState(new BlockPos(x + 7, y + 25, z + 16), leaves); + this.setBlockState(new BlockPos(x + 8, y + 25, z + 16), leaves); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 16), leaves); + this.setBlockState(new BlockPos(x + 12, y + 25, z + 16), leaves); + this.setBlockState(new BlockPos(x + 15, y + 25, z + 16), leaves); + this.setBlockState(new BlockPos(x + 17, y + 25, z + 16), leaves); + this.setBlockState(new BlockPos(x + 7, y + 25, z + 17), leaves); + this.setBlockState(new BlockPos(x + 11, y + 25, z + 17), log); + this.setBlockState(new BlockPos(x + 12, y + 25, z + 17), leaves); + this.setBlockState(new BlockPos(x + 14, y + 25, z + 17), leaves); + this.setBlockState(new BlockPos(x + 4, y + 25, z + 18), leaves); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 18), leaves); + this.setBlockState(new BlockPos(x + 12, y + 25, z + 18), leaves); + this.setBlockState(new BlockPos(x + 13, y + 25, z + 18), leaves); + this.setBlockState(new BlockPos(x + 16, y + 25, z + 18), leaves); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 19), leaves); + this.setBlockState(new BlockPos(x + 11, y + 25, z + 19), leaves); + this.setBlockState(new BlockPos(x + 13, y + 25, z + 19), leaves); + this.setBlockState(new BlockPos(x + 16, y + 25, z + 19), leaves); + this.setBlockState(new BlockPos(x + 11, y + 25, z + 20), leaves); + this.setBlockState(new BlockPos(x + 6, y + 26, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, y + 26, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, y + 26, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, y + 26, z + 5), leaves); + this.setBlockState(new BlockPos(x + 10, y + 26, z + 5), leaves); + this.setBlockState(new BlockPos(x + 8, y + 26, z + 6), leaves); + this.setBlockState(new BlockPos(x + 10, y + 26, z + 6), log); + this.setBlockState(new BlockPos(x + 3, y + 26, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, y + 26, z + 7), leaves); + this.setBlockState(new BlockPos(x + 9, y + 26, z + 7), leaves); + this.setBlockState(new BlockPos(x + 3, y + 26, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, y + 26, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, y + 26, z + 8), leaves); + this.setBlockState(new BlockPos(x + 14, y + 26, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, y + 26, z + 9), leaves); + this.setBlockState(new BlockPos(x + 10, y + 26, z + 9), leaves); + this.setBlockState(new BlockPos(x + 13, y + 26, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 26, z + 9), leaves); + this.setBlockState(new BlockPos(x + 18, y + 26, z + 9), leaves); + this.setBlockState(new BlockPos(x + 16, y + 26, z + 10), leaves); + this.setBlockState(new BlockPos(x + 4, y + 26, z + 11), leaves); + this.setBlockState(new BlockPos(x + 13, y + 26, z + 11), leaves); + this.setBlockState(new BlockPos(x + 16, y + 26, z + 11), leaves); + this.setBlockState(new BlockPos(x + 17, y + 26, z + 11), leaves); + this.setBlockState(new BlockPos(x + 18, y + 26, z + 11), leaves); + this.setBlockState(new BlockPos(x + 19, y + 26, z + 11), leaves); + this.setBlockState(new BlockPos(x + 19, y + 26, z + 13), leaves); + this.setBlockState(new BlockPos(x + 10, y + 26, z + 14), log); + this.setBlockState(new BlockPos(x + 13, y + 26, z + 14), leaves); + this.setBlockState(new BlockPos(x + 14, y + 26, z + 14), leaves); + this.setBlockState(new BlockPos(x + 18, y + 26, z + 14), leaves); + this.setBlockState(new BlockPos(x + 8, y + 26, z + 15), leaves); + this.setBlockState(new BlockPos(x + 11, y + 26, z + 15), leaves); + this.setBlockState(new BlockPos(x + 13, y + 26, z + 15), leaves); + this.setBlockState(new BlockPos(x + 17, y + 26, z + 15), log); + this.setBlockState(new BlockPos(x + 19, y + 26, z + 15), leaves); + this.setBlockState(new BlockPos(x + 20, y + 26, z + 15), leaves); + this.setBlockState(new BlockPos(x + 8, y + 26, z + 16), leaves); + this.setBlockState(new BlockPos(x + 11, y + 26, z + 16), leaves); + this.setBlockState(new BlockPos(x + 12, y + 26, z + 16), leaves); + this.setBlockState(new BlockPos(x + 13, y + 26, z + 16), leaves); + this.setBlockState(new BlockPos(x + 14, y + 26, z + 16), leaves); + this.setBlockState(new BlockPos(x + 16, y + 26, z + 16), leaves); + this.setBlockState(new BlockPos(x + 19, y + 26, z + 16), leaves); + this.setBlockState(new BlockPos(x + 4, y + 26, z + 17), leaves); + this.setBlockState(new BlockPos(x + 5, y + 26, z + 17), leaves); + this.setBlockState(new BlockPos(x + 8, y + 26, z + 17), leaves); + this.setBlockState(new BlockPos(x + 16, y + 26, z + 17), leaves); + this.setBlockState(new BlockPos(x + 9, y + 26, z + 18), leaves); + this.setBlockState(new BlockPos(x + 17, y + 26, z + 18), leaves); + this.setBlockState(new BlockPos(x + 15, y + 26, z + 19), leaves); + this.setBlockState(new BlockPos(x + 9, y + 27, z + 4), leaves); + this.setBlockState(new BlockPos(x + 11, y + 27, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, y + 27, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, y + 27, z + 6), leaves); + this.setBlockState(new BlockPos(x + 9, y + 27, z + 6), log); + this.setBlockState(new BlockPos(x + 13, y + 27, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, y + 27, z + 7), leaves); + this.setBlockState(new BlockPos(x + 9, y + 27, z + 7), leaves); + this.setBlockState(new BlockPos(x + 13, y + 27, z + 7), leaves); + this.setBlockState(new BlockPos(x + 15, y + 27, z + 7), leaves); + this.setBlockState(new BlockPos(x + 4, y + 27, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, y + 27, z + 8), leaves); + this.setBlockState(new BlockPos(x + 11, y + 27, z + 8), leaves); + this.setBlockState(new BlockPos(x + 12, y + 27, z + 8), leaves); + this.setBlockState(new BlockPos(x + 13, y + 27, z + 8), leaves); + this.setBlockState(new BlockPos(x + 14, y + 27, z + 8), leaves); + this.setBlockState(new BlockPos(x + 4, y + 27, z + 9), leaves); + this.setBlockState(new BlockPos(x + 6, y + 27, z + 9), leaves); + this.setBlockState(new BlockPos(x + 8, y + 27, z + 9), leaves); + this.setBlockState(new BlockPos(x + 11, y + 27, z + 9), leaves); + this.setBlockState(new BlockPos(x + 12, y + 27, z + 9), leaves); + this.setBlockState(new BlockPos(x + 13, y + 27, z + 9), log); + this.setBlockState(new BlockPos(x + 14, y + 27, z + 9), leaves); + this.setBlockState(new BlockPos(x + 5, y + 27, z + 10), leaves); + this.setBlockState(new BlockPos(x + 8, y + 27, z + 10), leaves); + this.setBlockState(new BlockPos(x + 13, y + 27, z + 10), leaves); + this.setBlockState(new BlockPos(x + 19, y + 27, z + 10), leaves); + this.setBlockState(new BlockPos(x + 6, y + 27, z + 12), leaves); + this.setBlockState(new BlockPos(x + 7, y + 27, z + 12), leaves); + this.setBlockState(new BlockPos(x + 13, y + 27, z + 12), leaves); + this.setBlockState(new BlockPos(x + 12, y + 27, z + 13), leaves); + this.setBlockState(new BlockPos(x + 15, y + 27, z + 13), leaves); + this.setBlockState(new BlockPos(x + 9, y + 27, z + 14), log); + this.setBlockState(new BlockPos(x + 15, y + 27, z + 14), leaves); + this.setBlockState(new BlockPos(x + 17, y + 27, z + 14), leaves); + this.setBlockState(new BlockPos(x + 20, y + 27, z + 14), leaves); + this.setBlockState(new BlockPos(x + 11, y + 27, z + 15), log); + this.setBlockState(new BlockPos(x + 13, y + 27, z + 15), leaves); + this.setBlockState(new BlockPos(x + 15, y + 27, z + 15), leaves); + this.setBlockState(new BlockPos(x + 16, y + 27, z + 15), leaves); + this.setBlockState(new BlockPos(x + 13, y + 27, z + 16), leaves); + this.setBlockState(new BlockPos(x + 15, y + 27, z + 16), leaves); + this.setBlockState(new BlockPos(x + 16, y + 27, z + 17), leaves); + this.setBlockState(new BlockPos(x + 9, y + 27, z + 18), leaves); + this.setBlockState(new BlockPos(x + 11, y + 27, z + 18), leaves); + this.setBlockState(new BlockPos(x + 14, y + 27, z + 18), leaves); + this.setBlockState(new BlockPos(x + 17, y + 27, z + 18), leaves); + this.setBlockState(new BlockPos(x + 18, y + 27, z + 18), leaves); + this.setBlockState(new BlockPos(x + 6, y + 28, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, y + 28, z + 3), leaves); + this.setBlockState(new BlockPos(x + 11, y + 28, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, y + 28, z + 5), leaves); + this.setBlockState(new BlockPos(x + 4, y + 28, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, y + 28, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, y + 28, z + 6), leaves); + this.setBlockState(new BlockPos(x + 9, y + 28, z + 6), log); + this.setBlockState(new BlockPos(x + 4, y + 28, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, y + 28, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, y + 28, z + 8), leaves); + this.setBlockState(new BlockPos(x + 8, y + 28, z + 8), leaves); + this.setBlockState(new BlockPos(x + 14, y + 28, z + 8), log); + this.setBlockState(new BlockPos(x + 18, y + 28, z + 8), leaves); + this.setBlockState(new BlockPos(x + 4, y + 28, z + 9), leaves); + this.setBlockState(new BlockPos(x + 7, y + 28, z + 9), leaves); + this.setBlockState(new BlockPos(x + 12, y + 28, z + 9), leaves); + this.setBlockState(new BlockPos(x + 5, y + 28, z + 10), leaves); + this.setBlockState(new BlockPos(x + 10, y + 28, z + 10), leaves); + this.setBlockState(new BlockPos(x + 11, y + 28, z + 10), leaves); + this.setBlockState(new BlockPos(x + 15, y + 28, z + 10), leaves); + this.setBlockState(new BlockPos(x + 3, y + 28, z + 11), leaves); + this.setBlockState(new BlockPos(x + 5, y + 28, z + 11), leaves); + this.setBlockState(new BlockPos(x + 15, y + 28, z + 11), leaves); + this.setBlockState(new BlockPos(x + 16, y + 28, z + 11), leaves); + this.setBlockState(new BlockPos(x + 17, y + 28, z + 11), leaves); + this.setBlockState(new BlockPos(x + 18, y + 28, z + 11), leaves); + this.setBlockState(new BlockPos(x + 7, y + 28, z + 12), leaves); + this.setBlockState(new BlockPos(x + 13, y + 28, z + 12), leaves); + this.setBlockState(new BlockPos(x + 15, y + 28, z + 12), leaves); + this.setBlockState(new BlockPos(x + 4, y + 28, z + 14), leaves); + this.setBlockState(new BlockPos(x + 9, y + 28, z + 14), log); + this.setBlockState(new BlockPos(x + 12, y + 28, z + 14), leaves); + this.setBlockState(new BlockPos(x + 17, y + 28, z + 14), leaves); + this.setBlockState(new BlockPos(x + 5, y + 28, z + 15), leaves); + this.setBlockState(new BlockPos(x + 10, y + 28, z + 15), leaves); + this.setBlockState(new BlockPos(x + 11, y + 28, z + 15), log); + this.setBlockState(new BlockPos(x + 12, y + 28, z + 15), leaves); + this.setBlockState(new BlockPos(x + 15, y + 28, z + 15), leaves); + this.setBlockState(new BlockPos(x + 5, y + 28, z + 16), leaves); + this.setBlockState(new BlockPos(x + 13, y + 28, z + 16), leaves); + this.setBlockState(new BlockPos(x + 17, y + 28, z + 16), leaves); + this.setBlockState(new BlockPos(x + 16, y + 28, z + 17), leaves); + this.setBlockState(new BlockPos(x + 11, y + 28, z + 18), leaves); + this.setBlockState(new BlockPos(x + 8, y + 29, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, y + 29, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, y + 29, z + 6), leaves); + this.setBlockState(new BlockPos(x + 9, y + 29, z + 6), log); + this.setBlockState(new BlockPos(x + 15, y + 29, z + 6), leaves); + this.setBlockState(new BlockPos(x + 16, y + 29, z + 6), leaves); + this.setBlockState(new BlockPos(x + 17, y + 29, z + 6), leaves); + this.setBlockState(new BlockPos(x + 4, y + 29, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, y + 29, z + 7), leaves); + this.setBlockState(new BlockPos(x + 9, y + 29, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, y + 29, z + 7), leaves); + this.setBlockState(new BlockPos(x + 11, y + 29, z + 7), leaves); + this.setBlockState(new BlockPos(x + 16, y + 29, z + 7), leaves); + this.setBlockState(new BlockPos(x + 17, y + 29, z + 7), leaves); + this.setBlockState(new BlockPos(x + 18, y + 29, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, y + 29, z + 8), leaves); + this.setBlockState(new BlockPos(x + 10, y + 29, z + 8), leaves); + this.setBlockState(new BlockPos(x + 13, y + 29, z + 8), leaves); + this.setBlockState(new BlockPos(x + 14, y + 29, z + 8), log); + this.setBlockState(new BlockPos(x + 19, y + 29, z + 8), leaves); + this.setBlockState(new BlockPos(x + 3, y + 29, z + 9), leaves); + this.setBlockState(new BlockPos(x + 16, y + 29, z + 9), leaves); + this.setBlockState(new BlockPos(x + 19, y + 29, z + 9), leaves); + this.setBlockState(new BlockPos(x + 14, y + 29, z + 10), leaves); + this.setBlockState(new BlockPos(x + 15, y + 29, z + 11), leaves); + this.setBlockState(new BlockPos(x + 18, y + 29, z + 11), leaves); + this.setBlockState(new BlockPos(x + 9, y + 29, z + 12), leaves); + this.setBlockState(new BlockPos(x + 14, y + 29, z + 12), leaves); + this.setBlockState(new BlockPos(x + 16, y + 29, z + 12), leaves); + this.setBlockState(new BlockPos(x + 17, y + 29, z + 12), leaves); + this.setBlockState(new BlockPos(x + 4, y + 29, z + 13), leaves); + this.setBlockState(new BlockPos(x + 6, y + 29, z + 13), leaves); + this.setBlockState(new BlockPos(x + 9, y + 29, z + 13), log); + this.setBlockState(new BlockPos(x + 18, y + 29, z + 14), leaves); + this.setBlockState(new BlockPos(x + 6, y + 29, z + 15), leaves); + this.setBlockState(new BlockPos(x + 9, y + 29, z + 15), leaves); + this.setBlockState(new BlockPos(x + 11, y + 29, z + 15), leaves); + this.setBlockState(new BlockPos(x + 12, y + 29, z + 15), log); + this.setBlockState(new BlockPos(x + 14, y + 29, z + 15), leaves); + this.setBlockState(new BlockPos(x + 17, y + 29, z + 15), leaves); + this.setBlockState(new BlockPos(x + 14, y + 29, z + 16), leaves); + this.setBlockState(new BlockPos(x + 11, y + 29, z + 18), leaves); + this.setBlockState(new BlockPos(x + 11, y + 30, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, y + 30, z + 6), leaves); + this.setBlockState(new BlockPos(x + 10, y + 30, z + 6), leaves); + this.setBlockState(new BlockPos(x + 13, y + 30, z + 6), leaves); + this.setBlockState(new BlockPos(x + 16, y + 30, z + 6), leaves); + this.setBlockState(new BlockPos(x + 8, y + 30, z + 7), leaves); + this.setBlockState(new BlockPos(x + 12, y + 30, z + 7), leaves); + this.setBlockState(new BlockPos(x + 12, y + 30, z + 8), leaves); + this.setBlockState(new BlockPos(x + 14, y + 30, z + 8), log); + this.setBlockState(new BlockPos(x + 15, y + 30, z + 8), leaves); + this.setBlockState(new BlockPos(x + 16, y + 30, z + 8), leaves); + this.setBlockState(new BlockPos(x + 8, y + 30, z + 9), leaves); + this.setBlockState(new BlockPos(x + 9, y + 30, z + 9), leaves); + this.setBlockState(new BlockPos(x + 14, y + 30, z + 9), leaves); + this.setBlockState(new BlockPos(x + 7, y + 30, z + 10), leaves); + this.setBlockState(new BlockPos(x + 14, y + 30, z + 10), leaves); + this.setBlockState(new BlockPos(x + 15, y + 30, z + 10), leaves); + this.setBlockState(new BlockPos(x + 4, y + 30, z + 11), leaves); + this.setBlockState(new BlockPos(x + 10, y + 30, z + 12), leaves); + this.setBlockState(new BlockPos(x + 5, y + 30, z + 13), leaves); + this.setBlockState(new BlockPos(x + 6, y + 30, z + 13), leaves); + this.setBlockState(new BlockPos(x + 9, y + 30, z + 13), log); + this.setBlockState(new BlockPos(x + 17, y + 30, z + 13), leaves); + this.setBlockState(new BlockPos(x + 8, y + 30, z + 14), leaves); + this.setBlockState(new BlockPos(x + 9, y + 30, z + 14), leaves); + this.setBlockState(new BlockPos(x + 10, y + 30, z + 14), leaves); + this.setBlockState(new BlockPos(x + 11, y + 30, z + 14), leaves); + this.setBlockState(new BlockPos(x + 13, y + 30, z + 14), leaves); + this.setBlockState(new BlockPos(x + 12, y + 30, z + 15), leaves); + this.setBlockState(new BlockPos(x + 14, y + 30, z + 15), leaves); + this.setBlockState(new BlockPos(x + 12, y + 30, z + 16), leaves); + this.setBlockState(new BlockPos(x + 11, y + 30, z + 18), leaves); + this.setBlockState(new BlockPos(x + 9, y + 31, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, y + 31, z + 5), leaves); + this.setBlockState(new BlockPos(x + 13, y + 31, z + 5), leaves); + this.setBlockState(new BlockPos(x + 15, y + 31, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, y + 31, z + 6), leaves); + this.setBlockState(new BlockPos(x + 14, y + 31, z + 6), leaves); + this.setBlockState(new BlockPos(x + 16, y + 31, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, y + 31, z + 7), leaves); + this.setBlockState(new BlockPos(x + 10, y + 31, z + 7), leaves); + this.setBlockState(new BlockPos(x + 12, y + 31, z + 7), leaves); + this.setBlockState(new BlockPos(x + 13, y + 31, z + 7), leaves); + this.setBlockState(new BlockPos(x + 11, y + 31, z + 8), leaves); + this.setBlockState(new BlockPos(x + 14, y + 31, z + 8), log); + this.setBlockState(new BlockPos(x + 4, y + 31, z + 10), leaves); + this.setBlockState(new BlockPos(x + 16, y + 31, z + 10), leaves); + this.setBlockState(new BlockPos(x + 12, y + 31, z + 11), leaves); + this.setBlockState(new BlockPos(x + 16, y + 31, z + 11), leaves); + this.setBlockState(new BlockPos(x + 11, y + 31, z + 12), leaves); + this.setBlockState(new BlockPos(x + 13, y + 31, z + 12), leaves); + this.setBlockState(new BlockPos(x + 14, y + 31, z + 12), leaves); + this.setBlockState(new BlockPos(x + 16, y + 31, z + 12), leaves); + this.setBlockState(new BlockPos(x + 18, y + 31, z + 12), leaves); + this.setBlockState(new BlockPos(x + 8, y + 31, z + 13), log); + this.setBlockState(new BlockPos(x + 13, y + 31, z + 13), leaves); + this.setBlockState(new BlockPos(x + 7, y + 31, z + 14), leaves); + this.setBlockState(new BlockPos(x + 15, y + 31, z + 14), leaves); + this.setBlockState(new BlockPos(x + 8, y + 31, z + 15), leaves); + this.setBlockState(new BlockPos(x + 10, y + 31, z + 15), leaves); + this.setBlockState(new BlockPos(x + 12, y + 31, z + 15), leaves); + this.setBlockState(new BlockPos(x + 9, y + 31, z + 16), leaves); + this.setBlockState(new BlockPos(x + 12, y + 31, z + 16), leaves); + this.setBlockState(new BlockPos(x + 11, y + 31, z + 17), leaves); + this.setBlockState(new BlockPos(x + 12, y + 31, z + 17), leaves); + this.setBlockState(new BlockPos(x + 8, y + 32, z + 6), leaves); + this.setBlockState(new BlockPos(x + 12, y + 32, z + 7), leaves); + this.setBlockState(new BlockPos(x + 14, y + 32, z + 7), leaves); + this.setBlockState(new BlockPos(x + 15, y + 32, z + 7), leaves); + this.setBlockState(new BlockPos(x + 16, y + 32, z + 7), leaves); + this.setBlockState(new BlockPos(x + 13, y + 32, z + 8), leaves); + this.setBlockState(new BlockPos(x + 14, y + 32, z + 8), log); + this.setBlockState(new BlockPos(x + 11, y + 32, z + 9), leaves); + this.setBlockState(new BlockPos(x + 14, y + 32, z + 11), leaves); + this.setBlockState(new BlockPos(x + 15, y + 32, z + 11), leaves); + this.setBlockState(new BlockPos(x + 6, y + 32, z + 12), leaves); + this.setBlockState(new BlockPos(x + 13, y + 32, z + 12), leaves); + this.setBlockState(new BlockPos(x + 6, y + 32, z + 13), leaves); + this.setBlockState(new BlockPos(x + 8, y + 32, z + 13), leaves); + this.setBlockState(new BlockPos(x + 9, y + 32, z + 14), leaves); + this.setBlockState(new BlockPos(x + 11, y + 32, z + 15), leaves); + this.setBlockState(new BlockPos(x + 12, y + 32, z + 15), leaves); + this.setBlockState(new BlockPos(x + 11, y + 32, z + 16), leaves); + this.setBlockState(new BlockPos(x + 12, y + 33, z + 6), leaves); + this.setBlockState(new BlockPos(x + 13, y + 33, z + 8), leaves); + this.setBlockState(new BlockPos(x + 15, y + 33, z + 9), leaves); + this.setBlockState(new BlockPos(x + 17, y + 33, z + 9), leaves); + this.setBlockState(new BlockPos(x + 13, y + 33, z + 10), leaves); + this.setBlockState(new BlockPos(x + 6, y + 33, z + 11), leaves); + this.setBlockState(new BlockPos(x + 8, y + 33, z + 11), leaves); + this.setBlockState(new BlockPos(x + 14, y + 33, z + 11), leaves); + this.setBlockState(new BlockPos(x + 15, y + 33, z + 11), leaves); + this.setBlockState(new BlockPos(x + 6, y + 33, z + 12), leaves); + this.setBlockState(new BlockPos(x + 16, y + 33, z + 12), leaves); + this.setBlockState(new BlockPos(x + 6, y + 33, z + 13), leaves); + this.setBlockState(new BlockPos(x + 7, y + 33, z + 13), leaves); + this.setBlockState(new BlockPos(x + 13, y + 33, z + 13), leaves); + this.setBlockState(new BlockPos(x + 16, y + 33, z + 13), leaves); + this.setBlockState(new BlockPos(x + 8, y + 33, z + 15), leaves); + this.setBlockState(new BlockPos(x + 14, y + 34, z + 8), leaves); + this.setBlockState(new BlockPos(x + 15, y + 34, z + 8), leaves); + this.setBlockState(new BlockPos(x + 12, y + 34, z + 9), leaves); + this.setBlockState(new BlockPos(x + 13, y + 34, z + 10), leaves); + this.setBlockState(new BlockPos(x + 15, y + 34, z + 10), leaves); + this.setBlockState(new BlockPos(x + 8, y + 34, z + 12), leaves); + this.setBlockState(new BlockPos(x + 14, y + 34, z + 12), leaves); + this.setBlockState(new BlockPos(x + 16, y + 34, z + 12), leaves); + this.setBlockState(new BlockPos(x + 8, y + 34, z + 13), leaves); + this.setBlockState(new BlockPos(x + 7, y + 34, z + 14), leaves); + this.setBlockState(new BlockPos(x + 9, y + 34, z + 14), leaves); + this.setBlockState(new BlockPos(x + 13, y + 35, z + 9), leaves); + } + + protected void setBlockState(BlockPos pos, IBlockState state) { + + this.setBlockAndNotifyAdequately(this.world, pos, state); + } + + private void setBlockMetadataWithNotify(int x, int y, int z, int meta1, int meta2) { + + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeLiquidambarStyraciflua.java b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeLiquidambarStyraciflua.java new file mode 100644 index 00000000..a1fd5f3c --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeLiquidambarStyraciflua.java @@ -0,0 +1,616 @@ +package appalachia.rtg.world.gen.feature.tree.rtg; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockLog; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * Liquidambar Styraciflua (American Sweetgum) + *

+ * This tree was designed by Lentebriesje and released as part of the 'Custom Tree Repository' project + * on Planet Minecraft (http://www.planetminecraft.com/project/native-trees-of-europe-template-repository-1779952/). + * It was converted into Java from its original schematic using the 'Schematic To Java Converter [For Modders]' program + * by ThisIsMika (http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/2193206-schematic-to-java-converter-for-modders). + * It has been modified slightly by WhichOnesPink to allow for random variation when generating in the world. + */ +public class TreeLiquidambarStyraciflua extends AppalachiaTree { + + World world; + Random rand; + + public TreeLiquidambarStyraciflua() { + + super(); + + this.trunkSize = 3; + this.validGroundBlocks = new ArrayList(Arrays.asList(Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState())); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + if (rand.nextInt(3) != 0) { + return false; + } + + this.world = world; + this.rand = rand; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + ArrayList groundPos = new ArrayList() { + + }; + groundPos.add(new BlockPos(x + 5, y, z + 4)); + + for (int i = 0; i < groundPos.size(); i++) { + if (!isValidGroundBlock(world, rand, groundPos.get(i), 1)) { + return false; + } + } + + IBlockState leaves = this.leavesBlock.withProperty(BlockLeaves.CHECK_DECAY, false); + //IBlockState leaves = this.leavesBlock.withProperty(BlockLeaves.DECAYABLE, false); + int currentY = y; + + this.spawn(world, x, currentY, z, this.logBlock, leaves); + + return true; + } + + protected void spawn(World world, int x, int y, int z, IBlockState log, IBlockState leaves) { + + int currentY = y; + + for (int t = 0; t < this.trunkSize; t++) { + + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + currentY++; + } + + this.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 6, 4, 4); + currentY++; + + this.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 8, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 7, 4, 4); + this.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 2, currentY, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 6, 4, 4); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 8, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 8, 12, 12); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 0), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 2, 4, 4); + this.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 9), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 4, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 10, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 8, 4, 4); + this.setBlockState(new BlockPos(x + 5, currentY, z + 8), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 9), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 0), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 0), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 0, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 0, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 1, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 2, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 0), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 2), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 7, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 0, currentY, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 0, currentY, z + 4, 4, 4); + this.setBlockState(new BlockPos(x + 1, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 1, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 2, currentY, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 5, currentY, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 8), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 9), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 9), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 9, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 10, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 3, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 1), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 6), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 3, currentY, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 8), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 1, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 8, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 9, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 7, currentY, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 4, currentY, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 6), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 3, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), log.withProperty(BlockLog.LOG_AXIS, BlockLog.EnumAxis.NONE)); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 3, 8, 8); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 2, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 6), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, currentY, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 8, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 2, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 6), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 7), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 4, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 7, currentY, z + 4), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 6, currentY, z + 2), leaves); + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 6), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 6, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 7, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 3, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 4, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 3), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), log); + this.setBlockState(new BlockPos(x + 6, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 4, currentY, z + 5), leaves); + currentY++; + + this.setBlockState(new BlockPos(x + 4, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 4), leaves); + this.setBlockState(new BlockPos(x + 5, currentY, z + 5), leaves); + currentY++; + } + + protected void setBlockState(BlockPos pos, IBlockState state) { + + this.setBlockAndNotifyAdequately(this.world, pos, state); + } + + private void setBlockMetadataWithNotify(int x, int y, int z, int meta1, int meta2) { + + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeQuercusRobur.java b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeQuercusRobur.java new file mode 100644 index 00000000..afd8cba0 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeQuercusRobur.java @@ -0,0 +1,330 @@ +package appalachia.rtg.world.gen.feature.tree.rtg; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.BlockLog; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.world.World; + +import appalachia.api.AppalachiaBlocks; +import com.google.common.collect.Lists; + +public class TreeQuercusRobur extends AppalachiaTree { + + private Random rand; + private World world; + private BlockPos basePos = BlockPos.ORIGIN; + int heightLimit; + int height; + double heightAttenuation = 0.618D; + double branchSlope = 0.381D; + double scaleWidth = 1.0D; + double leafDensity = 1.0D; + TrunkType trunkType; + int heightLimitLimit = 12; + int leafDistanceLimit = 4; + List foliageCoords; + + public TreeQuercusRobur() { + + this(false); + } + + public TreeQuercusRobur(boolean notify) { + + super(notify); + + this.trunkType = TrunkType.THIN; + this.saplingBlock = AppalachiaBlocks.sapling_quercus_robur.getDefaultState(); + } + + void generateLeafNodeList() { + + this.height = (int)((double)this.heightLimit * this.heightAttenuation); + + if (this.height >= this.heightLimit) { + this.height = this.heightLimit - 1; + } + + int i = (int)(1.382D + Math.pow(this.leafDensity * (double)this.heightLimit / 13.0D, 2.0D)); + + if (i < 1) { + i = 1; + } + + int j = this.basePos.getY() + this.height; + int k = this.heightLimit - this.leafDistanceLimit; + this.foliageCoords = Lists. newArrayList(); + this.foliageCoords.add(new TreeQuercusRobur.FoliageCoordinates(this.basePos.up(k), j)); + + for (; k >= 0; --k) { + float f = this.layerSize(k); + + if (f >= 0.0F) { + for (int l = 0; l < i; ++l) { + double d0 = this.scaleWidth * (double)f * ((double)this.rand.nextFloat() + 0.328D); + double d1 = (double)(this.rand.nextFloat() * 2.0F) * Math.PI; + double d2 = d0 * Math.sin(d1) + 0.5D; + double d3 = d0 * Math.cos(d1) + 0.5D; + BlockPos blockpos = this.basePos.add(d2, (double)(k - 1), d3); + BlockPos blockpos1 = blockpos.up(this.leafDistanceLimit); + + if (this.checkBlockLine(blockpos, blockpos1) == -1) { + int i1 = this.basePos.getX() - blockpos.getX(); + int j1 = this.basePos.getZ() - blockpos.getZ(); + double d4 = (double)blockpos.getY() - Math.sqrt((double)(i1 * i1 + j1 * j1)) * this.branchSlope; + int k1 = d4 > (double)j ? j : (int)d4; + BlockPos blockpos2 = new BlockPos(this.basePos.getX(), k1, this.basePos.getZ()); + + if (this.checkBlockLine(blockpos2, blockpos) == -1) { + this.foliageCoords.add(new TreeQuercusRobur.FoliageCoordinates(blockpos, blockpos2.getY())); + } + } + } + } + } + } + + void crossSection(BlockPos pos, float leafSize, IBlockState leafBlock) { + + int i = (int)((double)leafSize + 0.618D); + + for (int j = -i; j <= i; ++j) { + for (int k = -i; k <= i; ++k) { + if (Math.pow((double)Math.abs(j) + 0.5D, 2.0D) + Math.pow((double)Math.abs(k) + 0.5D, 2.0D) <= (double)(leafSize * leafSize)) { + BlockPos blockpos = pos.add(j, 0, k); + IBlockState state = this.world.getBlockState(blockpos); + + if (state.getBlock().isAir(state, world, blockpos) || state.getBlock().isLeaves(state, world, blockpos)) { + this.setBlockAndNotifyAdequately(this.world, blockpos, leafBlock); + } + } + } + } + } + + float layerSize(int y) { + + if ((float)y < (float)this.heightLimit * 0.3F) { + return -1.0F; + } + else { + float f = (float)this.heightLimit / 2.0F; + float f1 = f - (float)y; + float f2 = MathHelper.sqrt_float(f * f - f1 * f1); + + if (f1 == 0.0F) { + f2 = f; + } + else if (Math.abs(f1) >= f) { + return 0.0F; + } + + return f2 * 0.5F; + } + } + + float leafSize(int y) { + + return y >= 0 && y < this.leafDistanceLimit ? (y != 0 && y != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F; + } + + void generateLeafNode(BlockPos pos) { + + for (int i = 0; i < this.leafDistanceLimit; ++i) { + if (!this.noLeaves) { + this.crossSection(pos.up(i), this.leafSize(i), this.leavesBlock.withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false))); + } + } + } + + void limb(BlockPos p_175937_1_, BlockPos p_175937_2_, IBlockState p_175937_3_) { + + BlockPos blockpos = p_175937_2_.add(-p_175937_1_.getX(), -p_175937_1_.getY(), -p_175937_1_.getZ()); + int i = this.getGreatestDistance(blockpos); + float f = (float)blockpos.getX() / (float)i; + float f1 = (float)blockpos.getY() / (float)i; + float f2 = (float)blockpos.getZ() / (float)i; + + for (int j = 0; j <= i; ++j) { + BlockPos blockpos1 = p_175937_1_.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2)); + BlockLog.EnumAxis blocklog$enumaxis = this.getLogAxis(p_175937_1_, blockpos1); + this.setBlockAndNotifyAdequately(this.world, blockpos1, p_175937_3_.withProperty(BlockLog.LOG_AXIS, blocklog$enumaxis)); + } + } + + private int getGreatestDistance(BlockPos posIn) { + + int i = MathHelper.abs_int(posIn.getX()); + int j = MathHelper.abs_int(posIn.getY()); + int k = MathHelper.abs_int(posIn.getZ()); + return k > i && k > j ? k : (j > i ? j : i); + } + + private BlockLog.EnumAxis getLogAxis(BlockPos p_175938_1_, BlockPos p_175938_2_) { + + BlockLog.EnumAxis blocklog$enumaxis = BlockLog.EnumAxis.Y; + int i = Math.abs(p_175938_2_.getX() - p_175938_1_.getX()); + int j = Math.abs(p_175938_2_.getZ() - p_175938_1_.getZ()); + int k = Math.max(i, j); + + if (k > 0) { + if (i == k) { + blocklog$enumaxis = BlockLog.EnumAxis.X; + } + else if (j == k) { + blocklog$enumaxis = BlockLog.EnumAxis.Z; + } + } + + return blocklog$enumaxis; + } + + void generateLeaves() { + + for (TreeQuercusRobur.FoliageCoordinates worldgenbigtree$foliagecoordinates : this.foliageCoords) { + this.generateLeafNode(worldgenbigtree$foliagecoordinates); + } + } + + boolean leafNodeNeedsBase(int p_76493_1_) { + + return (double)p_76493_1_ >= (double)this.heightLimit * 0.2D; + } + + void generateTrunk() { + + BlockPos blockpos = this.basePos; + BlockPos blockpos1 = this.basePos.up(this.height); + IBlockState block = this.logBlock; + this.limb(blockpos, blockpos1, block); + + switch (this.trunkType) { + case THICK: + this.limb(blockpos.east(), blockpos1.east(), block); + this.limb(blockpos.east().south(), blockpos1.east().south(), block); + this.limb(blockpos.south(), blockpos1.south(), block); + break; + + default: + break; + } + } + + void generateLeafNodeBases() { + + for (TreeQuercusRobur.FoliageCoordinates worldgenbigtree$foliagecoordinates : this.foliageCoords) { + int i = worldgenbigtree$foliagecoordinates.getBranchBase(); + BlockPos blockpos = new BlockPos(this.basePos.getX(), i, this.basePos.getZ()); + + if (!blockpos.equals(worldgenbigtree$foliagecoordinates) && this.leafNodeNeedsBase(i - this.basePos.getY())) { + this.limb(blockpos, worldgenbigtree$foliagecoordinates, this.logBlock); + } + } + } + + int checkBlockLine(BlockPos posOne, BlockPos posTwo) { + + BlockPos blockpos = posTwo.add(-posOne.getX(), -posOne.getY(), -posOne.getZ()); + int i = this.getGreatestDistance(blockpos); + float f = (float)blockpos.getX() / (float)i; + float f1 = (float)blockpos.getY() / (float)i; + float f2 = (float)blockpos.getZ() / (float)i; + + if (i == 0) { + return -1; + } + else { + for (int j = 0; j <= i; ++j) { + BlockPos blockpos1 = posOne.add((double)(0.5F + (float)j * f), (double)(0.5F + (float)j * f1), (double)(0.5F + (float)j * f2)); + + if (!this.isReplaceable(world, blockpos1)) { + return j; + } + } + + return -1; + } + } + + public void setDecorationDefaults() { + + this.leafDistanceLimit = 5; + } + + @Override + public boolean generate(World worldIn, Random rand, BlockPos position) { + + this.world = worldIn; + this.basePos = position; + this.rand = new Random(rand.nextLong()); + + if (this.heightLimit == 0) { + this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit); + } + + if (!this.validTreeLocation()) { + this.world = null; //Fix vanilla Mem leak, holds latest world + return false; + } + else { + this.generateLeafNodeList(); + this.generateLeaves(); + this.generateTrunk(); + this.generateLeafNodeBases(); + this.world = null; //Fix vanilla Mem leak, holds latest world + return true; + } + } + + private boolean validTreeLocation() { + + BlockPos down = this.basePos.down(); + net.minecraft.block.state.IBlockState state = this.world.getBlockState(down); + boolean isSoil = state.getBlock().canSustainPlant(state, this.world, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.SAPLING)); + + if (!isSoil) { + return false; + } + else { + int i = this.checkBlockLine(this.basePos, this.basePos.up(this.heightLimit - 1)); + + if (i == -1) { + return true; + } + else if (i < 6) { + return false; + } + else { + this.heightLimit = i; + return true; + } + } + } + + static class FoliageCoordinates extends BlockPos { + + private final int branchBase; + + public FoliageCoordinates(BlockPos pos, int branchBase) { + + super(pos.getX(), pos.getY(), pos.getZ()); + this.branchBase = branchBase; + } + + public int getBranchBase() { + + return this.branchBase; + } + } + + public enum TrunkType { + THIN, + THICK; + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeTiliaAmericana.java b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeTiliaAmericana.java new file mode 100644 index 00000000..d03062fb --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/feature/tree/rtg/TreeTiliaAmericana.java @@ -0,0 +1,2142 @@ +package appalachia.rtg.world.gen.feature.tree.rtg; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; + +import net.minecraft.block.BlockLeaves; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * Tilia Americana (American Basswood) + *

+ * This tree was designed by Lentebriesje and released as part of the 'Custom Tree Repository' project + * on Planet Minecraft (http://www.planetminecraft.com/project/native-trees-of-europe-template-repository-1779952/). + * It was converted into Java from its original schematic using the 'Schematic To Java Converter [For Modders]' program + * by ThisIsMika (http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/2193206-schematic-to-java-converter-for-modders). + * It has been modified slightly by WhichOnesPink to allow for random variation when generating in the world. + */ +public class TreeTiliaAmericana extends AppalachiaTree { + + World world; + Random rand; + + public TreeTiliaAmericana() { + + super(); + + this.trunkSize = 2; + this.validGroundBlocks = new ArrayList(Arrays.asList(Blocks.GRASS.getDefaultState(), Blocks.DIRT.getDefaultState())); + } + + @Override + public boolean generate(World world, Random rand, BlockPos pos) { + + if (rand.nextInt(8) != 0) { + return false; + } + + this.world = world; + this.rand = rand; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + ArrayList groundPos = new ArrayList() { + + }; + groundPos.add(new BlockPos(x + 8, y, z + 7)); + + for (int i = 0; i < groundPos.size(); i++) { + if (!isValidGroundBlock(world, rand, groundPos.get(i), 1)) { + return false; + } + } + + IBlockState leaves = this.leavesBlock.withProperty(BlockLeaves.CHECK_DECAY, false); + //IBlockState leaves = this.leavesBlock.withProperty(BlockLeaves.DECAYABLE, false); + int currentY = y; + + this.spawn(world, x, currentY, z, this.logBlock, leaves); + + return true; + } + + protected void spawn(World world, int x, int y, int z, IBlockState log, IBlockState leaves) { + + int currentY = y; + + this.setBlockState(new BlockPos(x + 8, y + 0, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 1, z + 7), log); + this.setBlockState(new BlockPos(x + 7, y + 1, z + 8), log); + this.setBlockState(new BlockPos(x + 9, y + 1, z + 8), log); + this.setBlockState(new BlockPos(x + 8, y + 2, z + 6), log); + this.setBlockState(new BlockPos(x + 7, y + 2, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 2, z + 7), log); + this.setBlockState(new BlockPos(x + 7, y + 2, z + 8), log); + this.setBlockState(new BlockPos(x + 9, y + 2, z + 8), log); + this.setBlockState(new BlockPos(x + 8, y + 3, z + 6), log); + this.setBlockState(new BlockPos(x + 7, y + 3, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 3, z + 7), log); + this.setBlockState(new BlockPos(x + 7, y + 3, z + 8), log); + this.setBlockState(new BlockPos(x + 9, y + 3, z + 8), log); + this.setBlockState(new BlockPos(x + 7, y + 4, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 4, z + 7), log); + this.setBlockState(new BlockPos(x + 7, y + 5, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 5, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 5, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 5, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 5, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 5, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 5, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 5, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 5, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 5, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 5, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 5, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 5, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 5, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 5, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 5, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 5, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 5, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 5, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 5, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 6, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 6, z + 7), log); + this.setBlockState(new BlockPos(x + 5, y + 6, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 6, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 6, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 6, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 6, z + 8), log); + this.setBlockState(new BlockPos(x + 10, y + 6, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 6, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 6, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 6, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 6, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 6, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 6, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 6, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 6, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 6, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 6, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 6, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 6, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 6, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 6, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 6, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 6, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 6, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 6, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 6, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 6, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 6, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 6, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 6, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 7, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 7, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 7, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 7, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 7, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 7, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 7, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 7, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 7, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 7, z + 9), log); + this.setBlockState(new BlockPos(x + 7, y + 7, z + 9), log); + this.setBlockState(new BlockPos(x + 8, y + 7, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 7, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 7, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 7, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 7, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 7, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 7, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 7, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 7, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 7, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 7, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 7, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 7, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 7, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 7, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 7, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 7, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 7, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 7, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 7, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 7, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 7, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 7, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 7, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 7, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 7, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 7, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 7, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 7, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 7, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 7, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 7, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 7, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 7, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 7, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 7, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 7, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 7, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 7, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 7, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 7, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 7, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 8, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 8, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 8, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 8, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 8, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 8, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 8, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 8, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 8, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 8, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 8, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 8, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 8, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 8, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 8, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 8, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 8, z + 6), log); + this.setBlockState(new BlockPos(x + 4, y + 8, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 8, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 8, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 8, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 8, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 8, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 8, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 8, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 8, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 8, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 8, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 8, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 8, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 8, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 8, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 8, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 8, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 8, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 8, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 8, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 8, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 8, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 8, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 8, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 8, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 8, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 8, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 8, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 8, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 8, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 8, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 8, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 8, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 8, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 8, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 8, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 8, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 8, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 8, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 8, z + 10), log); + this.setBlockState(new BlockPos(x + 6, y + 8, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 8, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 8, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 8, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 8, z + 10), log); + this.setBlockState(new BlockPos(x + 9, y + 8, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 8, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 8, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 8, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 8, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 8, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 8, z + 11), log); + this.setBlockState(new BlockPos(x + 7, y + 8, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 8, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 8, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 8, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 8, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 8, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 8, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 8, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 8, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 8, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 8, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 8, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 8, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 8, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 8, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 8, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 8, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 8, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 8, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 8, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 8, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 8, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 9, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 9, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 9, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 9, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 9, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 9, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 9, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 9, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 9, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 9, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 9, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 9, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 9, z + 5), log); + this.setBlockState(new BlockPos(x + 3, y + 9, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 9, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 9, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 9, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 9, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 9, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 9, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 9, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 9, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 9, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 9, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 9, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 9, z + 7), log); + this.setBlockState(new BlockPos(x + 7, y + 9, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 9, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 9, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 9, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 9, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 9, z + 7), log); + this.setBlockMetadataWithNotify(x + 11, y + 9, z + 7, 4, 4); + this.setBlockState(new BlockPos(x + 12, y + 9, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 9, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 9, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 9, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 9, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 9, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 9, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 9, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 9, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 9, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 9, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 9, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 9, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 9, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 9, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 9, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 9, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 9, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 9, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 9, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 9, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 9, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 9, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 9, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 9, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 9, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 9, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 9, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 9, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 9, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 9, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 9, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 9, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 9, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 9, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 9, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 9, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 9, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 9, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 9, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 9, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 9, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 9, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 9, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 9, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 9, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 9, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 9, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 9, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 9, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 10, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 10, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 10, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 10, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 10, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 10, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 10, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 10, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 10, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 10, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 10, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 10, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 10, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 10, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 10, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 10, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 10, z + 5), log); + this.setBlockMetadataWithNotify(x + 7, y + 10, z + 5, 8, 8); + this.setBlockState(new BlockPos(x + 9, y + 10, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 10, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 10, z + 5), log); + this.setBlockState(new BlockPos(x + 13, y + 10, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 13, y + 10, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 10, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 10, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 10, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 10, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 10, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 10, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 10, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 10, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 10, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 10, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 10, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 10, z + 6, 4, 4); + this.setBlockState(new BlockPos(x + 13, y + 10, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 13, y + 10, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 10, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 10, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 10, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 10, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 10, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 10, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 10, z + 7), log); + this.setBlockState(new BlockPos(x + 6, y + 10, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 10, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 10, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 10, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 10, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 10, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 10, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 10, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 10, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 10, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 10, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 10, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 10, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 10, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 10, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 10, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 10, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 10, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 10, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 10, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 10, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 10, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 10, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 10, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 10, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 10, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 10, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 10, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 10, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 10, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 10, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 10, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 10, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 10, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 10, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 10, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 10, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 10, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 10, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 10, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 10, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 10, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 10, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 10, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 10, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 10, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 10, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 10, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 10, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 11, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 11, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 11, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 11, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 11, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 11, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 11, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 11, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 11, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 11, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 11, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 11, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 11, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 11, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 11, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 11, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 11, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 11, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 11, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 11, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 11, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 11, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 11, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 11, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 11, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 11, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 11, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 11, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 11, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 11, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 11, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 11, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 11, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 11, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 11, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 11, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 11, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 11, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 11, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 11, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 11, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 11, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 11, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 11, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 11, z + 7), log); + this.setBlockState(new BlockPos(x + 5, y + 11, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 11, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 11, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 11, z + 7), log); + this.setBlockState(new BlockPos(x + 9, y + 11, z + 7), log); + this.setBlockState(new BlockPos(x + 12, y + 11, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 11, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 11, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 11, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 11, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 11, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 11, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 11, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 11, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 11, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 11, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 11, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 11, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 11, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 11, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 11, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 11, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 11, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 11, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 11, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 11, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 11, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 11, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 11, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 11, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 11, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 11, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 11, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 11, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 11, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 11, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 11, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 11, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 11, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 11, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 11, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 11, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 11, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 11, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 11, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 11, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 11, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 11, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 11, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 11, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 11, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 12, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 12, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 12, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 12, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 12, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 12, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 12, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 12, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 12, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 12, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 12, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 12, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 12, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 12, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 12, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 12, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 12, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 12, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 12, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 12, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 12, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 12, z + 5, 4, 4); + this.setBlockState(new BlockPos(x + 12, y + 12, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 12, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 12, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 12, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 12, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 12, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 12, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 12, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 12, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 12, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 12, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 12, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 12, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 12, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 12, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 12, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 12, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 12, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 12, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 12, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 12, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 12, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 12, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 12, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 12, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 12, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 12, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 12, z + 8), log); + this.setBlockState(new BlockPos(x + 9, y + 12, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 12, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 12, z + 8), log); + this.setBlockState(new BlockPos(x + 11, y + 12, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 12, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 13, y + 12, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 13, y + 12, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 12, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 12, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 12, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 12, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 12, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 12, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 12, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 12, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 12, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 12, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 12, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 12, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 12, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 12, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 12, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 12, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 12, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 12, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 12, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 12, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 12, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 12, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 12, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 12, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 12, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 12, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 12, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 12, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 12, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 12, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 12, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 12, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 12, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 12, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 12, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 12, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 13, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 13, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 13, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 13, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 13, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 13, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 13, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 13, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 13, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 13, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 13, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 13, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 13, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 13, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 13, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 13, z + 4), log); + this.setBlockState(new BlockPos(x + 7, y + 13, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 13, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 13, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 13, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 13, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 13, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 13, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 13, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 13, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 13, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 13, z + 5), log); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 13, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 13, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 13, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 13, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 13, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 13, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 13, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 13, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 13, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 6), log); + this.setBlockState(new BlockPos(x + 9, y + 13, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 13, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 13, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 13, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 13, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 13, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 13, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 13, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 13, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 13, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 13, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 13, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 13, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 13, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 13, z + 7), log); + this.setBlockState(new BlockPos(x + 5, y + 13, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 13, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 13, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 13, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 13, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 13, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 13, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 13, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 13, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 13, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 13, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 13, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 13, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 13, y + 13, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 13, y + 13, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 13, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 13, z + 9), log); + this.setBlockState(new BlockPos(x + 9, y + 13, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 13, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 13, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 13, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 13, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 13, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 13, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 13, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 13, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 13, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 13, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 13, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 13, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 13, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 13, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 13, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 13, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 13, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 13, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 13, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 13, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 13, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 13, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 13, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 13, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 13, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 13, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 13, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 14, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 14, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 14, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 14, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 14, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 14, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 14, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 14, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 14, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 14, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 14, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 14, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 14, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 14, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 14, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 14, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 14, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 14, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 14, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 14, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 14, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 14, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 4), log); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 14, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 14, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 14, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 14, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 14, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 14, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 14, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 14, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 14, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 14, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 14, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 14, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 14, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 14, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 14, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 14, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 14, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 14, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 14, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 14, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 14, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 14, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 14, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 14, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 14, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 7), log); + this.setBlockState(new BlockPos(x + 3, y + 14, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 14, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 14, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 14, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 14, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 14, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 14, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 14, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 14, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 14, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 14, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 14, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 14, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 14, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 14, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 14, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 10), log); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 14, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 14, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 14, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 14, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 14, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 14, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 14, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 14, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 14, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 14, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 14, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 14, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 14, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 14, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 14, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 14, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 14, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 14, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 14, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 14, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 14, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 15, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 15, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 15, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 15, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 15, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 15, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 15, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 15, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 15, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 15, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 15, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 15, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 15, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 15, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 15, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 15, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 15, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 15, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 15, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 15, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 15, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 15, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 15, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 5), log); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 15, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 6), log); + this.setBlockState(new BlockPos(x + 8, y + 15, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 15, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 15, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 15, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 15, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 15, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 15, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 15, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 15, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 15, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 7), log); + this.setBlockState(new BlockPos(x + 10, y + 15, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 15, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 15, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 15, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 15, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 15, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 15, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 15, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 15, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 15, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 15, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 15, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 15, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 15, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 15, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 15, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 15, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 15, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 15, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 15, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 15, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 15, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 15, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 15, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 15, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 15, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 15, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 15, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 15, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 15, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 15, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 15, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 15, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 15, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 15, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 15, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 15, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 15, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 15, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 15, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 15, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 15, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 16, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 16, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 16, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 16, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 16, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 16, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 16, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 16, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 16, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 16, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 16, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 16, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 16, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 16, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 16, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 16, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 16, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 16, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 16, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 16, z + 4), log); + this.setBlockState(new BlockPos(x + 5, y + 16, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 16, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 16, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 4), log); + this.setBlockState(new BlockPos(x + 8, y + 16, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 16, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 16, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 16, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 16, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 16, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 16, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 16, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 16, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 16, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 16, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 16, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 16, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 16, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 16, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 16, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 16, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 16, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 16, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 16, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 16, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 16, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 16, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 16, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 16, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 16, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 16, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 16, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 16, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 16, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 16, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 16, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 16, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 8), log); + this.setBlockState(new BlockPos(x + 8, y + 16, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 16, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 16, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 16, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 16, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 16, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 16, z + 9), log); + this.setBlockState(new BlockPos(x + 5, y + 16, z + 9), log); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 16, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 16, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 16, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 16, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 16, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 16, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 16, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 16, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 16, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 16, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 16, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 16, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 16, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 16, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 16, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 16, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 16, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 16, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 16, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 16, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 16, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 16, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 16, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 16, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 16, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 16, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 16, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 16, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 16, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 16, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 16, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 16, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 17, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 17, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 17, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 17, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 17, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 17, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 17, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 17, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 3), log); + this.setBlockMetadataWithNotify(x + 6, y + 17, z + 3, 8, 8); + this.setBlockState(new BlockPos(x + 7, y + 17, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 17, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 17, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 17, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 17, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 17, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 17, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 17, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 17, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 17, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 17, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 17, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 17, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 17, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 17, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 17, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 17, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 17, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 17, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 17, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 17, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 17, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 17, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 17, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 17, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 17, z + 7), log); + this.setBlockState(new BlockPos(x + 9, y + 17, z + 7), log); + this.setBlockState(new BlockPos(x + 10, y + 17, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 17, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 17, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 17, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 17, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 17, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 17, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 17, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 17, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 17, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 17, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 17, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 17, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 17, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 17, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 17, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 17, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 17, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 17, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 17, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 17, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 17, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 17, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 17, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 17, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 17, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 17, z + 10), log); + this.setBlockMetadataWithNotify(x + 3, y + 17, z + 10, 8, 8); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 10), log); + this.setBlockState(new BlockPos(x + 5, y + 17, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 17, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 17, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 17, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 17, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 17, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 17, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 17, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 17, z + 11, 4, 4); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 17, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 17, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 17, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 17, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 17, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 17, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 17, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 17, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 17, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 17, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 17, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 17, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 18, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 18, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 18, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 18, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 18, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 18, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 18, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 18, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 18, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 18, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 18, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 18, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 18, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 18, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 18, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 18, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 18, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 18, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 18, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 18, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 13, y + 18, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 13, y + 18, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 18, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 18, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 18, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 18, z + 7), log); + this.setBlockState(new BlockPos(x + 11, y + 18, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 18, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 18, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 18, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 13, y + 18, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 13, y + 18, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 18, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 18, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 18, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 18, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 18, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 18, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 18, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 18, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 18, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 18, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 18, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 18, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 18, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 18, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 18, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 18, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 18, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 18, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 18, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 18, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 18, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 18, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 18, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 18, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 18, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 18, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 18, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 18, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 18, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 18, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 18, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 18, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 18, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 18, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 18, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 18, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 18, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 18, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 18, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 18, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 18, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 18, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 18, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 18, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 18, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 18, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 18, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 18, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 18, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 19, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 19, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 19, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 19, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 19, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 19, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 19, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 19, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 19, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 19, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 19, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 19, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 19, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 19, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 19, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 19, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 19, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 19, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 19, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 19, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 19, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 19, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 19, z + 7), log); + this.setBlockState(new BlockPos(x + 9, y + 19, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 19, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 19, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 19, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 19, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 19, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 19, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 19, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 19, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 19, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 19, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 19, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 19, z + 8), log); + this.setBlockState(new BlockPos(x + 9, y + 19, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 19, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 19, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 19, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 19, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 19, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 19, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 19, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 19, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 19, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 19, z + 9), log); + this.setBlockState(new BlockPos(x + 9, y + 19, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 19, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 19, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 19, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 19, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 19, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 19, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 19, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 19, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 19, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 19, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 19, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 19, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 19, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 19, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 19, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 19, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 19, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 19, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 19, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 19, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 19, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 19, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 19, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 20, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 20, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 20, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 20, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 20, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 20, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 20, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 20, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 20, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 20, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 20, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 20, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 20, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 5), log); + this.setBlockState(new BlockPos(x + 8, y + 20, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 20, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 20, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 20, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 20, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 20, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 20, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 20, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 20, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 6), log); + this.setBlockState(new BlockPos(x + 8, y + 20, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 20, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 20, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 20, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 20, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 20, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 20, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 20, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 20, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 20, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 20, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 20, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 20, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 20, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 20, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 20, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 20, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 20, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 20, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 20, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 20, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 20, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 20, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 20, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 20, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 20, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 20, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 20, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 20, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 20, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 20, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 20, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 20, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 20, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 20, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 20, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 20, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 20, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 20, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 20, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 20, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 20, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 20, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 20, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 20, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 20, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 20, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 20, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 20, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 10), log); + this.setBlockState(new BlockPos(x + 8, y + 20, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 20, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 20, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 20, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 20, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 20, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 20, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 20, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 20, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 20, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 20, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 20, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 20, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 20, z + 13), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 20, z + 13, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 21, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 21, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 21, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 21, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 21, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 21, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 21, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 21, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 21, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 21, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 21, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 21, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 21, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 21, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 4), log); + this.setBlockState(new BlockPos(x + 8, y + 21, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 21, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 21, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 21, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 21, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 21, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 21, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 21, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 21, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 21, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 21, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 21, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 21, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 21, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 21, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 21, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 21, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 21, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 21, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 21, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 21, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 21, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 21, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 21, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 21, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 21, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 21, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 13, y + 21, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 13, y + 21, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 21, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 21, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 21, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 21, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 21, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 21, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 21, z + 7), log); + this.setBlockState(new BlockPos(x + 9, y + 21, z + 7), log); + this.setBlockState(new BlockPos(x + 10, y + 21, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 21, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 21, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 21, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 21, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 21, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 21, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 21, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 21, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 21, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 21, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 21, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 21, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 21, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 21, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 21, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 21, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 21, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 21, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 21, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 21, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 21, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 21, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 21, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 21, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 21, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 21, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 21, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 21, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 21, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 22, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 22, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 22, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 22, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 22, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 22, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 22, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 22, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 22, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 22, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 22, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 22, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 22, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 22, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 22, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 22, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 22, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 22, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 22, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 22, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 22, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 22, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 22, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 22, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 22, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 22, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 22, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 22, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 22, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 22, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 22, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 22, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 13, y + 22, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 13, y + 22, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 22, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 22, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 22, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 22, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 22, z + 7), log); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 7), log); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 22, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 22, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 22, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 22, z + 7), log); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 22, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 22, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 22, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 22, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 22, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 22, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 22, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 22, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 22, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 22, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 22, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 22, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 22, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 22, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 13, y + 22, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 13, y + 22, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 22, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 22, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 22, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 22, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 22, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 22, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 22, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 22, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 22, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 22, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 22, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 22, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 22, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 22, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 22, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 22, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 22, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 22, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 22, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 22, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 22, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 22, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 22, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 22, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 22, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 22, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 22, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 22, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 22, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 22, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 23, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 23, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 23, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 23, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 23, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 23, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 23, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 23, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 23, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 23, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 23, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 23, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 23, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 23, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 23, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 23, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 23, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 23, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 23, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 23, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 23, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 23, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 23, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 23, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 23, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 23, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 23, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 23, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 23, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 23, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 23, z + 5), log); + this.setBlockMetadataWithNotify(x + 8, y + 23, z + 5, 8, 8); + this.setBlockState(new BlockPos(x + 10, y + 23, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 23, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 23, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 23, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 23, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 23, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 23, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 23, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 23, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 23, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 23, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 23, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 23, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 23, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 13, y + 23, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 13, y + 23, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 23, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 23, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 23, z + 7), log); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 23, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 7), log); + this.setBlockState(new BlockPos(x + 9, y + 23, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 23, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 1, y + 23, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 1, y + 23, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 23, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 23, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 23, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 23, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 23, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 23, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 23, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 23, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 13, y + 23, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 13, y + 23, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 23, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 23, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 23, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 23, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 23, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 23, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 23, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 23, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 23, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 23, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 23, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 23, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 23, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 23, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 23, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 23, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 23, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 23, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 23, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 23, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 23, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 23, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 23, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 23, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 23, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 23, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 23, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 23, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 23, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 23, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 23, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 23, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 23, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 23, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 24, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 24, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 24, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 24, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 24, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 24, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 24, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 24, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 24, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 24, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 24, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 24, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 24, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 24, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 24, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 24, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 24, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 24, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 24, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 24, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 5), log); + this.setBlockState(new BlockPos(x + 9, y + 24, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 24, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 24, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 24, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 24, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 24, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 24, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 24, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 24, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 24, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 6), log); + this.setBlockState(new BlockPos(x + 8, y + 24, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 24, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 24, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 24, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 24, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 24, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 24, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 24, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 24, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 24, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 24, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 24, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 24, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 24, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 24, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 24, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 24, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 24, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 24, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 24, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 24, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 24, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 24, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 24, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 24, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 24, z + 8), log); + this.setBlockState(new BlockPos(x + 9, y + 24, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 24, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 24, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 24, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 24, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 24, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 24, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 24, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 24, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 24, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 24, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 24, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 24, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 24, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 24, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 24, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 24, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 24, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 24, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 24, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 24, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 24, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 24, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 24, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 24, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 24, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 24, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 24, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 1), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 25, z + 1, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 25, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 25, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 25, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 25, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 25, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 25, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 25, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 25, z + 3, 4, 4); + this.setBlockState(new BlockPos(x + 10, y + 25, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 25, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 25, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 25, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 25, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 25, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 25, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 25, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 25, z + 4), log); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 25, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 25, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 25, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 25, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 25, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 25, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 25, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 25, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 25, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 25, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 25, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 25, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 25, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 25, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 25, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 25, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 25, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 25, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 25, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 25, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 25, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 25, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 2, y + 25, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 2, y + 25, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 25, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 25, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 25, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 25, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 25, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 25, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 25, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 25, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 25, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 25, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 25, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 25, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 25, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 25, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 25, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 25, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 25, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 25, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 25, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 25, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 25, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 25, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 25, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 25, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 25, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 25, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 25, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 25, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 25, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 25, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 9), log); + this.setBlockState(new BlockPos(x + 10, y + 25, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 25, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 25, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 25, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 12, y + 25, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 12, y + 25, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 25, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 25, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 25, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 25, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 25, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 25, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 25, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 25, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 25, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 25, z + 12), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 25, z + 12, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 26, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 26, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 26, z + 2), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 26, z + 2, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 26, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 26, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 26, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 26, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 26, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 26, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 26, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 26, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 26, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 26, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 26, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 26, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 26, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 26, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 26, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 26, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 26, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 26, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 26, z + 6), log); + this.setBlockMetadataWithNotify(x + 7, y + 26, z + 6, 8, 8); + this.setBlockState(new BlockPos(x + 3, y + 26, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 26, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 26, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 26, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 26, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 26, z + 7), log); + this.setBlockMetadataWithNotify(x + 8, y + 26, z + 7, 4, 4); + this.setBlockState(new BlockPos(x + 9, y + 26, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 26, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 26, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 26, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 3, y + 26, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 3, y + 26, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 26, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 26, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 26, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 26, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 26, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 26, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 26, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 26, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 26, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 26, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 26, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 26, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 26, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 26, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 26, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 26, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 26, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 26, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 26, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 26, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 26, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 26, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 26, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 26, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 26, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 26, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 26, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 26, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 26, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 26, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 27, z + 3), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 27, z + 3, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 27, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 27, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 27, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 27, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 27, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 27, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 27, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 27, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 27, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 27, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 27, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 27, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 27, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 27, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 27, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 27, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 27, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 27, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 27, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 27, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 27, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 27, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 27, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 27, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 27, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 27, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 27, z + 7), log); + this.setBlockState(new BlockPos(x + 9, y + 27, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 27, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 27, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 27, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 4, y + 27, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 4, y + 27, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 27, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 27, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 27, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 27, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 27, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 27, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 27, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 27, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 27, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 27, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 27, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 27, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 27, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 27, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 27, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 27, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 11, y + 27, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 11, y + 27, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 27, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 27, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 9, y + 27, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 9, y + 27, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 27, z + 11), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 27, z + 11, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 28, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 28, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 28, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 28, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 28, z + 4), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 28, z + 4, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 28, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 28, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 28, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 28, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 28, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 28, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 28, z + 7), log); + this.setBlockState(new BlockPos(x + 8, y + 28, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 28, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 28, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 28, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 28, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 28, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 28, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 28, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 28, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 28, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 10, y + 28, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 10, y + 28, z + 8, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 28, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 28, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 28, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 28, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 28, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 28, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 8, y + 28, z + 10), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 28, z + 10, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 29, z + 5), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 29, z + 5, 12, 12); + this.setBlockState(new BlockPos(x + 5, y + 29, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 5, y + 29, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 29, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 29, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 29, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 29, z + 7, 4, 4); + this.setBlockState(new BlockPos(x + 8, y + 29, z + 9), leaves); + this.setBlockMetadataWithNotify(x + 8, y + 29, z + 9, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 30, z + 6), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 30, z + 6, 12, 12); + this.setBlockState(new BlockPos(x + 7, y + 30, z + 7), leaves); + this.setBlockMetadataWithNotify(x + 7, y + 30, z + 7, 12, 12); + this.setBlockState(new BlockPos(x + 6, y + 30, z + 8), leaves); + this.setBlockMetadataWithNotify(x + 6, y + 30, z + 8, 12, 12); + } + + protected void setBlockState(BlockPos pos, IBlockState state) { + + this.setBlockAndNotifyAdequately(this.world, pos, state); + } + + private void setBlockMetadataWithNotify(int x, int y, int z, int meta1, int meta2) { + + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLAppalachianMountains.java b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLAppalachianMountains.java new file mode 100644 index 00000000..f919ec9e --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLAppalachianMountains.java @@ -0,0 +1,123 @@ +package appalachia.rtg.world.gen.surface.appalachia; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceAPLAppalachianMountains extends SurfaceBase { + + private float min; + + private float sCliff = 1.5f; + private float sHeight = 60f; + private float sStrength = 65f; + private float iCliff = 0.3f; + private float iHeight = 100f; + private float iStrength = 50f; + private float cCliff = 1.5f; + + public SurfaceAPLAppalachianMountains(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff) { + + super(config, top, fill); + min = minCliff; + } + + public SurfaceAPLAppalachianMountains(BiomeConfig config, IBlockState top, IBlockState fill, float minCliff, float stoneCliff, float stoneHeight, float stoneStrength, float snowCliff, float snowHeight, float snowStrength, float clayCliff) { + + this(config, top, fill, minCliff); + + sCliff = stoneCliff; + sHeight = stoneHeight; + sStrength = stoneStrength; + iCliff = snowCliff; + iHeight = snowHeight; + iStrength = snowStrength; + cCliff = clayCliff; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + int cliff = 0; + + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (depth == 0) { + + float p = simplex.noise3(i / 8f, j / 8f, k / 8f) * 0.5f; + if (c > min && c > sCliff - ((k - sHeight) / sStrength) + p) { + cliff = 1; + } + if (c > cCliff) { + cliff = 2; + } + if (k > 110 + (p * 4) && c < iCliff + ((k - iHeight) / iStrength) + p) { + cliff = 3; + } + + if (cliff == 1) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else if (k < 63) { + if (k < 62) { + primer.setBlockState(x, k, y, fillerBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + } + else if (depth < 6) { + if (cliff == 1) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + else if (cliff == 2) { + primer.setBlockState(x, k, y, getShadowStoneBlock(world, i, j, x, y, k)); + } + else if (cliff == 3) { + primer.setBlockState(x, k, y, Blocks.SNOW.getDefaultState()); + } + else { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + } + } + } + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeBeach.java b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeBeach.java new file mode 100644 index 00000000..bf081958 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeBeach.java @@ -0,0 +1,84 @@ +package appalachia.rtg.world.gen.surface.appalachia; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeBeach; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceAPLBlueRidgeBeach extends SurfaceBase { + + protected IBlockState mixBlock; + protected float width; + protected float height; + + public SurfaceAPLBlueRidgeBeach(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler); + + mixBlock = this.getConfigBlock(config, BiomeConfigAPLBlueRidgeBeach.surfaceMixBlockId, + BiomeConfigAPLBlueRidgeBeach.surfaceMixBlockMetaId, + mix); + + width = mixWidth; + height = mixHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 2.3f ? true : false; // 2.3f because higher thresholds result in fewer stone cliffs (more grassy cliffs) + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) > height) // > 0.27f, i / 12f + { + primer.setBlockState(x, k, y, mixBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeForest.java b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeForest.java new file mode 100644 index 00000000..98775959 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeForest.java @@ -0,0 +1,84 @@ +package appalachia.rtg.world.gen.surface.appalachia; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeForest; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceAPLBlueRidgeForest extends SurfaceBase { + + protected IBlockState mixBlock; + protected float width; + protected float height; + + public SurfaceAPLBlueRidgeForest(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler); + + mixBlock = this.getConfigBlock(config, BiomeConfigAPLBlueRidgeForest.surfaceMixBlockId, + BiomeConfigAPLBlueRidgeForest.surfaceMixBlockMetaId, + mix); + + width = mixWidth; + height = mixHeight; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 2.3f ? true : false; // 2.3f because higher thresholds result in fewer stone cliffs (more grassy cliffs) + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / width, j / width) > height) // > 0.27f, i / 12f + { + primer.setBlockState(x, k, y, mixBlock); + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeForestAutumn.java b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeForestAutumn.java new file mode 100644 index 00000000..93400a29 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeForestAutumn.java @@ -0,0 +1,19 @@ +package appalachia.rtg.world.gen.surface.appalachia; + +import net.minecraft.block.state.IBlockState; + +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeForestAutumn; + +import rtg.api.biome.BiomeConfig; + +public class SurfaceAPLBlueRidgeForestAutumn extends SurfaceAPLBlueRidgeForest { + + public SurfaceAPLBlueRidgeForestAutumn(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler, mix, mixWidth, mixHeight); + + mixBlock = this.getConfigBlock(config, BiomeConfigAPLBlueRidgeForestAutumn.surfaceMixBlockId, + BiomeConfigAPLBlueRidgeForestAutumn.surfaceMixBlockMetaId, + mix); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeHills.java b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeHills.java new file mode 100644 index 00000000..ec0dff98 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeHills.java @@ -0,0 +1,19 @@ +package appalachia.rtg.world.gen.surface.appalachia; + +import net.minecraft.block.state.IBlockState; + +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeHills; + +import rtg.api.biome.BiomeConfig; + +public class SurfaceAPLBlueRidgeHills extends SurfaceAPLBlueRidgeForest { + + public SurfaceAPLBlueRidgeHills(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler, mix, mixWidth, mixHeight); + + mixBlock = this.getConfigBlock(config, BiomeConfigAPLBlueRidgeHills.surfaceMixBlockId, + BiomeConfigAPLBlueRidgeHills.surfaceMixBlockMetaId, + mix); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeHillsAutumn.java b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeHillsAutumn.java new file mode 100644 index 00000000..0dc14a0b --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeHillsAutumn.java @@ -0,0 +1,19 @@ +package appalachia.rtg.world.gen.surface.appalachia; + +import net.minecraft.block.state.IBlockState; + +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeHillsAutumn; + +import rtg.api.biome.BiomeConfig; + +public class SurfaceAPLBlueRidgeHillsAutumn extends SurfaceAPLBlueRidgeForest { + + public SurfaceAPLBlueRidgeHillsAutumn(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler, mix, mixWidth, mixHeight); + + mixBlock = this.getConfigBlock(config, BiomeConfigAPLBlueRidgeHillsAutumn.surfaceMixBlockId, + BiomeConfigAPLBlueRidgeHillsAutumn.surfaceMixBlockMetaId, + mix); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeMountains.java b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeMountains.java new file mode 100644 index 00000000..7cb14e39 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeMountains.java @@ -0,0 +1,19 @@ +package appalachia.rtg.world.gen.surface.appalachia; + +import net.minecraft.block.state.IBlockState; + +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeMountains; + +import rtg.api.biome.BiomeConfig; + +public class SurfaceAPLBlueRidgeMountains extends SurfaceAPLBlueRidgeForest { + + public SurfaceAPLBlueRidgeMountains(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler, mix, mixWidth, mixHeight); + + mixBlock = this.getConfigBlock(config, BiomeConfigAPLBlueRidgeMountains.surfaceMixBlockId, + BiomeConfigAPLBlueRidgeMountains.surfaceMixBlockMetaId, + mix); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeMountainsAutumn.java b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeMountainsAutumn.java new file mode 100644 index 00000000..c65d0c67 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeMountainsAutumn.java @@ -0,0 +1,19 @@ +package appalachia.rtg.world.gen.surface.appalachia; + +import net.minecraft.block.state.IBlockState; + +import appalachia.rtg.api.biome.appalachia.config.BiomeConfigAPLBlueRidgeMountainsAutumn; + +import rtg.api.biome.BiomeConfig; + +public class SurfaceAPLBlueRidgeMountainsAutumn extends SurfaceAPLBlueRidgeForest { + + public SurfaceAPLBlueRidgeMountainsAutumn(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mix, float mixWidth, float mixHeight) { + + super(config, top, filler, mix, mixWidth, mixHeight); + + mixBlock = this.getConfigBlock(config, BiomeConfigAPLBlueRidgeMountainsAutumn.surfaceMixBlockId, + BiomeConfigAPLBlueRidgeMountainsAutumn.surfaceMixBlockMetaId, + mix); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeRiver.java b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeRiver.java new file mode 100644 index 00000000..77a68dae --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLBlueRidgeRiver.java @@ -0,0 +1,49 @@ +package appalachia.rtg.world.gen.surface.appalachia; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceAPLBlueRidgeRiver extends SurfaceBase { + + public SurfaceAPLBlueRidgeRiver(BiomeConfig config) { + + super(config, Blocks.GRASS, (byte) 0, Blocks.DIRT, (byte) 0); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + if (river > 0.05f && river + (simplex.noise2(i / 10f, j / 10f) * 0.15f) > 0.8f) { + Block b; + for (int k = 255; k > -1; k--) { + b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b != Blocks.WATER) { + depth++; + + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, Blocks.GRASS.getDefaultState()); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, Blocks.DIRT.getDefaultState()); + } + else if (depth > 4) { + return; + } + } + } + } + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLPrairie.java b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLPrairie.java new file mode 100644 index 00000000..ea2223cc --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLPrairie.java @@ -0,0 +1,66 @@ +package appalachia.rtg.world.gen.surface.appalachia; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceAPLPrairie extends SurfaceBase { + + public SurfaceAPLPrairie(BiomeConfig config, IBlockState top, IBlockState filler) { + + super(config, top, filler); + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + primer.setBlockState(x, k, y, topBlock); + } + else if (depth < 4) { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLSmokyMountains.java b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLSmokyMountains.java new file mode 100644 index 00000000..b0f68888 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/surface/appalachia/SurfaceAPLSmokyMountains.java @@ -0,0 +1,97 @@ +package appalachia.rtg.world.gen.surface.appalachia; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.ChunkPrimer; + +import rtg.api.biome.BiomeConfig; +import rtg.util.CellNoise; +import rtg.util.CliffCalculator; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.surface.SurfaceBase; + +public class SurfaceAPLSmokyMountains extends SurfaceBase { + + + private IBlockState blockMixTop; + private IBlockState blockMixFiller; + private float floMixWidth; + private float floMixHeight; + private float floSmallWidth; + private float floSmallStrength; + + public SurfaceAPLSmokyMountains(BiomeConfig config, IBlockState top, IBlockState filler, IBlockState mixTop, IBlockState mixFiller, + float mixWidth, float mixHeight, float smallWidth, float smallStrength) { + + super(config, top, filler); + + blockMixTop = mixTop; + blockMixFiller = mixFiller; + + floMixWidth = mixWidth; + floMixHeight = mixHeight; + floSmallWidth = smallWidth; + floSmallStrength = smallStrength; + } + + @Override + public void paintTerrain(ChunkPrimer primer, int i, int j, int x, int y, int depth, World world, Random rand, + OpenSimplexNoise simplex, CellNoise cell, float[] noise, float river, Biome[] base) { + + float c = CliffCalculator.calc(x, y, noise); + boolean cliff = c > 1.4f ? true : false; + boolean mix = false; + + for (int k = 255; k > -1; k--) { + Block b = primer.getBlockState(x, k, y).getBlock(); + if (b == Blocks.AIR) { + depth = -1; + } + else if (b == Blocks.STONE) { + depth++; + + if (cliff) { + if (depth > -1 && depth < 2) { + if (rand.nextInt(3) == 0) { + + primer.setBlockState(x, k, y, hcCobble(world, i, j, x, y, k)); + } + else { + + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else if (depth < 10) { + primer.setBlockState(x, k, y, hcStone(world, i, j, x, y, k)); + } + } + else { + if (depth == 0 && k > 61) { + if (simplex.noise2(i / floMixWidth, j / floMixWidth) + simplex.noise2(i / floSmallWidth, j / floSmallWidth) + * floSmallStrength > floMixHeight) { + primer.setBlockState(x, k, y, blockMixTop); + + mix = true; + } + else { + primer.setBlockState(x, k, y, topBlock); + } + } + else if (depth < 4) { + if (mix) { + primer.setBlockState(x, k, y, blockMixFiller); + } + else { + primer.setBlockState(x, k, y, fillerBlock); + } + } + } + } + } + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLAppalachianMountains.java b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLAppalachianMountains.java new file mode 100644 index 00000000..fee2e7bc --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLAppalachianMountains.java @@ -0,0 +1,25 @@ +package appalachia.rtg.world.gen.terrain.appalachia; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainAPLAppalachianMountains extends TerrainBase { + + // the BoP version has steep slopes and a flat area on top. The RTG version will + private float start = 0f;// this puts a minimum on "ruggedness" on the top. We want to allow flats + private float height = 40f; // sets the variability range + private float width = 80f; // width of irregularity noise on top. We want low, for a lot of features. + + public TerrainAPLAppalachianMountains() { + + base = 120f; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, start, width, height, base - 62f); + //return terrainMountainRiver(x, y, simplex, cell, river, 300f, 67f); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeBeach.java b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeBeach.java new file mode 100644 index 00000000..f77327f2 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeBeach.java @@ -0,0 +1,11 @@ +package appalachia.rtg.world.gen.terrain.appalachia; + + +import rtg.world.gen.terrain.vanilla.TerrainVanillaBeach; + +public class TerrainAPLBlueRidgeBeach extends TerrainVanillaBeach { + + public TerrainAPLBlueRidgeBeach() { + + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeForest.java b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeForest.java new file mode 100644 index 00000000..28ff0269 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeForest.java @@ -0,0 +1,26 @@ +package appalachia.rtg.world.gen.terrain.appalachia; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainAPLBlueRidgeForest extends TerrainBase { + + protected float hillStrength = 10f;// this needs to be linked to the + + public TerrainAPLBlueRidgeForest() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + groundNoise = groundNoise(x, y, groundVariation, simplex); + + float m = hills(x, y, hillStrength, simplex, river); + + float floNoise = 65f + groundNoise + m; + + return riverized(floNoise, river); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeForestAutumn.java b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeForestAutumn.java new file mode 100644 index 00000000..65ba1a90 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeForestAutumn.java @@ -0,0 +1,8 @@ +package appalachia.rtg.world.gen.terrain.appalachia; + +public class TerrainAPLBlueRidgeForestAutumn extends TerrainAPLBlueRidgeForest { + + public TerrainAPLBlueRidgeForestAutumn() { + super(); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeHills.java b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeHills.java new file mode 100644 index 00000000..c6c0344c --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeHills.java @@ -0,0 +1,28 @@ +package appalachia.rtg.world.gen.terrain.appalachia; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainAPLBlueRidgeHills extends TerrainBase { + + protected float hillStrength = 30f; + + public TerrainAPLBlueRidgeHills() { + + this(72f, 30f); + } + + public TerrainAPLBlueRidgeHills(float bh, float hs) { + + base = bh; + hillStrength = hs; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainHighland(x, y, simplex, cell, river, 10f, 68f, hillStrength, base - 62f); + + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeHillsAutumn.java b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeHillsAutumn.java new file mode 100644 index 00000000..fc418872 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeHillsAutumn.java @@ -0,0 +1,8 @@ +package appalachia.rtg.world.gen.terrain.appalachia; + +public class TerrainAPLBlueRidgeHillsAutumn extends TerrainAPLBlueRidgeHills { + + public TerrainAPLBlueRidgeHillsAutumn() { + super(); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeMountains.java b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeMountains.java new file mode 100644 index 00000000..2529e3d0 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeMountains.java @@ -0,0 +1,42 @@ +package appalachia.rtg.world.gen.terrain.appalachia; + +import rtg.world.gen.terrain.FunctionalTerrainBase; +import rtg.world.gen.terrain.HeightVariation; +import rtg.world.gen.terrain.JitterEffect; +import rtg.world.gen.terrain.MountainsWithPassesEffect; + +public class TerrainAPLBlueRidgeMountains extends FunctionalTerrainBase { + + protected float width; + protected float strength; + protected float spikeWidth = 40; + protected float spikeHeight = 20; + + public TerrainAPLBlueRidgeMountains(float mountainWidth, float mountainStrength) { + + this(mountainWidth, mountainStrength, 90f); + } + + public TerrainAPLBlueRidgeMountains(float mountainWidth, float mountainStrength, float baseHeight) { + + width = mountainWidth; + strength = mountainStrength; + base = baseHeight; + MountainsWithPassesEffect mountainEffect = new MountainsWithPassesEffect(); + mountainEffect.mountainHeight = strength; + mountainEffect.mountainWavelength = width; + mountainEffect.spikeHeight = this.spikeHeight; + mountainEffect.spikeWavelength = this.spikeWidth; + + this.height = new JitterEffect(6f, 10f, mountainEffect); + height = new JitterEffect(2f, 6f, height); + + HeightVariation passHeight = new HeightVariation(); + passHeight.height = 15; + passHeight.octave = 4; + passHeight.wavelength = 70; + + height = height.plus(passHeight); + + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeMountainsAutumn.java b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeMountainsAutumn.java new file mode 100644 index 00000000..e54ffa98 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeMountainsAutumn.java @@ -0,0 +1,9 @@ +package appalachia.rtg.world.gen.terrain.appalachia; + +public class TerrainAPLBlueRidgeMountainsAutumn extends TerrainAPLBlueRidgeMountains { + + public TerrainAPLBlueRidgeMountainsAutumn(float mountainWidth, float mountainStrength) { + + super(mountainWidth, mountainStrength); + } +} \ No newline at end of file diff --git a/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeRiver.java b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeRiver.java new file mode 100644 index 00000000..a5e417e8 --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLBlueRidgeRiver.java @@ -0,0 +1,18 @@ +package appalachia.rtg.world.gen.terrain.appalachia; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainAPLBlueRidgeRiver extends TerrainBase { + + public TerrainAPLBlueRidgeRiver() { + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return terrainFlatLakes(x, y, simplex, river, 3f, 60f); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLPrairie.java b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLPrairie.java new file mode 100644 index 00000000..ea8b6dbe --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLPrairie.java @@ -0,0 +1,27 @@ +package appalachia.rtg.world.gen.terrain.appalachia; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainAPLPrairie extends TerrainBase { + + private float minHeight; + private float maxHeight; + private float hillStrength; + + // 63f, 80f, 30f + + public TerrainAPLPrairie(float minHeight, float maxHeight, float hillStrength) { + + this.minHeight = minHeight; + this.maxHeight = (maxHeight > rollingHillsMaxHeight) ? rollingHillsMaxHeight : ((maxHeight < this.minHeight) ? rollingHillsMaxHeight : maxHeight); + this.hillStrength = hillStrength; + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return this.terrainPlains(x, y, simplex, river, 200f, 1f, 30f, 1f, maxHeight); + } +} diff --git a/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLSmokyMountains.java b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLSmokyMountains.java new file mode 100644 index 00000000..58f12bdb --- /dev/null +++ b/src/main/java/appalachia/rtg/world/gen/terrain/appalachia/TerrainAPLSmokyMountains.java @@ -0,0 +1,46 @@ +package appalachia.rtg.world.gen.terrain.appalachia; + +import rtg.util.CellNoise; +import rtg.util.OpenSimplexNoise; +import rtg.world.gen.terrain.HeightEffect; +import rtg.world.gen.terrain.JitterEffect; +import rtg.world.gen.terrain.MountainsWithPassesEffect; +import rtg.world.gen.terrain.TerrainBase; + +public class TerrainAPLSmokyMountains extends TerrainBase { + + private float width; + private float strength; + private float terrainHeight; + private float spikeWidth = 30; + private float spikeHeight = 50; + private HeightEffect heightEffect; + + public TerrainAPLSmokyMountains(float mountainWidth, float mountainStrength) { + + this(mountainWidth, mountainStrength, 90f); + } + + public TerrainAPLSmokyMountains(float mountainWidth, float mountainStrength, float height) { + + width = mountainWidth; + strength = mountainStrength; + terrainHeight = height; + MountainsWithPassesEffect mountainEffect = new MountainsWithPassesEffect(); + mountainEffect.mountainHeight = strength; + mountainEffect.mountainWavelength = width; + mountainEffect.spikeHeight = this.spikeHeight; + mountainEffect.spikeWavelength = this.spikeWidth; + + + heightEffect = new JitterEffect(7f, 10f, mountainEffect); + heightEffect = new JitterEffect(3f, 6f, heightEffect); + + } + + @Override + public float generateNoise(OpenSimplexNoise simplex, CellNoise cell, int x, int y, float border, float river) { + + return riverized(heightEffect.added(simplex, cell, x, y) + terrainHeight, river); + } +} diff --git a/src/main/java/appalachia/util/BiomeUtils.java b/src/main/java/appalachia/util/BiomeUtils.java index 8bf99fcb..0a455b37 100644 --- a/src/main/java/appalachia/util/BiomeUtils.java +++ b/src/main/java/appalachia/util/BiomeUtils.java @@ -2,7 +2,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.biome.Biome; - import static net.minecraft.world.biome.Biome.REGISTRY; public class BiomeUtils { @@ -17,26 +16,32 @@ public class BiomeUtils { } public static Biome[] getRegisteredBiomes() { + return registeredBiomes; } public static int biomeIds() { + return 256; } public static ResourceLocation getLocForBiome(Biome biome) { + return REGISTRY.getNameForObject(biome); } public static Biome getBiomeForLoc(ResourceLocation location) { + return REGISTRY.getObject(location); } public static int getId(Biome biome) { + return Biome.getIdForBiome(biome); } public static String getName(Biome biome) { + return biome.getBiomeName(); } } diff --git a/src/main/java/appalachia/util/Logger.java b/src/main/java/appalachia/util/Logger.java index c0f20d66..fabb7a58 100644 --- a/src/main/java/appalachia/util/Logger.java +++ b/src/main/java/appalachia/util/Logger.java @@ -5,7 +5,7 @@ import net.minecraftforge.fml.common.FMLLog; -import appalachia.config.appalachia.ConfigAppalachia; +import appalachia.config.ConfigAppalachia; import org.apache.logging.log4j.Level; diff --git a/src/main/java/appalachia/util/RandomUtil.java b/src/main/java/appalachia/util/RandomUtil.java index 23b68231..7b8ad2e3 100644 --- a/src/main/java/appalachia/util/RandomUtil.java +++ b/src/main/java/appalachia/util/RandomUtil.java @@ -2,15 +2,15 @@ import java.util.Random; -public class RandomUtil -{ - public static int getRandomInt(int intStart, int intEnd) - { - return (int)( (Math.random() * intEnd) + intStart ); +public class RandomUtil { + + public static int getRandomInt(int intStart, int intEnd) { + + return (int)((Math.random() * intEnd) + intStart); } - - public static int getRandomInt(Random rand, int intStart, int intEnd) - { + + public static int getRandomInt(Random rand, int intStart, int intEnd) { + return intStart + rand.nextInt(intEnd - intStart + 1); } } \ No newline at end of file diff --git a/src/main/java/appalachia/world/.gitkeep b/src/main/java/appalachia/world/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/src/main/java/appalachia/world/AppalachiaWorldGenerator.java b/src/main/java/appalachia/world/AppalachiaWorldGenerator.java new file mode 100644 index 00000000..b10044f0 --- /dev/null +++ b/src/main/java/appalachia/world/AppalachiaWorldGenerator.java @@ -0,0 +1,30 @@ +package appalachia.world; + +import java.util.Random; + +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkGenerator; +import net.minecraft.world.chunk.IChunkProvider; + +import net.minecraftforge.fml.common.IWorldGenerator; + + +public class AppalachiaWorldGenerator implements IWorldGenerator { + + @Override + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { + + switch (world.provider.getDimension()) { + case 0: + generateSurface(world, random, chunkX * 16, chunkZ * 16); + break; + + default: + break; + } + } + + public void generateSurface(World world, Random random, int chunkX, int chunkZ) { + + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/fence_autumn_grey.json b/src/main/resources/assets/appalachia/blockstates/fence_autumn_grey.json new file mode 100644 index 00000000..b8c48216 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/fence_autumn_grey.json @@ -0,0 +1,17 @@ +{ + "multipart": [ + { "apply": { "model": "appalachia:fence_autumn_grey_post" }}, + { "when": { "north": "true" }, + "apply": { "model": "appalachia:fence_autumn_grey_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "appalachia:fence_autumn_grey_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "appalachia:fence_autumn_grey_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "appalachia:fence_autumn_grey_side", "y": 270, "uvlock": true } + } + ] +} diff --git a/src/main/resources/assets/appalachia/blockstates/fence_blueridge_01.json b/src/main/resources/assets/appalachia/blockstates/fence_blueridge_01.json new file mode 100644 index 00000000..f7efc0c6 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/fence_blueridge_01.json @@ -0,0 +1,17 @@ +{ + "multipart": [ + { "apply": { "model": "appalachia:fence_blueridge_01_post" }}, + { "when": { "north": "true" }, + "apply": { "model": "appalachia:fence_blueridge_01_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "appalachia:fence_blueridge_01_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "appalachia:fence_blueridge_01_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "appalachia:fence_blueridge_01_side", "y": 270, "uvlock": true } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/fence_blueridge_02.json b/src/main/resources/assets/appalachia/blockstates/fence_blueridge_02.json new file mode 100644 index 00000000..6da447ac --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/fence_blueridge_02.json @@ -0,0 +1,17 @@ +{ + "multipart": [ + { "apply": { "model": "appalachia:fence_blueridge_02_post" }}, + { "when": { "north": "true" }, + "apply": { "model": "appalachia:fence_blueridge_02_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "appalachia:fence_blueridge_02_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "appalachia:fence_blueridge_02_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "appalachia:fence_blueridge_02_side", "y": 270, "uvlock": true } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/fence_blueridge_03.json b/src/main/resources/assets/appalachia/blockstates/fence_blueridge_03.json new file mode 100644 index 00000000..6f3cec46 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/fence_blueridge_03.json @@ -0,0 +1,17 @@ +{ + "multipart": [ + { "apply": { "model": "appalachia:fence_blueridge_03_post" }}, + { "when": { "north": "true" }, + "apply": { "model": "appalachia:fence_blueridge_03_side", "uvlock": true } + }, + { "when": { "east": "true" }, + "apply": { "model": "appalachia:fence_blueridge_03_side", "y": 90, "uvlock": true } + }, + { "when": { "south": "true" }, + "apply": { "model": "appalachia:fence_blueridge_03_side", "y": 180, "uvlock": true } + }, + { "when": { "west": "true" }, + "apply": { "model": "appalachia:fence_blueridge_03_side", "y": 270, "uvlock": true } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/fence_gate_autumn_grey.json b/src/main/resources/assets/appalachia/blockstates/fence_gate_autumn_grey.json new file mode 100644 index 00000000..09537768 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/fence_gate_autumn_grey.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,in_wall=false,open=false": { "model": "appalachia:fence_gate_autumn_grey_closed" }, + "facing=west,in_wall=false,open=false": { "model": "appalachia:fence_gate_autumn_grey_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=false": { "model": "appalachia:fence_gate_autumn_grey_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=false": { "model": "appalachia:fence_gate_autumn_grey_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=false,open=true": { "model": "appalachia:fence_gate_autumn_grey_open" }, + "facing=west,in_wall=false,open=true": { "model": "appalachia:fence_gate_autumn_grey_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=true": { "model": "appalachia:fence_gate_autumn_grey_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=true": { "model": "appalachia:fence_gate_autumn_grey_open", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=false": { "model": "appalachia:fence_gate_autumn_grey_wall_closed" }, + "facing=west,in_wall=true,open=false": { "model": "appalachia:fence_gate_autumn_grey_wall_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=false": { "model": "appalachia:fence_gate_autumn_grey_wall_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=false": { "model": "appalachia:fence_gate_autumn_grey_wall_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=true": { "model": "appalachia:fence_gate_autumn_grey_wall_open" }, + "facing=west,in_wall=true,open=true": { "model": "appalachia:fence_gate_autumn_grey_wall_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=true": { "model": "appalachia:fence_gate_autumn_grey_wall_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=true": { "model": "appalachia:fence_gate_autumn_grey_wall_open", "y": 270, "uvlock": true } + } +} diff --git a/src/main/resources/assets/appalachia/blockstates/fence_gate_blueridge_01.json b/src/main/resources/assets/appalachia/blockstates/fence_gate_blueridge_01.json new file mode 100644 index 00000000..f8ef4cd0 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/fence_gate_blueridge_01.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_01_closed" }, + "facing=west,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_01_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_01_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_01_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_01_open" }, + "facing=west,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_01_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_01_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_01_open", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_01_wall_closed" }, + "facing=west,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_01_wall_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_01_wall_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_01_wall_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_01_wall_open" }, + "facing=west,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_01_wall_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_01_wall_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_01_wall_open", "y": 270, "uvlock": true } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/fence_gate_blueridge_02.json b/src/main/resources/assets/appalachia/blockstates/fence_gate_blueridge_02.json new file mode 100644 index 00000000..b6571dcb --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/fence_gate_blueridge_02.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_02_closed" }, + "facing=west,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_02_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_02_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_02_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_02_open" }, + "facing=west,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_02_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_02_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_02_open", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_02_wall_closed" }, + "facing=west,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_02_wall_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_02_wall_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_02_wall_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_02_wall_open" }, + "facing=west,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_02_wall_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_02_wall_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_02_wall_open", "y": 270, "uvlock": true } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/fence_gate_blueridge_03.json b/src/main/resources/assets/appalachia/blockstates/fence_gate_blueridge_03.json new file mode 100644 index 00000000..7b8a704d --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/fence_gate_blueridge_03.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=south,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_03_closed" }, + "facing=west,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_03_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_03_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=false": { "model": "appalachia:fence_gate_blueridge_03_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_03_open" }, + "facing=west,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_03_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_03_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=false,open=true": { "model": "appalachia:fence_gate_blueridge_03_open", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_03_wall_closed" }, + "facing=west,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_03_wall_closed", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_03_wall_closed", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=false": { "model": "appalachia:fence_gate_blueridge_03_wall_closed", "y": 270, "uvlock": true }, + "facing=south,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_03_wall_open" }, + "facing=west,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_03_wall_open", "y": 90, "uvlock": true }, + "facing=north,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_03_wall_open", "y": 180, "uvlock": true }, + "facing=east,in_wall=true,open=true": { "model": "appalachia:fence_gate_blueridge_03_wall_open", "y": 270, "uvlock": true } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/leaves_autumn_orange.json b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_orange.json new file mode 100644 index 00000000..48250a08 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_orange.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "appalachia:leaves_autumn_orange" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/leaves_autumn_orange_fallen.json b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_orange_fallen.json new file mode 100644 index 00000000..6cfd6249 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_orange_fallen.json @@ -0,0 +1,12 @@ +{ + "variants": { + "layers=1": { "model": "appalachia:leaves_autumn_orange_height2" }, + "layers=2": { "model": "appalachia:leaves_autumn_orange_height4" }, + "layers=3": { "model": "appalachia:leaves_autumn_orange_height6" }, + "layers=4": { "model": "appalachia:leaves_autumn_orange_height8" }, + "layers=5": { "model": "appalachia:leaves_autumn_orange_height10" }, + "layers=6": { "model": "appalachia:leaves_autumn_orange_height12" }, + "layers=7": { "model": "appalachia:leaves_autumn_orange_height14" }, + "layers=8": { "model": "appalachia:leaves_autumn_orange" } + } +} diff --git a/src/main/resources/assets/appalachia/blockstates/leaves_autumn_red.json b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_red.json new file mode 100644 index 00000000..16bf0e8e --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_red.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "appalachia:leaves_autumn_red" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/leaves_autumn_red_fallen.json b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_red_fallen.json new file mode 100644 index 00000000..c513840b --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_red_fallen.json @@ -0,0 +1,12 @@ +{ + "variants": { + "layers=1": { "model": "appalachia:leaves_autumn_red_height2" }, + "layers=2": { "model": "appalachia:leaves_autumn_red_height4" }, + "layers=3": { "model": "appalachia:leaves_autumn_red_height6" }, + "layers=4": { "model": "appalachia:leaves_autumn_red_height8" }, + "layers=5": { "model": "appalachia:leaves_autumn_red_height10" }, + "layers=6": { "model": "appalachia:leaves_autumn_red_height12" }, + "layers=7": { "model": "appalachia:leaves_autumn_red_height14" }, + "layers=8": { "model": "appalachia:leaves_autumn_red" } + } +} diff --git a/src/main/resources/assets/appalachia/blockstates/leaves_autumn_yellow.json b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_yellow.json new file mode 100644 index 00000000..9c1292a5 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_yellow.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "appalachia:leaves_autumn_yellow" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/leaves_autumn_yellow_fallen.json b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_yellow_fallen.json new file mode 100644 index 00000000..6c896bc6 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/leaves_autumn_yellow_fallen.json @@ -0,0 +1,12 @@ +{ + "variants": { + "layers=1": { "model": "appalachia:leaves_autumn_yellow_height2" }, + "layers=2": { "model": "appalachia:leaves_autumn_yellow_height4" }, + "layers=3": { "model": "appalachia:leaves_autumn_yellow_height6" }, + "layers=4": { "model": "appalachia:leaves_autumn_yellow_height8" }, + "layers=5": { "model": "appalachia:leaves_autumn_yellow_height10" }, + "layers=6": { "model": "appalachia:leaves_autumn_yellow_height12" }, + "layers=7": { "model": "appalachia:leaves_autumn_yellow_height14" }, + "layers=8": { "model": "appalachia:leaves_autumn_yellow" } + } +} diff --git a/src/main/resources/assets/appalachia/blockstates/leaves_oak_fallen.json b/src/main/resources/assets/appalachia/blockstates/leaves_oak_fallen.json new file mode 100644 index 00000000..3aa8bf24 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/leaves_oak_fallen.json @@ -0,0 +1,12 @@ +{ + "variants": { + "layers=1": { "model": "appalachia:leaves_oak_height2" }, + "layers=2": { "model": "appalachia:leaves_oak_height4" }, + "layers=3": { "model": "appalachia:leaves_oak_height6" }, + "layers=4": { "model": "appalachia:leaves_oak_height8" }, + "layers=5": { "model": "appalachia:leaves_oak_height10" }, + "layers=6": { "model": "appalachia:leaves_oak_height12" }, + "layers=7": { "model": "appalachia:leaves_oak_height14" }, + "layers=8": { "model": "oak_leaves" } + } +} diff --git a/src/main/resources/assets/appalachia/blockstates/log_autumn_grey.json b/src/main/resources/assets/appalachia/blockstates/log_autumn_grey.json new file mode 100644 index 00000000..195fd7cb --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/log_autumn_grey.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "appalachia:log_autumn_grey" }, + "axis=z": { "model": "appalachia:log_autumn_grey", "x": 90 }, + "axis=x": { "model": "appalachia:log_autumn_grey", "x": 90, "y": 90 }, + "axis=none": { "model": "appalachia:log_autumn_grey_bark" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/log_blueridge_01.json b/src/main/resources/assets/appalachia/blockstates/log_blueridge_01.json new file mode 100644 index 00000000..2cfa1a68 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/log_blueridge_01.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "appalachia:log_blueridge_01" }, + "axis=z": { "model": "appalachia:log_blueridge_01", "x": 90 }, + "axis=x": { "model": "appalachia:log_blueridge_01", "x": 90, "y": 90 }, + "axis=none": { "model": "appalachia:log_blueridge_01_bark" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/log_blueridge_02.json b/src/main/resources/assets/appalachia/blockstates/log_blueridge_02.json new file mode 100644 index 00000000..982266d6 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/log_blueridge_02.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "appalachia:log_blueridge_02" }, + "axis=z": { "model": "appalachia:log_blueridge_02", "x": 90 }, + "axis=x": { "model": "appalachia:log_blueridge_02", "x": 90, "y": 90 }, + "axis=none": { "model": "appalachia:log_blueridge_02_bark" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/log_blueridge_03.json b/src/main/resources/assets/appalachia/blockstates/log_blueridge_03.json new file mode 100644 index 00000000..2b8e3dd4 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/log_blueridge_03.json @@ -0,0 +1,8 @@ +{ + "variants": { + "axis=y": { "model": "appalachia:log_blueridge_03" }, + "axis=z": { "model": "appalachia:log_blueridge_03", "x": 90 }, + "axis=x": { "model": "appalachia:log_blueridge_03", "x": 90, "y": 90 }, + "axis=none": { "model": "appalachia:log_blueridge_03_bark" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/planks_autumn_grey.json b/src/main/resources/assets/appalachia/blockstates/planks_autumn_grey.json new file mode 100644 index 00000000..44949941 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/planks_autumn_grey.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "appalachia:planks_autumn_grey" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/planks_blueridge_01.json b/src/main/resources/assets/appalachia/blockstates/planks_blueridge_01.json new file mode 100644 index 00000000..cdf0826d --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/planks_blueridge_01.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "appalachia:planks_blueridge_01" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/planks_blueridge_02.json b/src/main/resources/assets/appalachia/blockstates/planks_blueridge_02.json new file mode 100644 index 00000000..a63295a8 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/planks_blueridge_02.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "appalachia:planks_blueridge_02" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/planks_blueridge_03.json b/src/main/resources/assets/appalachia/blockstates/planks_blueridge_03.json new file mode 100644 index 00000000..b169fafc --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/planks_blueridge_03.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "appalachia:planks_blueridge_03" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/sapling_quercus_robur.json b/src/main/resources/assets/appalachia/blockstates/sapling_quercus_robur.json new file mode 100644 index 00000000..5ba5972f --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/sapling_quercus_robur.json @@ -0,0 +1,5 @@ +{ + "variants": { + "normal": { "model": "appalachia:sapling_quercus_robur" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/slab_autumn_grey.json b/src/main/resources/assets/appalachia/blockstates/slab_autumn_grey.json new file mode 100644 index 00000000..d5dfd6a9 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/slab_autumn_grey.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "appalachia:slab_autumn_grey" }, + "half=top": { "model": "appalachia:slab_autumn_grey_upper" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/slab_blueridge_01.json b/src/main/resources/assets/appalachia/blockstates/slab_blueridge_01.json new file mode 100644 index 00000000..348c190c --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/slab_blueridge_01.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "appalachia:slab_blueridge_01" }, + "half=top": { "model": "appalachia:slab_blueridge_01_upper" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/slab_blueridge_02.json b/src/main/resources/assets/appalachia/blockstates/slab_blueridge_02.json new file mode 100644 index 00000000..2c065961 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/slab_blueridge_02.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "appalachia:slab_blueridge_02" }, + "half=top": { "model": "appalachia:slab_blueridge_02_upper" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/slab_blueridge_03.json b/src/main/resources/assets/appalachia/blockstates/slab_blueridge_03.json new file mode 100644 index 00000000..6411c0b3 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/slab_blueridge_03.json @@ -0,0 +1,6 @@ +{ + "variants": { + "half=bottom": { "model": "appalachia:slab_blueridge_03" }, + "half=top": { "model": "appalachia:slab_blueridge_03_upper" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/stairs_autumn_grey.json b/src/main/resources/assets/appalachia/blockstates/stairs_autumn_grey.json new file mode 100644 index 00000000..592f2b33 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/stairs_autumn_grey.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "appalachia:stairs_autumn_grey" }, + "facing=west,half=bottom,shape=straight": { "model": "appalachia:stairs_autumn_grey", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "appalachia:stairs_autumn_grey", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "appalachia:stairs_autumn_grey", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "appalachia:stairs_autumn_grey_outer" }, + "facing=west,half=bottom,shape=outer_right": { "model": "appalachia:stairs_autumn_grey_outer", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "appalachia:stairs_autumn_grey_outer", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "appalachia:stairs_autumn_grey_outer", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "appalachia:stairs_autumn_grey_outer", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "appalachia:stairs_autumn_grey_outer", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "appalachia:stairs_autumn_grey_outer" }, + "facing=north,half=bottom,shape=outer_left": { "model": "appalachia:stairs_autumn_grey_outer", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "appalachia:stairs_autumn_grey_inner" }, + "facing=west,half=bottom,shape=inner_right": { "model": "appalachia:stairs_autumn_grey_inner", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "appalachia:stairs_autumn_grey_inner", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "appalachia:stairs_autumn_grey_inner", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "appalachia:stairs_autumn_grey_inner", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "appalachia:stairs_autumn_grey_inner", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "appalachia:stairs_autumn_grey_inner" }, + "facing=north,half=bottom,shape=inner_left": { "model": "appalachia:stairs_autumn_grey_inner", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "appalachia:stairs_autumn_grey", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "appalachia:stairs_autumn_grey", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "appalachia:stairs_autumn_grey", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "appalachia:stairs_autumn_grey", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "appalachia:stairs_autumn_grey_outer", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "appalachia:stairs_autumn_grey_outer", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "appalachia:stairs_autumn_grey_outer", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "appalachia:stairs_autumn_grey_outer", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "appalachia:stairs_autumn_grey_outer", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "appalachia:stairs_autumn_grey_outer", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "appalachia:stairs_autumn_grey_outer", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "appalachia:stairs_autumn_grey_outer", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "appalachia:stairs_autumn_grey_inner", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "appalachia:stairs_autumn_grey_inner", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "appalachia:stairs_autumn_grey_inner", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "appalachia:stairs_autumn_grey_inner", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "appalachia:stairs_autumn_grey_inner", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "appalachia:stairs_autumn_grey_inner", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "appalachia:stairs_autumn_grey_inner", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "appalachia:stairs_autumn_grey_inner", "x": 180, "uvlock": true } + } +} diff --git a/src/main/resources/assets/appalachia/blockstates/stairs_blueridge_01.json b/src/main/resources/assets/appalachia/blockstates/stairs_blueridge_01.json new file mode 100644 index 00000000..0d31a478 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/stairs_blueridge_01.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_01" }, + "facing=west,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_01", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_01", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_01", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_01_outer" }, + "facing=west,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_01_outer", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_01_outer", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_01_outer", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_01_outer", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_01_outer", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_01_outer" }, + "facing=north,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_01_outer", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_01_inner" }, + "facing=west,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_01_inner", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_01_inner", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_01_inner", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_01_inner", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_01_inner", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_01_inner" }, + "facing=north,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_01_inner", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_01", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_01", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_01", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_01", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_01_outer", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_01_outer", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_01_outer", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_01_outer", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_01_outer", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_01_outer", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_01_outer", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_01_outer", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_01_inner", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_01_inner", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_01_inner", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_01_inner", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_01_inner", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_01_inner", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_01_inner", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_01_inner", "x": 180, "uvlock": true } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/stairs_blueridge_02.json b/src/main/resources/assets/appalachia/blockstates/stairs_blueridge_02.json new file mode 100644 index 00000000..d51b8b79 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/stairs_blueridge_02.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_02" }, + "facing=west,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_02", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_02", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_02", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_02_outer" }, + "facing=west,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_02_outer", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_02_outer", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_02_outer", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_02_outer", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_02_outer", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_02_outer" }, + "facing=north,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_02_outer", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_02_inner" }, + "facing=west,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_02_inner", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_02_inner", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_02_inner", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_02_inner", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_02_inner", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_02_inner" }, + "facing=north,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_02_inner", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_02", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_02", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_02", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_02", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_02_outer", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_02_outer", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_02_outer", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_02_outer", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_02_outer", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_02_outer", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_02_outer", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_02_outer", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_02_inner", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_02_inner", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_02_inner", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_02_inner", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_02_inner", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_02_inner", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_02_inner", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_02_inner", "x": 180, "uvlock": true } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/blockstates/stairs_blueridge_03.json b/src/main/resources/assets/appalachia/blockstates/stairs_blueridge_03.json new file mode 100644 index 00000000..14aac3b8 --- /dev/null +++ b/src/main/resources/assets/appalachia/blockstates/stairs_blueridge_03.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_03" }, + "facing=west,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_03", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_03", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=straight": { "model": "appalachia:stairs_blueridge_03", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_03_outer" }, + "facing=west,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_03_outer", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_03_outer", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=outer_right": { "model": "appalachia:stairs_blueridge_03_outer", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_03_outer", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_03_outer", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_03_outer" }, + "facing=north,half=bottom,shape=outer_left": { "model": "appalachia:stairs_blueridge_03_outer", "y": 180, "uvlock": true }, + "facing=east,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_03_inner" }, + "facing=west,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_03_inner", "y": 180, "uvlock": true }, + "facing=south,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_03_inner", "y": 90, "uvlock": true }, + "facing=north,half=bottom,shape=inner_right": { "model": "appalachia:stairs_blueridge_03_inner", "y": 270, "uvlock": true }, + "facing=east,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_03_inner", "y": 270, "uvlock": true }, + "facing=west,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_03_inner", "y": 90, "uvlock": true }, + "facing=south,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_03_inner" }, + "facing=north,half=bottom,shape=inner_left": { "model": "appalachia:stairs_blueridge_03_inner", "y": 180, "uvlock": true }, + "facing=east,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_03", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_03", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_03", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=straight": { "model": "appalachia:stairs_blueridge_03", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_03_outer", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_03_outer", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_03_outer", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=outer_right": { "model": "appalachia:stairs_blueridge_03_outer", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_03_outer", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_03_outer", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_03_outer", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=outer_left": { "model": "appalachia:stairs_blueridge_03_outer", "x": 180, "uvlock": true }, + "facing=east,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_03_inner", "x": 180, "uvlock": true }, + "facing=west,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_03_inner", "x": 180, "y": 180, "uvlock": true }, + "facing=south,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_03_inner", "x": 180, "y": 90, "uvlock": true }, + "facing=north,half=top,shape=inner_right": { "model": "appalachia:stairs_blueridge_03_inner", "x": 180, "y": 270, "uvlock": true }, + "facing=east,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_03_inner", "x": 180, "y": 90, "uvlock": true }, + "facing=west,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_03_inner", "x": 180, "y": 270, "uvlock": true }, + "facing=south,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_03_inner", "x": 180, "y": 180, "uvlock": true }, + "facing=north,half=top,shape=inner_left": { "model": "appalachia:stairs_blueridge_03_inner", "x": 180, "uvlock": true } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/lang/en_US.lang b/src/main/resources/assets/appalachia/lang/en_US.lang index e69de29b..8a009590 100644 --- a/src/main/resources/assets/appalachia/lang/en_US.lang +++ b/src/main/resources/assets/appalachia/lang/en_US.lang @@ -0,0 +1,68 @@ +#Creative Tabs + +itemGroup.appalachiablocks=Appalachia Blocks +itemGroup.appalachiadecorations=Appalachia Decorations + +#Mobs +entity.appalachia.BlackBear.name=Black Bear +entity.BlackBear.name=Black Bear +subtitles.entity.black_bear.idle1=Black Bear groans +subtitles.entity.black_bear.idle2=Black Bear groans +subtitles.entity.black_bear.idle3=Black Bear groans +subtitles.entity.black_bear.idle4=Black Bear groans +subtitles.entity.black_bear.baby_idle1=Black Bear hums +subtitles.entity.black_bear.baby_idle2=Black Bear hums +subtitles.entity.black_bear.baby_idle3=Black Bear hums +subtitles.entity.black_bear.baby_idle4=Black Bear hums +subtitles.entity.black_bear.hurt1=Black Bear hurts +subtitles.entity.black_bear.hurt2=Black Bear hurts +subtitles.entity.black_bear.hurt3=Black Bear hurts +subtitles.entity.black_bear.hurt4=Black Bear hurts +subtitles.entity.black_bear.warning1=Black Bear roars +subtitles.entity.black_bear.warning2=Black Bear roars +subtitles.entity.black_bear.warning3=Black Bear roars +subtitles.entity.black_bear.death1=Black Bear dies +subtitles.entity.black_bear.death2=Black Bear dies +subtitles.entity.black_bear.death3=Black Bear dies + +#Blocks + +tile.log.autumn.grey.name=Grey Autumn Log +tile.planks.autumn.grey.name=Grey Autumn Planks +tile.slab.autumn.grey.name=Grey Autumn Slab +tile.stairs.autumn.grey.name=Grey Autumn Stairs +tile.fence.autumn.grey.name=Grey Autumn Fence +tile.fence.gate.autumn.grey.name=Grey Autumn Fence Gate + +tile.leaves.oak.fallen.name=Oak Fallen Leaves + +tile.leaves.autumn.red.name=Red Autumn Leaves +tile.leaves.autumn.red.fallen.name=Red Autumn Fallen Leaves +tile.leaves.autumn.orange.name=Orange Autumn Leaves +tile.leaves.autumn.orange.fallen.name=Orange Autumn Fallen Leaves +tile.leaves.autumn.yellow.name=Yellow Autumn Leaves +tile.leaves.autumn.yellow.fallen.name=Yellow Autumn Fallen Leaves + +tile.sapling.quercus.robur.name=Quercus Robur Sapling + + +tile.log.blueridge.01.name=Blue Ridge Log (01) +tile.planks.blueridge.01.name=Blue Ridge Planks (01) +tile.slab.blueridge.01.name=Blue Ridge Slab (01) +tile.stairs.blueridge.01.name=Blue Ridge Stairs (01) +tile.fence.blueridge.01.name=Blue Ridge Fence (01) +tile.fence.gate.blueridge.01.name=Blue Ridge Fence Gate (01) + +tile.log.blueridge.02.name=Blue Ridge Log (02) +tile.planks.blueridge.02.name=Blue Ridge Planks (02) +tile.slab.blueridge.02.name=Blue Ridge Slab (02) +tile.stairs.blueridge.02.name=Blue Ridge Stairs (02) +tile.fence.blueridge.02.name=Blue Ridge Fence (02) +tile.fence.gate.blueridge.02.name=Blue Ridge Fence Gate (02) + +tile.log.blueridge.03.name=Blue Ridge Log (03) +tile.planks.blueridge.03.name=Blue Ridge Planks (03) +tile.slab.blueridge.03.name=Blue Ridge Slab (03) +tile.stairs.blueridge.03.name=Blue Ridge Stairs (03) +tile.fence.blueridge.03.name=Blue Ridge Fence (03) +tile.fence.gate.blueridge.03.name=Blue Ridge Fence Gate (03) diff --git a/src/main/resources/assets/appalachia/logo.png b/src/main/resources/assets/appalachia/logo.png index 377fb302..aacc0377 100644 Binary files a/src/main/resources/assets/appalachia/logo.png and b/src/main/resources/assets/appalachia/logo.png differ diff --git a/src/main/resources/assets/appalachia/models/block/fence_autumn_grey.json b/src/main/resources/assets/appalachia/models/block/fence_autumn_grey.json new file mode 100644 index 00000000..8e1f6b47 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_autumn_grey.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/fence_autumn_grey_inventory.json b/src/main/resources/assets/appalachia/models/block/fence_autumn_grey_inventory.json new file mode 100644 index 00000000..8e1f6b47 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_autumn_grey_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/fence_autumn_grey_post.json b/src/main/resources/assets/appalachia/models/block/fence_autumn_grey_post.json new file mode 100644 index 00000000..c1eea8f4 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_autumn_grey_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/fence_autumn_grey_side.json b/src/main/resources/assets/appalachia/models/block/fence_autumn_grey_side.json new file mode 100644 index 00000000..bf22f8b1 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_autumn_grey_side.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_side", + "textures": { + "texture": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_01.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_01.json new file mode 100644 index 00000000..27cf9d4d --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_01.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_01_inventory.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_01_inventory.json new file mode 100644 index 00000000..27cf9d4d --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_01_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_01_post.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_01_post.json new file mode 100644 index 00000000..dfc805c8 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_01_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_01_side.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_01_side.json new file mode 100644 index 00000000..94104526 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_01_side.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_side", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_02.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_02.json new file mode 100644 index 00000000..be94bad5 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_02.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_02_inventory.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_02_inventory.json new file mode 100644 index 00000000..be94bad5 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_02_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_02_post.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_02_post.json new file mode 100644 index 00000000..da397885 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_02_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_02_side.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_02_side.json new file mode 100644 index 00000000..2eb58a26 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_02_side.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_side", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_03.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_03.json new file mode 100644 index 00000000..7d6f7494 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_03.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_03_inventory.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_03_inventory.json new file mode 100644 index 00000000..7d6f7494 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_03_inventory.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_inventory", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_03_post.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_03_post.json new file mode 100644 index 00000000..ef1a8a8c --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_03_post.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_post", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_blueridge_03_side.json b/src/main/resources/assets/appalachia/models/block/fence_blueridge_03_side.json new file mode 100644 index 00000000..93838d72 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_blueridge_03_side.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_side", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_closed.json b/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_closed.json new file mode 100644 index 00000000..e155386e --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_closed", + "textures": { + "texture": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_open.json b/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_open.json new file mode 100644 index 00000000..f49ddc17 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_open", + "textures": { + "texture": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_wall_closed.json b/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_wall_closed.json new file mode 100644 index 00000000..9398b36e --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_wall_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_closed", + "textures": { + "texture": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_wall_open.json b/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_wall_open.json new file mode 100644 index 00000000..96a32971 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_autumn_grey_wall_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_open", + "textures": { + "texture": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_closed.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_closed.json new file mode 100644 index 00000000..75c18f4a --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_closed", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_open.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_open.json new file mode 100644 index 00000000..c57cb4f0 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_open", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_wall_closed.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_wall_closed.json new file mode 100644 index 00000000..1a10fd29 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_wall_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_closed", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_wall_open.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_wall_open.json new file mode 100644 index 00000000..6c8dd9fb --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_01_wall_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_open", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_closed.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_closed.json new file mode 100644 index 00000000..3f506e31 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_closed", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_open.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_open.json new file mode 100644 index 00000000..f49c8f6c --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_open", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_wall_closed.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_wall_closed.json new file mode 100644 index 00000000..61ed205e --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_wall_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_closed", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_wall_open.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_wall_open.json new file mode 100644 index 00000000..11db1928 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_02_wall_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_open", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_closed.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_closed.json new file mode 100644 index 00000000..1bccc434 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_closed", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_open.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_open.json new file mode 100644 index 00000000..ea412c13 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/fence_gate_open", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_wall_closed.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_wall_closed.json new file mode 100644 index 00000000..f493b35a --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_wall_closed.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_closed", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_wall_open.json b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_wall_open.json new file mode 100644 index 00000000..02b78e75 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/fence_gate_blueridge_03_wall_open.json @@ -0,0 +1,6 @@ +{ + "parent": "block/wall_gate_open", + "textures": { + "texture": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange.json new file mode 100644 index 00000000..24df3183 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange.json @@ -0,0 +1,6 @@ +{ + "parent": "block/leaves", + "textures": { + "all": "appalachia:blocks/leaves_autumn_orange" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height10.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height10.json new file mode 100644 index 00000000..cfb47165 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height10.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_orange", + "texture": "appalachia:blocks/leaves_autumn_orange" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 10, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height12.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height12.json new file mode 100644 index 00000000..55b60644 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height12.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_orange", + "texture": "appalachia:blocks/leaves_autumn_orange" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 12, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height14.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height14.json new file mode 100644 index 00000000..58170e80 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height14.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_orange", + "texture": "appalachia:blocks/leaves_autumn_orange" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 14, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "south": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "west": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "east": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height2.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height2.json new file mode 100644 index 00000000..33ab6276 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height2.json @@ -0,0 +1,20 @@ +{ + "parent": "block/thin_block", + "textures": { + "particle": "appalachia:blocks/leaves_autumn_orange", + "texture": "appalachia:blocks/leaves_autumn_orange" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height4.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height4.json new file mode 100644 index 00000000..e6b4c540 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height4.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_orange", + "texture": "appalachia:blocks/leaves_autumn_orange" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 4, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height6.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height6.json new file mode 100644 index 00000000..e4ba2aca --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height6.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_orange", + "texture": "appalachia:blocks/leaves_autumn_orange" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 6, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height8.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height8.json new file mode 100644 index 00000000..c3e3f223 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_orange_height8.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_orange", + "texture": "appalachia:blocks/leaves_autumn_orange" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_red.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red.json new file mode 100644 index 00000000..0991d85b --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red.json @@ -0,0 +1,6 @@ +{ + "parent": "block/leaves", + "textures": { + "all": "appalachia:blocks/leaves_autumn_red" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height10.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height10.json new file mode 100644 index 00000000..2bc33be8 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height10.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_red", + "texture": "appalachia:blocks/leaves_autumn_red" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 10, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height12.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height12.json new file mode 100644 index 00000000..2fd3ac6a --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height12.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_red", + "texture": "appalachia:blocks/leaves_autumn_red" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 12, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height14.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height14.json new file mode 100644 index 00000000..a5844842 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height14.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_red", + "texture": "appalachia:blocks/leaves_autumn_red" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 14, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "south": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "west": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "east": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height2.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height2.json new file mode 100644 index 00000000..8f00ef06 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height2.json @@ -0,0 +1,20 @@ +{ + "parent": "block/thin_block", + "textures": { + "particle": "appalachia:blocks/leaves_autumn_red", + "texture": "appalachia:blocks/leaves_autumn_red" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height4.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height4.json new file mode 100644 index 00000000..0750cc1d --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height4.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_red", + "texture": "appalachia:blocks/leaves_autumn_red" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 4, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height6.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height6.json new file mode 100644 index 00000000..d71dcaa8 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height6.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_red", + "texture": "appalachia:blocks/leaves_autumn_red" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 6, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height8.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height8.json new file mode 100644 index 00000000..e10ac9c0 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_red_height8.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_red", + "texture": "appalachia:blocks/leaves_autumn_red" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow.json new file mode 100644 index 00000000..e1fb371c --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow.json @@ -0,0 +1,6 @@ +{ + "parent": "block/leaves", + "textures": { + "all": "appalachia:blocks/leaves_autumn_yellow" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height10.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height10.json new file mode 100644 index 00000000..a04ae631 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height10.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_yellow", + "texture": "appalachia:blocks/leaves_autumn_yellow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 10, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 6, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height12.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height12.json new file mode 100644 index 00000000..8ef2544f --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height12.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_yellow", + "texture": "appalachia:blocks/leaves_autumn_yellow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 12, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 4, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height14.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height14.json new file mode 100644 index 00000000..72bafbc5 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height14.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_yellow", + "texture": "appalachia:blocks/leaves_autumn_yellow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 14, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "south": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "west": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "east": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height2.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height2.json new file mode 100644 index 00000000..9b970513 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height2.json @@ -0,0 +1,20 @@ +{ + "parent": "block/thin_block", + "textures": { + "particle": "appalachia:blocks/leaves_autumn_yellow", + "texture": "appalachia:blocks/leaves_autumn_yellow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 14, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height4.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height4.json new file mode 100644 index 00000000..0caafe99 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height4.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_yellow", + "texture": "appalachia:blocks/leaves_autumn_yellow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 4, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 12, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height6.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height6.json new file mode 100644 index 00000000..c45dc225 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height6.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_yellow", + "texture": "appalachia:blocks/leaves_autumn_yellow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 6, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 10, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height8.json b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height8.json new file mode 100644 index 00000000..bd3d0bf7 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_autumn_yellow_height8.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "appalachia:blocks/leaves_autumn_yellow", + "texture": "appalachia:blocks/leaves_autumn_yellow" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "cullface": "down", "tintindex": 0 }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture", "tintindex": 0 }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "north", "tintindex": 0 }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "south", "tintindex": 0 }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "west", "tintindex": 0 }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#texture", "cullface": "east", "tintindex": 0 } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_oak_height10.json b/src/main/resources/assets/appalachia/models/block/leaves_oak_height10.json new file mode 100644 index 00000000..8ce6f757 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_oak_height10.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/leaves_oak", + "texture": "blocks/leaves_oak" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 10, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture" }, + "north": { "uv": [ 0, 6, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 6, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 6, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 6, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_oak_height12.json b/src/main/resources/assets/appalachia/models/block/leaves_oak_height12.json new file mode 100644 index 00000000..dc9bb794 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_oak_height12.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/leaves_oak", + "texture": "blocks/leaves_oak" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 12, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture" }, + "north": { "uv": [ 0, 4, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 4, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 4, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 4, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_oak_height14.json b/src/main/resources/assets/appalachia/models/block/leaves_oak_height14.json new file mode 100644 index 00000000..cb4df1cb --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_oak_height14.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/leaves_oak", + "texture": "blocks/leaves_oak" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 14, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture" }, + "north": { "uv": [ 0, 2, 16, 16 ], "tintindex": 0, "texture": "#texture" }, + "south": { "uv": [ 0, 2, 16, 16 ], "tintindex": 0, "texture": "#texture" }, + "west": { "uv": [ 0, 2, 16, 16 ], "tintindex": 0, "texture": "#texture" }, + "east": { "uv": [ 0, 2, 16, 16 ], "tintindex": 0, "texture": "#texture" } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_oak_height2.json b/src/main/resources/assets/appalachia/models/block/leaves_oak_height2.json new file mode 100644 index 00000000..dbe36a8c --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_oak_height2.json @@ -0,0 +1,20 @@ +{ + "parent": "block/thin_block", + "textures": { + "particle": "blocks/leaves_oak", + "texture": "blocks/leaves_oak" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 2, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture" }, + "north": { "uv": [ 0, 14, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 14, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 14, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 14, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_oak_height4.json b/src/main/resources/assets/appalachia/models/block/leaves_oak_height4.json new file mode 100644 index 00000000..621f3ad1 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_oak_height4.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/leaves_oak", + "texture": "blocks/leaves_oak" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 4, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture" }, + "north": { "uv": [ 0, 12, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 12, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 12, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 12, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_oak_height6.json b/src/main/resources/assets/appalachia/models/block/leaves_oak_height6.json new file mode 100644 index 00000000..69b61e93 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_oak_height6.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/leaves_oak", + "texture": "blocks/leaves_oak" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 6, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture" }, + "north": { "uv": [ 0, 10, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 10, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 10, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 10, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/leaves_oak_height8.json b/src/main/resources/assets/appalachia/models/block/leaves_oak_height8.json new file mode 100644 index 00000000..90165e78 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/leaves_oak_height8.json @@ -0,0 +1,19 @@ +{ + "textures": { + "particle": "blocks/leaves_oak", + "texture": "blocks/leaves_oak" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "tintindex": 0, "texture": "#texture" }, + "north": { "uv": [ 0, 8, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "north" }, + "south": { "uv": [ 0, 8, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "south" }, + "west": { "uv": [ 0, 8, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "west" }, + "east": { "uv": [ 0, 8, 16, 16 ], "tintindex": 0, "texture": "#texture", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/appalachia/models/block/log_autumn_grey.json b/src/main/resources/assets/appalachia/models/block/log_autumn_grey.json new file mode 100644 index 00000000..ee7d5690 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/log_autumn_grey.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "appalachia:blocks/log_autumn_grey_top", + "side": "appalachia:blocks/log_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/log_autumn_grey_bark.json b/src/main/resources/assets/appalachia/models/block/log_autumn_grey_bark.json new file mode 100644 index 00000000..3892f929 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/log_autumn_grey_bark.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appalachia:blocks/log_autumn_grey" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/log_blueridge_01.json b/src/main/resources/assets/appalachia/models/block/log_blueridge_01.json new file mode 100644 index 00000000..73498c3f --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/log_blueridge_01.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "appalachia:blocks/log_blueridge_top_01", + "side": "appalachia:blocks/log_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/log_blueridge_01_bark.json b/src/main/resources/assets/appalachia/models/block/log_blueridge_01_bark.json new file mode 100644 index 00000000..05377056 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/log_blueridge_01_bark.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appalachia:blocks/log_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/log_blueridge_02.json b/src/main/resources/assets/appalachia/models/block/log_blueridge_02.json new file mode 100644 index 00000000..ea8a554b --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/log_blueridge_02.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "appalachia:blocks/log_blueridge_top_02", + "side": "appalachia:blocks/log_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/log_blueridge_02_bark.json b/src/main/resources/assets/appalachia/models/block/log_blueridge_02_bark.json new file mode 100644 index 00000000..89649c26 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/log_blueridge_02_bark.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appalachia:blocks/log_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/log_blueridge_03.json b/src/main/resources/assets/appalachia/models/block/log_blueridge_03.json new file mode 100644 index 00000000..6e73a7b6 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/log_blueridge_03.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_column", + "textures": { + "end": "appalachia:blocks/log_blueridge_top_03", + "side": "appalachia:blocks/log_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/log_blueridge_03_bark.json b/src/main/resources/assets/appalachia/models/block/log_blueridge_03_bark.json new file mode 100644 index 00000000..855579f8 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/log_blueridge_03_bark.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appalachia:blocks/log_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/planks_autumn_grey.json b/src/main/resources/assets/appalachia/models/block/planks_autumn_grey.json new file mode 100644 index 00000000..b70c4748 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/planks_autumn_grey.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/planks_blueridge_01.json b/src/main/resources/assets/appalachia/models/block/planks_blueridge_01.json new file mode 100644 index 00000000..acb94666 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/planks_blueridge_01.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/planks_blueridge_02.json b/src/main/resources/assets/appalachia/models/block/planks_blueridge_02.json new file mode 100644 index 00000000..9b586554 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/planks_blueridge_02.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/planks_blueridge_03.json b/src/main/resources/assets/appalachia/models/block/planks_blueridge_03.json new file mode 100644 index 00000000..bc491e6a --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/planks_blueridge_03.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/sapling_quercus_robur.json b/src/main/resources/assets/appalachia/models/block/sapling_quercus_robur.json new file mode 100644 index 00000000..35cfb22a --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/sapling_quercus_robur.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "appalachia:blocks/sapling_quercus_robur" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/slab_autumn_grey.json b/src/main/resources/assets/appalachia/models/block/slab_autumn_grey.json new file mode 100644 index 00000000..6898af55 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/slab_autumn_grey.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "appalachia:blocks/planks_autumn_grey", + "top": "appalachia:blocks/planks_autumn_grey", + "side": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/slab_autumn_grey_upper.json b/src/main/resources/assets/appalachia/models/block/slab_autumn_grey_upper.json new file mode 100644 index 00000000..13a2e9d0 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/slab_autumn_grey_upper.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "appalachia:blocks/planks_autumn_grey", + "top": "appalachia:blocks/planks_autumn_grey", + "side": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/slab_blueridge_01.json b/src/main/resources/assets/appalachia/models/block/slab_blueridge_01.json new file mode 100644 index 00000000..433678ca --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/slab_blueridge_01.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_01", + "top": "appalachia:blocks/planks_blueridge_01", + "side": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/slab_blueridge_01_upper.json b/src/main/resources/assets/appalachia/models/block/slab_blueridge_01_upper.json new file mode 100644 index 00000000..fe659cc9 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/slab_blueridge_01_upper.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_01", + "top": "appalachia:blocks/planks_blueridge_01", + "side": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/slab_blueridge_02.json b/src/main/resources/assets/appalachia/models/block/slab_blueridge_02.json new file mode 100644 index 00000000..7dc46808 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/slab_blueridge_02.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_02", + "top": "appalachia:blocks/planks_blueridge_02", + "side": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/slab_blueridge_02_upper.json b/src/main/resources/assets/appalachia/models/block/slab_blueridge_02_upper.json new file mode 100644 index 00000000..787e1b21 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/slab_blueridge_02_upper.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_02", + "top": "appalachia:blocks/planks_blueridge_02", + "side": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/slab_blueridge_03.json b/src/main/resources/assets/appalachia/models/block/slab_blueridge_03.json new file mode 100644 index 00000000..6eb3d019 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/slab_blueridge_03.json @@ -0,0 +1,8 @@ +{ + "parent": "block/half_slab", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_03", + "top": "appalachia:blocks/planks_blueridge_03", + "side": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/slab_blueridge_03_upper.json b/src/main/resources/assets/appalachia/models/block/slab_blueridge_03_upper.json new file mode 100644 index 00000000..0a535227 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/slab_blueridge_03_upper.json @@ -0,0 +1,8 @@ +{ + "parent": "block/upper_slab", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_03", + "top": "appalachia:blocks/planks_blueridge_03", + "side": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/stairs_autumn_grey.json b/src/main/resources/assets/appalachia/models/block/stairs_autumn_grey.json new file mode 100644 index 00000000..13e57c2e --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_autumn_grey.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "appalachia:blocks/planks_autumn_grey", + "top": "appalachia:blocks/planks_autumn_grey", + "side": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/stairs_autumn_grey_inner.json b/src/main/resources/assets/appalachia/models/block/stairs_autumn_grey_inner.json new file mode 100644 index 00000000..f96d8ee2 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_autumn_grey_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "appalachia:blocks/planks_autumn_grey", + "top": "appalachia:blocks/planks_autumn_grey", + "side": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/stairs_autumn_grey_outer.json b/src/main/resources/assets/appalachia/models/block/stairs_autumn_grey_outer.json new file mode 100644 index 00000000..12625c23 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_autumn_grey_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "appalachia:blocks/planks_autumn_grey", + "top": "appalachia:blocks/planks_autumn_grey", + "side": "appalachia:blocks/planks_autumn_grey" + } +} diff --git a/src/main/resources/assets/appalachia/models/block/stairs_blueridge_01.json b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_01.json new file mode 100644 index 00000000..480fdf91 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_01.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_01", + "top": "appalachia:blocks/planks_blueridge_01", + "side": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/stairs_blueridge_01_inner.json b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_01_inner.json new file mode 100644 index 00000000..e00a6cd8 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_01_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_01", + "top": "appalachia:blocks/planks_blueridge_01", + "side": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/stairs_blueridge_01_outer.json b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_01_outer.json new file mode 100644 index 00000000..1dd25956 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_01_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_01", + "top": "appalachia:blocks/planks_blueridge_01", + "side": "appalachia:blocks/planks_blueridge_01" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/stairs_blueridge_02.json b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_02.json new file mode 100644 index 00000000..2f26a83f --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_02.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_02", + "top": "appalachia:blocks/planks_blueridge_02", + "side": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/stairs_blueridge_02_inner.json b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_02_inner.json new file mode 100644 index 00000000..2ae306a5 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_02_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_02", + "top": "appalachia:blocks/planks_blueridge_02", + "side": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/stairs_blueridge_02_outer.json b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_02_outer.json new file mode 100644 index 00000000..b9831c55 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_02_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_02", + "top": "appalachia:blocks/planks_blueridge_02", + "side": "appalachia:blocks/planks_blueridge_02" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/stairs_blueridge_03.json b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_03.json new file mode 100644 index 00000000..2384d37e --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_03.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_03", + "top": "appalachia:blocks/planks_blueridge_03", + "side": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/stairs_blueridge_03_inner.json b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_03_inner.json new file mode 100644 index 00000000..7e92219b --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_03_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_03", + "top": "appalachia:blocks/planks_blueridge_03", + "side": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/block/stairs_blueridge_03_outer.json b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_03_outer.json new file mode 100644 index 00000000..95dfab5f --- /dev/null +++ b/src/main/resources/assets/appalachia/models/block/stairs_blueridge_03_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "appalachia:blocks/planks_blueridge_03", + "top": "appalachia:blocks/planks_blueridge_03", + "side": "appalachia:blocks/planks_blueridge_03" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/fence_autumn_grey.json b/src/main/resources/assets/appalachia/models/item/fence_autumn_grey.json new file mode 100644 index 00000000..4b67d169 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/fence_autumn_grey.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/fence_autumn_grey_inventory" +} diff --git a/src/main/resources/assets/appalachia/models/item/fence_blueridge_01.json b/src/main/resources/assets/appalachia/models/item/fence_blueridge_01.json new file mode 100644 index 00000000..deb6f51f --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/fence_blueridge_01.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/fence_blueridge_01_inventory" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/fence_blueridge_02.json b/src/main/resources/assets/appalachia/models/item/fence_blueridge_02.json new file mode 100644 index 00000000..86917b5d --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/fence_blueridge_02.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/fence_blueridge_02_inventory" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/fence_blueridge_03.json b/src/main/resources/assets/appalachia/models/item/fence_blueridge_03.json new file mode 100644 index 00000000..b4b14cd0 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/fence_blueridge_03.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/fence_blueridge_03_inventory" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/fence_gate_autumn_grey.json b/src/main/resources/assets/appalachia/models/item/fence_gate_autumn_grey.json new file mode 100644 index 00000000..e5206f95 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/fence_gate_autumn_grey.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/fence_gate_autumn_grey_closed" +} diff --git a/src/main/resources/assets/appalachia/models/item/fence_gate_blueridge_01.json b/src/main/resources/assets/appalachia/models/item/fence_gate_blueridge_01.json new file mode 100644 index 00000000..ac1f62dd --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/fence_gate_blueridge_01.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/fence_gate_blueridge_01_closed" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/fence_gate_blueridge_02.json b/src/main/resources/assets/appalachia/models/item/fence_gate_blueridge_02.json new file mode 100644 index 00000000..ddb66e98 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/fence_gate_blueridge_02.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/fence_gate_blueridge_02_closed" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/fence_gate_blueridge_03.json b/src/main/resources/assets/appalachia/models/item/fence_gate_blueridge_03.json new file mode 100644 index 00000000..83b4fbae --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/fence_gate_blueridge_03.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/fence_gate_blueridge_03_closed" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/leaves_autumn_orange.json b/src/main/resources/assets/appalachia/models/item/leaves_autumn_orange.json new file mode 100644 index 00000000..33fd7e10 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/leaves_autumn_orange.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/leaves_autumn_orange" +} diff --git a/src/main/resources/assets/appalachia/models/item/leaves_autumn_orange_fallen.json b/src/main/resources/assets/appalachia/models/item/leaves_autumn_orange_fallen.json new file mode 100644 index 00000000..b54ad5e4 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/leaves_autumn_orange_fallen.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/leaves_autumn_orange_height2" +} diff --git a/src/main/resources/assets/appalachia/models/item/leaves_autumn_red.json b/src/main/resources/assets/appalachia/models/item/leaves_autumn_red.json new file mode 100644 index 00000000..1275cc0c --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/leaves_autumn_red.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/leaves_autumn_red" +} diff --git a/src/main/resources/assets/appalachia/models/item/leaves_autumn_red_fallen.json b/src/main/resources/assets/appalachia/models/item/leaves_autumn_red_fallen.json new file mode 100644 index 00000000..99591644 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/leaves_autumn_red_fallen.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/leaves_autumn_red_height2" +} diff --git a/src/main/resources/assets/appalachia/models/item/leaves_autumn_yellow.json b/src/main/resources/assets/appalachia/models/item/leaves_autumn_yellow.json new file mode 100644 index 00000000..2aee8702 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/leaves_autumn_yellow.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/leaves_autumn_yellow" +} diff --git a/src/main/resources/assets/appalachia/models/item/leaves_autumn_yellow_fallen.json b/src/main/resources/assets/appalachia/models/item/leaves_autumn_yellow_fallen.json new file mode 100644 index 00000000..cc8a2c50 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/leaves_autumn_yellow_fallen.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/leaves_autumn_yellow_height2" +} diff --git a/src/main/resources/assets/appalachia/models/item/leaves_oak_fallen.json b/src/main/resources/assets/appalachia/models/item/leaves_oak_fallen.json new file mode 100644 index 00000000..d43da000 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/leaves_oak_fallen.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/leaves_oak_height2" +} diff --git a/src/main/resources/assets/appalachia/models/item/log_autumn_grey.json b/src/main/resources/assets/appalachia/models/item/log_autumn_grey.json new file mode 100644 index 00000000..00423f0b --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/log_autumn_grey.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/log_autumn_grey" +} diff --git a/src/main/resources/assets/appalachia/models/item/log_blueridge_01.json b/src/main/resources/assets/appalachia/models/item/log_blueridge_01.json new file mode 100644 index 00000000..d6256735 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/log_blueridge_01.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/log_blueridge_01" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/log_blueridge_02.json b/src/main/resources/assets/appalachia/models/item/log_blueridge_02.json new file mode 100644 index 00000000..89e7e044 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/log_blueridge_02.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/log_blueridge_02" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/log_blueridge_03.json b/src/main/resources/assets/appalachia/models/item/log_blueridge_03.json new file mode 100644 index 00000000..bb45ce9c --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/log_blueridge_03.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/log_blueridge_03" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/planks_autumn_grey.json b/src/main/resources/assets/appalachia/models/item/planks_autumn_grey.json new file mode 100644 index 00000000..676d2a1f --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/planks_autumn_grey.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/planks_autumn_grey" +} diff --git a/src/main/resources/assets/appalachia/models/item/planks_blueridge_01.json b/src/main/resources/assets/appalachia/models/item/planks_blueridge_01.json new file mode 100644 index 00000000..4dd02aef --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/planks_blueridge_01.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/planks_blueridge_01" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/planks_blueridge_02.json b/src/main/resources/assets/appalachia/models/item/planks_blueridge_02.json new file mode 100644 index 00000000..a1b31df1 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/planks_blueridge_02.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/planks_blueridge_02" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/planks_blueridge_03.json b/src/main/resources/assets/appalachia/models/item/planks_blueridge_03.json new file mode 100644 index 00000000..09d3719f --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/planks_blueridge_03.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/planks_blueridge_03" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/sapling_quercus_robur.json b/src/main/resources/assets/appalachia/models/item/sapling_quercus_robur.json new file mode 100644 index 00000000..401e47b6 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/sapling_quercus_robur.json @@ -0,0 +1,6 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "appalachia:blocks/sapling_quercus_robur" + } +} diff --git a/src/main/resources/assets/appalachia/models/item/slab_autumn_grey.json b/src/main/resources/assets/appalachia/models/item/slab_autumn_grey.json new file mode 100644 index 00000000..625f8b27 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/slab_autumn_grey.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/slab_autumn_grey" +} diff --git a/src/main/resources/assets/appalachia/models/item/slab_blueridge_01.json b/src/main/resources/assets/appalachia/models/item/slab_blueridge_01.json new file mode 100644 index 00000000..f0c9b635 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/slab_blueridge_01.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/slab_blueridge_01" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/slab_blueridge_02.json b/src/main/resources/assets/appalachia/models/item/slab_blueridge_02.json new file mode 100644 index 00000000..9c3b700c --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/slab_blueridge_02.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/slab_blueridge_02" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/slab_blueridge_03.json b/src/main/resources/assets/appalachia/models/item/slab_blueridge_03.json new file mode 100644 index 00000000..25c4d22c --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/slab_blueridge_03.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/slab_blueridge_03" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/stairs_autumn_grey.json b/src/main/resources/assets/appalachia/models/item/stairs_autumn_grey.json new file mode 100644 index 00000000..df289e2b --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/stairs_autumn_grey.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/stairs_autumn_grey" +} diff --git a/src/main/resources/assets/appalachia/models/item/stairs_blueridge_01.json b/src/main/resources/assets/appalachia/models/item/stairs_blueridge_01.json new file mode 100644 index 00000000..a1352094 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/stairs_blueridge_01.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/stairs_blueridge_01" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/stairs_blueridge_02.json b/src/main/resources/assets/appalachia/models/item/stairs_blueridge_02.json new file mode 100644 index 00000000..76235de1 --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/stairs_blueridge_02.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/stairs_blueridge_02" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/models/item/stairs_blueridge_03.json b/src/main/resources/assets/appalachia/models/item/stairs_blueridge_03.json new file mode 100644 index 00000000..338eb94c --- /dev/null +++ b/src/main/resources/assets/appalachia/models/item/stairs_blueridge_03.json @@ -0,0 +1,3 @@ +{ + "parent": "appalachia:block/stairs_blueridge_03" +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/sounds.json b/src/main/resources/assets/appalachia/sounds.json new file mode 100644 index 00000000..3e5634cc --- /dev/null +++ b/src/main/resources/assets/appalachia/sounds.json @@ -0,0 +1,112 @@ +{ + "entity.blackbear.idle1": { + "sounds": [ + "appalachia:entity/blackbear/idle1" + ] + }, + "entity.blackbear.idle2": { + "sounds": [ + "appalachia:entity/blackbear/idle2" + ] + }, + "entity.blackbear.idle3": { + "sounds": [ + "appalachia:entity/blackbear/idle3" + ] + }, + "entity.blackbear.idle4": { + "sounds": [ + "appalachia:entity/blackbear/idle4" + ] + }, + "entity.blackbear.step1": { + "sounds": [ + "appalachia:entity/blackbear/step1" + ] + }, + "entity.blackbear.step2": { + "sounds": [ + "appalachia:entity/blackbear/step2" + ] + }, + "entity.blackbear.step3": { + "sounds": [ + "appalachia:entity/blackbear/step3" + ] + }, + "entity.blackbear.step4": { + "sounds": [ + "appalachia:entity/blackbear/step4" + ] + }, + "entity.blackbear.hurt1": { + "sounds": [ + "appalachia:entity/blackbear/hurt1" + ] + }, + "entity.blackbear.hurt2": { + "sounds": [ + "appalachia:entity/blackbear/hurt2" + ] + }, + "entity.blackbear.hurt3": { + "sounds": [ + "appalachia:entity/blackbear/hurt3" + ] + }, + "entity.blackbear.hurt4": { + "sounds": [ + "appalachia:entity/blackbear/hurt4" + ] + }, + "entity.blackbear.warning1": { + "sounds": [ + "appalachia:entity/blackbear/warning1" + ] + }, + "entity.blackbear.warning2": { + "sounds": [ + "appalachia:entity/blackbear/warning2" + ] + }, + "entity.blackbear.warning3": { + "sounds": [ + "appalachia:entity/blackbear/warning3" + ] + }, + "entity.blackbear.death1": { + "sounds": [ + "appalachia:entity/blackbear/death1" + ] + }, + "entity.blackbear.death2": { + "sounds": [ + "appalachia:entity/blackbear/death2" + ] + }, + "entity.blackbear.death3": { + "sounds": [ + "appalachia:entity/blackbear/death3" + ] + }, + "entity.blackbear_baby.idle1": { + "sounds": [ + "appalachia:entity/blackbear_baby/idle1" + ] + }, + "entity.blackbear_baby.idle2": { + "sounds": [ + "appalachia:entity/blackbear_baby/idle2" + ] + }, + "entity.blackbear_baby.idle3": { + "sounds": [ + "appalachia:entity/blackbear_baby/idle3" + ] + }, + "entity.blackbear_baby.idle4": { + "sounds": [ + "appalachia:entity/blackbear_baby/idle4" + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/death1.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/death1.ogg new file mode 100644 index 00000000..f4d53636 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/death1.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/death2.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/death2.ogg new file mode 100644 index 00000000..2a613e6a Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/death2.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/death3.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/death3.ogg new file mode 100644 index 00000000..a95321a7 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/death3.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt1.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt1.ogg new file mode 100644 index 00000000..1cfc69d2 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt1.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt2.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt2.ogg new file mode 100644 index 00000000..f8064f96 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt2.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt3.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt3.ogg new file mode 100644 index 00000000..9505b50c Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt3.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt4.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt4.ogg new file mode 100644 index 00000000..1409d8e3 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/hurt4.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle1.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle1.ogg new file mode 100644 index 00000000..ed4783b6 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle1.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle2.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle2.ogg new file mode 100644 index 00000000..73b33906 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle2.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle3.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle3.ogg new file mode 100644 index 00000000..3f539a1f Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle3.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle4.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle4.ogg new file mode 100644 index 00000000..4ed9a4a3 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/idle4.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/step1.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/step1.ogg new file mode 100644 index 00000000..6b8aae33 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/step1.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/step2.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/step2.ogg new file mode 100644 index 00000000..93f07268 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/step2.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/step3.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/step3.ogg new file mode 100644 index 00000000..664a8ffa Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/step3.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/step4.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/step4.ogg new file mode 100644 index 00000000..70cee7de Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/step4.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/warning1.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/warning1.ogg new file mode 100644 index 00000000..ad652aaf Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/warning1.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/warning2.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/warning2.ogg new file mode 100644 index 00000000..c4be0c78 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/warning2.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear/warning3.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear/warning3.ogg new file mode 100644 index 00000000..8fb6fe48 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear/warning3.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle1.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle1.ogg new file mode 100644 index 00000000..ed4783b6 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle1.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle2.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle2.ogg new file mode 100644 index 00000000..73b33906 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle2.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle3.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle3.ogg new file mode 100644 index 00000000..9b0d35a9 Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle3.ogg differ diff --git a/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle4.ogg b/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle4.ogg new file mode 100644 index 00000000..3f539a1f Binary files /dev/null and b/src/main/resources/assets/appalachia/sounds/entity/blackbear_baby/idle4.ogg differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/leaves_autumn_orange.png b/src/main/resources/assets/appalachia/textures/blocks/leaves_autumn_orange.png new file mode 100644 index 00000000..6eb11697 Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/leaves_autumn_orange.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/leaves_autumn_red.png b/src/main/resources/assets/appalachia/textures/blocks/leaves_autumn_red.png new file mode 100644 index 00000000..887679d7 Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/leaves_autumn_red.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/leaves_autumn_yellow.png b/src/main/resources/assets/appalachia/textures/blocks/leaves_autumn_yellow.png new file mode 100644 index 00000000..a4dda04b Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/leaves_autumn_yellow.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/log_autumn_grey.png b/src/main/resources/assets/appalachia/textures/blocks/log_autumn_grey.png new file mode 100644 index 00000000..c3757c88 Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/log_autumn_grey.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/log_autumn_grey_top.png b/src/main/resources/assets/appalachia/textures/blocks/log_autumn_grey_top.png new file mode 100644 index 00000000..185a098e Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/log_autumn_grey_top.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_01.png b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_01.png new file mode 100644 index 00000000..af17bc9e Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_01.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_02.png b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_02.png new file mode 100644 index 00000000..be132945 Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_02.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_03.png b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_03.png new file mode 100644 index 00000000..73874cea Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_03.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_top_01.png b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_top_01.png new file mode 100644 index 00000000..50d38892 Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_top_01.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_top_02.png b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_top_02.png new file mode 100644 index 00000000..789f7542 Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_top_02.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_top_03.png b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_top_03.png new file mode 100644 index 00000000..86131305 Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/log_blueridge_top_03.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/planks_autumn_grey.png b/src/main/resources/assets/appalachia/textures/blocks/planks_autumn_grey.png new file mode 100644 index 00000000..93de71fc Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/planks_autumn_grey.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/planks_blueridge_01.png b/src/main/resources/assets/appalachia/textures/blocks/planks_blueridge_01.png new file mode 100644 index 00000000..f9a6e488 Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/planks_blueridge_01.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/planks_blueridge_02.png b/src/main/resources/assets/appalachia/textures/blocks/planks_blueridge_02.png new file mode 100644 index 00000000..bebdb7a8 Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/planks_blueridge_02.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/planks_blueridge_03.png b/src/main/resources/assets/appalachia/textures/blocks/planks_blueridge_03.png new file mode 100644 index 00000000..c203e1cf Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/planks_blueridge_03.png differ diff --git a/src/main/resources/assets/appalachia/textures/blocks/sapling_quercus_robur.png b/src/main/resources/assets/appalachia/textures/blocks/sapling_quercus_robur.png new file mode 100644 index 00000000..3a38a737 Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/blocks/sapling_quercus_robur.png differ diff --git a/src/main/resources/assets/appalachia/textures/entity/bear/blackbear.png b/src/main/resources/assets/appalachia/textures/entity/bear/blackbear.png new file mode 100644 index 00000000..c4011f56 Binary files /dev/null and b/src/main/resources/assets/appalachia/textures/entity/bear/blackbear.png differ diff --git a/src/api/java/.gitkeep b/src/main/resources/assets/appalachia/textures/items/.gitkeep similarity index 100% rename from src/api/java/.gitkeep rename to src/main/resources/assets/appalachia/textures/items/.gitkeep