diff --git a/Convert.java b/Convert.java index e06ec11c..77a1705d 100644 --- a/Convert.java +++ b/Convert.java @@ -1,146 +1,147 @@ - class ModelPart { - static java.util.ArrayList parts = new java.util.ArrayList<>(20); - final String name; - ModelPart parent = null; - boolean mirror = false; - - float x=0, y=0, z=0, rx=0, ry=0, rz=0; - int u=0, v=0; - float bx=0,by=0,bz=0,ba=0,bb=0,bc=0; - float scale = 1; - static int wd = 64; - static int hg = 32; - - - boolean hadBox = false; - ModelPart(Convert c, String name){ - this(c, 0, 0, name); - - } - - ModelPart(Convert c, int u, int v, String name){ - this.name = name; - this.u = u; - this.v = v; - parts.add(this); - } - - ModelPart(int wd, int hg, int u, int v, String name){ - this.name = name; - this.u = u; - this.v = v; - ModelPart.wd = wd; - ModelPart.hg = hg; - parts.add(this); - } - - ModelPart setPos(float x, float y, float z){ - this.x=x; - this.y=y; - this.z=z; - return this; - } - - ModelPart setRotationAngle(float x, float y, float z){ - this.rx=x; - this.ry=y; - this.rz=z; - return this; - } - - ModelPart addChild(ModelPart p){ - p.parent = this; - return this; - } - - ModelPart texOffs(int u, int v){ - this.u=u; - this.v=v; - return this; - } - ModelPart addBox(float x, float y, float z, float a, float b, float c){ - return addBox(x, y, z, a, b, c, 1); - } - - ModelPart addBox(float x, float y, float z, float a, float b, float c, float _d){ - bx=x; - by=y; - bz=z; - ba=a; - bb=b; - bc=c; - scale = _d; - hadBox = true; - return this; - } - ModelPart addBox(float x, float y, float z, float a, float b, float c, float _d, boolean mirror){ - this.mirror = mirror; - bx=x; - by=y; - bz=z; - ba=a; - bb=b; - bc=c; - hadBox = true; - return this; - } - - public String toString(){ - String s = ""; - String pName = parent==null?"modelPartData":parent.name; - if (scale!=1){ - s += "CubeDeformation deformation_"+name+" = new CubeDeformation("+scale+"f);\n"; - } - s += "PartDefinition " + name + " = "; - s += pName+".addOrReplaceChild(\""+name+"\", CubeListBuilder.create()\n"; - if (this.mirror) s+= ".mirror()\n"; - s+= ".texOffs("+u+", "+v+")"; - if (this.hadBox) { - s+= "\n"; - if (scale!=1) - s+= ".addBox("+bx+"f, "+by+"f, "+bz+"f, "+ba+"f, "+bb+"f, "+bc+"f, deformation_"+name+"),\n"; - else - s+= ".addBox("+bx+"f, "+by+"f, "+bz+"f, "+ba+"f, "+bb+"f, "+bc+"f),\n"; - } else { - s+= ",\n"; - } - - if (x==0 && y==0 && z==0 && rx==0 && ry==0 && rz==0){ - s+= "PartPose.ZERO"; - } else if (rx==0 && ry==0 && rz==0){ - s+= "PartPose.offset("+x+"f, "+y+"f, "+z+"f)"; - } else { - s+= "PartPose.offsetAndRotation("+x+"f, "+y+"f, "+z+"f, \n"+rx+"f, "+ry+"f, "+rz+"f)"; - } - s +=");"; - - return s; - } - - public static void print(){ - System.out.println("public static LayerDefinition getTexturedModelData() {"); - System.out.println(" MeshDefinition modelData = new MeshDefinition();"); - System.out.println(" PartDefinition modelPartData = modelData.getRoot();"); - for(ModelPart p : parts){ - System.out.println(p); - System.out.println(); - } - System.out.println("return LayerDefinition.create(modelData, "+wd+", "+hg+");"); - System.out.println("}"); - - System.out.println(); - System.out.println(); - - for(ModelPart p : parts){ - String pName = p.parent==null?"modelPart":p.parent.name; - System.out.println(p.name +" = "+pName+".getChild(\""+p.name+"\");"); - } - } + static java.util.ArrayList parts = new java.util.ArrayList<>(20); + final String name; + ModelPart parent = null; + boolean mirror = false; + + float x = 0, y = 0, z = 0, rx = 0, ry = 0, rz = 0; + int u = 0, v = 0; + float bx = 0, by = 0, bz = 0, ba = 0, bb = 0, bc = 0; + float scale = 1; + static int wd = 64; + static int hg = 32; + + + boolean hadBox = false; + + ModelPart(Convert c, String name) { + this(c, 0, 0, name); + + } + + ModelPart(Convert c, int u, int v, String name) { + this.name = name; + this.u = u; + this.v = v; + parts.add(this); + } + + ModelPart(int wd, int hg, int u, int v, String name) { + this.name = name; + this.u = u; + this.v = v; + ModelPart.wd = wd; + ModelPart.hg = hg; + parts.add(this); + } + + ModelPart setPos(float x, float y, float z) { + this.x = x; + this.y = y; + this.z = z; + return this; + } + + ModelPart setRotationAngle(float x, float y, float z) { + this.rx = x; + this.ry = y; + this.rz = z; + return this; + } + + ModelPart addChild(ModelPart p) { + p.parent = this; + return this; + } + + ModelPart texOffs(int u, int v) { + this.u = u; + this.v = v; + return this; + } + + ModelPart addBox(float x, float y, float z, float a, float b, float c) { + return addBox(x, y, z, a, b, c, 1); + } + + ModelPart addBox(float x, float y, float z, float a, float b, float c, float _d) { + bx = x; + by = y; + bz = z; + ba = a; + bb = b; + bc = c; + scale = _d; + hadBox = true; + return this; + } + + ModelPart addBox(float x, float y, float z, float a, float b, float c, float _d, boolean mirror) { + this.mirror = mirror; + bx = x; + by = y; + bz = z; + ba = a; + bb = b; + bc = c; + hadBox = true; + return this; + } + + public String toString() { + String s = ""; + String pName = parent == null ? "modelPartData" : parent.name; + if (scale != 1) { + s += "CubeDeformation deformation_" + name + " = new CubeDeformation(" + scale + "f);\n"; + } + s += "PartDefinition " + name + " = "; + s += pName + ".addOrReplaceChild(\"" + name + "\", CubeListBuilder.create()\n"; + if (this.mirror) s += ".mirror()\n"; + s += ".texOffs(" + u + ", " + v + ")"; + if (this.hadBox) { + s += "\n"; + if (scale != 1) + s += ".addBox(" + bx + "f, " + by + "f, " + bz + "f, " + ba + "f, " + bb + "f, " + bc + "f, deformation_" + name + "),\n"; + else s += ".addBox(" + bx + "f, " + by + "f, " + bz + "f, " + ba + "f, " + bb + "f, " + bc + "f),\n"; + } + else { + s += ",\n"; + } + + if (x == 0 && y == 0 && z == 0 && rx == 0 && ry == 0 && rz == 0) { + s += "PartPose.ZERO"; + } + else if (rx == 0 && ry == 0 && rz == 0) { + s += "PartPose.offset(" + x + "f, " + y + "f, " + z + "f)"; + } + else { + s += "PartPose.offsetAndRotation(" + x + "f, " + y + "f, " + z + "f, \n" + rx + "f, " + ry + "f, " + rz + "f)"; + } + s += ");"; + + return s; + } + + public static void print() { + System.out.println("public static LayerDefinition getTexturedModelData() {"); + System.out.println(" MeshDefinition modelData = new MeshDefinition();"); + System.out.println(" PartDefinition modelPartData = modelData.getRoot();"); + for (ModelPart p : parts) { + System.out.println(p); + System.out.println(); + } + System.out.println("return LayerDefinition.create(modelData, " + wd + ", " + hg + ");"); + System.out.println("}"); + + System.out.println(); + System.out.println(); + + for (ModelPart p : parts) { + String pName = p.parent == null ? "modelPart" : p.parent.name; + System.out.println(p.name + " = " + pName + ".getChild(\"" + p.name + "\");"); + } + } } -public class Convert { - public static void main(String[] args){ - new Convert().c(); ModelPart.print(); } diff --git a/README.md b/README.md index b55c4f42..120884de 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,19 @@ [![](https://jitpack.io/v/paulevsGitch/BetterEnd.svg)](https://jitpack.io/#paulevsGitch/BetterEnd) + # Better End + Better End Mod for Fabric, MC 1.17.1 Importing: + * Clone repo * Edit gradle.properties if necessary * Run command line in folder: gradlew genSources eclipse (or Another-IDE-Name) * Import project to IDE Building: + * Clone repo * Run command line in folder: gradlew build * Mod .jar will be in ./build/libs -Mappings: -* https://modmuss50.me/fabric.html?&version=1.16.4 diff --git a/build.gradle b/build.gradle index b2fff8e6..8a4606af 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,14 @@ buildscript { - dependencies { - classpath 'org.kohsuke:github-api:1.114' - } + dependencies { + classpath 'org.kohsuke:github-api:1.114' + } } plugins { - id 'idea' - id 'eclipse' - id 'fabric-loom' version '0.8-SNAPSHOT' - id 'maven-publish' + id 'idea' + id 'eclipse' + id 'fabric-loom' version '0.8-SNAPSHOT' + id 'maven-publish' } sourceCompatibility = JavaVersion.VERSION_16 @@ -19,102 +19,102 @@ version = project.mod_version group = project.maven_group repositories { - maven { url "https://maven.dblsaiko.net/" } - maven { url "https://maven.fabricmc.net/" } - maven { url 'https://maven.blamejared.com' } - maven { url "https://maven.shedaniel.me/" } - maven { url 'https://jitpack.io' } + maven { url "https://maven.dblsaiko.net/" } + maven { url "https://maven.fabricmc.net/" } + maven { url 'https://maven.blamejared.com' } + maven { url "https://maven.shedaniel.me/" } + maven { url 'https://jitpack.io' } } dependencies { - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings minecraft.officialMojangMappings() - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - - useApi "vazkii.patchouli:Patchouli:1.17-${project.patchouli_version}" - useApi "com.github.paulevsGitch:BCLib:${project.bclib_version}" + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings minecraft.officialMojangMappings() + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - useOptional "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}" - useOptional "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}" - //useOptional "grondag:canvas-mc116:${project.canvas_version}" + useApi "vazkii.patchouli:Patchouli:1.17-${project.patchouli_version}" + useApi "com.github.paulevsGitch:BCLib:${project.bclib_version}" + + useOptional "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}" + useOptional "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}" + //useOptional "grondag:canvas-mc116:${project.canvas_version}" } def useOptional(String dep) { - dependencies.modRuntime (dep) { - exclude group: 'net.fabricmc.fabric-api' - exclude group: 'net.fabricmc' - if (!dep.contains("me.shedaniel")) { - exclude group: 'me.shedaniel.cloth' - exclude group: 'me.shedaniel' - } - } - dependencies.modCompileOnly (dep) { - exclude group: 'net.fabricmc.fabric-api' - exclude group: 'net.fabricmc' - if (!dep.contains("me.shedaniel")) { - exclude group: 'me.shedaniel.cloth' - exclude group: 'me.shedaniel' - } - } + dependencies.modRuntime(dep) { + exclude group: 'net.fabricmc.fabric-api' + exclude group: 'net.fabricmc' + if (!dep.contains("me.shedaniel")) { + exclude group: 'me.shedaniel.cloth' + exclude group: 'me.shedaniel' + } + } + dependencies.modCompileOnly(dep) { + exclude group: 'net.fabricmc.fabric-api' + exclude group: 'net.fabricmc' + if (!dep.contains("me.shedaniel")) { + exclude group: 'me.shedaniel.cloth' + exclude group: 'me.shedaniel' + } + } } def useApi(String dep) { - dependencies.modApi (dep) { - exclude group: 'net.fabricmc.fabric-api' - exclude group: 'net.fabricmc' - if (!dep.contains("me.shedaniel")) { - exclude group: 'me.shedaniel.cloth' - exclude group: 'me.shedaniel' - } - } + dependencies.modApi(dep) { + exclude group: 'net.fabricmc.fabric-api' + exclude group: 'net.fabricmc' + if (!dep.contains("me.shedaniel")) { + exclude group: 'me.shedaniel.cloth' + exclude group: 'me.shedaniel' + } + } } processResources { - inputs.property "version", project.version - duplicatesStrategy = 'WARN' + inputs.property "version", project.version + duplicatesStrategy = 'WARN' - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" - expand "version": project.version - } + from(sourceSets.main.resources.srcDirs) { + include "fabric.mod.json" + expand "version": project.version + } - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" - } + from(sourceSets.main.resources.srcDirs) { + exclude "fabric.mod.json" + } } // ensure that the encoding is set to UTF-8, no matter what the system default is // this fixes some edge cases with special characters not displaying correctly // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html tasks.withType(JavaCompile) { - options.encoding = "UTF-8" + options.encoding = "UTF-8" } javadoc { - options.tags = ["reason"] + options.tags = ["reason"] } task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir + classifier = 'javadoc' + from javadoc.destinationDir } // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // if it is present. // If you remove this task, sources will not be generated. task sourcesJar(type: Jar, dependsOn: classes) { - classifier = 'sources' - from sourceSets.main.allSource + classifier = 'sources' + from sourceSets.main.allSource } jar { - from "LICENSE" + from "LICENSE" } artifacts { - archives sourcesJar - archives javadocJar + archives sourcesJar + archives javadocJar } def env = System.getenv() @@ -123,24 +123,24 @@ import org.kohsuke.github.GHReleaseBuilder import org.kohsuke.github.GitHub task release(dependsOn: [remapJar, sourcesJar, javadocJar]) { - onlyIf { - env.GITHUB_TOKEN - } + onlyIf { + env.GITHUB_TOKEN + } - doLast { - def github = GitHub.connectUsingOAuth(env.GITHUB_TOKEN as String) - def repository = github.getRepository("paulevsGitch/BetterEnd") + doLast { + def github = GitHub.connectUsingOAuth(env.GITHUB_TOKEN as String) + def repository = github.getRepository("paulevsGitch/BetterEnd") - def releaseBuilder = new GHReleaseBuilder(repository, version as String) - releaseBuilder.name("${archivesBaseName}-${version}") - releaseBuilder.body("A changelog can be found at https://github.com/paulevsGitch/BetterEnd/commits") - releaseBuilder.commitish("master") + def releaseBuilder = new GHReleaseBuilder(repository, version as String) + releaseBuilder.name("${archivesBaseName}-${version}") + releaseBuilder.body("A changelog can be found at https://github.com/paulevsGitch/BetterEnd/commits") + releaseBuilder.commitish("master") - def ghRelease = releaseBuilder.create() - ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"), "application/java-archive"); - ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources.jar"), "application/java-archive"); - ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-javadoc.jar"), "application/java-archive"); - } + def ghRelease = releaseBuilder.create() + ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"), "application/java-archive"); + ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources.jar"), "application/java-archive"); + ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-javadoc.jar"), "application/java-archive"); + } } // configure the maven publication diff --git a/gradle.properties b/gradle.properties index 3223bfa7..509aedca 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,17 +1,14 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx2G - # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version= 1.17.1 -yarn_mappings= 6 -loader_version= 0.11.6 - +minecraft_version=1.17.1 +yarn_mappings=6 +loader_version=0.11.6 # Mod Properties -mod_version = 0.10.1-pre -maven_group = ru.betterend -archives_base_name = better-end - +mod_version=0.10.4-pre +maven_group=ru.betterend +archives_base_name=better-end # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api patchouli_version = 55-FABRIC-SNAPSHOT diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 00000000..b0b045eb --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,6 @@ +# From https://github.com/jitpack/jitpack.io/issues/4506#issuecomment-864562270 +before_install: + - source "$HOME/.sdkman/bin/sdkman-init.sh" + - sdk update + - sdk install java 16.0.1.hs-adpt + - sdk use java 16.0.1.hs-adpt \ No newline at end of file diff --git a/json/block/%name%.json b/json/block/%name%.json index 10f7880a..d129f585 100644 --- a/json/block/%name%.json +++ b/json/block/%name%.json @@ -1,6 +1,6 @@ { - "parent": "block/cube_all", - "textures": { - "all": "betterend:block/%name%" - } + "parent": "block/cube_all", + "textures": { + "all": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_brick_half_slab.json b/json/block/%name%_brick_half_slab.json index 4a5be990..0db32a8f 100644 --- a/json/block/%name%_brick_half_slab.json +++ b/json/block/%name%_brick_half_slab.json @@ -1,8 +1,8 @@ { - "parent": "block/slab", - "textures": { - "bottom": "betterend:block/%name%_bricks", - "side": "betterend:block/%name%_bricks", - "top": "betterend:block/%name%_bricks" - } + "parent": "block/slab", + "textures": { + "bottom": "betterend:block/%name%_bricks", + "side": "betterend:block/%name%_bricks", + "top": "betterend:block/%name%_bricks" + } } \ No newline at end of file diff --git a/json/block/%name%_brick_inner_stairs.json b/json/block/%name%_brick_inner_stairs.json index 98c27d1f..6f04c892 100644 --- a/json/block/%name%_brick_inner_stairs.json +++ b/json/block/%name%_brick_inner_stairs.json @@ -1,8 +1,8 @@ { - "parent": "block/inner_stairs", - "textures": { - "bottom": "betterend:block/%name%_bricks", - "side": "betterend:block/%name%_bricks", - "top": "betterend:block/%name%_bricks" - } + "parent": "block/inner_stairs", + "textures": { + "bottom": "betterend:block/%name%_bricks", + "side": "betterend:block/%name%_bricks", + "top": "betterend:block/%name%_bricks" + } } \ No newline at end of file diff --git a/json/block/%name%_brick_outer_stairs.json b/json/block/%name%_brick_outer_stairs.json index 5fe881ad..481b896d 100644 --- a/json/block/%name%_brick_outer_stairs.json +++ b/json/block/%name%_brick_outer_stairs.json @@ -1,8 +1,8 @@ { - "parent": "block/outer_stairs", - "textures": { - "bottom": "betterend:block/%name%_bricks", - "side": "betterend:block/%name%_bricks", - "top": "betterend:block/%name%_bricks" - } + "parent": "block/outer_stairs", + "textures": { + "bottom": "betterend:block/%name%_bricks", + "side": "betterend:block/%name%_bricks", + "top": "betterend:block/%name%_bricks" + } } \ No newline at end of file diff --git a/json/block/%name%_brick_stairs.json b/json/block/%name%_brick_stairs.json index ee695265..94e5512c 100644 --- a/json/block/%name%_brick_stairs.json +++ b/json/block/%name%_brick_stairs.json @@ -1,8 +1,8 @@ { - "parent": "block/stairs", - "textures": { - "bottom": "betterend:block/%name%_bricks", - "side": "betterend:block/%name%_bricks", - "top": "betterend:block/%name%_bricks" - } + "parent": "block/stairs", + "textures": { + "bottom": "betterend:block/%name%_bricks", + "side": "betterend:block/%name%_bricks", + "top": "betterend:block/%name%_bricks" + } } \ No newline at end of file diff --git a/json/block/%name%_brick_wall_inventory.json b/json/block/%name%_brick_wall_inventory.json index f5616dc9..7f16d3b4 100644 --- a/json/block/%name%_brick_wall_inventory.json +++ b/json/block/%name%_brick_wall_inventory.json @@ -1,6 +1,6 @@ { - "parent": "minecraft:block/wall_inventory", - "textures": { - "wall": "betterend:block/%name%_bricks" - } + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "betterend:block/%name%_bricks" + } } \ No newline at end of file diff --git a/json/block/%name%_brick_wall_post.json b/json/block/%name%_brick_wall_post.json index 3e23f8a3..a7fdb47e 100644 --- a/json/block/%name%_brick_wall_post.json +++ b/json/block/%name%_brick_wall_post.json @@ -1,6 +1,6 @@ { - "parent": "minecraft:block/template_wall_post", - "textures": { - "wall": "betterend:block/%name%_bricks" - } + "parent": "minecraft:block/template_wall_post", + "textures": { + "wall": "betterend:block/%name%_bricks" + } } \ No newline at end of file diff --git a/json/block/%name%_brick_wall_side.json b/json/block/%name%_brick_wall_side.json index e95d0502..bf16dc33 100644 --- a/json/block/%name%_brick_wall_side.json +++ b/json/block/%name%_brick_wall_side.json @@ -1,6 +1,6 @@ { - "parent": "minecraft:block/template_wall_side", - "textures": { - "wall": "betterend:block/%name%_bricks" - } + "parent": "minecraft:block/template_wall_side", + "textures": { + "wall": "betterend:block/%name%_bricks" + } } \ No newline at end of file diff --git a/json/block/%name%_brick_wall_side_tall.json b/json/block/%name%_brick_wall_side_tall.json index 7323cbfb..d0f4d3fc 100644 --- a/json/block/%name%_brick_wall_side_tall.json +++ b/json/block/%name%_brick_wall_side_tall.json @@ -1,6 +1,6 @@ { - "parent": "minecraft:block/template_wall_side_tall", - "textures": { - "wall": "betterend:block/%name%_bricks" - } + "parent": "minecraft:block/template_wall_side_tall", + "textures": { + "wall": "betterend:block/%name%_bricks" + } } \ No newline at end of file diff --git a/json/block/%name%_bricks.json b/json/block/%name%_bricks.json index 5f68cf77..3566742f 100644 --- a/json/block/%name%_bricks.json +++ b/json/block/%name%_bricks.json @@ -1,6 +1,6 @@ { - "parent": "block/cube_all", - "textures": { - "all": "betterend:block/%name%_bricks" - } + "parent": "block/cube_all", + "textures": { + "all": "betterend:block/%name%_bricks" + } } \ No newline at end of file diff --git a/json/block/%name%_button.json b/json/block/%name%_button.json index 4a465cf5..bc35f8cb 100644 --- a/json/block/%name%_button.json +++ b/json/block/%name%_button.json @@ -1,6 +1,6 @@ { - "parent": "block/button", - "textures": { - "texture": "betterend:block/%name%" - } + "parent": "block/button", + "textures": { + "texture": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_button_inventory.json b/json/block/%name%_button_inventory.json index e04a286b..a16f6271 100644 --- a/json/block/%name%_button_inventory.json +++ b/json/block/%name%_button_inventory.json @@ -1,6 +1,6 @@ { - "parent": "block/button_inventory", - "textures": { - "texture": "betterend:block/%name%" - } + "parent": "block/button_inventory", + "textures": { + "texture": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_button_pressed.json b/json/block/%name%_button_pressed.json index 5afc1c34..ad08effa 100644 --- a/json/block/%name%_button_pressed.json +++ b/json/block/%name%_button_pressed.json @@ -1,6 +1,6 @@ { - "parent": "block/button_pressed", - "textures": { - "texture": "betterend:block/%name%" - } + "parent": "block/button_pressed", + "textures": { + "texture": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_half_slab.json b/json/block/%name%_half_slab.json index afe17edd..365ca375 100644 --- a/json/block/%name%_half_slab.json +++ b/json/block/%name%_half_slab.json @@ -1,8 +1,8 @@ { - "parent": "block/slab", - "textures": { - "bottom": "betterend:block/%name%", - "side": "betterend:block/%name%", - "top": "betterend:block/%name%" - } + "parent": "block/slab", + "textures": { + "bottom": "betterend:block/%name%", + "side": "betterend:block/%name%", + "top": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_inner_stairs.json b/json/block/%name%_inner_stairs.json index f7f22430..5fbdd28b 100644 --- a/json/block/%name%_inner_stairs.json +++ b/json/block/%name%_inner_stairs.json @@ -1,8 +1,8 @@ { - "parent": "block/inner_stairs", - "textures": { - "bottom": "betterend:block/%name%", - "side": "betterend:block/%name%", - "top": "betterend:block/%name%" - } + "parent": "block/inner_stairs", + "textures": { + "bottom": "betterend:block/%name%", + "side": "betterend:block/%name%", + "top": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_outer_stairs.json b/json/block/%name%_outer_stairs.json index 2c6740d1..6e0a7437 100644 --- a/json/block/%name%_outer_stairs.json +++ b/json/block/%name%_outer_stairs.json @@ -1,8 +1,8 @@ { - "parent": "block/outer_stairs", - "textures": { - "bottom": "betterend:block/%name%", - "side": "betterend:block/%name%", - "top": "betterend:block/%name%" - } + "parent": "block/outer_stairs", + "textures": { + "bottom": "betterend:block/%name%", + "side": "betterend:block/%name%", + "top": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_pressure_plate_down.json b/json/block/%name%_pressure_plate_down.json index 0836b6f5..32039660 100644 --- a/json/block/%name%_pressure_plate_down.json +++ b/json/block/%name%_pressure_plate_down.json @@ -1,6 +1,6 @@ { - "parent": "block/pressure_plate_down", - "textures": { - "texture": "betterend:block/%name%" - } + "parent": "block/pressure_plate_down", + "textures": { + "texture": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_pressure_plate_up.json b/json/block/%name%_pressure_plate_up.json index 655f909b..65ff46e0 100644 --- a/json/block/%name%_pressure_plate_up.json +++ b/json/block/%name%_pressure_plate_up.json @@ -1,6 +1,6 @@ { - "parent": "block/pressure_plate_up", - "textures": { - "texture": "betterend:block/%name%" - } + "parent": "block/pressure_plate_up", + "textures": { + "texture": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_small_tiles.json b/json/block/%name%_small_tiles.json index b81bf3b0..4f31a369 100644 --- a/json/block/%name%_small_tiles.json +++ b/json/block/%name%_small_tiles.json @@ -1,6 +1,6 @@ { - "parent": "block/cube_all", - "textures": { - "all": "betterend:block/%name%_small_tiles" - } + "parent": "block/cube_all", + "textures": { + "all": "betterend:block/%name%_small_tiles" + } } \ No newline at end of file diff --git a/json/block/%name%_stairs.json b/json/block/%name%_stairs.json index 1aee442b..1e4dd106 100644 --- a/json/block/%name%_stairs.json +++ b/json/block/%name%_stairs.json @@ -1,8 +1,8 @@ { - "parent": "block/stairs", - "textures": { - "bottom": "betterend:block/%name%", - "side": "betterend:block/%name%", - "top": "betterend:block/%name%" - } + "parent": "block/stairs", + "textures": { + "bottom": "betterend:block/%name%", + "side": "betterend:block/%name%", + "top": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_tile.json b/json/block/%name%_tile.json index 211afd9d..de0b467d 100644 --- a/json/block/%name%_tile.json +++ b/json/block/%name%_tile.json @@ -1,6 +1,6 @@ { - "parent": "block/cube_all", - "textures": { - "all": "betterend:block/%name%_tile" - } + "parent": "block/cube_all", + "textures": { + "all": "betterend:block/%name%_tile" + } } \ No newline at end of file diff --git a/json/block/%name%_wall_inventory.json b/json/block/%name%_wall_inventory.json index 35d05c72..27cd062b 100644 --- a/json/block/%name%_wall_inventory.json +++ b/json/block/%name%_wall_inventory.json @@ -1,6 +1,6 @@ { - "parent": "minecraft:block/wall_inventory", - "textures": { - "wall": "betterend:block/%name%" - } + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_wall_post.json b/json/block/%name%_wall_post.json index f668ca4b..dd01a06a 100644 --- a/json/block/%name%_wall_post.json +++ b/json/block/%name%_wall_post.json @@ -1,6 +1,6 @@ { - "parent": "minecraft:block/template_wall_post", - "textures": { - "wall": "betterend:block/%name%" - } + "parent": "minecraft:block/template_wall_post", + "textures": { + "wall": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_wall_side.json b/json/block/%name%_wall_side.json index 6fc8de4b..e997817b 100644 --- a/json/block/%name%_wall_side.json +++ b/json/block/%name%_wall_side.json @@ -1,6 +1,6 @@ { - "parent": "minecraft:block/template_wall_side", - "textures": { - "wall": "betterend:block/%name%" - } + "parent": "minecraft:block/template_wall_side", + "textures": { + "wall": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/block/%name%_wall_side_tall.json b/json/block/%name%_wall_side_tall.json index 9570ac1a..fe040d22 100644 --- a/json/block/%name%_wall_side_tall.json +++ b/json/block/%name%_wall_side_tall.json @@ -1,6 +1,6 @@ { - "parent": "minecraft:block/template_wall_side_tall", - "textures": { - "wall": "betterend:block/%name%" - } + "parent": "minecraft:block/template_wall_side_tall", + "textures": { + "wall": "betterend:block/%name%" + } } \ No newline at end of file diff --git a/json/blockstates/%name%.json b/json/blockstates/%name%.json index ef978798..f230067b 100644 --- a/json/blockstates/%name%.json +++ b/json/blockstates/%name%.json @@ -1,7 +1,7 @@ { - "variants": { - "": { - "model": "betterend:block/%name%" - } - } + "variants": { + "": { + "model": "betterend:block/%name%" + } + } } \ No newline at end of file diff --git a/json/blockstates/%name%_brick_slab.json b/json/blockstates/%name%_brick_slab.json index d5a6bf3e..f548c186 100644 --- a/json/blockstates/%name%_brick_slab.json +++ b/json/blockstates/%name%_brick_slab.json @@ -1,15 +1,15 @@ { - "variants": { - "type=bottom": { - "model": "betterend:block/%name%_brick_half_slab" - }, - "type=double": { - "model": "betterend:block/%name%_bricks" - }, - "type=top": { - "model": "betterend:block/%name%_brick_half_slab", - "uvlock": true, - "x": 180 - } - } + "variants": { + "type=bottom": { + "model": "betterend:block/%name%_brick_half_slab" + }, + "type=double": { + "model": "betterend:block/%name%_bricks" + }, + "type=top": { + "model": "betterend:block/%name%_brick_half_slab", + "uvlock": true, + "x": 180 + } + } } \ No newline at end of file diff --git a/json/blockstates/%name%_brick_stairs.json b/json/blockstates/%name%_brick_stairs.json index 97fbabb4..16dbadc5 100644 --- a/json/blockstates/%name%_brick_stairs.json +++ b/json/blockstates/%name%_brick_stairs.json @@ -1,209 +1,209 @@ { - "variants": { - "facing=east,half=bottom,shape=inner_left": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "y": 270 - }, - "facing=east,half=bottom,shape=inner_right": { - "model": "betterend:block/%name%_brick_inner_stairs" - }, - "facing=east,half=bottom,shape=outer_left": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "y": 270 - }, - "facing=east,half=bottom,shape=outer_right": { - "model": "betterend:block/%name%_brick_outer_stairs" - }, - "facing=east,half=bottom,shape=straight": { - "model": "betterend:block/%name%_brick_stairs" - }, - "facing=east,half=top,shape=inner_left": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "x": 180 - }, - "facing=east,half=top,shape=inner_right": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "x": 180, - "y": 90 - }, - "facing=east,half=top,shape=outer_left": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "x": 180 - }, - "facing=east,half=top,shape=outer_right": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "x": 180, - "y": 90 - }, - "facing=east,half=top,shape=straight": { - "model": "betterend:block/%name%_brick_stairs", - "uvlock": true, - "x": 180 - }, - "facing=north,half=bottom,shape=inner_left": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "y": 180 - }, - "facing=north,half=bottom,shape=inner_right": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "y": 270 - }, - "facing=north,half=bottom,shape=outer_left": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "y": 180 - }, - "facing=north,half=bottom,shape=outer_right": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "y": 270 - }, - "facing=north,half=bottom,shape=straight": { - "model": "betterend:block/%name%_brick_stairs", - "uvlock": true, - "y": 270 - }, - "facing=north,half=top,shape=inner_left": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "x": 180, - "y": 270 - }, - "facing=north,half=top,shape=inner_right": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "x": 180 - }, - "facing=north,half=top,shape=outer_left": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "x": 180, - "y": 270 - }, - "facing=north,half=top,shape=outer_right": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "x": 180 - }, - "facing=north,half=top,shape=straight": { - "model": "betterend:block/%name%_brick_stairs", - "uvlock": true, - "x": 180, - "y": 270 - }, - "facing=south,half=bottom,shape=inner_left": { - "model": "betterend:block/%name%_brick_inner_stairs" - }, - "facing=south,half=bottom,shape=inner_right": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "y": 90 - }, - "facing=south,half=bottom,shape=outer_left": { - "model": "betterend:block/%name%_brick_outer_stairs" - }, - "facing=south,half=bottom,shape=outer_right": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "y": 90 - }, - "facing=south,half=bottom,shape=straight": { - "model": "betterend:block/%name%_brick_stairs", - "uvlock": true, - "y": 90 - }, - "facing=south,half=top,shape=inner_left": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "x": 180, - "y": 90 - }, - "facing=south,half=top,shape=inner_right": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "x": 180, - "y": 180 - }, - "facing=south,half=top,shape=outer_left": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "x": 180, - "y": 90 - }, - "facing=south,half=top,shape=outer_right": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "x": 180, - "y": 180 - }, - "facing=south,half=top,shape=straight": { - "model": "betterend:block/%name%_brick_stairs", - "uvlock": true, - "x": 180, - "y": 90 - }, - "facing=west,half=bottom,shape=inner_left": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "y": 90 - }, - "facing=west,half=bottom,shape=inner_right": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "y": 180 - }, - "facing=west,half=bottom,shape=outer_left": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "y": 90 - }, - "facing=west,half=bottom,shape=outer_right": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "y": 180 - }, - "facing=west,half=bottom,shape=straight": { - "model": "betterend:block/%name%_brick_stairs", - "uvlock": true, - "y": 180 - }, - "facing=west,half=top,shape=inner_left": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "x": 180, - "y": 180 - }, - "facing=west,half=top,shape=inner_right": { - "model": "betterend:block/%name%_brick_inner_stairs", - "uvlock": true, - "x": 180, - "y": 270 - }, - "facing=west,half=top,shape=outer_left": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "x": 180, - "y": 180 - }, - "facing=west,half=top,shape=outer_right": { - "model": "betterend:block/%name%_brick_outer_stairs", - "uvlock": true, - "x": 180, - "y": 270 - }, - "facing=west,half=top,shape=straight": { - "model": "betterend:block/%name%_brick_stairs", - "uvlock": true, - "x": 180, - "y": 180 - } - } + "variants": { + "facing=east,half=bottom,shape=inner_left": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "y": 270 + }, + "facing=east,half=bottom,shape=inner_right": { + "model": "betterend:block/%name%_brick_inner_stairs" + }, + "facing=east,half=bottom,shape=outer_left": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "y": 270 + }, + "facing=east,half=bottom,shape=outer_right": { + "model": "betterend:block/%name%_brick_outer_stairs" + }, + "facing=east,half=bottom,shape=straight": { + "model": "betterend:block/%name%_brick_stairs" + }, + "facing=east,half=top,shape=inner_left": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "x": 180 + }, + "facing=east,half=top,shape=inner_right": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=east,half=top,shape=outer_left": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "x": 180 + }, + "facing=east,half=top,shape=outer_right": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=east,half=top,shape=straight": { + "model": "betterend:block/%name%_brick_stairs", + "uvlock": true, + "x": 180 + }, + "facing=north,half=bottom,shape=inner_left": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "y": 180 + }, + "facing=north,half=bottom,shape=inner_right": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "y": 270 + }, + "facing=north,half=bottom,shape=outer_left": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "y": 180 + }, + "facing=north,half=bottom,shape=outer_right": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "y": 270 + }, + "facing=north,half=bottom,shape=straight": { + "model": "betterend:block/%name%_brick_stairs", + "uvlock": true, + "y": 270 + }, + "facing=north,half=top,shape=inner_left": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=north,half=top,shape=inner_right": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "x": 180 + }, + "facing=north,half=top,shape=outer_left": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=north,half=top,shape=outer_right": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "x": 180 + }, + "facing=north,half=top,shape=straight": { + "model": "betterend:block/%name%_brick_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=south,half=bottom,shape=inner_left": { + "model": "betterend:block/%name%_brick_inner_stairs" + }, + "facing=south,half=bottom,shape=inner_right": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "y": 90 + }, + "facing=south,half=bottom,shape=outer_left": { + "model": "betterend:block/%name%_brick_outer_stairs" + }, + "facing=south,half=bottom,shape=outer_right": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "y": 90 + }, + "facing=south,half=bottom,shape=straight": { + "model": "betterend:block/%name%_brick_stairs", + "uvlock": true, + "y": 90 + }, + "facing=south,half=top,shape=inner_left": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=south,half=top,shape=inner_right": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=south,half=top,shape=outer_left": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=south,half=top,shape=outer_right": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=south,half=top,shape=straight": { + "model": "betterend:block/%name%_brick_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=west,half=bottom,shape=inner_left": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "y": 90 + }, + "facing=west,half=bottom,shape=inner_right": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "y": 180 + }, + "facing=west,half=bottom,shape=outer_left": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "y": 90 + }, + "facing=west,half=bottom,shape=outer_right": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "y": 180 + }, + "facing=west,half=bottom,shape=straight": { + "model": "betterend:block/%name%_brick_stairs", + "uvlock": true, + "y": 180 + }, + "facing=west,half=top,shape=inner_left": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=west,half=top,shape=inner_right": { + "model": "betterend:block/%name%_brick_inner_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=west,half=top,shape=outer_left": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=west,half=top,shape=outer_right": { + "model": "betterend:block/%name%_brick_outer_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=west,half=top,shape=straight": { + "model": "betterend:block/%name%_brick_stairs", + "uvlock": true, + "x": 180, + "y": 180 + } + } } \ No newline at end of file diff --git a/json/blockstates/%name%_brick_wall.json b/json/blockstates/%name%_brick_wall.json index 17f3910d..346ac2f1 100644 --- a/json/blockstates/%name%_brick_wall.json +++ b/json/blockstates/%name%_brick_wall.json @@ -1,90 +1,90 @@ { - "multipart": [ - { - "when": { - "up": "true" - }, - "apply": { - "model": "betterend:block/%name%_brick_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "betterend:block/%name%_brick_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "betterend:block/%name%_brick_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "betterend:block/%name%_brick_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "betterend:block/%name%_brick_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "betterend:block/%name%_brick_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "betterend:block/%name%_brick_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "betterend:block/%name%_brick_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "betterend:block/%name%_brick_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] + "multipart": [ + { + "when": { + "up": "true" + }, + "apply": { + "model": "betterend:block/%name%_brick_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "betterend:block/%name%_brick_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "betterend:block/%name%_brick_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "betterend:block/%name%_brick_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "betterend:block/%name%_brick_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "betterend:block/%name%_brick_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "betterend:block/%name%_brick_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "betterend:block/%name%_brick_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "betterend:block/%name%_brick_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] } \ No newline at end of file diff --git a/json/blockstates/%name%_bricks.json b/json/blockstates/%name%_bricks.json index d55de86c..1851167f 100644 --- a/json/blockstates/%name%_bricks.json +++ b/json/blockstates/%name%_bricks.json @@ -1,7 +1,7 @@ { - "variants": { - "": { - "model": "betterend:block/%name%_bricks" - } - } + "variants": { + "": { + "model": "betterend:block/%name%_bricks" + } + } } \ No newline at end of file diff --git a/json/blockstates/%name%_button.json b/json/blockstates/%name%_button.json index f0a946f9..60701fd4 100644 --- a/json/blockstates/%name%_button.json +++ b/json/blockstates/%name%_button.json @@ -1,118 +1,118 @@ { - "variants": { - "face=ceiling,facing=east,powered=false": { - "model": "betterend:block/%name%_button", - "x": 180, - "y": 270 - }, - "face=ceiling,facing=east,powered=true": { - "model": "betterend:block/%name%_button_pressed", - "x": 180, - "y": 270 - }, - "face=ceiling,facing=north,powered=false": { - "model": "betterend:block/%name%_button", - "x": 180, - "y": 180 - }, - "face=ceiling,facing=north,powered=true": { - "model": "betterend:block/%name%_button_pressed", - "x": 180, - "y": 180 - }, - "face=ceiling,facing=south,powered=false": { - "model": "betterend:block/%name%_button", - "x": 180 - }, - "face=ceiling,facing=south,powered=true": { - "model": "betterend:block/%name%_button_pressed", - "x": 180 - }, - "face=ceiling,facing=west,powered=false": { - "model": "betterend:block/%name%_button", - "x": 180, - "y": 90 - }, - "face=ceiling,facing=west,powered=true": { - "model": "betterend:block/%name%_button_pressed", - "x": 180, - "y": 90 - }, - "face=floor,facing=east,powered=false": { - "model": "betterend:block/%name%_button", - "y": 90 - }, - "face=floor,facing=east,powered=true": { - "model": "betterend:block/%name%_button_pressed", - "y": 90 - }, - "face=floor,facing=north,powered=false": { - "model": "betterend:block/%name%_button" - }, - "face=floor,facing=north,powered=true": { - "model": "betterend:block/%name%_button_pressed" - }, - "face=floor,facing=south,powered=false": { - "model": "betterend:block/%name%_button", - "y": 180 - }, - "face=floor,facing=south,powered=true": { - "model": "betterend:block/%name%_button_pressed", - "y": 180 - }, - "face=floor,facing=west,powered=false": { - "model": "betterend:block/%name%_button", - "y": 270 - }, - "face=floor,facing=west,powered=true": { - "model": "betterend:block/%name%_button_pressed", - "y": 270 - }, - "face=wall,facing=east,powered=false": { - "model": "betterend:block/%name%_button", - "uvlock": true, - "x": 90, - "y": 90 - }, - "face=wall,facing=east,powered=true": { - "model": "betterend:block/%name%_button_pressed", - "uvlock": true, - "x": 90, - "y": 90 - }, - "face=wall,facing=north,powered=false": { - "model": "betterend:block/%name%_button", - "uvlock": true, - "x": 90 - }, - "face=wall,facing=north,powered=true": { - "model": "betterend:block/%name%_button_pressed", - "uvlock": true, - "x": 90 - }, - "face=wall,facing=south,powered=false": { - "model": "betterend:block/%name%_button", - "uvlock": true, - "x": 90, - "y": 180 - }, - "face=wall,facing=south,powered=true": { - "model": "betterend:block/%name%_button_pressed", - "uvlock": true, - "x": 90, - "y": 180 - }, - "face=wall,facing=west,powered=false": { - "model": "betterend:block/%name%_button", - "uvlock": true, - "x": 90, - "y": 270 - }, - "face=wall,facing=west,powered=true": { - "model": "betterend:block/%name%_button_pressed", - "uvlock": true, - "x": 90, - "y": 270 - } - } + "variants": { + "face=ceiling,facing=east,powered=false": { + "model": "betterend:block/%name%_button", + "x": 180, + "y": 270 + }, + "face=ceiling,facing=east,powered=true": { + "model": "betterend:block/%name%_button_pressed", + "x": 180, + "y": 270 + }, + "face=ceiling,facing=north,powered=false": { + "model": "betterend:block/%name%_button", + "x": 180, + "y": 180 + }, + "face=ceiling,facing=north,powered=true": { + "model": "betterend:block/%name%_button_pressed", + "x": 180, + "y": 180 + }, + "face=ceiling,facing=south,powered=false": { + "model": "betterend:block/%name%_button", + "x": 180 + }, + "face=ceiling,facing=south,powered=true": { + "model": "betterend:block/%name%_button_pressed", + "x": 180 + }, + "face=ceiling,facing=west,powered=false": { + "model": "betterend:block/%name%_button", + "x": 180, + "y": 90 + }, + "face=ceiling,facing=west,powered=true": { + "model": "betterend:block/%name%_button_pressed", + "x": 180, + "y": 90 + }, + "face=floor,facing=east,powered=false": { + "model": "betterend:block/%name%_button", + "y": 90 + }, + "face=floor,facing=east,powered=true": { + "model": "betterend:block/%name%_button_pressed", + "y": 90 + }, + "face=floor,facing=north,powered=false": { + "model": "betterend:block/%name%_button" + }, + "face=floor,facing=north,powered=true": { + "model": "betterend:block/%name%_button_pressed" + }, + "face=floor,facing=south,powered=false": { + "model": "betterend:block/%name%_button", + "y": 180 + }, + "face=floor,facing=south,powered=true": { + "model": "betterend:block/%name%_button_pressed", + "y": 180 + }, + "face=floor,facing=west,powered=false": { + "model": "betterend:block/%name%_button", + "y": 270 + }, + "face=floor,facing=west,powered=true": { + "model": "betterend:block/%name%_button_pressed", + "y": 270 + }, + "face=wall,facing=east,powered=false": { + "model": "betterend:block/%name%_button", + "uvlock": true, + "x": 90, + "y": 90 + }, + "face=wall,facing=east,powered=true": { + "model": "betterend:block/%name%_button_pressed", + "uvlock": true, + "x": 90, + "y": 90 + }, + "face=wall,facing=north,powered=false": { + "model": "betterend:block/%name%_button", + "uvlock": true, + "x": 90 + }, + "face=wall,facing=north,powered=true": { + "model": "betterend:block/%name%_button_pressed", + "uvlock": true, + "x": 90 + }, + "face=wall,facing=south,powered=false": { + "model": "betterend:block/%name%_button", + "uvlock": true, + "x": 90, + "y": 180 + }, + "face=wall,facing=south,powered=true": { + "model": "betterend:block/%name%_button_pressed", + "uvlock": true, + "x": 90, + "y": 180 + }, + "face=wall,facing=west,powered=false": { + "model": "betterend:block/%name%_button", + "uvlock": true, + "x": 90, + "y": 270 + }, + "face=wall,facing=west,powered=true": { + "model": "betterend:block/%name%_button_pressed", + "uvlock": true, + "x": 90, + "y": 270 + } + } } \ No newline at end of file diff --git a/json/blockstates/%name%_pillar.json b/json/blockstates/%name%_pillar.json index 27ec0347..5ff8dab2 100644 --- a/json/blockstates/%name%_pillar.json +++ b/json/blockstates/%name%_pillar.json @@ -1,7 +1,16 @@ { - "variants": { - "axis=x": { "model": "betterend:block/%name%_pillar", "x": 90, "y": 90 }, - "axis=y": { "model": "betterend:block/%name%_pillar" }, - "axis=z": { "model": "betterend:block/%name%_pillar", "x": 90 } - } + "variants": { + "axis=x": { + "model": "betterend:block/%name%_pillar", + "x": 90, + "y": 90 + }, + "axis=y": { + "model": "betterend:block/%name%_pillar" + }, + "axis=z": { + "model": "betterend:block/%name%_pillar", + "x": 90 + } + } } \ No newline at end of file diff --git a/json/blockstates/%name%_plate.json b/json/blockstates/%name%_plate.json index 4060f8da..f7c1e4bd 100644 --- a/json/blockstates/%name%_plate.json +++ b/json/blockstates/%name%_plate.json @@ -1,10 +1,10 @@ { - "variants": { - "powered=false": { - "model": "betterend:block/%name%_pressure_plate_up" - }, - "powered=true": { - "model": "betterend:block/%name%_pressure_plate_down" - } - } + "variants": { + "powered=false": { + "model": "betterend:block/%name%_pressure_plate_up" + }, + "powered=true": { + "model": "betterend:block/%name%_pressure_plate_down" + } + } } \ No newline at end of file diff --git a/json/blockstates/%name%_slab.json b/json/blockstates/%name%_slab.json index 17875e4c..e99a19da 100644 --- a/json/blockstates/%name%_slab.json +++ b/json/blockstates/%name%_slab.json @@ -1,15 +1,15 @@ { - "variants": { - "type=bottom": { - "model": "betterend:block/%name%_half_slab" - }, - "type=double": { - "model": "betterend:block/%name%" - }, - "type=top": { - "model": "betterend:block/%name%_half_slab", - "uvlock": true, - "x": 180 - } - } + "variants": { + "type=bottom": { + "model": "betterend:block/%name%_half_slab" + }, + "type=double": { + "model": "betterend:block/%name%" + }, + "type=top": { + "model": "betterend:block/%name%_half_slab", + "uvlock": true, + "x": 180 + } + } } \ No newline at end of file diff --git a/json/blockstates/%name%_small_tiles.json b/json/blockstates/%name%_small_tiles.json index 5a84411b..f4f1f62a 100644 --- a/json/blockstates/%name%_small_tiles.json +++ b/json/blockstates/%name%_small_tiles.json @@ -1,7 +1,7 @@ { - "variants": { - "": { - "model": "betterend:block/%name%_small_tiles" - } - } + "variants": { + "": { + "model": "betterend:block/%name%_small_tiles" + } + } } \ No newline at end of file diff --git a/json/blockstates/%name%_stairs.json b/json/blockstates/%name%_stairs.json index 685e1861..54b129ce 100644 --- a/json/blockstates/%name%_stairs.json +++ b/json/blockstates/%name%_stairs.json @@ -1,209 +1,209 @@ { - "variants": { - "facing=east,half=bottom,shape=inner_left": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "y": 270 - }, - "facing=east,half=bottom,shape=inner_right": { - "model": "betterend:block/%name%_inner_stairs" - }, - "facing=east,half=bottom,shape=outer_left": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "y": 270 - }, - "facing=east,half=bottom,shape=outer_right": { - "model": "betterend:block/%name%_outer_stairs" - }, - "facing=east,half=bottom,shape=straight": { - "model": "betterend:block/%name%_stairs" - }, - "facing=east,half=top,shape=inner_left": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "x": 180 - }, - "facing=east,half=top,shape=inner_right": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "x": 180, - "y": 90 - }, - "facing=east,half=top,shape=outer_left": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "x": 180 - }, - "facing=east,half=top,shape=outer_right": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "x": 180, - "y": 90 - }, - "facing=east,half=top,shape=straight": { - "model": "betterend:block/%name%_stairs", - "uvlock": true, - "x": 180 - }, - "facing=north,half=bottom,shape=inner_left": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "y": 180 - }, - "facing=north,half=bottom,shape=inner_right": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "y": 270 - }, - "facing=north,half=bottom,shape=outer_left": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "y": 180 - }, - "facing=north,half=bottom,shape=outer_right": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "y": 270 - }, - "facing=north,half=bottom,shape=straight": { - "model": "betterend:block/%name%_stairs", - "uvlock": true, - "y": 270 - }, - "facing=north,half=top,shape=inner_left": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "x": 180, - "y": 270 - }, - "facing=north,half=top,shape=inner_right": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "x": 180 - }, - "facing=north,half=top,shape=outer_left": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "x": 180, - "y": 270 - }, - "facing=north,half=top,shape=outer_right": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "x": 180 - }, - "facing=north,half=top,shape=straight": { - "model": "betterend:block/%name%_stairs", - "uvlock": true, - "x": 180, - "y": 270 - }, - "facing=south,half=bottom,shape=inner_left": { - "model": "betterend:block/%name%_inner_stairs" - }, - "facing=south,half=bottom,shape=inner_right": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "y": 90 - }, - "facing=south,half=bottom,shape=outer_left": { - "model": "betterend:block/%name%_outer_stairs" - }, - "facing=south,half=bottom,shape=outer_right": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "y": 90 - }, - "facing=south,half=bottom,shape=straight": { - "model": "betterend:block/%name%_stairs", - "uvlock": true, - "y": 90 - }, - "facing=south,half=top,shape=inner_left": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "x": 180, - "y": 90 - }, - "facing=south,half=top,shape=inner_right": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "x": 180, - "y": 180 - }, - "facing=south,half=top,shape=outer_left": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "x": 180, - "y": 90 - }, - "facing=south,half=top,shape=outer_right": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "x": 180, - "y": 180 - }, - "facing=south,half=top,shape=straight": { - "model": "betterend:block/%name%_stairs", - "uvlock": true, - "x": 180, - "y": 90 - }, - "facing=west,half=bottom,shape=inner_left": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "y": 90 - }, - "facing=west,half=bottom,shape=inner_right": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "y": 180 - }, - "facing=west,half=bottom,shape=outer_left": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "y": 90 - }, - "facing=west,half=bottom,shape=outer_right": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "y": 180 - }, - "facing=west,half=bottom,shape=straight": { - "model": "betterend:block/%name%_stairs", - "uvlock": true, - "y": 180 - }, - "facing=west,half=top,shape=inner_left": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "x": 180, - "y": 180 - }, - "facing=west,half=top,shape=inner_right": { - "model": "betterend:block/%name%_inner_stairs", - "uvlock": true, - "x": 180, - "y": 270 - }, - "facing=west,half=top,shape=outer_left": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "x": 180, - "y": 180 - }, - "facing=west,half=top,shape=outer_right": { - "model": "betterend:block/%name%_outer_stairs", - "uvlock": true, - "x": 180, - "y": 270 - }, - "facing=west,half=top,shape=straight": { - "model": "betterend:block/%name%_stairs", - "uvlock": true, - "x": 180, - "y": 180 - } - } + "variants": { + "facing=east,half=bottom,shape=inner_left": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "y": 270 + }, + "facing=east,half=bottom,shape=inner_right": { + "model": "betterend:block/%name%_inner_stairs" + }, + "facing=east,half=bottom,shape=outer_left": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "y": 270 + }, + "facing=east,half=bottom,shape=outer_right": { + "model": "betterend:block/%name%_outer_stairs" + }, + "facing=east,half=bottom,shape=straight": { + "model": "betterend:block/%name%_stairs" + }, + "facing=east,half=top,shape=inner_left": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "x": 180 + }, + "facing=east,half=top,shape=inner_right": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=east,half=top,shape=outer_left": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "x": 180 + }, + "facing=east,half=top,shape=outer_right": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=east,half=top,shape=straight": { + "model": "betterend:block/%name%_stairs", + "uvlock": true, + "x": 180 + }, + "facing=north,half=bottom,shape=inner_left": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "y": 180 + }, + "facing=north,half=bottom,shape=inner_right": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "y": 270 + }, + "facing=north,half=bottom,shape=outer_left": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "y": 180 + }, + "facing=north,half=bottom,shape=outer_right": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "y": 270 + }, + "facing=north,half=bottom,shape=straight": { + "model": "betterend:block/%name%_stairs", + "uvlock": true, + "y": 270 + }, + "facing=north,half=top,shape=inner_left": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=north,half=top,shape=inner_right": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "x": 180 + }, + "facing=north,half=top,shape=outer_left": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=north,half=top,shape=outer_right": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "x": 180 + }, + "facing=north,half=top,shape=straight": { + "model": "betterend:block/%name%_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=south,half=bottom,shape=inner_left": { + "model": "betterend:block/%name%_inner_stairs" + }, + "facing=south,half=bottom,shape=inner_right": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "y": 90 + }, + "facing=south,half=bottom,shape=outer_left": { + "model": "betterend:block/%name%_outer_stairs" + }, + "facing=south,half=bottom,shape=outer_right": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "y": 90 + }, + "facing=south,half=bottom,shape=straight": { + "model": "betterend:block/%name%_stairs", + "uvlock": true, + "y": 90 + }, + "facing=south,half=top,shape=inner_left": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=south,half=top,shape=inner_right": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=south,half=top,shape=outer_left": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=south,half=top,shape=outer_right": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=south,half=top,shape=straight": { + "model": "betterend:block/%name%_stairs", + "uvlock": true, + "x": 180, + "y": 90 + }, + "facing=west,half=bottom,shape=inner_left": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "y": 90 + }, + "facing=west,half=bottom,shape=inner_right": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "y": 180 + }, + "facing=west,half=bottom,shape=outer_left": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "y": 90 + }, + "facing=west,half=bottom,shape=outer_right": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "y": 180 + }, + "facing=west,half=bottom,shape=straight": { + "model": "betterend:block/%name%_stairs", + "uvlock": true, + "y": 180 + }, + "facing=west,half=top,shape=inner_left": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=west,half=top,shape=inner_right": { + "model": "betterend:block/%name%_inner_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=west,half=top,shape=outer_left": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "x": 180, + "y": 180 + }, + "facing=west,half=top,shape=outer_right": { + "model": "betterend:block/%name%_outer_stairs", + "uvlock": true, + "x": 180, + "y": 270 + }, + "facing=west,half=top,shape=straight": { + "model": "betterend:block/%name%_stairs", + "uvlock": true, + "x": 180, + "y": 180 + } + } } \ No newline at end of file diff --git a/json/blockstates/%name%_tile.json b/json/blockstates/%name%_tile.json index b9f56911..7608ad47 100644 --- a/json/blockstates/%name%_tile.json +++ b/json/blockstates/%name%_tile.json @@ -1,7 +1,7 @@ { - "variants": { - "": { - "model": "betterend:block/%name%_tile" - } - } + "variants": { + "": { + "model": "betterend:block/%name%_tile" + } + } } \ No newline at end of file diff --git a/json/blockstates/%name%_wall.json b/json/blockstates/%name%_wall.json index 3d81eb45..e2107bcd 100644 --- a/json/blockstates/%name%_wall.json +++ b/json/blockstates/%name%_wall.json @@ -1,90 +1,90 @@ { - "multipart": [ - { - "when": { - "up": "true" - }, - "apply": { - "model": "betterend:block/%name%_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "betterend:block/%name%_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "betterend:block/%name%_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "betterend:block/%name%_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "betterend:block/%name%_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "betterend:block/%name%_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "betterend:block/%name%_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "betterend:block/%name%_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "betterend:block/%name%_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] + "multipart": [ + { + "when": { + "up": "true" + }, + "apply": { + "model": "betterend:block/%name%_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "betterend:block/%name%_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "betterend:block/%name%_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "betterend:block/%name%_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "betterend:block/%name%_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "betterend:block/%name%_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "betterend:block/%name%_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "betterend:block/%name%_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "betterend:block/%name%_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] } \ No newline at end of file diff --git a/json/item/%name%.json b/json/item/%name%.json index 82508cd3..fa3a6fe2 100644 --- a/json/item/%name%.json +++ b/json/item/%name%.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%" + "parent": "betterend:block/%name%" } \ No newline at end of file diff --git a/json/item/%name%_brick_slab.json b/json/item/%name%_brick_slab.json index c148cf65..99e58c89 100644 --- a/json/item/%name%_brick_slab.json +++ b/json/item/%name%_brick_slab.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_brick_half_slab" + "parent": "betterend:block/%name%_brick_half_slab" } \ No newline at end of file diff --git a/json/item/%name%_brick_stairs.json b/json/item/%name%_brick_stairs.json index 24b61896..532344a8 100644 --- a/json/item/%name%_brick_stairs.json +++ b/json/item/%name%_brick_stairs.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_brick_stairs" + "parent": "betterend:block/%name%_brick_stairs" } \ No newline at end of file diff --git a/json/item/%name%_brick_wall.json b/json/item/%name%_brick_wall.json index 1e902ec4..fb1bd7a9 100644 --- a/json/item/%name%_brick_wall.json +++ b/json/item/%name%_brick_wall.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_brick_wall_inventory" + "parent": "betterend:block/%name%_brick_wall_inventory" } \ No newline at end of file diff --git a/json/item/%name%_bricks.json b/json/item/%name%_bricks.json index 56ce6003..aaa903bd 100644 --- a/json/item/%name%_bricks.json +++ b/json/item/%name%_bricks.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_bricks" + "parent": "betterend:block/%name%_bricks" } \ No newline at end of file diff --git a/json/item/%name%_button.json b/json/item/%name%_button.json index 240fb2d7..83518a8e 100644 --- a/json/item/%name%_button.json +++ b/json/item/%name%_button.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_button_inventory" + "parent": "betterend:block/%name%_button_inventory" } \ No newline at end of file diff --git a/json/item/%name%_pillar.json b/json/item/%name%_pillar.json index a6257b38..a05144eb 100644 --- a/json/item/%name%_pillar.json +++ b/json/item/%name%_pillar.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_pillar" + "parent": "betterend:block/%name%_pillar" } \ No newline at end of file diff --git a/json/item/%name%_plate.json b/json/item/%name%_plate.json index d774f9bc..e0815368 100644 --- a/json/item/%name%_plate.json +++ b/json/item/%name%_plate.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_pressure_plate_up" + "parent": "betterend:block/%name%_pressure_plate_up" } \ No newline at end of file diff --git a/json/item/%name%_slab.json b/json/item/%name%_slab.json index 1c83dcd9..f6f23abc 100644 --- a/json/item/%name%_slab.json +++ b/json/item/%name%_slab.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_half_slab" + "parent": "betterend:block/%name%_half_slab" } \ No newline at end of file diff --git a/json/item/%name%_small_tiles.json b/json/item/%name%_small_tiles.json index 46e284e5..21315991 100644 --- a/json/item/%name%_small_tiles.json +++ b/json/item/%name%_small_tiles.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_small_tiles" + "parent": "betterend:block/%name%_small_tiles" } \ No newline at end of file diff --git a/json/item/%name%_stairs.json b/json/item/%name%_stairs.json index c4871532..2de302c2 100644 --- a/json/item/%name%_stairs.json +++ b/json/item/%name%_stairs.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_stairs" + "parent": "betterend:block/%name%_stairs" } \ No newline at end of file diff --git a/json/item/%name%_tile.json b/json/item/%name%_tile.json index ad863533..bb10a897 100644 --- a/json/item/%name%_tile.json +++ b/json/item/%name%_tile.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_tile" + "parent": "betterend:block/%name%_tile" } \ No newline at end of file diff --git a/json/item/%name%_wall.json b/json/item/%name%_wall.json index 59b31173..a6cf400d 100644 --- a/json/item/%name%_wall.json +++ b/json/item/%name%_wall.json @@ -1,3 +1,3 @@ { - "parent": "betterend:block/%name%_wall_inventory" + "parent": "betterend:block/%name%_wall_inventory" } \ No newline at end of file diff --git a/src/main/java/ru/betterend/BetterEnd.java b/src/main/java/ru/betterend/BetterEnd.java index b18c01fe..9e4d49b5 100644 --- a/src/main/java/ru/betterend/BetterEnd.java +++ b/src/main/java/ru/betterend/BetterEnd.java @@ -33,7 +33,7 @@ import ru.betterend.world.surface.SurfaceBuilders; public class BetterEnd implements ModInitializer { public static final String MOD_ID = "betterend"; public static final Logger LOGGER = new Logger(MOD_ID); - + @Override public void onInitialize() { WorldDataAPI.registerModCache(MOD_ID); @@ -62,15 +62,15 @@ public class BetterEnd implements ModInitializer { Integrations.init(); Configs.saveConfigs(); } - + public static ResourceLocation makeID(String path) { return new ResourceLocation(MOD_ID, path); } - + public static String getStringId(String id) { return String.format("%s:%s", MOD_ID, id); } - + public static boolean isModId(ResourceLocation id) { return id.getNamespace().equals(MOD_ID); } diff --git a/src/main/java/ru/betterend/api/BetterEndPlugin.java b/src/main/java/ru/betterend/api/BetterEndPlugin.java index afc8daeb..5e961c65 100644 --- a/src/main/java/ru/betterend/api/BetterEndPlugin.java +++ b/src/main/java/ru/betterend/api/BetterEndPlugin.java @@ -7,28 +7,28 @@ public interface BetterEndPlugin { */ default void registerAlloyingRecipes() { } - + /** * Smithing recipes registration. * See AnvilSmithingRecipe.Builder for details. */ default void registerSmithingRecipes() { } - + /** * Additional biomes registration. * See BiomeRegistry.registerBiome for details. */ default void registerEndBiomes() { } - + /** * Register other mod stuff, for example, EndHammers. */ default void registerOthers() { } - - + + public static void register(BetterEndPlugin plugin) { plugin.registerAlloyingRecipes(); plugin.registerSmithingRecipes(); diff --git a/src/main/java/ru/betterend/blocks/AeterniumAnvil.java b/src/main/java/ru/betterend/blocks/AeterniumAnvil.java index 7233dedb..b74848dd 100644 --- a/src/main/java/ru/betterend/blocks/AeterniumAnvil.java +++ b/src/main/java/ru/betterend/blocks/AeterniumAnvil.java @@ -9,14 +9,14 @@ import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndItems; public class AeterniumAnvil extends EndAnvilBlock { - + protected final Item anvilItem; - + public AeterniumAnvil() { super(EndBlocks.AETERNIUM_BLOCK.defaultMaterialColor(), EndToolMaterial.AETERNIUM.getLevel()); this.anvilItem = EndItems.registerEndItem("aeternuim_anvil_item", new EndAnvilItem(this)); } - + @Override public IntegerProperty getDurability() { if (durability == null) { @@ -25,7 +25,7 @@ public class AeterniumAnvil extends EndAnvilBlock { } return durability; } - + @Override public Item asItem() { return anvilItem; diff --git a/src/main/java/ru/betterend/blocks/AeterniumBlock.java b/src/main/java/ru/betterend/blocks/AeterniumBlock.java index d176689d..edbfed1d 100644 --- a/src/main/java/ru/betterend/blocks/AeterniumBlock.java +++ b/src/main/java/ru/betterend/blocks/AeterniumBlock.java @@ -12,15 +12,11 @@ import net.minecraft.world.level.material.MaterialColor; import ru.bclib.blocks.BaseBlock; public class AeterniumBlock extends BaseBlock { - + public AeterniumBlock() { - super(FabricBlockSettings.of(Material.METAL, MaterialColor.COLOR_GRAY) - .hardness(65F) - .resistance(1200F) - .requiresCorrectToolForDrops() - .sound(SoundType.NETHERITE_BLOCK)); + super(FabricBlockSettings.of(Material.METAL, MaterialColor.COLOR_GRAY).hardness(65F).resistance(1200F).requiresCorrectToolForDrops().sound(SoundType.NETHERITE_BLOCK)); } - + @Environment(EnvType.CLIENT) public int getColor(BlockState state, BlockGetter world, BlockPos pos) { return 0xFF657A7A; diff --git a/src/main/java/ru/betterend/blocks/AmaranitaHymenophoreBlock.java b/src/main/java/ru/betterend/blocks/AmaranitaHymenophoreBlock.java index a3f14802..121652c6 100644 --- a/src/main/java/ru/betterend/blocks/AmaranitaHymenophoreBlock.java +++ b/src/main/java/ru/betterend/blocks/AmaranitaHymenophoreBlock.java @@ -12,7 +12,7 @@ public class AmaranitaHymenophoreBlock extends BaseBlock implements IRenderTyped public AmaranitaHymenophoreBlock() { super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sound(SoundType.WOOD)); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; diff --git a/src/main/java/ru/betterend/blocks/AncientEmeraldIceBlock.java b/src/main/java/ru/betterend/blocks/AncientEmeraldIceBlock.java index ce9f48a7..243f7634 100644 --- a/src/main/java/ru/betterend/blocks/AncientEmeraldIceBlock.java +++ b/src/main/java/ru/betterend/blocks/AncientEmeraldIceBlock.java @@ -25,11 +25,11 @@ public class AncientEmeraldIceBlock extends BaseBlock { public AncientEmeraldIceBlock() { super(FabricBlockSettings.copyOf(Blocks.BLUE_ICE).randomTicks()); } - + @Override public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) { Direction dir = BlocksHelper.randomDirection(random); - + if (random.nextBoolean()) { int x = MHelper.randRange(-2, 2, random); int y = MHelper.randRange(-2, 2, random); @@ -40,7 +40,7 @@ public class AncientEmeraldIceBlock extends BaseBlock { makeParticles(world, p, random); } } - + pos = pos.relative(dir); state = world.getBlockState(pos); if (state.is(Blocks.WATER)) { @@ -52,11 +52,11 @@ public class AncientEmeraldIceBlock extends BaseBlock { makeParticles(world, pos, random); } } - + private void makeParticles(ServerLevel world, BlockPos pos, Random random) { world.sendParticles(EndParticles.SNOWFLAKE, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 20, 0.5, 0.5, 0.5, 0); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL); diff --git a/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java b/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java index a69171d5..82bd0f28 100644 --- a/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java +++ b/src/main/java/ru/betterend/blocks/AuroraCrystalBlock.java @@ -31,19 +31,11 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp public static final Vec3i[] COLORS; private static final int MIN_DROP = 1; private static final int MAX_DROP = 4; - + public AuroraCrystalBlock() { - super(FabricBlockSettings.of(Material.GLASS) - .breakByTool(FabricToolTags.PICKAXES) - .breakByTool(TagAPI.HAMMERS) - .hardness(1F) - .resistance(1F) - .luminance(15) - .noOcclusion() - .isSuffocating((state, world, pos) -> false) - .sound(SoundType.GLASS)); + super(FabricBlockSettings.of(Material.GLASS).breakByTool(FabricToolTags.PICKAXES).breakByTool(TagAPI.HAMMERS).hardness(1F).resistance(1F).luminance(15).noOcclusion().isSuffocating((state, world, pos) -> false).sound(SoundType.GLASS)); } - + @Override public BlockColor getProvider() { return (state, world, pos, tintIndex) -> { @@ -51,37 +43,37 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp pos = BlockPos.ZERO; } ; - + long i = (long) pos.getX() + (long) pos.getY() + (long) pos.getZ(); double delta = i * 0.1; int index = MHelper.floor(delta); int index2 = (index + 1) & 3; delta -= index; index &= 3; - + Vec3i color1 = COLORS[index]; Vec3i color2 = COLORS[index2]; - + int r = MHelper.floor(Mth.lerp(delta, color1.getX(), color2.getX())); int g = MHelper.floor(Mth.lerp(delta, color1.getY(), color2.getY())); int b = MHelper.floor(Mth.lerp(delta, color1.getZ(), color2.getZ())); - + return ColorUtil.color(r, g, b); }; } - + @Override public ItemColor getItemProvider() { return (stack, tintIndex) -> { return ColorUtil.color(COLORS[3].getX(), COLORS[3].getY(), COLORS[3].getZ()); }; } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.TRANSLUCENT; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); @@ -107,13 +99,8 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp } return Lists.newArrayList(); } - + static { - COLORS = new Vec3i[]{ - new Vec3i(247, 77, 161), - new Vec3i(120, 184, 255), - new Vec3i(120, 255, 168), - new Vec3i(243, 58, 255) - }; + COLORS = new Vec3i[]{new Vec3i(247, 77, 161), new Vec3i(120, 184, 255), new Vec3i(120, 255, 168), new Vec3i(243, 58, 255)}; } } diff --git a/src/main/java/ru/betterend/blocks/BlueVineBlock.java b/src/main/java/ru/betterend/blocks/BlueVineBlock.java index c73f3add..5e13a8f5 100644 --- a/src/main/java/ru/betterend/blocks/BlueVineBlock.java +++ b/src/main/java/ru/betterend/blocks/BlueVineBlock.java @@ -10,12 +10,12 @@ import ru.betterend.registry.EndBlocks; public class BlueVineBlock extends UpDownPlantBlock { public static final EnumProperty SHAPE = BlockProperties.TRIPLE_SHAPE; - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(SHAPE); } - + @Override protected boolean isTerrain(BlockState state) { return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM; diff --git a/src/main/java/ru/betterend/blocks/BlueVineLanternBlock.java b/src/main/java/ru/betterend/blocks/BlueVineLanternBlock.java index 98509b60..bec0c00e 100644 --- a/src/main/java/ru/betterend/blocks/BlueVineLanternBlock.java +++ b/src/main/java/ru/betterend/blocks/BlueVineLanternBlock.java @@ -19,17 +19,17 @@ import ru.betterend.registry.EndBlocks; public class BlueVineLanternBlock extends BaseBlock { public static final BooleanProperty NATURAL = BlockProperties.NATURAL; - + public BlueVineLanternBlock() { super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).luminance(15).sound(SoundType.WART_BLOCK)); this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false)); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { return !state.getValue(NATURAL) || world.getBlockState(pos.below()).getBlock() == EndBlocks.BLUE_VINE; } - + @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { if (!canSurvive(state, world, pos)) { @@ -39,7 +39,7 @@ public class BlueVineLanternBlock extends BaseBlock { return state; } } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(NATURAL); diff --git a/src/main/java/ru/betterend/blocks/BlueVineSeedBlock.java b/src/main/java/ru/betterend/blocks/BlueVineSeedBlock.java index c80586dd..254a814b 100644 --- a/src/main/java/ru/betterend/blocks/BlueVineSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/BlueVineSeedBlock.java @@ -29,7 +29,7 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock { BlocksHelper.setWithoutUpdate(world, pos.above(height), EndBlocks.BLUE_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP)); placeLantern(world, pos.above(height + 1)); } - + private void placeLantern(WorldGenLevel world, BlockPos pos) { BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true)); for (Direction dir : BlocksHelper.HORIZONTAL) { @@ -42,12 +42,12 @@ public class BlueVineSeedBlock extends EndPlantWithAgeBlock { BlocksHelper.setWithoutUpdate(world, pos.above(), EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.UP)); } } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.END_MOSS) || state.is(EndBlocks.END_MYCELIUM); } - + @Override public BlockBehaviour.OffsetType getOffsetType() { return BlockBehaviour.OffsetType.NONE; diff --git a/src/main/java/ru/betterend/blocks/BoluxMushroomBlock.java b/src/main/java/ru/betterend/blocks/BoluxMushroomBlock.java index 83d9c0d7..682e10de 100644 --- a/src/main/java/ru/betterend/blocks/BoluxMushroomBlock.java +++ b/src/main/java/ru/betterend/blocks/BoluxMushroomBlock.java @@ -19,36 +19,36 @@ import java.util.Random; public class BoluxMushroomBlock extends EndPlantBlock { private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 9, 15); - + public BoluxMushroomBlock() { super(10); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.RUTISCUS); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return SHAPE; } - + @Override public BlockBehaviour.OffsetType getOffsetType() { return BlockBehaviour.OffsetType.NONE; } - + @Override public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) { return false; } - + @Override public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) { return false; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { return Lists.newArrayList(new ItemStack(this)); diff --git a/src/main/java/ru/betterend/blocks/BrimstoneBlock.java b/src/main/java/ru/betterend/blocks/BrimstoneBlock.java index 2a2e9140..83befb84 100644 --- a/src/main/java/ru/betterend/blocks/BrimstoneBlock.java +++ b/src/main/java/ru/betterend/blocks/BrimstoneBlock.java @@ -26,30 +26,30 @@ import java.util.Random; public class BrimstoneBlock extends BaseBlock { public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE; - + public BrimstoneBlock() { super(FabricBlockSettings.copyOf(Blocks.END_STONE).materialColor(MaterialColor.COLOR_BROWN).randomTicks()); registerDefaultState(stateDefinition.any().setValue(ACTIVATED, false)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(ACTIVATED); } - + @Override public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) { if (world.isClientSide()) { updateChunks((ClientLevel) world, pos); } } - + public void destroy(LevelAccessor world, BlockPos pos, BlockState state) { if (world.isClientSide()) { updateChunks((ClientLevel) world, pos); } } - + private void updateChunks(ClientLevel world, BlockPos pos) { int y = pos.getY() >> 4; int x1 = (pos.getX() - 2) >> 4; @@ -62,7 +62,7 @@ public class BrimstoneBlock extends BaseBlock { } } } - + @Override public void tick(BlockState state, ServerLevel world, BlockPos pos, Random random) { boolean deactivate = true; @@ -87,10 +87,7 @@ public class BrimstoneBlock extends BaseBlock { } } else if (sideState.getFluidState().getType() == Fluids.WATER) { - BlockState crystal = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState() - .setValue(SulphurCrystalBlock.FACING, dir) - .setValue(SulphurCrystalBlock.WATERLOGGED, true) - .setValue(SulphurCrystalBlock.AGE, 0); + BlockState crystal = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState().setValue(SulphurCrystalBlock.FACING, dir).setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.AGE, 0); world.setBlockAndUpdate(side, crystal); } } diff --git a/src/main/java/ru/betterend/blocks/BubbleCoralBlock.java b/src/main/java/ru/betterend/blocks/BubbleCoralBlock.java index 34d15af6..3a0bd6a9 100644 --- a/src/main/java/ru/betterend/blocks/BubbleCoralBlock.java +++ b/src/main/java/ru/betterend/blocks/BubbleCoralBlock.java @@ -20,22 +20,18 @@ import ru.betterend.blocks.basis.EndUnderwaterPlantBlock; import java.util.Random; public class BubbleCoralBlock extends EndUnderwaterPlantBlock { - + private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16); - + public BubbleCoralBlock() { - super(FabricBlockSettings.of(Material.WATER_PLANT) - .breakByTool(FabricToolTags.SHEARS) - .breakByHand(true) - .sound(SoundType.CORAL_BLOCK) - .noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.CORAL_BLOCK).noCollission()); } - + @Override public BlockBehaviour.OffsetType getOffsetType() { return BlockBehaviour.OffsetType.NONE; } - + @Environment(EnvType.CLIENT) public void animateTick(BlockState state, Level world, BlockPos pos, Random random) { double x = pos.getX() + random.nextDouble(); @@ -43,17 +39,17 @@ public class BubbleCoralBlock extends EndUnderwaterPlantBlock { double z = pos.getZ() + random.nextDouble(); world.addParticle(ParticleTypes.BUBBLE, x, y, z, 0.0D, 0.0D, 0.0D); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return SHAPE; } - + @Override public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) { return false; } - + @Override public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) { return false; diff --git a/src/main/java/ru/betterend/blocks/BulbVineBlock.java b/src/main/java/ru/betterend/blocks/BulbVineBlock.java index 7eb1985b..5cc9b9f2 100644 --- a/src/main/java/ru/betterend/blocks/BulbVineBlock.java +++ b/src/main/java/ru/betterend/blocks/BulbVineBlock.java @@ -19,7 +19,7 @@ public class BulbVineBlock extends BaseVineBlock { public BulbVineBlock() { super(15, true); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { if (state.getValue(SHAPE) == TripleShape.BOTTOM) { @@ -32,12 +32,12 @@ public class BulbVineBlock extends BaseVineBlock { return Lists.newArrayList(); } } - + @Override public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) { return false; } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { boolean canPlace = super.canSurvive(state, world, pos); diff --git a/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java b/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java index b18b29d9..bf7dbec4 100644 --- a/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java +++ b/src/main/java/ru/betterend/blocks/BulbVineLanternBlock.java @@ -30,52 +30,43 @@ import java.util.Optional; public class BulbVineLanternBlock extends EndLanternBlock implements IRenderTyped, BlockModelProvider { private static final VoxelShape SHAPE_CEIL = Block.box(4, 4, 4, 12, 16, 12); private static final VoxelShape SHAPE_FLOOR = Block.box(4, 0, 4, 12, 12, 12); - + public BulbVineLanternBlock() { - this(FabricBlockSettings.of(Material.METAL) - .hardness(1) - .resistance(1) - .breakByTool(FabricToolTags.PICKAXES) - .materialColor(MaterialColor.COLOR_LIGHT_GRAY) - .luminance(15) - .requiresCorrectToolForDrops() - .sound(SoundType.LANTERN)); + this(FabricBlockSettings.of(Material.METAL).hardness(1).resistance(1).breakByTool(FabricToolTags.PICKAXES).materialColor(MaterialColor.COLOR_LIGHT_GRAY).luminance(15).requiresCorrectToolForDrops().sound(SoundType.LANTERN)); } - + public BulbVineLanternBlock(Properties settings) { super(settings); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return state.getValue(IS_FLOOR) ? SHAPE_FLOOR : SHAPE_CEIL; } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + @Override @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { Map textures = Maps.newHashMap(); textures.put("%glow%", getGlowTexture()); textures.put("%metal%", getMetalTexture(resourceLocation)); - Optional pattern = blockState.getValue(IS_FLOOR) ? - Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_FLOOR, textures) : - Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures); + Optional pattern = blockState.getValue(IS_FLOOR) ? Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_FLOOR, textures) : Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures); return ModelsHelper.fromPattern(pattern); } - + protected String getMetalTexture(ResourceLocation blockId) { String name = blockId.getPath(); name = name.substring(0, name.indexOf('_')); return name + "_bulb_vine_lantern_metal"; } - + protected String getGlowTexture() { return "bulb_vine_lantern_bulb"; } - + } diff --git a/src/main/java/ru/betterend/blocks/BulbVineLanternColoredBlock.java b/src/main/java/ru/betterend/blocks/BulbVineLanternColoredBlock.java index cfde3ec7..fcd8f9fb 100644 --- a/src/main/java/ru/betterend/blocks/BulbVineLanternColoredBlock.java +++ b/src/main/java/ru/betterend/blocks/BulbVineLanternColoredBlock.java @@ -11,17 +11,17 @@ public class BulbVineLanternColoredBlock extends BulbVineLanternBlock implements public BulbVineLanternColoredBlock(FabricBlockSettings settings) { super(settings); } - + @Override public BlockColor getProvider() { return (state, world, pos, tintIndex) -> getColor(); } - + @Override public ItemColor getItemProvider() { return (stack, tintIndex) -> getColor(); } - + private int getColor() { int color = BlocksHelper.getBlockColor(this); int b = (color & 255); @@ -30,7 +30,7 @@ public class BulbVineLanternColoredBlock extends BulbVineLanternBlock implements float[] hsv = ColorUtil.RGBtoHSB(r, g, b, new float[3]); return ColorUtil.HSBtoRGB(hsv[0], hsv[1], hsv[1] > 0.2 ? 1 : hsv[2]); } - + @Override protected String getGlowTexture() { return "bulb_vine_lantern_overlay"; diff --git a/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java b/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java index 73e1c97d..34a840aa 100644 --- a/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/BulbVineSeedBlock.java @@ -15,13 +15,13 @@ import ru.betterend.registry.EndBlocks; import java.util.Random; public class BulbVineSeedBlock extends EndPlantWithAgeBlock { - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { BlockState up = world.getBlockState(pos.above()); return up.is(TagAPI.GEN_TERRAIN) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES); } - + @Override public void growAdult(WorldGenLevel world, Random random, BlockPos pos) { int h = BlocksHelper.downRay(world, pos, random.nextInt(24)) - 1; diff --git a/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java b/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java index 166c13e8..467562b7 100644 --- a/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java +++ b/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java @@ -26,38 +26,38 @@ public class CavePumpkinBlock extends BaseBlockNotFull implements IRenderTyped { public static final BooleanProperty SMALL = BlockProperties.SMALL; private static final VoxelShape SHAPE_SMALL; private static final VoxelShape SHAPE_BIG; - + public CavePumpkinBlock() { super(FabricBlockSettings.copyOf(Blocks.PUMPKIN).luminance((state) -> state.getValue(SMALL) ? 10 : 15)); registerDefaultState(defaultBlockState().setValue(SMALL, false)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(SMALL); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + @Override public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { return state.getValue(SMALL) ? SHAPE_SMALL : SHAPE_BIG; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { return state.getValue(SMALL) ? Collections.singletonList(new ItemStack(EndBlocks.CAVE_PUMPKIN_SEED)) : Collections.singletonList(new ItemStack(this)); } - + static { VoxelShape lantern = Block.box(1, 0, 1, 15, 13, 15); VoxelShape cap = Block.box(0, 12, 0, 16, 15, 16); VoxelShape top = Block.box(5, 15, 5, 11, 16, 11); SHAPE_BIG = Shapes.or(lantern, cap, top); - + lantern = Block.box(5, 7, 5, 11, 13, 11); cap = Block.box(4, 12, 4, 12, 15, 12); top = Block.box(6, 15, 6, 10, 16, 10); diff --git a/src/main/java/ru/betterend/blocks/CavePumpkinVineBlock.java b/src/main/java/ru/betterend/blocks/CavePumpkinVineBlock.java index 4d59e2d9..4c3567c9 100644 --- a/src/main/java/ru/betterend/blocks/CavePumpkinVineBlock.java +++ b/src/main/java/ru/betterend/blocks/CavePumpkinVineBlock.java @@ -20,13 +20,13 @@ import java.util.Random; public class CavePumpkinVineBlock extends EndPlantWithAgeBlock { private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12); - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { BlockState down = world.getBlockState(pos.above()); return isTerrain(down); } - + @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { int age = state.getValue(AGE); @@ -43,11 +43,11 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock { } } } - + @Override public void growAdult(WorldGenLevel world, Random random, BlockPos pos) { } - + @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { state = super.updateShape(state, facing, neighborState, world, pos, neighborPos); @@ -59,12 +59,12 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock { } return state; } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return SHAPE; } - + @Override public BlockBehaviour.OffsetType getOffsetType() { return BlockBehaviour.OffsetType.NONE; diff --git a/src/main/java/ru/betterend/blocks/ChandelierBlock.java b/src/main/java/ru/betterend/blocks/ChandelierBlock.java index f998c29e..6ebb8132 100644 --- a/src/main/java/ru/betterend/blocks/ChandelierBlock.java +++ b/src/main/java/ru/betterend/blocks/ChandelierBlock.java @@ -30,27 +30,27 @@ import java.util.Optional; public class ChandelierBlock extends BaseAttachedBlock implements IRenderTyped, BlockModelProvider { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); - + public ChandelierBlock(Block source) { super(FabricBlockSettings.copyOf(source).luminance(15).noCollission().noOcclusion().requiresCorrectToolForDrops()); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return BOUNDING_SHAPES.get(state.getValue(FACING)); } - + @Override @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation blockId) { return ModelsHelper.createItemModel(blockId); } - + @Override @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { @@ -67,7 +67,7 @@ public class ChandelierBlock extends BaseAttachedBlock implements IRenderTyped, } return ModelsHelper.fromPattern(pattern); } - + @Override @Environment(EnvType.CLIENT) public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { @@ -96,7 +96,7 @@ public class ChandelierBlock extends BaseAttachedBlock implements IRenderTyped, registerBlockModel(stateId, modelId, blockState, modelCache); return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false); } - + static { BOUNDING_SHAPES.put(Direction.UP, Block.box(5, 0, 5, 11, 13, 11)); BOUNDING_SHAPES.put(Direction.DOWN, Block.box(5, 3, 5, 11, 16, 11)); diff --git a/src/main/java/ru/betterend/blocks/CharniaBlock.java b/src/main/java/ru/betterend/blocks/CharniaBlock.java index 5a665ab6..dff8ef06 100644 --- a/src/main/java/ru/betterend/blocks/CharniaBlock.java +++ b/src/main/java/ru/betterend/blocks/CharniaBlock.java @@ -8,7 +8,7 @@ import net.minecraft.world.level.material.Fluids; import ru.betterend.blocks.basis.EndUnderwaterPlantBlock; public class CharniaBlock extends EndUnderwaterPlantBlock { - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { return canSupportCenter(world, pos.below(), Direction.UP) && world.getFluidState(pos).getType() == Fluids.WATER; diff --git a/src/main/java/ru/betterend/blocks/ChorusGrassBlock.java b/src/main/java/ru/betterend/blocks/ChorusGrassBlock.java index 66bb0d7d..71635d36 100644 --- a/src/main/java/ru/betterend/blocks/ChorusGrassBlock.java +++ b/src/main/java/ru/betterend/blocks/ChorusGrassBlock.java @@ -8,7 +8,7 @@ public class ChorusGrassBlock extends EndPlantBlock { public ChorusGrassBlock() { super(true); } - + @Override protected boolean isTerrain(BlockState state) { return state.getBlock() == EndBlocks.CHORUS_NYLIUM; diff --git a/src/main/java/ru/betterend/blocks/DenseEmeraldIceBlock.java b/src/main/java/ru/betterend/blocks/DenseEmeraldIceBlock.java index dfea39df..b589f450 100644 --- a/src/main/java/ru/betterend/blocks/DenseEmeraldIceBlock.java +++ b/src/main/java/ru/betterend/blocks/DenseEmeraldIceBlock.java @@ -19,12 +19,12 @@ public class DenseEmeraldIceBlock extends BaseBlock implements IRenderTyped { public DenseEmeraldIceBlock() { super(FabricBlockSettings.copyOf(Blocks.PACKED_ICE)); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.TRANSLUCENT; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL); diff --git a/src/main/java/ru/betterend/blocks/DragonTreeSaplingBlock.java b/src/main/java/ru/betterend/blocks/DragonTreeSaplingBlock.java index 882bd275..8e67ec12 100644 --- a/src/main/java/ru/betterend/blocks/DragonTreeSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/DragonTreeSaplingBlock.java @@ -2,24 +2,31 @@ package ru.betterend.blocks; import net.minecraft.core.BlockPos; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; import ru.bclib.blocks.FeatureSaplingBlock; +import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; -public class DragonTreeSaplingBlock extends FeatureSaplingBlock { +public class DragonTreeSaplingBlock extends PottableFeatureSapling { public DragonTreeSaplingBlock() { super(); } - + @Override protected Feature getFeature() { return EndFeatures.DRAGON_TREE.getFeature(); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { return world.getBlockState(pos.below()).is(EndBlocks.SHADOW_GRASS); } + + @Override + public boolean canPlantOn(Block block) { + return block == EndBlocks.SHADOW_GRASS; + } } diff --git a/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java b/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java index 20466312..978a69cb 100644 --- a/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java +++ b/src/main/java/ru/betterend/blocks/EmeraldIceBlock.java @@ -33,12 +33,12 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderType public EmeraldIceBlock() { super(FabricBlockSettings.copyOf(Blocks.ICE)); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.TRANSLUCENT; } - + @Override public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) { super.playerDestroy(world, player, pos, state, blockEntity, stack); @@ -47,23 +47,23 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderType world.removeBlock(pos, false); return; } - + Material material = world.getBlockState(pos.below()).getMaterial(); if (material.blocksMotion() || material.isLiquid()) { world.setBlockAndUpdate(pos, Blocks.WATER.defaultBlockState()); } } - + } - + @Override public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) { if (world.getBrightness(LightLayer.BLOCK, pos) > 11 - state.getLightBlock(world, pos)) { this.melt(state, world, pos); } - + } - + protected void melt(BlockState state, Level world, BlockPos pos) { if (world.dimensionType().ultraWarm()) { world.removeBlock(pos, false); @@ -73,7 +73,7 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderType world.neighborChanged(pos, Blocks.WATER, pos); } } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL); @@ -84,7 +84,7 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderType return Collections.emptyList(); } } - + @Override @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { diff --git a/src/main/java/ru/betterend/blocks/EndBlockProperties.java b/src/main/java/ru/betterend/blocks/EndBlockProperties.java index 5f40740e..584d00ea 100644 --- a/src/main/java/ru/betterend/blocks/EndBlockProperties.java +++ b/src/main/java/ru/betterend/blocks/EndBlockProperties.java @@ -11,114 +11,99 @@ public class EndBlockProperties extends BlockProperties { public static final EnumProperty HYDRALUX_SHAPE = EnumProperty.create("shape", HydraluxShape.class); public static final EnumProperty PEDESTAL_STATE = EnumProperty.create("state", PedestalState.class); public static final EnumProperty CACTUS_BOTTOM = EnumProperty.create("bottom", CactusBottom.class); - - public static final BooleanProperty HAS_ITEM = BooleanProperty.create("has_item"); + public static final IntegerProperty PORTAL = IntegerProperty.create("portal", 0, EndPortals.getCount()); - + public static final IntegerProperty PLANT_ID = IntegerProperty.create("plant_id", 0, 63); + public static final IntegerProperty SOIL_ID = IntegerProperty.create("soil_id", 0, 15); + public static final IntegerProperty POT_LIGHT = IntegerProperty.create("pot_light", 0, 3); + public static final BooleanProperty HAS_ITEM = BooleanProperty.create("has_item"); + public enum PedestalState implements StringRepresentable { - PEDESTAL_TOP("pedestal_top"), - COLUMN_TOP("column_top"), - BOTTOM("bottom"), - PILLAR("pillar"), - COLUMN("column"), - DEFAULT("default"); - + PEDESTAL_TOP("pedestal_top"), COLUMN_TOP("column_top"), BOTTOM("bottom"), PILLAR("pillar"), COLUMN("column"), DEFAULT("default"); + private final String name; - + PedestalState(String name) { this.name = name; } - + @Override public String getSerializedName() { return this.name; } - + @Override public String toString() { return this.name; } } - + public enum HydraluxShape implements StringRepresentable { - FLOWER_BIG_BOTTOM("flower_big_bottom", true), - FLOWER_BIG_TOP("flower_big_top", true), - FLOWER_SMALL_BOTTOM("flower_small_bottom", true), - FLOWER_SMALL_TOP("flower_small_top", true), - VINE("vine", false), - ROOTS("roots", false); - + FLOWER_BIG_BOTTOM("flower_big_bottom", true), FLOWER_BIG_TOP("flower_big_top", true), FLOWER_SMALL_BOTTOM("flower_small_bottom", true), FLOWER_SMALL_TOP("flower_small_top", true), VINE("vine", false), ROOTS("roots", false); + private final String name; private final boolean glow; - + HydraluxShape(String name, boolean glow) { this.name = name; this.glow = glow; } - + @Override public String getSerializedName() { return name; } - + @Override public String toString() { return name; } - + public boolean hasGlow() { return glow; } } - + public enum LumecornShape implements StringRepresentable { - LIGHT_TOP("light_top", 15), - LIGHT_TOP_MIDDLE("light_top_middle", 15), - LIGHT_MIDDLE("light_middle", 15), - LIGHT_BOTTOM("light_bottom", 15), - MIDDLE("middle", 0), - BOTTOM_BIG("bottom_big", 0), - BOTTOM_SMALL("bottom_small", 0); - + LIGHT_TOP("light_top", 15), LIGHT_TOP_MIDDLE("light_top_middle", 15), LIGHT_MIDDLE("light_middle", 15), LIGHT_BOTTOM("light_bottom", 15), MIDDLE("middle", 0), BOTTOM_BIG("bottom_big", 0), BOTTOM_SMALL("bottom_small", 0); + private final String name; private final int light; - + LumecornShape(String name, int light) { this.name = name; this.light = light; } - + @Override public String getSerializedName() { return name; } - + @Override public String toString() { return name; } - + public int getLight() { return light; } } - + public enum CactusBottom implements StringRepresentable { - EMPTY("empty"), - SAND("sand"), - MOSS("moss"); - + EMPTY("empty"), SAND("sand"), MOSS("moss"); + private final String name; - + CactusBottom(String name) { this.name = name; } - + @Override public String getSerializedName() { return name; } - + @Override public String toString() { return name; diff --git a/src/main/java/ru/betterend/blocks/EndLilyBlock.java b/src/main/java/ru/betterend/blocks/EndLilyBlock.java index f4bfa0b9..80e9a521 100644 --- a/src/main/java/ru/betterend/blocks/EndLilyBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLilyBlock.java @@ -40,16 +40,11 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock { public static final EnumProperty SHAPE = BlockProperties.TRIPLE_SHAPE; private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 16, 12); private static final VoxelShape SHAPE_TOP = Block.box(2, 0, 2, 14, 6, 14); - + public EndLilyBlock() { - super(FabricBlockSettings.of(Material.WATER_PLANT) - .breakByTool(FabricToolTags.SHEARS) - .breakByHand(true) - .sound(SoundType.WET_GRASS) - .lightLevel((state) -> state.getValue(SHAPE) == TripleShape.TOP ? 13 : 0) - .noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS).lightLevel((state) -> state.getValue(SHAPE) == TripleShape.TOP ? 13 : 0).noCollission()); } - + @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { if (!canSurvive(state, world, pos)) { @@ -59,24 +54,24 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock { return state; } } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { Vec3 vec3d = state.getOffset(view, pos); VoxelShape shape = state.getValue(SHAPE) == TripleShape.TOP ? SHAPE_TOP : SHAPE_BOTTOM; return shape.move(vec3d.x, vec3d.y, vec3d.z); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(SHAPE); } - + @Override public FluidState getFluidState(BlockState state) { return state.getValue(SHAPE) == TripleShape.TOP ? Fluids.EMPTY.defaultFluidState() : Fluids.WATER.getSource(false); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { if (state.getValue(SHAPE) == TripleShape.TOP) { @@ -91,7 +86,7 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock { return up.getBlock() == this && down.getBlock() == this; } } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { if (state.getValue(SHAPE) == TripleShape.TOP) { @@ -99,18 +94,18 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock { } return Collections.emptyList(); } - + @Override @Environment(EnvType.CLIENT) public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) { return new ItemStack(EndBlocks.END_LILY_SEED); } - + @Override public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) { return false; } - + @Override public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) { return false; diff --git a/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java b/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java index e85797e2..04f7cd38 100644 --- a/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLilySeedBlock.java @@ -25,7 +25,7 @@ public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock { BlocksHelper.setWithoutUpdate(world, up, EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.TOP)); } } - + private boolean canGrow(WorldGenLevel world, BlockPos pos) { BlockPos up = pos.above(); while (world.getBlockState(up).getFluidState().getType().equals(Fluids.WATER.getSource())) { @@ -33,7 +33,7 @@ public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock { } return world.isEmptyBlock(up); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(TagAPI.END_GROUND); diff --git a/src/main/java/ru/betterend/blocks/EndLotusFlowerBlock.java b/src/main/java/ru/betterend/blocks/EndLotusFlowerBlock.java index a7da3edc..dbeefd29 100644 --- a/src/main/java/ru/betterend/blocks/EndLotusFlowerBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLotusFlowerBlock.java @@ -23,37 +23,37 @@ import java.util.List; public class EndLotusFlowerBlock extends EndPlantBlock { private static final VoxelShape SHAPE_OUTLINE = Block.box(2, 0, 2, 14, 14, 14); private static final VoxelShape SHAPE_COLLISION = Block.box(0, 0, 0, 16, 2, 16); - + public EndLotusFlowerBlock() { super(FabricBlockSettings.of(Material.PLANT).luminance(15).noOcclusion()); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.END_LOTUS_STEM); } - + @Override public BlockBehaviour.OffsetType getOffsetType() { return BlockBehaviour.OffsetType.NONE; } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return SHAPE_OUTLINE; } - + @Override public VoxelShape getCollisionShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return SHAPE_COLLISION; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { int count = MHelper.randRange(1, 2, MHelper.RANDOM); return Lists.newArrayList(new ItemStack(EndBlocks.END_LOTUS_SEED, count)); } - + @Override @Environment(EnvType.CLIENT) public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) { diff --git a/src/main/java/ru/betterend/blocks/EndLotusLeafBlock.java b/src/main/java/ru/betterend/blocks/EndLotusLeafBlock.java index 7b9644a7..5df755e9 100644 --- a/src/main/java/ru/betterend/blocks/EndLotusLeafBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLotusLeafBlock.java @@ -32,42 +32,42 @@ public class EndLotusLeafBlock extends BaseBlockNotFull implements IRenderTyped public static final EnumProperty HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING; public static final EnumProperty SHAPE = BlockProperties.TRIPLE_SHAPE; private static final VoxelShape VSHAPE = Block.box(0, 0, 0, 16, 1, 16); - + public EndLotusLeafBlock() { super(FabricBlockSettings.of(Material.PLANT).noOcclusion().sound(SoundType.WET_GRASS)); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { BlockState down = world.getBlockState(pos.below()); return !down.getFluidState().isEmpty() && down.getFluidState().getType() instanceof WaterFluid; } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(SHAPE, HORIZONTAL_FACING); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return VSHAPE; } - + @Override public BlockState rotate(BlockState state, Rotation rotation) { return BlocksHelper.rotateHorizontal(state, rotation, HORIZONTAL_FACING); } - + @Override public BlockState mirror(BlockState state, Mirror mirror) { return BlocksHelper.mirrorHorizontal(state, mirror, HORIZONTAL_FACING); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + @Override @Environment(EnvType.CLIENT) public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) { diff --git a/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java b/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java index 73ca66ff..c471f826 100644 --- a/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLotusSeedBlock.java @@ -22,7 +22,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { BlockState roots = EndBlocks.END_LOTUS_STEM.defaultBlockState().setValue(EndLotusStemBlock.SHAPE, TripleShape.BOTTOM).setValue(EndLotusStemBlock.WATERLOGGED, true); BlockState stem = EndBlocks.END_LOTUS_STEM.defaultBlockState(); BlockState flower = EndBlocks.END_LOTUS_FLOWER.defaultBlockState(); - + BlocksHelper.setWithoutUpdate(world, pos, roots); MutableBlockPos bpos = new MutableBlockPos().set(pos); bpos.setY(bpos.getY() + 1); @@ -30,7 +30,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.WATERLOGGED, true)); bpos.setY(bpos.getY() + 1); } - + int height = random.nextBoolean() ? 0 : random.nextBoolean() ? 1 : random.nextBoolean() ? 1 : -1; TripleShape shape = (height == 0) ? TripleShape.TOP : TripleShape.MIDDLE; Direction dir = BlocksHelper.randomHorizontal(random); @@ -42,7 +42,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { else { BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.SHAPE, shape)); } - + bpos.setY(bpos.getY() + 1); for (int i = 1; i <= height; i++) { if (!world.isEmptyBlock(bpos)) { @@ -56,11 +56,11 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { BlocksHelper.setWithoutUpdate(world, bpos, stem); bpos.setY(bpos.getY() + 1); } - + if (!world.isEmptyBlock(bpos) || height < 0) { bpos.setY(bpos.getY() - 1); } - + BlocksHelper.setWithoutUpdate(world, bpos, flower); bpos.setY(bpos.getY() - 1); stem = world.getBlockState(bpos); @@ -70,15 +70,15 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { stem = stem.setValue(EndLotusStemBlock.WATERLOGGED, true); } } - + if (world.getBlockState(bpos.relative(dir)).is(EndBlocks.END_LOTUS_LEAF)) { stem = stem.setValue(EndLotusStemBlock.LEAF, true).setValue(EndLotusStemBlock.FACING, dir); } - + BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.SHAPE, TripleShape.TOP)); } } - + private boolean canGrow(WorldGenLevel world, BlockPos pos) { MutableBlockPos bpos = new MutableBlockPos(); bpos.set(pos); @@ -87,7 +87,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { } return world.isEmptyBlock(bpos) && world.isEmptyBlock(bpos.above()); } - + private void generateLeaf(WorldGenLevel world, BlockPos pos) { MutableBlockPos p = new MutableBlockPos(); BlockState leaf = EndBlocks.END_LOTUS_LEAF.defaultBlockState(); @@ -101,7 +101,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { BlocksHelper.setWithoutUpdate(world, p.set(pos).move(d1).move(d2), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1).setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP)); } } - + private boolean hasLeaf(WorldGenLevel world, BlockPos pos) { MutableBlockPos p = new MutableBlockPos(); p.setY(pos.getY()); @@ -110,13 +110,12 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock { p.setX(pos.getX() + x); for (int z = -1; z < 2; z++) { p.setZ(pos.getZ() + z); - if (world.isEmptyBlock(p) && !world.getFluidState(p.below()).isEmpty()) - count++; + if (world.isEmptyBlock(p) && !world.getFluidState(p.below()).isEmpty()) count++; } } return count == 9; } - + @Override protected boolean isTerrain(BlockState state) { return state.is(TagAPI.END_GROUND); diff --git a/src/main/java/ru/betterend/blocks/EndLotusStemBlock.java b/src/main/java/ru/betterend/blocks/EndLotusStemBlock.java index 05a3c639..2a7e1803 100644 --- a/src/main/java/ru/betterend/blocks/EndLotusStemBlock.java +++ b/src/main/java/ru/betterend/blocks/EndLotusStemBlock.java @@ -37,44 +37,44 @@ public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlo public static final BooleanProperty LEAF = BooleanProperty.create("leaf"); public static final EnumProperty SHAPE = BlockProperties.TRIPLE_SHAPE; private static final Map SHAPES = Maps.newEnumMap(Axis.class); - + public EndLotusStemBlock() { super(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS)); this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false).setValue(SHAPE, TripleShape.MIDDLE).setValue(LEAF, false).setValue(FACING, Direction.UP)); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return state.getValue(LEAF) ? SHAPES.get(Axis.Y) : SHAPES.get(state.getValue(FACING).getAxis()); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(FACING, WATERLOGGED, SHAPE, LEAF); } - + @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { LevelAccessor worldAccess = ctx.getLevel(); BlockPos blockPos = ctx.getClickedPos(); return this.defaultBlockState().setValue(WATERLOGGED, worldAccess.getFluidState(blockPos).getType() == Fluids.WATER).setValue(FACING, ctx.getClickedFace()); } - + @Override public BlockState rotate(BlockState state, Rotation rotation) { return BlocksHelper.rotateHorizontal(state, rotation, FACING); } - + @Override public BlockState mirror(BlockState state, Mirror mirror) { return BlocksHelper.mirrorHorizontal(state, mirror, FACING); } - + @Override public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) { if (state.getValue(WATERLOGGED)) { @@ -82,12 +82,12 @@ public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlo } return state; } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + static { SHAPES.put(Axis.X, Block.box(0, 6, 6, 16, 10, 10)); SHAPES.put(Axis.Y, Block.box(6, 0, 6, 10, 16, 10)); diff --git a/src/main/java/ru/betterend/blocks/EndPedestal.java b/src/main/java/ru/betterend/blocks/EndPedestal.java index a86c2a31..2478b1b1 100644 --- a/src/main/java/ru/betterend/blocks/EndPedestal.java +++ b/src/main/java/ru/betterend/blocks/EndPedestal.java @@ -10,18 +10,18 @@ import java.util.HashMap; import java.util.Map; public class EndPedestal extends PedestalBlock { - + public EndPedestal(Block parent) { super(parent); } - + @Override protected Map createTexturesMap() { ResourceLocation blockId = Registry.BLOCK.getKey(parent); String name = blockId.getPath(); return new HashMap() { private static final long serialVersionUID = 1L; - + { put("%mod%", BetterEnd.MOD_ID); put("%top%", name + "_polished"); diff --git a/src/main/java/ru/betterend/blocks/EndPortalBlock.java b/src/main/java/ru/betterend/blocks/EndPortalBlock.java index e4dc81ab..895b9c1c 100644 --- a/src/main/java/ru/betterend/blocks/EndPortalBlock.java +++ b/src/main/java/ru/betterend/blocks/EndPortalBlock.java @@ -42,24 +42,24 @@ import java.util.Random; public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, IColorProvider { public static final IntegerProperty PORTAL = EndBlockProperties.PORTAL; - + public EndPortalBlock() { super(FabricBlockSettings.copyOf(Blocks.NETHER_PORTAL).resistance(Blocks.BEDROCK.getExplosionResistance()).luminance(15)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { super.createBlockStateDefinition(builder); builder.add(PORTAL); } - + @Override @Environment(EnvType.CLIENT) public void animateTick(BlockState state, Level world, BlockPos pos, Random random) { if (random.nextInt(100) == 0) { world.playLocalSound(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, SoundEvents.PORTAL_AMBIENT, SoundSource.BLOCKS, 0.5F, random.nextFloat() * 0.4F + 0.8F, false); } - + double x = pos.getX() + random.nextDouble(); double y = pos.getY() + random.nextDouble(); double z = pos.getZ() + random.nextDouble(); @@ -70,19 +70,19 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I else { z = pos.getZ() + 0.5D + 0.25D * k; } - + world.addParticle(EndParticles.PORTAL_SPHERE, x, y, z, 0, 0, 0); } - + @Override public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) { } - + @Override public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) { return state; } - + @Override public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { if (world.isClientSide || !validate(entity)) return; @@ -95,8 +95,7 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I BlockPos exitPos = findExitPos(currentWorld, destination, pos, entity); if (exitPos == null) return; if (entity instanceof ServerPlayer && ((ServerPlayer) entity).isCreative()) { - ((ServerPlayer) entity).teleportTo(destination, exitPos.getX() + 0.5, exitPos.getY(), - exitPos.getZ() + 0.5, entity.getYRot(), entity.getXRot()); + ((ServerPlayer) entity).teleportTo(destination, exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5, entity.getYRot(), entity.getXRot()); } else { ((TeleportingEntity) entity).be_setExitPos(exitPos); @@ -104,17 +103,16 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I teleported.ifPresent(Entity::setPortalCooldown); } } - + private boolean validate(Entity entity) { - return !entity.isPassenger() && !entity.isVehicle() && - entity.canChangeDimensions() && !entity.isOnPortalCooldown(); + return !entity.isPassenger() && !entity.isVehicle() && entity.canChangeDimensions() && !entity.isOnPortalCooldown(); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.TRANSLUCENT; } - + private BlockPos findExitPos(ServerLevel currentWorld, ServerLevel targetWorld, BlockPos currentPos, Entity entity) { if (targetWorld == null) return null; Registry registry = targetWorld.registryAccess().registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY); @@ -127,8 +125,7 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I MutableBlockPos checkPos = basePos.mutable(); BlockState currentState = currentWorld.getBlockState(currentPos); int radius = (EternalRitual.SEARCH_RADIUS >> 4) + 1; - checkPos = EternalRitual.findBlockPos(targetWorld, checkPos, radius, this, state -> state.is(this) && - state.getValue(PORTAL).equals(currentState.getValue(PORTAL))); + checkPos = EternalRitual.findBlockPos(targetWorld, checkPos, radius, this, state -> state.is(this) && state.getValue(PORTAL).equals(currentState.getValue(PORTAL))); if (checkPos != null) { BlockState checkState = targetWorld.getBlockState(checkPos); Axis axis = checkState.getValue(AXIS); @@ -146,11 +143,11 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I } return null; } - + private MutableBlockPos findCenter(Level world, MutableBlockPos pos, Direction.Axis axis) { return findCenter(world, pos, axis, 1); } - + private MutableBlockPos findCenter(Level world, MutableBlockPos pos, Direction.Axis axis, int step) { if (step > 8) return pos; BlockState right, left; @@ -174,12 +171,12 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I } return pos; } - + @Override public BlockColor getProvider() { return (state, world, pos, tintIndex) -> EndPortals.getColor(state.getValue(PORTAL)); } - + @Override public ItemColor getItemProvider() { return (stack, tintIndex) -> EndPortals.getColor(0); diff --git a/src/main/java/ru/betterend/blocks/EndStoneSmelter.java b/src/main/java/ru/betterend/blocks/EndStoneSmelter.java index 5b08ab4f..103240e3 100644 --- a/src/main/java/ru/betterend/blocks/EndStoneSmelter.java +++ b/src/main/java/ru/betterend/blocks/EndStoneSmelter.java @@ -47,17 +47,12 @@ public class EndStoneSmelter extends BaseBlockWithEntity { public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING; public static final BooleanProperty LIT = BlockStateProperties.LIT; public static final String ID = "end_stone_smelter"; - + public EndStoneSmelter() { - super(FabricBlockSettings.of(Material.STONE, MaterialColor.COLOR_GRAY) - .luminance(state -> state.getValue(LIT) ? 15 : 0) - .hardness(4F) - .resistance(100F) - .requiresCorrectToolForDrops() - .sound(SoundType.STONE)); + super(FabricBlockSettings.of(Material.STONE, MaterialColor.COLOR_GRAY).luminance(state -> state.getValue(LIT) ? 15 : 0).hardness(4F).resistance(100F).requiresCorrectToolForDrops().sound(SoundType.STONE)); registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(LIT, false)); } - + public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { if (world.isClientSide) { return InteractionResult.SUCCESS; @@ -67,24 +62,24 @@ public class EndStoneSmelter extends BaseBlockWithEntity { return InteractionResult.CONSUME; } } - + private void openScreen(Level world, BlockPos pos, Player player) { BlockEntity blockEntity = world.getBlockEntity(pos); if (blockEntity instanceof EndStoneSmelterBlockEntity) { player.openMenu((EndStoneSmelterBlockEntity) blockEntity); } } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { return defaultBlockState().setValue(FACING, ctx.getHorizontalDirection().getOpposite()); } - + @Override public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { return new EndStoneSmelterBlockEntity(blockPos, blockState); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { List drop = Lists.newArrayList(new ItemStack(this)); @@ -100,38 +95,38 @@ public class EndStoneSmelter extends BaseBlockWithEntity { } return drop; } - + @Override public boolean hasAnalogOutputSignal(BlockState state) { return true; } - + @Override public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) { //TODO return AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos)); } - + @Override public RenderShape getRenderShape(BlockState state) { return RenderShape.MODEL; } - + @Override public BlockState rotate(BlockState state, Rotation rotation) { return state.setValue(FACING, rotation.rotate(state.getValue(FACING))); } - + @Override public BlockState mirror(BlockState state, Mirror mirror) { return state.rotate(mirror.getRotation(state.getValue(FACING))); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(FACING, LIT); } - + @Environment(EnvType.CLIENT) public void animateTick(BlockState state, Level world, BlockPos pos, Random random) { if (state.getValue(LIT)) { @@ -141,7 +136,7 @@ public class EndStoneSmelter extends BaseBlockWithEntity { if (random.nextDouble() < 0.1D) { world.playLocalSound(x, y, z, SoundEvents.BLASTFURNACE_FIRE_CRACKLE, SoundSource.BLOCKS, 1.0F, 1.0F, false); } - + Direction direction = state.getValue(FACING); Direction.Axis axis = direction.getAxis(); double defOffset = random.nextDouble() * 0.6D - 0.3D; @@ -151,8 +146,8 @@ public class EndStoneSmelter extends BaseBlockWithEntity { world.addParticle(ParticleTypes.SMOKE, x + offX, y + offY, z + offZ, 0.0D, 0.0D, 0.0D); } } - - + + @Override @Nullable public BlockEntityTicker getTicker(Level level, BlockState blockState, BlockEntityType blockEntityType) { diff --git a/src/main/java/ru/betterend/blocks/EnderBlock.java b/src/main/java/ru/betterend/blocks/EnderBlock.java index 31469430..1ef9b960 100644 --- a/src/main/java/ru/betterend/blocks/EnderBlock.java +++ b/src/main/java/ru/betterend/blocks/EnderBlock.java @@ -12,15 +12,11 @@ import net.minecraft.world.level.material.MaterialColor; import ru.bclib.blocks.BaseBlock; public class EnderBlock extends BaseBlock { - + public EnderBlock() { - super(FabricBlockSettings.of(Material.STONE, MaterialColor.WARPED_WART_BLOCK) - .hardness(5F) - .resistance(6F) - .requiresCorrectToolForDrops() - .sound(SoundType.STONE)); + super(FabricBlockSettings.of(Material.STONE, MaterialColor.WARPED_WART_BLOCK).hardness(5F).resistance(6F).requiresCorrectToolForDrops().sound(SoundType.STONE)); } - + @Environment(EnvType.CLIENT) public int getColor(BlockState state, BlockGetter world, BlockPos pos) { return 0xFF005548; diff --git a/src/main/java/ru/betterend/blocks/EndstoneDustBlock.java b/src/main/java/ru/betterend/blocks/EndstoneDustBlock.java index 4dc094f3..205b6177 100644 --- a/src/main/java/ru/betterend/blocks/EndstoneDustBlock.java +++ b/src/main/java/ru/betterend/blocks/EndstoneDustBlock.java @@ -19,18 +19,16 @@ import java.util.List; public class EndstoneDustBlock extends FallingBlock { @Environment(EnvType.CLIENT) private static final int COLOR = ColorUtil.color(226, 239, 168); - + public EndstoneDustBlock() { - super(FabricBlockSettings.copyOf(Blocks.SAND) - .breakByTool(FabricToolTags.SHOVELS) - .materialColor(Blocks.END_STONE.defaultMaterialColor())); + super(FabricBlockSettings.copyOf(Blocks.SAND).breakByTool(FabricToolTags.SHOVELS).materialColor(Blocks.END_STONE.defaultMaterialColor())); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { return Collections.singletonList(new ItemStack(this)); } - + @Environment(EnvType.CLIENT) public int getDustColor(BlockState state, BlockGetter world, BlockPos pos) { return COLOR; diff --git a/src/main/java/ru/betterend/blocks/EternalPedestal.java b/src/main/java/ru/betterend/blocks/EternalPedestal.java index e699bc08..a2b843fa 100644 --- a/src/main/java/ru/betterend/blocks/EternalPedestal.java +++ b/src/main/java/ru/betterend/blocks/EternalPedestal.java @@ -29,12 +29,12 @@ import java.util.List; public class EternalPedestal extends PedestalBlock { public static final BooleanProperty ACTIVATED = EndBlockProperties.ACTIVE; - + public EternalPedestal() { super(EndBlocks.FLAVOLITE_RUNED_ETERNAL); this.registerDefaultState(defaultBlockState().setValue(ACTIVATED, false)); } - + @Override public void checkRitual(Level world, BlockPos pos) { BlockEntity blockEntity = world.getBlockEntity(pos); @@ -74,7 +74,7 @@ public class EternalPedestal extends PedestalBlock { } } } - + @Override @Deprecated public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) { @@ -85,23 +85,23 @@ public class EternalPedestal extends PedestalBlock { } return updated; } - + @Override @Deprecated public float getDestroyProgress(BlockState state, Player player, BlockGetter world, BlockPos pos) { return 0.0F; } - + @Override public float getExplosionResistance() { return Blocks.BEDROCK.getExplosionResistance(); } - + @Override public boolean dropFromExplosion(Explosion explosion) { return false; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { if (state.is(this)) { @@ -120,18 +120,18 @@ public class EternalPedestal extends PedestalBlock { } return drop; } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { super.createBlockStateDefinition(stateManager); stateManager.add(ACTIVATED); } - + @Override public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { return new EternalPedestalEntity(blockPos, blockState); } - + @Override public boolean hasUniqueEntity() { return true; diff --git a/src/main/java/ru/betterend/blocks/FilaluxBlock.java b/src/main/java/ru/betterend/blocks/FilaluxBlock.java index 3d09def1..55d35214 100644 --- a/src/main/java/ru/betterend/blocks/FilaluxBlock.java +++ b/src/main/java/ru/betterend/blocks/FilaluxBlock.java @@ -7,7 +7,7 @@ public class FilaluxBlock extends BaseVineBlock { public FilaluxBlock() { super(15, true); } - + @Override public BlockBehaviour.OffsetType getOffsetType() { return BlockBehaviour.OffsetType.NONE; diff --git a/src/main/java/ru/betterend/blocks/FilaluxWingsBlock.java b/src/main/java/ru/betterend/blocks/FilaluxWingsBlock.java index 3b1392a4..ff01c75f 100644 --- a/src/main/java/ru/betterend/blocks/FilaluxWingsBlock.java +++ b/src/main/java/ru/betterend/blocks/FilaluxWingsBlock.java @@ -20,21 +20,21 @@ import java.util.EnumMap; public class FilaluxWingsBlock extends BaseAttachedBlock implements IRenderTyped { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); - + public FilaluxWingsBlock() { super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).sound(SoundType.WET_GRASS).noCollission()); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return BOUNDING_SHAPES.get(state.getValue(FACING)); } - + static { BOUNDING_SHAPES.put(Direction.UP, Shapes.box(0.0, 0.0, 0.0, 1.0, 0.5, 1.0)); BOUNDING_SHAPES.put(Direction.DOWN, Shapes.box(0.0, 0.5, 0.0, 1.0, 1.0, 1.0)); diff --git a/src/main/java/ru/betterend/blocks/FlamaeaBlock.java b/src/main/java/ru/betterend/blocks/FlamaeaBlock.java index e9a5a1ea..aa1d8ec7 100644 --- a/src/main/java/ru/betterend/blocks/FlamaeaBlock.java +++ b/src/main/java/ru/betterend/blocks/FlamaeaBlock.java @@ -22,41 +22,43 @@ import java.util.List; public class FlamaeaBlock extends EndPlantBlock implements ISpetialItem { private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16); - + public FlamaeaBlock() { - super(FabricBlockSettings.of(Material.PLANT) - .breakByTool(FabricToolTags.SHEARS) - .breakByHand(true) - .sound(SoundType.WET_GRASS)); + super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS)); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(Blocks.WATER); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return SHAPE; } - + @Override public BlockBehaviour.OffsetType getOffsetType() { return BlockBehaviour.OffsetType.NONE; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { return Lists.newArrayList(new ItemStack(this)); } - + @Override public int getStackSize() { return 64; } - + @Override public boolean canPlaceOnWater() { return true; } + + @Override + public boolean addToPot() { + return false; + } } diff --git a/src/main/java/ru/betterend/blocks/FlowerPotBlock.java b/src/main/java/ru/betterend/blocks/FlowerPotBlock.java new file mode 100644 index 00000000..9a8b2f24 --- /dev/null +++ b/src/main/java/ru/betterend/blocks/FlowerPotBlock.java @@ -0,0 +1,391 @@ +package ru.betterend.blocks; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.mojang.math.Transformation; +import com.mojang.math.Vector3f; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.fabricmc.fabric.mixin.object.builder.AbstractBlockAccessor; +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.block.model.BlockModel; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.client.resources.model.UnbakedModel; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SaplingBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.storage.loot.LootContext.Builder; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; +import ru.bclib.blocks.BaseBlockNotFull; +import ru.bclib.client.models.BasePatterns; +import ru.bclib.client.models.ModelsHelper; +import ru.bclib.client.models.ModelsHelper.MultiPartBuilder; +import ru.bclib.client.models.PatternsHelper; +import ru.bclib.client.render.BCLRenderLayer; +import ru.bclib.interfaces.IPostInit; +import ru.bclib.interfaces.IRenderTyped; +import ru.bclib.util.BlocksHelper; +import ru.bclib.util.JsonFactory; +import ru.betterend.BetterEnd; +import ru.betterend.blocks.basis.PottableLeavesBlock; +import ru.betterend.client.models.Patterns; +import ru.betterend.config.Configs; +import ru.betterend.interfaces.PottablePlant; +import ru.betterend.interfaces.PottableTerrain; +import ru.betterend.registry.EndBlocks; + +import java.io.File; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public class FlowerPotBlock extends BaseBlockNotFull implements IRenderTyped, IPostInit { + private static final IntegerProperty PLANT_ID = EndBlockProperties.PLANT_ID; + private static final IntegerProperty SOIL_ID = EndBlockProperties.SOIL_ID; + private static final IntegerProperty POT_LIGHT = EndBlockProperties.POT_LIGHT; + private static final VoxelShape SHAPE_EMPTY; + private static final VoxelShape SHAPE_FULL; + private static Block[] plants; + private static Block[] soils; + + public FlowerPotBlock(Block source) { + super(FabricBlockSettings.copyOf(source).luminance(state -> state.getValue(POT_LIGHT) * 5)); + this.registerDefaultState(this.defaultBlockState().setValue(PLANT_ID, 0).setValue(SOIL_ID, 0).setValue(POT_LIGHT, 0)); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(PLANT_ID, SOIL_ID, POT_LIGHT); + } + + @Override + public List getDrops(BlockState state, Builder builder) { + List drop = Lists.newArrayList(new ItemStack(this)); + int id = state.getValue(SOIL_ID) - 1; + if (id >= 0 && id < soils.length && soils[id] != null) { + drop.add(new ItemStack(soils[id])); + } + id = state.getValue(PLANT_ID) - 1; + if (id >= 0 && id < plants.length && plants[id] != null) { + drop.add(new ItemStack(plants[id])); + } + return drop; + } + + @Override + public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { + int plantID = state.getValue(PLANT_ID); + if (plantID < 1 || plantID > plants.length || plants[plantID - 1] == null) { + return state.getValue(POT_LIGHT) > 0 ? state.setValue(POT_LIGHT, 0) : state; + } + int light = plants[plantID - 1].defaultBlockState().getLightEmission() / 5; + if (state.getValue(POT_LIGHT) != light) { + state = state.setValue(POT_LIGHT, light); + } + return state; + } + + @Override + public void postInit() { + if (FlowerPotBlock.plants != null) { + return; + } + + Block[] plants = new Block[128]; + Block[] soils = new Block[16]; + + Map reservedPlantsIDs = Maps.newHashMap(); + Map reservedSoilIDs = Maps.newHashMap(); + + JsonObject obj = JsonFactory.getJsonObject(new File(FabricLoader.getInstance().getConfigDir().toFile(), BetterEnd.MOD_ID + "/blocks.json")); + if (obj.get("flower_pots") != null) { + JsonElement plantsObj = obj.get("flower_pots").getAsJsonObject().get("plants"); + JsonElement soilsObj = obj.get("flower_pots").getAsJsonObject().get("soils"); + if (plantsObj != null) { + plantsObj.getAsJsonObject().entrySet().forEach(entry -> { + String name = entry.getKey().substring(0, entry.getKey().indexOf(' ')); + reservedPlantsIDs.put(name, entry.getValue().getAsInt()); + }); + } + if (soilsObj != null) { + soilsObj.getAsJsonObject().entrySet().forEach(entry -> { + String name = entry.getKey().substring(0, entry.getKey().indexOf(' ')); + reservedSoilIDs.put(name, entry.getValue().getAsInt()); + }); + } + } + + EndBlocks.getModBlocks().forEach(block -> { + if (block instanceof PottablePlant && ((PottablePlant) block).addToPot()) {//&& canBeAdded(block)) { + processBlock(plants, block, "flower_pots.plants", reservedPlantsIDs); + } + else if (block instanceof PottableTerrain) { + processBlock(soils, block, "flower_pots.soils", reservedSoilIDs); + } + }); + Configs.BLOCK_CONFIG.saveChanges(); + + FlowerPotBlock.plants = new Block[maxNotNull(plants) + 1]; + System.arraycopy(plants, 0, FlowerPotBlock.plants, 0, FlowerPotBlock.plants.length); + + FlowerPotBlock.soils = new Block[maxNotNull(soils) + 1]; + System.arraycopy(soils, 0, FlowerPotBlock.soils, 0, FlowerPotBlock.soils.length); + + if (PLANT_ID.getValue(Integer.toString(FlowerPotBlock.plants.length)).isEmpty()) { + throw new RuntimeException("There are too much plant ID values!"); + } + if (SOIL_ID.getValue(Integer.toString(FlowerPotBlock.soils.length)).isEmpty()) { + throw new RuntimeException("There are too much soil ID values!"); + } + } + + private int maxNotNull(Block[] array) { + int max = 0; + for (int i = 0; i < array.length; i++) { + if (array[i] != null) { + max = i; + } + } + return max; + } + + private void processBlock(Block[] target, Block block, String path, Map idMap) { + ResourceLocation location = Registry.BLOCK.getKey(block); + if (idMap.containsKey(location.getPath())) { + target[idMap.get(location.getPath())] = block; + } + else { + for (int i = 0; i < target.length; i++) { + if (!idMap.values().contains(i)) { + target[i] = block; + idMap.put(location.getPath(), i); + Configs.BLOCK_CONFIG.getInt(path, location.getPath(), i); + break; + } + } + } + } + + @Override + public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { + if (level.isClientSide) { + return InteractionResult.CONSUME; + } + ItemStack itemStack = player.getItemInHand(hand); + int soilID = state.getValue(SOIL_ID); + if (soilID == 0 || soilID > soils.length || soils[soilID - 1] == null) { + if (!(itemStack.getItem() instanceof BlockItem)) { + return InteractionResult.PASS; + } + Block block = ((BlockItem) itemStack.getItem()).getBlock(); + for (int i = 0; i < soils.length; i++) { + if (block == soils[i]) { + BlocksHelper.setWithUpdate(level, pos, state.setValue(SOIL_ID, i + 1)); + return InteractionResult.SUCCESS; + } + } + return InteractionResult.PASS; + } + + int plantID = state.getValue(PLANT_ID); + if (itemStack.isEmpty()) { + if (plantID > 0 && plantID <= plants.length && plants[plantID - 1] != null) { + BlocksHelper.setWithUpdate(level, pos, state.setValue(PLANT_ID, 0).setValue(POT_LIGHT, 0)); + player.addItem(new ItemStack(plants[plantID - 1])); + return InteractionResult.SUCCESS; + } + if (soilID > 0 && soilID <= soils.length && soils[soilID - 1] != null) { + BlocksHelper.setWithUpdate(level, pos, state.setValue(SOIL_ID, 0)); + player.addItem(new ItemStack(soils[soilID - 1])); + } + return InteractionResult.PASS; + } + if (!(itemStack.getItem() instanceof BlockItem)) { + return InteractionResult.PASS; + } + BlockItem item = (BlockItem) itemStack.getItem(); + for (int i = 0; i < plants.length; i++) { + if (item.getBlock() == plants[i]) { + if (!((PottablePlant) plants[i]).canPlantOn(soils[soilID - 1])) { + return InteractionResult.PASS; + } + int light = plants[i].defaultBlockState().getLightEmission() / 5; + BlocksHelper.setWithUpdate(level, pos, state.setValue(PLANT_ID, i + 1).setValue(POT_LIGHT, light)); + level.playLocalSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, SoundEvents.HOE_TILL, SoundSource.BLOCKS, 1, 1, false); + return InteractionResult.SUCCESS; + } + } + return InteractionResult.PASS; + } + + @Override + @Environment(EnvType.CLIENT) + public BlockModel getItemModel(ResourceLocation blockId) { + Optional pattern = PatternsHelper.createJson(Patterns.BLOCK_FLOWER_POT, blockId); + return ModelsHelper.fromPattern(pattern); + } + + @Override + @Environment(EnvType.CLIENT) + public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { + MultiPartBuilder model = MultiPartBuilder.create(stateDefinition); + model.part(new ModelResourceLocation(stateId.getNamespace(), stateId.getPath(), "inventory")).add(); + Transformation offset = new Transformation(new Vector3f(0, 7.5F / 16F, 0), null, null, null); + + for (int i = 0; i < plants.length; i++) { + if (plants[i] == null) { + continue; + } + + final int compareID = i + 1; + ResourceLocation modelPath = Registry.BLOCK.getKey(plants[i]); + ResourceLocation objSource = new ResourceLocation(modelPath.getNamespace(), "models/block/" + modelPath.getPath() + "_potted.json"); + + if (Minecraft.getInstance().getResourceManager().hasResource(objSource)) { + objSource = new ResourceLocation(modelPath.getNamespace(), "block/" + modelPath.getPath() + "_potted"); + model.part(objSource).setTransformation(offset).setCondition(state -> state.getValue(PLANT_ID) == compareID).add(); + continue; + } + + else if (plants[i] instanceof SaplingBlock) { + ResourceLocation loc = Registry.BLOCK.getKey(plants[i]); + modelPath = new ResourceLocation(loc.getNamespace(), "block/" + loc.getPath() + "_potted"); + Map textures = Maps.newHashMap(); + textures.put("%modid%", loc.getNamespace()); + textures.put("%texture%", loc.getPath()); + Optional pattern = Patterns.createJson(BasePatterns.BLOCK_CROSS, textures); + UnbakedModel unbakedModel = ModelsHelper.fromPattern(pattern); + modelCache.put(modelPath, unbakedModel); + model.part(modelPath).setTransformation(offset).setCondition(state -> state.getValue(PLANT_ID) == compareID).add(); + continue; + } + else if (plants[i] instanceof PottableLeavesBlock) { + ResourceLocation loc = Registry.BLOCK.getKey(plants[i]); + modelPath = new ResourceLocation(loc.getNamespace(), "block/" + loc.getPath() + "_potted"); + Map textures = Maps.newHashMap(); + textures.put("%leaves%", loc.getPath().contains("lucernia") ? loc.getPath() + "_1" : loc.getPath()); + textures.put("%stem%", loc.getPath().replace("_leaves", "_log_side")); + Optional pattern = Patterns.createJson(Patterns.BLOCK_POTTED_LEAVES, textures); + UnbakedModel unbakedModel = ModelsHelper.fromPattern(pattern); + modelCache.put(modelPath, unbakedModel); + model.part(modelPath).setTransformation(offset).setCondition(state -> state.getValue(PLANT_ID) == compareID).add(); + continue; + } + + objSource = new ResourceLocation(modelPath.getNamespace(), "blockstates/" + modelPath.getPath() + ".json"); + JsonObject obj = JsonFactory.getJsonObject(objSource); + if (obj != null) { + JsonElement variants = obj.get("variants"); + JsonElement list = null; + String path = null; + + if (variants == null) { + continue; + } + + if (variants.isJsonArray()) { + list = variants.getAsJsonArray().get(0); + } + else if (variants.isJsonObject()) { + list = variants.getAsJsonObject().get(((PottablePlant) plants[i]).getPottedState()); + } + + if (list == null) { + BetterEnd.LOGGER.warning("Incorrect json for pot plant " + objSource + ", no matching variants"); + continue; + } + + if (list.isJsonArray()) { + path = list.getAsJsonArray().get(0).getAsJsonObject().get("model").getAsString(); + } + else { + path = list.getAsJsonObject().get("model").getAsString(); + } + + if (path == null) { + BetterEnd.LOGGER.warning("Incorrect json for pot plant " + objSource + ", no matching variants"); + continue; + } + + model.part(new ResourceLocation(path)).setTransformation(offset).setCondition(state -> state.getValue(PLANT_ID) == compareID).add(); + } + else { + for (ResourceLocation location: modelCache.keySet()) { + if (location.getPath().equals(modelPath.getPath())) { + model.part(location).setTransformation(offset).setCondition(state -> state.getValue(PLANT_ID) == compareID).add(); + break; + } + } + } + } + + for (int i = 0; i < soils.length; i++) { + if (soils[i] == null) { + continue; + } + + ResourceLocation soilLoc = BetterEnd.makeID("flower_pot_soil_" + i); + if (!modelCache.containsKey(soilLoc)) { + String texture = Registry.BLOCK.getKey(soils[i]).getPath() + "_top"; + if (texture.contains("rutiscus")) { + texture += "_1"; + } + Optional pattern = Patterns.createJson(Patterns.BLOCK_FLOWER_POT_SOIL, texture); + UnbakedModel soil = ModelsHelper.fromPattern(pattern); + modelCache.put(soilLoc, soil); + } + final int compareID = i + 1; + model.part(soilLoc).setCondition(state -> state.getValue(SOIL_ID) == compareID).add(); + } + + UnbakedModel result = model.build(); + modelCache.put(stateId, result); + return result; + } + + @Override + public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { + int id = state.getValue(PLANT_ID); + return id > 0 && id <= plants.length ? SHAPE_FULL : SHAPE_EMPTY; + } + + @Override + public VoxelShape getCollisionShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { + return SHAPE_EMPTY; + } + + @Override + public BCLRenderLayer getRenderLayer() { + return BCLRenderLayer.CUTOUT; + } + + static { + SHAPE_EMPTY = Shapes.or(Block.box(4, 1, 4, 12, 8, 12), Block.box(5, 0, 5, 11, 1, 11)); + SHAPE_FULL = Shapes.or(SHAPE_EMPTY, Block.box(3, 8, 3, 13, 16, 13)); + } +} \ No newline at end of file diff --git a/src/main/java/ru/betterend/blocks/GlowingMossBlock.java b/src/main/java/ru/betterend/blocks/GlowingMossBlock.java index 10b21eab..5b065c01 100644 --- a/src/main/java/ru/betterend/blocks/GlowingMossBlock.java +++ b/src/main/java/ru/betterend/blocks/GlowingMossBlock.java @@ -12,17 +12,17 @@ public class GlowingMossBlock extends EndPlantBlock { public GlowingMossBlock(int light) { super(light); } - + @Override protected boolean isTerrain(BlockState state) { return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM; } - + @Environment(EnvType.CLIENT) public boolean hasEmissiveLighting(BlockGetter world, BlockPos pos) { return true; } - + @Environment(EnvType.CLIENT) public float getAmbientOcclusionLightLevel(BlockGetter world, BlockPos pos) { return 1F; diff --git a/src/main/java/ru/betterend/blocks/GlowingPillarLuminophorBlock.java b/src/main/java/ru/betterend/blocks/GlowingPillarLuminophorBlock.java index b2b5b903..bbaed475 100644 --- a/src/main/java/ru/betterend/blocks/GlowingPillarLuminophorBlock.java +++ b/src/main/java/ru/betterend/blocks/GlowingPillarLuminophorBlock.java @@ -19,22 +19,17 @@ import ru.betterend.registry.EndBlocks; public class GlowingPillarLuminophorBlock extends BaseBlock { public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL; - + public GlowingPillarLuminophorBlock() { - super(FabricBlockSettings.of(Material.LEAVES) - .materialColor(MaterialColor.COLOR_ORANGE) - .breakByTool(FabricToolTags.SHEARS) - .strength(0.2F) - .luminance(15) - .sound(SoundType.GRASS)); + super(FabricBlockSettings.of(Material.LEAVES).materialColor(MaterialColor.COLOR_ORANGE).breakByTool(FabricToolTags.SHEARS).strength(0.2F).luminance(15).sound(SoundType.GRASS)); this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false)); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { return !state.getValue(NATURAL) || world.getBlockState(pos.below()).is(EndBlocks.GLOWING_PILLAR_ROOTS); } - + @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { if (!canSurvive(state, world, pos)) { @@ -44,7 +39,7 @@ public class GlowingPillarLuminophorBlock extends BaseBlock { return state; } } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(NATURAL); diff --git a/src/main/java/ru/betterend/blocks/GlowingPillarRootsBlock.java b/src/main/java/ru/betterend/blocks/GlowingPillarRootsBlock.java index 4af0f1ac..fe1f49ef 100644 --- a/src/main/java/ru/betterend/blocks/GlowingPillarRootsBlock.java +++ b/src/main/java/ru/betterend/blocks/GlowingPillarRootsBlock.java @@ -16,17 +16,17 @@ import ru.betterend.registry.EndBlocks; public class GlowingPillarRootsBlock extends UpDownPlantBlock { public static final EnumProperty SHAPE = BlockProperties.TRIPLE_SHAPE; - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(SHAPE); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.AMBER_MOSS); } - + @Override @Environment(EnvType.CLIENT) public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) { diff --git a/src/main/java/ru/betterend/blocks/GlowingPillarSeedBlock.java b/src/main/java/ru/betterend/blocks/GlowingPillarSeedBlock.java index 549f8664..55f7fdec 100644 --- a/src/main/java/ru/betterend/blocks/GlowingPillarSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/GlowingPillarSeedBlock.java @@ -21,17 +21,11 @@ import ru.betterend.registry.EndBlocks; import java.util.Random; public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock { - + public GlowingPillarSeedBlock() { - super(FabricBlockSettings.of(Material.PLANT) - .breakByTool(FabricToolTags.SHEARS) - .breakByHand(true) - .sound(SoundType.GRASS) - .lightLevel(state -> state.getValue(AGE) * 3 + 3) - .randomTicks() - .noCollission()); + super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).lightLevel(state -> state.getValue(AGE) * 3 + 3).randomTicks().noCollission()); } - + @Override public void growAdult(WorldGenLevel world, Random random, BlockPos pos) { int height = MHelper.randRange(1, 2, random); @@ -39,7 +33,7 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock { if (h < height) { return; } - + MutableBlockPos mut = new MutableBlockPos().set(pos); BlockState roots = EndBlocks.GLOWING_PILLAR_ROOTS.defaultBlockState(); if (height < 2) { @@ -63,12 +57,12 @@ public class GlowingPillarSeedBlock extends EndPlantWithAgeBlock { BlocksHelper.setWithUpdate(world, mut, EndBlocks.GLOWING_PILLAR_LEAVES.defaultBlockState().setValue(BlockStateProperties.FACING, Direction.UP)); } } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.AMBER_MOSS); } - + @Override public BlockBehaviour.OffsetType getOffsetType() { return BlockBehaviour.OffsetType.NONE; diff --git a/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java b/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java index 3f893e82..91ab9c2f 100644 --- a/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java +++ b/src/main/java/ru/betterend/blocks/HelixTreeLeavesBlock.java @@ -32,35 +32,30 @@ import java.util.List; public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider { public static final IntegerProperty COLOR = EndBlockProperties.COLOR; private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0); - + public HelixTreeLeavesBlock() { - super(FabricBlockSettings.of(Material.LEAVES) - .materialColor(MaterialColor.COLOR_ORANGE) - .breakByTool(FabricToolTags.SHEARS) - .sound(SoundType.WART_BLOCK) - .sound(SoundType.GRASS) - .strength(0.2F)); + super(FabricBlockSettings.of(Material.LEAVES).materialColor(MaterialColor.COLOR_ORANGE).breakByTool(FabricToolTags.SHEARS).sound(SoundType.WART_BLOCK).sound(SoundType.GRASS).strength(0.2F)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(COLOR); } - + @Override public BlockColor getProvider() { return (state, world, pos, tintIndex) -> { return ColorUtil.color(237, getGreen(state.getValue(COLOR)), 20); }; } - + @Override public ItemColor getItemProvider() { return (stack, tintIndex) -> { return ColorUtil.color(237, getGreen(4), 20); }; } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { double px = ctx.getClickedPos().getX() * 0.1; @@ -68,12 +63,12 @@ public class HelixTreeLeavesBlock extends BaseBlock implements IColorProvider { double pz = ctx.getClickedPos().getZ() * 0.1; return this.defaultBlockState().setValue(COLOR, MHelper.floor(NOISE.eval(px, py, pz) * 3.5 + 4)); } - + private int getGreen(int color) { float delta = color / 7F; return (int) Mth.lerp(delta, 80, 158); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); diff --git a/src/main/java/ru/betterend/blocks/HelixTreeSaplingBlock.java b/src/main/java/ru/betterend/blocks/HelixTreeSaplingBlock.java index 527cfd49..3650496c 100644 --- a/src/main/java/ru/betterend/blocks/HelixTreeSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/HelixTreeSaplingBlock.java @@ -1,12 +1,28 @@ package ru.betterend.blocks; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; import ru.bclib.blocks.FeatureSaplingBlock; +import ru.betterend.blocks.basis.PottableFeatureSapling; +import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; -public class HelixTreeSaplingBlock extends FeatureSaplingBlock { +public class HelixTreeSaplingBlock extends PottableFeatureSapling { @Override protected Feature getFeature() { return EndFeatures.HELIX_TREE.getFeature(); } + + @Override + public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { + return world.getBlockState(pos.below()).is(EndBlocks.AMBER_MOSS); + } + + @Override + public boolean canPlantOn(Block block) { + return block == EndBlocks.AMBER_MOSS; + } } diff --git a/src/main/java/ru/betterend/blocks/HydraluxBlock.java b/src/main/java/ru/betterend/blocks/HydraluxBlock.java index f5f93876..c9179b5b 100644 --- a/src/main/java/ru/betterend/blocks/HydraluxBlock.java +++ b/src/main/java/ru/betterend/blocks/HydraluxBlock.java @@ -29,23 +29,18 @@ import java.util.List; import java.util.Random; public class HydraluxBlock extends UnderwaterPlantBlock { - + public static final EnumProperty SHAPE = EndBlockProperties.HYDRALUX_SHAPE; - + public HydraluxBlock() { - super(FabricBlockSettings.of(Material.WATER_PLANT) - .breakByTool(FabricToolTags.SHEARS) - .breakByHand(true) - .sound(SoundType.WET_GRASS) - .lightLevel((state) -> state.getValue(SHAPE).hasGlow() ? 15 : 0) - .noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS).lightLevel((state) -> state.getValue(SHAPE).hasGlow() ? 15 : 0).noCollission()); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(SHAPE); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { BlockState down = world.getBlockState(pos.below()); @@ -60,28 +55,28 @@ public class HydraluxBlock extends UnderwaterPlantBlock { return down.is(this) && world.getBlockState(pos.above()).is(this); } } - + @Override protected boolean isTerrain(BlockState state) { return state.is(TagAPI.END_GROUND); } - + @Override public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) { return false; } - + @Override public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) { return false; } - + @Override @Environment(EnvType.CLIENT) public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) { return new ItemStack(EndBlocks.HYDRALUX_SAPLING); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { HydraluxShape shape = state.getValue(SHAPE); diff --git a/src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java b/src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java index 14c08d7d..c45b296a 100644 --- a/src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java +++ b/src/main/java/ru/betterend/blocks/HydraluxPetalBlock.java @@ -13,19 +13,13 @@ import ru.bclib.blocks.BaseBlock; public class HydraluxPetalBlock extends BaseBlock { public HydraluxPetalBlock() { - this(FabricBlockSettings.of(Material.PLANT) - .breakByTool(FabricToolTags.AXES) - .breakByHand(true) - .hardness(1) - .resistance(1) - .materialColor(MaterialColor.PODZOL) - .sound(SoundType.WART_BLOCK)); + this(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.AXES).breakByHand(true).hardness(1).resistance(1).materialColor(MaterialColor.PODZOL).sound(SoundType.WART_BLOCK)); } - + public HydraluxPetalBlock(Properties settings) { super(settings); } - + @Override public void fallOn(Level level, BlockState blockState, BlockPos blockPos, Entity entity, float f) { } diff --git a/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java b/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java index 0b27b837..17c58284 100644 --- a/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java +++ b/src/main/java/ru/betterend/blocks/HydraluxPetalColoredBlock.java @@ -20,17 +20,17 @@ public class HydraluxPetalColoredBlock extends HydraluxPetalBlock implements ICo public HydraluxPetalColoredBlock(FabricBlockSettings settings) { super(settings); } - + @Override public BlockColor getProvider() { return (state, world, pos, tintIndex) -> BlocksHelper.getBlockColor(this); } - + @Override public ItemColor getItemProvider() { return (stack, tintIndex) -> BlocksHelper.getBlockColor(this); } - + @Override @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { diff --git a/src/main/java/ru/betterend/blocks/HydraluxSaplingBlock.java b/src/main/java/ru/betterend/blocks/HydraluxSaplingBlock.java index 05a2cf0b..05532be7 100644 --- a/src/main/java/ru/betterend/blocks/HydraluxSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/HydraluxSaplingBlock.java @@ -14,19 +14,19 @@ import ru.betterend.registry.EndBlocks; import java.util.Random; public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock { - + @Override public void grow(WorldGenLevel world, Random random, BlockPos pos) { int h = MHelper.randRange(4, 8, random); MutableBlockPos mut = new MutableBlockPos().set(pos); - + for (int i = 1; i < h; i++) { mut.setY(pos.getY() + i); if (!world.getBlockState(mut).is(Blocks.WATER)) { return; } } - + mut.setY(pos.getY()); BlockState state = EndBlocks.HYDRALUX.defaultBlockState(); BlocksHelper.setWithoutUpdate(world, pos, state.setValue(EndBlockProperties.HYDRALUX_SHAPE, HydraluxShape.ROOTS)); @@ -34,15 +34,15 @@ public class HydraluxSaplingBlock extends UnderwaterPlantWithAgeBlock { mut.setY(pos.getY() + i); BlocksHelper.setWithoutUpdate(world, mut, state.setValue(EndBlockProperties.HYDRALUX_SHAPE, HydraluxShape.VINE)); } - + mut.setY(mut.getY() + 1); boolean big = random.nextBoolean(); BlocksHelper.setWithoutUpdate(world, mut, state.setValue(EndBlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_BOTTOM : HydraluxShape.FLOWER_SMALL_BOTTOM)); - + mut.setY(mut.getY() + 1); BlocksHelper.setWithoutUpdate(world, mut, state.setValue(EndBlockProperties.HYDRALUX_SHAPE, big ? HydraluxShape.FLOWER_BIG_TOP : HydraluxShape.FLOWER_SMALL_TOP)); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.SULPHURIC_ROCK.stone); diff --git a/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java b/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java index 6b5eba5e..29dd87f5 100644 --- a/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java +++ b/src/main/java/ru/betterend/blocks/HydrothermalVentBlock.java @@ -40,7 +40,6 @@ import ru.bclib.blocks.BlockProperties; import ru.bclib.util.BlocksHelper; import ru.betterend.blocks.entities.BlockEntityHydrothermalVent; import ru.betterend.registry.EndBlocks; -import ru.betterend.registry.EndParticles; import java.util.Random; @@ -49,42 +48,38 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE; private static final VoxelShape SHAPE = Block.box(1, 1, 1, 15, 16, 15); - + public HydrothermalVentBlock() { - super(FabricBlockSettings.of(Material.STONE) - .breakByTool(FabricToolTags.PICKAXES) - .sound(SoundType.STONE) - .noCollission() - .requiresCorrectToolForDrops()); + super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES).sound(SoundType.STONE).noCollission().requiresCorrectToolForDrops()); this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, true).setValue(ACTIVATED, false)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(WATERLOGGED, ACTIVATED); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return SHAPE; } - + @Override public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) { return false; } - + @Override public boolean placeLiquid(LevelAccessor world, BlockPos pos, BlockState state, FluidState fluidState) { return false; } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { state = world.getBlockState(pos.below()); return state.is(EndBlocks.SULPHURIC_ROCK.stone); } - + @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { if (!canSurvive(state, world, pos)) { @@ -95,24 +90,24 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo } return state; } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { LevelAccessor worldAccess = ctx.getLevel(); BlockPos blockPos = ctx.getClickedPos(); return this.defaultBlockState().setValue(WATERLOGGED, worldAccess.getFluidState(blockPos).getType() == Fluids.WATER); } - + @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); } - + @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { return new BlockEntityHydrothermalVent(pos, state); } - + @Override public void tick(BlockState state, ServerLevel world, BlockPos pos, Random random) { BlockPos up = pos.above(); @@ -121,14 +116,14 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo world.getBlockTicks().scheduleTick(up, EndBlocks.VENT_BUBBLE_COLUMN, 5); } } - + @Override public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) { if (world instanceof ServerLevel && state.getValue(WATERLOGGED) && world.getBlockState(pos.above()).is(Blocks.WATER)) { tick(state, (ServerLevel) world, pos, world.random); } } - + @Environment(EnvType.CLIENT) public void animateTick(BlockState state, Level world, BlockPos pos, Random random) { super.animateTick(state, world, pos, random); @@ -139,7 +134,7 @@ public class HydrothermalVentBlock extends BaseBlockNotFull implements EntityBlo world.addParticle(ParticleTypes.LARGE_SMOKE, x, y, z, 0, 0, 0); } } - + @Nullable @Override public BlockEntityTicker getTicker(Level level, BlockState blockState, BlockEntityType blockEntityType) { diff --git a/src/main/java/ru/betterend/blocks/InfusionPedestal.java b/src/main/java/ru/betterend/blocks/InfusionPedestal.java index 45c2e56e..bc802776 100644 --- a/src/main/java/ru/betterend/blocks/InfusionPedestal.java +++ b/src/main/java/ru/betterend/blocks/InfusionPedestal.java @@ -15,19 +15,18 @@ import net.minecraft.world.phys.shapes.VoxelShape; import org.jetbrains.annotations.Nullable; import ru.betterend.blocks.basis.PedestalBlock; import ru.betterend.blocks.entities.InfusionPedestalEntity; -import ru.betterend.blocks.entities.PedestalBlockEntity; import ru.betterend.rituals.InfusionRitual; @SuppressWarnings("deprecation") public class InfusionPedestal extends PedestalBlock { private static final VoxelShape SHAPE_DEFAULT; private static final VoxelShape SHAPE_PEDESTAL_TOP; - + public InfusionPedestal() { super(Blocks.OBSIDIAN); this.height = 1.08F; } - + @Override public void checkRitual(Level world, BlockPos pos) { BlockEntity blockEntity = world.getBlockEntity(pos); @@ -47,17 +46,17 @@ public class InfusionPedestal extends PedestalBlock { } } } - + @Override public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { return new InfusionPedestalEntity(blockPos, blockState); } - + @Override public boolean hasUniqueEntity() { return true; } - + @Override @Deprecated public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { @@ -76,13 +75,13 @@ public class InfusionPedestal extends PedestalBlock { } return super.getShape(state, world, pos, context); } - + @Override @Nullable public BlockEntityTicker getTicker(Level level, BlockState blockState, BlockEntityType blockEntityType) { return InfusionPedestalEntity::tickEnity; } - + static { VoxelShape basinUp = Block.box(2, 3, 2, 14, 4, 14); VoxelShape basinDown = Block.box(0, 0, 0, 16, 3, 16); diff --git a/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java b/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java index b0b857aa..fb0c574a 100644 --- a/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java +++ b/src/main/java/ru/betterend/blocks/JellyshroomCapBlock.java @@ -39,14 +39,14 @@ public class JellyshroomCapBlock extends SlimeBlock implements IRenderTyped, Blo private final Vec3i colorStart; private final Vec3i colorEnd; private final int coloritem; - + public JellyshroomCapBlock(int r1, int g1, int b1, int r2, int g2, int b2) { super(FabricBlockSettings.copyOf(Blocks.SLIME_BLOCK)); colorStart = new Vec3i(r1, g1, b1); colorEnd = new Vec3i(r2, g2, b2); coloritem = ColorUtil.color((r1 + r2) >> 1, (g1 + g2) >> 1, (b1 + b2) >> 1); } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { double px = ctx.getClickedPos().getX() * 0.1; @@ -54,35 +54,35 @@ public class JellyshroomCapBlock extends SlimeBlock implements IRenderTyped, Blo double pz = ctx.getClickedPos().getZ() * 0.1; return this.defaultBlockState().setValue(COLOR, MHelper.floor(NOISE.eval(px, py, pz) * 3.5 + 4)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(COLOR); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.TRANSLUCENT; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { return Lists.newArrayList(new ItemStack(this)); } - + @Override @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { return getBlockModel(resourceLocation, defaultBlockState()); } - + @Override @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { Optional pattern = Patterns.createJson(Patterns.BLOCK_COLORED, "jellyshroom_cap"); return ModelsHelper.fromPattern(pattern); } - + @Override public BlockColor getProvider() { return (state, world, pos, tintIndex) -> { @@ -93,7 +93,7 @@ public class JellyshroomCapBlock extends SlimeBlock implements IRenderTyped, Blo return ColorUtil.color(r, g, b); }; } - + @Override public ItemColor getItemProvider() { return (stack, tintIndex) -> { diff --git a/src/main/java/ru/betterend/blocks/LacugroveSaplingBlock.java b/src/main/java/ru/betterend/blocks/LacugroveSaplingBlock.java index f353b7dc..968acaa7 100644 --- a/src/main/java/ru/betterend/blocks/LacugroveSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/LacugroveSaplingBlock.java @@ -2,24 +2,31 @@ package ru.betterend.blocks; import net.minecraft.core.BlockPos; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; import ru.bclib.blocks.FeatureSaplingBlock; +import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; -public class LacugroveSaplingBlock extends FeatureSaplingBlock { +public class LacugroveSaplingBlock extends PottableFeatureSapling { public LacugroveSaplingBlock() { super(); } - + @Override protected Feature getFeature() { return EndFeatures.LACUGROVE.getFeature(); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { return world.getBlockState(pos.below()).is(EndBlocks.END_MOSS) || world.getBlockState(pos.below()).is(EndBlocks.ENDSTONE_DUST); } + + @Override + public boolean canPlantOn(Block block) { + return block == EndBlocks.END_MOSS; + } } diff --git a/src/main/java/ru/betterend/blocks/LanceleafBlock.java b/src/main/java/ru/betterend/blocks/LanceleafBlock.java index 081405ab..f2dd344c 100644 --- a/src/main/java/ru/betterend/blocks/LanceleafBlock.java +++ b/src/main/java/ru/betterend/blocks/LanceleafBlock.java @@ -22,19 +22,19 @@ import java.util.Collections; import java.util.List; public class LanceleafBlock extends EndPlantBlock { - + public static final EnumProperty SHAPE = BlockProperties.PENTA_SHAPE; public static final IntegerProperty ROTATION = BlockProperties.ROTATION; - + public LanceleafBlock() { super(); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(SHAPE, ROTATION); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { PentaShape shape = state.getValue(SHAPE); @@ -48,7 +48,7 @@ public class LanceleafBlock extends EndPlantBlock { return world.getBlockState(pos.below()).is(this) && world.getBlockState(pos.above()).is(this); } } - + @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { if (!canSurvive(state, world, pos)) { @@ -58,7 +58,7 @@ public class LanceleafBlock extends EndPlantBlock { return state; } } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { if (state.getValue(SHAPE) == PentaShape.BOTTOM) { diff --git a/src/main/java/ru/betterend/blocks/LanceleafSeedBlock.java b/src/main/java/ru/betterend/blocks/LanceleafSeedBlock.java index 8325e8f7..fdafa498 100644 --- a/src/main/java/ru/betterend/blocks/LanceleafSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/LanceleafSeedBlock.java @@ -34,12 +34,12 @@ public class LanceleafSeedBlock extends EndPlantWithAgeBlock { BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.PRE_TOP)); BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), plant.setValue(BlockProperties.PENTA_SHAPE, PentaShape.TOP)); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.AMBER_MOSS); } - + @Override public BlockBehaviour.OffsetType getOffsetType() { return BlockBehaviour.OffsetType.NONE; diff --git a/src/main/java/ru/betterend/blocks/LargeAmaranitaBlock.java b/src/main/java/ru/betterend/blocks/LargeAmaranitaBlock.java index 098140af..5cdf3dbd 100644 --- a/src/main/java/ru/betterend/blocks/LargeAmaranitaBlock.java +++ b/src/main/java/ru/betterend/blocks/LargeAmaranitaBlock.java @@ -26,30 +26,26 @@ public class LargeAmaranitaBlock extends EndPlantBlock { public static final EnumProperty SHAPE = BlockProperties.TRIPLE_SHAPE; private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 14, 12); private static final VoxelShape SHAPE_TOP = Shapes.or(Block.box(1, 3, 1, 15, 16, 15), SHAPE_BOTTOM); - + public LargeAmaranitaBlock() { - super(FabricBlockSettings.of(Material.PLANT) - .breakByTool(FabricToolTags.SHEARS) - .breakByHand(true) - .sound(SoundType.GRASS) - .lightLevel((state) -> (state.getValue(SHAPE) == TripleShape.TOP) ? 15 : 0)); + super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).lightLevel((state) -> (state.getValue(SHAPE) == TripleShape.TOP) ? 15 : 0)); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return state.getValue(SHAPE) == TripleShape.TOP ? SHAPE_TOP : SHAPE_BOTTOM; } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.SANGNUM) || state.is(EndBlocks.MOSSY_OBSIDIAN) || state.is(EndBlocks.MOSSY_DRAGON_BONE); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(SHAPE); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { TripleShape shape = state.getValue(SHAPE); @@ -63,17 +59,17 @@ public class LargeAmaranitaBlock extends EndPlantBlock { return world.getBlockState(pos.below()).is(this) && world.getBlockState(pos.above()).is(this); } } - + @Override public OffsetType getOffsetType() { return OffsetType.NONE; } - + @Override public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) { return false; } - + @Override public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) { return false; diff --git a/src/main/java/ru/betterend/blocks/LucerniaSaplingBlock.java b/src/main/java/ru/betterend/blocks/LucerniaSaplingBlock.java index b174bb8e..2bc76f6f 100644 --- a/src/main/java/ru/betterend/blocks/LucerniaSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/LucerniaSaplingBlock.java @@ -2,24 +2,31 @@ package ru.betterend.blocks; import net.minecraft.core.BlockPos; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; import ru.bclib.blocks.FeatureSaplingBlock; +import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; -public class LucerniaSaplingBlock extends FeatureSaplingBlock { +public class LucerniaSaplingBlock extends PottableFeatureSapling { public LucerniaSaplingBlock() { super(); } - + @Override protected Feature getFeature() { return EndFeatures.LUCERNIA.getFeature(); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { return world.getBlockState(pos.below()).is(EndBlocks.RUTISCUS); } + + @Override + public boolean canPlantOn(Block block) { + return block == EndBlocks.RUTISCUS; + } } diff --git a/src/main/java/ru/betterend/blocks/LumecornBlock.java b/src/main/java/ru/betterend/blocks/LumecornBlock.java index 95257dd1..e2a494bc 100644 --- a/src/main/java/ru/betterend/blocks/LumecornBlock.java +++ b/src/main/java/ru/betterend/blocks/LumecornBlock.java @@ -36,29 +36,26 @@ public class LumecornBlock extends BaseBlockNotFull implements IRenderTyped { public static final EnumProperty SHAPE = EnumProperty.create("shape", LumecornShape.class); private static final VoxelShape SHAPE_BOTTOM = Block.box(6, 0, 6, 10, 16, 10); private static final VoxelShape SHAPE_TOP = Block.box(6, 0, 6, 10, 8, 10); - + public LumecornBlock() { - super(FabricBlockSettings.of(Material.WOOD) - .breakByTool(FabricToolTags.AXES) - .hardness(0.5F) - .luminance(state -> state.getValue(SHAPE).getLight())); + super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).hardness(0.5F).luminance(state -> state.getValue(SHAPE).getLight())); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(SHAPE); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return state.getValue(SHAPE) == LumecornShape.LIGHT_TOP ? SHAPE_TOP : SHAPE_BOTTOM; } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { LumecornShape shape = state.getValue(SHAPE); @@ -72,7 +69,7 @@ public class LumecornBlock extends BaseBlockNotFull implements IRenderTyped { return world.getBlockState(pos.below()).is(this) && world.getBlockState(pos.above()).is(this); } } - + @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { if (!canSurvive(state, world, pos)) { @@ -82,7 +79,7 @@ public class LumecornBlock extends BaseBlockNotFull implements IRenderTyped { return state; } } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { LumecornShape shape = state.getValue(SHAPE); @@ -91,7 +88,7 @@ public class LumecornBlock extends BaseBlockNotFull implements IRenderTyped { } return MHelper.RANDOM.nextBoolean() ? Collections.singletonList(new ItemStack(EndItems.LUMECORN_ROD)) : Collections.emptyList(); } - + @Override @Environment(EnvType.CLIENT) public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) { diff --git a/src/main/java/ru/betterend/blocks/LumecornSeedBlock.java b/src/main/java/ru/betterend/blocks/LumecornSeedBlock.java index b7e7b3af..efd74d09 100644 --- a/src/main/java/ru/betterend/blocks/LumecornSeedBlock.java +++ b/src/main/java/ru/betterend/blocks/LumecornSeedBlock.java @@ -12,17 +12,17 @@ import ru.betterend.registry.EndFeatures; import java.util.Random; public class LumecornSeedBlock extends EndPlantWithAgeBlock { - + @Override public void growAdult(WorldGenLevel world, Random random, BlockPos pos) { EndFeatures.LUMECORN.getFeature().place(new FeaturePlaceContext<>(world, null, random, pos, null)); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.END_MOSS); } - + @Override public BlockBehaviour.OffsetType getOffsetType() { return BlockBehaviour.OffsetType.NONE; diff --git a/src/main/java/ru/betterend/blocks/MengerSpongeBlock.java b/src/main/java/ru/betterend/blocks/MengerSpongeBlock.java index 8565038b..2b7ee706 100644 --- a/src/main/java/ru/betterend/blocks/MengerSpongeBlock.java +++ b/src/main/java/ru/betterend/blocks/MengerSpongeBlock.java @@ -27,14 +27,14 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements IRenderTyped public MengerSpongeBlock() { super(FabricBlockSettings.copyOf(Blocks.SPONGE).noOcclusion()); } - + @Override public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { if (absorbWater(world, pos)) { world.setBlockAndUpdate(pos, EndBlocks.MENGER_SPONGE_WET.defaultBlockState()); } } - + @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { if (absorbWater(world, pos)) { @@ -42,17 +42,17 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements IRenderTyped } return state; } - + private boolean absorbWater(LevelAccessor world, BlockPos pos) { Queue> queue = Lists.newLinkedList(); queue.add(new Tuple<>(pos, 0)); int i = 0; - + while (!queue.isEmpty()) { Tuple pair = queue.poll(); BlockPos blockPos = pair.getA(); int j = pair.getB(); - + for (Direction direction : Direction.values()) { BlockPos blockPos2 = blockPos.relative(direction); BlockState blockState = world.getBlockState(blockPos2); @@ -83,15 +83,15 @@ public class MengerSpongeBlock extends BaseBlockNotFull implements IRenderTyped } } } - + if (i > 64) { break; } } - + return i > 0; } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; diff --git a/src/main/java/ru/betterend/blocks/MengerSpongeWetBlock.java b/src/main/java/ru/betterend/blocks/MengerSpongeWetBlock.java index 2b9dc68b..475583d8 100644 --- a/src/main/java/ru/betterend/blocks/MengerSpongeWetBlock.java +++ b/src/main/java/ru/betterend/blocks/MengerSpongeWetBlock.java @@ -30,7 +30,7 @@ public class MengerSpongeWetBlock extends BaseBlockNotFull implements IRenderTyp public MengerSpongeWetBlock() { super(FabricBlockSettings.copyOf(Blocks.WET_SPONGE).noOcclusion()); } - + @Override public void onPlace(BlockState state, Level world, BlockPos pos, BlockState oldState, boolean notify) { if (world.dimensionType().ultraWarm()) { @@ -39,7 +39,7 @@ public class MengerSpongeWetBlock extends BaseBlockNotFull implements IRenderTyp world.playSound(null, pos, SoundEvents.FIRE_EXTINGUISH, SoundSource.BLOCKS, 1.0F, (1.0F + world.getRandom().nextFloat() * 0.2F) * 0.7F); } } - + @Override @Environment(EnvType.CLIENT) public void animateTick(BlockState state, Level world, BlockPos pos, Random random) { @@ -77,12 +77,12 @@ public class MengerSpongeWetBlock extends BaseBlockNotFull implements IRenderTyp } } } - + world.addParticle(ParticleTypes.DRIPPING_WATER, x, y, z, 0, 0, 0); } } } - + @Override public void playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) { BlocksHelper.setWithUpdate(world, pos, Blocks.AIR); @@ -94,12 +94,12 @@ public class MengerSpongeWetBlock extends BaseBlockNotFull implements IRenderTyp world.addFreshEntity(drop); } } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + @Override public FluidState getFluidState(BlockState state) { return Fluids.WATER.getSource(false); diff --git a/src/main/java/ru/betterend/blocks/MossyDragonBoneBlock.java b/src/main/java/ru/betterend/blocks/MossyDragonBoneBlock.java index 28bbc7e1..56500f9c 100644 --- a/src/main/java/ru/betterend/blocks/MossyDragonBoneBlock.java +++ b/src/main/java/ru/betterend/blocks/MossyDragonBoneBlock.java @@ -26,7 +26,7 @@ public class MossyDragonBoneBlock extends BaseRotatedPillarBlock { public MossyDragonBoneBlock() { super(FabricBlockSettings.copyOf(Blocks.BONE_BLOCK).hardness(0.5F).randomTicks()); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); @@ -35,14 +35,14 @@ public class MossyDragonBoneBlock extends BaseRotatedPillarBlock { } return Collections.singletonList(new ItemStack(EndBlocks.DRAGON_BONE_BLOCK)); } - + @Override public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) { if (random.nextInt(16) == 0 && !canSurvive(state, world, pos)) { world.setBlockAndUpdate(pos, Blocks.BONE_BLOCK.defaultBlockState().setValue(AXIS, state.getValue(AXIS))); } } - + @Override public boolean canSurvive(BlockState state, LevelReader worldView, BlockPos pos) { BlockPos blockPos = pos.above(); diff --git a/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java b/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java index c004ce87..0e227568 100644 --- a/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java +++ b/src/main/java/ru/betterend/blocks/MossyGlowshroomCapBlock.java @@ -14,16 +14,16 @@ import ru.betterend.registry.EndBlocks; public class MossyGlowshroomCapBlock extends BaseBlock { public static final BooleanProperty TRANSITION = EndBlockProperties.TRANSITION; - + public MossyGlowshroomCapBlock() { super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sound(SoundType.WOOD)); this.registerDefaultState(this.stateDefinition.any().setValue(TRANSITION, false)); } - + public BlockState getStateForPlacement(BlockPlaceContext ctx) { return this.defaultBlockState().setValue(TRANSITION, EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(ctx.getLevel().getBlockState(ctx.getClickedPos().below()))); } - + protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(TRANSITION); } diff --git a/src/main/java/ru/betterend/blocks/MossyGlowshroomSaplingBlock.java b/src/main/java/ru/betterend/blocks/MossyGlowshroomSaplingBlock.java index 64bc3c75..77f54185 100644 --- a/src/main/java/ru/betterend/blocks/MossyGlowshroomSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/MossyGlowshroomSaplingBlock.java @@ -2,25 +2,31 @@ package ru.betterend.blocks; import net.minecraft.core.BlockPos; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; import ru.bclib.blocks.FeatureSaplingBlock; +import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; -public class MossyGlowshroomSaplingBlock extends FeatureSaplingBlock { - +public class MossyGlowshroomSaplingBlock extends PottableFeatureSapling { public MossyGlowshroomSaplingBlock() { super(7); } - + @Override protected Feature getFeature() { return EndFeatures.MOSSY_GLOWSHROOM.getFeature(); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { return world.getBlockState(pos.below()).is(EndBlocks.END_MOSS) || world.getBlockState(pos.below()).is(EndBlocks.END_MYCELIUM); } + + @Override + public boolean canPlantOn(Block block) { + return block == EndBlocks.END_MOSS || block == EndBlocks.END_MYCELIUM; + } } diff --git a/src/main/java/ru/betterend/blocks/MossyObsidian.java b/src/main/java/ru/betterend/blocks/MossyObsidian.java index b601c482..15417641 100644 --- a/src/main/java/ru/betterend/blocks/MossyObsidian.java +++ b/src/main/java/ru/betterend/blocks/MossyObsidian.java @@ -24,7 +24,7 @@ public class MossyObsidian extends BaseBlock { public MossyObsidian() { super(FabricBlockSettings.copyOf(Blocks.OBSIDIAN).hardness(3).randomTicks()); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); @@ -33,14 +33,14 @@ public class MossyObsidian extends BaseBlock { } return Collections.singletonList(new ItemStack(Blocks.OBSIDIAN)); } - + @Override public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) { if (random.nextInt(16) == 0 && !canSurvive(state, world, pos)) { world.setBlockAndUpdate(pos, Blocks.OBSIDIAN.defaultBlockState()); } } - + public boolean canSurvive(BlockState state, LevelReader worldView, BlockPos pos) { BlockPos blockPos = pos.above(); BlockState blockState = worldView.getBlockState(blockPos); diff --git a/src/main/java/ru/betterend/blocks/MurkweedBlock.java b/src/main/java/ru/betterend/blocks/MurkweedBlock.java index 673fff3a..be422d9b 100644 --- a/src/main/java/ru/betterend/blocks/MurkweedBlock.java +++ b/src/main/java/ru/betterend/blocks/MurkweedBlock.java @@ -27,19 +27,19 @@ public class MurkweedBlock extends EndPlantBlock { double v = random.nextDouble() * 0.1; world.addParticle(ParticleTypes.ENTITY_EFFECT, x, y, z, v, v, v); } - + @Override public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { if (entity instanceof LivingEntity && !((LivingEntity) entity).hasEffect(MobEffects.BLINDNESS)) { ((LivingEntity) entity).addEffect(new MobEffectInstance(MobEffects.BLINDNESS, 50)); } } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.SHADOW_GRASS); } - + @Override public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) { return false; diff --git a/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java b/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java index 7f55cd31..60fcf204 100644 --- a/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java +++ b/src/main/java/ru/betterend/blocks/NeedlegrassBlock.java @@ -29,7 +29,7 @@ public class NeedlegrassBlock extends EndPlantBlock { entity.hurt(DamageSource.CACTUS, 0.1F); } } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); @@ -40,12 +40,12 @@ public class NeedlegrassBlock extends EndPlantBlock { return Lists.newArrayList(new ItemStack(Items.STICK, MHelper.randRange(0, 2, MHelper.RANDOM))); } } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.SHADOW_GRASS); } - + @Override public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) { return false; diff --git a/src/main/java/ru/betterend/blocks/NeonCactusBlock.java b/src/main/java/ru/betterend/blocks/NeonCactusBlock.java index 2d1d9acd..db9468c8 100644 --- a/src/main/java/ru/betterend/blocks/NeonCactusBlock.java +++ b/src/main/java/ru/betterend/blocks/NeonCactusBlock.java @@ -2,9 +2,9 @@ package ru.betterend.blocks; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.world.level.block.Blocks; -import ru.bclib.blocks.BaseRotatedPillarBlock; +import ru.betterend.blocks.basis.LitPillarBlock; -public class NeonCactusBlock extends BaseRotatedPillarBlock { +public class NeonCactusBlock extends LitPillarBlock { public NeonCactusBlock() { super(FabricBlockSettings.copyOf(Blocks.CACTUS).luminance(15)); } diff --git a/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java b/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java index 8cd897ef..4b4df46d 100644 --- a/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/NeonCactusPlantBlock.java @@ -2,6 +2,8 @@ package ru.betterend.blocks; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos.MutableBlockPos; @@ -41,6 +43,7 @@ import ru.bclib.interfaces.IRenderTyped; import ru.bclib.util.BlocksHelper; import ru.bclib.util.MHelper; import ru.betterend.blocks.EndBlockProperties.CactusBottom; +import ru.betterend.interfaces.PottablePlant; import ru.betterend.registry.EndBlocks; import java.util.EnumMap; @@ -48,12 +51,12 @@ import java.util.List; import java.util.Random; @SuppressWarnings("deprecation") -public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, IRenderTyped { +public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, IRenderTyped, PottablePlant { public static final EnumProperty SHAPE = BlockProperties.TRIPLE_SHAPE; public static final EnumProperty CACTUS_BOTTOM = EndBlockProperties.CACTUS_BOTTOM; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; public static final DirectionProperty FACING = BlockStateProperties.FACING; - + private static final EnumMap BIG_SHAPES_OPEN = Maps.newEnumMap(Direction.class); private static final EnumMap MEDIUM_SHAPES_OPEN = Maps.newEnumMap(Direction.class); private static final EnumMap SMALL_SHAPES_OPEN = Maps.newEnumMap(Direction.class); @@ -61,17 +64,17 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate private static final EnumMap MEDIUM_SHAPES = Maps.newEnumMap(Axis.class); private static final EnumMap SMALL_SHAPES = Maps.newEnumMap(Axis.class); private static final int MAX_LENGTH = 12; - + public NeonCactusPlantBlock() { super(FabricBlockSettings.copyOf(Blocks.CACTUS).luminance(15).randomTicks()); registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false).setValue(FACING, Direction.UP).setValue(SHAPE, TripleShape.TOP)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(SHAPE, CACTUS_BOTTOM, WATERLOGGED, FACING); } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { LevelAccessor world = ctx.getLevel(); @@ -90,22 +93,22 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate } return state; } - + @Override public BlockState rotate(BlockState state, Rotation rotation) { return BlocksHelper.rotateHorizontal(state, rotation, FACING); } - + @Override public BlockState mirror(BlockState state, Mirror mirror) { return BlocksHelper.mirrorHorizontal(state, mirror, FACING); } - + @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); } - + @Override public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) { world.getBlockTicks().scheduleTick(pos, this, 2); @@ -125,19 +128,19 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate } return state; } - + @Override public void tick(BlockState blockState, ServerLevel serverLevel, BlockPos blockPos, Random random) { if (!blockState.canSurvive(serverLevel, blockPos)) { serverLevel.destroyBlock(blockPos, true, null, 1); } } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { TripleShape shape = state.getValue(SHAPE); @@ -157,7 +160,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate return shape == TripleShape.MIDDLE ? MEDIUM_SHAPES_OPEN.get(dir) : SMALL_SHAPES_OPEN.get(dir); } } - + @Override public boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) { Direction dir = state.getValue(FACING); @@ -165,7 +168,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate BlockState support = level.getBlockState(supportPos); return support.is(this) || support.isFaceSturdy(level, supportPos, dir); } - + @Override public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) { if (!this.canSurvive(state, world, pos) || random.nextInt(8) > 0) { @@ -200,11 +203,11 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate BlocksHelper.setWithoutUpdate(world, pos.relative(dir), placement); mutateStem(placement, world, pos, MAX_LENGTH); } - + public void growPlant(WorldGenLevel world, BlockPos pos, Random random) { growPlant(world, pos, random, MHelper.randRange(MAX_LENGTH >> 1, MAX_LENGTH, random)); } - + public void growPlant(WorldGenLevel world, BlockPos pos, Random random, int iterations) { BlockState state = defaultBlockState(); BlockState downState = world.getBlockState(pos.below()); @@ -230,7 +233,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate } } } - + private boolean growIteration(WorldGenLevel world, MutableBlockPos pos, Random random, List ends, int length) { BlockState state = world.getBlockState(pos); if (!state.is(this)) { @@ -264,7 +267,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate pos.move(dir); return true; } - + private Direction getSideDirection(WorldGenLevel world, BlockPos pos, BlockState iterState, Direction dir, Random random) { MutableBlockPos iterPos = pos.mutable(); Direction startDir = dir; @@ -286,24 +289,24 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate iterPos.move(dir); iterState = world.getBlockState(iterPos); } - + Direction side = lastDir == null ? BlocksHelper.randomHorizontal(random) : lastDir.getClockWise(); if (side.getOpposite() == startDir) { side = side.getOpposite(); } return side; } - + @Override public boolean isPathfindable(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, PathComputationType pathComputationType) { return false; } - + @Override public void entityInside(BlockState blockState, Level level, BlockPos blockPos, Entity entity) { entity.hurt(DamageSource.CACTUS, 1.0F); } - + private int getLength(BlockState state, ServerLevel world, BlockPos pos, int max) { int length = 0; Direction dir = state.getValue(FACING).getOpposite(); @@ -322,7 +325,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate } return length; } - + private int getHorizontal(BlockState state, WorldGenLevel world, BlockPos pos, int max) { int count = 0; Direction dir = state.getValue(FACING).getOpposite(); @@ -341,7 +344,7 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate } return count; } - + private void mutateStem(BlockState state, WorldGenLevel world, BlockPos pos, int max) { Direction dir = state.getValue(FACING).getOpposite(); MutableBlockPos mut = new MutableBlockPos().set(pos); @@ -360,34 +363,34 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate } } } - + static { BIG_SHAPES.put(Axis.X, Block.box(0, 2, 2, 16, 14, 14)); BIG_SHAPES.put(Axis.Y, Block.box(2, 0, 2, 14, 16, 14)); BIG_SHAPES.put(Axis.Z, Block.box(2, 2, 0, 14, 14, 16)); - + MEDIUM_SHAPES.put(Axis.X, Block.box(0, 3, 3, 16, 13, 13)); MEDIUM_SHAPES.put(Axis.Y, Block.box(3, 0, 3, 13, 16, 13)); MEDIUM_SHAPES.put(Axis.Z, Block.box(3, 3, 0, 13, 13, 16)); - + SMALL_SHAPES.put(Axis.X, Block.box(0, 4, 4, 16, 12, 12)); SMALL_SHAPES.put(Axis.Y, Block.box(4, 0, 4, 12, 16, 12)); SMALL_SHAPES.put(Axis.Z, Block.box(4, 4, 0, 12, 12, 16)); - + BIG_SHAPES_OPEN.put(Direction.UP, Block.box(2, 0, 2, 14, 14, 14)); BIG_SHAPES_OPEN.put(Direction.DOWN, Block.box(2, 2, 2, 14, 16, 14)); BIG_SHAPES_OPEN.put(Direction.NORTH, Block.box(2, 2, 2, 14, 14, 16)); BIG_SHAPES_OPEN.put(Direction.SOUTH, Block.box(2, 2, 0, 14, 14, 14)); BIG_SHAPES_OPEN.put(Direction.WEST, Block.box(2, 2, 2, 16, 14, 14)); BIG_SHAPES_OPEN.put(Direction.EAST, Block.box(0, 2, 2, 14, 14, 14)); - + MEDIUM_SHAPES_OPEN.put(Direction.UP, Block.box(3, 0, 3, 13, 13, 13)); MEDIUM_SHAPES_OPEN.put(Direction.DOWN, Block.box(3, 3, 3, 13, 16, 13)); MEDIUM_SHAPES_OPEN.put(Direction.NORTH, Block.box(3, 3, 3, 13, 13, 16)); MEDIUM_SHAPES_OPEN.put(Direction.SOUTH, Block.box(3, 3, 0, 13, 13, 13)); MEDIUM_SHAPES_OPEN.put(Direction.WEST, Block.box(3, 3, 3, 16, 13, 13)); MEDIUM_SHAPES_OPEN.put(Direction.EAST, Block.box(0, 3, 3, 13, 13, 13)); - + SMALL_SHAPES_OPEN.put(Direction.UP, Block.box(4, 0, 4, 12, 12, 12)); SMALL_SHAPES_OPEN.put(Direction.DOWN, Block.box(4, 4, 4, 12, 16, 12)); SMALL_SHAPES_OPEN.put(Direction.NORTH, Block.box(4, 4, 4, 12, 12, 16)); @@ -395,4 +398,15 @@ public class NeonCactusPlantBlock extends BaseBlockNotFull implements SimpleWate SMALL_SHAPES_OPEN.put(Direction.WEST, Block.box(4, 4, 4, 16, 12, 12)); SMALL_SHAPES_OPEN.put(Direction.EAST, Block.box(0, 4, 4, 12, 12, 12)); } + + @Override + public boolean canPlantOn(Block block) { + return true; + } + + @Override + @Environment(EnvType.CLIENT) + public String getPottedState() { + return "bottom=moss,shape=top,facing=up"; + } } diff --git a/src/main/java/ru/betterend/blocks/PedestalVanilla.java b/src/main/java/ru/betterend/blocks/PedestalVanilla.java index bc729cc9..44004e98 100644 --- a/src/main/java/ru/betterend/blocks/PedestalVanilla.java +++ b/src/main/java/ru/betterend/blocks/PedestalVanilla.java @@ -9,18 +9,18 @@ import java.util.HashMap; import java.util.Map; public class PedestalVanilla extends PedestalBlock { - + public PedestalVanilla(Block parent) { super(parent); } - + @Override protected Map createTexturesMap() { ResourceLocation blockId = Registry.BLOCK.getKey(parent); String name = blockId.getPath().replace("_block", ""); return new HashMap() { private static final long serialVersionUID = 1L; - + { put("%mod%", blockId.getNamespace()); put("%top%", "polished_" + name); diff --git a/src/main/java/ru/betterend/blocks/PondAnemoneBlock.java b/src/main/java/ru/betterend/blocks/PondAnemoneBlock.java index 9ac012a2..202ee564 100644 --- a/src/main/java/ru/betterend/blocks/PondAnemoneBlock.java +++ b/src/main/java/ru/betterend/blocks/PondAnemoneBlock.java @@ -21,21 +21,16 @@ import java.util.Random; public class PondAnemoneBlock extends EndUnderwaterPlantBlock { private static final VoxelShape SHAPE = Block.box(2, 0, 2, 14, 14, 14); - + public PondAnemoneBlock() { - super(FabricBlockSettings.of(Material.WATER_PLANT) - .breakByTool(FabricToolTags.SHEARS) - .breakByHand(true) - .luminance(13) - .sound(SoundType.CORAL_BLOCK) - .noCollission()); + super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).luminance(13).sound(SoundType.CORAL_BLOCK).noCollission()); } - + @Override public BlockBehaviour.OffsetType getOffsetType() { return BlockBehaviour.OffsetType.NONE; } - + @Environment(EnvType.CLIENT) public void animateTick(BlockState state, Level world, BlockPos pos, Random random) { double x = pos.getX() + random.nextDouble(); @@ -43,17 +38,17 @@ public class PondAnemoneBlock extends EndUnderwaterPlantBlock { double z = pos.getZ() + random.nextDouble(); world.addParticle(ParticleTypes.BUBBLE, x, y, z, 0.0D, 0.0D, 0.0D); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return SHAPE; } - + @Override public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) { return false; } - + @Override public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) { return false; diff --git a/src/main/java/ru/betterend/blocks/PythadendronSaplingBlock.java b/src/main/java/ru/betterend/blocks/PythadendronSaplingBlock.java index 580b129a..3f1df4a8 100644 --- a/src/main/java/ru/betterend/blocks/PythadendronSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/PythadendronSaplingBlock.java @@ -2,24 +2,31 @@ package ru.betterend.blocks; import net.minecraft.core.BlockPos; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; import ru.bclib.blocks.FeatureSaplingBlock; +import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; -public class PythadendronSaplingBlock extends FeatureSaplingBlock { +public class PythadendronSaplingBlock extends PottableFeatureSapling { public PythadendronSaplingBlock() { super(); } - + @Override protected Feature getFeature() { return EndFeatures.PYTHADENDRON_TREE.getFeature(); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { return world.getBlockState(pos.below()).is(EndBlocks.CHORUS_NYLIUM); } + + @Override + public boolean canPlantOn(Block block) { + return block == EndBlocks.CHORUS_NYLIUM; + } } diff --git a/src/main/java/ru/betterend/blocks/RespawnObeliskBlock.java b/src/main/java/ru/betterend/blocks/RespawnObeliskBlock.java index c43bc723..57809ae3 100644 --- a/src/main/java/ru/betterend/blocks/RespawnObeliskBlock.java +++ b/src/main/java/ru/betterend/blocks/RespawnObeliskBlock.java @@ -48,25 +48,25 @@ import java.util.List; public class RespawnObeliskBlock extends BaseBlock implements IColorProvider, IRenderTyped { private static final VoxelShape VOXEL_SHAPE_BOTTOM = Block.box(1, 0, 1, 15, 16, 15); private static final VoxelShape VOXEL_SHAPE_MIDDLE_TOP = Block.box(2, 0, 2, 14, 16, 14); - + public static final EnumProperty SHAPE = BlockProperties.TRIPLE_SHAPE; - + public RespawnObeliskBlock() { super(FabricBlockSettings.copyOf(Blocks.END_STONE).luminance((state) -> { return (state.getValue(SHAPE) == TripleShape.BOTTOM) ? 0 : 15; })); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return (state.getValue(SHAPE) == TripleShape.BOTTOM) ? VOXEL_SHAPE_BOTTOM : VOXEL_SHAPE_MIDDLE_TOP; } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(SHAPE); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { for (int i = 0; i < 3; i++) { @@ -76,7 +76,7 @@ public class RespawnObeliskBlock extends BaseBlock implements IColorProvider, IR } return true; } - + @Override public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) { state = this.defaultBlockState(); @@ -84,7 +84,7 @@ public class RespawnObeliskBlock extends BaseBlock implements IColorProvider, IR BlocksHelper.setWithUpdate(world, pos.above(), state.setValue(SHAPE, TripleShape.MIDDLE)); BlocksHelper.setWithUpdate(world, pos.above(2), state.setValue(SHAPE, TripleShape.TOP)); } - + @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { TripleShape shape = state.getValue(SHAPE); @@ -113,7 +113,7 @@ public class RespawnObeliskBlock extends BaseBlock implements IColorProvider, IR } } } - + @Override public void playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) { if (player.isCreative()) { @@ -127,7 +127,7 @@ public class RespawnObeliskBlock extends BaseBlock implements IColorProvider, IR } super.playerWillDestroy(world, pos, state, player); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { if (state.getValue(SHAPE) == TripleShape.BOTTOM) { @@ -137,24 +137,24 @@ public class RespawnObeliskBlock extends BaseBlock implements IColorProvider, IR return Lists.newArrayList(); } } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.TRANSLUCENT; } - + @Override public BlockColor getProvider() { return ((IColorProvider) EndBlocks.AURORA_CRYSTAL).getProvider(); } - + @Override public ItemColor getItemProvider() { return (stack, tintIndex) -> { return ColorUtil.color(255, 255, 255); }; } - + @Override public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { ItemStack itemStack = player.getItemInHand(hand); diff --git a/src/main/java/ru/betterend/blocks/RunedFlavolite.java b/src/main/java/ru/betterend/blocks/RunedFlavolite.java index a7502123..f92cde75 100644 --- a/src/main/java/ru/betterend/blocks/RunedFlavolite.java +++ b/src/main/java/ru/betterend/blocks/RunedFlavolite.java @@ -19,28 +19,24 @@ import java.util.List; public class RunedFlavolite extends BaseBlock { public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE; - + public RunedFlavolite(boolean unbreakable) { - super(FabricBlockSettings.copyOf(EndBlocks.FLAVOLITE.polished) - .strength( - unbreakable ? -1 : 1, - unbreakable ? Blocks.BEDROCK.getExplosionResistance() : Blocks.OBSIDIAN.getExplosionResistance() - ).luminance(state -> { - return state.getValue(ACTIVATED) ? 8 : 0; - })); + super(FabricBlockSettings.copyOf(EndBlocks.FLAVOLITE.polished).strength(unbreakable ? -1 : 1, unbreakable ? Blocks.BEDROCK.getExplosionResistance() : Blocks.OBSIDIAN.getExplosionResistance()).luminance(state -> { + return state.getValue(ACTIVATED) ? 8 : 0; + })); this.registerDefaultState(stateDefinition.any().setValue(ACTIVATED, false)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(ACTIVATED); } - + @Override public boolean dropFromExplosion(Explosion explosion) { return !BlocksHelper.isInvulnerableUnsafe(this.defaultBlockState()); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { if (BlocksHelper.isInvulnerableUnsafe(this.defaultBlockState())) { diff --git a/src/main/java/ru/betterend/blocks/ShadowBerryBlock.java b/src/main/java/ru/betterend/blocks/ShadowBerryBlock.java index 41b72758..e31de007 100644 --- a/src/main/java/ru/betterend/blocks/ShadowBerryBlock.java +++ b/src/main/java/ru/betterend/blocks/ShadowBerryBlock.java @@ -6,17 +6,17 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; -import ru.bclib.blocks.BaseCropBlock; +import ru.betterend.blocks.basis.PottableCropBlock; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndItems; -public class ShadowBerryBlock extends BaseCropBlock { +public class ShadowBerryBlock extends PottableCropBlock { private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 8, 15); - + public ShadowBerryBlock() { super(EndItems.SHADOW_BERRY_RAW, EndBlocks.SHADOW_GRASS); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return SHAPE; diff --git a/src/main/java/ru/betterend/blocks/ShadowGrassBlock.java b/src/main/java/ru/betterend/blocks/ShadowGrassBlock.java index 7149ec83..e75cd4c7 100644 --- a/src/main/java/ru/betterend/blocks/ShadowGrassBlock.java +++ b/src/main/java/ru/betterend/blocks/ShadowGrassBlock.java @@ -15,7 +15,7 @@ public class ShadowGrassBlock extends EndTerrainBlock { public ShadowGrassBlock() { super(MaterialColor.COLOR_BLACK); } - + @Environment(EnvType.CLIENT) public void animateTick(BlockState state, Level world, BlockPos pos, Random random) { super.animateTick(state, world, pos, random); diff --git a/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java b/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java index 9ecb7761..aa58c8e4 100644 --- a/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java +++ b/src/main/java/ru/betterend/blocks/SilkMothHiveBlock.java @@ -39,33 +39,33 @@ import java.util.Random; public class SilkMothHiveBlock extends BaseBlock { public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS; - + public SilkMothHiveBlock() { super(FabricBlockSettings.of(Material.WOOD).breakByHand(true).hardness(0.5F).resistance(0.1F).sound(SoundType.WOOL).noOcclusion().randomTicks()); this.registerDefaultState(defaultBlockState().setValue(FULLNESS, 0)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(FACING, FULLNESS); } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { Direction dir = ctx.getHorizontalDirection().getOpposite(); return this.defaultBlockState().setValue(FACING, dir); } - + @Override public BlockState rotate(BlockState state, Rotation rotation) { return BlocksHelper.rotateHorizontal(state, rotation, FACING); } - + @Override public BlockState mirror(BlockState state, Mirror mirror) { return BlocksHelper.mirrorHorizontal(state, mirror, FACING); } - + @Override public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) { Direction dir = state.getValue(FACING); @@ -86,7 +86,7 @@ public class SilkMothHiveBlock extends BaseBlock { world.addFreshEntity(moth); world.playSound(null, pos, SoundEvents.BEEHIVE_EXIT, SoundSource.BLOCKS, 1, 1); } - + @Override public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { if (hand == InteractionHand.MAIN_HAND) { diff --git a/src/main/java/ru/betterend/blocks/SilkMothNestBlock.java b/src/main/java/ru/betterend/blocks/SilkMothNestBlock.java index b21f8758..3e760b76 100644 --- a/src/main/java/ru/betterend/blocks/SilkMothNestBlock.java +++ b/src/main/java/ru/betterend/blocks/SilkMothNestBlock.java @@ -54,33 +54,33 @@ public class SilkMothNestBlock extends BaseBlock implements IRenderTyped { public static final IntegerProperty FULLNESS = EndBlockProperties.FULLNESS; private static final VoxelShape TOP = box(6, 0, 6, 10, 16, 10); private static final VoxelShape BOTTOM = box(0, 0, 0, 16, 16, 16); - + public SilkMothNestBlock() { super(FabricBlockSettings.of(Material.WOOL).hardness(0.5F).resistance(0.1F).sound(SoundType.WOOL).noOcclusion().randomTicks()); this.registerDefaultState(defaultBlockState().setValue(ACTIVE, true).setValue(FULLNESS, 0)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(ACTIVE, FACING, FULLNESS); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return state.getValue(ACTIVE) ? BOTTOM : TOP; } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { Direction dir = ctx.getHorizontalDirection().getOpposite(); return this.defaultBlockState().setValue(FACING, dir); } - + @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { if (!state.getValue(ACTIVE)) { @@ -93,22 +93,22 @@ public class SilkMothNestBlock extends BaseBlock implements IRenderTyped { } return state; } - + @Override public BlockState rotate(BlockState state, Rotation rotation) { return BlocksHelper.rotateHorizontal(state, rotation, FACING); } - + @Override public BlockState mirror(BlockState state, Mirror mirror) { return BlocksHelper.mirrorHorizontal(state, mirror, FACING); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { return state.getValue(ACTIVE) ? Collections.singletonList(new ItemStack(this)) : Collections.emptyList(); } - + @Override public void playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) { if (!state.getValue(ACTIVE) && player.isCreative()) { @@ -120,7 +120,7 @@ public class SilkMothNestBlock extends BaseBlock implements IRenderTyped { } super.playerWillDestroy(world, pos, state, player); } - + @Override public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) { if (!state.getValue(ACTIVE)) { @@ -147,7 +147,7 @@ public class SilkMothNestBlock extends BaseBlock implements IRenderTyped { world.addFreshEntity(moth); world.playSound(null, pos, SoundEvents.BEEHIVE_EXIT, SoundSource.BLOCKS, 1, 1); } - + @Override public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { if (hand == InteractionHand.MAIN_HAND) { diff --git a/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java b/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java index 8a82e638..db8f7f4b 100644 --- a/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java +++ b/src/main/java/ru/betterend/blocks/SmallAmaranitaBlock.java @@ -20,12 +20,12 @@ import java.util.Random; public class SmallAmaranitaBlock extends EndPlantBlock { private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 10, 12); - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.SANGNUM) || state.is(EndBlocks.MOSSY_OBSIDIAN) || state.is(EndBlocks.MOSSY_DRAGON_BONE); } - + @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { BlockPos bigPos = growBig(world, pos); @@ -40,13 +40,13 @@ public class SmallAmaranitaBlock extends EndPlantBlock { } EndFeatures.LARGE_AMARANITA.getFeature().place(new FeaturePlaceContext<>(world, null, random, pos, null)); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { Vec3 vec3d = state.getOffset(view, pos); return SHAPE.move(vec3d.x, vec3d.y, vec3d.z); } - + private BlockPos growBig(ServerLevel world, BlockPos pos) { for (int x = -1; x < 2; x++) { for (int z = -1; z < 2; z++) { @@ -58,20 +58,17 @@ public class SmallAmaranitaBlock extends EndPlantBlock { } return null; } - + private boolean checkFrame(ServerLevel world, BlockPos pos) { - return world.getBlockState(pos).is(this) && - world.getBlockState(pos.south()).is(this) && - world.getBlockState(pos.east()).is(this) && - world.getBlockState(pos.south().east()).is(this); + return world.getBlockState(pos).is(this) && world.getBlockState(pos.south()).is(this) && world.getBlockState(pos.east()).is(this) && world.getBlockState(pos.south().east()).is(this); } - + private void replaceMushroom(ServerLevel world, BlockPos pos) { if (world.getBlockState(pos).is(this)) { BlocksHelper.setWithUpdate(world, pos, Blocks.AIR); } } - + @Override public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) { return random.nextInt(8) == 0; diff --git a/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java b/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java index a9f2a3cf..a0293a97 100644 --- a/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java +++ b/src/main/java/ru/betterend/blocks/SmallJellyshroomBlock.java @@ -2,6 +2,8 @@ package ru.betterend.blocks; import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; import net.minecraft.core.BlockPos; @@ -30,29 +32,26 @@ import ru.bclib.blocks.BaseAttachedBlock; import ru.bclib.client.render.BCLRenderLayer; import ru.bclib.interfaces.IRenderTyped; import ru.bclib.util.BlocksHelper; +import ru.betterend.interfaces.PottablePlant; import ru.betterend.registry.EndFeatures; import java.util.EnumMap; import java.util.List; import java.util.Random; -public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderTyped, BonemealableBlock { +public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderTyped, BonemealableBlock, PottablePlant { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); - + public SmallJellyshroomBlock() { - super(FabricBlockSettings.of(Material.PLANT) - .breakByTool(FabricToolTags.SHEARS) - .breakByHand(true) - .sound(SoundType.NETHER_WART) - .noCollission()); + super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.NETHER_WART).noCollission()); } - + @Override @SuppressWarnings("deprecation") public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return BOUNDING_SHAPES.get(state.getValue(FACING)); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); @@ -63,7 +62,7 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderT return Lists.newArrayList(); } } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { Direction direction = state.getValue(FACING); @@ -71,12 +70,12 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderT BlockState support = world.getBlockState(blockPos); return canSupportCenter(world, blockPos, direction) && support.canOcclude() && support.getLightEmission() == 0; } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + static { BOUNDING_SHAPES.put(Direction.UP, Block.box(3, 0, 3, 13, 16, 13)); BOUNDING_SHAPES.put(Direction.DOWN, Block.box(3, 0, 3, 13, 16, 13)); @@ -85,20 +84,31 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements IRenderT BOUNDING_SHAPES.put(Direction.WEST, Shapes.box(0.5, 0.0, 0.0, 1.0, 1.0, 1.0)); BOUNDING_SHAPES.put(Direction.EAST, Shapes.box(0.0, 0.0, 0.0, 0.5, 1.0, 1.0)); } - + @Override public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) { return state.getValue(FACING) == Direction.UP && world.getBlockState(pos.below()).is(TagAPI.END_GROUND); } - + @Override public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) { return random.nextInt(16) == 0; } - + @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { BlocksHelper.setWithUpdate(world, pos, Blocks.AIR); EndFeatures.JELLYSHROOM.getFeature().place(new FeaturePlaceContext<>(world, null, random, pos, null)); } + + @Override + public boolean canPlantOn(Block block) { + return true; + } + + @Override + @Environment(EnvType.CLIENT) + public String getPottedState() { + return "facing=up"; + } } diff --git a/src/main/java/ru/betterend/blocks/SmaragdantCrystalBlock.java b/src/main/java/ru/betterend/blocks/SmaragdantCrystalBlock.java index c99d5e79..9852eae0 100644 --- a/src/main/java/ru/betterend/blocks/SmaragdantCrystalBlock.java +++ b/src/main/java/ru/betterend/blocks/SmaragdantCrystalBlock.java @@ -4,16 +4,10 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.material.Material; -import ru.bclib.blocks.BaseRotatedPillarBlock; +import ru.betterend.blocks.basis.LitPillarBlock; -public class SmaragdantCrystalBlock extends BaseRotatedPillarBlock { +public class SmaragdantCrystalBlock extends LitPillarBlock { public SmaragdantCrystalBlock() { - super(FabricBlockSettings.of(Material.GLASS) - .breakByTool(FabricToolTags.PICKAXES) - .luminance(15) - .hardness(1F) - .resistance(1F) - .noOcclusion() - .sound(SoundType.GLASS)); + super(FabricBlockSettings.of(Material.GLASS).breakByTool(FabricToolTags.PICKAXES).luminance(15).hardness(1F).resistance(1F).noOcclusion().sound(SoundType.AMETHYST)); } } diff --git a/src/main/java/ru/betterend/blocks/SmaragdantCrystalShardBlock.java b/src/main/java/ru/betterend/blocks/SmaragdantCrystalShardBlock.java index 2831a2b4..afad9916 100644 --- a/src/main/java/ru/betterend/blocks/SmaragdantCrystalShardBlock.java +++ b/src/main/java/ru/betterend/blocks/SmaragdantCrystalShardBlock.java @@ -35,38 +35,32 @@ import java.util.EnumMap; public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements IRenderTyped, SimpleWaterloggedBlock, LiquidBlockContainer { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; - + public SmaragdantCrystalShardBlock() { - super(FabricBlockSettings.of(Material.STONE) - .materialColor(MaterialColor.COLOR_GREEN) - .breakByTool(FabricToolTags.PICKAXES) - .luminance(15) - .sound(SoundType.GLASS) - .requiresCorrectToolForDrops() - .noCollission()); + super(FabricBlockSettings.of(Material.STONE).materialColor(MaterialColor.COLOR_GREEN).breakByTool(FabricToolTags.PICKAXES).luminance(15).sound(SoundType.AMETHYST_CLUSTER).requiresCorrectToolForDrops().noCollission()); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { super.createBlockStateDefinition(stateManager); stateManager.add(WATERLOGGED); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + @Override public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) { return !state.getValue(WATERLOGGED); } - + @Override public boolean placeLiquid(LevelAccessor world, BlockPos pos, BlockState state, FluidState fluidState) { return !state.getValue(WATERLOGGED); } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { BlockState state = super.getStateForPlacement(ctx); @@ -78,24 +72,24 @@ public class SmaragdantCrystalShardBlock extends BaseAttachedBlock implements IR } return null; } - + @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : Fluids.EMPTY.defaultFluidState(); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return BOUNDING_SHAPES.get(state.getValue(FACING)); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { Direction direction = state.getValue(FACING); BlockPos blockPos = pos.relative(direction.getOpposite()); return world.getBlockState(blockPos).isFaceSturdy(world, blockPos, direction); } - + static { BOUNDING_SHAPES.put(Direction.UP, Shapes.box(0.125, 0.0, 0.125, 0.875F, 0.875F, 0.875F)); BOUNDING_SHAPES.put(Direction.DOWN, Shapes.box(0.125, 0.125, 0.125, 0.875F, 1.0, 0.875F)); diff --git a/src/main/java/ru/betterend/blocks/SulphurCrystalBlock.java b/src/main/java/ru/betterend/blocks/SulphurCrystalBlock.java index e2534aaa..88d6dfcf 100644 --- a/src/main/java/ru/betterend/blocks/SulphurCrystalBlock.java +++ b/src/main/java/ru/betterend/blocks/SulphurCrystalBlock.java @@ -45,42 +45,37 @@ public class SulphurCrystalBlock extends BaseAttachedBlock implements IRenderTyp private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); public static final IntegerProperty AGE = IntegerProperty.create("age", 0, 2); public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; - + public SulphurCrystalBlock() { - super(FabricBlockSettings.of(Material.STONE) - .materialColor(MaterialColor.COLOR_YELLOW) - .breakByTool(FabricToolTags.PICKAXES) - .sound(SoundType.GLASS) - .requiresCorrectToolForDrops() - .noCollission()); + super(FabricBlockSettings.of(Material.STONE).materialColor(MaterialColor.COLOR_YELLOW).breakByTool(FabricToolTags.PICKAXES).sound(SoundType.GLASS).requiresCorrectToolForDrops().noCollission()); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { super.createBlockStateDefinition(stateManager); stateManager.add(AGE, WATERLOGGED); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { return state.getValue(AGE) < 2 ? Collections.emptyList() : Lists.newArrayList(new ItemStack(EndItems.CRYSTALLINE_SULPHUR, MHelper.randRange(1, 3, MHelper.RANDOM))); } - + @Override public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) { return !state.getValue(WATERLOGGED); } - + @Override public boolean placeLiquid(LevelAccessor world, BlockPos pos, BlockState state, FluidState fluidState) { return !state.getValue(WATERLOGGED); } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { BlockState state = super.getStateForPlacement(ctx); @@ -92,24 +87,24 @@ public class SulphurCrystalBlock extends BaseAttachedBlock implements IRenderTyp } return null; } - + @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : Fluids.EMPTY.defaultFluidState(); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return BOUNDING_SHAPES.get(state.getValue(FACING)); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { Direction direction = state.getValue(FACING); BlockPos blockPos = pos.relative(direction.getOpposite()); return world.getBlockState(blockPos).is(EndBlocks.BRIMSTONE); } - + static { BOUNDING_SHAPES.put(Direction.UP, Shapes.box(0.125, 0.0, 0.125, 0.875F, 0.5, 0.875F)); BOUNDING_SHAPES.put(Direction.DOWN, Shapes.box(0.125, 0.5, 0.125, 0.875F, 1.0, 0.875F)); diff --git a/src/main/java/ru/betterend/blocks/TenaneaFlowersBlock.java b/src/main/java/ru/betterend/blocks/TenaneaFlowersBlock.java index c1b32bf0..de030d36 100644 --- a/src/main/java/ru/betterend/blocks/TenaneaFlowersBlock.java +++ b/src/main/java/ru/betterend/blocks/TenaneaFlowersBlock.java @@ -20,11 +20,11 @@ import java.util.Random; public class TenaneaFlowersBlock extends BaseVineBlock implements IColorProvider { public static final Vec3i[] COLORS; - + public TenaneaFlowersBlock() { super(15); } - + @Override public BlockColor getProvider() { return (state, world, pos, tintIndex) -> { @@ -38,29 +38,29 @@ public class TenaneaFlowersBlock extends BaseVineBlock implements IColorProvider int index2 = (index + 1) & 3; delta -= index; index &= 3; - + Vec3i color1 = COLORS[index]; Vec3i color2 = COLORS[index2]; - + int r = MHelper.floor(Mth.lerp(delta, color1.getX(), color2.getX())); int g = MHelper.floor(Mth.lerp(delta, color1.getY(), color2.getY())); int b = MHelper.floor(Mth.lerp(delta, color1.getZ(), color2.getZ())); float[] hsb = ColorUtil.RGBtoHSB(r, g, b, new float[3]); - + return ColorUtil.HSBtoRGB(hsb[0], MHelper.max(0.5F, hsb[1]), hsb[2]); }; } - + @Override public ItemColor getItemProvider() { return (stack, tintIndex) -> ColorUtil.color(255, 255, 255); } - + @Override public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) { return false; } - + @Environment(EnvType.CLIENT) public void animateTick(BlockState state, Level world, BlockPos pos, Random random) { super.animateTick(state, world, pos, random); @@ -71,13 +71,8 @@ public class TenaneaFlowersBlock extends BaseVineBlock implements IColorProvider world.addParticle(EndParticles.TENANEA_PETAL, x, y, z, 0, 0, 0); } } - + static { - COLORS = new Vec3i[]{ - new Vec3i(250, 111, 222), - new Vec3i(167, 89, 255), - new Vec3i(120, 207, 239), - new Vec3i(255, 87, 182) - }; + COLORS = new Vec3i[]{new Vec3i(250, 111, 222), new Vec3i(167, 89, 255), new Vec3i(120, 207, 239), new Vec3i(255, 87, 182)}; } } diff --git a/src/main/java/ru/betterend/blocks/TenaneaSaplingBlock.java b/src/main/java/ru/betterend/blocks/TenaneaSaplingBlock.java index 5a91977e..2e960926 100644 --- a/src/main/java/ru/betterend/blocks/TenaneaSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/TenaneaSaplingBlock.java @@ -2,24 +2,31 @@ package ru.betterend.blocks; import net.minecraft.core.BlockPos; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; import ru.bclib.blocks.FeatureSaplingBlock; +import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; -public class TenaneaSaplingBlock extends FeatureSaplingBlock { +public class TenaneaSaplingBlock extends PottableFeatureSapling { public TenaneaSaplingBlock() { super(); } - + @Override protected Feature getFeature() { return EndFeatures.TENANEA.getFeature(); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { return world.getBlockState(pos.below()).is(EndBlocks.PINK_MOSS); } + + @Override + public boolean canPlantOn(Block block) { + return block == EndBlocks.PINK_MOSS; + } } diff --git a/src/main/java/ru/betterend/blocks/TerrainPlantBlock.java b/src/main/java/ru/betterend/blocks/TerrainPlantBlock.java index 3f1ba358..3d7d62ab 100644 --- a/src/main/java/ru/betterend/blocks/TerrainPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/TerrainPlantBlock.java @@ -6,12 +6,12 @@ import ru.betterend.blocks.basis.EndPlantBlock; public class TerrainPlantBlock extends EndPlantBlock { private final Block[] ground; - + public TerrainPlantBlock(Block... ground) { super(true); this.ground = ground; } - + @Override protected boolean isTerrain(BlockState state) { for (Block block : ground) { diff --git a/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossBlock.java b/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossBlock.java index e0977aa2..1088eda7 100644 --- a/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossBlock.java +++ b/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossBlock.java @@ -18,27 +18,27 @@ public class TwistedUmbrellaMossBlock extends EndPlantBlock { public TwistedUmbrellaMossBlock() { super(11); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.END_MOSS) || state.is(EndBlocks.END_MYCELIUM) || state.is(EndBlocks.JUNGLE_MOSS); } - + @Environment(EnvType.CLIENT) public boolean hasEmissiveLighting(BlockGetter world, BlockPos pos) { return true; } - + @Environment(EnvType.CLIENT) public float getAmbientOcclusionLightLevel(BlockGetter world, BlockPos pos) { return 1F; } - + @Override public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) { return world.isEmptyBlock(pos.above()); } - + @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { int rot = world.random.nextInt(4); diff --git a/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossTallBlock.java b/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossTallBlock.java index 07bff735..659a8b04 100644 --- a/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossTallBlock.java +++ b/src/main/java/ru/betterend/blocks/TwistedUmbrellaMossTallBlock.java @@ -14,13 +14,13 @@ public class TwistedUmbrellaMossTallBlock extends BaseDoublePlantBlock { public TwistedUmbrellaMossTallBlock() { super(12); } - + @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(EndBlocks.TWISTED_UMBRELLA_MOSS)); world.addFreshEntity(item); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.END_MOSS) || state.is(EndBlocks.END_MYCELIUM) || state.is(EndBlocks.JUNGLE_MOSS); diff --git a/src/main/java/ru/betterend/blocks/UmbrellaMossBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaMossBlock.java index 08ad3fea..c8ebca8a 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaMossBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaMossBlock.java @@ -18,27 +18,27 @@ public class UmbrellaMossBlock extends EndPlantBlock { public UmbrellaMossBlock() { super(11); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.END_MOSS) || state.is(EndBlocks.END_MYCELIUM) || state.is(EndBlocks.JUNGLE_MOSS); } - + @Environment(EnvType.CLIENT) public boolean hasEmissiveLighting(BlockGetter world, BlockPos pos) { return true; } - + @Environment(EnvType.CLIENT) public float getAmbientOcclusionLightLevel(BlockGetter world, BlockPos pos) { return 1F; } - + @Override public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) { return world.isEmptyBlock(pos.above()); } - + @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { int rot = world.random.nextInt(4); diff --git a/src/main/java/ru/betterend/blocks/UmbrellaMossTallBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaMossTallBlock.java index e89bc3c0..8cf39f9c 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaMossTallBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaMossTallBlock.java @@ -14,13 +14,13 @@ public class UmbrellaMossTallBlock extends BaseDoublePlantBlock { public UmbrellaMossTallBlock() { super(12); } - + @Override public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) { ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(EndBlocks.UMBRELLA_MOSS)); world.addFreshEntity(item); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(EndBlocks.END_MOSS) || state.is(EndBlocks.END_MYCELIUM) || state.is(EndBlocks.JUNGLE_MOSS); diff --git a/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterBlock.java index 0ba01d1f..4b37671a 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterBlock.java @@ -25,19 +25,17 @@ import ru.betterend.registry.EndItems; public class UmbrellaTreeClusterBlock extends BaseBlock { public static final BooleanProperty NATURAL = BlockProperties.NATURAL; - + public UmbrellaTreeClusterBlock() { - super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK) - .materialColor(MaterialColor.COLOR_PURPLE) - .luminance(15)); + super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK).materialColor(MaterialColor.COLOR_PURPLE).luminance(15)); registerDefaultState(stateDefinition.any().setValue(NATURAL, false)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(NATURAL); } - + @Override public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { ItemStack stack = player.getMainHandItem(); diff --git a/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterEmptyBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterEmptyBlock.java index 0c5abc6e..68c676f3 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterEmptyBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaTreeClusterEmptyBlock.java @@ -17,19 +17,17 @@ import java.util.Random; public class UmbrellaTreeClusterEmptyBlock extends BaseBlock { public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL; - + public UmbrellaTreeClusterEmptyBlock() { - super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK) - .materialColor(MaterialColor.COLOR_PURPLE) - .randomTicks()); + super(FabricBlockSettings.copyOf(Blocks.NETHER_WART_BLOCK).materialColor(MaterialColor.COLOR_PURPLE).randomTicks()); registerDefaultState(stateDefinition.any().setValue(NATURAL, false)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(NATURAL); } - + @Override public void tick(BlockState state, ServerLevel world, BlockPos pos, Random random) { if (state.getValue(NATURAL) && random.nextInt(16) == 0) { diff --git a/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java index 1f2e0683..b62e41fd 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaTreeMembraneBlock.java @@ -31,11 +31,11 @@ import java.util.List; public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderTyped, BlockModelProvider { public static final IntegerProperty COLOR = EndBlockProperties.COLOR; private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0); - + public UmbrellaTreeMembraneBlock() { super(FabricBlockSettings.copyOf(Blocks.SLIME_BLOCK)); } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { double px = ctx.getClickedPos().getX() * 0.1; @@ -43,17 +43,17 @@ public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderType double pz = ctx.getClickedPos().getZ() * 0.1; return this.defaultBlockState().setValue(COLOR, MHelper.floor(NOISE.eval(px, py, pz) * 3.5 + 4)); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(COLOR); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.TRANSLUCENT; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { if (state.getValue(COLOR) > 0) { @@ -63,12 +63,12 @@ public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderType return MHelper.RANDOM.nextInt(4) == 0 ? Lists.newArrayList(new ItemStack(EndBlocks.UMBRELLA_TREE_SAPLING)) : Collections.emptyList(); } } - + @Override public boolean propagatesSkylightDown(BlockState state, BlockGetter world, BlockPos pos) { return state.getValue(COLOR) > 0; } - + @Environment(EnvType.CLIENT) public boolean skipRendering(BlockState state, BlockState stateFrom, Direction direction) { if (state.getValue(COLOR) > 0) { @@ -78,7 +78,7 @@ public class UmbrellaTreeMembraneBlock extends SlimeBlock implements IRenderType return false; } } - + @Override @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { diff --git a/src/main/java/ru/betterend/blocks/UmbrellaTreeSaplingBlock.java b/src/main/java/ru/betterend/blocks/UmbrellaTreeSaplingBlock.java index 46eebfb8..782942a6 100644 --- a/src/main/java/ru/betterend/blocks/UmbrellaTreeSaplingBlock.java +++ b/src/main/java/ru/betterend/blocks/UmbrellaTreeSaplingBlock.java @@ -2,30 +2,37 @@ package ru.betterend.blocks; import net.minecraft.core.BlockPos; import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.levelgen.feature.Feature; import ru.bclib.blocks.FeatureSaplingBlock; import ru.bclib.client.render.BCLRenderLayer; +import ru.betterend.blocks.basis.PottableFeatureSapling; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndFeatures; -public class UmbrellaTreeSaplingBlock extends FeatureSaplingBlock { +public class UmbrellaTreeSaplingBlock extends PottableFeatureSapling { public UmbrellaTreeSaplingBlock() { super(); } - + @Override protected Feature getFeature() { return EndFeatures.UMBRELLA_TREE.getFeature(); } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { return world.getBlockState(pos.below()).is(EndBlocks.JUNGLE_MOSS); } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.TRANSLUCENT; } + + @Override + public boolean canPlantOn(Block block) { + return block == EndBlocks.JUNGLE_MOSS; + } } diff --git a/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java b/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java index 174a7739..3bbab8d1 100644 --- a/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java +++ b/src/main/java/ru/betterend/blocks/VentBubbleColumnBlock.java @@ -40,29 +40,29 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid public VentBubbleColumnBlock() { super(FabricBlockSettings.of(Material.BUBBLE_COLUMN).noOcclusion().noCollission().noDrops()); } - + @Override public ItemStack pickupBlock(LevelAccessor world, BlockPos pos, BlockState state) { world.setBlock(pos, Blocks.AIR.defaultBlockState(), 11); return new ItemStack(Items.WATER_BUCKET); } - + @Override public RenderShape getRenderShape(BlockState state) { return RenderShape.INVISIBLE; } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { BlockState blockState = world.getBlockState(pos.below()); return blockState.is(this) || blockState.is(EndBlocks.HYDROTHERMAL_VENT); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { return Shapes.empty(); } - + @Override public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) { if (!state.canSurvive(world, pos)) { @@ -77,7 +77,7 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid } return state; } - + @Environment(EnvType.CLIENT) public void animateTick(BlockState state, Level world, BlockPos pos, Random random) { if (random.nextInt(4) == 0) { @@ -90,7 +90,7 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid world.playLocalSound(pos.getX(), pos.getY(), pos.getZ(), SoundEvents.BUBBLE_COLUMN_UPWARDS_AMBIENT, SoundSource.BLOCKS, 0.2F + random.nextFloat() * 0.2F, 0.9F + random.nextFloat() * 0.15F, false); } } - + @Environment(EnvType.CLIENT) public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) { BlockState blockState = world.getBlockState(pos.above()); @@ -98,7 +98,7 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid entity.onAboveBubbleCol(false); if (!world.isClientSide) { ServerLevel serverWorld = (ServerLevel) world; - + for (int i = 0; i < 2; ++i) { serverWorld.sendParticles(ParticleTypes.SPLASH, (double) pos.getX() + world.random.nextDouble(), (double) (pos.getY() + 1), (double) pos.getZ() + world.random.nextDouble(), 1, 0.0D, 0.0D, 0.0D, 1.0D); serverWorld.sendParticles(ParticleTypes.BUBBLE, (double) pos.getX() + world.random.nextDouble(), (double) (pos.getY() + 1), (double) pos.getZ() + world.random.nextDouble(), 1, 0.0D, 0.01D, 0.0D, 0.2D); @@ -109,23 +109,23 @@ public class VentBubbleColumnBlock extends Block implements BucketPickup, Liquid entity.onInsideBubbleColumn(false); } } - + @Override public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) { return false; } - + @Override public boolean placeLiquid(LevelAccessor world, BlockPos pos, BlockState state, FluidState fluidState) { return false; } - + @Override public FluidState getFluidState(BlockState state) { return Fluids.WATER.getSource(false); } - - + + @Override public Optional getPickupSound() { return Fluids.WATER.getPickupSound(); diff --git a/src/main/java/ru/betterend/blocks/basis/EndAnvilBlock.java b/src/main/java/ru/betterend/blocks/basis/EndAnvilBlock.java index 406d26dd..e1599f80 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndAnvilBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndAnvilBlock.java @@ -18,22 +18,22 @@ import java.util.List; import java.util.Objects; public class EndAnvilBlock extends BaseAnvilBlock { - + protected final int level; protected IntegerProperty durability; protected MetalMaterial metalMaterial; protected int maxDurability; - + public EndAnvilBlock(MaterialColor color, int level) { super(color); this.level = level; } - + public EndAnvilBlock(MetalMaterial metalMaterial, MaterialColor color, int level) { this(color, level); this.metalMaterial = metalMaterial; } - + public int getDurability(BlockState blockState) { Block anvilBlock = blockState.getBlock(); if (anvilBlock instanceof EndAnvilBlock) { @@ -41,7 +41,7 @@ public class EndAnvilBlock extends BaseAnvilBlock { } return 0; } - + public IntegerProperty getDurability() { if (durability == null) { this.maxDurability = 5; @@ -49,11 +49,11 @@ public class EndAnvilBlock extends BaseAnvilBlock { } return durability; } - + public int getMaxDurability() { return maxDurability; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { List drops = super.getDrops(state, builder); @@ -61,7 +61,7 @@ public class EndAnvilBlock extends BaseAnvilBlock { itemStack.getOrCreateTag().putInt(EndAnvilItem.DURABILITY, state.getValue(durability)); return drops; } - + @Override @SuppressWarnings("deprecation") public Item asItem() { @@ -70,22 +70,22 @@ public class EndAnvilBlock extends BaseAnvilBlock { } return Item.byBlock(this); } - + @Override public BlockState getStateForPlacement(BlockPlaceContext blockPlaceContext) { return Objects.requireNonNull(super.getStateForPlacement(blockPlaceContext)).setValue(durability, maxDurability); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder builder) { super.createBlockStateDefinition(builder); builder.add(getDurability()); } - + public int getCraftingLevel() { return level; } - + public static BlockState applyDamage(BlockState blockState) { Block anvilBlock = blockState.getBlock(); if (anvilBlock instanceof EndAnvilBlock) { @@ -100,7 +100,7 @@ public class EndAnvilBlock extends BaseAnvilBlock { } return getDamagedState(blockState); } - + private static BlockState getDamagedState(BlockState fallingState) { Block anvilBlock = fallingState.getBlock(); if (anvilBlock instanceof EndAnvilBlock) { diff --git a/src/main/java/ru/betterend/blocks/basis/EndLanternBlock.java b/src/main/java/ru/betterend/blocks/basis/EndLanternBlock.java index f5509ed6..b41a4fea 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndLanternBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndLanternBlock.java @@ -32,20 +32,20 @@ import java.util.Map; public class EndLanternBlock extends BaseBlockNotFull implements SimpleWaterloggedBlock, LiquidBlockContainer { public static final BooleanProperty IS_FLOOR = BlockProperties.IS_FLOOR; public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; - + public EndLanternBlock(Block source) { this(FabricBlockSettings.copyOf(source).luminance(15).noOcclusion()); } - + public EndLanternBlock(Properties settings) { super(settings.noOcclusion()); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(IS_FLOOR, WATERLOGGED); } - + @Override public BlockState getStateForPlacement(BlockPlaceContext ctx) { LevelReader worldView = ctx.getLevel(); @@ -86,7 +86,7 @@ public class EndLanternBlock extends BaseBlockNotFull implements SimpleWaterlogg } } } - + @Override public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { if (state.getValue(IS_FLOOR)) { @@ -96,7 +96,7 @@ public class EndLanternBlock extends BaseBlockNotFull implements SimpleWaterlogg return canSupportCenter(world, pos.above(), Direction.DOWN); } } - + @Override public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { Boolean water = state.getValue(WATERLOGGED); @@ -110,28 +110,27 @@ public class EndLanternBlock extends BaseBlockNotFull implements SimpleWaterlogg return state; } } - + @Override public boolean canPlaceLiquid(BlockGetter world, BlockPos pos, BlockState state, Fluid fluid) { return false; } - + @Override public boolean placeLiquid(LevelAccessor world, BlockPos pos, BlockState state, FluidState fluidState) { return false; } - + @Override public FluidState getFluidState(BlockState state) { return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : Fluids.EMPTY.defaultFluidState(); } - + @Override @Environment(EnvType.CLIENT) public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { String floor = blockState.getValue(IS_FLOOR) ? "_floor" : ""; - ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), - "block/" + stateId.getPath() + floor); + ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + floor); registerBlockModel(stateId, modelId, blockState, modelCache); return ModelsHelper.createBlockSimple(modelId); } diff --git a/src/main/java/ru/betterend/blocks/basis/EndPlantBlock.java b/src/main/java/ru/betterend/blocks/basis/EndPlantBlock.java index 9219a55f..ecc1b787 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndPlantBlock.java @@ -1,33 +1,44 @@ package ru.betterend.blocks.basis; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import ru.bclib.api.TagAPI; import ru.bclib.blocks.BasePlantBlock; +import ru.betterend.interfaces.PottablePlant; -public class EndPlantBlock extends BasePlantBlock { - +public class EndPlantBlock extends BasePlantBlock implements PottablePlant { public EndPlantBlock() { this(false); } - + public EndPlantBlock(int light) { this(false, light); } - + public EndPlantBlock(boolean replaceable) { super(replaceable); } - + public EndPlantBlock(boolean replaceable, int light) { super(replaceable, light); } - + public EndPlantBlock(Properties settings) { super(settings); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(TagAPI.END_GROUND); } + + @Override + public boolean canPlantOn(Block block) { + return isTerrain(block.defaultBlockState()); + } + + @Override + public boolean addToPot() { + return getStateDefinition().getProperties().isEmpty(); + } } diff --git a/src/main/java/ru/betterend/blocks/basis/EndPlantWithAgeBlock.java b/src/main/java/ru/betterend/blocks/basis/EndPlantWithAgeBlock.java index 8956b9de..0ad9c22d 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndPlantWithAgeBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndPlantWithAgeBlock.java @@ -5,14 +5,14 @@ import ru.bclib.api.TagAPI; import ru.bclib.blocks.BasePlantWithAgeBlock; public abstract class EndPlantWithAgeBlock extends BasePlantWithAgeBlock { - + public EndPlantWithAgeBlock() { } - + public EndPlantWithAgeBlock(Properties settings) { super(settings); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(TagAPI.END_GROUND); diff --git a/src/main/java/ru/betterend/blocks/basis/EndTerrainBlock.java b/src/main/java/ru/betterend/blocks/basis/EndTerrainBlock.java index 80af5145..be224b9c 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndTerrainBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndTerrainBlock.java @@ -3,8 +3,9 @@ package ru.betterend.blocks.basis; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.material.MaterialColor; import ru.bclib.blocks.BaseTerrainBlock; +import ru.betterend.interfaces.PottableTerrain; -public class EndTerrainBlock extends BaseTerrainBlock { +public class EndTerrainBlock extends BaseTerrainBlock implements PottableTerrain { public EndTerrainBlock(MaterialColor color) { super(Blocks.END_STONE, color); } diff --git a/src/main/java/ru/betterend/blocks/basis/EndTripleTerrain.java b/src/main/java/ru/betterend/blocks/basis/EndTripleTerrain.java index f47bbe88..10d4d7b1 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndTripleTerrain.java +++ b/src/main/java/ru/betterend/blocks/basis/EndTripleTerrain.java @@ -3,9 +3,9 @@ package ru.betterend.blocks.basis; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.material.MaterialColor; import ru.bclib.blocks.TripleTerrainBlock; +import ru.betterend.interfaces.PottableTerrain; -public class EndTripleTerrain extends TripleTerrainBlock { - +public class EndTripleTerrain extends TripleTerrainBlock implements PottableTerrain { public EndTripleTerrain(MaterialColor color) { super(Blocks.END_STONE, color); } diff --git a/src/main/java/ru/betterend/blocks/basis/EndUnderwaterPlantBlock.java b/src/main/java/ru/betterend/blocks/basis/EndUnderwaterPlantBlock.java index de41a686..443b860e 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndUnderwaterPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndUnderwaterPlantBlock.java @@ -5,18 +5,18 @@ import ru.bclib.api.TagAPI; import ru.bclib.blocks.UnderwaterPlantBlock; public class EndUnderwaterPlantBlock extends UnderwaterPlantBlock { - + public EndUnderwaterPlantBlock() { } - + public EndUnderwaterPlantBlock(int light) { super(light); } - + public EndUnderwaterPlantBlock(Properties settings) { super(settings); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(TagAPI.END_GROUND); diff --git a/src/main/java/ru/betterend/blocks/basis/EndUnderwaterWallPlantBlock.java b/src/main/java/ru/betterend/blocks/basis/EndUnderwaterWallPlantBlock.java index 032eea09..53d0d3fb 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndUnderwaterWallPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndUnderwaterWallPlantBlock.java @@ -5,18 +5,18 @@ import ru.bclib.api.TagAPI; import ru.bclib.blocks.BaseUnderwaterWallPlantBlock; public class EndUnderwaterWallPlantBlock extends BaseUnderwaterWallPlantBlock { - + public EndUnderwaterWallPlantBlock() { } - + public EndUnderwaterWallPlantBlock(int light) { super(light); } - + public EndUnderwaterWallPlantBlock(Properties settings) { super(settings); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(TagAPI.END_GROUND); diff --git a/src/main/java/ru/betterend/blocks/basis/EndWallMushroom.java b/src/main/java/ru/betterend/blocks/basis/EndWallMushroom.java index fed2b359..93ce64d1 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndWallMushroom.java +++ b/src/main/java/ru/betterend/blocks/basis/EndWallMushroom.java @@ -5,11 +5,11 @@ import ru.bclib.api.TagAPI; import ru.bclib.blocks.WallMushroomBlock; public class EndWallMushroom extends WallMushroomBlock { - + public EndWallMushroom(int light) { super(light); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(TagAPI.END_GROUND); diff --git a/src/main/java/ru/betterend/blocks/basis/EndWallPlantBlock.java b/src/main/java/ru/betterend/blocks/basis/EndWallPlantBlock.java index 9b7f6a8e..2bbcf20c 100644 --- a/src/main/java/ru/betterend/blocks/basis/EndWallPlantBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/EndWallPlantBlock.java @@ -7,15 +7,15 @@ import ru.bclib.blocks.BaseWallPlantBlock; public class EndWallPlantBlock extends BaseWallPlantBlock { public EndWallPlantBlock() { } - + public EndWallPlantBlock(int light) { super(light); } - + public EndWallPlantBlock(Properties settings) { super(settings); } - + @Override protected boolean isTerrain(BlockState state) { return state.is(TagAPI.END_GROUND); diff --git a/src/main/java/ru/betterend/blocks/basis/FurBlock.java b/src/main/java/ru/betterend/blocks/basis/FurBlock.java index 96e2ce4a..cc819cc0 100644 --- a/src/main/java/ru/betterend/blocks/basis/FurBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/FurBlock.java @@ -31,33 +31,24 @@ public class FurBlock extends BaseAttachedBlock implements IRenderTyped { private static final EnumMap BOUNDING_SHAPES = Maps.newEnumMap(Direction.class); private final ItemLike drop; private final int dropChance; - + public FurBlock(ItemLike drop, int light, int dropChance, boolean wet) { - super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT) - .breakByTool(FabricToolTags.SHEARS) - .breakByHand(true) - .luminance(light) - .sound(wet ? SoundType.WET_GRASS : SoundType.GRASS) - .noCollission()); + super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).luminance(light).sound(wet ? SoundType.WET_GRASS : SoundType.GRASS).noCollission()); this.drop = drop; this.dropChance = dropChance; } - + public FurBlock(ItemLike drop, int dropChance) { - super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT) - .breakByTool(FabricToolTags.SHEARS) - .breakByHand(true) - .sound(SoundType.GRASS) - .noCollission()); + super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.GRASS).noCollission()); this.drop = drop; this.dropChance = dropChance; } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return BOUNDING_SHAPES.get(state.getValue(FACING)); } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { ItemStack tool = builder.getParameter(LootContextParams.TOOL); @@ -71,12 +62,12 @@ public class FurBlock extends BaseAttachedBlock implements IRenderTyped { return Lists.newArrayList(); } } - + @Override public BCLRenderLayer getRenderLayer() { return BCLRenderLayer.CUTOUT; } - + static { BOUNDING_SHAPES.put(Direction.UP, Shapes.box(0.0, 0.0, 0.0, 1.0, 0.5, 1.0)); BOUNDING_SHAPES.put(Direction.DOWN, Shapes.box(0.0, 0.5, 0.0, 1.0, 1.0, 1.0)); diff --git a/src/main/java/ru/betterend/blocks/basis/LitBaseBlock.java b/src/main/java/ru/betterend/blocks/basis/LitBaseBlock.java new file mode 100644 index 00000000..af09b680 --- /dev/null +++ b/src/main/java/ru/betterend/blocks/basis/LitBaseBlock.java @@ -0,0 +1,24 @@ +package ru.betterend.blocks.basis; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.renderer.block.model.BlockModel; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.Nullable; +import ru.bclib.blocks.BaseBlock; + +public class LitBaseBlock extends BaseBlock { + private static final String PATTERN = "{\"parent\":\"betterend:block/cube_noshade\",\"textures\":{\"texture\":\"betterend:block/name\"}}"; + + public LitBaseBlock(Properties settings) { + super(settings); + } + + @Nullable + @Override + @Environment(EnvType.CLIENT) + public BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { + return BlockModel.fromString(PATTERN.replace("name", resourceLocation.getPath())); + } +} diff --git a/src/main/java/ru/betterend/blocks/basis/LitPillarBlock.java b/src/main/java/ru/betterend/blocks/basis/LitPillarBlock.java new file mode 100644 index 00000000..d09a9c40 --- /dev/null +++ b/src/main/java/ru/betterend/blocks/basis/LitPillarBlock.java @@ -0,0 +1,23 @@ +package ru.betterend.blocks.basis; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.resources.ResourceLocation; +import ru.bclib.blocks.BaseRotatedPillarBlock; + +import java.util.Optional; + +public class LitPillarBlock extends BaseRotatedPillarBlock { + private static final String PATTERN = "{\"parent\":\"betterend:block/pillar_noshade\",\"textures\":{\"end\":\"betterend:block/name_top\",\"side\":\"betterend:block/name_side\"}}"; + + public LitPillarBlock(Properties settings) { + super(settings); + } + + @Override + @Environment(EnvType.CLIENT) + protected Optional createBlockPattern(ResourceLocation blockId) { + String name = blockId.getPath(); + return Optional.of(PATTERN.replace("name", name)); + } +} diff --git a/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java b/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java index fa6f4963..744886cd 100644 --- a/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/PedestalBlock.java @@ -42,11 +42,9 @@ import ru.bclib.client.models.ModelsHelper; import ru.betterend.blocks.EndBlockProperties; import ru.betterend.blocks.EndBlockProperties.PedestalState; import ru.betterend.blocks.InfusionPedestal; -import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity; import ru.betterend.blocks.entities.InfusionPedestalEntity; import ru.betterend.blocks.entities.PedestalBlockEntity; import ru.betterend.client.models.Patterns; -import ru.betterend.registry.EndBlockEntities; import ru.betterend.registry.EndBlocks; import ru.betterend.rituals.InfusionRitual; @@ -55,20 +53,21 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.function.ToIntFunction; @SuppressWarnings({"deprecation"}) public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { public final static EnumProperty STATE = EndBlockProperties.PEDESTAL_STATE; public static final BooleanProperty HAS_ITEM = EndBlockProperties.HAS_ITEM; public static final BooleanProperty HAS_LIGHT = BlockProperties.HAS_LIGHT; - + private static final VoxelShape SHAPE_DEFAULT; private static final VoxelShape SHAPE_COLUMN; private static final VoxelShape SHAPE_PILLAR; private static final VoxelShape SHAPE_PEDESTAL_TOP; private static final VoxelShape SHAPE_COLUMN_TOP; private static final VoxelShape SHAPE_BOTTOM; - + /** * Register new Pedestal block with Better End mod id. * @@ -79,7 +78,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { public static Block registerPedestal(String name, Block source) { return EndBlocks.registerBlock(name, new PedestalBlock(source)); } - + /** * Register new Pedestal block with specified mod id. * @@ -90,23 +89,31 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { public static Block registerPedestal(ResourceLocation id, Block source) { return EndBlocks.registerBlock(id, new PedestalBlock(source)); } - + protected final Block parent; protected float height = 1.0F; - + public PedestalBlock(Block parent) { - super(FabricBlockSettings.copyOf(parent).luminance(state -> state.getValue(HAS_LIGHT) ? 12 : 0)); + super(FabricBlockSettings.copyOf(parent).luminance(getLuminance(parent.defaultBlockState()))); this.registerDefaultState(stateDefinition.any().setValue(STATE, PedestalState.DEFAULT).setValue(HAS_ITEM, false).setValue(HAS_LIGHT, false)); this.parent = parent; } - + + private static ToIntFunction getLuminance(BlockState parent) { + final int light = parent.getLightEmission(); + if (light > 0) { + return state -> light; + } + return state -> state.getValue(HAS_LIGHT) ? 12 : 0; + } + public float getHeight(BlockState state) { if (state.getBlock() instanceof PedestalBlock && state.getValue(STATE) == PedestalState.PEDESTAL_TOP) { return this.height - 0.2F; } return this.height; } - + @Override @Deprecated public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { @@ -136,7 +143,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } return InteractionResult.PASS; } - + @Override public void destroy(LevelAccessor levelAccessor, BlockPos blockPos, BlockState blockState) { MutableBlockPos posMutable = new MutableBlockPos(); @@ -155,7 +162,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } } } - + public void checkRitual(Level world, BlockPos pos) { MutableBlockPos posMutable = new MutableBlockPos(); for (Point point : InfusionRitual.getMap()) { @@ -167,7 +174,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } } } - + @Override @Nullable public BlockState getStateForPlacement(BlockPlaceContext context) { @@ -195,7 +202,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } return defaultBlockState(); } - + @Override @Deprecated public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) { @@ -206,7 +213,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } return updated; } - + private BlockState getUpdatedState(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) { if (!state.is(this)) return state.updateShape(direction, newState, world, pos, posFrom); if (direction != Direction.UP && direction != Direction.DOWN) return state; @@ -246,7 +253,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } return updatedState; } - + @Override public List getDrops(BlockState state, LootContext.Builder builder) { List drop = Lists.newArrayList(super.getDrops(state, builder)); @@ -266,7 +273,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } return drop; } - + private void moveStoredStack(LevelAccessor world, BlockState state, BlockPos pos) { BlockEntity blockEntity = world.getBlockEntity(pos); if (blockEntity instanceof PedestalBlockEntity && state.is(this)) { @@ -277,7 +284,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } } } - + private void moveStoredStack(BlockEntity blockEntity, LevelAccessor world, ItemStack stack, BlockPos pos) { BlockState state = world.getBlockState(pos); if (!state.is(this)) { @@ -302,14 +309,14 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { dropStoredStack(blockEntity, stack, pos); } } - + private void dropStoredStack(BlockEntity blockEntity, ItemStack stack, BlockPos pos) { if (blockEntity != null && blockEntity.getLevel() != null) { Level world = blockEntity.getLevel(); Block.popResource(world, getDropPos(world, pos), stack); } } - + private BlockPos getDropPos(LevelAccessor world, BlockPos pos) { BlockPos dropPos; if (world.getBlockState(pos).isAir()) { @@ -326,14 +333,13 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } return getDropPos(world, pos.above()); } - + public boolean isPlaceable(BlockState state) { if (!state.is(this)) return false; PedestalState currentState = state.getValue(STATE); - return currentState == PedestalState.DEFAULT || - currentState == PedestalState.PEDESTAL_TOP; + return currentState == PedestalState.DEFAULT || currentState == PedestalState.PEDESTAL_TOP; } - + @Override @Deprecated public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { @@ -361,39 +367,39 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } return super.getShape(state, world, pos, context); } - + @Override protected void createBlockStateDefinition(StateDefinition.Builder stateManager) { stateManager.add(STATE, HAS_ITEM, HAS_LIGHT); } - + @Override public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) { return new PedestalBlockEntity(blockPos, blockState); } - + public boolean hasUniqueEntity() { return false; } - + @Override @Deprecated public boolean hasAnalogOutputSignal(BlockState state) { return state.getBlock() instanceof PedestalBlock; } - + @Override @Deprecated public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) { return state.getValue(HAS_ITEM) ? 15 : 0; } - + @Override @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation blockId) { return getBlockModel(blockId, defaultBlockState()); } - + @Override @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { @@ -421,23 +427,22 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } return ModelsHelper.fromPattern(pattern); } - + @Override @Environment(EnvType.CLIENT) public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map modelCache) { PedestalState state = blockState.getValue(STATE); - ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), - "block/" + stateId.getPath() + "_" + state); + ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + "_" + state); registerBlockModel(stateId, modelId, blockState, modelCache); return ModelsHelper.createBlockSimple(modelId); } - + protected Map createTexturesMap() { ResourceLocation blockId = Registry.BLOCK.getKey(parent); String name = blockId.getPath(); return new HashMap() { private static final long serialVersionUID = 1L; - + { put("%mod%", blockId.getNamespace()); put("%top%", name + "_top"); @@ -447,7 +452,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { } }; } - + static { VoxelShape basinUp = Block.box(2, 3, 2, 14, 4, 14); VoxelShape basinDown = Block.box(0, 0, 0, 16, 3, 16); @@ -466,7 +471,7 @@ public class PedestalBlock extends BaseBlockNotFull implements EntityBlock { SHAPE_COLUMN = Shapes.or(basin, SHAPE_PILLAR, columnTop); SHAPE_BOTTOM = Shapes.or(basin, SHAPE_PILLAR); } - + @Override @Nullable public BlockEntityTicker getTicker(Level level, BlockState blockState, BlockEntityType blockEntityType) { diff --git a/src/main/java/ru/betterend/blocks/basis/PottableCropBlock.java b/src/main/java/ru/betterend/blocks/basis/PottableCropBlock.java new file mode 100644 index 00000000..9c84d0e9 --- /dev/null +++ b/src/main/java/ru/betterend/blocks/basis/PottableCropBlock.java @@ -0,0 +1,30 @@ +package ru.betterend.blocks.basis; + +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import ru.bclib.blocks.BaseCropBlock; +import ru.betterend.interfaces.PottablePlant; + +public class PottableCropBlock extends BaseCropBlock implements PottablePlant { + private final Block[] terrain; + + public PottableCropBlock(Item drop, Block... terrain) { + super(drop, terrain); + this.terrain = terrain; + } + + @Override + public boolean canPlantOn(Block block) { + for (Block ter: terrain) { + if (block == ter) { + return true; + } + } + return false; + } + + @Override + public String getPottedState() { + return "age=3"; + } +} diff --git a/src/main/java/ru/betterend/blocks/basis/PottableFeatureSapling.java b/src/main/java/ru/betterend/blocks/basis/PottableFeatureSapling.java new file mode 100644 index 00000000..387f0a2f --- /dev/null +++ b/src/main/java/ru/betterend/blocks/basis/PottableFeatureSapling.java @@ -0,0 +1,16 @@ +package ru.betterend.blocks.basis; + +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.levelgen.feature.Feature; +import ru.bclib.blocks.FeatureSaplingBlock; +import ru.betterend.interfaces.PottablePlant; + +public abstract class PottableFeatureSapling extends FeatureSaplingBlock implements PottablePlant { + public PottableFeatureSapling() { + super(); + } + + public PottableFeatureSapling(int light) { + super(light); + } +} diff --git a/src/main/java/ru/betterend/blocks/basis/PottableLeavesBlock.java b/src/main/java/ru/betterend/blocks/basis/PottableLeavesBlock.java new file mode 100644 index 00000000..4fd5006b --- /dev/null +++ b/src/main/java/ru/betterend/blocks/basis/PottableLeavesBlock.java @@ -0,0 +1,28 @@ +package ru.betterend.blocks.basis; + +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.material.MaterialColor; +import ru.bclib.blocks.BaseLeavesBlock; +import ru.betterend.interfaces.PottablePlant; + +public class PottableLeavesBlock extends BaseLeavesBlock implements PottablePlant { + private Block sapling; + + public PottableLeavesBlock(Block sapling, MaterialColor color) { + super(sapling, color); + this.sapling = sapling; + } + + public PottableLeavesBlock(Block sapling, MaterialColor color, int light) { + super(sapling, color, light); + this.sapling = sapling; + } + + @Override + public boolean canPlantOn(Block block) { + if (sapling instanceof PottablePlant) { + return ((PottablePlant) sapling).canPlantOn(block); + } + return true; + } +} diff --git a/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java b/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java index d421cd5d..a8cd4351 100644 --- a/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java +++ b/src/main/java/ru/betterend/blocks/basis/StoneLanternBlock.java @@ -24,33 +24,31 @@ import java.util.Optional; public class StoneLanternBlock extends EndLanternBlock implements IColorProvider { private static final VoxelShape SHAPE_CEIL = Block.box(3, 1, 3, 13, 16, 13); private static final VoxelShape SHAPE_FLOOR = Block.box(3, 0, 3, 13, 15, 13); - + public StoneLanternBlock(Block source) { super(FabricBlockSettings.copyOf(source).luminance(15)); } - + @Override public BlockColor getProvider() { return ((IColorProvider) EndBlocks.AURORA_CRYSTAL).getProvider(); } - + @Override public ItemColor getItemProvider() { return ((IColorProvider) EndBlocks.AURORA_CRYSTAL).getItemProvider(); } - + @Override public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) { return state.getValue(IS_FLOOR) ? SHAPE_FLOOR : SHAPE_CEIL; } - + @Override @Environment(EnvType.CLIENT) public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) { String blockName = resourceLocation.getPath(); - Optional pattern = blockState.getValue(IS_FLOOR) ? - Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_FLOOR, blockName, blockName) : - Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_CEIL, blockName, blockName); + Optional pattern = blockState.getValue(IS_FLOOR) ? Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_FLOOR, blockName, blockName) : Patterns.createJson(Patterns.BLOCK_STONE_LANTERN_CEIL, blockName, blockName); return ModelsHelper.fromPattern(pattern); } } diff --git a/src/main/java/ru/betterend/blocks/complex/ColoredMaterial.java b/src/main/java/ru/betterend/blocks/complex/ColoredMaterial.java index 16a2c92e..b6b94f5a 100644 --- a/src/main/java/ru/betterend/blocks/complex/ColoredMaterial.java +++ b/src/main/java/ru/betterend/blocks/complex/ColoredMaterial.java @@ -21,11 +21,11 @@ public class ColoredMaterial { private static final Map DYES = Maps.newHashMap(); private static final Map COLORS = Maps.newHashMap(); private final Map colors = Maps.newHashMap(); - + public ColoredMaterial(Function constructor, Block source, boolean craftEight) { this(constructor, source, COLORS, DYES, craftEight); } - + public ColoredMaterial(Function constructor, Block source, Map colors, Map dyes, boolean craftEight) { String id = Registry.BLOCK.getKey(source).getPath(); colors.forEach((color, name) -> { @@ -42,15 +42,15 @@ public class ColoredMaterial { BlocksHelper.addBlockColor(block, color); }); } - + public Block getByColor(DyeColor color) { return colors.get(color.getMaterialColor().col); } - + public Block getByColor(int color) { return colors.get(color); } - + static { for (DyeColor color : DyeColor.values()) { int colorRGB = color.getMaterialColor().col; diff --git a/src/main/java/ru/betterend/blocks/complex/CrystalSubblocksMaterial.java b/src/main/java/ru/betterend/blocks/complex/CrystalSubblocksMaterial.java index c5d240b1..90e87cdc 100644 --- a/src/main/java/ru/betterend/blocks/complex/CrystalSubblocksMaterial.java +++ b/src/main/java/ru/betterend/blocks/complex/CrystalSubblocksMaterial.java @@ -4,8 +4,6 @@ import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; import net.minecraft.world.level.block.Block; -import ru.bclib.blocks.BaseBlock; -import ru.bclib.blocks.BaseRotatedPillarBlock; import ru.bclib.blocks.BaseSlabBlock; import ru.bclib.blocks.BaseStairsBlock; import ru.bclib.blocks.BaseWallBlock; @@ -13,6 +11,8 @@ import ru.bclib.recipes.GridRecipe; import ru.bclib.util.TagHelper; import ru.betterend.BetterEnd; import ru.betterend.blocks.EndPedestal; +import ru.betterend.blocks.basis.LitBaseBlock; +import ru.betterend.blocks.basis.LitPillarBlock; import ru.betterend.config.Configs; import ru.betterend.recipe.CraftingRecipes; import ru.betterend.registry.EndBlocks; @@ -29,43 +29,43 @@ public class CrystalSubblocksMaterial { public final Block brick_stairs; public final Block brick_slab; public final Block brick_wall; - + public CrystalSubblocksMaterial(String name, Block source) { FabricBlockSettings material = FabricBlockSettings.copyOf(source); - polished = EndBlocks.registerBlock(name + "_polished", new BaseBlock(material)); - tiles = EndBlocks.registerBlock(name + "_tiles", new BaseBlock(material)); - pillar = EndBlocks.registerBlock(name + "_pillar", new BaseRotatedPillarBlock(material)); + polished = EndBlocks.registerBlock(name + "_polished", new LitBaseBlock(material)); + tiles = EndBlocks.registerBlock(name + "_tiles", new LitBaseBlock(material)); + pillar = EndBlocks.registerBlock(name + "_pillar", new LitPillarBlock(material)); stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(source)); slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(source)); wall = EndBlocks.registerBlock(name + "_wall", new BaseWallBlock(source)); pedestal = EndBlocks.registerBlock(name + "_pedestal", new EndPedestal(source)); - bricks = EndBlocks.registerBlock(name + "_bricks", new BaseBlock(material)); + bricks = EndBlocks.registerBlock(name + "_bricks", new LitBaseBlock(material)); brick_stairs = EndBlocks.registerBlock(name + "_bricks_stairs", new BaseStairsBlock(bricks)); brick_slab = EndBlocks.registerBlock(name + "_bricks_slab", new BaseSlabBlock(bricks)); brick_wall = EndBlocks.registerBlock(name + "_bricks_wall", new BaseWallBlock(bricks)); - + // Recipes // GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks", bricks).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', source).setGroup("end_bricks").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_polished", polished).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', bricks).setGroup("end_tile").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_tiles", tiles).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', polished).setGroup("end_small_tile").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_pillar", pillar).checkConfig(Configs.RECIPE_CONFIG).setShape("#", "#").addMaterial('#', slab).setGroup("end_pillar").build(); - + GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', source).setGroup("end_stone_stairs").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', source).setGroup("end_stone_slabs").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_stairs", brick_stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', bricks).setGroup("end_stone_stairs").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_slab", brick_slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', bricks).setGroup("end_stone_slabs").build(); - + GridRecipe.make(BetterEnd.MOD_ID, name + "_wall", wall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', source).setGroup("end_wall").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_wall", brick_wall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', bricks).setGroup("end_wall").build(); - + CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar); - + // Item Tags // TagHelper.addTag(ItemTags.SLABS, slab, brick_slab); TagHelper.addTag(ItemTags.STONE_BRICKS, bricks); TagHelper.addTag(ItemTags.STONE_CRAFTING_MATERIALS, source); TagHelper.addTag(ItemTags.STONE_TOOL_MATERIALS, source); - + // Block Tags // TagHelper.addTag(BlockTags.STONE_BRICKS, bricks); TagHelper.addTag(BlockTags.WALLS, wall, brick_wall); diff --git a/src/main/java/ru/betterend/blocks/complex/MetalMaterial.java b/src/main/java/ru/betterend/blocks/complex/MetalMaterial.java index b0dbd619..a729dfed 100644 --- a/src/main/java/ru/betterend/blocks/complex/MetalMaterial.java +++ b/src/main/java/ru/betterend/blocks/complex/MetalMaterial.java @@ -60,67 +60,67 @@ public class MetalMaterial { public final Block chain; public final Block stairs; public final Block slab; - + public final Block chandelier; public final Block bulb_lantern; public final ColoredMaterial bulb_lantern_colored; - + public final Block anvilBlock; public final Item anvilItem; - + public final Item rawOre; public final Item nugget; public final Item ingot; - + public final Item shovelHead; public final Item pickaxeHead; public final Item axeHead; public final Item hoeHead; public final Item swordBlade; public final Item swordHandle; - + public final Item shovel; public final Item sword; public final Item pickaxe; public final Item axe; public final Item hoe; public final Item hammer; - + public final Item forgedPlate; public final Item helmet; public final Item chestplate; public final Item leggings; public final Item boots; - + public final Tag.Named alloyingOre; - + public static MetalMaterial makeNormal(String name, MaterialColor color, Tier material, ArmorMaterial armor) { return new MetalMaterial(name, true, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color), EndItems.makeEndItemSettings(), material, armor); } - + public static MetalMaterial makeNormal(String name, MaterialColor color, float hardness, float resistance, Tier material, ArmorMaterial armor) { return new MetalMaterial(name, true, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color).hardness(hardness).resistance(resistance), EndItems.makeEndItemSettings(), material, armor); } - + public static MetalMaterial makeOreless(String name, MaterialColor color, Tier material, ArmorMaterial armor) { return new MetalMaterial(name, false, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color), EndItems.makeEndItemSettings(), material, armor); } - + public static MetalMaterial makeOreless(String name, MaterialColor color, float hardness, float resistance, Tier material, ArmorMaterial armor) { return new MetalMaterial(name, false, FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).materialColor(color).hardness(hardness).resistance(resistance), EndItems.makeEndItemSettings(), material, armor); } - + private MetalMaterial(String name, boolean hasOre, FabricBlockSettings settings, Properties itemSettings, Tier material, ArmorMaterial armor) { BlockBehaviour.Properties lanternProperties = FabricBlockSettings.copyOf(settings).hardness(1).resistance(1).luminance(15).sound(SoundType.LANTERN); final int level = material.getLevel(); - + rawOre = hasOre ? EndItems.registerEndItem(name + "_raw", new ModelProviderItem(itemSettings)) : null; ore = hasOre ? EndBlocks.registerBlock(name + "_ore", new BaseOreBlock(rawOre, 1, 3, 1)) : null; alloyingOre = hasOre ? TagAPI.makeItemTag(BetterEnd.MOD_ID, name + "_alloying") : null; if (hasOre) { TagHelper.addTag(alloyingOre, ore, rawOre); } - + block = EndBlocks.registerBlock(name + "_block", new BaseBlock(settings)); tile = EndBlocks.registerBlock(name + "_tile", new BaseBlock(settings)); stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(tile)); @@ -130,49 +130,49 @@ public class MetalMaterial { bars = EndBlocks.registerBlock(name + "_bars", new BaseMetalBarsBlock(block)); chain = EndBlocks.registerBlock(name + "_chain", new BaseChainBlock(block.defaultMaterialColor())); pressurePlate = EndBlocks.registerBlock(name + "_plate", new WoodenPressurePlateBlock(block)); - + chandelier = EndBlocks.registerBlock(name + "_chandelier", new ChandelierBlock(block)); bulb_lantern = EndBlocks.registerBlock(name + "_bulb_lantern", new BulbVineLanternBlock(lanternProperties)); bulb_lantern_colored = new ColoredMaterial(BulbVineLanternColoredBlock::new, bulb_lantern, false); - + nugget = EndItems.registerEndItem(name + "_nugget", new ModelProviderItem(itemSettings)); ingot = EndItems.registerEndItem(name + "_ingot", new ModelProviderItem(itemSettings)); - + shovelHead = EndItems.registerEndItem(name + "_shovel_head"); pickaxeHead = EndItems.registerEndItem(name + "_pickaxe_head"); axeHead = EndItems.registerEndItem(name + "_axe_head"); hoeHead = EndItems.registerEndItem(name + "_hoe_head"); swordBlade = EndItems.registerEndItem(name + "_sword_blade"); swordHandle = EndItems.registerEndItem(name + "_sword_handle"); - + shovel = EndItems.registerEndTool(name + "_shovel", new BaseShovelItem(material, 1.5F, -3.0F, itemSettings)); sword = EndItems.registerEndTool(name + "_sword", new BaseSwordItem(material, 3, -2.4F, itemSettings)); pickaxe = EndItems.registerEndTool(name + "_pickaxe", new EndPickaxe(material, 1, -2.8F, itemSettings)); axe = EndItems.registerEndTool(name + "_axe", new BaseAxeItem(material, 6.0F, -3.0F, itemSettings)); hoe = EndItems.registerEndTool(name + "_hoe", new BaseHoeItem(material, -3, 0.0F, itemSettings)); hammer = EndItems.registerEndTool(name + "_hammer", new EndHammerItem(material, 5.0F, -3.2F, 0.3D, itemSettings)); - + forgedPlate = EndItems.registerEndItem(name + "_forged_plate"); helmet = EndItems.registerEndItem(name + "_helmet", new EndArmorItem(armor, EquipmentSlot.HEAD, itemSettings)); chestplate = EndItems.registerEndItem(name + "_chestplate", new EndArmorItem(armor, EquipmentSlot.CHEST, itemSettings)); leggings = EndItems.registerEndItem(name + "_leggings", new EndArmorItem(armor, EquipmentSlot.LEGS, itemSettings)); boots = EndItems.registerEndItem(name + "_boots", new EndArmorItem(armor, EquipmentSlot.FEET, itemSettings)); - + anvilBlock = EndBlocks.registerBlock(name + "_anvil", new EndAnvilBlock(this, block.defaultMaterialColor(), level)); anvilItem = EndItems.registerEndItem(name + "_anvil_item", new EndAnvilItem(anvilBlock)); - + if (hasOre) { FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_ingot_furnace_ore", ore, ingot).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_ingot").buildWithBlasting(); FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_ingot_furnace_raw", rawOre, ingot).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_ingot").buildWithBlasting(); AlloyingRecipe.Builder.create(name + "_ingot_alloy").setInput(alloyingOre, alloyingOre).setOutput(ingot, 3).setExpiriense(2.1F).build(); } - + // Basic recipes GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_nuggets", ingot).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', nugget).setGroup("end_metal_ingots_nug").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_nuggets_from_ingot", nugget).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(9).setList("#").addMaterial('#', ingot).setGroup("end_metal_nuggets_ing").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_block", block).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', ingot).setGroup("end_metal_blocks").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_ingot_from_block", ingot).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(9).setList("#").addMaterial('#', block).setGroup("end_metal_ingots").build(); - + // Block recipes GridRecipe.make(BetterEnd.MOD_ID, name + "_tile", tile).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', block).setGroup("end_metal_tiles").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_bars", bars).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(16).setShape("###", "###").addMaterial('#', ingot).setGroup("end_metal_bars").build(); @@ -184,9 +184,9 @@ public class MetalMaterial { GridRecipe.make(BetterEnd.MOD_ID, name + "_chain", chain).checkConfig(Configs.RECIPE_CONFIG).setShape("N", "#", "N").addMaterial('#', ingot).addMaterial('N', nugget).setGroup("end_metal_chain").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_anvil", anvilBlock).checkConfig(Configs.RECIPE_CONFIG).setShape("###", " I ", "III").addMaterial('#', block, tile).addMaterial('I', ingot).setGroup("end_metal_anvil").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_bulb_lantern", bulb_lantern).checkConfig(Configs.RECIPE_CONFIG).setShape("C", "I", "#").addMaterial('C', chain).addMaterial('I', ingot).addMaterial('#', EndItems.GLOWING_BULB).build(); - + GridRecipe.make(BetterEnd.MOD_ID, name + "_chandelier", chandelier).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", " # ").addMaterial('#', ingot).addMaterial('I', EndItems.LUMECORN_ROD).setGroup("end_metal_chandelier").build(); - + // Tools & armor into nuggets FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_axe_nugget", axe, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_hoe_nugget", hoe, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); @@ -197,7 +197,7 @@ public class MetalMaterial { FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_chestplate_nugget", chestplate, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_leggings_nugget", leggings, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); FurnaceRecipe.make(BetterEnd.MOD_ID, name + "_boots_nugget", boots, nugget).checkConfig(Configs.RECIPE_CONFIG).setGroup("end_nugget").buildWithBlasting(); - + // Tool parts from ingots AnvilRecipe.Builder.create(name + "_shovel_head").setInput(ingot).setOutput(shovelHead).setAnvilLevel(level).setToolLevel(level).setDamage(level).build(); AnvilRecipe.Builder.create(name + "_pickaxe_head").setInput(ingot).setInputCount(3).setOutput(pickaxeHead).setAnvilLevel(level).setToolLevel(level).setDamage(level).build(); @@ -205,7 +205,7 @@ public class MetalMaterial { AnvilRecipe.Builder.create(name + "_hoe_head").setInput(ingot).setInputCount(2).setOutput(hoeHead).setAnvilLevel(level).setToolLevel(level).setDamage(level).build(); AnvilRecipe.Builder.create(name + "_sword_blade").setInput(ingot).setOutput(swordBlade).setAnvilLevel(level).setToolLevel(level).setDamage(level).build(); AnvilRecipe.Builder.create(name + "_forged_plate").setInput(ingot).setOutput(forgedPlate).setAnvilLevel(level).setToolLevel(level).setDamage(level).build(); - + // Tools from parts SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_hammer").checkConfig(Configs.RECIPE_CONFIG).setResult(hammer).setBase(block).setAddition(Items.STICK).build(); SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_axe").checkConfig(Configs.RECIPE_CONFIG).setResult(axe).setBase(axeHead).setAddition(Items.STICK).build(); @@ -214,13 +214,13 @@ public class MetalMaterial { SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_sword_handle").checkConfig(Configs.RECIPE_CONFIG).setResult(swordHandle).setBase(ingot).setAddition(Items.STICK).build(); SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_sword").checkConfig(Configs.RECIPE_CONFIG).setResult(sword).setBase(swordBlade).setAddition(swordHandle).build(); SmithingTableRecipe.create(BetterEnd.MOD_ID, name + "_shovel").checkConfig(Configs.RECIPE_CONFIG).setResult(shovel).setBase(shovelHead).setAddition(Items.STICK).build(); - + // Armor crafting GridRecipe.make(BetterEnd.MOD_ID, name + "_helmet", helmet).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_helmets").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_chestplate", chestplate).checkConfig(Configs.RECIPE_CONFIG).setShape("# #", "###", "###").addMaterial('#', forgedPlate).setGroup("end_metal_chestplates").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_leggings", leggings).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_leggings").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_boots", boots).checkConfig(Configs.RECIPE_CONFIG).setShape("# #", "# #").addMaterial('#', forgedPlate).setGroup("end_metal_boots").build(); - + TagHelper.addTag(BlockTags.ANVIL, anvilBlock); TagHelper.addTag(BlockTags.BEACON_BASE_BLOCKS, block); TagHelper.addTag(ItemTags.BEACON_PAYMENT_ITEMS, ingot); diff --git a/src/main/java/ru/betterend/blocks/complex/StoneMaterial.java b/src/main/java/ru/betterend/blocks/complex/StoneMaterial.java index 26aed797..aa1d06a8 100644 --- a/src/main/java/ru/betterend/blocks/complex/StoneMaterial.java +++ b/src/main/java/ru/betterend/blocks/complex/StoneMaterial.java @@ -19,6 +19,7 @@ import ru.bclib.recipes.GridRecipe; import ru.bclib.util.TagHelper; import ru.betterend.BetterEnd; import ru.betterend.blocks.EndPedestal; +import ru.betterend.blocks.FlowerPotBlock; import ru.betterend.blocks.basis.StoneLanternBlock; import ru.betterend.config.Configs; import ru.betterend.recipe.CraftingRecipes; @@ -27,7 +28,7 @@ import ru.betterend.registry.EndItems; public class StoneMaterial { public final Block stone; - + public final Block polished; public final Block tiles; public final Block pillar; @@ -35,19 +36,20 @@ public class StoneMaterial { public final Block slab; public final Block wall; public final Block button; - public final Block pressure_plate; + public final Block pressurePlate; public final Block pedestal; public final Block lantern; - + public final Block bricks; - public final Block brick_stairs; - public final Block brick_slab; - public final Block brick_wall; + public final Block brickStairs; + public final Block brickSlab; + public final Block brickWall; public final Block furnace; - + public final Block flowerPot; + public StoneMaterial(String name, MaterialColor color) { FabricBlockSettings material = FabricBlockSettings.copyOf(Blocks.END_STONE).materialColor(color); - + stone = EndBlocks.registerBlock(name, new BaseBlock(material)); polished = EndBlocks.registerBlock(name + "_polished", new BaseBlock(material)); tiles = EndBlocks.registerBlock(name + "_tiles", new BaseBlock(material)); @@ -56,51 +58,53 @@ public class StoneMaterial { slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(stone)); wall = EndBlocks.registerBlock(name + "_wall", new BaseWallBlock(stone)); button = EndBlocks.registerBlock(name + "_button", new BaseStoneButtonBlock(stone)); - pressure_plate = EndBlocks.registerBlock(name + "_plate", new StonePressurePlateBlock(stone)); + pressurePlate = EndBlocks.registerBlock(name + "_plate", new StonePressurePlateBlock(stone)); pedestal = EndBlocks.registerBlock(name + "_pedestal", new EndPedestal(stone)); lantern = EndBlocks.registerBlock(name + "_lantern", new StoneLanternBlock(stone)); - + bricks = EndBlocks.registerBlock(name + "_bricks", new BaseBlock(material)); - brick_stairs = EndBlocks.registerBlock(name + "_bricks_stairs", new BaseStairsBlock(bricks)); - brick_slab = EndBlocks.registerBlock(name + "_bricks_slab", new BaseSlabBlock(bricks)); - brick_wall = EndBlocks.registerBlock(name + "_bricks_wall", new BaseWallBlock(bricks)); + brickStairs = EndBlocks.registerBlock(name + "_bricks_stairs", new BaseStairsBlock(bricks)); + brickSlab = EndBlocks.registerBlock(name + "_bricks_slab", new BaseSlabBlock(bricks)); + brickWall = EndBlocks.registerBlock(name + "_bricks_wall", new BaseWallBlock(bricks)); furnace = EndBlocks.registerBlock(name + "_furnace", new BaseFurnaceBlock(bricks)); - + flowerPot = EndBlocks.registerBlock(name + "_flower_pot", new FlowerPotBlock(bricks)); + // Recipes // GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks", bricks).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', stone).setGroup("end_bricks").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_polished", polished).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', bricks).setGroup("end_tile").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_tiles", tiles).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("##", "##").addMaterial('#', polished).setGroup("end_small_tile").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_pillar", pillar).checkConfig(Configs.RECIPE_CONFIG).setShape("#", "#").addMaterial('#', slab).setGroup("end_pillar").build(); - + GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', stone).setGroup("end_stone_stairs").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_slab", slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', stone).setGroup("end_stone_slabs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_stairs", brick_stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', bricks).setGroup("end_stone_stairs").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_slab", brick_slab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', bricks).setGroup("end_stone_slabs").build(); - + GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_stairs", brickStairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', bricks).setGroup("end_stone_stairs").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_slab", brickSlab).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###").addMaterial('#', bricks).setGroup("end_stone_slabs").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_wall", wall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', stone).setGroup("end_wall").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_wall", brick_wall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', bricks).setGroup("end_wall").build(); - + GridRecipe.make(BetterEnd.MOD_ID, name + "_bricks_wall", brickWall).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("###", "###").addMaterial('#', bricks).setGroup("end_wall").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_button", button).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', stone).setGroup("end_stone_buttons").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressure_plate).checkConfig(Configs.RECIPE_CONFIG).setShape("##").addMaterial('#', stone).setGroup("end_stone_plates").build(); - GridRecipe.make(BetterEnd.MOD_ID, name + "_lantern", lantern).checkConfig(Configs.RECIPE_CONFIG).setShape("S", "#", "S").addMaterial('#', EndItems.CRYSTAL_SHARDS).addMaterial('S', slab, brick_slab).setGroup("end_stone_lanterns").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_pressure_plate", pressurePlate).checkConfig(Configs.RECIPE_CONFIG).setShape("##").addMaterial('#', stone).setGroup("end_stone_plates").build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_lantern", lantern).checkConfig(Configs.RECIPE_CONFIG).setShape("S", "#", "S").addMaterial('#', EndItems.CRYSTAL_SHARDS).addMaterial('S', slab, brickSlab).setGroup("end_stone_lanterns").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_furnace", furnace).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #", "###").addMaterial('#', stone).setGroup("end_stone_furnaces").build(); - + GridRecipe.make(BetterEnd.MOD_ID, name + "_flower_pot", flowerPot).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("# #", " # ").addMaterial('#', bricks).setGroup("end_pots").build(); + CraftingRecipes.registerPedestal(name + "_pedestal", pedestal, slab, pillar); - + // Item Tags // - TagHelper.addTag(ItemTags.SLABS, slab, brick_slab); + TagHelper.addTag(ItemTags.SLABS, slab, brickSlab); TagHelper.addTag(ItemTags.STONE_BRICKS, bricks); TagHelper.addTag(ItemTags.STONE_CRAFTING_MATERIALS, stone); TagHelper.addTag(ItemTags.STONE_TOOL_MATERIALS, stone); TagHelper.addTag(TagAPI.FURNACES, furnace); - + // Block Tags // TagHelper.addTag(BlockTags.STONE_BRICKS, bricks); - TagHelper.addTag(BlockTags.WALLS, wall, brick_wall); - TagHelper.addTag(BlockTags.SLABS, slab, brick_slab); - TagHelper.addTags(pressure_plate, BlockTags.PRESSURE_PLATES, BlockTags.STONE_PRESSURE_PLATES); + TagHelper.addTag(BlockTags.WALLS, wall, brickWall); + TagHelper.addTag(BlockTags.SLABS, slab, brickSlab); + TagHelper.addTags(pressurePlate, BlockTags.PRESSURE_PLATES, BlockTags.STONE_PRESSURE_PLATES); TagHelper.addTag(TagAPI.END_STONES, stone); - + TagHelper.addTag(TagAPI.DRAGON_IMMUNE, stone, stairs, slab, wall); } } \ No newline at end of file diff --git a/src/main/java/ru/betterend/blocks/complex/WoodenMaterial.java b/src/main/java/ru/betterend/blocks/complex/WoodenMaterial.java index 9c17ae2f..b07f8bff 100644 --- a/src/main/java/ru/betterend/blocks/complex/WoodenMaterial.java +++ b/src/main/java/ru/betterend/blocks/complex/WoodenMaterial.java @@ -41,12 +41,12 @@ import ru.betterend.registry.EndBlocks; public class WoodenMaterial { public final Block log; public final Block bark; - + public final Block log_stripped; public final Block bark_stripped; - + public final Block planks; - + public final Block stairs; public final Block slab; public final Block fence; @@ -55,28 +55,28 @@ public class WoodenMaterial { public final Block pressurePlate; public final Block trapdoor; public final Block door; - + public final Block craftingTable; public final Block ladder; public final Block sign; - + public final Block chest; public final Block barrel; public final Block shelf; public final Block composter; - + public final Tag.Named logBlockTag; public final Tag.Named logItemTag; - + public WoodenMaterial(String name, MaterialColor woodColor, MaterialColor planksColor) { FabricBlockSettings materialPlanks = FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).materialColor(planksColor); - + log_stripped = EndBlocks.registerBlock(name + "_stripped_log", new BaseRotatedPillarBlock(materialPlanks)); bark_stripped = EndBlocks.registerBlock(name + "_stripped_bark", new BaseBarkBlock(materialPlanks)); - + log = EndBlocks.registerBlock(name + "_log", new BaseStripableLogBlock(woodColor, log_stripped)); bark = EndBlocks.registerBlock(name + "_bark", new StripableBarkBlock(woodColor, bark_stripped)); - + planks = EndBlocks.registerBlock(name + "_planks", new BaseBlock(materialPlanks)); stairs = EndBlocks.registerBlock(name + "_stairs", new BaseStairsBlock(planks)); slab = EndBlocks.registerBlock(name + "_slab", new BaseSlabBlock(planks)); @@ -86,16 +86,16 @@ public class WoodenMaterial { pressurePlate = EndBlocks.registerBlock(name + "_plate", new WoodenPressurePlateBlock(planks)); trapdoor = EndBlocks.registerBlock(name + "_trapdoor", new BaseTrapdoorBlock(planks)); door = EndBlocks.registerBlock(name + "_door", new BaseDoorBlock(planks)); - + craftingTable = EndBlocks.registerBlock(name + "_crafting_table", new BaseCraftingTableBlock(planks)); ladder = EndBlocks.registerBlock(name + "_ladder", new BaseLadderBlock(planks)); sign = EndBlocks.registerBlock(name + "_sign", new BaseSignBlock(planks)); - + chest = EndBlocks.registerBlock(name + "_chest", new BaseChestBlock(planks)); barrel = EndBlocks.registerBlock(name + "_barrel", new BaseBarrelBlock(planks)); shelf = EndBlocks.registerBlock(name + "_bookshelf", new BaseBookshelfBlock(planks)); composter = EndBlocks.registerBlock(name + "_composter", new BaseComposterBlock(planks)); - + // Recipes // GridRecipe.make(BetterEnd.MOD_ID, name + "_planks", planks).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setList("#").addMaterial('#', log, bark, log_stripped, bark_stripped).setGroup("end_planks").build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_stairs", stairs).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("# ", "## ", "###").addMaterial('#', planks).setGroup("end_planks_stairs").build(); @@ -116,13 +116,13 @@ public class WoodenMaterial { GridRecipe.make(BetterEnd.MOD_ID, name + "_log", log).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', bark).setOutputCount(3).build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_composter", composter).checkConfig(Configs.RECIPE_CONFIG).setShape("# #", "# #", "###").addMaterial('#', slab).build(); GridRecipe.make(BetterEnd.MOD_ID, name + "_shulker", Items.SHULKER_BOX).checkConfig(Configs.RECIPE_CONFIG).setShape("S", "#", "S").addMaterial('S', Items.SHULKER_SHELL).addMaterial('#', chest).build(); - + // Item Tags // TagHelper.addTag(ItemTags.PLANKS, planks); TagHelper.addTag(ItemTags.WOODEN_PRESSURE_PLATES, pressurePlate); TagHelper.addTag(ItemTags.LOGS, log, bark, log_stripped, bark_stripped); TagHelper.addTag(ItemTags.LOGS_THAT_BURN, log, bark, log_stripped, bark_stripped); - + TagHelper.addTags(button, ItemTags.WOODEN_BUTTONS, ItemTags.BUTTONS); TagHelper.addTags(door, ItemTags.WOODEN_DOORS, ItemTags.DOORS); TagHelper.addTags(fence, ItemTags.WOODEN_FENCES, ItemTags.FENCES); @@ -130,13 +130,13 @@ public class WoodenMaterial { TagHelper.addTags(stairs, ItemTags.WOODEN_STAIRS, ItemTags.STAIRS); TagHelper.addTags(trapdoor, ItemTags.WOODEN_TRAPDOORS, ItemTags.TRAPDOORS); TagHelper.addTag(TagAPI.ITEM_CHEST, chest); - + // Block Tags // TagHelper.addTag(BlockTags.PLANKS, planks); TagHelper.addTag(BlockTags.CLIMBABLE, ladder); TagHelper.addTag(BlockTags.LOGS, log, bark, log_stripped, bark_stripped); TagHelper.addTag(BlockTags.LOGS_THAT_BURN, log, bark, log_stripped, bark_stripped); - + TagHelper.addTags(button, BlockTags.WOODEN_BUTTONS, BlockTags.BUTTONS); TagHelper.addTags(door, BlockTags.WOODEN_DOORS, BlockTags.DOORS); TagHelper.addTags(fence, BlockTags.WOODEN_FENCES, BlockTags.FENCES); @@ -145,42 +145,42 @@ public class WoodenMaterial { TagHelper.addTags(trapdoor, BlockTags.WOODEN_TRAPDOORS, BlockTags.TRAPDOORS); TagHelper.addTag(TagAPI.BOOKSHELVES, shelf); TagHelper.addTag(TagAPI.BLOCK_CHEST, chest); - + logBlockTag = TagAPI.makeBlockTag(BetterEnd.MOD_ID, name + "_logs"); logItemTag = TagAPI.makeItemTag(BetterEnd.MOD_ID, name + "_logs"); TagHelper.addTag(logBlockTag, log_stripped, bark_stripped, log, bark); TagHelper.addTag(logItemTag, log_stripped, bark_stripped, log, bark); - + FlammableBlockRegistry.getDefaultInstance().add(log, 5, 5); FlammableBlockRegistry.getDefaultInstance().add(bark, 5, 5); FlammableBlockRegistry.getDefaultInstance().add(log_stripped, 5, 5); FlammableBlockRegistry.getDefaultInstance().add(bark_stripped, 5, 5); - + FlammableBlockRegistry.getDefaultInstance().add(planks, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(stairs, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(slab, 5, 20); - + FlammableBlockRegistry.getDefaultInstance().add(fence, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(gate, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(button, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(pressurePlate, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(trapdoor, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(door, 5, 20); - + FlammableBlockRegistry.getDefaultInstance().add(craftingTable, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(ladder, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(sign, 5, 20); - + FlammableBlockRegistry.getDefaultInstance().add(chest, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(barrel, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(shelf, 5, 20); FlammableBlockRegistry.getDefaultInstance().add(composter, 5, 20); } - + public boolean isTreeLog(Block block) { return block == log || block == bark; } - + public boolean isTreeLog(BlockState state) { return isTreeLog(state.getBlock()); } diff --git a/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java b/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java index b0d16ec7..a478dc00 100644 --- a/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java +++ b/src/main/java/ru/betterend/blocks/entities/BlockEntityHydrothermalVent.java @@ -3,7 +3,6 @@ package ru.betterend.blocks.entities; import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.core.Direction; -import net.minecraft.core.particles.ParticleTypes; import net.minecraft.world.entity.EquipmentSlot; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.item.ElytraItem; @@ -24,11 +23,11 @@ import java.util.List; public class BlockEntityHydrothermalVent extends BlockEntity { private final static Vec3 POSITIVE_Y = new Vec3(0.0f, 1.0f, 0.0f); private static final MutableBlockPos POS = new MutableBlockPos(); - + public BlockEntityHydrothermalVent(BlockPos blockPos, BlockState blockState) { super(EndBlockEntities.HYDROTHERMAL_VENT, blockPos, blockState); } - + public static void tick(Level level, BlockPos worldPosition, BlockState state, T uncastedEntity) { if (level != null && uncastedEntity instanceof BlockEntityHydrothermalVent && state.is(EndBlocks.HYDROTHERMAL_VENT)) { BlockEntityHydrothermalVent blockEntity = (BlockEntityHydrothermalVent) uncastedEntity; @@ -36,11 +35,11 @@ public class BlockEntityHydrothermalVent extends BlockEntity { clientTick(level, worldPosition, state, blockEntity); } //else { - serverTick(level, worldPosition, state, blockEntity); + serverTick(level, worldPosition, state, blockEntity); //} } } - + private static void clientTick(Level level, BlockPos worldPosition, BlockState state, BlockEntityHydrothermalVent blockEntity) { boolean active = state.getValue(HydrothermalVentBlock.ACTIVATED); if (active && level.random.nextInt(20) == 0 && state.getValue(HydrothermalVentBlock.WATERLOGGED)) { @@ -50,7 +49,7 @@ public class BlockEntityHydrothermalVent extends BlockEntity { level.addParticle(EndParticles.GEYSER_PARTICLE, x, y, z, 0, 0, 0); } } - + private static void serverTick(Level level, BlockPos worldPosition, BlockState state, BlockEntityHydrothermalVent blockEntity) { boolean active = state.getValue(HydrothermalVentBlock.ACTIVATED); POS.set(worldPosition).move(Direction.UP); @@ -70,7 +69,7 @@ public class BlockEntityHydrothermalVent extends BlockEntity { } } } - + private boolean hasElytra(LivingEntity entity) { Item item = entity.getItemBySlot(EquipmentSlot.CHEST).getItem(); return item instanceof ElytraItem || item instanceof FallFlyingItem; diff --git a/src/main/java/ru/betterend/blocks/entities/EndStoneSmelterBlockEntity.java b/src/main/java/ru/betterend/blocks/entities/EndStoneSmelterBlockEntity.java index c53f7b40..33920964 100644 --- a/src/main/java/ru/betterend/blocks/entities/EndStoneSmelterBlockEntity.java +++ b/src/main/java/ru/betterend/blocks/entities/EndStoneSmelterBlockEntity.java @@ -46,12 +46,12 @@ import java.util.List; import java.util.Map; public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity implements WorldlyContainer, RecipeHolder, StackedContentsCompatible { - + private static final int[] TOP_SLOTS = new int[]{0, 1}; private static final int[] BOTTOM_SLOTS = new int[]{2, 3}; private static final int[] SIDE_SLOTS = new int[]{1, 2}; private static final Map AVAILABLE_FUELS = Maps.newHashMap(); - + private final Object2IntOpenHashMap recipesUsed; protected NonNullList inventory; protected final ContainerData propertyDelegate; @@ -60,7 +60,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme private int smeltTime; private int burnTime; private int fuelTime; - + public EndStoneSmelterBlockEntity(BlockPos blockPos, BlockState blockState) { super(EndBlockEntities.END_STONE_SMELTER, blockPos, blockState); this.inventory = NonNullList.withSize(4, ItemStack.EMPTY); @@ -80,7 +80,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme return 0; } } - + public void set(int index, int value) { switch (index) { case 0: @@ -96,22 +96,22 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme EndStoneSmelterBlockEntity.this.smeltTimeTotal = value; } } - + public int getCount() { return 4; } }; } - + private boolean isBurning() { return burnTime > 0; } - + @Override public int getContainerSize() { return inventory.size(); } - + @Override public boolean isEmpty() { Iterator iterator = inventory.iterator(); @@ -121,27 +121,26 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme return true; } itemStack = iterator.next(); - } - while (itemStack.isEmpty()); - + } while (itemStack.isEmpty()); + return false; } - + @Override public ItemStack getItem(int slot) { return inventory.get(slot); } - + @Override public ItemStack removeItem(int slot, int amount) { return ContainerHelper.removeItem(inventory, slot, amount); } - + @Override public ItemStack removeItemNoUpdate(int slot) { return ContainerHelper.takeItem(inventory, slot); } - + @Override public void setItem(int slot, ItemStack stack) { ItemStack itemStack = inventory.get(slot); @@ -156,19 +155,17 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme setChanged(); } } - + protected int getSmeltTime() { if (level == null) return 200; - int smeltTime = level.getRecipeManager().getRecipeFor(AlloyingRecipe.TYPE, this, level) - .map(AlloyingRecipe::getSmeltTime).orElse(0); + int smeltTime = level.getRecipeManager().getRecipeFor(AlloyingRecipe.TYPE, this, level).map(AlloyingRecipe::getSmeltTime).orElse(0); if (smeltTime == 0) { - smeltTime = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, this, level) - .map(BlastingRecipe::getCookingTime).orElse(200); + smeltTime = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, this, level).map(BlastingRecipe::getCookingTime).orElse(200); smeltTime /= 1.5; } return smeltTime; } - + public void dropExperience(Player player) { if (level == null) return; List> list = Lists.newArrayList(); @@ -188,21 +185,21 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme player.awardRecipes(list); recipesUsed.clear(); } - + private void dropExperience(Level world, Vec3 vec3d, int count, float amount) { int expTotal = Mth.floor(count * amount); float g = Mth.frac(count * amount); if (g != 0.0F && Math.random() < g) { expTotal++; } - + while (expTotal > 0) { int expVal = ExperienceOrb.getExperienceValue(expTotal); expTotal -= expVal; world.addFreshEntity(new ExperienceOrb(world, vec3d.x, vec3d.y, vec3d.z, expVal)); } } - + @Override public boolean stillValid(Player player) { if (level != null && level.getBlockEntity(worldPosition) != this) { @@ -210,30 +207,30 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme } return player.distanceToSqr(worldPosition.getX() + 0.5D, worldPosition.getY() + 0.5D, worldPosition.getZ() + 0.5D) <= 64.0D; } - + @Override public void clearContent() { inventory.clear(); } - + @Override protected Component getDefaultName() { return new TranslatableComponent(String.format("block.%s.%s", BetterEnd.MOD_ID, EndStoneSmelter.ID)); } - + @Override protected AbstractContainerMenu createMenu(int syncId, Inventory playerInventory) { return new EndStoneSmelterScreenHandler(syncId, playerInventory, this, propertyDelegate); } - + public static void tick(Level tickLevel, BlockPos tickPos, BlockState tickState, EndStoneSmelterBlockEntity blockEntity) { if (tickLevel == null) return; - + boolean initialBurning = blockEntity.isBurning(); if (initialBurning) { blockEntity.burnTime--; } - + boolean burning = initialBurning; if (!tickLevel.isClientSide) { ItemStack fuel = blockEntity.inventory.get(2); @@ -264,7 +261,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme blockEntity.setChanged(); } } - + if (burning && accepted) { blockEntity.smeltTime++; if (blockEntity.smeltTime == blockEntity.smeltTimeTotal) { @@ -285,17 +282,15 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme } } } - + protected boolean canAcceptRecipeOutput(Recipe recipe) { if (recipe == null) return false; boolean validInput; if (recipe instanceof AlloyingRecipe) { - validInput = !inventory.get(0).isEmpty() && - !inventory.get(1).isEmpty(); + validInput = !inventory.get(0).isEmpty() && !inventory.get(1).isEmpty(); } else { - validInput = !inventory.get(0).isEmpty() || - !inventory.get(1).isEmpty(); + validInput = !inventory.get(0).isEmpty() || !inventory.get(1).isEmpty(); } if (validInput) { ItemStack result = recipe.getResultItem(); @@ -318,10 +313,10 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme } return false; } - + private void craftRecipe(Recipe recipe) { if (recipe == null || !canAcceptRecipeOutput(recipe)) return; - + ItemStack result = recipe.getResultItem(); ItemStack output = inventory.get(3); if (output.isEmpty()) { @@ -330,12 +325,12 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme else if (output.getItem() == result.getItem()) { output.grow(result.getCount()); } - + assert this.level != null; if (!this.level.isClientSide) { setRecipeUsed(recipe); } - + if (recipe instanceof AlloyingRecipe) { inventory.get(0).shrink(1); inventory.get(1).shrink(1); @@ -349,14 +344,14 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme } } } - + @Override public void fillStackedContents(StackedContents finder) { for (ItemStack itemStack : this.inventory) { finder.accountStack(itemStack); } } - + @Override public void setRecipeUsed(Recipe recipe) { if (recipe != null) { @@ -365,12 +360,12 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme lastRecipe = recipe; } } - + @Override public Recipe getRecipeUsed() { return this.lastRecipe; } - + @Override public int[] getSlotsForFace(Direction side) { if (side == Direction.DOWN) { @@ -378,12 +373,12 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme } return side == Direction.UP ? TOP_SLOTS : SIDE_SLOTS; } - + @Override public boolean canPlaceItemThroughFace(int slot, ItemStack stack, Direction dir) { return this.canPlaceItem(slot, stack); } - + @Override public boolean canTakeItemThroughFace(int slot, ItemStack stack, Direction dir) { if (dir == Direction.DOWN && slot == 2) { @@ -391,7 +386,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme } return true; } - + protected int getFuelTime(ItemStack fuel) { if (fuel.isEmpty()) { return 0; @@ -399,7 +394,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme Item item = fuel.getItem(); return AVAILABLE_FUELS.getOrDefault(item, getFabricFuel(fuel)); } - + @Override public void load(CompoundTag tag) { super.load(tag); @@ -414,7 +409,7 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme recipesUsed.put(new ResourceLocation(id), compoundTag.getInt(id)); } } - + @Override public CompoundTag save(CompoundTag tag) { super.save(tag); @@ -426,10 +421,10 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme CompoundTag usedRecipes = new CompoundTag(); recipesUsed.forEach((identifier, integer) -> usedRecipes.putInt(identifier.toString(), integer)); tag.put("RecipesUsed", usedRecipes); - + return tag; } - + public boolean canPlaceItem(int slot, ItemStack stack) { if (slot == 3) { return false; @@ -440,24 +435,24 @@ public class EndStoneSmelterBlockEntity extends BaseContainerBlockEntity impleme ItemStack itemStack = this.inventory.get(2); return canUseAsFuel(stack) || stack.getItem() == Items.BUCKET && itemStack.getItem() != Items.BUCKET; } - + public static boolean canUseAsFuel(ItemStack stack) { return AVAILABLE_FUELS.containsKey(stack.getItem()) || getFabricFuel(stack) > 2000; } - + public static void registerFuel(ItemLike fuel, int time) { AVAILABLE_FUELS.put(fuel.asItem(), time); } - + public static Map availableFuels() { return AVAILABLE_FUELS; } - + private static int getFabricFuel(ItemStack stack) { Integer ticks = FuelRegistry.INSTANCE.get(stack.getItem()); return ticks == null ? 0 : ticks; } - + static { AbstractFurnaceBlockEntity.getFuel().forEach((item, time) -> { if (time >= 2000) { diff --git a/src/main/java/ru/betterend/blocks/entities/EternalPedestalEntity.java b/src/main/java/ru/betterend/blocks/entities/EternalPedestalEntity.java index 7796d528..84c2e74d 100644 --- a/src/main/java/ru/betterend/blocks/entities/EternalPedestalEntity.java +++ b/src/main/java/ru/betterend/blocks/entities/EternalPedestalEntity.java @@ -9,23 +9,23 @@ import ru.betterend.rituals.EternalRitual; public class EternalPedestalEntity extends PedestalBlockEntity { private EternalRitual linkedRitual; - + public EternalPedestalEntity(BlockPos blockPos, BlockState blockState) { super(EndBlockEntities.ETERNAL_PEDESTAL, blockPos, blockState); } - + public boolean hasRitual() { return linkedRitual != null; } - + public void linkRitual(EternalRitual ritual) { this.linkedRitual = ritual; } - + public EternalRitual getRitual() { return linkedRitual; } - + @Override public void setLevel(Level level) { super.setLevel(level); @@ -33,7 +33,7 @@ public class EternalPedestalEntity extends PedestalBlockEntity { linkedRitual.setWorld(level); } } - + @Override public CompoundTag save(CompoundTag tag) { if (hasRitual()) { @@ -41,7 +41,7 @@ public class EternalPedestalEntity extends PedestalBlockEntity { } return super.save(tag); } - + @Override protected void fromTag(CompoundTag tag) { super.fromTag(tag); diff --git a/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java b/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java index b4f67dce..6d03ed5c 100644 --- a/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java +++ b/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java @@ -9,13 +9,13 @@ import ru.betterend.registry.EndBlockEntities; import ru.betterend.rituals.InfusionRitual; public class InfusionPedestalEntity extends PedestalBlockEntity { - + private InfusionRitual linkedRitual; - + public InfusionPedestalEntity(BlockPos blockPos, BlockState blockState) { super(EndBlockEntities.INFUSION_PEDESTAL, blockPos, blockState); } - + @Override public void setLevel(Level world) { super.setLevel(world); @@ -26,19 +26,19 @@ public class InfusionPedestalEntity extends PedestalBlockEntity { linkRitual(new InfusionRitual(this, world, this.getBlockPos())); } } - + public void linkRitual(InfusionRitual ritual) { linkedRitual = ritual; } - + public InfusionRitual getRitual() { return linkedRitual; } - + public boolean hasRitual() { return linkedRitual != null; } - + @Override public CompoundTag save(CompoundTag tag) { if (hasRitual()) { @@ -46,7 +46,7 @@ public class InfusionPedestalEntity extends PedestalBlockEntity { } return super.save(tag); } - + @Override protected void fromTag(CompoundTag tag) { super.fromTag(tag); @@ -55,7 +55,7 @@ public class InfusionPedestalEntity extends PedestalBlockEntity { linkedRitual.fromTag(tag.getCompound("ritual")); } } - + public static void tickEnity(Level level, BlockPos blockPos, BlockState blockState, T uncastedEntity) { if (uncastedEntity instanceof InfusionPedestalEntity) { InfusionPedestalEntity blockEntity = (InfusionPedestalEntity) uncastedEntity; diff --git a/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java b/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java index 0e61d526..75e85049 100644 --- a/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java +++ b/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java @@ -16,70 +16,70 @@ import ru.betterend.registry.EndItems; public class PedestalBlockEntity extends BlockEntity implements Container, BlockEntityClientSerializable { private ItemStack activeItem = ItemStack.EMPTY; - + private final int maxAge = 314; private int age; - + public PedestalBlockEntity(BlockPos blockPos, BlockState blockState) { this(EndBlockEntities.PEDESTAL, blockPos, blockState); } - + public PedestalBlockEntity(BlockEntityType blockEntityType, BlockPos blockPos, BlockState blockState) { super(blockEntityType, blockPos, blockState); } - + public int getAge() { return age; } - + public int getMaxAge() { return maxAge; } - + @Override public int getContainerSize() { return 1; } - + @Override public boolean isEmpty() { return activeItem.isEmpty(); } - + @Override public ItemStack getItem(int slot) { return activeItem; } - + @Override public ItemStack removeItem(int slot, int amount) { return removeItemNoUpdate(slot); } - + @Override public boolean canPlaceItem(int slot, ItemStack stack) { return isEmpty(); } - + @Override public void clearContent() { activeItem = ItemStack.EMPTY; setChanged(); } - + @Override public ItemStack removeItemNoUpdate(int slot) { ItemStack stored = activeItem; clearContent(); return stored; } - + @Override public void setItem(int slot, ItemStack stack) { activeItem = stack.split(1); setChanged(); } - + @Override public void setChanged() { if (level != null && !level.isClientSide) { @@ -97,46 +97,46 @@ public class PedestalBlockEntity extends BlockEntity implements Container, Block } super.setChanged(); } - - + + @Override public boolean stillValid(Player player) { return true; } - + @Override public void load(CompoundTag tag) { super.load(tag); fromTag(tag); } - + @Override public CompoundTag save(CompoundTag tag) { tag.put("active_item", activeItem.save(new CompoundTag())); return super.save(tag); } - + @Override public void fromClientTag(CompoundTag tag) { fromTag(tag); } - + @Override public CompoundTag toClientTag(CompoundTag tag) { return save(tag); } - + protected void fromTag(CompoundTag tag) { if (tag.contains("active_item")) { CompoundTag itemTag = tag.getCompound("active_item"); activeItem = ItemStack.of(itemTag); } } - + public static void tick(Level level, BlockPos blockPos, BlockState blockState, T uncastedEntity) { clientTick(level, blockPos, blockState, (PedestalBlockEntity) uncastedEntity); } - + private static void clientTick(Level tickLevel, BlockPos tickPos, BlockState tickState, PedestalBlockEntity blockEntity) { if (!blockEntity.isEmpty()) { blockEntity.age++; diff --git a/src/main/java/ru/betterend/client/BetterEndClient.java b/src/main/java/ru/betterend/client/BetterEndClient.java index 73859941..b53340fd 100644 --- a/src/main/java/ru/betterend/client/BetterEndClient.java +++ b/src/main/java/ru/betterend/client/BetterEndClient.java @@ -43,12 +43,12 @@ public class BetterEndClient implements ClientModInitializer { ClientOptions.init(); registerRenderers(); registerTooltips(); - + if (BCLib.isDevEnvironment()) { TranslationHelper.printMissingNames(BetterEnd.MOD_ID); } } - + public static void registerTooltips() { ItemTooltipCallback.EVENT.register((player, stack, context, lines) -> { if (stack.getItem() instanceof CrystaliteArmor) { @@ -63,21 +63,19 @@ public class BetterEndClient implements ClientModInitializer { } }); } - + private void registerRenderLayers() { RenderType cutout = RenderType.cutout(); RenderType translucent = RenderType.translucent(); Registry.BLOCK.forEach(block -> { if (block instanceof IRenderTyped) { BCLRenderLayer layer = ((IRenderTyped) block).getRenderLayer(); - if (layer == BCLRenderLayer.CUTOUT) - BlockRenderLayerMap.INSTANCE.putBlock(block, cutout); - else if (layer == BCLRenderLayer.TRANSLUCENT) - BlockRenderLayerMap.INSTANCE.putBlock(block, translucent); + if (layer == BCLRenderLayer.CUTOUT) BlockRenderLayerMap.INSTANCE.putBlock(block, cutout); + else if (layer == BCLRenderLayer.TRANSLUCENT) BlockRenderLayerMap.INSTANCE.putBlock(block, translucent); } }); } - + private static void registerRenderers() { List modBlocks = EndBlocks.getModBlocks(); modBlocks.stream().filter(BaseChestBlock.class::isInstance).forEach(BaseChestBlockEntityRenderer::registerRenderLayer); diff --git a/src/main/java/ru/betterend/client/ClientOptions.java b/src/main/java/ru/betterend/client/ClientOptions.java index a82bfe9a..b40be6f8 100644 --- a/src/main/java/ru/betterend/client/ClientOptions.java +++ b/src/main/java/ru/betterend/client/ClientOptions.java @@ -7,7 +7,7 @@ public class ClientOptions { private static boolean useFogDensity; private static boolean blendBiomeMusic; private static boolean sulfurWaterColor; - + public static void init() { customSky = Configs.CLENT_CONFIG.getBooleanRoot("customSky", true); useFogDensity = Configs.CLENT_CONFIG.getBooleanRoot("useFogDensity", true); @@ -15,35 +15,35 @@ public class ClientOptions { sulfurWaterColor = Configs.CLENT_CONFIG.getBooleanRoot("sulfurWaterColor", true); Configs.CLENT_CONFIG.saveChanges(); } - + public static boolean isCustomSky() { return customSky; } - + public static void setCustomSky(boolean customSky) { ClientOptions.customSky = customSky; } - + public static boolean useFogDensity() { return useFogDensity; } - + public static void setUseFogDensity(boolean useFogDensity) { ClientOptions.useFogDensity = useFogDensity; } - + public static boolean blendBiomeMusic() { return blendBiomeMusic; } - + public static void setBlendBiomeMusic(boolean blendBiomeMusic) { ClientOptions.blendBiomeMusic = blendBiomeMusic; } - + public static boolean useSulfurWaterColor() { return sulfurWaterColor; } - + public static void setSulfurWaterColor(boolean sulfurWaterColor) { ClientOptions.sulfurWaterColor = sulfurWaterColor; } diff --git a/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java b/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java index c794b5d2..e25550e5 100644 --- a/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java +++ b/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java @@ -26,12 +26,12 @@ public class EndStoneSmelterRecipeBookScreen extends BlastingRecipeBookComponent private Slot fuelSlot; private Item currentItem; private float frameTime; - + @Override protected Set getFuelItems() { return EndStoneSmelterBlockEntity.availableFuels().keySet(); } - + @Override public void slotClicked(Slot slot) { super.slotClicked(slot); @@ -39,7 +39,7 @@ public class EndStoneSmelterRecipeBookScreen extends BlastingRecipeBookComponent this.fuelSlot = null; } } - + @Override public void setupGhostRecipe(Recipe recipe, List slots) { this.ghostRecipe.clear(); @@ -62,11 +62,11 @@ public class EndStoneSmelterRecipeBookScreen extends BlastingRecipeBookComponent if (this.fuels == null) { this.fuels = this.getFuelItems(); } - + this.fuelIterator = this.fuels.iterator(); this.currentItem = null; } - + @Override public void renderGhostRecipe(PoseStack matrices, int x, int y, boolean bl, float f) { this.ghostRecipe.render(matrices, minecraft, x, y, bl, f); @@ -74,7 +74,7 @@ public class EndStoneSmelterRecipeBookScreen extends BlastingRecipeBookComponent if (!Screen.hasControlDown()) { this.frameTime += f; } - + int slotX = this.fuelSlot.x + x; int slotY = this.fuelSlot.y + y; GuiComponent.fill(matrices, slotX, slotY, slotX + 16, slotY + 16, 822018048); @@ -85,7 +85,7 @@ public class EndStoneSmelterRecipeBookScreen extends BlastingRecipeBookComponent RenderSystem.depthFunc(515); } } - + private Item getFuel() { if (this.currentItem == null || this.frameTime > 30.0F) { this.frameTime = 0.0F; diff --git a/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java b/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java index c1cce315..96b7fcbd 100644 --- a/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java +++ b/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java @@ -17,18 +17,18 @@ import ru.betterend.BetterEnd; @Environment(EnvType.CLIENT) public class EndStoneSmelterScreen extends AbstractContainerScreen implements RecipeUpdateListener { - + private final static ResourceLocation RECIPE_BUTTON_TEXTURE = new ResourceLocation("textures/gui/recipe_button.png"); private final static ResourceLocation BACKGROUND_TEXTURE = BetterEnd.makeID("textures/gui/smelter_gui.png"); - + public final EndStoneSmelterRecipeBookScreen recipeBook; private boolean narrow; - + public EndStoneSmelterScreen(EndStoneSmelterScreenHandler handler, Inventory inventory, Component title) { super(handler, inventory, title); recipeBook = new EndStoneSmelterRecipeBookScreen(); } - + public void init() { super.init(); //TODO: test in 1.17 @@ -43,13 +43,13 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen= (left + imageWidth) || mouseY >= (top + imageHeight); return this.recipeBook.hasClickedOutside(mouseX, mouseY, leftPos, topPos, imageWidth, imageHeight, button) && isMouseOut; } - + @Override public boolean charTyped(char chr, int keyCode) { return recipeBook.charTyped(chr, keyCode) || super.charTyped(chr, keyCode); } - + @Override public void recipesUpdated() { recipeBook.recipesUpdated(); } - + @Override public RecipeBookComponent getRecipeBookComponent() { return recipeBook; } - + @Override protected void renderBg(PoseStack matrices, float delta, int mouseX, int mouseY) { if (minecraft == null) return; @@ -124,7 +124,7 @@ public class EndStoneSmelterScreen extends AbstractContainerScreen { - - public final static MenuType HANDLER_TYPE = ScreenHandlerRegistry.registerSimple( - BetterEnd.makeID(EndStoneSmelter.ID), EndStoneSmelterScreenHandler::new); - + + public final static MenuType HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(BetterEnd.makeID(EndStoneSmelter.ID), EndStoneSmelterScreenHandler::new); + private final Container inventory; private final ContainerData propertyDelegate; protected final Level world; - + public EndStoneSmelterScreenHandler(int syncId, Inventory playerInventory) { this(syncId, playerInventory, new SimpleContainer(4), new SimpleContainerData(4)); } - + public EndStoneSmelterScreenHandler(int syncId, Inventory playerInventory, Container inventory, ContainerData propertyDelegate) { super(HANDLER_TYPE, syncId); this.inventory = inventory; this.propertyDelegate = propertyDelegate; this.world = playerInventory.player.level; - + addDataSlots(propertyDelegate); addSlot(new Slot(inventory, 0, 45, 17)); addSlot(new Slot(inventory, 1, 67, 17)); addSlot(new SmelterFuelSlot(this, inventory, 2, 56, 53)); addSlot(new SmelterOutputSlot(playerInventory.player, inventory, 3, 129, 35)); - + for (int i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { addSlot(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); @@ -59,77 +58,77 @@ public class EndStoneSmelterScreenHandler extends RecipeBookMenu { addSlot(new Slot(playerInventory, i, 8 + i * 18, 142)); } } - + @Override public MenuType getType() { return HANDLER_TYPE; } - + @Override public void fillCraftSlotsStackedContents(StackedContents finder) { if (inventory instanceof StackedContentsCompatible) { ((StackedContentsCompatible) inventory).fillStackedContents(finder); } } - + @Override public void clearCraftingContent() { inventory.clearContent(); } - + @Override public boolean recipeMatches(Recipe recipe) { return recipe.matches(inventory, world); } - + @Override public int getResultSlotIndex() { return 3; } - + @Override public int getGridWidth() { return 2; } - + @Override public int getGridHeight() { return 1; } - + @Override public int getSize() { return 4; } - + @Override public RecipeBookType getRecipeBookType() { return RecipeBookType.BLAST_FURNACE; } - + @Override public boolean shouldMoveToInventory(int i) { return i != this.getResultSlotIndex(); } - + @Override public boolean stillValid(Player player) { return inventory.stillValid(player); } - + protected boolean isSmeltable(ItemStack itemStack) { return world.getRecipeManager().getRecipeFor(AlloyingRecipe.TYPE, new SimpleContainer(itemStack), world).isPresent(); } - + public boolean isFuel(ItemStack itemStack) { return EndStoneSmelterBlockEntity.canUseAsFuel(itemStack); } - + @Override public ItemStack quickMoveStack(Player player, int index) { Slot slot = slots.get(index); if (slot == null || !slot.hasItem()) return ItemStack.EMPTY; - + ItemStack slotStack = slot.getItem(); ItemStack itemStack = slotStack.copy(); if (index == 3) { @@ -161,30 +160,30 @@ public class EndStoneSmelterScreenHandler extends RecipeBookMenu { else if (!moveItemStackTo(slotStack, 4, 40, false)) { return ItemStack.EMPTY; } - + if (slotStack.isEmpty()) { slot.set(ItemStack.EMPTY); } else { slot.setChanged(); } - + if (slotStack.getCount() == itemStack.getCount()) { return ItemStack.EMPTY; } - + slot.onTake(player, slotStack); - + return itemStack; } - + @Environment(EnvType.CLIENT) public int getSmeltProgress() { int time = propertyDelegate.get(2); int timeTotal = propertyDelegate.get(3); return timeTotal != 0 && time != 0 ? time * 24 / timeTotal : 0; } - + @Environment(EnvType.CLIENT) public int getFuelProgress() { int fuelTime = propertyDelegate.get(1); @@ -193,7 +192,7 @@ public class EndStoneSmelterScreenHandler extends RecipeBookMenu { } return propertyDelegate.get(0) * 13 / fuelTime; } - + @Environment(EnvType.CLIENT) public boolean isBurning() { return propertyDelegate.get(0) > 0; diff --git a/src/main/java/ru/betterend/client/gui/slot/SmelterFuelSlot.java b/src/main/java/ru/betterend/client/gui/slot/SmelterFuelSlot.java index 3ff61a84..60b69a99 100644 --- a/src/main/java/ru/betterend/client/gui/slot/SmelterFuelSlot.java +++ b/src/main/java/ru/betterend/client/gui/slot/SmelterFuelSlot.java @@ -7,18 +7,18 @@ import net.minecraft.world.item.ItemStack; import ru.betterend.client.gui.EndStoneSmelterScreenHandler; public class SmelterFuelSlot extends Slot { - + private final EndStoneSmelterScreenHandler handler; - + public SmelterFuelSlot(EndStoneSmelterScreenHandler handler, Container inventory, int index, int x, int y) { super(inventory, index, x, y); this.handler = handler; } - + public boolean mayPlace(ItemStack stack) { return this.handler.isFuel(stack) || FurnaceFuelSlot.isBucket(stack); } - + public int getMaxStackSize(ItemStack stack) { return FurnaceFuelSlot.isBucket(stack) ? 1 : super.getMaxStackSize(stack); } diff --git a/src/main/java/ru/betterend/client/gui/slot/SmelterOutputSlot.java b/src/main/java/ru/betterend/client/gui/slot/SmelterOutputSlot.java index 3b4d0edc..3fa93cd8 100644 --- a/src/main/java/ru/betterend/client/gui/slot/SmelterOutputSlot.java +++ b/src/main/java/ru/betterend/client/gui/slot/SmelterOutputSlot.java @@ -7,37 +7,37 @@ import net.minecraft.world.item.ItemStack; import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity; public class SmelterOutputSlot extends Slot { - + private Player player; private int amount; - + public SmelterOutputSlot(Player player, Container inventory, int index, int x, int y) { super(inventory, index, x, y); this.player = player; } - + public boolean mayPlace(ItemStack stack) { return false; } - + public ItemStack remove(int amount) { if (this.hasItem()) { this.amount += Math.min(amount, this.getItem().getCount()); } - + return super.remove(amount); } - + public void onTake(Player player, ItemStack stack) { this.checkTakeAchievements(stack); super.onTake(player, stack); } - + protected void onQuickCraft(ItemStack stack, int amount) { this.amount += amount; this.checkTakeAchievements(stack); } - + protected void checkTakeAchievements(ItemStack stack) { stack.onCraftedBy(this.player.level, this.player, this.amount); if (!this.player.level.isClientSide && this.container instanceof EndStoneSmelterBlockEntity) { diff --git a/src/main/java/ru/betterend/client/models/Patterns.java b/src/main/java/ru/betterend/client/models/Patterns.java index 4da3a10f..9b4609d5 100644 --- a/src/main/java/ru/betterend/client/models/Patterns.java +++ b/src/main/java/ru/betterend/client/models/Patterns.java @@ -74,7 +74,10 @@ public class Patterns { public final static ResourceLocation BLOCK_FURNACE_LIT = BetterEnd.makeID("patterns/block/furnace_glow.json"); public final static ResourceLocation BLOCK_TOP_SIDE_BOTTOM = BetterEnd.makeID("patterns/block/top_side_bottom.json"); public final static ResourceLocation BLOCK_PATH = BetterEnd.makeID("patterns/block/path.json"); - + public final static ResourceLocation BLOCK_FLOWER_POT = BetterEnd.makeID("patterns/block/flower_pot.json"); + public final static ResourceLocation BLOCK_FLOWER_POT_SOIL = BetterEnd.makeID("patterns/block/flower_pot_soil.json"); + public final static ResourceLocation BLOCK_POTTED_LEAVES = BetterEnd.makeID("patterns/block/potted_leaves.json"); + //Item Models public final static ResourceLocation ITEM_WALL = BetterEnd.makeID("patterns/item/pattern_wall.json"); public final static ResourceLocation ITEM_FENCE = BetterEnd.makeID("patterns/item/pattern_fence.json"); @@ -84,30 +87,28 @@ public class Patterns { public final static ResourceLocation ITEM_GENERATED = BetterEnd.makeID("patterns/item/pattern_item_generated.json"); public final static ResourceLocation ITEM_HANDHELD = BetterEnd.makeID("patterns/item/pattern_item_handheld.json"); public final static ResourceLocation ITEM_SPAWN_EGG = BetterEnd.makeID("patterns/item/pattern_item_spawn_egg.json"); - + public static Optional createItemGenerated(String name) { return createJson(ITEM_GENERATED, name); } - + public static Optional createBlockSimple(String name) { return Patterns.createJson(Patterns.BLOCK_BASE, name, name); } - + public static Optional createBlockPillar(String name) { return Patterns.createJson(Patterns.BLOCK_PILLAR, name, name); } - + public static String createJson(Reader data, String parent, String block) { try (BufferedReader buffer = new BufferedReader(data)) { - return buffer.lines().collect(Collectors.joining()) - .replace("%parent%", parent) - .replace("%block%", block); + return buffer.lines().collect(Collectors.joining()).replace("%parent%", parent).replace("%block%", block); } catch (Exception ex) { return null; } } - + public static Optional createJson(ResourceLocation patternId, String parent, String block) { ResourceManager resourceManager = Minecraft.getInstance().getResourceManager(); try (InputStream input = resourceManager.getResource(patternId).getInputStream()) { @@ -117,18 +118,17 @@ public class Patterns { return Optional.empty(); } } - + public static Optional createJson(ResourceLocation patternId, String texture) { Map textures = Maps.newHashMap(); textures.put("%texture%", texture); return createJson(patternId, textures); } - + public static Optional createJson(ResourceLocation patternId, Map textures) { ResourceManager resourceManager = Minecraft.getInstance().getResourceManager(); try (InputStream input = resourceManager.getResource(patternId).getInputStream()) { - String json = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8)) - .lines().collect(Collectors.joining()); + String json = new BufferedReader(new InputStreamReader(input, StandardCharsets.UTF_8)).lines().collect(Collectors.joining()); for (Entry texture : textures.entrySet()) { json = json.replace(texture.getKey(), texture.getValue()); } @@ -138,5 +138,5 @@ public class Patterns { return Optional.empty(); } } - + } diff --git a/src/main/java/ru/betterend/client/render/ArmoredElytraLayer.java b/src/main/java/ru/betterend/client/render/ArmoredElytraLayer.java index 174ed8b9..d208d398 100644 --- a/src/main/java/ru/betterend/client/render/ArmoredElytraLayer.java +++ b/src/main/java/ru/betterend/client/render/ArmoredElytraLayer.java @@ -22,12 +22,12 @@ import ru.betterend.registry.EndEntitiesRenders; public class ArmoredElytraLayer> extends ElytraLayer { private final ArmoredElytraModel elytraModel; - + public ArmoredElytraLayer(RenderLayerParent renderLayerParent, EntityModelSet entityModelSet) { super(renderLayerParent, entityModelSet); elytraModel = new ArmoredElytraModel<>(entityModelSet.bakeLayer(EndEntitiesRenders.ARMORED_ELYTRA)); } - + public void render(PoseStack poseStack, MultiBufferSource multiBufferSource, int i, T livingEntity, float f, float g, float h, float j, float k, float l) { ItemStack itemStack = livingEntity.getItemBySlot(EquipmentSlot.CHEST); if (itemStack.getItem() instanceof FallFlyingItem) { @@ -41,7 +41,7 @@ public class ArmoredElytraLayer wingsTexture = abstractClientPlayer.getCloakTextureLocation(); } } - + poseStack.pushPose(); poseStack.translate(0.0D, 0.0D, 0.125D); getParentModel().copyPropertiesTo(elytraModel); diff --git a/src/main/java/ru/betterend/client/render/BeamRenderer.java b/src/main/java/ru/betterend/client/render/BeamRenderer.java index a623f094..f8f54d9c 100644 --- a/src/main/java/ru/betterend/client/render/BeamRenderer.java +++ b/src/main/java/ru/betterend/client/render/BeamRenderer.java @@ -13,12 +13,12 @@ import net.minecraft.util.Mth; public class BeamRenderer { private static final ResourceLocation BEAM_TEXTURE = new ResourceLocation("textures/entity/end_gateway_beam.png"); - + public static void renderLightBeam(PoseStack matrices, MultiBufferSource vertexConsumers, int age, float tick, int minY, int maxY, float[] colors, float alpha, float beamIn, float beamOut) { float red = colors[0]; float green = colors[1]; float blue = colors[2]; - + int maxBY = minY + maxY; float delta = maxY < 0 ? tick : -tick; float fractDelta = Mth.frac(delta * 0.2F - (float) Mth.floor(delta * 0.1F)); @@ -26,19 +26,19 @@ public class BeamRenderer { float minV = Mth.clamp(fractDelta - 1.0F, 0.0F, 1.0F); float maxV = (float) maxY * (0.5F / beamIn) + minV; float rotation = (age + tick) / 25.0F + 6.0F; - + VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderType.beaconBeam(BEAM_TEXTURE, true)); - + matrices.pushPose(); matrices.mulPose(Vector3f.YP.rotation(-rotation)); renderBeam(matrices, vertexConsumer, red, green, blue, alpha, minY, maxBY, beamIn, 0.0F, 0.0F, beamIn, 0.0F, xIn, xIn, 0.0F, 0.0F, 1.0F, minV, maxV); - + float xOut = -beamOut; maxV = (float) maxY + minV; renderBeam(matrices, vertexConsumer, red, green, blue, alpha, minY, maxBY, xOut, xOut, beamOut, xOut, xOut, beamOut, beamOut, beamOut, 0.0F, 1.0F, minV, maxV); matrices.popPose(); } - + private static void renderBeam(PoseStack matrices, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, int minY, int maxY, float x1, float d1, float x2, float d2, float x3, float d3, float x4, float d4, float minU, float maxU, float minV, float maxV) { PoseStack.Pose entry = matrices.last(); Matrix4f matrix4f = entry.pose(); @@ -48,14 +48,14 @@ public class BeamRenderer { renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, maxY, minY, x2, d2, x4, d4, minU, maxU, minV, maxV); renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, maxY, minY, x3, d3, x1, d1, minU, maxU, minV, maxV); } - + private static void renderBeam(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, int minY, int maxY, float minX, float minD, float maxX, float maxD, float minU, float maxU, float minV, float maxV) { addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, maxX, minY, maxD, maxU, minV); addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, maxX, maxY, maxD, maxU, maxV); addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, minX, maxY, minD, minU, maxV); addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, minX, minY, minD, minU, minV); } - + private static void addVertex(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, float x, float y, float d, float u, float v) { vertexConsumer.vertex(matrix4f, x, y, d).color(red, green, blue, alpha).uv(u, v).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(15728880).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex(); } diff --git a/src/main/java/ru/betterend/client/render/EndCrystalRenderer.java b/src/main/java/ru/betterend/client/render/EndCrystalRenderer.java index d03473e3..c3ab55ae 100644 --- a/src/main/java/ru/betterend/client/render/EndCrystalRenderer.java +++ b/src/main/java/ru/betterend/client/render/EndCrystalRenderer.java @@ -23,7 +23,7 @@ public class EndCrystalRenderer { private static final ModelPart FRAME; private static final int AGE_CYCLE = 240; private static final float SINE_45_DEGREES; - + public static void render(int age, int maxAge, float tickDelta, PoseStack matrices, MultiBufferSource vertexConsumerProvider, int light) { float k = (float) AGE_CYCLE / maxAge; float rotation = (age * k + tickDelta) * 3.0F; @@ -45,28 +45,22 @@ public class EndCrystalRenderer { CORE.render(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY); matrices.popPose(); } - + public static LayerDefinition getTexturedModelData() { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - modelPartData.addOrReplaceChild("FRAME", CubeListBuilder.create() - .texOffs(0, 0) - .addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f), - PartPose.ZERO); - - modelPartData.addOrReplaceChild("CORE", CubeListBuilder.create() - .texOffs(32, 0) - .addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f), - PartPose.ZERO); - + modelPartData.addOrReplaceChild("FRAME", CubeListBuilder.create().texOffs(0, 0).addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f), PartPose.ZERO); + + modelPartData.addOrReplaceChild("CORE", CubeListBuilder.create().texOffs(32, 0).addBox(-4.0f, -4.0f, -4.0f, 8.0f, 8.0f, 8.0f), PartPose.ZERO); + return LayerDefinition.create(modelData, 64, 32); } - + static { END_CRYSTAL = RenderType.entityCutoutNoCull(CRYSTAL_TEXTURE); RenderType.entitySmoothCutout(CRYSTAL_BEAM_TEXTURE); SINE_45_DEGREES = (float) Math.sin(0.7853981633974483D); - + ModelPart root = getTexturedModelData().bakeRoot(); FRAME = root.getChild("FRAME"); CORE = root.getChild("CORE"); diff --git a/src/main/java/ru/betterend/client/render/EternalCrystalRenderer.java b/src/main/java/ru/betterend/client/render/EternalCrystalRenderer.java index a6ecb0ed..8e8bd739 100644 --- a/src/main/java/ru/betterend/client/render/EternalCrystalRenderer.java +++ b/src/main/java/ru/betterend/client/render/EternalCrystalRenderer.java @@ -23,7 +23,7 @@ public class EternalCrystalRenderer { private static final RenderType RENDER_LAYER; private static final ModelPart[] SHARDS; private static final ModelPart CORE; - + public static void render(int age, float tickDelta, PoseStack matrices, MultiBufferSource vertexConsumerProvider, int light) { VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RENDER_LAYER); float[] colors = colors(age); @@ -32,7 +32,7 @@ public class EternalCrystalRenderer { matrices.scale(0.6F, 0.6F, 0.6F); matrices.mulPose(Vector3f.YP.rotation(rotation)); CORE.render(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, colors[0], colors[1], colors[2], colors[3]); - + for (int i = 0; i < 4; i++) { matrices.pushPose(); float offset = Mth.sin(rotation * 2 + i) * 0.15F; @@ -40,62 +40,47 @@ public class EternalCrystalRenderer { SHARDS[i].render(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, colors[0], colors[1], colors[2], colors[3]); matrices.popPose(); } - + matrices.popPose(); } - + public static float[] colors(int age) { double delta = age * 0.01; int index = MHelper.floor(delta); int index2 = (index + 1) & 3; delta -= index; index &= 3; - + Vec3i color1 = AuroraCrystalBlock.COLORS[index]; Vec3i color2 = AuroraCrystalBlock.COLORS[index2]; - + int r = MHelper.floor(Mth.lerp(delta, color1.getX(), color2.getX())); int g = MHelper.floor(Mth.lerp(delta, color1.getY(), color2.getY())); int b = MHelper.floor(Mth.lerp(delta, color1.getZ(), color2.getZ())); - + return ColorUtil.toFloatArray(ColorUtil.color(r, g, b)); } - + public static LayerDefinition getTexturedModelData() { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - modelPartData.addOrReplaceChild("SHARDS_0", CubeListBuilder.create() - .texOffs(2, 4) - .addBox(-5.0f, 1.0f, -3.0f, 2.0f, 8.0f, 2.0f), - PartPose.ZERO); - - modelPartData.addOrReplaceChild("SHARDS_1", CubeListBuilder.create() - .texOffs(2, 4) - .addBox(3.0f, -1.0f, -1.0f, 2.0f, 8.0f, 2.0f), - PartPose.ZERO); - - modelPartData.addOrReplaceChild("SHARDS_2", CubeListBuilder.create() - .texOffs(2, 4) - .addBox(-1.0f, 0.0f, -5.0f, 2.0f, 4.0f, 2.0f), - PartPose.ZERO); - - modelPartData.addOrReplaceChild("SHARDS_3", CubeListBuilder.create() - .texOffs(2, 4) - .addBox(0.0f, 3.0f, 4.0f, 2.0f, 6.0f, 2.0f), - PartPose.ZERO); - - modelPartData.addOrReplaceChild("CORE", CubeListBuilder.create() - .texOffs(0, 0) - .addBox(-2.0f, -2.0f, -2.0f, 4.0f, 12.0f, 4.0f), - PartPose.ZERO); - + modelPartData.addOrReplaceChild("SHARDS_0", CubeListBuilder.create().texOffs(2, 4).addBox(-5.0f, 1.0f, -3.0f, 2.0f, 8.0f, 2.0f), PartPose.ZERO); + + modelPartData.addOrReplaceChild("SHARDS_1", CubeListBuilder.create().texOffs(2, 4).addBox(3.0f, -1.0f, -1.0f, 2.0f, 8.0f, 2.0f), PartPose.ZERO); + + modelPartData.addOrReplaceChild("SHARDS_2", CubeListBuilder.create().texOffs(2, 4).addBox(-1.0f, 0.0f, -5.0f, 2.0f, 4.0f, 2.0f), PartPose.ZERO); + + modelPartData.addOrReplaceChild("SHARDS_3", CubeListBuilder.create().texOffs(2, 4).addBox(0.0f, 3.0f, 4.0f, 2.0f, 6.0f, 2.0f), PartPose.ZERO); + + modelPartData.addOrReplaceChild("CORE", CubeListBuilder.create().texOffs(0, 0).addBox(-2.0f, -2.0f, -2.0f, 4.0f, 12.0f, 4.0f), PartPose.ZERO); + return LayerDefinition.create(modelData, 16, 16); } - + static { RENDER_LAYER = RenderType.beaconBeam(BetterEnd.makeID("textures/entity/eternal_crystal.png"), true); SHARDS = new ModelPart[4]; - + ModelPart root = getTexturedModelData().bakeRoot(); SHARDS[0] = root.getChild("SHARDS_0"); SHARDS[1] = root.getChild("SHARDS_1"); diff --git a/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java b/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java index 2568db8c..b342250a 100644 --- a/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java +++ b/src/main/java/ru/betterend/client/render/PedestalItemRenderer.java @@ -24,21 +24,21 @@ import ru.betterend.registry.EndItems; @Environment(EnvType.CLIENT) public class PedestalItemRenderer implements BlockEntityRenderer { - + public PedestalItemRenderer(BlockEntityRendererProvider.Context ctx) { super(); } - + @Override public void render(T blockEntity, float tickDelta, PoseStack matrices, MultiBufferSource vertexConsumers, int light, int overlay) { Level world = blockEntity.getLevel(); if (world == null || blockEntity.isEmpty()) return; - + BlockState state = world.getBlockState(blockEntity.getBlockPos()); if (!(state.getBlock() instanceof PedestalBlock)) return; - + ItemStack activeItem = blockEntity.getItem(0); - + matrices.pushPose(); Minecraft minecraft = Minecraft.getInstance(); //TODO: check i=0 @@ -56,7 +56,7 @@ public class PedestalItemRenderer implements Bloc if (state.is(EndBlocks.ETERNAL_PEDESTAL) && state.getValue(EternalPedestal.ACTIVATED)) { float[] colors = EternalCrystalRenderer.colors(age); int y = blockEntity.getBlockPos().getY(); - + BeamRenderer.renderLightBeam(matrices, vertexConsumers, age, tickDelta, -y, 1024 - y, colors, 0.25F, 0.13F, 0.16F); float altitude = Mth.sin((blockEntity.getAge() + tickDelta) / 10.0F) * 0.1F + 0.1F; matrices.translate(0.0D, altitude, 0.0D); diff --git a/src/main/java/ru/betterend/config/Configs.java b/src/main/java/ru/betterend/config/Configs.java index e249ddd5..2589022c 100644 --- a/src/main/java/ru/betterend/config/Configs.java +++ b/src/main/java/ru/betterend/config/Configs.java @@ -15,10 +15,10 @@ public class Configs { public static final IdConfig BIOME_CONFIG = new EntryConfig(BetterEnd.MOD_ID, "biomes"); public static final PathConfig GENERATOR_CONFIG = new PathConfig(BetterEnd.MOD_ID, "generator"); public static final PathConfig RECIPE_CONFIG = new PathConfig(BetterEnd.MOD_ID, "recipes"); - + @Environment(value = EnvType.CLIENT) public static final PathConfig CLENT_CONFIG = new PathConfig(BetterEnd.MOD_ID, "client"); - + public static void saveConfigs() { ENTITY_CONFIG.saveChanges(); BLOCK_CONFIG.saveChanges(); @@ -26,7 +26,7 @@ public class Configs { ITEM_CONFIG.saveChanges(); GENERATOR_CONFIG.saveChanges(); RECIPE_CONFIG.saveChanges(); - + if (BCLib.isClient()) { CLENT_CONFIG.saveChanges(); } diff --git a/src/main/java/ru/betterend/effects/EndEnchantments.java b/src/main/java/ru/betterend/effects/EndEnchantments.java index 8dd15091..71e0a833 100644 --- a/src/main/java/ru/betterend/effects/EndEnchantments.java +++ b/src/main/java/ru/betterend/effects/EndEnchantments.java @@ -7,11 +7,11 @@ import ru.betterend.effects.enchantment.EndVeilEnchantment; public class EndEnchantments { public final static Enchantment END_VEIL = registerEnchantment("end_veil", new EndVeilEnchantment()); - + public static Enchantment registerEnchantment(String name, Enchantment enchantment) { return Registry.register(Registry.ENCHANTMENT, BetterEnd.makeID(name), enchantment); } - + public static void register() { } } diff --git a/src/main/java/ru/betterend/effects/EndPotions.java b/src/main/java/ru/betterend/effects/EndPotions.java index 1151175c..0b2e2394 100644 --- a/src/main/java/ru/betterend/effects/EndPotions.java +++ b/src/main/java/ru/betterend/effects/EndPotions.java @@ -14,15 +14,15 @@ import ru.betterend.registry.EndItems; public class EndPotions { public final static Potion END_VEIL = registerPotion("end_veil", EndStatusEffects.END_VEIL, 3600); public final static Potion LONG_END_VEIL = registerPotion("long_end_veil", EndStatusEffects.END_VEIL, 9600); - + public static Potion registerPotion(String name, MobEffect effect, int duration) { return registerPotion(name, new Potion(name, new MobEffectInstance(effect, duration))); } - + public static Potion registerPotion(String name, Potion potion) { return Registry.register(Registry.POTION, BetterEnd.makeID(name), potion); } - + public static void register() { PotionBrewingAccessor.callAddMix(Potions.AWKWARD, EndItems.ENDER_DUST, END_VEIL); PotionBrewingAccessor.callAddMix(END_VEIL, Items.REDSTONE, LONG_END_VEIL); diff --git a/src/main/java/ru/betterend/effects/EndStatusEffects.java b/src/main/java/ru/betterend/effects/EndStatusEffects.java index 1a7edb84..66e3ca4a 100644 --- a/src/main/java/ru/betterend/effects/EndStatusEffects.java +++ b/src/main/java/ru/betterend/effects/EndStatusEffects.java @@ -11,9 +11,9 @@ public class EndStatusEffects { public final static MobEffectInstance CRYSTALITE_HEALTH_REGEN = new MobEffectInstance(MobEffects.REGENERATION, 40, 0, true, false, true); public final static MobEffectInstance CRYSTALITE_DIG_SPEED = new MobEffectInstance(MobEffects.DIG_SPEED, 40, 0, true, false, true); public final static MobEffectInstance CRYSTALITE_MOVE_SPEED = new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 40, 0, true, false, true); - + public final static MobEffect END_VEIL = registerEffect("end_veil", new EndVeilEffect()); - + public static MobEffect registerEffect(String name, E effect) { return Registry.register(Registry.MOB_EFFECT, BetterEnd.makeID(name), effect); } diff --git a/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java b/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java index 6a0fa0d0..57652b8a 100644 --- a/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java +++ b/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java @@ -5,11 +5,11 @@ import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.EnchantmentCategory; public class EndVeilEnchantment extends Enchantment { - + public EndVeilEnchantment() { super(Enchantment.Rarity.VERY_RARE, EnchantmentCategory.ARMOR_HEAD, new EquipmentSlot[]{EquipmentSlot.HEAD}); } - + @Override public boolean isDiscoverable() { return false; diff --git a/src/main/java/ru/betterend/effects/status/EndVeilEffect.java b/src/main/java/ru/betterend/effects/status/EndVeilEffect.java index 1a324c24..cbe52844 100644 --- a/src/main/java/ru/betterend/effects/status/EndVeilEffect.java +++ b/src/main/java/ru/betterend/effects/status/EndVeilEffect.java @@ -4,11 +4,11 @@ import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectCategory; public class EndVeilEffect extends MobEffect { - + public EndVeilEffect() { super(MobEffectCategory.BENEFICIAL, 0x0D554A); } - + @Override public boolean isDurationEffectTick(int duration, int amplifier) { return false; diff --git a/src/main/java/ru/betterend/entity/CubozoaEntity.java b/src/main/java/ru/betterend/entity/CubozoaEntity.java index bfe8def7..c3c1723d 100644 --- a/src/main/java/ru/betterend/entity/CubozoaEntity.java +++ b/src/main/java/ru/betterend/entity/CubozoaEntity.java @@ -39,19 +39,19 @@ public class CubozoaEntity extends AbstractSchoolingFish { public static final int VARIANTS = 2; private static final EntityDataAccessor VARIANT = SynchedEntityData.defineId(CubozoaEntity.class, EntityDataSerializers.BYTE); private static final EntityDataAccessor SCALE = SynchedEntityData.defineId(CubozoaEntity.class, EntityDataSerializers.BYTE); - + public CubozoaEntity(EntityType entityType, Level world) { super(entityType, world); } - + @Override public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, SpawnGroupData entityData, CompoundTag entityTag) { SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag); - + if (BiomeAPI.getFromBiome(world.getBiome(blockPosition())) == EndBiomes.SULPHUR_SPRINGS) { this.entityData.set(VARIANT, (byte) 1); } - + if (entityTag != null) { if (entityTag.contains("Variant")) { this.entityData.set(VARIANT, entityTag.getByte("Variant")); @@ -60,25 +60,25 @@ public class CubozoaEntity extends AbstractSchoolingFish { this.entityData.set(SCALE, entityTag.getByte("Scale")); } } - + this.refreshDimensions(); return data; } - + @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(VARIANT, (byte) 0); this.entityData.define(SCALE, (byte) this.getRandom().nextInt(16)); } - + @Override public void addAdditionalSaveData(CompoundTag tag) { super.addAdditionalSaveData(tag); tag.putByte("Variant", (byte) getVariant()); tag.putByte("Scale", getByteScale()); } - + @Override public void readAdditionalSaveData(CompoundTag tag) { super.readAdditionalSaveData(tag); @@ -89,7 +89,7 @@ public class CubozoaEntity extends AbstractSchoolingFish { this.entityData.set(SCALE, tag.getByte("Scale")); } } - + @Override public ItemStack getBucketItemStack() { ItemStack bucket = EndItems.BUCKET_CUBOZOA.getDefaultInstance(); @@ -98,26 +98,23 @@ public class CubozoaEntity extends AbstractSchoolingFish { tag.putByte("Scale", entityData.get(SCALE)); return bucket; } - + public static AttributeSupplier.Builder createMobAttributes() { - return LivingEntity.createLivingAttributes() - .add(Attributes.MAX_HEALTH, 2.0) - .add(Attributes.FOLLOW_RANGE, 16.0) - .add(Attributes.MOVEMENT_SPEED, 0.5); + return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 2.0).add(Attributes.FOLLOW_RANGE, 16.0).add(Attributes.MOVEMENT_SPEED, 0.5); } - + public int getVariant() { return (int) this.entityData.get(VARIANT); } - + public byte getByteScale() { return this.entityData.get(SCALE); } - + public float getScale() { return getByteScale() / 32F + 0.75F; } - + public static boolean canSpawn(EntityType type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) { AABB box = new AABB(pos).inflate(16); List list = world.getEntitiesOfClass(CubozoaEntity.class, box, (entity) -> { @@ -125,11 +122,11 @@ public class CubozoaEntity extends AbstractSchoolingFish { }); return list.size() < 9; } - + protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) { return dimensions.height * 0.5F; } - + @Override protected void dropFromLootTable(DamageSource source, boolean causedByPlayer) { int count = random.nextInt(3); @@ -138,12 +135,12 @@ public class CubozoaEntity extends AbstractSchoolingFish { this.level.addFreshEntity(drop); } } - + @Override protected SoundEvent getFlopSound() { return SoundEvents.SALMON_FLOP; } - + @Override public void playerTouch(Player player) { if (player instanceof ServerPlayer && player.hurt(DamageSource.mobAttack(this), 0.5F)) { diff --git a/src/main/java/ru/betterend/entity/DragonflyEntity.java b/src/main/java/ru/betterend/entity/DragonflyEntity.java index ea18a0c4..1cae90ad 100644 --- a/src/main/java/ru/betterend/entity/DragonflyEntity.java +++ b/src/main/java/ru/betterend/entity/DragonflyEntity.java @@ -50,20 +50,16 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { this.setPathfindingMalus(BlockPathTypes.DANGER_FIRE, -1.0F); this.xpReward = 1; } - + public static AttributeSupplier.Builder createMobAttributes() { - return LivingEntity.createLivingAttributes() - .add(Attributes.MAX_HEALTH, 8.0D) - .add(Attributes.FOLLOW_RANGE, 16.0D) - .add(Attributes.FLYING_SPEED, 1.0D) - .add(Attributes.MOVEMENT_SPEED, 0.1D); + return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 8.0D).add(Attributes.FOLLOW_RANGE, 16.0D).add(Attributes.FLYING_SPEED, 1.0D).add(Attributes.MOVEMENT_SPEED, 0.1D); } - + @Override public boolean canBeLeashed(Player player) { return false; } - + @Override protected PathNavigation createNavigation(Level world) { FlyingPathNavigation birdNavigation = new FlyingPathNavigation(this, world) { @@ -71,7 +67,7 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { BlockState state = this.level.getBlockState(pos); return state.isAir() || !state.getMaterial().blocksMotion(); } - + public void tick() { super.tick(); } @@ -81,12 +77,12 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { birdNavigation.setCanPassDoors(true); return birdNavigation; } - + @Override public float getWalkTargetValue(BlockPos pos, LevelReader world) { return world.getBlockState(pos).isAir() ? 10.0F : 0.0F; } - + @Override protected void registerGoals() { this.goalSelector.addGoal(1, new FloatGoal(this)); @@ -94,65 +90,65 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { this.goalSelector.addGoal(3, new FollowParentGoal(this, 1.0D)); this.goalSelector.addGoal(4, new WanderAroundGoal()); } - + @Override public boolean isPushable() { return false; } - + @Override public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { return false; } - + @Override protected Entity.MovementEmission getMovementEmission() { return Entity.MovementEmission.EVENTS; } - + @Override public boolean isFlying() { return !this.onGround; } - + @Override public boolean isNoGravity() { return true; } - + @Override public SoundEvent getAmbientSound() { return EndSounds.ENTITY_DRAGONFLY; } - + @Override protected float getSoundVolume() { return MHelper.randRange(0.25F, 0.5F, random); } - + class DragonflyLookControl extends LookControl { DragonflyLookControl(Mob entity) { super(entity); } - + protected boolean resetXRotOnTick() { return true; } } - + class WanderAroundGoal extends Goal { WanderAroundGoal() { this.setFlags(EnumSet.of(Goal.Flag.MOVE)); } - + public boolean canUse() { return DragonflyEntity.this.navigation.isDone() && DragonflyEntity.this.random.nextInt(10) == 0; } - + public boolean canContinueToUse() { return DragonflyEntity.this.navigation.isInProgress(); } - + public void start() { Vec3 vec3d = this.getRandomLocation(); if (vec3d != null) { @@ -168,7 +164,7 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { } super.start(); } - + private Vec3 getRandomLocation() { int h = BlocksHelper.downRay(DragonflyEntity.this.level, DragonflyEntity.this.blockPosition(), 16); Vec3 rotation = DragonflyEntity.this.getViewVector(0.0F); @@ -190,18 +186,18 @@ public class DragonflyEntity extends Animal implements FlyingAnimal { } return AirAndWaterRandomPos.getPos(DragonflyEntity.this, 8, 4, -2, rotation.x, rotation.z, 1.5707963705062866D); } - + private boolean isInVoid(Vec3 pos) { int h = BlocksHelper.downRay(DragonflyEntity.this.level, new BlockPos(pos), 128); return h > 100; } } - + @Override public AgeableMob getBreedOffspring(ServerLevel world, AgeableMob entity) { return EndEntities.DRAGONFLY.create(world); } - + public static boolean canSpawn(EntityType type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) { int y = world.getChunk(pos).getHeight(Types.WORLD_SURFACE, pos.getX() & 15, pos.getY() & 15); return y > 0 && pos.getY() >= y; diff --git a/src/main/java/ru/betterend/entity/EndFishEntity.java b/src/main/java/ru/betterend/entity/EndFishEntity.java index 19d6bf32..5246a55d 100644 --- a/src/main/java/ru/betterend/entity/EndFishEntity.java +++ b/src/main/java/ru/betterend/entity/EndFishEntity.java @@ -36,19 +36,19 @@ public class EndFishEntity extends AbstractSchoolingFish { public static final int VARIANTS = VARIANTS_NORMAL + VARIANTS_SULPHUR; private static final EntityDataAccessor VARIANT = SynchedEntityData.defineId(EndFishEntity.class, EntityDataSerializers.BYTE); private static final EntityDataAccessor SCALE = SynchedEntityData.defineId(EndFishEntity.class, EntityDataSerializers.BYTE); - + public EndFishEntity(EntityType entityType, Level world) { super(entityType, world); } - + @Override public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, SpawnGroupData entityData, CompoundTag entityTag) { SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag); - + if (BiomeAPI.getFromBiome(world.getBiome(blockPosition())) == EndBiomes.SULPHUR_SPRINGS) { this.entityData.set(VARIANT, (byte) (random.nextInt(VARIANTS_SULPHUR) + VARIANTS_NORMAL)); } - + if (entityTag != null) { if (entityTag.contains("Variant")) { this.entityData.set(VARIANT, entityTag.getByte("variant")); @@ -57,25 +57,25 @@ public class EndFishEntity extends AbstractSchoolingFish { this.entityData.set(SCALE, entityTag.getByte("scale")); } } - + this.refreshDimensions(); return data; } - + @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(VARIANT, (byte) this.getRandom().nextInt(VARIANTS_NORMAL)); this.entityData.define(SCALE, (byte) this.getRandom().nextInt(16)); } - + @Override public void addAdditionalSaveData(CompoundTag tag) { super.addAdditionalSaveData(tag); tag.putByte("Variant", (byte) getVariant()); tag.putByte("Scale", getByteScale()); } - + @Override public void readAdditionalSaveData(CompoundTag tag) { super.readAdditionalSaveData(tag); @@ -86,7 +86,7 @@ public class EndFishEntity extends AbstractSchoolingFish { this.entityData.set(SCALE, tag.getByte("Scale")); } } - + @Override public ItemStack getBucketItemStack() { ItemStack bucket = EndItems.BUCKET_END_FISH.getDefaultInstance(); @@ -95,27 +95,27 @@ public class EndFishEntity extends AbstractSchoolingFish { tag.putByte("scale", entityData.get(SCALE)); return bucket; } - + @Override protected SoundEvent getFlopSound() { return SoundEvents.TROPICAL_FISH_FLOP; } - + @Override protected SoundEvent getAmbientSound() { return SoundEvents.SALMON_AMBIENT; } - + @Override protected SoundEvent getDeathSound() { return SoundEvents.SALMON_DEATH; } - + @Override protected SoundEvent getHurtSound(DamageSource source) { return SoundEvents.SALMON_HURT; } - + @Override public void tick() { super.tick(); @@ -126,26 +126,23 @@ public class EndFishEntity extends AbstractSchoolingFish { level.addParticle(ParticleTypes.BUBBLE, x, y, z, 0, 0, 0); } } - + public static AttributeSupplier.Builder createMobAttributes() { - return LivingEntity.createLivingAttributes() - .add(Attributes.MAX_HEALTH, 2.0) - .add(Attributes.FOLLOW_RANGE, 16.0) - .add(Attributes.MOVEMENT_SPEED, 0.75); + return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 2.0).add(Attributes.FOLLOW_RANGE, 16.0).add(Attributes.MOVEMENT_SPEED, 0.75); } - + public int getVariant() { return (int) this.entityData.get(VARIANT); } - + public byte getByteScale() { return this.entityData.get(SCALE); } - + public float getScale() { return getByteScale() / 32F + 0.75F; } - + public static boolean canSpawn(EntityType type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) { AABB box = new AABB(pos).inflate(16); List list = world.getEntitiesOfClass(EndFishEntity.class, box, (entity) -> { @@ -153,7 +150,7 @@ public class EndFishEntity extends AbstractSchoolingFish { }); return list.size() < 9; } - + @Override protected void dropFromLootTable(DamageSource source, boolean causedByPlayer) { ItemEntity drop = new ItemEntity(level, getX(), getY(), getZ(), new ItemStack(EndItems.END_FISH_RAW)); diff --git a/src/main/java/ru/betterend/entity/EndSlimeEntity.java b/src/main/java/ru/betterend/entity/EndSlimeEntity.java index 00a8c861..064e369f 100644 --- a/src/main/java/ru/betterend/entity/EndSlimeEntity.java +++ b/src/main/java/ru/betterend/entity/EndSlimeEntity.java @@ -48,12 +48,12 @@ import java.util.Random; public class EndSlimeEntity extends Slime { private static final EntityDataAccessor VARIANT = SynchedEntityData.defineId(EndSlimeEntity.class, EntityDataSerializers.BYTE); private static final MutableBlockPos POS = new MutableBlockPos(); - + public EndSlimeEntity(EntityType entityType, Level world) { super(entityType, world); this.moveControl = new EndSlimeMoveControl(this); } - + protected void registerGoals() { this.goalSelector.addGoal(1, new SwimmingGoal()); this.goalSelector.addGoal(2, new FaceTowardTargetGoal()); @@ -64,15 +64,11 @@ public class EndSlimeEntity extends Slime { })); this.targetSelector.addGoal(3, new NearestAttackableTargetGoal(this, IronGolem.class, true)); } - + public static AttributeSupplier.Builder createMobAttributes() { - return LivingEntity.createLivingAttributes() - .add(Attributes.MAX_HEALTH, 1.0D) - .add(Attributes.ATTACK_DAMAGE, 1.0D) - .add(Attributes.FOLLOW_RANGE, 16.0D) - .add(Attributes.MOVEMENT_SPEED, 0.15D); + return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 1.0D).add(Attributes.ATTACK_DAMAGE, 1.0D).add(Attributes.FOLLOW_RANGE, 16.0D).add(Attributes.MOVEMENT_SPEED, 0.15D); } - + @Override public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, SpawnGroupData entityData, CompoundTag entityTag) { SpawnGroupData data = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityTag); @@ -89,19 +85,19 @@ public class EndSlimeEntity extends Slime { this.refreshDimensions(); return data; } - + @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(VARIANT, (byte) 0); } - + @Override public void addAdditionalSaveData(CompoundTag tag) { super.addAdditionalSaveData(tag); tag.putByte("Variant", (byte) getSlimeType()); } - + @Override public void readAdditionalSaveData(CompoundTag tag) { super.readAdditionalSaveData(tag); @@ -109,12 +105,12 @@ public class EndSlimeEntity extends Slime { this.entityData.set(VARIANT, tag.getByte("Variant")); } } - + @Override protected ParticleOptions getParticleType() { return ParticleTypes.PORTAL; } - + @Override public void remove(RemovalReason reason) { int i = this.getSize(); @@ -125,7 +121,7 @@ public class EndSlimeEntity extends Slime { int j = i / 2; int k = 2 + this.random.nextInt(3); int type = this.getSlimeType(); - + for (int l = 0; l < k; ++l) { float g = ((float) (l % 2) - 0.5F) * f; float h = ((float) (l / 2) - 0.5F) * f; @@ -133,7 +129,7 @@ public class EndSlimeEntity extends Slime { if (this.isPersistenceRequired()) { slimeEntity.setPersistenceRequired(); } - + slimeEntity.setSlimeType(type); slimeEntity.setCustomName(text); slimeEntity.setNoAi(bl); @@ -144,10 +140,10 @@ public class EndSlimeEntity extends Slime { this.level.addFreshEntity(slimeEntity); } } - + ((ISlime) this).entityRemove(reason); } - + @Override protected void dropFromLootTable(DamageSource source, boolean causedByPlayer) { int maxCount = this.getSize(); @@ -163,52 +159,52 @@ public class EndSlimeEntity extends Slime { ItemEntity drop = new ItemEntity(level, getX(), getY(), getZ(), new ItemStack(Items.SLIME_BALL, count)); this.level.addFreshEntity(drop); } - + public int getSlimeType() { return this.entityData.get(VARIANT).intValue(); } - + public void setSlimeType(int value) { this.entityData.set(VARIANT, (byte) value); } - + protected void setMossy() { setSlimeType(1); } - + public boolean isMossy() { return getSlimeType() == 1; } - + protected void setLake() { setSlimeType(2); } - + public boolean isLake() { return getSlimeType() == 2; } - + protected void setAmber(boolean mossy) { this.entityData.set(VARIANT, (byte) 3); } - + public boolean isAmber() { return this.entityData.get(VARIANT) == 3; } - + public boolean isChorus() { return this.entityData.get(VARIANT) == 0; } - + public static boolean canSpawn(EntityType type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) { return random.nextInt(16) == 0 || isPermanentBiome(world, pos) || (notManyEntities(world, pos, 32, 3) && isWaterNear(world, pos, 32, 8)); } - + private static boolean isPermanentBiome(ServerLevelAccessor world, BlockPos pos) { Biome biome = world.getBiome(pos); return BiomeAPI.getFromBiome(biome) == EndBiomes.CHORUS_FOREST; } - + private static boolean notManyEntities(ServerLevelAccessor world, BlockPos pos, int radius, int maxCount) { AABB box = new AABB(pos).inflate(radius); List list = world.getEntitiesOfClass(EndSlimeEntity.class, box, (entity) -> { @@ -216,7 +212,7 @@ public class EndSlimeEntity extends Slime { }); return list.size() <= maxCount; } - + private static boolean isWaterNear(ServerLevelAccessor world, BlockPos pos, int radius, int radius2) { for (int x = pos.getX() - radius; x <= pos.getX() + radius; x++) { POS.setX(x); @@ -232,17 +228,17 @@ public class EndSlimeEntity extends Slime { } return false; } - + class MoveGoal extends Goal { public MoveGoal() { this.setFlags(EnumSet.of(Goal.Flag.JUMP, Goal.Flag.MOVE)); } - + public boolean canUse() { if (EndSlimeEntity.this.isPassenger()) { return false; } - + float yaw = EndSlimeEntity.this.getYHeadRot(); float speed = EndSlimeEntity.this.getSpeed(); if (speed > 0.1) { @@ -252,70 +248,63 @@ public class EndSlimeEntity extends Slime { int down = BlocksHelper.downRay(EndSlimeEntity.this.level, pos, 16); return down < 5; } - + return true; } - + public void tick() { ((EndSlimeMoveControl) EndSlimeEntity.this.getMoveControl()).move(1.0D); } } - + class SwimmingGoal extends Goal { public SwimmingGoal() { this.setFlags(EnumSet.of(Goal.Flag.JUMP, Goal.Flag.MOVE)); EndSlimeEntity.this.getNavigation().setCanFloat(true); } - + public boolean canUse() { - return (EndSlimeEntity.this.isInWater() - || EndSlimeEntity.this.isInLava()) - && EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl; + return (EndSlimeEntity.this.isInWater() || EndSlimeEntity.this.isInLava()) && EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl; } - + public void tick() { if (EndSlimeEntity.this.getRandom().nextFloat() < 0.8F) { EndSlimeEntity.this.getJumpControl().jump(); } - + ((EndSlimeMoveControl) EndSlimeEntity.this.getMoveControl()).move(1.2D); } } - + class RandomLookGoal extends Goal { private float targetYaw; private int timer; - + public RandomLookGoal() { this.setFlags(EnumSet.of(Goal.Flag.LOOK)); } - + public boolean canUse() { - return EndSlimeEntity.this.getTarget() == null - && (EndSlimeEntity.this.onGround - || EndSlimeEntity.this.isInWater() - || EndSlimeEntity.this.isInLava() - || EndSlimeEntity.this.hasEffect(MobEffects.LEVITATION)) - && EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl; + return EndSlimeEntity.this.getTarget() == null && (EndSlimeEntity.this.onGround || EndSlimeEntity.this.isInWater() || EndSlimeEntity.this.isInLava() || EndSlimeEntity.this.hasEffect(MobEffects.LEVITATION)) && EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl; } - + public void tick() { if (--this.timer <= 0) { this.timer = 40 + EndSlimeEntity.this.getRandom().nextInt(60); this.targetYaw = (float) EndSlimeEntity.this.getRandom().nextInt(360); } - + ((EndSlimeMoveControl) EndSlimeEntity.this.getMoveControl()).look(this.targetYaw, false); } } - + class FaceTowardTargetGoal extends Goal { private int ticksLeft; - + public FaceTowardTargetGoal() { this.setFlags(EnumSet.of(Goal.Flag.LOOK)); } - + public boolean canUse() { LivingEntity livingEntity = EndSlimeEntity.this.getTarget(); if (livingEntity == null) { @@ -328,12 +317,12 @@ public class EndSlimeEntity extends Slime { return livingEntity instanceof Player && ((Player) livingEntity).getAbilities().invulnerable ? false : EndSlimeEntity.this.getMoveControl() instanceof EndSlimeMoveControl; } } - + public void start() { this.ticksLeft = 300; super.start(); } - + public boolean canContinueToUse() { LivingEntity livingEntity = EndSlimeEntity.this.getTarget(); if (livingEntity == null) { @@ -349,33 +338,33 @@ public class EndSlimeEntity extends Slime { return --this.ticksLeft > 0; } } - + public void tick() { EndSlimeEntity.this.lookAt(EndSlimeEntity.this.getTarget(), 10.0F, 10.0F); ((EndSlimeMoveControl) EndSlimeEntity.this.getMoveControl()).look(EndSlimeEntity.this.getYRot(), EndSlimeEntity.this.isDealsDamage()); } } - + class EndSlimeMoveControl extends MoveControl { private float targetYaw; private int ticksUntilJump; private boolean jumpOften; - + public EndSlimeMoveControl(EndSlimeEntity slime) { super(slime); this.targetYaw = 180.0F * slime.getYRot() / 3.1415927F; } - + public void look(float targetYaw, boolean jumpOften) { this.targetYaw = targetYaw; this.jumpOften = jumpOften; } - + public void move(double speed) { this.speedModifier = speed; this.operation = MoveControl.Operation.MOVE_TO; } - + public void tick() { this.mob.setYRot(this.rotlerp(this.mob.getYRot(), this.targetYaw, 90.0F)); this.mob.yHeadRot = this.mob.getYRot(); @@ -392,7 +381,7 @@ public class EndSlimeEntity extends Slime { if (this.jumpOften) { this.ticksUntilJump /= 3; } - + EndSlimeEntity.this.getJumpControl().jump(); if (EndSlimeEntity.this.doPlayJumpSound()) { EndSlimeEntity.this.playSound(EndSlimeEntity.this.getJumpSound(), EndSlimeEntity.this.getSoundVolume(), getJumpSoundPitch()); @@ -407,10 +396,10 @@ public class EndSlimeEntity extends Slime { else { this.mob.setSpeed((float) (this.speedModifier * this.mob.getAttributeValue(Attributes.MOVEMENT_SPEED))); } - + } } - + private float getJumpSoundPitch() { float f = EndSlimeEntity.this.isTiny() ? 1.4F : 0.8F; return ((EndSlimeEntity.this.random.nextFloat() - EndSlimeEntity.this.random.nextFloat()) * 0.2F + 1.0F) * f; diff --git a/src/main/java/ru/betterend/entity/ShadowWalkerEntity.java b/src/main/java/ru/betterend/entity/ShadowWalkerEntity.java index b5c08d8d..9138d104 100644 --- a/src/main/java/ru/betterend/entity/ShadowWalkerEntity.java +++ b/src/main/java/ru/betterend/entity/ShadowWalkerEntity.java @@ -33,7 +33,7 @@ public class ShadowWalkerEntity extends Monster { public ShadowWalkerEntity(EntityType entityType, Level world) { super(entityType, world); } - + @Override protected void registerGoals() { this.goalSelector.addGoal(2, new AttackGoal(this, 1.0D, false)); @@ -42,65 +42,48 @@ public class ShadowWalkerEntity extends Monster { this.goalSelector.addGoal(8, new RandomLookAroundGoal(this)); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, Player.class, true)); } - + public static AttributeSupplier.Builder createMobAttributes() { - return Monster.createMonsterAttributes() - .add(Attributes.FOLLOW_RANGE, 35.0) - .add(Attributes.MOVEMENT_SPEED, 0.15) - .add(Attributes.ATTACK_DAMAGE, 4.5) - .add(Attributes.ARMOR, 2.0) - .add(Attributes.SPAWN_REINFORCEMENTS_CHANCE); + return Monster.createMonsterAttributes().add(Attributes.FOLLOW_RANGE, 35.0).add(Attributes.MOVEMENT_SPEED, 0.15).add(Attributes.ATTACK_DAMAGE, 4.5).add(Attributes.ARMOR, 2.0).add(Attributes.SPAWN_REINFORCEMENTS_CHANCE); } - + @Override public void tick() { super.tick(); - level.addParticle(ParticleTypes.ASH, - getX() + random.nextGaussian() * 0.2, - getY() + random.nextGaussian() * 0.5 + 1, - getZ() + random.nextGaussian() * 0.2, - 0, 0, 0); - level.addParticle(ParticleTypes.SMOKE, - getX() + random.nextGaussian() * 0.2, - getY() + random.nextGaussian() * 0.5 + 1, - getZ() + random.nextGaussian() * 0.2, - 0, 0, 0); - level.addParticle(ParticleTypes.ENTITY_EFFECT, - getX() + random.nextGaussian() * 0.2, - getY() + random.nextGaussian() * 0.5 + 1, - getZ() + random.nextGaussian() * 0.2, - 0, 0, 0); + level.addParticle(ParticleTypes.ASH, getX() + random.nextGaussian() * 0.2, getY() + random.nextGaussian() * 0.5 + 1, getZ() + random.nextGaussian() * 0.2, 0, 0, 0); + level.addParticle(ParticleTypes.SMOKE, getX() + random.nextGaussian() * 0.2, getY() + random.nextGaussian() * 0.5 + 1, getZ() + random.nextGaussian() * 0.2, 0, 0, 0); + level.addParticle(ParticleTypes.ENTITY_EFFECT, getX() + random.nextGaussian() * 0.2, getY() + random.nextGaussian() * 0.5 + 1, getZ() + random.nextGaussian() * 0.2, 0, 0, 0); } - + @Override protected SoundEvent getAmbientSound() { return EndSounds.ENTITY_SHADOW_WALKER; } - + @Override protected SoundEvent getHurtSound(DamageSource source) { return EndSounds.ENTITY_SHADOW_WALKER_DAMAGE; } - + @Override protected SoundEvent getDeathSound() { return EndSounds.ENTITY_SHADOW_WALKER_DEATH; } - + @Override protected void playStepSound(BlockPos pos, BlockState state) { } - + @Override protected float getSoundVolume() { return MHelper.randRange(0.25F, 0.5F, random); } - + @Override public float getVoicePitch() { return MHelper.randRange(0.75F, 1.25F, random); } - + @Override public boolean doHurtTarget(Entity target) { boolean attack = super.doHurtTarget(target); @@ -112,7 +95,7 @@ public class ShadowWalkerEntity extends Monster { } return attack; } - + public static boolean canSpawn(EntityType type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) { if (Monster.checkMonsterSpawnRules(type, world, spawnReason, pos, random)) { AABB box = new AABB(pos).inflate(16); @@ -123,26 +106,26 @@ public class ShadowWalkerEntity extends Monster { } return false; } - + private final class AttackGoal extends MeleeAttackGoal { private final ShadowWalkerEntity walker; private int ticks; - + public AttackGoal(ShadowWalkerEntity walker, double speed, boolean pauseWhenMobIdle) { super(walker, speed, pauseWhenMobIdle); this.walker = walker; } - + public void start() { super.start(); this.ticks = 0; } - + public void stop() { super.stop(); this.walker.setAggressive(false); } - + public void tick() { super.tick(); ++this.ticks; diff --git a/src/main/java/ru/betterend/entity/SilkMothEntity.java b/src/main/java/ru/betterend/entity/SilkMothEntity.java index 05192a8a..8e7902c8 100644 --- a/src/main/java/ru/betterend/entity/SilkMothEntity.java +++ b/src/main/java/ru/betterend/entity/SilkMothEntity.java @@ -59,7 +59,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { private BlockPos hivePos; private BlockPos entrance; private Level hiveWorld; - + public SilkMothEntity(EntityType entityType, Level world) { super(entityType, world); this.moveControl = new FlyingMoveControl(this, 20, true); @@ -68,25 +68,21 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { this.setPathfindingMalus(BlockPathTypes.DANGER_FIRE, -1.0F); this.xpReward = 1; } - + public static AttributeSupplier.Builder createMobAttributes() { - return LivingEntity.createLivingAttributes() - .add(Attributes.MAX_HEALTH, 2.0D) - .add(Attributes.FOLLOW_RANGE, 16.0D) - .add(Attributes.FLYING_SPEED, 0.4D) - .add(Attributes.MOVEMENT_SPEED, 0.1D); + return LivingEntity.createLivingAttributes().add(Attributes.MAX_HEALTH, 2.0D).add(Attributes.FOLLOW_RANGE, 16.0D).add(Attributes.FLYING_SPEED, 0.4D).add(Attributes.MOVEMENT_SPEED, 0.1D); } - + public void setHive(Level world, BlockPos hive) { this.hivePos = hive; this.hiveWorld = world; } - + @Override public boolean canBeLeashed(Player player) { return false; } - + @Override public void addAdditionalSaveData(CompoundTag tag) { if (hivePos != null) { @@ -94,7 +90,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { tag.putString("HiveWorld", hiveWorld.dimension().location().toString()); } } - + @Override public void readAdditionalSaveData(CompoundTag tag) { if (tag.contains("HivePos")) { @@ -109,7 +105,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { } } } - + @Override protected void registerGoals() { this.goalSelector.addGoal(1, new ReturnToHiveGoal()); @@ -118,7 +114,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { this.goalSelector.addGoal(8, new WanderAroundGoal()); this.goalSelector.addGoal(9, new FloatGoal(this)); } - + @Override protected PathNavigation createNavigation(Level world) { FlyingPathNavigation birdNavigation = new FlyingPathNavigation(this, world) { @@ -126,7 +122,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { BlockState state = this.level.getBlockState(pos); return state.isAir() || !state.getMaterial().blocksMotion(); } - + public void tick() { super.tick(); } @@ -136,37 +132,37 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { birdNavigation.setCanPassDoors(true); return birdNavigation; } - + @Override public boolean isPushable() { return false; } - + @Override public boolean causeFallDamage(float fallDistance, float damageMultiplier, DamageSource damageSource) { return false; } - + @Override protected Entity.MovementEmission getMovementEmission() { return Entity.MovementEmission.EVENTS; } - + @Override public boolean isFlying() { return !this.onGround; } - + @Override public boolean isNoGravity() { return true; } - + @Override public AgeableMob getBreedOffspring(ServerLevel world, AgeableMob entity) { return EndEntities.SILK_MOTH.create(world); } - + @Override protected void dropFromLootTable(DamageSource source, boolean causedByPlayer) { int minCount = 0; @@ -183,43 +179,43 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { ItemEntity drop = new ItemEntity(level, getX(), getY(), getZ(), new ItemStack(EndItems.SILK_FIBER, count)); this.level.addFreshEntity(drop); } - + public static boolean canSpawn(EntityType type, ServerLevelAccessor world, MobSpawnType spawnReason, BlockPos pos, Random random) { int y = world.getChunk(pos).getHeight(Types.WORLD_SURFACE, pos.getX() & 15, pos.getY() & 15); return y > 0 && pos.getY() >= y && notManyEntities(world, pos, 32, 1); } - + private static boolean notManyEntities(ServerLevelAccessor world, BlockPos pos, int radius, int maxCount) { AABB box = new AABB(pos).inflate(radius); List list = world.getEntitiesOfClass(SilkMothEntity.class, box, (entity) -> true); return list.size() <= maxCount; } - + class MothLookControl extends LookControl { MothLookControl(Mob entity) { super(entity); } - + protected boolean resetXRotOnTick() { return true; } } - + class WanderAroundGoal extends Goal { WanderAroundGoal() { this.setFlags(EnumSet.of(Goal.Flag.MOVE)); } - + @Override public boolean canUse() { return SilkMothEntity.this.navigation.isDone() && SilkMothEntity.this.random.nextInt(10) == 0; } - + @Override public boolean canContinueToUse() { return SilkMothEntity.this.navigation.isInProgress(); } - + @Override public void start() { Vec3 vec3d = null; @@ -237,7 +233,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { } } } - + @Nullable private Vec3 getRandomLocation() { Vec3 vec3d3 = SilkMothEntity.this.getViewVector(0.0F); @@ -245,26 +241,22 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { return vec3d4 != null ? vec3d4 : AirAndWaterRandomPos.getPos(SilkMothEntity.this, 8, 4, -2, vec3d3.x, vec3d3.z, 1.5707963705062866D); } } - + class ReturnToHiveGoal extends Goal { ReturnToHiveGoal() { this.setFlags(EnumSet.of(Goal.Flag.MOVE)); } - + @Override public boolean canUse() { - return SilkMothEntity.this.hivePos != null - && SilkMothEntity.this.hiveWorld == SilkMothEntity.this.level - && SilkMothEntity.this.navigation.isDone() - && SilkMothEntity.this.random.nextInt(16) == 0 - && SilkMothEntity.this.position().distanceToSqr(SilkMothEntity.this.hivePos.getX(), SilkMothEntity.this.hivePos.getY(), SilkMothEntity.this.hivePos.getZ()) < 64; + return SilkMothEntity.this.hivePos != null && SilkMothEntity.this.hiveWorld == SilkMothEntity.this.level && SilkMothEntity.this.navigation.isDone() && SilkMothEntity.this.random.nextInt(16) == 0 && SilkMothEntity.this.position().distanceToSqr(SilkMothEntity.this.hivePos.getX(), SilkMothEntity.this.hivePos.getY(), SilkMothEntity.this.hivePos.getZ()) < 64; } - + @Override public boolean canContinueToUse() { return SilkMothEntity.this.navigation.isInProgress() && level.getBlockState(entrance).isAir() && (level.getBlockState(hivePos).is(EndBlocks.SILK_MOTH_NEST) || level.getBlockState(hivePos).is(EndBlocks.SILK_MOTH_HIVE)); } - + @Override public void start() { BlockState state = SilkMothEntity.this.level.getBlockState(SilkMothEntity.this.hivePos); @@ -279,7 +271,7 @@ public class SilkMothEntity extends Animal implements FlyingAnimal { catch (Exception e) { } } - + @Override public void tick() { super.tick(); diff --git a/src/main/java/ru/betterend/entity/model/BlockBenchModel.java b/src/main/java/ru/betterend/entity/model/BlockBenchModel.java index 24e18c09..1ae01dbb 100644 --- a/src/main/java/ru/betterend/entity/model/BlockBenchModel.java +++ b/src/main/java/ru/betterend/entity/model/BlockBenchModel.java @@ -12,11 +12,11 @@ public abstract class BlockBenchModel extends EntityModel { public BlockBenchModel() { super(); } - + public BlockBenchModel(Function function) { super(function); } - + protected void setRotationAngle(ModelPart modelRenderer, float x, float y, float z) { modelRenderer.xRot = x; modelRenderer.yRot = y; diff --git a/src/main/java/ru/betterend/entity/model/CubozoaEntityModel.java b/src/main/java/ru/betterend/entity/model/CubozoaEntityModel.java index fd0f9f75..fd56cab7 100644 --- a/src/main/java/ru/betterend/entity/model/CubozoaEntityModel.java +++ b/src/main/java/ru/betterend/entity/model/CubozoaEntityModel.java @@ -15,71 +15,53 @@ import ru.betterend.entity.CubozoaEntity; public class CubozoaEntityModel extends BlockBenchModel { private final static int TENTACLE_COUNT = 4; - + private final ModelPart model; private final ModelPart[] tentacle_center; private final ModelPart[] tentacle; private float scaleY; private float scaleXZ; - + public static LayerDefinition getTexturedModelData() { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - - PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, - CubeListBuilder - .create() - .texOffs(0, 17) - .addBox(-2.0F, -12.5F, -2.0F, 4.0F, 4.0F, 4.0F), - PartPose.offset(0.0F, 24.0F, 0.0F) - ); - - bodyPart.addOrReplaceChild("main_cube_r1", CubeListBuilder.create() - .texOffs(0, 0) - .addBox(-5.0F, -7.0F, -5.0F, 10.0F, 7.0F, 10.0F), PartPose.offsetAndRotation(0.0F, -14.0F, 0.0F, 0.0F, 0.0F, -3.1416F)); - + + PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 17).addBox(-2.0F, -12.5F, -2.0F, 4.0F, 4.0F, 4.0F), PartPose.offset(0.0F, 24.0F, 0.0F)); + + bodyPart.addOrReplaceChild("main_cube_r1", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -7.0F, -5.0F, 10.0F, 7.0F, 10.0F), PartPose.offsetAndRotation(0.0F, -14.0F, 0.0F, 0.0F, 0.0F, -3.1416F)); + for (int i = 1; i <= TENTACLE_COUNT; i++) { - PartDefinition tentaclePart = bodyPart - .addOrReplaceChild("tentacle_center_" + i, - CubeListBuilder.create(), - PartPose.offsetAndRotation( - 0.0F, 0.0F, 0.0F, - 0.0F, i * 1.5708F, 0.0F - ) - ); - - tentaclePart.addOrReplaceChild("tentacle_" + i, CubeListBuilder.create() - .texOffs(16, 17) - .addBox(-4.0F, 0.0F, 0.0F, 8.0F, 7.0F, 0.0F), - PartPose.offset(0.0F, -7.0F, 4.5F)); + PartDefinition tentaclePart = bodyPart.addOrReplaceChild("tentacle_center_" + i, CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, i * 1.5708F, 0.0F)); + + tentaclePart.addOrReplaceChild("tentacle_" + i, CubeListBuilder.create().texOffs(16, 17).addBox(-4.0F, 0.0F, 0.0F, 8.0F, 7.0F, 0.0F), PartPose.offset(0.0F, -7.0F, 4.5F)); } - + return LayerDefinition.create(modelData, 48, 48); } - + public CubozoaEntityModel(ModelPart modelPart) { super(RenderType::entityTranslucent); tentacle = new ModelPart[TENTACLE_COUNT]; tentacle_center = new ModelPart[TENTACLE_COUNT]; - + model = modelPart.getChild(PartNames.BODY); for (int i = 1; i <= TENTACLE_COUNT; i++) { tentacle_center[i - 1] = model.getChild("tentacle_center_" + i); tentacle[i - 1] = tentacle_center[i - 1].getChild("tentacle_" + i); } } - + @Override public void setupAnim(CubozoaEntity entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) { float sin = Mth.sin(animationProgress * 0.13F); scaleY = sin * 0.1F + 0.9F; scaleXZ = Mth.sin(animationProgress * 0.13F + 3.14F) * 0.1F + 0.9F; - + for (int i = 0; i < TENTACLE_COUNT; i++) { tentacle[i].xRot = sin * 0.15f; } } - + @Override public void renderToBuffer(PoseStack matrices, VertexConsumer vertices, int light, int overlay, float red, float green, float blue, float alpha) { matrices.pushPose(); diff --git a/src/main/java/ru/betterend/entity/model/DragonflyEntityModel.java b/src/main/java/ru/betterend/entity/model/DragonflyEntityModel.java index 6490d8ca..d0cacdd6 100644 --- a/src/main/java/ru/betterend/entity/model/DragonflyEntityModel.java +++ b/src/main/java/ru/betterend/entity/model/DragonflyEntityModel.java @@ -23,99 +23,37 @@ public class DragonflyEntityModel extends BlockBenchModel { private final ModelPart wing_4; private final ModelPart legs_1; private final ModelPart legs_2; - + public static LayerDefinition getTexturedModelData() { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - - PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox(-4.0F, -4.0F, 0.0F, 4.0F, 4.0F, 9.0F), - PartPose.offset(2.0F, 21.5F, -4.0F) - ); - - bodyPart.addOrReplaceChild(PartNames.HEAD, - CubeListBuilder - .create() - .texOffs(17, 0) - .addBox(-1.5F, -1.5F, -2.5F, 3.0F, 3.0F, 3.0F), - PartPose.offsetAndRotation(-2.0F, -2.0F, 0.0F, 0.3491F, 0.0F, 0.0F) - ); - - PartDefinition tailPart = bodyPart.addOrReplaceChild(PartNames.TAIL, - CubeListBuilder - .create() - .texOffs(26, 0) - .addBox(-1.5F, -1.5F, 0.0F, 3.0F, 3.0F, 7.0F), - PartPose.offset(-2.0F, -2.0F, 9.0F) - ); - - tailPart.addOrReplaceChild(PartNames.TAIL_FIN, - CubeListBuilder - .create() - .texOffs(36, 0) - .addBox(-1.0F, -1.0F, 0.0F, 2.0F, 2.0F, 10.0F), - PartPose.offset(0.0F, 0.0F, 7.0F) - ); - - bodyPart.addOrReplaceChild(PartNames.LEFT_WING, - CubeListBuilder - .create() - .texOffs(0, 13) - .addBox(-15.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F), - PartPose.offset(-2.0F, -4.0F, 4.0F) - ); - - bodyPart.addOrReplaceChild(PartNames.RIGHT_WING, - CubeListBuilder - .create() - .mirror() - .texOffs(0, 13) - .addBox(0.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F), - PartPose.offset(-2.0F, -4.0F, 4.0F) - ); - - bodyPart.addOrReplaceChild(PartNames.LEFT_WING_BASE, - CubeListBuilder - .create() - .texOffs(4, 17) - .addBox(-12.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F), - PartPose.offset(-2.0F, -4.0F, 8.0F) - ); - - bodyPart.addOrReplaceChild(PartNames.RIGHT_WING_BASE, - CubeListBuilder - .create() - .mirror() - .texOffs(4, 17) - .addBox(0.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F), - PartPose.offset(-2.0F, -4.0F, 8.0F) - ); - - bodyPart.addOrReplaceChild(PartNames.LEFT_LEG, - CubeListBuilder - .create() - .texOffs(50, 1) - .addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F), - PartPose.offsetAndRotation(-1.0F, 0.0F, 1.0F, 0.0F, 0.0F, -0.5236F) - ); - - bodyPart.addOrReplaceChild(PartNames.RIGHT_LEG, - CubeListBuilder - .create() - .texOffs(50, 1) - .addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F), - PartPose.offsetAndRotation(-3.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.5236F) - ); - + + PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, -4.0F, 0.0F, 4.0F, 4.0F, 9.0F), PartPose.offset(2.0F, 21.5F, -4.0F)); + + bodyPart.addOrReplaceChild(PartNames.HEAD, CubeListBuilder.create().texOffs(17, 0).addBox(-1.5F, -1.5F, -2.5F, 3.0F, 3.0F, 3.0F), PartPose.offsetAndRotation(-2.0F, -2.0F, 0.0F, 0.3491F, 0.0F, 0.0F)); + + PartDefinition tailPart = bodyPart.addOrReplaceChild(PartNames.TAIL, CubeListBuilder.create().texOffs(26, 0).addBox(-1.5F, -1.5F, 0.0F, 3.0F, 3.0F, 7.0F), PartPose.offset(-2.0F, -2.0F, 9.0F)); + + tailPart.addOrReplaceChild(PartNames.TAIL_FIN, CubeListBuilder.create().texOffs(36, 0).addBox(-1.0F, -1.0F, 0.0F, 2.0F, 2.0F, 10.0F), PartPose.offset(0.0F, 0.0F, 7.0F)); + + bodyPart.addOrReplaceChild(PartNames.LEFT_WING, CubeListBuilder.create().texOffs(0, 13).addBox(-15.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F), PartPose.offset(-2.0F, -4.0F, 4.0F)); + + bodyPart.addOrReplaceChild(PartNames.RIGHT_WING, CubeListBuilder.create().mirror().texOffs(0, 13).addBox(0.0F, 0.0F, -3.0F, 15.0F, 0.0F, 4.0F), PartPose.offset(-2.0F, -4.0F, 4.0F)); + + bodyPart.addOrReplaceChild(PartNames.LEFT_WING_BASE, CubeListBuilder.create().texOffs(4, 17).addBox(-12.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F), PartPose.offset(-2.0F, -4.0F, 8.0F)); + + bodyPart.addOrReplaceChild(PartNames.RIGHT_WING_BASE, CubeListBuilder.create().mirror().texOffs(4, 17).addBox(0.0F, 0.0F, -2.5F, 12.0F, 0.0F, 3.0F), PartPose.offset(-2.0F, -4.0F, 8.0F)); + + bodyPart.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create().texOffs(50, 1).addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F), PartPose.offsetAndRotation(-1.0F, 0.0F, 1.0F, 0.0F, 0.0F, -0.5236F)); + + bodyPart.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create().texOffs(50, 1).addBox(0.0F, 0.0F, 0.0F, 0.0F, 3.0F, 6.0F), PartPose.offsetAndRotation(-3.0F, 0.0F, 1.0F, 0.0F, 0.0F, 0.5236F)); + return LayerDefinition.create(modelData, 64, 64); } - + public DragonflyEntityModel(ModelPart modelPart) { super(RenderType::entityCutout); - + model = modelPart.getChild(PartNames.BODY); head = model.getChild(PartNames.HEAD); tail = model.getChild(PartNames.TAIL); @@ -127,24 +65,24 @@ public class DragonflyEntityModel extends BlockBenchModel { legs_1 = model.getChild(PartNames.LEFT_LEG); legs_2 = model.getChild(PartNames.RIGHT_LEG); } - + @Override public void setupAnim(DragonflyEntity entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) { float progress = animationProgress * 2F; - + wing_1.zRot = 0.3491F + (float) Math.sin(progress) * 0.3491F; wing_2.zRot = -wing_1.zRot; - + wing_3.zRot = 0.3491F + (float) Math.cos(progress) * 0.3491F; wing_4.zRot = -wing_3.zRot; - + progress = animationProgress * 0.05F; - + head.xRot = 0.3491F + (float) Math.sin(progress * 0.7F) * 0.1F; tail.xRot = (float) Math.cos(progress) * 0.05F - 0.05F; tail_2.xRot = -tail.xRot * 1.5F; } - + @Override public void renderToBuffer(PoseStack matrices, VertexConsumer vertices, int light, int overlay, float red, float green, float blue, float alpha) { model.render(matrices, vertices, light, overlay); diff --git a/src/main/java/ru/betterend/entity/model/EndFishEntityModel.java b/src/main/java/ru/betterend/entity/model/EndFishEntityModel.java index 8a4860e3..bb2902e1 100644 --- a/src/main/java/ru/betterend/entity/model/EndFishEntityModel.java +++ b/src/main/java/ru/betterend/entity/model/EndFishEntityModel.java @@ -19,66 +19,29 @@ public class EndFishEntityModel extends BlockBenchModel { private final ModelPart flipper; private final ModelPart fin_right; private final ModelPart fin_left; - + public static LayerDefinition getTexturedModelData() { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - - PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox(-1.0F, -2.0F, -4.0F, 2.0F, 4.0F, 8.0F), - PartPose.offset(0.0F, 20.0F, 0.0F) - ); - - bodyPart.addOrReplaceChild(PartNames.TOP_FIN, - CubeListBuilder - .create() - .texOffs(0, 6) - .addBox(0.0F, -8.0F, 0.0F, 0.0F, 8.0F, 6.0F), - PartPose.offsetAndRotation(0.0F, -2.0F, -4.0F, -0.6981F, 0.0F, 0.0F) - ); - - bodyPart.addOrReplaceChild(PartNames.BOTTOM_FIN, - CubeListBuilder - .create() - .texOffs(0, 6) - .addBox(0.0F, 0.0F, 0.0F, 0.0F, 8.0F, 6.0F), - PartPose.offsetAndRotation(0.0F, 2.0F, -4.0F, 0.6981F, 0.0F, 0.0F) - ); - - bodyPart.addOrReplaceChild(PartNames.TAIL_FIN, - CubeListBuilder - .create() - .texOffs(0, 15) - .addBox(0.0F, -5.0F, 0.0F, 0.0F, 5.0F, 5.0F), - PartPose.offsetAndRotation(0.0F, 0.0F, 2.0F, -0.7854F, 0.0F, 0.0F) - ); - - bodyPart.addOrReplaceChild(PartNames.RIGHT_FIN, - CubeListBuilder - .create() - .texOffs(0, 25) - .addBox(-3.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F), - PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, 0.7854F, 0.0F) - ); - - bodyPart.addOrReplaceChild(PartNames.LEFT_FIN, - CubeListBuilder - .create() - .mirror() - .texOffs(0, 25) - .addBox(0.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F), - PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, -0.7854F, 0.0F) - ); - + + PartDefinition bodyPart = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 0).addBox(-1.0F, -2.0F, -4.0F, 2.0F, 4.0F, 8.0F), PartPose.offset(0.0F, 20.0F, 0.0F)); + + bodyPart.addOrReplaceChild(PartNames.TOP_FIN, CubeListBuilder.create().texOffs(0, 6).addBox(0.0F, -8.0F, 0.0F, 0.0F, 8.0F, 6.0F), PartPose.offsetAndRotation(0.0F, -2.0F, -4.0F, -0.6981F, 0.0F, 0.0F)); + + bodyPart.addOrReplaceChild(PartNames.BOTTOM_FIN, CubeListBuilder.create().texOffs(0, 6).addBox(0.0F, 0.0F, 0.0F, 0.0F, 8.0F, 6.0F), PartPose.offsetAndRotation(0.0F, 2.0F, -4.0F, 0.6981F, 0.0F, 0.0F)); + + bodyPart.addOrReplaceChild(PartNames.TAIL_FIN, CubeListBuilder.create().texOffs(0, 15).addBox(0.0F, -5.0F, 0.0F, 0.0F, 5.0F, 5.0F), PartPose.offsetAndRotation(0.0F, 0.0F, 2.0F, -0.7854F, 0.0F, 0.0F)); + + bodyPart.addOrReplaceChild(PartNames.RIGHT_FIN, CubeListBuilder.create().texOffs(0, 25).addBox(-3.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F), PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, 0.7854F, 0.0F)); + + bodyPart.addOrReplaceChild(PartNames.LEFT_FIN, CubeListBuilder.create().mirror().texOffs(0, 25).addBox(0.7071F, 0.7071F, -1.5F, 3.0F, 0.0F, 3.0F), PartPose.offsetAndRotation(-1.0F, 0.0F, -1.0F, 1.5708F, -0.7854F, 0.0F)); + return LayerDefinition.create(modelData, 32, 32); } - + public EndFishEntityModel(ModelPart modelPart) { super(RenderType::entityCutout); - + model = modelPart.getChild(PartNames.BODY); fin_top = model.getChild(PartNames.TOP_FIN); fin_bottom = model.getChild(PartNames.BOTTOM_FIN); @@ -86,7 +49,7 @@ public class EndFishEntityModel extends BlockBenchModel { fin_right = model.getChild(PartNames.RIGHT_FIN); fin_left = model.getChild(PartNames.LEFT_FIN); } - + @Override public void setupAnim(EndFishEntity entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) { float s1 = (float) Math.sin(animationProgress * 0.1); @@ -97,7 +60,7 @@ public class EndFishEntityModel extends BlockBenchModel { fin_left.yRot = s1 * 0.3F - 0.7854F; fin_right.yRot = 0.7854F - s1 * 0.3F; } - + @Override public void renderToBuffer(PoseStack matrices, VertexConsumer vertices, int light, int overlay, float red, float green, float blue, float alpha) { model.render(matrices, vertices, light, overlay); diff --git a/src/main/java/ru/betterend/entity/model/EndSlimeEntityModel.java b/src/main/java/ru/betterend/entity/model/EndSlimeEntityModel.java index 3fda3e2b..8ef508cc 100644 --- a/src/main/java/ru/betterend/entity/model/EndSlimeEntityModel.java +++ b/src/main/java/ru/betterend/entity/model/EndSlimeEntityModel.java @@ -24,91 +24,53 @@ public class EndSlimeEntityModel extends ListModel private final ModelPart mouth; private final ModelPart flower; private final ModelPart crop; - + public static LayerDefinition getShellOnlyTexturedModelData() { return getTexturedModelData(true); } - + public static LayerDefinition getCompleteTexturedModelData() { return getTexturedModelData(false); } - + private static LayerDefinition getTexturedModelData(boolean onlyShell) { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - + if (onlyShell) { - modelPartData.addOrReplaceChild(PartNames.BODY, - CubeListBuilder - .create() - .texOffs(0, 0) - .addBox(-4.0F, 16.0F, -4.0F, 8.0F, 8.0F, 8.0F), - PartPose.ZERO - ); + modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 0).addBox(-4.0F, 16.0F, -4.0F, 8.0F, 8.0F, 8.0F), PartPose.ZERO); } else { - modelPartData.addOrReplaceChild(PartNames.BODY, - CubeListBuilder - .create() - .texOffs(0, 16) - .addBox(-3.0F, 17.0F, -3.0F, 6.0F, 6.0F, 6.0F), - PartPose.ZERO - ); - - modelPartData.addOrReplaceChild(PartNames.RIGHT_EYE, - CubeListBuilder - .create() - .texOffs(32, 0) - .addBox(-3.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F), - PartPose.ZERO - ); - - modelPartData.addOrReplaceChild(PartNames.LEFT_EYE, - CubeListBuilder - .create() - .texOffs(32, 4) - .addBox(1.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F), - PartPose.ZERO - ); - - modelPartData.addOrReplaceChild(PartNames.MOUTH, - CubeListBuilder - .create() - .texOffs(32, 8) - .addBox(0.0F, 21.0F, -3.5F, 1.0F, 1.0F, 1.0F), - PartPose.ZERO - ); - + modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(0, 16).addBox(-3.0F, 17.0F, -3.0F, 6.0F, 6.0F, 6.0F), PartPose.ZERO); + + modelPartData.addOrReplaceChild(PartNames.RIGHT_EYE, CubeListBuilder.create().texOffs(32, 0).addBox(-3.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F), PartPose.ZERO); + + modelPartData.addOrReplaceChild(PartNames.LEFT_EYE, CubeListBuilder.create().texOffs(32, 4).addBox(1.25F, 18.0F, -3.5F, 2.0F, 2.0F, 2.0F), PartPose.ZERO); + + modelPartData.addOrReplaceChild(PartNames.MOUTH, CubeListBuilder.create().texOffs(32, 8).addBox(0.0F, 21.0F, -3.5F, 1.0F, 1.0F, 1.0F), PartPose.ZERO); + PartDefinition flowerPart = modelPartData.addOrReplaceChild("flower", CubeListBuilder.create(), PartPose.ZERO); PartDefinition cropPart = modelPartData.addOrReplaceChild("crop", CubeListBuilder.create(), PartPose.ZERO); - + for (int i = 0; i < 6; i++) { final PartDefinition parent = i < 4 ? flowerPart : cropPart; final float rot = MHelper.degreesToRadians(i < 4 ? (i * 45F) : ((i - 4) * 90F + 45F)); - - PartDefinition petalRotPart = parent.addOrReplaceChild("petalRot_" + i, - CubeListBuilder.create(), - PartPose.offsetAndRotation(0, 0, 0, 0, rot, 0)); - - - petalRotPart.addOrReplaceChild("petal_" + i, - CubeListBuilder - .create() - .texOffs(40, 0) - .addBox(0.0F, 0.0F, 0.0F, 8.0F, 8.0F, 0.0F), - PartPose.offset(-4, 8, 0) - ); + + PartDefinition petalRotPart = parent.addOrReplaceChild("petalRot_" + i, CubeListBuilder.create(), PartPose.offsetAndRotation(0, 0, 0, 0, rot, 0)); + + + petalRotPart.addOrReplaceChild("petal_" + i, CubeListBuilder.create().texOffs(40, 0).addBox(0.0F, 0.0F, 0.0F, 8.0F, 8.0F, 0.0F), PartPose.offset(-4, 8, 0)); } } - + return LayerDefinition.create(modelData, 64, 32); } - + public EndSlimeEntityModel(EntityModelSet modelSet, boolean onlyShell) { super(RenderType::entityCutout); - + ModelPart modelPart = modelSet.bakeLayer(onlyShell ? EndEntitiesRenders.END_SLIME_SHELL_MODEL : EndEntitiesRenders.END_SLIME_MODEL); - + innerCube = modelPart.getChild(PartNames.BODY); if (!onlyShell) { rightEye = modelPart.getChild(PartNames.RIGHT_EYE); @@ -125,23 +87,23 @@ public class EndSlimeEntityModel extends ListModel crop = null; } } - + @Override public void setupAnim(T entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) { } - + public void renderFlower(PoseStack matrices, VertexConsumer vertices, int light, int overlay) { flower.render(matrices, vertices, light, overlay); } - + public void renderCrop(PoseStack matrices, VertexConsumer vertices, int light, int overlay) { crop.render(matrices, vertices, light, overlay); } - + private boolean isOnlyShell() { return rightEye == null; } - + @Override public Iterable parts() { if (isOnlyShell()) { diff --git a/src/main/java/ru/betterend/entity/model/SilkMothEntityModel.java b/src/main/java/ru/betterend/entity/model/SilkMothEntityModel.java index c0f156b8..47423a00 100644 --- a/src/main/java/ru/betterend/entity/model/SilkMothEntityModel.java +++ b/src/main/java/ru/betterend/entity/model/SilkMothEntityModel.java @@ -29,136 +29,47 @@ public class SilkMothEntityModel extends BlockBenchModel { private final ModelPart wingR_r1; private final ModelPart wingL_r1; private final ModelPart abdomen_r1; - + public static LayerDefinition getTexturedModelData() { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - - PartDefinition legsL = modelPartData.addOrReplaceChild(PartNames.LEFT_LEG, - CubeListBuilder - .create() - .texOffs(0, 0), - PartPose.offsetAndRotation(1.5f, 19.9f, -0.45f, 0.0f, 0.0f, 0.6981f) - ); - - legsL.addOrReplaceChild("cube_r1", - CubeListBuilder - .create() - .texOffs(0, 13) - .addBox(0.0216f, 0.0f, -0.5976f, 3.0f, 0.0f, 1.0f), - PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f) - ); - - legsL.addOrReplaceChild("cube_r2", - CubeListBuilder - .create() - .texOffs(0, 15) - .addBox(0.0f, 0.0f, -0.6f, 3.0f, 0.0f, 1.0f), - PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f) - ); - - legsL.addOrReplaceChild("cube_r3", - CubeListBuilder - .create() - .texOffs(0, 14) - .addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f), - PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f) - ); - - PartDefinition legsR = modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG, - CubeListBuilder - .create() - .texOffs(0, 0), - PartPose.offsetAndRotation(-1.5f, 19.9f, -0.55f, 0.0f, 3.1416f, -0.6545f) - ); - - legsR.addOrReplaceChild("cube_r4", - CubeListBuilder - .create() - .texOffs(0, 10) - .addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f), - PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f) - ); - - legsR.addOrReplaceChild("cube_r5", - CubeListBuilder - .create() - .texOffs(0, 11) - .addBox(0.0f, 0.0f, -0.4f, 3.0f, 0.0f, 1.0f), - PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f) - ); - - legsR.addOrReplaceChild("cube_r6", - CubeListBuilder - .create() - .texOffs(0, 12) - .addBox(0.0216f, 0.0f, -0.4024f, 3.0f, 0.0f, 1.0f), - PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f) - ); - - PartDefinition head_pivot = modelPartData.addOrReplaceChild(PartNames.HEAD, - CubeListBuilder - .create() - .texOffs(15, 10) - .addBox(-1.5f, -1.5f, -2.0f, 3.0f, 3.0f, 3.0f), - PartPose.offset(0.0f, 18.0f, -3.0f) - ); - - head_pivot.addOrReplaceChild("tendril_r_r1", - CubeListBuilder - .create() - .mirror() - .texOffs(23, 0) - .addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f), - PartPose.offsetAndRotation(1.0f, -1.15f, -1.0f, 0.0f, 0.0f, 0.3927f) - ); - - head_pivot.addOrReplaceChild("tendril_r_r2", - CubeListBuilder - .create() - .texOffs(23, 0) - .addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f), - PartPose.offsetAndRotation(-1.0f, -1.15f, -1.0f, 0.0f, 0.0f, -0.3927f) - ); - - PartDefinition bb_main = modelPartData.addOrReplaceChild(PartNames.BODY, - CubeListBuilder - .create() - .texOffs(19, 19) - .addBox(-2.5f, -8.5f, -3.0f, 5.0f, 5.0f, 3.0f), - PartPose.offset(0.0f, 24.0f, 0.0f) - ); - - bb_main.addOrReplaceChild(PartNames.RIGHT_WING, - CubeListBuilder.create() - .mirror() - .texOffs(0, 5) - .addBox(-7.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f), - PartPose.offsetAndRotation(-1.5f, -6.5f, 0.5f, 0.0f, 0.0f, 0.3927f) - ); - - bb_main.addOrReplaceChild(PartNames.LEFT_WING, - CubeListBuilder - .create() - .texOffs(0, 5) - .addBox(-2.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f), - PartPose.offsetAndRotation(1.5f, -6.5f, 0.5f, 0.0f, 0.0f, -0.3927f) - ); - - bb_main.addOrReplaceChild("abdomen_r1", - CubeListBuilder - .create() - .texOffs(0, 10) - .addBox(-3.0f, -4.0f, -1.0f, 4.0f, 4.0f, 7.0f), - PartPose.offsetAndRotation(1.0f, -3.9f, 0.0f, -0.3927f, 0.0f, 0.0f) - ); - + + PartDefinition legsL = modelPartData.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create().texOffs(0, 0), PartPose.offsetAndRotation(1.5f, 19.9f, -0.45f, 0.0f, 0.0f, 0.6981f)); + + legsL.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(0, 13).addBox(0.0216f, 0.0f, -0.5976f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f)); + + legsL.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(0, 15).addBox(0.0f, 0.0f, -0.6f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f)); + + legsL.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(0, 14).addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f)); + + PartDefinition legsR = modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create().texOffs(0, 0), PartPose.offsetAndRotation(-1.5f, 19.9f, -0.55f, 0.0f, 3.1416f, -0.6545f)); + + legsR.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(0, 10).addBox(0.0f, 0.0f, -0.5f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, -1.0f, 0.0f, 0.2182f, 0.3927f)); + + legsR.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(0, 11).addBox(0.0f, 0.0f, -0.4f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.5f, 0.1f, -0.05f, 0.0f, 0.0f, 0.3927f)); + + legsR.addOrReplaceChild("cube_r6", CubeListBuilder.create().texOffs(0, 12).addBox(0.0216f, 0.0f, -0.4024f, 3.0f, 0.0f, 1.0f), PartPose.offsetAndRotation(0.0f, 0.0f, 0.9f, 0.0f, -0.2182f, 0.3927f)); + + PartDefinition head_pivot = modelPartData.addOrReplaceChild(PartNames.HEAD, CubeListBuilder.create().texOffs(15, 10).addBox(-1.5f, -1.5f, -2.0f, 3.0f, 3.0f, 3.0f), PartPose.offset(0.0f, 18.0f, -3.0f)); + + head_pivot.addOrReplaceChild("tendril_r_r1", CubeListBuilder.create().mirror().texOffs(23, 0).addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f), PartPose.offsetAndRotation(1.0f, -1.15f, -1.0f, 0.0f, 0.0f, 0.3927f)); + + head_pivot.addOrReplaceChild("tendril_r_r2", CubeListBuilder.create().texOffs(23, 0).addBox(-1.5f, -5.0f, 0.0f, 3.0f, 5.0f, 0.0f), PartPose.offsetAndRotation(-1.0f, -1.15f, -1.0f, 0.0f, 0.0f, -0.3927f)); + + PartDefinition bb_main = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(19, 19).addBox(-2.5f, -8.5f, -3.0f, 5.0f, 5.0f, 3.0f), PartPose.offset(0.0f, 24.0f, 0.0f)); + + bb_main.addOrReplaceChild(PartNames.RIGHT_WING, CubeListBuilder.create().mirror().texOffs(0, 5).addBox(-7.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f), PartPose.offsetAndRotation(-1.5f, -6.5f, 0.5f, 0.0f, 0.0f, 0.3927f)); + + bb_main.addOrReplaceChild(PartNames.LEFT_WING, CubeListBuilder.create().texOffs(0, 5).addBox(-2.0f, 0.0f, -3.0f, 9.0f, 0.0f, 5.0f), PartPose.offsetAndRotation(1.5f, -6.5f, 0.5f, 0.0f, 0.0f, -0.3927f)); + + bb_main.addOrReplaceChild("abdomen_r1", CubeListBuilder.create().texOffs(0, 10).addBox(-3.0f, -4.0f, -1.0f, 4.0f, 4.0f, 7.0f), PartPose.offsetAndRotation(1.0f, -3.9f, 0.0f, -0.3927f, 0.0f, 0.0f)); + return LayerDefinition.create(modelData, 64, 64); } - + public SilkMothEntityModel(ModelPart modelPart) { super(RenderType::entityCutout); - + legsL = modelPart.getChild(PartNames.LEFT_LEG); cube_r1 = legsL.getChild("cube_r1"); cube_r2 = legsL.getChild("cube_r2"); @@ -175,7 +86,7 @@ public class SilkMothEntityModel extends BlockBenchModel { wingL_r1 = bb_main.getChild(PartNames.LEFT_WING); abdomen_r1 = bb_main.getChild("abdomen_r1"); } - + @Override public void setupAnim(SilkMothEntity entity, float limbAngle, float limbDistance, float animationProgress, float headYaw, float headPitch) { wingR_r1.zRot = Mth.sin(animationProgress * 2F) * 0.4F + 0.3927F; @@ -187,7 +98,7 @@ public class SilkMothEntityModel extends BlockBenchModel { legsR.zRot = Mth.sin(animationProgress * 0.07F) * 0.1F - 0.6545F; legsL.zRot = -legsR.zRot; } - + @Override public void renderToBuffer(PoseStack matrices, VertexConsumer vertices, int light, int overlay, float red, float green, float blue, float alpha) { bb_main.render(matrices, vertices, light, overlay); diff --git a/src/main/java/ru/betterend/entity/render/RendererEntityCubozoa.java b/src/main/java/ru/betterend/entity/render/RendererEntityCubozoa.java index e04d4082..33ccebc1 100644 --- a/src/main/java/ru/betterend/entity/render/RendererEntityCubozoa.java +++ b/src/main/java/ru/betterend/entity/render/RendererEntityCubozoa.java @@ -17,7 +17,7 @@ import ru.betterend.registry.EndEntitiesRenders; public class RendererEntityCubozoa extends MobRenderer { private static final ResourceLocation[] TEXTURE = new ResourceLocation[2]; private static final RenderType[] GLOW = new RenderType[2]; - + public RendererEntityCubozoa(EntityRendererProvider.Context ctx) { super(ctx, new CubozoaEntityModel(ctx.bakeLayer(EndEntitiesRenders.CUBOZOA_MODEL)), 0.5f); this.addLayer(new EyesLayer(this) { @@ -25,7 +25,7 @@ public class RendererEntityCubozoa extends MobRenderer { private static final ResourceLocation TEXTURE = BetterEnd.makeID("textures/entity/dragonfly.png"); private static final RenderType GLOW = RenderType.eyes(BetterEnd.makeID("textures/entity/dragonfly_glow.png")); - + public RendererEntityDragonfly(EntityRendererProvider.Context ctx) { super(ctx, new DragonflyEntityModel(ctx.bakeLayer(EndEntitiesRenders.DRAGONFLY_MODEL)), 0.5f); this.addLayer(new EyesLayer(this) { @@ -23,7 +23,7 @@ public class RendererEntityDragonfly extends MobRenderer { private static final ResourceLocation[] TEXTURE = new ResourceLocation[EndFishEntity.VARIANTS]; private static final RenderType[] GLOW = new RenderType[EndFishEntity.VARIANTS]; - + public RendererEntityEndFish(EntityRendererProvider.Context ctx) { super(ctx, new EndFishEntityModel(ctx.bakeLayer(EndEntitiesRenders.END_FISH_MODEL)), 0.5f); this.addLayer(new EyesLayer(this) { @@ -25,29 +25,26 @@ public class RendererEntityEndFish extends MobRenderer> { private static final ResourceLocation TEXTURE[] = new ResourceLocation[4]; private static final RenderType GLOW[] = new RenderType[4]; - + public RendererEntityEndSlime(EntityRendererProvider.Context ctx) { super(ctx, new EndSlimeEntityModel<>(ctx.getModelSet(), false), 0.25f); this.addLayer(new OverlayFeatureRenderer(this, ctx)); @@ -29,33 +29,29 @@ public class RendererEntityEndSlime extends MobRenderer - extends RenderLayer> { + + private final class OverlayFeatureRenderer extends RenderLayer> { private final EndSlimeEntityModel modelOrdinal; private final EndSlimeEntityModel modelLake; - + public OverlayFeatureRenderer(RenderLayerParent> featureRendererContext, EntityRendererProvider.Context ctx) { super(featureRendererContext); modelOrdinal = new EndSlimeEntityModel<>(ctx.getModelSet(), true); modelLake = new EndSlimeEntityModel<>(ctx.getModelSet(), true); } - - public void render(PoseStack matrixStack, MultiBufferSource vertexConsumerProvider, int i, T livingEntity, - float f, float g, float h, float j, float k, float l) { + + public void render(PoseStack matrixStack, MultiBufferSource vertexConsumerProvider, int i, T livingEntity, float f, float g, float h, float j, float k, float l) { if (!livingEntity.isInvisible()) { if (livingEntity.isLake()) { - VertexConsumer vertexConsumer = vertexConsumerProvider - .getBuffer(RenderType.entityCutout(this.getTextureLocation(livingEntity))); - this.getParentModel().renderFlower(matrixStack, vertexConsumer, i, - LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F)); + VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderType.entityCutout(this.getTextureLocation(livingEntity))); + this.getParentModel().renderFlower(matrixStack, vertexConsumer, i, LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F)); } else if (livingEntity.isAmber() || livingEntity.isChorus()) { - VertexConsumer vertexConsumer = vertexConsumerProvider - .getBuffer(RenderType.entityCutout(this.getTextureLocation(livingEntity))); - this.getParentModel().renderCrop(matrixStack, vertexConsumer, i, - LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F)); + VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderType.entityCutout(this.getTextureLocation(livingEntity))); + this.getParentModel().renderCrop(matrixStack, vertexConsumer, i, LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F)); } - + EndSlimeEntityModel model = livingEntity.getSlimeType() == 1 ? modelLake : modelOrdinal; this.getParentModel().copyPropertiesTo(model); model.prepareMobModel(livingEntity, f, g, h); model.setupAnim(livingEntity, f, g, j, k, l); - VertexConsumer vertexConsumer = vertexConsumerProvider - .getBuffer(RenderType.entityTranslucent(this.getTextureLocation(livingEntity))); - model.renderToBuffer(matrixStack, vertexConsumer, i, - LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F), 1.0F, 1.0F, 1.0F, 1.0F); + VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderType.entityTranslucent(this.getTextureLocation(livingEntity))); + model.renderToBuffer(matrixStack, vertexConsumer, i, LivingEntityRenderer.getOverlayCoords(livingEntity, 0.0F), 1.0F, 1.0F, 1.0F, 1.0F); } } } - + static { TEXTURE[0] = BetterEnd.makeID("textures/entity/end_slime/end_slime.png"); TEXTURE[1] = BetterEnd.makeID("textures/entity/end_slime/end_slime_mossy.png"); diff --git a/src/main/java/ru/betterend/entity/render/RendererEntityShadowWalker.java b/src/main/java/ru/betterend/entity/render/RendererEntityShadowWalker.java index cf51c758..da3df3d6 100644 --- a/src/main/java/ru/betterend/entity/render/RendererEntityShadowWalker.java +++ b/src/main/java/ru/betterend/entity/render/RendererEntityShadowWalker.java @@ -8,15 +8,14 @@ import net.minecraft.resources.ResourceLocation; import ru.betterend.BetterEnd; import ru.betterend.entity.ShadowWalkerEntity; -public class RendererEntityShadowWalker - extends HumanoidMobRenderer> { +public class RendererEntityShadowWalker extends HumanoidMobRenderer> { private static final ResourceLocation TEXTURE = BetterEnd.makeID("textures/entity/shadow_walker.png"); - + public RendererEntityShadowWalker(EntityRendererProvider.Context ctx) { super(ctx, new PlayerModel(ctx.bakeLayer(ModelLayers.PLAYER), false), 0.5F); //super(entityRenderDispatcher, new PlayerModel(0.0F, false), 0.5F); } - + @Override public ResourceLocation getTextureLocation(ShadowWalkerEntity zombieEntity) { return TEXTURE; diff --git a/src/main/java/ru/betterend/entity/render/SilkMothEntityRenderer.java b/src/main/java/ru/betterend/entity/render/SilkMothEntityRenderer.java index 089e6e44..3ee6fed8 100644 --- a/src/main/java/ru/betterend/entity/render/SilkMothEntityRenderer.java +++ b/src/main/java/ru/betterend/entity/render/SilkMothEntityRenderer.java @@ -10,11 +10,11 @@ import ru.betterend.registry.EndEntitiesRenders; public class SilkMothEntityRenderer extends MobRenderer { private static final ResourceLocation TEXTURE = BetterEnd.makeID("textures/entity/silk_moth.png"); - + public SilkMothEntityRenderer(EntityRendererProvider.Context ctx) { super(ctx, new SilkMothEntityModel(ctx.bakeLayer(EndEntitiesRenders.SILK_MOTH_MODEL)), 0.5f); } - + @Override public ResourceLocation getTextureLocation(SilkMothEntity entity) { return TEXTURE; diff --git a/src/main/java/ru/betterend/events/ItemTooltipCallback.java b/src/main/java/ru/betterend/events/ItemTooltipCallback.java index f0a70655..e6ea2ccd 100644 --- a/src/main/java/ru/betterend/events/ItemTooltipCallback.java +++ b/src/main/java/ru/betterend/events/ItemTooltipCallback.java @@ -21,7 +21,7 @@ public interface ItemTooltipCallback { callback.getTooltip(player, stack, context, lines); } }); - + /** * Called when an item stack's tooltip is rendered. Text added to {@code lines} will be * rendered with the tooltip. diff --git a/src/main/java/ru/betterend/events/PlayerAdvancementsCallback.java b/src/main/java/ru/betterend/events/PlayerAdvancementsCallback.java index 29d0f1aa..b1ddcedd 100644 --- a/src/main/java/ru/betterend/events/PlayerAdvancementsCallback.java +++ b/src/main/java/ru/betterend/events/PlayerAdvancementsCallback.java @@ -6,12 +6,12 @@ import net.minecraft.advancements.Advancement; import net.minecraft.server.level.ServerPlayer; public interface PlayerAdvancementsCallback { - + Event PLAYER_ADVANCEMENT_COMPLETE = EventFactory.createArrayBacked(PlayerAdvancementsCallback.class, callbacks -> (player, advancement, criterionName) -> { for (PlayerAdvancementsCallback event : callbacks) { event.onAdvancementComplete(player, advancement, criterionName); } }); - + void onAdvancementComplete(ServerPlayer player, Advancement advancement, String criterionName); } diff --git a/src/main/java/ru/betterend/integration/FlamboyantRefabricatedIntegration.java b/src/main/java/ru/betterend/integration/FlamboyantRefabricatedIntegration.java index 49c56ea1..a2fa567d 100644 --- a/src/main/java/ru/betterend/integration/FlamboyantRefabricatedIntegration.java +++ b/src/main/java/ru/betterend/integration/FlamboyantRefabricatedIntegration.java @@ -15,12 +15,12 @@ public class FlamboyantRefabricatedIntegration extends ModIntegration { public FlamboyantRefabricatedIntegration() { super("flamboyant"); } - + @Override public void init() { Map colors = Maps.newHashMap(); Map dyes = Maps.newHashMap(); - + addColor("fead1d", "amber", colors, dyes); addColor("bd9a5f", "beige", colors, dyes); addColor("edeada", "cream", colors, dyes); @@ -37,15 +37,15 @@ public class FlamboyantRefabricatedIntegration extends ModIntegration { addColor("6bb1cf", "sky_blue", colors, dyes); addColor("6e8c9c", "slate_gray", colors, dyes); addColor("b02454", "violet", colors, dyes); - + new ColoredMaterial(HydraluxPetalColoredBlock::new, EndBlocks.HYDRALUX_PETAL_BLOCK, colors, dyes, true); } - + private void addColor(String hex, String name, Map colors, Map dyes) { int color = ColorUtil.color(hex); colors.put(color, name); dyes.put(color, getItem(name + "_dye")); - + System.out.println(name + " " + color + " " + new Color(color)); } } diff --git a/src/main/java/ru/betterend/integration/Integrations.java b/src/main/java/ru/betterend/integration/Integrations.java index d4a90d55..5317b1c4 100644 --- a/src/main/java/ru/betterend/integration/Integrations.java +++ b/src/main/java/ru/betterend/integration/Integrations.java @@ -18,35 +18,29 @@ public class Integrations { public static final ModIntegration BYG = ModIntegrationAPI.register(new BYGIntegration()); public static final ModIntegration NOURISH = ModIntegrationAPI.register(new NourishIntegration()); public static final ModIntegration FLAMBOYANT_REFABRICATED = ModIntegrationAPI.register(new FlamboyantRefabricatedIntegration()); - + private static boolean hasHydrogen; - + public static void init() { if (hasGuideBook()) { GuideBookItem.register(); - + PlayerAdvancementsCallback.PLAYER_ADVANCEMENT_COMPLETE.register((player, advancement, criterionName) -> { ResourceLocation advId = new ResourceLocation("minecraft:end/enter_end_gateway"); if (advId.equals(advancement.getId())) { player.addItem(new ItemStack(GuideBookItem.GUIDE_BOOK)); } }); - - GridRecipe.make(BetterEnd.MOD_ID, "guide_book", GuideBookItem.GUIDE_BOOK) - .checkConfig(Configs.RECIPE_CONFIG) - .setShape("D", "B", "C") - .addMaterial('D', EndItems.ENDER_DUST) - .addMaterial('B', Items.BOOK) - .addMaterial('C', EndItems.CRYSTAL_SHARDS) - .build(); + + GridRecipe.make(BetterEnd.MOD_ID, "guide_book", GuideBookItem.GUIDE_BOOK).checkConfig(Configs.RECIPE_CONFIG).setShape("D", "B", "C").addMaterial('D', EndItems.ENDER_DUST).addMaterial('B', Items.BOOK).addMaterial('C', EndItems.CRYSTAL_SHARDS).build(); } hasHydrogen = FabricLoader.getInstance().isModLoaded("hydrogen"); } - + public static boolean hasGuideBook() { return FabricLoader.getInstance().isModLoaded("patchouli"); } - + public static boolean hasHydrogen() { return hasHydrogen; } diff --git a/src/main/java/ru/betterend/integration/NourishIntegration.java b/src/main/java/ru/betterend/integration/NourishIntegration.java index abed1ced..fc33a470 100644 --- a/src/main/java/ru/betterend/integration/NourishIntegration.java +++ b/src/main/java/ru/betterend/integration/NourishIntegration.java @@ -10,46 +10,17 @@ public class NourishIntegration extends ModIntegration { public NourishIntegration() { super("nourish"); } - + @Override public void init() { Tag.Named fats = getItemTag("fats"); Tag.Named fruit = getItemTag("fruit"); Tag.Named protein = getItemTag("protein"); Tag.Named sweets = getItemTag("sweets"); - - TagHelper.addTag( - fats, - EndItems.END_FISH_RAW, - EndItems.END_FISH_COOKED - ); - TagHelper.addTag( - fruit, - EndItems.SHADOW_BERRY_RAW, - EndItems.SHADOW_BERRY_COOKED, - EndItems.BLOSSOM_BERRY, - EndItems.SHADOW_BERRY_JELLY, - EndItems.SWEET_BERRY_JELLY, - EndItems.BLOSSOM_BERRY_JELLY, - EndItems.AMBER_ROOT_RAW, - EndItems.CHORUS_MUSHROOM_RAW, - EndItems.CHORUS_MUSHROOM_COOKED, - EndItems.BOLUX_MUSHROOM_COOKED - ); - TagHelper.addTag( - protein, - EndItems.END_FISH_RAW, - EndItems.END_FISH_COOKED, - EndItems.CHORUS_MUSHROOM_COOKED, - EndItems.BOLUX_MUSHROOM_COOKED, - EndItems.CAVE_PUMPKIN_PIE - ); - TagHelper.addTag( - sweets, - EndItems.SHADOW_BERRY_JELLY, - EndItems.SWEET_BERRY_JELLY, - EndItems.BLOSSOM_BERRY_JELLY, - EndItems.CAVE_PUMPKIN_PIE - ); + + TagHelper.addTag(fats, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED); + TagHelper.addTag(fruit, EndItems.SHADOW_BERRY_RAW, EndItems.SHADOW_BERRY_COOKED, EndItems.BLOSSOM_BERRY, EndItems.SHADOW_BERRY_JELLY, EndItems.SWEET_BERRY_JELLY, EndItems.BLOSSOM_BERRY_JELLY, EndItems.AMBER_ROOT_RAW, EndItems.CHORUS_MUSHROOM_RAW, EndItems.CHORUS_MUSHROOM_COOKED, EndItems.BOLUX_MUSHROOM_COOKED); + TagHelper.addTag(protein, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED, EndItems.CHORUS_MUSHROOM_COOKED, EndItems.BOLUX_MUSHROOM_COOKED, EndItems.CAVE_PUMPKIN_PIE); + TagHelper.addTag(sweets, EndItems.SHADOW_BERRY_JELLY, EndItems.SWEET_BERRY_JELLY, EndItems.BLOSSOM_BERRY_JELLY, EndItems.CAVE_PUMPKIN_PIE); } } diff --git a/src/main/java/ru/betterend/integration/byg/BYGBlocks.java b/src/main/java/ru/betterend/integration/byg/BYGBlocks.java index 7107e62a..8d58b147 100644 --- a/src/main/java/ru/betterend/integration/byg/BYGBlocks.java +++ b/src/main/java/ru/betterend/integration/byg/BYGBlocks.java @@ -8,9 +8,9 @@ import ru.betterend.registry.EndBlocks; public class BYGBlocks { public static final Block IVIS_MOSS = EndBlocks.registerBlock("ivis_moss", new EndWallPlantBlock()); public static final Block NIGHTSHADE_MOSS = EndBlocks.registerBlock("nightshade_moss", new EndWallPlantBlock()); - + public static final Block IVIS_VINE = EndBlocks.registerBlock("ivis_vine", new BaseVineBlock()); - + public static void register() { } } diff --git a/src/main/java/ru/betterend/integration/byg/BYGIntegration.java b/src/main/java/ru/betterend/integration/byg/BYGIntegration.java index c9e1fbd6..e550639b 100644 --- a/src/main/java/ru/betterend/integration/byg/BYGIntegration.java +++ b/src/main/java/ru/betterend/integration/byg/BYGIntegration.java @@ -23,7 +23,7 @@ public class BYGIntegration extends ModIntegration implements EndBiomeIntegratio public BYGIntegration() { super("byg"); } - + @Override public void init() { Block block = Integrations.BYG.getBlock("ivis_phylium"); @@ -34,14 +34,14 @@ public class BYGIntegration extends ModIntegration implements EndBiomeIntegratio BYGFeatures.register(); BYGBiomes.register(); } - + @Override public void addBiomes() { BYGBiomes.addBiomes(); - + Class biomeClass = this.getClass("corgiaoc.byg.common.world.biome.BYGEndBiome"); List biomes = this.getStaticFieldValue(biomeClass, "BYG_END_BIOMES"); - + if (biomes != null && biomeClass != null) { biomes.forEach((obj) -> { Biome biome = this.getAndExecuteRuntime(biomeClass, obj, "getBiome"); diff --git a/src/main/java/ru/betterend/integration/byg/biomes/BYGBiomes.java b/src/main/java/ru/betterend/integration/byg/biomes/BYGBiomes.java index 06bc218e..013afbe9 100644 --- a/src/main/java/ru/betterend/integration/byg/biomes/BYGBiomes.java +++ b/src/main/java/ru/betterend/integration/byg/biomes/BYGBiomes.java @@ -9,11 +9,11 @@ public class BYGBiomes { public static final EndBiome OLD_BULBIS_GARDENS = EndBiomes.registerSubBiomeIntegration(new OldBulbisGardens()); public static final EndBiome NIGHTSHADE_REDWOODS = EndBiomes.registerSubBiomeIntegration(new NightshadeRedwoods()); //public static final EndBiome ETHERIAL_GROVE = EndBiomes.registerSubBiomeIntegration(new EterialGrove()); - + public static void register() { System.out.println("Registered " + OLD_BULBIS_GARDENS); } - + public static void addBiomes() { EndBiomes.addSubBiomeIntegration(OLD_BULBIS_GARDENS, Integrations.BYG.getID("bulbis_gardens")); EndBiomes.addSubBiomeIntegration(NIGHTSHADE_REDWOODS, Integrations.BYG.getID("nightshade_forest")); diff --git a/src/main/java/ru/betterend/integration/byg/biomes/NightshadeRedwoods.java b/src/main/java/ru/betterend/integration/byg/biomes/NightshadeRedwoods.java index e99863a3..2b677885 100644 --- a/src/main/java/ru/betterend/integration/byg/biomes/NightshadeRedwoods.java +++ b/src/main/java/ru/betterend/integration/byg/biomes/NightshadeRedwoods.java @@ -21,25 +21,13 @@ public class NightshadeRedwoods extends EndBiome { public NightshadeRedwoods() { super(makeDef()); } - + private static BCLBiomeDef makeDef() { Biome biome = Integrations.BYG.getBiome("nightshade_forest"); BiomeSpecialEffects effects = biome.getSpecialEffects(); - - BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods")) - .setFogColor(140, 108, 47) - .setFogDensity(1.5F) - .setWaterAndFogColor(55, 70, 186) - .setFoliageColor(122, 17, 155) - .setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F) - .setSurface(biome.getGenerationSettings().getSurfaceBuilder().get()) - .setGrassColor(48, 13, 89) - .setPlantsColor(200, 125, 9) - .addFeature(EndFeatures.END_LAKE_RARE) - .addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE) - .addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD) - .addFeature(BYGFeatures.NIGHTSHADE_MOSS); - + + BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods")).setFogColor(140, 108, 47).setFogDensity(1.5F).setWaterAndFogColor(55, 70, 186).setFoliageColor(122, 17, 155).setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F).setSurface(biome.getGenerationSettings().getSurfaceBuilder().get()).setGrassColor(48, 13, 89).setPlantsColor(200, 125, 9).addFeature(EndFeatures.END_LAKE_RARE).addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE).addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD).addFeature(BYGFeatures.NIGHTSHADE_MOSS); + if (BCLib.isClient()) { SoundEvent loop = effects.getAmbientLoopSoundEvent().get(); SoundEvent music = effects.getBackgroundMusic().get().getEvent(); @@ -52,14 +40,14 @@ public class NightshadeRedwoods extends EndBiome { def.addFeature(Decoration.VEGETAL_DECORATION, feature.get()); }); }); - + for (MobCategory group : MobCategory.values()) { List list = biome.getMobSettings().getMobs(group).unwrap(); list.forEach((entry) -> { def.addMobSpawn(entry); }); } - + return def; } } diff --git a/src/main/java/ru/betterend/integration/byg/biomes/OldBulbisGardens.java b/src/main/java/ru/betterend/integration/byg/biomes/OldBulbisGardens.java index 04b11ddd..03e5bfcd 100644 --- a/src/main/java/ru/betterend/integration/byg/biomes/OldBulbisGardens.java +++ b/src/main/java/ru/betterend/integration/byg/biomes/OldBulbisGardens.java @@ -27,7 +27,7 @@ import java.util.function.Supplier; class FeaturesAccesor extends Features { static ConfiguredDecorator shadowHEIGHTMAP_SQUARE; - + static { shadowHEIGHTMAP_SQUARE = Decorators.HEIGHTMAP_SQUARE; } @@ -37,23 +37,15 @@ public class OldBulbisGardens extends EndBiome { public OldBulbisGardens() { super(makeDef()); } - + private static BCLBiomeDef makeDef() { Biome biome = Integrations.BYG.getBiome("bulbis_gardens"); BiomeSpecialEffects effects = biome.getSpecialEffects(); - + Block ivis = Integrations.BYG.getBlock("ivis_phylium"); Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock(); - BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens")) - .setFogColor(215, 132, 207) - .setFogDensity(1.8F) - .setWaterAndFogColor(40, 0, 56) - .setFoliageColor(122, 17, 155) - .setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F) - .setSurface(ivis, origin) - .addFeature(EndFeatures.END_LAKE_RARE) - .addFeature(BYGFeatures.OLD_BULBIS_TREE); - + BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens")).setFogColor(215, 132, 207).setFogDensity(1.8F).setWaterAndFogColor(40, 0, 56).setFoliageColor(122, 17, 155).setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F).setSurface(ivis, origin).addFeature(EndFeatures.END_LAKE_RARE).addFeature(BYGFeatures.OLD_BULBIS_TREE); + if (BCLib.isClient()) { SoundEvent loop = effects.getAmbientLoopSoundEvent().get(); SoundEvent music = effects.getBackgroundMusic().get().getEvent(); @@ -61,14 +53,14 @@ public class OldBulbisGardens extends EndBiome { SoundEvent mood = effects.getAmbientMoodSettings().get().getSoundEvent(); def.setLoop(loop).setMusic(music).setAdditions(additions).setMood(mood); } - + for (MobCategory group : MobCategory.values()) { List list = biome.getMobSettings().getMobs(group).unwrap(); list.forEach((entry) -> { def.addMobSpawn(entry); }); } - + List>>> features = biome.getGenerationSettings().features(); List>> vegetal = features.get(Decoration.VEGETAL_DECORATION.ordinal()); if (vegetal.size() > 2) { @@ -89,13 +81,9 @@ public class OldBulbisGardens extends EndBiome { def.addFeature(Decoration.VEGETAL_DECORATION, feature); } } - - def.addFeature(EndFeatures.PURPLE_POLYPORE) - .addFeature(BYGFeatures.IVIS_MOSS_WOOD) - .addFeature(BYGFeatures.IVIS_MOSS) - .addFeature(BYGFeatures.IVIS_VINE) - .addFeature(BYGFeatures.IVIS_SPROUT); - + + def.addFeature(EndFeatures.PURPLE_POLYPORE).addFeature(BYGFeatures.IVIS_MOSS_WOOD).addFeature(BYGFeatures.IVIS_MOSS).addFeature(BYGFeatures.IVIS_VINE).addFeature(BYGFeatures.IVIS_SPROUT); + return def; } } diff --git a/src/main/java/ru/betterend/integration/byg/features/BYGFeatures.java b/src/main/java/ru/betterend/integration/byg/features/BYGFeatures.java index 7d1cb873..105c8c22 100644 --- a/src/main/java/ru/betterend/integration/byg/features/BYGFeatures.java +++ b/src/main/java/ru/betterend/integration/byg/features/BYGFeatures.java @@ -19,13 +19,13 @@ public class BYGFeatures { public static final BCLFeature IVIS_MOSS_WOOD = redisterVegetation("ivis_moss_wood", new WallPlantOnLogFeature(BYGBlocks.IVIS_MOSS, 6), 15); public static final BCLFeature NIGHTSHADE_MOSS = redisterVegetation("nightshade_moss", new WallPlantFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), 2); public static final BCLFeature NIGHTSHADE_MOSS_WOOD = redisterVegetation("nightshade_moss_wood", new WallPlantOnLogFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), 8); - + public static final BCLFeature NIGHTSHADE_REDWOOD_TREE = redisterVegetation("nightshade_redwood_tree", new NightshadeRedwoodTreeFeature(), 1); public static final BCLFeature BIG_ETHER_TREE = redisterVegetation("big_ether_tree", new BigEtherTreeFeature(), 1); - + public static void register() { } - + private static BCLFeature redisterVegetation(String name, Feature feature, int density) { return BCLFeature.makeVegetationFeature(BetterEnd.makeID(name), feature, density); } diff --git a/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java b/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java index 8d6e4dab..5ef738cc 100644 --- a/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java +++ b/src/main/java/ru/betterend/integration/byg/features/BigEtherTreeFeature.java @@ -24,24 +24,22 @@ public class BigEtherTreeFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + BlockState log = Integrations.BYG.getDefaultState("ether_log"); BlockState wood = Integrations.BYG.getDefaultState("ether_wood"); Function splinePlacer = (bpos) -> { return log; }; Function replace = (state) -> { - return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) - || state.getMaterial().isReplaceable(); + return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable(); }; - + int height = MHelper.randRange(40, 60, random); List trunk = SplineHelper.makeSpline(0, 0, 0, 0, height, 0, height / 4); SplineHelper.offsetParts(trunk, random, 2F, 0, 2F); SDF sdf = SplineHelper.buildSDF(trunk, 2.3F, 0.8F, splinePlacer); - + int count = height / 15; for (int i = 1; i < count; i++) { float splinePos = (float) i / (float) count; @@ -57,22 +55,21 @@ public class BigEtherTreeFeature extends DefaultFeature { List br = SplineHelper.copySpline(branch); SplineHelper.offsetParts(br, random, 0, 1, 1); SplineHelper.rotateSpline(br, angle); - + SplineHelper.offset(br, start); SplineHelper.fillSpline(br, world, wood, pos, replace); } } - + sdf.setReplaceFunction((state) -> { - return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) - || state.getMaterial().isReplaceable(); + return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable(); }).addPostProcess((info) -> { if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) { return wood; } return info.getState(); }).fillRecursive(world, pos); - + return true; } } diff --git a/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java b/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java index dd8ba4ff..a05dd86e 100644 --- a/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java +++ b/src/main/java/ru/betterend/integration/byg/features/NightshadeRedwoodTreeFeature.java @@ -32,26 +32,24 @@ import java.util.Random; public class NightshadeRedwoodTreeFeature extends DefaultFeature { private static final List BRANCH; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + BlockState log = Integrations.BYG.getDefaultState("nightshade_log"); BlockState wood = Integrations.BYG.getDefaultState("nightshade_wood"); BlockState leaves = Integrations.BYG.getDefaultState("nightshade_leaves"); BlockState leaves_flower = Integrations.BYG.getDefaultState("flowering_nightshade_leaves"); - + Function splinePlacer = (bpos) -> { return log; }; Function replace = (state) -> { - return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) - || state.getMaterial().isReplaceable(); + return state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().isReplaceable(); }; Function post = (info) -> { if (info.getState().equals(log) && (!info.getStateUp().equals(log) || !info.getStateDown().equals(log))) { @@ -62,15 +60,15 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature { Function ignore = (state) -> { return state.equals(log) || state.equals(wood); }; - + int height = MHelper.randRange(40, 60, random); List trunk = SplineHelper.makeSpline(0, 0, 0, 0, height, 0, height / 4); SplineHelper.offsetParts(trunk, random, 0.8F, 0, 0.8F); - + if (!SplineHelper.canGenerate(trunk, pos, world, replace)) { return false; } - + int count = height >> 2; float start = trunk.size() / 3F; float delta = trunk.size() * 0.6F; @@ -89,11 +87,10 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature { SplineHelper.offset(branch, offset); SplineHelper.fillSpline(branch, world, wood, pos, replace); } - + SDF sdf = SplineHelper.buildSDF(trunk, 2.3F, 0.8F, splinePlacer); SDF roots = new SDFSphere().setRadius(2F).setBlock(log); - roots = new SDFFlatWave().setIntensity(2F).setRaysCount(MHelper.randRange(5, 7, random)) - .setAngle(random.nextFloat() * MHelper.PI2).setSource(roots); + roots = new SDFFlatWave().setIntensity(2F).setRaysCount(MHelper.randRange(5, 7, random)).setAngle(random.nextFloat() * MHelper.PI2).setSource(roots); sdf = new SDFSmoothUnion().setRadius(2F).setSourceA(sdf).setSourceB(roots); sdf.setReplaceFunction(replace).addPostProcess(post).fillRecursive(world, pos); Vector3f last = SplineHelper.getPos(trunk, trunk.size() - 1.35F); @@ -101,7 +98,7 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature { BlockPos p = pos.offset(last.x() + 0.5, last.y() + y, last.z() + 0.5); BlocksHelper.setWithoutUpdate(world, p, y == 4 ? wood : log); } - + for (int y = 0; y < 16; y++) { BlockPos p = pos.offset(last.x() + 0.5, last.y() + y, last.z() + 0.5); if (world.isEmptyBlock(p)) { @@ -123,7 +120,7 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature { } } } - + MutableBlockPos mut = new MutableBlockPos(); Function leavesPost1 = (info) -> { if (info.getState().equals(log) || info.getState().equals(wood)) { @@ -173,19 +170,17 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature { } return info.getState(); }; - + SDF canopy = new SDFCappedCone().setRadius1(12F).setRadius2(1f).setHeight(height * 0.3F).setBlock(leaves); canopy = new SDFDisplacement().setFunction((vec) -> { return MHelper.randRange(-3F, 3F, random); }).setSource(canopy); - canopy.addPostProcess(leavesPost1).addPostProcess(leavesPost2).fillRecursiveIgnore(world, - pos.offset(0, height * 0.75, 0), ignore); - + canopy.addPostProcess(leavesPost1).addPostProcess(leavesPost2).fillRecursiveIgnore(world, pos.offset(0, height * 0.75, 0), ignore); + return true; } - + static { - BRANCH = Lists.newArrayList(new Vector3f(0, 0, 0), new Vector3f(0.25F, 0.1F, 0), new Vector3f(0.40F, 0.2F, 0), - new Vector3f(0.50F, 0.4F, 0), new Vector3f(0.55F, 0.6F, 0)); + BRANCH = Lists.newArrayList(new Vector3f(0, 0, 0), new Vector3f(0.25F, 0.1F, 0), new Vector3f(0.40F, 0.2F, 0), new Vector3f(0.50F, 0.4F, 0), new Vector3f(0.55F, 0.6F, 0)); } } diff --git a/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java b/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java index 1f2b5cae..2c708bdb 100644 --- a/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java +++ b/src/main/java/ru/betterend/integration/byg/features/OldBulbisTreeFeature.java @@ -33,31 +33,27 @@ public class OldBulbisTreeFeature extends DefaultFeature { private static final List ROOT; private static final List LEAF; private static final List SIDE; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - if (!world.getBlockState(pos.below(4)).is(TagAPI.GEN_TERRAIN)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + if (!world.getBlockState(pos.below(4)).is(TagAPI.GEN_TERRAIN)) return false; + BlockState stem = Integrations.BYG.getDefaultState("bulbis_stem"); BlockState wood = Integrations.BYG.getDefaultState("bulbis_wood"); - BlockState cap = Integrations.BYG - .getDefaultState(random.nextBoolean() ? "bulbis_shell" : "purple_bulbis_shell"); + BlockState cap = Integrations.BYG.getDefaultState(random.nextBoolean() ? "bulbis_shell" : "purple_bulbis_shell"); BlockState glow = Integrations.BYG.getDefaultState("purple_shroomlight"); - + Function replacement = (state) -> { - if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.END_GROUND) - || state.getMaterial().equals(Material.PLANT)) { + if (state.equals(stem) || state.equals(wood) || state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) { return true; } return state.getMaterial().isReplaceable(); }; - + float size = MHelper.randRange(10, 20, random); float addSize = MHelper.randRange(1, 1.7F, random); float addRad = addSize * 0.5F + 0.5F; @@ -80,50 +76,48 @@ public class OldBulbisTreeFeature extends DefaultFeature { SDF branch = SplineHelper.buildSDF(spline, 2.3F * addRad, 1.3F * addRad, (bpos) -> { return stem; }); - + Vector3f vec = spline.get(spline.size() - 1); float radius = (size + MHelper.randRange(0, size * 0.5F, random)) * 0.35F; bigSphere(world, pos.offset(vec.x(), vec.y(), vec.z()), radius, cap, glow, wood, replacement, random); vec = SplineHelper.getPos(spline, 0.3F); makeRoots(world, pos.offset(vec.x(), vec.y(), vec.z()), size * 0.4F + 5, random, wood, replacement); - + sdf = (sdf == null) ? branch : new SDFUnion().setSourceA(sdf).setSourceB(branch); } - + sdf.setReplaceFunction(replacement).addPostProcess((info) -> { - if (info.getState().equals(stem) - && (!info.getStateUp().equals(stem) || !info.getStateDown().equals(stem))) { + if (info.getState().equals(stem) && (!info.getStateUp().equals(stem) || !info.getStateDown().equals(stem))) { return wood; } return info.getState(); }).fillArea(world, pos, limits); - + return true; } - - private void bigSphere(WorldGenLevel world, BlockPos pos, float radius, BlockState cap, BlockState glow, - BlockState wood, Function replacement, Random random) { + + private void bigSphere(WorldGenLevel world, BlockPos pos, float radius, BlockState cap, BlockState glow, BlockState wood, Function replacement, Random random) { OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap); - + SDF sphereInner = new SDFSphere().setRadius(radius * 0.53F).setBlock(Blocks.AIR); sphereInner = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1); }).setSource(sphereInner); - + SDF sphereGlow = new SDFSphere().setRadius(radius * 0.6F).setBlock(glow); sphereGlow = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1) * 2F; }).setSource(sphereGlow); sphereGlow = new SDFSubtraction().setSourceA(sphereGlow).setSourceB(sphereInner); - + sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sphereGlow); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sphereInner); - + float offsetY = radius * 1.7F; sphere = new SDFUnion().setSourceA(sphere).setSourceB(sphereGlow); sphere = new SDFTranslate().setTranslate(0, offsetY, 0).setSource(sphere); - + int leafCount = (int) (radius * 0.5F) + 2; for (int i = 0; i < 4; i++) { float angle = (float) i / 4 * MHelper.PI2; @@ -131,13 +125,13 @@ public class OldBulbisTreeFeature extends DefaultFeature { SplineHelper.rotateSpline(spline, angle); SplineHelper.scale(spline, radius * 1.4F); SplineHelper.fillSplineForce(spline, world, wood, pos, replacement); - + for (int j = 0; j < leafCount; j++) { float delta = ((float) j / (float) (leafCount - 1)); float scale = (float) Math.sin(delta * Math.PI) * 0.8F + 0.2F; float index = Mth.lerp(delta, 1F, 3.9F); Vector3f point = SplineHelper.getPos(spline, index); - + List side = SplineHelper.copySpline(SIDE); SplineHelper.rotateSpline(side, angle); SplineHelper.scale(side, scale * radius); @@ -145,17 +139,16 @@ public class OldBulbisTreeFeature extends DefaultFeature { SplineHelper.fillSplineForce(side, world, wood, p, replacement); } } - + sphere.fillArea(world, pos, new AABB(pos.above((int) offsetY)).inflate(radius * 1.3F)); } - - private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random, BlockState wood, - Function replacement) { + + private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random, BlockState wood, Function replacement) { int count = (int) (radius * 1.5F); for (int i = 0; i < count; i++) { float angle = (float) i / (float) count * MHelper.PI2; float scale = radius * MHelper.randRange(0.85F, 1.15F, random); - + List branch = SplineHelper.copySpline(ROOT); SplineHelper.rotateSpline(branch, angle); SplineHelper.scale(branch, scale); @@ -165,20 +158,15 @@ public class OldBulbisTreeFeature extends DefaultFeature { } } } - + static { - SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), - new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), - new Vector3f(0.50F, 1.00F, 0.00F)); - - ROOT = Lists.newArrayList(new Vector3f(0F, 1F, 0), new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), - new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); + SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F)); + + ROOT = Lists.newArrayList(new Vector3f(0F, 1F, 0), new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); - - LEAF = Lists.newArrayList(new Vector3f(0.00F, 0.0F, 0), new Vector3f(0.10F, 0.4F, 0), - new Vector3f(0.40F, 0.8F, 0), new Vector3f(0.75F, 0.9F, 0), new Vector3f(1.00F, 0.8F, 0)); - - SIDE = Lists.newArrayList(new Vector3f(0, -0.3F, -0.5F), new Vector3f(0, -0.1F, -0.3F), - new Vector3f(0, 0.0F, 0.0F), new Vector3f(0, -0.1F, 0.3F), new Vector3f(0, -0.3F, 0.5F)); + + LEAF = Lists.newArrayList(new Vector3f(0.00F, 0.0F, 0), new Vector3f(0.10F, 0.4F, 0), new Vector3f(0.40F, 0.8F, 0), new Vector3f(0.75F, 0.9F, 0), new Vector3f(1.00F, 0.8F, 0)); + + SIDE = Lists.newArrayList(new Vector3f(0, -0.3F, -0.5F), new Vector3f(0, -0.1F, -0.3F), new Vector3f(0, 0.0F, 0.0F), new Vector3f(0, -0.1F, 0.3F), new Vector3f(0, -0.3F, 0.5F)); } } diff --git a/src/main/java/ru/betterend/integration/rei/REIAlloyingCategory.java b/src/main/java/ru/betterend/integration/rei/REIAlloyingCategory.java index 369037e9..84cc097b 100644 --- a/src/main/java/ru/betterend/integration/rei/REIAlloyingCategory.java +++ b/src/main/java/ru/betterend/integration/rei/REIAlloyingCategory.java @@ -22,26 +22,26 @@ import java.util.List; public class REIAlloyingCategory implements TransferDisplayCategory { private final EntryStack ICON; - + REIAlloyingCategory(EntryStack icon) { ICON = icon; } - + @Override public @NotNull CategoryIdentifier getCategoryIdentifier() { return REIPlugin.ALLOYING; } - + @Override public @NotNull Component getTitle() { return new TranslatableComponent(EndBlocks.END_STONE_SMELTER.getDescriptionId()); } - + @Override public @NotNull EntryStack getIcon() { return ICON; } - + @Override public @NotNull List setupDisplay(REIAlloyingDisplay display, Rectangle bounds) { Point startPoint = new Point(bounds.getCenterX() - 41, bounds.y + 10); @@ -51,8 +51,7 @@ public class REIAlloyingCategory implements TransferDisplayCategory inputEntries = display.getInputEntries(); widgets.add(Widgets.createSlot(new Point(startPoint.x - 20, startPoint.y + 1)).entries(inputEntries.get(0)).markInput()); @@ -65,10 +64,9 @@ public class REIAlloyingCategory implements TransferDisplayCategory widgets, Rectangle bounds, REIAlloyingDisplay display, - IntList redSlots) { + public void renderRedSlots(PoseStack matrices, List widgets, Rectangle bounds, REIAlloyingDisplay display, IntList redSlots) { Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27); matrices.pushPose(); matrices.translate(0, 0, 400); @@ -78,7 +76,7 @@ public class REIAlloyingCategory implements TransferDisplayCategory fuel; - + private Recipe recipe; private float xp; private double smeltTime; - - + + public REIAlloyingDisplay(AlloyingRecipe recipe) { this(recipe, recipe.getExperience(), recipe.getSmeltTime()); } - + protected REIAlloyingDisplay(Recipe recipe, float xp, double smeltTime) { - super( - EntryIngredients.ofIngredients(recipe.getIngredients()), - Collections.singletonList(EntryIngredients.of(recipe.getResultItem())) - ); + super(EntryIngredients.ofIngredients(recipe.getIngredients()), Collections.singletonList(EntryIngredients.of(recipe.getResultItem()))); this.recipe = recipe; this.xp = xp; this.smeltTime = smeltTime; } - - + + public static List getFuel() { return fuel; } - + @Override public @NotNull Optional getDisplayLocation() { return Optional.ofNullable(recipe).map(Recipe::getId); } - + @Override public CategoryIdentifier getCategoryIdentifier() { return REIPlugin.ALLOYING; } - + // @Override // public @NotNull List> getRequiredEntries() { // return this.input; // } - + public float getXp() { return this.xp; } - + public double getSmeltTime() { return this.smeltTime; } - + public Optional> getOptionalRecipe() { return Optional.ofNullable(recipe); } - + @Override public int getWidth() { return 2; } - + @Override public int getHeight() { return 1; } - + // @Override // public List> getOrganisedInputEntries(ContainerInfo containerInfo, AbstractContainerMenu container) { // return this.input; // } - + static { - fuel = EndStoneSmelterBlockEntity.availableFuels().keySet().stream() - .map(Item::getDefaultInstance).map(EntryStacks::of) - .map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableComponent("category.rei.smelting.fuel") - .withStyle(ChatFormatting.YELLOW)))).collect(Collectors.toList()); + fuel = EndStoneSmelterBlockEntity.availableFuels().keySet().stream().map(Item::getDefaultInstance).map(EntryStacks::of).map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableComponent("category.rei.smelting.fuel").withStyle(ChatFormatting.YELLOW)))).collect(Collectors.toList()); } } diff --git a/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelCategory.java b/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelCategory.java index 930d3e3e..c1809eb7 100644 --- a/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelCategory.java +++ b/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelCategory.java @@ -25,60 +25,58 @@ import java.util.List; public class REIAlloyingFuelCategory implements DisplayCategory { private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#.##"); - + @Override public @NotNull CategoryIdentifier getCategoryIdentifier() { return REIPlugin.ALLOYING_FUEL; } - + @Override public @NotNull Component getTitle() { return new TranslatableComponent("category.rei.fuel"); } - + @Override public int getDisplayHeight() { return 49; } - + @Override public @NotNull EntryStack getIcon() { return EntryStacks.of(Items.COAL); } - + @Override public List setupDisplay(REIAlloyingFuelDisplay recipeDisplay, Rectangle bounds) { Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 17); String burnTime = DECIMAL_FORMAT.format(recipeDisplay.getFuelTime()); List widgets = Lists.newArrayList(); widgets.add(Widgets.createRecipeBase(bounds)); - widgets.add(Widgets.createLabel(new Point(bounds.x + 26, bounds.getMaxY() - 15), new TranslatableComponent("category.rei.fuel.time", burnTime)) - .color(0xFF404040, 0xFFBBBBBB).noShadow().leftAligned()); + widgets.add(Widgets.createLabel(new Point(bounds.x + 26, bounds.getMaxY() - 15), new TranslatableComponent("category.rei.fuel.time", burnTime)).color(0xFF404040, 0xFFBBBBBB).noShadow().leftAligned()); widgets.add(Widgets.createBurningFire(new Point(bounds.x + 6, startPoint.y + 1)).animationDurationTicks(recipeDisplay.getFuelTime())); widgets.add(Widgets.createSlot(new Point(bounds.x + 6, startPoint.y + 18)).entries(recipeDisplay.getInputEntries().get(0)).markInput()); return widgets; } - + @Override public DisplayRenderer getDisplayRenderer(REIAlloyingFuelDisplay recipe) { Slot slot = Widgets.createSlot(new Point(0, 0)).entries(recipe.getInputEntries().get(0)).disableBackground().disableHighlight(); String burnItems = DECIMAL_FORMAT.format(recipe.getFuelTime() / 200d); return new DisplayRenderer() { private TranslatableComponent text = new TranslatableComponent("category.rei.fuel.time_short.items", burnItems); - + @Override public int getHeight() { return 22; } - + @Nullable @Override public Tooltip getTooltip(Point point) { - if (slot.containsMouse(point)) - return slot.getCurrentTooltip(point); + if (slot.containsMouse(point)) return slot.getCurrentTooltip(point); return null; } - + @Override public void render(PoseStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta) { slot.setZ(getZ() + 50); diff --git a/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelDisplay.java b/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelDisplay.java index c177c5fa..eeed9804 100644 --- a/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelDisplay.java +++ b/src/main/java/ru/betterend/integration/rei/REIAlloyingFuelDisplay.java @@ -10,11 +10,11 @@ import java.util.List; public class REIAlloyingFuelDisplay extends BasicDisplay { private final int fuelTime; - + public REIAlloyingFuelDisplay(List fuel, CompoundTag tag) { this(fuel, tag.getInt("fuelTime")); } - + public REIAlloyingFuelDisplay(List fuel, int fuelTime) { super(fuel, Collections.emptyList()); this.fuelTime = fuelTime; @@ -23,14 +23,14 @@ public class REIAlloyingFuelDisplay extends BasicDisplay { this.fuel = fuel; this.fuelTime = fuelTime; }*/ - + @Override public CategoryIdentifier getCategoryIdentifier() { return REIPlugin.ALLOYING_FUEL; } - + public int getFuelTime() { return fuelTime; } - + } diff --git a/src/main/java/ru/betterend/integration/rei/REIAnvilCategory.java b/src/main/java/ru/betterend/integration/rei/REIAnvilCategory.java index 6be1b8ab..d65067ba 100644 --- a/src/main/java/ru/betterend/integration/rei/REIAnvilCategory.java +++ b/src/main/java/ru/betterend/integration/rei/REIAnvilCategory.java @@ -27,27 +27,27 @@ import java.util.stream.Collectors; public class REIAnvilCategory implements TransferDisplayCategory { private final EntryStack[] ANVILS; - + REIAnvilCategory(EntryStack[] anvils) { ANVILS = anvils; } - + @Override public @NotNull CategoryIdentifier getCategoryIdentifier() { return REIPlugin.SMITHING; } - + @Override public @NotNull Component getTitle() { return new TranslatableComponent(Blocks.ANVIL.getDescriptionId()); } - + @Override public @NotNull EntryStack getIcon() { return ANVILS[0]; } - - + + @Override public @NotNull List setupDisplay(REIAnvilDisplay display, Rectangle bounds) { Point startPoint = new Point(bounds.getCenterX() - 41, bounds.y + 10); @@ -72,19 +72,17 @@ public class REIAnvilCategory implements TransferDisplayCategory entryStack.setAmount(display.getInputCount())); widgets.add(Widgets.createArrow(new Point(x + 24, y + 4))); - widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 7, bounds.y + bounds.height - 15), - new TranslatableComponent("category.rei.damage.amount&dmg", display.getDamage())).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB)); + widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 7, bounds.y + bounds.height - 15), new TranslatableComponent("category.rei.damage.amount&dmg", display.getDamage())).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB)); widgets.add(Widgets.createSlot(new Point(x - 20, y + 4)).entries(materials).markInput()); widgets.add(Widgets.createSlot(new Point(x + 1, y + 4)).entries(inputEntries.get(0)).markInput()); widgets.add(Widgets.createSlot(new Point(x + 61, y + 5)).entries(display.getOutputEntries().get(0)).disableBackground().markOutput()); widgets.add(Widgets.createSlot(new Point(x - 9, y + 25)).entries(anvils)); - + return widgets; } - + @Override - public void renderRedSlots(PoseStack matrices, List widgets, Rectangle bounds, REIAnvilDisplay display, - IntList redSlots) { + public void renderRedSlots(PoseStack matrices, List widgets, Rectangle bounds, REIAnvilDisplay display, IntList redSlots) { Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27); matrices.pushPose(); matrices.translate(0, 0, 400); @@ -94,10 +92,10 @@ public class REIAnvilCategory implements TransferDisplayCategory getDisplayLocation() { return Optional.ofNullable(recipe).map(Recipe::getId); } - + @Override public CategoryIdentifier getCategoryIdentifier() { return REIPlugin.SMITHING; } - + // @Override // public @NotNull List> getRequiredEntries() { // return input; // } - + @Override public int getWidth() { return 2; } - + @Override public int getHeight() { return 1; } - + // @Override // public List> getOrganisedInputEntries(ContainerInfo containerInfo, // AbstractContainerMenu container) { diff --git a/src/main/java/ru/betterend/integration/rei/REIContainer.java b/src/main/java/ru/betterend/integration/rei/REIContainer.java index 47bfa4e8..5365baf4 100644 --- a/src/main/java/ru/betterend/integration/rei/REIContainer.java +++ b/src/main/java/ru/betterend/integration/rei/REIContainer.java @@ -1,7 +1,7 @@ package ru.betterend.integration.rei; public class REIContainer implements Runnable { - + @Override public void run() { //ContainerInfoHandler.registerContainerInfo(AlloyingRecipe.ID, CraftingContainerInfoWrapper.create(EndStoneSmelterScreenHandler.class)); diff --git a/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java b/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java index a390f2c3..dce30a94 100644 --- a/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java +++ b/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java @@ -22,29 +22,29 @@ import java.util.ArrayList; import java.util.List; public class REIInfusionCategory implements TransferDisplayCategory { - + private final static ResourceLocation BACKGROUND = BetterEnd.makeID("textures/gui/rei_infusion.png"); private final EntryStack ICON; - + REIInfusionCategory(EntryStack icon) { ICON = icon; } - + @Override public @NotNull CategoryIdentifier getCategoryIdentifier() { return REIPlugin.INFUSION; } - + @Override public @NotNull Component getTitle() { return new TranslatableComponent(EndBlocks.INFUSION_PEDESTAL.getDescriptionId()); } - + @Override public @NotNull EntryStack getIcon() { return ICON; } - + @Override public @NotNull List setupDisplay(REIInfusionDisplay display, Rectangle bounds) { Point centerPoint = new Point(bounds.getCenterX() - 34, bounds.getCenterY() - 2); @@ -71,23 +71,15 @@ public class REIInfusionCategory implements TransferDisplayCategory widgets, Rectangle bounds, REIInfusionDisplay display, IntList redSlots) {} } diff --git a/src/main/java/ru/betterend/integration/rei/REIInfusionDisplay.java b/src/main/java/ru/betterend/integration/rei/REIInfusionDisplay.java index 18e91a7a..a019a1b1 100644 --- a/src/main/java/ru/betterend/integration/rei/REIInfusionDisplay.java +++ b/src/main/java/ru/betterend/integration/rei/REIInfusionDisplay.java @@ -13,48 +13,45 @@ import java.util.Collections; import java.util.Optional; public class REIInfusionDisplay extends BasicDisplay implements SimpleGridMenuDisplay { - + private final InfusionRecipe recipe; private final int time; - + public REIInfusionDisplay(InfusionRecipe recipe) { - super( - EntryIngredients.ofIngredients(recipe.getIngredients()), - Collections.singletonList(EntryIngredients.of(recipe.getResultItem())) - ); + super(EntryIngredients.ofIngredients(recipe.getIngredients()), Collections.singletonList(EntryIngredients.of(recipe.getResultItem()))); this.recipe = recipe; this.time = recipe.getInfusionTime(); } - + public int getInfusionTime() { return this.time; } - + @Override public @NotNull Optional getDisplayLocation() { return Optional.ofNullable(recipe).map(Recipe::getId); } - + @Override public CategoryIdentifier getCategoryIdentifier() { return REIPlugin.INFUSION; } - + // @Override // public @NotNull List> getRequiredEntries() { // return this.input; // } - + @Override public int getWidth() { return 0; } - + @Override public int getHeight() { return 0; } - + // @Override // public List> getOrganisedInputEntries(ContainerInfo containerInfo, AbstractContainerMenu container) { // return this.input; diff --git a/src/main/java/ru/betterend/integration/rei/REIPlugin.java b/src/main/java/ru/betterend/integration/rei/REIPlugin.java index 507b9308..a273294a 100644 --- a/src/main/java/ru/betterend/integration/rei/REIPlugin.java +++ b/src/main/java/ru/betterend/integration/rei/REIPlugin.java @@ -34,39 +34,36 @@ public class REIPlugin implements REIClientPlugin { public final static CategoryIdentifier ALLOYING = CategoryIdentifier.of(BetterEnd.MOD_ID, AlloyingRecipe.GROUP); public final static CategoryIdentifier SMITHING = CategoryIdentifier.of(BetterEnd.MOD_ID, AnvilRecipe.ID.getPath()); public final static CategoryIdentifier INFUSION = CategoryIdentifier.of(BetterEnd.MOD_ID, InfusionRecipe.GROUP); - + private EntryStack END_STONE_SMELTER; private EntryStack INFUSION_RITUAL; private EntryStack[] ANVILS; private EntryStack[] FURNACES; - + void init() { //we need to initialize those variables after the static initialization //otherwise the registry does not know the BlockItems if (END_STONE_SMELTER != null) { return; } - + END_STONE_SMELTER = EntryStacks.of(EndBlocks.END_STONE_SMELTER); INFUSION_RITUAL = EntryStacks.of(EndBlocks.INFUSION_PEDESTAL); - - List anvils = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks().stream() - .filter(EndAnvilBlock.class::isInstance).collect(Collectors.toList()))); + + List anvils = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks().stream().filter(EndAnvilBlock.class::isInstance).collect(Collectors.toList()))); anvils.add(0, EntryStacks.of(Blocks.ANVIL)); ANVILS = anvils.toArray(new EntryStack[0]); - - FURNACES = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks().stream() - .filter(BaseFurnaceBlock.class::isInstance).collect(Collectors.toList()))) - .toArray(new EntryStack[0]); + + FURNACES = Lists.newArrayList(EntryIngredients.ofItems(EndBlocks.getModBlocks().stream().filter(BaseFurnaceBlock.class::isInstance).collect(Collectors.toList()))).toArray(new EntryStack[0]); } - + @Override public void registerDisplays(DisplayRegistry registry) { registry.registerRecipeFiller(AlloyingRecipe.class, AlloyingRecipe.TYPE, REIAlloyingDisplay::new); registry.registerRecipeFiller(BlastingRecipe.class, RecipeType.BLASTING, REIBlastingDisplay::new); registry.registerRecipeFiller(AnvilRecipe.class, AnvilRecipe.TYPE, REIAnvilDisplay::new); registry.registerRecipeFiller(InfusionRecipe.class, InfusionRecipe.TYPE, REIInfusionDisplay::new); - + FuelRegistryImpl.INSTANCE.getFuelTimes().forEach((item, time) -> { if (time >= 2000) { final List list = Arrays.asList(EntryIngredients.of(item)); @@ -74,25 +71,20 @@ public class REIPlugin implements REIClientPlugin { } }); } - + @Override public void registerCategories(CategoryRegistry registry) { init(); - - registry.add( - new REIAlloyingFuelCategory(), - new REIAlloyingCategory(END_STONE_SMELTER), - new REIInfusionCategory(INFUSION_RITUAL), - new REIAnvilCategory(ANVILS) - ); - + + registry.add(new REIAlloyingFuelCategory(), new REIAlloyingCategory(END_STONE_SMELTER), new REIInfusionCategory(INFUSION_RITUAL), new REIAnvilCategory(ANVILS)); + registry.addWorkstations(ALLOYING_FUEL, END_STONE_SMELTER); registry.addWorkstations(ALLOYING, END_STONE_SMELTER); registry.addWorkstations(INFUSION, INFUSION_RITUAL); registry.addWorkstations(SMITHING, ANVILS); registry.removePlusButton(ALLOYING_FUEL); registry.removePlusButton(SMITHING); - + registry.addWorkstations(DefaultPlugin.SMELTING, FURNACES); registry.addWorkstations(DefaultPlugin.FUEL, FURNACES); } diff --git a/src/main/java/ru/betterend/interfaces/AnvilScreenHandlerExtended.java b/src/main/java/ru/betterend/interfaces/AnvilScreenHandlerExtended.java index 33a02de5..24454bdf 100644 --- a/src/main/java/ru/betterend/interfaces/AnvilScreenHandlerExtended.java +++ b/src/main/java/ru/betterend/interfaces/AnvilScreenHandlerExtended.java @@ -6,11 +6,11 @@ import java.util.List; public interface AnvilScreenHandlerExtended { void be_updateCurrentRecipe(AnvilRecipe recipe); - + AnvilRecipe be_getCurrentRecipe(); - + List be_getRecipes(); - + default void be_nextRecipe() { List recipes = be_getRecipes(); if (recipes.size() < 2) return; @@ -21,7 +21,7 @@ public interface AnvilScreenHandlerExtended { } be_updateCurrentRecipe(recipes.get(i)); } - + default void be_previousRecipe() { List recipes = be_getRecipes(); if (recipes.size() < 2) return; diff --git a/src/main/java/ru/betterend/interfaces/BetterEndRecipe.java b/src/main/java/ru/betterend/interfaces/BetterEndRecipe.java index d75eeaae..9f939661 100644 --- a/src/main/java/ru/betterend/interfaces/BetterEndRecipe.java +++ b/src/main/java/ru/betterend/interfaces/BetterEndRecipe.java @@ -1,4 +1,3 @@ package ru.betterend.interfaces; -public interface BetterEndRecipe { -} +public interface BetterEndRecipe {} diff --git a/src/main/java/ru/betterend/interfaces/FallFlyingItem.java b/src/main/java/ru/betterend/interfaces/FallFlyingItem.java index ea1451f2..fbb6bc0a 100644 --- a/src/main/java/ru/betterend/interfaces/FallFlyingItem.java +++ b/src/main/java/ru/betterend/interfaces/FallFlyingItem.java @@ -4,6 +4,6 @@ import net.minecraft.resources.ResourceLocation; public interface FallFlyingItem { ResourceLocation getModelTexture(); - + double getMovementFactor(); } diff --git a/src/main/java/ru/betterend/interfaces/ISlime.java b/src/main/java/ru/betterend/interfaces/ISlime.java index af7cb878..feb05e07 100644 --- a/src/main/java/ru/betterend/interfaces/ISlime.java +++ b/src/main/java/ru/betterend/interfaces/ISlime.java @@ -4,6 +4,6 @@ import net.minecraft.world.entity.Entity; public interface ISlime { public void be_setSlimeSize(int size, boolean heal); - + void entityRemove(Entity.RemovalReason removalReason); } diff --git a/src/main/java/ru/betterend/interfaces/MultiModelItem.java b/src/main/java/ru/betterend/interfaces/MultiModelItem.java index a486db0a..097f2ae4 100644 --- a/src/main/java/ru/betterend/interfaces/MultiModelItem.java +++ b/src/main/java/ru/betterend/interfaces/MultiModelItem.java @@ -8,7 +8,7 @@ import ru.betterend.registry.EndItems; public interface MultiModelItem { @Environment(EnvType.CLIENT) void registerModelPredicate(); - + static void register() { EndItems.getModItems(BetterEnd.MOD_ID).forEach(item -> { if (item instanceof MultiModelItem) { diff --git a/src/main/java/ru/betterend/interfaces/PottablePlant.java b/src/main/java/ru/betterend/interfaces/PottablePlant.java new file mode 100644 index 00000000..8cff20ae --- /dev/null +++ b/src/main/java/ru/betterend/interfaces/PottablePlant.java @@ -0,0 +1,18 @@ +package ru.betterend.interfaces; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.world.level.block.Block; + +public interface PottablePlant { + boolean canPlantOn(Block block); + + default boolean addToPot() { + return true; + } + + @Environment(EnvType.CLIENT) + default String getPottedState() { + return ""; + } +} diff --git a/src/main/java/ru/betterend/interfaces/PottableTerrain.java b/src/main/java/ru/betterend/interfaces/PottableTerrain.java new file mode 100644 index 00000000..9f034393 --- /dev/null +++ b/src/main/java/ru/betterend/interfaces/PottableTerrain.java @@ -0,0 +1,3 @@ +package ru.betterend.interfaces; + +public interface PottableTerrain {} diff --git a/src/main/java/ru/betterend/interfaces/TeleportingEntity.java b/src/main/java/ru/betterend/interfaces/TeleportingEntity.java index 40b20dda..803cf507 100644 --- a/src/main/java/ru/betterend/interfaces/TeleportingEntity.java +++ b/src/main/java/ru/betterend/interfaces/TeleportingEntity.java @@ -4,8 +4,8 @@ import net.minecraft.core.BlockPos; public interface TeleportingEntity { void be_setExitPos(BlockPos pos); - + void be_resetExitPos(); - + boolean be_canTeleport(); } diff --git a/src/main/java/ru/betterend/item/ArmoredElytra.java b/src/main/java/ru/betterend/item/ArmoredElytra.java index 1e163318..8a650154 100644 --- a/src/main/java/ru/betterend/item/ArmoredElytra.java +++ b/src/main/java/ru/betterend/item/ArmoredElytra.java @@ -19,58 +19,53 @@ import ru.betterend.interfaces.MultiModelItem; import ru.betterend.registry.EndItems; public class ArmoredElytra extends BaseArmorItem implements MultiModelItem, FallFlyingItem { - + private final ResourceLocation wingTexture; private final Item repairItem; private final double movementFactor; private final float toughness; private final int defense; - + public ArmoredElytra(String name, ArmorMaterial material, Item repairItem, int durability, double movementFactor, boolean fireproof) { - super(material, EquipmentSlot.CHEST, fireproof ? - EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC).fireResistant() : - EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC)); + super(material, EquipmentSlot.CHEST, fireproof ? EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC).fireResistant() : EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC)); this.wingTexture = BetterEnd.makeID("textures/entity/" + name + ".png"); this.repairItem = repairItem; this.movementFactor = movementFactor; this.defense = (int) ((double) material.getDefenseForSlot(EquipmentSlot.CHEST) / 1.75); this.toughness = material.getToughness() / 1.75F; - addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], - "Armor modifier", defense, AttributeModifier.Operation.ADDITION)); - addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], - "Armor toughness", toughness, AttributeModifier.Operation.ADDITION)); + addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor modifier", defense, AttributeModifier.Operation.ADDITION)); + addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor toughness", toughness, AttributeModifier.Operation.ADDITION)); } - + @Override public double getMovementFactor() { return movementFactor; } - + @Override @Environment(EnvType.CLIENT) public ResourceLocation getModelTexture() { return wingTexture; } - + @Override public boolean isValidRepairItem(ItemStack itemStack, ItemStack itemStack2) { return super.isValidRepairItem(itemStack, itemStack2) || itemStack2.getItem() == repairItem; } - + @Override public int getDefense() { return defense; } - + @Override public float getToughness() { return toughness; } - + @Override @Environment(EnvType.CLIENT) public void registerModelPredicate() { - FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"), - (itemStack, clientLevel, livingEntity, id) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F); + FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"), (itemStack, clientLevel, livingEntity, id) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F); } } diff --git a/src/main/java/ru/betterend/item/CrystaliteArmor.java b/src/main/java/ru/betterend/item/CrystaliteArmor.java index c2e084ff..35690808 100644 --- a/src/main/java/ru/betterend/item/CrystaliteArmor.java +++ b/src/main/java/ru/betterend/item/CrystaliteArmor.java @@ -12,14 +12,14 @@ import ru.betterend.effects.EndStatusEffects; import ru.betterend.item.material.EndArmorMaterial; public class CrystaliteArmor extends BaseArmorItem { - + public final static TranslatableComponent CHEST_DESC; public final static TranslatableComponent BOOTS_DESC; - + public CrystaliteArmor(EquipmentSlot equipmentSlot, Properties settings) { super(EndArmorMaterial.CRYSTALITE, equipmentSlot, settings); } - + public static boolean hasFullSet(LivingEntity owner) { for (ItemStack armorStack : owner.getArmorSlots()) { if (!(armorStack.getItem() instanceof CrystaliteArmor)) { @@ -28,11 +28,11 @@ public class CrystaliteArmor extends BaseArmorItem { } return true; } - + public static void applySetEffect(LivingEntity owner) { owner.addEffect(new MobEffectInstance(EndStatusEffects.CRYSTALITE_HEALTH_REGEN)); } - + static { Style descStyle = Style.EMPTY.applyFormats(ChatFormatting.DARK_AQUA, ChatFormatting.ITALIC); CHEST_DESC = new TranslatableComponent("tooltip.armor.crystalite_chest"); diff --git a/src/main/java/ru/betterend/item/CrystaliteBoots.java b/src/main/java/ru/betterend/item/CrystaliteBoots.java index ee7b032f..b72f98e0 100644 --- a/src/main/java/ru/betterend/item/CrystaliteBoots.java +++ b/src/main/java/ru/betterend/item/CrystaliteBoots.java @@ -19,16 +19,16 @@ import ru.betterend.registry.EndItems; import java.util.List; public class CrystaliteBoots extends CrystaliteArmor implements MobEffectApplier { - + public CrystaliteBoots() { super(EquipmentSlot.FEET, EndItems.makeEndItemSettings().rarity(Rarity.RARE)); } - + @Override public void applyEffect(LivingEntity owner) { owner.addEffect(new MobEffectInstance(EndStatusEffects.CRYSTALITE_MOVE_SPEED)); } - + @Override @Environment(EnvType.CLIENT) public void appendHoverText(ItemStack stack, @Nullable Level level, List lines, TooltipFlag tooltip) { diff --git a/src/main/java/ru/betterend/item/CrystaliteChestplate.java b/src/main/java/ru/betterend/item/CrystaliteChestplate.java index 023269bb..5f3035b0 100644 --- a/src/main/java/ru/betterend/item/CrystaliteChestplate.java +++ b/src/main/java/ru/betterend/item/CrystaliteChestplate.java @@ -19,16 +19,16 @@ import ru.betterend.registry.EndItems; import java.util.List; public class CrystaliteChestplate extends CrystaliteArmor implements MobEffectApplier { - + public CrystaliteChestplate() { super(EquipmentSlot.CHEST, EndItems.makeEndItemSettings().rarity(Rarity.RARE)); } - + @Override public void applyEffect(LivingEntity owner) { owner.addEffect(new MobEffectInstance(EndStatusEffects.CRYSTALITE_DIG_SPEED)); } - + @Override @Environment(EnvType.CLIENT) public void appendHoverText(ItemStack stack, @Nullable Level level, List lines, TooltipFlag tooltip) { diff --git a/src/main/java/ru/betterend/item/CrystaliteElytra.java b/src/main/java/ru/betterend/item/CrystaliteElytra.java index a8995c5a..869be56f 100644 --- a/src/main/java/ru/betterend/item/CrystaliteElytra.java +++ b/src/main/java/ru/betterend/item/CrystaliteElytra.java @@ -16,53 +16,50 @@ import ru.betterend.interfaces.MultiModelItem; import ru.betterend.registry.EndItems; public class CrystaliteElytra extends CrystaliteArmor implements MultiModelItem, FallFlyingItem { - + private final ResourceLocation wingTexture; private final double movementFactor; private final int defense; private final float toughness; - + public CrystaliteElytra(int durability, double movementFactor) { super(EquipmentSlot.CHEST, EndItems.makeEndItemSettings().durability(durability).rarity(Rarity.EPIC)); this.wingTexture = BetterEnd.makeID("textures/entity/elytra_crystalite.png"); this.movementFactor = movementFactor; this.defense = (int) ((double) material.getDefenseForSlot(EquipmentSlot.CHEST) / 1.75); this.toughness = material.getToughness() / 1.75F; - addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], - "Armor modifier", defense, AttributeModifier.Operation.ADDITION)); - addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], - "Armor toughness", toughness, AttributeModifier.Operation.ADDITION)); + addAttributeModifier(Attributes.ARMOR, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor modifier", defense, AttributeModifier.Operation.ADDITION)); + addAttributeModifier(Attributes.ARMOR_TOUGHNESS, new AttributeModifier(ARMOR_MODIFIER_UUID_PER_SLOT[2], "Armor toughness", toughness, AttributeModifier.Operation.ADDITION)); } - + @Override public boolean isValidRepairItem(ItemStack itemStack, ItemStack itemStack2) { return super.isValidRepairItem(itemStack, itemStack2) || itemStack2.getItem() == EndItems.ENCHANTED_MEMBRANE; } - + @Override public double getMovementFactor() { return movementFactor; } - + @Override @Environment(EnvType.CLIENT) public ResourceLocation getModelTexture() { return wingTexture; } - + @Override public int getDefense() { return defense; } - + @Override public float getToughness() { return toughness; } - + @Override public void registerModelPredicate() { - FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"), - (itemStack, clientLevel, livingEntity, i) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F); + FabricModelPredicateProviderRegistry.register(this, new ResourceLocation("broken"), (itemStack, clientLevel, livingEntity, i) -> ElytraItem.isFlyEnabled(itemStack) ? 0.0F : 1.0F); } } diff --git a/src/main/java/ru/betterend/item/CrystaliteHelmet.java b/src/main/java/ru/betterend/item/CrystaliteHelmet.java index a9889445..c1341630 100644 --- a/src/main/java/ru/betterend/item/CrystaliteHelmet.java +++ b/src/main/java/ru/betterend/item/CrystaliteHelmet.java @@ -9,7 +9,7 @@ import ru.betterend.registry.EndItems; import java.util.UUID; public class CrystaliteHelmet extends CrystaliteArmor { - + public CrystaliteHelmet() { super(EquipmentSlot.HEAD, EndItems.makeEndItemSettings().rarity(Rarity.RARE)); UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[EquipmentSlot.HEAD.getIndex()]; diff --git a/src/main/java/ru/betterend/item/CrystaliteLeggings.java b/src/main/java/ru/betterend/item/CrystaliteLeggings.java index f6b2ac77..26ca413b 100644 --- a/src/main/java/ru/betterend/item/CrystaliteLeggings.java +++ b/src/main/java/ru/betterend/item/CrystaliteLeggings.java @@ -9,7 +9,7 @@ import ru.betterend.registry.EndItems; import java.util.UUID; public class CrystaliteLeggings extends CrystaliteArmor { - + public CrystaliteLeggings() { super(EquipmentSlot.LEGS, EndItems.makeEndItemSettings().rarity(Rarity.RARE)); UUID uuid = ARMOR_MODIFIER_UUID_PER_SLOT[EquipmentSlot.LEGS.getIndex()]; diff --git a/src/main/java/ru/betterend/item/EnchantedItem.java b/src/main/java/ru/betterend/item/EnchantedItem.java index 814b9644..fd033403 100644 --- a/src/main/java/ru/betterend/item/EnchantedItem.java +++ b/src/main/java/ru/betterend/item/EnchantedItem.java @@ -13,19 +13,19 @@ import ru.bclib.items.ModelProviderItem; import ru.betterend.registry.EndItems; public class EnchantedItem extends ModelProviderItem { - + private final Item source; - + public EnchantedItem(Item source) { super(EndItems.makeEndItemSettings().rarity(Rarity.RARE).stacksTo(16)); this.source = source; } - + @Override public boolean isFoil(ItemStack stack) { return true; } - + @Override @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { diff --git a/src/main/java/ru/betterend/item/EndAnvilItem.java b/src/main/java/ru/betterend/item/EndAnvilItem.java index b0173781..4e5161a9 100644 --- a/src/main/java/ru/betterend/item/EndAnvilItem.java +++ b/src/main/java/ru/betterend/item/EndAnvilItem.java @@ -15,13 +15,13 @@ import ru.betterend.blocks.basis.EndAnvilBlock; import ru.betterend.registry.EndBlocks; public class EndAnvilItem extends BaseAnvilItem { - + public final static String DURABILITY = "durability"; - + public EndAnvilItem(Block anvilBlock) { super(anvilBlock, EndBlocks.makeBlockItemSettings()); } - + @Override protected BlockState getPlacementState(BlockPlaceContext blockPlaceContext) { BlockState blockState = super.getPlacementState(blockPlaceContext); @@ -32,7 +32,7 @@ public class EndAnvilItem extends BaseAnvilItem { } return blockState; } - + @Override @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { diff --git a/src/main/java/ru/betterend/item/EndArmorItem.java b/src/main/java/ru/betterend/item/EndArmorItem.java index 40752e88..437db9bb 100644 --- a/src/main/java/ru/betterend/item/EndArmorItem.java +++ b/src/main/java/ru/betterend/item/EndArmorItem.java @@ -13,16 +13,11 @@ import ru.bclib.client.models.ItemModelProvider; import java.util.UUID; public class EndArmorItem extends ArmorItem implements ItemModelProvider { - - protected static final UUID[] ARMOR_MODIFIER_UUID_PER_SLOT = new UUID[]{ - UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), - UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), - UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), - UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150") - }; - + + protected static final UUID[] ARMOR_MODIFIER_UUID_PER_SLOT = new UUID[]{UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")}; + protected final Multimap defaultModifiers; - + public EndArmorItem(ArmorMaterial material, EquipmentSlot equipmentSlot, Properties settings) { super(material, equipmentSlot, settings); this.defaultModifiers = HashMultimap.create(); @@ -33,12 +28,12 @@ public class EndArmorItem extends ArmorItem implements ItemModelProvider { addAttributeModifier(Attributes.KNOCKBACK_RESISTANCE, new AttributeModifier(uuid, "Armor knockback resistance", knockbackResistance, AttributeModifier.Operation.ADDITION)); } } - + @Override public Multimap getDefaultAttributeModifiers(EquipmentSlot equipmentSlot) { return equipmentSlot == slot ? defaultModifiers : super.getDefaultAttributeModifiers(equipmentSlot); } - + protected void addAttributeModifier(Attribute attribute, AttributeModifier modifier) { if (defaultModifiers.containsKey(attribute)) { defaultModifiers.removeAll(attribute); diff --git a/src/main/java/ru/betterend/item/EndAttribute.java b/src/main/java/ru/betterend/item/EndAttribute.java index 7ddc0bb8..03159fea 100644 --- a/src/main/java/ru/betterend/item/EndAttribute.java +++ b/src/main/java/ru/betterend/item/EndAttribute.java @@ -3,7 +3,7 @@ package ru.betterend.item; import net.minecraft.world.entity.ai.attributes.Attribute; public class EndAttribute extends Attribute { - + public EndAttribute(String description, double value) { super(description, value); } diff --git a/src/main/java/ru/betterend/item/GuideBookItem.java b/src/main/java/ru/betterend/item/GuideBookItem.java index da0384a4..ce192756 100644 --- a/src/main/java/ru/betterend/item/GuideBookItem.java +++ b/src/main/java/ru/betterend/item/GuideBookItem.java @@ -22,14 +22,14 @@ import java.util.List; public class GuideBookItem extends ModelProviderItem { public final static ResourceLocation BOOK_ID = BetterEnd.makeID("guidebook"); public static final Item GUIDE_BOOK = EndItems.registerEndItem(BOOK_ID, new GuideBookItem()); - + public static void register() { } - + public GuideBookItem() { super(EndItems.makeEndItemSettings().stacksTo(1)); } - + @Override public InteractionResultHolder use(Level world, Player user, InteractionHand hand) { if (!world.isClientSide && user instanceof ServerPlayer) { @@ -38,7 +38,7 @@ public class GuideBookItem extends ModelProviderItem { } return InteractionResultHolder.consume(user.getItemInHand(hand)); } - + @Override public void appendHoverText(ItemStack stack, Level world, List tooltip, TooltipFlag context) { tooltip.add(LangUtil.getText("book.betterend", "subtitle").withStyle(ChatFormatting.DARK_PURPLE, ChatFormatting.ITALIC)); diff --git a/src/main/java/ru/betterend/item/material/EndArmorMaterial.java b/src/main/java/ru/betterend/item/material/EndArmorMaterial.java index 1ff8c95c..cb3b8615 100644 --- a/src/main/java/ru/betterend/item/material/EndArmorMaterial.java +++ b/src/main/java/ru/betterend/item/material/EndArmorMaterial.java @@ -16,17 +16,14 @@ import java.util.function.Supplier; public enum EndArmorMaterial implements ArmorMaterial { THALLASIUM("thallasium", 17, new int[]{1, 4, 5, 2}, 12, SoundEvents.ARMOR_EQUIP_IRON, 0.0F, 0.0F, () -> { return Ingredient.of(EndBlocks.THALLASIUM.ingot); - }), - TERMINITE("terminite", 26, new int[]{3, 6, 7, 3}, 14, SoundEvents.ARMOR_EQUIP_IRON, 1.0F, 0.05F, () -> { + }), TERMINITE("terminite", 26, new int[]{3, 6, 7, 3}, 14, SoundEvents.ARMOR_EQUIP_IRON, 1.0F, 0.05F, () -> { return Ingredient.of(EndBlocks.TERMINITE.ingot); - }), - AETERNIUM("aeternium", 40, new int[]{4, 7, 9, 4}, 18, SoundEvents.ARMOR_EQUIP_NETHERITE, 3.5F, 0.2F, () -> { + }), AETERNIUM("aeternium", 40, new int[]{4, 7, 9, 4}, 18, SoundEvents.ARMOR_EQUIP_NETHERITE, 3.5F, 0.2F, () -> { return Ingredient.of(EndItems.AETERNIUM_INGOT); - }), - CRYSTALITE("crystalite", 30, new int[]{3, 6, 8, 3}, 24, SoundEvents.ARMOR_EQUIP_DIAMOND, 1.2F, 0.1F, () -> { + }), CRYSTALITE("crystalite", 30, new int[]{3, 6, 8, 3}, 24, SoundEvents.ARMOR_EQUIP_DIAMOND, 1.2F, 0.1F, () -> { return Ingredient.of(EndBlocks.TERMINITE.ingot); }); - + private static final int[] BASE_DURABILITY = new int[]{13, 15, 16, 11}; private final String name; private final int durabilityMultiplier; @@ -36,11 +33,9 @@ public enum EndArmorMaterial implements ArmorMaterial { private final float toughness; private final float knockbackResistance; private final LazyLoadedValue repairIngredient; - - private EndArmorMaterial(String name, int durabilityMultiplier, int[] protectionAmounts, int enchantability, - SoundEvent equipSound, float toughness, float knockbackResistance, - Supplier repairIngredient) { - + + private EndArmorMaterial(String name, int durabilityMultiplier, int[] protectionAmounts, int enchantability, SoundEvent equipSound, float toughness, float knockbackResistance, Supplier repairIngredient) { + this.name = name; this.durabilityMultiplier = durabilityMultiplier; this.protectionAmounts = protectionAmounts; @@ -50,46 +45,46 @@ public enum EndArmorMaterial implements ArmorMaterial { this.knockbackResistance = knockbackResistance; this.repairIngredient = new LazyLoadedValue<>(repairIngredient); } - + @Override public int getDurabilityForSlot(EquipmentSlot slot) { return BASE_DURABILITY[slot.getIndex()] * this.durabilityMultiplier; } - + @Override public int getDefenseForSlot(EquipmentSlot slot) { return this.protectionAmounts[slot.getIndex()]; } - + @Override public int getEnchantmentValue() { return this.enchantability; } - + @Override public SoundEvent getEquipSound() { return this.equipSound; } - + @Override public Ingredient getRepairIngredient() { return this.repairIngredient.get(); } - + @Override @Environment(EnvType.CLIENT) public String getName() { return this.name; } - + @Override public float getToughness() { return this.toughness; } - + @Override public float getKnockbackResistance() { return this.knockbackResistance; } - + } diff --git a/src/main/java/ru/betterend/item/material/EndToolMaterial.java b/src/main/java/ru/betterend/item/material/EndToolMaterial.java index fa17936b..d546c6a4 100644 --- a/src/main/java/ru/betterend/item/material/EndToolMaterial.java +++ b/src/main/java/ru/betterend/item/material/EndToolMaterial.java @@ -11,24 +11,21 @@ import java.util.function.Supplier; public enum EndToolMaterial implements Tier { THALLASIUM(2, 320, 7.0F, 1.5F, 12, () -> { return Ingredient.of(EndBlocks.THALLASIUM.ingot); - }), - TERMINITE(3, 1230, 8.5F, 3.0F, 14, () -> { + }), TERMINITE(3, 1230, 8.5F, 3.0F, 14, () -> { return Ingredient.of(EndBlocks.TERMINITE.ingot); - }), - AETERNIUM(5, 2196, 10.0F, 4.5F, 18, () -> { + }), AETERNIUM(5, 2196, 10.0F, 4.5F, 18, () -> { return Ingredient.of(EndItems.AETERNIUM_INGOT); }); - + private final int durability; private final float miningSpeed; private final float attackDamage; private final int miningLevel; private final int enchantability; private final LazyLoadedValue repairIngredient; - - private EndToolMaterial(int miningLevel, int durability, float miningSpeed, float attackDamage, int enchantability, - Supplier repairIngredient) { - + + private EndToolMaterial(int miningLevel, int durability, float miningSpeed, float attackDamage, int enchantability, Supplier repairIngredient) { + this.durability = durability; this.miningSpeed = miningSpeed; this.attackDamage = attackDamage; @@ -36,35 +33,35 @@ public enum EndToolMaterial implements Tier { this.enchantability = enchantability; this.repairIngredient = new LazyLoadedValue<>(repairIngredient); } - + @Override public int getUses() { return this.durability; } - + @Override public float getSpeed() { return this.miningSpeed; } - + @Override public float getAttackDamageBonus() { return this.attackDamage; } - + @Override public int getLevel() { return this.miningLevel; } - + @Override public int getEnchantmentValue() { return this.enchantability; } - + @Override public Ingredient getRepairIngredient() { return this.repairIngredient.get(); } - + } diff --git a/src/main/java/ru/betterend/item/model/ArmoredElytraModel.java b/src/main/java/ru/betterend/item/model/ArmoredElytraModel.java index 7b6fa214..825d8dfa 100644 --- a/src/main/java/ru/betterend/item/model/ArmoredElytraModel.java +++ b/src/main/java/ru/betterend/item/model/ArmoredElytraModel.java @@ -16,37 +16,30 @@ import net.minecraft.world.phys.Vec3; public class ArmoredElytraModel extends AgeableListModel { private final ModelPart rightWing; private final ModelPart leftWing; - + public static LayerDefinition getTexturedModelData() { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - modelPartData.addOrReplaceChild(PartNames.LEFT_WING, CubeListBuilder.create() - .texOffs(22, 0) - .addBox(-10.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f), - PartPose.ZERO); - - modelPartData.addOrReplaceChild(PartNames.RIGHT_WING, CubeListBuilder.create() - .mirror() - .texOffs(22, 0) - .addBox(0.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f), - PartPose.ZERO); - + modelPartData.addOrReplaceChild(PartNames.LEFT_WING, CubeListBuilder.create().texOffs(22, 0).addBox(-10.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f), PartPose.ZERO); + + modelPartData.addOrReplaceChild(PartNames.RIGHT_WING, CubeListBuilder.create().mirror().texOffs(22, 0).addBox(0.0f, 0.0f, 0.0f, 10.0f, 20.0f, 2.0f), PartPose.ZERO); + return LayerDefinition.create(modelData, 64, 32); } - + public ArmoredElytraModel(ModelPart modelPart) { leftWing = modelPart.getChild(PartNames.LEFT_WING); rightWing = modelPart.getChild(PartNames.RIGHT_WING); } - + protected Iterable headParts() { return ImmutableList.of(); } - + protected Iterable bodyParts() { return ImmutableList.of(leftWing, rightWing); } - + public void setupAnim(T livingEntity, float f, float g, float h, float i, float j) { float rotX = 0.2617994F; float rotZ = -0.2617994F; @@ -68,7 +61,7 @@ public class ArmoredElytraModel extends AgeableListModel rotY = 0.08726646F; wingY = 3.0F; } - + leftWing.x = 5.0F; leftWing.y = wingY; if (livingEntity instanceof AbstractClientPlayer) { @@ -85,7 +78,7 @@ public class ArmoredElytraModel extends AgeableListModel leftWing.zRot = rotZ; leftWing.yRot = rotY; } - + rightWing.x = -leftWing.x; rightWing.yRot = -leftWing.yRot; rightWing.y = leftWing.y; diff --git a/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java b/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java index ee0bf6eb..86069770 100644 --- a/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java +++ b/src/main/java/ru/betterend/item/model/CrystaliteArmorProvider.java @@ -26,26 +26,23 @@ public class CrystaliteArmorProvider implements ArmorRenderingRegistry.ModelProv private final static CrystaliteChestplateModel CHEST_MODEL_SLIM = CrystaliteChestplateModel.createThinModel(null); private final static CrystaliteLeggingsModel LEGGINGS_MODEL = CrystaliteLeggingsModel.createModel(null); private final static CrystaliteBootsModel BOOTS_MODEL = CrystaliteBootsModel.createModel(null); - + //@Override - public @NotNull ResourceLocation getArmorTexture(LivingEntity entity, ItemStack stack, EquipmentSlot slot, - boolean secondLayer, @Nullable String suffix, ResourceLocation defaultTexture) { + public @NotNull ResourceLocation getArmorTexture(LivingEntity entity, ItemStack stack, EquipmentSlot slot, boolean secondLayer, @Nullable String suffix, ResourceLocation defaultTexture) { if (!isStackValid(stack)) return defaultTexture; if (secondLayer) return SECOND_LAYER; return FIRST_LAYER; } - + //@Override - public @NotNull HumanoidModel getArmorModel(LivingEntity entity, ItemStack stack, - EquipmentSlot slot, HumanoidModel defaultModel) { + public @NotNull HumanoidModel getArmorModel(LivingEntity entity, ItemStack stack, EquipmentSlot slot, HumanoidModel defaultModel) { if (!isStackValid(stack)) return defaultModel; switch (slot) { case HEAD: { return HELMET_MODEL; } case CHEST: { - if (entity instanceof AbstractClientPlayer && - ((AbstractClientPlayer) entity).getModelName().equals("slim")) { + if (entity instanceof AbstractClientPlayer && ((AbstractClientPlayer) entity).getModelName().equals("slim")) { CHEST_MODEL_SLIM.copyPropertiesTo(defaultModel); return CHEST_MODEL_SLIM; } @@ -64,16 +61,11 @@ public class CrystaliteArmorProvider implements ArmorRenderingRegistry.ModelProv } } } - + public Iterable getRenderedItems() { - return Lists.newArrayList( - EndItems.CRYSTALITE_HELMET, - EndItems.CRYSTALITE_CHESTPLATE, - EndItems.CRYSTALITE_ELYTRA, - EndItems.CRYSTALITE_LEGGINGS, - EndItems.CRYSTALITE_BOOTS); + return Lists.newArrayList(EndItems.CRYSTALITE_HELMET, EndItems.CRYSTALITE_CHESTPLATE, EndItems.CRYSTALITE_ELYTRA, EndItems.CRYSTALITE_LEGGINGS, EndItems.CRYSTALITE_BOOTS); } - + private boolean isStackValid(ItemStack stack) { return stack.getItem() instanceof CrystaliteArmor; } diff --git a/src/main/java/ru/betterend/item/model/CrystaliteBootsModel.java b/src/main/java/ru/betterend/item/model/CrystaliteBootsModel.java index 5458e891..baeb7acf 100644 --- a/src/main/java/ru/betterend/item/model/CrystaliteBootsModel.java +++ b/src/main/java/ru/betterend/item/model/CrystaliteBootsModel.java @@ -17,15 +17,15 @@ import ru.betterend.registry.EndEntitiesRenders; import java.util.Collections; public class CrystaliteBootsModel extends HumanoidModel { - + public ModelPart leftBoot; public ModelPart rightBoot; - + public static LayerDefinition getTexturedModelData() { final float scale = 1.0f; MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - + // TODO: see if we need to subclass HumanoidModel // Humanoid model tries to retrieve all parts in it's constructor, // so we need to add empty Nodes @@ -36,44 +36,38 @@ public class CrystaliteBootsModel extends HumanoidModel { modelPartData.addOrReplaceChild("left_arm", CubeListBuilder.create(), PartPose.ZERO); modelPartData.addOrReplaceChild("right_leg", CubeListBuilder.create(), PartPose.ZERO); modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO); - + CubeDeformation deformation = new CubeDeformation(scale + 0.25f); - modelPartData.addOrReplaceChild("leftBoot", CubeListBuilder.create() - .texOffs(0, 32) - .addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), - PartPose.offset(1.9f, 12.0f, 0.0f)); - - modelPartData.addOrReplaceChild("rightBoot", CubeListBuilder.create() - .texOffs(0, 16) - .addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), - PartPose.offset(-1.9f, 12.0f, 0.0f)); - + modelPartData.addOrReplaceChild("leftBoot", CubeListBuilder.create().texOffs(0, 32).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(1.9f, 12.0f, 0.0f)); + + modelPartData.addOrReplaceChild("rightBoot", CubeListBuilder.create().texOffs(0, 16).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-1.9f, 12.0f, 0.0f)); + return LayerDefinition.create(modelData, 64, 48); } - + public static CrystaliteBootsModel createModel(EntityModelSet entityModelSet) { return new CrystaliteBootsModel(entityModelSet == null ? getTexturedModelData().bakeRoot() : entityModelSet.bakeLayer(EndEntitiesRenders.CRYSTALITE_BOOTS)); } - + public CrystaliteBootsModel(ModelPart modelPart) { super(modelPart, RenderType::entityTranslucent); - + leftBoot = modelPart.getChild("leftBoot"); rightBoot = modelPart.getChild("rightBoot"); } - + @Override public void copyPropertiesTo(HumanoidModel bipedEntityModel) { super.copyPropertiesTo(bipedEntityModel); this.leftBoot.copyFrom(leftLeg); this.rightBoot.copyFrom(rightLeg); } - + @Override protected Iterable headParts() { return Collections::emptyIterator; } - + @Override protected Iterable bodyParts() { return Lists.newArrayList(leftBoot, rightBoot); diff --git a/src/main/java/ru/betterend/item/model/CrystaliteChestplateModel.java b/src/main/java/ru/betterend/item/model/CrystaliteChestplateModel.java index f784da8f..cc59cb92 100644 --- a/src/main/java/ru/betterend/item/model/CrystaliteChestplateModel.java +++ b/src/main/java/ru/betterend/item/model/CrystaliteChestplateModel.java @@ -20,23 +20,23 @@ import ru.betterend.registry.EndEntitiesRenders; import java.util.Collections; public class CrystaliteChestplateModel extends HumanoidModel { - + public ModelPart leftShoulder; public ModelPart rightShoulder; private final boolean thinArms; - + public static LayerDefinition getRegularTexturedModelData() { return getTexturedModelData(1.0f, false); } - + public static LayerDefinition getThinTexturedModelData() { return getTexturedModelData(1.0f, true); } - + private static LayerDefinition getTexturedModelData(float scale, boolean thinArms) { MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - + // TODO: see if we need to subclass HumanoidModel // Humanoid model tries to retrieve all parts in it's constructor, // so we need to add empty Nodes @@ -47,52 +47,35 @@ public class CrystaliteChestplateModel extends HumanoidModel { modelPartData.addOrReplaceChild("left_arm", CubeListBuilder.create(), PartPose.ZERO); modelPartData.addOrReplaceChild("right_leg", CubeListBuilder.create(), PartPose.ZERO); modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO); - + CubeDeformation deformation = new CubeDeformation(scale + 0.25F); - PartDefinition body = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create() - .texOffs(16, 16) - .addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation), - PartPose.ZERO); - + PartDefinition body = modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(16, 16).addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation), PartPose.ZERO); + if (thinArms) { deformation = new CubeDeformation(scale + 0.45F); - PartDefinition leftShoulder = modelPartData.addOrReplaceChild("leftShoulder", CubeListBuilder.create() - .mirror() - .texOffs(40, 32) - .addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), - PartPose.offset(5.0f, 2.0f, 0.0f)); - - PartDefinition rightShoulder = modelPartData.addOrReplaceChild("rightShoulder", CubeListBuilder.create() - .texOffs(40, 16) - .addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), - PartPose.offset(-5.0f, 2.0f, 10.0f)); + PartDefinition leftShoulder = modelPartData.addOrReplaceChild("leftShoulder", CubeListBuilder.create().mirror().texOffs(40, 32).addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(5.0f, 2.0f, 0.0f)); + + PartDefinition rightShoulder = modelPartData.addOrReplaceChild("rightShoulder", CubeListBuilder.create().texOffs(40, 16).addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-5.0f, 2.0f, 10.0f)); } else { deformation = new CubeDeformation(scale + 0.45F); - PartDefinition leftShoulder = modelPartData.addOrReplaceChild("leftShoulder", CubeListBuilder.create() - .mirror() - .texOffs(40, 32) - .addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), - PartPose.offset(5.0f, 2.0f, 0.0f)); - - PartDefinition rightShoulder = modelPartData.addOrReplaceChild("rightShoulder", CubeListBuilder.create() - .texOffs(40, 16) - .addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), - PartPose.offset(-5.0f, 2.0f, 10.0f)); + PartDefinition leftShoulder = modelPartData.addOrReplaceChild("leftShoulder", CubeListBuilder.create().mirror().texOffs(40, 32).addBox(-1.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(5.0f, 2.0f, 0.0f)); + + PartDefinition rightShoulder = modelPartData.addOrReplaceChild("rightShoulder", CubeListBuilder.create().texOffs(40, 16).addBox(-3.0f, -2.5f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-5.0f, 2.0f, 10.0f)); } return LayerDefinition.create(modelData, 64, 48); } - + final ModelPart localBody; - + public static CrystaliteChestplateModel createRegularModel(EntityModelSet entityModelSet) { return new CrystaliteChestplateModel(entityModelSet == null ? getRegularTexturedModelData().bakeRoot() : entityModelSet.bakeLayer(EndEntitiesRenders.CRYSTALITE_CHESTPLATE), false); } - + public static CrystaliteChestplateModel createThinModel(EntityModelSet entityModelSet) { return new CrystaliteChestplateModel(entityModelSet == null ? getThinTexturedModelData().bakeRoot() : entityModelSet.bakeLayer(EndEntitiesRenders.CRYSTALITE_CHESTPLATE_THIN), true); } - + protected CrystaliteChestplateModel(ModelPart modelPart, boolean thinArms) { super(modelPart, RenderType::entityTranslucent); this.thinArms = thinArms; @@ -100,24 +83,24 @@ public class CrystaliteChestplateModel extends HumanoidModel { leftShoulder = modelPart.getChild("leftShoulder"); rightShoulder = modelPart.getChild("rightShoulder"); } - + @Override public void copyPropertiesTo(HumanoidModel bipedEntityModel) { super.copyPropertiesTo(bipedEntityModel); this.leftShoulder.copyFrom(leftArm); this.rightShoulder.copyFrom(rightArm); } - + @Override protected Iterable headParts() { return Collections::emptyIterator; } - + @Override protected Iterable bodyParts() { return Lists.newArrayList(localBody, leftShoulder, rightShoulder); } - + @Override public void translateToHand(HumanoidArm arm, PoseStack matrices) { ModelPart modelPart = this.getArm(arm); diff --git a/src/main/java/ru/betterend/item/model/CrystaliteHelmetModel.java b/src/main/java/ru/betterend/item/model/CrystaliteHelmetModel.java index 474980c9..78da1ead 100644 --- a/src/main/java/ru/betterend/item/model/CrystaliteHelmetModel.java +++ b/src/main/java/ru/betterend/item/model/CrystaliteHelmetModel.java @@ -22,12 +22,12 @@ import java.util.Collections; @Environment(EnvType.CLIENT) public class CrystaliteHelmetModel extends HumanoidModel { final ModelPart myHat; - + public static LayerDefinition getTexturedModelData() { final float scale = 1.0f; MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - + // TODO: see if we need to subclass HumanoidModel // Humanoid model tries to retrieve all parts in it's constructor, // so we need to add empty Nodes @@ -38,32 +38,29 @@ public class CrystaliteHelmetModel extends HumanoidModel { modelPartData.addOrReplaceChild("left_arm", CubeListBuilder.create(), PartPose.ZERO); modelPartData.addOrReplaceChild("right_leg", CubeListBuilder.create(), PartPose.ZERO); modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO); - + CubeDeformation deformation_hat = new CubeDeformation(scale + 0.5f); - PartDefinition hat = modelPartData.addOrReplaceChild(PartNames.HAT, CubeListBuilder.create() - .texOffs(0, 0) - .addBox(-4.0f, -8.0f, -4.0f, 8.0f, 8.0f, 8.0f, deformation_hat), - PartPose.ZERO); - + PartDefinition hat = modelPartData.addOrReplaceChild(PartNames.HAT, CubeListBuilder.create().texOffs(0, 0).addBox(-4.0f, -8.0f, -4.0f, 8.0f, 8.0f, 8.0f, deformation_hat), PartPose.ZERO); + return LayerDefinition.create(modelData, 64, 48); } - + public static CrystaliteHelmetModel createModel(EntityModelSet entityModelSet) { return new CrystaliteHelmetModel(entityModelSet == null ? getTexturedModelData().bakeRoot() : entityModelSet.bakeLayer(EndEntitiesRenders.CRYSTALITE_HELMET)); } - - + + public CrystaliteHelmetModel(ModelPart modelPart) { super(modelPart, RenderType::entityTranslucent); - + myHat = modelPart.getChild(PartNames.HAT); } - + @Override protected Iterable headParts() { return Collections::emptyIterator; } - + @Override protected Iterable bodyParts() { return Lists.newArrayList(myHat); diff --git a/src/main/java/ru/betterend/item/model/CrystaliteLeggingsModel.java b/src/main/java/ru/betterend/item/model/CrystaliteLeggingsModel.java index 0f1a743d..42879aa7 100644 --- a/src/main/java/ru/betterend/item/model/CrystaliteLeggingsModel.java +++ b/src/main/java/ru/betterend/item/model/CrystaliteLeggingsModel.java @@ -22,7 +22,7 @@ public class CrystaliteLeggingsModel extends HumanoidModel { float scale = 1.0f; MeshDefinition modelData = new MeshDefinition(); PartDefinition modelPartData = modelData.getRoot(); - + // TODO: see if we need to subclass HumanoidModel // Humanoid model tries to retrieve all parts in it's constructor, // so we need to add empty Nodes @@ -33,47 +33,38 @@ public class CrystaliteLeggingsModel extends HumanoidModel { modelPartData.addOrReplaceChild("left_arm", CubeListBuilder.create(), PartPose.ZERO); // modelPartData.addOrReplaceChild("right_leg", CubeListBuilder.create(), PartPose.ZERO); // modelPartData.addOrReplaceChild("left_leg", CubeListBuilder.create(), PartPose.ZERO); - + CubeDeformation deformation = new CubeDeformation(scale); - modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create() - .texOffs(16, 16) - .addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation), - PartPose.ZERO); - - modelPartData.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create() - .texOffs(0, 32) - .addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), - PartPose.offset(1.9f, 12.0f, 0.0f)); - - modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create() - .texOffs(0, 16) - .addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), - PartPose.offset(-1.9f, 12.0f, 0.0f)); - + modelPartData.addOrReplaceChild(PartNames.BODY, CubeListBuilder.create().texOffs(16, 16).addBox(-4.0f, 0.0f, -2.0f, 8.0f, 12.0f, 4.0f, deformation), PartPose.ZERO); + + modelPartData.addOrReplaceChild(PartNames.LEFT_LEG, CubeListBuilder.create().texOffs(0, 32).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(1.9f, 12.0f, 0.0f)); + + modelPartData.addOrReplaceChild(PartNames.RIGHT_LEG, CubeListBuilder.create().texOffs(0, 16).addBox(-2.0f, 0.0f, -2.0f, 4.0f, 12.0f, 4.0f, deformation), PartPose.offset(-1.9f, 12.0f, 0.0f)); + return LayerDefinition.create(modelData, 64, 48); } - + final ModelPart myBody; final ModelPart myLeftLeg; final ModelPart myRightLeg; - + public static CrystaliteLeggingsModel createModel(EntityModelSet entityModelSet) { return new CrystaliteLeggingsModel(entityModelSet == null ? getTexturedModelData().bakeRoot() : entityModelSet.bakeLayer(EndEntitiesRenders.CRYSTALITE_LEGGINGS)); } - + public CrystaliteLeggingsModel(ModelPart modelPart) { super(modelPart, RenderType::entityTranslucent); - + myBody = modelPart.getChild(PartNames.BODY); myLeftLeg = modelPart.getChild(PartNames.LEFT_LEG); myRightLeg = modelPart.getChild(PartNames.RIGHT_LEG); } - + @Override protected Iterable headParts() { return Collections::emptyIterator; } - + @Override protected Iterable bodyParts() { return Lists.newArrayList(myBody, myRightLeg, myLeftLeg); diff --git a/src/main/java/ru/betterend/item/tool/EndHammerItem.java b/src/main/java/ru/betterend/item/tool/EndHammerItem.java index 5f1e11c0..9aa9e42f 100644 --- a/src/main/java/ru/betterend/item/tool/EndHammerItem.java +++ b/src/main/java/ru/betterend/item/tool/EndHammerItem.java @@ -35,46 +35,41 @@ import java.util.UUID; public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, ItemModelProvider { public final static UUID ATTACK_KNOCKBACK_MODIFIER_ID = Mth.createInsecureUUID(ThreadLocalRandom.current()); - + private final Multimap attributeModifiers; - + public EndHammerItem(Tier material, float attackDamage, float attackSpeed, double knockback, Properties settings) { //we override all methods that access BlockTags.MINEABLE_WITH_PICKAXE in the superclass, so this should not matter super(attackDamage, attackSpeed, material, BlockTags.MINEABLE_WITH_PICKAXE, settings); - + Builder builder = ImmutableMultimap.builder(); builder.put(Attributes.ATTACK_DAMAGE, new AttributeModifier(BASE_ATTACK_DAMAGE_UUID, "Weapon modifier", attackDamage + material.getAttackDamageBonus(), AttributeModifier.Operation.ADDITION)); builder.put(Attributes.ATTACK_SPEED, new AttributeModifier(BASE_ATTACK_SPEED_UUID, "Weapon modifier", attackSpeed, AttributeModifier.Operation.ADDITION)); builder.put(Attributes.ATTACK_KNOCKBACK, new AttributeModifier(ATTACK_KNOCKBACK_MODIFIER_ID, "Weapon modifier", knockback, AttributeModifier.Operation.ADDITION)); this.attributeModifiers = builder.build(); } - + @Override public boolean canAttackBlock(BlockState state, Level world, BlockPos pos, Player miner) { - return state.getMaterial().equals(Material.STONE) || - state.getMaterial().equals(Material.GLASS) || - state.is(Blocks.DIAMOND_BLOCK) || - state.is(Blocks.EMERALD_BLOCK) || - state.is(Blocks.LAPIS_BLOCK) || - state.is(Blocks.REDSTONE_BLOCK); + return state.getMaterial().equals(Material.STONE) || state.getMaterial().equals(Material.GLASS) || state.is(Blocks.DIAMOND_BLOCK) || state.is(Blocks.EMERALD_BLOCK) || state.is(Blocks.LAPIS_BLOCK) || state.is(Blocks.REDSTONE_BLOCK); } - + @Override public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { stack.hurtAndBreak(1, attacker, ((entity) -> entity.broadcastBreakEvent(EquipmentSlot.MAINHAND))); - + return true; } - + @Override public boolean mineBlock(ItemStack stack, Level world, BlockState state, BlockPos pos, LivingEntity miner) { if (state.getDestroySpeed(world, pos) != 0.0F) { stack.hurtAndBreak(1, miner, ((entity) -> entity.broadcastBreakEvent(EquipmentSlot.MAINHAND))); } - + return true; } - + @Override public float getDestroySpeed(ItemStack stack, BlockState state) { if (state.getMaterial().equals(Material.GLASS)) { @@ -92,7 +87,7 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I } return 1.0F; } - + @Override public float getMiningSpeedMultiplier(Tag tag, BlockState state, ItemStack stack, LivingEntity user) { if (tag.equals(TagAPI.HAMMERS)) { @@ -100,7 +95,7 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I } return 1.0F; } - + @Override public int getMiningLevel(Tag tag, BlockState state, ItemStack stack, LivingEntity user) { if (tag.equals(TagAPI.HAMMERS)) { @@ -108,7 +103,7 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I } return 0; } - + @Override public boolean isCorrectToolForDrops(BlockState state) { if (state.getMaterial().equals(Material.GLASS)) { @@ -129,12 +124,12 @@ public class EndHammerItem extends DiggerItem implements DynamicAttributeTool, I } return true; } - + @Override public Multimap getDefaultAttributeModifiers(EquipmentSlot slot) { return slot == EquipmentSlot.MAINHAND ? this.attributeModifiers : super.getDefaultAttributeModifiers(slot); } - + @Override @Environment(EnvType.CLIENT) public BlockModel getItemModel(ResourceLocation resourceLocation) { diff --git a/src/main/java/ru/betterend/item/tool/EndPickaxe.java b/src/main/java/ru/betterend/item/tool/EndPickaxe.java index bf8494fa..cdd1d3fd 100644 --- a/src/main/java/ru/betterend/item/tool/EndPickaxe.java +++ b/src/main/java/ru/betterend/item/tool/EndPickaxe.java @@ -10,7 +10,7 @@ public class EndPickaxe extends BasePickaxeItem { public EndPickaxe(Tier material, int attackDamage, float attackSpeed, Properties settings) { super(material, attackDamage, attackSpeed, settings); } - + @Override public float getDestroySpeed(ItemStack stack, BlockState state) { if (state.is(Blocks.END_STONE) && this.getTier().getLevel() > 2) { diff --git a/src/main/java/ru/betterend/mixin/client/AnvilScreenMixin.java b/src/main/java/ru/betterend/mixin/client/AnvilScreenMixin.java index a629fb99..13f1e979 100644 --- a/src/main/java/ru/betterend/mixin/client/AnvilScreenMixin.java +++ b/src/main/java/ru/betterend/mixin/client/AnvilScreenMixin.java @@ -25,17 +25,16 @@ import java.util.List; @Mixin(AnvilScreen.class) public class AnvilScreenMixin extends ItemCombinerScreen { - + @Shadow private EditBox name; - + private final List be_buttons = Lists.newArrayList(); - - public AnvilScreenMixin(AnvilMenu handler, Inventory playerInventory, Component title, - ResourceLocation texture) { + + public AnvilScreenMixin(AnvilMenu handler, Inventory playerInventory, Component title, ResourceLocation texture) { super(handler, playerInventory, title, texture); } - + @Inject(method = "subInit", at = @At("TAIL")) protected void be_subInit(CallbackInfo info) { int x = (width - imageWidth) / 2; @@ -44,14 +43,14 @@ public class AnvilScreenMixin extends ItemCombinerScreen { be_buttons.add(new Button(x + 8, y + 45, 15, 20, new TextComponent("<"), b -> be_previousRecipe())); be_buttons.add(new Button(x + 154, y + 45, 15, 20, new TextComponent(">"), b -> be_nextRecipe())); } - + @Inject(method = "renderFg", at = @At("TAIL")) protected void be_renderForeground(PoseStack matrices, int mouseX, int mouseY, float delta, CallbackInfo info) { be_buttons.forEach(button -> { button.render(matrices, mouseX, mouseY, delta); }); } - + @Inject(method = "slotChanged", at = @At("HEAD"), cancellable = true) public void be_onSlotUpdate(AbstractContainerMenu handler, int slotId, ItemStack stack, CallbackInfo info) { AnvilScreenHandlerExtended anvilHandler = (AnvilScreenHandlerExtended) handler; @@ -69,15 +68,15 @@ public class AnvilScreenMixin extends ItemCombinerScreen { be_buttons.forEach(button -> button.visible = false); } } - + private void be_nextRecipe() { ((AnvilScreenHandlerExtended) menu).be_nextRecipe(); } - + private void be_previousRecipe() { ((AnvilScreenHandlerExtended) menu).be_previousRecipe(); } - + @Override public boolean mouseClicked(double mouseX, double mouseY, int button) { if (minecraft != null) { diff --git a/src/main/java/ru/betterend/mixin/client/ArmorStandRendererMixin.java b/src/main/java/ru/betterend/mixin/client/ArmorStandRendererMixin.java index 4f61d259..05433101 100644 --- a/src/main/java/ru/betterend/mixin/client/ArmorStandRendererMixin.java +++ b/src/main/java/ru/betterend/mixin/client/ArmorStandRendererMixin.java @@ -13,11 +13,11 @@ import ru.betterend.client.render.ArmoredElytraLayer; @Mixin(ArmorStandRenderer.class) public abstract class ArmorStandRendererMixin extends LivingEntityRenderer { - + public ArmorStandRendererMixin(EntityRendererProvider.Context context, ArmorStandArmorModel entityModel, float f) { super(context, entityModel, f); } - + @Inject(method = "*", at = @At("TAIL")) public void be_addCustomLayer(EntityRendererProvider.Context context, CallbackInfo ci) { addLayer(new ArmoredElytraLayer<>(this, context.getModelSet())); diff --git a/src/main/java/ru/betterend/mixin/client/BiomeColorsMixin.java b/src/main/java/ru/betterend/mixin/client/BiomeColorsMixin.java index cce33d52..f88e0c5a 100644 --- a/src/main/java/ru/betterend/mixin/client/BiomeColorsMixin.java +++ b/src/main/java/ru/betterend/mixin/client/BiomeColorsMixin.java @@ -5,13 +5,11 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BiomeColors; import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos.MutableBlockPos; -import net.minecraft.core.Direction; import net.minecraft.world.level.BlockAndTintGetter; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import ru.bclib.util.BlocksHelper; import ru.bclib.util.ColorUtil; import ru.bclib.util.MHelper; import ru.betterend.client.ClientOptions; @@ -27,7 +25,7 @@ public class BiomeColorsMixin { private static final int STREAM_COLOR = ColorUtil.color(105, 213, 244); private static final Point[] OFFSETS; private static final boolean HAS_SODIUM; - + @Inject(method = "getAverageWaterColor", at = @At("RETURN"), cancellable = true) private static void be_getWaterColor(BlockAndTintGetter world, BlockPos pos, CallbackInfoReturnable info) { if (ClientOptions.useSulfurWaterColor()) { @@ -44,10 +42,10 @@ public class BiomeColorsMixin { } } } - + static { HAS_SODIUM = FabricLoader.getInstance().isModLoaded("sodium"); - + int index = 0; OFFSETS = new Point[20]; for (int x = -2; x < 3; x++) { diff --git a/src/main/java/ru/betterend/mixin/client/CapeLayerMixin.java b/src/main/java/ru/betterend/mixin/client/CapeLayerMixin.java index 22a68c0e..8ddbb4cc 100644 --- a/src/main/java/ru/betterend/mixin/client/CapeLayerMixin.java +++ b/src/main/java/ru/betterend/mixin/client/CapeLayerMixin.java @@ -14,7 +14,7 @@ import ru.betterend.item.ArmoredElytra; @Mixin(CapeLayer.class) public class CapeLayerMixin { - + @Inject(method = "render", at = @At("HEAD"), cancellable = true) public void be_checkCustomElytra(PoseStack poseStack, MultiBufferSource multiBufferSource, int i, AbstractClientPlayer abstractClientPlayer, float f, float g, float h, float j, float k, float l, CallbackInfo info) { ItemStack itemStack = abstractClientPlayer.getItemBySlot(EquipmentSlot.CHEST); diff --git a/src/main/java/ru/betterend/mixin/client/ClientPlayNetworkHandlerMixin.java b/src/main/java/ru/betterend/mixin/client/ClientPlayNetworkHandlerMixin.java index 2829daa8..8ab932f4 100644 --- a/src/main/java/ru/betterend/mixin/client/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/ru/betterend/mixin/client/ClientPlayNetworkHandlerMixin.java @@ -20,10 +20,10 @@ public class ClientPlayNetworkHandlerMixin { @Final @Shadow private Minecraft minecraft; - + @Shadow private ClientLevel level; - + @Inject(method = "handleOpenSignEditor", at = @At(value = "HEAD"), cancellable = true) public void be_openSignEditor(ClientboundOpenSignEditorPacket packet, CallbackInfo info) { PacketUtils.ensureRunningOnSameThread(packet, ClientPacketListener.class.cast(this), minecraft); diff --git a/src/main/java/ru/betterend/mixin/client/HumanoidMobRendererMixin.java b/src/main/java/ru/betterend/mixin/client/HumanoidMobRendererMixin.java index f922d7b7..13232b92 100644 --- a/src/main/java/ru/betterend/mixin/client/HumanoidMobRendererMixin.java +++ b/src/main/java/ru/betterend/mixin/client/HumanoidMobRendererMixin.java @@ -13,11 +13,11 @@ import ru.betterend.client.render.ArmoredElytraLayer; @Mixin(HumanoidMobRenderer.class) public abstract class HumanoidMobRendererMixin> extends MobRenderer { - + public HumanoidMobRendererMixin(EntityRendererProvider.Context context, M entityModel, float f) { super(context, entityModel, f); } - + @Inject(method = "(Lnet/minecraft/client/renderer/entity/EntityRendererProvider$Context;Lnet/minecraft/client/model/HumanoidModel;FFFF)V", at = @At("TAIL")) public void be_addCustomLayer(EntityRendererProvider.Context context, M humanoidModel, float f, float g, float h, float i, CallbackInfo ci) { addLayer(new ArmoredElytraLayer<>(this, context.getModelSet())); diff --git a/src/main/java/ru/betterend/mixin/client/LevelRendererMixin.java b/src/main/java/ru/betterend/mixin/client/LevelRendererMixin.java index a49d25da..7ad1fa17 100644 --- a/src/main/java/ru/betterend/mixin/client/LevelRendererMixin.java +++ b/src/main/java/ru/betterend/mixin/client/LevelRendererMixin.java @@ -42,7 +42,7 @@ public class LevelRendererMixin { private static final ResourceLocation HORIZON = BetterEnd.makeID("textures/sky/nebula_1.png"); private static final ResourceLocation STARS = BetterEnd.makeID("textures/sky/stars.png"); private static final ResourceLocation FOG = BetterEnd.makeID("textures/sky/fog.png"); - + private static VertexBuffer stars1; private static VertexBuffer stars2; private static VertexBuffer stars3; @@ -61,21 +61,21 @@ public class LevelRendererMixin { private static float blind02; private static float blind06; private static boolean directOpenGL = false; - + @Shadow @Final private Minecraft minecraft; - + @Shadow @Final private TextureManager textureManager; - + @Shadow private ClientLevel level; - + @Shadow private int ticks; - + @Inject(method = "*", at = @At("TAIL")) private void be_onInit(Minecraft client, RenderBuffers bufferBuilders, CallbackInfo info) { be_initStars(); @@ -88,22 +88,22 @@ public class LevelRendererMixin { axis2.normalize(); axis3.normalize(); axis4.normalize(); - + directOpenGL = FabricLoader.getInstance().isModLoaded("optifabric") || FabricLoader.getInstance().isModLoaded("immersive_portals"); } - + @Inject(method = "renderSky", at = @At("HEAD"), cancellable = true) private void be_renderBetterEndSky(PoseStack matrices, Matrix4f matrix4f, float tickDelta, Runnable runnable, CallbackInfo info) { if (ClientOptions.isCustomSky() && minecraft.level.effects().skyType() == DimensionSpecialEffects.SkyType.END) { runnable.run(); - + time = (ticks % 360000) * 0.000017453292F; time2 = time * 2; time3 = time * 3; - + FogRenderer.levelFogColor(); RenderSystem.enableTexture(); - + if (directOpenGL) { GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glAlphaFunc(516, 0.0F); @@ -114,73 +114,73 @@ public class LevelRendererMixin { RenderSystem.enableBlend(); RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA); } - + float blindA = 1F - BackgroundInfo.blindness; blind02 = blindA * 0.2F; blind06 = blindA * 0.6F; - + if (blindA > 0) { matrices.pushPose(); matrices.mulPose(new Quaternion(0, time, 0, false)); RenderSystem.setShaderTexture(0, HORIZON); be_renderBuffer(matrices, matrix4f, horizon, DefaultVertexFormat.POSITION_TEX, 0.77F, 0.31F, 0.73F, 0.7F * blindA); matrices.popPose(); - + matrices.pushPose(); matrices.mulPose(new Quaternion(0, -time, 0, false)); RenderSystem.setShaderTexture(0, NEBULA_1); be_renderBuffer(matrices, matrix4f, nebulas1, DefaultVertexFormat.POSITION_TEX, 0.77F, 0.31F, 0.73F, blind02); matrices.popPose(); - + matrices.pushPose(); matrices.mulPose(new Quaternion(0, time2, 0, false)); RenderSystem.setShaderTexture(0, NEBULA_2); be_renderBuffer(matrices, matrix4f, nebulas2, DefaultVertexFormat.POSITION_TEX, 0.77F, 0.31F, 0.73F, blind02); matrices.popPose(); - + RenderSystem.setShaderTexture(0, STARS); - + matrices.pushPose(); matrices.mulPose(axis3.rotation(time)); be_renderBuffer(matrices, matrix4f, stars3, DefaultVertexFormat.POSITION_TEX, 0.77F, 0.31F, 0.73F, blind06); matrices.popPose(); - + matrices.pushPose(); matrices.mulPose(axis4.rotation(time2)); be_renderBuffer(matrices, matrix4f, stars4, DefaultVertexFormat.POSITION_TEX, 1F, 1F, 1F, blind06); matrices.popPose(); } - + float a = (BackgroundInfo.fogDensity - 1F); if (a > 0) { if (a > 1) a = 1; RenderSystem.setShaderTexture(0, FOG); be_renderBuffer(matrices, matrix4f, fog, DefaultVertexFormat.POSITION_TEX, BackgroundInfo.fogColorRed, BackgroundInfo.fogColorGreen, BackgroundInfo.fogColorBlue, a); } - + RenderSystem.disableTexture(); - + if (blindA > 0) { matrices.pushPose(); matrices.mulPose(axis1.rotation(time3)); be_renderBuffer(matrices, matrix4f, stars1, DefaultVertexFormat.POSITION, 1, 1, 1, blind06); matrices.popPose(); - + matrices.pushPose(); matrices.mulPose(axis2.rotation(time2)); be_renderBuffer(matrices, matrix4f, stars2, DefaultVertexFormat.POSITION, 0.95F, 0.64F, 0.93F, blind06); matrices.popPose(); } - + RenderSystem.enableTexture(); RenderSystem.depthMask(true); RenderSystem.defaultBlendFunc(); RenderSystem.disableBlend(); - + info.cancel(); } } - + private void be_renderBuffer(PoseStack matrices, Matrix4f matrix4f, VertexBuffer buffer, VertexFormat format, float r, float g, float b, float a) { RenderSystem.setShaderColor(r, g, b, a); if (format == DefaultVertexFormat.POSITION) { @@ -190,7 +190,7 @@ public class LevelRendererMixin { buffer.drawWithShader(matrices.last().pose(), matrix4f, GameRenderer.getPositionTexShader()); } } - + private void be_initStars() { BufferBuilder buffer = Tesselator.getInstance().getBuilder(); stars1 = be_buildBufferStars(buffer, stars1, 0.1, 0.30, 3500, 41315); @@ -202,12 +202,12 @@ public class LevelRendererMixin { horizon = be_buildBufferHorizon(buffer, horizon); fog = be_buildBufferFog(buffer, fog); } - + private VertexBuffer be_buildBufferStars(BufferBuilder bufferBuilder, VertexBuffer buffer, double minSize, double maxSize, int count, long seed) { if (buffer != null) { buffer.close(); } - + //TODO: Test if this is working correct //Format is set in the DrawState //buffer = new VertexBuffer(DefaultVertexFormat.POSITION); @@ -215,70 +215,70 @@ public class LevelRendererMixin { be_makeStars(bufferBuilder, minSize, maxSize, count, seed); bufferBuilder.end(); buffer.upload(bufferBuilder); - + return buffer; } - + private VertexBuffer be_buildBufferUVStars(BufferBuilder bufferBuilder, VertexBuffer buffer, double minSize, double maxSize, int count, long seed) { if (buffer != null) { buffer.close(); } - + // buffer = new VertexBuffer(DefaultVertexFormat.POSITION_TEX); buffer = new VertexBuffer(); be_makeUVStars(bufferBuilder, minSize, maxSize, count, seed); bufferBuilder.end(); buffer.upload(bufferBuilder); - + return buffer; } - + private VertexBuffer be_buildBufferFarFog(BufferBuilder bufferBuilder, VertexBuffer buffer, double minSize, double maxSize, int count, long seed) { if (buffer != null) { buffer.close(); } - + // buffer = new VertexBuffer(DefaultVertexFormat.POSITION_TEX); buffer = new VertexBuffer(); be_makeFarFog(bufferBuilder, minSize, maxSize, count, seed); bufferBuilder.end(); buffer.upload(bufferBuilder); - + return buffer; } - + private VertexBuffer be_buildBufferHorizon(BufferBuilder bufferBuilder, VertexBuffer buffer) { if (buffer != null) { buffer.close(); } - + // buffer = new VertexBuffer(DefaultVertexFormat.POSITION_TEX); buffer = new VertexBuffer(); be_makeCylinder(bufferBuilder, 16, 50, 100); bufferBuilder.end(); buffer.upload(bufferBuilder); - + return buffer; } - + private VertexBuffer be_buildBufferFog(BufferBuilder bufferBuilder, VertexBuffer buffer) { if (buffer != null) { buffer.close(); } - + // buffer = new VertexBuffer(DefaultVertexFormat.POSITION_TEX); buffer = new VertexBuffer(); be_makeCylinder(bufferBuilder, 16, 50, 70); bufferBuilder.end(); buffer.upload(bufferBuilder); - + return buffer; } - + private void be_makeStars(BufferBuilder buffer, double minSize, double maxSize, int count, long seed) { Random random = new Random(seed); buffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION); - + for (int i = 0; i < count; ++i) { double posX = random.nextDouble() * 2.0 - 1.0; double posY = random.nextDouble() * 2.0 - 1.0; @@ -302,7 +302,7 @@ public class LevelRendererMixin { double s = random.nextDouble() * Math.PI * 2.0; double t = Math.sin(s); double u = Math.cos(s); - + for (int v = 0; v < 4; ++v) { double x = (double) ((v & 2) - 1) * size; double y = (double) ((v + 1 & 2) - 1) * size; @@ -317,11 +317,11 @@ public class LevelRendererMixin { } } } - + private void be_makeUVStars(BufferBuilder buffer, double minSize, double maxSize, int count, long seed) { Random random = new Random(seed); buffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX); - + for (int i = 0; i < count; ++i) { double posX = random.nextDouble() * 2.0 - 1.0; double posY = random.nextDouble() * 2.0 - 1.0; @@ -345,7 +345,7 @@ public class LevelRendererMixin { double s = random.nextDouble() * Math.PI * 2.0; double t = Math.sin(s); double u = Math.cos(s); - + int pos = 0; float minV = random.nextInt(4) / 4F; for (int v = 0; v < 4; ++v) { @@ -365,11 +365,11 @@ public class LevelRendererMixin { } } } - + private void be_makeFarFog(BufferBuilder buffer, double minSize, double maxSize, int count, long seed) { Random random = new Random(seed); buffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX); - + for (int i = 0; i < count; ++i) { double posX = random.nextDouble() * 2.0 - 1.0; double posY = random.nextDouble() - 0.5; @@ -397,7 +397,7 @@ public class LevelRendererMixin { double s = random.nextDouble() * Math.PI * 2.0; double t = Math.sin(s); double u = Math.cos(s); - + int pos = 0; for (int v = 0; v < 4; ++v) { double x = (double) ((v & 2) - 1) * size; @@ -416,7 +416,7 @@ public class LevelRendererMixin { } } } - + private void be_makeCylinder(BufferBuilder buffer, int segments, double height, double radius) { buffer.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX); for (int i = 0; i < segments; i++) { @@ -426,10 +426,10 @@ public class LevelRendererMixin { double pz1 = Math.cos(a1) * radius; double px2 = Math.sin(a2) * radius; double pz2 = Math.cos(a2) * radius; - + float u0 = (float) i / (float) segments; float u1 = (float) (i + 1) / (float) segments; - + buffer.vertex(px1, -height, pz1).uv(u0, 0).endVertex(); buffer.vertex(px1, height, pz1).uv(u0, 1).endVertex(); buffer.vertex(px2, height, pz2).uv(u1, 1).endVertex(); diff --git a/src/main/java/ru/betterend/mixin/client/LocalPlayerMixin.java b/src/main/java/ru/betterend/mixin/client/LocalPlayerMixin.java index a631bb40..1280cee3 100644 --- a/src/main/java/ru/betterend/mixin/client/LocalPlayerMixin.java +++ b/src/main/java/ru/betterend/mixin/client/LocalPlayerMixin.java @@ -20,18 +20,16 @@ import ru.betterend.interfaces.FallFlyingItem; @Mixin(LocalPlayer.class) public abstract class LocalPlayerMixin extends AbstractClientPlayer { - + public LocalPlayerMixin(ClientLevel clientLevel, GameProfile gameProfile) { super(clientLevel, gameProfile); } - + @Final @Shadow public ClientPacketListener connection; - - @Inject(method = "aiStep", at = @At(value = "INVOKE", - target = "Lnet/minecraft/client/player/LocalPlayer;getItemBySlot(Lnet/minecraft/world/entity/EquipmentSlot;)Lnet/minecraft/world/item/ItemStack;", - shift = Shift.AFTER)) + + @Inject(method = "aiStep", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;getItemBySlot(Lnet/minecraft/world/entity/EquipmentSlot;)Lnet/minecraft/world/item/ItemStack;", shift = Shift.AFTER)) public void be_aiStep(CallbackInfo info) { ItemStack itemStack = getItemBySlot(EquipmentSlot.CHEST); if (itemStack.getItem() instanceof FallFlyingItem && ElytraItem.isFlyEnabled(itemStack) && tryToStartFallFlying()) { diff --git a/src/main/java/ru/betterend/mixin/client/MinecraftClientMixin.java b/src/main/java/ru/betterend/mixin/client/MinecraftClientMixin.java index 065f18ba..00eb4fa3 100644 --- a/src/main/java/ru/betterend/mixin/client/MinecraftClientMixin.java +++ b/src/main/java/ru/betterend/mixin/client/MinecraftClientMixin.java @@ -1,15 +1,11 @@ package ru.betterend.mixin.client; import net.minecraft.client.Minecraft; -import net.minecraft.client.color.block.BlockColors; -import net.minecraft.client.color.item.ItemColors; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.WinScreen; -import net.minecraft.client.main.GameConfig; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.player.LocalPlayer; -import net.minecraft.core.Registry; import net.minecraft.sounds.Music; import net.minecraft.sounds.Musics; import net.minecraft.world.level.Level; @@ -18,45 +14,24 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import ru.bclib.interfaces.IColorProvider; import ru.bclib.util.MHelper; @Mixin(Minecraft.class) public class MinecraftClientMixin { @Shadow public LocalPlayer player; - + @Shadow public Screen screen; - + @Final @Shadow public Gui gui; - + @Shadow public ClientLevel level; - - @Final - @Shadow - private BlockColors blockColors; - - @Final - @Shadow - private ItemColors itemColors; - - @Inject(method = "*", at = @At("TAIL")) - private void be_onInit(GameConfig args, CallbackInfo info) { - Registry.BLOCK.forEach(block -> { - if (block instanceof IColorProvider) { - IColorProvider provider = (IColorProvider) block; - blockColors.register(provider.getProvider(), block); - itemColors.register(provider.getItemProvider(), block.asItem()); - } - }); - } - + @Inject(method = "getSituationalMusic", at = @At("HEAD"), cancellable = true) private void be_getEndMusic(CallbackInfoReturnable info) { if (!(this.screen instanceof WinScreen) && this.player != null) { @@ -65,7 +40,7 @@ public class MinecraftClientMixin { info.setReturnValue(Musics.END_BOSS); } else { - Music sound = (Music) this.level.getBiomeManager().getNoiseBiomeAtPosition(this.player.blockPosition()).getBackgroundMusic().orElse(Musics.END); + Music sound = this.level.getBiomeManager().getNoiseBiomeAtPosition(this.player.blockPosition()).getBackgroundMusic().orElse(Musics.END); info.setReturnValue(sound); } info.cancel(); diff --git a/src/main/java/ru/betterend/mixin/client/ModelLoaderMixin.java b/src/main/java/ru/betterend/mixin/client/ModelLoaderMixin.java index adba0f1a..19b6d60f 100644 --- a/src/main/java/ru/betterend/mixin/client/ModelLoaderMixin.java +++ b/src/main/java/ru/betterend/mixin/client/ModelLoaderMixin.java @@ -9,12 +9,10 @@ import ru.betterend.world.generator.GeneratorOptions; @Mixin(ModelBakery.class) public abstract class ModelLoaderMixin { - + @ModifyVariable(method = "loadModel", ordinal = 2, at = @At(value = "INVOKE")) public ResourceLocation be_switchModel(ResourceLocation id) { - if (GeneratorOptions.changeChorusPlant() && id.getNamespace().equals("minecraft") && - id.getPath().startsWith("blockstates/") && id.getPath().contains("chorus") && - !id.getPath().contains("custom_")) { + if (GeneratorOptions.changeChorusPlant() && id.getNamespace().equals("minecraft") && id.getPath().startsWith("blockstates/") && id.getPath().contains("chorus") && !id.getPath().contains("custom_")) { id = new ResourceLocation(id.getPath().replace("chorus", "custom_chorus")); } return id; diff --git a/src/main/java/ru/betterend/mixin/client/MusicTrackerMixin.java b/src/main/java/ru/betterend/mixin/client/MusicTrackerMixin.java index 8c631b07..99221b68 100644 --- a/src/main/java/ru/betterend/mixin/client/MusicTrackerMixin.java +++ b/src/main/java/ru/betterend/mixin/client/MusicTrackerMixin.java @@ -1,6 +1,7 @@ package ru.betterend.mixin.client; import net.minecraft.client.Minecraft; +import net.minecraft.client.player.LocalPlayer; import net.minecraft.client.resources.sounds.AbstractSoundInstance; import net.minecraft.client.resources.sounds.SoundInstance; import net.minecraft.client.sounds.MusicManager; @@ -13,7 +14,9 @@ import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import ru.bclib.api.BiomeAPI; import ru.betterend.client.ClientOptions; +import ru.betterend.world.biome.EndBiome; import java.util.Random; @@ -22,26 +25,26 @@ public abstract class MusicTrackerMixin { @Final @Shadow private Minecraft minecraft; - + @Final @Shadow private Random random; - + @Shadow private SoundInstance currentMusic; - + @Shadow private int nextSongDelay; - + private static float volume = 1; private static float srcVolume = 0; private static long time; - + @Inject(method = "tick", at = @At("HEAD"), cancellable = true) public void be_onTick(CallbackInfo info) { if (ClientOptions.blendBiomeMusic()) { Music musicSound = minecraft.getSituationalMusic(); - if (be_checkNullSound(musicSound) && volume > 0 && be_isInEnd() && be_shouldChangeSound(musicSound)) { + if (be_checkNullSound(musicSound) && volume > 0 && be_shouldChangeSound(musicSound) && be_isCorrectBiome()) { if (volume > 0) { if (srcVolume < 0) { srcVolume = currentMusic.getVolume(); @@ -79,19 +82,22 @@ public abstract class MusicTrackerMixin { } } } - - private boolean be_isInEnd() { - return minecraft.level != null && minecraft.level.dimension().equals(Level.END); + + private boolean be_isCorrectBiome() { + if (minecraft.level == null) { + return false; + } + return BiomeAPI.getRenderBiome(minecraft.level.getBiome(minecraft.player.blockPosition())) instanceof EndBiome; } - + private boolean be_shouldChangeSound(Music musicSound) { return currentMusic != null && !musicSound.getEvent().getLocation().equals(this.currentMusic.getLocation()) && musicSound.replaceCurrentMusic(); } - + private boolean be_checkNullSound(Music musicSound) { return musicSound != null && musicSound.getEvent() != null; } - + @Shadow public abstract void startPlaying(Music type); } diff --git a/src/main/java/ru/betterend/mixin/client/PlayerRendererMixin.java b/src/main/java/ru/betterend/mixin/client/PlayerRendererMixin.java index 8c92033c..52cb8ff4 100644 --- a/src/main/java/ru/betterend/mixin/client/PlayerRendererMixin.java +++ b/src/main/java/ru/betterend/mixin/client/PlayerRendererMixin.java @@ -13,11 +13,11 @@ import ru.betterend.client.render.ArmoredElytraLayer; @Mixin(PlayerRenderer.class) public abstract class PlayerRendererMixin extends LivingEntityRenderer> { - + public PlayerRendererMixin(EntityRendererProvider.Context context, PlayerModel entityModel, float f) { super(context, entityModel, f); } - + @Inject(method = "*", at = @At("TAIL")) public void be_addCustomLayer(EntityRendererProvider.Context context, boolean bl, CallbackInfo ci) { addLayer(new ArmoredElytraLayer<>(this, context.getModelSet())); diff --git a/src/main/java/ru/betterend/mixin/common/AnvilMenuMixin.java b/src/main/java/ru/betterend/mixin/common/AnvilMenuMixin.java index 0023d35d..fe443a28 100644 --- a/src/main/java/ru/betterend/mixin/common/AnvilMenuMixin.java +++ b/src/main/java/ru/betterend/mixin/common/AnvilMenuMixin.java @@ -31,11 +31,11 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc private List be_recipes = Collections.emptyList(); private AnvilRecipe be_currentRecipe; private DataSlot anvilLevel; - + public AnvilMenuMixin(int syncId, Inventory playerInventory) { super(MenuType.ANVIL, syncId, playerInventory, ContainerLevelAccess.NULL); } - + @Inject(method = "(ILnet/minecraft/world/entity/player/Inventory;Lnet/minecraft/world/inventory/ContainerLevelAccess;)V", at = @At("TAIL")) public void be_initAnvilLevel(int syncId, Inventory inventory, ContainerLevelAccess context, CallbackInfo info) { this.anvilLevel = addDataSlot(DataSlot.standalone()); @@ -53,17 +53,17 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc anvilLevel.set(1); } } - + @Shadow public abstract void createResult(); - + @Inject(method = "mayPickup", at = @At("HEAD"), cancellable = true) protected void be_canTakeOutput(Player player, boolean present, CallbackInfoReturnable info) { if (be_currentRecipe != null) { info.setReturnValue(be_currentRecipe.checkHammerDurability(inputSlots, player)); } } - + @Inject(method = "onTake", at = @At("HEAD"), cancellable = true) protected void be_onTakeOutput(Player player, ItemStack stack, CallbackInfo info) { if (be_currentRecipe != null) { @@ -87,19 +87,17 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc world.levelEvent(1030, blockPos, 0); } }); - //TODO: no more return, does this still work? - //info.setReturnValue(stack); + info.cancel(); } } - + @Inject(method = "createResult", at = @At("HEAD"), cancellable = true) public void be_updateOutput(CallbackInfo info) { RecipeManager recipeManager = this.player.level.getRecipeManager(); be_recipes = recipeManager.getRecipesFor(AnvilRecipe.TYPE, inputSlots, player.level); if (be_recipes.size() > 0) { int anvilLevel = this.anvilLevel.get(); - be_recipes = be_recipes.stream().filter(recipe -> - anvilLevel >= recipe.getAnvilLevel()).collect(Collectors.toList()); + be_recipes = be_recipes.stream().filter(recipe -> anvilLevel >= recipe.getAnvilLevel()).collect(Collectors.toList()); if (be_recipes.size() > 0) { if (be_currentRecipe == null || !be_recipes.contains(be_currentRecipe)) { be_currentRecipe = be_recipes.get(0); @@ -112,14 +110,14 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc } } } - + @Inject(method = "setItemName", at = @At("HEAD"), cancellable = true) public void be_setNewItemName(String string, CallbackInfo info) { if (be_currentRecipe != null) { info.cancel(); } } - + @Override public boolean clickMenuButton(Player player, int id) { if (id == 0) { @@ -132,24 +130,24 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc } return super.clickMenuButton(player, id); } - + private void be_updateResult() { if (be_currentRecipe == null) return; resultSlots.setItem(0, be_currentRecipe.assemble(inputSlots)); broadcastChanges(); } - + @Override public void be_updateCurrentRecipe(AnvilRecipe recipe) { this.be_currentRecipe = recipe; be_updateResult(); } - + @Override public AnvilRecipe be_getCurrentRecipe() { return be_currentRecipe; } - + @Override public List be_getRecipes() { return be_recipes; diff --git a/src/main/java/ru/betterend/mixin/common/BiomeGenerationSettingsAccessor.java b/src/main/java/ru/betterend/mixin/common/BiomeGenerationSettingsAccessor.java index 8298551f..96243502 100644 --- a/src/main/java/ru/betterend/mixin/common/BiomeGenerationSettingsAccessor.java +++ b/src/main/java/ru/betterend/mixin/common/BiomeGenerationSettingsAccessor.java @@ -13,13 +13,13 @@ import java.util.function.Supplier; public interface BiomeGenerationSettingsAccessor { @Accessor("features") List>>> be_getFeatures(); - + @Accessor("features") void be_setFeatures(List>>> features); - + @Accessor("structureStarts") List>> be_getStructures(); - + @Accessor("structureStarts") void be_setStructures(List>> structures); } diff --git a/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java b/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java index 3ce40d02..3d13e9c4 100644 --- a/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ChorusFlowerBlockMixin.java @@ -35,15 +35,15 @@ import java.util.Random; public abstract class ChorusFlowerBlockMixin extends Block { private static final VoxelShape SHAPE_FULL = Block.box(0, 0, 0, 16, 16, 16); private static final VoxelShape SHAPE_HALF = Block.box(0, 0, 0, 16, 4, 16); - + public ChorusFlowerBlockMixin(Properties settings) { super(settings); } - + @Final @Shadow private ChorusPlantBlock plant; - + @Inject(method = "canSurvive", at = @At("HEAD"), cancellable = true) private void be_canSurvive(BlockState state, LevelReader world, BlockPos pos, CallbackInfoReturnable info) { if (world.getBlockState(pos.below()).is(EndBlocks.CHORUS_NYLIUM)) { @@ -51,7 +51,7 @@ public abstract class ChorusFlowerBlockMixin extends Block { info.cancel(); } } - + @Inject(method = "randomTick", at = @At("HEAD"), cancellable = true) private void be_randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random, CallbackInfo info) { if (world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) { @@ -71,7 +71,7 @@ public abstract class ChorusFlowerBlockMixin extends Block { } } } - + @Inject(method = "generatePlant", at = @At("RETURN"), cancellable = true) private static void be_generatePlant(LevelAccessor world, BlockPos pos, Random random, int size, CallbackInfo info) { BlockState state = world.getBlockState(pos); @@ -79,20 +79,20 @@ public abstract class ChorusFlowerBlockMixin extends Block { BlocksHelper.setWithoutUpdate(world, pos, state.setValue(VanillaBlockProperties.ROOTS, true)); } } - + @Shadow private static boolean allNeighborsEmpty(LevelReader world, BlockPos pos, @Nullable Direction exceptDirection) { return false; } - + @Shadow private void placeGrownFlower(Level world, BlockPos pos, int age) { } - + @Shadow private void placeDeadFlower(Level world, BlockPos pos) { } - + @Override public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { if (GeneratorOptions.changeChorusPlant()) { @@ -102,7 +102,7 @@ public abstract class ChorusFlowerBlockMixin extends Block { return super.getShape(state, world, pos, context); } } - + @Inject(method = "placeDeadFlower", at = @At("HEAD"), cancellable = true) private void be_placeDeadFlower(Level world, BlockPos pos, CallbackInfo info) { BlockState down = world.getBlockState(pos.below()); diff --git a/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java b/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java index 161df5cc..6424310d 100644 --- a/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ChorusPlantBlockMixin.java @@ -29,14 +29,14 @@ public abstract class ChorusPlantBlockMixin extends Block { public ChorusPlantBlockMixin(Properties settings) { super(settings); } - + @Inject(method = "*", at = @At("TAIL")) private void beOnInit(BlockBehaviour.Properties settings, CallbackInfo info) { if (GeneratorOptions.changeChorusPlant()) { this.registerDefaultState(this.defaultBlockState().setValue(VanillaBlockProperties.ROOTS, false)); } } - + @Inject(method = "createBlockStateDefinition", at = @At("TAIL")) private void be_createBlockStateDefinition(StateDefinition.Builder builder, CallbackInfo info) { GeneratorOptions.init(); @@ -44,7 +44,7 @@ public abstract class ChorusPlantBlockMixin extends Block { builder.add(VanillaBlockProperties.ROOTS); } } - + @Inject(method = "getStateForPlacement(Lnet/minecraft/world/item/context/BlockPlaceContext;)Lnet/minecraft/world/level/block/state/BlockState;", at = @At("RETURN"), cancellable = true) private void be_getStateForPlacement(BlockPlaceContext ctx, CallbackInfoReturnable info) { BlockPos pos = ctx.getClickedPos(); @@ -60,11 +60,8 @@ public abstract class ChorusPlantBlockMixin extends Block { info.cancel(); } } - - @Inject(method = "Lnet/minecraft/world/level/block/ChorusPlantBlock;getStateForPlacement" + - "(Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;)" + - "Lnet/minecraft/world/level/block/state/BlockState;", - at = @At("RETURN"), cancellable = true) + + @Inject(method = "Lnet/minecraft/world/level/block/ChorusPlantBlock;getStateForPlacement" + "(Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;)" + "Lnet/minecraft/world/level/block/state/BlockState;", at = @At("RETURN"), cancellable = true) private void be_getStateForPlacement(BlockGetter blockGetter, BlockPos blockPos, CallbackInfoReturnable info) { BlockState plant = info.getReturnValue(); if (plant.is(Blocks.CHORUS_PLANT)) { @@ -85,7 +82,7 @@ public abstract class ChorusPlantBlockMixin extends Block { } } } - + @Inject(method = "canSurvive", at = @At("HEAD"), cancellable = true) private void be_canSurvive(BlockState state, LevelReader world, BlockPos pos, CallbackInfoReturnable info) { BlockState down = world.getBlockState(pos.below()); @@ -94,7 +91,7 @@ public abstract class ChorusPlantBlockMixin extends Block { info.cancel(); } } - + @Inject(method = "updateShape", at = @At("RETURN"), cancellable = true) private void be_updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom, CallbackInfoReturnable info) { BlockState plant = info.getReturnValue(); diff --git a/src/main/java/ru/betterend/mixin/common/ChunkBiomeContainerMixin.java b/src/main/java/ru/betterend/mixin/common/ChunkBiomeContainerMixin.java index 1cd6d74f..d1f953a3 100644 --- a/src/main/java/ru/betterend/mixin/common/ChunkBiomeContainerMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ChunkBiomeContainerMixin.java @@ -19,23 +19,23 @@ public class ChunkBiomeContainerMixin implements IBiomeArray { @Final @Shadow private Biome[] biomes; - + @Final @Shadow private static int WIDTH_BITS; - + @Final @Shadow private static int HORIZONTAL_MASK; - + @Override public void be_setBiome(Biome biome, BlockPos pos) { int biomeX = pos.getX() >> 2; int biomeY = pos.getY() >> 2; int biomeZ = pos.getZ() >> 2; int index = be_getArrayIndex(biomeX, biomeY, biomeZ); - - if (Integrations.hasHydrogen()) { + + if (Integrations.hasHydrogen() && be_shouldWriteToHydrogen()) { try { ChunkBiomeContainer self = (ChunkBiomeContainer) (Object) this; BitStorage storage = be_getHydrogenStorage(self); @@ -69,38 +69,48 @@ public class ChunkBiomeContainerMixin implements IBiomeArray { } return; } - + biomes[index] = biome; } - + @Shadow @Final private int quartMinY; @Shadow @Final private int quartHeight; - + + private boolean be_shouldWriteToHydrogen() { + try { + Field field = ChunkBiomeContainer.class.getDeclaredField("intArray"); + return field != null; + } + catch (NoSuchFieldException e) { + return false; + } + } + private int be_getArrayIndex(int biomeX, int biomeY, int biomeZ) { int i = biomeX & HORIZONTAL_MASK; int j = Mth.clamp(biomeY - this.quartMinY, 0, this.quartHeight); int k = biomeZ & HORIZONTAL_MASK; return j << WIDTH_BITS + WIDTH_BITS | k << WIDTH_BITS | i; } - + private Field be_getField(String name) throws Exception { Field field = ChunkBiomeContainer.class.getDeclaredField(name); field.setAccessible(true); return field; } - + private BitStorage be_getHydrogenStorage(ChunkBiomeContainer container) throws Exception { return (BitStorage) be_getField("intArray").get(container); } - + private Biome[] be_getHydrogenPalette(ChunkBiomeContainer container) throws Exception { return (Biome[]) be_getField("palette").get(container); } - + private int be_getHydrogenPaletteIndex(Biome biome, Biome[] palette) { int index = -1; for (int i = 0; i < palette.length; i++) { @@ -111,11 +121,11 @@ public class ChunkBiomeContainerMixin implements IBiomeArray { } return index; } - + private void be_setHydrogenPalette(ChunkBiomeContainer container, Biome[] palette) throws Exception { be_getField("palette").set(container, palette); } - + private void be_setHydrogenStorage(ChunkBiomeContainer container, BitStorage storage) throws Exception { be_getField("intArray").set(container, storage); } diff --git a/src/main/java/ru/betterend/mixin/common/CraftingMenuMixin.java b/src/main/java/ru/betterend/mixin/common/CraftingMenuMixin.java index 48e81bf2..8dfce982 100644 --- a/src/main/java/ru/betterend/mixin/common/CraftingMenuMixin.java +++ b/src/main/java/ru/betterend/mixin/common/CraftingMenuMixin.java @@ -16,7 +16,7 @@ public abstract class CraftingMenuMixin { @Final @Shadow private ContainerLevelAccess access; - + @Inject(method = "stillValid", at = @At("HEAD"), cancellable = true) private void be_stillValid(Player player, CallbackInfoReturnable info) { if (access.evaluate((world, pos) -> { diff --git a/src/main/java/ru/betterend/mixin/common/DimensionTypeMixin.java b/src/main/java/ru/betterend/mixin/common/DimensionTypeMixin.java index 24520f25..863b38fa 100644 --- a/src/main/java/ru/betterend/mixin/common/DimensionTypeMixin.java +++ b/src/main/java/ru/betterend/mixin/common/DimensionTypeMixin.java @@ -17,10 +17,9 @@ import ru.betterend.world.generator.GeneratorOptions; public class DimensionTypeMixin { @Inject(method = "defaultEndGenerator", at = @At("HEAD"), cancellable = true) private static void be_replaceGenerator(Registry biomeRegistry, Registry chunkGeneratorSettingsRegistry, long seed, CallbackInfoReturnable info) { - info.setReturnValue(new NoiseBasedChunkGenerator(new BetterEndBiomeSource(biomeRegistry, seed), seed, - () -> chunkGeneratorSettingsRegistry.getOrThrow(NoiseGeneratorSettings.END))); + info.setReturnValue(new NoiseBasedChunkGenerator(new BetterEndBiomeSource(biomeRegistry, seed), seed, () -> chunkGeneratorSettingsRegistry.getOrThrow(NoiseGeneratorSettings.END))); } - + @Inject(method = "createDragonFight", at = @At("HEAD"), cancellable = true) private void be_hasEnderDragonFight(CallbackInfoReturnable info) { if (!GeneratorOptions.hasDragonFights()) { diff --git a/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java b/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java index 6a4c95e0..4d85fc64 100644 --- a/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EnchantmentMenuMixin.java @@ -26,35 +26,35 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { @Final @Shadow private Container enchantSlots; - + @Final @Shadow private ContainerLevelAccess access; - + @Final @Shadow private Random random; - + @Final @Shadow private DataSlot enchantmentSeed; - + @Shadow @Final public int[] costs; - + @Shadow @Final public int[] enchantClue; - + @Shadow @Final public int[] levelClue; - + protected EnchantmentMenuMixin(MenuType type, int syncId) { super(type, syncId); } - + @Inject(method = "slotsChanged", at = @At("HEAD"), cancellable = true) private void be_slotsChanged(Container inventory, CallbackInfo info) { if (inventory == this.enchantSlots) { @@ -62,7 +62,7 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { if (!itemStack.isEmpty() && itemStack.isEnchantable()) { this.access.execute((world, blockPos) -> { int i = 0; - + int j; for (j = -1; j <= 1; ++j) { for (int k = -1; k <= 1; ++k) { @@ -70,24 +70,24 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { if (world.getBlockState(blockPos.offset(k * 2, 0, j * 2)).is(TagAPI.BOOKSHELVES)) { ++i; } - + if (world.getBlockState(blockPos.offset(k * 2, 1, j * 2)).is(TagAPI.BOOKSHELVES)) { ++i; } - + if (k != 0 && j != 0) { if (world.getBlockState(blockPos.offset(k * 2, 0, j)).is(TagAPI.BOOKSHELVES)) { ++i; } - + if (world.getBlockState(blockPos.offset(k * 2, 1, j)).is(TagAPI.BOOKSHELVES)) { ++i; } - + if (world.getBlockState(blockPos.offset(k, 0, j * 2)).is(TagAPI.BOOKSHELVES)) { ++i; } - + if (world.getBlockState(blockPos.offset(k, 1, j * 2)).is(TagAPI.BOOKSHELVES)) { ++i; } @@ -95,9 +95,9 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { } } } - + random.setSeed(enchantmentSeed.get()); - + for (j = 0; j < 3; ++j) { costs[j] = EnchantmentHelper.getEnchantmentCost(this.random, j, i, itemStack); enchantClue[j] = -1; @@ -106,7 +106,7 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { costs[j] = 0; } } - + for (j = 0; j < 3; ++j) { if (this.costs[j] > 0) { List list = this.getEnchantmentList(itemStack, j, this.costs[j]); @@ -117,7 +117,7 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { } } } - + broadcastChanges(); }); } @@ -131,7 +131,7 @@ public abstract class EnchantmentMenuMixin extends AbstractContainerMenu { info.cancel(); } } - + @Shadow private List getEnchantmentList(ItemStack stack, int slot, int level) { return null; diff --git a/src/main/java/ru/betterend/mixin/common/EndCityFeatureMixin.java b/src/main/java/ru/betterend/mixin/common/EndCityFeatureMixin.java index 6a53bc32..6ec5f02f 100644 --- a/src/main/java/ru/betterend/mixin/common/EndCityFeatureMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EndCityFeatureMixin.java @@ -35,7 +35,7 @@ public class EndCityFeatureMixin { } } } - + @Shadow private static int getYPositionForFeature(ChunkPos pos, ChunkGenerator chunkGenerator, LevelHeightAccessor levelHeightAccessor) { return 0; diff --git a/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java b/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java index 0ac42423..529ca254 100644 --- a/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java @@ -36,20 +36,20 @@ public class EndDragonFightMixin { @Final @Shadow private ServerLevel level; - + @Shadow private BlockPattern.BlockPatternMatch findExitPortal() { return null; } - + @Shadow private void spawnExitPortal(boolean bl) { } - + @Shadow private void respawnDragon(List list) { } - + @Inject(method = "tryRespawn", at = @At("HEAD"), cancellable = true) private void be_tryRespawnDragon(CallbackInfo info) { if (GeneratorOptions.replacePortal() && GeneratorOptions.hasDragonFights() && this.dragonKilled && this.respawnStage == null) { @@ -64,16 +64,16 @@ public class EndDragonFightMixin { else { LOGGER.debug("Found the exit portal & temporarily using it."); } - + blockPos = portalLocation; } - + List crystals = Lists.newArrayList(); BlockPos center = GeneratorOptions.getPortalPos().above(5); for (Direction dir : BlocksHelper.HORIZONTAL) { BlockPos central = center.relative(dir, 4); List crystalList = level.getEntitiesOfClass(EndCrystal.class, new AABB(central.below(255).south().west(), central.above(255).north().east())); - + int count = crystalList.size(); for (int n = 0; n < count; n++) { EndCrystal crystal = crystalList.get(n); @@ -83,15 +83,15 @@ public class EndDragonFightMixin { n--; } } - + if (crystalList.isEmpty()) { info.cancel(); return; } - + crystals.addAll(crystalList); } - + LOGGER.debug("Found all crystals, respawning dragon."); respawnDragon(crystals); info.cancel(); diff --git a/src/main/java/ru/betterend/mixin/common/EndPodiumFeatureMixin.java b/src/main/java/ru/betterend/mixin/common/EndPodiumFeatureMixin.java index bb88dcc2..911b2a99 100644 --- a/src/main/java/ru/betterend/mixin/common/EndPodiumFeatureMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EndPodiumFeatureMixin.java @@ -30,7 +30,7 @@ public class EndPodiumFeatureMixin { @Final @Shadow private boolean active; - + @Inject(method = "place", at = @At("HEAD"), cancellable = true) private void be_place(FeaturePlaceContext featurePlaceContext, CallbackInfoReturnable info) { if (!GeneratorOptions.hasPortal()) { @@ -49,14 +49,14 @@ public class EndPodiumFeatureMixin { info.cancel(); } } - + @ModifyVariable(method = "place", ordinal = 0, at = @At("HEAD")) private FeaturePlaceContext be_setPosOnGround(FeaturePlaceContext featurePlaceContext) { WorldGenLevel world = featurePlaceContext.level(); BlockPos pos = be_updatePos(featurePlaceContext.origin(), world); return new FeaturePlaceContext(world, featurePlaceContext.chunkGenerator(), featurePlaceContext.random(), pos, featurePlaceContext.config()); } - + private BlockPos be_updatePos(BlockPos blockPos, WorldGenLevel world) { if (GeneratorOptions.useNewGenerator()) { BlockPos pos = GeneratorOptions.getPortalPos(); diff --git a/src/main/java/ru/betterend/mixin/common/EndSpikeMixin.java b/src/main/java/ru/betterend/mixin/common/EndSpikeMixin.java index d29bc07c..fa21aa5e 100644 --- a/src/main/java/ru/betterend/mixin/common/EndSpikeMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EndSpikeMixin.java @@ -17,7 +17,7 @@ public class EndSpikeMixin { @Final @Shadow private int height; - + @Inject(method = "getHeight", at = @At("HEAD"), cancellable = true) private void be_getSpikeHeight(CallbackInfoReturnable info) { if (!GeneratorOptions.isDirectSpikeHeight()) { @@ -30,12 +30,12 @@ public class EndSpikeMixin { info.setReturnValue(maxY); } } - + @Shadow public int getCenterX() { return 0; } - + @Shadow public int getCenterZ() { return 0; diff --git a/src/main/java/ru/betterend/mixin/common/EnderManMixin.java b/src/main/java/ru/betterend/mixin/common/EnderManMixin.java index dc5f1424..ddc807b6 100644 --- a/src/main/java/ru/betterend/mixin/common/EnderManMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EnderManMixin.java @@ -15,8 +15,7 @@ import ru.betterend.effects.EndStatusEffects; public abstract class EnderManMixin { @Inject(method = "isLookingAtMe", at = @At("HEAD"), cancellable = true) private void be_isLookingAtMe(Player player, CallbackInfoReturnable info) { - if (player.isCreative() || player.hasEffect(EndStatusEffects.END_VEIL) || - EnchantmentHelper.getItemEnchantmentLevel(EndEnchantments.END_VEIL, player.getItemBySlot(EquipmentSlot.HEAD)) > 0) { + if (player.isCreative() || player.hasEffect(EndStatusEffects.END_VEIL) || EnchantmentHelper.getItemEnchantmentLevel(EndEnchantments.END_VEIL, player.getItemBySlot(EquipmentSlot.HEAD)) > 0) { info.setReturnValue(false); } } diff --git a/src/main/java/ru/betterend/mixin/common/EntityMixin.java b/src/main/java/ru/betterend/mixin/common/EntityMixin.java index cb37e312..2cd3441a 100644 --- a/src/main/java/ru/betterend/mixin/common/EntityMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EntityMixin.java @@ -21,31 +21,31 @@ public abstract class EntityMixin implements TeleportingEntity { private float yRot; @Shadow private float xRot; - + @Shadow public Level level; - + @Final @Shadow public abstract void unRide(); - + @Shadow public abstract Vec3 getDeltaMovement(); - + @Shadow public abstract EntityType getType(); - + @Shadow protected abstract PortalInfo findDimensionEntryPoint(ServerLevel destination); - + @Shadow protected abstract void removeAfterChangingDimensions(); - + @Shadow public abstract boolean isRemoved(); - + private BlockPos exitPos; - + @Inject(method = "changeDimension", at = @At("HEAD"), cancellable = true) public void be_changeDimension(ServerLevel destination, CallbackInfoReturnable info) { if (!isRemoved() && be_canTeleport() && level instanceof ServerLevel) { @@ -61,10 +61,10 @@ public abstract class EntityMixin implements TeleportingEntity { entity.moveTo(teleportTarget.pos.x, teleportTarget.pos.y, teleportTarget.pos.z, teleportTarget.yRot, entity.getXRot()); entity.setDeltaMovement(teleportTarget.speed); //TODO: check if this works as intended in 1.17 - + destination.addDuringTeleport(entity); } - + this.removeAfterChangingDimensions(); level.getProfiler().pop(); ((ServerLevel) level).resetEmptyTime(); @@ -75,24 +75,24 @@ public abstract class EntityMixin implements TeleportingEntity { } } } - + @Inject(method = "findDimensionEntryPoint", at = @At("HEAD"), cancellable = true) protected void be_findDimensionEntryPoint(ServerLevel destination, CallbackInfoReturnable info) { if (be_canTeleport()) { info.setReturnValue(new PortalInfo(new Vec3(exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5), getDeltaMovement(), yRot, xRot)); } } - + @Override public void be_setExitPos(BlockPos pos) { this.exitPos = pos.immutable(); } - + @Override public void be_resetExitPos() { this.exitPos = null; } - + @Override public boolean be_canTeleport() { return this.exitPos != null; diff --git a/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java b/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java index c78eda16..6896ff44 100644 --- a/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java +++ b/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java @@ -39,39 +39,39 @@ import java.util.Collection; @Mixin(LivingEntity.class) public abstract class LivingEntityMixin extends Entity { - + public LivingEntityMixin(EntityType entityType, Level level) { super(entityType, level); } - + @Shadow protected int fallFlyTicks; - + @Shadow public abstract boolean hasEffect(MobEffect mobEffect); - + @Shadow public abstract ItemStack getItemBySlot(EquipmentSlot equipmentSlot); - + @Shadow public abstract void calculateEntityAnimation(LivingEntity livingEntity, boolean b); - + @Shadow protected abstract SoundEvent getFallDamageSound(int i); - + @Shadow public abstract boolean isFallFlying(); - + @Shadow public abstract AttributeMap getAttributes(); - + private Entity lastAttacker; - + @Inject(method = "createLivingAttributes", at = @At("RETURN"), cancellable = true) private static void be_addLivingAttributes(CallbackInfoReturnable info) { EndAttributes.addLivingEntityAttributes(info.getReturnValue()); } - + @Inject(method = "tickEffects", at = @At("HEAD")) protected void be_applyEffects(CallbackInfo info) { if (!level.isClientSide()) { @@ -86,7 +86,7 @@ public abstract class LivingEntityMixin extends Entity { }); } } - + @Inject(method = "canBeAffected", at = @At("HEAD"), cancellable = true) public void be_canBeAffected(MobEffectInstance mobEffectInstance, CallbackInfoReturnable info) { try { @@ -98,12 +98,12 @@ public abstract class LivingEntityMixin extends Entity { BetterEnd.LOGGER.warning("Blindness resistance attribute haven't been registered."); } } - + @Inject(method = "hurt", at = @At("HEAD")) public void be_hurt(DamageSource source, float amount, CallbackInfoReturnable info) { this.lastAttacker = source.getEntity(); } - + @ModifyArg(method = "hurt", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;knockback(DDD)V"), index = 0) private double be_increaseKnockback(double value, double x, double z) { if (lastAttacker != null && lastAttacker instanceof LivingEntity) { @@ -112,7 +112,7 @@ public abstract class LivingEntityMixin extends Entity { } return value; } - + @Inject(method = "updateFallFlying", at = @At("HEAD"), cancellable = true) private void be_updateFallFlying(CallbackInfo info) { ItemStack itemStack = getItemBySlot(EquipmentSlot.CHEST); @@ -121,8 +121,7 @@ public abstract class LivingEntityMixin extends Entity { if (isFlying && !onGround && !isPassenger() && !hasEffect(MobEffects.LEVITATION)) { if (ElytraItem.isFlyEnabled(itemStack)) { if ((fallFlyTicks + 1) % 20 == 0) { - itemStack.hurtAndBreak(1, LivingEntity.class.cast(this), - livingEntity -> livingEntity.broadcastBreakEvent(EquipmentSlot.CHEST)); + itemStack.hurtAndBreak(1, LivingEntity.class.cast(this), livingEntity -> livingEntity.broadcastBreakEvent(EquipmentSlot.CHEST)); } isFlying = true; } @@ -137,10 +136,8 @@ public abstract class LivingEntityMixin extends Entity { info.cancel(); } } - - @Inject(method = "travel", at = @At(value = "INVOKE", - target = "Lnet/minecraft/world/entity/LivingEntity;isFallFlying()Z", - shift = Shift.AFTER), cancellable = true) + + @Inject(method = "travel", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;isFallFlying()Z", shift = Shift.AFTER), cancellable = true) public void be_travel(Vec3 vec3, CallbackInfo info) { ItemStack itemStack = getItemBySlot(EquipmentSlot.CHEST); if (isFallFlying() && itemStack.getItem() instanceof FallFlyingItem) { @@ -148,7 +145,7 @@ public abstract class LivingEntityMixin extends Entity { if (moveDelta.y > -0.5D) { fallDistance = 1.0F; } - + Vec3 lookAngle = getLookAngle(); double d = 0.08D; float rotX = getXRot() * 0.017453292F; @@ -163,12 +160,12 @@ public abstract class LivingEntityMixin extends Entity { coef = moveDelta.y * -0.1D * (double) n; moveDelta = moveDelta.add(lookAngle.x * coef / k, coef, lookAngle.z * coef / k); } - + if (rotX < 0.0F && k > 0.0D) { coef = l * (double) (-Mth.sin(rotX)) * 0.04D; moveDelta = moveDelta.add(-lookAngle.x * coef / k, coef * 3.2D, -lookAngle.z * coef / k); } - + if (k > 0.0D) { moveDelta = moveDelta.add((lookAngle.x / k * l - moveDelta.x) * 0.1D, 0.0D, (lookAngle.z / k * l - moveDelta.z) * 0.1D); } @@ -191,12 +188,12 @@ public abstract class LivingEntityMixin extends Entity { setSharedFlag(7, false); } } - + calculateEntityAnimation(LivingEntity.class.cast(this), this instanceof FlyingAnimal); info.cancel(); } } - + private double be_getKnockback(Item tool) { if (tool == null) return 0.0D; Collection modifiers = tool.getDefaultAttributeModifiers(EquipmentSlot.MAINHAND).get(Attributes.ATTACK_KNOCKBACK); diff --git a/src/main/java/ru/betterend/mixin/common/MinecraftServerMixin.java b/src/main/java/ru/betterend/mixin/common/MinecraftServerMixin.java index a425eaa0..84575b1c 100644 --- a/src/main/java/ru/betterend/mixin/common/MinecraftServerMixin.java +++ b/src/main/java/ru/betterend/mixin/common/MinecraftServerMixin.java @@ -24,15 +24,15 @@ import java.util.Map; public abstract class MinecraftServerMixin { @Shadow private ServerResources resources; - + @Final @Shadow private Map, ServerLevel> levels; - + @Final @Shadow protected WorldData worldData; - + @Inject(method = "overworld", at = @At(value = "HEAD"), cancellable = true) private void be_overworld(CallbackInfoReturnable info) { if (GeneratorOptions.swapOverworldToEnd()) { @@ -44,7 +44,7 @@ public abstract class MinecraftServerMixin { info.cancel(); } } - + @Inject(method = "createLevels", at = @At(value = "TAIL")) private void be_createLevels(ChunkProgressListener worldGenerationProgressListener, CallbackInfo info) { if (GeneratorOptions.swapOverworldToEnd()) { @@ -59,21 +59,21 @@ public abstract class MinecraftServerMixin { setInitialSpawn(world, serverWorldProperties, generatorOptions.generateBonusChest(), bl); } } - + @Shadow private static void setInitialSpawn(ServerLevel serverLevel, ServerLevelData serverLevelData, boolean bl, boolean bl2) { } - + ; - + @Inject(method = "setInitialSpawn", at = @At(value = "HEAD"), cancellable = true) private static void be_setInitialSpawn(ServerLevel world, ServerLevelData serverWorldProperties, boolean bonusChest, boolean debugWorld, CallbackInfo info) { if (GeneratorOptions.swapOverworldToEnd() && world.dimension() == Level.OVERWORLD) { info.cancel(); } } - - + + @Shadow public PlayerList getPlayerList() { return null; diff --git a/src/main/java/ru/betterend/mixin/common/NoiseBasedChunkGeneratorMixin.java b/src/main/java/ru/betterend/mixin/common/NoiseBasedChunkGeneratorMixin.java index e03b2975..aa8b7619 100644 --- a/src/main/java/ru/betterend/mixin/common/NoiseBasedChunkGeneratorMixin.java +++ b/src/main/java/ru/betterend/mixin/common/NoiseBasedChunkGeneratorMixin.java @@ -21,16 +21,16 @@ public abstract class NoiseBasedChunkGeneratorMixin extends ChunkGenerator { @Final @Shadow protected Supplier settings; - + public NoiseBasedChunkGeneratorMixin(BiomeSource populationSource, BiomeSource biomeSource, StructureSettings structuresConfig, long worldSeed) { super(populationSource, biomeSource, structuresConfig, worldSeed); } - + @Inject(method = "(Lnet/minecraft/world/level/biome/BiomeSource;Lnet/minecraft/world/level/biome/BiomeSource;JLjava/util/function/Supplier;)V", at = @At("TAIL")) private void beOnInit(BiomeSource populationSource, BiomeSource biomeSource, long seed, Supplier settings, CallbackInfo info) { TerrainGenerator.initNoise(seed); } - + @Inject(method = "fillNoiseColumn([DIIII)V", at = @At("HEAD"), cancellable = true, allow = 2) private void be_fillNoiseColumn(double[] buffer, int x, int z, int k, int l, CallbackInfo info) { if (GeneratorOptions.useNewGenerator() && settings.get().stable(NoiseGeneratorSettings.END)) { diff --git a/src/main/java/ru/betterend/mixin/common/PlayerAdvancementsMixin.java b/src/main/java/ru/betterend/mixin/common/PlayerAdvancementsMixin.java index 61042c36..2d6b56f2 100644 --- a/src/main/java/ru/betterend/mixin/common/PlayerAdvancementsMixin.java +++ b/src/main/java/ru/betterend/mixin/common/PlayerAdvancementsMixin.java @@ -15,11 +15,8 @@ import ru.betterend.events.PlayerAdvancementsCallback; public abstract class PlayerAdvancementsMixin { @Shadow private ServerPlayer player; - - @Inject(method = "award", at = @At( - value = "INVOKE", - target = "Lnet/minecraft/advancements/AdvancementRewards;grant(Lnet/minecraft/server/level/ServerPlayer;)V", - shift = Shift.AFTER)) + + @Inject(method = "award", at = @At(value = "INVOKE", target = "Lnet/minecraft/advancements/AdvancementRewards;grant(Lnet/minecraft/server/level/ServerPlayer;)V", shift = Shift.AFTER)) public void be_award(Advancement advancement, String criterionName, CallbackInfoReturnable info) { PlayerAdvancementsCallback.PLAYER_ADVANCEMENT_COMPLETE.invoker().onAdvancementComplete(player, advancement, criterionName); } diff --git a/src/main/java/ru/betterend/mixin/common/PlayerListMixin.java b/src/main/java/ru/betterend/mixin/common/PlayerListMixin.java index 03ac97f4..7990da91 100644 --- a/src/main/java/ru/betterend/mixin/common/PlayerListMixin.java +++ b/src/main/java/ru/betterend/mixin/common/PlayerListMixin.java @@ -62,26 +62,26 @@ public class PlayerListMixin { @Final @Shadow private static Logger LOGGER; - + @Final @Shadow private MinecraftServer server; - + @Final @Shadow private RegistryAccess.RegistryHolder registryHolder; - + @Shadow private int viewDistance; - + @Final @Shadow private List players; - + @Final @Shadow private Map playersByUUID; - + @Inject(method = "placeNewPlayer", at = @At(value = "HEAD"), cancellable = true) public void be_placeNewPlayer(Connection connection, ServerPlayer serverPlayer, CallbackInfo info) { if (GeneratorOptions.swapOverworldToEnd()) { @@ -101,7 +101,7 @@ public class PlayerListMixin { else { var23 = Level.END; } - + ResourceKey registryKey = var23; ServerLevel serverLevel = this.server.getLevel(registryKey); ServerLevel serverLevel3; @@ -112,39 +112,29 @@ public class PlayerListMixin { else { serverLevel3 = serverLevel; } - + serverPlayer.setLevel(serverLevel3); //serverPlayer.gameMode.setLevel((ServerLevel) serverPlayer.level); String string2 = "local"; if (connection.getRemoteAddress() != null) { string2 = connection.getRemoteAddress().toString(); } - - LOGGER.info("{}[{}] logged in with entity id {} at ({}, {}, {})", serverPlayer.getName().getString(), string2, - serverPlayer.getId(), serverPlayer.getX(), serverPlayer.getY(), serverPlayer.getZ()); + + LOGGER.info("{}[{}] logged in with entity id {} at ({}, {}, {})", serverPlayer.getName().getString(), string2, serverPlayer.getId(), serverPlayer.getX(), serverPlayer.getY(), serverPlayer.getZ()); LevelData worldProperties = serverLevel3.getLevelData(); serverPlayer.loadGameTypes(compoundTag); //this.updatePlayerGameMode(serverPlayer, (ServerPlayer) null, serverLevel3); - ServerGamePacketListenerImpl serverPlayNetworkHandler = new ServerGamePacketListenerImpl(this.server, - connection, serverPlayer); + ServerGamePacketListenerImpl serverPlayNetworkHandler = new ServerGamePacketListenerImpl(this.server, connection, serverPlayer); GameRules gameRules = serverLevel3.getGameRules(); boolean bl = gameRules.getBoolean(GameRules.RULE_DO_IMMEDIATE_RESPAWN); boolean bl2 = gameRules.getBoolean(GameRules.RULE_REDUCEDDEBUGINFO); - serverPlayNetworkHandler.send(new ClientboundLoginPacket(serverPlayer.getId(), - serverPlayer.gameMode.getGameModeForPlayer(), serverPlayer.gameMode.getPreviousGameModeForPlayer(), - BiomeManager.obfuscateSeed(serverLevel3.getSeed()), worldProperties.isHardcore(), - this.server.levelKeys(), this.registryHolder, serverLevel3.dimensionType(), serverLevel3.dimension(), - this.getMaxPlayers(), this.viewDistance, bl2, !bl, serverLevel3.isDebug(), serverLevel3.isFlat())); - serverPlayNetworkHandler.send(new ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.BRAND, - (new FriendlyByteBuf(Unpooled.buffer())).writeUtf(this.getServer().getServerModName()))); - serverPlayNetworkHandler - .send(new ClientboundChangeDifficultyPacket(worldProperties.getDifficulty(), worldProperties.isDifficultyLocked())); + serverPlayNetworkHandler.send(new ClientboundLoginPacket(serverPlayer.getId(), serverPlayer.gameMode.getGameModeForPlayer(), serverPlayer.gameMode.getPreviousGameModeForPlayer(), BiomeManager.obfuscateSeed(serverLevel3.getSeed()), worldProperties.isHardcore(), this.server.levelKeys(), this.registryHolder, serverLevel3.dimensionType(), serverLevel3.dimension(), this.getMaxPlayers(), this.viewDistance, bl2, !bl, serverLevel3.isDebug(), serverLevel3.isFlat())); + serverPlayNetworkHandler.send(new ClientboundCustomPayloadPacket(ClientboundCustomPayloadPacket.BRAND, (new FriendlyByteBuf(Unpooled.buffer())).writeUtf(this.getServer().getServerModName()))); + serverPlayNetworkHandler.send(new ClientboundChangeDifficultyPacket(worldProperties.getDifficulty(), worldProperties.isDifficultyLocked())); serverPlayNetworkHandler.send(new ClientboundPlayerAbilitiesPacket(serverPlayer.getAbilities())); serverPlayNetworkHandler.send(new ClientboundSetCarriedItemPacket(serverPlayer.getInventory().selected)); - serverPlayNetworkHandler - .send(new ClientboundUpdateRecipesPacket(this.server.getRecipeManager().getRecipes())); - serverPlayNetworkHandler - .send(new ClientboundUpdateTagsPacket(this.server.getTags().serializeToNetwork(this.registryHolder))); + serverPlayNetworkHandler.send(new ClientboundUpdateRecipesPacket(this.server.getRecipeManager().getRecipes())); + serverPlayNetworkHandler.send(new ClientboundUpdateTagsPacket(this.server.getTags().serializeToNetwork(this.registryHolder))); this.sendPlayerPermissionLevel(serverPlayer); serverPlayer.getStats().markAllDirty(); serverPlayer.getRecipeBook().sendInitialRecipeBook(serverPlayer); @@ -152,46 +142,38 @@ public class PlayerListMixin { this.server.invalidateStatus(); TranslatableComponent mutableText2; if (serverPlayer.getGameProfile().getName().equalsIgnoreCase(string)) { - mutableText2 = new TranslatableComponent("multiplayer.player.joined", - new Object[]{serverPlayer.getDisplayName()}); + mutableText2 = new TranslatableComponent("multiplayer.player.joined", new Object[]{serverPlayer.getDisplayName()}); } else { - mutableText2 = new TranslatableComponent("multiplayer.player.joined.renamed", - new Object[]{serverPlayer.getDisplayName(), string}); + mutableText2 = new TranslatableComponent("multiplayer.player.joined.renamed", new Object[]{serverPlayer.getDisplayName(), string}); } - + this.broadcastMessage(mutableText2.withStyle(ChatFormatting.YELLOW), ChatType.SYSTEM, Util.NIL_UUID); - serverPlayNetworkHandler.teleport(serverPlayer.getX(), serverPlayer.getY(), serverPlayer.getZ(), - serverPlayer.getYRot(), serverPlayer.getXRot()); + serverPlayNetworkHandler.teleport(serverPlayer.getX(), serverPlayer.getY(), serverPlayer.getZ(), serverPlayer.getYRot(), serverPlayer.getXRot()); this.players.add(serverPlayer); this.playersByUUID.put(serverPlayer.getUUID(), serverPlayer); - this.broadcastAll(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, - new ServerPlayer[]{serverPlayer})); - + this.broadcastAll(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, new ServerPlayer[]{serverPlayer})); + for (ServerPlayer player : this.players) { - serverPlayer.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, - new ServerPlayer[]{(ServerPlayer) player})); + serverPlayer.connection.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, new ServerPlayer[]{(ServerPlayer) player})); } - + serverLevel3.addNewPlayer(serverPlayer); this.server.getCustomBossEvents().onPlayerConnect(serverPlayer); this.sendLevelInfo(serverPlayer, serverLevel3); if (!this.server.getResourcePack().isEmpty()) { - serverPlayer.sendTexturePack(this.server.getResourcePack(), this.server.getResourcePackHash(), - this.server.isResourcePackRequired(), this.server.getResourcePackPrompt()); + serverPlayer.sendTexturePack(this.server.getResourcePack(), this.server.getResourcePackHash(), this.server.isResourcePackRequired(), this.server.getResourcePackPrompt()); } - + for (MobEffectInstance statusEffectInstance : serverPlayer.getActiveEffects()) { - serverPlayNetworkHandler - .send(new ClientboundUpdateMobEffectPacket(serverPlayer.getId(), statusEffectInstance)); + serverPlayNetworkHandler.send(new ClientboundUpdateMobEffectPacket(serverPlayer.getId(), statusEffectInstance)); } - + if (compoundTag != null && compoundTag.contains("RootVehicle", 10)) { CompoundTag compoundTag2 = compoundTag.getCompound("RootVehicle"); - Entity entity = EntityType.loadEntityRecursive(compoundTag2.getCompound("Entity"), serverLevel3, - (vehicle) -> { - return !serverLevel3.addWithUUID(vehicle) ? null : vehicle; - }); + Entity entity = EntityType.loadEntityRecursive(compoundTag2.getCompound("Entity"), serverLevel3, (vehicle) -> { + return !serverLevel3.addWithUUID(vehicle) ? null : vehicle; + }); if (entity != null) { UUID uUID2; if (compoundTag2.hasUUID("Attach")) { @@ -200,7 +182,7 @@ public class PlayerListMixin { else { uUID2 = null; } - + Iterator var21; Entity entity3; if (entity.getUUID().equals(uUID2)) { @@ -208,7 +190,7 @@ public class PlayerListMixin { } else { var21 = entity.getIndirectPassengers().iterator(); - + while (var21.hasNext()) { entity3 = (Entity) var21.next(); if (entity3.getUUID().equals(uUID2)) { @@ -217,12 +199,12 @@ public class PlayerListMixin { } } } - + if (!serverPlayer.isPassenger()) { LOGGER.warn("Couldn't reattach entity to player"); entity.discard(); var21 = entity.getIndirectPassengers().iterator(); - + while (var21.hasNext()) { entity3 = (Entity) var21.next(); entity3.discard(); @@ -230,51 +212,51 @@ public class PlayerListMixin { } } } - + serverPlayer.initInventoryMenu(); info.cancel(); } } - + @Shadow public CompoundTag load(ServerPlayer player) { return null; } - + // @Shadow // private void updatePlayerGameMode(ServerPlayer player, @Nullable ServerPlayer oldPlayer, ServerLevel world) {} - + @Shadow public void sendPlayerPermissionLevel(ServerPlayer player) { } - + @Shadow public int getPlayerCount() { return 0; } - + @Shadow public int getMaxPlayers() { return 0; } - + @Shadow public MinecraftServer getServer() { return null; } - + @Shadow protected void updateEntireScoreboard(ServerScoreboard scoreboard, ServerPlayer player) { } - + @Shadow public void broadcastMessage(Component message, ChatType type, UUID senderUuid) { } - + @Shadow public void broadcastAll(Packet packet) { } - + @Shadow public void sendLevelInfo(ServerPlayer player, ServerLevel world) { } diff --git a/src/main/java/ru/betterend/mixin/common/PlayerMixin.java b/src/main/java/ru/betterend/mixin/common/PlayerMixin.java index 64ffafc3..be4b79a4 100644 --- a/src/main/java/ru/betterend/mixin/common/PlayerMixin.java +++ b/src/main/java/ru/betterend/mixin/common/PlayerMixin.java @@ -28,13 +28,13 @@ import java.util.Optional; @Mixin(Player.class) public abstract class PlayerMixin extends LivingEntity { - + protected PlayerMixin(EntityType entityType, Level level) { super(entityType, level); } - + private static Direction[] horizontal; - + @Inject(method = "findRespawnPositionAndUseSpawnBlock", at = @At(value = "HEAD"), cancellable = true) private static void be_findRespawnPositionAndUseSpawnBlock(ServerLevel world, BlockPos pos, float f, boolean bl, boolean bl2, CallbackInfoReturnable> info) { BlockState blockState = world.getBlockState(pos); @@ -43,7 +43,7 @@ public abstract class PlayerMixin extends LivingEntity { info.cancel(); } } - + @Inject(method = "tryToStartFallFlying", at = @At("HEAD"), cancellable = true) public void be_tryToStartFlying(CallbackInfoReturnable info) { if (!onGround && !isFallFlying() && !isInWater() && !hasEffect(MobEffects.LEVITATION)) { @@ -54,7 +54,7 @@ public abstract class PlayerMixin extends LivingEntity { } } } - + private static Optional be_obeliskRespawnPosition(ServerLevel world, BlockPos pos, BlockState state) { if (state.getValue(BlockProperties.TRIPLE_SHAPE) == TripleShape.TOP) { pos = pos.below(2); diff --git a/src/main/java/ru/betterend/mixin/common/ServerLevelMixin.java b/src/main/java/ru/betterend/mixin/common/ServerLevelMixin.java index d9c184da..ea3899b2 100644 --- a/src/main/java/ru/betterend/mixin/common/ServerLevelMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ServerLevelMixin.java @@ -35,22 +35,22 @@ import java.util.function.Supplier; @Mixin(ServerLevel.class) public abstract class ServerLevelMixin extends Level { private static String be_lastWorld = null; - + protected ServerLevelMixin(WritableLevelData writableLevelData, ResourceKey resourceKey, DimensionType dimensionType, Supplier supplier, boolean bl, boolean bl2, long l) { super(writableLevelData, resourceKey, dimensionType, supplier, bl, bl2, l); } - + @Inject(method = "*", at = @At("TAIL")) private void be_onServerWorldInit(MinecraftServer server, Executor workerExecutor, LevelStorageSource.LevelStorageAccess session, ServerLevelData properties, ResourceKey registryKey, DimensionType dimensionType, ChunkProgressListener worldGenerationProgressListener, ChunkGenerator chunkGenerator, boolean debugWorld, long l, List list, boolean bl, CallbackInfo info) { if (be_lastWorld != null && be_lastWorld.equals(session.getLevelId())) { return; } - + be_lastWorld = session.getLevelId(); ServerLevel world = ServerLevel.class.cast(this); EndBiomes.onWorldLoad(world.getSeed()); } - + @Inject(method = "getSharedSpawnPos", at = @At("HEAD"), cancellable = true) private void be_getSharedSpawnPos(CallbackInfoReturnable info) { if (GeneratorOptions.changeSpawn()) { @@ -60,14 +60,8 @@ public abstract class ServerLevelMixin extends Level { } } } - - @ModifyArg( - method = "tickChunk", - at = @At( - value = "INVOKE", - target = "Lnet/minecraft/server/level/ServerLevel;setBlockAndUpdate(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;)Z" - ) - ) + + @ModifyArg(method = "tickChunk", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/ServerLevel;setBlockAndUpdate(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;)Z")) private BlockState be_modifyTickState(BlockPos pos, BlockState state) { if (state.is(Blocks.ICE)) { ResourceLocation biome = BiomeAPI.getBiomeID(getBiome(pos)); diff --git a/src/main/java/ru/betterend/mixin/common/ServerPlayerMixin.java b/src/main/java/ru/betterend/mixin/common/ServerPlayerMixin.java index 9095fb5f..32a57518 100644 --- a/src/main/java/ru/betterend/mixin/common/ServerPlayerMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ServerPlayerMixin.java @@ -49,28 +49,28 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt private int lastSentFood; @Shadow private int lastSentExp; - + private BlockPos exitPos; private int be_teleportDelay = 0; - + public ServerPlayerMixin(Level world, BlockPos pos, float yaw, GameProfile profile) { super(world, pos, yaw, profile); } - + @Inject(method = "createEndPlatform", at = @At("HEAD"), cancellable = true) private void be_createEndSpawnPlatform(ServerLevel world, BlockPos centerPos, CallbackInfo info) { if (!GeneratorOptions.generateObsidianPlatform()) { info.cancel(); } } - + @Inject(method = "findDimensionEntryPoint", at = @At("HEAD"), cancellable = true) protected void be_getTeleportTarget(ServerLevel destination, CallbackInfoReturnable info) { if (be_canTeleport()) { info.setReturnValue(new PortalInfo(new Vec3(exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5), getDeltaMovement(), getYRot(), getXRot())); } } - + @Inject(method = "changeDimension", at = @At("HEAD"), cancellable = true) public void be_changeDimension(ServerLevel destination, CallbackInfoReturnable info) { if (be_canTeleport() && level instanceof ServerLevel) { @@ -78,8 +78,7 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt ServerLevel serverWorld = getLevel(); LevelData worldProperties = destination.getLevelData(); ServerPlayer player = ServerPlayer.class.cast(this); - connection.send(new ClientboundRespawnPacket(destination.dimensionType(), destination.dimension(), BiomeManager.obfuscateSeed(destination.getSeed()), - gameMode.getGameModeForPlayer(), gameMode.getPreviousGameModeForPlayer(), destination.isDebug(), destination.isFlat(), true)); + connection.send(new ClientboundRespawnPacket(destination.dimensionType(), destination.dimension(), BiomeManager.obfuscateSeed(destination.getSeed()), gameMode.getGameModeForPlayer(), gameMode.getPreviousGameModeForPlayer(), destination.isDebug(), destination.isFlat(), true)); connection.send(new ClientboundChangeDifficultyPacket(worldProperties.getDifficulty(), worldProperties.isDifficultyLocked())); PlayerList playerManager = server.getPlayerList(); playerManager.sendPlayerPermissionLevel(player); @@ -100,11 +99,11 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt connection.send(new ClientboundPlayerAbilitiesPacket(getAbilities())); playerManager.sendLevelInfo(player, destination); playerManager.sendAllPlayerInfo(player); - + for (MobEffectInstance statusEffectInstance : getActiveEffects()) { connection.send(new ClientboundUpdateMobEffectPacket(getId(), statusEffectInstance)); } - + connection.send(new ClientboundLevelEventPacket(1032, BlockPos.ZERO, 0, false)); lastSentExp = -1; lastSentHealth = -1.0F; @@ -115,12 +114,12 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt info.setReturnValue(player); } } - + @Inject(method = "tick", at = @At("TAIL")) public void be_decreaseCooldawn(CallbackInfo info) { if (be_teleportDelay > 0) be_teleportDelay--; } - + @Override public int getDimensionChangingDelay() { if (be_teleportDelay > 0) { @@ -128,27 +127,27 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt } return super.getDimensionChangingDelay(); } - + @Shadow public abstract ServerLevel getLevel(); - + @Shadow abstract void triggerDimensionChangeTriggers(ServerLevel origin); - + @Shadow @Override protected abstract PortalInfo findDimensionEntryPoint(ServerLevel destination); - + @Override public void be_setExitPos(BlockPos pos) { this.exitPos = pos.immutable(); } - + @Override public void be_resetExitPos() { this.exitPos = null; } - + @Override public boolean be_canTeleport() { return this.exitPos != null; diff --git a/src/main/java/ru/betterend/mixin/common/ShuffelingListMixin.java b/src/main/java/ru/betterend/mixin/common/ShuffelingListMixin.java index 22b95808..840c8e35 100644 --- a/src/main/java/ru/betterend/mixin/common/ShuffelingListMixin.java +++ b/src/main/java/ru/betterend/mixin/common/ShuffelingListMixin.java @@ -13,14 +13,14 @@ public abstract class ShuffelingListMixin implements ShuffelingListExtended> entries; - + public boolean isEmpty() { return this.entries.isEmpty(); } - + @Shadow public abstract ShufflingList shuffle(); - + public U getOne() { return this.shuffle().stream().findFirst().orElseThrow(RuntimeException::new); } diff --git a/src/main/java/ru/betterend/mixin/common/SlimeMixin.java b/src/main/java/ru/betterend/mixin/common/SlimeMixin.java index b57d2c19..0787e522 100644 --- a/src/main/java/ru/betterend/mixin/common/SlimeMixin.java +++ b/src/main/java/ru/betterend/mixin/common/SlimeMixin.java @@ -13,16 +13,16 @@ public abstract class SlimeMixin extends Entity implements ISlime { public SlimeMixin(EntityType entityType, Level level) { super(entityType, level); } - + @Shadow protected void setSize(int size, boolean heal) { } - + @Override public void be_setSlimeSize(int size, boolean heal) { setSize(size, heal); } - + @Override public void entityRemove(Entity.RemovalReason removalReason) { super.remove(removalReason); diff --git a/src/main/java/ru/betterend/mixin/common/SpikeFeatureMixin.java b/src/main/java/ru/betterend/mixin/common/SpikeFeatureMixin.java index 80f3eefa..956c402b 100644 --- a/src/main/java/ru/betterend/mixin/common/SpikeFeatureMixin.java +++ b/src/main/java/ru/betterend/mixin/common/SpikeFeatureMixin.java @@ -38,14 +38,14 @@ public class SpikeFeatureMixin { info.setReturnValue(false); } } - + @Inject(method = "placeSpike", at = @At("HEAD"), cancellable = true) private void be_placeSpike(ServerLevelAccessor world, Random random, SpikeConfiguration config, SpikeFeature.EndSpike spike, CallbackInfo info) { int x = spike.getCenterX(); int z = spike.getCenterZ(); int radius = spike.getRadius(); int minY = 0; - + long lx = (long) x; long lz = (long) z; if (lx * lx + lz * lz < 10000) { @@ -61,10 +61,10 @@ public class SpikeFeatureMixin { else { minY = world.getChunk(x >> 4, z >> 4).getHeight(Types.WORLD_SURFACE, x & 15, z); } - + GeneratorOptions.setDirectSpikeHeight(); int maxY = minY + spike.getHeight() - 64; - + if (GeneratorOptions.replacePillars() && be_radiusInRange(radius)) { radius--; StructureTemplate base = StructureHelper.readStructure(BetterEnd.makeID("pillars/pillar_base_" + radius)); @@ -75,11 +75,11 @@ public class SpikeFeatureMixin { side = top.getSize(); BlockPos pos2 = new BlockPos(x - (side.getX() >> 1), maxY, z - (side.getZ() >> 1)); maxY = pos2.getY(); - + StructurePlaceSettings data = new StructurePlaceSettings(); base.placeInWorld(world, pos1, pos1, data, random, 2); top.placeInWorld(world, pos2, pos2, data, random, 2); - + int r2 = radius * radius + 1; MutableBlockPos mut = new MutableBlockPos(); for (int px = -radius; px <= radius; px++) { @@ -128,13 +128,13 @@ public class SpikeFeatureMixin { mut.setZ(z); mut.setY(maxY); BlocksHelper.setWithoutUpdate(world, mut, Blocks.BEDROCK); - + EndCrystal crystal = EntityType.END_CRYSTAL.create(world.getLevel()); crystal.setBeamTarget(config.getCrystalBeamTarget()); crystal.setInvulnerable(config.isCrystalInvulnerable()); crystal.moveTo(x + 0.5D, maxY + 1, z + 0.5D, random.nextFloat() * 360.0F, 0.0F); world.addFreshEntity(crystal); - + if (spike.isGuarded()) { for (int px = -2; px <= 2; ++px) { boolean bl = Mth.abs(px) == 2; @@ -153,10 +153,10 @@ public class SpikeFeatureMixin { } } } - + info.cancel(); } - + private boolean be_radiusInRange(int radius) { return radius > 1 && radius < 6; } diff --git a/src/main/java/ru/betterend/mixin/common/WeightedBiomePickerMixin.java b/src/main/java/ru/betterend/mixin/common/WeightedBiomePickerMixin.java index fd6b15d4..dffde15a 100644 --- a/src/main/java/ru/betterend/mixin/common/WeightedBiomePickerMixin.java +++ b/src/main/java/ru/betterend/mixin/common/WeightedBiomePickerMixin.java @@ -17,19 +17,19 @@ import java.util.List; @Mixin(value = WeightedBiomePicker.class, remap = false) public class WeightedBiomePickerMixin implements IBiomeList { private final List> biomes = Lists.newArrayList(); - + @Inject(method = "addBiome", at = @At("TAIL")) private void be_addBiome(final ResourceKey biome, final double weight, CallbackInfo info) { if (be_isCorrectPicker(WeightedBiomePicker.class.cast(this))) { biomes.add(biome); } } - + @Override public List> getBiomes() { return biomes; } - + private boolean be_isCorrectPicker(WeightedBiomePicker picker) { return picker == InternalBiomeData.getEndBiomesMap().get(Biomes.SMALL_END_ISLANDS) || picker == InternalBiomeData.getEndBarrensMap().get(Biomes.END_BARRENS); } diff --git a/src/main/java/ru/betterend/mixin/common/WorldGenRegionMixin.java b/src/main/java/ru/betterend/mixin/common/WorldGenRegionMixin.java index c275b531..cbd755db 100644 --- a/src/main/java/ru/betterend/mixin/common/WorldGenRegionMixin.java +++ b/src/main/java/ru/betterend/mixin/common/WorldGenRegionMixin.java @@ -1,25 +1,21 @@ package ru.betterend.mixin.common; import net.minecraft.core.BlockPos; -import net.minecraft.core.SectionPos; import net.minecraft.server.level.WorldGenRegion; import net.minecraft.world.level.ChunkPos; -import net.minecraft.world.level.levelgen.feature.SpikeFeature; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import ru.bclib.util.MHelper; @Mixin(WorldGenRegion.class) public class WorldGenRegionMixin { @Final @Shadow private ChunkPos center; - + @Inject(method = "ensureCanWrite", at = @At("HEAD"), cancellable = true) private void be_alterBlockCheck(BlockPos blockPos, CallbackInfoReturnable info) { int x = blockPos.getX() >> 4; diff --git a/src/main/java/ru/betterend/noise/OpenSimplexNoise.java b/src/main/java/ru/betterend/noise/OpenSimplexNoise.java index bf281185..7621c7b4 100644 --- a/src/main/java/ru/betterend/noise/OpenSimplexNoise.java +++ b/src/main/java/ru/betterend/noise/OpenSimplexNoise.java @@ -23,31 +23,31 @@ public final class OpenSimplexNoise { private static final double SQUISH_CONSTANT_3D = 1.0 / 3; // (Math.sqrt(3+1)-1)/3; private static final double STRETCH_CONSTANT_4D = -0.138196601125011; // (1/Math.sqrt(4+1)-1)/4; private static final double SQUISH_CONSTANT_4D = 0.309016994374947; // (Math.sqrt(4+1)-1)/4; - + private static final double NORM_CONSTANT_2D = 47; private static final double NORM_CONSTANT_3D = 103; private static final double NORM_CONSTANT_4D = 30; - + private static final long DEFAULT_SEED = 0; - + private short[] perm; private short[] permGradIndex3D; - + public OpenSimplexNoise() { this(DEFAULT_SEED); } - + public OpenSimplexNoise(short[] perm) { this.perm = perm; permGradIndex3D = new short[256]; - + for (int i = 0; i < 256; i++) { // Since 3D has 24 gradients, simple bitmask won't work, so // precompute modulo array. permGradIndex3D[i] = (short) ((perm[i] % (gradients3D.length / 3)) * 3); } } - + // Initializes the class using a permutation array generated from a 64-bit // seed. // Generates a proper permutation (i.e. doesn't merely perform N successive @@ -57,60 +57,60 @@ public final class OpenSimplexNoise { perm = new short[256]; permGradIndex3D = new short[256]; short[] source = new short[256]; - for (short i = 0; i < 256; i++) + for (short i = 0; i < 256; i++) { source[i] = i; + } seed = seed * 6364136223846793005l + 1442695040888963407l; seed = seed * 6364136223846793005l + 1442695040888963407l; seed = seed * 6364136223846793005l + 1442695040888963407l; for (int i = 255; i >= 0; i--) { seed = seed * 6364136223846793005l + 1442695040888963407l; int r = (int) ((seed + 31) % (i + 1)); - if (r < 0) - r += (i + 1); + if (r < 0) r += (i + 1); perm[i] = source[r]; permGradIndex3D[i] = (short) ((perm[i] % (gradients3D.length / 3)) * 3); source[r] = source[i]; } } - + // 2D OpenSimplex Noise. public double eval(double x, double y) { - + // Place input coordinates onto grid. double stretchOffset = (x + y) * STRETCH_CONSTANT_2D; double xs = x + stretchOffset; double ys = y + stretchOffset; - + // Floor to get grid coordinates of rhombus (stretched square) // super-cell origin. int xsb = fastFloor(xs); int ysb = fastFloor(ys); - + // Skew out to get actual coordinates of rhombus origin. We'll need // these later. double squishOffset = (xsb + ysb) * SQUISH_CONSTANT_2D; double xb = xsb + squishOffset; double yb = ysb + squishOffset; - + // Compute grid coordinates relative to rhombus origin. double xins = xs - xsb; double yins = ys - ysb; - + // Sum those together to get a value that determines which region we're // in. double inSum = xins + yins; - + // Positions relative to origin point. double dx0 = x - xb; double dy0 = y - yb; - + // We'll be defining these inside the next block and using them // afterwards. double dx_ext, dy_ext; int xsv_ext, ysv_ext; - + double value = 0; - + // Contribution (1,0) double dx1 = dx0 - 1 - SQUISH_CONSTANT_2D; double dy1 = dy0 - 0 - SQUISH_CONSTANT_2D; @@ -119,7 +119,7 @@ public final class OpenSimplexNoise { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, dx1, dy1); } - + // Contribution (0,1) double dx2 = dx0 - 0 - SQUISH_CONSTANT_2D; double dy2 = dy0 - 1 - SQUISH_CONSTANT_2D; @@ -128,7 +128,7 @@ public final class OpenSimplexNoise { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, dx2, dy2); } - + if (inSum <= 1) { // We're inside the triangle (2-Simplex) at (0,0) double zins = 1 - inSum; if (zins > xins || zins > yins) { // (0,0) is one of the closest two @@ -181,71 +181,71 @@ public final class OpenSimplexNoise { dx0 = dx0 - 1 - 2 * SQUISH_CONSTANT_2D; dy0 = dy0 - 1 - 2 * SQUISH_CONSTANT_2D; } - + // Contribution (0,0) or (1,1) double attn0 = 2 - dx0 * dx0 - dy0 * dy0; if (attn0 > 0) { attn0 *= attn0; value += attn0 * attn0 * extrapolate(xsb, ysb, dx0, dy0); } - + // Extra Vertex double attn_ext = 2 - dx_ext * dx_ext - dy_ext * dy_ext; if (attn_ext > 0) { attn_ext *= attn_ext; value += attn_ext * attn_ext * extrapolate(xsv_ext, ysv_ext, dx_ext, dy_ext); } - + return value / NORM_CONSTANT_2D; } - + // 3D OpenSimplex Noise. public double eval(double x, double y, double z) { - + // Place input coordinates on simplectic honeycomb. double stretchOffset = (x + y + z) * STRETCH_CONSTANT_3D; double xs = x + stretchOffset; double ys = y + stretchOffset; double zs = z + stretchOffset; - + // Floor to get simplectic honeycomb coordinates of rhombohedron // (stretched cube) super-cell origin. int xsb = fastFloor(xs); int ysb = fastFloor(ys); int zsb = fastFloor(zs); - + // Skew out to get actual coordinates of rhombohedron origin. We'll need // these later. double squishOffset = (xsb + ysb + zsb) * SQUISH_CONSTANT_3D; double xb = xsb + squishOffset; double yb = ysb + squishOffset; double zb = zsb + squishOffset; - + // Compute simplectic honeycomb coordinates relative to rhombohedral // origin. double xins = xs - xsb; double yins = ys - ysb; double zins = zs - zsb; - + // Sum those together to get a value that determines which region we're // in. double inSum = xins + yins + zins; - + // Positions relative to origin point. double dx0 = x - xb; double dy0 = y - yb; double dz0 = z - zb; - + // We'll be defining these inside the next block and using them // afterwards. double dx_ext0, dy_ext0, dz_ext0; double dx_ext1, dy_ext1, dz_ext1; int xsv_ext0, ysv_ext0, zsv_ext0; int xsv_ext1, ysv_ext1, zsv_ext1; - + double value = 0; if (inSum <= 1) { // We're inside the tetrahedron (3-Simplex) at (0,0,0) - + // Determine which two of (0,0,1), (0,1,0), (1,0,0) are closest. byte aPoint = 0x01; double aScore = xins; @@ -259,7 +259,7 @@ public final class OpenSimplexNoise { aScore = zins; aPoint = 0x04; } - + // Now we determine the two lattice points not part of the // tetrahedron that may contribute. // This depends on the closest two tetrahedral vertices, including @@ -273,7 +273,7 @@ public final class OpenSimplexNoise { // vertex is the // closest out // of a and b. - + if ((c & 0x01) == 0) { xsv_ext0 = xsb - 1; xsv_ext1 = xsb; @@ -284,7 +284,7 @@ public final class OpenSimplexNoise { xsv_ext0 = xsv_ext1 = xsb + 1; dx_ext0 = dx_ext1 = dx0 - 1; } - + if ((c & 0x02) == 0) { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0; @@ -301,7 +301,7 @@ public final class OpenSimplexNoise { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1; } - + if ((c & 0x04) == 0) { zsv_ext0 = zsb; zsv_ext1 = zsb - 1; @@ -318,7 +318,7 @@ public final class OpenSimplexNoise { byte c = (byte) (aPoint | bPoint); // Our two extra vertices are // determined by the closest // two. - + if ((c & 0x01) == 0) { xsv_ext0 = xsb; xsv_ext1 = xsb - 1; @@ -330,7 +330,7 @@ public final class OpenSimplexNoise { dx_ext0 = dx0 - 1 - 2 * SQUISH_CONSTANT_3D; dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_3D; } - + if ((c & 0x02) == 0) { ysv_ext0 = ysb; ysv_ext1 = ysb - 1; @@ -342,7 +342,7 @@ public final class OpenSimplexNoise { dy_ext0 = dy0 - 1 - 2 * SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_3D; } - + if ((c & 0x04) == 0) { zsv_ext0 = zsb; zsv_ext1 = zsb - 1; @@ -355,14 +355,14 @@ public final class OpenSimplexNoise { dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_3D; } } - + // Contribution (0,0,0) double attn0 = 2 - dx0 * dx0 - dy0 * dy0 - dz0 * dz0; if (attn0 > 0) { attn0 *= attn0; value += attn0 * attn0 * extrapolate(xsb + 0, ysb + 0, zsb + 0, dx0, dy0, dz0); } - + // Contribution (1,0,0) double dx1 = dx0 - 1 - SQUISH_CONSTANT_3D; double dy1 = dy0 - 0 - SQUISH_CONSTANT_3D; @@ -372,7 +372,7 @@ public final class OpenSimplexNoise { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, zsb + 0, dx1, dy1, dz1); } - + // Contribution (0,1,0) double dx2 = dx0 - 0 - SQUISH_CONSTANT_3D; double dy2 = dy0 - 1 - SQUISH_CONSTANT_3D; @@ -382,7 +382,7 @@ public final class OpenSimplexNoise { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, zsb + 0, dx2, dy2, dz2); } - + // Contribution (0,0,1) double dx3 = dx2; double dy3 = dy1; @@ -395,7 +395,7 @@ public final class OpenSimplexNoise { } else if (inSum >= 2) { // We're inside the tetrahedron (3-Simplex) at // (1,1,1) - + // Determine which two tetrahedral vertices are the closest, out of // (1,1,0), (1,0,1), (0,1,1) but not (1,1,1). byte aPoint = 0x06; @@ -410,7 +410,7 @@ public final class OpenSimplexNoise { aScore = zins; aPoint = 0x03; } - + // Now we determine the two lattice points not part of the // tetrahedron that may contribute. // This depends on the closest two tetrahedral vertices, including @@ -424,7 +424,7 @@ public final class OpenSimplexNoise { // vertex is the // closest out // of a and b. - + if ((c & 0x01) != 0) { xsv_ext0 = xsb + 2; xsv_ext1 = xsb + 1; @@ -435,7 +435,7 @@ public final class OpenSimplexNoise { xsv_ext0 = xsv_ext1 = xsb; dx_ext0 = dx_ext1 = dx0 - 3 * SQUISH_CONSTANT_3D; } - + if ((c & 0x02) != 0) { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1 - 3 * SQUISH_CONSTANT_3D; @@ -452,7 +452,7 @@ public final class OpenSimplexNoise { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0 - 3 * SQUISH_CONSTANT_3D; } - + if ((c & 0x04) != 0) { zsv_ext0 = zsb + 1; zsv_ext1 = zsb + 2; @@ -469,7 +469,7 @@ public final class OpenSimplexNoise { byte c = (byte) (aPoint & bPoint); // Our two extra vertices are // determined by the closest // two. - + if ((c & 0x01) != 0) { xsv_ext0 = xsb + 1; xsv_ext1 = xsb + 2; @@ -481,7 +481,7 @@ public final class OpenSimplexNoise { dx_ext0 = dx0 - SQUISH_CONSTANT_3D; dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_3D; } - + if ((c & 0x02) != 0) { ysv_ext0 = ysb + 1; ysv_ext1 = ysb + 2; @@ -493,7 +493,7 @@ public final class OpenSimplexNoise { dy_ext0 = dy0 - SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_3D; } - + if ((c & 0x04) != 0) { zsv_ext0 = zsb + 1; zsv_ext1 = zsb + 2; @@ -506,7 +506,7 @@ public final class OpenSimplexNoise { dz_ext1 = dz0 - 2 * SQUISH_CONSTANT_3D; } } - + // Contribution (1,1,0) double dx3 = dx0 - 1 - 2 * SQUISH_CONSTANT_3D; double dy3 = dy0 - 1 - 2 * SQUISH_CONSTANT_3D; @@ -516,7 +516,7 @@ public final class OpenSimplexNoise { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 1, ysb + 1, zsb + 0, dx3, dy3, dz3); } - + // Contribution (1,0,1) double dx2 = dx3; double dy2 = dy0 - 0 - 2 * SQUISH_CONSTANT_3D; @@ -526,7 +526,7 @@ public final class OpenSimplexNoise { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 1, ysb + 0, zsb + 1, dx2, dy2, dz2); } - + // Contribution (0,1,1) double dx1 = dx0 - 0 - 2 * SQUISH_CONSTANT_3D; double dy1 = dy3; @@ -536,7 +536,7 @@ public final class OpenSimplexNoise { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 0, ysb + 1, zsb + 1, dx1, dy1, dz1); } - + // Contribution (1,1,1) dx0 = dx0 - 1 - 3 * SQUISH_CONSTANT_3D; dy0 = dy0 - 1 - 3 * SQUISH_CONSTANT_3D; @@ -555,7 +555,7 @@ public final class OpenSimplexNoise { double bScore; byte bPoint; boolean bIsFurtherSide; - + // Decide between point (0,0,1) and (1,1,0) as closest double p1 = xins + yins; if (p1 > 1) { @@ -568,7 +568,7 @@ public final class OpenSimplexNoise { aPoint = 0x04; aIsFurtherSide = false; } - + // Decide between point (0,1,0) and (1,0,1) as closest double p2 = xins + zins; if (p2 > 1) { @@ -581,7 +581,7 @@ public final class OpenSimplexNoise { bPoint = 0x02; bIsFurtherSide = false; } - + // The closest out of the two (1,0,0) and (0,1,1) will replace the // furthest out of the two decided above, if closer. double p3 = yins + zins; @@ -611,12 +611,12 @@ public final class OpenSimplexNoise { bIsFurtherSide = false; } } - + // Where each of the two closest points are determines how the extra // two vertices are calculated. if (aIsFurtherSide == bIsFurtherSide) { if (aIsFurtherSide) { // Both closest points on (1,1,1) side - + // One of the two extra points is (1,1,1) dx_ext0 = dx0 - 1 - 3 * SQUISH_CONSTANT_3D; dy_ext0 = dy0 - 1 - 3 * SQUISH_CONSTANT_3D; @@ -624,7 +624,7 @@ public final class OpenSimplexNoise { xsv_ext0 = xsb + 1; ysv_ext0 = ysb + 1; zsv_ext0 = zsb + 1; - + // Other extra point is based on the shared axis. byte c = (byte) (aPoint & bPoint); if ((c & 0x01) != 0) { @@ -653,7 +653,7 @@ public final class OpenSimplexNoise { } } else {// Both closest points on (0,0,0) side - + // One of the two extra points is (0,0,0) dx_ext0 = dx0; dy_ext0 = dy0; @@ -661,7 +661,7 @@ public final class OpenSimplexNoise { xsv_ext0 = xsb; ysv_ext0 = ysb; zsv_ext0 = zsb; - + // Other extra point is based on the omitted axis. byte c = (byte) (aPoint | bPoint); if ((c & 0x01) == 0) { @@ -700,7 +700,7 @@ public final class OpenSimplexNoise { c1 = bPoint; c2 = aPoint; } - + // One contribution is a permutation of (1,1,-1) if ((c1 & 0x01) == 0) { dx_ext0 = dx0 + 1 - SQUISH_CONSTANT_3D; @@ -726,7 +726,7 @@ public final class OpenSimplexNoise { ysv_ext0 = ysb + 1; zsv_ext0 = zsb - 1; } - + // One contribution is a permutation of (0,0,2) dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_3D; @@ -747,7 +747,7 @@ public final class OpenSimplexNoise { zsv_ext1 += 2; } } - + // Contribution (1,0,0) double dx1 = dx0 - 1 - SQUISH_CONSTANT_3D; double dy1 = dy0 - 0 - SQUISH_CONSTANT_3D; @@ -757,7 +757,7 @@ public final class OpenSimplexNoise { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, zsb + 0, dx1, dy1, dz1); } - + // Contribution (0,1,0) double dx2 = dx0 - 0 - SQUISH_CONSTANT_3D; double dy2 = dy0 - 1 - SQUISH_CONSTANT_3D; @@ -767,7 +767,7 @@ public final class OpenSimplexNoise { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, zsb + 0, dx2, dy2, dz2); } - + // Contribution (0,0,1) double dx3 = dx2; double dy3 = dy1; @@ -777,7 +777,7 @@ public final class OpenSimplexNoise { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 0, ysb + 0, zsb + 1, dx3, dy3, dz3); } - + // Contribution (1,1,0) double dx4 = dx0 - 1 - 2 * SQUISH_CONSTANT_3D; double dy4 = dy0 - 1 - 2 * SQUISH_CONSTANT_3D; @@ -787,7 +787,7 @@ public final class OpenSimplexNoise { attn4 *= attn4; value += attn4 * attn4 * extrapolate(xsb + 1, ysb + 1, zsb + 0, dx4, dy4, dz4); } - + // Contribution (1,0,1) double dx5 = dx4; double dy5 = dy0 - 0 - 2 * SQUISH_CONSTANT_3D; @@ -797,7 +797,7 @@ public final class OpenSimplexNoise { attn5 *= attn5; value += attn5 * attn5 * extrapolate(xsb + 1, ysb + 0, zsb + 1, dx5, dy5, dz5); } - + // Contribution (0,1,1) double dx6 = dx0 - 0 - 2 * SQUISH_CONSTANT_3D; double dy6 = dy4; @@ -808,41 +808,41 @@ public final class OpenSimplexNoise { value += attn6 * attn6 * extrapolate(xsb + 0, ysb + 1, zsb + 1, dx6, dy6, dz6); } } - + // First extra vertex double attn_ext0 = 2 - dx_ext0 * dx_ext0 - dy_ext0 * dy_ext0 - dz_ext0 * dz_ext0; if (attn_ext0 > 0) { attn_ext0 *= attn_ext0; value += attn_ext0 * attn_ext0 * extrapolate(xsv_ext0, ysv_ext0, zsv_ext0, dx_ext0, dy_ext0, dz_ext0); } - + // Second extra vertex double attn_ext1 = 2 - dx_ext1 * dx_ext1 - dy_ext1 * dy_ext1 - dz_ext1 * dz_ext1; if (attn_ext1 > 0) { attn_ext1 *= attn_ext1; value += attn_ext1 * attn_ext1 * extrapolate(xsv_ext1, ysv_ext1, zsv_ext1, dx_ext1, dy_ext1, dz_ext1); } - + return value / NORM_CONSTANT_3D; } - + // 4D OpenSimplex Noise. public double eval(double x, double y, double z, double w) { - + // Place input coordinates on simplectic honeycomb. double stretchOffset = (x + y + z + w) * STRETCH_CONSTANT_4D; double xs = x + stretchOffset; double ys = y + stretchOffset; double zs = z + stretchOffset; double ws = w + stretchOffset; - + // Floor to get simplectic honeycomb coordinates of rhombo-hypercube // super-cell origin. int xsb = fastFloor(xs); int ysb = fastFloor(ys); int zsb = fastFloor(zs); int wsb = fastFloor(ws); - + // Skew out to get actual coordinates of stretched rhombo-hypercube // origin. We'll need these later. double squishOffset = (xsb + ysb + zsb + wsb) * SQUISH_CONSTANT_4D; @@ -850,24 +850,24 @@ public final class OpenSimplexNoise { double yb = ysb + squishOffset; double zb = zsb + squishOffset; double wb = wsb + squishOffset; - + // Compute simplectic honeycomb coordinates relative to rhombo-hypercube // origin. double xins = xs - xsb; double yins = ys - ysb; double zins = zs - zsb; double wins = ws - wsb; - + // Sum those together to get a value that determines which region we're // in. double inSum = xins + yins + zins + wins; - + // Positions relative to origin point. double dx0 = x - xb; double dy0 = y - yb; double dz0 = z - zb; double dw0 = w - wb; - + // We'll be defining these inside the next block and using them // afterwards. double dx_ext0, dy_ext0, dz_ext0, dw_ext0; @@ -876,11 +876,11 @@ public final class OpenSimplexNoise { int xsv_ext0, ysv_ext0, zsv_ext0, wsv_ext0; int xsv_ext1, ysv_ext1, zsv_ext1, wsv_ext1; int xsv_ext2, ysv_ext2, zsv_ext2, wsv_ext2; - + double value = 0; if (inSum <= 1) { // We're inside the pentachoron (4-Simplex) at // (0,0,0,0) - + // Determine which two of (0,0,0,1), (0,0,1,0), (0,1,0,0), (1,0,0,0) // are closest. byte aPoint = 0x01; @@ -903,7 +903,7 @@ public final class OpenSimplexNoise { aScore = wins; aPoint = 0x08; } - + // Now we determine the three lattice points not part of the // pentachoron that may contribute. // This depends on the closest two pentachoron vertices, including @@ -927,7 +927,7 @@ public final class OpenSimplexNoise { xsv_ext0 = xsv_ext1 = xsv_ext2 = xsb + 1; dx_ext0 = dx_ext1 = dx_ext2 = dx0 - 1; } - + if ((c & 0x02) == 0) { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb; dy_ext0 = dy_ext1 = dy_ext2 = dy0; @@ -944,7 +944,7 @@ public final class OpenSimplexNoise { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb + 1; dy_ext0 = dy_ext1 = dy_ext2 = dy0 - 1; } - + if ((c & 0x04) == 0) { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb; dz_ext0 = dz_ext1 = dz_ext2 = dz0; @@ -967,7 +967,7 @@ public final class OpenSimplexNoise { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb + 1; dz_ext0 = dz_ext1 = dz_ext2 = dz0 - 1; } - + if ((c & 0x08) == 0) { wsv_ext0 = wsv_ext1 = wsb; wsv_ext2 = wsb - 1; @@ -984,7 +984,7 @@ public final class OpenSimplexNoise { byte c = (byte) (aPoint | bPoint); // Our three extra vertices // are determined by the // closest two. - + if ((c & 0x01) == 0) { xsv_ext0 = xsv_ext2 = xsb; xsv_ext1 = xsb - 1; @@ -997,7 +997,7 @@ public final class OpenSimplexNoise { dx_ext0 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; dx_ext1 = dx_ext2 = dx0 - 1 - SQUISH_CONSTANT_4D; } - + if ((c & 0x02) == 0) { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb; dy_ext0 = dy0 - 2 * SQUISH_CONSTANT_4D; @@ -1016,7 +1016,7 @@ public final class OpenSimplexNoise { dy_ext0 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; dy_ext1 = dy_ext2 = dy0 - 1 - SQUISH_CONSTANT_4D; } - + if ((c & 0x04) == 0) { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb; dz_ext0 = dz0 - 2 * SQUISH_CONSTANT_4D; @@ -1035,7 +1035,7 @@ public final class OpenSimplexNoise { dz_ext0 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; dz_ext1 = dz_ext2 = dz0 - 1 - SQUISH_CONSTANT_4D; } - + if ((c & 0x08) == 0) { wsv_ext0 = wsv_ext1 = wsb; wsv_ext2 = wsb - 1; @@ -1049,14 +1049,14 @@ public final class OpenSimplexNoise { dw_ext1 = dw_ext2 = dw0 - 1 - SQUISH_CONSTANT_4D; } } - + // Contribution (0,0,0,0) double attn0 = 2 - dx0 * dx0 - dy0 * dy0 - dz0 * dz0 - dw0 * dw0; if (attn0 > 0) { attn0 *= attn0; value += attn0 * attn0 * extrapolate(xsb + 0, ysb + 0, zsb + 0, wsb + 0, dx0, dy0, dz0, dw0); } - + // Contribution (1,0,0,0) double dx1 = dx0 - 1 - SQUISH_CONSTANT_4D; double dy1 = dy0 - 0 - SQUISH_CONSTANT_4D; @@ -1067,7 +1067,7 @@ public final class OpenSimplexNoise { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, zsb + 0, wsb + 0, dx1, dy1, dz1, dw1); } - + // Contribution (0,1,0,0) double dx2 = dx0 - 0 - SQUISH_CONSTANT_4D; double dy2 = dy0 - 1 - SQUISH_CONSTANT_4D; @@ -1078,7 +1078,7 @@ public final class OpenSimplexNoise { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, zsb + 0, wsb + 0, dx2, dy2, dz2, dw2); } - + // Contribution (0,0,1,0) double dx3 = dx2; double dy3 = dy1; @@ -1089,7 +1089,7 @@ public final class OpenSimplexNoise { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 0, ysb + 0, zsb + 1, wsb + 0, dx3, dy3, dz3, dw3); } - + // Contribution (0,0,0,1) double dx4 = dx2; double dy4 = dy1; @@ -1126,7 +1126,7 @@ public final class OpenSimplexNoise { aScore = wins; aPoint = 0x07; } - + // Now we determine the three lattice points not part of the // pentachoron that may contribute. // This depends on the closest two pentachoron vertices, including @@ -1140,7 +1140,7 @@ public final class OpenSimplexNoise { // vertex is the // closest out // of a and b. - + if ((c & 0x01) != 0) { xsv_ext0 = xsb + 2; xsv_ext1 = xsv_ext2 = xsb + 1; @@ -1151,7 +1151,7 @@ public final class OpenSimplexNoise { xsv_ext0 = xsv_ext1 = xsv_ext2 = xsb; dx_ext0 = dx_ext1 = dx_ext2 = dx0 - 4 * SQUISH_CONSTANT_4D; } - + if ((c & 0x02) != 0) { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb + 1; dy_ext0 = dy_ext1 = dy_ext2 = dy0 - 1 - 4 * SQUISH_CONSTANT_4D; @@ -1168,7 +1168,7 @@ public final class OpenSimplexNoise { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb; dy_ext0 = dy_ext1 = dy_ext2 = dy0 - 4 * SQUISH_CONSTANT_4D; } - + if ((c & 0x04) != 0) { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb + 1; dz_ext0 = dz_ext1 = dz_ext2 = dz0 - 1 - 4 * SQUISH_CONSTANT_4D; @@ -1191,7 +1191,7 @@ public final class OpenSimplexNoise { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb; dz_ext0 = dz_ext1 = dz_ext2 = dz0 - 4 * SQUISH_CONSTANT_4D; } - + if ((c & 0x08) != 0) { wsv_ext0 = wsv_ext1 = wsb + 1; wsv_ext2 = wsb + 2; @@ -1208,7 +1208,7 @@ public final class OpenSimplexNoise { byte c = (byte) (aPoint & bPoint); // Our three extra vertices // are determined by the // closest two. - + if ((c & 0x01) != 0) { xsv_ext0 = xsv_ext2 = xsb + 1; xsv_ext1 = xsb + 2; @@ -1221,7 +1221,7 @@ public final class OpenSimplexNoise { dx_ext0 = dx0 - 2 * SQUISH_CONSTANT_4D; dx_ext1 = dx_ext2 = dx0 - 3 * SQUISH_CONSTANT_4D; } - + if ((c & 0x02) != 0) { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb + 1; dy_ext0 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; @@ -1240,7 +1240,7 @@ public final class OpenSimplexNoise { dy_ext0 = dy0 - 2 * SQUISH_CONSTANT_4D; dy_ext1 = dy_ext2 = dy0 - 3 * SQUISH_CONSTANT_4D; } - + if ((c & 0x04) != 0) { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb + 1; dz_ext0 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; @@ -1259,7 +1259,7 @@ public final class OpenSimplexNoise { dz_ext0 = dz0 - 2 * SQUISH_CONSTANT_4D; dz_ext1 = dz_ext2 = dz0 - 3 * SQUISH_CONSTANT_4D; } - + if ((c & 0x08) != 0) { wsv_ext0 = wsv_ext1 = wsb + 1; wsv_ext2 = wsb + 2; @@ -1273,7 +1273,7 @@ public final class OpenSimplexNoise { dw_ext1 = dw_ext2 = dw0 - 3 * SQUISH_CONSTANT_4D; } } - + // Contribution (1,1,1,0) double dx4 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D; double dy4 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D; @@ -1284,7 +1284,7 @@ public final class OpenSimplexNoise { attn4 *= attn4; value += attn4 * attn4 * extrapolate(xsb + 1, ysb + 1, zsb + 1, wsb + 0, dx4, dy4, dz4, dw4); } - + // Contribution (1,1,0,1) double dx3 = dx4; double dy3 = dy4; @@ -1295,7 +1295,7 @@ public final class OpenSimplexNoise { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 1, ysb + 1, zsb + 0, wsb + 1, dx3, dy3, dz3, dw3); } - + // Contribution (1,0,1,1) double dx2 = dx4; double dy2 = dy0 - 3 * SQUISH_CONSTANT_4D; @@ -1306,7 +1306,7 @@ public final class OpenSimplexNoise { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 1, ysb + 0, zsb + 1, wsb + 1, dx2, dy2, dz2, dw2); } - + // Contribution (0,1,1,1) double dx1 = dx0 - 3 * SQUISH_CONSTANT_4D; double dz1 = dz4; @@ -1317,7 +1317,7 @@ public final class OpenSimplexNoise { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 0, ysb + 1, zsb + 1, wsb + 1, dx1, dy1, dz1, dw1); } - + // Contribution (1,1,1,1) dx0 = dx0 - 1 - 4 * SQUISH_CONSTANT_4D; dy0 = dy0 - 1 - 4 * SQUISH_CONSTANT_4D; @@ -1337,7 +1337,7 @@ public final class OpenSimplexNoise { double bScore; byte bPoint; boolean bIsBiggerSide = true; - + // Decide between (1,1,0,0) and (0,0,1,1) if (xins + yins > zins + wins) { aScore = xins + yins; @@ -1347,7 +1347,7 @@ public final class OpenSimplexNoise { aScore = zins + wins; aPoint = 0x0C; } - + // Decide between (1,0,1,0) and (0,1,0,1) if (xins + zins > yins + wins) { bScore = xins + zins; @@ -1357,7 +1357,7 @@ public final class OpenSimplexNoise { bScore = yins + wins; bPoint = 0x0A; } - + // Closer between (1,0,0,1) and (0,1,1,0) will replace the further // of a and b, if closer. if (xins + wins > yins + zins) { @@ -1382,7 +1382,7 @@ public final class OpenSimplexNoise { aPoint = 0x06; } } - + // Decide if (1,0,0,0) is closer. double p1 = 2 - inSum + xins; if (aScore >= bScore && p1 > bScore) { @@ -1395,7 +1395,7 @@ public final class OpenSimplexNoise { aPoint = 0x01; aIsBiggerSide = false; } - + // Decide if (0,1,0,0) is closer. double p2 = 2 - inSum + yins; if (aScore >= bScore && p2 > bScore) { @@ -1408,7 +1408,7 @@ public final class OpenSimplexNoise { aPoint = 0x02; aIsBiggerSide = false; } - + // Decide if (0,0,1,0) is closer. double p3 = 2 - inSum + zins; if (aScore >= bScore && p3 > bScore) { @@ -1421,7 +1421,7 @@ public final class OpenSimplexNoise { aPoint = 0x04; aIsBiggerSide = false; } - + // Decide if (0,0,0,1) is closer. double p4 = 2 - inSum + wins; if (aScore >= bScore && p4 > bScore) { @@ -1434,7 +1434,7 @@ public final class OpenSimplexNoise { aPoint = 0x08; aIsBiggerSide = false; } - + // Where each of the two closest points are determines how the extra // three vertices are calculated. if (aIsBiggerSide == bIsBiggerSide) { @@ -1452,7 +1452,7 @@ public final class OpenSimplexNoise { dx_ext0 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D; dx_ext1 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; } - + if ((c1 & 0x02) == 0) { ysv_ext0 = ysb; ysv_ext1 = ysb - 1; @@ -1464,7 +1464,7 @@ public final class OpenSimplexNoise { dy_ext0 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D; dy_ext1 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; } - + if ((c1 & 0x04) == 0) { zsv_ext0 = zsb; zsv_ext1 = zsb - 1; @@ -1476,7 +1476,7 @@ public final class OpenSimplexNoise { dz_ext0 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D; dz_ext1 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; } - + if ((c1 & 0x08) == 0) { wsv_ext0 = wsb; wsv_ext1 = wsb - 1; @@ -1488,7 +1488,7 @@ public final class OpenSimplexNoise { dw_ext0 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D; dw_ext1 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; } - + // One combination is a permutation of (0,0,0,2) based on c2 xsv_ext2 = xsb; ysv_ext2 = ysb; @@ -1514,7 +1514,7 @@ public final class OpenSimplexNoise { wsv_ext2 += 2; dw_ext2 -= 2; } - + } else { // Both closest points on the smaller side // One of the two extra points is (0,0,0,0) @@ -1526,10 +1526,10 @@ public final class OpenSimplexNoise { dy_ext2 = dy0; dz_ext2 = dz0; dw_ext2 = dw0; - + // Other two points are based on the omitted axes. byte c = (byte) (aPoint | bPoint); - + if ((c & 0x01) == 0) { xsv_ext0 = xsb - 1; xsv_ext1 = xsb; @@ -1540,7 +1540,7 @@ public final class OpenSimplexNoise { xsv_ext0 = xsv_ext1 = xsb + 1; dx_ext0 = dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_4D; } - + if ((c & 0x02) == 0) { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0 - SQUISH_CONSTANT_4D; @@ -1557,7 +1557,7 @@ public final class OpenSimplexNoise { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_4D; } - + if ((c & 0x04) == 0) { zsv_ext0 = zsv_ext1 = zsb; dz_ext0 = dz_ext1 = dz0 - SQUISH_CONSTANT_4D; @@ -1574,7 +1574,7 @@ public final class OpenSimplexNoise { zsv_ext0 = zsv_ext1 = zsb + 1; dz_ext0 = dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_4D; } - + if ((c & 0x08) == 0) { wsv_ext0 = wsb; wsv_ext1 = wsb - 1; @@ -1585,7 +1585,7 @@ public final class OpenSimplexNoise { wsv_ext0 = wsv_ext1 = wsb + 1; dw_ext0 = dw_ext1 = dw0 - 1 - SQUISH_CONSTANT_4D; } - + } } else { // One point on each "side" @@ -1598,7 +1598,7 @@ public final class OpenSimplexNoise { c1 = bPoint; c2 = aPoint; } - + // Two contributions are the bigger-sided point with each 0 // replaced with -1. if ((c1 & 0x01) == 0) { @@ -1611,7 +1611,7 @@ public final class OpenSimplexNoise { xsv_ext0 = xsv_ext1 = xsb + 1; dx_ext0 = dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_4D; } - + if ((c1 & 0x02) == 0) { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0 - SQUISH_CONSTANT_4D; @@ -1628,7 +1628,7 @@ public final class OpenSimplexNoise { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_4D; } - + if ((c1 & 0x04) == 0) { zsv_ext0 = zsv_ext1 = zsb; dz_ext0 = dz_ext1 = dz0 - SQUISH_CONSTANT_4D; @@ -1645,7 +1645,7 @@ public final class OpenSimplexNoise { zsv_ext0 = zsv_ext1 = zsb + 1; dz_ext0 = dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_4D; } - + if ((c1 & 0x08) == 0) { wsv_ext0 = wsb; wsv_ext1 = wsb - 1; @@ -1656,7 +1656,7 @@ public final class OpenSimplexNoise { wsv_ext0 = wsv_ext1 = wsb + 1; dw_ext0 = dw_ext1 = dw0 - 1 - SQUISH_CONSTANT_4D; } - + // One contribution is a permutation of (0,0,0,2) based on the // smaller-sided point xsv_ext2 = xsb; @@ -1684,7 +1684,7 @@ public final class OpenSimplexNoise { dw_ext2 -= 2; } } - + // Contribution (1,0,0,0) double dx1 = dx0 - 1 - SQUISH_CONSTANT_4D; double dy1 = dy0 - 0 - SQUISH_CONSTANT_4D; @@ -1695,7 +1695,7 @@ public final class OpenSimplexNoise { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, zsb + 0, wsb + 0, dx1, dy1, dz1, dw1); } - + // Contribution (0,1,0,0) double dx2 = dx0 - 0 - SQUISH_CONSTANT_4D; double dy2 = dy0 - 1 - SQUISH_CONSTANT_4D; @@ -1706,7 +1706,7 @@ public final class OpenSimplexNoise { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, zsb + 0, wsb + 0, dx2, dy2, dz2, dw2); } - + // Contribution (0,0,1,0) double dx3 = dx2; double dy3 = dy1; @@ -1717,7 +1717,7 @@ public final class OpenSimplexNoise { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 0, ysb + 0, zsb + 1, wsb + 0, dx3, dy3, dz3, dw3); } - + // Contribution (0,0,0,1) double dx4 = dx2; double dy4 = dy1; @@ -1728,7 +1728,7 @@ public final class OpenSimplexNoise { attn4 *= attn4; value += attn4 * attn4 * extrapolate(xsb + 0, ysb + 0, zsb + 0, wsb + 1, dx4, dy4, dz4, dw4); } - + // Contribution (1,1,0,0) double dx5 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy5 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; @@ -1739,7 +1739,7 @@ public final class OpenSimplexNoise { attn5 *= attn5; value += attn5 * attn5 * extrapolate(xsb + 1, ysb + 1, zsb + 0, wsb + 0, dx5, dy5, dz5, dw5); } - + // Contribution (1,0,1,0) double dx6 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy6 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; @@ -1750,7 +1750,7 @@ public final class OpenSimplexNoise { attn6 *= attn6; value += attn6 * attn6 * extrapolate(xsb + 1, ysb + 0, zsb + 1, wsb + 0, dx6, dy6, dz6, dw6); } - + // Contribution (1,0,0,1) double dx7 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy7 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; @@ -1761,7 +1761,7 @@ public final class OpenSimplexNoise { attn7 *= attn7; value += attn7 * attn7 * extrapolate(xsb + 1, ysb + 0, zsb + 0, wsb + 1, dx7, dy7, dz7, dw7); } - + // Contribution (0,1,1,0) double dx8 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy8 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; @@ -1772,7 +1772,7 @@ public final class OpenSimplexNoise { attn8 *= attn8; value += attn8 * attn8 * extrapolate(xsb + 0, ysb + 1, zsb + 1, wsb + 0, dx8, dy8, dz8, dw8); } - + // Contribution (0,1,0,1) double dx9 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy9 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; @@ -1783,7 +1783,7 @@ public final class OpenSimplexNoise { attn9 *= attn9; value += attn9 * attn9 * extrapolate(xsb + 0, ysb + 1, zsb + 0, wsb + 1, dx9, dy9, dz9, dw9); } - + // Contribution (0,0,1,1) double dx10 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy10 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; @@ -1802,7 +1802,7 @@ public final class OpenSimplexNoise { double bScore; byte bPoint; boolean bIsBiggerSide = true; - + // Decide between (0,0,1,1) and (1,1,0,0) if (xins + yins < zins + wins) { aScore = xins + yins; @@ -1812,7 +1812,7 @@ public final class OpenSimplexNoise { aScore = zins + wins; aPoint = 0x03; } - + // Decide between (0,1,0,1) and (1,0,1,0) if (xins + zins < yins + wins) { bScore = xins + zins; @@ -1822,7 +1822,7 @@ public final class OpenSimplexNoise { bScore = yins + wins; bPoint = 0x05; } - + // Closer between (0,1,1,0) and (1,0,0,1) will replace the further // of a and b, if closer. if (xins + wins < yins + zins) { @@ -1847,7 +1847,7 @@ public final class OpenSimplexNoise { aPoint = 0x09; } } - + // Decide if (0,1,1,1) is closer. double p1 = 3 - inSum + xins; if (aScore <= bScore && p1 < bScore) { @@ -1860,7 +1860,7 @@ public final class OpenSimplexNoise { aPoint = 0x0E; aIsBiggerSide = false; } - + // Decide if (1,0,1,1) is closer. double p2 = 3 - inSum + yins; if (aScore <= bScore && p2 < bScore) { @@ -1873,7 +1873,7 @@ public final class OpenSimplexNoise { aPoint = 0x0D; aIsBiggerSide = false; } - + // Decide if (1,1,0,1) is closer. double p3 = 3 - inSum + zins; if (aScore <= bScore && p3 < bScore) { @@ -1886,7 +1886,7 @@ public final class OpenSimplexNoise { aPoint = 0x0B; aIsBiggerSide = false; } - + // Decide if (1,1,1,0) is closer. double p4 = 3 - inSum + wins; if (aScore <= bScore && p4 < bScore) { @@ -1899,14 +1899,14 @@ public final class OpenSimplexNoise { aPoint = 0x07; aIsBiggerSide = false; } - + // Where each of the two closest points are determines how the extra // three vertices are calculated. if (aIsBiggerSide == bIsBiggerSide) { if (aIsBiggerSide) { // Both closest points on the bigger side byte c1 = (byte) (aPoint & bPoint); byte c2 = (byte) (aPoint | bPoint); - + // Two contributions are permutations of (0,0,0,1) and // (0,0,0,2) based on c1 xsv_ext0 = xsv_ext1 = xsb; @@ -1945,7 +1945,7 @@ public final class OpenSimplexNoise { wsv_ext1 += 2; dw_ext1 -= 2; } - + // One contribution is a permutation of (1,1,1,-1) based on // c2 xsv_ext2 = xsb + 1; @@ -1983,10 +1983,10 @@ public final class OpenSimplexNoise { dy_ext2 = dy0 - 1 - 4 * SQUISH_CONSTANT_4D; dz_ext2 = dz0 - 1 - 4 * SQUISH_CONSTANT_4D; dw_ext2 = dw0 - 1 - 4 * SQUISH_CONSTANT_4D; - + // Other two points are based on the shared axes. byte c = (byte) (aPoint & bPoint); - + if ((c & 0x01) != 0) { xsv_ext0 = xsb + 2; xsv_ext1 = xsb + 1; @@ -1997,7 +1997,7 @@ public final class OpenSimplexNoise { xsv_ext0 = xsv_ext1 = xsb; dx_ext0 = dx_ext1 = dx0 - 3 * SQUISH_CONSTANT_4D; } - + if ((c & 0x02) != 0) { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D; @@ -2014,7 +2014,7 @@ public final class OpenSimplexNoise { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0 - 3 * SQUISH_CONSTANT_4D; } - + if ((c & 0x04) != 0) { zsv_ext0 = zsv_ext1 = zsb + 1; dz_ext0 = dz_ext1 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D; @@ -2031,7 +2031,7 @@ public final class OpenSimplexNoise { zsv_ext0 = zsv_ext1 = zsb; dz_ext0 = dz_ext1 = dz0 - 3 * SQUISH_CONSTANT_4D; } - + if ((c & 0x08) != 0) { wsv_ext0 = wsb + 1; wsv_ext1 = wsb + 2; @@ -2054,7 +2054,7 @@ public final class OpenSimplexNoise { c1 = bPoint; c2 = aPoint; } - + // Two contributions are the bigger-sided point with each 1 // replaced with 2. if ((c1 & 0x01) != 0) { @@ -2067,7 +2067,7 @@ public final class OpenSimplexNoise { xsv_ext0 = xsv_ext1 = xsb; dx_ext0 = dx_ext1 = dx0 - 3 * SQUISH_CONSTANT_4D; } - + if ((c1 & 0x02) != 0) { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D; @@ -2084,7 +2084,7 @@ public final class OpenSimplexNoise { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0 - 3 * SQUISH_CONSTANT_4D; } - + if ((c1 & 0x04) != 0) { zsv_ext0 = zsv_ext1 = zsb + 1; dz_ext0 = dz_ext1 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D; @@ -2101,7 +2101,7 @@ public final class OpenSimplexNoise { zsv_ext0 = zsv_ext1 = zsb; dz_ext0 = dz_ext1 = dz0 - 3 * SQUISH_CONSTANT_4D; } - + if ((c1 & 0x08) != 0) { wsv_ext0 = wsb + 1; wsv_ext1 = wsb + 2; @@ -2112,7 +2112,7 @@ public final class OpenSimplexNoise { wsv_ext0 = wsv_ext1 = wsb; dw_ext0 = dw_ext1 = dw0 - 3 * SQUISH_CONSTANT_4D; } - + // One contribution is a permutation of (1,1,1,-1) based on the // smaller-sided point xsv_ext2 = xsb + 1; @@ -2140,7 +2140,7 @@ public final class OpenSimplexNoise { dw_ext2 += 2; } } - + // Contribution (1,1,1,0) double dx4 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D; double dy4 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D; @@ -2151,7 +2151,7 @@ public final class OpenSimplexNoise { attn4 *= attn4; value += attn4 * attn4 * extrapolate(xsb + 1, ysb + 1, zsb + 1, wsb + 0, dx4, dy4, dz4, dw4); } - + // Contribution (1,1,0,1) double dx3 = dx4; double dy3 = dy4; @@ -2162,7 +2162,7 @@ public final class OpenSimplexNoise { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 1, ysb + 1, zsb + 0, wsb + 1, dx3, dy3, dz3, dw3); } - + // Contribution (1,0,1,1) double dx2 = dx4; double dy2 = dy0 - 3 * SQUISH_CONSTANT_4D; @@ -2173,7 +2173,7 @@ public final class OpenSimplexNoise { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 1, ysb + 0, zsb + 1, wsb + 1, dx2, dy2, dz2, dw2); } - + // Contribution (0,1,1,1) double dx1 = dx0 - 3 * SQUISH_CONSTANT_4D; double dz1 = dz4; @@ -2184,7 +2184,7 @@ public final class OpenSimplexNoise { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 0, ysb + 1, zsb + 1, wsb + 1, dx1, dy1, dz1, dw1); } - + // Contribution (1,1,0,0) double dx5 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy5 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; @@ -2195,7 +2195,7 @@ public final class OpenSimplexNoise { attn5 *= attn5; value += attn5 * attn5 * extrapolate(xsb + 1, ysb + 1, zsb + 0, wsb + 0, dx5, dy5, dz5, dw5); } - + // Contribution (1,0,1,0) double dx6 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy6 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; @@ -2206,7 +2206,7 @@ public final class OpenSimplexNoise { attn6 *= attn6; value += attn6 * attn6 * extrapolate(xsb + 1, ysb + 0, zsb + 1, wsb + 0, dx6, dy6, dz6, dw6); } - + // Contribution (1,0,0,1) double dx7 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy7 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; @@ -2217,7 +2217,7 @@ public final class OpenSimplexNoise { attn7 *= attn7; value += attn7 * attn7 * extrapolate(xsb + 1, ysb + 0, zsb + 0, wsb + 1, dx7, dy7, dz7, dw7); } - + // Contribution (0,1,1,0) double dx8 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy8 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; @@ -2228,7 +2228,7 @@ public final class OpenSimplexNoise { attn8 *= attn8; value += attn8 * attn8 * extrapolate(xsb + 0, ysb + 1, zsb + 1, wsb + 0, dx8, dy8, dz8, dw8); } - + // Contribution (0,1,0,1) double dx9 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy9 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; @@ -2239,7 +2239,7 @@ public final class OpenSimplexNoise { attn9 *= attn9; value += attn9 * attn9 * extrapolate(xsb + 0, ysb + 1, zsb + 0, wsb + 1, dx9, dy9, dz9, dw9); } - + // Contribution (0,0,1,1) double dx10 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy10 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; @@ -2251,78 +2251,64 @@ public final class OpenSimplexNoise { value += attn10 * attn10 * extrapolate(xsb + 0, ysb + 0, zsb + 1, wsb + 1, dx10, dy10, dz10, dw10); } } - + // First extra vertex double attn_ext0 = 2 - dx_ext0 * dx_ext0 - dy_ext0 * dy_ext0 - dz_ext0 * dz_ext0 - dw_ext0 * dw_ext0; if (attn_ext0 > 0) { attn_ext0 *= attn_ext0; - value += attn_ext0 * attn_ext0 - * extrapolate(xsv_ext0, ysv_ext0, zsv_ext0, wsv_ext0, dx_ext0, dy_ext0, dz_ext0, dw_ext0); + value += attn_ext0 * attn_ext0 * extrapolate(xsv_ext0, ysv_ext0, zsv_ext0, wsv_ext0, dx_ext0, dy_ext0, dz_ext0, dw_ext0); } - + // Second extra vertex double attn_ext1 = 2 - dx_ext1 * dx_ext1 - dy_ext1 * dy_ext1 - dz_ext1 * dz_ext1 - dw_ext1 * dw_ext1; if (attn_ext1 > 0) { attn_ext1 *= attn_ext1; - value += attn_ext1 * attn_ext1 - * extrapolate(xsv_ext1, ysv_ext1, zsv_ext1, wsv_ext1, dx_ext1, dy_ext1, dz_ext1, dw_ext1); + value += attn_ext1 * attn_ext1 * extrapolate(xsv_ext1, ysv_ext1, zsv_ext1, wsv_ext1, dx_ext1, dy_ext1, dz_ext1, dw_ext1); } - + // Third extra vertex double attn_ext2 = 2 - dx_ext2 * dx_ext2 - dy_ext2 * dy_ext2 - dz_ext2 * dz_ext2 - dw_ext2 * dw_ext2; if (attn_ext2 > 0) { attn_ext2 *= attn_ext2; - value += attn_ext2 * attn_ext2 - * extrapolate(xsv_ext2, ysv_ext2, zsv_ext2, wsv_ext2, dx_ext2, dy_ext2, dz_ext2, dw_ext2); + value += attn_ext2 * attn_ext2 * extrapolate(xsv_ext2, ysv_ext2, zsv_ext2, wsv_ext2, dx_ext2, dy_ext2, dz_ext2, dw_ext2); } - + return value / NORM_CONSTANT_4D; } - + private double extrapolate(int xsb, int ysb, double dx, double dy) { int index = perm[(perm[xsb & 0xFF] + ysb) & 0xFF] & 0x0E; return gradients2D[index] * dx + gradients2D[index + 1] * dy; } - + private double extrapolate(int xsb, int ysb, int zsb, double dx, double dy, double dz) { int index = permGradIndex3D[(perm[(perm[xsb & 0xFF] + ysb) & 0xFF] + zsb) & 0xFF]; return gradients3D[index] * dx + gradients3D[index + 1] * dy + gradients3D[index + 2] * dz; } - + private double extrapolate(int xsb, int ysb, int zsb, int wsb, double dx, double dy, double dz, double dw) { int index = perm[(perm[(perm[(perm[xsb & 0xFF] + ysb) & 0xFF] + zsb) & 0xFF] + wsb) & 0xFF] & 0xFC; - return gradients4D[index] * dx + gradients4D[index + 1] * dy + gradients4D[index + 2] * dz - + gradients4D[index + 3] * dw; + return gradients4D[index] * dx + gradients4D[index + 1] * dy + gradients4D[index + 2] * dz + gradients4D[index + 3] * dw; } - + private static int fastFloor(double x) { int xi = (int) x; return x < xi ? xi - 1 : xi; } - + // Gradients for 2D. They approximate the directions to the // vertices of an octagon from the center. private static byte[] gradients2D = new byte[]{5, 2, 2, 5, -5, 2, -2, 5, 5, -2, 2, -5, -5, -2, -2, -5,}; - + // Gradients for 3D. They approximate the directions to the // vertices of a rhombicuboctahedron from the center, skewed so // that the triangular and square facets can be inscribed inside // circles of the same radius. - private static byte[] gradients3D = new byte[]{-11, 4, 4, -4, 11, 4, -4, 4, 11, 11, 4, 4, 4, 11, 4, 4, 4, 11, -11, - -4, 4, -4, -11, 4, -4, -4, 11, 11, -4, 4, 4, -11, 4, 4, -4, 11, -11, 4, -4, -4, 11, -4, -4, 4, -11, 11, 4, - -4, 4, 11, -4, 4, 4, -11, -11, -4, -4, -4, -11, -4, -4, -4, -11, 11, -4, -4, 4, -11, -4, 4, -4, -11,}; - + private static byte[] gradients3D = new byte[]{-11, 4, 4, -4, 11, 4, -4, 4, 11, 11, 4, 4, 4, 11, 4, 4, 4, 11, -11, -4, 4, -4, -11, 4, -4, -4, 11, 11, -4, 4, 4, -11, 4, 4, -4, 11, -11, 4, -4, -4, 11, -4, -4, 4, -11, 11, 4, -4, 4, 11, -4, 4, 4, -11, -11, -4, -4, -4, -11, -4, -4, -4, -11, 11, -4, -4, 4, -11, -4, 4, -4, -11,}; + // Gradients for 4D. They approximate the directions to the // vertices of a disprismatotesseractihexadecachoron from the center, // skewed so that the tetrahedral and cubic facets can be inscribed inside // spheres of the same radius. - private static byte[] gradients4D = new byte[]{3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, -3, 1, 1, 1, -1, 3, - 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, -3, -1, 1, 1, -1, -3, 1, - 1, -1, -1, 3, 1, -1, -1, 1, 3, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, -3, 1, -1, 1, -1, 3, -1, - 1, -1, 1, -3, 1, -1, 1, -1, 3, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, -3, -1, -1, 1, -1, - -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, -3, 1, 1, -1, - -1, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, -3, -1, 1, - -1, -1, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, -3, - 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, -1, 1, -1, - -1, -3, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3,}; + private static byte[] gradients4D = new byte[]{3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3,}; } \ No newline at end of file diff --git a/src/main/java/ru/betterend/particle/FireflyParticle.java b/src/main/java/ru/betterend/particle/FireflyParticle.java index bf331531..80505a3e 100644 --- a/src/main/java/ru/betterend/particle/FireflyParticle.java +++ b/src/main/java/ru/betterend/particle/FireflyParticle.java @@ -19,7 +19,7 @@ public class FireflyParticle extends SimpleAnimatedParticle { private double nextVX; private double nextVY; private double nextVZ; - + protected FireflyParticle(ClientLevel world, double x, double y, double z, SpriteSet sprites, double r, double g, double b) { super(world, x, y, z, sprites, 0); setSprite(sprites.get(random)); @@ -28,16 +28,16 @@ public class FireflyParticle extends SimpleAnimatedParticle { this.setFadeColor(15916745); this.setSpriteFromAge(sprites); this.setAlpha(0); - + preVX = random.nextGaussian() * 0.02; preVY = random.nextGaussian() * 0.02; preVZ = random.nextGaussian() * 0.02; - + nextVX = random.nextGaussian() * 0.02; nextVY = random.nextGaussian() * 0.02; nextVZ = random.nextGaussian() * 0.02; } - + @Override public void tick() { int ticks = this.age & 31; @@ -50,29 +50,29 @@ public class FireflyParticle extends SimpleAnimatedParticle { nextVZ = random.nextGaussian() * 0.02; } double delta = (double) ticks / 31.0; - + this.xd = Mth.lerp(delta, preVX, nextVX); this.yd = Mth.lerp(delta, preVY, nextVY); this.zd = Mth.lerp(delta, preVZ, nextVZ); - + if (this.age <= 60) { this.setAlpha(this.age / 60F); } else if (this.age > lifetime - 60) { this.setAlpha((lifetime - this.age) / 60F); } - + super.tick(); } - + @Environment(EnvType.CLIENT) public static class FireflyParticleFactory implements ParticleProvider { private final SpriteSet sprites; - + public FireflyParticleFactory(SpriteSet sprites) { this.sprites = sprites; } - + @Override public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double vX, double vY, double vZ) { return new FireflyParticle(world, x, y, z, sprites, 1, 1, 1); diff --git a/src/main/java/ru/betterend/particle/InfusionParticle.java b/src/main/java/ru/betterend/particle/InfusionParticle.java index b9dbbc7b..35cc2cf8 100644 --- a/src/main/java/ru/betterend/particle/InfusionParticle.java +++ b/src/main/java/ru/betterend/particle/InfusionParticle.java @@ -10,9 +10,9 @@ import net.minecraft.client.particle.SpriteSet; import net.minecraft.client.particle.TextureSheetParticle; public class InfusionParticle extends TextureSheetParticle { - + private final SpriteSet spriteProvider; - + public InfusionParticle(ClientLevel clientWorld, double x, double y, double z, double velocityX, double velocityY, double velocityZ, float[] palette, SpriteSet spriteProvider) { super(clientWorld, x, y, z, 0.0, 0.0, 0.0); this.setSpriteFromAge(spriteProvider); @@ -25,12 +25,12 @@ public class InfusionParticle extends TextureSheetParticle { this.lifetime = (int) (3.0F / (this.random.nextFloat() * 0.9F + 0.1F)); this.quadSize *= 0.9F; } - + @Override public ParticleRenderType getRenderType() { return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } - + @Override public void tick() { this.xo = this.x; @@ -47,15 +47,15 @@ public class InfusionParticle extends TextureSheetParticle { this.move(velocityX, velocityY, velocityZ); } } - + @Environment(EnvType.CLIENT) public static class InfusionFactory implements ParticleProvider { private final SpriteSet spriteProvider; - + public InfusionFactory(SpriteSet spriteProvider) { this.spriteProvider = spriteProvider; } - + public Particle createParticle(InfusionParticleType particleType, ClientLevel clientWorld, double d, double e, double f, double g, double h, double i) { return new InfusionParticle(clientWorld, d, e, f, g, h, i, particleType.getPalette(), this.spriteProvider); } diff --git a/src/main/java/ru/betterend/particle/InfusionParticleType.java b/src/main/java/ru/betterend/particle/InfusionParticleType.java index 6b0d1080..da771119 100644 --- a/src/main/java/ru/betterend/particle/InfusionParticleType.java +++ b/src/main/java/ru/betterend/particle/InfusionParticleType.java @@ -16,10 +16,8 @@ import ru.bclib.util.ColorUtil; import ru.betterend.registry.EndParticles; public class InfusionParticleType extends ParticleType implements ParticleOptions { - public static final Codec CODEC = ItemStack.CODEC.xmap( - itemStack -> new InfusionParticleType(EndParticles.INFUSION, itemStack), - infusionParticleType -> infusionParticleType.itemStack); - + public static final Codec CODEC = ItemStack.CODEC.xmap(itemStack -> new InfusionParticleType(EndParticles.INFUSION, itemStack), infusionParticleType -> infusionParticleType.itemStack); + public static final ParticleOptions.Deserializer PARAMETERS_FACTORY = new ParticleOptions.Deserializer() { public InfusionParticleType fromCommand(ParticleType particleType, StringReader stringReader) throws CommandSyntaxException { stringReader.expect(' '); @@ -27,46 +25,46 @@ public class InfusionParticleType extends ParticleType imp ItemStack itemStack = new ItemInput(itemStringReader.getItem(), itemStringReader.getNbt()).createItemStack(1, false); return new InfusionParticleType(particleType, itemStack); } - + public InfusionParticleType fromNetwork(ParticleType particleType, FriendlyByteBuf packetByteBuf) { return new InfusionParticleType(particleType, packetByteBuf.readItem()); } }; - + private final ParticleType type; private final ItemStack itemStack; - + public InfusionParticleType(ParticleType particleType, ItemStack stack) { super(true, PARAMETERS_FACTORY); this.type = particleType; this.itemStack = stack; } - + public InfusionParticleType(ItemStack stack) { this(EndParticles.INFUSION, stack); } - + @Environment(EnvType.CLIENT) public float[] getPalette() { int color = ColorUtil.extractColor(itemStack.getItem()); return ColorUtil.toFloatArray(color); } - + @Override public ParticleType getType() { return this.type; } - + @Override public void writeToNetwork(FriendlyByteBuf buffer) { buffer.writeItem(itemStack); } - + @Override public String writeToString() { return Registry.PARTICLE_TYPE.getKey(this).toString(); } - + @Override public Codec codec() { return CODEC; diff --git a/src/main/java/ru/betterend/particle/ParticleBlackSpore.java b/src/main/java/ru/betterend/particle/ParticleBlackSpore.java index 21de4ecc..dee3e30b 100644 --- a/src/main/java/ru/betterend/particle/ParticleBlackSpore.java +++ b/src/main/java/ru/betterend/particle/ParticleBlackSpore.java @@ -20,25 +20,25 @@ public class ParticleBlackSpore extends SimpleAnimatedParticle { private double nextVX; private double nextVY; private double nextVZ; - + protected ParticleBlackSpore(ClientLevel world, double x, double y, double z, double r, double g, double b, SpriteSet sprites) { super(world, x, y, z, sprites, 0); setSprite(sprites.get(random)); - + this.lifetime = MHelper.randRange(30, 60, random); this.quadSize = MHelper.randRange(0.05F, 0.15F, random); this.setColor(1, 1, 1); this.setAlpha(0); - + preVX = random.nextGaussian() * 0.015; preVY = 0; preVZ = random.nextGaussian() * 0.015; - + nextVX = random.nextGaussian() * 0.015; nextVY = random.nextFloat() * 0.02 + 0.01; nextVZ = random.nextGaussian() * 0.015; } - + @Override public void tick() { int ticks = this.age & 15; @@ -51,39 +51,39 @@ public class ParticleBlackSpore extends SimpleAnimatedParticle { nextVZ = random.nextGaussian() * 0.015; } double delta = (double) ticks / 15.0; - + if (this.age <= 15) { this.setAlpha(this.age / 15F); } else if (this.age >= this.lifetime - 15) { this.setAlpha((this.lifetime - this.age) / 15F); } - + if (this.age >= this.lifetime) { this.remove(); } - + this.xd = Mth.lerp(delta, preVX, nextVX); this.yd = Mth.lerp(delta, preVY, nextVY); this.zd = Mth.lerp(delta, preVZ, nextVZ); - + super.tick(); } - + @Override public ParticleRenderType getRenderType() { return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } - + @Environment(EnvType.CLIENT) public static class FactoryBlackSpore implements ParticleProvider { - + private final SpriteSet sprites; - + public FactoryBlackSpore(SpriteSet sprites) { this.sprites = sprites; } - + @Override public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double vX, double vY, double vZ) { return new ParticleBlackSpore(world, x, y, z, 1, 1, 1, sprites); diff --git a/src/main/java/ru/betterend/particle/ParticleGeyser.java b/src/main/java/ru/betterend/particle/ParticleGeyser.java index 4fc4476d..6da20d09 100644 --- a/src/main/java/ru/betterend/particle/ParticleGeyser.java +++ b/src/main/java/ru/betterend/particle/ParticleGeyser.java @@ -17,7 +17,7 @@ public class ParticleGeyser extends TextureSheetParticle { private MutableBlockPos mut = new MutableBlockPos(); private boolean changeDir = false; private boolean check = true; - + protected ParticleGeyser(ClientLevel world, double x, double y, double z, double vx, double vy, double vz, SpriteSet sprites) { super(world, x, y, z, vx, vy, vz); pickSprite(sprites); @@ -27,10 +27,10 @@ public class ParticleGeyser extends TextureSheetParticle { this.zd = vz; this.yo = y - 0.125; } - + @Override public void tick() { - + if (this.yo == this.y || this.age > this.lifetime) { this.remove(); } @@ -38,10 +38,10 @@ public class ParticleGeyser extends TextureSheetParticle { if (this.age >= this.lifetime - 200) { this.setAlpha((this.lifetime - this.age) / 200F); } - + this.quadSize += 0.005F; this.yd = 0.125; - + if (changeDir) { changeDir = false; check = false; @@ -56,21 +56,21 @@ public class ParticleGeyser extends TextureSheetParticle { } super.tick(); } - + @Override public ParticleRenderType getRenderType() { return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } - + @Environment(EnvType.CLIENT) public static class FactoryGeyser implements ParticleProvider { - + private final SpriteSet sprites; - + public FactoryGeyser(SpriteSet sprites) { this.sprites = sprites; } - + @Override public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double vX, double vY, double vZ) { return new ParticleGeyser(world, x, y, z, 0, 0.125, 0, sprites); diff --git a/src/main/java/ru/betterend/particle/ParticleGlowingSphere.java b/src/main/java/ru/betterend/particle/ParticleGlowingSphere.java index 2afd97e8..c4f1d349 100644 --- a/src/main/java/ru/betterend/particle/ParticleGlowingSphere.java +++ b/src/main/java/ru/betterend/particle/ParticleGlowingSphere.java @@ -20,7 +20,7 @@ public class ParticleGlowingSphere extends SimpleAnimatedParticle { private double nextVX; private double nextVY; private double nextVZ; - + protected ParticleGlowingSphere(ClientLevel world, double x, double y, double z, SpriteSet sprites, double r, double g, double b) { super(world, x, y, z, sprites, 0); setSprite(sprites.get(random)); @@ -28,16 +28,16 @@ public class ParticleGlowingSphere extends SimpleAnimatedParticle { this.quadSize = MHelper.randRange(0.05F, 0.15F, random); this.setFadeColor(15916745); this.setSpriteFromAge(sprites); - + preVX = random.nextGaussian() * 0.02; preVY = random.nextGaussian() * 0.02; preVZ = random.nextGaussian() * 0.02; - + nextVX = random.nextGaussian() * 0.02; nextVY = random.nextGaussian() * 0.02; nextVZ = random.nextGaussian() * 0.02; } - + @Override public void tick() { ticks++; @@ -51,23 +51,23 @@ public class ParticleGlowingSphere extends SimpleAnimatedParticle { ticks = 0; } double delta = (double) ticks / 30.0; - + this.xd = Mth.lerp(delta, preVX, nextVX); this.yd = Mth.lerp(delta, preVY, nextVY); this.zd = Mth.lerp(delta, preVZ, nextVZ); - + super.tick(); } - + @Environment(EnvType.CLIENT) public static class FactoryGlowingSphere implements ParticleProvider { - + private final SpriteSet sprites; - + public FactoryGlowingSphere(SpriteSet sprites) { this.sprites = sprites; } - + @Override public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double vX, double vY, double vZ) { return new ParticleGlowingSphere(world, x, y, z, sprites, 1, 1, 1); diff --git a/src/main/java/ru/betterend/particle/ParticleJungleSpore.java b/src/main/java/ru/betterend/particle/ParticleJungleSpore.java index 309f398d..0488b778 100644 --- a/src/main/java/ru/betterend/particle/ParticleJungleSpore.java +++ b/src/main/java/ru/betterend/particle/ParticleJungleSpore.java @@ -12,7 +12,7 @@ import ru.bclib.util.MHelper; @Environment(EnvType.CLIENT) public class ParticleJungleSpore extends SimpleAnimatedParticle { - + protected ParticleJungleSpore(ClientLevel world, double x, double y, double z, SpriteSet sprites, double r, double g, double b) { super(world, x, y, z, sprites, 0); setSprite(sprites.get(random)); @@ -22,11 +22,11 @@ public class ParticleJungleSpore extends SimpleAnimatedParticle { this.setSpriteFromAge(sprites); this.setAlpha(0); } - + @Override public void tick() { super.tick(); - + int ticks = this.age % 30; if (ticks == 0) { this.xd = random.nextGaussian() * 0.02; @@ -34,7 +34,7 @@ public class ParticleJungleSpore extends SimpleAnimatedParticle { this.zd = random.nextGaussian() * 0.02; ticks = 0; } - + if (this.age <= 30) { float delta = ticks / 30F; this.setAlpha(delta); @@ -48,20 +48,20 @@ public class ParticleJungleSpore extends SimpleAnimatedParticle { else { this.setAlpha(1); } - + this.yd -= 0.001F; this.xd *= 0.99F; this.zd *= 0.99F; } - + @Environment(EnvType.CLIENT) public static class FactoryJungleSpore implements ParticleProvider { private final SpriteSet sprites; - + public FactoryJungleSpore(SpriteSet sprites) { this.sprites = sprites; } - + @Override public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double vX, double vY, double vZ) { return new ParticleJungleSpore(world, x, y, z, sprites, 1, 1, 1); diff --git a/src/main/java/ru/betterend/particle/ParticleSnowflake.java b/src/main/java/ru/betterend/particle/ParticleSnowflake.java index b9724a87..bcc46243 100644 --- a/src/main/java/ru/betterend/particle/ParticleSnowflake.java +++ b/src/main/java/ru/betterend/particle/ParticleSnowflake.java @@ -21,24 +21,24 @@ public class ParticleSnowflake extends TextureSheetParticle { private double nextVX; private double nextVY; private double nextVZ; - + protected ParticleSnowflake(ClientLevel world, double x, double y, double z, double r, double g, double b, SpriteSet sprites) { super(world, x, y, z, r, g, b); pickSprite(sprites); - + this.lifetime = MHelper.randRange(150, 300, random); this.quadSize = MHelper.randRange(0.05F, 0.2F, random); this.setAlpha(0F); - + preVX = random.nextGaussian() * 0.015; preVY = random.nextGaussian() * 0.015; preVZ = random.nextGaussian() * 0.015; - + nextVX = random.nextGaussian() * 0.015; nextVY = random.nextGaussian() * 0.015; nextVZ = random.nextGaussian() * 0.015; } - + @Override public void tick() { ticks++; @@ -55,39 +55,39 @@ public class ParticleSnowflake extends TextureSheetParticle { ticks = 0; } double delta = (double) ticks / 200.0; - + if (this.age <= 40) { this.setAlpha(this.age / 40F); } else if (this.age >= this.lifetime - 40) { this.setAlpha((this.lifetime - this.age) / 40F); } - + if (this.age >= this.lifetime) { this.remove(); } - + this.xd = Mth.lerp(delta, preVX, nextVX); this.yd = Mth.lerp(delta, preVY, nextVY); this.zd = Mth.lerp(delta, preVZ, nextVZ); - + super.tick(); } - + @Override public ParticleRenderType getRenderType() { return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } - + @Environment(EnvType.CLIENT) public static class FactorySnowflake implements ParticleProvider { - + private final SpriteSet sprites; - + public FactorySnowflake(SpriteSet sprites) { this.sprites = sprites; } - + @Override public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double vX, double vY, double vZ) { return new ParticleSnowflake(world, x, y, z, 1, 1, 1, sprites); diff --git a/src/main/java/ru/betterend/particle/ParticleSulphur.java b/src/main/java/ru/betterend/particle/ParticleSulphur.java index 2fcf0d47..1cb57527 100644 --- a/src/main/java/ru/betterend/particle/ParticleSulphur.java +++ b/src/main/java/ru/betterend/particle/ParticleSulphur.java @@ -21,25 +21,25 @@ public class ParticleSulphur extends TextureSheetParticle { private double nextVX; private double nextVY; private double nextVZ; - + protected ParticleSulphur(ClientLevel world, double x, double y, double z, double r, double g, double b, SpriteSet sprites) { super(world, x, y, z, r, g, b); pickSprite(sprites); - + this.lifetime = MHelper.randRange(150, 300, random); this.quadSize = MHelper.randRange(0.05F, 0.15F, random); this.setColor(1, 1, 1); this.setAlpha(0); - + preVX = random.nextGaussian() * 0.015; preVY = random.nextGaussian() * 0.015; preVZ = random.nextGaussian() * 0.015; - + nextVX = random.nextGaussian() * 0.015; nextVY = random.nextGaussian() * 0.015; nextVZ = random.nextGaussian() * 0.015; } - + @Override public void tick() { ticks++; @@ -56,39 +56,39 @@ public class ParticleSulphur extends TextureSheetParticle { ticks = 0; } double delta = (double) ticks / 200.0; - + if (this.age <= 40) { this.setAlpha(this.age / 40F); } else if (this.age >= this.lifetime - 40) { this.setAlpha((this.lifetime - this.age) / 40F); } - + if (this.age >= this.lifetime) { this.remove(); } - + this.xd = Mth.lerp(delta, preVX, nextVX); this.yd = Mth.lerp(delta, preVY, nextVY); this.zd = Mth.lerp(delta, preVZ, nextVZ); - + super.tick(); } - + @Override public ParticleRenderType getRenderType() { return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } - + @Environment(EnvType.CLIENT) public static class FactorySulphur implements ParticleProvider { - + private final SpriteSet sprites; - + public FactorySulphur(SpriteSet sprites) { this.sprites = sprites; } - + @Override public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double vX, double vY, double vZ) { return new ParticleSulphur(world, x, y, z, 1, 1, 1, sprites); diff --git a/src/main/java/ru/betterend/particle/ParticleTenaneaPetal.java b/src/main/java/ru/betterend/particle/ParticleTenaneaPetal.java index 0cd51137..88b08700 100644 --- a/src/main/java/ru/betterend/particle/ParticleTenaneaPetal.java +++ b/src/main/java/ru/betterend/particle/ParticleTenaneaPetal.java @@ -19,18 +19,18 @@ import ru.betterend.registry.EndBlocks; @Environment(EnvType.CLIENT) public class ParticleTenaneaPetal extends TextureSheetParticle { private static BlockColor provider; - + private double preVX; private double preVY; private double preVZ; private double nextVX; private double nextVY; private double nextVZ; - + protected ParticleTenaneaPetal(ClientLevel world, double x, double y, double z, double r, double g, double b, SpriteSet sprites) { super(world, x, y, z, r, g, b); pickSprite(sprites); - + if (provider == null) { IColorProvider block = (IColorProvider) EndBlocks.TENANEA_FLOWERS; provider = block.getProvider(); @@ -39,25 +39,25 @@ public class ParticleTenaneaPetal extends TextureSheetParticle { this.rCol = ((color >> 16) & 255) / 255F; this.gCol = ((color >> 8) & 255) / 255F; this.bCol = ((color) & 255) / 255F; - + this.lifetime = MHelper.randRange(120, 200, random); this.quadSize = MHelper.randRange(0.05F, 0.15F, random); this.setAlpha(0); - + preVX = 0; preVY = 0; preVZ = 0; - + nextVX = random.nextGaussian() * 0.02; nextVY = -random.nextDouble() * 0.02 - 0.02; nextVZ = random.nextGaussian() * 0.02; } - + @Override public int getLightColor(float tint) { return 15728880; } - + @Override public void tick() { int ticks = this.age & 63; @@ -70,39 +70,39 @@ public class ParticleTenaneaPetal extends TextureSheetParticle { nextVZ = random.nextGaussian() * 0.02; } double delta = (double) ticks / 63.0; - + if (this.age <= 40) { this.setAlpha(this.age / 40F); } else if (this.age >= this.lifetime - 40) { this.setAlpha((this.lifetime - this.age) / 40F); } - + if (this.age >= this.lifetime) { this.remove(); } - + this.xd = Mth.lerp(delta, preVX, nextVX); this.yd = Mth.lerp(delta, preVY, nextVY); this.zd = Mth.lerp(delta, preVZ, nextVZ); - + super.tick(); } - + @Override public ParticleRenderType getRenderType() { return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } - + @Environment(EnvType.CLIENT) public static class FactoryTenaneaPetal implements ParticleProvider { - + private final SpriteSet sprites; - + public FactoryTenaneaPetal(SpriteSet sprites) { this.sprites = sprites; } - + @Override public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double vX, double vY, double vZ) { return new ParticleTenaneaPetal(world, x, y, z, 1, 1, 1, sprites); diff --git a/src/main/java/ru/betterend/particle/PaticlePortalSphere.java b/src/main/java/ru/betterend/particle/PaticlePortalSphere.java index 65fc17af..76ba79f2 100644 --- a/src/main/java/ru/betterend/particle/PaticlePortalSphere.java +++ b/src/main/java/ru/betterend/particle/PaticlePortalSphere.java @@ -19,7 +19,7 @@ public class PaticlePortalSphere extends SimpleAnimatedParticle { private double nextVX; private double nextVY; private double nextVZ; - + public PaticlePortalSphere(ClientLevel world, double x, double y, double z, SpriteSet spriteProvider) { super(world, x, y, z, spriteProvider, 0); setSprite(spriteProvider.get(random)); @@ -28,16 +28,16 @@ public class PaticlePortalSphere extends SimpleAnimatedParticle { this.setColor(0xFEBBD5); this.setFadeColor(0xBBFEE4); this.setSpriteFromAge(spriteProvider); - + preVX = random.nextGaussian() * 0.02; preVY = random.nextGaussian() * 0.02; preVZ = random.nextGaussian() * 0.02; - + nextVX = random.nextGaussian() * 0.02; nextVY = random.nextGaussian() * 0.02; nextVZ = random.nextGaussian() * 0.02; } - + @Override public void tick() { ticks++; @@ -51,23 +51,23 @@ public class PaticlePortalSphere extends SimpleAnimatedParticle { ticks = 0; } double delta = (double) ticks / 30.0; - + this.xd = Mth.lerp(delta, preVX, nextVX); this.yd = Mth.lerp(delta, preVY, nextVY); this.zd = Mth.lerp(delta, preVZ, nextVZ); - + super.tick(); } - + @Environment(EnvType.CLIENT) public static class FactoryPortalSphere implements ParticleProvider { - + private final SpriteSet sprites; - + public FactoryPortalSphere(SpriteSet sprites) { this.sprites = sprites; } - + @Override public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double vX, double vY, double vZ) { return new PaticlePortalSphere(world, x, y, z, sprites); diff --git a/src/main/java/ru/betterend/particle/SmaragdantParticle.java b/src/main/java/ru/betterend/particle/SmaragdantParticle.java index d58d88cb..946bca07 100644 --- a/src/main/java/ru/betterend/particle/SmaragdantParticle.java +++ b/src/main/java/ru/betterend/particle/SmaragdantParticle.java @@ -20,25 +20,25 @@ public class SmaragdantParticle extends SimpleAnimatedParticle { private double nextVX; private double nextVY; private double nextVZ; - + protected SmaragdantParticle(ClientLevel world, double x, double y, double z, double r, double g, double b, SpriteSet sprites) { super(world, x, y, z, sprites, 0); setSprite(sprites.get(random)); - + this.lifetime = MHelper.randRange(60, 120, random); this.quadSize = MHelper.randRange(0.05F, 0.15F, random); this.setColor(1, 1, 1); this.setAlpha(0); - + preVX = random.nextGaussian() * 0.01; preVY = random.nextGaussian() * 0.01; preVZ = random.nextGaussian() * 0.01; - + nextVX = random.nextGaussian() * 0.01; nextVY = random.nextGaussian() * 0.01; nextVZ = random.nextGaussian() * 0.01; } - + @Override public void tick() { int ticks = this.age & 31; @@ -51,39 +51,39 @@ public class SmaragdantParticle extends SimpleAnimatedParticle { nextVZ = random.nextGaussian() * 0.015; } double delta = (double) ticks / 31.0; - + if (this.age <= 31) { this.setAlpha(this.age / 31F); } else if (this.age >= this.lifetime - 31) { this.setAlpha((this.lifetime - this.age) / 31F); } - + if (this.age >= this.lifetime) { this.remove(); } - + this.xd = Mth.lerp(delta, preVX, nextVX); this.yd = Mth.lerp(delta, preVY, nextVY); this.zd = Mth.lerp(delta, preVZ, nextVZ); - + super.tick(); } - + @Override public ParticleRenderType getRenderType() { return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; } - + @Environment(EnvType.CLIENT) public static class SmaragdantParticleFactory implements ParticleProvider { - + private final SpriteSet sprites; - + public SmaragdantParticleFactory(SpriteSet sprites) { this.sprites = sprites; } - + @Override public Particle createParticle(SimpleParticleType type, ClientLevel world, double x, double y, double z, double vX, double vY, double vZ) { return new SmaragdantParticle(world, x, y, z, 1, 1, 1, sprites); diff --git a/src/main/java/ru/betterend/recipe/AlloyingRecipes.java b/src/main/java/ru/betterend/recipe/AlloyingRecipes.java index b4f5aefe..7050c34e 100644 --- a/src/main/java/ru/betterend/recipe/AlloyingRecipes.java +++ b/src/main/java/ru/betterend/recipe/AlloyingRecipes.java @@ -9,44 +9,12 @@ import ru.betterend.registry.EndTags; public class AlloyingRecipes { public static void register() { - AlloyingRecipe.Builder.create("additional_iron") - .setInput(EndTags.ALLOYING_IRON, EndTags.ALLOYING_IRON) - .setOutput(Items.IRON_INGOT, 3) - .setExpiriense(2.1F) - .build(); - AlloyingRecipe.Builder.create("additional_gold") - .setInput(EndTags.ALLOYING_GOLD, EndTags.ALLOYING_GOLD) - .setOutput(Items.GOLD_INGOT, 3) - .setExpiriense(3F) - .build(); - AlloyingRecipe.Builder.create("additional_copper") - .setInput(EndTags.ALLOYING_COPPER, EndTags.ALLOYING_COPPER) - .setOutput(Items.COPPER_INGOT, 3) - .setExpiriense(3F) - .build(); - AlloyingRecipe.Builder.create("additional_netherite") - .setInput(Blocks.ANCIENT_DEBRIS, Blocks.ANCIENT_DEBRIS) - .setOutput(Items.NETHERITE_SCRAP, 3) - .setExpiriense(6F) - .setSmeltTime(1000) - .build(); - AlloyingRecipe.Builder.create("terminite_ingot") - .setInput(Items.IRON_INGOT, EndItems.ENDER_DUST) - .setOutput(EndBlocks.TERMINITE.ingot, 1) - .setExpiriense(2.5F) - .setSmeltTime(450) - .build(); - AlloyingRecipe.Builder.create("aeternium_ingot") - .setInput(EndBlocks.TERMINITE.ingot, Items.NETHERITE_INGOT) - .setOutput(EndItems.AETERNIUM_INGOT, 1) - .setExpiriense(4.5F) - .setSmeltTime(850) - .build(); - AlloyingRecipe.Builder.create("terminite_ingot_thallasium") - .setInput(EndBlocks.THALLASIUM.ingot, EndItems.ENDER_DUST) - .setOutput(EndBlocks.TERMINITE.ingot, 1) - .setExpiriense(2.5F) - .setSmeltTime(450) - .build(); + AlloyingRecipe.Builder.create("additional_iron").setInput(EndTags.ALLOYING_IRON, EndTags.ALLOYING_IRON).setOutput(Items.IRON_INGOT, 3).setExpiriense(2.1F).build(); + AlloyingRecipe.Builder.create("additional_gold").setInput(EndTags.ALLOYING_GOLD, EndTags.ALLOYING_GOLD).setOutput(Items.GOLD_INGOT, 3).setExpiriense(3F).build(); + AlloyingRecipe.Builder.create("additional_copper").setInput(EndTags.ALLOYING_COPPER, EndTags.ALLOYING_COPPER).setOutput(Items.COPPER_INGOT, 3).setExpiriense(3F).build(); + AlloyingRecipe.Builder.create("additional_netherite").setInput(Blocks.ANCIENT_DEBRIS, Blocks.ANCIENT_DEBRIS).setOutput(Items.NETHERITE_SCRAP, 3).setExpiriense(6F).setSmeltTime(1000).build(); + AlloyingRecipe.Builder.create("terminite_ingot").setInput(Items.IRON_INGOT, EndItems.ENDER_DUST).setOutput(EndBlocks.TERMINITE.ingot, 1).setExpiriense(2.5F).setSmeltTime(450).build(); + AlloyingRecipe.Builder.create("aeternium_ingot").setInput(EndBlocks.TERMINITE.ingot, Items.NETHERITE_INGOT).setOutput(EndItems.AETERNIUM_INGOT, 1).setExpiriense(4.5F).setSmeltTime(850).build(); + AlloyingRecipe.Builder.create("terminite_ingot_thallasium").setInput(EndBlocks.THALLASIUM.ingot, EndItems.ENDER_DUST).setOutput(EndBlocks.TERMINITE.ingot, 1).setExpiriense(2.5F).setSmeltTime(450).build(); } } diff --git a/src/main/java/ru/betterend/recipe/AnvilRecipes.java b/src/main/java/ru/betterend/recipe/AnvilRecipes.java index 197eac88..60bfc6d5 100644 --- a/src/main/java/ru/betterend/recipe/AnvilRecipes.java +++ b/src/main/java/ru/betterend/recipe/AnvilRecipes.java @@ -7,68 +7,16 @@ import ru.betterend.registry.EndItems; public class AnvilRecipes { public static void register() { - AnvilRecipe.Builder.create("ender_pearl_to_dust") - .setInput(Items.ENDER_PEARL) - .setOutput(EndItems.ENDER_DUST) - .setToolLevel(4) - .setDamage(5) - .build(); - AnvilRecipe.Builder.create("ender_shard_to_dust") - .setInput(EndItems.ENDER_SHARD) - .setOutput(EndItems.ENDER_DUST) - .setToolLevel(0) - .setDamage(3) - .build(); - + AnvilRecipe.Builder.create("ender_pearl_to_dust").setInput(Items.ENDER_PEARL).setOutput(EndItems.ENDER_DUST).setToolLevel(4).setDamage(5).build(); + AnvilRecipe.Builder.create("ender_shard_to_dust").setInput(EndItems.ENDER_SHARD).setOutput(EndItems.ENDER_DUST).setToolLevel(0).setDamage(3).build(); + int anvilLevel = EndToolMaterial.AETERNIUM.getLevel(); - AnvilRecipe.Builder.create("aeternium_axe_head") - .setInput(EndItems.AETERNIUM_INGOT) - .setOutput(EndItems.AETERNIUM_AXE_HEAD) - .setAnvilLevel(anvilLevel) - .setToolLevel(4) - .setDamage(6) - .build(); - AnvilRecipe.Builder.create("aeternium_pickaxe_head") - .setInput(EndItems.AETERNIUM_INGOT) - .setOutput(EndItems.AETERNIUM_PICKAXE_HEAD) - .setAnvilLevel(anvilLevel) - .setToolLevel(4) - .setDamage(6) - .build(); - AnvilRecipe.Builder.create("aeternium_shovel_head") - .setInput(EndItems.AETERNIUM_INGOT) - .setOutput(EndItems.AETERNIUM_SHOVEL_HEAD) - .setAnvilLevel(anvilLevel) - .setToolLevel(4) - .setDamage(6) - .build(); - AnvilRecipe.Builder.create("aeternium_hoe_head") - .setInput(EndItems.AETERNIUM_INGOT) - .setOutput(EndItems.AETERNIUM_HOE_HEAD) - .setAnvilLevel(anvilLevel) - .setToolLevel(4) - .setDamage(6) - .build(); - AnvilRecipe.Builder.create("aeternium_hammer_head") - .setInput(EndItems.AETERNIUM_INGOT) - .setOutput(EndItems.AETERNIUM_HAMMER_HEAD) - .setAnvilLevel(anvilLevel) - .setToolLevel(4) - .setDamage(6) - .build(); - AnvilRecipe.Builder.create("aeternium_sword_blade") - .setInput(EndItems.AETERNIUM_INGOT) - .setOutput(EndItems.AETERNIUM_SWORD_BLADE) - .setAnvilLevel(anvilLevel) - .setToolLevel(4) - .setDamage(6) - .build(); - AnvilRecipe.Builder.create("aeternium_forged_plate") - .setInput(EndItems.AETERNIUM_INGOT) - .setOutput(EndItems.AETERNIUM_FORGED_PLATE) - .setAnvilLevel(anvilLevel) - .setToolLevel(4) - .setDamage(6) - .build(); + AnvilRecipe.Builder.create("aeternium_axe_head").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_AXE_HEAD).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); + AnvilRecipe.Builder.create("aeternium_pickaxe_head").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_PICKAXE_HEAD).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); + AnvilRecipe.Builder.create("aeternium_shovel_head").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_SHOVEL_HEAD).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); + AnvilRecipe.Builder.create("aeternium_hoe_head").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_HOE_HEAD).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); + AnvilRecipe.Builder.create("aeternium_hammer_head").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_HAMMER_HEAD).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); + AnvilRecipe.Builder.create("aeternium_sword_blade").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_SWORD_BLADE).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); + AnvilRecipe.Builder.create("aeternium_forged_plate").setInput(EndItems.AETERNIUM_INGOT).setOutput(EndItems.AETERNIUM_FORGED_PLATE).setAnvilLevel(anvilLevel).setToolLevel(anvilLevel).setDamage(6).build(); } } diff --git a/src/main/java/ru/betterend/recipe/CraftingRecipes.java b/src/main/java/ru/betterend/recipe/CraftingRecipes.java index 1e619222..d83ae9e9 100644 --- a/src/main/java/ru/betterend/recipe/CraftingRecipes.java +++ b/src/main/java/ru/betterend/recipe/CraftingRecipes.java @@ -15,69 +15,39 @@ import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndItems; public class CraftingRecipes { - + public static void register() { - GridRecipe.make(BetterEnd.MOD_ID, "ender_perl_to_block", EndBlocks.ENDER_BLOCK) - .checkConfig(Configs.RECIPE_CONFIG) - .setShape("OO", "OO") - .addMaterial('O', Items.ENDER_PEARL) - .build(); - GridRecipe.make(BetterEnd.MOD_ID, "ender_block_to_perl", Items.ENDER_PEARL) - .checkConfig(Configs.RECIPE_CONFIG) - .addMaterial('#', EndBlocks.ENDER_BLOCK) - .setOutputCount(4) - .setList("#") - .build(); - - GridRecipe.make(BetterEnd.MOD_ID, "end_stone_smelter", EndBlocks.END_STONE_SMELTER) - .checkConfig(Configs.RECIPE_CONFIG) - .setShape("T#T", "V V", "T#T") - .addMaterial('#', Blocks.END_STONE_BRICKS) - .addMaterial('T', EndBlocks.THALLASIUM.ingot) - .addMaterial('V', TagAPI.FURNACES) - .build(); - + GridRecipe.make(BetterEnd.MOD_ID, "ender_perl_to_block", EndBlocks.ENDER_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("OO", "OO").addMaterial('O', Items.ENDER_PEARL).build(); + GridRecipe.make(BetterEnd.MOD_ID, "ender_block_to_perl", Items.ENDER_PEARL).checkConfig(Configs.RECIPE_CONFIG).addMaterial('#', EndBlocks.ENDER_BLOCK).setOutputCount(4).setList("#").build(); + + GridRecipe.make(BetterEnd.MOD_ID, "end_stone_smelter", EndBlocks.END_STONE_SMELTER).checkConfig(Configs.RECIPE_CONFIG).setShape("T#T", "V V", "T#T").addMaterial('#', Blocks.END_STONE_BRICKS).addMaterial('T', EndBlocks.THALLASIUM.ingot).addMaterial('V', TagAPI.FURNACES).build(); + registerPedestal("andesite_pedestal", EndBlocks.ANDESITE_PEDESTAL, Blocks.POLISHED_ANDESITE_SLAB, Blocks.POLISHED_ANDESITE); registerPedestal("diorite_pedestal", EndBlocks.DIORITE_PEDESTAL, Blocks.POLISHED_DIORITE_SLAB, Blocks.POLISHED_DIORITE); registerPedestal("granite_pedestal", EndBlocks.GRANITE_PEDESTAL, Blocks.POLISHED_GRANITE_SLAB, Blocks.POLISHED_GRANITE); registerPedestal("quartz_pedestal", EndBlocks.QUARTZ_PEDESTAL, Blocks.QUARTZ_SLAB, Blocks.QUARTZ_PILLAR); registerPedestal("purpur_pedestal", EndBlocks.PURPUR_PEDESTAL, Blocks.PURPUR_SLAB, Blocks.PURPUR_PILLAR); - - GridRecipe.make(BetterEnd.MOD_ID, "infusion_pedestal", EndBlocks.INFUSION_PEDESTAL) - .checkConfig(Configs.RECIPE_CONFIG) - .setShape(" Y ", "O#O", " # ") - .addMaterial('O', Items.ENDER_PEARL) - .addMaterial('Y', Items.ENDER_EYE) - .addMaterial('#', Blocks.OBSIDIAN) - .build(); - + + GridRecipe.make(BetterEnd.MOD_ID, "infusion_pedestal", EndBlocks.INFUSION_PEDESTAL).checkConfig(Configs.RECIPE_CONFIG).setShape(" Y ", "O#O", " # ").addMaterial('O', Items.ENDER_PEARL).addMaterial('Y', Items.ENDER_EYE).addMaterial('#', Blocks.OBSIDIAN).build(); + String material = "aeternium"; - GridRecipe.make(BetterEnd.MOD_ID, material + "_block", EndBlocks.AETERNIUM_BLOCK) - .checkConfig(Configs.RECIPE_CONFIG) - .setShape("III", "III", "III") - .addMaterial('I', EndItems.AETERNIUM_INGOT) - .build(); - GridRecipe.make(BetterEnd.MOD_ID, material + "_block_to_ingot", EndItems.AETERNIUM_INGOT) - .checkConfig(Configs.RECIPE_CONFIG) - .addMaterial('#', EndBlocks.AETERNIUM_BLOCK) - .setOutputCount(9) - .setList("#") - .build(); - + GridRecipe.make(BetterEnd.MOD_ID, material + "_block", EndBlocks.AETERNIUM_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("III", "III", "III").addMaterial('I', EndItems.AETERNIUM_INGOT).build(); + GridRecipe.make(BetterEnd.MOD_ID, material + "_block_to_ingot", EndItems.AETERNIUM_INGOT).checkConfig(Configs.RECIPE_CONFIG).addMaterial('#', EndBlocks.AETERNIUM_BLOCK).setOutputCount(9).setList("#").build(); + GridRecipe.make(BetterEnd.MOD_ID, "blue_vine_seed_dye", Items.BLUE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.BLUE_VINE_SEED).build(); GridRecipe.make(BetterEnd.MOD_ID, "creeping_moss_dye", Items.CYAN_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CREEPING_MOSS).build(); GridRecipe.make(BetterEnd.MOD_ID, "umbrella_moss_dye", Items.YELLOW_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.UMBRELLA_MOSS).build(); GridRecipe.make(BetterEnd.MOD_ID, "umbrella_moss_tall_dye", Items.YELLOW_DYE).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(2).setList("#").addMaterial('#', EndBlocks.UMBRELLA_MOSS_TALL).build(); GridRecipe.make(BetterEnd.MOD_ID, "shadow_plant_dye", Items.BLACK_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.SHADOW_PLANT).build(); - + GridRecipe.make(BetterEnd.MOD_ID, "paper", Items.PAPER).checkConfig(Configs.RECIPE_CONFIG).setShape("###").addMaterial('#', EndItems.END_LILY_LEAF_DRIED).setOutputCount(3).build(); - + GridRecipe.make(BetterEnd.MOD_ID, "aurora_block", EndBlocks.AURORA_CRYSTAL).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.CRYSTAL_SHARDS).build(); GridRecipe.make(BetterEnd.MOD_ID, "lotus_block", EndBlocks.END_LOTUS.log).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndBlocks.END_LOTUS_STEM).build(); GridRecipe.make(BetterEnd.MOD_ID, "needlegrass_stick", Items.STICK).setList("#").checkConfig(Configs.RECIPE_CONFIG).setOutputCount(2).addMaterial('#', EndBlocks.NEEDLEGRASS).build(); GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_seeds", EndBlocks.SHADOW_BERRY).checkConfig(Configs.RECIPE_CONFIG).setList("#").setOutputCount(4).addMaterial('#', EndItems.SHADOW_BERRY_RAW).build(); GridRecipe.make(BetterEnd.MOD_ID, "purple_polypore_dye", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.PURPLE_POLYPORE).build(); - + registerLantern("end_stone_lantern", EndBlocks.END_STONE_LANTERN, Blocks.END_STONE_BRICK_SLAB); registerLantern("andesite_lantern", EndBlocks.ANDESITE_LANTERN, Blocks.ANDESITE_SLAB); registerLantern("diorite_lantern", EndBlocks.DIORITE_LANTERN, Blocks.DIORITE_SLAB); @@ -85,171 +55,85 @@ public class CraftingRecipes { registerLantern("quartz_lantern", EndBlocks.QUARTZ_LANTERN, Blocks.QUARTZ_SLAB); registerLantern("purpur_lantern", EndBlocks.PURPUR_LANTERN, Blocks.PURPUR_SLAB); registerLantern("blackstone_lantern", EndBlocks.BLACKSTONE_LANTERN, Blocks.BLACKSTONE_SLAB); - + GridRecipe.make(BetterEnd.MOD_ID, "amber_gem", EndItems.AMBER_GEM).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.RAW_AMBER).build(); GridRecipe.make(BetterEnd.MOD_ID, "amber_block", EndBlocks.AMBER_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.AMBER_GEM).build(); GridRecipe.make(BetterEnd.MOD_ID, "amber_gem_block", EndItems.AMBER_GEM).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setList("#").addMaterial('#', EndBlocks.AMBER_BLOCK).build(); - GridRecipe.make(BetterEnd.MOD_ID, "iron_bulb_lantern", EndBlocks.IRON_BULB_LANTERN).checkConfig(Configs.RECIPE_CONFIG).setShape("C", "I", "#").addMaterial('C', Items.CHAIN).addMaterial('I', Items.IRON_INGOT) - .addMaterial('#', EndItems.GLOWING_BULB).build(); + GridRecipe.make(BetterEnd.MOD_ID, "iron_bulb_lantern", EndBlocks.IRON_BULB_LANTERN).checkConfig(Configs.RECIPE_CONFIG).setShape("C", "I", "#").addMaterial('C', Items.CHAIN).addMaterial('I', Items.IRON_INGOT).addMaterial('#', EndItems.GLOWING_BULB).build(); GridRecipe.make(BetterEnd.MOD_ID, "twisted_moss_dye", Items.PINK_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.TWISTED_MOSS).build(); GridRecipe.make(BetterEnd.MOD_ID, "byshy_grass_dye", Items.MAGENTA_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.BUSHY_GRASS).build(); GridRecipe.make(BetterEnd.MOD_ID, "tail_moss_dye", Items.GRAY_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.TAIL_MOSS).build(); GridRecipe.make(BetterEnd.MOD_ID, "petal_block", EndBlocks.HYDRALUX_PETAL_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndItems.HYDRALUX_PETAL).build(); GridRecipe.make(BetterEnd.MOD_ID, "petal_white_dye", Items.WHITE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndItems.HYDRALUX_PETAL).build(); - - GridRecipe.make(BetterEnd.MOD_ID, "sweet_berry_jelly", EndItems.SWEET_BERRY_JELLY) - .checkConfig(Configs.RECIPE_CONFIG) - .setList("JWSB") - .addMaterial('J', EndItems.GELATINE) - .addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)) - .addMaterial('S', Items.SUGAR).addMaterial('B', Items.SWEET_BERRIES) - .build(); - - GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_jelly", EndItems.SHADOW_BERRY_JELLY) - .checkConfig(Configs.RECIPE_CONFIG) - .setList("JWSB") - .addMaterial('J', EndItems.GELATINE) - .addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)) - .addMaterial('S', Items.SUGAR) - .addMaterial('B', EndItems.SHADOW_BERRY_COOKED) - .build(); - - GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_jelly", EndItems.BLOSSOM_BERRY_JELLY) - .checkConfig(Configs.RECIPE_CONFIG) - .setList("JWSB") - .addMaterial('J', EndItems.GELATINE) - .addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)) - .addMaterial('S', Items.SUGAR) - .addMaterial('B', EndItems.BLOSSOM_BERRY) - .build(); - - GridRecipe.make(BetterEnd.MOD_ID, "sulphur_gunpowder", Items.GUNPOWDER).checkConfig(Configs.RECIPE_CONFIG).setList("SCB").addMaterial('S', EndItems.CRYSTALLINE_SULPHUR).addMaterial('C', Items.COAL, Items.CHARCOAL) - .addMaterial('B', Items.BONE_MEAL).build(); - + + GridRecipe.make(BetterEnd.MOD_ID, "sweet_berry_jelly", EndItems.SWEET_BERRY_JELLY).checkConfig(Configs.RECIPE_CONFIG).setList("JWSB").addMaterial('J', EndItems.GELATINE).addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)).addMaterial('S', Items.SUGAR).addMaterial('B', Items.SWEET_BERRIES).build(); + + GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_jelly", EndItems.SHADOW_BERRY_JELLY).checkConfig(Configs.RECIPE_CONFIG).setList("JWSB").addMaterial('J', EndItems.GELATINE).addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)).addMaterial('S', Items.SUGAR).addMaterial('B', EndItems.SHADOW_BERRY_COOKED).build(); + + GridRecipe.make(BetterEnd.MOD_ID, "shadow_berry_jelly", EndItems.BLOSSOM_BERRY_JELLY).checkConfig(Configs.RECIPE_CONFIG).setList("JWSB").addMaterial('J', EndItems.GELATINE).addMaterial('W', PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.WATER)).addMaterial('S', Items.SUGAR).addMaterial('B', EndItems.BLOSSOM_BERRY).build(); + + GridRecipe.make(BetterEnd.MOD_ID, "sulphur_gunpowder", Items.GUNPOWDER).checkConfig(Configs.RECIPE_CONFIG).setList("SCB").addMaterial('S', EndItems.CRYSTALLINE_SULPHUR).addMaterial('C', Items.COAL, Items.CHARCOAL).addMaterial('B', Items.BONE_MEAL).build(); + GridRecipe.make(BetterEnd.MOD_ID, "dense_emerald_ice", EndBlocks.DENSE_EMERALD_ICE).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndBlocks.EMERALD_ICE).build(); GridRecipe.make(BetterEnd.MOD_ID, "ancient_emerald_ice", EndBlocks.ANCIENT_EMERALD_ICE).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', EndBlocks.DENSE_EMERALD_ICE).build(); - + GridRecipe.make(BetterEnd.MOD_ID, "charnia_cyan_dye", Items.CYAN_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_CYAN).build(); GridRecipe.make(BetterEnd.MOD_ID, "charnia_green_dye", Items.GREEN_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_GREEN).build(); GridRecipe.make(BetterEnd.MOD_ID, "charnia_light_blue_dye", Items.LIGHT_BLUE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_LIGHT_BLUE).build(); GridRecipe.make(BetterEnd.MOD_ID, "charnia_orange_dye", Items.ORANGE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_ORANGE).build(); GridRecipe.make(BetterEnd.MOD_ID, "charnia_purple_dye", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_PURPLE).build(); GridRecipe.make(BetterEnd.MOD_ID, "charnia_red_dye", Items.RED_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.CHARNIA_RED).build(); - - GridRecipe.make(BetterEnd.MOD_ID, "respawn_obelisk", EndBlocks.RESPAWN_OBELISK) - .checkConfig(Configs.RECIPE_CONFIG) - .setShape("CSC", "CSC", "AAA") - .addMaterial('C', EndBlocks.AURORA_CRYSTAL) - .addMaterial('S', EndItems.ETERNAL_CRYSTAL) - .addMaterial('A', EndBlocks.AMBER_BLOCK) - .build(); - + + GridRecipe.make(BetterEnd.MOD_ID, "respawn_obelisk", EndBlocks.RESPAWN_OBELISK).checkConfig(Configs.RECIPE_CONFIG).setShape("CSC", "CSC", "AAA").addMaterial('C', EndBlocks.AURORA_CRYSTAL).addMaterial('S', EndItems.ETERNAL_CRYSTAL).addMaterial('A', EndBlocks.AMBER_BLOCK).build(); + GridRecipe.make(BetterEnd.MOD_ID, "twisted_umbrella_moss_dye", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setList("#").addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS).build(); GridRecipe.make(BetterEnd.MOD_ID, "twisted_umbrella_moss_dye_tall", Items.PURPLE_DYE).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(2).setList("#").addMaterial('#', EndBlocks.TWISTED_UMBRELLA_MOSS_TALL).build(); - - GridRecipe.make(BetterEnd.MOD_ID, "leather_to_stripes", EndItems.LEATHER_STRIPE) - .checkConfig(Configs.RECIPE_CONFIG) - .setList("L") - .addMaterial('L', Items.LEATHER) - .setOutputCount(3) - .build(); - GridRecipe.make(BetterEnd.MOD_ID, "stripes_to_leather", Items.LEATHER) - .checkConfig(Configs.RECIPE_CONFIG) - .setList("SSS") - .addMaterial('S', EndItems.LEATHER_STRIPE) - .build(); - GridRecipe.make(BetterEnd.MOD_ID, "leather_wrapped_stick", EndItems.LEATHER_WRAPPED_STICK) - .checkConfig(Configs.RECIPE_CONFIG) - .setList("SL") - .addMaterial('S', Items.STICK) - .addMaterial('L', EndItems.LEATHER_STRIPE) - .build(); - + + GridRecipe.make(BetterEnd.MOD_ID, "leather_to_stripes", EndItems.LEATHER_STRIPE).checkConfig(Configs.RECIPE_CONFIG).setList("L").addMaterial('L', Items.LEATHER).setOutputCount(3).build(); + GridRecipe.make(BetterEnd.MOD_ID, "stripes_to_leather", Items.LEATHER).checkConfig(Configs.RECIPE_CONFIG).setList("SSS").addMaterial('S', EndItems.LEATHER_STRIPE).build(); + GridRecipe.make(BetterEnd.MOD_ID, "leather_wrapped_stick", EndItems.LEATHER_WRAPPED_STICK).checkConfig(Configs.RECIPE_CONFIG).setList("SL").addMaterial('S', Items.STICK).addMaterial('L', EndItems.LEATHER_STRIPE).build(); + GridRecipe.make(BetterEnd.MOD_ID, "fiber_string", Items.STRING).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(6).setShape("#", "#", "#").addMaterial('#', EndItems.SILK_FIBER).build(); - - GridRecipe.make(BetterEnd.MOD_ID, "ender_eye_amber", Items.ENDER_EYE) - .checkConfig(Configs.RECIPE_CONFIG) - .setShape("SAS", "APA", "SAS") - .addMaterial('S', EndItems.CRYSTAL_SHARDS) - .addMaterial('A', EndItems.AMBER_GEM) - .addMaterial('P', Items.ENDER_PEARL) - .build(); - - GridRecipe.make(BetterEnd.MOD_ID, "iron_chandelier", EndBlocks.IRON_CHANDELIER).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", " # ").addMaterial('#', Items.IRON_INGOT).addMaterial('I', EndItems.LUMECORN_ROD) - .setGroup("end_metal_chandelier").build(); - GridRecipe.make(BetterEnd.MOD_ID, "gold_chandelier", EndBlocks.GOLD_CHANDELIER).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", " # ").addMaterial('#', Items.GOLD_INGOT).addMaterial('I', EndItems.LUMECORN_ROD) - .setGroup("end_metal_chandelier").build(); - - GridRecipe.make(BetterEnd.MOD_ID, "missing_tile", EndBlocks.MISSING_TILE) - .checkConfig(Configs.RECIPE_CONFIG) - .setOutputCount(4) - .setShape("#P", "P#") - .addMaterial('#', EndBlocks.VIOLECITE.stone, EndBlocks.VIOLECITE.bricks, EndBlocks.VIOLECITE.tiles) - .addMaterial('P', Blocks.PURPUR_BLOCK) - .build(); - + + GridRecipe.make(BetterEnd.MOD_ID, "ender_eye_amber", Items.ENDER_EYE).checkConfig(Configs.RECIPE_CONFIG).setShape("SAS", "APA", "SAS").addMaterial('S', EndItems.CRYSTAL_SHARDS).addMaterial('A', EndItems.AMBER_GEM).addMaterial('P', Items.ENDER_PEARL).build(); + + GridRecipe.make(BetterEnd.MOD_ID, "iron_chandelier", EndBlocks.IRON_CHANDELIER).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", " # ").addMaterial('#', Items.IRON_INGOT).addMaterial('I', EndItems.LUMECORN_ROD).setGroup("end_metal_chandelier").build(); + GridRecipe.make(BetterEnd.MOD_ID, "gold_chandelier", EndBlocks.GOLD_CHANDELIER).checkConfig(Configs.RECIPE_CONFIG).setShape("I#I", " # ").addMaterial('#', Items.GOLD_INGOT).addMaterial('I', EndItems.LUMECORN_ROD).setGroup("end_metal_chandelier").build(); + + GridRecipe.make(BetterEnd.MOD_ID, "missing_tile", EndBlocks.MISSING_TILE).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setShape("#P", "P#").addMaterial('#', EndBlocks.VIOLECITE.stone, EndBlocks.VIOLECITE.bricks, EndBlocks.VIOLECITE.tiles).addMaterial('P', Blocks.PURPUR_BLOCK).build(); + registerHammer("iron", Items.IRON_INGOT, EndItems.IRON_HAMMER); registerHammer("golden", Items.GOLD_INGOT, EndItems.GOLDEN_HAMMER); registerHammer("diamond", Items.DIAMOND, EndItems.DIAMOND_HAMMER); - + GridRecipe.make(BetterEnd.MOD_ID, "charcoal_block", EndBlocks.CHARCOAL_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', Items.CHARCOAL).build(); GridRecipe.make(BetterEnd.MOD_ID, "charcoal_from_block", Items.CHARCOAL).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(9).setList("#").addMaterial('#', EndBlocks.CHARCOAL_BLOCK).build(); GridRecipe.make(BetterEnd.MOD_ID, "end_stone_furnace", EndBlocks.END_STONE_FURNACE).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "# #", "###").addMaterial('#', Blocks.END_STONE).build(); GridRecipe.make(BetterEnd.MOD_ID, "filalux_lantern", EndBlocks.FILALUX_LANTERN).checkConfig(Configs.RECIPE_CONFIG).setShape("###", "###", "###").addMaterial('#', EndBlocks.FILALUX).build(); - - GridRecipe.make(BetterEnd.MOD_ID, "silk_moth_hive", EndBlocks.SILK_MOTH_HIVE) - .checkConfig(Configs.RECIPE_CONFIG).setShape("#L#", "LML", "#L#") - .addMaterial('#', EndBlocks.TENANEA.planks) - .addMaterial('L', EndBlocks.TENANEA_LEAVES) - .addMaterial('M', EndItems.SILK_MOTH_MATRIX) - .build(); - - GridRecipe.make(BetterEnd.MOD_ID, "cave_pumpkin_pie", EndItems.CAVE_PUMPKIN_PIE) - .checkConfig(Configs.RECIPE_CONFIG) - .setShape("SBS", "BPB", "SBS") - .addMaterial('P', EndBlocks.CAVE_PUMPKIN) - .addMaterial('B', EndItems.BLOSSOM_BERRY, EndItems.SHADOW_BERRY_RAW).addMaterial('S', Items.SUGAR).build(); - - GridRecipe.make(BetterEnd.MOD_ID, "cave_pumpkin_seeds", EndBlocks.CAVE_PUMPKIN_SEED) - .checkConfig(Configs.RECIPE_CONFIG) - .setOutputCount(4) - .setList("#") - .addMaterial('#', EndBlocks.CAVE_PUMPKIN) - .build(); - + + GridRecipe.make(BetterEnd.MOD_ID, "silk_moth_hive", EndBlocks.SILK_MOTH_HIVE).checkConfig(Configs.RECIPE_CONFIG).setShape("#L#", "LML", "#L#").addMaterial('#', EndBlocks.TENANEA.planks).addMaterial('L', EndBlocks.TENANEA_LEAVES).addMaterial('M', EndItems.SILK_MOTH_MATRIX).build(); + + GridRecipe.make(BetterEnd.MOD_ID, "cave_pumpkin_pie", EndItems.CAVE_PUMPKIN_PIE).checkConfig(Configs.RECIPE_CONFIG).setShape("SBS", "BPB", "SBS").addMaterial('P', EndBlocks.CAVE_PUMPKIN).addMaterial('B', EndItems.BLOSSOM_BERRY, EndItems.SHADOW_BERRY_RAW).addMaterial('S', Items.SUGAR).build(); + + GridRecipe.make(BetterEnd.MOD_ID, "cave_pumpkin_seeds", EndBlocks.CAVE_PUMPKIN_SEED).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(4).setList("#").addMaterial('#', EndBlocks.CAVE_PUMPKIN).build(); + GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block", EndBlocks.NEON_CACTUS_BLOCK).checkConfig(Configs.RECIPE_CONFIG).setShape("##", "##").addMaterial('#', EndBlocks.NEON_CACTUS).build(); GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block_slab", EndBlocks.NEON_CACTUS_BLOCK_SLAB).checkConfig(Configs.RECIPE_CONFIG).setShape("###").setOutputCount(6).addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK).build(); GridRecipe.make(BetterEnd.MOD_ID, "neon_cactus_block_stairs", EndBlocks.NEON_CACTUS_BLOCK_STAIRS).checkConfig(Configs.RECIPE_CONFIG).setShape("# ", "## ", "###").setOutputCount(4).addMaterial('#', EndBlocks.NEON_CACTUS_BLOCK).build(); - + GridRecipe.make(BetterEnd.MOD_ID, "sugar_from_root", Items.SUGAR).checkConfig(Configs.RECIPE_CONFIG).setList("###").addMaterial('#', EndItems.AMBER_ROOT_RAW).build(); + GridRecipe.make(BetterEnd.MOD_ID, "endstone_flower_pot", EndBlocks.ENDSTONE_FLOWER_POT).checkConfig(Configs.RECIPE_CONFIG).setOutputCount(3).setShape("# #", " # ").addMaterial('#', Blocks.END_STONE_BRICKS).setGroup("end_pots").build(); } - + private static void registerLantern(String name, Block lantern, Block slab) { - GridRecipe.make(BetterEnd.MOD_ID, name, lantern) - .checkConfig(Configs.RECIPE_CONFIG) - .setShape("S", "#", "S") - .addMaterial('#', EndItems.CRYSTAL_SHARDS) - .addMaterial('S', slab) - .setGroup("end_stone_lanterns") - .build(); + GridRecipe.make(BetterEnd.MOD_ID, name, lantern).checkConfig(Configs.RECIPE_CONFIG).setShape("S", "#", "S").addMaterial('#', EndItems.CRYSTAL_SHARDS).addMaterial('S', slab).setGroup("end_stone_lanterns").build(); } - + public static void registerPedestal(String name, Block pedestal, Block slab, Block pillar) { - GridRecipe.make(BetterEnd.MOD_ID, name, pedestal) - .checkConfig(Configs.RECIPE_CONFIG) - .setShape("S", "#", "S") - .addMaterial('S', slab) - .addMaterial('#', pillar) - .setOutputCount(2) - .build(); + GridRecipe.make(BetterEnd.MOD_ID, name, pedestal).checkConfig(Configs.RECIPE_CONFIG).setShape("S", "#", "S").addMaterial('S', slab).addMaterial('#', pillar).setOutputCount(2).build(); } - + private static void registerHammer(String name, Item material, Item result) { - GridRecipe.make(BetterEnd.MOD_ID, name + "_hammer", result) - .checkConfig(Configs.RECIPE_CONFIG) - .setShape("I I", "I#I", " # ") - .addMaterial('I', material) - .addMaterial('#', Items.STICK) - .build(); + GridRecipe.make(BetterEnd.MOD_ID, name + "_hammer", result).checkConfig(Configs.RECIPE_CONFIG).setShape("I I", "I#I", " # ").addMaterial('I', material).addMaterial('#', Items.STICK).build(); } } diff --git a/src/main/java/ru/betterend/recipe/InfusionRecipes.java b/src/main/java/ru/betterend/recipe/InfusionRecipes.java index 7b3463d6..631e806c 100644 --- a/src/main/java/ru/betterend/recipe/InfusionRecipes.java +++ b/src/main/java/ru/betterend/recipe/InfusionRecipes.java @@ -13,599 +13,58 @@ import ru.betterend.registry.EndItems; public class InfusionRecipes { public static void register() { - InfusionRecipe.Builder.create("runed_flavolite") - .setInput(EndBlocks.FLAVOLITE.polished) - .setOutput(EndBlocks.FLAVOLITE_RUNED) - .addCatalyst(0, EndItems.CRYSTAL_SHARDS) - .addCatalyst(2, EndItems.CRYSTAL_SHARDS) - .addCatalyst(4, EndItems.CRYSTAL_SHARDS) - .addCatalyst(6, EndItems.CRYSTAL_SHARDS) - .setTime(100) - .build(); - - InfusionRecipe.Builder.create("eternal_crystal") - .setInput(Items.END_CRYSTAL) - .setOutput(EndItems.ETERNAL_CRYSTAL) - .addCatalyst(0, EndItems.CRYSTAL_SHARDS) - .addCatalyst(2, EndItems.CRYSTAL_SHARDS) - .addCatalyst(4, EndItems.CRYSTAL_SHARDS) - .addCatalyst(6, EndItems.CRYSTAL_SHARDS) - .addCatalyst(1, EndItems.ENDER_SHARD) - .addCatalyst(3, EndItems.ENDER_SHARD) - .addCatalyst(5, EndItems.ENDER_SHARD) - .addCatalyst(7, EndItems.ENDER_SHARD) - .setTime(250) - .build(); - - InfusionRecipe.Builder.create("crystalite_helmet") - .setInput(EndBlocks.TERMINITE.helmet) - .setOutput(EndItems.CRYSTALITE_HELMET) - .addCatalyst(0, EndItems.AMBER_GEM) - .addCatalyst(2, EndItems.CRYSTAL_SHARDS) - .addCatalyst(6, EndItems.CRYSTAL_SHARDS) - .setTime(150) - .build(); - InfusionRecipe.Builder.create("crystalite_chestplate") - .setInput(EndBlocks.TERMINITE.chestplate) - .setOutput(EndItems.CRYSTALITE_CHESTPLATE) - .addCatalyst(0, EndItems.AMBER_GEM) - .addCatalyst(1, EndItems.CRYSTAL_SHARDS) - .addCatalyst(3, EndItems.CRYSTAL_SHARDS) - .addCatalyst(5, EndItems.CRYSTAL_SHARDS) - .addCatalyst(7, EndItems.CRYSTAL_SHARDS) - .setTime(300) - .build(); - InfusionRecipe.Builder.create("crystalite_leggings") - .setInput(EndBlocks.TERMINITE.leggings) - .setOutput(EndItems.CRYSTALITE_LEGGINGS) - .addCatalyst(0, EndItems.AMBER_GEM) - .addCatalyst(2, EndItems.CRYSTAL_SHARDS) - .addCatalyst(4, EndItems.CRYSTAL_SHARDS) - .addCatalyst(6, EndItems.CRYSTAL_SHARDS) - .setTime(225) - .build(); - InfusionRecipe.Builder.create("crystalite_boots") - .setInput(EndBlocks.TERMINITE.boots) - .setOutput(EndItems.CRYSTALITE_BOOTS) - .addCatalyst(0, EndItems.AMBER_GEM) - .addCatalyst(2, EndItems.CRYSTAL_SHARDS) - .addCatalyst(6, EndItems.CRYSTAL_SHARDS) - .setTime(150) - .build(); - - InfusionRecipe.Builder.create("crystalite_elytra") - .setInput(Items.ELYTRA) - .setOutput(EndItems.CRYSTALITE_ELYTRA) - .addCatalyst(0, EndItems.AMBER_GEM) - .addCatalyst(1, EndItems.CRYSTAL_SHARDS) - .addCatalyst(2, EndItems.ENCHANTED_MEMBRANE) - .addCatalyst(3, EndItems.CRYSTAL_SHARDS) - .addCatalyst(4, EndItems.ENCHANTED_MEMBRANE) - .addCatalyst(5, EndItems.CRYSTAL_SHARDS) - .addCatalyst(6, EndItems.ENCHANTED_MEMBRANE) - .addCatalyst(7, EndItems.CRYSTAL_SHARDS) - .setTime(500) - .build(); - - InfusionRecipe.Builder.create("enchanted_petal") - .setInput(EndItems.HYDRALUX_PETAL) - .setOutput(EndItems.ENCHANTED_PETAL) - .addCatalyst(0, EndItems.CRYSTAL_SHARDS) - .addCatalyst(2, EndItems.CRYSTAL_SHARDS) - .addCatalyst(4, EndItems.CRYSTAL_SHARDS) - .addCatalyst(6, EndItems.CRYSTAL_SHARDS) - .setTime(75) - .build(); - InfusionRecipe.Builder.create("enchanted_membrane") - .setInput(Items.PHANTOM_MEMBRANE) - .setOutput(EndItems.ENCHANTED_MEMBRANE) - .addCatalyst(0, EndItems.CRYSTAL_SHARDS) - .addCatalyst(2, EndItems.CRYSTAL_SHARDS) - .addCatalyst(4, EndItems.CRYSTAL_SHARDS) - .addCatalyst(6, EndItems.CRYSTAL_SHARDS) - .setTime(75) - .build(); - - InfusionRecipe.Builder.create("protection_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.ALL_DAMAGE_PROTECTION, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(4, Items.TURTLE_HELMET) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("fire_protection_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.FIRE_PROTECTION, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.BLAZE_ROD) - .addCatalyst(4, Items.BLAZE_ROD) - .addCatalyst(6, Items.BLAZE_ROD) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("feather_falling_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.FALL_PROTECTION, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.FEATHER) - .addCatalyst(4, Items.FEATHER) - .addCatalyst(6, Items.FEATHER) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("blast_protection_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.BLAST_PROTECTION, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Blocks.OBSIDIAN) - .addCatalyst(4, Blocks.OBSIDIAN) - .addCatalyst(6, Blocks.OBSIDIAN) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("projectile_protection_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.PROJECTILE_PROTECTION, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.SCUTE) - .addCatalyst(4, Items.SHIELD) - .addCatalyst(6, Items.SCUTE) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("respiration_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.RESPIRATION, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.NAUTILUS_SHELL) - .addCatalyst(4, Items.NAUTILUS_SHELL) - .addCatalyst(6, Items.NAUTILUS_SHELL) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("aqua_affinity_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.AQUA_AFFINITY, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.PRISMARINE_CRYSTALS) - .addCatalyst(4, Items.PRISMARINE_CRYSTALS) - .addCatalyst(6, Items.PRISMARINE_CRYSTALS) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("thorns_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.THORNS, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Blocks.CACTUS) - .addCatalyst(4, Blocks.CACTUS) - .addCatalyst(6, Blocks.CACTUS) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("depth_strider_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.DEPTH_STRIDER, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Blocks.LILY_PAD) - .addCatalyst(4, EndBlocks.END_LILY_SEED) - .addCatalyst(6, Blocks.LILY_PAD) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("frost_walker_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.FROST_WALKER, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(4, EndBlocks.ANCIENT_EMERALD_ICE) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("soul_speed_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.SOUL_SPEED, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Blocks.SOUL_SAND, Blocks.SOUL_SOIL) - .addCatalyst(4, Blocks.SOUL_SAND, Blocks.SOUL_SOIL) - .addCatalyst(6, Blocks.SOUL_SAND, Blocks.SOUL_SOIL) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("sharpness_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.SHARPNESS, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(4, Items.NETHERITE_SCRAP) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("smite_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.SMITE, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Blocks.SUNFLOWER) - .addCatalyst(4, Items.GOLD_INGOT) - .addCatalyst(6, Blocks.SUNFLOWER) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("bane_of_arthropods_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.BANE_OF_ARTHROPODS, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.FERMENTED_SPIDER_EYE) - .addCatalyst(4, Items.IRON_INGOT) - .addCatalyst(6, Items.FERMENTED_SPIDER_EYE) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("knockback_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.KNOCKBACK, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.REDSTONE) - .addCatalyst(4, Blocks.PISTON) - .addCatalyst(6, Items.REDSTONE) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("fire_aspect_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.FIRE_ASPECT, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.BLAZE_POWDER) - .addCatalyst(4, Items.MAGMA_CREAM) - .addCatalyst(6, Items.BLAZE_POWDER) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("looting_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.MOB_LOOTING, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.EMERALD) - .addCatalyst(4, Items.GOLD_INGOT) - .addCatalyst(6, Items.EMERALD) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("sweeping_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.SWEEPING_EDGE, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.GOLDEN_SWORD) - .addCatalyst(4, Items.IRON_SWORD) - .addCatalyst(6, Items.GOLDEN_SWORD) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("efficiency_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.BLOCK_EFFICIENCY, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, EndItems.AMBER_GEM) - .addCatalyst(4, EndItems.AMBER_GEM) - .addCatalyst(6, EndItems.AMBER_GEM) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("silk_touch_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.SILK_TOUCH, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Blocks.COBWEB) - .addCatalyst(4, EndItems.ETERNAL_CRYSTAL) - .addCatalyst(6, Blocks.COBWEB) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(375) - .build(); - InfusionRecipe.Builder.create("unbreaking_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.UNBREAKING, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.DIAMOND) - .addCatalyst(4, Items.DIAMOND) - .addCatalyst(6, Items.DIAMOND) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("fortune_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.BLOCK_FORTUNE, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.EMERALD) - .addCatalyst(4, Items.RABBIT_FOOT) - .addCatalyst(6, Items.EMERALD) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("power_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.POWER_ARROWS, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, EndItems.AMBER_GEM) - .addCatalyst(4, Items.DIAMOND_SWORD) - .addCatalyst(6, EndItems.AMBER_GEM) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("punch_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.PUNCH_ARROWS, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.POPPED_CHORUS_FRUIT) - .addCatalyst(4, Items.SPECTRAL_ARROW) - .addCatalyst(6, Items.POPPED_CHORUS_FRUIT) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("flame_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.FLAMING_ARROWS, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.BLAZE_POWDER) - .addCatalyst(4, Items.SPECTRAL_ARROW) - .addCatalyst(6, Items.BLAZE_POWDER) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("infinity_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.INFINITY_ARROWS, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.SPECTRAL_ARROW) - .addCatalyst(4, EndItems.ETERNAL_CRYSTAL) - .addCatalyst(6, Items.SPECTRAL_ARROW) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(375) - .build(); - InfusionRecipe.Builder.create("luck_of_sea_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.FISHING_LUCK, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.EMERALD) - .addCatalyst(4, Items.FISHING_ROD) - .addCatalyst(6, Items.EMERALD) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("lure_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.FISHING_SPEED, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.GOLD_NUGGET) - .addCatalyst(4, Items.FISHING_ROD) - .addCatalyst(6, Items.GOLD_NUGGET) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("loyalty_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.LOYALTY, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.ENDER_EYE) - .addCatalyst(4, Items.HEART_OF_THE_SEA) - .addCatalyst(6, Items.ENDER_EYE) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(375) - .build(); - InfusionRecipe.Builder.create("impaling_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.IMPALING, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.PRISMARINE_SHARD) - .addCatalyst(4, Items.IRON_SWORD) - .addCatalyst(6, Items.PRISMARINE_SHARD) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("riptide_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.RIPTIDE, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.LEAD) - .addCatalyst(4, Items.HEART_OF_THE_SEA) - .addCatalyst(6, Items.LEAD) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(375) - .build(); - InfusionRecipe.Builder.create("channeling_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.CHANNELING, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.CHAIN) - .addCatalyst(4, Items.HEART_OF_THE_SEA) - .addCatalyst(6, Items.CHAIN) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(375) - .build(); - InfusionRecipe.Builder.create("multishot_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.MULTISHOT, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.ARROW) - .addCatalyst(4, Items.SPECTRAL_ARROW) - .addCatalyst(6, Items.ARROW) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("quick_charge_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.QUICK_CHARGE, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.QUARTZ) - .addCatalyst(4, Items.GLOWSTONE_DUST) - .addCatalyst(6, Items.QUARTZ) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("piercing_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.PIERCING, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.GLOWSTONE_DUST) - .addCatalyst(4, Items.SPECTRAL_ARROW) - .addCatalyst(6, Items.GLOWSTONE_DUST) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(300) - .build(); - InfusionRecipe.Builder.create("mending_book") - .setInput(Items.BOOK) - .setOutput(createEnchantedBook(Enchantments.MENDING, 1)) - .addCatalyst(0, EndItems.ENCHANTED_PETAL) - .addCatalyst(2, Items.EXPERIENCE_BOTTLE) - .addCatalyst(4, Blocks.ANVIL) - .addCatalyst(6, Items.EXPERIENCE_BOTTLE) - .addCatalyst(1, Items.LAPIS_LAZULI) - .addCatalyst(3, Items.LAPIS_LAZULI) - .addCatalyst(5, Items.LAPIS_LAZULI) - .addCatalyst(7, Items.LAPIS_LAZULI) - .setGroup("enchantment") - .setTime(375) - .build(); + InfusionRecipe.Builder.create("runed_flavolite").setInput(EndBlocks.FLAVOLITE.polished).setOutput(EndBlocks.FLAVOLITE_RUNED).addCatalyst(0, EndItems.CRYSTAL_SHARDS).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(100).build(); + + InfusionRecipe.Builder.create("eternal_crystal").setInput(Items.END_CRYSTAL).setOutput(EndItems.ETERNAL_CRYSTAL).addCatalyst(0, EndItems.CRYSTAL_SHARDS).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).addCatalyst(1, EndItems.ENDER_SHARD).addCatalyst(3, EndItems.ENDER_SHARD).addCatalyst(5, EndItems.ENDER_SHARD).addCatalyst(7, EndItems.ENDER_SHARD).setTime(250).build(); + + InfusionRecipe.Builder.create("crystalite_helmet").setInput(EndBlocks.TERMINITE.helmet).setOutput(EndItems.CRYSTALITE_HELMET).addCatalyst(0, EndItems.AMBER_GEM).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(150).build(); + InfusionRecipe.Builder.create("crystalite_chestplate").setInput(EndBlocks.TERMINITE.chestplate).setOutput(EndItems.CRYSTALITE_CHESTPLATE).addCatalyst(0, EndItems.AMBER_GEM).addCatalyst(1, EndItems.CRYSTAL_SHARDS).addCatalyst(3, EndItems.CRYSTAL_SHARDS).addCatalyst(5, EndItems.CRYSTAL_SHARDS).addCatalyst(7, EndItems.CRYSTAL_SHARDS).setTime(300).build(); + InfusionRecipe.Builder.create("crystalite_leggings").setInput(EndBlocks.TERMINITE.leggings).setOutput(EndItems.CRYSTALITE_LEGGINGS).addCatalyst(0, EndItems.AMBER_GEM).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(225).build(); + InfusionRecipe.Builder.create("crystalite_boots").setInput(EndBlocks.TERMINITE.boots).setOutput(EndItems.CRYSTALITE_BOOTS).addCatalyst(0, EndItems.AMBER_GEM).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(150).build(); + + InfusionRecipe.Builder.create("crystalite_elytra").setInput(Items.ELYTRA).setOutput(EndItems.CRYSTALITE_ELYTRA).addCatalyst(0, EndItems.AMBER_GEM).addCatalyst(1, EndItems.CRYSTAL_SHARDS).addCatalyst(2, EndItems.ENCHANTED_MEMBRANE).addCatalyst(3, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.ENCHANTED_MEMBRANE).addCatalyst(5, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.ENCHANTED_MEMBRANE).addCatalyst(7, EndItems.CRYSTAL_SHARDS).setTime(500).build(); + + InfusionRecipe.Builder.create("enchanted_petal").setInput(EndItems.HYDRALUX_PETAL).setOutput(EndItems.ENCHANTED_PETAL).addCatalyst(0, EndItems.CRYSTAL_SHARDS).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(75).build(); + InfusionRecipe.Builder.create("enchanted_membrane").setInput(Items.PHANTOM_MEMBRANE).setOutput(EndItems.ENCHANTED_MEMBRANE).addCatalyst(0, EndItems.CRYSTAL_SHARDS).addCatalyst(2, EndItems.CRYSTAL_SHARDS).addCatalyst(4, EndItems.CRYSTAL_SHARDS).addCatalyst(6, EndItems.CRYSTAL_SHARDS).setTime(75).build(); + + InfusionRecipe.Builder.create("protection_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.ALL_DAMAGE_PROTECTION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(4, Items.TURTLE_HELMET).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("fire_protection_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FIRE_PROTECTION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.BLAZE_ROD).addCatalyst(4, Items.BLAZE_ROD).addCatalyst(6, Items.BLAZE_ROD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("feather_falling_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FALL_PROTECTION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.FEATHER).addCatalyst(4, Items.FEATHER).addCatalyst(6, Items.FEATHER).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("blast_protection_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.BLAST_PROTECTION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.OBSIDIAN).addCatalyst(4, Blocks.OBSIDIAN).addCatalyst(6, Blocks.OBSIDIAN).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("projectile_protection_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.PROJECTILE_PROTECTION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.SCUTE).addCatalyst(4, Items.SHIELD).addCatalyst(6, Items.SCUTE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("respiration_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.RESPIRATION, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.NAUTILUS_SHELL).addCatalyst(4, Items.NAUTILUS_SHELL).addCatalyst(6, Items.NAUTILUS_SHELL).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("aqua_affinity_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.AQUA_AFFINITY, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.PRISMARINE_CRYSTALS).addCatalyst(4, Items.PRISMARINE_CRYSTALS).addCatalyst(6, Items.PRISMARINE_CRYSTALS).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("thorns_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.THORNS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.CACTUS).addCatalyst(4, Blocks.CACTUS).addCatalyst(6, Blocks.CACTUS).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("depth_strider_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.DEPTH_STRIDER, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.LILY_PAD).addCatalyst(4, EndBlocks.END_LILY_SEED).addCatalyst(6, Blocks.LILY_PAD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("frost_walker_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FROST_WALKER, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(4, EndBlocks.ANCIENT_EMERALD_ICE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("soul_speed_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.SOUL_SPEED, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.SOUL_SAND, Blocks.SOUL_SOIL).addCatalyst(4, Blocks.SOUL_SAND, Blocks.SOUL_SOIL).addCatalyst(6, Blocks.SOUL_SAND, Blocks.SOUL_SOIL).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("sharpness_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.SHARPNESS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(4, Items.NETHERITE_SCRAP).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("smite_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.SMITE, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.SUNFLOWER).addCatalyst(4, Items.GOLD_INGOT).addCatalyst(6, Blocks.SUNFLOWER).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("bane_of_arthropods_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.BANE_OF_ARTHROPODS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.FERMENTED_SPIDER_EYE).addCatalyst(4, Items.IRON_INGOT).addCatalyst(6, Items.FERMENTED_SPIDER_EYE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("knockback_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.KNOCKBACK, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.REDSTONE).addCatalyst(4, Blocks.PISTON).addCatalyst(6, Items.REDSTONE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("fire_aspect_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FIRE_ASPECT, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.BLAZE_POWDER).addCatalyst(4, Items.MAGMA_CREAM).addCatalyst(6, Items.BLAZE_POWDER).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("looting_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.MOB_LOOTING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.EMERALD).addCatalyst(4, Items.GOLD_INGOT).addCatalyst(6, Items.EMERALD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("sweeping_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.SWEEPING_EDGE, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.GOLDEN_SWORD).addCatalyst(4, Items.IRON_SWORD).addCatalyst(6, Items.GOLDEN_SWORD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("efficiency_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.BLOCK_EFFICIENCY, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, EndItems.AMBER_GEM).addCatalyst(4, EndItems.AMBER_GEM).addCatalyst(6, EndItems.AMBER_GEM).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("silk_touch_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.SILK_TOUCH, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Blocks.COBWEB).addCatalyst(4, EndItems.ETERNAL_CRYSTAL).addCatalyst(6, Blocks.COBWEB).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); + InfusionRecipe.Builder.create("unbreaking_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.UNBREAKING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.DIAMOND).addCatalyst(4, Items.DIAMOND).addCatalyst(6, Items.DIAMOND).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("fortune_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.BLOCK_FORTUNE, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.EMERALD).addCatalyst(4, Items.RABBIT_FOOT).addCatalyst(6, Items.EMERALD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("power_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.POWER_ARROWS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, EndItems.AMBER_GEM).addCatalyst(4, Items.DIAMOND_SWORD).addCatalyst(6, EndItems.AMBER_GEM).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("punch_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.PUNCH_ARROWS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.POPPED_CHORUS_FRUIT).addCatalyst(4, Items.SPECTRAL_ARROW).addCatalyst(6, Items.POPPED_CHORUS_FRUIT).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("flame_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FLAMING_ARROWS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.BLAZE_POWDER).addCatalyst(4, Items.SPECTRAL_ARROW).addCatalyst(6, Items.BLAZE_POWDER).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("infinity_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.INFINITY_ARROWS, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.SPECTRAL_ARROW).addCatalyst(4, EndItems.ETERNAL_CRYSTAL).addCatalyst(6, Items.SPECTRAL_ARROW).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); + InfusionRecipe.Builder.create("luck_of_sea_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FISHING_LUCK, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.EMERALD).addCatalyst(4, Items.FISHING_ROD).addCatalyst(6, Items.EMERALD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("lure_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.FISHING_SPEED, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.GOLD_NUGGET).addCatalyst(4, Items.FISHING_ROD).addCatalyst(6, Items.GOLD_NUGGET).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("loyalty_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.LOYALTY, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.ENDER_EYE).addCatalyst(4, Items.HEART_OF_THE_SEA).addCatalyst(6, Items.ENDER_EYE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); + InfusionRecipe.Builder.create("impaling_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.IMPALING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.PRISMARINE_SHARD).addCatalyst(4, Items.IRON_SWORD).addCatalyst(6, Items.PRISMARINE_SHARD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("riptide_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.RIPTIDE, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.LEAD).addCatalyst(4, Items.HEART_OF_THE_SEA).addCatalyst(6, Items.LEAD).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); + InfusionRecipe.Builder.create("channeling_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.CHANNELING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.CHAIN).addCatalyst(4, Items.HEART_OF_THE_SEA).addCatalyst(6, Items.CHAIN).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); + InfusionRecipe.Builder.create("multishot_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.MULTISHOT, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.ARROW).addCatalyst(4, Items.SPECTRAL_ARROW).addCatalyst(6, Items.ARROW).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("quick_charge_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.QUICK_CHARGE, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.QUARTZ).addCatalyst(4, Items.GLOWSTONE_DUST).addCatalyst(6, Items.QUARTZ).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("piercing_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.PIERCING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.GLOWSTONE_DUST).addCatalyst(4, Items.SPECTRAL_ARROW).addCatalyst(6, Items.GLOWSTONE_DUST).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(300).build(); + InfusionRecipe.Builder.create("mending_book").setInput(Items.BOOK).setOutput(createEnchantedBook(Enchantments.MENDING, 1)).addCatalyst(0, EndItems.ENCHANTED_PETAL).addCatalyst(2, Items.EXPERIENCE_BOTTLE).addCatalyst(4, Blocks.ANVIL).addCatalyst(6, Items.EXPERIENCE_BOTTLE).addCatalyst(1, Items.LAPIS_LAZULI).addCatalyst(3, Items.LAPIS_LAZULI).addCatalyst(5, Items.LAPIS_LAZULI).addCatalyst(7, Items.LAPIS_LAZULI).setGroup("enchantment").setTime(375).build(); } - + private static ItemStack createEnchantedBook(Enchantment enchantment, int level) { ItemStack book = new ItemStack(Items.ENCHANTED_BOOK); EnchantedBookItem.addEnchantment(book, new EnchantmentInstance(enchantment, level)); diff --git a/src/main/java/ru/betterend/recipe/SmithingRecipes.java b/src/main/java/ru/betterend/recipe/SmithingRecipes.java index 4a4cc075..64bf7913 100644 --- a/src/main/java/ru/betterend/recipe/SmithingRecipes.java +++ b/src/main/java/ru/betterend/recipe/SmithingRecipes.java @@ -8,102 +8,27 @@ import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndItems; public class SmithingRecipes { - + public static void register() { - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_sword_handle") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.AETERNIUM_SWORD_HANDLE) - .setBase(EndBlocks.TERMINITE.ingot) - .setAddition(EndItems.LEATHER_WRAPPED_STICK) - .build(); - - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_sword") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.AETERNIUM_SWORD) - .setBase(EndItems.AETERNIUM_SWORD_BLADE) - .setAddition(EndItems.AETERNIUM_SWORD_HANDLE) - .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_pickaxe") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.AETERNIUM_PICKAXE) - .setBase(EndItems.AETERNIUM_PICKAXE_HEAD) - .setAddition(EndItems.LEATHER_WRAPPED_STICK) - .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_axe") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.AETERNIUM_AXE) - .setBase(EndItems.AETERNIUM_AXE_HEAD) - .setAddition(EndItems.LEATHER_WRAPPED_STICK) - .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_shovel") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.AETERNIUM_SHOVEL) - .setBase(EndItems.AETERNIUM_SHOVEL_HEAD) - .setAddition(EndItems.LEATHER_WRAPPED_STICK) - .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_hoe") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.AETERNIUM_HOE) - .setBase(EndItems.AETERNIUM_HOE_HEAD) - .setAddition(EndItems.LEATHER_WRAPPED_STICK) - .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_hammer") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.AETERNIUM_HAMMER) - .setBase(EndItems.AETERNIUM_HAMMER_HEAD) - .setAddition(EndItems.LEATHER_WRAPPED_STICK) - .build(); - - SmithingTableRecipe.create(BetterEnd.MOD_ID, "netherite_hammer") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.NETHERITE_HAMMER) - .setBase(EndItems.DIAMOND_HAMMER) - .setAddition(Items.NETHERITE_INGOT) - .build(); - - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_helmet") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.AETERNIUM_HELMET) - .setBase(EndBlocks.TERMINITE.helmet) - .setAddition(EndItems.AETERNIUM_FORGED_PLATE) - .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_chestplate") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.AETERNIUM_CHESTPLATE) - .setBase(EndBlocks.TERMINITE.chestplate) - .setAddition(EndItems.AETERNIUM_FORGED_PLATE) - .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_leggings") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.AETERNIUM_LEGGINGS) - .setBase(EndBlocks.TERMINITE.leggings) - .setAddition(EndItems.AETERNIUM_FORGED_PLATE) - .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_boots") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.AETERNIUM_BOOTS) - .setBase(EndBlocks.TERMINITE.boots) - .setAddition(EndItems.AETERNIUM_FORGED_PLATE) - .build(); - - SmithingTableRecipe.create(BetterEnd.MOD_ID, "thallasium_anvil_updrade") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndBlocks.TERMINITE.anvilBlock) - .setBase(EndBlocks.THALLASIUM.anvilBlock) - .setAddition(EndBlocks.TERMINITE.block) - .build(); - SmithingTableRecipe.create(BetterEnd.MOD_ID, "terminite_anvil_updrade") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndBlocks.AETERNIUM_ANVIL) - .setBase(EndBlocks.TERMINITE.anvilBlock) - .setAddition(EndItems.AETERNIUM_INGOT) - .build(); - - SmithingTableRecipe.create(BetterEnd.MOD_ID, "armored_elytra") - .checkConfig(Configs.RECIPE_CONFIG) - .setResult(EndItems.ARMORED_ELYTRA) - .setBase(Items.ELYTRA) - .setAddition(EndItems.AETERNIUM_INGOT) - .build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_sword_handle").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_SWORD_HANDLE).setBase(EndBlocks.TERMINITE.ingot).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); + + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_sword").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_SWORD).setBase(EndItems.AETERNIUM_SWORD_BLADE).setAddition(EndItems.AETERNIUM_SWORD_HANDLE).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_pickaxe").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_PICKAXE).setBase(EndItems.AETERNIUM_PICKAXE_HEAD).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_axe").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_AXE).setBase(EndItems.AETERNIUM_AXE_HEAD).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_shovel").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_SHOVEL).setBase(EndItems.AETERNIUM_SHOVEL_HEAD).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_hoe").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_HOE).setBase(EndItems.AETERNIUM_HOE_HEAD).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_hammer").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_HAMMER).setBase(EndItems.AETERNIUM_HAMMER_HEAD).setAddition(EndItems.LEATHER_WRAPPED_STICK).build(); + + SmithingTableRecipe.create(BetterEnd.MOD_ID, "netherite_hammer").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.NETHERITE_HAMMER).setBase(EndItems.DIAMOND_HAMMER).setAddition(Items.NETHERITE_INGOT).build(); + + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_helmet").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_HELMET).setBase(EndBlocks.TERMINITE.helmet).setAddition(EndItems.AETERNIUM_FORGED_PLATE).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_chestplate").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_CHESTPLATE).setBase(EndBlocks.TERMINITE.chestplate).setAddition(EndItems.AETERNIUM_FORGED_PLATE).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_leggings").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_LEGGINGS).setBase(EndBlocks.TERMINITE.leggings).setAddition(EndItems.AETERNIUM_FORGED_PLATE).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "aeternium_boots").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.AETERNIUM_BOOTS).setBase(EndBlocks.TERMINITE.boots).setAddition(EndItems.AETERNIUM_FORGED_PLATE).build(); + + SmithingTableRecipe.create(BetterEnd.MOD_ID, "thallasium_anvil_updrade").checkConfig(Configs.RECIPE_CONFIG).setResult(EndBlocks.TERMINITE.anvilBlock).setBase(EndBlocks.THALLASIUM.anvilBlock).setAddition(EndBlocks.TERMINITE.block).build(); + SmithingTableRecipe.create(BetterEnd.MOD_ID, "terminite_anvil_updrade").checkConfig(Configs.RECIPE_CONFIG).setResult(EndBlocks.AETERNIUM_ANVIL).setBase(EndBlocks.TERMINITE.anvilBlock).setAddition(EndItems.AETERNIUM_INGOT).build(); + + SmithingTableRecipe.create(BetterEnd.MOD_ID, "armored_elytra").checkConfig(Configs.RECIPE_CONFIG).setResult(EndItems.ARMORED_ELYTRA).setBase(Items.ELYTRA).setAddition(EndItems.AETERNIUM_INGOT).build(); } } diff --git a/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java b/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java index db042ffb..742755a7 100644 --- a/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java +++ b/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java @@ -2,7 +2,6 @@ package ru.betterend.recipe.builders; import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import me.shedaniel.rei.api.common.category.CategoryIdentifier; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.core.NonNullList; @@ -31,7 +30,7 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { public final static String GROUP = "alloying"; public final static RecipeType TYPE = BCLRecipeManager.registerType(BetterEnd.MOD_ID, GROUP); public final static Serializer SERIALIZER = BCLRecipeManager.registerSerializer(BetterEnd.MOD_ID, GROUP, new Serializer()); - + protected final RecipeType type; protected final ResourceLocation id; protected final Ingredient primaryInput; @@ -40,7 +39,7 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { protected final String group; protected final float experience; protected final int smeltTime; - + public AlloyingRecipe(ResourceLocation id, String group, Ingredient primaryInput, Ingredient secondaryInput, ItemStack output, float experience, int smeltTime) { this.group = group; this.id = id; @@ -51,75 +50,74 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { this.smeltTime = smeltTime; this.type = TYPE; } - + public float getExperience() { return this.experience; } - + public int getSmeltTime() { return this.smeltTime; } - + @Override public NonNullList getIngredients() { NonNullList defaultedList = NonNullList.create(); defaultedList.add(primaryInput); defaultedList.add(secondaryInput); - + return defaultedList; } - + @Override public boolean matches(Container inv, Level world) { - return this.primaryInput.test(inv.getItem(0)) && this.secondaryInput.test(inv.getItem(1)) || - this.primaryInput.test(inv.getItem(1)) && this.secondaryInput.test(inv.getItem(0)); + return this.primaryInput.test(inv.getItem(0)) && this.secondaryInput.test(inv.getItem(1)) || this.primaryInput.test(inv.getItem(1)) && this.secondaryInput.test(inv.getItem(0)); } - + @Override public ItemStack assemble(Container inv) { return this.output.copy(); } - + @Override public boolean canCraftInDimensions(int width, int height) { return true; } - + @Override public ItemStack getResultItem() { return this.output; } - + @Override public ResourceLocation getId() { return this.id; } - + @Override public RecipeSerializer getSerializer() { return SERIALIZER; } - + @Override public RecipeType getType() { return this.type; } - + @Override @Environment(EnvType.CLIENT) public String getGroup() { return this.group; } - + @Environment(EnvType.CLIENT) public ItemStack getToastSymbol() { return new ItemStack(EndBlocks.END_STONE_SMELTER); } - + public static class Builder { private final static Builder INSTANCE = new Builder(); private static boolean exist; - + public static Builder create(ResourceLocation id) { INSTANCE.id = id; INSTANCE.group = String.format("%s_%s", GROUP, id); @@ -129,14 +127,14 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { INSTANCE.experience = 0.0F; INSTANCE.smeltTime = 350; exist = Configs.RECIPE_CONFIG.getBoolean("alloying", id.getPath(), true); - + return INSTANCE; } - + public static Builder create(String id) { return create(BetterEnd.makeID(id)); } - + private ResourceLocation id; private Ingredient primaryInput; private Ingredient secondaryInput; @@ -145,15 +143,15 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { private float experience; private int smeltTime; private boolean alright = true; - + private Builder() { } - + public Builder setGroup(String group) { this.group = group; return this; } - + public Builder setPrimaryInput(ItemLike... inputs) { for (ItemLike item : inputs) { this.alright &= RecipeHelper.exists(item); @@ -161,7 +159,7 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { this.primaryInput = Ingredient.of(inputs); return this; } - + public Builder setSecondaryInput(ItemLike... inputs) { for (ItemLike item : inputs) { this.alright &= RecipeHelper.exists(item); @@ -169,45 +167,45 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { this.secondaryInput = Ingredient.of(inputs); return this; } - + public Builder setPrimaryInput(Tag input) { this.primaryInput = Ingredient.of(input); return this; } - + public Builder setSecondaryInput(Tag input) { this.secondaryInput = Ingredient.of(input); return this; } - + public Builder setInput(ItemLike primaryInput, ItemLike secondaryInput) { this.setPrimaryInput(primaryInput); this.setSecondaryInput(secondaryInput); return this; } - + public Builder setInput(Tag primaryInput, Tag secondaryInput) { this.setPrimaryInput(primaryInput); this.setSecondaryInput(secondaryInput); return this; } - + public Builder setOutput(ItemLike output, int amount) { this.alright &= RecipeHelper.exists(output); this.output = new ItemStack(output, amount); return this; } - + public Builder setExpiriense(float amount) { this.experience = amount; return this; } - + public Builder setSmeltTime(int time) { this.smeltTime = time; return this; } - + public void build() { if (exist) { if (primaryInput == null) { @@ -234,7 +232,7 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { } } } - + public static class Serializer implements RecipeSerializer { @Override public AlloyingRecipe fromJson(ResourceLocation id, JsonObject json) { @@ -249,10 +247,10 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { } float experience = GsonHelper.getAsFloat(json, "experience", 0.0F); int smeltTime = GsonHelper.getAsInt(json, "smelttime", 350); - + return new AlloyingRecipe(id, group, primaryInput, secondaryInput, output, experience, smeltTime); } - + @Override public AlloyingRecipe fromNetwork(ResourceLocation id, FriendlyByteBuf packetBuffer) { String group = packetBuffer.readUtf(32767); @@ -261,10 +259,10 @@ public class AlloyingRecipe implements Recipe, BetterEndRecipe { ItemStack output = packetBuffer.readItem(); float experience = packetBuffer.readFloat(); int smeltTime = packetBuffer.readVarInt(); - + return new AlloyingRecipe(id, group, primary, secondary, output, experience, smeltTime); } - + @Override public void toNetwork(FriendlyByteBuf packetBuffer, AlloyingRecipe recipe) { packetBuffer.writeUtf(recipe.group); diff --git a/src/main/java/ru/betterend/recipe/builders/AnvilRecipe.java b/src/main/java/ru/betterend/recipe/builders/AnvilRecipe.java index 7082a566..07aad245 100644 --- a/src/main/java/ru/betterend/recipe/builders/AnvilRecipe.java +++ b/src/main/java/ru/betterend/recipe/builders/AnvilRecipe.java @@ -38,7 +38,7 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { public final static RecipeType TYPE = BCLRecipeManager.registerType(BetterEnd.MOD_ID, GROUP); public final static Serializer SERIALIZER = BCLRecipeManager.registerSerializer(BetterEnd.MOD_ID, GROUP, new Serializer()); public final static ResourceLocation ID = BetterEnd.makeID(GROUP); - + private final ResourceLocation id; private final Ingredient input; private final ItemStack output; @@ -46,7 +46,7 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { private final int toolLevel; private final int anvilLevel; private final int inputCount; - + public AnvilRecipe(ResourceLocation identifier, Ingredient input, ItemStack output, int inputCount, int toolLevel, int anvilLevel, int damage) { this.id = identifier; this.input = input; @@ -56,44 +56,43 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { this.inputCount = inputCount; this.damage = damage; } - + @Override public RecipeSerializer getSerializer() { return SERIALIZER; } - + @Override public ItemStack getResultItem() { return this.output; } - + @Override public boolean matches(Container craftingInventory, Level world) { return this.matches(craftingInventory); } - + @Override public ItemStack assemble(Container craftingInventory) { return this.output.copy(); } - + public ItemStack craft(Container craftingInventory, Player player) { if (!player.isCreative()) { if (!checkHammerDurability(craftingInventory, player)) return ItemStack.EMPTY; ItemStack hammer = craftingInventory.getItem(1); - hammer.hurtAndBreak(this.damage, player, entity -> - entity.broadcastBreakEvent((InteractionHand) null)); + hammer.hurtAndBreak(this.damage, player, entity -> entity.broadcastBreakEvent((InteractionHand) null)); } return this.assemble(craftingInventory); } - + public boolean checkHammerDurability(Container craftingInventory, Player player) { if (player.isCreative()) return true; ItemStack hammer = craftingInventory.getItem(1); int damage = hammer.getDamageValue() + this.damage; return damage < hammer.getMaxDamage(); } - + public boolean matches(Container craftingInventory) { ItemStack hammer = craftingInventory.getItem(1); if (hammer.isEmpty() || !TagAPI.HAMMERS.contains(hammer.getItem())) { @@ -102,54 +101,51 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { ItemStack material = craftingInventory.getItem(0); int materialCount = material.getCount(); int level = ((TieredItem) hammer.getItem()).getTier().getLevel(); - return this.input.test(craftingInventory.getItem(0)) && - materialCount >= this.inputCount && - level >= this.toolLevel; + return this.input.test(craftingInventory.getItem(0)) && materialCount >= this.inputCount && level >= this.toolLevel; } - + public int getDamage() { return this.damage; } - + public int getInputCount() { return this.inputCount; } - + public int getAnvilLevel() { return this.anvilLevel; } - + @Override public NonNullList getIngredients() { NonNullList defaultedList = NonNullList.create(); - defaultedList.add(Ingredient.of(TagAPI.HAMMERS.getValues().stream().filter(hammer -> - ((TieredItem) hammer).getTier().getLevel() >= toolLevel).map(ItemStack::new))); + defaultedList.add(Ingredient.of(TagAPI.HAMMERS.getValues().stream().filter(hammer -> ((TieredItem) hammer).getTier().getLevel() >= toolLevel).map(ItemStack::new))); defaultedList.add(input); - + return defaultedList; } - + @Override @Environment(EnvType.CLIENT) public boolean canCraftInDimensions(int width, int height) { return true; } - + @Override public ResourceLocation getId() { return this.id; } - + @Override public RecipeType getType() { return TYPE; } - + @Override public boolean isSpecial() { return true; } - + @Override public boolean equals(Object o) { if (this == o) return true; @@ -157,24 +153,24 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { AnvilRecipe that = (AnvilRecipe) o; return damage == that.damage && toolLevel == that.toolLevel && id.equals(that.id) && input.equals(that.input) && output.equals(that.output); } - + @Override public int hashCode() { return Objects.hash(id, input, output, damage, toolLevel); } - + @Override public String toString() { return "AnvilRecipe [" + id + "]"; } - + public static class Builder { private final static Builder INSTANCE = new Builder(); - + public static Builder create(String id) { return create(BetterEnd.makeID(id)); } - + public static Builder create(ResourceLocation id) { INSTANCE.id = id; INSTANCE.input = null; @@ -184,10 +180,10 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { INSTANCE.anvilLevel = 1; INSTANCE.damage = 1; INSTANCE.alright = true; - + return INSTANCE; } - + private ResourceLocation id; private Ingredient input; private ItemStack output; @@ -196,56 +192,56 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { private int anvilLevel = 1; private int damage = 1; private boolean alright; - + private Builder() { } - + public Builder setInput(ItemLike... inputItems) { this.alright &= RecipeHelper.exists(inputItems); this.setInput(Ingredient.of(inputItems)); return this; } - + public Builder setInput(Tag inputTag) { this.setInput(Ingredient.of(inputTag)); return this; } - + public Builder setInput(Ingredient ingredient) { this.input = ingredient; return this; } - + public Builder setInputCount(int count) { this.inputCount = count; return this; } - + public Builder setOutput(ItemLike output) { return this.setOutput(output, 1); } - + public Builder setOutput(ItemLike output, int amount) { this.alright &= RecipeHelper.exists(output); this.output = new ItemStack(output, amount); return this; } - + public Builder setToolLevel(int level) { this.toolLevel = level; return this; } - + public Builder setAnvilLevel(int level) { this.anvilLevel = level; return this; } - + public Builder setDamage(int damage) { this.damage = damage; return this; } - + public void build() { if (Configs.RECIPE_CONFIG.getBoolean("anvil", id.getPath(), true)) { if (input == null) { @@ -268,7 +264,7 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { } } } - + public static class Serializer implements RecipeSerializer { @Override public AnvilRecipe fromJson(ResourceLocation id, JsonObject json) { @@ -292,10 +288,10 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { int toolLevel = GsonHelper.getAsInt(json, "toolLevel", 1); int anvilLevel = GsonHelper.getAsInt(json, "anvilLevel", 1); int damage = GsonHelper.getAsInt(json, "damage", 1); - + return new AnvilRecipe(id, input, output, inputCount, toolLevel, anvilLevel, damage); } - + @Override public AnvilRecipe fromNetwork(ResourceLocation id, FriendlyByteBuf packetBuffer) { Ingredient input = Ingredient.fromNetwork(packetBuffer); @@ -304,10 +300,10 @@ public class AnvilRecipe implements Recipe, BetterEndRecipe { int toolLevel = packetBuffer.readVarInt(); int anvilLevel = packetBuffer.readVarInt(); int damage = packetBuffer.readVarInt(); - + return new AnvilRecipe(id, input, output, inputCount, toolLevel, anvilLevel, damage); } - + @Override public void toNetwork(FriendlyByteBuf packetBuffer, AnvilRecipe recipe) { recipe.input.toNetwork(packetBuffer); diff --git a/src/main/java/ru/betterend/recipe/builders/InfusionRecipe.java b/src/main/java/ru/betterend/recipe/builders/InfusionRecipe.java index 4ebdfb40..648a460f 100644 --- a/src/main/java/ru/betterend/recipe/builders/InfusionRecipe.java +++ b/src/main/java/ru/betterend/recipe/builders/InfusionRecipe.java @@ -30,18 +30,18 @@ public class InfusionRecipe implements Recipe, BetterEndRecipe { public final static String GROUP = "infusion"; public final static RecipeType TYPE = BCLRecipeManager.registerType(BetterEnd.MOD_ID, GROUP); public final static Serializer SERIALIZER = BCLRecipeManager.registerSerializer(BetterEnd.MOD_ID, GROUP, new Serializer()); - + private final ResourceLocation id; private final Ingredient[] catalysts; private Ingredient input; private ItemStack output; private int time = 1; private String group; - + private InfusionRecipe(ResourceLocation id) { this(id, null, null); } - + private InfusionRecipe(ResourceLocation id, Ingredient input, ItemStack output) { this.id = id; this.input = input; @@ -49,11 +49,11 @@ public class InfusionRecipe implements Recipe, BetterEndRecipe { this.catalysts = new Ingredient[8]; Arrays.fill(catalysts, Ingredient.EMPTY); } - + public int getInfusionTime() { return this.time; } - + @Override public boolean matches(InfusionRitual inv, Level world) { boolean valid = this.input.test(inv.getItem(0)); @@ -63,17 +63,17 @@ public class InfusionRecipe implements Recipe, BetterEndRecipe { } return valid; } - + @Override public ItemStack assemble(InfusionRitual ritual) { return output.copy(); } - + @Override public boolean canCraftInDimensions(int width, int height) { return true; } - + @Override public NonNullList getIngredients() { NonNullList defaultedList = NonNullList.create(); @@ -81,97 +81,97 @@ public class InfusionRecipe implements Recipe, BetterEndRecipe { defaultedList.addAll(Arrays.asList(catalysts)); return defaultedList; } - + @Override public ItemStack getResultItem() { return this.output; } - + @Override public ResourceLocation getId() { return this.id; } - + @Override @Environment(EnvType.CLIENT) public String getGroup() { return this.group; } - + @Override public RecipeSerializer getSerializer() { return SERIALIZER; } - + @Override public RecipeType getType() { return TYPE; } - + public static class Builder { private final static Builder INSTANCE = new Builder(); private static boolean exist; - + public static Builder create(String id) { return create(BetterEnd.makeID(id)); } - + public static Builder create(ResourceLocation id) { INSTANCE.id = id; INSTANCE.input = null; INSTANCE.output = null; INSTANCE.time = 1; exist = Configs.RECIPE_CONFIG.getBoolean("infusion", id.getPath(), true); - + Arrays.fill(INSTANCE.catalysts, Ingredient.EMPTY); - + return INSTANCE; } - + private final Ingredient[] catalysts = new Ingredient[8]; private ResourceLocation id; private Ingredient input; private ItemStack output; private String group; private int time = 1; - + private Builder() { Arrays.fill(catalysts, Ingredient.EMPTY); } - + public Builder setGroup(String group) { this.group = group; return this; } - + public Builder setInput(ItemLike input) { this.input = Ingredient.of(input); return this; } - + public Builder setOutput(ItemLike output) { this.output = new ItemStack(output); this.output.setCount(1); return this; } - + public Builder setOutput(ItemStack output) { this.output = output; this.output.setCount(1); return this; } - + public Builder setTime(int time) { this.time = time; return this; } - + public Builder addCatalyst(int slot, ItemLike... items) { if (slot > 7) return this; this.catalysts[slot] = Ingredient.of(items); return this; } - + public void build() { if (exist) { if (input == null) { @@ -198,7 +198,7 @@ public class InfusionRecipe implements Recipe, BetterEndRecipe { } } } - + public static class Serializer implements RecipeSerializer { @Override public InfusionRecipe fromJson(ResourceLocation id, JsonObject json) { @@ -221,7 +221,7 @@ public class InfusionRecipe implements Recipe, BetterEndRecipe { } recipe.group = GsonHelper.getAsString(json, "group", GROUP); recipe.time = GsonHelper.getAsInt(json, "time", 1); - + JsonObject catalysts = GsonHelper.getAsJsonObject(json, "catalysts"); ItemStack catalyst = ItemUtil.fromStackString(GsonHelper.getAsString(catalysts, "north", "")); recipe.catalysts[0] = (catalyst != null && !catalyst.isEmpty()) ? Ingredient.of(catalyst.getItem()) : Ingredient.EMPTY; @@ -239,10 +239,10 @@ public class InfusionRecipe implements Recipe, BetterEndRecipe { recipe.catalysts[6] = (catalyst != null && !catalyst.isEmpty()) ? Ingredient.of(catalyst.getItem()) : Ingredient.EMPTY; catalyst = ItemUtil.fromStackString(GsonHelper.getAsString(catalysts, "north_west", "")); recipe.catalysts[7] = (catalyst != null && !catalyst.isEmpty()) ? Ingredient.of(catalyst.getItem()) : Ingredient.EMPTY; - + return recipe; } - + @Override public InfusionRecipe fromNetwork(ResourceLocation id, FriendlyByteBuf buffer) { InfusionRecipe recipe = new InfusionRecipe(id); @@ -255,7 +255,7 @@ public class InfusionRecipe implements Recipe, BetterEndRecipe { } return recipe; } - + @Override public void toNetwork(FriendlyByteBuf buffer, InfusionRecipe recipe) { recipe.input.toNetwork(buffer); diff --git a/src/main/java/ru/betterend/registry/EndAttributes.java b/src/main/java/ru/betterend/registry/EndAttributes.java index 95d2dda4..7d35fb04 100644 --- a/src/main/java/ru/betterend/registry/EndAttributes.java +++ b/src/main/java/ru/betterend/registry/EndAttributes.java @@ -8,11 +8,11 @@ import ru.betterend.item.EndAttribute; public class EndAttributes { public final static Attribute BLINDNESS_RESISTANCE = registerAttribute("generic.blindness_resistance", 0.0, true); - + public static Attribute registerAttribute(String name, double value, boolean syncable) { return Registry.register(Registry.ATTRIBUTE, BetterEnd.makeID(name), new EndAttribute("attribute.name." + name, value).setSyncable(syncable)); } - + public static AttributeSupplier.Builder addLivingEntityAttributes(AttributeSupplier.Builder builder) { return builder.add(EndAttributes.BLINDNESS_RESISTANCE); } diff --git a/src/main/java/ru/betterend/registry/EndBiomes.java b/src/main/java/ru/betterend/registry/EndBiomes.java index 69c9abae..62dcd6f2 100644 --- a/src/main/java/ru/betterend/registry/EndBiomes.java +++ b/src/main/java/ru/betterend/registry/EndBiomes.java @@ -62,23 +62,23 @@ import java.util.Set; public class EndBiomes { public static final Set FABRIC_VOID = Sets.newHashSet(); private static final Set SUBBIOMES_UNMUTABLES = Sets.newHashSet(); - + public static final BiomePicker LAND_BIOMES = new BiomePicker(); public static final BiomePicker VOID_BIOMES = new BiomePicker(); public static final BiomePicker CAVE_BIOMES = new BiomePicker(); public static final List SUBBIOMES = Lists.newArrayList(); private static final JsonObject EMPTY_JSON = new JsonObject(); private static BiomeMap caveBiomeMap; - + // Vanilla Land public static final EndBiome END = registerBiome(Biomes.THE_END, BiomeType.LAND, 1F); public static final EndBiome END_MIDLANDS = registerSubBiome(Biomes.END_MIDLANDS, END, 0.5F); public static final EndBiome END_HIGHLANDS = registerSubBiome(Biomes.END_HIGHLANDS, END, 0.5F); - + // Vanilla Void public static final EndBiome END_BARRENS = registerBiome(Biomes.END_BARRENS, BiomeType.VOID, 1F); public static final EndBiome SMALL_END_ISLANDS = registerBiome(Biomes.SMALL_END_ISLANDS, BiomeType.VOID, 1); - + // Better End Land public static final EndBiome FOGGY_MUSHROOMLAND = registerBiome(new FoggyMushroomlandBiome(), BiomeType.LAND); public static final EndBiome CHORUS_FOREST = registerBiome(new ChorusForestBiome(), BiomeType.LAND); @@ -97,10 +97,10 @@ public class EndBiomes { public static final EndBiome DRY_SHRUBLAND = registerBiome(new DryShrublandBiome(), BiomeType.LAND); public static final EndBiome LANTERN_WOODS = registerBiome(new LanternWoodsBiome(), BiomeType.LAND); public static final EndBiome NEON_OASIS = registerSubBiome(new NeonOasisBiome(), DUST_WASTELANDS); - + // Better End Void public static final EndBiome ICE_STARFIELD = registerBiome(new BiomeIceStarfield(), BiomeType.VOID); - + // Better End Caves public static final EndCaveBiome EMPTY_END_CAVE = registerCaveBiome(new EmptyEndCaveBiome()); public static final EndCaveBiome EMPTY_SMARAGDANT_CAVE = registerCaveBiome(new EmptySmaragdantCaveBiome()); @@ -108,28 +108,28 @@ public class EndBiomes { public static final EndCaveBiome EMPTY_AURORA_CAVE = registerCaveBiome(new EmptyAuroraCaveBiome()); public static final EndCaveBiome LUSH_AURORA_CAVE = registerCaveBiome(new LushAuroraCaveBiome()); public static final EndCaveBiome JADE_CAVE = registerCaveBiome(new JadeCaveBiome()); - + public static void register() { CAVE_BIOMES.rebuild(); } - + public static void onWorldLoad(long seed) { if (caveBiomeMap == null || caveBiomeMap.getSeed() != seed) { caveBiomeMap = new BiomeMap(seed, GeneratorOptions.getBiomeSizeCaves(), CAVE_BIOMES); } } - + public static void mutateRegistry(Registry biomeRegistry) { LAND_BIOMES.clearMutables(); VOID_BIOMES.clearMutables(); CAVE_BIOMES.clearMutables(); - + if (FABRIC_VOID.isEmpty()) { loadFabricAPIBiomes(); } - + Map configs = Maps.newHashMap(); - + biomeRegistry.forEach((biome) -> { if (biome.getBiomeCategory() == BiomeCategory.THEEND) { ResourceLocation id = biomeRegistry.getKey(biome); @@ -152,7 +152,7 @@ public class EndBiomes { hasCaves = JsonFactory.getBoolean(element.getAsJsonObject(), "has_caves", true); } EndBiome endBiome = new EndBiome(id, biome, fog, chance, hasCaves); - + if (isVoid) { VOID_BIOMES.addBiomeMutable(endBiome); } @@ -170,30 +170,30 @@ public class EndBiomes { } }); Configs.BIOME_CONFIG.saveChanges(); - + rebuildPicker(LAND_BIOMES, biomeRegistry); rebuildPicker(VOID_BIOMES, biomeRegistry); rebuildPicker(CAVE_BIOMES, biomeRegistry); - + SUBBIOMES.forEach((endBiome) -> { endBiome.updateActualBiomes(biomeRegistry); }); } - + private static void rebuildPicker(BiomePicker picker, Registry biomeRegistry) { picker.rebuild(); picker.getBiomes().forEach((endBiome) -> { endBiome.updateActualBiomes(biomeRegistry); }); } - + private static void loadFabricAPIBiomes() { List> biomes = Lists.newArrayList(); biomes.addAll(getBiomes(InternalBiomeData.getEndBiomesMap().get(Biomes.SMALL_END_ISLANDS))); biomes.addAll(getBiomes(InternalBiomeData.getEndBarrensMap().get(Biomes.END_BARRENS))); biomes.forEach((key) -> FABRIC_VOID.add(key.location())); FABRIC_VOID.removeIf(id -> id.getNamespace().equals("endplus")); - + if (BCLib.isDevEnvironment()) { System.out.println("=================================="); System.out.println("Added void biomes from Fabric API:"); @@ -203,12 +203,12 @@ public class EndBiomes { System.out.println("=================================="); } } - + private static List> getBiomes(WeightedBiomePicker picker) { IBiomeList biomeList = (IBiomeList) (Object) picker; return biomeList == null ? Collections.emptyList() : biomeList.getBiomes(); } - + private static JsonObject loadJsonConfig(String namespace) { InputStream inputstream = EndBiomes.class.getResourceAsStream("/data/" + namespace + "/end_biome_properties.json"); if (inputstream != null) { @@ -218,7 +218,7 @@ public class EndBiomes { return EMPTY_JSON; } } - + /** * Registers new {@link EndBiome} and adds it to picker, can be used to add existing mod biomes into the End. * @@ -230,7 +230,7 @@ public class EndBiomes { public static EndBiome registerBiome(Biome biome, BiomeType type, float genChance) { return registerBiome(biome, type, 1, genChance); } - + /** * Registers new {@link EndBiome} and adds it to picker, can be used to add existing mod biomes into the End. * @@ -247,7 +247,7 @@ public class EndBiomes { } return endBiome; } - + /** * Registers new {@link EndBiome} from existed {@link Biome} and put as a sub-biome into selected parent. * @@ -259,7 +259,7 @@ public class EndBiomes { public static EndBiome registerSubBiome(Biome biome, EndBiome parent, float genChance, boolean hasCaves) { return registerSubBiome(biome, parent, 1, genChance, hasCaves); } - + /** * Registers new {@link EndBiome} from existed {@link Biome} and put as a sub-biome into selected parent. * @@ -280,7 +280,7 @@ public class EndBiomes { } return endBiome; } - + /** * Put existing {@link EndBiome} as a sub-biome into selected parent. * @@ -298,7 +298,7 @@ public class EndBiomes { } return biome; } - + /** * Registers {@link EndBiome} and adds it into worldgen. * @@ -319,7 +319,7 @@ public class EndBiomes { } return biome; } - + /** * Put integration sub-biome {@link EndBiome} into subbiomes list and registers it. * @@ -335,7 +335,7 @@ public class EndBiomes { } return biome; } - + /** * Link integration sub-biome with parent. * @@ -350,15 +350,15 @@ public class EndBiomes { } } } - + public static EndBiome registerBiome(ResourceKey key, BiomeType type, float genChance) { return registerBiome(BuiltinRegistries.BIOME.get(key), type, genChance); } - + public static EndBiome registerSubBiome(ResourceKey key, EndBiome parent, float genChance) { return registerSubBiome(BuiltinRegistries.BIOME.get(key), parent, genChance, true); } - + private static void addToPicker(EndBiome biome, BiomeType type) { if (type == BiomeType.LAND) { LAND_BIOMES.addBiome(biome); @@ -367,7 +367,7 @@ public class EndBiomes { VOID_BIOMES.addBiome(biome); } } - + public static EndCaveBiome registerCaveBiome(EndCaveBiome biome) { if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) { BiomeAPI.registerBiome(biome); @@ -375,7 +375,7 @@ public class EndBiomes { } return biome; } - + public static EndCaveBiome getCaveBiome(int x, int z) { return (EndCaveBiome) caveBiomeMap.getBiome(x, z); } diff --git a/src/main/java/ru/betterend/registry/EndBlockEntities.java b/src/main/java/ru/betterend/registry/EndBlockEntities.java index 13e90bdf..1b0ed400 100644 --- a/src/main/java/ru/betterend/registry/EndBlockEntities.java +++ b/src/main/java/ru/betterend/registry/EndBlockEntities.java @@ -15,29 +15,22 @@ import ru.betterend.blocks.entities.InfusionPedestalEntity; import ru.betterend.blocks.entities.PedestalBlockEntity; public class EndBlockEntities { - public final static BlockEntityType END_STONE_SMELTER = registerBlockEntity(EndStoneSmelter.ID, - FabricBlockEntityTypeBuilder.create(EndStoneSmelterBlockEntity::new, EndBlocks.END_STONE_SMELTER)); - public final static BlockEntityType PEDESTAL = registerBlockEntity("pedestal", - FabricBlockEntityTypeBuilder.create(PedestalBlockEntity::new, getPedestals())); - public final static BlockEntityType ETERNAL_PEDESTAL = registerBlockEntity("eternal_pedestal", - FabricBlockEntityTypeBuilder.create(EternalPedestalEntity::new, EndBlocks.ETERNAL_PEDESTAL)); - public final static BlockEntityType INFUSION_PEDESTAL = registerBlockEntity("infusion_pedestal", - FabricBlockEntityTypeBuilder.create(InfusionPedestalEntity::new, EndBlocks.INFUSION_PEDESTAL)); - public final static BlockEntityType HYDROTHERMAL_VENT = registerBlockEntity("hydrother_malvent", - FabricBlockEntityTypeBuilder.create(BlockEntityHydrothermalVent::new, EndBlocks.HYDROTHERMAL_VENT)); - + public final static BlockEntityType END_STONE_SMELTER = registerBlockEntity(EndStoneSmelter.ID, FabricBlockEntityTypeBuilder.create(EndStoneSmelterBlockEntity::new, EndBlocks.END_STONE_SMELTER)); + public final static BlockEntityType PEDESTAL = registerBlockEntity("pedestal", FabricBlockEntityTypeBuilder.create(PedestalBlockEntity::new, getPedestals())); + public final static BlockEntityType ETERNAL_PEDESTAL = registerBlockEntity("eternal_pedestal", FabricBlockEntityTypeBuilder.create(EternalPedestalEntity::new, EndBlocks.ETERNAL_PEDESTAL)); + public final static BlockEntityType INFUSION_PEDESTAL = registerBlockEntity("infusion_pedestal", FabricBlockEntityTypeBuilder.create(InfusionPedestalEntity::new, EndBlocks.INFUSION_PEDESTAL)); + public final static BlockEntityType HYDROTHERMAL_VENT = registerBlockEntity("hydrother_malvent", FabricBlockEntityTypeBuilder.create(BlockEntityHydrothermalVent::new, EndBlocks.HYDROTHERMAL_VENT)); + public static BlockEntityType registerBlockEntity(String id, FabricBlockEntityTypeBuilder builder) { return Registry.register(Registry.BLOCK_ENTITY_TYPE, BetterEnd.makeID(id), builder.build(null)); - + //return Registry.register(Registry.BLOCK_ENTITY_TYPE, BetterEnd.makeID(id), builder.build(null)); } - + public static void register() { } - + static Block[] getPedestals() { - return EndBlocks.getModBlocks().stream() - .filter(block -> block instanceof PedestalBlock && !((PedestalBlock) block).hasUniqueEntity()) - .toArray(Block[]::new); + return EndBlocks.getModBlocks().stream().filter(block -> block instanceof PedestalBlock && !((PedestalBlock) block).hasUniqueEntity()).toArray(Block[]::new); } } diff --git a/src/main/java/ru/betterend/registry/EndBlocks.java b/src/main/java/ru/betterend/registry/EndBlocks.java index fa034b22..490752f3 100644 --- a/src/main/java/ru/betterend/registry/EndBlocks.java +++ b/src/main/java/ru/betterend/registry/EndBlocks.java @@ -10,9 +10,7 @@ import net.minecraft.world.level.material.MaterialColor; import org.jetbrains.annotations.NotNull; import ru.bclib.blocks.BaseBarrelBlock; import ru.bclib.blocks.BaseChestBlock; -import ru.bclib.blocks.BaseCropBlock; import ru.bclib.blocks.BaseFurnaceBlock; -import ru.bclib.blocks.BaseLeavesBlock; import ru.bclib.blocks.BaseOreBlock; import ru.bclib.blocks.BasePathBlock; import ru.bclib.blocks.BaseRotatedPillarBlock; @@ -68,6 +66,7 @@ import ru.betterend.blocks.FilaluxBlock; import ru.betterend.blocks.FilaluxLanternBlock; import ru.betterend.blocks.FilaluxWingsBlock; import ru.betterend.blocks.FlamaeaBlock; +import ru.betterend.blocks.FlowerPotBlock; import ru.betterend.blocks.GlowingHymenophoreBlock; import ru.betterend.blocks.GlowingMossBlock; import ru.betterend.blocks.GlowingPillarLuminophorBlock; @@ -132,6 +131,8 @@ import ru.betterend.blocks.basis.EndUnderwaterWallPlantBlock; import ru.betterend.blocks.basis.EndWallMushroom; import ru.betterend.blocks.basis.EndWallPlantBlock; import ru.betterend.blocks.basis.FurBlock; +import ru.betterend.blocks.basis.PottableCropBlock; +import ru.betterend.blocks.basis.PottableLeavesBlock; import ru.betterend.blocks.basis.StoneLanternBlock; import ru.betterend.blocks.complex.ColoredMaterial; import ru.betterend.blocks.complex.CrystalSubblocksMaterial; @@ -160,7 +161,7 @@ public class EndBlocks extends BlocksRegistry { public static final Block JUNGLE_MOSS = registerBlock("jungle_moss", new EndTerrainBlock(MaterialColor.COLOR_GREEN)); public static final Block SANGNUM = registerBlock("sangnum", new EndTerrainBlock(MaterialColor.COLOR_RED)); public static final Block RUTISCUS = registerBlock("rutiscus", new EndTerrainBlock(MaterialColor.COLOR_ORANGE)); - + // Roads // public static final Block END_MYCELIUM_PATH = registerBlock("end_mycelium_path", new BasePathBlock(END_MYCELIUM)); public static final Block END_MOSS_PATH = registerBlock("end_moss_path", new BasePathBlock(END_MOSS)); @@ -173,13 +174,13 @@ public class EndBlocks extends BlocksRegistry { public static final Block JUNGLE_MOSS_PATH = registerBlock("jungle_moss_path", new BasePathBlock(JUNGLE_MOSS)); public static final Block SANGNUM_PATH = registerBlock("sangnum_path", new BasePathBlock(SANGNUM)); public static final Block RUTISCUS_PATH = registerBlock("rutiscus_path", new BasePathBlock(RUTISCUS)); - + public static final Block MOSSY_OBSIDIAN = registerBlock("mossy_obsidian", new MossyObsidian()); public static final Block DRAGON_BONE_BLOCK = registerBlock("dragon_bone_block", new BaseRotatedPillarBlock(Blocks.BONE_BLOCK)); public static final Block DRAGON_BONE_STAIRS = registerBlock("dragon_bone_stairs", new BaseStairsBlock(DRAGON_BONE_BLOCK)); public static final Block DRAGON_BONE_SLAB = registerBlock("dragon_bone_slab", new BaseSlabBlock(DRAGON_BONE_BLOCK)); public static final Block MOSSY_DRAGON_BONE = registerBlock("mossy_dragon_bone", new MossyDragonBoneBlock()); - + // Rocks // public static final StoneMaterial FLAVOLITE = new StoneMaterial("flavolite", MaterialColor.SAND); public static final StoneMaterial VIOLECITE = new StoneMaterial("violecite", MaterialColor.COLOR_PURPLE); @@ -190,76 +191,77 @@ public class EndBlocks extends BlocksRegistry { public static final Block BRIMSTONE = registerBlock("brimstone", new BrimstoneBlock()); public static final Block SULPHUR_CRYSTAL = registerBlock("sulphur_crystal", new SulphurCrystalBlock()); public static final Block MISSING_TILE = registerBlock("missing_tile", new MissingTileBlock()); - + public static final Block ENDSTONE_FLOWER_POT = registerBlock("endstone_flower_pot", new FlowerPotBlock(Blocks.END_STONE)); + public static final Block FLAVOLITE_RUNED = registerBlock("flavolite_runed", new RunedFlavolite(false)); public static final Block FLAVOLITE_RUNED_ETERNAL = registerBlock("flavolite_runed_eternal", new RunedFlavolite(true)); - + public static final Block ANDESITE_PEDESTAL = registerBlock("andesite_pedestal", new PedestalVanilla(Blocks.ANDESITE)); public static final Block DIORITE_PEDESTAL = registerBlock("diorite_pedestal", new PedestalVanilla(Blocks.DIORITE)); public static final Block GRANITE_PEDESTAL = registerBlock("granite_pedestal", new PedestalVanilla(Blocks.GRANITE)); public static final Block QUARTZ_PEDESTAL = registerBlock("quartz_pedestal", new PedestalVanilla(Blocks.QUARTZ_BLOCK)); public static final Block PURPUR_PEDESTAL = registerBlock("purpur_pedestal", new PedestalVanilla(Blocks.PURPUR_BLOCK)); - + public static final Block HYDROTHERMAL_VENT = registerBlock("hydrothermal_vent", new HydrothermalVentBlock()); public static final Block VENT_BUBBLE_COLUMN = registerEndBlockOnly("vent_bubble_column", new VentBubbleColumnBlock()); - + public static final Block DENSE_SNOW = registerBlock("dense_snow", new DenseSnowBlock()); public static final Block EMERALD_ICE = registerBlock("emerald_ice", new EmeraldIceBlock()); public static final Block DENSE_EMERALD_ICE = registerBlock("dense_emerald_ice", new DenseEmeraldIceBlock()); public static final Block ANCIENT_EMERALD_ICE = registerBlock("ancient_emerald_ice", new AncientEmeraldIceBlock()); - + public static final Block END_STONE_STALACTITE = registerBlock("end_stone_stalactite", new StalactiteBlock(Blocks.END_STONE)); public static final Block END_STONE_STALACTITE_CAVEMOSS = registerBlock("end_stone_stalactite_cavemoss", new StalactiteBlock(CAVE_MOSS)); - + // Wooden Materials And Trees // public static final Block MOSSY_GLOWSHROOM_SAPLING = registerBlock("mossy_glowshroom_sapling", new MossyGlowshroomSaplingBlock()); public static final Block MOSSY_GLOWSHROOM_CAP = registerBlock("mossy_glowshroom_cap", new MossyGlowshroomCapBlock()); public static final Block MOSSY_GLOWSHROOM_HYMENOPHORE = registerBlock("mossy_glowshroom_hymenophore", new GlowingHymenophoreBlock()); public static final Block MOSSY_GLOWSHROOM_FUR = registerBlock("mossy_glowshroom_fur", new FurBlock(MOSSY_GLOWSHROOM_SAPLING, 15, 16, true)); public static final WoodenMaterial MOSSY_GLOWSHROOM = new WoodenMaterial("mossy_glowshroom", MaterialColor.COLOR_GRAY, MaterialColor.WOOD); - + public static final Block PYTHADENDRON_SAPLING = registerBlock("pythadendron_sapling", new PythadendronSaplingBlock()); - public static final Block PYTHADENDRON_LEAVES = registerBlock("pythadendron_leaves", new BaseLeavesBlock(PYTHADENDRON_SAPLING, MaterialColor.COLOR_MAGENTA)); + public static final Block PYTHADENDRON_LEAVES = registerBlock("pythadendron_leaves", new PottableLeavesBlock(PYTHADENDRON_SAPLING, MaterialColor.COLOR_MAGENTA)); public static final WoodenMaterial PYTHADENDRON = new WoodenMaterial("pythadendron", MaterialColor.COLOR_MAGENTA, MaterialColor.COLOR_PURPLE); - + public static final Block END_LOTUS_SEED = registerBlock("end_lotus_seed", new EndLotusSeedBlock()); public static final Block END_LOTUS_STEM = registerBlock("end_lotus_stem", new EndLotusStemBlock()); public static final Block END_LOTUS_LEAF = registerEndBlockOnly("end_lotus_leaf", new EndLotusLeafBlock()); public static final Block END_LOTUS_FLOWER = registerEndBlockOnly("end_lotus_flower", new EndLotusFlowerBlock()); public static final WoodenMaterial END_LOTUS = new WoodenMaterial("end_lotus", MaterialColor.COLOR_LIGHT_BLUE, MaterialColor.COLOR_CYAN); - + public static final Block LACUGROVE_SAPLING = registerBlock("lacugrove_sapling", new LacugroveSaplingBlock()); - public static final Block LACUGROVE_LEAVES = registerBlock("lacugrove_leaves", new BaseLeavesBlock(LACUGROVE_SAPLING, MaterialColor.COLOR_CYAN)); + public static final Block LACUGROVE_LEAVES = registerBlock("lacugrove_leaves", new PottableLeavesBlock(LACUGROVE_SAPLING, MaterialColor.COLOR_CYAN)); public static final WoodenMaterial LACUGROVE = new WoodenMaterial("lacugrove", MaterialColor.COLOR_BROWN, MaterialColor.COLOR_YELLOW); - + public static final Block DRAGON_TREE_SAPLING = registerBlock("dragon_tree_sapling", new DragonTreeSaplingBlock()); - public static final Block DRAGON_TREE_LEAVES = registerBlock("dragon_tree_leaves", new BaseLeavesBlock(DRAGON_TREE_SAPLING, MaterialColor.COLOR_MAGENTA)); + public static final Block DRAGON_TREE_LEAVES = registerBlock("dragon_tree_leaves", new PottableLeavesBlock(DRAGON_TREE_SAPLING, MaterialColor.COLOR_MAGENTA)); public static final WoodenMaterial DRAGON_TREE = new WoodenMaterial("dragon_tree", MaterialColor.COLOR_BLACK, MaterialColor.COLOR_MAGENTA); - + public static final Block TENANEA_SAPLING = registerBlock("tenanea_sapling", new TenaneaSaplingBlock()); - public static final Block TENANEA_LEAVES = registerBlock("tenanea_leaves", new BaseLeavesBlock(TENANEA_SAPLING, MaterialColor.COLOR_PINK)); + public static final Block TENANEA_LEAVES = registerBlock("tenanea_leaves", new PottableLeavesBlock(TENANEA_SAPLING, MaterialColor.COLOR_PINK)); public static final Block TENANEA_FLOWERS = registerBlock("tenanea_flowers", new TenaneaFlowersBlock()); public static final Block TENANEA_OUTER_LEAVES = registerBlock("tenanea_outer_leaves", new FurBlock(TENANEA_SAPLING, 32)); public static final WoodenMaterial TENANEA = new WoodenMaterial("tenanea", MaterialColor.COLOR_BROWN, MaterialColor.COLOR_PINK); - + public static final Block HELIX_TREE_SAPLING = registerBlock("helix_tree_sapling", new HelixTreeSaplingBlock()); public static final Block HELIX_TREE_LEAVES = registerBlock("helix_tree_leaves", new HelixTreeLeavesBlock()); public static final WoodenMaterial HELIX_TREE = new WoodenMaterial("helix_tree", MaterialColor.COLOR_GRAY, MaterialColor.COLOR_ORANGE); - + public static final Block UMBRELLA_TREE_SAPLING = registerBlock("umbrella_tree_sapling", new UmbrellaTreeSaplingBlock()); public static final Block UMBRELLA_TREE_MEMBRANE = registerBlock("umbrella_tree_membrane", new UmbrellaTreeMembraneBlock()); public static final Block UMBRELLA_TREE_CLUSTER = registerBlock("umbrella_tree_cluster", new UmbrellaTreeClusterBlock()); public static final Block UMBRELLA_TREE_CLUSTER_EMPTY = registerBlock("umbrella_tree_cluster_empty", new UmbrellaTreeClusterEmptyBlock()); public static final WoodenMaterial UMBRELLA_TREE = new WoodenMaterial("umbrella_tree", MaterialColor.COLOR_BLUE, MaterialColor.COLOR_GREEN); - + public static final Block JELLYSHROOM_CAP_PURPLE = registerBlock("jellyshroom_cap_purple", new JellyshroomCapBlock(217, 142, 255, 164, 0, 255)); public static final WoodenMaterial JELLYSHROOM = new WoodenMaterial("jellyshroom", MaterialColor.COLOR_PURPLE, MaterialColor.COLOR_LIGHT_BLUE); - + public static final Block LUCERNIA_SAPLING = registerBlock("lucernia_sapling", new LucerniaSaplingBlock()); - public static final Block LUCERNIA_LEAVES = registerBlock("lucernia_leaves", new BaseLeavesBlock(LUCERNIA_SAPLING, MaterialColor.COLOR_ORANGE)); + public static final Block LUCERNIA_LEAVES = registerBlock("lucernia_leaves", new PottableLeavesBlock(LUCERNIA_SAPLING, MaterialColor.COLOR_ORANGE)); public static final Block LUCERNIA_OUTER_LEAVES = registerBlock("lucernia_outer_leaves", new FurBlock(LUCERNIA_SAPLING, 32)); public static final WoodenMaterial LUCERNIA = new WoodenMaterial("lucernia", MaterialColor.COLOR_ORANGE, MaterialColor.COLOR_ORANGE); - + // Small Plants // public static final Block UMBRELLA_MOSS = registerBlock("umbrella_moss", new UmbrellaMossBlock()); public static final Block UMBRELLA_MOSS_TALL = registerBlock("umbrella_moss_tall", new UmbrellaMossTallBlock()); @@ -283,26 +285,26 @@ public class EndBlocks extends BlocksRegistry { public static final Block AERIDIUM = registerBlock("aeridium", new TerrainPlantBlock(RUTISCUS)); public static final Block LUTEBUS = registerBlock("lutebus", new TerrainPlantBlock(RUTISCUS)); public static final Block LAMELLARIUM = registerBlock("lamellarium", new TerrainPlantBlock(RUTISCUS)); - + public static final Block BLUE_VINE_SEED = registerBlock("blue_vine_seed", new BlueVineSeedBlock()); public static final Block BLUE_VINE = registerEndBlockOnly("blue_vine", new BlueVineBlock()); public static final Block BLUE_VINE_LANTERN = registerBlock("blue_vine_lantern", new BlueVineLanternBlock()); public static final Block BLUE_VINE_FUR = registerBlock("blue_vine_fur", new FurBlock(BLUE_VINE_SEED, 15, 3, false)); - + public static final Block LANCELEAF_SEED = registerBlock("lanceleaf_seed", new LanceleafSeedBlock()); public static final Block LANCELEAF = registerEndBlockOnly("lanceleaf", new LanceleafBlock()); - + public static final Block GLOWING_PILLAR_SEED = registerBlock("glowing_pillar_seed", new GlowingPillarSeedBlock()); public static final Block GLOWING_PILLAR_ROOTS = registerEndBlockOnly("glowing_pillar_roots", new GlowingPillarRootsBlock()); public static final Block GLOWING_PILLAR_LUMINOPHOR = registerBlock("glowing_pillar_luminophor", new GlowingPillarLuminophorBlock()); public static final Block GLOWING_PILLAR_LEAVES = registerBlock("glowing_pillar_leaves", new FurBlock(GLOWING_PILLAR_SEED, 15, 3, false)); - + public static final Block SMALL_JELLYSHROOM = registerBlock("small_jellyshroom", new SmallJellyshroomBlock()); public static final Block BOLUX_MUSHROOM = registerBlock("bolux_mushroom", new BoluxMushroomBlock()); - + public static final Block LUMECORN_SEED = registerBlock("lumecorn_seed", new LumecornSeedBlock()); public static final Block LUMECORN = registerEndBlockOnly("lumecorn", new LumecornBlock()); - + public static final Block SMALL_AMARANITA_MUSHROOM = registerBlock("small_amaranita_mushroom", new SmallAmaranitaBlock()); public static final Block LARGE_AMARANITA_MUSHROOM = registerEndBlockOnly("large_amaranita_mushroom", new LargeAmaranitaBlock()); public static final Block AMARANITA_STEM = registerBlock("amaranita_stem", new AmaranitaStemBlock()); @@ -311,21 +313,21 @@ public class EndBlocks extends BlocksRegistry { public static final Block AMARANITA_LANTERN = registerBlock("amaranita_lantern", new GlowingHymenophoreBlock()); public static final Block AMARANITA_FUR = registerBlock("amaranita_fur", new FurBlock(SMALL_AMARANITA_MUSHROOM, 15, 4, true)); public static final Block AMARANITA_CAP = registerBlock("amaranita_cap", new AmaranitaCapBlock()); - + public static final Block NEON_CACTUS = registerBlock("neon_cactus", new NeonCactusPlantBlock()); public static final Block NEON_CACTUS_BLOCK = registerBlock("neon_cactus_block", new NeonCactusBlock()); public static final Block NEON_CACTUS_BLOCK_STAIRS = registerBlock("neon_cactus_stairs", new BaseStairsBlock(NEON_CACTUS_BLOCK)); public static final Block NEON_CACTUS_BLOCK_SLAB = registerBlock("neon_cactus_slab", new BaseSlabBlock(NEON_CACTUS_BLOCK)); - + // Crops public static final Block SHADOW_BERRY = registerBlock("shadow_berry", new ShadowBerryBlock()); - public static final Block BLOSSOM_BERRY = registerBlock("blossom_berry_seed", new BaseCropBlock(EndItems.BLOSSOM_BERRY, PINK_MOSS)); - public static final Block AMBER_ROOT = registerBlock("amber_root_seed", new BaseCropBlock(EndItems.AMBER_ROOT_RAW, AMBER_MOSS)); - public static final Block CHORUS_MUSHROOM = registerBlock("chorus_mushroom_seed", new BaseCropBlock(EndItems.CHORUS_MUSHROOM_RAW, CHORUS_NYLIUM)); - //public static final Block PEARLBERRY = registerBlock("pearlberry_seed", new EndCropBlock(EndItems.BLOSSOM_BERRY, END_MOSS, END_MYCELIUM)); + public static final Block BLOSSOM_BERRY = registerBlock("blossom_berry_seed", new PottableCropBlock(EndItems.BLOSSOM_BERRY, PINK_MOSS)); + public static final Block AMBER_ROOT = registerBlock("amber_root_seed", new PottableCropBlock(EndItems.AMBER_ROOT_RAW, AMBER_MOSS)); + public static final Block CHORUS_MUSHROOM = registerBlock("chorus_mushroom_seed", new PottableCropBlock(EndItems.CHORUS_MUSHROOM_RAW, CHORUS_NYLIUM)); + //public static final Block PEARLBERRY = registerBlock("pearlberry_seed", new PottableCropBlock(EndItems.BLOSSOM_BERRY, END_MOSS, END_MYCELIUM)); public static final Block CAVE_PUMPKIN_SEED = registerBlock("cave_pumpkin_seed", new CavePumpkinVineBlock()); public static final Block CAVE_PUMPKIN = registerBlock("cave_pumpkin", new CavePumpkinBlock()); - + // Water plants public static final Block BUBBLE_CORAL = registerBlock("bubble_coral", new BubbleCoralBlock()); public static final Block MENGER_SPONGE = registerBlock("menger_sponge", new MengerSpongeBlock()); @@ -336,24 +338,24 @@ public class EndBlocks extends BlocksRegistry { public static final Block CHARNIA_LIGHT_BLUE = registerBlock("charnia_light_blue", new CharniaBlock()); public static final Block CHARNIA_CYAN = registerBlock("charnia_cyan", new CharniaBlock()); public static final Block CHARNIA_GREEN = registerBlock("charnia_green", new CharniaBlock()); - + public static final Block END_LILY = registerEndBlockOnly("end_lily", new EndLilyBlock()); public static final Block END_LILY_SEED = registerBlock("end_lily_seed", new EndLilySeedBlock()); - + public static final Block HYDRALUX_SAPLING = registerBlock("hydralux_sapling", new HydraluxSaplingBlock()); public static final Block HYDRALUX = registerEndBlockOnly("hydralux", new HydraluxBlock()); public static final Block HYDRALUX_PETAL_BLOCK = registerBlock("hydralux_petal_block", new HydraluxPetalBlock()); public static final ColoredMaterial HYDRALUX_PETAL_BLOCK_COLORED = new ColoredMaterial(HydraluxPetalColoredBlock::new, HYDRALUX_PETAL_BLOCK, true); - + public static final Block POND_ANEMONE = registerBlock("pond_anemone", new PondAnemoneBlock()); - + public static final Block FLAMAEA = registerBlock("flamaea", new FlamaeaBlock()); - + public static final Block CAVE_BUSH = registerBlock("cave_bush", new SimpleLeavesBlock(MaterialColor.COLOR_MAGENTA)); - + public static final Block MURKWEED = registerBlock("murkweed", new MurkweedBlock()); public static final Block NEEDLEGRASS = registerBlock("needlegrass", new NeedlegrassBlock()); - + // Wall Plants // public static final Block PURPLE_POLYPORE = registerBlock("purple_polypore", new EndWallMushroom(13)); public static final Block AURANT_POLYPORE = registerBlock("aurant_polypore", new EndWallMushroom(13)); @@ -364,7 +366,7 @@ public class EndBlocks extends BlocksRegistry { public static final Block BULB_MOSS = registerBlock("bulb_moss", new EndWallPlantBlock(12)); public static final Block JUNGLE_FERN = registerBlock("jungle_fern", new EndWallPlantBlock()); public static final Block RUSCUS = registerBlock("ruscus", new EndWallPlantBlock()); - + // Vines // public static final Block DENSE_VINE = registerBlock("dense_vine", new BaseVineBlock(15, true)); public static final Block TWISTED_VINE = registerBlock("twisted_vine", new BaseVineBlock()); @@ -376,30 +378,30 @@ public class EndBlocks extends BlocksRegistry { public static final Block FILALUX = registerBlock("filalux", new FilaluxBlock()); public static final Block FILALUX_WINGS = registerBlock("filalux_wings", new FilaluxWingsBlock()); public static final Block FILALUX_LANTERN = registerBlock("filalux_lantern", new FilaluxLanternBlock()); - + // Mob-Related public static final Block SILK_MOTH_NEST = registerBlock("silk_moth_nest", new SilkMothNestBlock()); public static final Block SILK_MOTH_HIVE = registerBlock("silk_moth_hive", new SilkMothHiveBlock()); - + // Ores // public static final Block ENDER_ORE = registerBlock("ender_ore", new BaseOreBlock(EndItems.ENDER_SHARD, 1, 3, 5)); public static final Block AMBER_ORE = registerBlock("amber_ore", new BaseOreBlock(EndItems.RAW_AMBER, 1, 2, 4)); - + // Materials // public static final MetalMaterial THALLASIUM = MetalMaterial.makeNormal("thallasium", MaterialColor.COLOR_BLUE, EndToolMaterial.THALLASIUM, EndArmorMaterial.THALLASIUM); public static final MetalMaterial TERMINITE = MetalMaterial.makeOreless("terminite", MaterialColor.WARPED_WART_BLOCK, 7F, 9F, EndToolMaterial.TERMINITE, EndArmorMaterial.TERMINITE); public static final Block AETERNIUM_BLOCK = registerBlock("aeternium_block", new AeterniumBlock()); public static final Block CHARCOAL_BLOCK = registerBlock("charcoal_block", new CharcoalBlock()); - + public static final Block ENDER_BLOCK = registerBlock("ender_block", new EnderBlock()); public static final Block AURORA_CRYSTAL = registerBlock("aurora_crystal", new AuroraCrystalBlock()); public static final Block AMBER_BLOCK = registerBlock("amber_block", new AmberBlock()); + public static final Block SMARAGDANT_CRYSTAL_SHARD = registerBlock("smaragdant_crystal_shard", new SmaragdantCrystalShardBlock()); public static final Block SMARAGDANT_CRYSTAL = registerBlock("smaragdant_crystal", new SmaragdantCrystalBlock()); public static final CrystalSubblocksMaterial SMARAGDANT_SUBBLOCKS = new CrystalSubblocksMaterial("smaragdant_crystal", SMARAGDANT_CRYSTAL); - public static final Block SMARAGDANT_CRYSTAL_SHARD = registerBlock("smaragdant_crystal_shard", new SmaragdantCrystalShardBlock()); - + public static final Block RESPAWN_OBELISK = registerBlock("respawn_obelisk", new RespawnObeliskBlock()); - + // Lanterns public static final Block ANDESITE_LANTERN = registerBlock("andesite_lantern", new StoneLanternBlock(Blocks.ANDESITE)); public static final Block DIORITE_LANTERN = registerBlock("diorite_lantern", new StoneLanternBlock(Blocks.DIORITE)); @@ -408,34 +410,33 @@ public class EndBlocks extends BlocksRegistry { public static final Block PURPUR_LANTERN = registerBlock("purpur_lantern", new StoneLanternBlock(Blocks.PURPUR_BLOCK)); public static final Block END_STONE_LANTERN = registerBlock("end_stone_lantern", new StoneLanternBlock(Blocks.END_STONE)); public static final Block BLACKSTONE_LANTERN = registerBlock("blackstone_lantern", new StoneLanternBlock(Blocks.BLACKSTONE)); - + public static final Block IRON_BULB_LANTERN = registerBlock("iron_bulb_lantern", new BulbVineLanternBlock()); public static final ColoredMaterial IRON_BULB_LANTERN_COLORED = new ColoredMaterial(BulbVineLanternColoredBlock::new, IRON_BULB_LANTERN, false); - + public static final Block IRON_CHANDELIER = EndBlocks.registerBlock("iron_chandelier", new ChandelierBlock(Blocks.GOLD_BLOCK)); public static final Block GOLD_CHANDELIER = EndBlocks.registerBlock("gold_chandelier", new ChandelierBlock(Blocks.GOLD_BLOCK)); - + // Blocks With Entity // public static final Block END_STONE_FURNACE = registerBlock("end_stone_furnace", new BaseFurnaceBlock(Blocks.END_STONE)); public static final Block END_STONE_SMELTER = registerBlock("end_stone_smelter", new EndStoneSmelter()); public static final Block ETERNAL_PEDESTAL = registerBlock("eternal_pedestal", new EternalPedestal()); public static final Block INFUSION_PEDESTAL = registerBlock("infusion_pedestal", new InfusionPedestal()); public static final Block AETERNIUM_ANVIL = registerBlock("aeternium_anvil", new AeterniumAnvil()); - + // Technical public static final Block END_PORTAL_BLOCK = registerEndBlockOnly("end_portal_block", new EndPortalBlock()); - + private static BlocksRegistry BLOCKS_REGISTRY; - + private EndBlocks(CreativeModeTab creativeTab) { super(creativeTab); } - + public static List getModBlocks() { - return getModBlocks(BetterEnd.MOD_ID).stream().filter(BlockItem.class::isInstance) - .map(item -> ((BlockItem) item).getBlock()).collect(Collectors.toList()); + return getModBlocks(BetterEnd.MOD_ID).stream().filter(BlockItem.class::isInstance).map(item -> ((BlockItem) item).getBlock()).collect(Collectors.toList()); } - + public static Block registerBlock(ResourceLocation id, Block block) { if (!Configs.BLOCK_CONFIG.getBooleanRoot(id.getPath(), true)) { return block; @@ -455,24 +456,24 @@ public class EndBlocks extends BlocksRegistry { getBlockRegistry().register(id, block); return block; } - + public static Block registerBlock(String name, Block block) { return registerBlock(BetterEnd.makeID(name), block); } - + public static Block registerEndBlockOnly(String name, Block block) { return getBlockRegistry().registerBlockOnly(name, block); } - + public static FabricItemSettings makeBlockItemSettings() { return getBlockRegistry().makeItemSettings(); } - + @Override public ResourceLocation createModId(String name) { return BetterEnd.makeID(name); } - + @NotNull private static BlocksRegistry getBlockRegistry() { if (BLOCKS_REGISTRY == null) { diff --git a/src/main/java/ru/betterend/registry/EndEntities.java b/src/main/java/ru/betterend/registry/EndEntities.java index 6cb84eaf..c016c825 100644 --- a/src/main/java/ru/betterend/registry/EndEntities.java +++ b/src/main/java/ru/betterend/registry/EndEntities.java @@ -29,7 +29,7 @@ public class EndEntities { public static final EntityType SHADOW_WALKER = register("shadow_walker", MobCategory.MONSTER, 0.6F, 1.95F, ShadowWalkerEntity::new, ShadowWalkerEntity.createMobAttributes(), true, ColorUtil.color(30, 30, 30), ColorUtil.color(5, 5, 5)); public static final EntityType CUBOZOA = register("cubozoa", MobCategory.WATER_AMBIENT, 0.6F, 1F, CubozoaEntity::new, CubozoaEntity.createMobAttributes(), true, ColorUtil.color(151, 77, 181), ColorUtil.color(93, 176, 238)); public static final EntityType SILK_MOTH = register("silk_moth", MobCategory.AMBIENT, 0.6F, 0.6F, SilkMothEntity::new, SilkMothEntity.createMobAttributes(), true, ColorUtil.color(198, 138, 204), ColorUtil.color(242, 220, 236)); - + public static void register() { SpawnHelper.restrictionAir(DRAGONFLY, DragonflyEntity::canSpawn); SpawnHelper.restrictionLand(END_SLIME, EndSlimeEntity::canSpawn); @@ -38,7 +38,7 @@ public class EndEntities { SpawnHelper.restrictionWater(CUBOZOA, CubozoaEntity::canSpawn); SpawnHelper.restrictionAir(SILK_MOTH, SilkMothEntity::canSpawn); } - + protected static EntityType register(String name, MobCategory group, float width, float height, EntityFactory entity) { ResourceLocation id = BetterEnd.makeID(name); EntityType type = FabricEntityTypeBuilder.create(group, entity).dimensions(EntityDimensions.fixed(width, height)).build(); @@ -47,7 +47,7 @@ public class EndEntities { } return type; } - + private static EntityType register(String name, MobCategory group, float width, float height, EntityFactory entity, Builder attributes, boolean fixedSize, int eggColor, int dotsColor) { ResourceLocation id = BetterEnd.makeID(name); EntityType type = FabricEntityTypeBuilder.create(group, entity).dimensions(fixedSize ? EntityDimensions.fixed(width, height) : EntityDimensions.scalable(width, height)).build(); diff --git a/src/main/java/ru/betterend/registry/EndEntitiesRenders.java b/src/main/java/ru/betterend/registry/EndEntitiesRenders.java index f3fa3bb3..cd322df0 100644 --- a/src/main/java/ru/betterend/registry/EndEntitiesRenders.java +++ b/src/main/java/ru/betterend/registry/EndEntitiesRenders.java @@ -25,14 +25,14 @@ import ru.betterend.item.model.CrystaliteHelmetModel; import ru.betterend.item.model.CrystaliteLeggingsModel; public class EndEntitiesRenders { - + public static final ModelLayerLocation DRAGONFLY_MODEL = registerMain("dragonfly"); public static final ModelLayerLocation END_SLIME_SHELL_MODEL = registerMain("endslime_shell"); public static final ModelLayerLocation END_SLIME_MODEL = registerMain("endslime"); public static final ModelLayerLocation END_FISH_MODEL = registerMain("endfish"); public static final ModelLayerLocation CUBOZOA_MODEL = registerMain("cubozoa"); public static final ModelLayerLocation SILK_MOTH_MODEL = registerMain("silkmoth"); - + //Not sure if this should go to another registry public static final ModelLayerLocation ARMORED_ELYTRA = registerMain("armored_elytra"); public static final ModelLayerLocation CRYSTALITE_CHESTPLATE = registerMain("crystalite_chestplate"); @@ -40,7 +40,7 @@ public class EndEntitiesRenders { public static final ModelLayerLocation CRYSTALITE_HELMET = registerMain("crystalite_helmet"); public static final ModelLayerLocation CRYSTALITE_LEGGINGS = registerMain("crystalite_leggings"); public static final ModelLayerLocation CRYSTALITE_BOOTS = registerMain("crystalite_boots"); - + public static void register() { register(EndEntities.DRAGONFLY, RendererEntityDragonfly.class); register(EndEntities.END_SLIME, RendererEntityEndSlime.class); @@ -48,14 +48,14 @@ public class EndEntitiesRenders { register(EndEntities.SHADOW_WALKER, RendererEntityShadowWalker.class); register(EndEntities.CUBOZOA, RendererEntityCubozoa.class); register(EndEntities.SILK_MOTH, SilkMothEntityRenderer.class); - + EntityModelLayerRegistry.registerModelLayer(DRAGONFLY_MODEL, DragonflyEntityModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(END_SLIME_SHELL_MODEL, EndSlimeEntityModel::getShellOnlyTexturedModelData); EntityModelLayerRegistry.registerModelLayer(END_SLIME_MODEL, EndSlimeEntityModel::getCompleteTexturedModelData); EntityModelLayerRegistry.registerModelLayer(END_FISH_MODEL, EndFishEntityModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(CUBOZOA_MODEL, CubozoaEntityModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(SILK_MOTH_MODEL, SilkMothEntityModel::getTexturedModelData); - + EntityModelLayerRegistry.registerModelLayer(ARMORED_ELYTRA, ArmoredElytraModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_CHESTPLATE, CrystaliteChestplateModel::getRegularTexturedModelData); EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_CHESTPLATE_THIN, CrystaliteChestplateModel::getThinTexturedModelData); @@ -63,7 +63,7 @@ public class EndEntitiesRenders { EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_LEGGINGS, CrystaliteLeggingsModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_BOOTS, CrystaliteBootsModel::getTexturedModelData); } - + private static void register(EntityType type, Class> renderer) { EntityRendererRegistry.INSTANCE.register(type, (context) -> { MobRenderer render = null; @@ -76,7 +76,7 @@ public class EndEntitiesRenders { return render; }); } - + private static ModelLayerLocation registerMain(String id) { return new ModelLayerLocation(new ResourceLocation(BetterEnd.MOD_ID, id), "main"); } diff --git a/src/main/java/ru/betterend/registry/EndFeatures.java b/src/main/java/ru/betterend/registry/EndFeatures.java index 295f4059..7042b14e 100644 --- a/src/main/java/ru/betterend/registry/EndFeatures.java +++ b/src/main/java/ru/betterend/registry/EndFeatures.java @@ -93,7 +93,7 @@ public class EndFeatures { public static final BCLFeature JELLYSHROOM = redisterVegetation("jellyshroom", new JellyshroomFeature(), 3); public static final BCLFeature GIGANTIC_AMARANITA = redisterVegetation("gigantic_amaranita", new GiganticAmaranitaFeature(), 1); public static final BCLFeature LUCERNIA = redisterVegetation("lucernia", new LucerniaFeature(), 3); - + // Bushes // public static final BCLFeature PYTHADENDRON_BUSH = redisterVegetation("pythadendron_bush", new BushFeature(EndBlocks.PYTHADENDRON_LEAVES, EndBlocks.PYTHADENDRON.bark), 4); public static final BCLFeature DRAGON_TREE_BUSH = redisterVegetation("dragon_tree_bush", new BushFeature(EndBlocks.DRAGON_TREE_LEAVES, EndBlocks.DRAGON_TREE.bark), 15); @@ -103,7 +103,7 @@ public class EndFeatures { public static final BCLFeature LUCERNIA_BUSH = redisterVegetation("lucernia_bush", new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES, EndBlocks.LUCERNIA_OUTER_LEAVES, EndBlocks.LUCERNIA.bark), 10); public static final BCLFeature LUCERNIA_BUSH_RARE = redisterVegetation("lucernia_bush_rare", new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES, EndBlocks.LUCERNIA_OUTER_LEAVES, EndBlocks.LUCERNIA.bark), 1); public static final BCLFeature NEON_CACTUS = redisterVegetation("neon_cactus", new NeonCactusFeature(), 2); - + // Plants // public static final BCLFeature UMBRELLA_MOSS = redisterVegetation("umbrella_moss", new DoublePlantFeature(EndBlocks.UMBRELLA_MOSS, EndBlocks.UMBRELLA_MOSS_TALL, 5), 5); public static final BCLFeature CREEPING_MOSS = redisterVegetation("creeping_moss", new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 5), 5); @@ -141,16 +141,16 @@ public class EndFeatures { public static final BCLFeature CHORUS_MUSHROOM = redisterVegetation("chorus_mushroom", new SinglePlantFeature(EndBlocks.CHORUS_MUSHROOM, 5, 5), 1); public static final BCLFeature AMBER_ROOT = redisterVegetation("amber_root", new SinglePlantFeature(EndBlocks.AMBER_ROOT, 5, 5), 1); //public static final BCLFeature PEARLBERRY = redisterVegetation("pearlberry", new SinglePlantFeature(EndBlocks.PEARLBERRY, 5, 5), 1); - + // Vines // public static final BCLFeature DENSE_VINE = redisterVegetation("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3); public static final BCLFeature TWISTED_VINE = redisterVegetation("twisted_vine", new VineFeature(EndBlocks.TWISTED_VINE, 24), 3); public static final BCLFeature BULB_VINE = redisterVegetation("bulb_vine", new VineFeature(EndBlocks.BULB_VINE, 24), 5); public static final BCLFeature JUNGLE_VINE = redisterVegetation("jungle_vine", new VineFeature(EndBlocks.JUNGLE_VINE, 24), 5); - + // Ceil plants public static final BCLFeature SMALL_JELLYSHROOM_CEIL = redisterVegetation("small_jellyshroom_ceil", new SingleInvertedScatterFeature(EndBlocks.SMALL_JELLYSHROOM, 8), 8); - + // Wall Plants // public static final BCLFeature PURPLE_POLYPORE = redisterVegetation("purple_polypore", new WallPlantOnLogFeature(EndBlocks.PURPLE_POLYPORE, 3), 5); public static final BCLFeature AURANT_POLYPORE = redisterVegetation("aurant_polypore", new WallPlantOnLogFeature(EndBlocks.AURANT_POLYPORE, 3), 5); @@ -167,10 +167,10 @@ public class EndFeatures { public static final BCLFeature JUNGLE_FERN_WOOD = redisterVegetation("jungle_fern_wood", new WallPlantOnLogFeature(EndBlocks.JUNGLE_FERN, 3), 12); public static final BCLFeature RUSCUS = redisterVegetation("ruscus", new WallPlantFeature(EndBlocks.RUSCUS, 6), 10); public static final BCLFeature RUSCUS_WOOD = redisterVegetation("ruscus_wood", new WallPlantOnLogFeature(EndBlocks.RUSCUS, 6), 10); - + // Sky plants public static final BCLFeature FILALUX = redisterVegetation("filalux", new FilaluxFeature(), 1); - + // Water // public static final BCLFeature BUBBLE_CORAL = redisterVegetation("bubble_coral", new UnderwaterPlantFeature(EndBlocks.BUBBLE_CORAL, 6), 10); public static final BCLFeature BUBBLE_CORAL_RARE = redisterVegetation("bubble_coral_rare", new UnderwaterPlantFeature(EndBlocks.BUBBLE_CORAL, 3), 4); @@ -180,7 +180,7 @@ public class EndFeatures { public static final BCLFeature END_LOTUS_LEAF = redisterVegetation("end_lotus_leaf", new EndLotusLeafFeature(20), 25); public static final BCLFeature HYDRALUX = redisterVegetation("hydralux", new HydraluxFeature(5), 5); public static final BCLFeature POND_ANEMONE = redisterVegetation("pond_anemone", new UnderwaterPlantFeature(EndBlocks.POND_ANEMONE, 6), 10); - + public static final BCLFeature CHARNIA_RED = redisterVegetation("charnia_red", new CharniaFeature(EndBlocks.CHARNIA_RED), 10); public static final BCLFeature CHARNIA_PURPLE = redisterVegetation("charnia_purple", new CharniaFeature(EndBlocks.CHARNIA_PURPLE), 10); public static final BCLFeature CHARNIA_CYAN = redisterVegetation("charnia_cyan", new CharniaFeature(EndBlocks.CHARNIA_CYAN), 10); @@ -191,7 +191,7 @@ public class EndFeatures { public static final BCLFeature CHARNIA_RED_RARE = redisterVegetation("charnia_red_rare", new CharniaFeature(EndBlocks.CHARNIA_RED), 2); public static final BCLFeature BIOME_ISLAND = BCLFeature.makeFeatureConfigured(BetterEnd.makeID("overworld_island"), new BiomeIslandFeature()); public static final BCLFeature FLAMAEA = redisterVegetation("flamaea", new SinglePlantFeature(EndBlocks.FLAMAEA, 12, false, 5), 20); - + // Terrain // public static final BCLFeature END_LAKE = registerLake("end_lake", new EndLakeFeature(), 4); public static final BCLFeature END_LAKE_NORMAL = registerLake("end_lake_normal", new EndLakeFeature(), 20); @@ -211,20 +211,20 @@ public class EndFeatures { public static final BCLFeature OBSIDIAN_BOULDER = registerChanced("obsidian_boulder", new ObsidianBoulderFeature(), 10); public static final BCLFeature FALLEN_PILLAR = registerChanced("fallen_pillar", new FallenPillarFeature(), 20); public static final BCLFeature TUNEL_CAVE = BCLFeature.makeChunkFeature(BetterEnd.makeID("tunel_cave"), new TunelCaveFeature()); - + // Ores // public static final BCLFeature THALLASIUM_ORE = registerOre("thallasium_ore", EndBlocks.THALLASIUM.ore, 24, 8, 0, 5, 128); public static final BCLFeature ENDER_ORE = registerOre("ender_ore", EndBlocks.ENDER_ORE, 12, 4, 0, 5, 128); public static final BCLFeature AMBER_ORE = registerOre("amber_ore", EndBlocks.AMBER_ORE, 24, 6, 0, 5, 128); public static final BCLFeature VIOLECITE_LAYER = registerLayer("violecite_layer", EndBlocks.VIOLECITE, 15, 16, 128, 8); public static final BCLFeature FLAVOLITE_LAYER = registerLayer("flavolite_layer", EndBlocks.FLAVOLITE, 12, 16, 128, 6); - + // Buildings public static final BCLFeature CRASHED_SHIP = registerChanced("crashed_ship", new CrashedShipFeature(), 500); - + // Mobs public static final BCLFeature SILK_MOTH_NEST = registerChanced("silk_moth_nest", new SilkMothNestFeature(), 2); - + // Caves public static final DefaultFeature SMARAGDANT_CRYSTAL = new SmaragdantCrystalFeature(); public static final DefaultFeature SMARAGDANT_CRYSTAL_SHARD = new SingleBlockFeature(EndBlocks.SMARAGDANT_CRYSTAL_SHARD); @@ -238,43 +238,43 @@ public class EndFeatures { public static final DefaultFeature END_STONE_STALACTITE_CAVEMOSS = new StalactiteFeature(true, EndBlocks.END_STONE_STALACTITE_CAVEMOSS, Blocks.END_STONE, EndBlocks.CAVE_MOSS); public static final DefaultFeature END_STONE_STALAGMITE_CAVEMOSS = new StalactiteFeature(false, EndBlocks.END_STONE_STALACTITE_CAVEMOSS, EndBlocks.CAVE_MOSS); public static final DefaultFeature CAVE_PUMPKIN = new CavePumpkinFeature(); - + private static BCLFeature redisterVegetation(String name, Feature feature, int density) { return BCLFeature.makeVegetationFeature(BetterEnd.makeID(name), feature, density); } - + private static BCLFeature registerRawGen(String name, Feature feature, int chance) { return BCLFeature.makeRawGenFeature(BetterEnd.makeID(name), feature, chance); } - + private static BCLFeature registerLake(String name, Feature feature, int chance) { //return BCLFeature.makeLakeFeature(BetterEnd.makeID(name), feature, chance); return BCLFeature.makeRawGenFeature(BetterEnd.makeID(name), feature, chance); } - + private static BCLFeature registerChanced(String name, Feature feature, int chance) { return BCLFeature.makeChansedFeature(BetterEnd.makeID(name), feature, chance); } - + private static BCLFeature registerOre(String name, Block blockOre, int veins, int veinSize, int offset, int minY, int maxY) { return BCLFeature.makeOreFeature(BetterEnd.makeID(name), blockOre, veins, veinSize, offset, minY, maxY); } - + private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) { OreLayerFeature layer = new OreLayerFeature(block.defaultBlockState(), radius, minY, maxY); ConfiguredFeature configured = layer.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.COUNT.configured(new CountConfiguration(count))); return new BCLFeature(BetterEnd.makeID(name), layer, GenerationStep.Decoration.UNDERGROUND_ORES, configured); } - + private static BCLFeature registerLayer(String name, StoneMaterial material, float radius, int minY, int maxY, int count) { return registerLayer(name, material.stone, radius, minY, maxY, count); } - + public static void registerBiomeFeatures(ResourceLocation id, Biome biome, List>>> features) { if (id.getNamespace().equals(BetterEnd.MOD_ID)) { return; } - + if (GeneratorOptions.removeChorusFromVanillaBiomes()) { if (id.getNamespace().equals("minecraft")) { String path = id.getPath(); @@ -290,38 +290,38 @@ public class EndFeatures { } } } - + addFeature(FLAVOLITE_LAYER, features); addFeature(THALLASIUM_ORE, features); addFeature(ENDER_ORE, features); addFeature(CRASHED_SHIP, features); - + BCLBiome bclbiome = BiomeAPI.getBiome(id); boolean hasCaves = bclbiome.getCustomData("has_caves", true); if (hasCaves && !EndBiomes.VOID_BIOMES.containsImmutable(id)) { addFeature(ROUND_CAVE, features); addFeature(TUNEL_CAVE, features); } - + BCLFeature feature = BiomeAPI.getBiome(id).getStructuresFeature(); if (feature != null) { addFeature(feature, features); } } - + public static void addDefaultFeatures(BCLBiomeDef def) { def.addFeature(FLAVOLITE_LAYER); def.addFeature(THALLASIUM_ORE); def.addFeature(ENDER_ORE); def.addFeature(CRASHED_SHIP); - + boolean hasCaves = def.getCustomData("has_caves", true); if (hasCaves) { def.addFeature(ROUND_CAVE); def.addFeature(TUNEL_CAVE); } } - + private static void addFeature(BCLFeature feature, List>>> features) { int index = feature.getFeatureStep().ordinal(); if (features.size() > index) { @@ -337,7 +337,7 @@ public class EndFeatures { features.add(newFeature); } } - + public static void register() { } } diff --git a/src/main/java/ru/betterend/registry/EndItems.java b/src/main/java/ru/betterend/registry/EndItems.java index cbfd428a..d8e8b97d 100644 --- a/src/main/java/ru/betterend/registry/EndItems.java +++ b/src/main/java/ru/betterend/registry/EndItems.java @@ -17,11 +17,13 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.TieredItem; import net.minecraft.world.item.Tiers; import org.jetbrains.annotations.NotNull; +import ru.bclib.items.BaseAnvilItem; import ru.bclib.items.BaseArmorItem; import ru.bclib.items.tool.BaseAxeItem; import ru.bclib.items.tool.BaseHoeItem; import ru.bclib.items.tool.BaseShovelItem; import ru.bclib.items.tool.BaseSwordItem; +import ru.bclib.registry.BaseRegistry; import ru.bclib.registry.ItemsRegistry; import ru.betterend.BetterEnd; import ru.betterend.config.Configs; @@ -65,13 +67,13 @@ public class EndItems extends ItemsRegistry { public final static Item LUMECORN_ROD = registerEndItem("lumecorn_rod"); public final static Item SILK_MOTH_MATRIX = registerEndItem("silk_moth_matrix"); public final static Item ENCHANTED_MEMBRANE = registerEndItem("enchanted_membrane", new EnchantedItem(Items.PHANTOM_MEMBRANE)); - + // Music Discs public final static Item MUSIC_DISC_STRANGE_AND_ALIEN = registerEndDisc("music_disc_strange_and_alien", 0, EndSounds.RECORD_STRANGE_AND_ALIEN); public final static Item MUSIC_DISC_GRASPING_AT_STARS = registerEndDisc("music_disc_grasping_at_stars", 0, EndSounds.RECORD_GRASPING_AT_STARS); public final static Item MUSIC_DISC_ENDSEEKER = registerEndDisc("music_disc_endseeker", 0, EndSounds.RECORD_ENDSEEKER); public final static Item MUSIC_DISC_EO_DRACONA = registerEndDisc("music_disc_eo_dracona", 0, EndSounds.RECORD_EO_DRACONA); - + // Armor // public static final Item AETERNIUM_HELMET = registerEndItem("aeternium_helmet", new BaseArmorItem(EndArmorMaterial.AETERNIUM, EquipmentSlot.HEAD, makeEndItemSettings().fireResistant())); public static final Item AETERNIUM_CHESTPLATE = registerEndItem("aeternium_chestplate", new BaseArmorItem(EndArmorMaterial.AETERNIUM, EquipmentSlot.CHEST, makeEndItemSettings().fireResistant())); @@ -83,7 +85,7 @@ public class EndItems extends ItemsRegistry { public static final Item CRYSTALITE_BOOTS = registerEndItem("crystalite_boots", new CrystaliteBoots()); public static final Item ARMORED_ELYTRA = registerEndItem("elytra_armored", new ArmoredElytra("elytra_armored", EndArmorMaterial.AETERNIUM, Items.PHANTOM_MEMBRANE, 900, 0.975D, true)); public static final Item CRYSTALITE_ELYTRA = registerEndItem("elytra_crystalite", new CrystaliteElytra(650, 0.99D)); - + // Tools // public static final TieredItem AETERNIUM_SHOVEL = registerEndTool("aeternium_shovel", new BaseShovelItem(EndToolMaterial.AETERNIUM, 1.5F, -3.0F, makeEndItemSettings().fireResistant())); public static final TieredItem AETERNIUM_SWORD = registerEndTool("aeternium_sword", new BaseSwordItem(EndToolMaterial.AETERNIUM, 3, -2.4F, makeEndItemSettings().fireResistant())); @@ -91,7 +93,7 @@ public class EndItems extends ItemsRegistry { public static final TieredItem AETERNIUM_AXE = registerEndTool("aeternium_axe", new BaseAxeItem(EndToolMaterial.AETERNIUM, 5.0F, -3.0F, makeEndItemSettings().fireResistant())); public static final TieredItem AETERNIUM_HOE = registerEndTool("aeternium_hoe", new BaseHoeItem(EndToolMaterial.AETERNIUM, -3, 0.0F, makeEndItemSettings().fireResistant())); public static final TieredItem AETERNIUM_HAMMER = registerEndTool("aeternium_hammer", new EndHammerItem(EndToolMaterial.AETERNIUM, 6.0F, -3.0F, 0.3D, makeEndItemSettings().fireResistant())); - + // Toolparts // public final static Item AETERNIUM_SHOVEL_HEAD = registerEndItem("aeternium_shovel_head"); public final static Item AETERNIUM_PICKAXE_HEAD = registerEndItem("aeternium_pickaxe_head"); @@ -100,13 +102,13 @@ public class EndItems extends ItemsRegistry { public final static Item AETERNIUM_HAMMER_HEAD = registerEndItem("aeternium_hammer_head"); public final static Item AETERNIUM_SWORD_BLADE = registerEndItem("aeternium_sword_blade"); public final static Item AETERNIUM_SWORD_HANDLE = registerEndItem("aeternium_sword_handle"); - + // Hammers // public static final TieredItem IRON_HAMMER = registerEndTool("iron_hammer", new EndHammerItem(Tiers.IRON, 5.0F, -3.2F, 0.2D, makeEndItemSettings())); public static final TieredItem GOLDEN_HAMMER = registerEndTool("golden_hammer", new EndHammerItem(Tiers.GOLD, 4.5F, -3.4F, 0.3D, makeEndItemSettings())); public static final TieredItem DIAMOND_HAMMER = registerEndTool("diamond_hammer", new EndHammerItem(Tiers.DIAMOND, 5.5F, -3.1F, 0.2D, makeEndItemSettings())); public static final TieredItem NETHERITE_HAMMER = registerEndTool("netherite_hammer", new EndHammerItem(Tiers.NETHERITE, 5.0F, -3.0F, 0.2D, makeEndItemSettings().fireResistant())); - + // Food // public final static Item SHADOW_BERRY_RAW = registerEndFood("shadow_berry_raw", 4, 0.5F); public final static Item SHADOW_BERRY_COOKED = registerEndFood("shadow_berry_cooked", 6, 0.7F); @@ -123,32 +125,32 @@ public class EndItems extends ItemsRegistry { public final static Item CHORUS_MUSHROOM_COOKED = registerEndFood("chorus_mushroom_cooked", Foods.MUSHROOM_STEW); public final static Item BOLUX_MUSHROOM_COOKED = registerEndFood("bolux_mushroom_cooked", Foods.MUSHROOM_STEW); public final static Item CAVE_PUMPKIN_PIE = registerEndFood("cave_pumpkin_pie", Foods.PUMPKIN_PIE); - + // Drinks // public final static Item UMBRELLA_CLUSTER_JUICE = registerEndDrink("umbrella_cluster_juice", 5, 0.7F); - + private static ItemsRegistry itemRegistry; - + protected EndItems(CreativeModeTab creativeTab) { super(creativeTab); } - + public static List getModItems() { return getModItems(BetterEnd.MOD_ID); } - + public static Item registerEndDisc(String name, int power, SoundEvent sound) { return getItemRegistry().registerDisc(name, power, sound); } - + public static Item registerEndItem(String name) { return getItemRegistry().registerItem(name); } - + public static Item registerEndItem(String name, Item item) { return getItemRegistry().register(BetterEnd.makeID(name), item); } - + public static Item registerEndItem(ResourceLocation id, Item item) { if (item instanceof ArmorItem) { return registerEndArmor(id, item); @@ -159,7 +161,7 @@ public class EndItems extends ItemsRegistry { getItemRegistry().register(id, item); return item; } - + private static Item registerEndArmor(ResourceLocation itemId, Item item) { if (!Configs.ITEM_CONFIG.getBoolean("armor", itemId.getPath(), true)) { return item; @@ -167,47 +169,47 @@ public class EndItems extends ItemsRegistry { getItemRegistry().register(itemId, item); return item; } - + public static TieredItem registerEndTool(String name, TieredItem item) { if (!Configs.ITEM_CONFIG.getBoolean("tools", name, true)) { return item; } return getItemRegistry().registerTool(name, item); } - + public static Item registerEndEgg(String name, EntityType type, int background, int dots) { return getItemRegistry().registerEgg(name, type, background, dots); } - + public static Item registerEndFood(String name, int hunger, float saturation, MobEffectInstance... effects) { return getItemRegistry().registerFood(name, hunger, saturation, effects); } - + public static Item registerEndFood(String name, FoodProperties foodComponent) { return getItemRegistry().registerFood(name, foodComponent); } - + public static Item registerEndDrink(String name) { return getItemRegistry().registerDrink(name); } - + public static Item registerEndDrink(String name, FoodProperties foodComponent) { return getItemRegistry().registerDrink(name, foodComponent); } - + public static Item registerEndDrink(String name, int hunger, float saturation) { return getItemRegistry().registerDrink(name, hunger, saturation); } - + public static FabricItemSettings makeEndItemSettings() { return itemRegistry.makeItemSettings(); } - + @Override public ResourceLocation createModId(String name) { return BetterEnd.makeID(name); } - + @NotNull private static ItemsRegistry getItemRegistry() { if (itemRegistry == null) { diff --git a/src/main/java/ru/betterend/registry/EndModelProviders.java b/src/main/java/ru/betterend/registry/EndModelProviders.java index 3c7d2dd3..bf43f23e 100644 --- a/src/main/java/ru/betterend/registry/EndModelProviders.java +++ b/src/main/java/ru/betterend/registry/EndModelProviders.java @@ -7,9 +7,9 @@ import shadow.fabric.api.client.rendering.v1.ArmorRenderingRegistry; @Environment(EnvType.CLIENT) public class EndModelProviders { - + public final static CrystaliteArmorProvider CRYSTALITE_PROVIDER = new CrystaliteArmorProvider(); - + public final static void register() { ArmorRenderingRegistry.registerModel(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems()); ArmorRenderingRegistry.registerTexture(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems()); diff --git a/src/main/java/ru/betterend/registry/EndParticles.java b/src/main/java/ru/betterend/registry/EndParticles.java index 0b8e1d49..2fb673a6 100644 --- a/src/main/java/ru/betterend/registry/EndParticles.java +++ b/src/main/java/ru/betterend/registry/EndParticles.java @@ -33,7 +33,7 @@ public class EndParticles { public static final SimpleParticleType JUNGLE_SPORE = register("jungle_spore"); public static final SimpleParticleType FIREFLY = register("firefly"); public static final SimpleParticleType SMARAGDANT = register("smaragdant_particle"); - + public static void register() { ParticleFactoryRegistry.getInstance().register(GLOWING_SPHERE, ParticleGlowingSphere.FactoryGlowingSphere::new); ParticleFactoryRegistry.getInstance().register(PORTAL_SPHERE, PaticlePortalSphere.FactoryPortalSphere::new); @@ -48,15 +48,15 @@ public class EndParticles { ParticleFactoryRegistry.getInstance().register(FIREFLY, FireflyParticle.FireflyParticleFactory::new); ParticleFactoryRegistry.getInstance().register(SMARAGDANT, SmaragdantParticle.SmaragdantParticleFactory::new); } - + private static SimpleParticleType register(String name) { return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), FabricParticleTypes.simple()); } - + private static SimpleParticleType registerFar(String name) { return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), FabricParticleTypes.simple(true)); } - + private static ParticleType register(String name, ParticleType type) { return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), type); } diff --git a/src/main/java/ru/betterend/registry/EndPortals.java b/src/main/java/ru/betterend/registry/EndPortals.java index 221a7c63..f72ff29b 100644 --- a/src/main/java/ru/betterend/registry/EndPortals.java +++ b/src/main/java/ru/betterend/registry/EndPortals.java @@ -15,11 +15,11 @@ import ru.betterend.BetterEnd; import java.io.File; public class EndPortals { - + public final static ResourceLocation OVERWORLD_ID = Level.OVERWORLD.location(); - + private static PortalInfo[] portals; - + public static void loadPortals() { File file = new File(FabricLoader.getInstance().getConfigDir().toString(), "betterend/portals.json"); JsonObject json; @@ -43,25 +43,25 @@ public class EndPortals { portals[i] = new PortalInfo(array.get(i).getAsJsonObject()); } } - + public static int getCount() { return MHelper.max(portals.length - 1, 1); } - + public static ServerLevel getWorld(MinecraftServer server, int portalId) { if (portalId < 0 || portalId >= portals.length) { return server.overworld(); } return portals[portalId].getWorld(server); } - + public static ResourceLocation getWorldId(int portalId) { if (portalId < 0 || portalId >= portals.length) { return OVERWORLD_ID; } return portals[portalId].dimension; } - + public static int getPortalIdByItem(ResourceLocation item) { for (int i = 0; i < portals.length; i++) { if (portals[i].item.equals(item)) { @@ -70,7 +70,7 @@ public class EndPortals { } return 0; } - + public static int getPortalIdByWorld(ResourceLocation world) { for (int i = 0; i < portals.length; i++) { if (portals[i].dimension.equals(world)) { @@ -79,11 +79,11 @@ public class EndPortals { } return 0; } - + public static int getColor(int state) { return portals[state].color; } - + public static boolean isAvailableItem(ResourceLocation item) { for (PortalInfo portal : portals) { if (portal.item.equals(item)) { @@ -92,7 +92,7 @@ public class EndPortals { } return false; } - + private static JsonObject makeDefault(File file) { JsonObject jsonObject = new JsonObject(); JsonFactory.storeJson(file, jsonObject); @@ -102,33 +102,27 @@ public class EndPortals { JsonFactory.storeJson(file, jsonObject); return jsonObject; } - + private static PortalInfo makeDefault() { return new PortalInfo(new ResourceLocation("minecraft:overworld"), BetterEnd.makeID("eternal_crystal"), 255, 255, 255); } - + private static class PortalInfo { private final ResourceLocation dimension; private final ResourceLocation item; private final int color; private ServerLevel world; - + PortalInfo(JsonObject obj) { - this( - new ResourceLocation(JsonFactory.getString(obj, "dimension", "minecraft:overworld")), - new ResourceLocation(JsonFactory.getString(obj, "item", "betterend:eternal_crystal")), - JsonFactory.getInt(obj, "colorRed", 255), - JsonFactory.getInt(obj, "colorGreen", 255), - JsonFactory.getInt(obj, "colorBlue", 255) - ); + this(new ResourceLocation(JsonFactory.getString(obj, "dimension", "minecraft:overworld")), new ResourceLocation(JsonFactory.getString(obj, "item", "betterend:eternal_crystal")), JsonFactory.getInt(obj, "colorRed", 255), JsonFactory.getInt(obj, "colorGreen", 255), JsonFactory.getInt(obj, "colorBlue", 255)); } - + PortalInfo(ResourceLocation dimension, ResourceLocation item, int r, int g, int b) { this.dimension = dimension; this.item = item; this.color = ColorUtil.color(r, g, b); } - + ServerLevel getWorld(MinecraftServer server) { if (world != null) { return world; @@ -141,7 +135,7 @@ public class EndPortals { } return server.overworld(); } - + JsonObject toJson() { JsonObject obj = new JsonObject(); obj.addProperty("dimension", dimension.toString()); diff --git a/src/main/java/ru/betterend/registry/EndSounds.java b/src/main/java/ru/betterend/registry/EndSounds.java index 7e1c962e..d733db69 100644 --- a/src/main/java/ru/betterend/registry/EndSounds.java +++ b/src/main/java/ru/betterend/registry/EndSounds.java @@ -11,7 +11,7 @@ public class EndSounds { public static final SoundEvent MUSIC_DARK = register("music", "dark"); public static final SoundEvent MUSIC_OPENSPACE = register("music", "openspace"); public static final SoundEvent MUSIC_CAVES = register("music", "caves"); - + // Ambient public static final SoundEvent AMBIENT_FOGGY_MUSHROOMLAND = register("ambient", "foggy_mushroomland"); public static final SoundEvent AMBIENT_CHORUS_FOREST = register("ambient", "chorus_forest"); @@ -23,22 +23,23 @@ public class EndSounds { public static final SoundEvent AMBIENT_UMBRELLA_JUNGLE = register("ambient", "umbrella_jungle"); public static final SoundEvent AMBIENT_GLOWING_GRASSLANDS = register("ambient", "glowing_grasslands"); public static final SoundEvent AMBIENT_CAVES = register("ambient", "caves"); - + public static final SoundEvent AMBIENT_AMBER_LAND = register("ambient", "amber_land"); + // Entity public static final SoundEvent ENTITY_DRAGONFLY = register("entity", "dragonfly"); public static final SoundEvent ENTITY_SHADOW_WALKER = register("entity", "shadow_walker"); public static final SoundEvent ENTITY_SHADOW_WALKER_DAMAGE = register("entity", "shadow_walker_damage"); public static final SoundEvent ENTITY_SHADOW_WALKER_DEATH = register("entity", "shadow_walker_death"); - + // Records public static final SoundEvent RECORD_STRANGE_AND_ALIEN = register("record", "strange_and_alien"); public static final SoundEvent RECORD_GRASPING_AT_STARS = register("record", "grasping_at_stars"); public static final SoundEvent RECORD_ENDSEEKER = register("record", "endseeker"); public static final SoundEvent RECORD_EO_DRACONA = register("record", "eo_dracona"); - + public static void register() { } - + private static SoundEvent register(String type, String id) { id = "betterend." + type + "." + id; return Registry.register(Registry.SOUND_EVENT, id, new SoundEvent(BetterEnd.makeID(id))); diff --git a/src/main/java/ru/betterend/registry/EndStructures.java b/src/main/java/ru/betterend/registry/EndStructures.java index fbea7076..7ebc2fac 100644 --- a/src/main/java/ru/betterend/registry/EndStructures.java +++ b/src/main/java/ru/betterend/registry/EndStructures.java @@ -6,8 +6,8 @@ import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.levelgen.GenerationStep.Decoration; import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature; import net.minecraft.world.level.levelgen.feature.StructurePieceType; +import ru.bclib.world.structures.BCLStructureFeature; import ru.betterend.BetterEnd; -import ru.betterend.world.structures.EndStructureFeature; import ru.betterend.world.structures.features.EternalPortalStructure; import ru.betterend.world.structures.features.GiantIceStarStructure; import ru.betterend.world.structures.features.GiantMossyGlowshroomStructure; @@ -32,29 +32,29 @@ public class EndStructures { public static final StructurePieceType LAKE_PIECE = register("lake_piece", LakePiece::new); public static final StructurePieceType PAINTED_MOUNTAIN_PIECE = register("painted_mountain_piece", PaintedMountainPiece::new); public static final StructurePieceType NBT_PIECE = register("nbt_piece", NBTPiece::new); - - public static final EndStructureFeature GIANT_MOSSY_GLOWSHROOM = new EndStructureFeature("giant_mossy_glowshroom", new GiantMossyGlowshroomStructure(), Decoration.SURFACE_STRUCTURES, 16, 8); - public static final EndStructureFeature MEGALAKE = new EndStructureFeature("megalake", new MegaLakeStructure(), Decoration.RAW_GENERATION, 4, 1); - public static final EndStructureFeature MEGALAKE_SMALL = new EndStructureFeature("megalake_small", new MegaLakeSmallStructure(), Decoration.RAW_GENERATION, 4, 1); - public static final EndStructureFeature MOUNTAIN = new EndStructureFeature("mountain", new MountainStructure(), Decoration.RAW_GENERATION, 3, 2); - public static final EndStructureFeature PAINTED_MOUNTAIN = new EndStructureFeature("painted_mountain", new PaintedMountainStructure(), Decoration.RAW_GENERATION, 3, 2); - public static final EndStructureFeature ETERNAL_PORTAL = new EndStructureFeature("eternal_portal", new EternalPortalStructure(), Decoration.SURFACE_STRUCTURES, 16, 6); - public static final EndStructureFeature GIANT_ICE_STAR = new EndStructureFeature("giant_ice_star", new GiantIceStarStructure(), Decoration.SURFACE_STRUCTURES, 16, 8); - + + public static final BCLStructureFeature GIANT_MOSSY_GLOWSHROOM = new BCLStructureFeature(BetterEnd.makeID("giant_mossy_glowshroom"), new GiantMossyGlowshroomStructure(), Decoration.SURFACE_STRUCTURES, 16, 8); + public static final BCLStructureFeature MEGALAKE = new BCLStructureFeature(BetterEnd.makeID("megalake"), new MegaLakeStructure(), Decoration.RAW_GENERATION, 4, 1); + public static final BCLStructureFeature MEGALAKE_SMALL = new BCLStructureFeature(BetterEnd.makeID("megalake_small"), new MegaLakeSmallStructure(), Decoration.RAW_GENERATION, 4, 1); + public static final BCLStructureFeature MOUNTAIN = new BCLStructureFeature(BetterEnd.makeID("mountain"), new MountainStructure(), Decoration.RAW_GENERATION, 3, 2); + public static final BCLStructureFeature PAINTED_MOUNTAIN = new BCLStructureFeature(BetterEnd.makeID("painted_mountain"), new PaintedMountainStructure(), Decoration.RAW_GENERATION, 3, 2); + public static final BCLStructureFeature ETERNAL_PORTAL = new BCLStructureFeature(BetterEnd.makeID("eternal_portal"), new EternalPortalStructure(), Decoration.SURFACE_STRUCTURES, 16, 6); + public static final BCLStructureFeature GIANT_ICE_STAR = new BCLStructureFeature(BetterEnd.makeID("giant_ice_star"), new GiantIceStarStructure(), Decoration.SURFACE_STRUCTURES, 16, 8); + public static void register() { } - + private static StructurePieceType register(String id, StructurePieceType pieceType) { return Registry.register(Registry.STRUCTURE_PIECE, BetterEnd.makeID(id), pieceType); } - + public static void registerBiomeStructures(ResourceLocation id, Biome biome, Collection>> structures) { if (!id.getPath().contains("mountain") && !id.getPath().contains("lake")) { addStructure(ETERNAL_PORTAL, structures); } } - - private static void addStructure(EndStructureFeature feature, Collection>> structures) { + + private static void addStructure(BCLStructureFeature feature, Collection>> structures) { structures.add(() -> { return feature.getFeatureConfigured(); }); diff --git a/src/main/java/ru/betterend/registry/EndTags.java b/src/main/java/ru/betterend/registry/EndTags.java index 93bb51dc..27b6d08a 100644 --- a/src/main/java/ru/betterend/registry/EndTags.java +++ b/src/main/java/ru/betterend/registry/EndTags.java @@ -3,6 +3,8 @@ package ru.betterend.registry; import com.google.common.collect.Lists; import net.fabricmc.fabric.impl.tool.attribute.ToolManagerImpl; import net.fabricmc.fabric.impl.tool.attribute.handlers.ModdedToolsVanillaBlocksToolHandler; +import net.fabricmc.fabric.mixin.object.builder.AbstractBlockAccessor; +import net.fabricmc.fabric.mixin.object.builder.AbstractBlockSettingsAccessor; import net.minecraft.core.Registry; import net.minecraft.tags.BlockTags; import net.minecraft.tags.ItemTags; @@ -14,6 +16,7 @@ import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.Biome.BiomeCategory; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.LeavesBlock; +import net.minecraft.world.level.block.state.BlockBehaviour.Properties; import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderConfiguration; import net.minecraft.world.level.material.Material; import ru.bclib.api.BonemealAPI; @@ -32,21 +35,37 @@ import java.util.List; public class EndTags { // Table with common (c) tags: // https://fabricmc.net/wiki/tutorial:tags - + // Block Tags public static final Tag.Named PEDESTALS = TagAPI.makeBlockTag(BetterEnd.MOD_ID, "pedestal"); public static final Tag.Named END_STONES = TagAPI.makeCommonBlockTag("end_stones"); - + public static final Tag.Named ALLOYING_IRON = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_iron"); public static final Tag.Named ALLOYING_GOLD = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_gold"); public static final Tag.Named ALLOYING_COPPER = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_copper"); - + public static void register() { TagAPI.addEndGround(EndBlocks.THALLASIUM.ore); TagAPI.addEndGround(EndBlocks.ENDSTONE_DUST); TagAPI.addEndGround(EndBlocks.AMBER_ORE); - + EndBlocks.getModBlocks().forEach(block -> { + Properties properties = ((AbstractBlockAccessor) block).getSettings(); + Material material = ((AbstractBlockSettingsAccessor) properties).getMaterial(); + + if (material.equals(Material.STONE)) { + TagHelper.addTag(TagAPI.MINEABLE_PICKAXE, block); + } + else if (material.equals(Material.WOOD)) { + TagHelper.addTag(TagAPI.MINEABLE_AXE, block); + } + else if (material.equals(Material.LEAVES) || material.equals(Material.PLANT) || material.equals(Material.WATER_PLANT)) { + TagHelper.addTag(TagAPI.MINEABLE_HOE, block); + } + else if (material.equals(Material.SAND)) { + TagHelper.addTag(TagAPI.MINEABLE_HOE, block); + } + if (block instanceof EndTerrainBlock) { TagAPI.addEndGround(block); TagHelper.addTag(BlockTags.NYLIUM, block); @@ -62,7 +81,7 @@ public class EndTags { else if (block instanceof PedestalBlock) { TagHelper.addTag(PEDESTALS, block); } - + Material mat = block.defaultBlockState().getMaterial(); if (mat.equals(Material.PLANT) || mat.equals(Material.REPLACEABLE_PLANT)) { ComposterBlockAccessor.callAdd(0.1F, block); @@ -71,7 +90,7 @@ public class EndTags { TagAPI.addEndGround(EndBlocks.CAVE_MOSS); TagHelper.addTag(BlockTags.NYLIUM, EndBlocks.CAVE_MOSS); BonemealAPI.addSpreadableBlock(EndBlocks.CAVE_MOSS); - + List hammers = Lists.newArrayList(); EndItems.getModItems(BetterEnd.MOD_ID).forEach(item -> { if (item.isEdible()) { @@ -86,35 +105,21 @@ public class EndTags { } }); ToolManagerImpl.tag(TagAPI.HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(hammers)); - - TagHelper.addTag( - TagAPI.GEN_TERRAIN, - EndBlocks.ENDER_ORE, - EndBlocks.FLAVOLITE.stone, - EndBlocks.VIOLECITE.stone, - EndBlocks.SULPHURIC_ROCK.stone, - EndBlocks.BRIMSTONE, - EndBlocks.VIRID_JADESTONE.stone, - EndBlocks.AZURE_JADESTONE.stone, - EndBlocks.SANDY_JADESTONE.stone - ); + TagHelper.addTag(TagAPI.HAMMERS, EndItems.AETERNIUM_HAMMER); + + TagHelper.addTag(TagAPI.GEN_TERRAIN, EndBlocks.ENDER_ORE, EndBlocks.FLAVOLITE.stone, EndBlocks.VIOLECITE.stone, EndBlocks.SULPHURIC_ROCK.stone, EndBlocks.BRIMSTONE, EndBlocks.VIRID_JADESTONE.stone, EndBlocks.AZURE_JADESTONE.stone, EndBlocks.SANDY_JADESTONE.stone); TagHelper.addTag(TagAPI.END_GROUND, EndBlocks.SULPHURIC_ROCK.stone, EndBlocks.BRIMSTONE); TagHelper.addTag(BlockTags.ANVIL, EndBlocks.AETERNIUM_ANVIL); TagHelper.addTag(BlockTags.BEACON_BASE_BLOCKS, EndBlocks.AETERNIUM_BLOCK); TagHelper.addTag(ItemTags.BEACON_PAYMENT_ITEMS, EndItems.AETERNIUM_INGOT); - TagHelper.addTag(TagAPI.DRAGON_IMMUNE, - EndBlocks.ENDER_ORE, - EndBlocks.ETERNAL_PEDESTAL, - EndBlocks.FLAVOLITE_RUNED_ETERNAL, - EndBlocks.FLAVOLITE_RUNED - ); + TagHelper.addTag(TagAPI.DRAGON_IMMUNE, EndBlocks.ENDER_ORE, EndBlocks.ETERNAL_PEDESTAL, EndBlocks.FLAVOLITE_RUNED_ETERNAL, EndBlocks.FLAVOLITE_RUNED); TagHelper.addTag(TagAPI.IRON_INGOTS, EndBlocks.THALLASIUM.ingot); - + TagHelper.addTag(ALLOYING_IRON, Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON); TagHelper.addTag(ALLOYING_GOLD, Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD); TagHelper.addTag(ALLOYING_COPPER, Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER); } - + public static void addTerrainTags(Registry biomeRegistry) { biomeRegistry.forEach((biome) -> { if (biome.getBiomeCategory() == BiomeCategory.THEEND) { diff --git a/src/main/java/ru/betterend/rituals/EternalRitual.java b/src/main/java/ru/betterend/rituals/EternalRitual.java index 78586e7a..98cc3bee 100644 --- a/src/main/java/ru/betterend/rituals/EternalRitual.java +++ b/src/main/java/ru/betterend/rituals/EternalRitual.java @@ -45,61 +45,48 @@ import java.util.Set; import java.util.function.Predicate; public class EternalRitual { - private final static Set STRUCTURE_MAP = Sets.newHashSet( - new Point(-4, -5), new Point(-4, 5), new Point(-6, 0), - new Point(4, -5), new Point(4, 5), new Point(6, 0)); - private final static Set FRAME_MAP = Sets.newHashSet( - new Point(0, 0), new Point(0, 6), new Point(1, 0), - new Point(1, 6), new Point(2, 1), new Point(2, 5), - new Point(3, 2), new Point(3, 3), new Point(3, 4)); - private final static Set PORTAL_MAP = Sets.newHashSet( - new Point(0, 0), new Point(0, 1), new Point(0, 2), - new Point(0, 3), new Point(0, 4), new Point(1, 0), - new Point(1, 1), new Point(1, 2), new Point(1, 3), - new Point(1, 4), new Point(2, 1), new Point(2, 2), - new Point(2, 3)); - private final static Set BASE_MAP = Sets.newHashSet( - new Point(3, 0), new Point(2, 0), new Point(2, 1), new Point(1, 1), - new Point(1, 2), new Point(0, 1), new Point(0, 2)); - + private final static Set STRUCTURE_MAP = Sets.newHashSet(new Point(-4, -5), new Point(-4, 5), new Point(-6, 0), new Point(4, -5), new Point(4, 5), new Point(6, 0)); + private final static Set FRAME_MAP = Sets.newHashSet(new Point(0, 0), new Point(0, 6), new Point(1, 0), new Point(1, 6), new Point(2, 1), new Point(2, 5), new Point(3, 2), new Point(3, 3), new Point(3, 4)); + private final static Set PORTAL_MAP = Sets.newHashSet(new Point(0, 0), new Point(0, 1), new Point(0, 2), new Point(0, 3), new Point(0, 4), new Point(1, 0), new Point(1, 1), new Point(1, 2), new Point(1, 3), new Point(1, 4), new Point(2, 1), new Point(2, 2), new Point(2, 3)); + private final static Set BASE_MAP = Sets.newHashSet(new Point(3, 0), new Point(2, 0), new Point(2, 1), new Point(1, 1), new Point(1, 2), new Point(0, 1), new Point(0, 2)); + private final static Block BASE = EndBlocks.FLAVOLITE.tiles; private final static Block PEDESTAL = EndBlocks.ETERNAL_PEDESTAL; private final static Block FRAME = EndBlocks.FLAVOLITE_RUNED_ETERNAL; private final static Block PORTAL = EndBlocks.END_PORTAL_BLOCK; private final static BooleanProperty ACTIVE = BlockProperties.ACTIVE; - + public final static int SEARCH_RADIUS = calculateSearchSteps(48); - + private Level world; private Direction.Axis axis; private ResourceLocation targetWorldId; private BlockPos center; private BlockPos exit; private boolean active = false; - + public EternalRitual(Level world) { this.world = world; } - + public EternalRitual(Level world, BlockPos initial) { this(world); this.configure(initial); } - + public void setWorld(Level world) { this.world = world; } - + @Nullable public ResourceLocation getTargetWorldId() { return targetWorldId; } - + private boolean isInvalid() { - return world == null || world.isClientSide() || - center == null || axis == null; + return world == null || world.isClientSide() || center == null || axis == null; } - + public void checkStructure() { if (isInvalid()) return; Direction moveX, moveY; @@ -134,7 +121,7 @@ public class EternalRitual { activatePortal(item); } } - + private boolean checkFrame(Level world, BlockPos framePos) { Direction moveDir = Direction.Axis.X == axis ? Direction.NORTH : Direction.EAST; boolean valid = true; @@ -148,11 +135,11 @@ public class EternalRitual { } return valid; } - + public boolean isActive() { return active; } - + private void activatePortal(Item keyItem) { if (active) return; ResourceLocation itemId = Registry.ITEM.getKey(keyItem); @@ -184,12 +171,12 @@ public class EternalRitual { active = false; } } - + private void initPortal(ResourceLocation worldId, int portalId) { targetWorldId = worldId; exit = findPortalPos(portalId); } - + private void doEffects(ServerLevel serverWorld, BlockPos center) { Direction moveX, moveY; if (Direction.Axis.X == axis) { @@ -208,7 +195,7 @@ public class EternalRitual { } serverWorld.playSound(null, center, SoundEvents.END_PORTAL_SPAWN, SoundSource.NEUTRAL, 16, 1); } - + private void activatePortal(Level world, BlockPos center, int portalId) { BlockPos framePos = center.below(); Direction moveDir = Direction.Axis.X == axis ? Direction.NORTH : Direction.EAST; @@ -229,7 +216,7 @@ public class EternalRitual { BlockState portal = PORTAL.defaultBlockState().setValue(EndPortalBlock.AXIS, portalAxis).setValue(EndPortalBlock.PORTAL, portalId); ParticleOptions effect = new BlockParticleOption(ParticleTypes.BLOCK, portal); ServerLevel serverWorld = (ServerLevel) world; - + PORTAL_MAP.forEach(point -> { BlockPos pos = center.mutable().move(moveDir, point.x).move(Direction.UP, point.y); if (!world.getBlockState(pos).is(PORTAL)) { @@ -245,13 +232,13 @@ public class EternalRitual { } }); } - + public void disablePortal(int state) { if (!active || isInvalid()) return; removePortal(getTargetWorld(state), exit); removePortal(world, center); } - + private void removePortal(Level world, BlockPos center) { BlockPos framePos = center.below(); Direction moveDir = Direction.Axis.X == axis ? Direction.NORTH : Direction.EAST; @@ -279,11 +266,10 @@ public class EternalRitual { }); this.active = false; } - + @Nullable private BlockPos findFrame(Level world, BlockPos.MutableBlockPos startPos) { - List foundPos = findAllBlockPos(world, startPos, (SEARCH_RADIUS >> 4) + 1, FRAME, - blockState -> blockState.is(FRAME) && !blockState.getValue(ACTIVE)); + List foundPos = findAllBlockPos(world, startPos, (SEARCH_RADIUS >> 4) + 1, FRAME, blockState -> blockState.is(FRAME) && !blockState.getValue(ACTIVE)); for (BlockPos.MutableBlockPos testPos : foundPos) { if (checkFrame(world, testPos)) { return testPos; @@ -291,7 +277,7 @@ public class EternalRitual { } return null; } - + private BlockPos findPortalPos(int portalId) { MinecraftServer server = world.getServer(); ServerLevel targetWorld = (ServerLevel) getTargetWorld(portalId); @@ -344,20 +330,20 @@ public class EternalRitual { generatePortal(targetWorld, basePos, portalAxis, portalId); return basePos.immutable(); } - + private Level getTargetWorld(int state) { if (world.dimension() == Level.END) { return EndPortals.getWorld(world.getServer(), state); } return Objects.requireNonNull(world.getServer()).getLevel(Level.END); } - + private boolean checkIsAreaValid(Level world, BlockPos pos, Direction.Axis axis) { if (pos.getY() >= world.getHeight() - 1) return false; if (!isBaseValid(world, pos, axis)) return false; return EternalRitual.checkArea(world, pos, axis); } - + private boolean isBaseValid(Level world, BlockPos pos, Direction.Axis axis) { boolean solid = true; if (axis.equals(Direction.Axis.X)) { @@ -378,11 +364,11 @@ public class EternalRitual { } return solid; } - + private boolean validBlock(Level world, BlockPos pos, BlockState state) { return state.isRedstoneConductor(world, pos) && state.isCollisionShapeFullBlock(world, pos); } - + public void configure(BlockPos initial) { BlockPos checkPos = initial.east(12); if (this.hasPedestal(checkPos)) { @@ -456,11 +442,11 @@ public class EternalRitual { } } } - + private boolean hasPedestal(BlockPos pos) { return world.getBlockState(pos).is(PEDESTAL); } - + private boolean isActive(BlockPos pos) { BlockState state = world.getBlockState(pos); if (state.is(PEDESTAL)) { @@ -480,7 +466,7 @@ public class EternalRitual { } return false; } - + public CompoundTag toTag(CompoundTag tag) { tag.put("center", NbtUtils.writeBlockPos(center)); tag.putString("axis", axis.getName()); @@ -493,7 +479,7 @@ public class EternalRitual { } return tag; } - + public void fromTag(CompoundTag tag) { axis = Direction.Axis.byName(tag.getString("axis")); center = NbtUtils.readBlockPos(tag.getCompound("center")); @@ -505,17 +491,15 @@ public class EternalRitual { targetWorldId = new ResourceLocation(tag.getString("key_item")); } } - + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; EternalRitual ritual = (EternalRitual) o; - return world.equals(ritual.world) && - Objects.equals(center, ritual.center) && - Objects.equals(exit, ritual.exit); + return world.equals(ritual.world) && Objects.equals(center, ritual.center) && Objects.equals(exit, ritual.exit); } - + public static void generatePortal(Level world, BlockPos center, Direction.Axis axis, int portalId) { BlockPos framePos = center.below(); Direction moveDir = Direction.Axis.X == axis ? Direction.EAST : Direction.NORTH; @@ -535,7 +519,7 @@ public class EternalRitual { }); generateBase(world, framePos, moveDir); } - + private static void generateBase(Level world, BlockPos center, Direction moveX) { BlockState base = BASE.defaultBlockState(); Direction moveY = moveX.getClockWise(); @@ -550,7 +534,7 @@ public class EternalRitual { world.setBlockAndUpdate(pos, base); }); } - + public static boolean checkArea(Level world, BlockPos center, Direction.Axis axis) { Direction moveDir = Direction.Axis.X == axis ? Direction.NORTH : Direction.EAST; for (BlockPos checkPos : BlockPos.betweenClosed(center.relative(moveDir.getClockWise()), center.relative(moveDir.getCounterClockWise()))) { @@ -565,13 +549,13 @@ public class EternalRitual { } return true; } - + private static boolean isStateInvalid(BlockState state) { if (!state.getFluidState().isEmpty()) return true; Material material = state.getMaterial(); return !material.isReplaceable() && !material.equals(Material.PLANT); } - + /** * @param world World for search * @param checkPos Start search position @@ -610,7 +594,7 @@ public class EternalRitual { } return null; } - + /** * @param world World for search * @param checkPos Start search position @@ -649,7 +633,7 @@ public class EternalRitual { } return posFound; } - + public static int calculateSearchSteps(int radius) { return radius * 4 - 1; } diff --git a/src/main/java/ru/betterend/rituals/InfusionRitual.java b/src/main/java/ru/betterend/rituals/InfusionRitual.java index 45acdb5d..4043fc3a 100644 --- a/src/main/java/ru/betterend/rituals/InfusionRitual.java +++ b/src/main/java/ru/betterend/rituals/InfusionRitual.java @@ -20,17 +20,8 @@ import java.util.Arrays; import java.util.Objects; public class InfusionRitual implements Container { - private static final Point[] PEDESTALS_MAP = new Point[]{ - new Point(0, 3), - new Point(2, 2), - new Point(3, 0), - new Point(2, -2), - new Point(0, -3), - new Point(-2, -2), - new Point(-3, 0), - new Point(-2, 2) - }; - + private static final Point[] PEDESTALS_MAP = new Point[]{new Point(0, 3), new Point(2, 2), new Point(3, 0), new Point(2, -2), new Point(0, -3), new Point(-2, -2), new Point(-3, 0), new Point(-2, 2)}; + private Level world; private BlockPos worldPos; private InfusionRecipe activeRecipe; @@ -38,17 +29,17 @@ public class InfusionRitual implements Container { private boolean hasRecipe = false; private int progress = 0; private int time = 0; - + private final PedestalBlockEntity[] catalysts = new PedestalBlockEntity[8]; private final InfusionPedestalEntity input; - + public InfusionRitual(InfusionPedestalEntity pedestal, Level world, BlockPos pos) { this.input = pedestal; this.world = world; this.worldPos = pos; configure(); } - + public void configure() { if (world == null || worldPos == null || world.isClientSide) return; for (int i = 0; i < catalysts.length; i++) { @@ -63,7 +54,7 @@ public class InfusionRitual implements Container { } } } - + public boolean checkRecipe() { if (!isValid()) return false; InfusionRecipe recipe = world.getRecipeManager().getRecipeFor(InfusionRecipe.TYPE, this, world).orElse(null); @@ -83,26 +74,26 @@ public class InfusionRitual implements Container { } return false; } - + private void updateRecipe(InfusionRecipe recipe) { activeRecipe = recipe; hasRecipe = true; resetTimer(); setChanged(); } - + private void resetTimer() { time = activeRecipe != null ? activeRecipe.getInfusionTime() : 0; progress = 0; } - + public void reset() { activeRecipe = null; hasRecipe = false; resetTimer(); setChanged(); } - + public void tick() { if (isDirty) { configure(); @@ -132,46 +123,46 @@ public class InfusionRitual implements Container { } } } - + } - + @Override public boolean canPlaceItem(int slot, ItemStack stack) { return isValid(); } - + public boolean isValid() { if (world == null || world.isClientSide || worldPos == null || input == null) return false; return Arrays.stream(catalysts).noneMatch(Objects::isNull); } - + public boolean hasRecipe() { return hasRecipe; } - + public void setLocation(Level world, BlockPos pos) { this.world = world; this.worldPos = pos; this.isDirty = true; } - + @Override public void clearContent() { if (!isValid()) return; input.clearContent(); Arrays.stream(catalysts).forEach(PedestalBlockEntity::clearContent); } - + @Override public int getContainerSize() { return 9; } - + @Override public boolean isEmpty() { return false; } - + @Override public ItemStack getItem(int slot) { if (slot > 8) return ItemStack.EMPTY; @@ -182,12 +173,12 @@ public class InfusionRitual implements Container { return catalysts[slot - 1].getItem(0); } } - + @Override public ItemStack removeItem(int slot, int amount) { return removeItemNoUpdate(slot); } - + @Override public ItemStack removeItemNoUpdate(int slot) { if (slot > 8) return ItemStack.EMPTY; @@ -198,7 +189,7 @@ public class InfusionRitual implements Container { return catalysts[slot - 1].removeItemNoUpdate(0); } } - + @Override public void setItem(int slot, ItemStack stack) { if (slot > 8) return; @@ -209,7 +200,7 @@ public class InfusionRitual implements Container { catalysts[slot - 1].setItem(0, stack); } } - + @Override public void setChanged() { if (isValid()) { @@ -217,16 +208,16 @@ public class InfusionRitual implements Container { Arrays.stream(catalysts).forEach(PedestalBlockEntity::setChanged); } } - + public void markDirty() { this.isDirty = true; } - + @Override public boolean stillValid(Player player) { return true; } - + public void fromTag(CompoundTag tag) { if (tag.contains("recipe")) { hasRecipe = tag.getBoolean("recipe"); @@ -234,7 +225,7 @@ public class InfusionRitual implements Container { time = tag.getInt("time"); } } - + public CompoundTag toTag(CompoundTag tag) { if (hasRecipe()) { tag.putBoolean("recipe", hasRecipe); @@ -243,7 +234,7 @@ public class InfusionRitual implements Container { } return tag; } - + public static Point[] getMap() { return PEDESTALS_MAP; } diff --git a/src/main/java/ru/betterend/tab/CreativeTabs.java b/src/main/java/ru/betterend/tab/CreativeTabs.java index a42bc34c..2ac6cea8 100644 --- a/src/main/java/ru/betterend/tab/CreativeTabs.java +++ b/src/main/java/ru/betterend/tab/CreativeTabs.java @@ -3,6 +3,7 @@ package ru.betterend.tab; import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.ItemStack; +import ru.bclib.items.BaseAnvilItem; import ru.betterend.BetterEnd; import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndItems; @@ -12,17 +13,13 @@ import java.util.stream.Collectors; public class CreativeTabs { public static final CreativeModeTab TAB_BLOCKS; public static final CreativeModeTab TAB_ITEMS; - + static { - TAB_BLOCKS = FabricItemGroupBuilder.create(BetterEnd.makeID("end_blocks")) - .icon(() -> new ItemStack(EndBlocks.END_MYCELIUM)).appendItems(stacks -> { - stacks.addAll(EndBlocks.getModBlocks().stream() - .map(ItemStack::new).collect(Collectors.toList())); - }).build(); - TAB_ITEMS = FabricItemGroupBuilder.create(BetterEnd.makeID("end_items")) - .icon(() -> new ItemStack(EndItems.ETERNAL_CRYSTAL)).appendItems(stacks -> { - stacks.addAll(EndItems.getModItems().stream() - .map(ItemStack::new).collect(Collectors.toList())); - }).build(); + TAB_BLOCKS = FabricItemGroupBuilder.create(BetterEnd.makeID("end_blocks")).icon(() -> new ItemStack(EndBlocks.END_MYCELIUM)).appendItems(stacks -> { + stacks.addAll(EndBlocks.getModBlocks().stream().map(ItemStack::new).collect(Collectors.toList())); + }).build(); + TAB_ITEMS = FabricItemGroupBuilder.create(BetterEnd.makeID("end_items")).icon(() -> new ItemStack(EndItems.ETERNAL_CRYSTAL)).appendItems(stacks -> { + stacks.addAll(EndItems.getModItems().stream().map(ItemStack::new).collect(Collectors.toList())); + }).build(); } } diff --git a/src/main/java/ru/betterend/util/BlockFixer.java b/src/main/java/ru/betterend/util/BlockFixer.java index 53bded10..aba30ef3 100644 --- a/src/main/java/ru/betterend/util/BlockFixer.java +++ b/src/main/java/ru/betterend/util/BlockFixer.java @@ -22,7 +22,7 @@ import java.util.stream.IntStream; public class BlockFixer { private static final BlockState AIR = Blocks.AIR.defaultBlockState(); private static final BlockState WATER = Blocks.WATER.defaultBlockState(); - + public static void fixBlocks(LevelAccessor world, BlockPos start, BlockPos end) { Set doubleCheck = Sets.newConcurrentHashSet(); int dx = end.getX() - start.getX() + 1; @@ -36,7 +36,7 @@ public class BlockFixer { for (int y = start.getY(); y <= end.getY(); y++) { POS.setY(y); state = world.getBlockState(POS); - + if (state.getBlock() instanceof FurBlock) { doubleCheck.add(POS.immutable()); } @@ -109,7 +109,7 @@ public class BlockFixer { Set ends = Sets.newHashSet(); Set add = Sets.newHashSet(); ends.add(POS.immutable()); - + for (int i = 0; i < 64 && !ends.isEmpty(); i++) { ends.forEach((pos) -> { setWithoutUpdate(world, pos, AIR); @@ -141,10 +141,10 @@ public class BlockFixer { // Falling blocks else if (state.getBlock() instanceof FallingBlock) { BlockState falling = state; - + POS.setY(POS.getY() - 1); state = world.getBlockState(POS); - + int ray = BlocksHelper.downRayRep(world, POS.immutable(), 64); if (ray > 32) { setWithoutUpdate(world, POS, Blocks.END_STONE.defaultBlockState()); @@ -193,18 +193,18 @@ public class BlockFixer { } } }); - + doubleCheck.forEach((pos) -> { if (!world.getBlockState(pos).canSurvive(world, pos)) { setWithoutUpdate(world, pos, AIR); } }); } - + private static BlockState getAirOrFluid(BlockState state) { return state.getFluidState().isEmpty() ? AIR : state.getFluidState().createLegacyBlock(); } - + private static void setWithoutUpdate(LevelAccessor world, BlockPos pos, BlockState state) { synchronized (world) { BlocksHelper.setWithoutUpdate(world, pos, state); diff --git a/src/main/java/ru/betterend/util/BonemealPlants.java b/src/main/java/ru/betterend/util/BonemealPlants.java index e0a9befb..b2a5cdf6 100644 --- a/src/main/java/ru/betterend/util/BonemealPlants.java +++ b/src/main/java/ru/betterend/util/BonemealPlants.java @@ -10,46 +10,46 @@ public class BonemealPlants { BonemealAPI.addLandGrass(EndBlocks.UMBRELLA_MOSS, EndBlocks.END_MOSS); BonemealAPI.addLandGrass(EndBlocks.CREEPING_MOSS, EndBlocks.END_MYCELIUM); BonemealAPI.addLandGrass(EndBlocks.UMBRELLA_MOSS, EndBlocks.END_MYCELIUM); - + BonemealAPI.addLandGrass(EndBlocks.CAVE_GRASS, EndBlocks.CAVE_MOSS); BonemealAPI.addLandGrass(EndBlocks.CHORUS_GRASS, EndBlocks.CHORUS_NYLIUM); BonemealAPI.addLandGrass(EndBlocks.CRYSTAL_GRASS, EndBlocks.CRYSTAL_MOSS); BonemealAPI.addLandGrass(EndBlocks.SHADOW_PLANT, EndBlocks.SHADOW_GRASS); BonemealAPI.addLandGrass(EndBlocks.BUSHY_GRASS, EndBlocks.PINK_MOSS); BonemealAPI.addLandGrass(EndBlocks.AMBER_GRASS, EndBlocks.AMBER_MOSS); - + BonemealAPI.addLandGrass(EndBlocks.JUNGLE_GRASS, EndBlocks.JUNGLE_MOSS); BonemealAPI.addLandGrass(EndBlocks.TWISTED_UMBRELLA_MOSS, EndBlocks.JUNGLE_MOSS); BonemealAPI.addLandGrass(EndBlocks.JUNGLE_MOSS, EndBlocks.SMALL_JELLYSHROOM, 0.1F); - + BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.BLOOMING_COOKSONIA, EndBlocks.END_MOSS); BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.VAIOLUSH_FERN, EndBlocks.END_MOSS); BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.FRACTURN, EndBlocks.END_MOSS); BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.SALTEAGO, EndBlocks.END_MOSS); - + BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.END_MOSS, EndBlocks.CREEPING_MOSS, 0.1F); BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.END_MOSS, EndBlocks.UMBRELLA_MOSS, 0.1F); BonemealAPI.addLandGrass(EndBiomes.GLOWING_GRASSLANDS.getID(), EndBlocks.END_MOSS, EndBlocks.TWISTED_UMBRELLA_MOSS, 0.1F); - + BonemealAPI.addLandGrass(EndBlocks.ORANGO, EndBlocks.RUTISCUS); BonemealAPI.addLandGrass(EndBlocks.RUTISCUS, EndBlocks.AERIDIUM, 0.2F); BonemealAPI.addLandGrass(EndBlocks.RUTISCUS, EndBlocks.LUTEBUS, 0.2F); BonemealAPI.addLandGrass(EndBlocks.RUTISCUS, EndBlocks.LAMELLARIUM); - + BonemealAPI.addLandGrass(EndBiomes.LANTERN_WOODS.getID(), EndBlocks.RUTISCUS, EndBlocks.AERIDIUM, 0.2F); BonemealAPI.addLandGrass(EndBiomes.LANTERN_WOODS.getID(), EndBlocks.LAMELLARIUM, EndBlocks.RUTISCUS); BonemealAPI.addLandGrass(EndBiomes.LANTERN_WOODS.getID(), EndBlocks.RUTISCUS, EndBlocks.BOLUX_MUSHROOM, 0.05F); - + BonemealAPI.addLandGrass(EndBlocks.GLOBULAGUS, EndBlocks.SANGNUM, EndBlocks.MOSSY_OBSIDIAN, EndBlocks.MOSSY_DRAGON_BONE); BonemealAPI.addLandGrass(EndBlocks.CLAWFERN, EndBlocks.SANGNUM, EndBlocks.MOSSY_OBSIDIAN, EndBlocks.MOSSY_DRAGON_BONE); BonemealAPI.addLandGrass(EndBlocks.SANGNUM, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F); BonemealAPI.addLandGrass(EndBlocks.MOSSY_OBSIDIAN, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F); BonemealAPI.addLandGrass(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F); - + BonemealAPI.addLandGrass(EndBlocks.GLOBULAGUS, EndBlocks.MOSSY_DRAGON_BONE); BonemealAPI.addLandGrass(EndBlocks.CLAWFERN, EndBlocks.MOSSY_DRAGON_BONE); BonemealAPI.addLandGrass(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F); - + BonemealAPI.addLandGrass(EndBlocks.GLOBULAGUS, EndBlocks.MOSSY_OBSIDIAN); BonemealAPI.addLandGrass(EndBlocks.CLAWFERN, EndBlocks.MOSSY_OBSIDIAN); BonemealAPI.addLandGrass(EndBlocks.MOSSY_OBSIDIAN, EndBlocks.SMALL_AMARANITA_MUSHROOM, 0.1F); diff --git a/src/main/java/ru/betterend/util/FeaturesHelper.java b/src/main/java/ru/betterend/util/FeaturesHelper.java index c14bdce8..22bfeb96 100644 --- a/src/main/java/ru/betterend/util/FeaturesHelper.java +++ b/src/main/java/ru/betterend/util/FeaturesHelper.java @@ -17,7 +17,7 @@ import java.util.function.Supplier; public class FeaturesHelper { private static final Set INJECTED = Sets.newHashSet(); - + public static void addFeatures(Registry biomeRegistry) { biomeRegistry.forEach((biome) -> { if (biome.getBiomeCategory() == Biome.BiomeCategory.THEEND && !INJECTED.contains(biome)) { @@ -28,10 +28,10 @@ public class FeaturesHelper { preFeatures.forEach((list) -> { features.add(Lists.newArrayList(list)); }); - + EndFeatures.registerBiomeFeatures(biomeRegistry.getKey(biome), biome, features); EndStructures.registerBiomeStructures(biomeRegistry.getKey(biome), biome, structures); - + accessor.be_setFeatures(features); accessor.be_setStructures(structures); INJECTED.add(biome); diff --git a/src/main/java/ru/betterend/util/ItemUtil.java b/src/main/java/ru/betterend/util/ItemUtil.java index c6c9bba1..c96484b5 100644 --- a/src/main/java/ru/betterend/util/ItemUtil.java +++ b/src/main/java/ru/betterend/util/ItemUtil.java @@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable; import ru.betterend.BetterEnd; public class ItemUtil { - + public static String toStackString(@NotNull ItemStack stack) { try { if (stack == null) { @@ -25,7 +25,7 @@ public class ItemUtil { } return ""; } - + @Nullable public static ItemStack fromStackString(String stackString) { if (stackString == null || stackString.equals("")) { @@ -52,7 +52,7 @@ public class ItemUtil { } return null; } - + @Nullable public static ItemStack fromJsonRecipe(JsonObject recipe) { try { diff --git a/src/main/java/ru/betterend/util/LangUtil.java b/src/main/java/ru/betterend/util/LangUtil.java index 534022c0..bc051bf8 100644 --- a/src/main/java/ru/betterend/util/LangUtil.java +++ b/src/main/java/ru/betterend/util/LangUtil.java @@ -5,33 +5,33 @@ import net.minecraft.network.chat.TranslatableComponent; public class LangUtil { public final static String CONFIG_ELEMENT = "configuration"; - + private String element; - + public LangUtil(String element) { this.element = element; } - + public void setElement(String key) { this.element = key; } - + public String getString(String key) { return getString(element, key); } - + public TranslatableComponent getText(String key) { return getText(element, key); } - + public static String translate(String key) { return I18n.get(key); } - + public static String getString(String element, String key) { return translate(String.format("%s.%s", element, key)); } - + public static TranslatableComponent getText(String element, String key) { return new TranslatableComponent(getString(element, key)); } diff --git a/src/main/java/ru/betterend/util/LootTableUtil.java b/src/main/java/ru/betterend/util/LootTableUtil.java index dab4cac4..02015f80 100644 --- a/src/main/java/ru/betterend/util/LootTableUtil.java +++ b/src/main/java/ru/betterend/util/LootTableUtil.java @@ -11,7 +11,7 @@ import ru.betterend.registry.EndItems; public class LootTableUtil { private static final ResourceLocation END_CITY_TREASURE_ID = new ResourceLocation("chests/end_city_treasure"); - + public static void init() { LootTableLoadingCallback.EVENT.register((resourceManager, lootManager, id, supplier, setter) -> { if (END_CITY_TREASURE_ID.equals(id)) { @@ -20,7 +20,7 @@ public class LootTableUtil { builder.withCondition(LootItemRandomChanceCondition.randomChance(0.5f).build()); builder.withEntry(LootItem.lootTableItem(Items.GHAST_TEAR).build()); supplier.withPool(builder); - + builder = FabricLootPoolBuilder.builder(); builder.setRolls(UniformGenerator.between(0, 5)); builder.withCondition(LootItemRandomChanceCondition.randomChance(0.1f).build()); diff --git a/src/main/java/ru/betterend/util/RecipeHelper.java b/src/main/java/ru/betterend/util/RecipeHelper.java index 78c393e0..51df7f6e 100644 --- a/src/main/java/ru/betterend/util/RecipeHelper.java +++ b/src/main/java/ru/betterend/util/RecipeHelper.java @@ -13,7 +13,7 @@ public class RecipeHelper { return Registry.ITEM.getKey(item.asItem()) != Registry.ITEM.getDefaultKey(); } } - + public static boolean exists(ItemLike... items) { for (ItemLike item : items) { if (!exists(item)) { diff --git a/src/main/java/ru/betterend/util/ShuffelingListExtended.java b/src/main/java/ru/betterend/util/ShuffelingListExtended.java index a86ee5bf..5d4f15fd 100644 --- a/src/main/java/ru/betterend/util/ShuffelingListExtended.java +++ b/src/main/java/ru/betterend/util/ShuffelingListExtended.java @@ -2,6 +2,6 @@ package ru.betterend.util; public interface ShuffelingListExtended { public boolean isEmpty(); - + public U getOne(); } diff --git a/src/main/java/ru/betterend/util/SpawnHelper.java b/src/main/java/ru/betterend/util/SpawnHelper.java index 4aefd2eb..e42a688a 100644 --- a/src/main/java/ru/betterend/util/SpawnHelper.java +++ b/src/main/java/ru/betterend/util/SpawnHelper.java @@ -11,11 +11,11 @@ public class SpawnHelper { public static void restrictionAir(EntityType entity, SpawnPredicate predicate) { SpawnRestrictionAccessor.callRegister(entity, Type.NO_RESTRICTIONS, Types.MOTION_BLOCKING, predicate); } - + public static void restrictionLand(EntityType entity, SpawnPredicate predicate) { SpawnRestrictionAccessor.callRegister(entity, Type.ON_GROUND, Types.MOTION_BLOCKING, predicate); } - + public static void restrictionWater(EntityType entity, SpawnPredicate predicate) { SpawnRestrictionAccessor.callRegister(entity, Type.IN_WATER, Types.MOTION_BLOCKING, predicate); } diff --git a/src/main/java/ru/betterend/world/biome/EndBiome.java b/src/main/java/ru/betterend/world/biome/EndBiome.java index 8dd4a44d..3284188d 100644 --- a/src/main/java/ru/betterend/world/biome/EndBiome.java +++ b/src/main/java/ru/betterend/world/biome/EndBiome.java @@ -10,14 +10,14 @@ import ru.betterend.registry.EndFeatures; public class EndBiome extends BCLBiome { public EndBiome(BCLBiomeDef def) { super(updateDef(def)); - + } - + public EndBiome(ResourceLocation id, Biome biome, float fogDensity, float genChance, boolean hasCaves) { super(id, biome, fogDensity, genChance); this.addCustomData("has_caves", hasCaves); } - + private static BCLBiomeDef updateDef(BCLBiomeDef def) { def.loadConfigValues(Configs.BIOME_CONFIG); EndFeatures.addDefaultFeatures(def); diff --git a/src/main/java/ru/betterend/world/biome/air/BiomeIceStarfield.java b/src/main/java/ru/betterend/world/biome/air/BiomeIceStarfield.java index ac5109ee..86c0dde2 100644 --- a/src/main/java/ru/betterend/world/biome/air/BiomeIceStarfield.java +++ b/src/main/java/ru/betterend/world/biome/air/BiomeIceStarfield.java @@ -10,17 +10,6 @@ import ru.betterend.world.biome.EndBiome; public class BiomeIceStarfield extends EndBiome { public BiomeIceStarfield() { - super(new BCLBiomeDef(BetterEnd.makeID("ice_starfield")) - .addCustomData("has_caves", false) - .addStructureFeature(EndStructures.GIANT_ICE_STAR.getFeatureConfigured()) - .setFogColor(224, 245, 254) - .setTemperature(0F) - .setFogDensity(2.2F) - .setFoliageColor(193, 244, 244) - .setGenChance(0.25F) - .setParticles(EndParticles.SNOWFLAKE, 0.002F) - .addFeature(EndFeatures.ICE_STAR) - .addFeature(EndFeatures.ICE_STAR_SMALL) - .addMobSpawn(EntityType.ENDERMAN, 20, 1, 4)); + super(new BCLBiomeDef(BetterEnd.makeID("ice_starfield")).addCustomData("has_caves", false).addStructureFeature(EndStructures.GIANT_ICE_STAR.getFeatureConfigured()).setFogColor(224, 245, 254).setTemperature(0F).setFogDensity(2.2F).setFoliageColor(193, 244, 244).setGenChance(0.25F).setParticles(EndParticles.SNOWFLAKE, 0.002F).addFeature(EndFeatures.ICE_STAR).addFeature(EndFeatures.ICE_STAR_SMALL).addMobSpawn(EntityType.ENDERMAN, 20, 1, 4)); } } diff --git a/src/main/java/ru/betterend/world/biome/cave/EmptyAuroraCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/EmptyAuroraCaveBiome.java index fcec0818..1ed7ef16 100644 --- a/src/main/java/ru/betterend/world/biome/cave/EmptyAuroraCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/EmptyAuroraCaveBiome.java @@ -7,23 +7,18 @@ import ru.betterend.registry.EndParticles; public class EmptyAuroraCaveBiome extends EndCaveBiome { public EmptyAuroraCaveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("empty_aurora_cave")) - .setFogColor(150, 30, 68) - .setFogDensity(2.0F) - .setPlantsColor(108, 25, 46) - .setWaterAndFogColor(186, 77, 237) - .setParticles(EndParticles.GLOWING_SPHERE, 0.001F)); - + super(new BCLBiomeDef(BetterEnd.makeID("empty_aurora_cave")).setFogColor(150, 30, 68).setFogDensity(2.0F).setPlantsColor(108, 25, 46).setWaterAndFogColor(186, 77, 237).setParticles(EndParticles.GLOWING_SPHERE, 0.001F)); + this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1); - + this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1); } - + @Override public float getFloorDensity() { return 0.01F; } - + @Override public float getCeilDensity() { return 0.1F; diff --git a/src/main/java/ru/betterend/world/biome/cave/EmptyEndCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/EmptyEndCaveBiome.java index c88e10e3..151e7475 100644 --- a/src/main/java/ru/betterend/world/biome/cave/EmptyEndCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/EmptyEndCaveBiome.java @@ -10,12 +10,12 @@ public class EmptyEndCaveBiome extends EndCaveBiome { this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE, 1); this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1); } - + @Override public float getFloorDensity() { return 0.1F; } - + @Override public float getCeilDensity() { return 0.1F; diff --git a/src/main/java/ru/betterend/world/biome/cave/EmptySmaragdantCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/EmptySmaragdantCaveBiome.java index 4924dacc..15330771 100644 --- a/src/main/java/ru/betterend/world/biome/cave/EmptySmaragdantCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/EmptySmaragdantCaveBiome.java @@ -7,24 +7,19 @@ import ru.betterend.registry.EndParticles; public class EmptySmaragdantCaveBiome extends EndCaveBiome { public EmptySmaragdantCaveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("empty_smaragdant_cave")) - .setFogColor(0, 253, 182) - .setFogDensity(2.0F) - .setPlantsColor(0, 131, 145) - .setWaterAndFogColor(31, 167, 212) - .setParticles(EndParticles.SMARAGDANT, 0.001F)); - + super(new BCLBiomeDef(BetterEnd.makeID("empty_smaragdant_cave")).setFogColor(0, 253, 182).setFogDensity(2.0F).setPlantsColor(0, 131, 145).setWaterAndFogColor(31, 167, 212).setParticles(EndParticles.SMARAGDANT, 0.001F)); + this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20); - + this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1); } - + @Override public float getFloorDensity() { return 0.1F; } - + @Override public float getCeilDensity() { return 0.1F; diff --git a/src/main/java/ru/betterend/world/biome/cave/EndCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/EndCaveBiome.java index 27464e46..8ccd3283 100644 --- a/src/main/java/ru/betterend/world/biome/cave/EndCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/EndCaveBiome.java @@ -17,50 +17,47 @@ import ru.betterend.world.features.terrain.caves.CaveChunkPopulatorFeature; public class EndCaveBiome extends EndBiome { final private ShufflingList> floorFeatures = new ShufflingList<>(); final private ShufflingList> ceilFeatures = new ShufflingList<>(); - + public EndCaveBiome(BCLBiomeDef definition) { super(makeDef(definition)); } - + private static BCLBiomeDef makeDef(BCLBiomeDef definition) { - BCLFeature feature = BCLFeature.makeChunkFeature( - BetterEnd.makeID(definition.getID().getPath() + "_cave_populator"), - new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(definition.getID())) - ); + BCLFeature feature = BCLFeature.makeChunkFeature(BetterEnd.makeID(definition.getID().getPath() + "_cave_populator"), new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(definition.getID()))); definition.setCategory(BiomeCategory.NONE).addFeature(feature); definition.setMusic(EndSounds.MUSIC_CAVES); definition.setLoop(EndSounds.AMBIENT_CAVES); return definition; } - + public void addFloorFeature(Feature feature, int weight) { floorFeatures.add(feature, weight); } - + public void addCeilFeature(Feature feature, int weight) { ceilFeatures.add(feature, weight); } - + public Feature getFloorFeature() { return ((ShuffelingListExtended>) floorFeatures).isEmpty() ? null : ((ShuffelingListExtended>) floorFeatures).getOne(); } - + public Feature getCeilFeature() { return ((ShuffelingListExtended>) ceilFeatures).isEmpty() ? null : ((ShuffelingListExtended>) ceilFeatures).getOne(); } - + public float getFloorDensity() { return 0; } - + public float getCeilDensity() { return 0; } - + public BlockState getCeil(BlockPos pos) { return null; } - + public BlockState getWall(BlockPos pos) { return null; } diff --git a/src/main/java/ru/betterend/world/biome/cave/JadeCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/JadeCaveBiome.java index 19252607..05f34321 100644 --- a/src/main/java/ru/betterend/world/biome/cave/JadeCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/JadeCaveBiome.java @@ -12,18 +12,14 @@ public class JadeCaveBiome extends EndCaveBiome { private static final OpenSimplexNoise WALL_NOISE = new OpenSimplexNoise("jade_cave".hashCode()); private static final OpenSimplexNoise DEPTH_NOISE = new OpenSimplexNoise("depth_noise".hashCode()); private static final BlockState[] JADE = new BlockState[3]; - + public JadeCaveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("jade_cave")) - .setFogColor(118, 150, 112) - .setFogDensity(2.0F) - .setWaterAndFogColor(95, 223, 255) - ); + super(new BCLBiomeDef(BetterEnd.makeID("jade_cave")).setFogColor(118, 150, 112).setFogDensity(2.0F).setWaterAndFogColor(95, 223, 255)); JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState(); JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState(); JADE[2] = EndBlocks.SANDY_JADESTONE.stone.defaultBlockState(); } - + @Override public BlockState getWall(BlockPos pos) { double depth = DEPTH_NOISE.eval(pos.getX() * 0.02, pos.getZ() * 0.02) * 0.2 + 0.5; diff --git a/src/main/java/ru/betterend/world/biome/cave/LushAuroraCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/LushAuroraCaveBiome.java index 547d9ee2..053c7938 100644 --- a/src/main/java/ru/betterend/world/biome/cave/LushAuroraCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/LushAuroraCaveBiome.java @@ -11,36 +11,30 @@ import ru.betterend.registry.EndParticles; public class LushAuroraCaveBiome extends EndCaveBiome { public LushAuroraCaveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("lush_aurora_cave")) - .setFogColor(150, 30, 68) - .setFogDensity(2.0F) - .setPlantsColor(108, 25, 46) - .setWaterAndFogColor(186, 77, 237) - .setParticles(EndParticles.GLOWING_SPHERE, 0.001F) - .setSurface(EndBlocks.CAVE_MOSS)); - + super(new BCLBiomeDef(BetterEnd.makeID("lush_aurora_cave")).setFogColor(150, 30, 68).setFogDensity(2.0F).setPlantsColor(108, 25, 46).setWaterAndFogColor(186, 77, 237).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).setSurface(EndBlocks.CAVE_MOSS)); + this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1); this.addFloorFeature(EndFeatures.CAVE_BUSH, 5); this.addFloorFeature(EndFeatures.CAVE_GRASS, 40); this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE_CAVEMOSS, 5); - + this.addCeilFeature(EndFeatures.CAVE_BUSH, 1); this.addCeilFeature(EndFeatures.CAVE_PUMPKIN, 1); this.addCeilFeature(EndFeatures.RUBINEA, 3); this.addCeilFeature(EndFeatures.MAGNULA, 1); this.addCeilFeature(EndFeatures.END_STONE_STALACTITE_CAVEMOSS, 10); } - + @Override public float getFloorDensity() { return 0.2F; } - + @Override public float getCeilDensity() { return 0.1F; } - + @Override public BlockState getCeil(BlockPos pos) { return EndBlocks.CAVE_MOSS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP); diff --git a/src/main/java/ru/betterend/world/biome/cave/LushSmaragdantCaveBiome.java b/src/main/java/ru/betterend/world/biome/cave/LushSmaragdantCaveBiome.java index e91b4861..fa7b3ab3 100644 --- a/src/main/java/ru/betterend/world/biome/cave/LushSmaragdantCaveBiome.java +++ b/src/main/java/ru/betterend/world/biome/cave/LushSmaragdantCaveBiome.java @@ -8,25 +8,19 @@ import ru.betterend.registry.EndParticles; public class LushSmaragdantCaveBiome extends EndCaveBiome { public LushSmaragdantCaveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("lush_smaragdant_cave")) - .setFogColor(0, 253, 182) - .setFogDensity(2.0F) - .setPlantsColor(0, 131, 145) - .setWaterAndFogColor(31, 167, 212) - .setParticles(EndParticles.SMARAGDANT, 0.001F) - .setSurface(EndBlocks.CAVE_MOSS)); - + super(new BCLBiomeDef(BetterEnd.makeID("lush_smaragdant_cave")).setFogColor(0, 253, 182).setFogDensity(2.0F).setPlantsColor(0, 131, 145).setWaterAndFogColor(31, 167, 212).setParticles(EndParticles.SMARAGDANT, 0.001F).setSurface(EndBlocks.CAVE_MOSS)); + this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20); - + this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1); } - + @Override public float getFloorDensity() { return 0.1F; } - + @Override public float getCeilDensity() { return 0.1F; diff --git a/src/main/java/ru/betterend/world/biome/land/AmberLandBiome.java b/src/main/java/ru/betterend/world/biome/land/AmberLandBiome.java index 63032057..a1e984df 100644 --- a/src/main/java/ru/betterend/world/biome/land/AmberLandBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/AmberLandBiome.java @@ -13,27 +13,6 @@ import ru.betterend.world.biome.EndBiome; public class AmberLandBiome extends EndBiome { public AmberLandBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("amber_land")) - .setFogColor(255, 184, 71) - .setFogDensity(2.0F) - .setPlantsColor(219, 115, 38) - .setWaterAndFogColor(145, 108, 72) - .setMusic(EndSounds.MUSIC_FOREST) - .setParticles(EndParticles.AMBER_SPHERE, 0.001F) - .setSurface(EndBlocks.AMBER_MOSS) - .addFeature(EndFeatures.AMBER_ORE) - .addFeature(EndFeatures.END_LAKE_RARE) - .addFeature(EndFeatures.HELIX_TREE) - .addFeature(EndFeatures.LANCELEAF) - .addFeature(EndFeatures.GLOW_PILLAR) - .addFeature(EndFeatures.AMBER_GRASS) - .addFeature(EndFeatures.AMBER_ROOT) - .addFeature(EndFeatures.BULB_MOSS) - .addFeature(EndFeatures.BULB_MOSS_WOOD) - .addFeature(EndFeatures.CHARNIA_ORANGE) - .addFeature(EndFeatures.CHARNIA_RED) - .addStructureFeature(StructureFeatures.END_CITY) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 4) - .addMobSpawn(EndEntities.END_SLIME, 30, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("amber_land")).setFogColor(255, 184, 71).setFogDensity(2.0F).setPlantsColor(219, 115, 38).setWaterAndFogColor(145, 108, 72).setMusic(EndSounds.MUSIC_FOREST).setLoop(EndSounds.AMBIENT_AMBER_LAND).setParticles(EndParticles.AMBER_SPHERE, 0.001F).setSurface(EndBlocks.AMBER_MOSS).addFeature(EndFeatures.AMBER_ORE).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.HELIX_TREE).addFeature(EndFeatures.LANCELEAF).addFeature(EndFeatures.GLOW_PILLAR).addFeature(EndFeatures.AMBER_GRASS).addFeature(EndFeatures.AMBER_ROOT).addFeature(EndFeatures.BULB_MOSS).addFeature(EndFeatures.BULB_MOSS_WOOD).addFeature(EndFeatures.CHARNIA_ORANGE).addFeature(EndFeatures.CHARNIA_RED).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4).addMobSpawn(EndEntities.END_SLIME, 30, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/BlossomingSpiresBiome.java b/src/main/java/ru/betterend/world/biome/land/BlossomingSpiresBiome.java index 46e0c3a8..8eaaf0fe 100644 --- a/src/main/java/ru/betterend/world/biome/land/BlossomingSpiresBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/BlossomingSpiresBiome.java @@ -11,26 +11,6 @@ import ru.betterend.world.biome.EndBiome; public class BlossomingSpiresBiome extends EndBiome { public BlossomingSpiresBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("blossoming_spires")) - .addCustomData("has_caves", false) - .setFogColor(241, 146, 229) - .setFogDensity(1.7F) - .setPlantsColor(122, 45, 122) - .setSurface(EndBlocks.PINK_MOSS) - .setMusic(EndSounds.MUSIC_FOREST) - .setLoop(EndSounds.AMBIENT_BLOSSOMING_SPIRES) - .addFeature(EndFeatures.SPIRE) - .addFeature(EndFeatures.FLOATING_SPIRE) - .addFeature(EndFeatures.TENANEA) - .addFeature(EndFeatures.TENANEA_BUSH) - .addFeature(EndFeatures.BULB_VINE) - .addFeature(EndFeatures.BUSHY_GRASS) - .addFeature(EndFeatures.BUSHY_GRASS_WG) - .addFeature(EndFeatures.BLOSSOM_BERRY) - .addFeature(EndFeatures.TWISTED_MOSS) - .addFeature(EndFeatures.TWISTED_MOSS_WOOD) - .addFeature(EndFeatures.SILK_MOTH_NEST) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 4) - .addMobSpawn(EndEntities.SILK_MOTH, 5, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("blossoming_spires")).addCustomData("has_caves", false).setFogColor(241, 146, 229).setFogDensity(1.7F).setPlantsColor(122, 45, 122).setSurface(EndBlocks.PINK_MOSS).setMusic(EndSounds.MUSIC_FOREST).setLoop(EndSounds.AMBIENT_BLOSSOMING_SPIRES).addFeature(EndFeatures.SPIRE).addFeature(EndFeatures.FLOATING_SPIRE).addFeature(EndFeatures.TENANEA).addFeature(EndFeatures.TENANEA_BUSH).addFeature(EndFeatures.BULB_VINE).addFeature(EndFeatures.BUSHY_GRASS).addFeature(EndFeatures.BUSHY_GRASS_WG).addFeature(EndFeatures.BLOSSOM_BERRY).addFeature(EndFeatures.TWISTED_MOSS).addFeature(EndFeatures.TWISTED_MOSS_WOOD).addFeature(EndFeatures.SILK_MOTH_NEST).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4).addMobSpawn(EndEntities.SILK_MOTH, 5, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/ChorusForestBiome.java b/src/main/java/ru/betterend/world/biome/land/ChorusForestBiome.java index 5a2024cc..1fef31e2 100644 --- a/src/main/java/ru/betterend/world/biome/land/ChorusForestBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/ChorusForestBiome.java @@ -15,30 +15,6 @@ import ru.betterend.world.biome.EndBiome; public class ChorusForestBiome extends EndBiome { public ChorusForestBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("chorus_forest")) - .setFogColor(87, 26, 87) - .setFogDensity(1.5F) - .setPlantsColor(122, 45, 122) - .setWaterAndFogColor(73, 30, 73) - .setSurface(EndBlocks.CHORUS_NYLIUM) - .setParticles(ParticleTypes.PORTAL, 0.01F) - .setLoop(EndSounds.AMBIENT_CHORUS_FOREST) - .setMusic(EndSounds.MUSIC_DARK) - .addFeature(EndFeatures.VIOLECITE_LAYER) - .addFeature(EndFeatures.END_LAKE_RARE) - .addFeature(EndFeatures.PYTHADENDRON_TREE) - .addFeature(EndFeatures.PYTHADENDRON_BUSH) - .addFeature(EndFeatures.PURPLE_POLYPORE) - .addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT) - .addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT) - .addFeature(EndFeatures.CHORUS_GRASS) - .addFeature(EndFeatures.CHORUS_MUSHROOM) - .addFeature(EndFeatures.TAIL_MOSS) - .addFeature(EndFeatures.TAIL_MOSS_WOOD) - .addFeature(EndFeatures.CHARNIA_PURPLE) - .addFeature(EndFeatures.CHARNIA_RED_RARE) - .addStructureFeature(StructureFeatures.END_CITY) - .addMobSpawn(EndEntities.END_SLIME, 5, 1, 2) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); + super(new BCLBiomeDef(BetterEnd.makeID("chorus_forest")).setFogColor(87, 26, 87).setFogDensity(1.5F).setPlantsColor(122, 45, 122).setWaterAndFogColor(73, 30, 73).setSurface(EndBlocks.CHORUS_NYLIUM).setParticles(ParticleTypes.PORTAL, 0.01F).setLoop(EndSounds.AMBIENT_CHORUS_FOREST).setMusic(EndSounds.MUSIC_DARK).addFeature(EndFeatures.VIOLECITE_LAYER).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.PYTHADENDRON_TREE).addFeature(EndFeatures.PYTHADENDRON_BUSH).addFeature(EndFeatures.PURPLE_POLYPORE).addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT).addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT).addFeature(EndFeatures.CHORUS_GRASS).addFeature(EndFeatures.CHORUS_MUSHROOM).addFeature(EndFeatures.TAIL_MOSS).addFeature(EndFeatures.TAIL_MOSS_WOOD).addFeature(EndFeatures.CHARNIA_PURPLE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EndEntities.END_SLIME, 5, 1, 2).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/CrystalMountainsBiome.java b/src/main/java/ru/betterend/world/biome/land/CrystalMountainsBiome.java index bbdbfc9e..d4f57290 100644 --- a/src/main/java/ru/betterend/world/biome/land/CrystalMountainsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/CrystalMountainsBiome.java @@ -11,13 +11,6 @@ import ru.betterend.world.biome.EndBiome; public class CrystalMountainsBiome extends EndBiome { public CrystalMountainsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("crystal_mountains")) - .addStructureFeature(EndStructures.MOUNTAIN.getFeatureConfigured()) - .setPlantsColor(255, 133, 211) - .setSurface(EndBlocks.CRYSTAL_MOSS) - .setMusic(EndSounds.MUSIC_OPENSPACE) - .addFeature(EndFeatures.ROUND_CAVE) - .addFeature(EndFeatures.CRYSTAL_GRASS) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("crystal_mountains")).addStructureFeature(EndStructures.MOUNTAIN.getFeatureConfigured()).setPlantsColor(255, 133, 211).setSurface(EndBlocks.CRYSTAL_MOSS).setMusic(EndSounds.MUSIC_OPENSPACE).addFeature(EndFeatures.ROUND_CAVE).addFeature(EndFeatures.CRYSTAL_GRASS).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/DragonGraveyardsBiome.java b/src/main/java/ru/betterend/world/biome/land/DragonGraveyardsBiome.java index 57e1fc00..e02302a0 100644 --- a/src/main/java/ru/betterend/world/biome/land/DragonGraveyardsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/DragonGraveyardsBiome.java @@ -11,24 +11,6 @@ import ru.betterend.world.biome.EndBiome; public class DragonGraveyardsBiome extends EndBiome { public DragonGraveyardsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("dragon_graveyards")) - .setGenChance(0.1F) - .setFogColor(244, 46, 79) - .setFogDensity(1.3F) - .setParticles(EndParticles.FIREFLY, 0.0007F) - .setMusic(EndSounds.MUSIC_OPENSPACE) - .setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS) - .setSurface(EndBlocks.SANGNUM) - .setWaterAndFogColor(203, 59, 167) - .setPlantsColor(244, 46, 79) - .addFeature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT) - .addFeature(EndFeatures.FALLEN_PILLAR) - .addFeature(EndFeatures.OBSIDIAN_BOULDER) - .addFeature(EndFeatures.GIGANTIC_AMARANITA) - .addFeature(EndFeatures.LARGE_AMARANITA) - .addFeature(EndFeatures.SMALL_AMARANITA) - .addFeature(EndFeatures.GLOBULAGUS) - .addFeature(EndFeatures.CLAWFERN) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("dragon_graveyards")).setGenChance(0.1F).setFogColor(244, 46, 79).setFogDensity(1.3F).setParticles(EndParticles.FIREFLY, 0.0007F).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS).setSurface(EndBlocks.SANGNUM).setWaterAndFogColor(203, 59, 167).setPlantsColor(244, 46, 79).addFeature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT).addFeature(EndFeatures.FALLEN_PILLAR).addFeature(EndFeatures.OBSIDIAN_BOULDER).addFeature(EndFeatures.GIGANTIC_AMARANITA).addFeature(EndFeatures.LARGE_AMARANITA).addFeature(EndFeatures.SMALL_AMARANITA).addFeature(EndFeatures.GLOBULAGUS).addFeature(EndFeatures.CLAWFERN).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/DryShrublandBiome.java b/src/main/java/ru/betterend/world/biome/land/DryShrublandBiome.java index 6d78ad1a..8f3955e8 100644 --- a/src/main/java/ru/betterend/world/biome/land/DryShrublandBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/DryShrublandBiome.java @@ -11,19 +11,6 @@ import ru.betterend.world.biome.EndBiome; public class DryShrublandBiome extends EndBiome { public DryShrublandBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("dry_shrubland")) - .setFogColor(132, 35, 13) - .setFogDensity(1.2F) - .setWaterAndFogColor(113, 88, 53) - .setPlantsColor(237, 122, 66) - .setSurface(EndBlocks.RUTISCUS) - .setMusic(EndSounds.MUSIC_OPENSPACE) - .addFeature(EndFeatures.LUCERNIA_BUSH_RARE) - .addFeature(EndFeatures.ORANGO) - .addFeature(EndFeatures.AERIDIUM) - .addFeature(EndFeatures.LUTEBUS) - .addFeature(EndFeatures.LAMELLARIUM) - .addStructureFeature(StructureFeatures.END_CITY) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("dry_shrubland")).setFogColor(132, 35, 13).setFogDensity(1.2F).setWaterAndFogColor(113, 88, 53).setPlantsColor(237, 122, 66).setSurface(EndBlocks.RUTISCUS).setMusic(EndSounds.MUSIC_OPENSPACE).addFeature(EndFeatures.LUCERNIA_BUSH_RARE).addFeature(EndFeatures.ORANGO).addFeature(EndFeatures.AERIDIUM).addFeature(EndFeatures.LUTEBUS).addFeature(EndFeatures.LAMELLARIUM).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/DustWastelandsBiome.java b/src/main/java/ru/betterend/world/biome/land/DustWastelandsBiome.java index e13be0f7..50724299 100644 --- a/src/main/java/ru/betterend/world/biome/land/DustWastelandsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/DustWastelandsBiome.java @@ -11,16 +11,6 @@ import ru.betterend.world.biome.EndBiome; public class DustWastelandsBiome extends EndBiome { public DustWastelandsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("dust_wastelands")) - .setFogColor(226, 239, 168) - .setFogDensity(2) - .setWaterAndFogColor(192, 180, 131) - .setSurface(EndBlocks.ENDSTONE_DUST) - .setDepth(1.5F) - .setParticles(ParticleTypes.WHITE_ASH, 0.01F) - .setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) - .setMusic(EndSounds.MUSIC_OPENSPACE) - .addStructureFeature(StructureFeatures.END_CITY) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("dust_wastelands")).setFogColor(226, 239, 168).setFogDensity(2).setWaterAndFogColor(192, 180, 131).setSurface(EndBlocks.ENDSTONE_DUST).setDepth(1.5F).setParticles(ParticleTypes.WHITE_ASH, 0.01F).setLoop(EndSounds.AMBIENT_DUST_WASTELANDS).setMusic(EndSounds.MUSIC_OPENSPACE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/FoggyMushroomlandBiome.java b/src/main/java/ru/betterend/world/biome/land/FoggyMushroomlandBiome.java index 3896e6a6..4e608789 100644 --- a/src/main/java/ru/betterend/world/biome/land/FoggyMushroomlandBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/FoggyMushroomlandBiome.java @@ -14,35 +14,8 @@ import ru.betterend.world.biome.EndBiome; public class FoggyMushroomlandBiome extends EndBiome { public FoggyMushroomlandBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("foggy_mushroomland")) - .addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM.getFeatureConfigured()) - .setPlantsColor(73, 210, 209) - .setFogColor(41, 122, 173) - .setFogDensity(3) - .setWaterAndFogColor(119, 227, 250) - .setSurface(EndBlocks.END_MOSS, EndBlocks.END_MYCELIUM) - .setParticles(EndParticles.GLOWING_SPHERE, 0.001F) - .setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND) - .setMusic(EndSounds.MUSIC_FOREST) - .addFeature(EndFeatures.END_LAKE) - .addFeature(EndFeatures.MOSSY_GLOWSHROOM) - .addFeature(EndFeatures.BLUE_VINE) - .addFeature(EndFeatures.UMBRELLA_MOSS) - .addFeature(EndFeatures.CREEPING_MOSS) - .addFeature(EndFeatures.DENSE_VINE) - //.addFeature(EndFeatures.PEARLBERRY) - .addFeature(EndFeatures.CYAN_MOSS) - .addFeature(EndFeatures.CYAN_MOSS_WOOD) - .addFeature(EndFeatures.END_LILY) - .addFeature(EndFeatures.BUBBLE_CORAL) - .addFeature(EndFeatures.CHARNIA_CYAN) - .addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) - .addFeature(EndFeatures.CHARNIA_RED_RARE) - .addStructureFeature(StructureFeatures.END_CITY) - .addMobSpawn(EndEntities.DRAGONFLY, 80, 2, 5) - .addMobSpawn(EndEntities.END_FISH, 20, 2, 5) - .addMobSpawn(EndEntities.CUBOZOA, 10, 3, 8) - .addMobSpawn(EndEntities.END_SLIME, 10, 1, 2) - .addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("foggy_mushroomland")).addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM.getFeatureConfigured()).setPlantsColor(73, 210, 209).setFogColor(41, 122, 173).setFogDensity(3).setWaterAndFogColor(119, 227, 250).setSurface(EndBlocks.END_MOSS, EndBlocks.END_MYCELIUM).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND).setMusic(EndSounds.MUSIC_FOREST).addFeature(EndFeatures.END_LAKE).addFeature(EndFeatures.MOSSY_GLOWSHROOM).addFeature(EndFeatures.BLUE_VINE).addFeature(EndFeatures.UMBRELLA_MOSS).addFeature(EndFeatures.CREEPING_MOSS).addFeature(EndFeatures.DENSE_VINE) + //.addFeature(EndFeatures.PEARLBERRY) + .addFeature(EndFeatures.CYAN_MOSS).addFeature(EndFeatures.CYAN_MOSS_WOOD).addFeature(EndFeatures.END_LILY).addFeature(EndFeatures.BUBBLE_CORAL).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EndEntities.DRAGONFLY, 80, 2, 5).addMobSpawn(EndEntities.END_FISH, 20, 2, 5).addMobSpawn(EndEntities.CUBOZOA, 10, 3, 8).addMobSpawn(EndEntities.END_SLIME, 10, 1, 2).addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/GlowingGrasslandsBiome.java b/src/main/java/ru/betterend/world/biome/land/GlowingGrasslandsBiome.java index 5435e994..eafb5f8d 100644 --- a/src/main/java/ru/betterend/world/biome/land/GlowingGrasslandsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/GlowingGrasslandsBiome.java @@ -12,29 +12,6 @@ import ru.betterend.world.biome.EndBiome; public class GlowingGrasslandsBiome extends EndBiome { public GlowingGrasslandsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("glowing_grasslands")) - .setFogColor(99, 228, 247) - .setFogDensity(1.3F) - .setParticles(EndParticles.FIREFLY, 0.001F) - .setMusic(EndSounds.MUSIC_OPENSPACE) - .setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS) - .setSurface(EndBlocks.END_MOSS) - .setWaterAndFogColor(92, 250, 230) - .setPlantsColor(73, 210, 209) - .addFeature(EndFeatures.END_LAKE_RARE) - .addFeature(EndFeatures.LUMECORN) - .addFeature(EndFeatures.BLOOMING_COOKSONIA) - .addFeature(EndFeatures.SALTEAGO) - .addFeature(EndFeatures.VAIOLUSH_FERN) - .addFeature(EndFeatures.FRACTURN) - .addFeature(EndFeatures.UMBRELLA_MOSS_RARE) - .addFeature(EndFeatures.CREEPING_MOSS_RARE) - .addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE) - .addFeature(EndFeatures.CHARNIA_CYAN) - .addFeature(EndFeatures.CHARNIA_GREEN) - .addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) - .addFeature(EndFeatures.CHARNIA_RED_RARE) - .addStructureFeature(StructureFeatures.END_CITY) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("glowing_grasslands")).setFogColor(99, 228, 247).setFogDensity(1.3F).setParticles(EndParticles.FIREFLY, 0.001F).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS).setSurface(EndBlocks.END_MOSS).setWaterAndFogColor(92, 250, 230).setPlantsColor(73, 210, 209).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.LUMECORN).addFeature(EndFeatures.BLOOMING_COOKSONIA).addFeature(EndFeatures.SALTEAGO).addFeature(EndFeatures.VAIOLUSH_FERN).addFeature(EndFeatures.FRACTURN).addFeature(EndFeatures.UMBRELLA_MOSS_RARE).addFeature(EndFeatures.CREEPING_MOSS_RARE).addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/LanternWoodsBiome.java b/src/main/java/ru/betterend/world/biome/land/LanternWoodsBiome.java index a7954a63..7f131d13 100644 --- a/src/main/java/ru/betterend/world/biome/land/LanternWoodsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/LanternWoodsBiome.java @@ -12,29 +12,6 @@ import ru.betterend.world.biome.EndBiome; public class LanternWoodsBiome extends EndBiome { public LanternWoodsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("lantern_woods")) - .setFogColor(189, 82, 70) - .setFogDensity(1.1F) - .setWaterAndFogColor(171, 234, 226) - .setPlantsColor(254, 85, 57) - .setSurface(EndBlocks.RUTISCUS) - .setMusic(EndSounds.MUSIC_FOREST) - .setParticles(EndParticles.GLOWING_SPHERE, 0.001F) - .addFeature(EndFeatures.END_LAKE_NORMAL) - .addFeature(EndFeatures.FLAMAEA) - .addFeature(EndFeatures.LUCERNIA) - .addFeature(EndFeatures.LUCERNIA_BUSH) - .addFeature(EndFeatures.FILALUX) - .addFeature(EndFeatures.AERIDIUM) - .addFeature(EndFeatures.LAMELLARIUM) - .addFeature(EndFeatures.BOLUX_MUSHROOM) - .addFeature(EndFeatures.AURANT_POLYPORE) - .addFeature(EndFeatures.POND_ANEMONE) - .addFeature(EndFeatures.CHARNIA_ORANGE) - .addFeature(EndFeatures.CHARNIA_RED) - .addFeature(EndFeatures.RUSCUS) - .addFeature(EndFeatures.RUSCUS_WOOD) - .addStructureFeature(StructureFeatures.END_CITY) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("lantern_woods")).setFogColor(189, 82, 70).setFogDensity(1.1F).setWaterAndFogColor(171, 234, 226).setPlantsColor(254, 85, 57).setSurface(EndBlocks.RUTISCUS).setMusic(EndSounds.MUSIC_FOREST).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).addFeature(EndFeatures.END_LAKE_NORMAL).addFeature(EndFeatures.FLAMAEA).addFeature(EndFeatures.LUCERNIA).addFeature(EndFeatures.LUCERNIA_BUSH).addFeature(EndFeatures.FILALUX).addFeature(EndFeatures.AERIDIUM).addFeature(EndFeatures.LAMELLARIUM).addFeature(EndFeatures.BOLUX_MUSHROOM).addFeature(EndFeatures.AURANT_POLYPORE).addFeature(EndFeatures.POND_ANEMONE).addFeature(EndFeatures.CHARNIA_ORANGE).addFeature(EndFeatures.CHARNIA_RED).addFeature(EndFeatures.RUSCUS).addFeature(EndFeatures.RUSCUS_WOOD).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/MegalakeBiome.java b/src/main/java/ru/betterend/world/biome/land/MegalakeBiome.java index 7a42bccd..dceecceb 100644 --- a/src/main/java/ru/betterend/world/biome/land/MegalakeBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/MegalakeBiome.java @@ -12,31 +12,8 @@ import ru.betterend.world.biome.EndBiome; public class MegalakeBiome extends EndBiome { public MegalakeBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("megalake")) - .addStructureFeature(EndStructures.MEGALAKE.getFeatureConfigured()) - .setPlantsColor(73, 210, 209) - .setFogColor(178, 209, 248) - .setWaterAndFogColor(96, 163, 255) - .setFogDensity(1.75F) - .setMusic(EndSounds.MUSIC_WATER) - .setLoop(EndSounds.AMBIENT_MEGALAKE) - .setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST) - .setDepth(0F) - .addFeature(EndFeatures.END_LOTUS) - .addFeature(EndFeatures.END_LOTUS_LEAF) - .addFeature(EndFeatures.BUBBLE_CORAL_RARE) - .addFeature(EndFeatures.END_LILY_RARE) - .addFeature(EndFeatures.UMBRELLA_MOSS) - .addFeature(EndFeatures.CREEPING_MOSS) - //.addFeature(EndFeatures.PEARLBERRY) - .addFeature(EndFeatures.CHARNIA_CYAN) - .addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) - .addFeature(EndFeatures.CHARNIA_RED_RARE) - .addFeature(EndFeatures.MENGER_SPONGE) - .addMobSpawn(EndEntities.DRAGONFLY, 50, 1, 3) - .addMobSpawn(EndEntities.END_FISH, 50, 3, 8) - .addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8) - .addMobSpawn(EndEntities.END_SLIME, 5, 1, 2) - .addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("megalake")).addStructureFeature(EndStructures.MEGALAKE.getFeatureConfigured()).setPlantsColor(73, 210, 209).setFogColor(178, 209, 248).setWaterAndFogColor(96, 163, 255).setFogDensity(1.75F).setMusic(EndSounds.MUSIC_WATER).setLoop(EndSounds.AMBIENT_MEGALAKE).setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST).setDepth(0F).addFeature(EndFeatures.END_LOTUS).addFeature(EndFeatures.END_LOTUS_LEAF).addFeature(EndFeatures.BUBBLE_CORAL_RARE).addFeature(EndFeatures.END_LILY_RARE).addFeature(EndFeatures.UMBRELLA_MOSS).addFeature(EndFeatures.CREEPING_MOSS) + //.addFeature(EndFeatures.PEARLBERRY) + .addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addFeature(EndFeatures.MENGER_SPONGE).addMobSpawn(EndEntities.DRAGONFLY, 50, 1, 3).addMobSpawn(EndEntities.END_FISH, 50, 3, 8).addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8).addMobSpawn(EndEntities.END_SLIME, 5, 1, 2).addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/MegalakeGroveBiome.java b/src/main/java/ru/betterend/world/biome/land/MegalakeGroveBiome.java index a5e16704..af0b1747 100644 --- a/src/main/java/ru/betterend/world/biome/land/MegalakeGroveBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/MegalakeGroveBiome.java @@ -13,33 +13,8 @@ import ru.betterend.world.biome.EndBiome; public class MegalakeGroveBiome extends EndBiome { public MegalakeGroveBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("megalake_grove")) - .addStructureFeature(EndStructures.MEGALAKE_SMALL.getFeatureConfigured()) - .setPlantsColor(73, 210, 209) - .setFogColor(178, 209, 248) - .setWaterAndFogColor(96, 163, 255) - .setFogDensity(2.0F) - .setParticles(EndParticles.GLOWING_SPHERE, 0.001F) - .setMusic(EndSounds.MUSIC_WATER) - .setLoop(EndSounds.AMBIENT_MEGALAKE_GROVE) - .setSurface(EndBlocks.END_MOSS) - .setDepth(0F) - .addFeature(EndFeatures.LACUGROVE) - .addFeature(EndFeatures.END_LOTUS) - .addFeature(EndFeatures.END_LOTUS_LEAF) - .addFeature(EndFeatures.BUBBLE_CORAL_RARE) - .addFeature(EndFeatures.END_LILY_RARE) - .addFeature(EndFeatures.UMBRELLA_MOSS) - //.addFeature(EndFeatures.PEARLBERRY) - .addFeature(EndFeatures.CREEPING_MOSS) - .addFeature(EndFeatures.CHARNIA_CYAN) - .addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) - .addFeature(EndFeatures.CHARNIA_RED_RARE) - .addFeature(EndFeatures.MENGER_SPONGE) - .addMobSpawn(EndEntities.DRAGONFLY, 20, 1, 3) - .addMobSpawn(EndEntities.END_FISH, 20, 3, 8) - .addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8) - .addMobSpawn(EndEntities.END_SLIME, 5, 1, 2) - .addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("megalake_grove")).addStructureFeature(EndStructures.MEGALAKE_SMALL.getFeatureConfigured()).setPlantsColor(73, 210, 209).setFogColor(178, 209, 248).setWaterAndFogColor(96, 163, 255).setFogDensity(2.0F).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).setMusic(EndSounds.MUSIC_WATER).setLoop(EndSounds.AMBIENT_MEGALAKE_GROVE).setSurface(EndBlocks.END_MOSS).setDepth(0F).addFeature(EndFeatures.LACUGROVE).addFeature(EndFeatures.END_LOTUS).addFeature(EndFeatures.END_LOTUS_LEAF).addFeature(EndFeatures.BUBBLE_CORAL_RARE).addFeature(EndFeatures.END_LILY_RARE).addFeature(EndFeatures.UMBRELLA_MOSS) + //.addFeature(EndFeatures.PEARLBERRY) + .addFeature(EndFeatures.CREEPING_MOSS).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addFeature(EndFeatures.MENGER_SPONGE).addMobSpawn(EndEntities.DRAGONFLY, 20, 1, 3).addMobSpawn(EndEntities.END_FISH, 20, 3, 8).addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8).addMobSpawn(EndEntities.END_SLIME, 5, 1, 2).addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/NeonOasisBiome.java b/src/main/java/ru/betterend/world/biome/land/NeonOasisBiome.java index 3d2619b1..d3269e79 100644 --- a/src/main/java/ru/betterend/world/biome/land/NeonOasisBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/NeonOasisBiome.java @@ -12,23 +12,6 @@ import ru.betterend.world.biome.EndBiome; public class NeonOasisBiome extends EndBiome { public NeonOasisBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("neon_oasis")) - .setGenChance(0.5F) - .setFogColor(226, 239, 168) - .setFogDensity(2) - .setWaterAndFogColor(106, 238, 215) - .setSurface(EndBlocks.ENDSTONE_DUST, EndBlocks.END_MOSS) - .setParticles(ParticleTypes.WHITE_ASH, 0.01F) - .setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) - .setMusic(EndSounds.MUSIC_OPENSPACE) - .addFeature(EndFeatures.DESERT_LAKE) - .addFeature(EndFeatures.NEON_CACTUS) - .addFeature(EndFeatures.UMBRELLA_MOSS) - .addFeature(EndFeatures.CREEPING_MOSS) - .addFeature(EndFeatures.CHARNIA_GREEN) - .addFeature(EndFeatures.CHARNIA_CYAN) - .addFeature(EndFeatures.CHARNIA_RED) - .addStructureFeature(StructureFeatures.END_CITY) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("neon_oasis")).setGenChance(0.5F).setFogColor(226, 239, 168).setFogDensity(2).setWaterAndFogColor(106, 238, 215).setSurface(EndBlocks.ENDSTONE_DUST, EndBlocks.END_MOSS).setParticles(ParticleTypes.WHITE_ASH, 0.01F).setLoop(EndSounds.AMBIENT_DUST_WASTELANDS).setMusic(EndSounds.MUSIC_OPENSPACE).addFeature(EndFeatures.DESERT_LAKE).addFeature(EndFeatures.NEON_CACTUS).addFeature(EndFeatures.UMBRELLA_MOSS).addFeature(EndFeatures.CREEPING_MOSS).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_RED).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/PaintedMountainsBiome.java b/src/main/java/ru/betterend/world/biome/land/PaintedMountainsBiome.java index 8bf6fbbc..dd09cbf0 100644 --- a/src/main/java/ru/betterend/world/biome/land/PaintedMountainsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/PaintedMountainsBiome.java @@ -11,15 +11,6 @@ import ru.betterend.world.biome.EndBiome; public class PaintedMountainsBiome extends EndBiome { public PaintedMountainsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("painted_mountains")) - .addStructureFeature(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured()) - .setFogColor(226, 239, 168) - .setFogDensity(2) - .setWaterAndFogColor(192, 180, 131) - .setMusic(EndSounds.MUSIC_OPENSPACE) - .setLoop(EndSounds.AMBIENT_DUST_WASTELANDS) - .setSurface(EndBlocks.ENDSTONE_DUST) - .setParticles(ParticleTypes.WHITE_ASH, 0.01F) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("painted_mountains")).addStructureFeature(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured()).setFogColor(226, 239, 168).setFogDensity(2).setWaterAndFogColor(192, 180, 131).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_DUST_WASTELANDS).setSurface(EndBlocks.ENDSTONE_DUST).setParticles(ParticleTypes.WHITE_ASH, 0.01F).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/ShadowForestBiome.java b/src/main/java/ru/betterend/world/biome/land/ShadowForestBiome.java index a3bde81b..3c1fce3f 100644 --- a/src/main/java/ru/betterend/world/biome/land/ShadowForestBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/ShadowForestBiome.java @@ -13,32 +13,6 @@ import ru.betterend.world.biome.EndBiome; public class ShadowForestBiome extends EndBiome { public ShadowForestBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("shadow_forest")) - .setFogColor(0, 0, 0) - .setFogDensity(2.5F) - .setPlantsColor(45, 45, 45) - .setWaterAndFogColor(42, 45, 80) - .setSurface(EndBlocks.SHADOW_GRASS) - .setParticles(ParticleTypes.MYCELIUM, 0.01F) - .setLoop(EndSounds.AMBIENT_CHORUS_FOREST) - .setMusic(EndSounds.MUSIC_DARK) - .addFeature(EndFeatures.VIOLECITE_LAYER) - .addFeature(EndFeatures.END_LAKE_RARE) - .addFeature(EndFeatures.DRAGON_TREE) - .addFeature(EndFeatures.DRAGON_TREE_BUSH) - .addFeature(EndFeatures.SHADOW_PLANT) - .addFeature(EndFeatures.MURKWEED) - .addFeature(EndFeatures.NEEDLEGRASS) - .addFeature(EndFeatures.SHADOW_BERRY) - .addFeature(EndFeatures.TWISTED_VINE) - .addFeature(EndFeatures.PURPLE_POLYPORE) - .addFeature(EndFeatures.TAIL_MOSS) - .addFeature(EndFeatures.TAIL_MOSS_WOOD) - .addFeature(EndFeatures.CHARNIA_PURPLE) - .addFeature(EndFeatures.CHARNIA_RED_RARE) - .addStructureFeature(StructureFeatures.END_CITY) - .addMobSpawn(EndEntities.SHADOW_WALKER, 80, 2, 4) - .addMobSpawn(EntityType.ENDERMAN, 40, 1, 4) - .addMobSpawn(EntityType.PHANTOM, 1, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("shadow_forest")).setFogColor(0, 0, 0).setFogDensity(2.5F).setPlantsColor(45, 45, 45).setWaterAndFogColor(42, 45, 80).setSurface(EndBlocks.SHADOW_GRASS).setParticles(ParticleTypes.MYCELIUM, 0.01F).setLoop(EndSounds.AMBIENT_CHORUS_FOREST).setMusic(EndSounds.MUSIC_DARK).addFeature(EndFeatures.VIOLECITE_LAYER).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.DRAGON_TREE).addFeature(EndFeatures.DRAGON_TREE_BUSH).addFeature(EndFeatures.SHADOW_PLANT).addFeature(EndFeatures.MURKWEED).addFeature(EndFeatures.NEEDLEGRASS).addFeature(EndFeatures.SHADOW_BERRY).addFeature(EndFeatures.TWISTED_VINE).addFeature(EndFeatures.PURPLE_POLYPORE).addFeature(EndFeatures.TAIL_MOSS).addFeature(EndFeatures.TAIL_MOSS_WOOD).addFeature(EndFeatures.CHARNIA_PURPLE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EndEntities.SHADOW_WALKER, 80, 2, 4).addMobSpawn(EntityType.ENDERMAN, 40, 1, 4).addMobSpawn(EntityType.PHANTOM, 1, 1, 2)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/SulphurSpringsBiome.java b/src/main/java/ru/betterend/world/biome/land/SulphurSpringsBiome.java index 8caad6f7..d17128c4 100644 --- a/src/main/java/ru/betterend/world/biome/land/SulphurSpringsBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/SulphurSpringsBiome.java @@ -12,27 +12,6 @@ import ru.betterend.world.surface.SurfaceBuilders; public class SulphurSpringsBiome extends EndBiome { public SulphurSpringsBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("sulphur_springs")) - .addCustomData("has_caves", false) - .setSurface(SurfaceBuilders.SULPHURIC_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG)) - .setMusic(EndSounds.MUSIC_OPENSPACE) - .setLoop(EndSounds.AMBIENT_SULPHUR_SPRINGS) - .setWaterColor(25, 90, 157) - .setWaterFogColor(30, 65, 61) - .setFogColor(207, 194, 62) - .setFogDensity(1.5F) - .setDepth(0F) - .setParticles(EndParticles.SULPHUR_PARTICLE, 0.001F) - .addFeature(EndFeatures.GEYSER) - .addFeature(EndFeatures.SURFACE_VENT) - .addFeature(EndFeatures.SULPHURIC_LAKE) - .addFeature(EndFeatures.SULPHURIC_CAVE) - .addFeature(EndFeatures.HYDRALUX) - .addFeature(EndFeatures.CHARNIA_GREEN) - .addFeature(EndFeatures.CHARNIA_ORANGE) - .addFeature(EndFeatures.CHARNIA_RED_RARE) - .addMobSpawn(EndEntities.END_FISH, 50, 3, 8) - .addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); + super(new BCLBiomeDef(BetterEnd.makeID("sulphur_springs")).addCustomData("has_caves", false).setSurface(SurfaceBuilders.SULPHURIC_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG)).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_SULPHUR_SPRINGS).setWaterColor(25, 90, 157).setWaterFogColor(30, 65, 61).setFogColor(207, 194, 62).setFogDensity(1.5F).setDepth(0F).setParticles(EndParticles.SULPHUR_PARTICLE, 0.001F).addFeature(EndFeatures.GEYSER).addFeature(EndFeatures.SURFACE_VENT).addFeature(EndFeatures.SULPHURIC_LAKE).addFeature(EndFeatures.SULPHURIC_CAVE).addFeature(EndFeatures.HYDRALUX).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_ORANGE).addFeature(EndFeatures.CHARNIA_RED_RARE).addMobSpawn(EndEntities.END_FISH, 50, 3, 8).addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); } } diff --git a/src/main/java/ru/betterend/world/biome/land/UmbrellaJungleBiome.java b/src/main/java/ru/betterend/world/biome/land/UmbrellaJungleBiome.java index dacda618..24683b76 100644 --- a/src/main/java/ru/betterend/world/biome/land/UmbrellaJungleBiome.java +++ b/src/main/java/ru/betterend/world/biome/land/UmbrellaJungleBiome.java @@ -12,33 +12,6 @@ import ru.betterend.world.biome.EndBiome; public class UmbrellaJungleBiome extends EndBiome { public UmbrellaJungleBiome() { - super(new BCLBiomeDef(BetterEnd.makeID("umbrella_jungle")) - .setFogColor(87, 223, 221) - .setWaterAndFogColor(119, 198, 253) - .setFoliageColor(27, 183, 194) - .setFogDensity(2.3F) - .setParticles(EndParticles.JUNGLE_SPORE, 0.001F) - .setMusic(EndSounds.MUSIC_FOREST) - .setLoop(EndSounds.AMBIENT_UMBRELLA_JUNGLE) - .setSurface(EndBlocks.JUNGLE_MOSS) - .addFeature(EndFeatures.END_LAKE) - .addFeature(EndFeatures.UMBRELLA_TREE) - .addFeature(EndFeatures.JELLYSHROOM) - .addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS) - .addFeature(EndFeatures.SMALL_JELLYSHROOM_FLOOR) - .addFeature(EndFeatures.JUNGLE_GRASS) - .addFeature(EndFeatures.CYAN_MOSS) - .addFeature(EndFeatures.CYAN_MOSS_WOOD) - .addFeature(EndFeatures.JUNGLE_FERN_WOOD) - .addFeature(EndFeatures.SMALL_JELLYSHROOM_WALL) - .addFeature(EndFeatures.SMALL_JELLYSHROOM_WOOD) - .addFeature(EndFeatures.SMALL_JELLYSHROOM_CEIL) - .addFeature(EndFeatures.JUNGLE_VINE) - .addFeature(EndFeatures.CHARNIA_CYAN) - .addFeature(EndFeatures.CHARNIA_GREEN) - .addFeature(EndFeatures.CHARNIA_LIGHT_BLUE) - .addFeature(EndFeatures.CHARNIA_RED_RARE) - .addStructureFeature(StructureFeatures.END_CITY) - .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); + super(new BCLBiomeDef(BetterEnd.makeID("umbrella_jungle")).setFogColor(87, 223, 221).setWaterAndFogColor(119, 198, 253).setFoliageColor(27, 183, 194).setFogDensity(2.3F).setParticles(EndParticles.JUNGLE_SPORE, 0.001F).setMusic(EndSounds.MUSIC_FOREST).setLoop(EndSounds.AMBIENT_UMBRELLA_JUNGLE).setSurface(EndBlocks.JUNGLE_MOSS).addFeature(EndFeatures.END_LAKE).addFeature(EndFeatures.UMBRELLA_TREE).addFeature(EndFeatures.JELLYSHROOM).addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS).addFeature(EndFeatures.SMALL_JELLYSHROOM_FLOOR).addFeature(EndFeatures.JUNGLE_GRASS).addFeature(EndFeatures.CYAN_MOSS).addFeature(EndFeatures.CYAN_MOSS_WOOD).addFeature(EndFeatures.JUNGLE_FERN_WOOD).addFeature(EndFeatures.SMALL_JELLYSHROOM_WALL).addFeature(EndFeatures.SMALL_JELLYSHROOM_WOOD).addFeature(EndFeatures.SMALL_JELLYSHROOM_CEIL).addFeature(EndFeatures.JUNGLE_VINE).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); } } \ No newline at end of file diff --git a/src/main/java/ru/betterend/world/features/BiomeIslandFeature.java b/src/main/java/ru/betterend/world/features/BiomeIslandFeature.java index 8c57392e..846b7514 100644 --- a/src/main/java/ru/betterend/world/features/BiomeIslandFeature.java +++ b/src/main/java/ru/betterend/world/features/BiomeIslandFeature.java @@ -21,11 +21,11 @@ import ru.betterend.noise.OpenSimplexNoise; public class BiomeIslandFeature extends DefaultFeature { private static final MutableBlockPos CENTER = new MutableBlockPos(); private static final SDF ISLAND; - + private static OpenSimplexNoise simplexNoise = new OpenSimplexNoise(412L); private static BlockState topBlock = Blocks.GRASS_BLOCK.defaultBlockState(); private static BlockState underBlock = Blocks.DIRT.defaultBlockState(); - + @Override public boolean place(FeaturePlaceContext featureConfig) { final BlockPos pos = featureConfig.origin(); @@ -45,13 +45,11 @@ public class BiomeIslandFeature extends DefaultFeature { ISLAND.fillRecursive(world, pos.below()); return true; } - + private static SDF createSDFIsland() { SDF sdfCone = new SDFCappedCone().setRadius1(0).setRadius2(6).setHeight(4).setBlock(pos -> { - if (pos.getY() > CENTER.getY()) - return AIR; - if (pos.getY() == CENTER.getY()) - return topBlock; + if (pos.getY() > CENTER.getY()) return AIR; + if (pos.getY() == CENTER.getY()) return topBlock; return underBlock; }); sdfCone = new SDFTranslate().setTranslate(0, -2, 0).setSource(sdfCone); @@ -59,14 +57,12 @@ public class BiomeIslandFeature extends DefaultFeature { float deltaX = Math.abs(pos.x()); float deltaY = Math.abs(pos.y()); float deltaZ = Math.abs(pos.z()); - if (deltaY < 2.0f && (deltaX < 3.0f || deltaZ < 3.0F)) - return 0.0f; + if (deltaY < 2.0f && (deltaX < 3.0f || deltaZ < 3.0F)) return 0.0f; return (float) simplexNoise.eval(CENTER.getX() + pos.x(), CENTER.getY() + pos.y(), CENTER.getZ() + pos.z()); - }).setSource(sdfCone) - .setReplaceFunction(state -> BlocksHelper.isFluid(state) || state.getMaterial().isReplaceable()); + }).setSource(sdfCone).setReplaceFunction(state -> BlocksHelper.isFluid(state) || state.getMaterial().isReplaceable()); return sdfCone; } - + static { ISLAND = createSDFIsland(); } diff --git a/src/main/java/ru/betterend/world/features/BlueVineFeature.java b/src/main/java/ru/betterend/world/features/BlueVineFeature.java index a5916fdd..73037656 100644 --- a/src/main/java/ru/betterend/world/features/BlueVineFeature.java +++ b/src/main/java/ru/betterend/world/features/BlueVineFeature.java @@ -11,18 +11,18 @@ import java.util.Random; public class BlueVineFeature extends ScatterFeature { private boolean small; - + public BlueVineFeature() { super(5); } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { float d = MHelper.length(center.getX() - blockPos.getX(), center.getZ() - blockPos.getZ()) / radius * 0.6F + random.nextFloat() * 0.4F; small = d > 0.5F; return EndBlocks.BLUE_VINE_SEED.canSurvive(AIR, world, blockPos); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { if (small) { diff --git a/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java b/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java index df2435d0..3b5ea0d7 100644 --- a/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java +++ b/src/main/java/ru/betterend/world/features/CavePumpkinFeature.java @@ -18,19 +18,16 @@ public class CavePumpkinFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.above()).is(TagAPI.GEN_TERRAIN) || !world.isEmptyBlock(pos) - || !world.isEmptyBlock(pos.below())) { + if (!world.getBlockState(pos.above()).is(TagAPI.GEN_TERRAIN) || !world.isEmptyBlock(pos) || !world.isEmptyBlock(pos.below())) { return false; } - + int age = random.nextInt(4); - BlocksHelper.setWithoutUpdate(world, pos, - EndBlocks.CAVE_PUMPKIN_SEED.defaultBlockState().setValue(EndBlockProperties.AGE, age)); + BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.CAVE_PUMPKIN_SEED.defaultBlockState().setValue(EndBlockProperties.AGE, age)); if (age > 1) { - BlocksHelper.setWithoutUpdate(world, pos.below(), - EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(EndBlockProperties.SMALL, age < 3)); + BlocksHelper.setWithoutUpdate(world, pos.below(), EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(EndBlockProperties.SMALL, age < 3)); } - + return true; } } diff --git a/src/main/java/ru/betterend/world/features/CharniaFeature.java b/src/main/java/ru/betterend/world/features/CharniaFeature.java index 57636909..c8022a39 100644 --- a/src/main/java/ru/betterend/world/features/CharniaFeature.java +++ b/src/main/java/ru/betterend/world/features/CharniaFeature.java @@ -6,7 +6,7 @@ public class CharniaFeature extends UnderwaterPlantFeature { public CharniaFeature(Block plant) { super(plant, 6); } - + @Override protected int getChance() { return 3; diff --git a/src/main/java/ru/betterend/world/features/CrashedShipFeature.java b/src/main/java/ru/betterend/world/features/CrashedShipFeature.java index 248bbb9f..704aca73 100644 --- a/src/main/java/ru/betterend/world/features/CrashedShipFeature.java +++ b/src/main/java/ru/betterend/world/features/CrashedShipFeature.java @@ -30,7 +30,7 @@ public class CrashedShipFeature extends NBTStructureFeature { private static final StructureProcessor REPLACER; private static final String STRUCTURE_PATH = "/data/minecraft/structures/end_city/ship.nbt"; private StructureTemplate structure; - + @Override protected StructureTemplate getStructure(WorldGenLevel world, BlockPos pos, Random random) { if (structure == null) { @@ -41,7 +41,7 @@ public class CrashedShipFeature extends NBTStructureFeature { } return structure; } - + @Override protected boolean canSpawn(WorldGenLevel world, BlockPos pos, Random random) { long x = pos.getX() >> 4; @@ -51,29 +51,29 @@ public class CrashedShipFeature extends NBTStructureFeature { } return pos.getY() > 5 && world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN); } - + @Override protected Rotation getRotation(WorldGenLevel world, BlockPos pos, Random random) { return Rotation.getRandom(random); } - + @Override protected Mirror getMirror(WorldGenLevel world, BlockPos pos, Random random) { return Mirror.values()[random.nextInt(3)]; } - + @Override protected int getYOffset(StructureTemplate structure, WorldGenLevel world, BlockPos pos, Random random) { int min = structure.getSize().getY() >> 3; int max = structure.getSize().getY() >> 2; return -MHelper.randRange(min, max, random); } - + @Override protected TerrainMerge getTerrainMerge(WorldGenLevel world, BlockPos pos, Random random) { return TerrainMerge.NONE; } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -82,11 +82,11 @@ public class CrashedShipFeature extends NBTStructureFeature { center = new BlockPos(((center.getX() >> 4) << 4) | 8, 128, ((center.getZ() >> 4) << 4) | 8); center = getGround(world, center); BoundingBox bounds = makeBox(center); - + if (!canSpawn(world, center, random)) { return false; } - + StructureTemplate structure = getStructure(world, center, random); Rotation rotation = getRotation(world, center, random); Mirror mirror = getMirror(world, center, random); @@ -94,37 +94,35 @@ public class CrashedShipFeature extends NBTStructureFeature { center = center.offset(0, getYOffset(structure, world, center, random) + 0.5, 0); StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation).setMirror(mirror); center = center.offset(-offset.getX() * 0.5, 0, -offset.getZ() * 0.5); - + BoundingBox structB = structure.getBoundingBox(placementData, center); bounds = StructureHelper.intersectBoxes(bounds, structB); - + addStructureData(placementData); structure.placeInWorld(world, center, center, placementData.setBoundingBox(bounds), random, 2); - + StructureHelper.erodeIntense(world, bounds, random); BlockFixer.fixBlocks(world, new BlockPos(bounds.minX(), bounds.minY(), bounds.minZ()), new BlockPos(bounds.maxX(), bounds.maxY(), bounds.maxZ())); - + return true; } - + @Override protected void addStructureData(StructurePlaceSettings data) { data.addProcessor(BlockIgnoreProcessor.STRUCTURE_AND_AIR).addProcessor(REPLACER).setIgnoreEntities(true); } - + static { REPLACER = new StructureProcessor() { @Override - public StructureBlockInfo processBlock(LevelReader worldView, BlockPos pos, BlockPos blockPos, - StructureBlockInfo structureBlockInfo, StructureBlockInfo structureBlockInfo2, - StructurePlaceSettings structurePlacementData) { + public StructureBlockInfo processBlock(LevelReader worldView, BlockPos pos, BlockPos blockPos, StructureBlockInfo structureBlockInfo, StructureBlockInfo structureBlockInfo2, StructurePlaceSettings structurePlacementData) { BlockState state = structureBlockInfo2.state; if (state.is(Blocks.SPAWNER) || state.getMaterial().equals(Material.WOOL)) { return new StructureBlockInfo(structureBlockInfo2.pos, AIR, null); } return structureBlockInfo2; } - + @Override protected StructureProcessorType getType() { return StructureProcessorType.NOP; diff --git a/src/main/java/ru/betterend/world/features/DoublePlantFeature.java b/src/main/java/ru/betterend/world/features/DoublePlantFeature.java index 1a811cc9..f4f40612 100644 --- a/src/main/java/ru/betterend/world/features/DoublePlantFeature.java +++ b/src/main/java/ru/betterend/world/features/DoublePlantFeature.java @@ -14,20 +14,20 @@ public class DoublePlantFeature extends ScatterFeature { private final Block smallPlant; private final Block largePlant; private Block plant; - + public DoublePlantFeature(Block smallPlant, Block largePlant, int radius) { super(radius); this.smallPlant = smallPlant; this.largePlant = largePlant; } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { float d = MHelper.length(center.getX() - blockPos.getX(), center.getZ() - blockPos.getZ()) / radius * 0.6F + random.nextFloat() * 0.4F; plant = d < 0.5F ? largePlant : smallPlant; return plant.canSurvive(plant.defaultBlockState(), world, blockPos); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { if (plant instanceof BaseDoublePlantBlock) { diff --git a/src/main/java/ru/betterend/world/features/EndLilyFeature.java b/src/main/java/ru/betterend/world/features/EndLilyFeature.java index d505742a..490c3ca4 100644 --- a/src/main/java/ru/betterend/world/features/EndLilyFeature.java +++ b/src/main/java/ru/betterend/world/features/EndLilyFeature.java @@ -11,13 +11,13 @@ public class EndLilyFeature extends UnderwaterPlantScatter { public EndLilyFeature(int radius) { super(radius); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { EndLilySeedBlock seed = (EndLilySeedBlock) EndBlocks.END_LILY_SEED; seed.grow(world, random, blockPos); } - + @Override protected int getChance() { return 15; diff --git a/src/main/java/ru/betterend/world/features/EndLotusFeature.java b/src/main/java/ru/betterend/world/features/EndLotusFeature.java index b0d65d6a..489fb561 100644 --- a/src/main/java/ru/betterend/world/features/EndLotusFeature.java +++ b/src/main/java/ru/betterend/world/features/EndLotusFeature.java @@ -11,13 +11,13 @@ public class EndLotusFeature extends UnderwaterPlantScatter { public EndLotusFeature(int radius) { super(radius); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { EndLotusSeedBlock seed = (EndLotusSeedBlock) EndBlocks.END_LOTUS_SEED; seed.grow(world, random, blockPos); } - + @Override protected int getChance() { return 15; diff --git a/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java b/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java index 239d0648..788b4cf3 100644 --- a/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java +++ b/src/main/java/ru/betterend/world/features/EndLotusLeafFeature.java @@ -17,24 +17,24 @@ public class EndLotusLeafFeature extends ScatterFeature { public EndLotusLeafFeature(int radius) { super(radius); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { if (canGenerate(world, blockPos)) { generateLeaf(world, blockPos); } } - + @Override protected int getChance() { return 15; } - + @Override protected BlockPos getCenterGround(WorldGenLevel world, BlockPos pos) { return getPosOnSurface(world, pos); } - + private void generateLeaf(WorldGenLevel world, BlockPos pos) { MutableBlockPos p = new MutableBlockPos(); BlockState leaf = EndBlocks.END_LOTUS_LEAF.defaultBlockState(); @@ -48,7 +48,7 @@ public class EndLotusLeafFeature extends ScatterFeature { BlocksHelper.setWithoutUpdate(world, p.set(pos).move(d1).move(d2), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1).setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP)); } } - + private boolean canGenerate(WorldGenLevel world, BlockPos pos) { MutableBlockPos p = new MutableBlockPos(); p.setY(pos.getY()); @@ -57,13 +57,12 @@ public class EndLotusLeafFeature extends ScatterFeature { p.setX(pos.getX() + x); for (int z = -1; z < 2; z++) { p.setZ(pos.getZ() + z); - if (world.isEmptyBlock(p) && world.getBlockState(p.below()).is(Blocks.WATER)) - count++; + if (world.isEmptyBlock(p) && world.getBlockState(p.below()).is(Blocks.WATER)) count++; } } return count == 9; } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { return world.isEmptyBlock(blockPos) && world.getBlockState(blockPos.below()).is(Blocks.WATER); diff --git a/src/main/java/ru/betterend/world/features/FilaluxFeature.java b/src/main/java/ru/betterend/world/features/FilaluxFeature.java index e3ac1ad8..d991f638 100644 --- a/src/main/java/ru/betterend/world/features/FilaluxFeature.java +++ b/src/main/java/ru/betterend/world/features/FilaluxFeature.java @@ -17,7 +17,7 @@ public class FilaluxFeature extends SkyScatterFeature { public FilaluxFeature() { super(10); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { BlockState vine = EndBlocks.FILALUX.defaultBlockState(); diff --git a/src/main/java/ru/betterend/world/features/FullHeightScatterFeature.java b/src/main/java/ru/betterend/world/features/FullHeightScatterFeature.java index 02b4735f..0adf51e5 100644 --- a/src/main/java/ru/betterend/world/features/FullHeightScatterFeature.java +++ b/src/main/java/ru/betterend/world/features/FullHeightScatterFeature.java @@ -15,16 +15,15 @@ import java.util.Random; public abstract class FullHeightScatterFeature extends DefaultFeature { private static final MutableBlockPos POS = new MutableBlockPos(); private final int radius; - + public FullHeightScatterFeature(int radius) { this.radius = radius; } - - public abstract boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, - float radius); - + + public abstract boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius); + public abstract void generate(WorldGenLevel world, Random random, BlockPos blockPos); - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -42,13 +41,12 @@ public abstract class FullHeightScatterFeature extends DefaultFeature { float theta = random.nextFloat() * MHelper.PI2; float x = pr * (float) Math.cos(theta); float z = pr * (float) Math.sin(theta); - + POS.set(center.getX() + x, y + 5, center.getZ() + z); int down = BlocksHelper.downRay(world, POS, 16); - if (down > 10) - continue; + if (down > 10) continue; POS.setY(POS.getY() - down); - + if (canGenerate(world, random, center, POS, r)) { generate(world, random, POS); } diff --git a/src/main/java/ru/betterend/world/features/GlowPillarFeature.java b/src/main/java/ru/betterend/world/features/GlowPillarFeature.java index 851ce83e..2bd24160 100644 --- a/src/main/java/ru/betterend/world/features/GlowPillarFeature.java +++ b/src/main/java/ru/betterend/world/features/GlowPillarFeature.java @@ -11,18 +11,18 @@ public class GlowPillarFeature extends ScatterFeature { public GlowPillarFeature() { super(9); } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { return EndBlocks.GLOWING_PILLAR_SEED.canSurvive(AIR, world, blockPos); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { EndPlantWithAgeBlock seed = ((EndPlantWithAgeBlock) EndBlocks.GLOWING_PILLAR_SEED); seed.growAdult(world, random, blockPos); } - + @Override protected int getChance() { return 10; diff --git a/src/main/java/ru/betterend/world/features/HydraluxFeature.java b/src/main/java/ru/betterend/world/features/HydraluxFeature.java index fc92fc56..12c6fbdb 100644 --- a/src/main/java/ru/betterend/world/features/HydraluxFeature.java +++ b/src/main/java/ru/betterend/world/features/HydraluxFeature.java @@ -11,13 +11,13 @@ public class HydraluxFeature extends UnderwaterPlantScatter { public HydraluxFeature(int radius) { super(radius); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { HydraluxSaplingBlock seed = (HydraluxSaplingBlock) EndBlocks.HYDRALUX_SAPLING; seed.grow(world, random, blockPos); } - + @Override protected int getChance() { return 15; diff --git a/src/main/java/ru/betterend/world/features/InvertedScatterFeature.java b/src/main/java/ru/betterend/world/features/InvertedScatterFeature.java index cd847402..ba38dfb4 100644 --- a/src/main/java/ru/betterend/world/features/InvertedScatterFeature.java +++ b/src/main/java/ru/betterend/world/features/InvertedScatterFeature.java @@ -15,16 +15,15 @@ import java.util.Random; public abstract class InvertedScatterFeature extends DefaultFeature { private static final MutableBlockPos POS = new MutableBlockPos(); private final int radius; - + public InvertedScatterFeature(int radius) { this.radius = radius; } - - public abstract boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, - float radius); - + + public abstract boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius); + public abstract void generate(WorldGenLevel world, Random random, BlockPos blockPos); - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -42,13 +41,12 @@ public abstract class InvertedScatterFeature extends DefaultFeature { float theta = random.nextFloat() * MHelper.PI2; float x = pr * (float) Math.cos(theta); float z = pr * (float) Math.sin(theta); - + POS.set(center.getX() + x, center.getY() - 7, center.getZ() + z); int up = BlocksHelper.upRay(world, POS, 16); - if (up > 14) - continue; + if (up > 14) continue; POS.setY(POS.getY() + up); - + if (canGenerate(world, random, center, POS, r)) { generate(world, random, POS); } diff --git a/src/main/java/ru/betterend/world/features/LanceleafFeature.java b/src/main/java/ru/betterend/world/features/LanceleafFeature.java index d35a27c9..7eb3966c 100644 --- a/src/main/java/ru/betterend/world/features/LanceleafFeature.java +++ b/src/main/java/ru/betterend/world/features/LanceleafFeature.java @@ -11,18 +11,18 @@ public class LanceleafFeature extends ScatterFeature { public LanceleafFeature() { super(7); } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { return EndBlocks.LANCELEAF_SEED.canSurvive(AIR, world, blockPos); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { EndPlantWithAgeBlock seed = ((EndPlantWithAgeBlock) EndBlocks.LANCELEAF_SEED); seed.growAdult(world, random, blockPos); } - + @Override protected int getChance() { return 5; diff --git a/src/main/java/ru/betterend/world/features/MengerSpongeFeature.java b/src/main/java/ru/betterend/world/features/MengerSpongeFeature.java index f79076b6..6dc0e6d3 100644 --- a/src/main/java/ru/betterend/world/features/MengerSpongeFeature.java +++ b/src/main/java/ru/betterend/world/features/MengerSpongeFeature.java @@ -12,11 +12,11 @@ import java.util.function.Function; public class MengerSpongeFeature extends UnderwaterPlantScatter { private static final Function REPLACE; - + public MengerSpongeFeature(int radius) { super(radius); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.MENGER_SPONGE_WET); @@ -29,7 +29,7 @@ public class MengerSpongeFeature extends UnderwaterPlantScatter { } } } - + static { REPLACE = (state) -> { if (state.is(EndBlocks.END_LOTUS_STEM)) { diff --git a/src/main/java/ru/betterend/world/features/NeonCactusFeature.java b/src/main/java/ru/betterend/world/features/NeonCactusFeature.java index 02701406..3b3164a3 100644 --- a/src/main/java/ru/betterend/world/features/NeonCactusFeature.java +++ b/src/main/java/ru/betterend/world/features/NeonCactusFeature.java @@ -21,10 +21,10 @@ public class NeonCactusFeature extends DefaultFeature { if (!ground.is(EndBlocks.ENDSTONE_DUST) && !ground.is(EndBlocks.END_MOSS)) { return false; } - + NeonCactusPlantBlock cactus = ((NeonCactusPlantBlock) EndBlocks.NEON_CACTUS); cactus.growPlant(world, pos, random); - + return true; } } diff --git a/src/main/java/ru/betterend/world/features/ScatterFeature.java b/src/main/java/ru/betterend/world/features/ScatterFeature.java index fa0d7b3c..e3adb7f0 100644 --- a/src/main/java/ru/betterend/world/features/ScatterFeature.java +++ b/src/main/java/ru/betterend/world/features/ScatterFeature.java @@ -15,20 +15,19 @@ import java.util.Random; public abstract class ScatterFeature extends DefaultFeature { private static final MutableBlockPos POS = new MutableBlockPos(); private final int radius; - + public ScatterFeature(int radius) { this.radius = radius; } - - public abstract boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, - float radius); - + + public abstract boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius); + public abstract void generate(WorldGenLevel world, Random random, BlockPos blockPos); - + protected BlockPos getCenterGround(WorldGenLevel world, BlockPos pos) { return getPosOnSurfaceWG(world, pos); } - + protected boolean canSpawn(WorldGenLevel world, BlockPos pos) { if (pos.getY() < 5) { return false; @@ -38,7 +37,7 @@ public abstract class ScatterFeature extends DefaultFeature { } return true; } - + protected boolean getGroundPlant(WorldGenLevel world, MutableBlockPos pos) { int down = BlocksHelper.downRay(world, pos, 16); if (down > Math.abs(getYOffset() * 2)) { @@ -47,26 +46,26 @@ public abstract class ScatterFeature extends DefaultFeature { pos.setY(pos.getY() - down); return true; } - + protected int getYOffset() { return 5; } - + protected int getChance() { return 1; } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); BlockPos center = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); center = getCenterGround(world, center); - + if (!canSpawn(world, center)) { return false; } - + float r = MHelper.randRange(radius * 0.5F, radius, random); int count = MHelper.floor(r * r * MHelper.randRange(1.5F, 3F, random)); for (int i = 0; i < count; i++) { @@ -74,14 +73,13 @@ public abstract class ScatterFeature extends DefaultFeature { float theta = random.nextFloat() * MHelper.PI2; float x = pr * (float) Math.cos(theta); float z = pr * (float) Math.sin(theta); - + POS.set(center.getX() + x, center.getY() + getYOffset(), center.getZ() + z); - if (getGroundPlant(world, POS) && canGenerate(world, random, center, POS, r) - && (getChance() < 2 || random.nextInt(getChance()) == 0)) { + if (getGroundPlant(world, POS) && canGenerate(world, random, center, POS, r) && (getChance() < 2 || random.nextInt(getChance()) == 0)) { generate(world, random, POS); } } - + return true; } } diff --git a/src/main/java/ru/betterend/world/features/SilkMothNestFeature.java b/src/main/java/ru/betterend/world/features/SilkMothNestFeature.java index 60a5ce6d..ec402a17 100644 --- a/src/main/java/ru/betterend/world/features/SilkMothNestFeature.java +++ b/src/main/java/ru/betterend/world/features/SilkMothNestFeature.java @@ -19,7 +19,7 @@ import java.util.Random; public class SilkMothNestFeature extends DefaultFeature { private static final MutableBlockPos POS = new MutableBlockPos(); - + private boolean canGenerate(WorldGenLevel world, BlockPos pos) { BlockState state = world.getBlockState(pos.above()); if (state.is(BlockTags.LEAVES) || state.is(BlockTags.LOGS)) { @@ -32,7 +32,7 @@ public class SilkMothNestFeature extends DefaultFeature { } return false; } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -45,11 +45,9 @@ public class SilkMothNestFeature extends DefaultFeature { POS.setY(y); if (canGenerate(world, POS)) { Direction dir = BlocksHelper.randomHorizontal(random); - BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.SILK_MOTH_NEST.defaultBlockState() - .setValue(BlockStateProperties.HORIZONTAL_FACING, dir).setValue(BlockProperties.ACTIVE, false)); + BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.SILK_MOTH_NEST.defaultBlockState().setValue(BlockStateProperties.HORIZONTAL_FACING, dir).setValue(BlockProperties.ACTIVE, false)); POS.setY(y - 1); - BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.SILK_MOTH_NEST.defaultBlockState() - .setValue(BlockStateProperties.HORIZONTAL_FACING, dir)); + BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.SILK_MOTH_NEST.defaultBlockState().setValue(BlockStateProperties.HORIZONTAL_FACING, dir)); return true; } } diff --git a/src/main/java/ru/betterend/world/features/SingleInvertedScatterFeature.java b/src/main/java/ru/betterend/world/features/SingleInvertedScatterFeature.java index 8b354840..452b9afe 100644 --- a/src/main/java/ru/betterend/world/features/SingleInvertedScatterFeature.java +++ b/src/main/java/ru/betterend/world/features/SingleInvertedScatterFeature.java @@ -13,12 +13,12 @@ import java.util.Random; public class SingleInvertedScatterFeature extends InvertedScatterFeature { private final Block block; - + public SingleInvertedScatterFeature(Block block, int radius) { super(radius); this.block = block; } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { if (!world.isEmptyBlock(blockPos)) { @@ -30,7 +30,7 @@ public class SingleInvertedScatterFeature extends InvertedScatterFeature { } return state.canSurvive(world, blockPos); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { BlockState state = block.defaultBlockState(); diff --git a/src/main/java/ru/betterend/world/features/SinglePlantFeature.java b/src/main/java/ru/betterend/world/features/SinglePlantFeature.java index 87106c37..c7379c73 100644 --- a/src/main/java/ru/betterend/world/features/SinglePlantFeature.java +++ b/src/main/java/ru/betterend/world/features/SinglePlantFeature.java @@ -15,40 +15,40 @@ public class SinglePlantFeature extends ScatterFeature { private final Block plant; private final boolean rawHeightmap; private final int chance; - + public SinglePlantFeature(Block plant, int radius) { this(plant, radius, true, 1); } - + public SinglePlantFeature(Block plant, int radius, int chance) { this(plant, radius, true, chance); } - + public SinglePlantFeature(Block plant, int radius, boolean rawHeightmap) { this(plant, radius, rawHeightmap, 1); } - + public SinglePlantFeature(Block plant, int radius, boolean rawHeightmap, int chance) { super(radius); this.plant = plant; this.rawHeightmap = rawHeightmap; this.chance = chance; } - + protected int getChance() { return chance; } - + @Override protected BlockPos getCenterGround(WorldGenLevel world, BlockPos pos) { return rawHeightmap ? getPosOnSurfaceWG(world, pos) : getPosOnSurface(world, pos); } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { return plant.canSurvive(plant.defaultBlockState(), world, blockPos); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { if (plant instanceof BaseDoublePlantBlock) { diff --git a/src/main/java/ru/betterend/world/features/SkyScatterFeature.java b/src/main/java/ru/betterend/world/features/SkyScatterFeature.java index 60da3899..4f17b028 100644 --- a/src/main/java/ru/betterend/world/features/SkyScatterFeature.java +++ b/src/main/java/ru/betterend/world/features/SkyScatterFeature.java @@ -13,40 +13,40 @@ public abstract class SkyScatterFeature extends ScatterFeature { public SkyScatterFeature(int radius) { super(radius); } - + @Override protected int getChance() { return 10; } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { if (!world.isEmptyBlock(blockPos)) { return false; } - + for (Direction dir : BlocksHelper.HORIZONTAL) { if (!world.isEmptyBlock(blockPos.relative(dir))) { return false; } } - + int maxD = getYOffset() + 2; int maxV = getYOffset() - 2; - + return BlocksHelper.upRay(world, blockPos, maxD) > maxV && BlocksHelper.downRay(world, blockPos, maxD) > maxV; } - + @Override protected boolean canSpawn(WorldGenLevel world, BlockPos pos) { return true; } - + @Override protected BlockPos getCenterGround(WorldGenLevel world, BlockPos pos) { return new BlockPos(pos.getX(), MHelper.randRange(32, 192, world.getRandom()), pos.getZ()); } - + protected boolean getGroundPlant(WorldGenLevel world, MutableBlockPos pos) { pos.setY(pos.getY() + MHelper.randRange(-getYOffset(), getYOffset(), world.getRandom())); return true; diff --git a/src/main/java/ru/betterend/world/features/UnderwaterPlantFeature.java b/src/main/java/ru/betterend/world/features/UnderwaterPlantFeature.java index 1da85b42..bbc6fc6e 100644 --- a/src/main/java/ru/betterend/world/features/UnderwaterPlantFeature.java +++ b/src/main/java/ru/betterend/world/features/UnderwaterPlantFeature.java @@ -11,17 +11,17 @@ import java.util.Random; public class UnderwaterPlantFeature extends UnderwaterPlantScatter { private final Block plant; - + public UnderwaterPlantFeature(Block plant, int radius) { super(radius); this.plant = plant; } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { return super.canSpawn(world, blockPos) && plant.canSurvive(plant.defaultBlockState(), world, blockPos); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { if (plant instanceof BaseDoublePlantBlock) { diff --git a/src/main/java/ru/betterend/world/features/UnderwaterPlantScatter.java b/src/main/java/ru/betterend/world/features/UnderwaterPlantScatter.java index 6fac8d50..38106f16 100644 --- a/src/main/java/ru/betterend/world/features/UnderwaterPlantScatter.java +++ b/src/main/java/ru/betterend/world/features/UnderwaterPlantScatter.java @@ -9,11 +9,11 @@ import java.util.Random; public abstract class UnderwaterPlantScatter extends ScatterFeature { private static final MutableBlockPos POS = new MutableBlockPos(); - + public UnderwaterPlantScatter(int radius) { super(radius); } - + @Override protected BlockPos getCenterGround(WorldGenLevel world, BlockPos pos) { POS.setX(pos.getX()); @@ -21,32 +21,32 @@ public abstract class UnderwaterPlantScatter extends ScatterFeature { POS.setY(0); return getGround(world, POS).immutable(); } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { return world.getBlockState(blockPos).is(Blocks.WATER); } - + @Override protected boolean canSpawn(WorldGenLevel world, BlockPos pos) { return world.getBlockState(pos).is(Blocks.WATER); } - + @Override protected boolean getGroundPlant(WorldGenLevel world, MutableBlockPos pos) { return getGround(world, pos).getY() < 128; } - + @Override protected int getYOffset() { return -5; } - + @Override protected int getChance() { return 5; } - + private BlockPos getGround(WorldGenLevel world, MutableBlockPos pos) { while (pos.getY() < 128 && world.getFluidState(pos).isEmpty()) { pos.setY(pos.getY() + 1); diff --git a/src/main/java/ru/betterend/world/features/VineFeature.java b/src/main/java/ru/betterend/world/features/VineFeature.java index 7e5beb3d..366fbee6 100644 --- a/src/main/java/ru/betterend/world/features/VineFeature.java +++ b/src/main/java/ru/betterend/world/features/VineFeature.java @@ -15,20 +15,20 @@ public class VineFeature extends InvertedScatterFeature { private final Block vineBlock; private final int maxLength; private final boolean vine; - + public VineFeature(Block vineBlock, int maxLength) { super(6); this.vineBlock = vineBlock; this.maxLength = maxLength; this.vine = vineBlock instanceof BaseVineBlock; } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) { BlockState state = world.getBlockState(blockPos); return state.getMaterial().isReplaceable() && canPlaceBlock(state, world, blockPos); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos blockPos) { int h = BlocksHelper.downRay(world, blockPos, random.nextInt(maxLength)) - 1; @@ -43,7 +43,7 @@ public class VineFeature extends InvertedScatterFeature { BlocksHelper.setWithoutUpdate(world, blockPos.below(h), bottom); } } - + private boolean canPlaceBlock(BlockState state, WorldGenLevel world, BlockPos blockPos) { if (vine) { return ((BaseVineBlock) vineBlock).canGenerate(state, world, blockPos); @@ -52,17 +52,17 @@ public class VineFeature extends InvertedScatterFeature { return vineBlock.canSurvive(state, world, blockPos); } } - + private BlockState getTopState() { BlockState state = vineBlock.defaultBlockState(); return vine ? state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP) : state; } - + private BlockState getMiggleState() { BlockState state = vineBlock.defaultBlockState(); return vine ? state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE) : state; } - + private BlockState getBottomState() { BlockState state = vineBlock.defaultBlockState(); return vine ? state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM) : state; diff --git a/src/main/java/ru/betterend/world/features/WallPlantFeature.java b/src/main/java/ru/betterend/world/features/WallPlantFeature.java index 0e219ee1..00e346d1 100644 --- a/src/main/java/ru/betterend/world/features/WallPlantFeature.java +++ b/src/main/java/ru/betterend/world/features/WallPlantFeature.java @@ -14,12 +14,12 @@ import java.util.Random; public class WallPlantFeature extends WallScatterFeature { private final Block block; - + public WallPlantFeature(Block block, int radius) { super(radius); this.block = block; } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos pos, Direction dir) { if (block instanceof BaseWallPlantBlock) { @@ -32,7 +32,7 @@ public class WallPlantFeature extends WallScatterFeature { } return block.canSurvive(block.defaultBlockState(), world, pos); } - + @Override public void generate(WorldGenLevel world, Random random, BlockPos pos, Direction dir) { BlockState state = block.defaultBlockState(); diff --git a/src/main/java/ru/betterend/world/features/WallPlantOnLogFeature.java b/src/main/java/ru/betterend/world/features/WallPlantOnLogFeature.java index a8b4f6e0..ddbe8993 100644 --- a/src/main/java/ru/betterend/world/features/WallPlantOnLogFeature.java +++ b/src/main/java/ru/betterend/world/features/WallPlantOnLogFeature.java @@ -13,7 +13,7 @@ public class WallPlantOnLogFeature extends WallPlantFeature { public WallPlantOnLogFeature(Block block, int radius) { super(block, radius); } - + @Override public boolean canGenerate(WorldGenLevel world, Random random, BlockPos pos, Direction dir) { BlockPos blockPos = pos.relative(dir.getOpposite()); diff --git a/src/main/java/ru/betterend/world/features/WallScatterFeature.java b/src/main/java/ru/betterend/world/features/WallScatterFeature.java index 951af5ba..ea32e39b 100644 --- a/src/main/java/ru/betterend/world/features/WallScatterFeature.java +++ b/src/main/java/ru/betterend/world/features/WallScatterFeature.java @@ -16,15 +16,15 @@ import java.util.Random; public abstract class WallScatterFeature extends DefaultFeature { private static final Direction[] DIR = BlocksHelper.makeHorizontal(); private final int radius; - + public WallScatterFeature(int radius) { this.radius = radius; } - + public abstract boolean canGenerate(WorldGenLevel world, Random random, BlockPos pos, Direction dir); - + public abstract void generate(WorldGenLevel world, Random random, BlockPos pos, Direction dir); - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -36,7 +36,7 @@ public abstract class WallScatterFeature extends DefaultFeature { return false; } int py = MHelper.randRange(minY, maxY, random); - + MutableBlockPos mut = new MutableBlockPos(); for (int x = -radius; x <= radius; x++) { mut.setX(center.getX() + x); @@ -56,10 +56,10 @@ public abstract class WallScatterFeature extends DefaultFeature { } } } - + return true; } - + private void shuffle(Random random) { for (int i = 0; i < 4; i++) { int j = random.nextInt(4); diff --git a/src/main/java/ru/betterend/world/features/bushes/BushFeature.java b/src/main/java/ru/betterend/world/features/bushes/BushFeature.java index a97c5d2f..20768d89 100644 --- a/src/main/java/ru/betterend/world/features/bushes/BushFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/BushFeature.java @@ -28,21 +28,20 @@ public class BushFeature extends DefaultFeature { private static final Function REPLACE; private final Block leaves; private final Block stem; - + public BushFeature(Block leaves, Block stem) { this.leaves = leaves; this.stem = stem; } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) - && !world.getBlockState(pos.above()).is(TagAPI.END_GROUND)) + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above()).is(TagAPI.END_GROUND)) return false; - + float radius = MHelper.randRange(1.8F, 3.5F, random); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); SDF sphere = new SDFSphere().setRadius(radius).setBlock(this.leaves); @@ -53,8 +52,7 @@ public class BushFeature extends DefaultFeature { sphere = new SDFDisplacement().setFunction((vec) -> { return MHelper.randRange(-2F, 2F, random); }).setSource(sphere); - sphere = new SDFSubtraction().setSourceA(sphere) - .setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); + sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); sphere.setReplaceFunction(REPLACE); sphere.addPostProcess((info) -> { if (info.getState().getBlock() instanceof LeavesBlock) { @@ -74,18 +72,17 @@ public class BushFeature extends DefaultFeature { BlockPos p = pos.relative(d); if (world.isEmptyBlock(p)) { if (leaves instanceof LeavesBlock) { - BlocksHelper.setWithoutUpdate(world, p, - leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1)); + BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1)); } else { BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState()); } } } - + return true; } - + static { REPLACE = (state) -> { if (state.getMaterial().equals(Material.PLANT)) { diff --git a/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java b/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java index 2c840d9b..26ac4748 100644 --- a/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/BushWithOuterFeature.java @@ -31,22 +31,21 @@ public class BushWithOuterFeature extends DefaultFeature { private final Block outer_leaves; private final Block leaves; private final Block stem; - + public BushWithOuterFeature(Block leaves, Block outer_leaves, Block stem) { this.outer_leaves = outer_leaves; this.leaves = leaves; this.stem = stem; } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) - && !world.getBlockState(pos.above()).is(TagAPI.END_GROUND)) + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above()).is(TagAPI.END_GROUND)) return false; - + float radius = MHelper.randRange(1.8F, 3.5F, random); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); SDF sphere = new SDFSphere().setRadius(radius).setBlock(this.leaves); @@ -57,8 +56,7 @@ public class BushWithOuterFeature extends DefaultFeature { sphere = new SDFDisplacement().setFunction((vec) -> { return MHelper.randRange(-2F, 2F, random); }).setSource(sphere); - sphere = new SDFSubtraction().setSourceA(sphere) - .setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); + sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); sphere.setReplaceFunction(REPLACE); sphere.addPostProcess((info) -> { if (info.getState().getBlock() instanceof LeavesBlock) { @@ -76,8 +74,7 @@ public class BushWithOuterFeature extends DefaultFeature { MHelper.shuffle(DIRECTIONS, random); for (Direction dir : DIRECTIONS) { if (info.getState(dir).isAir()) { - info.setBlockPos(info.getPos().relative(dir), - outer_leaves.defaultBlockState().setValue(BlockStateProperties.FACING, dir)); + info.setBlockPos(info.getPos().relative(dir), outer_leaves.defaultBlockState().setValue(BlockStateProperties.FACING, dir)); } } } @@ -89,18 +86,17 @@ public class BushWithOuterFeature extends DefaultFeature { BlockPos p = pos.relative(d); if (world.isEmptyBlock(p)) { if (leaves instanceof LeavesBlock) { - BlocksHelper.setWithoutUpdate(world, p, - leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1)); + BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1)); } else { BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState()); } } } - + return true; } - + static { REPLACE = (state) -> { if (state.getMaterial().equals(Material.PLANT)) { diff --git a/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java b/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java index cef4abcf..189a4cf8 100644 --- a/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/LargeAmaranitaFeature.java @@ -23,9 +23,8 @@ public class LargeAmaranitaFeature extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + MutableBlockPos mut = new MutableBlockPos().set(pos); int height = MHelper.randRange(2, 3, random); for (int i = 1; i < height; i++) { @@ -35,16 +34,14 @@ public class LargeAmaranitaFeature extends DefaultFeature { } } mut.set(pos); - + BlockState state = EndBlocks.LARGE_AMARANITA_MUSHROOM.defaultBlockState(); BlocksHelper.setWithUpdate(world, mut, state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM)); if (height > 2) { - BlocksHelper.setWithUpdate(world, mut.move(Direction.UP), - state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE)); + BlocksHelper.setWithUpdate(world, mut.move(Direction.UP), state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE)); } - BlocksHelper.setWithUpdate(world, mut.move(Direction.UP), - state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP)); - + BlocksHelper.setWithUpdate(world, mut.move(Direction.UP), state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP)); + return true; } } diff --git a/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java b/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java index 2f4aab60..a6abc5d0 100644 --- a/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java +++ b/src/main/java/ru/betterend/world/features/bushes/Lumecorn.java @@ -23,9 +23,8 @@ public class Lumecorn extends DefaultFeature { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + int height = MHelper.randRange(4, 7, random); MutableBlockPos mut = new MutableBlockPos().set(pos); for (int i = 1; i < height; i++) { @@ -35,30 +34,23 @@ public class Lumecorn extends DefaultFeature { } } mut.set(pos); - BlockState topMiddle = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, - LumecornShape.LIGHT_TOP_MIDDLE); - BlockState middle = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, - LumecornShape.LIGHT_MIDDLE); - BlockState bottom = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, - LumecornShape.LIGHT_BOTTOM); + BlockState topMiddle = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_TOP_MIDDLE); + BlockState middle = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_MIDDLE); + BlockState bottom = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_BOTTOM); BlockState top = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_TOP); if (height == 4) { - BlocksHelper.setWithoutUpdate(world, mut, - EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL)); + BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL)); BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), bottom); BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), topMiddle); BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), top); return true; } if (random.nextBoolean()) { - BlocksHelper.setWithoutUpdate(world, mut, - EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL)); + BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL)); } else { - BlocksHelper.setWithoutUpdate(world, mut, - EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_BIG)); - BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), - EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.MIDDLE)); + BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_BIG)); + BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.MIDDLE)); height--; } BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), bottom); diff --git a/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java b/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java index 9b1bb218..afff518e 100644 --- a/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java +++ b/src/main/java/ru/betterend/world/features/bushes/TenaneaBushFeature.java @@ -33,29 +33,25 @@ import java.util.function.Function; public class TenaneaBushFeature extends DefaultFeature { private static final Function REPLACE; private static final Direction[] DIRECTIONS = Direction.values(); - + public TenaneaBushFeature() { } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + float radius = MHelper.randRange(1.8F, 3.5F, random); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); BlockState leaves = EndBlocks.TENANEA_LEAVES.defaultBlockState(); SDF sphere = new SDFSphere().setRadius(radius).setBlock(leaves); sphere = new SDFScale3D().setScale(1, 0.75F, 1).setSource(sphere); - sphere = new SDFDisplacement().setFunction((vec) -> - (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 3).setSource(sphere); - sphere = new SDFDisplacement().setFunction((vec) -> - MHelper.randRange(-2F, 2F, random)).setSource(sphere); - sphere = new SDFSubtraction().setSourceA(sphere) - .setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); + sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 3).setSource(sphere); + sphere = new SDFDisplacement().setFunction((vec) -> MHelper.randRange(-2F, 2F, random)).setSource(sphere); + sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); sphere.setReplaceFunction(REPLACE); List support = Lists.newArrayList(); sphere.addPostProcess((info) -> { @@ -66,15 +62,14 @@ public class TenaneaBushFeature extends DefaultFeature { BlockPos d = info.getPos().below(); support.add(d); } - + MHelper.shuffle(DIRECTIONS, random); for (Direction d : DIRECTIONS) { if (info.getState(d).isAir()) { - info.setBlockPos(info.getPos().relative(d), - EndBlocks.TENANEA_OUTER_LEAVES.defaultBlockState().setValue(FurBlock.FACING, d)); + info.setBlockPos(info.getPos().relative(d), EndBlocks.TENANEA_OUTER_LEAVES.defaultBlockState().setValue(FurBlock.FACING, d)); } } - + return info.getState().setValue(LeavesBlock.DISTANCE, distance); } else { @@ -92,14 +87,11 @@ public class TenaneaBushFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, p, leaves.setValue(LeavesBlock.DISTANCE, 1)); } } - + MutableBlockPos mut = new MutableBlockPos(); - BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, - TripleShape.TOP); - BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, - TripleShape.MIDDLE); - BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, - TripleShape.BOTTOM); + BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP); + BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE); + BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM); support.forEach((bpos) -> { BlockState state = world.getBlockState(bpos); if (state.isAir() || state.is(EndBlocks.TENANEA_OUTER_LEAVES)) { @@ -120,10 +112,10 @@ public class TenaneaBushFeature extends DefaultFeature { } } }); - + return true; } - + static { REPLACE = (state) -> { if (state.getMaterial().equals(Material.PLANT)) { diff --git a/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java b/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java index 87385f7a..e46350e2 100644 --- a/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/BigAuroraCrystalFeature.java @@ -25,26 +25,24 @@ public class BigAuroraCrystalFeature extends DefaultFeature { final WorldGenLevel world = featureConfig.level(); int maxY = pos.getY() + BlocksHelper.upRay(world, pos, 16); int minY = pos.getY() - BlocksHelper.downRay(world, pos, 16); - + if (maxY - minY < 10) { return false; } - + int y = MHelper.randRange(minY, maxY, random); pos = new BlockPos(pos.getX(), y, pos.getZ()); - + int height = MHelper.randRange(5, 25, random); - SDF prism = new SDFHexPrism().setHeight(height).setRadius(MHelper.randRange(1.7F, 3F, random)) - .setBlock(EndBlocks.AURORA_CRYSTAL); + SDF prism = new SDFHexPrism().setHeight(height).setRadius(MHelper.randRange(1.7F, 3F, random)).setBlock(EndBlocks.AURORA_CRYSTAL); Vector3f vec = MHelper.randomHorizontal(random); prism = new SDFRotation().setRotation(vec, random.nextFloat()).setSource(prism); prism.setReplaceFunction((bState) -> { - return bState.getMaterial().isReplaceable() || bState.is(TagAPI.GEN_TERRAIN) - || bState.getMaterial().equals(Material.PLANT) || bState.getMaterial().equals(Material.LEAVES); + return bState.getMaterial().isReplaceable() || bState.is(TagAPI.GEN_TERRAIN) || bState.getMaterial().equals(Material.PLANT) || bState.getMaterial().equals(Material.LEAVES); }); prism.fillRecursive(world, pos); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.AURORA_CRYSTAL); - + return true; } } diff --git a/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java b/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java index c4e889a7..943ddfe0 100644 --- a/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/DesertLakeFeature.java @@ -23,7 +23,7 @@ public class DesertLakeFeature extends DefaultFeature { private static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState(); private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(15152); private static final MutableBlockPos POS = new MutableBlockPos(); - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -35,35 +35,35 @@ public class DesertLakeFeature extends DefaultFeature { int dist2 = MHelper.floor(radius * 1.5); int bott = MHelper.floor(depth); blockPos = getPosOnSurfaceWG(world, blockPos); - + if (blockPos.getY() < 10) return false; - + int waterLevel = blockPos.getY(); - + BlockPos pos = getPosOnSurfaceRaycast(world, blockPos.north(dist).above(10), 20); if (Math.abs(blockPos.getY() - pos.getY()) > 5) return false; waterLevel = MHelper.min(pos.getY(), waterLevel); - + pos = getPosOnSurfaceRaycast(world, blockPos.south(dist).above(10), 20); if (Math.abs(blockPos.getY() - pos.getY()) > 5) return false; waterLevel = MHelper.min(pos.getY(), waterLevel); - + pos = getPosOnSurfaceRaycast(world, blockPos.east(dist).above(10), 20); if (Math.abs(blockPos.getY() - pos.getY()) > 5) return false; waterLevel = MHelper.min(pos.getY(), waterLevel); - + pos = getPosOnSurfaceRaycast(world, blockPos.west(dist).above(10), 20); if (Math.abs(blockPos.getY() - pos.getY()) > 5) return false; waterLevel = MHelper.min(pos.getY(), waterLevel); BlockState state; - + int minX = blockPos.getX() - dist2; int maxX = blockPos.getX() + dist2; int minZ = blockPos.getZ() - dist2; int maxZ = blockPos.getZ() + dist2; int maskMinX = minX - 1; int maskMinZ = minZ - 1; - + boolean[][] mask = new boolean[maxX - minX + 3][maxZ - minZ + 3]; for (int x = minX; x <= maxX; x++) { POS.setX(x); @@ -89,7 +89,7 @@ public class DesertLakeFeature extends DefaultFeature { } } } - + for (int x = minX; x <= maxX; x++) { POS.setX(x); int x2 = x - blockPos.getX(); @@ -120,8 +120,7 @@ public class DesertLakeFeature extends DefaultFeature { pos = POS.below(); if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) { state = world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); - if (y > waterLevel + 1) - BlocksHelper.setWithoutUpdate(world, pos, state); + if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state); else if (y > waterLevel) BlocksHelper.setWithoutUpdate(world, pos, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState()); else @@ -136,9 +135,9 @@ public class DesertLakeFeature extends DefaultFeature { } } } - + double aspect = ((double) radius / (double) depth); - + for (int x = blockPos.getX() - dist; x <= blockPos.getX() + dist; x++) { POS.setX(x); int x2 = x - blockPos.getX(); @@ -197,17 +196,13 @@ public class DesertLakeFeature extends DefaultFeature { } } } - + BlockFixer.fixBlocks(world, new BlockPos(minX - 2, waterLevel - 2, minZ - 2), new BlockPos(maxX + 2, blockPos.getY() + 20, maxZ + 2)); - + return true; } - + private boolean canReplace(BlockState state) { - return state.getMaterial().isReplaceable() - || state.is(TagAPI.GEN_TERRAIN) - || state.is(EndBlocks.ENDSTONE_DUST) - || state.getMaterial().equals(Material.PLANT) - || state.getMaterial().equals(Material.WATER_PLANT); + return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.WATER_PLANT); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java b/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java index 3a0e2c25..83468973 100644 --- a/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/EndLakeFeature.java @@ -23,7 +23,7 @@ public class EndLakeFeature extends DefaultFeature { private static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState(); private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(15152); private static final MutableBlockPos POS = new MutableBlockPos(); - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -35,35 +35,35 @@ public class EndLakeFeature extends DefaultFeature { int dist2 = MHelper.floor(radius * 1.5); int bott = MHelper.floor(depth); blockPos = getPosOnSurfaceWG(world, blockPos); - + if (blockPos.getY() < 10) return false; - + int waterLevel = blockPos.getY(); - + BlockPos pos = getPosOnSurfaceRaycast(world, blockPos.north(dist).above(10), 20); if (Math.abs(blockPos.getY() - pos.getY()) > 5) return false; waterLevel = MHelper.min(pos.getY(), waterLevel); - + pos = getPosOnSurfaceRaycast(world, blockPos.south(dist).above(10), 20); if (Math.abs(blockPos.getY() - pos.getY()) > 5) return false; waterLevel = MHelper.min(pos.getY(), waterLevel); - + pos = getPosOnSurfaceRaycast(world, blockPos.east(dist).above(10), 20); if (Math.abs(blockPos.getY() - pos.getY()) > 5) return false; waterLevel = MHelper.min(pos.getY(), waterLevel); - + pos = getPosOnSurfaceRaycast(world, blockPos.west(dist).above(10), 20); if (Math.abs(blockPos.getY() - pos.getY()) > 5) return false; waterLevel = MHelper.min(pos.getY(), waterLevel); BlockState state; - + int minX = blockPos.getX() - dist2; int maxX = blockPos.getX() + dist2; int minZ = blockPos.getZ() - dist2; int maxZ = blockPos.getZ() + dist2; int maskMinX = minX - 1; int maskMinZ = minZ - 1; - + boolean[][] mask = new boolean[maxX - minX + 3][maxZ - minZ + 3]; for (int x = minX; x <= maxX; x++) { POS.setX(x); @@ -89,7 +89,7 @@ public class EndLakeFeature extends DefaultFeature { } } } - + for (int x = minX; x <= maxX; x++) { POS.setX(x); int x2 = x - blockPos.getX(); @@ -120,8 +120,7 @@ public class EndLakeFeature extends DefaultFeature { pos = POS.below(); if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) { state = world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); - if (y > waterLevel + 1) - BlocksHelper.setWithoutUpdate(world, pos, state); + if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state); else if (y > waterLevel) BlocksHelper.setWithoutUpdate(world, pos, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState()); else @@ -136,9 +135,9 @@ public class EndLakeFeature extends DefaultFeature { } } } - + double aspect = ((double) radius / (double) depth); - + for (int x = blockPos.getX() - dist; x <= blockPos.getX() + dist; x++) { POS.setX(x); int x2 = x - blockPos.getX(); @@ -191,17 +190,13 @@ public class EndLakeFeature extends DefaultFeature { } } } - + BlockFixer.fixBlocks(world, new BlockPos(minX - 2, waterLevel - 2, minZ - 2), new BlockPos(maxX + 2, blockPos.getY() + 20, maxZ + 2)); - + return true; } - + private boolean canReplace(BlockState state) { - return state.getMaterial().isReplaceable() - || state.is(TagAPI.GEN_TERRAIN) - || state.is(EndBlocks.ENDSTONE_DUST) - || state.getMaterial().equals(Material.PLANT) - || state.getMaterial().equals(Material.WATER_PLANT); + return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.WATER_PLANT); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java b/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java index 532a158f..f9ceac04 100644 --- a/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/FallenPillarFeature.java @@ -27,16 +27,14 @@ public class FallenPillarFeature extends DefaultFeature { final Random random = featureConfig.random(); BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - pos = getPosOnSurface(world, - new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))); + pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))); if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) { return false; } - + float height = MHelper.randRange(20F, 40F, random); float radius = MHelper.randRange(2F, 4F, random); - SDF pillar = new SDFCappedCone().setRadius1(radius).setRadius2(radius).setHeight(height * 0.5F) - .setBlock(Blocks.OBSIDIAN); + SDF pillar = new SDFCappedCone().setRadius1(radius).setRadius2(radius).setHeight(height * 0.5F).setBlock(Blocks.OBSIDIAN); pillar = new SDFTranslate().setTranslate(0, radius * 0.5F - 2, 0).setSource(pillar); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); pillar = new SDFDisplacement().setFunction((vec) -> { @@ -45,7 +43,7 @@ public class FallenPillarFeature extends DefaultFeature { Vector3f vec = MHelper.randomHorizontal(random); float angle = (float) random.nextGaussian() * 0.05F + (float) Math.PI; pillar = new SDFRotation().setRotation(vec, angle).setSource(pillar); - + BlockState mossy = EndBlocks.MOSSY_OBSIDIAN.defaultBlockState(); pillar.addPostProcess((info) -> { if (info.getStateUp().isAir() && random.nextFloat() > 0.1F) { @@ -53,10 +51,9 @@ public class FallenPillarFeature extends DefaultFeature { } return info.getState(); }).setReplaceFunction((state) -> { - return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) - || state.getMaterial().equals(Material.PLANT); + return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT); }).fillRecursive(world, pos); - + return true; } } diff --git a/src/main/java/ru/betterend/world/features/terrain/FloatingSpireFeature.java b/src/main/java/ru/betterend/world/features/terrain/FloatingSpireFeature.java index c0734595..ba395aaf 100644 --- a/src/main/java/ru/betterend/world/features/terrain/FloatingSpireFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/FloatingSpireFeature.java @@ -28,13 +28,12 @@ public class FloatingSpireFeature extends SpireFeature { final WorldGenLevel world = featureConfig.level(); final ChunkGenerator chunkGenerator = featureConfig.chunkGenerator(); int minY = getYOnSurface(world, pos.getX(), pos.getZ()); - int y = minY > 57 ? MHelper.floor(MHelper.randRange(minY, minY * 2, random) * 0.5F + 32) - : MHelper.randRange(64, 192, random); + int y = minY > 57 ? MHelper.floor(MHelper.randRange(minY, minY * 2, random) * 0.5F + 32) : MHelper.randRange(64, 192, random); pos = new BlockPos(pos.getX(), y, pos.getZ()); - + SDF sdf = new SDFSphere().setRadius(MHelper.randRange(2, 3, random)).setBlock(Blocks.END_STONE); int count = MHelper.randRange(3, 5, random); - + for (int i = 0; i < count; i++) { float rMin = (i * 1.3F) + 2.5F; sdf = addSegment(sdf, MHelper.randRange(rMin, rMin + 1.5F, random), random); @@ -43,11 +42,10 @@ public class FloatingSpireFeature extends SpireFeature { float rMin = (i * 1.3F) + 2.5F; sdf = addSegment(sdf, MHelper.randRange(rMin, rMin + 1.5F, random), random); } - + OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); sdf = new SDFDisplacement().setFunction((vec) -> { - return (float) (Math.abs(noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1)) * 3F - + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F); + return (float) (Math.abs(noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1)) * 3F + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F); }).setSource(sdf); final BlockPos center = pos; List support = Lists.newArrayList(); @@ -59,19 +57,18 @@ public class FloatingSpireFeature extends SpireFeature { return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); } else if (info.getState(Direction.UP, 3).isAir()) { - return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig() - .getUnderMaterial(); + return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getUnderMaterial(); } return info.getState(); }); sdf.fillRecursive(world, center); - + support.forEach((bpos) -> { if (BiomeAPI.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) { EndFeatures.TENANEA_BUSH.getFeature().place(new FeaturePlaceContext<>(world, chunkGenerator, random, bpos, null)); } }); - + return true; } } diff --git a/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java b/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java index 596b71b1..80179102 100644 --- a/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/GeyserFeature.java @@ -45,18 +45,18 @@ public class GeyserFeature extends DefaultFeature { protected static final Function REPLACE2; private static final Function IGNORE; private static final Direction[] HORIZONTAL = BlocksHelper.makeHorizontal(); - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final WorldGenLevel world = featureConfig.level(); final BlockPos pos = getPosOnSurfaceWG(world, featureConfig.origin()); final ChunkGenerator chunkGenerator = featureConfig.chunkGenerator(); - + if (pos.getY() < 10) { return false; } - + MutableBlockPos bpos = new MutableBlockPos().set(pos); bpos.setY(bpos.getY() - 1); BlockState state = world.getBlockState(bpos); @@ -64,105 +64,102 @@ public class GeyserFeature extends DefaultFeature { bpos.setY(bpos.getY() - 1); state = world.getBlockState(bpos); } - + if (pos.getY() - bpos.getY() < 25) { return false; } - + int halfHeight = MHelper.randRange(10, 20, random); float radius1 = halfHeight * 0.5F; float radius2 = halfHeight * 0.1F + 0.5F; - SDF sdf = new SDFCappedCone().setHeight(halfHeight).setRadius1(radius1).setRadius2(radius2) - .setBlock(EndBlocks.SULPHURIC_ROCK.stone); + SDF sdf = new SDFCappedCone().setHeight(halfHeight).setRadius1(radius1).setRadius2(radius2).setBlock(EndBlocks.SULPHURIC_ROCK.stone); sdf = new SDFTranslate().setTranslate(0, halfHeight - 3, 0).setSource(sdf); - + int count = halfHeight; for (int i = 0; i < count; i++) { int py = i << 1; float delta = (float) i / (float) (count - 1); float radius = Mth.lerp(delta, radius1, radius2) * 1.3F; - - SDF bowl = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius) - .setBlock(EndBlocks.SULPHURIC_ROCK.stone); - - SDF brimstone = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius) - .setBlock(EndBlocks.BRIMSTONE); + + SDF bowl = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.SULPHURIC_ROCK.stone); + + SDF brimstone = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.BRIMSTONE); brimstone = new SDFTranslate().setTranslate(0, 2F, 0).setSource(brimstone); bowl = new SDFSubtraction().setSourceA(bowl).setSourceB(brimstone); bowl = new SDFUnion().setSourceA(brimstone).setSourceB(bowl); - + SDF water = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(Blocks.WATER); water = new SDFTranslate().setTranslate(0, 4, 0).setSource(water); bowl = new SDFSubtraction().setSourceA(bowl).setSourceB(water); bowl = new SDFUnion().setSourceA(water).setSourceB(bowl); - + final OpenSimplexNoise noise1 = new OpenSimplexNoise(random.nextLong()); final OpenSimplexNoise noise2 = new OpenSimplexNoise(random.nextLong()); - + bowl = new SDFCoordModify().setFunction((vec) -> { float dx = (float) noise1.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1); float dz = (float) noise2.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1); vec.set(vec.x() + dx, vec.y(), vec.z() + dz); }).setSource(bowl); - + SDF cut = new SDFFlatland().setBlock(Blocks.AIR); cut = new SDFInvert().setSource(cut); cut = new SDFTranslate().setTranslate(0, radius - 2, 0).setSource(cut); bowl = new SDFSubtraction().setSourceA(bowl).setSourceB(cut); - + bowl = new SDFTranslate().setTranslate(radius, py - radius, 0).setSource(bowl); bowl = new SDFRotation().setRotation(Vector3f.YP, i * 4F).setSource(bowl); sdf = new SDFUnion().setSourceA(sdf).setSourceB(bowl); } sdf.setReplaceFunction(REPLACE2).fillRecursive(world, pos); - + radius2 = radius2 * 0.5F; if (radius2 < 0.7F) { radius2 = 0.7F; } final OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); - + SDFPrimitive obj1; SDFPrimitive obj2; - + obj1 = new SDFCappedCone().setHeight(halfHeight + 5).setRadius1(radius1 * 0.5F).setRadius2(radius2); sdf = new SDFTranslate().setTranslate(0, halfHeight - 13, 0).setSource(obj1); sdf = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.x() * 0.3F, vec.y() * 0.3F, vec.z() * 0.3F) * 0.5F; }).setSource(sdf); - + obj2 = new SDFSphere().setRadius(radius1); SDF cave = new SDFScale3D().setScale(1.5F, 1, 1.5F).setSource(obj2); cave = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.x() * 0.1F, vec.y() * 0.1F, vec.z() * 0.1F) * 2F; }).setSource(cave); cave = new SDFTranslate().setTranslate(0, -halfHeight - 10, 0).setSource(cave); - + sdf = new SDFSmoothUnion().setRadius(5).setSourceA(cave).setSourceB(sdf); - + obj1.setBlock(WATER); obj2.setBlock(WATER); sdf.setReplaceFunction(REPLACE2); sdf.fillRecursive(world, pos); - + obj1.setBlock(EndBlocks.BRIMSTONE); obj2.setBlock(EndBlocks.BRIMSTONE); new SDFDisplacement().setFunction((vec) -> { return -2F; }).setSource(sdf).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE); - + obj1.setBlock(EndBlocks.SULPHURIC_ROCK.stone); obj2.setBlock(EndBlocks.SULPHURIC_ROCK.stone); new SDFDisplacement().setFunction((vec) -> { return -4F; }).setSource(cave).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE); - + obj1.setBlock(Blocks.END_STONE); obj2.setBlock(Blocks.END_STONE); new SDFDisplacement().setFunction((vec) -> { return -6F; }).setSource(cave).setReplaceFunction(REPLACE1).fillRecursiveIgnore(world, pos, IGNORE); - + BlocksHelper.setWithoutUpdate(world, pos, WATER); MutableBlockPos mut = new MutableBlockPos().set(pos); count = getYOnSurface(world, pos.getX(), pos.getZ()) - pos.getY(); @@ -173,10 +170,9 @@ public class GeyserFeature extends DefaultFeature { } mut.setY(mut.getY() + 1); } - + for (int i = 0; i < 150; i++) { - mut.set(pos).move(MHelper.floor(random.nextGaussian() * 4 + 0.5), -halfHeight - 10, - MHelper.floor(random.nextGaussian() * 4 + 0.5)); + mut.set(pos).move(MHelper.floor(random.nextGaussian() * 4 + 0.5), -halfHeight - 10, MHelper.floor(random.nextGaussian() * 4 + 0.5)); float distRaw = MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ()); int dist = MHelper.floor(6 - distRaw) + random.nextInt(2); if (dist >= 0) { @@ -185,22 +181,19 @@ public class GeyserFeature extends DefaultFeature { mut.setY(mut.getY() - 1); state = world.getBlockState(mut); } - if (state.is(TagAPI.GEN_TERRAIN) - && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { + if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { for (int j = 0; j <= dist; j++) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); MHelper.shuffle(HORIZONTAL, random); for (Direction dir : HORIZONTAL) { BlockPos p = mut.relative(dir); if (random.nextBoolean() && world.getBlockState(p).is(Blocks.WATER)) { - BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TUBE_WORM.defaultBlockState() - .setValue(HorizontalDirectionalBlock.FACING, dir)); + BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TUBE_WORM.defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, dir)); } } mut.setY(mut.getY() + 1); } - state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.ACTIVATED, - distRaw < 2); + state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.ACTIVATED, distRaw < 2); BlocksHelper.setWithoutUpdate(world, mut, state); mut.setY(mut.getY() + 1); state = world.getBlockState(mut); @@ -212,10 +205,9 @@ public class GeyserFeature extends DefaultFeature { } } } - + for (int i = 0; i < 10; i++) { - mut.set(pos).move(MHelper.floor(random.nextGaussian() * 0.7 + 0.5), -halfHeight - 10, - MHelper.floor(random.nextGaussian() * 0.7 + 0.5)); + mut.set(pos).move(MHelper.floor(random.nextGaussian() * 0.7 + 0.5), -halfHeight - 10, MHelper.floor(random.nextGaussian() * 0.7 + 0.5)); float distRaw = MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ()); int dist = MHelper.floor(6 - distRaw) + random.nextInt(2); if (dist >= 0) { @@ -229,8 +221,7 @@ public class GeyserFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); mut.setY(mut.getY() + 1); } - state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.ACTIVATED, - distRaw < 2); + state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.ACTIVATED, distRaw < 2); BlocksHelper.setWithoutUpdate(world, mut, state); mut.setY(mut.getY() + 1); state = world.getBlockState(mut); @@ -242,22 +233,22 @@ public class GeyserFeature extends DefaultFeature { } } } - + EndFeatures.SULPHURIC_LAKE.getFeature().place(new FeaturePlaceContext<>(world, chunkGenerator, random, pos, null)); - + double distance = radius1 * 1.7; BlockPos start = pos.offset(-distance, -halfHeight - 15 - distance, -distance); BlockPos end = pos.offset(distance, -halfHeight - 5 + distance, distance); BlockFixer.fixBlocks(world, start, end); - + return true; } - + static { REPLACE1 = (state) -> { return state.isAir() || (state.is(TagAPI.GEN_TERRAIN)); }; - + REPLACE2 = (state) -> { if (state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.SULPHUR_CRYSTAL)) { return true; @@ -267,7 +258,7 @@ public class GeyserFeature extends DefaultFeature { } return state.getMaterial().isReplaceable(); }; - + IGNORE = (state) -> { return state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state.is(EndBlocks.BRIMSTONE); }; diff --git a/src/main/java/ru/betterend/world/features/terrain/IceStarFeature.java b/src/main/java/ru/betterend/world/features/terrain/IceStarFeature.java index c7f5e69c..032eefa1 100644 --- a/src/main/java/ru/betterend/world/features/terrain/IceStarFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/IceStarFeature.java @@ -24,14 +24,14 @@ public class IceStarFeature extends DefaultFeature { private final float maxSize; private final int minCount; private final int maxCount; - + public IceStarFeature(float minSize, float maxSize, int minCount, int maxCount) { this.minSize = minSize; this.maxSize = maxSize; this.minCount = minCount; this.maxCount = maxCount; } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -41,8 +41,7 @@ public class IceStarFeature extends DefaultFeature { int count = MHelper.randRange(minCount, maxCount, random); List points = getFibonacciPoints(count); SDF sdf = null; - SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F).setRadius2(0).setHeight(size) - .setBlock(EndBlocks.DENSE_SNOW); + SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F).setRadius2(0).setHeight(size).setBlock(EndBlocks.DENSE_SNOW); spike = new SDFTranslate().setTranslate(0, size - 0.5F, 0).setSource(spike); for (Vector3f point : points) { SDF rotated = spike; @@ -57,29 +56,28 @@ public class IceStarFeature extends DefaultFeature { } sdf = (sdf == null) ? rotated : new SDFUnion().setSourceA(sdf).setSourceB(rotated); } - + int x1 = (pos.getX() >> 4) << 4; int z1 = (pos.getZ() >> 4) << 4; pos = new BlockPos(x1 + random.nextInt(16), MHelper.randRange(32, 128, random), z1 + random.nextInt(16)); - + final float ancientRadius = size * 0.7F; final float denseRadius = size * 0.9F; final float iceRadius = size < 7 ? size * 5 : size * 1.3F; final float randScale = size * 0.3F; - + final BlockPos center = pos; final BlockState ice = EndBlocks.EMERALD_ICE.defaultBlockState(); final BlockState dense = EndBlocks.DENSE_EMERALD_ICE.defaultBlockState(); final BlockState ancient = EndBlocks.ANCIENT_EMERALD_ICE.defaultBlockState(); final SDF sdfCopy = sdf; - + sdf.addPostProcess((info) -> { BlockPos bpos = info.getPos(); float px = bpos.getX() - center.getX(); float py = bpos.getY() - center.getY(); float pz = bpos.getZ() - center.getZ(); - float distance = MHelper.length(px, py, pz) + sdfCopy.getDistance(px, py, pz) * 0.4F - + random.nextFloat() * randScale; + float distance = MHelper.length(px, py, pz) + sdfCopy.getDistance(px, py, pz) * 0.4F + random.nextFloat() * randScale; if (distance < ancientRadius) { return ancient; } @@ -91,10 +89,10 @@ public class IceStarFeature extends DefaultFeature { } return info.getState(); }).fillRecursive(world, pos); - + return true; } - + private List getFibonacciPoints(int count) { float max = count - 1; List result = new ArrayList(count); diff --git a/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java b/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java index 1b5e85bd..b88c2a08 100644 --- a/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/ObsidianBoulderFeature.java @@ -25,27 +25,25 @@ public class ObsidianBoulderFeature extends DefaultFeature { final Random random = featureConfig.random(); BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - pos = getPosOnSurface(world, - new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))); + pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))); if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) { return false; } - + int count = MHelper.randRange(1, 5, random); for (int i = 0; i < count; i++) { - BlockPos p = getPosOnSurface(world, - new BlockPos(pos.getX() + random.nextInt(16) - 8, pos.getY(), pos.getZ() + random.nextInt(16) - 8)); + BlockPos p = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16) - 8, pos.getY(), pos.getZ() + random.nextInt(16) - 8)); makeBoulder(world, p, random); } - + return true; } - + private void makeBoulder(WorldGenLevel world, BlockPos pos, Random random) { if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) { return; } - + float radius = MHelper.randRange(1F, 5F, random); SDF sphere = new SDFSphere().setRadius(radius).setBlock(Blocks.OBSIDIAN); float sx = MHelper.randRange(0.7F, 1.3F, random); @@ -56,7 +54,7 @@ public class ObsidianBoulderFeature extends DefaultFeature { sphere = new SDFDisplacement().setFunction((vec) -> { return (float) (noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 1.5F); }).setSource(sphere); - + BlockState mossy = EndBlocks.MOSSY_OBSIDIAN.defaultBlockState(); sphere.addPostProcess((info) -> { if (info.getStateUp().isAir() && random.nextFloat() > 0.1F) { @@ -64,8 +62,7 @@ public class ObsidianBoulderFeature extends DefaultFeature { } return info.getState(); }).setReplaceFunction((state) -> { - return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) - || state.getMaterial().equals(Material.PLANT); + return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT); }).fillRecursive(world, pos); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java b/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java index 2c4db528..c6f0b403 100644 --- a/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/ObsidianPillarBasementFeature.java @@ -33,7 +33,7 @@ public class ObsidianPillarBasementFeature extends DefaultFeature { if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) { return false; } - + float height = MHelper.randRange(10F, 35F, random); float radius = MHelper.randRange(2F, 5F, random); SDF pillar = new SDFCappedCone().setRadius1(radius).setRadius2(radius).setHeight(height * 0.5F).setBlock(Blocks.OBSIDIAN); @@ -60,7 +60,7 @@ public class ObsidianPillarBasementFeature extends DefaultFeature { }).setReplaceFunction((state) -> { return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT); }).fillRecursive(world, pos); - + return true; } } diff --git a/src/main/java/ru/betterend/world/features/terrain/OreLayerFeature.java b/src/main/java/ru/betterend/world/features/terrain/OreLayerFeature.java index d47fbc44..9a253f40 100644 --- a/src/main/java/ru/betterend/world/features/terrain/OreLayerFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/OreLayerFeature.java @@ -20,20 +20,20 @@ public class OreLayerFeature extends DefaultFeature { private static final SDFSphere SPHERE; private static final SDFCoordModify NOISE; private static final SDF FUNCTION; - + private final BlockState state; private final float radius; private final int minY; private final int maxY; private OpenSimplexNoise noise; - + public OreLayerFeature(BlockState state, float radius, int minY, int maxY) { this.state = state; this.radius = radius; this.minY = minY; this.maxY = maxY; } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -44,11 +44,11 @@ public class OreLayerFeature extends DefaultFeature { int posX = MHelper.randRange(Math.max(r - 16, 0), Math.min(31 - r, 15), random) + pos.getX(); int posZ = MHelper.randRange(Math.max(r - 16, 0), Math.min(31 - r, 15), random) + pos.getZ(); int posY = MHelper.randRange(minY, maxY, random); - + if (noise == null) { noise = new OpenSimplexNoise(world.getSeed()); } - + SPHERE.setRadius(radius).setBlock(state); NOISE.setFunction((vec) -> { double x = (vec.x() + pos.getX()) * 0.1; @@ -59,18 +59,18 @@ public class OreLayerFeature extends DefaultFeature { FUNCTION.fillRecursive(world, new BlockPos(posX, posY, posZ)); return true; } - + static { SPHERE = new SDFSphere(); NOISE = new SDFCoordModify(); - + SDF body = SPHERE; body = new SDFScale3D().setScale(1, 0.2F, 1).setSource(body); body = NOISE.setSource(body); body.setReplaceFunction((state) -> { return state.is(Blocks.END_STONE); }); - + FUNCTION = body; } } diff --git a/src/main/java/ru/betterend/world/features/terrain/SingleBlockFeature.java b/src/main/java/ru/betterend/world/features/terrain/SingleBlockFeature.java index e7bcd5b0..41701817 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SingleBlockFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SingleBlockFeature.java @@ -15,11 +15,11 @@ import java.util.Random; public class SingleBlockFeature extends DefaultFeature { private final Block block; - + public SingleBlockFeature(Block block) { this.block = block; } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -28,14 +28,14 @@ public class SingleBlockFeature extends DefaultFeature { if (!world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN)) { return false; } - + BlockState state = block.defaultBlockState(); if (block.getStateDefinition().getProperty("waterlogged") != null) { boolean waterlogged = !world.getFluidState(pos).isEmpty(); state = state.setValue(BlockStateProperties.WATERLOGGED, waterlogged); } BlocksHelper.setWithoutUpdate(world, pos, state); - + return true; } } diff --git a/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java b/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java index 1dcf48bd..c69bf173 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SmaragdantCrystalFeature.java @@ -24,16 +24,14 @@ public class SmaragdantCrystalFeature extends DefaultFeature { if (!world.getBlockState(pos.below()).is(TagAPI.GEN_TERRAIN)) { return false; } - + MutableBlockPos mut = new MutableBlockPos(); int count = MHelper.randRange(15, 30, random); BlockState crystal = EndBlocks.SMARAGDANT_CRYSTAL.defaultBlockState(); BlockState shard = EndBlocks.SMARAGDANT_CRYSTAL_SHARD.defaultBlockState(); for (int i = 0; i < count; i++) { - mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, - MHelper.floor(random.nextGaussian() * 2 + 0.5)); - int dist = MHelper.floor(1.5F - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) - + random.nextInt(3); + mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5)); + int dist = MHelper.floor(1.5F - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(3); if (dist > 0) { BlockState state = world.getBlockState(mut); for (int n = 0; n < 10 && state.isAir(); n++) { @@ -46,12 +44,11 @@ public class SmaragdantCrystalFeature extends DefaultFeature { mut.setY(mut.getY() + 1); } boolean waterlogged = !world.getFluidState(mut).isEmpty(); - BlocksHelper.setWithoutUpdate(world, mut, - shard.setValue(BlockStateProperties.WATERLOGGED, waterlogged)); + BlocksHelper.setWithoutUpdate(world, mut, shard.setValue(BlockStateProperties.WATERLOGGED, waterlogged)); } } } - + return true; } } diff --git a/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java b/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java index e96165eb..6751cb6c 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SpireFeature.java @@ -30,7 +30,7 @@ import java.util.function.Function; public class SpireFeature extends DefaultFeature { protected static final Function REPLACE; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -38,11 +38,10 @@ public class SpireFeature extends DefaultFeature { final WorldGenLevel world = featureConfig.level(); final ChunkGenerator chunkGenerator = featureConfig.chunkGenerator(); pos = getPosOnSurfaceWG(world, pos); - if (pos.getY() < 10 || !world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN) - || !world.getBlockState(pos.below(6)).is(TagAPI.GEN_TERRAIN)) { + if (pos.getY() < 10 || !world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN) || !world.getBlockState(pos.below(6)).is(TagAPI.GEN_TERRAIN)) { return false; } - + SDF sdf = new SDFSphere().setRadius(MHelper.randRange(2, 3, random)).setBlock(Blocks.END_STONE); int count = MHelper.randRange(3, 7, random); for (int i = 0; i < count; i++) { @@ -51,8 +50,7 @@ public class SpireFeature extends DefaultFeature { } OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); sdf = new SDFDisplacement().setFunction((vec) -> { - return (float) (Math.abs(noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1)) * 3F - + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F); + return (float) (Math.abs(noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1)) * 3F + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F); }).setSource(sdf); final BlockPos center = pos; List support = Lists.newArrayList(); @@ -64,28 +62,26 @@ public class SpireFeature extends DefaultFeature { return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); } else if (info.getState(Direction.UP, 3).isAir()) { - return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig() - .getUnderMaterial(); + return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getUnderMaterial(); } return info.getState(); }).fillRecursive(world, center); - + support.forEach((bpos) -> { if (BiomeAPI.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) { EndFeatures.TENANEA_BUSH.getFeature().place(new FeaturePlaceContext<>(world, chunkGenerator, random, bpos, null)); } }); - + return true; } - + protected SDF addSegment(SDF sdf, float radius, Random random) { SDF sphere = new SDFSphere().setRadius(radius).setBlock(Blocks.END_STONE); - SDF offseted = new SDFTranslate().setTranslate(0, radius + random.nextFloat() * 0.25F * radius, 0) - .setSource(sdf); + SDF offseted = new SDFTranslate().setTranslate(0, radius + random.nextFloat() * 0.25F * radius, 0).setSource(sdf); return new SDFSmoothUnion().setRadius(radius * 0.5F).setSourceA(sphere).setSourceB(offseted); } - + static { REPLACE = (state) -> { if (state.is(TagAPI.END_GROUND)) { diff --git a/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java b/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java index 19979332..2ce040b0 100644 --- a/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/StalactiteFeature.java @@ -20,13 +20,13 @@ public class StalactiteFeature extends DefaultFeature { private final boolean ceiling; private final Block[] ground; private final Block block; - + public StalactiteFeature(boolean ceiling, Block block, Block... ground) { this.ceiling = ceiling; this.ground = ground; this.block = block; } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -35,12 +35,12 @@ public class StalactiteFeature extends DefaultFeature { if (!isGround(world.getBlockState(ceiling ? pos.above() : pos.below()).getBlock())) { return false; } - + MutableBlockPos mut = new MutableBlockPos().set(pos); int height = random.nextInt(16); int dir = ceiling ? -1 : 1; boolean stalagnate = false; - + for (int i = 1; i <= height; i++) { mut.setY(pos.getY() + i * dir); BlockState state = world.getBlockState(mut); @@ -50,26 +50,24 @@ public class StalactiteFeature extends DefaultFeature { break; } } - + if (!stalagnate && height > 7) { height = random.nextInt(8); } - + float center = height * 0.5F; for (int i = 0; i < height; i++) { mut.setY(pos.getY() + i * dir); int size = stalagnate ? Mth.clamp((int) (Mth.abs(i - center) + 1), 1, 7) : height - i - 1; boolean waterlogged = !world.getFluidState(mut).isEmpty(); - BlockState base = block.defaultBlockState().setValue(StalactiteBlock.SIZE, size) - .setValue(BlockStateProperties.WATERLOGGED, waterlogged); - BlockState state = stalagnate ? base.setValue(StalactiteBlock.IS_FLOOR, dir > 0 ? i < center : i > center) - : base.setValue(StalactiteBlock.IS_FLOOR, dir > 0); + BlockState base = block.defaultBlockState().setValue(StalactiteBlock.SIZE, size).setValue(BlockStateProperties.WATERLOGGED, waterlogged); + BlockState state = stalagnate ? base.setValue(StalactiteBlock.IS_FLOOR, dir > 0 ? i < center : i > center) : base.setValue(StalactiteBlock.IS_FLOOR, dir > 0); BlocksHelper.setWithoutUpdate(world, mut, state); } - + return true; } - + private boolean isGround(Block block) { for (Block b : ground) { if (b == block) { diff --git a/src/main/java/ru/betterend/world/features/terrain/SulphurHillFeature.java b/src/main/java/ru/betterend/world/features/terrain/SulphurHillFeature.java index 53266cbc..6f331805 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SulphurHillFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SulphurHillFeature.java @@ -27,7 +27,7 @@ public class SulphurHillFeature extends DefaultFeature { if (pos.getY() < 57 || pos.getY() > 70) { return false; } - + int count = MHelper.randRange(5, 13, random); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); for (int i = 0; i < count; i++) { @@ -41,7 +41,7 @@ public class SulphurHillFeature extends DefaultFeature { } return true; } - + private void makeCircle(WorldGenLevel world, BlockPos pos, OpenSimplexNoise noise, Random random) { int radius = MHelper.randRange(5, 9, random); int min = -radius - 3; diff --git a/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java index 214441cc..c19af4f2 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SulphuricCaveFeature.java @@ -29,20 +29,20 @@ public class SulphuricCaveFeature extends DefaultFeature { private static final BlockState CAVE_AIR = Blocks.CAVE_AIR.defaultBlockState(); private static final BlockState WATER = Blocks.WATER.defaultBlockState(); private static final Direction[] HORIZONTAL = BlocksHelper.makeHorizontal(); - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); int radius = MHelper.randRange(10, 30, random); - + int top = world.getHeight(Heightmap.Types.WORLD_SURFACE_WG, pos.getX(), pos.getZ()); MutableBlockPos bpos = new MutableBlockPos(); bpos.setX(pos.getX()); bpos.setZ(pos.getZ()); bpos.setY(top - 1); - + BlockState state = world.getBlockState(bpos); while (!state.is(TagAPI.GEN_TERRAIN) && bpos.getY() > 5) { bpos.setY(bpos.getY() - 1); @@ -52,32 +52,32 @@ public class SulphuricCaveFeature extends DefaultFeature { return false; } top = (int) (bpos.getY() - (radius * 1.3F + 5)); - + while (state.is(TagAPI.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) { bpos.setY(bpos.getY() - 1); state = world.getBlockState(bpos); } int bottom = (int) (bpos.getY() + radius * 1.3F + 5); - + if (top <= bottom) { return false; } - + MutableBlockPos mut = new MutableBlockPos(); pos = new BlockPos(pos.getX(), MHelper.randRange(bottom, top, random), pos.getZ()); - + OpenSimplexNoise noise = new OpenSimplexNoise(MHelper.getSeed(534, pos.getX(), pos.getZ())); - + int x1 = pos.getX() - radius - 5; int z1 = pos.getZ() - radius - 5; int x2 = pos.getX() + radius + 5; int z2 = pos.getZ() + radius + 5; int y1 = MHelper.floor(pos.getY() - (radius + 5) / 1.6); int y2 = MHelper.floor(pos.getY() + (radius + 5) / 1.6); - + double hr = radius * 0.75; double nr = radius * 0.25; - + Set brimstone = Sets.newHashSet(); BlockState rock = EndBlocks.SULPHURIC_ROCK.stone.defaultBlockState(); int waterLevel = pos.getY() + MHelper.randRange(MHelper.floor(radius * 0.8), radius, random); @@ -106,8 +106,7 @@ public class SulphuricCaveFeature extends DefaultFeature { else if (dist < r2 * r2) { state = world.getBlockState(mut); if (state.is(TagAPI.GEN_TERRAIN) || state.is(Blocks.AIR)) { - double v = noise.eval(x * 0.1, y * 0.1, z * 0.1) - + noise.eval(x * 0.03, y * 0.03, z * 0.03) * 0.5; + double v = noise.eval(x * 0.1, y * 0.1, z * 0.1) + noise.eval(x * 0.03, y * 0.03, z * 0.03) * 0.5; if (v > 0.4) { brimstone.add(mut.immutable()); } @@ -122,30 +121,26 @@ public class SulphuricCaveFeature extends DefaultFeature { brimstone.forEach((blockPos) -> { placeBrimstone(world, blockPos, random); }); - + if (random.nextInt(4) == 0) { int count = MHelper.randRange(5, 20, random); for (int i = 0; i < count; i++) { - mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 0, - MHelper.floor(random.nextGaussian() * 2 + 0.5)); - int dist = MHelper.floor(3 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) - + random.nextInt(2); + mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 0, MHelper.floor(random.nextGaussian() * 2 + 0.5)); + int dist = MHelper.floor(3 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2); if (dist > 0) { state = world.getBlockState(mut); while (!state.getFluidState().isEmpty() || state.getMaterial().equals(Material.WATER_PLANT)) { mut.setY(mut.getY() - 1); state = world.getBlockState(mut); } - if (state.is(TagAPI.GEN_TERRAIN) - && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { + if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { for (int j = 0; j <= dist; j++) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); MHelper.shuffle(HORIZONTAL, random); for (Direction dir : HORIZONTAL) { BlockPos p = mut.relative(dir); if (random.nextBoolean() && world.getBlockState(p).is(Blocks.WATER)) { - BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TUBE_WORM.defaultBlockState() - .setValue(HorizontalDirectionalBlock.FACING, dir)); + BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TUBE_WORM.defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, dir)); } } mut.setY(mut.getY() + 1); @@ -155,8 +150,7 @@ public class SulphuricCaveFeature extends DefaultFeature { state = world.getBlockState(mut); while (state.is(Blocks.WATER)) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.VENT_BUBBLE_COLUMN.defaultBlockState()); - world.getBlockTicks().scheduleTick(mut, EndBlocks.VENT_BUBBLE_COLUMN, - MHelper.randRange(8, 32, random)); + world.getBlockTicks().scheduleTick(mut, EndBlocks.VENT_BUBBLE_COLUMN, MHelper.randRange(8, 32, random)); mut.setY(mut.getY() + 1); state = world.getBlockState(mut); } @@ -164,19 +158,16 @@ public class SulphuricCaveFeature extends DefaultFeature { } } } - + BlockFixer.fixBlocks(world, new BlockPos(x1, y1, z1), new BlockPos(x2, y2, z2)); - + return true; } - + private boolean isReplaceable(BlockState state) { - return state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) - || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state.is(EndBlocks.SULPHUR_CRYSTAL) - || state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) - || state.getMaterial().equals(Material.WATER_PLANT) || state.getMaterial().equals(Material.LEAVES); + return state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state.is(EndBlocks.SULPHUR_CRYSTAL) || state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.WATER_PLANT) || state.getMaterial().equals(Material.LEAVES); } - + private void placeBrimstone(WorldGenLevel world, BlockPos pos, Random random) { BlockState state = getBrimstone(world, pos); BlocksHelper.setWithoutUpdate(world, pos, state); @@ -184,7 +175,7 @@ public class SulphuricCaveFeature extends DefaultFeature { makeShards(world, pos, random); } } - + private BlockState getBrimstone(WorldGenLevel world, BlockPos pos) { for (Direction dir : BlocksHelper.DIRECTIONS) { if (world.getBlockState(pos.relative(dir)).is(Blocks.WATER)) { @@ -193,14 +184,12 @@ public class SulphuricCaveFeature extends DefaultFeature { } return EndBlocks.BRIMSTONE.defaultBlockState(); } - + private void makeShards(WorldGenLevel world, BlockPos pos, Random random) { for (Direction dir : BlocksHelper.DIRECTIONS) { BlockPos side; if (random.nextInt(16) == 0 && world.getBlockState((side = pos.relative(dir))).is(Blocks.WATER)) { - BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState() - .setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.FACING, dir) - .setValue(SulphurCrystalBlock.AGE, random.nextInt(3)); + BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState().setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.FACING, dir).setValue(SulphurCrystalBlock.AGE, random.nextInt(3)); BlocksHelper.setWithoutUpdate(world, side, state); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java b/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java index 2e81d139..244c0a4f 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SulphuricLakeFeature.java @@ -25,26 +25,26 @@ import java.util.Set; public class SulphuricLakeFeature extends DefaultFeature { private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(15152); private static final MutableBlockPos POS = new MutableBlockPos(); - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); BlockPos blockPos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); blockPos = getPosOnSurfaceWG(world, blockPos); - + if (blockPos.getY() < 57) { return false; } - + double radius = MHelper.randRange(10.0, 20.0, random); int dist2 = MHelper.floor(radius * 1.5); - + int minX = blockPos.getX() - dist2; int maxX = blockPos.getX() + dist2; int minZ = blockPos.getZ() - dist2; int maxZ = blockPos.getZ() + dist2; - + Set brimstone = Sets.newHashSet(); for (int x = minX; x <= maxX; x++) { POS.setX(x); @@ -135,14 +135,14 @@ public class SulphuricLakeFeature extends DefaultFeature { } } } - + brimstone.forEach((bpos) -> { placeBrimstone(world, bpos, random); }); - + return true; } - + private boolean isBorder(WorldGenLevel world, BlockPos pos) { int y = pos.getY() + 1; for (Direction dir : BlocksHelper.DIRECTIONS) { @@ -152,7 +152,7 @@ public class SulphuricLakeFeature extends DefaultFeature { } return false; } - + private boolean isAbsoluteBorder(WorldGenLevel world, BlockPos pos) { int y = pos.getY() - 2; for (Direction dir : BlocksHelper.DIRECTIONS) { @@ -162,19 +162,17 @@ public class SulphuricLakeFeature extends DefaultFeature { } return false; } - + private boolean isDeepWater(WorldGenLevel world, BlockPos pos) { int y = pos.getY() + 1; for (Direction dir : BlocksHelper.DIRECTIONS) { - if (getYOnSurface(world, pos.getX() + dir.getStepX(), pos.getZ() + dir.getStepZ()) < y - || getYOnSurface(world, pos.getX() + dir.getStepX() * 2, pos.getZ() + dir.getStepZ() * 2) < y - || getYOnSurface(world, pos.getX() + dir.getStepX() * 3, pos.getZ() + dir.getStepZ() * 3) < y) { + if (getYOnSurface(world, pos.getX() + dir.getStepX(), pos.getZ() + dir.getStepZ()) < y || getYOnSurface(world, pos.getX() + dir.getStepX() * 2, pos.getZ() + dir.getStepZ() * 2) < y || getYOnSurface(world, pos.getX() + dir.getStepX() * 3, pos.getZ() + dir.getStepZ() * 3) < y) { return false; } } return true; } - + private void placeBrimstone(WorldGenLevel world, BlockPos pos, Random random) { BlockState state = getBrimstone(world, pos); BlocksHelper.setWithoutUpdate(world, pos, state); @@ -182,7 +180,7 @@ public class SulphuricLakeFeature extends DefaultFeature { makeShards(world, pos, random); } } - + private BlockState getBrimstone(WorldGenLevel world, BlockPos pos) { for (Direction dir : BlocksHelper.DIRECTIONS) { if (world.getBlockState(pos.relative(dir)).is(Blocks.WATER)) { @@ -191,14 +189,12 @@ public class SulphuricLakeFeature extends DefaultFeature { } return EndBlocks.BRIMSTONE.defaultBlockState(); } - + private void makeShards(WorldGenLevel world, BlockPos pos, Random random) { for (Direction dir : BlocksHelper.DIRECTIONS) { BlockPos side; if (random.nextInt(16) == 0 && world.getBlockState((side = pos.relative(dir))).is(Blocks.WATER)) { - BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState() - .setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.FACING, dir) - .setValue(SulphurCrystalBlock.AGE, random.nextInt(3)); + BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState().setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.FACING, dir).setValue(SulphurCrystalBlock.AGE, random.nextInt(3)); BlocksHelper.setWithoutUpdate(world, side, state); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java b/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java index e3b98484..1b205a1c 100644 --- a/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/SurfaceVentFeature.java @@ -21,12 +21,11 @@ public class SurfaceVentFeature extends DefaultFeature { final Random random = featureConfig.random(); BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - pos = getPosOnSurface(world, - new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))); + pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))); if (!world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN)) { return false; } - + MutableBlockPos mut = new MutableBlockPos(); int count = MHelper.randRange(15, 30, random); BlockState vent = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.WATERLOGGED, false); @@ -39,8 +38,7 @@ public class SurfaceVentFeature extends DefaultFeature { mut.setY(mut.getY() - 1); state = world.getBlockState(mut); } - if (state.is(TagAPI.GEN_TERRAIN) - && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { + if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) { for (int j = 0; j <= dist; j++) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone); mut.setY(mut.getY() + 1); @@ -49,7 +47,7 @@ public class SurfaceVentFeature extends DefaultFeature { } } } - + return true; } } diff --git a/src/main/java/ru/betterend/world/features/terrain/caves/CaveChunkPopulatorFeature.java b/src/main/java/ru/betterend/world/features/terrain/caves/CaveChunkPopulatorFeature.java index a1ed2856..8c7eecc7 100644 --- a/src/main/java/ru/betterend/world/features/terrain/caves/CaveChunkPopulatorFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/caves/CaveChunkPopulatorFeature.java @@ -22,11 +22,11 @@ import java.util.function.Supplier; public class CaveChunkPopulatorFeature extends DefaultFeature { private Supplier supplier; - + public CaveChunkPopulatorFeature(Supplier biome) { this.supplier = biome; } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -46,9 +46,8 @@ public class CaveChunkPopulatorFeature extends DefaultFeature { BlockFixer.fixBlocks(world, min, max); return true; } - - protected void fillSets(int sx, int sz, ChunkAccess chunk, Set floorPositions, - Set ceilPositions, MutableBlockPos min, MutableBlockPos max) { + + protected void fillSets(int sx, int sz, ChunkAccess chunk, Set floorPositions, Set ceilPositions, MutableBlockPos min, MutableBlockPos max) { MutableBlockPos mut = new MutableBlockPos(); MutableBlockPos mut2 = new MutableBlockPos(); MutableBlockPos mut3 = new MutableBlockPos(); @@ -80,7 +79,7 @@ public class CaveChunkPopulatorFeature extends DefaultFeature { } } } - + private void updateMin(BlockPos pos, MutableBlockPos min) { if (pos.getX() < min.getX()) { min.setX(pos.getX()); @@ -92,7 +91,7 @@ public class CaveChunkPopulatorFeature extends DefaultFeature { min.setZ(pos.getZ()); } } - + private void updateMax(BlockPos pos, MutableBlockPos max) { if (pos.getX() > max.getX()) { max.setX(pos.getX()); @@ -104,9 +103,8 @@ public class CaveChunkPopulatorFeature extends DefaultFeature { max.setZ(pos.getZ()); } } - - protected void placeFloor(WorldGenLevel world, EndCaveBiome biome, Set floorPositions, Random random, - BlockState surfaceBlock) { + + protected void placeFloor(WorldGenLevel world, EndCaveBiome biome, Set floorPositions, Random random, BlockState surfaceBlock) { float density = biome.getFloorDensity(); floorPositions.forEach((pos) -> { BlocksHelper.setWithoutUpdate(world, pos, surfaceBlock); @@ -118,7 +116,7 @@ public class CaveChunkPopulatorFeature extends DefaultFeature { } }); } - + protected void placeCeil(WorldGenLevel world, EndCaveBiome biome, Set ceilPositions, Random random) { float density = biome.getCeilDensity(); ceilPositions.forEach((pos) -> { diff --git a/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java index db692501..4c374b20 100644 --- a/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/caves/EndCaveFeature.java @@ -34,7 +34,7 @@ public abstract class EndCaveFeature extends DefaultFeature { protected static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState(); protected static final BlockState WATER = Blocks.WATER.defaultBlockState(); private static final Vec3i[] SPHERE; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -43,18 +43,18 @@ public abstract class EndCaveFeature extends DefaultFeature { if (pos.getX() * pos.getX() + pos.getZ() * pos.getZ() <= 2500) { return false; } - + if (biomeMissingCaves(world, pos)) { return false; } - + int radius = MHelper.randRange(10, 30, random); BlockPos center = findPos(world, pos, radius, random); - + if (center == null) { return false; } - + EndCaveBiome biome = EndBiomes.getCaveBiome(pos.getX(), pos.getZ()); Set caveBlocks = generate(world, center, radius, random); if (!caveBlocks.isEmpty()) { @@ -81,12 +81,12 @@ public abstract class EndCaveFeature extends DefaultFeature { } fixBlocks(world, caveBlocks); } - + return true; } - + protected abstract Set generate(WorldGenLevel world, BlockPos center, int radius, Random random); - + protected void placeFloor(WorldGenLevel world, EndCaveBiome biome, Set floorPositions, Random random, BlockState surfaceBlock) { float density = biome.getFloorDensity(); floorPositions.forEach((pos) -> { @@ -101,7 +101,7 @@ public abstract class EndCaveFeature extends DefaultFeature { } }); } - + protected void placeCeil(WorldGenLevel world, EndCaveBiome biome, Set ceilPositions, Random random) { float density = biome.getCeilDensity(); ceilPositions.forEach((pos) -> { @@ -117,7 +117,7 @@ public abstract class EndCaveFeature extends DefaultFeature { } }); } - + protected void placeWalls(WorldGenLevel world, EndCaveBiome biome, Set positions, Random random) { Set placed = Sets.newHashSet(); positions.forEach(pos -> { @@ -136,7 +136,7 @@ public abstract class EndCaveFeature extends DefaultFeature { } }); } - + private boolean hasOpenSide(BlockPos pos, Set positions) { for (Direction dir : BlocksHelper.DIRECTIONS) { if (!positions.contains(pos.relative(dir))) { @@ -145,11 +145,11 @@ public abstract class EndCaveFeature extends DefaultFeature { } return false; } - + protected void setBiomes(WorldGenLevel world, EndCaveBiome biome, Set blocks) { blocks.forEach((pos) -> setBiome(world, pos, biome)); } - + protected void setBiome(WorldGenLevel world, BlockPos pos, EndCaveBiome biome) { IBiomeArray array = (IBiomeArray) world.getChunk(pos).getBiomes(); if (array != null) { @@ -157,14 +157,14 @@ public abstract class EndCaveFeature extends DefaultFeature { array.be_setBiome(bio, pos); } } - + private BlockPos findPos(WorldGenLevel world, BlockPos pos, int radius, Random random) { int top = world.getHeight(Heightmap.Types.WORLD_SURFACE_WG, pos.getX(), pos.getZ()); MutableBlockPos bpos = new MutableBlockPos(); bpos.setX(pos.getX()); bpos.setZ(pos.getZ()); bpos.setY(top - 1); - + BlockState state = world.getBlockState(bpos); while (!state.is(TagAPI.GEN_TERRAIN) && bpos.getY() > 5) { bpos.setY(bpos.getY() - 1); @@ -174,20 +174,20 @@ public abstract class EndCaveFeature extends DefaultFeature { return null; } top = (int) (bpos.getY() - (radius * 1.3F + 5)); - + while (state.is(TagAPI.GEN_TERRAIN) || !state.getFluidState().isEmpty() && bpos.getY() > 5) { bpos.setY(bpos.getY() - 1); state = world.getBlockState(bpos); } int bottom = (int) (bpos.getY() + radius * 1.3F + 5); - + if (top <= bottom) { return null; } - + return new BlockPos(pos.getX(), MHelper.randRange(bottom, top, random), pos.getZ()); } - + protected void fixBlocks(WorldGenLevel world, Set caveBlocks) { BlockPos pos = caveBlocks.iterator().next(); MutableBlockPos start = new MutableBlockPos().set(pos); @@ -199,14 +199,14 @@ public abstract class EndCaveFeature extends DefaultFeature { if (bpos.getX() > end.getX()) { end.setX(bpos.getX()); } - + if (bpos.getY() < start.getY()) { start.setY(bpos.getY()); } if (bpos.getY() > end.getY()) { end.setY(bpos.getY()); } - + if (bpos.getZ() < start.getZ()) { start.setZ(bpos.getZ()); } @@ -216,7 +216,7 @@ public abstract class EndCaveFeature extends DefaultFeature { }); BlockFixer.fixBlocks(world, start.offset(-2, -2, -2), end.offset(2, 2, 2)); } - + protected boolean isWaterNear(WorldGenLevel world, BlockPos pos) { for (Direction dir : BlocksHelper.DIRECTIONS) { if (!world.getFluidState(pos.relative(dir, 5)).isEmpty()) { @@ -225,7 +225,7 @@ public abstract class EndCaveFeature extends DefaultFeature { } return false; } - + protected boolean biomeMissingCaves(WorldGenLevel world, BlockPos pos) { for (int x = -2; x < 3; x++) { for (int z = -2; z < 3; z++) { @@ -239,7 +239,7 @@ public abstract class EndCaveFeature extends DefaultFeature { } return false; } - + static { List prePos = Lists.newArrayList(); int radius = 5; diff --git a/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java index e3a582bb..502da6f9 100644 --- a/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/caves/RoundCaveFeature.java @@ -19,17 +19,17 @@ public class RoundCaveFeature extends EndCaveFeature { @Override protected Set generate(WorldGenLevel world, BlockPos center, int radius, Random random) { OpenSimplexNoise noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ())); - + int x1 = center.getX() - radius - 5; int z1 = center.getZ() - radius - 5; int x2 = center.getX() + radius + 5; int z2 = center.getZ() + radius + 5; int y1 = MHelper.floor(center.getY() - (radius + 5) / 1.6); int y2 = MHelper.floor(center.getY() + (radius + 5) / 1.6); - + double hr = radius * 0.75; double nr = radius * 0.25; - + int dx = x2 - x1 + 1; int dz = z2 - z1 + 1; int count = dx * dz; @@ -53,12 +53,12 @@ public class RoundCaveFeature extends EndCaveFeature { state = world.getBlockState(bpos); if (isReplaceable(state) && !isWaterNear(world, bpos)) { blocks.add(bpos.immutable()); - + while (state.getMaterial().equals(Material.LEAVES)) { bpos.setY(bpos.getY() + 1); state = world.getBlockState(bpos); } - + bpos.setY(y - 1); while (state.getMaterial().equals(Material.LEAVES)) { bpos.setY(bpos.getY() - 1); @@ -69,14 +69,11 @@ public class RoundCaveFeature extends EndCaveFeature { } }); blocks.forEach(bpos -> BlocksHelper.setWithoutUpdate(world, bpos, CAVE_AIR)); - + return blocks; } - + private boolean isReplaceable(BlockState state) { - return state.is(TagAPI.GEN_TERRAIN) - || state.getMaterial().isReplaceable() - || state.getMaterial().equals(Material.PLANT) - || state.getMaterial().equals(Material.LEAVES); + return state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.LEAVES); } } diff --git a/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java b/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java index b5c1d6e8..34cd0eb0 100644 --- a/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java +++ b/src/main/java/ru/betterend/world/features/terrain/caves/TunelCaveFeature.java @@ -35,24 +35,24 @@ public class TunelCaveFeature extends EndCaveFeature { if ((long) cx * (long) cx + (long) cz + (long) cz < 256) { return Sets.newHashSet(); } - + int x1 = cx << 4; int z1 = cz << 4; int x2 = x1 + 16; int z2 = z1 + 16; - + Random rand = new Random(world.getSeed()); OpenSimplexNoise noiseH = new OpenSimplexNoise(rand.nextInt()); OpenSimplexNoise noiseV = new OpenSimplexNoise(rand.nextInt()); OpenSimplexNoise noiseD = new OpenSimplexNoise(rand.nextInt()); - + Set positions = Sets.newConcurrentHashSet(); - + float a = hasCaves(world, new BlockPos(x1, 0, z1)) ? 1F : 0F; float b = hasCaves(world, new BlockPos(x2, 0, z1)) ? 1F : 0F; float c = hasCaves(world, new BlockPos(x1, 0, z2)) ? 1F : 0F; float d = hasCaves(world, new BlockPos(x2, 0, z2)) ? 1F : 0F; - + ChunkAccess chunk = world.getChunk(cx, cz); IntStream.range(0, 256).parallel().forEach(index -> { MutableBlockPos pos = new MutableBlockPos(); @@ -84,10 +84,10 @@ public class TunelCaveFeature extends EndCaveFeature { } }); positions.forEach(bpos -> BlocksHelper.setWithoutUpdate(world, bpos, CAVE_AIR)); - + return positions; } - + private boolean noWaterNear(WorldGenLevel world, BlockPos pos) { BlockPos above1 = pos.above(); BlockPos above2 = pos.above(2); @@ -104,7 +104,7 @@ public class TunelCaveFeature extends EndCaveFeature { } return true; } - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -113,16 +113,16 @@ public class TunelCaveFeature extends EndCaveFeature { if (pos.getX() * pos.getX() + pos.getZ() * pos.getZ() <= 2500) { return false; } - + if (biomeMissingCaves(world, pos)) { return false; } - + Set caveBlocks = generate(world, pos, random); if (caveBlocks.isEmpty()) { return false; } - + Map> floorSets = Maps.newHashMap(); Map> ceilSets = Maps.newHashMap(); MutableBlockPos mut = new MutableBlockPos(); @@ -157,11 +157,11 @@ public class TunelCaveFeature extends EndCaveFeature { } }); caveBlocks.removeAll(remove); - + if (caveBlocks.isEmpty()) { return true; } - + floorSets.forEach((biome, floorPositions) -> { BlockState surfaceBlock = biome.getBiome().getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); placeFloor(world, biome, floorPositions, random, surfaceBlock); @@ -172,15 +172,15 @@ public class TunelCaveFeature extends EndCaveFeature { EndCaveBiome biome = EndBiomes.getCaveBiome(pos.getX(), pos.getZ()); placeWalls(world, biome, caveBlocks, random); fixBlocks(world, caveBlocks); - + return true; } - + @Override protected Set generate(WorldGenLevel world, BlockPos center, int radius, Random random) { return null; } - + @Override protected void placeFloor(WorldGenLevel world, EndCaveBiome biome, Set floorPositions, Random random, BlockState surfaceBlock) { float density = biome.getFloorDensity() * 0.2F; @@ -196,7 +196,7 @@ public class TunelCaveFeature extends EndCaveFeature { } }); } - + @Override protected void placeCeil(WorldGenLevel world, EndCaveBiome biome, Set ceilPositions, Random random) { float density = biome.getCeilDensity() * 0.2F; @@ -213,14 +213,11 @@ public class TunelCaveFeature extends EndCaveFeature { } }); } - + protected boolean hasCaves(WorldGenLevel world, BlockPos pos) { - return hasCavesInBiome(world, pos.offset(-8, 0, -8)) && - hasCavesInBiome(world, pos.offset(8, 0, -8)) && - hasCavesInBiome(world, pos.offset(-8, 0, 8)) && - hasCavesInBiome(world, pos.offset(8, 0, 8)); + return hasCavesInBiome(world, pos.offset(-8, 0, -8)) && hasCavesInBiome(world, pos.offset(8, 0, -8)) && hasCavesInBiome(world, pos.offset(-8, 0, 8)) && hasCavesInBiome(world, pos.offset(8, 0, 8)); } - + protected boolean hasCavesInBiome(WorldGenLevel world, BlockPos pos) { Biome biome = world.getBiome(pos); BCLBiome endBiome = BiomeAPI.getFromBiome(biome); diff --git a/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java b/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java index c3abb2ee..87f64a6a 100644 --- a/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/DragonTreeFeature.java @@ -39,61 +39,60 @@ public class DragonTreeFeature extends DefaultFeature { private static final List SIDE1; private static final List SIDE2; private static final List ROOT; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + float size = MHelper.randRange(10, 25, random); List spline = SplineHelper.makeSpline(0, 0, 0, 0, size, 0, 6); SplineHelper.offsetParts(spline, random, 1F, 0, 1F); - + if (!SplineHelper.canGenerate(spline, pos, world, REPLACE)) { return false; } BlocksHelper.setWithoutUpdate(world, pos, AIR); - + Vector3f last = SplineHelper.getPos(spline, 3.5F); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); float radius = size * MHelper.randRange(0.5F, 0.7F, random); makeCap(world, pos.offset(last.x(), last.y(), last.z()), radius, random, noise); - + last = spline.get(0); makeRoots(world, pos.offset(last.x(), last.y(), last.z()), radius, random); - + radius = MHelper.randRange(1.2F, 2.3F, random); SDF function = SplineHelper.buildSDF(spline, radius, 1.2F, (bpos) -> { return EndBlocks.DRAGON_TREE.bark.defaultBlockState(); }); - + function.setReplaceFunction(REPLACE); function.addPostProcess(POST); function.fillRecursiveIgnore(world, pos, IGNORE); - + return true; } - + private void makeCap(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise) { int count = (int) radius; int offset = (int) (BRANCH.get(BRANCH.size() - 1).y() * radius); for (int i = 0; i < count; i++) { float angle = (float) i / (float) count * MHelper.PI2; float scale = radius * MHelper.randRange(0.85F, 1.15F, random); - + List branch = SplineHelper.copySpline(BRANCH); SplineHelper.rotateSpline(branch, angle); SplineHelper.scale(branch, scale); SplineHelper.fillSpline(branch, world, EndBlocks.DRAGON_TREE.bark.defaultBlockState(), pos, REPLACE); - + branch = SplineHelper.copySpline(SIDE1); SplineHelper.rotateSpline(branch, angle); SplineHelper.scale(branch, scale); SplineHelper.fillSpline(branch, world, EndBlocks.DRAGON_TREE.bark.defaultBlockState(), pos, REPLACE); - + branch = SplineHelper.copySpline(SIDE2); SplineHelper.rotateSpline(branch, angle); SplineHelper.scale(branch, scale); @@ -101,13 +100,13 @@ public class DragonTreeFeature extends DefaultFeature { } leavesBall(world, pos.above(offset), radius * 1.15F + 2, random, noise); } - + private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random) { int count = (int) (radius * 1.5F); for (int i = 0; i < count; i++) { float angle = (float) i / (float) count * MHelper.PI2; float scale = radius * MHelper.randRange(0.85F, 1.15F, random); - + List branch = SplineHelper.copySpline(ROOT); SplineHelper.rotateSpline(branch, angle); SplineHelper.scale(branch, scale); @@ -117,10 +116,9 @@ public class DragonTreeFeature extends DefaultFeature { } } } - + private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise) { - SDF sphere = new SDFSphere().setRadius(radius) - .setBlock(EndBlocks.DRAGON_TREE_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); + SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.DRAGON_TREE_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); SDF sub = new SDFScale().setScale(5).setSource(sphere); sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub); @@ -167,12 +165,11 @@ public class DragonTreeFeature extends DefaultFeature { return info.getState(); }); sphere.fillRecursiveIgnore(world, pos, IGNORE); - + if (radius > 5) { int count = (int) (radius * 2.5F); for (int i = 0; i < count; i++) { - BlockPos p = pos.offset(random.nextGaussian() * 1, random.nextGaussian() * 1, - random.nextGaussian() * 1); + BlockPos p = pos.offset(random.nextGaussian() * 1, random.nextGaussian() * 1, random.nextGaussian() * 1); boolean place = true; for (Direction d : Direction.values()) { BlockState state = world.getBlockState(p.relative(d)); @@ -186,10 +183,10 @@ public class DragonTreeFeature extends DefaultFeature { } } } - + BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.DRAGON_TREE.bark); } - + static { REPLACE = (state) -> { if (state.is(TagAPI.END_GROUND)) { @@ -203,36 +200,33 @@ public class DragonTreeFeature extends DefaultFeature { } return state.getMaterial().isReplaceable(); }; - + IGNORE = (state) -> { return EndBlocks.DRAGON_TREE.isTreeLog(state); }; - + POST = (info) -> { - if (EndBlocks.DRAGON_TREE.isTreeLog(info.getStateUp()) - && EndBlocks.DRAGON_TREE.isTreeLog(info.getStateDown())) { + if (EndBlocks.DRAGON_TREE.isTreeLog(info.getStateUp()) && EndBlocks.DRAGON_TREE.isTreeLog(info.getStateDown())) { return EndBlocks.DRAGON_TREE.log.defaultBlockState(); } return info.getState(); }; - - BRANCH = Lists.newArrayList(new Vector3f(0, 0, 0), new Vector3f(0.1F, 0.3F, 0), new Vector3f(0.4F, 0.6F, 0), - new Vector3f(0.8F, 0.8F, 0), new Vector3f(1, 1, 0)); + + BRANCH = Lists.newArrayList(new Vector3f(0, 0, 0), new Vector3f(0.1F, 0.3F, 0), new Vector3f(0.4F, 0.6F, 0), new Vector3f(0.8F, 0.8F, 0), new Vector3f(1, 1, 0)); SIDE1 = Lists.newArrayList(new Vector3f(0.4F, 0.6F, 0), new Vector3f(0.8F, 0.8F, 0), new Vector3f(1, 1, 0)); SIDE2 = SplineHelper.copySpline(SIDE1); - + Vector3f offset1 = new Vector3f(-0.4F, -0.6F, 0); Vector3f offset2 = new Vector3f(0.4F, 0.6F, 0); - + SplineHelper.offset(SIDE1, offset1); SplineHelper.offset(SIDE2, offset1); SplineHelper.rotateSpline(SIDE1, 0.5F); SplineHelper.rotateSpline(SIDE2, -0.5F); SplineHelper.offset(SIDE1, offset2); SplineHelper.offset(SIDE2, offset2); - - ROOT = Lists.newArrayList(new Vector3f(0F, 1F, 0), new Vector3f(0.1F, 0.7F, 0), new Vector3f(0.3F, 0.3F, 0), - new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.2F, 0)); + + ROOT = Lists.newArrayList(new Vector3f(0F, 1F, 0), new Vector3f(0.1F, 0.7F, 0), new Vector3f(0.3F, 0.3F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.2F, 0)); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); } } diff --git a/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java b/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java index 2e3c7937..72b6145b 100644 --- a/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/GiganticAmaranitaFeature.java @@ -30,43 +30,42 @@ public class GiganticAmaranitaFeature extends DefaultFeature { private static final Function REPLACE; private static final Function IGNORE; private static final Function POST; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + float size = MHelper.randRange(5, 10, random); List spline = SplineHelper.makeSpline(0, 0, 0, 0, size, 0, 5); SplineHelper.offsetParts(spline, random, 0.7F, 0, 0.7F); - + if (!SplineHelper.canGenerate(spline, pos, world, REPLACE)) { return false; } BlocksHelper.setWithoutUpdate(world, pos, AIR); - + float radius = size * 0.17F;// MHelper.randRange(0.8F, 1.2F, random); SDF function = SplineHelper.buildSDF(spline, radius, 0.2F, (bpos) -> EndBlocks.AMARANITA_STEM.defaultBlockState()); - + Vector3f capPos = spline.get(spline.size() - 1); makeHead(world, pos.offset(capPos.x() + 0.5F, capPos.y() + 1.5F, capPos.z() + 0.5F), Mth.floor(size / 1.6F)); - + function.setReplaceFunction(REPLACE); function.addPostProcess(POST); function.fillRecursiveIgnore(world, pos, IGNORE); - + for (int i = 0; i < 3; i++) { List copy = SplineHelper.copySpline(spline); SplineHelper.offsetParts(copy, random, 0.2F, 0, 0.2F); SplineHelper.fillSplineForce(copy, world, EndBlocks.AMARANITA_HYPHAE.defaultBlockState(), pos, REPLACE); } - + return true; } - + private void makeHead(WorldGenLevel world, BlockPos pos, int radius) { MutableBlockPos mut = new MutableBlockPos(); if (radius < 2) { @@ -97,13 +96,12 @@ public class GiganticAmaranitaFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_LANTERN); mut.move(Direction.DOWN); if (world.getBlockState(mut).getMaterial().isReplaceable()) { - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState() - .setValue(BaseAttachedBlock.FACING, Direction.DOWN)); + BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, Direction.DOWN)); } } } } - + int h = radius + 1; for (int y = 0; y < h; y++) { mut.setY(pos.getY() + y + 1); @@ -117,7 +115,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature { } } } - + mut.setY(pos.getY() + h + 1); for (int x = -1; x < 2; x++) { mut.setX(pos.getX() + x); @@ -161,21 +159,18 @@ public class GiganticAmaranitaFeature extends DefaultFeature { int distance = axis == Axis.X ? x < 0 ? -1 : 1 : z < 0 ? -1 : 1; BlockPos offseted = mut.relative(axis, distance); if (world.getBlockState(offseted).getMaterial().isReplaceable()) { - Direction dir = Direction.fromAxisAndDirection(axis, - distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE); - BlocksHelper.setWithoutUpdate(world, offseted, EndBlocks.AMARANITA_FUR - .defaultBlockState().setValue(BaseAttachedBlock.FACING, dir)); + Direction dir = Direction.fromAxisAndDirection(axis, distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE); + BlocksHelper.setWithoutUpdate(world, offseted, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, dir)); } mut.move(Direction.DOWN); } if (world.getBlockState(mut).getMaterial().isReplaceable()) { - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState() - .setValue(BaseAttachedBlock.FACING, Direction.DOWN)); + BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, Direction.DOWN)); } } } } - + int h = radius - 1; for (int y = 0; y < h; y++) { mut.setY(pos.getY() + y + 1); @@ -189,7 +184,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature { } } } - + mut.setY(pos.getY() + h + 1); for (int x = -1; x < 3; x++) { mut.setX(pos.getX() + x); @@ -215,7 +210,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature { if (world.getBlockState(mut).getMaterial().isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE); } - + mut.set(pos).move(Direction.SOUTH, 3).move(Direction.EAST, i); if (world.getBlockState(mut).getMaterial().isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE); @@ -228,7 +223,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature { if (world.getBlockState(mut).getMaterial().isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE); } - + mut.set(pos).move(Direction.EAST, 3).move(Direction.NORTH, i); if (world.getBlockState(mut).getMaterial().isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE); @@ -241,7 +236,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature { if (world.getBlockState(mut).getMaterial().isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE); } - + mut.set(pos).move(Direction.WEST, 3).move(Direction.NORTH, i); if (world.getBlockState(mut).getMaterial().isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE); @@ -255,15 +250,14 @@ public class GiganticAmaranitaFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE); } } - + for (int i = 0; i < 4; i++) { - mut.set(pos).move(Direction.UP).move(BlocksHelper.HORIZONTAL[i], 3) - .move(BlocksHelper.HORIZONTAL[(i + 1) & 3], 3); + mut.set(pos).move(Direction.UP).move(BlocksHelper.HORIZONTAL[i], 3).move(BlocksHelper.HORIZONTAL[(i + 1) & 3], 3); if (world.getBlockState(mut).getMaterial().isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE); } } - + for (int x = -2; x < 3; x++) { for (int z = -2; z < 3; z++) { mut.set(pos).move(x, 0, z); @@ -276,21 +270,18 @@ public class GiganticAmaranitaFeature extends DefaultFeature { int distance = axis == Axis.X ? x < 0 ? -1 : 1 : z < 0 ? -1 : 1; BlockPos offseted = mut.relative(axis, distance); if (world.getBlockState(offseted).getMaterial().isReplaceable()) { - Direction dir = Direction.fromAxisAndDirection(axis, - distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE); - BlocksHelper.setWithoutUpdate(world, offseted, EndBlocks.AMARANITA_FUR - .defaultBlockState().setValue(BaseAttachedBlock.FACING, dir)); + Direction dir = Direction.fromAxisAndDirection(axis, distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE); + BlocksHelper.setWithoutUpdate(world, offseted, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, dir)); } mut.move(Direction.DOWN); } if (world.getBlockState(mut).getMaterial().isReplaceable()) { - BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState() - .setValue(BaseAttachedBlock.FACING, Direction.DOWN)); + BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, Direction.DOWN)); } } } } - + for (int y = 0; y < 3; y++) { mut.setY(pos.getY() + y + 1); for (int x = -2; x < 3; x++) { @@ -303,7 +294,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature { } } } - + int h = radius + 1; for (int y = 4; y < h; y++) { mut.setY(pos.getY() + y); @@ -312,14 +303,12 @@ public class GiganticAmaranitaFeature extends DefaultFeature { for (int z = -2; z < 3; z++) { mut.setZ(pos.getZ() + z); if (y < 6) { - if (((x / 2) == 0 || (z / 2) == 0) - && world.getBlockState(mut).getMaterial().isReplaceable()) { + if (((x / 2) == 0 || (z / 2) == 0) && world.getBlockState(mut).getMaterial().isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP); } } else { - if ((x == 0 || z == 0) && (Math.abs(x) < 2 && Math.abs(z) < 2) - && world.getBlockState(mut).getMaterial().isReplaceable()) { + if ((x == 0 || z == 0) && (Math.abs(x) < 2 && Math.abs(z) < 2) && world.getBlockState(mut).getMaterial().isReplaceable()) { BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP); } } @@ -328,7 +317,7 @@ public class GiganticAmaranitaFeature extends DefaultFeature { } } } - + static { REPLACE = (state) -> { if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) { @@ -336,9 +325,9 @@ public class GiganticAmaranitaFeature extends DefaultFeature { } return state.getMaterial().isReplaceable(); }; - + IGNORE = EndBlocks.DRAGON_TREE::isTreeLog; - + POST = (info) -> { if (!info.getStateUp().is(EndBlocks.AMARANITA_STEM) || !info.getStateDown().is(EndBlocks.AMARANITA_STEM)) { return EndBlocks.AMARANITA_HYPHAE.defaultBlockState(); diff --git a/src/main/java/ru/betterend/world/features/trees/HelixTreeFeature.java b/src/main/java/ru/betterend/world/features/trees/HelixTreeFeature.java index b7bb9d23..8976ec1c 100644 --- a/src/main/java/ru/betterend/world/features/trees/HelixTreeFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/HelixTreeFeature.java @@ -31,20 +31,19 @@ import java.util.function.Function; public class HelixTreeFeature extends DefaultFeature { private static final Function POST; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; BlocksHelper.setWithoutUpdate(world, pos, AIR); - + float angle = random.nextFloat() * MHelper.PI2; float radiusRange = MHelper.randRange(4.5F, 6F, random); float scale = MHelper.randRange(0.5F, 1F, random); - + float dx; float dz; List spline = new ArrayList(10); @@ -59,7 +58,7 @@ public class HelixTreeFeature extends DefaultFeature { }); SDF rotated = new SDFRotation().setRotation(Vector3f.YP, (float) Math.PI).setSource(sdf); sdf = new SDFUnion().setSourceA(rotated).setSourceB(sdf); - + Vector3f lastPoint = spline.get(spline.size() - 1); List spline2 = SplineHelper.makeSpline(0, 0, 0, 0, 20, 0, 5); SDF stem = SplineHelper.buildSDF(spline2, 1.0F, 0.5F, (p) -> { @@ -67,7 +66,7 @@ public class HelixTreeFeature extends DefaultFeature { }); stem = new SDFTranslate().setTranslate(lastPoint.x(), lastPoint.y(), lastPoint.z()).setSource(stem); sdf = new SDFSmoothUnion().setRadius(3).setSourceA(sdf).setSourceB(stem); - + sdf = new SDFScale().setScale(scale).setSource(sdf); dx = 30 * scale; float dy1 = -20 * scale; @@ -83,11 +82,10 @@ public class HelixTreeFeature extends DefaultFeature { }); SplineHelper.scale(spline2, scale); BlockPos leafStart = pos.offset(lastPoint.x() + 0.5, lastPoint.y() + 0.5, lastPoint.z() + 0.5); - SplineHelper.fillSplineForce(spline2, world, EndBlocks.HELIX_TREE.log.defaultBlockState(), leafStart, - (state) -> { - return state.getMaterial().isReplaceable(); - }); - + SplineHelper.fillSplineForce(spline2, world, EndBlocks.HELIX_TREE.log.defaultBlockState(), leafStart, (state) -> { + return state.getMaterial().isReplaceable(); + }); + spline.clear(); float rad = MHelper.randRange(8F, 11F, random); int count = MHelper.randRange(20, 30, random); @@ -102,7 +100,7 @@ public class HelixTreeFeature extends DefaultFeature { dz = (float) Math.cos(i * 0.45F + angle) * radius; spline.add(new Vector3f(dx, i * scaleM, dz)); } - + Vector3f start = new Vector3f(); Vector3f end = new Vector3f(); lastPoint = spline.get(0); @@ -133,7 +131,7 @@ public class HelixTreeFeature extends DefaultFeature { } lastPoint = point; } - + leaf = leaf.setValue(HelixTreeLeavesBlock.COLOR, 7); leafStart = leafStart.offset(0, lastPoint.y(), 0); if (world.getBlockState(leafStart).isAir()) { @@ -147,12 +145,11 @@ public class HelixTreeFeature extends DefaultFeature { } } } - + return true; } - - private void fillLine(Vector3f start, Vector3f end, WorldGenLevel world, BlockState state, BlockPos pos, - int offset) { + + private void fillLine(Vector3f start, Vector3f end, WorldGenLevel world, BlockState state, BlockPos pos, int offset) { float dx = end.x() - start.x(); float dy = end.y() - start.y(); float dz = end.z() - start.z(); @@ -164,7 +161,7 @@ public class HelixTreeFeature extends DefaultFeature { float x = start.x(); float y = start.y(); float z = start.z(); - + MutableBlockPos bPos = new MutableBlockPos(); for (int i = 0; i < count; i++) { bPos.set(x + pos.getX(), y + pos.getY(), z + pos.getZ()); @@ -182,11 +179,10 @@ public class HelixTreeFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, bPos, state.setValue(HelixTreeLeavesBlock.COLOR, 7)); } } - + static { POST = (info) -> { - if (EndBlocks.HELIX_TREE.isTreeLog(info.getStateUp()) - && EndBlocks.HELIX_TREE.isTreeLog(info.getStateDown())) { + if (EndBlocks.HELIX_TREE.isTreeLog(info.getStateUp()) && EndBlocks.HELIX_TREE.isTreeLog(info.getStateDown())) { return EndBlocks.HELIX_TREE.log.defaultBlockState(); } return info.getState(); diff --git a/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java b/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java index 0c5f55c5..e47891c5 100644 --- a/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/JellyshroomFeature.java @@ -30,18 +30,17 @@ import java.util.function.Function; public class JellyshroomFeature extends DefaultFeature { private static final Function REPLACE; private static final List ROOT; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + BlockState bark = EndBlocks.JELLYSHROOM.bark.defaultBlockState(); BlockState membrane = EndBlocks.JELLYSHROOM_CAP_PURPLE.defaultBlockState(); - + int height = MHelper.randRange(5, 8, random); float radius = height * MHelper.randRange(0.15F, 0.25F, random); List spline = SplineHelper.makeSpline(0, -1, 0, 0, height, 0, 3); @@ -49,7 +48,7 @@ public class JellyshroomFeature extends DefaultFeature { SDF sdf = SplineHelper.buildSDF(spline, radius, 0.8F, (bpos) -> { return bark; }); - + radius = height * MHelper.randRange(0.7F, 0.9F, random); if (radius < 1.5F) { radius = 1.5F; @@ -61,8 +60,7 @@ public class JellyshroomFeature extends DefaultFeature { sdf = new SDFSmoothUnion().setRadius(3F).setSourceA(sdf).setSourceB(cap); sdf.setReplaceFunction(REPLACE).addPostProcess((info) -> { if (EndBlocks.JELLYSHROOM.isTreeLog(info.getState())) { - if (EndBlocks.JELLYSHROOM.isTreeLog(info.getStateUp()) - && EndBlocks.JELLYSHROOM.isTreeLog(info.getStateDown())) { + if (EndBlocks.JELLYSHROOM.isTreeLog(info.getStateUp()) && EndBlocks.JELLYSHROOM.isTreeLog(info.getStateDown())) { return EndBlocks.JELLYSHROOM.log.defaultBlockState(); } } @@ -77,16 +75,16 @@ public class JellyshroomFeature extends DefaultFeature { }).fillRecursive(world, pos); radius = height * 0.5F; makeRoots(world, pos.offset(0, 2, 0), radius, random, bark); - + return true; } - + private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random, BlockState wood) { int count = (int) (radius * 3.5F); for (int i = 0; i < count; i++) { float angle = (float) i / (float) count * MHelper.PI2; float scale = radius * MHelper.randRange(0.85F, 1.15F, random); - + List branch = SplineHelper.copySpline(ROOT); SplineHelper.rotateSpline(branch, angle); SplineHelper.scale(branch, scale); @@ -96,29 +94,28 @@ public class JellyshroomFeature extends DefaultFeature { } } } - + private SDF makeCap(float radius, Random random, BlockState cap) { SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap); SDF sub = new SDFTranslate().setTranslate(0, -4, 0).setSource(sphere); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub); sphere = new SDFScale3D().setScale(1, 0.5F, 1).setSource(sphere); sphere = new SDFTranslate().setTranslate(0, 1 - radius * 0.5F, 0).setSource(sphere); - + float angle = random.nextFloat() * MHelper.PI2; int count = (int) MHelper.randRange(radius * 0.5F, radius, random); if (count < 3) { count = 3; } sphere = new SDFFlatWave().setAngle(angle).setRaysCount(count).setIntensity(0.2F).setSource(sphere); - + return sphere; } - + static { - ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), - new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); + ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); - + REPLACE = (state) -> { if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT)) { return true; diff --git a/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java b/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java index 39655815..4c986fc1 100644 --- a/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/LacugroveFeature.java @@ -32,42 +32,41 @@ public class LacugroveFeature extends DefaultFeature { private static final Function REPLACE; private static final Function IGNORE; private static final Function POST; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + float size = MHelper.randRange(15, 25, random); List spline = SplineHelper.makeSpline(0, 0, 0, 0, size, 0, 6); SplineHelper.offsetParts(spline, random, 1F, 0, 1F); - + if (!SplineHelper.canGenerate(spline, pos, world, REPLACE)) { return false; } - + OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); - + float radius = MHelper.randRange(6F, 8F, random); radius *= (size - 15F) / 20F + 1F; Vector3f center = spline.get(4); leavesBall(world, pos.offset(center.x(), center.y(), center.z()), radius, random, noise); - + radius = MHelper.randRange(1.2F, 1.8F, random); SDF function = SplineHelper.buildSDF(spline, radius, 0.7F, (bpos) -> { return EndBlocks.LACUGROVE.bark.defaultBlockState(); }); - + function.setReplaceFunction(REPLACE); function.addPostProcess(POST); function.fillRecursive(world, pos); - + spline = spline.subList(4, 6); SplineHelper.fillSpline(spline, world, EndBlocks.LACUGROVE.bark.defaultBlockState(), pos, REPLACE); - + MutableBlockPos mut = new MutableBlockPos(); int offset = random.nextInt(2); for (int i = 0; i < 100; i++) { @@ -93,10 +92,8 @@ public class LacugroveFeature extends DefaultFeature { for (int y = top; y >= minY; y--) { mut.setY(y); BlockState state = world.getBlockState(mut); - if (state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) - || state.is(TagAPI.END_GROUND)) { - BlocksHelper.setWithoutUpdate(world, mut, - y == top ? EndBlocks.LACUGROVE.bark : EndBlocks.LACUGROVE.log); + if (state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) || state.is(TagAPI.END_GROUND)) { + BlocksHelper.setWithoutUpdate(world, mut, y == top ? EndBlocks.LACUGROVE.bark : EndBlocks.LACUGROVE.log); } else { break; @@ -106,21 +103,19 @@ public class LacugroveFeature extends DefaultFeature { } } } - + return true; } - + private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise) { - SDF sphere = new SDFSphere().setRadius(radius) - .setBlock(EndBlocks.LACUGROVE_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); + SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.LACUGROVE_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 3; }).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere); - sphere = new SDFSubtraction().setSourceA(sphere) - .setSourceB(new SDFTranslate().setTranslate(0, -radius - 2, 0).setSource(sphere)); + sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius - 2, 0).setSource(sphere)); MutableBlockPos mut = new MutableBlockPos(); sphere.addPostProcess((info) -> { if (random.nextInt(5) == 0) { @@ -157,12 +152,11 @@ public class LacugroveFeature extends DefaultFeature { return info.getState(); }); sphere.fillRecursiveIgnore(world, pos, IGNORE); - + if (radius > 5) { int count = (int) (radius * 2.5F); for (int i = 0; i < count; i++) { - BlockPos p = pos.offset(random.nextGaussian() * 1, random.nextGaussian() * 1, - random.nextGaussian() * 1); + BlockPos p = pos.offset(random.nextGaussian() * 1, random.nextGaussian() * 1, random.nextGaussian() * 1); boolean place = true; for (Direction d : Direction.values()) { BlockState state = world.getBlockState(p.relative(d)); @@ -176,10 +170,10 @@ public class LacugroveFeature extends DefaultFeature { } } } - + BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.LACUGROVE.bark); } - + static { REPLACE = (state) -> { if (state.is(TagAPI.END_GROUND)) { @@ -196,14 +190,13 @@ public class LacugroveFeature extends DefaultFeature { } return state.getMaterial().isReplaceable(); }; - + IGNORE = (state) -> { return EndBlocks.LACUGROVE.isTreeLog(state); }; - + POST = (info) -> { - if (EndBlocks.LACUGROVE.isTreeLog(info.getStateUp()) - && EndBlocks.LACUGROVE.isTreeLog(info.getStateDown())) { + if (EndBlocks.LACUGROVE.isTreeLog(info.getStateUp()) && EndBlocks.LACUGROVE.isTreeLog(info.getStateDown())) { return EndBlocks.LACUGROVE.log.defaultBlockState(); } return info.getState(); diff --git a/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java b/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java index 3982a8ca..3a5fe576 100644 --- a/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/LucerniaFeature.java @@ -39,16 +39,15 @@ public class LucerniaFeature extends DefaultFeature { private static final Function IGNORE; private static final List SPLINE; private static final List ROOT; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); final NoneFeatureConfiguration config = featureConfig.config(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + float size = MHelper.randRange(12, 20, random); int count = (int) (size * 0.3F); float var = MHelper.PI2 / (float) (count * 3); @@ -65,25 +64,21 @@ public class LucerniaFeature extends DefaultFeature { OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); leavesBall(world, pos.offset(last.x(), last.y(), last.z()), leavesRadius, random, noise, config != null); } - + makeRoots(world, pos.offset(0, MHelper.randRange(3, 5, random), 0), size * 0.35F, random); - + return true; } - - private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise, - boolean natural) { - SDF sphere = new SDFSphere().setRadius(radius) - .setBlock(EndBlocks.LUCERNIA_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); + + private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise, boolean natural) { + SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.LUCERNIA_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); SDF sub = new SDFScale().setScale(5).setSource(sphere); sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub); sphere = new SDFScale3D().setScale(1, 0.75F, 1).setSource(sphere); - sphere = new SDFDisplacement().setFunction((vec) -> - (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 2F).setSource(sphere); - sphere = new SDFDisplacement().setFunction((vec) -> - MHelper.randRange(-1.5F, 1.5F, random)).setSource(sphere); - + sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 2F).setSource(sphere); + sphere = new SDFDisplacement().setFunction((vec) -> MHelper.randRange(-1.5F, 1.5F, random)).setSource(sphere); + MutableBlockPos mut = new MutableBlockPos(); for (Direction d1 : BlocksHelper.HORIZONTAL) { BlockPos p = mut.set(pos).move(Direction.UP).move(d1).immutable(); @@ -93,14 +88,12 @@ public class LucerniaFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, p, EndBlocks.LUCERNIA.bark.defaultBlockState()); } } - + BlockState top = EndBlocks.FILALUX.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP); - BlockState middle = EndBlocks.FILALUX.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, - TripleShape.MIDDLE); - BlockState bottom = EndBlocks.FILALUX.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, - TripleShape.BOTTOM); + BlockState middle = EndBlocks.FILALUX.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE); + BlockState bottom = EndBlocks.FILALUX.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM); BlockState outer = EndBlocks.LUCERNIA_OUTER_LEAVES.defaultBlockState(); - + List support = Lists.newArrayList(); sphere.addPostProcess((info) -> { if (natural && random.nextInt(6) == 0 && info.getStateDown().isAir()) { @@ -116,14 +109,14 @@ public class LucerniaFeature extends DefaultFeature { } info.setState(EndBlocks.LUCERNIA.bark.defaultBlockState()); } - + MHelper.shuffle(DIRECTIONS, random); for (Direction d : DIRECTIONS) { if (info.getState(d).isAir()) { info.setBlockPos(info.getPos().relative(d), outer.setValue(FurBlock.FACING, d)); } } - + if (EndBlocks.LUCERNIA.isTreeLog(info.getState())) { for (int x = -6; x < 7; x++) { int ax = Math.abs(x); @@ -152,7 +145,7 @@ public class LucerniaFeature extends DefaultFeature { }); sphere.fillRecursiveIgnore(world, pos, IGNORE); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.LUCERNIA.bark); - + support.forEach((bpos) -> { BlockState state = world.getBlockState(bpos); if (state.isAir() || state.is(EndBlocks.LUCERNIA_OUTER_LEAVES)) { @@ -174,13 +167,13 @@ public class LucerniaFeature extends DefaultFeature { } }); } - + private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random) { int count = (int) (radius * 1.5F); for (int i = 0; i < count; i++) { float angle = (float) i / (float) count * MHelper.PI2; float scale = radius * MHelper.randRange(0.85F, 1.15F, random); - + List branch = SplineHelper.copySpline(ROOT); SplineHelper.rotateSpline(branch, angle); SplineHelper.scale(branch, scale); @@ -190,7 +183,7 @@ public class LucerniaFeature extends DefaultFeature { } } } - + static { REPLACE = (state) -> { if (state.is(TagAPI.END_GROUND)) { @@ -204,15 +197,12 @@ public class LucerniaFeature extends DefaultFeature { } return state.getMaterial().isReplaceable(); }; - + IGNORE = EndBlocks.LUCERNIA::isTreeLog; - - SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), - new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), - new Vector3f(0.50F, 1.00F, 0.00F)); - - ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), - new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); + + SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F)); + + ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); } } diff --git a/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java b/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java index c6eafe0c..bddf9706 100644 --- a/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/MossyGlowshroomFeature.java @@ -41,26 +41,25 @@ public class MossyGlowshroomFeature extends DefaultFeature { private static final SDFBinary FUNCTION; private static final SDFTranslate HEAD_POS; private static final SDFFlatWave ROOTS_ROT; - + private static final SDFPrimitive CONE1; private static final SDFPrimitive CONE2; private static final SDFPrimitive CONE_GLOW; private static final SDFPrimitive ROOTS; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos blockPos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); BlockState down = world.getBlockState(blockPos.below()); - if (!down.is(EndBlocks.END_MYCELIUM) && !down.is(EndBlocks.END_MOSS)) - return false; - + if (!down.is(EndBlocks.END_MYCELIUM) && !down.is(EndBlocks.END_MOSS)) return false; + CONE1.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP); CONE2.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP); CONE_GLOW.setBlock(EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE); ROOTS.setBlock(EndBlocks.MOSSY_GLOWSHROOM.bark); - + float height = MHelper.randRange(10F, 25F, random); int count = MHelper.floor(height / 4); List spline = SplineHelper.makeSpline(0, 0, 0, 0, height, 0, count); @@ -70,59 +69,54 @@ public class MossyGlowshroomFeature extends DefaultFeature { }); Vector3f pos = spline.get(spline.size() - 1); float scale = MHelper.randRange(0.75F, 1.1F, random); - + if (!SplineHelper.canGenerate(spline, scale, blockPos, world, REPLACE)) { return false; } BlocksHelper.setWithoutUpdate(world, blockPos, AIR); - + CENTER.set(blockPos.getX(), 0, blockPos.getZ()); HEAD_POS.setTranslate(pos.x(), pos.y(), pos.z()); ROOTS_ROT.setAngle(random.nextFloat() * MHelper.PI2); FUNCTION.setSourceA(sdf); - + new SDFScale().setScale(scale).setSource(FUNCTION).setReplaceFunction(REPLACE).addPostProcess((info) -> { if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) { if (random.nextBoolean() && info.getStateUp().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { - info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState() - .setValue(MossyGlowshroomCapBlock.TRANSITION, true)); + info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true)); return info.getState(); } - else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) - || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) { + else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) { info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.defaultBlockState()); return info.getState(); } } else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) { - info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState() - .setValue(MossyGlowshroomCapBlock.TRANSITION, true)); + info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true)); return info.getState(); } - + info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()); return info.getState(); } else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { for (Direction dir : BlocksHelper.HORIZONTAL) { if (info.getState(dir) == AIR) { - info.setBlockPos(info.getPos().relative(dir), - EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, dir)); + info.setBlockPos(info.getPos().relative(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, dir)); } } - + if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { - info.setBlockPos(info.getPos().below(), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState() - .setValue(FurBlock.FACING, Direction.DOWN)); + info.setBlockPos(info.getPos().below(), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.DOWN)); } } return info.getState(); }).fillRecursive(world, blockPos); - + return true; } - + static { SDFCappedCone cone1 = new SDFCappedCone().setHeight(2.5F).setRadius1(1.5F).setRadius2(2.5F); SDFCappedCone cone2 = new SDFCappedCone().setHeight(3F).setRadius1(2.5F).setRadius2(13F); @@ -131,40 +125,37 @@ public class MossyGlowshroomFeature extends DefaultFeature { SDF upCone = new SDFSubtraction().setSourceA(posedCone2).setSourceB(posedCone3); SDF wave = new SDFFlatWave().setRaysCount(12).setIntensity(1.3F).setSource(upCone); SDF cones = new SDFSmoothUnion().setRadius(3).setSourceA(cone1).setSourceB(wave); - + CONE1 = cone1; CONE2 = cone2; - + SDF innerCone = new SDFTranslate().setTranslate(0, 1.25F, 0).setSource(upCone); innerCone = new SDFScale3D().setScale(1.2F, 1F, 1.2F).setSource(innerCone); cones = new SDFUnion().setSourceA(cones).setSourceB(innerCone); - + SDF glowCone = new SDFCappedCone().setHeight(3F).setRadius1(2F).setRadius2(12.5F); CONE_GLOW = (SDFPrimitive) glowCone; glowCone = new SDFTranslate().setTranslate(0, 4.25F, 0).setSource(glowCone); glowCone = new SDFSubtraction().setSourceA(glowCone).setSourceB(posedCone3); - + cones = new SDFUnion().setSourceA(cones).setSourceB(glowCone); - + OpenSimplexNoise noise = new OpenSimplexNoise(1234); cones = new SDFCoordModify().setFunction((pos) -> { float dist = MHelper.length(pos.x(), pos.z()); - float y = pos.y() + (float) noise.eval(pos.x() * 0.1 + CENTER.x(), pos.z() * 0.1 + CENTER.z()) * dist * 0.3F - - dist * 0.15F; + float y = pos.y() + (float) noise.eval(pos.x() * 0.1 + CENTER.x(), pos.z() * 0.1 + CENTER.z()) * dist * 0.3F - dist * 0.15F; pos.set(pos.x(), y, pos.z()); }).setSource(cones); - - HEAD_POS = (SDFTranslate) new SDFTranslate() - .setSource(new SDFTranslate().setTranslate(0, 2.5F, 0).setSource(cones)); - + + HEAD_POS = (SDFTranslate) new SDFTranslate().setSource(new SDFTranslate().setTranslate(0, 2.5F, 0).setSource(cones)); + SDF roots = new SDFSphere().setRadius(4F); ROOTS = (SDFPrimitive) roots; roots = new SDFScale3D().setScale(1, 0.7F, 1).setSource(roots); ROOTS_ROT = (SDFFlatWave) new SDFFlatWave().setRaysCount(5).setIntensity(1.5F).setSource(roots); - - FUNCTION = new SDFSmoothUnion().setRadius(4) - .setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT)); - + + FUNCTION = new SDFSmoothUnion().setRadius(4).setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT)); + REPLACE = (state) -> { if (state.is(TagAPI.END_GROUND)) { return true; diff --git a/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java b/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java index a31da107..f56aced9 100644 --- a/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/PythadendronTreeFeature.java @@ -33,7 +33,7 @@ public class PythadendronTreeFeature extends DefaultFeature { private static final Function REPLACE; private static final Function IGNORE; private static final Function POST; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); @@ -43,56 +43,51 @@ public class PythadendronTreeFeature extends DefaultFeature { return false; } BlocksHelper.setWithoutUpdate(world, pos, AIR); - + float size = MHelper.randRange(10, 20, random); List spline = SplineHelper.makeSpline(0, 0, 0, 0, size, 0, 4); SplineHelper.offsetParts(spline, random, 0.7F, 0, 0.7F); Vector3f last = spline.get(spline.size() - 1); - + int depth = MHelper.floor((size - 10F) * 3F / 10F + 1F); float bsize = (10F - (size - 10F)) / 10F + 1.5F; - branch(last.x(), last.y(), last.z(), size * bsize, MHelper.randRange(0, MHelper.PI2, random), random, depth, - world, pos); - + branch(last.x(), last.y(), last.z(), size * bsize, MHelper.randRange(0, MHelper.PI2, random), random, depth, world, pos); + SDF function = SplineHelper.buildSDF(spline, 1.7F, 1.1F, (bpos) -> { return EndBlocks.PYTHADENDRON.bark.defaultBlockState(); }); function.setReplaceFunction(REPLACE); function.addPostProcess(POST); function.fillRecursive(world, pos); - + return true; } - - private void branch(float x, float y, float z, float size, float angle, Random random, int depth, - WorldGenLevel world, BlockPos pos) { - if (depth == 0) - return; - + + private void branch(float x, float y, float z, float size, float angle, Random random, int depth, WorldGenLevel world, BlockPos pos) { + if (depth == 0) return; + float dx = (float) Math.cos(angle) * size * 0.15F; float dz = (float) Math.sin(angle) * size * 0.15F; - + float x1 = x + dx; float z1 = z + dz; float x2 = x - dx; float z2 = z - dz; - + List spline = SplineHelper.makeSpline(x, y, z, x1, y, z1, 5); SplineHelper.powerOffset(spline, size * MHelper.randRange(1.0F, 2.0F, random), 4); SplineHelper.offsetParts(spline, random, 0.3F, 0, 0.3F); Vector3f pos1 = spline.get(spline.size() - 1); - - boolean s1 = SplineHelper.fillSpline(spline, world, EndBlocks.PYTHADENDRON.bark.defaultBlockState(), pos, - REPLACE); - + + boolean s1 = SplineHelper.fillSpline(spline, world, EndBlocks.PYTHADENDRON.bark.defaultBlockState(), pos, REPLACE); + spline = SplineHelper.makeSpline(x, y, z, x2, y, z2, 5); SplineHelper.powerOffset(spline, size * MHelper.randRange(1.0F, 2.0F, random), 4); SplineHelper.offsetParts(spline, random, 0.3F, 0, 0.3F); Vector3f pos2 = spline.get(spline.size() - 1); - - boolean s2 = SplineHelper.fillSpline(spline, world, EndBlocks.PYTHADENDRON.bark.defaultBlockState(), pos, - REPLACE); - + + boolean s2 = SplineHelper.fillSpline(spline, world, EndBlocks.PYTHADENDRON.bark.defaultBlockState(), pos, REPLACE); + OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); if (depth < 3) { if (s1) { @@ -102,12 +97,12 @@ public class PythadendronTreeFeature extends DefaultFeature { leavesBall(world, pos.offset(pos2.x(), pos2.y(), pos2.z()), random, noise); } } - + float size1 = size * MHelper.randRange(0.75F, 0.95F, random); float size2 = size * MHelper.randRange(0.75F, 0.95F, random); float angle1 = angle + (float) Math.PI * 0.5F + MHelper.randRange(-0.1F, 0.1F, random); float angle2 = angle + (float) Math.PI * 0.5F + MHelper.randRange(-0.1F, 0.1F, random); - + if (s1) { branch(pos1.x(), pos1.y(), pos1.z(), size1, angle1, random, depth - 1, world, pos); } @@ -115,12 +110,11 @@ public class PythadendronTreeFeature extends DefaultFeature { branch(pos2.x(), pos2.y(), pos2.z(), size2, angle2, random, depth - 1, world, pos); } } - + private void leavesBall(WorldGenLevel world, BlockPos pos, Random random, OpenSimplexNoise noise) { float radius = MHelper.randRange(4.5F, 6.5F, random); - - SDF sphere = new SDFSphere().setRadius(radius) - .setBlock(EndBlocks.PYTHADENDRON_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); + + SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.PYTHADENDRON_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); sphere = new SDFScale3D().setScale(1, 0.6F, 1).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 3; @@ -128,8 +122,7 @@ public class PythadendronTreeFeature extends DefaultFeature { sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere); - sphere = new SDFSubtraction().setSourceA(sphere) - .setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); + sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); MutableBlockPos mut = new MutableBlockPos(); sphere.addPostProcess((info) -> { if (random.nextInt(5) == 0) { @@ -167,7 +160,7 @@ public class PythadendronTreeFeature extends DefaultFeature { }); sphere.fillRecursiveIgnore(world, pos, IGNORE); } - + static { REPLACE = (state) -> { if (state.is(TagAPI.END_GROUND)) { @@ -181,14 +174,13 @@ public class PythadendronTreeFeature extends DefaultFeature { } return state.getMaterial().isReplaceable(); }; - + IGNORE = (state) -> { return EndBlocks.PYTHADENDRON.isTreeLog(state); }; - + POST = (info) -> { - if (EndBlocks.PYTHADENDRON.isTreeLog(info.getStateUp()) - && EndBlocks.PYTHADENDRON.isTreeLog(info.getStateDown())) { + if (EndBlocks.PYTHADENDRON.isTreeLog(info.getStateUp()) && EndBlocks.PYTHADENDRON.isTreeLog(info.getStateDown())) { return EndBlocks.PYTHADENDRON.log.defaultBlockState(); } return info.getState(); diff --git a/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java b/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java index 05c3a0f1..0aac6a7b 100644 --- a/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/TenaneaFeature.java @@ -38,15 +38,14 @@ public class TenaneaFeature extends DefaultFeature { private static final Function REPLACE; private static final Function IGNORE; private static final List SPLINE; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + float size = MHelper.randRange(7, 10, random); int count = (int) (size * 0.45F); float var = MHelper.PI2 / (float) (count * 3); @@ -63,22 +62,19 @@ public class TenaneaFeature extends DefaultFeature { OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong()); leavesBall(world, pos.offset(last.x(), last.y(), last.z()), leavesRadius, random, noise); } - + return true; } - + private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise) { - SDF sphere = new SDFSphere().setRadius(radius) - .setBlock(EndBlocks.TENANEA_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); + SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.TENANEA_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6)); SDF sub = new SDFScale().setScale(5).setSource(sphere); sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub); sphere = new SDFScale3D().setScale(1, 0.75F, 1).setSource(sphere); - sphere = new SDFDisplacement().setFunction((vec) -> - (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 2F).setSource(sphere); - sphere = new SDFDisplacement().setFunction((vec) -> - MHelper.randRange(-1.5F, 1.5F, random)).setSource(sphere); - + sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 2F).setSource(sphere); + sphere = new SDFDisplacement().setFunction((vec) -> MHelper.randRange(-1.5F, 1.5F, random)).setSource(sphere); + MutableBlockPos mut = new MutableBlockPos(); for (Direction d1 : BlocksHelper.HORIZONTAL) { BlockPos p = mut.set(pos).move(Direction.UP).move(d1).immutable(); @@ -88,15 +84,12 @@ public class TenaneaFeature extends DefaultFeature { BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TENANEA.bark.defaultBlockState()); } } - - BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, - TripleShape.TOP); - BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, - TripleShape.MIDDLE); - BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, - TripleShape.BOTTOM); + + BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP); + BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE); + BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM); BlockState outer = EndBlocks.TENANEA_OUTER_LEAVES.defaultBlockState(); - + List support = Lists.newArrayList(); sphere.addPostProcess((info) -> { if (random.nextInt(6) == 0 && info.getStateDown().isAir()) { @@ -112,14 +105,14 @@ public class TenaneaFeature extends DefaultFeature { } info.setState(EndBlocks.TENANEA.bark.defaultBlockState()); } - + MHelper.shuffle(DIRECTIONS, random); for (Direction d : DIRECTIONS) { if (info.getState(d).isAir()) { info.setBlockPos(info.getPos().relative(d), outer.setValue(FurBlock.FACING, d)); } } - + if (EndBlocks.TENANEA.isTreeLog(info.getState())) { for (int x = -6; x < 7; x++) { int ax = Math.abs(x); @@ -148,7 +141,7 @@ public class TenaneaFeature extends DefaultFeature { }); sphere.fillRecursiveIgnore(world, pos, IGNORE); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.TENANEA.bark); - + support.forEach((bpos) -> { BlockState state = world.getBlockState(bpos); if (state.isAir() || state.is(EndBlocks.TENANEA_OUTER_LEAVES)) { @@ -170,7 +163,7 @@ public class TenaneaFeature extends DefaultFeature { } }); } - + static { REPLACE = (state) -> { if (state.is(TagAPI.END_GROUND)) { @@ -184,11 +177,9 @@ public class TenaneaFeature extends DefaultFeature { } return state.getMaterial().isReplaceable(); }; - + IGNORE = EndBlocks.TENANEA::isTreeLog; - - SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), - new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), - new Vector3f(0.50F, 1.00F, 0.00F)); + + SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F)); } } diff --git a/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java b/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java index 34df39c0..e520e0b7 100644 --- a/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java +++ b/src/main/java/ru/betterend/world/features/trees/UmbrellaTreeFeature.java @@ -37,36 +37,32 @@ public class UmbrellaTreeFeature extends DefaultFeature { private static final Function REPLACE; private static final List SPLINE; private static final List ROOT; - + @Override public boolean place(FeaturePlaceContext featureConfig) { final Random random = featureConfig.random(); final BlockPos pos = featureConfig.origin(); final WorldGenLevel world = featureConfig.level(); final NoneFeatureConfiguration config = featureConfig.config(); - if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) - return false; - + if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false; + BlockState wood = EndBlocks.UMBRELLA_TREE.bark.defaultBlockState(); - BlockState membrane = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState() - .setValue(UmbrellaTreeMembraneBlock.COLOR, 1); - BlockState center = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState() - .setValue(UmbrellaTreeMembraneBlock.COLOR, 0); - BlockState fruit = EndBlocks.UMBRELLA_TREE_CLUSTER.defaultBlockState() - .setValue(UmbrellaTreeClusterBlock.NATURAL, true); - + BlockState membrane = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState().setValue(UmbrellaTreeMembraneBlock.COLOR, 1); + BlockState center = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState().setValue(UmbrellaTreeMembraneBlock.COLOR, 0); + BlockState fruit = EndBlocks.UMBRELLA_TREE_CLUSTER.defaultBlockState().setValue(UmbrellaTreeClusterBlock.NATURAL, true); + float size = MHelper.randRange(10, 20, random); int count = (int) (size * 0.15F); float var = MHelper.PI2 / (float) (count * 3); float start = MHelper.randRange(0, MHelper.PI2, random); SDF sdf = null; List
centers = Lists.newArrayList(); - + float scale = 1; if (config != null) { scale = MHelper.randRange(1F, 1.7F, random); } - + for (int i = 0; i < count; i++) { float angle = (float) i / (float) count * MHelper.PI2 + MHelper.randRange(0, var, random) + start; List spline = SplineHelper.copySpline(SPLINE); @@ -75,42 +71,40 @@ public class UmbrellaTreeFeature extends DefaultFeature { // SplineHelper.offset(spline, new Vector3f((20 - size) * 0.2F, 0, 0)); SplineHelper.rotateSpline(spline, angle); SplineHelper.offsetParts(spline, random, 0.5F, 0, 0.5F); - + if (SplineHelper.canGenerate(spline, pos, world, REPLACE)) { float rScale = (scale - 1) * 0.4F + 1; SDF branch = SplineHelper.buildSDF(spline, 1.2F * rScale, 0.8F * rScale, (bpos) -> { return wood; }); - + Vector3f vec = spline.get(spline.size() - 1); float radius = (size + MHelper.randRange(0, size * 0.5F, random)) * 0.4F; - + sdf = (sdf == null) ? branch : new SDFUnion().setSourceA(sdf).setSourceB(branch); SDF mem = makeMembrane(world, radius, random, membrane, center); - + float px = MHelper.floor(vec.x()) + 0.5F; float py = MHelper.floor(vec.y()) + 0.5F; float pz = MHelper.floor(vec.z()) + 0.5F; mem = new SDFTranslate().setTranslate(px, py, pz).setSource(mem); sdf = new SDFSmoothUnion().setRadius(2).setSourceA(sdf).setSourceB(mem); - centers.add(new Center(pos.getX() + (double) (px * scale), pos.getY() + (double) (py * scale), - pos.getZ() + (double) (pz * scale), radius * scale)); - + centers.add(new Center(pos.getX() + (double) (px * scale), pos.getY() + (double) (py * scale), pos.getZ() + (double) (pz * scale), radius * scale)); + vec = spline.get(0); } } - + if (sdf == null) { return false; } - + if (scale > 1) { sdf = new SDFScale().setScale(scale).setSource(sdf); } - + sdf.setReplaceFunction(REPLACE).addPostProcess((info) -> { - if (EndBlocks.UMBRELLA_TREE.isTreeLog(info.getStateUp()) - && EndBlocks.UMBRELLA_TREE.isTreeLog(info.getStateDown())) { + if (EndBlocks.UMBRELLA_TREE.isTreeLog(info.getStateUp()) && EndBlocks.UMBRELLA_TREE.isTreeLog(info.getStateDown())) { return EndBlocks.UMBRELLA_TREE.log.defaultBlockState(); } else if (info.getState().equals(membrane)) { @@ -131,7 +125,7 @@ public class UmbrellaTreeFeature extends DefaultFeature { return info.getState(); }).fillRecursive(world, pos); makeRoots(world, pos, (size * 0.5F + 3) * scale, random, wood); - + for (Center c : centers) { if (!world.getBlockState(new BlockPos(c.px, c.py, c.pz)).isAir()) { count = MHelper.floor(MHelper.randRange(5F, 10F, random) * scale); @@ -145,16 +139,16 @@ public class UmbrellaTreeFeature extends DefaultFeature { } } } - + return true; } - + private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random, BlockState wood) { int count = (int) (radius * 1.5F); for (int i = 0; i < count; i++) { float angle = (float) i / (float) count * MHelper.PI2; float scale = radius * MHelper.randRange(0.85F, 1.15F, random); - + List branch = SplineHelper.copySpline(ROOT); SplineHelper.rotateSpline(branch, angle); SplineHelper.scale(branch, scale); @@ -164,27 +158,27 @@ public class UmbrellaTreeFeature extends DefaultFeature { } } } - + private SDF makeMembrane(WorldGenLevel world, float radius, Random random, BlockState membrane, BlockState center) { SDF sphere = new SDFSphere().setRadius(radius).setBlock(membrane); SDF sub = new SDFTranslate().setTranslate(0, -4, 0).setSource(sphere); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub); sphere = new SDFScale3D().setScale(1, 0.5F, 1).setSource(sphere); sphere = new SDFTranslate().setTranslate(0, 1 - radius * 0.5F, 0).setSource(sphere); - + float angle = random.nextFloat() * MHelper.PI2; int count = (int) MHelper.randRange(radius, radius * 2, random); if (count < 5) { count = 5; } sphere = new SDFFlatWave().setAngle(angle).setRaysCount(count).setIntensity(0.6F).setSource(sphere); - + SDF cent = new SDFSphere().setRadius(2.5F).setBlock(center); sphere = new SDFUnion().setSourceA(sphere).setSourceB(cent); - + return sphere; } - + private void makeFruits(WorldGenLevel world, double px, double py, double pz, BlockState fruit, float scale) { MutableBlockPos mut = new MutableBlockPos().set(px, py, pz); for (int i = 0; i < 8; i++) { @@ -198,38 +192,34 @@ public class UmbrellaTreeFeature extends DefaultFeature { } } } - + static { - SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), - new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), - new Vector3f(0.50F, 1.00F, 0.00F)); - - ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), - new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); + SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F)); + + ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0)); SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0)); - + REPLACE = (state) -> { - if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) - || state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) { + if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) { return true; } return state.getMaterial().isReplaceable(); }; } - + private class Center { final double px; final double py; final double pz; final float radius; - + Center(double x, double y, double z, float radius) { this.px = x; this.py = y; this.pz = z; this.radius = radius; } - + double distance(float x, float z) { return MHelper.length(px - x, pz - z); } diff --git a/src/main/java/ru/betterend/world/generator/BetterEndBiomeSource.java b/src/main/java/ru/betterend/world/generator/BetterEndBiomeSource.java index 1c20fc72..20c971b4 100644 --- a/src/main/java/ru/betterend/world/generator/BetterEndBiomeSource.java +++ b/src/main/java/ru/betterend/world/generator/BetterEndBiomeSource.java @@ -39,26 +39,26 @@ public class BetterEndBiomeSource extends BiomeSource { private BiomeMap mapLand; private BiomeMap mapVoid; private final long seed; - + public BetterEndBiomeSource(Registry biomeRegistry, long seed) { super(getBiomes(biomeRegistry)); - + this.mapLand = new BiomeMap(seed, GeneratorOptions.getBiomeSizeLand(), EndBiomes.LAND_BIOMES); this.mapVoid = new BiomeMap(seed, GeneratorOptions.getBiomeSizeVoid(), EndBiomes.VOID_BIOMES); this.centerBiome = biomeRegistry.getOrThrow(Biomes.THE_END); this.barrens = biomeRegistry.getOrThrow(Biomes.END_BARRENS); this.biomeRegistry = biomeRegistry; this.seed = seed; - + WorldgenRandom chunkRandom = new WorldgenRandom(seed); chunkRandom.consumeCount(17292); this.noise = new SimplexNoise(chunkRandom); - + EndBiomes.mutateRegistry(biomeRegistry); EndTags.addTerrainTags(biomeRegistry); FeaturesHelper.addFeatures(biomeRegistry); } - + private static List getBiomes(Registry biomeRegistry) { List list = Lists.newArrayList(); biomeRegistry.forEach((biome) -> { @@ -69,13 +69,13 @@ public class BetterEndBiomeSource extends BiomeSource { }); return list; } - + @Override public Biome getNoiseBiome(int biomeX, int biomeY, int biomeZ) { boolean hasVoid = !GeneratorOptions.useNewGenerator() || !GeneratorOptions.noRingVoid(); long i = (long) biomeX * (long) biomeX; long j = (long) biomeZ * (long) biomeZ; - + long dist = i + j; if (hasVoid) { if (dist <= 65536L) return this.centerBiome; @@ -86,12 +86,12 @@ public class BetterEndBiomeSource extends BiomeSource { return this.centerBiome; } } - + if (biomeX == 0 && biomeZ == 0) { mapLand.clearCache(); mapVoid.clearCache(); } - + BCLBiome endBiome = null; if (GeneratorOptions.useNewGenerator()) { if (TerrainGenerator.isLand(biomeX, biomeZ)) { @@ -106,22 +106,22 @@ public class BetterEndBiomeSource extends BiomeSource { } else { float height = TheEndBiomeSource.getHeightValue(noise, (biomeX >> 1) + 1, (biomeZ >> 1) + 1) + (float) SMALL_NOISE.eval(biomeX, biomeZ) * 5; - + if (height > -20F && height < -5F) { return barrens; } - + endBiome = height < -10F ? mapVoid.getBiome(biomeX << 2, biomeZ << 2) : mapLand.getBiome(biomeX << 2, biomeZ << 2); } - + return BiomeAPI.getActualBiome(endBiome); } - + public Biome getLandBiome(int biomeX, int biomeY, int biomeZ) { boolean hasVoid = !GeneratorOptions.useNewGenerator() || !GeneratorOptions.noRingVoid(); long i = (long) biomeX * (long) biomeX; long j = (long) biomeZ * (long) biomeZ; - + long dist = i + j; if (hasVoid) { if (dist <= 65536L) return this.centerBiome; @@ -134,17 +134,17 @@ public class BetterEndBiomeSource extends BiomeSource { } return BiomeAPI.getActualBiome(mapLand.getBiome(biomeX << 2, biomeZ << 2)); } - + @Override public BiomeSource withSeed(long seed) { return new BetterEndBiomeSource(biomeRegistry, seed); } - + @Override protected Codec codec() { return CODEC; } - + public static void register() { Registry.register(Registry.BIOME_SOURCE, BetterEnd.makeID("better_end_biome_source"), CODEC); } diff --git a/src/main/java/ru/betterend/world/generator/BiomeType.java b/src/main/java/ru/betterend/world/generator/BiomeType.java index d259cf03..d0dc037a 100644 --- a/src/main/java/ru/betterend/world/generator/BiomeType.java +++ b/src/main/java/ru/betterend/world/generator/BiomeType.java @@ -1,6 +1,5 @@ package ru.betterend.world.generator; public enum BiomeType { - LAND, - VOID; + LAND, VOID; } diff --git a/src/main/java/ru/betterend/world/generator/GeneratorOptions.java b/src/main/java/ru/betterend/world/generator/GeneratorOptions.java index 521c5407..4a9fb012 100644 --- a/src/main/java/ru/betterend/world/generator/GeneratorOptions.java +++ b/src/main/java/ru/betterend/world/generator/GeneratorOptions.java @@ -30,7 +30,7 @@ public class GeneratorOptions { private static long islandDistBlock; private static int islandDistChunk; private static boolean directSpikeHeight; - + public static void init() { biomeSizeLand = Configs.GENERATOR_CONFIG.getInt("biomeMap", "biomeSizeLand", 256); biomeSizeVoid = Configs.GENERATOR_CONFIG.getInt("biomeMap", "biomeSizeVoid", 256); @@ -50,110 +50,106 @@ public class GeneratorOptions { mediumOptions = new LayerOptions("customGenerator.layers.mediumIslands", Configs.GENERATOR_CONFIG, 150, 100, 70, 20, true); smallOptions = new LayerOptions("customGenerator.layers.smallIslands", Configs.GENERATOR_CONFIG, 60, 50, 70, 30, false); changeSpawn = Configs.GENERATOR_CONFIG.getBoolean("spawn", "changeSpawn", false); - spawn = new BlockPos( - Configs.GENERATOR_CONFIG.getInt("spawn.point", "x", 20), - Configs.GENERATOR_CONFIG.getInt("spawn.point", "y", 65), - Configs.GENERATOR_CONFIG.getInt("spawn.point", "z", 0) - ); + spawn = new BlockPos(Configs.GENERATOR_CONFIG.getInt("spawn.point", "x", 20), Configs.GENERATOR_CONFIG.getInt("spawn.point", "y", 65), Configs.GENERATOR_CONFIG.getInt("spawn.point", "z", 0)); replacePortal = Configs.GENERATOR_CONFIG.getBoolean("portal", "customEndPortal", true); replacePillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "customObsidianSpikes", true); int circleRadius = Configs.GENERATOR_CONFIG.getInt("customGenerator", "voidRingSize", 1000); islandDistBlock = (long) circleRadius * (long) circleRadius; islandDistChunk = (circleRadius >> 3); // Twice bigger than normal } - + public static int getBiomeSizeLand() { return Mth.clamp(biomeSizeLand, 1, 8192); } - + public static int getBiomeSizeVoid() { return Mth.clamp(biomeSizeVoid, 1, 8192); } - + public static int getBiomeSizeCaves() { return Mth.clamp(biomeSizeCaves, 1, 8192); } - + public static boolean hasPortal() { return hasPortal; } - + public static boolean hasPillars() { return hasPillars; } - + public static boolean hasDragonFights() { return hasDragonFights; } - + public static boolean swapOverworldToEnd() { return swapOverworldToEnd; } - + public static boolean changeChorusPlant() { return changeChorusPlant; } - + public static boolean removeChorusFromVanillaBiomes() { return removeChorusFromVanillaBiomes; } - + public static boolean noRingVoid() { return noRingVoid; } - + public static boolean useNewGenerator() { return newGenerator; } - + public static boolean hasCentralIsland() { return generateCentralIsland; } - + public static boolean generateObsidianPlatform() { return generateObsidianPlatform; } - + public static int getEndCityFailChance() { return endCityFailChance; } - + public static boolean changeSpawn() { return changeSpawn; } - + public static BlockPos getSpawn() { return spawn; } - + public static BlockPos getPortalPos() { return portal; } - + public static void setPortalPos(BlockPos portal) { GeneratorOptions.portal = portal; } - + public static boolean replacePortal() { return replacePortal; } - + public static boolean replacePillars() { return replacePillars; } - + public static long getIslandDistBlock() { return islandDistBlock; } - + public static int getIslandDistChunk() { return islandDistChunk; } - + public static void setDirectSpikeHeight() { directSpikeHeight = true; } - + public static boolean isDirectSpikeHeight() { boolean height = directSpikeHeight; directSpikeHeight = false; diff --git a/src/main/java/ru/betterend/world/generator/IslandLayer.java b/src/main/java/ru/betterend/world/generator/IslandLayer.java index 178fd625..800eba1f 100644 --- a/src/main/java/ru/betterend/world/generator/IslandLayer.java +++ b/src/main/java/ru/betterend/world/generator/IslandLayer.java @@ -20,7 +20,7 @@ public class IslandLayer { private static final Random RANDOM = new Random(); private final SDFRadialNoiseMap noise; private final SDF island; - + private final List positions = new ArrayList(9); private final Map islands = Maps.newHashMap(); private final OpenSimplexNoise density; @@ -28,33 +28,33 @@ public class IslandLayer { private int lastX = Integer.MIN_VALUE; private int lastZ = Integer.MIN_VALUE; private final LayerOptions options; - + public IslandLayer(int seed, LayerOptions options) { this.density = new OpenSimplexNoise(seed); this.options = options; this.seed = seed; - + SDF cone1 = makeCone(0, 0.4F, 0.2F, -0.3F); SDF cone2 = makeCone(0.4F, 0.5F, 0.1F, -0.1F); SDF cone3 = makeCone(0.5F, 0.45F, 0.03F, 0.0F); SDF cone4 = makeCone(0.45F, 0, 0.02F, 0.03F); - + SDF coneBottom = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone1).setSourceB(cone2); SDF coneTop = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone3).setSourceB(cone4); noise = (SDFRadialNoiseMap) new SDFRadialNoiseMap().setSeed(seed).setRadius(0.5F).setIntensity(0.2F).setSource(coneTop); island = new SDFSmoothUnion().setRadius(0.01F).setSourceA(noise).setSourceB(coneBottom); } - + private int getSeed(int x, int z) { int h = seed + x * 374761393 + z * 668265263; h = (h ^ (h >> 13)) * 1274126177; return h ^ (h >> 16); } - + public void updatePositions(double x, double z) { int ix = MHelper.floor(x / options.distance); int iz = MHelper.floor(z / options.distance); - + if (lastX != ix || lastZ != iz) { lastX = ix; lastZ = iz; @@ -77,7 +77,7 @@ public class IslandLayer { } } } - + if (GeneratorOptions.hasCentralIsland() && Math.abs(ix) < GeneratorOptions.getIslandDistChunk() && Math.abs(iz) < GeneratorOptions.getIslandDistChunk()) { int count = positions.size(); for (int n = 0; n < count; n++) { @@ -94,7 +94,7 @@ public class IslandLayer { } } } - + private SDF getIsland(BlockPos pos) { SDF island = islands.get(pos); if (island == null) { @@ -110,14 +110,14 @@ public class IslandLayer { noise.setOffset(pos.getX(), pos.getZ()); return island; } - + private float getRelativeDistance(SDF sdf, BlockPos center, double px, double py, double pz) { float x = (float) (px - center.getX()) / options.scale; float y = (float) (py - center.getY()) / options.scale; float z = (float) (pz - center.getZ()) / options.scale; return sdf.getDistance(x, y, z); } - + private float calculateSDF(double x, double y, double z) { float distance = 10; for (BlockPos pos : positions) { @@ -127,23 +127,23 @@ public class IslandLayer { } return distance; } - + public float getDensity(double x, double y, double z) { return -calculateSDF(x, y, z); } - + public float getDensity(double x, double y, double z, float height) { noise.setIntensity(height); noise.setRadius(0.5F / (1 + height)); return -calculateSDF(x, y, z); } - + public void clearCache() { if (islands.size() > 128) { islands.clear(); } } - + private static SDF makeCone(float radiusBottom, float radiusTop, float height, float minY) { float hh = height * 0.5F; SDF sdf = new SDFCappedCone().setHeight(hh).setRadius1(radiusBottom).setRadius2(radiusTop); diff --git a/src/main/java/ru/betterend/world/generator/LayerOptions.java b/src/main/java/ru/betterend/world/generator/LayerOptions.java index 58241d87..03c6ecab 100644 --- a/src/main/java/ru/betterend/world/generator/LayerOptions.java +++ b/src/main/java/ru/betterend/world/generator/LayerOptions.java @@ -13,7 +13,7 @@ public class LayerOptions { public final int maxY; public final long centerDist; public final boolean hasCentralIsland; - + public LayerOptions(String name, PathConfig config, float distance, float scale, int center, int heightVariation, boolean hasCentral) { this.distance = clampDistance(config.getFloat(name, "distance[1-8192]", distance)); this.scale = clampScale(config.getFloat(name, "scale[0.1-1024]", scale)); @@ -25,23 +25,23 @@ public class LayerOptions { this.centerDist = Mth.floor(1000 / this.distance); this.hasCentralIsland = config.getBoolean(name, "hasCentralIsland", hasCentral); } - + private float clampDistance(float value) { return Mth.clamp(value, 1, 8192); } - + private float clampScale(float value) { return Mth.clamp(value, 0.1F, 1024); } - + private float clampCoverage(float value) { return 0.9999F - Mth.clamp(value, 0, 1) * 2; } - + private int clampCenter(int value) { return Mth.clamp(value, 0, 255); } - + private int clampVariation(int value) { return Mth.clamp(value, 0, 255); } diff --git a/src/main/java/ru/betterend/world/generator/TerrainBoolCache.java b/src/main/java/ru/betterend/world/generator/TerrainBoolCache.java index 3afe6529..1d3f9362 100644 --- a/src/main/java/ru/betterend/world/generator/TerrainBoolCache.java +++ b/src/main/java/ru/betterend/world/generator/TerrainBoolCache.java @@ -2,19 +2,19 @@ package ru.betterend.world.generator; public class TerrainBoolCache { private byte[] data = new byte[16384]; - + public static int scaleCoordinate(int value) { return value >> 7; } - + private int getIndex(int x, int z) { return x << 7 | z; } - + public void setData(int x, int z, byte value) { data[getIndex(x & 127, z & 127)] = value; } - + public byte getData(int x, int z) { return data[getIndex(x & 127, z & 127)]; } diff --git a/src/main/java/ru/betterend/world/generator/TerrainGenerator.java b/src/main/java/ru/betterend/world/generator/TerrainGenerator.java index 0e0cd530..499d7511 100644 --- a/src/main/java/ru/betterend/world/generator/TerrainGenerator.java +++ b/src/main/java/ru/betterend/world/generator/TerrainGenerator.java @@ -2,8 +2,6 @@ package ru.betterend.world.generator; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import net.minecraft.core.BlockPos; -import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.util.Mth; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.BiomeSource; @@ -15,7 +13,6 @@ import java.util.List; import java.util.Map; import java.util.Random; import java.util.concurrent.locks.ReentrantLock; -import java.util.stream.IntStream; public class TerrainGenerator { private static final Map TERRAIN_BOOL_CACHE_MAP = Maps.newHashMap(); @@ -25,13 +22,13 @@ public class TerrainGenerator { private static final double SCALE_Y = 4.0; private static final float[] COEF; private static final Point[] OFFS; - + private static IslandLayer largeIslands; private static IslandLayer mediumIslands; private static IslandLayer smallIslands; private static OpenSimplexNoise noise1; private static OpenSimplexNoise noise2; - + public static void initNoise(long seed) { Random random = new Random(seed); largeIslands = new IslandLayer(random.nextInt(), GeneratorOptions.bigOptions); @@ -41,25 +38,25 @@ public class TerrainGenerator { noise2 = new OpenSimplexNoise(random.nextInt()); TERRAIN_BOOL_CACHE_MAP.clear(); } - + public static void fillTerrainDensity(double[] buffer, int x, int z, BiomeSource biomeSource) { LOCKER.lock(); - + largeIslands.clearCache(); mediumIslands.clearCache(); smallIslands.clearCache(); - + double distortion1 = noise1.eval(x * 0.1, z * 0.1) * 20 + noise2.eval(x * 0.2, z * 0.2) * 10 + noise1.eval(x * 0.4, z * 0.4) * 5; double distortion2 = noise2.eval(x * 0.1, z * 0.1) * 20 + noise1.eval(x * 0.2, z * 0.2) * 10 + noise2.eval(x * 0.4, z * 0.4) * 5; double px = (double) x * SCALE_XZ + distortion1; double pz = (double) z * SCALE_XZ + distortion2; - + largeIslands.updatePositions(px, pz); mediumIslands.updatePositions(px, pz); smallIslands.updatePositions(px, pz); - + float height = getAverageDepth(biomeSource, x << 1, z << 1) * 0.5F; - + for (int y = 0; y < buffer.length; y++) { double py = (double) y * SCALE_Y; float dist = largeIslands.getDensity(px, py, pz, height); @@ -72,10 +69,10 @@ public class TerrainGenerator { } buffer[y] = dist; } - + LOCKER.unlock(); } - + private static float getAverageDepth(BiomeSource biomeSource, int x, int z) { if (getBiome(biomeSource, x, z).getDepth() < 0.1F) { return 0F; @@ -88,14 +85,14 @@ public class TerrainGenerator { } return depth; } - + private static Biome getBiome(BiomeSource biomeSource, int x, int z) { if (biomeSource instanceof BetterEndBiomeSource) { return ((BetterEndBiomeSource) biomeSource).getLandBiome(x, 0, z); } return biomeSource.getNoiseBiome(x, 0, z); } - + /** * Check if this is land * @@ -105,10 +102,10 @@ public class TerrainGenerator { public static boolean isLand(int x, int z) { int sectionX = TerrainBoolCache.scaleCoordinate(x); int sectionZ = TerrainBoolCache.scaleCoordinate(z); - + LOCKER.lock(); POS.setLocation(sectionX, sectionZ); - + TerrainBoolCache section = TERRAIN_BOOL_CACHE_MAP.get(POS); if (section == null) { if (TERRAIN_BOOL_CACHE_MAP.size() > 64) { @@ -122,19 +119,19 @@ public class TerrainGenerator { LOCKER.unlock(); return value > 1; } - + double px = (x >> 1) + 0.5; double pz = (z >> 1) + 0.5; - + double distortion1 = noise1.eval(px * 0.1, pz * 0.1) * 20 + noise2.eval(px * 0.2, pz * 0.2) * 10 + noise1.eval(px * 0.4, pz * 0.4) * 5; double distortion2 = noise2.eval(px * 0.1, pz * 0.1) * 20 + noise1.eval(px * 0.2, pz * 0.2) * 10 + noise2.eval(px * 0.4, pz * 0.4) * 5; px = px * SCALE_XZ + distortion1; pz = pz * SCALE_XZ + distortion2; - + largeIslands.updatePositions(px, pz); mediumIslands.updatePositions(px, pz); smallIslands.updatePositions(px, pz); - + boolean result = false; for (int y = 0; y < 32; y++) { double py = (double) y * SCALE_Y; @@ -151,13 +148,13 @@ public class TerrainGenerator { break; } } - + section.setData(x, z, (byte) (result ? 2 : 1)); LOCKER.unlock(); - + return result; } - + /** * Get something like height * @@ -166,19 +163,19 @@ public class TerrainGenerator { */ public static int getHeight(int x, int z) { LOCKER.lock(); - + double px = (double) x / 8.0; double pz = (double) z / 8.0; - + double distortion1 = noise1.eval(px * 0.1, pz * 0.1) * 20 + noise2.eval(px * 0.2, pz * 0.2) * 10 + noise1.eval(px * 0.4, pz * 0.4) * 5; double distortion2 = noise2.eval(px * 0.1, pz * 0.1) * 20 + noise1.eval(px * 0.2, pz * 0.2) * 10 + noise2.eval(px * 0.4, pz * 0.4) * 5; px = (double) x * SCALE_XZ + distortion1; pz = (double) z * SCALE_XZ + distortion2; - + largeIslands.updatePositions(px, pz); mediumIslands.updatePositions(px, pz); smallIslands.updatePositions(px, pz); - + for (int y = 32; y >= 0; y--) { double py = (double) y * SCALE_Y; float dist = largeIslands.getDensity(px, py, pz); @@ -194,11 +191,11 @@ public class TerrainGenerator { return Mth.floor(Mth.clamp(y + dist, y, y + 1) * SCALE_Y); } } - + LOCKER.unlock(); return 0; } - + static { float sum = 0; List coef = Lists.newArrayList(); diff --git a/src/main/java/ru/betterend/world/structures/EndStructureFeature.java b/src/main/java/ru/betterend/world/structures/EndStructureFeature.java deleted file mode 100644 index 3881eccd..00000000 --- a/src/main/java/ru/betterend/world/structures/EndStructureFeature.java +++ /dev/null @@ -1,45 +0,0 @@ -package ru.betterend.world.structures; - -import net.fabricmc.fabric.api.structure.v1.FabricStructureBuilder; -import net.minecraft.data.BuiltinRegistries; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.level.levelgen.GenerationStep; -import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature; -import net.minecraft.world.level.levelgen.feature.StructureFeature; -import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; -import ru.betterend.BetterEnd; - -import java.util.Random; - -public class EndStructureFeature { - private static final Random RANDOM = new Random(354); - private final StructureFeature structure; - private final ConfiguredStructureFeature featureConfigured; - private final GenerationStep.Decoration featureStep; - - public EndStructureFeature(String name, StructureFeature structure, GenerationStep.Decoration step, int spacing, int separation) { - ResourceLocation id = BetterEnd.makeID(name); - - this.featureStep = step; - this.structure = FabricStructureBuilder.create(id, structure) - .step(step) - .defaultConfig(spacing, separation, RANDOM.nextInt(8192)) - .register(); - - this.featureConfigured = this.structure.configured(NoneFeatureConfiguration.NONE); - - BuiltinRegistries.register(BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE, id, this.featureConfigured); - } - - public StructureFeature getStructure() { - return structure; - } - - public ConfiguredStructureFeature getFeatureConfigured() { - return featureConfigured; - } - - public GenerationStep.Decoration getFeatureStep() { - return featureStep; - } -} diff --git a/src/main/java/ru/betterend/world/structures/features/EternalPortalStructure.java b/src/main/java/ru/betterend/world/structures/features/EternalPortalStructure.java index 0706e607..9913d52d 100644 --- a/src/main/java/ru/betterend/world/structures/features/EternalPortalStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/EternalPortalStructure.java @@ -24,7 +24,7 @@ import ru.betterend.world.structures.piece.NBTPiece; public class EternalPortalStructure extends FeatureBaseStructure { private static final ResourceLocation STRUCTURE_ID = BetterEnd.makeID("portal/eternal_portal"); private static final StructureTemplate STRUCTURE = StructureHelper.readStructure(STRUCTURE_ID); - + @Override protected boolean isFeatureChunk(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, WorldgenRandom chunkRandom, ChunkPos pos, Biome biome, ChunkPos chunkPos, NoneFeatureConfiguration featureConfig, LevelHeightAccessor levelHeightAccessor) { long x = (long) chunkPos.x * (long) chunkPos.x; @@ -37,18 +37,18 @@ public class EternalPortalStructure extends FeatureBaseStructure { } return super.isFeatureChunk(chunkGenerator, biomeSource, worldSeed, chunkRandom, pos, biome, chunkPos, featureConfig, levelHeightAccessor); } - + @Override public StructureFeature.StructureStartFactory getStartFactory() { return PortalStructureStart::new; } - + public static class PortalStructureStart extends StructureStart { public PortalStructureStart(StructureFeature feature, ChunkPos pos, int references, long seed) { super(feature, pos, references, seed); } - - + + @Override public void generatePieces(RegistryAccess registryManager, ChunkGenerator chunkGenerator, StructureManager structureManager, ChunkPos chunkPos, Biome biome, NoneFeatureConfiguration featureConfiguration, LevelHeightAccessor levelHeightAccessor) { int x = chunkPos.getBlockX(MHelper.randRange(4, 12, random)); diff --git a/src/main/java/ru/betterend/world/structures/features/FeatureBaseStructure.java b/src/main/java/ru/betterend/world/structures/features/FeatureBaseStructure.java index 10f78d2c..1ac7ad59 100644 --- a/src/main/java/ru/betterend/world/structures/features/FeatureBaseStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/FeatureBaseStructure.java @@ -17,16 +17,16 @@ import java.util.Random; public abstract class FeatureBaseStructure extends StructureFeature { protected static final BlockState AIR = Blocks.AIR.defaultBlockState(); - + public FeatureBaseStructure() { super(NoneFeatureConfiguration.CODEC); } - + @Override protected boolean isFeatureChunk(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, WorldgenRandom chunkRandom, ChunkPos pos, Biome biome, ChunkPos chunkPos, NoneFeatureConfiguration featureConfig, LevelHeightAccessor levelHeightAccessor) { return getGenerationHeight(pos, chunkGenerator, levelHeightAccessor) >= 20; } - + private static int getGenerationHeight(ChunkPos chunkPos, ChunkGenerator chunkGenerator, LevelHeightAccessor levelHeightAccessor) { Random random = new Random((long) (chunkPos.x + chunkPos.z * 10387313)); Rotation blockRotation = Rotation.getRandom(random); @@ -42,7 +42,7 @@ public abstract class FeatureBaseStructure extends StructureFeature { BlockPos bpos = info.getPos(); float px = bpos.getX() - center.getX(); @@ -82,7 +82,7 @@ public class GiantIceStarStructure extends SDFStructureFeature { return info.getState(); }); } - + private List getFibonacciPoints(int count) { float max = count - 1; List result = new ArrayList(count); @@ -96,17 +96,17 @@ public class GiantIceStarStructure extends SDFStructureFeature { } return result; } - + @Override public StructureFeature.StructureStartFactory getStartFactory() { return StarStructureStart::new; } - + public static class StarStructureStart extends StructureStart { public StarStructureStart(StructureFeature feature, ChunkPos pos, int references, long seed) { super(feature, pos, references, seed); } - + @Override public void generatePieces(RegistryAccess registryManager, ChunkGenerator chunkGenerator, StructureManager structureManager, ChunkPos chunkPos, Biome biome, NoneFeatureConfiguration featureConfiguration, LevelHeightAccessor levelHeightAccessor) { int x = chunkPos.getBlockX(MHelper.randRange(4, 12, random)); @@ -116,7 +116,7 @@ public class GiantIceStarStructure extends SDFStructureFeature { ((SDFStructureFeature) this.getFeature()).getSDF(start, this.random).fillRecursive(world, start); }, random.nextInt()); this.pieces.add(piece); - + //this.calculateBoundingBox(); } } diff --git a/src/main/java/ru/betterend/world/structures/features/GiantMossyGlowshroomStructure.java b/src/main/java/ru/betterend/world/structures/features/GiantMossyGlowshroomStructure.java index abb29c87..50726751 100644 --- a/src/main/java/ru/betterend/world/structures/features/GiantMossyGlowshroomStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/GiantMossyGlowshroomStructure.java @@ -38,39 +38,39 @@ public class GiantMossyGlowshroomStructure extends SDFStructureFeature { SDF upCone = new SDFSubtraction().setSourceA(posedCone2).setSourceB(posedCone3); SDF wave = new SDFFlatWave().setRaysCount(12).setIntensity(1.3F).setSource(upCone); SDF cones = new SDFSmoothUnion().setRadius(3).setSourceA(cone1).setSourceB(wave); - + SDF innerCone = new SDFTranslate().setTranslate(0, 1.25F, 0).setSource(upCone); innerCone = new SDFScale3D().setScale(1.2F, 1F, 1.2F).setSource(innerCone); cones = new SDFUnion().setSourceA(cones).setSourceB(innerCone); - + SDF glowCone = new SDFCappedCone().setHeight(3F).setRadius1(2F).setRadius2(12.5F); SDFPrimitive priGlowCone = (SDFPrimitive) glowCone; glowCone = new SDFTranslate().setTranslate(0, 4.25F, 0).setSource(glowCone); glowCone = new SDFSubtraction().setSourceA(glowCone).setSourceB(posedCone3); - + cones = new SDFUnion().setSourceA(cones).setSourceB(glowCone); - + OpenSimplexNoise noise = new OpenSimplexNoise(1234); cones = new SDFCoordModify().setFunction((pos) -> { float dist = MHelper.length(pos.x(), pos.z()); float y = pos.y() + (float) noise.eval(pos.x() * 0.1 + center.getX(), pos.z() * 0.1 + center.getZ()) * dist * 0.3F - dist * 0.15F; pos.set(pos.x(), y, pos.z()); }).setSource(cones); - + SDFTranslate HEAD_POS = (SDFTranslate) new SDFTranslate().setSource(new SDFTranslate().setTranslate(0, 2.5F, 0).setSource(cones)); - + SDF roots = new SDFSphere().setRadius(4F); SDFPrimitive primRoots = (SDFPrimitive) roots; roots = new SDFScale3D().setScale(1, 0.7F, 1).setSource(roots); SDFFlatWave rotRoots = (SDFFlatWave) new SDFFlatWave().setRaysCount(5).setIntensity(1.5F).setSource(roots); - + SDFBinary function = new SDFSmoothUnion().setRadius(4).setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(rotRoots)); - + cone1.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP); cone2.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP); priGlowCone.setBlock(EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE); primRoots.setBlock(EndBlocks.MOSSY_GLOWSHROOM.bark); - + float height = MHelper.randRange(10F, 25F, random); int count = MHelper.floor(height / 4); List spline = SplineHelper.makeSpline(0, 0, 0, 0, height, 0, count); @@ -80,46 +80,43 @@ public class GiantMossyGlowshroomStructure extends SDFStructureFeature { }); Vector3f pos = spline.get(spline.size() - 1); float scale = MHelper.randRange(2F, 3.5F, random); - + HEAD_POS.setTranslate(pos.x(), pos.y(), pos.z()); rotRoots.setAngle(random.nextFloat() * MHelper.PI2); function.setSourceA(sdf); - - return new SDFRound().setRadius(1.5F).setSource(new SDFScale() - .setScale(scale) - .setSource(function)) - .addPostProcess((info) -> { - if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) { - if (random.nextBoolean() && info.getStateUp().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { - info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true)); - return info.getState(); - } - else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) { - info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.defaultBlockState()); - return info.getState(); - } - } - else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { - if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) { - info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true)); - return info.getState(); - } - - info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()); - return info.getState(); - } - else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { - for (Direction dir : BlocksHelper.HORIZONTAL) { - if (info.getState(dir) == AIR) { - info.setBlockPos(info.getPos().relative(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, dir)); - } - } - - if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { - info.setBlockPos(info.getPos().below(), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.DOWN)); - } - } + + return new SDFRound().setRadius(1.5F).setSource(new SDFScale().setScale(scale).setSource(function)).addPostProcess((info) -> { + if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) { + if (random.nextBoolean() && info.getStateUp().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { + info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true)); return info.getState(); - }); + } + else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) { + info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.defaultBlockState()); + return info.getState(); + } + } + else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) { + if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) { + info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true)); + return info.getState(); + } + + info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()); + return info.getState(); + } + else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { + for (Direction dir : BlocksHelper.HORIZONTAL) { + if (info.getState(dir) == AIR) { + info.setBlockPos(info.getPos().relative(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, dir)); + } + } + + if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) { + info.setBlockPos(info.getPos().below(), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.DOWN)); + } + } + return info.getState(); + }); } } diff --git a/src/main/java/ru/betterend/world/structures/features/MegaLakeSmallStructure.java b/src/main/java/ru/betterend/world/structures/features/MegaLakeSmallStructure.java index 1f2c525d..118b1f18 100644 --- a/src/main/java/ru/betterend/world/structures/features/MegaLakeSmallStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/MegaLakeSmallStructure.java @@ -19,12 +19,12 @@ public class MegaLakeSmallStructure extends FeatureBaseStructure { public StructureFeature.StructureStartFactory getStartFactory() { return SDFStructureStart::new; } - + public static class SDFStructureStart extends StructureStart { public SDFStructureStart(StructureFeature feature, ChunkPos chunkPos, int references, long seed) { super(feature, chunkPos, references, seed); } - + @Override public void generatePieces(RegistryAccess registryManager, ChunkGenerator chunkGenerator, StructureManager structureManager, ChunkPos chunkPos, Biome biome, NoneFeatureConfiguration featureConfiguration, LevelHeightAccessor levelHeightAccessor) { int x = chunkPos.getBlockX(MHelper.randRange(4, 12, random)); @@ -36,7 +36,7 @@ public class MegaLakeSmallStructure extends FeatureBaseStructure { LakePiece piece = new LakePiece(new BlockPos(x, y, z), radius, depth, random, biome); this.pieces.add(piece); } - + //this.calculateBoundingBox(); } } diff --git a/src/main/java/ru/betterend/world/structures/features/MegaLakeStructure.java b/src/main/java/ru/betterend/world/structures/features/MegaLakeStructure.java index 6c557318..fd19a701 100644 --- a/src/main/java/ru/betterend/world/structures/features/MegaLakeStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/MegaLakeStructure.java @@ -19,12 +19,12 @@ public class MegaLakeStructure extends FeatureBaseStructure { public StructureFeature.StructureStartFactory getStartFactory() { return SDFStructureStart::new; } - + public static class SDFStructureStart extends StructureStart { public SDFStructureStart(StructureFeature feature, ChunkPos chunkPos, int references, long seed) { super(feature, chunkPos, references, seed); } - + @Override public void generatePieces(RegistryAccess registryManager, ChunkGenerator chunkGenerator, StructureManager structureManager, ChunkPos chunkPos, Biome biome, NoneFeatureConfiguration featureConfiguration, LevelHeightAccessor levelHeightAccessor) { int x = chunkPos.getBlockX(MHelper.randRange(4, 12, random)); @@ -36,7 +36,7 @@ public class MegaLakeStructure extends FeatureBaseStructure { LakePiece piece = new LakePiece(new BlockPos(x, y, z), radius, depth, random, biome); this.pieces.add(piece); } - + //this.calculateBoundingBox(); } } diff --git a/src/main/java/ru/betterend/world/structures/features/MountainStructure.java b/src/main/java/ru/betterend/world/structures/features/MountainStructure.java index cfec9fb6..44c8eaf3 100644 --- a/src/main/java/ru/betterend/world/structures/features/MountainStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/MountainStructure.java @@ -19,12 +19,12 @@ public class MountainStructure extends FeatureBaseStructure { public StructureFeature.StructureStartFactory getStartFactory() { return SDFStructureStart::new; } - + public static class SDFStructureStart extends StructureStart { public SDFStructureStart(StructureFeature feature, ChunkPos chunkPos, int references, long seed) { super(feature, chunkPos, references, seed); } - + @Override public void generatePieces(RegistryAccess registryManager, ChunkGenerator chunkGenerator, StructureManager structureManager, ChunkPos chunkPos, Biome biome, NoneFeatureConfiguration featureConfiguration, LevelHeightAccessor levelHeightAccessor) { int x = chunkPos.getBlockX(MHelper.randRange(4, 12, random)); @@ -36,7 +36,7 @@ public class MountainStructure extends FeatureBaseStructure { CrystalMountainPiece piece = new CrystalMountainPiece(new BlockPos(x, y, z), radius, height, random, biome); this.pieces.add(piece); } - + //this.calculateBoundingBox(); } } diff --git a/src/main/java/ru/betterend/world/structures/features/PaintedMountainStructure.java b/src/main/java/ru/betterend/world/structures/features/PaintedMountainStructure.java index 83af1b97..ab8144d5 100644 --- a/src/main/java/ru/betterend/world/structures/features/PaintedMountainStructure.java +++ b/src/main/java/ru/betterend/world/structures/features/PaintedMountainStructure.java @@ -19,17 +19,17 @@ import ru.betterend.world.structures.piece.PaintedMountainPiece; public class PaintedMountainStructure extends FeatureBaseStructure { private static final BlockState[] VARIANTS; - + @Override public StructureFeature.StructureStartFactory getStartFactory() { return SDFStructureStart::new; } - + public static class SDFStructureStart extends StructureStart { public SDFStructureStart(StructureFeature feature, ChunkPos chunkPos, int references, long seed) { super(feature, chunkPos, references, seed); } - + @Override public void generatePieces(RegistryAccess registryManager, ChunkGenerator chunkGenerator, StructureManager structureManager, ChunkPos chunkPos, Biome biome, NoneFeatureConfiguration featureConfiguration, LevelHeightAccessor levelHeightAccessor) { int x = chunkPos.getBlockX(MHelper.randRange(4, 12, random)); @@ -45,16 +45,12 @@ public class PaintedMountainStructure extends FeatureBaseStructure { } this.pieces.add(new PaintedMountainPiece(new BlockPos(x, y, z), radius, height, random, biome, slises)); } - + //this.calculateBoundingBox(); } } - + static { - VARIANTS = new BlockState[]{ - Blocks.END_STONE.defaultBlockState(), - EndBlocks.FLAVOLITE.stone.defaultBlockState(), - EndBlocks.VIOLECITE.stone.defaultBlockState(), - }; + VARIANTS = new BlockState[]{Blocks.END_STONE.defaultBlockState(), EndBlocks.FLAVOLITE.stone.defaultBlockState(), EndBlocks.VIOLECITE.stone.defaultBlockState(),}; } } diff --git a/src/main/java/ru/betterend/world/structures/features/SDFStructureFeature.java b/src/main/java/ru/betterend/world/structures/features/SDFStructureFeature.java index 9932ea06..4e4e565e 100644 --- a/src/main/java/ru/betterend/world/structures/features/SDFStructureFeature.java +++ b/src/main/java/ru/betterend/world/structures/features/SDFStructureFeature.java @@ -18,19 +18,19 @@ import ru.betterend.world.structures.piece.VoxelPiece; import java.util.Random; public abstract class SDFStructureFeature extends FeatureBaseStructure { - + protected abstract SDF getSDF(BlockPos pos, Random random); - + @Override public StructureFeature.StructureStartFactory getStartFactory() { return SDFStructureStart::new; } - + public static class SDFStructureStart extends StructureStart { public SDFStructureStart(StructureFeature feature, ChunkPos chunkPos, int references, long seed) { super(feature, chunkPos, references, seed); } - + @Override public void generatePieces(RegistryAccess registryManager, ChunkGenerator chunkGenerator, StructureManager structureManager, ChunkPos chunkPos, Biome biome, NoneFeatureConfiguration featureConfiguration, LevelHeightAccessor levelHeightAccessor) { int x = chunkPos.getBlockX(MHelper.randRange(4, 12, random)); @@ -43,7 +43,7 @@ public abstract class SDFStructureFeature extends FeatureBaseStructure { }, random.nextInt()); this.pieces.add(piece); } - + //this.calculateBoundingBox(); } } diff --git a/src/main/java/ru/betterend/world/structures/piece/BasePiece.java b/src/main/java/ru/betterend/world/structures/piece/BasePiece.java index bc594164..c629d35e 100644 --- a/src/main/java/ru/betterend/world/structures/piece/BasePiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/BasePiece.java @@ -9,11 +9,11 @@ public abstract class BasePiece extends StructurePiece { protected BasePiece(StructurePieceType type, int i, BoundingBox boundingBox) { super(type, i, boundingBox); } - + protected BasePiece(StructurePieceType type, CompoundTag tag) { super(type, tag); fromNbt(tag); } - + protected abstract void fromNbt(CompoundTag tag); } \ No newline at end of file diff --git a/src/main/java/ru/betterend/world/structures/piece/CavePiece.java b/src/main/java/ru/betterend/world/structures/piece/CavePiece.java index 39cde6db..b159dc94 100644 --- a/src/main/java/ru/betterend/world/structures/piece/CavePiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/CavePiece.java @@ -23,7 +23,7 @@ public class CavePiece extends BasePiece { private OpenSimplexNoise noise; private BlockPos center; private float radius; - + public CavePiece(BlockPos center, float radius, int id) { super(EndStructures.CAVE_PIECE, id, null); this.center = center; @@ -31,12 +31,12 @@ public class CavePiece extends BasePiece { this.noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ())); makeBoundingBox(); } - + public CavePiece(ServerLevel serverLevel, CompoundTag tag) { super(EndStructures.CAVE_PIECE, tag); makeBoundingBox(); } - + @Override public boolean postProcess(WorldGenLevel world, StructureFeatureManager arg, ChunkGenerator chunkGenerator, Random random, BoundingBox blockBox, ChunkPos chunkPos, BlockPos blockPos) { int x1 = MHelper.max(this.boundingBox.minX(), blockBox.minX()); @@ -45,7 +45,7 @@ public class CavePiece extends BasePiece { int z2 = MHelper.min(this.boundingBox.maxZ(), blockBox.maxZ()); int y1 = this.boundingBox.minY(); int y2 = this.boundingBox.maxY(); - + double hr = radius * 0.75; double nr = radius * 0.25; MutableBlockPos pos = new MutableBlockPos(); @@ -78,23 +78,23 @@ public class CavePiece extends BasePiece { } } } - + return true; } - + @Override protected void addAdditionalSaveData(ServerLevel serverLevel, CompoundTag tag) { tag.put("center", NbtUtils.writeBlockPos(center)); tag.putFloat("radius", radius); } - + @Override protected void fromNbt(CompoundTag tag) { center = NbtUtils.readBlockPos(tag.getCompound("center")); radius = tag.getFloat("radius"); noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ())); } - + private void makeBoundingBox() { int minX = MHelper.floor(center.getX() - radius); int minY = MHelper.floor(center.getY() - radius); diff --git a/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java b/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java index 63d859e5..6708c172 100644 --- a/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/CrystalMountainPiece.java @@ -26,22 +26,22 @@ import java.util.Random; public class CrystalMountainPiece extends MountainPiece { private BlockState top; - + public CrystalMountainPiece(BlockPos center, float radius, float height, Random random, Biome biome) { super(EndStructures.MOUNTAIN_PIECE, center, radius, height, random, biome); top = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); } - + public CrystalMountainPiece(ServerLevel serverLevel, CompoundTag tag) { super(EndStructures.MOUNTAIN_PIECE, serverLevel, tag); } - + @Override protected void fromNbt(CompoundTag tag) { super.fromNbt(tag); top = BiomeAPI.getBiome(biomeID).getBiome().getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); } - + @Override public boolean postProcess(WorldGenLevel world, StructureFeatureManager arg, ChunkGenerator chunkGenerator, Random random, BoundingBox blockBox, ChunkPos chunkPos, BlockPos blockPos) { int sx = chunkPos.getMinBlockX(); @@ -91,9 +91,9 @@ public class CrystalMountainPiece extends MountainPiece { } } } - + map = chunk.getOrCreateHeightmapUnprimed(Types.WORLD_SURFACE); - + // Big crystals int count = (map.getFirstAvailable(8, 8) - (center.getY() + 24)) / 7; count = Mth.clamp(count, 0, 8); @@ -111,7 +111,7 @@ public class CrystalMountainPiece extends MountainPiece { } } } - + // Small crystals count = (map.getFirstAvailable(8, 8) - (center.getY() + 24)) / 2; count = Mth.clamp(count, 4, 8); @@ -129,10 +129,10 @@ public class CrystalMountainPiece extends MountainPiece { } } } - + return true; } - + private void crystal(ChunkAccess chunk, BlockPos pos, int radius, int height, float fill, Random random) { MutableBlockPos mut = new MutableBlockPos(); int max = MHelper.floor(fill * radius + radius + 0.5F); diff --git a/src/main/java/ru/betterend/world/structures/piece/LakePiece.java b/src/main/java/ru/betterend/world/structures/piece/LakePiece.java index 2955ea83..510a976d 100644 --- a/src/main/java/ru/betterend/world/structures/piece/LakePiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/LakePiece.java @@ -42,9 +42,9 @@ public class LakePiece extends BasePiece { private float aspect; private float depth; private int seed; - + private ResourceLocation biomeID; - + public LakePiece(BlockPos center, float radius, float depth, Random random, Biome biome) { super(EndStructures.LAKE_PIECE, random.nextInt(), null); this.center = center; @@ -56,12 +56,12 @@ public class LakePiece extends BasePiece { this.biomeID = BiomeAPI.getBiomeID(biome); makeBoundingBox(); } - + public LakePiece(ServerLevel serverLevel, CompoundTag tag) { super(EndStructures.LAKE_PIECE, tag); makeBoundingBox(); } - + @Override protected void addAdditionalSaveData(ServerLevel serverLevel, CompoundTag tag) { tag.put("center", NbtUtils.writeBlockPos(center)); @@ -70,7 +70,7 @@ public class LakePiece extends BasePiece { tag.putInt("seed", seed); tag.putString("biome", biomeID.toString()); } - + @Override protected void fromNbt(CompoundTag tag) { center = NbtUtils.readBlockPos(tag.getCompound("center")); @@ -81,7 +81,7 @@ public class LakePiece extends BasePiece { aspect = radius / depth; biomeID = new ResourceLocation(tag.getString("biome")); } - + @Override public boolean postProcess(WorldGenLevel world, StructureFeatureManager arg, ChunkGenerator chunkGenerator, Random random, BoundingBox blockBox, ChunkPos chunkPos, BlockPos blockPos) { int minY = this.boundingBox.minY(); @@ -102,11 +102,11 @@ public class LakePiece extends BasePiece { int z2 = wz - center.getZ(); float clamp = getHeightClamp(world, 8, wx, wz); if (clamp < 0.01) continue; - + double n = noise.eval(nx, nz) * 1.5 + 1.5; double x3 = MHelper.sqr(x2 + noise.eval(nx, nz, 100) * 10); double z3 = MHelper.sqr(z2 + noise.eval(nx, nz, -100) * 10); - + for (int y = minY; y <= maxY; y++) { mut.setY((int) (y + n)); double y2 = MHelper.sqr((y - center.getY()) * aspect); @@ -142,7 +142,7 @@ public class LakePiece extends BasePiece { fixWater(world, chunk, mut, random, sx, sz); return true; } - + private void fixWater(WorldGenLevel world, ChunkAccess chunk, MutableBlockPos mut, Random random, int sx, int sz) { int minY = this.boundingBox.minY(); int maxY = this.boundingBox.maxY(); @@ -157,7 +157,7 @@ public class LakePiece extends BasePiece { mut.setY(y - 1); if (chunk.getBlockState(mut).isAir()) { mut.setY(y + 1); - + BlockState bState = chunk.getBlockState(mut); if (bState.isAir()) { bState = random.nextBoolean() ? ENDSTONE : world.getBiome(mut.offset(sx, 0, sz)).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial(); @@ -165,9 +165,9 @@ public class LakePiece extends BasePiece { else { bState = bState.getFluidState().isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState(); } - + mut.setY(y); - + makeEndstonePillar(chunk, mut, bState); } else if (x > 1 && x < 15 && z > 1 && z < 15) { @@ -197,7 +197,7 @@ public class LakePiece extends BasePiece { } } } - + private void makeEndstonePillar(ChunkAccess chunk, MutableBlockPos mut, BlockState terrain) { chunk.setBlockState(mut, terrain, false); mut.setY(mut.getY() - 1); @@ -206,27 +206,27 @@ public class LakePiece extends BasePiece { mut.setY(mut.getY() - 1); } } - + private int getHeight(WorldGenLevel world, BlockPos pos) { int p = ((pos.getX() & 2047) << 11) | (pos.getZ() & 2047); int h = heightmap.getOrDefault(p, Byte.MIN_VALUE); if (h > Byte.MIN_VALUE) { return h; } - + if (!BiomeAPI.getBiomeID(world.getBiome(pos)).equals(biomeID)) { heightmap.put(p, (byte) 0); return 0; } - + h = world.getHeight(Types.WORLD_SURFACE_WG, pos.getX(), pos.getZ()); h = Mth.abs(h - center.getY()); h = h < 8 ? 1 : 0; - + heightmap.put(p, (byte) h); return h; } - + private float getHeightClamp(WorldGenLevel world, int radius, int posX, int posZ) { MutableBlockPos mut = new MutableBlockPos(); int r2 = radius * radius; @@ -248,7 +248,7 @@ public class LakePiece extends BasePiece { height /= max; return Mth.clamp(height, 0, 1); } - + private void makeBoundingBox() { int minX = MHelper.floor(center.getX() - radius - 8); int minY = MHelper.floor(center.getY() - depth - 8); diff --git a/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java b/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java index 6c9fccf8..e1b7e8d0 100644 --- a/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/MountainPiece.java @@ -31,7 +31,7 @@ public abstract class MountainPiece extends BasePiece { protected ResourceLocation biomeID; protected int seed1; protected int seed2; - + public MountainPiece(StructurePieceType type, BlockPos center, float radius, float height, Random random, Biome biome) { super(type, random.nextInt(), null); this.center = center; @@ -45,12 +45,12 @@ public abstract class MountainPiece extends BasePiece { this.biomeID = BiomeAPI.getBiomeID(biome); makeBoundingBox(); } - + public MountainPiece(StructurePieceType type, ServerLevel serverLevel, CompoundTag tag) { super(type, tag); makeBoundingBox(); } - + @Override protected void addAdditionalSaveData(ServerLevel serverLevel, CompoundTag tag) { tag.put("center", NbtUtils.writeBlockPos(center)); @@ -60,7 +60,7 @@ public abstract class MountainPiece extends BasePiece { tag.putInt("seed1", seed1); tag.putInt("seed2", seed2); } - + @Override protected void fromNbt(CompoundTag tag) { center = NbtUtils.readBlockPos(tag.getCompound("center")); @@ -73,14 +73,14 @@ public abstract class MountainPiece extends BasePiece { noise1 = new OpenSimplexNoise(seed1); noise2 = new OpenSimplexNoise(seed2); } - + private int getHeight(WorldGenLevel world, BlockPos pos) { int p = ((pos.getX() & 2047) << 11) | (pos.getZ() & 2047); int h = heightmap.getOrDefault(p, Integer.MIN_VALUE); if (h > Integer.MIN_VALUE) { return h; } - + if (!BiomeAPI.getBiomeID(world.getBiome(pos)).equals(biomeID)) { heightmap.put(p, -10); return -10; @@ -92,19 +92,19 @@ public abstract class MountainPiece extends BasePiece { heightmap.put(p, h); return h; } - + h = MHelper.floor(noise2.eval(pos.getX() * 0.01, pos.getZ() * 0.01) * noise2.eval(pos.getX() * 0.002, pos.getZ() * 0.002) * 8 + 8); - + if (h < 0) { heightmap.put(p, 0); return 0; } - + heightmap.put(p, h); - + return h; } - + protected float getHeightClamp(WorldGenLevel world, int radius, int posX, int posZ) { MutableBlockPos mut = new MutableBlockPos(); float height = 0; @@ -125,7 +125,7 @@ public abstract class MountainPiece extends BasePiece { height /= max; return Mth.clamp(height / radius, 0, 1); } - + private void makeBoundingBox() { int minX = MHelper.floor(center.getX() - radius); int minY = MHelper.floor(center.getY() - radius); diff --git a/src/main/java/ru/betterend/world/structures/piece/NBTPiece.java b/src/main/java/ru/betterend/world/structures/piece/NBTPiece.java index c0c731d4..da226992 100644 --- a/src/main/java/ru/betterend/world/structures/piece/NBTPiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/NBTPiece.java @@ -29,7 +29,7 @@ public class NBTPiece extends BasePiece { private BlockPos pos; private int erosion; private boolean cover; - + public NBTPiece(ResourceLocation structureID, StructureTemplate structure, BlockPos pos, int erosion, boolean cover, Random random) { super(EndStructures.NBT_PIECE, random.nextInt(), null); this.structureID = structureID; @@ -41,12 +41,12 @@ public class NBTPiece extends BasePiece { this.cover = cover; makeBoundingBox(); } - + public NBTPiece(ServerLevel serverLevel, CompoundTag tag) { super(EndStructures.NBT_PIECE, tag); makeBoundingBox(); } - + @Override protected void addAdditionalSaveData(ServerLevel serverLevel, CompoundTag tag) { tag.putString("structureID", structureID.toString()); @@ -56,7 +56,7 @@ public class NBTPiece extends BasePiece { tag.put("pos", NbtUtils.writeBlockPos(pos)); tag.putBoolean("cover", cover); } - + @Override protected void fromNbt(CompoundTag tag) { structureID = new ResourceLocation(tag.getString("structureID")); @@ -67,13 +67,10 @@ public class NBTPiece extends BasePiece { cover = tag.getBoolean("cover"); structure = StructureHelper.readStructure(structureID); } - + @Override public boolean postProcess(WorldGenLevel world, StructureFeatureManager arg, ChunkGenerator chunkGenerator, Random random, BoundingBox blockBox, ChunkPos chunkPos, BlockPos blockPos) { - BoundingBox bounds = BoundingBox.fromCorners( - new Vec3i(blockBox.minX(), this.boundingBox.minY(), blockBox.minZ()), - new Vec3i(blockBox.maxX(), this.boundingBox.maxX(), blockBox.maxZ()) - ); + BoundingBox bounds = BoundingBox.fromCorners(new Vec3i(blockBox.minX(), this.boundingBox.minY(), blockBox.minZ()), new Vec3i(blockBox.maxX(), this.boundingBox.maxX(), blockBox.maxZ())); StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation).setMirror(mirror).setBoundingBox(bounds); structure.placeInWorld(world, pos, pos, placementData, random, 2); if (erosion > 0) { @@ -89,7 +86,7 @@ public class NBTPiece extends BasePiece { } return true; } - + private void makeBoundingBox() { this.boundingBox = StructureHelper.getStructureBounds(pos, structure, rotation, mirror); } diff --git a/src/main/java/ru/betterend/world/structures/piece/PaintedMountainPiece.java b/src/main/java/ru/betterend/world/structures/piece/PaintedMountainPiece.java index a17512f8..49f46f95 100644 --- a/src/main/java/ru/betterend/world/structures/piece/PaintedMountainPiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/PaintedMountainPiece.java @@ -23,16 +23,16 @@ import java.util.Random; public class PaintedMountainPiece extends MountainPiece { private BlockState[] slises; - + public PaintedMountainPiece(BlockPos center, float radius, float height, Random random, Biome biome, BlockState[] slises) { super(EndStructures.PAINTED_MOUNTAIN_PIECE, center, radius, height, random, biome); this.slises = slises; } - + public PaintedMountainPiece(ServerLevel serverLevel, CompoundTag tag) { super(EndStructures.PAINTED_MOUNTAIN_PIECE, serverLevel, tag); } - + @Override protected void addAdditionalSaveData(ServerLevel serverLevel, CompoundTag tag) { super.addAdditionalSaveData(serverLevel, tag); @@ -42,7 +42,7 @@ public class PaintedMountainPiece extends MountainPiece { } tag.put("slises", slise); } - + @Override protected void fromNbt(CompoundTag tag) { super.fromNbt(tag); @@ -52,7 +52,7 @@ public class PaintedMountainPiece extends MountainPiece { slises[i] = NbtUtils.readBlockState(slise.getCompound(i)); } } - + @Override public boolean postProcess(WorldGenLevel world, StructureFeatureManager arg, ChunkGenerator chunkGenerator, Random random, BoundingBox blockBox, ChunkPos chunkPos, BlockPos blockPos) { int sx = chunkPos.getMinBlockX(); @@ -98,7 +98,7 @@ public class PaintedMountainPiece extends MountainPiece { } } } - + return true; } } diff --git a/src/main/java/ru/betterend/world/structures/piece/VoxelPiece.java b/src/main/java/ru/betterend/world/structures/piece/VoxelPiece.java index 40e4a46e..e876af74 100644 --- a/src/main/java/ru/betterend/world/structures/piece/VoxelPiece.java +++ b/src/main/java/ru/betterend/world/structures/piece/VoxelPiece.java @@ -16,29 +16,29 @@ import java.util.function.Consumer; public class VoxelPiece extends BasePiece { private StructureWorld world; - + public VoxelPiece(Consumer function, int id) { super(EndStructures.VOXEL_PIECE, id, null); world = new StructureWorld(); function.accept(world); this.boundingBox = world.getBounds(); } - + public VoxelPiece(ServerLevel level, CompoundTag tag) { super(EndStructures.VOXEL_PIECE, tag); this.boundingBox = world.getBounds(); } - + @Override protected void addAdditionalSaveData(ServerLevel serverLevel, CompoundTag tag) { tag.put("world", world.toBNT()); } - + @Override protected void fromNbt(CompoundTag tag) { world = new StructureWorld(tag.getCompound("world")); } - + @Override public boolean postProcess(WorldGenLevel world, StructureFeatureManager arg, ChunkGenerator chunkGenerator, Random random, BoundingBox blockBox, ChunkPos chunkPos, BlockPos blockPos) { this.world.placeChunk(world, chunkPos); diff --git a/src/main/java/ru/betterend/world/surface/SulphuricSurfaceBuilder.java b/src/main/java/ru/betterend/world/surface/SulphuricSurfaceBuilder.java index 88eaab88..303f926d 100644 --- a/src/main/java/ru/betterend/world/surface/SulphuricSurfaceBuilder.java +++ b/src/main/java/ru/betterend/world/surface/SulphuricSurfaceBuilder.java @@ -13,11 +13,11 @@ import java.util.Random; public class SulphuricSurfaceBuilder extends SurfaceBuilder { private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(5123); - + public SulphuricSurfaceBuilder() { super(SurfaceBuilderBaseConfiguration.CODEC); } - + @Override public void apply(Random random, ChunkAccess chunk, Biome biome, int x, int z, int height, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, int seed, long n, SurfaceBuilderBaseConfiguration surfaceBlocks) { double value = NOISE.eval(x * 0.03, z * 0.03) + NOISE.eval(x * 0.1, z * 0.1) * 0.3 + MHelper.randRange(-0.1, 0.1, MHelper.RANDOM); @@ -34,7 +34,7 @@ public class SulphuricSurfaceBuilder extends SurfaceBuilder SULPHURIC_SURFACE = register("sulphuric_surface", new SulphuricSurfaceBuilder()); - + private static SurfaceBuilder register(String name, SurfaceBuilder builder) { return Registry.register(Registry.SURFACE_BUILDER, name, builder); } - + private static SurfaceBuilderBaseConfiguration makeSimpleConfig(Block block) { BlockState state = block.defaultBlockState(); return new SurfaceBuilderBaseConfiguration(state, state, state); } - + public static void register() { } } diff --git a/src/main/java/shadow/fabric/api/client/rendering/v1/ArmorRenderingRegistry.java b/src/main/java/shadow/fabric/api/client/rendering/v1/ArmorRenderingRegistry.java index 1c86ce0c..cd8a8b09 100644 --- a/src/main/java/shadow/fabric/api/client/rendering/v1/ArmorRenderingRegistry.java +++ b/src/main/java/shadow/fabric/api/client/rendering/v1/ArmorRenderingRegistry.java @@ -51,7 +51,7 @@ import java.util.Arrays; public final class ArmorRenderingRegistry { private ArmorRenderingRegistry() { } - + /** * Registers a provider for custom armor models for an item. * @@ -61,7 +61,7 @@ public final class ArmorRenderingRegistry { public static void registerModel(@Nullable ModelProvider provider, Item... items) { registerModel(provider, Arrays.asList(items)); } - + /** * Registers a provider for custom armor models for an item. * @@ -71,7 +71,7 @@ public final class ArmorRenderingRegistry { public static void registerModel(@Nullable ModelProvider provider, Iterable items) { ArmorRenderingRegistryImpl.registerModel(provider, items); } - + /** * Registers a provider for custom texture models for an item. * @@ -81,7 +81,7 @@ public final class ArmorRenderingRegistry { public static void registerTexture(@Nullable TextureProvider provider, Item... items) { registerTexture(provider, Arrays.asList(items)); } - + /** * Registers a provider for custom texture models for an item. * @@ -91,7 +91,7 @@ public final class ArmorRenderingRegistry { public static void registerTexture(@Nullable TextureProvider provider, Iterable items) { ArmorRenderingRegistryImpl.registerTexture(provider, items); } - + /** * Register simple armor items to use the vanilla armor file name under the mods namespace. * @@ -103,7 +103,7 @@ public final class ArmorRenderingRegistry { return new ResourceLocation(identifier.getNamespace(), "textures/models/armor/" + identifier.getPath() + "_layer_" + (secondLayer ? 2 : 1) + (suffix == null ? "" : "_" + suffix) + ".png"); }, items); } - + /** * Gets the model of the armor piece. * @@ -117,7 +117,7 @@ public final class ArmorRenderingRegistry { public static HumanoidModel getArmorModel(LivingEntity entity, ItemStack stack, EquipmentSlot slot, HumanoidModel defaultModel) { return ArmorRenderingRegistryImpl.getArmorModel(entity, stack, slot, defaultModel); } - + /** * Gets the armor texture {@link net.minecraft.resources.ResourceLocation}. * @@ -133,7 +133,7 @@ public final class ArmorRenderingRegistry { public static ResourceLocation getArmorTexture(LivingEntity entity, ItemStack stack, EquipmentSlot slot, boolean secondLayer, @Nullable String suffix, ResourceLocation defaultTexture) { return ArmorRenderingRegistryImpl.getArmorTexture(entity, stack, slot, secondLayer, suffix, defaultTexture); } - + @FunctionalInterface @Environment(EnvType.CLIENT) public interface ModelProvider { @@ -146,10 +146,9 @@ public final class ArmorRenderingRegistry { * @param defaultModel The default vanilla armor model * @return The model of the armor piece. Should never be null. */ - @NotNull - HumanoidModel getArmorModel(LivingEntity entity, ItemStack stack, EquipmentSlot slot, HumanoidModel defaultModel); + @NotNull HumanoidModel getArmorModel(LivingEntity entity, ItemStack stack, EquipmentSlot slot, HumanoidModel defaultModel); } - + @FunctionalInterface @Environment(EnvType.CLIENT) public interface TextureProvider { @@ -162,7 +161,6 @@ public final class ArmorRenderingRegistry { * @param defaultTexture The default vanilla texture identifier * @return the custom armor texture identifier. Should never be null. */ - @NotNull - ResourceLocation getArmorTexture(LivingEntity entity, ItemStack stack, EquipmentSlot slot, boolean secondLayer, @Nullable String suffix, ResourceLocation defaultTexture); + @NotNull ResourceLocation getArmorTexture(LivingEntity entity, ItemStack stack, EquipmentSlot slot, boolean secondLayer, @Nullable String suffix, ResourceLocation defaultTexture); } } diff --git a/src/main/java/shadow/fabric/impl/client/rendering/ArmorProviderExtensions.java b/src/main/java/shadow/fabric/impl/client/rendering/ArmorProviderExtensions.java index c0917653..5c96d4ad 100644 --- a/src/main/java/shadow/fabric/impl/client/rendering/ArmorProviderExtensions.java +++ b/src/main/java/shadow/fabric/impl/client/rendering/ArmorProviderExtensions.java @@ -25,13 +25,11 @@ import org.jetbrains.annotations.Nullable; import shadow.fabric.api.client.rendering.v1.ArmorRenderingRegistry; public interface ArmorProviderExtensions { - @Nullable - ArmorRenderingRegistry.ModelProvider fabric_getArmorModelProvider(); - - @Nullable - ArmorRenderingRegistry.TextureProvider fabric_getArmorTextureProvider(); - + @Nullable ArmorRenderingRegistry.ModelProvider fabric_getArmorModelProvider(); + + @Nullable ArmorRenderingRegistry.TextureProvider fabric_getArmorTextureProvider(); + void fabric_setArmorModelProvider(@Nullable ArmorRenderingRegistry.ModelProvider provider); - + void fabric_setArmorTextureProvider(@Nullable ArmorRenderingRegistry.TextureProvider provider); } diff --git a/src/main/java/shadow/fabric/impl/client/rendering/ArmorRenderingRegistryImpl.java b/src/main/java/shadow/fabric/impl/client/rendering/ArmorRenderingRegistryImpl.java index 35815179..4c4f6e88 100644 --- a/src/main/java/shadow/fabric/impl/client/rendering/ArmorRenderingRegistryImpl.java +++ b/src/main/java/shadow/fabric/impl/client/rendering/ArmorRenderingRegistryImpl.java @@ -35,48 +35,48 @@ import java.util.Objects; public final class ArmorRenderingRegistryImpl { private ArmorRenderingRegistryImpl() { } - + public static void registerModel(ArmorRenderingRegistry.ModelProvider provider, Iterable items) { Objects.requireNonNull(items); - + for (Item item : items) { Objects.requireNonNull(item); - + ((ArmorProviderExtensions) item).fabric_setArmorModelProvider(provider); } } - + public static void registerTexture(ArmorRenderingRegistry.TextureProvider provider, Iterable items) { Objects.requireNonNull(items); - + for (Item item : items) { Objects.requireNonNull(item); - + ((ArmorProviderExtensions) item).fabric_setArmorTextureProvider(provider); } } - + public static HumanoidModel getArmorModel(LivingEntity entity, ItemStack stack, EquipmentSlot slot, HumanoidModel defaultModel) { if (!stack.isEmpty()) { ArmorRenderingRegistry.ModelProvider provider = ((ArmorProviderExtensions) stack.getItem()).fabric_getArmorModelProvider(); - + if (provider != null) { return provider.getArmorModel(entity, stack, slot, defaultModel); } } - + return defaultModel; } - + public static ResourceLocation getArmorTexture(LivingEntity entity, ItemStack stack, EquipmentSlot slot, boolean secondLayer, @Nullable String suffix, ResourceLocation defaultTexture) { if (!stack.isEmpty()) { ArmorRenderingRegistry.TextureProvider provider = ((ArmorProviderExtensions) stack.getItem()).fabric_getArmorTextureProvider(); - + if (provider != null) { return provider.getArmorTexture(entity, stack, slot, secondLayer, suffix, defaultTexture); } } - + return defaultTexture; } } diff --git a/src/main/java/shadow/fabric/mixin/client/rendering/MixinArmorFeatureRenderer.java b/src/main/java/shadow/fabric/mixin/client/rendering/MixinArmorFeatureRenderer.java index 88b00048..39c6cdc1 100644 --- a/src/main/java/shadow/fabric/mixin/client/rendering/MixinArmorFeatureRenderer.java +++ b/src/main/java/shadow/fabric/mixin/client/rendering/MixinArmorFeatureRenderer.java @@ -54,52 +54,52 @@ public abstract class MixinArmorFeatureRenderer extends RenderLayer { @Shadow @Final private static Map ARMOR_LOCATION_CACHE; - + public MixinArmorFeatureRenderer(RenderLayerParent context) { super(context); - + } - + @Unique private LivingEntity storedEntity; @Unique private EquipmentSlot storedSlot; - + @Inject(method = "render", at = @At("HEAD")) private void storeEntity(PoseStack matrixStack, MultiBufferSource vertexConsumerProvider, int i, LivingEntity livingEntity, float f, float g, float h, float j, float k, float l, CallbackInfo ci) { // We store the living entity wearing the armor before we render this.storedEntity = livingEntity; } - + @Inject(method = "renderArmorPiece", at = @At("HEAD")) private void storeSlot(PoseStack matrices, MultiBufferSource vertexConsumers, LivingEntity livingEntity, EquipmentSlot slot, int i, HumanoidModel bipedEntityModel, CallbackInfo ci) { // We store the current armor slot that is rendering before we render each armor piece this.storedSlot = slot; } - + @Inject(method = "render", at = @At("RETURN")) private void removeStored(PoseStack matrixStack, MultiBufferSource vertexConsumerProvider, int i, LivingEntity livingEntity, float f, float g, float h, float j, float k, float l, CallbackInfo ci) { // We remove the stored data after we render this.storedEntity = null; this.storedSlot = null; } - + @Inject(method = "getArmorModel", at = @At("RETURN"), cancellable = true) private void selectArmorModel(EquipmentSlot slot, CallbackInfoReturnable> cir) { ItemStack stack = storedEntity.getItemBySlot(slot); - + HumanoidModel defaultModel = cir.getReturnValue(); HumanoidModel model = ArmorRenderingRegistry.getArmorModel(storedEntity, stack, slot, defaultModel); - + if (model != defaultModel) { cir.setReturnValue(model); } } - + @Inject(method = "getArmorLocation", at = @At(value = "INVOKE", target = "Ljava/util/Map;computeIfAbsent(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;"), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD) private void getArmorTexture(ArmorItem armorItem, boolean secondLayer, /* @Nullable */ String suffix, CallbackInfoReturnable cir, String vanillaIdentifier) { String texture = ArmorRenderingRegistry.getArmorTexture(storedEntity, storedEntity.getItemBySlot(storedSlot), storedSlot, secondLayer, suffix, new ResourceLocation(vanillaIdentifier)).toString(); - + if (!Objects.equals(texture, vanillaIdentifier)) { cir.setReturnValue(ARMOR_LOCATION_CACHE.computeIfAbsent(texture, ResourceLocation::new)); } diff --git a/src/main/java/shadow/fabric/mixin/client/rendering/MixinItem.java b/src/main/java/shadow/fabric/mixin/client/rendering/MixinItem.java index b08dc5a5..719b8f92 100644 --- a/src/main/java/shadow/fabric/mixin/client/rendering/MixinItem.java +++ b/src/main/java/shadow/fabric/mixin/client/rendering/MixinItem.java @@ -34,22 +34,22 @@ public class MixinItem implements ArmorProviderExtensions { private ArmorRenderingRegistry.ModelProvider armorModelProvider; @Unique private ArmorRenderingRegistry.TextureProvider armorTextureProvider; - + @Override public ArmorRenderingRegistry.ModelProvider fabric_getArmorModelProvider() { return armorModelProvider; } - + @Override public ArmorRenderingRegistry.TextureProvider fabric_getArmorTextureProvider() { return armorTextureProvider; } - + @Override public void fabric_setArmorModelProvider(ArmorRenderingRegistry.ModelProvider provider) { armorModelProvider = provider; } - + @Override public void fabric_setArmorTextureProvider(ArmorRenderingRegistry.TextureProvider provider) { armorTextureProvider = provider; diff --git a/src/main/resources/assets/betterend/blockstates/smaragdant_crystal.json b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal.json deleted file mode 100644 index 2d3e15ba..00000000 --- a/src/main/resources/assets/betterend/blockstates/smaragdant_crystal.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "variants": { - "axis=x": { "model": "betterend:block/smaragdant_crystal", "x": 90, "y": 90 }, - "axis=y": { "model": "betterend:block/smaragdant_crystal" }, - "axis=z": { "model": "betterend:block/smaragdant_crystal", "x": 90 } - } -} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_bricks_stairs.json b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_bricks_stairs.json new file mode 100644 index 00000000..61ea29d6 --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_bricks_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "y": 180 }, + "facing=south,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "y": 90 }, + "facing=north,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "y": 270 }, + "facing=east,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer" }, + "facing=west,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 180 }, + "facing=south,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 90 }, + "facing=north,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 270 }, + "facing=east,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 270 }, + "facing=west,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 90 }, + "facing=south,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer" }, + "facing=north,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "y": 180 }, + "facing=east,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner" }, + "facing=west,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 180 }, + "facing=south,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 90 }, + "facing=north,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 270 }, + "facing=east,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 270 }, + "facing=west,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 90 }, + "facing=south,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner" }, + "facing=north,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "y": 180 }, + "facing=east,half=top,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "x": 180 }, + "facing=west,half=top,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "x": 180, "y": 180 }, + "facing=south,half=top,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "x": 180, "y": 90 }, + "facing=north,half=top,shape=straight": { "model": "betterend:block/smaragdant_bricks_stairs", "x": 180, "y": 270 }, + "facing=east,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 90 }, + "facing=west,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 270 }, + "facing=south,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 180 }, + "facing=north,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180 }, + "facing=east,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180 }, + "facing=west,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 180 }, + "facing=south,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 90 }, + "facing=north,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_bricks_stairs_outer", "x": 180, "y": 270 }, + "facing=east,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 90 }, + "facing=west,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 270 }, + "facing=south,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 180 }, + "facing=north,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180 }, + "facing=east,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180 }, + "facing=west,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 180 }, + "facing=south,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 90 }, + "facing=north,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_bricks_stairs_inner", "x": 180, "y": 270 } + } +} diff --git a/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_bricks_wall.json b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_bricks_wall.json new file mode 100644 index 00000000..b68ce3e7 --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_bricks_wall.json @@ -0,0 +1,90 @@ +{ + "multipart": [ + { + "when": { + "up": "true" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_bricks_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_bricks_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_bricks_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_bricks_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_bricks_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_bricks_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_bricks_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_bricks_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_bricks_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} diff --git a/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_pedestal.json b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_pedestal.json new file mode 100644 index 00000000..f199dcf1 --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_pedestal.json @@ -0,0 +1,22 @@ +{ + "variants": { + "state=default": { + "model": "betterend:block/smaragdant_pedestal_default" + }, + "state=column": { + "model": "betterend:block/smaragdant_pedestal_column" + }, + "state=column_top": { + "model": "betterend:block/smaragdant_pedestal_column_top" + }, + "state=pedestal_top": { + "model": "betterend:block/smaragdant_pedestal_top" + }, + "state=bottom": { + "model": "betterend:block/smaragdant_pedestal_bottom" + }, + "state=pillar": { + "model": "betterend:block/smaragdant_pedestal_pillar" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_slab.json b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_slab.json new file mode 100644 index 00000000..e944b672 --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_slab.json @@ -0,0 +1,15 @@ +{ + "variants": { + "type=bottom": { + "model": "betterend:block/smaragdant_slab" + }, + "type=top": { + "model": "betterend:block/smaragdant_slab", + "x": 180, + "uvlock": true + }, + "type=double": { + "model": "betterend:block/smaragdant_crystal" + } + } +} diff --git a/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_stairs.json b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_stairs.json new file mode 100644 index 00000000..2d3fc25c --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_stairs.json @@ -0,0 +1,44 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_stairs" }, + "facing=west,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_stairs", "y": 180 }, + "facing=south,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_stairs", "y": 90 }, + "facing=north,half=bottom,shape=straight": { "model": "betterend:block/smaragdant_stairs", "y": 270 }, + "facing=east,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_stairs_outer" }, + "facing=west,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_stairs_outer", "y": 180 }, + "facing=south,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_stairs_outer", "y": 90 }, + "facing=north,half=bottom,shape=outer_right": { "model": "betterend:block/smaragdant_stairs_outer", "y": 270 }, + "facing=east,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_stairs_outer", "y": 270 }, + "facing=west,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_stairs_outer", "y": 90 }, + "facing=south,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_stairs_outer" }, + "facing=north,half=bottom,shape=outer_left": { "model": "betterend:block/smaragdant_stairs_outer", "y": 180 }, + "facing=east,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_stairs_inner" }, + "facing=west,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_stairs_inner", "y": 180 }, + "facing=south,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_stairs_inner", "y": 90 }, + "facing=north,half=bottom,shape=inner_right": { "model": "betterend:block/smaragdant_stairs_inner", "y": 270 }, + "facing=east,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_stairs_inner", "y": 270 }, + "facing=west,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_stairs_inner", "y": 90 }, + "facing=south,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_stairs_inner" }, + "facing=north,half=bottom,shape=inner_left": { "model": "betterend:block/smaragdant_stairs_inner", "y": 180 }, + "facing=east,half=top,shape=straight": { "model": "betterend:block/smaragdant_stairs", "x": 180 }, + "facing=west,half=top,shape=straight": { "model": "betterend:block/smaragdant_stairs", "x": 180, "y": 180 }, + "facing=south,half=top,shape=straight": { "model": "betterend:block/smaragdant_stairs", "x": 180, "y": 90 }, + "facing=north,half=top,shape=straight": { "model": "betterend:block/smaragdant_stairs", "x": 180, "y": 270 }, + "facing=east,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_stairs_outer", "x": 180, "y": 90 }, + "facing=west,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_stairs_outer", "x": 180, "y": 270 }, + "facing=south,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_stairs_outer", "x": 180, "y": 180 }, + "facing=north,half=top,shape=outer_right": { "model": "betterend:block/smaragdant_stairs_outer", "x": 180 }, + "facing=east,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_stairs_outer", "x": 180 }, + "facing=west,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_stairs_outer", "x": 180, "y": 180 }, + "facing=south,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_stairs_outer", "x": 180, "y": 90 }, + "facing=north,half=top,shape=outer_left": { "model": "betterend:block/smaragdant_stairs_outer", "x": 180, "y": 270 }, + "facing=east,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_stairs_inner", "x": 180, "y": 90 }, + "facing=west,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_stairs_inner", "x": 180, "y": 270 }, + "facing=south,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_stairs_inner", "x": 180, "y": 180 }, + "facing=north,half=top,shape=inner_right": { "model": "betterend:block/smaragdant_stairs_inner", "x": 180 }, + "facing=east,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_stairs_inner", "x": 180 }, + "facing=west,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_stairs_inner", "x": 180, "y": 180 }, + "facing=south,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_stairs_inner", "x": 180, "y": 90 }, + "facing=north,half=top,shape=inner_left": { "model": "betterend:block/smaragdant_stairs_inner", "x": 180, "y": 270 } + } +} diff --git a/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_wall.json b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_wall.json new file mode 100644 index 00000000..3232369d --- /dev/null +++ b/src/main/resources/assets/betterend/blockstates/smaragdant_crystal_wall.json @@ -0,0 +1,90 @@ +{ + "multipart": [ + { + "when": { + "up": "true" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "betterend:block/smaragdant_crystal_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} diff --git a/src/main/resources/assets/betterend/lang/en_us.json b/src/main/resources/assets/betterend/lang/en_us.json index df012d66..62c1c097 100644 --- a/src/main/resources/assets/betterend/lang/en_us.json +++ b/src/main/resources/assets/betterend/lang/en_us.json @@ -874,5 +874,14 @@ "tooltip.armor.crystalite_set": "Set bonus: Regeneration I", "tooltip.armor.crystalite_chest": "Effect: Dig Speed I", - "tooltip.armor.crystalite_boots": "Effect: Swiftness I" + "tooltip.armor.crystalite_boots": "Effect: Swiftness I", + + "block.betterend.azure_jadestone_flower_pot": "Azure Jadestone Flower Pot", + "block.betterend.endstone_flower_pot": "Endstone Flower Pot", + "block.betterend.flavolite_flower_pot": "Flavolite Flower Pot", + "block.betterend.sandy_jadestone_flower_pot": "Sandy Jadestone Flower Pot", + "block.betterend.sulphuric_rock_flower_pot": "Sulphuric Rock Flower Pot", + "block.betterend.violecite_flower_pot": "Violecite Flower Pot", + "block.betterend.virid_jadestone_flower_pot": "Virid Jadestone Flower Pot", + "block.betterend.virid_jadestone_flower_pot": "Virid Jadestone Flower Pot" } diff --git a/src/main/resources/assets/betterend/lang/es_es.json b/src/main/resources/assets/betterend/lang/es_es.json new file mode 100644 index 00000000..efae5e35 --- /dev/null +++ b/src/main/resources/assets/betterend/lang/es_es.json @@ -0,0 +1,877 @@ +{ + "itemGroup.betterend.end_items": "Better End: Objetos", + "itemGroup.betterend.end_blocks": "Better End: Bloques", + + "item.betterend.guidebook": "El End para Bobos", + "book.betterend.landing": "Una pequeña guía para sobrevivir en las condiciones exstremas del End.", + "book.betterend.subtitle": "Sobrevivir en el End", + + "category.rei.damage.amount&dmg": "Daño de la herramienta: %s", + "category.rei.infusion.time&val": "Tiempo: %s", + + "biome.betterend.foggy_mushroomland": "Tierra de Setas Nublada", + "biome.betterend.dust_wastelands": "Tierras de Desecho de Polvo", + "biome.betterend.chorus_forest": "Bosque Coral", + "biome.betterend.megalake": "Megalago", + "biome.betterend.crystal_mountains": "Montañas de Cristal", + + "entity.betterend.dragonfly": "Libélula", + "item.betterend.spawn_egg_dragonfly": "Huevo de Generación de Libélula", + + "entity.betterend.end_slime": "Slime del End", + "item.betterend.spawn_egg_end_slime": "Huevo de Generación de Slime del End", + + "block.betterend.end_mycelium": "Micelio del End", + "block.betterend.end_moss": "Musgo del End", + "block.betterend.endstone_dust": "Polvo de Piedra del End", + + "block.betterend.end_mycelium_path": "Camino de Micelio del End", + "block.betterend.end_moss_path": "Camino de Musgo del End", + + "block.betterend.ender_ore": "Mena de Ender", + "block.betterend.terminite_block": "Bloque de Terminita", + "block.betterend.aeternium_block": "Bloque de Aeternio", + "block.betterend.ender_block": "Bloque de Ender", + "block.betterend.end_stone_smelter": "Fundidor de Piedra del End", + + "item.betterend.ender_dust": "Polvo de Ender", + "item.betterend.ender_shard": "Fragmento de Ender", + "item.betterend.terminite_ingot": "Lingote de Terminita", + "item.betterend.aeternium_ingot": "Lingote de Aeternio", + "item.betterend.terminite_helmet": "Casco de Terminita", + "item.betterend.terminite_chestplate": "Pechera de Terminita", + "item.betterend.terminite_leggings": "Grebas de Terminita", + "item.betterend.terminite_boots": "Botas de Terminita", + "item.betterend.terminite_shovel": "Pala de Terminita", + "item.betterend.terminite_sword": "Espada de Terminita", + "item.betterend.terminite_pickaxe": "Pico de Terminita", + "item.betterend.terminite_axe": "Hacha de Terminita", + "item.betterend.terminite_hoe": "Azada de Terminita", + "item.betterend.terminite_hammer": "Maryillo Herrero de Terminita", + "item.betterend.aeternium_helmet": "Casco de Aeternio", + "item.betterend.aeternium_chestplate": "Pechera de Aeternio", + "item.betterend.aeternium_leggings": "Grebas de Aeternio", + "item.betterend.aeternium_boots": "Botas de Aeternio", + "item.betterend.aeternium_shovel": "Pala de Aeternio", + "item.betterend.aeternium_sword": "Espada de Aeternio", + "item.betterend.aeternium_pickaxe": "Pico de Aeternio", + "item.betterend.aeternium_axe": "Hacha de Aeternio", + "item.betterend.aeternium_hoe": "Azada de Aeternio", + "item.betterend.aeternium_hammer": "Martillo Herrero de Aeternio", + "item.betterend.iron_hammer": "Martillo Herrero de Hierro", + "item.betterend.golden_hammer": "Martillo Herrero de Oro", + "item.betterend.diamond_hammer": "Martillo Herrero de Diamante", + "item.betterend.netherite_hammer": "Martillo Herrero de Netherite", + "item.betterend.crystalite_boots": "Botas de Cristalita", + "item.betterend.crystalite_chestplate": "Pechera de Cristalita", + "item.betterend.crystalite_helmet": "Casco de Cristalita", + "item.betterend.crystalite_leggings": "Grebas de Cristalita", + "item.betterend.aeternium_axe_head": "Aeternium Axe Head", + "item.betterend.aeternium_hammer_head": "Aeternium Hammer Head", + "item.betterend.aeternium_hoe_head": "Cabeza de Azada de Aeternio", + "item.betterend.aeternium_pickaxe_head": "Cabeza de Pico de Aeternio", + "item.betterend.aeternium_shovel_head": "Cabeza de Pala de Aeternio", + "item.betterend.aeternium_sword_blade": "Hoja de Espada de Aeternio", + "item.betterend.aeternium_sword_handle": "Mango de Espada de Aeternio", + "item.betterend.leather_stripe": "Raya de Cuero", + "item.betterend.leather_wrapped_stick": "Palo Envuelto con Cuero", + "item.betterend.elytra_armored": "Elytra Blindada", + "item.betterend.elytra_crystalite": "Elytra de Cristalite", + "item.betterend.enchanted_membrane": "Membrana Encantada", + + "effect.betterend.end_veil": "Velo del End", + "enchantment.betterend.end_veil": "Velo del End", + "item.minecraft.potion.effect.end_veil": "Poción de Velo del End", + "item.minecraft.potion.effect.long_end_veil": "Poción de Velo del End", + "item.minecraft.splash_potion.effect.end_veil": "Poción Arrojadiza de Velo del End", + "item.minecraft.splash_potion.effect.long_end_veil": "Poción Arrojadiza de Velo del End", + "item.minecraft.lingering_potion.effect.end_veil": "Poción de Efecto Duradero de Velo del End", + "item.minecraft.lingering_potion.effect.long_end_veil": "Poción de Efecto Duradero de Velo del End", + "item.minecraft.tipped_arrow.effect.end_veil": "Flecha de Velo del End", + "item.minecraft.tipped_arrow.effect.long_end_veil": "Flecha de Velo del End", + + "block.betterend.mossy_glowshroom_sapling": "Sapling de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_cap": "Gorra de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_fur": "Pelo de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_hymenophore": "Himenóforo de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_bark": "Corteza de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_barrel": "Barril de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_button": "Botón de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_chest": "Cofre de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_crafting_table": "Mesa de Crafteo de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_door": "Puerta de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_fence": "Valla de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_gate": "Puerta de Valla de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_ladder": "Escalera de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_log": "Tronco de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_planks": "Tablones de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_plate": "Placa de Presión de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_sign": "Cartel de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_slab": "Losa de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_stairs": "Escaleras de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_stripped_bark": "Corteza Despojada de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_stripped_log": "Tronco Despojado de Seta Luminosa Musgosa", + "block.betterend.mossy_glowshroom_trapdoor": "Trampilla de Seta Luminosa Musgosa", + + "block.betterend.umbrella_moss": "Paraguas de Musgo", + "block.betterend.umbrella_moss_tall": "Paraguas de Musgo Alto", + "block.betterend.creeping_moss": "Musgo Reptante", + + "block.betterend.blue_vine_seed": "Semilla de Vid Azul", + "block.betterend.blue_vine": "Vid Azul", + "block.betterend.blue_vine_lantern": "Linterna de Vid Azul", + "block.betterend.blue_vine_fur": "Pelo de Vid Azul", + + "block.betterend.dense_vine": "Vid Densa", + "block.betterend.bubble_coral": "Burbuja Coral", + "block.betterend.aurora_crystal": "Cristal Aurora", + "item.betterend.crystal_shards": "Fragmentos de Cristal", + + "block.betterend.pythadendron_sapling": "Sapling de Fitadendrón", + "block.betterend.pythadendron_bark": "Corteza de Fitadendrón", + "block.betterend.pythadendron_barrel": "Barril de Fitadendrón", + "block.betterend.pythadendron_button": "Botón de Fitadendrón", + "block.betterend.pythadendron_chest": "Cofre de Fitadendrón", + "block.betterend.pythadendron_crafting_table": "Mesa de Crafteo de Fitadendrón", + "block.betterend.pythadendron_door": "Puerta de Fitadendrón", + "block.betterend.pythadendron_fence": "Valla de Fitadendrón", + "block.betterend.pythadendron_gate": "Puerta de Valla de Fitadendrón", + "block.betterend.pythadendron_ladder": "Escalera de Fitadendrón", + "block.betterend.pythadendron_log": "Tronco de Fitadendrón", + "block.betterend.pythadendron_planks": "Tablones de Fitadendrón", + "block.betterend.pythadendron_plate": "Placa de Presión de Fitadendrón", + "block.betterend.pythadendron_sign": "Cartel de Fitadendrón", + "block.betterend.pythadendron_slab": "Losa de Fitadendrón", + "block.betterend.pythadendron_stairs": "Escaleras de Fitadendrón", + "block.betterend.pythadendron_stripped_bark": "Corteza Despojada de Fitadendrón", + "block.betterend.pythadendron_stripped_log": "Tronco Despojado de Fitadendrón", + "block.betterend.pythadendron_trapdoor": "Trampilla de Fitadendrón", + + "block.betterend.chorus_nylium": "Nilio Coral", + "block.betterend.chorus_nylium_path": "Camino de Nilio Coras", + "block.betterend.chorus_grass": "Hierba Coral", + + "block.betterend.end_lily": "Nenúfar del End", + "block.betterend.end_lily_seed": "Semilla de Nenúfar del End", + "item.betterend.end_lily_leaf": "Hoja de Nenúfar del End", + "item.betterend.end_lily_leaf_dried": "Hoja Seca de Nenúfar del End", + + "block.betterend.violecite": "Violecita", + "block.betterend.violecite_bricks": "Ladrillos de Violecita", + "block.betterend.violecite_bricks_slab": "Losa de Ladrillos de Violecita", + "block.betterend.violecite_bricks_stairs": "Escaleras de Ladrillos de Violecita", + "block.betterend.violecite_bricks_wall": "Muro de Ladrillos de Violecita", + "block.betterend.violecite_button": "Botón de Violecita", + "block.betterend.violecite_pillar": "Pilar de Violecita", + "block.betterend.violecite_plate": "Placa de Presión de Violecita", + "block.betterend.violecite_slab": "Losa de Violecita", + "block.betterend.violecite_tiles": "Casilla de Violecita", + "block.betterend.violecite_stairs": "Escaleras de Violecita", + "block.betterend.violecite_polished": "Violecita Pulida", + "block.betterend.violecite_wall": "Muro de Violecita", + "block.betterend.violecite_pedestal": "Pedestal de Violecita", + + "block.betterend.flavolite": "Flavolita", + "block.betterend.flavolite_bricks": "Ladrillos de Flavolita", + "block.betterend.flavolite_bricks_slab": "Losa de Ladrillos de Flavolita", + "block.betterend.flavolite_bricks_stairs": "Escaleras de Ladrillos de Flavolita", + "block.betterend.flavolite_bricks_wall": "Muro de Ladrillos de Flavolita", + "block.betterend.flavolite_button": "Botón de Flavolita", + "block.betterend.flavolite_pillar": "Pilar de Flavolita", + "block.betterend.flavolite_plate": "Placa de Presión de Flavolita", + "block.betterend.flavolite_slab": "Losa de Flavolita", + "block.betterend.flavolite_tiles": "Casilla de Flavolita", + "block.betterend.flavolite_stairs": "Escaleras de Flavolita", + "block.betterend.flavolite_polished": "Flavolita Pulida", + "block.betterend.flavolite_wall": "Muro de Flavolita", + "block.betterend.flavolite_pedestal": "Pedestal de Flavolita", + + "block.betterend.andesite_pedestal": "Pedestal de Andesita", + "block.betterend.diorite_pedestal": "Pdestal de Diorita", + "block.betterend.granite_pedestal": "Pedestal de Granito", + "block.betterend.purpur_pedestal": "Pedestal de Purpur", + "block.betterend.quartz_pedestal": "Pedestal de Cuarzo", + "block.betterend.infusion_pedestal": "Pedestal de Infusión", + + "block.betterend.end_lotus_seed": "Semilla de Loto del End", + "block.betterend.end_lotus_stem": "Tallo de Loto del End", + "block.betterend.end_lotus_leaf": "Hoja de Loto del End", + "block.betterend.end_lotus_flower": "Flor de Loto el End", + + "block.betterend.end_lotus_bark": "Corteza de Loto del End", + "block.betterend.end_lotus_barrel": "Barril de Loto del End", + "block.betterend.end_lotus_button": "Botón de Loto del End", + "block.betterend.end_lotus_chest": "Cofre de Loto del End", + "block.betterend.end_lotus_crafting_table": "Mesa de Crafteo de Loto del End", + "block.betterend.end_lotus_door": "Puerta de Loto del End", + "block.betterend.end_lotus_fence": "Valla de Loto del End", + "block.betterend.end_lotus_gate": "Puerta de Valla de Loto del End", + "block.betterend.end_lotus_ladder": "Escalera de Loto del End", + "block.betterend.end_lotus_log": "Tronco de Loto del End", + "block.betterend.end_lotus_planks": "Tablones de Loto del End", + "block.betterend.end_lotus_plate": "Placa de Presión de Loto del End", + "block.betterend.end_lotus_sign": "Cartel de Loto del End", + "block.betterend.end_lotus_slab": "Losa de Loto del End", + "block.betterend.end_lotus_stairs": "Escaleras de Loto del End", + "block.betterend.end_lotus_stripped_bark": "Corteza Despojada de Loto del End", + "block.betterend.end_lotus_stripped_log": "Tronco Despojado de Loto del End", + "block.betterend.end_lotus_trapdoor": "Trampilla de Loto del End", + + "block.betterend.cave_moss": "Musgo de Cueva", + "block.betterend.cave_grass": "Hierba de Cueva", + "block.betterend.cave_bush": "Arbusto de Cueva", + + "block.betterend.cave_moss_path": "Camino de Musgo de Cueva", + "block.betterend.crystal_moss": "Musgo de Cristal", + "block.betterend.crystal_moss_path": "Camino de Musgo de Cristal", + "block.betterend.pythadendron_leaves": "Hojas de Fitadendrón", + "item.betterend.spawn_egg_end_fish": "Huevo de Generación de Pez del End", + "block.betterend.crystal_grass": "Hierba de Cristal", + + "block.betterend.flavolite_runed": "Flavolita de Runa", + "block.betterend.end_portal_block": "Portal del End", + "block.betterend.eternal_pedestal": "Pedestal Eterno", + "block.betterend.flavolite_runed_eternal": "Flavolita de Runa Eterna", + "item.betterend.eternal_crystal": "Cristal Eterno", + + "block.betterend.lacugrove_bark": "Corteza de Lacugrove", + "block.betterend.lacugrove_barrel": "Barril de Lacugrove", + "block.betterend.lacugrove_button": "Botón de Lacugrove", + "block.betterend.lacugrove_chest": "Cofre de Lacugrove", + "block.betterend.lacugrove_crafting_table": "Mesa de Crafteo de Lacugrove", + "block.betterend.lacugrove_door": "Puerta de Lacugrove", + "block.betterend.lacugrove_fence": "Valla de Lacugrove", + "block.betterend.lacugrove_gate": "Puerta de Valla de Lacugrove", + "block.betterend.lacugrove_ladder": "Escalera de Lacugrove", + "block.betterend.lacugrove_log": "Tronco de Lacugrove", + "block.betterend.lacugrove_planks": "Tablones de Lacugrove", + "block.betterend.lacugrove_plate": "Placa de Presión de Lacugrove", + "block.betterend.lacugrove_sign": "Cartel de Lacugrove", + "block.betterend.lacugrove_slab": "Losa de Lacugrove", + "block.betterend.lacugrove_stairs": "Escaleras de Lacugrove", + "block.betterend.lacugrove_stripped_bark": "Corteza Despojada de Lacugrove", + "block.betterend.lacugrove_stripped_log": "Tronco Despojado de Lacugrove", + "block.betterend.lacugrove_trapdoor": "Trampilla de Lacugrove", + + "block.betterend.lacugrove_leaves": "Hojas de Lacugrove", + "block.betterend.lacugrove_sapling": "Sapling de Lacugrove", + + "biome.betterend.megalake_grove": "Arboleda del Megalago", + "biome.betterend.painted_mountains": "Montañas Pintadas", + + "block.betterend.dragon_tree_bark": "Corteza de Árbol de Dragón", + "block.betterend.dragon_tree_barrel": "Barril de Árbol de Dragón", + "block.betterend.dragon_tree_button": "Botón de Árbol de Dragón", + "block.betterend.dragon_tree_chest": "Cofre de Árbol de Dragón", + "block.betterend.dragon_tree_crafting_table": "Mesa de Crafteo de Árbol de Dragón", + "block.betterend.dragon_tree_door": "Puerta de Árbol de Dragón", + "block.betterend.dragon_tree_fence": "Valla de Árbol de Dragón", + "block.betterend.dragon_tree_gate": "Puerta de Valla de Árbol de Dragón", + "block.betterend.dragon_tree_ladder": "Escalera de Árbol de Dragón", + "block.betterend.dragon_tree_log": "Tronco de Árbol de Dragón", + "block.betterend.dragon_tree_planks": "Tablones de Árbol de Dragón", + "block.betterend.dragon_tree_plate": "Placa de Presión de Árbol de Dragón", + "block.betterend.dragon_tree_sign": "Cartel de Árbol de Dragón", + "block.betterend.dragon_tree_slab": "Losa de Árbol de Dragón", + "block.betterend.dragon_tree_stairs": "Escaleras de Árbol de Dragón", + "block.betterend.dragon_tree_stripped_bark": "Corteza Despojada de Árbol de Dragón", + "block.betterend.dragon_tree_stripped_log": "Tronco Despojado de Árbol de Dragón", + "block.betterend.dragon_tree_trapdoor": "Trampilla de Árbol de Dragón", + + "biome.betterend.shadow_forest": "Bosque Sombrío", + "block.betterend.dragon_tree_leaves": "Hojas de Árbol de Dragón", + "block.betterend.dragon_tree_sapling": "Sapling de Árbol de Dragón", + "block.betterend.shadow_grass": "Hierba Sombría", + "block.betterend.shadow_grass_path": "Camino de Hierba Sombría", + "block.betterend.shadow_plant": "Planta Sombría", + + "block.betterend.dragon_tree_bookshelf": "Librería de Árbol de Dragón", + "block.betterend.end_lotus_bookshelf": "Librería de Loto del End", + "block.betterend.lacugrove_bookshelf": "Librería de Lacugrove", + "block.betterend.mossy_glowshroom_bookshelf": "Librería de Seta Luminosa Musgosa", + "block.betterend.pythadendron_bookshelf": "Librería de Fitadendrón", + + "block.betterend.murkweed": "Hierba Oscura", + "block.betterend.needlegrass": "Hierba Punzante", + "block.betterend.twisted_vine": "Vid Retorcida", + + "block.betterend.shadow_berry": "Semillas de Balla Sombría", + "item.betterend.shadow_berry_cooked": "Balla Sombría Cocinada", + "item.betterend.shadow_berry_raw": "Balla Sombría", + "block.betterend.purple_polypore": "Políporo Morado", + + "block.betterend.cyan_moss": "Musgo Cyan", + "block.betterend.tail_moss": "Musgo Cola", + + "block.betterend.flavolite_lantern": "Linterna de Flavolita", + "block.betterend.end_stone_lantern": "Linterna de Piedra del End", + "block.betterend.violecite_lantern": "Linterna de Violecita", + + "entity.betterend.end_fish": "Pez del End", + "entity.betterend.shadow_walker": "Caminador Sombrío", + "item.betterend.spawn_egg_shadow_walker": "Huevo de Generación de Caminador Sombrío", + + "block.betterend.andesite_lantern": "Linterna de Andesita", + "block.betterend.blackstone_lantern": "Linterna de Piedra Negra", + "block.betterend.diorite_lantern": "Linterna de Diorita", + "block.betterend.granite_lantern": "Linterna de Granito", + "block.betterend.purpur_lantern": "Linterna de Purpur", + "block.betterend.quartz_lantern": "Linterna de Cuarzo", + + "item.betterend.bucket_end_fish": "Cubo de Pez del End", + "item.betterend.bucket_cubozoa": "Cubo de Cubozoa", + "item.betterend.end_fish_cooked": "Pez del End Cocinado", + "item.betterend.end_fish_raw": "Pez del End", + + "biome.betterend.amber_land": "Tierra de Ámbar", + "biome.betterend.blossoming_spires": "Agujas Florecientes", + "block.betterend.amber_grass": "Hierba de Ámber", + "block.betterend.amber_grass_path": "Camino de Hierba de Ámber", + "block.betterend.tenanea_bark": "Corteza de Tenanea", + "block.betterend.tenanea_barrel": "Barril de Tenanea", + "block.betterend.tenanea_bookshelf": "Librería de Tenanea", + "block.betterend.tenanea_button": "Botón de Tenanea", + "block.betterend.tenanea_chest": "Cofre de Tenanea", + "block.betterend.tenanea_crafting_table": "Mesa de Crafteo de Tenanea", + "block.betterend.tenanea_door": "Puerta de Tenanea", + "block.betterend.tenanea_fence": "Valla de Tenanea", + "block.betterend.tenanea_gate": "Puerta de Valla de Tenanea", + "block.betterend.tenanea_ladder": "Escalera de Tenanea", + "block.betterend.tenanea_leaves": "Hojas de Tenanea", + "block.betterend.tenanea_log": "Tronco de Tenanea", + "block.betterend.tenanea_planks": "Tablones de Tenanea", + "block.betterend.tenanea_plate": "Placa de Presión de Tenanea", + "block.betterend.tenanea_sapling": "Sapling de Tenanea", + "block.betterend.tenanea_sign": "Cartel de Tenanea", + "block.betterend.tenanea_slab": "Losa de Tenanea", + "block.betterend.tenanea_stairs": "Escaleras de Tenanea", + "block.betterend.tenanea_stripped_bark": "Corteza Despojada de Tenanea", + "block.betterend.tenanea_stripped_log": "Tronco Despojado de Tenanea", + "block.betterend.tenanea_trapdoor": "Trampilla de Tenanea", + + "block.betterend.amber_block": "Bloque de Ámbar", + "block.betterend.amber_ore": "Mena de Ámbar", + "item.betterend.amber_gem": "Gema de Ámbar", + "item.betterend.raw_amber": "Ámbar Crudo", + "block.betterend.tenanea_flowers": "Flores de Tenanea", + "block.betterend.tenanea_outer_leaves": "Hojas Exteriores de Tenanea", + + "block.betterend.pink_moss": "Musgo Rosa", + "block.betterend.pink_moss_path": "Camino de Musgo Rosa", + + "block.betterend.twisted_moss": "Musgo Retorcido", + + "block.betterend.bulb_vine": "Vid de Bulbo", + "block.betterend.bulb_vine_seed": "Semilla de Vid de Bulbo", + "item.betterend.glowing_bulb": "Bulbo Brillante", + + "block.betterend.iron_bulb_lantern": "Linterna de Bulbo de Hierro", + "block.betterend.iron_bulb_lantern_black": "Linterna de Bulbo de Hierro Negra", + "block.betterend.iron_bulb_lantern_blue": "Linterna de Bulbo de Hierro Azul", + "block.betterend.iron_bulb_lantern_brown": "Linterna de Bulbo de Hierro Marrón", + "block.betterend.iron_bulb_lantern_cyan": "Linterna de Bulbo de Hierro Cyan", + "block.betterend.iron_bulb_lantern_gray": "Linterna de Bulbo de Hierro Gris", + "block.betterend.iron_bulb_lantern_green": "Linterna de Bulbo de Hierro Verde", + "block.betterend.iron_bulb_lantern_light_blue": "Linterna de Bulbo de Hierro Azul Claro", + "block.betterend.iron_bulb_lantern_light_gray": "Linterna de Bulbo de Hierro Gris Claro", + "block.betterend.iron_bulb_lantern_lime": "Linterna de Bulbo de Hierro Lima", + "block.betterend.iron_bulb_lantern_magenta": "Linterna de Bulbo de Hierro Magenta", + "block.betterend.iron_bulb_lantern_orange": "Linterna de Bulbo de Hierro Naranja", + "block.betterend.iron_bulb_lantern_pink": "Linterna de Bulbo de Hierro Rosa", + "block.betterend.iron_bulb_lantern_purple": "Linterna de Bulbo de Hierro Morada", + "block.betterend.iron_bulb_lantern_red": "Linterna de Bulbo de Hierro Roja", + "block.betterend.iron_bulb_lantern_white": "Linterna de Bulbo de Hierro Blanca", + "block.betterend.iron_bulb_lantern_yellow": "Linterna de Bulbo de Hierro Amarilla", + + "block.betterend.thallasium_bulb_lantern": "Linterna de Bulbo de Talismanio", + "block.betterend.thallasium_bulb_lantern_black": "Linterna de Bulbo de Talismanio Negra", + "block.betterend.thallasium_bulb_lantern_blue": "Linterna de Bulbo de Talismanio Azul", + "block.betterend.thallasium_bulb_lantern_brown": "Linterna de Bulbo de Talismanio Marrón", + "block.betterend.thallasium_bulb_lantern_cyan": "Linterna de Bulbo de Talismanio Cyan", + "block.betterend.thallasium_bulb_lantern_gray": "Linterna de Bulbo de Talismanio Gris", + "block.betterend.thallasium_bulb_lantern_green": "Linterna de Bulbo de Talismanio Verde", + "block.betterend.thallasium_bulb_lantern_light_blue": "Linterna de Bulbo de Talismanio Azul Claro", + "block.betterend.thallasium_bulb_lantern_light_gray": "Linterna de Bulbo de Talismanio Gris Claro", + "block.betterend.thallasium_bulb_lantern_lime": "Linterna de Bulbo de Talismanio Lima", + "block.betterend.thallasium_bulb_lantern_magenta": "Linterna de Bulbo de Talismanio Magenta", + "block.betterend.thallasium_bulb_lantern_orange": "Linterna de Bulbo de Talismanio Naranja", + "block.betterend.thallasium_bulb_lantern_pink": "Linterna de Bulbo de Talismanio Rosa", + "block.betterend.thallasium_bulb_lantern_purple": "Linterna de Bulbo de Talismanio Morada", + "block.betterend.thallasium_bulb_lantern_red": "Linterna de Bulbo de Talismanio Roja", + "block.betterend.thallasium_bulb_lantern_white": "Linterna de Bulbo de Talismanio Blanca", + "block.betterend.thallasium_bulb_lantern_yellow": "Linterna de Bulbo de Talismanio Amarilla", + + "block.betterend.bushy_grass": "Hierba Tupida", + + "block.betterend.brimstone": "Azufre", + "block.betterend.sulphuric_rock": "Roca Sulfúrica", + "block.betterend.sulphuric_rock_bricks": "Ladrillos de Roca Sulfúrica", + "block.betterend.sulphuric_rock_bricks_slab": "Losa de Ladrillos de Roca Sulfúrica", + "block.betterend.sulphuric_rock_bricks_stairs": "Escaleras de Ladrillos de Roca Sulfúrica", + "block.betterend.sulphuric_rock_bricks_wall": "Muro de Ladrillos de Roca Sulfúrica", + "block.betterend.sulphuric_rock_button": "Botón de Roca Sulfúrica", + "block.betterend.sulphuric_rock_lantern": "Linterna de Roca Sulfúrica", + "block.betterend.sulphuric_rock_pedestal": "Pedestal de Roca Sulfúrica", + "block.betterend.sulphuric_rock_pillar": "Pilar de Roca Sulfúrica", + "block.betterend.sulphuric_rock_plate": "Placa de Presión de Roca Sulfúrica", + "block.betterend.sulphuric_rock_polished": "Roca Sulfúrica Pulida", + "block.betterend.sulphuric_rock_slab": "Losa de Roca Sulfúrica", + "block.betterend.sulphuric_rock_stairs": "Escaleras de Roca Sulfúrica", + "block.betterend.sulphuric_rock_tiles": "Casillas de Roca Sulfúrica", + "block.betterend.sulphuric_rock_wall": "Muro de Roca Sulfúrica", + "block.betterend.sulphur_crystal": "Cristal de Sulfuro", + "item.betterend.crystalline_sulphur": "Sulfuro", + + "biome.betterend.sulphur_springs": "Manantiales de Sulfuro", + "block.betterend.hydralux_petal_block": "Bloque de Pétalos de Hidrálux", + "block.betterend.hydralux_petal_block_black": "Bloque de Pétalos Negro", + "block.betterend.hydralux_petal_block_blue": "Bloque de Pétalos Azul", + "block.betterend.hydralux_petal_block_brown": "Bloque de Pétalos Marrón", + "block.betterend.hydralux_petal_block_cyan": "Bloque de Pétalos Cyan", + "block.betterend.hydralux_petal_block_gray": "Bloque de Pétalos Gris", + "block.betterend.hydralux_petal_block_green": "Bloque de Pétalos Verde", + "block.betterend.hydralux_petal_block_light_blue": "Bloque de Pétalos Azul Claro", + "block.betterend.hydralux_petal_block_light_gray": "Bloque de Pétalos Gris Claro", + "block.betterend.hydralux_petal_block_lime": "Bloque de Pétalos Lima", + "block.betterend.hydralux_petal_block_magenta": "Bloque de Pétalos Magenta", + "block.betterend.hydralux_petal_block_orange": "Bloque de Pétalos Naranja", + "block.betterend.hydralux_petal_block_pink": "Bloque de Pétalos Rosa", + "block.betterend.hydralux_petal_block_purple": "Bloque de Pétalos Morado", + "block.betterend.hydralux_petal_block_red": "Bloque de Pétalos Rojo", + "block.betterend.hydralux_petal_block_white": "Bloque de Pétalos Blanco", + "block.betterend.hydralux_petal_block_yellow": "Bloque de Pétalos Amarillo", + "block.betterend.hydralux_sapling": "Sapling de Hidrálux", + "block.betterend.hydrothermal_vent": "Ventilación Hidrotermal", + "item.betterend.hydralux_petal": "Pétalo de Hidrálux", + "item.betterend.enchanted_petal": "Pétalo Encantado", + + "block.betterend.menger_sponge": "Esponja Menguer", + "block.betterend.menger_sponge_wet": "Esponja Menguer Mojadar", + "block.betterend.tube_worm": "Tubo de Gusano", + + "block.betterend.charnia_cyan": "Charnia Cyan", + "block.betterend.charnia_light_blue": "Charnia Azul Claro", + "block.betterend.charnia_orange": "Charnia Naranja", + "block.betterend.charnia_purple": "Charnia Morado", + "block.betterend.charnia_red": "Charnia Rojo", + + "entity.betterend.cubozoa": "Cubozoa", + "item.betterend.spawn_egg_cubozoa": "Huevo de Generación de Cubozoa", + + "item.betterend.gelatine": "Gelatina", + "item.betterend.sweet_berry_jelly": "Gelatina de Balla Dulce", + "item.betterend.shadow_berry_jelly": "Gelatina de Balla Sombría", + + "block.betterend.amber_moss": "Musgo de Ámbar", + "block.betterend.amber_moss_path": "Camino de Musgo de Ámbar", + "block.betterend.helix_tree_bark": "Corteza de Árbol Helix", + "block.betterend.helix_tree_barrel": "Barril de Árbol Helix", + "block.betterend.helix_tree_bookshelf": "Librería de Árbol Helix", + "block.betterend.helix_tree_button": "Botón de Árbol Helix", + "block.betterend.helix_tree_chest": "Cofre de Helix Tree Chest", + "block.betterend.helix_tree_crafting_table": "Mesa de Crafteo de Árbol Helix", + "block.betterend.helix_tree_door": "Puerta de Árbol Helix", + "block.betterend.helix_tree_fence": "Valla de Árbol Helix", + "block.betterend.helix_tree_gate": "Puerta de Valla de Árbol Helix", + "block.betterend.helix_tree_ladder": "Escalera de Árbol Helix", + "block.betterend.helix_tree_leaves": "Hojas de Árbol Helix", + "block.betterend.helix_tree_log": "Tronco de Árbol Helix", + "block.betterend.helix_tree_planks": "Tablones de Árbol Helix", + "block.betterend.helix_tree_plate": "Placa de Presión de Árbol Helix", + "block.betterend.helix_tree_sapling": "Sapling de Árbol Helix", + "block.betterend.helix_tree_sign": "Cartel de Árbol Helix", + "block.betterend.helix_tree_slab": "Losa de Árbol Helix", + "block.betterend.helix_tree_stairs": "Escaleras de Árbol Helix", + "block.betterend.helix_tree_stripped_bark": "Corteza Despojada de Árbol Helix", + "block.betterend.helix_tree_stripped_log": "Tronco Despojado de Árbol Helix", + "block.betterend.helix_tree_trapdoor": "Trampilla de Árbol Helix", + "block.betterend.lanceleaf": "Hoja Lanza", + "block.betterend.lanceleaf_seed": "Semilla de Hoja Lanza", + "block.betterend.hydralux": "Hidrálux", + "block.betterend.helix_tree_luminophor": "Luminóforo de Lanceleaf", + + "block.betterend.glowing_pillar_leaves": "Hojas de Pilar Brillante", + "block.betterend.glowing_pillar_luminophor": "Luminóforo de Pilar Brillante", + "block.betterend.glowing_pillar_roots": "Raíces de Pilar Brillante", + "block.betterend.glowing_pillar_seed": "Semilla de Pilar Brillante", + + "biome.betterend.ice_starfield": "Campo Estelar de Hielo", + + "block.betterend.ancient_emerald_ice": "Hielo de Esmeralda Antiguo", + "block.betterend.dense_emerald_ice": "Hielo de Esmeralda Denso", + "block.betterend.dense_snow": "Nieve Densa", + "block.betterend.emerald_ice": "Hielo de Esmeralda", + + "block.betterend.bulb_moss": "Musgo de Bulbo", + + "block.betterend.charnia_green": "Charnia Verde", + "block.betterend.vent_bubble_column": "Ventilación de Columna Burbuja", + "block.betterend.respawn_obelisk": "Obelisco de Reaparición", + "message.betterend.set_spawn": "\u00A7b\u00A7lTu punto de reaparición se ha configurado aquí", + "message.betterend.fail_spawn": "\u00A7c\u00A7lNecesitas sostener 6 Gemas de Ámbar para configurar tu punto de reaparición", + + "block.betterend.dragon_tree_composter": "Compostador de Árbol de Dragón", + "block.betterend.end_lotus_composter": "Compostador de Loto del End", + "block.betterend.helix_tree_composter": "Compostador de Árbol Helix", + "block.betterend.lacugrove_composter": "Compostador de Lacugrove", + "block.betterend.mossy_glowshroom_composter": "Compostador de Seta Luminosa Musgosa", + "block.betterend.pythadendron_composter": "Compostador de Fitadendrón", + "block.betterend.tenanea_composter": "Compostador de Tenanea", + + "biome.betterend.old_bulbis_gardens": "Jardín de Bulbis Viejos", + "block.betterend.ivis_moss": "Musgo Ivis", + "block.betterend.ivis_vine": "Vid Ivis", + "block.betterend.silk_moth_nest": "Nido de Polilla de Seda", + + "block.betterend.umbrella_tree_bark": "Corteza de Árbol Paraguas", + "block.betterend.umbrella_tree_barrel": "Barril de Árbol Paraguas", + "block.betterend.umbrella_tree_bookshelf": "Librería de Árbol Paraguas", + "block.betterend.umbrella_tree_button": "Botón de Árbol Paraguas", + "block.betterend.umbrella_tree_chest": "Cofre de Árbol Paraguas", + "block.betterend.umbrella_tree_composter": "Compostador de Árbol Paraguas", + "block.betterend.umbrella_tree_crafting_table": "Mesa de Crafteo de Árbol Paraguas", + "block.betterend.umbrella_tree_door": "Puerta de Árbol Paraguas", + "block.betterend.umbrella_tree_fence": "Valla de Árbol Paraguas", + "block.betterend.umbrella_tree_gate": "Puerta de Valla de Árbol Paraguas", + "block.betterend.umbrella_tree_ladder": "Escalera de Árbol Paraguas", + "block.betterend.umbrella_tree_log": "Tronco de Árbol Paraguas", + "block.betterend.umbrella_tree_planks": "Tablones de Árbol Paraguas", + "block.betterend.umbrella_tree_plate": "Placa de Presión de Árbol Paraguas", + "block.betterend.umbrella_tree_sign": "Cartel de Árbol Paraguas", + "block.betterend.umbrella_tree_slab": "Losa de Árbol Paraguas", + "block.betterend.umbrella_tree_stairs": "Escaleras de Árbol Paraguas", + "block.betterend.umbrella_tree_stripped_bark": "Corteza Despojada de Árbol Paraguas", + "block.betterend.umbrella_tree_stripped_log": "Tronco Despojado de Árbol Paraguas", + "block.betterend.umbrella_tree_trapdoor": "Trampilla de Árbol Paraguas", + "block.betterend.umbrella_tree_membrane": "Membrana de Árbol Paraguas", + + "biome.betterend.umbrella_jungle": "Jungla Paraguas", + "block.betterend.jungle_grass": "Hierba de Jungla", + "block.betterend.jungle_moss": "Musgo de Jungla", + "block.betterend.jungle_moss_path": "Camino de Musgo de Jungla", + "block.betterend.small_jellyshroom": "Seta Gelatinosa Pequeña", + "block.betterend.twisted_umbrella_moss": "Musgo de Paraguas Retorcido", + "block.betterend.twisted_umbrella_moss_tall": "Musgo de Paraguas Retorcido Alto", + "block.betterend.umbrella_tree_cluster": "Racimo de Árbol Paraguas", + "block.betterend.umbrella_tree_cluster_empty": "Racimo de Árbol Paraguas Vacío", + "block.betterend.jungle_vine": "Vid de Jungla", + "block.betterend.jungle_fern": "Helecho de Jungla", + + "block.betterend.jellyshroom_bark": "Corteza de Seta Gelatinosa", + "block.betterend.jellyshroom_barrel": "Barril de Seta Gelatinosa", + "block.betterend.jellyshroom_bookshelf": "Librería de Seta Gelatinosa", + "block.betterend.jellyshroom_button": "Botón de Seta Gelatinosa", + "block.betterend.jellyshroom_cap_purple": "Copa de Seta Gelatinosa", + "block.betterend.jellyshroom_chest": "Cofre de Seta Gelatinosa", + "block.betterend.jellyshroom_composter": "Compostador de Seta Gelatinosa", + "block.betterend.jellyshroom_crafting_table": "Mesa de Crafteo de Seta Gelatinosa", + "block.betterend.jellyshroom_door": "Puerta de Seta Gelatinosa", + "block.betterend.jellyshroom_fence": "Valla de Seta Gelatinosa", + "block.betterend.jellyshroom_gate": "Puerta de Valla de Seta Gelatinosa", + "block.betterend.jellyshroom_ladder": "Escalera de Seta Gelatinosa", + "block.betterend.jellyshroom_log": "Tronco de Seta Gelatinosa", + "block.betterend.jellyshroom_planks": "Tablones de Seta Gelatinosa", + "block.betterend.jellyshroom_plate": "Placa de Presión de Seta Gelatinosa", + "block.betterend.jellyshroom_sign": "Cartel de Seta Gelatinosa", + "block.betterend.jellyshroom_slab": "Losa de Seta Gelatinosa", + "block.betterend.jellyshroom_stairs": "Escaleras de Seta Gelatinosa", + "block.betterend.jellyshroom_stripped_bark": "Corteza Despojada de Seta Gelatinosa", + "block.betterend.jellyshroom_stripped_log": "Tronco Despojado de Seta Gelatinosa", + "block.betterend.jellyshroom_trapdoor": "Trampilla de Seta Gelatinosa", + + "biome.betterend.eterial_grove": "Arboleda Eterial", + "block.betterend.umbrella_tree_sapling": "Sapling de Árbol Sombrilla", + "item.betterend.umbrella_cluster_juice": "Zumo de Racimo de Paraguas", + "block.betterend.blossom_berry_seed": "Semilla de Balla Floreciente", + "item.betterend.blossom_berry": "Balla Floreciente", + + "biome.betterend.nightshade_redwoods": "Secuoyas Nocturnas", + "block.betterend.nightshade_moss": "Musgo Nocturno", + + "biome.betterend.glowing_grasslands": "Tierras de Hierba Brillante", + "block.betterend.blooming_cooksonia": "Cooksonia Floreciente", + "block.betterend.fracturn": "Fracturno", + "block.betterend.lumecorn": "Lumecornia", + "block.betterend.salteago": "Salteago", + "block.betterend.vaiolush_fern": "Helecho Exhuberante", + "entity.betterend.silk_moth": "Polilla de eda", + "item.betterend.silk_fiber": "Fibra de Seda", + "item.betterend.spawn_egg_silk_moth": "Huevo de Generación de Polilla de Seda", + + "block.betterend.thallasium_ore": "Mena de Talismanio", + "item.betterend.thallasium_axe": "Hacha de Talismanio", + "item.betterend.thallasium_hoe": "Azada de Talismanio", + "item.betterend.thallasium_ingot": "Lingote de Talismanio", + "item.betterend.thallasium_pickaxe": "Pico de Talismanio", + "item.betterend.thallasium_shovel": "Pala de Talismanio", + "item.betterend.thallasium_sword": "Espada de Talismanio", + "block.betterend.thallasium_block": "Bloque de Talismanio", + + "block.betterend.thallasium_bars": "Barras de Talismanio", + "block.betterend.thallasium_door": "Puerta de Talismanio", + "block.betterend.thallasium_plate": "Placa de Presión de Talismanio", + "block.betterend.thallasium_tile": "Casilla de Talismanio", + "block.betterend.thallasium_trapdoor": "Trampilla de Talismanio", + + "block.betterend.lumecorn_seed": "Semilla de Lumecornia", + "item.betterend.lumecorn_rod": "Vara de Lumecornia", + "block.betterend.thallasium_chandelier": "Candelabro de Talismanio", + + "block.betterend.thallasium_anvil": "Yunque de Talismanio", + "block.betterend.thallasium_chain": "Cadena de Talismanio", + "block.betterend.thallasium_slab": "Losa de Talismanio", + "block.betterend.thallasium_stairs": "Escaleras de Talismanio", + + "block.betterend.gold_chandelier": "Candelabro de Oro", + "block.betterend.iron_chandelier": "Candelabro de Hierro", + "item.betterend.thallasium_nugget": "Pepita de Talismanio", + + "block.betterend.terminite_anvil": "Yunque de Terminita", + "block.betterend.terminite_bars": "Barras de Terminita", + + "block.betterend.terminite_bulb_lantern": "Linterna de Bulbo de Terminita", + "block.betterend.terminite_bulb_lantern_black": "Linterna de Bulbo de Terminita Negra", + "block.betterend.terminite_bulb_lantern_blue": "Linterna de Bulbo de Terminita Azul", + "block.betterend.terminite_bulb_lantern_brown": "Linterna de Bulbo de Terminita Marrón", + "block.betterend.terminite_bulb_lantern_cyan": "Linterna de Bulbo de Terminita Cyan", + "block.betterend.terminite_bulb_lantern_gray": "Linterna de Bulbo de Terminita Gris", + "block.betterend.terminite_bulb_lantern_green": "Linterna de Bulbo de Terminita Verde", + "block.betterend.terminite_bulb_lantern_light_blue": "Linterna de Bulbo de Terminita Azul Claro", + "block.betterend.terminite_bulb_lantern_light_gray": "Linterna de Bulbo de Terminita Gris Claro", + "block.betterend.terminite_bulb_lantern_lime": "Linterna de Bulbo de Terminita Lima", + "block.betterend.terminite_bulb_lantern_magenta": "Linterna de Bulbo de Terminita Magenta", + "block.betterend.terminite_bulb_lantern_orange": "Linterna de Bulbo de Terminita Naranja", + "block.betterend.terminite_bulb_lantern_pink": "Linterna de Bulbo de Terminita Rosa", + "block.betterend.terminite_bulb_lantern_purple": "Linterna de Bulbo de Terminita Morada", + "block.betterend.terminite_bulb_lantern_red": "Linterna de Bulbo de Terminita Roja", + "block.betterend.terminite_bulb_lantern_white": "Linterna de Bulbo de Terminita Blanca", + "block.betterend.terminite_bulb_lantern_yellow": "Linterna de Bulbo de Terminita Amarilla", + + "block.betterend.terminite_chain": "adena de Terminita", + "block.betterend.terminite_chandelier": "Candelabro de Terminita", + "block.betterend.terminite_door": "Puerta de Terminita", + "block.betterend.terminite_plate": "Placa de Presión de Terminita", + "block.betterend.terminite_slab": "Losa de Terminita", + "block.betterend.terminite_stairs": "Escaleras de Terminita", + "block.betterend.terminite_tile": "Casilla de Terminita", + "block.betterend.terminite_trapdoor": "Trampilla de Terminita", + "item.betterend.terminite_nugget": "Pepita de Terminita", + "item.betterend.thallasium_boots": "Botas de Talismanio", + "item.betterend.thallasium_chestplate": "Pechera de Talismanio", + "item.betterend.thallasium_hammer": "Martillo de Talismanio", + "item.betterend.thallasium_helmet": "Casco de Talismanio", + "item.betterend.thallasium_leggings": "Grebas de Talismanio", + "block.betterend.missing_tile": "Casilla Faltante", + "block.betterend.charcoal_block": "Bloque de Carbón Vegetal", + "block.betterend.end_stone_furnace": "Horno de Piedra del End", + "block.betterend.flavolite_furnace": "Horno de Flavolita", + "block.betterend.sulphuric_rock_furnace": "Horno de Roca Sulfúrica", + "block.betterend.violecite_furnace": "Horno de Violecita", + + "item.betterend.terminite_axe_head": "Cabeza de Hacha de Terminita", + "item.betterend.terminite_hoe_head": "Cabeza de Azada de Terminita", + "item.betterend.terminite_pickaxe_head": "Cabeza de Pico de Terminita", + "item.betterend.terminite_shovel_head": "Cabeza de Pala de Terminita", + "item.betterend.terminite_sword_blade": "Hoja de Espada de Terminita", + "item.betterend.terminite_sword_handle": "Mango de Espada de Terminita", + "item.betterend.thallasium_axe_head": "Cabeza de Hacha de Talismanio", + "item.betterend.thallasium_hoe_head": "Cabeza de Azada de Talismanio", + "item.betterend.thallasium_pickaxe_head": "Cabeza de Pico de Talismanio", + "item.betterend.thallasium_shovel_head": "Cabeza de Pala de Talismanio", + "item.betterend.thallasium_sword_blade": "Hoja de Espada de Talismanio", + "item.betterend.thallasium_sword_handle": "Mango de Espada de Talismanio", + "block.betterend.aeternium_anvil": "Yunque de Aeternio", + + "biome.betterend.dragon_graveyards": "Cementerios de Dragones", + "biome.betterend.dry_shrubland": "Matorral Seco", + "block.betterend.aeridium": "Aeridio", + "block.betterend.amaranita_cap": "Copa de Amaranita", + "block.betterend.amaranita_fur": "Pelo de Amaranita", + "block.betterend.amaranita_hymenophore": "Himenóforo de Amarinita", + "block.betterend.amaranita_hyphae": "Hifas de Amaranita", + "block.betterend.amaranita_lantern": "Linterna de Amaranita", + "block.betterend.amaranita_stem": "Tallo de Amaranita", + "block.betterend.clawfern": "Helecho de Garra", + "block.betterend.globulagus": "Globulagus", + "block.betterend.lamellarium": "Lamelario", + "block.betterend.large_amaranita_mushroom": "Seta de Amaranita Grande", + "block.betterend.lutebus": "Lutebús", + "block.betterend.mossy_bone": "Hueso Musgoso", + "block.betterend.mossy_obsidian": "Obsidiana Musgosa", + "block.betterend.orango": "Orango", + "block.betterend.rutiscus": "Rútiscus", + "block.betterend.rutiscus_path": "Camino de Rústicus", + "block.betterend.sangnum": "Sángnum", + "block.betterend.sangnum_path": "Camino de Sángnum", + "block.betterend.small_amaranita_mushroom": "Seta de Amarita Pequeña", + + "block.betterend.amber_root_seed": "Semilla de Raíz de Ámbar", + "block.betterend.azure_jadestone": "Piedra Jade Azur", + "block.betterend.azure_jadestone_bricks": "Ladrillos de Piedra Jade Azur", + "block.betterend.azure_jadestone_bricks_slab": "Losa de Ladrillos de Piedra Jade Azur", + "block.betterend.azure_jadestone_bricks_stairs": "Escaleras de Ladrillos de Piedra Jade Azur", + "block.betterend.azure_jadestone_bricks_wall": "Muro de Ladrillos de Piedra Jade Azur", + "block.betterend.azure_jadestone_button": "Botón de Piedra Jade Azur", + "block.betterend.azure_jadestone_furnace": "Horno de Piedra Jade Azur", + "block.betterend.azure_jadestone_lantern": "Linterna de Piedra Jade Azur", + "block.betterend.azure_jadestone_pedestal": "Pedestal de Piedra Jade Azur", + "block.betterend.azure_jadestone_pillar": "Pilar de Piedra Jade Azur", + "block.betterend.azure_jadestone_plate": "Placa de Presión de Piedra Jade Azur", + "block.betterend.azure_jadestone_polished": "Piedra Jade Azur Pulida", + "block.betterend.azure_jadestone_slab": "Losa de Piedra Jade Azur", + "block.betterend.azure_jadestone_stairs": "Escaleras de Piedra Jade Azur", + "block.betterend.azure_jadestone_tiles": "Casillas de Piedra Jade Azur", + "block.betterend.azure_jadestone_wall": "Muro de Piedra Jade Azur", + "block.betterend.chorus_mushroom_seed": "Semilla de Seta Coral", + "block.betterend.end_stone_stalactite": "Estalactita de Piedra del End", + "block.betterend.end_stone_stalactite_cavemoss": "Estalactita de Piedrad el End con Musgo de Cueva", + "block.betterend.pearlberry_seed": "Semilla de Balla Perla", + "block.betterend.rubinea": "Rubinea", + "block.betterend.sandy_jadestone": "Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_bricks": "Ladrillos de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_bricks_slab": "Losa de Ladrillos de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_bricks_stairs": "Escaleras de Ladrillos de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_bricks_wall": "Muro de Ladrillos de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_button": "Botón de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_furnace": "Horno de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_lantern": "Linterna de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_pedestal": "Pedestal de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_pillar": "Pilar de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_plate": "Placa de Presión de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_polished": "Piedra Jade Arenosa Pulida", + "block.betterend.sandy_jadestone_slab": "Losa de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_stairs": "Escaleras de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_tiles": "Casillas de Piedra Jade Arenosa", + "block.betterend.sandy_jadestone_wall": "Muro de Piedra Jade Arenosa", + "block.betterend.smaragdant_crystal": "Cristal de Smaragdant", + "block.betterend.smaragdant_crystal_shard": "Fragemnto de Cristal de Smaragdant", + "block.betterend.virid_jadestone": "Piedra Jade Virida", + "block.betterend.virid_jadestone_bricks": "Ladrillos de Piedra Jade Virida", + "block.betterend.virid_jadestone_bricks_slab": "Losa de Ladrillos de Piedra Jade Virida", + "block.betterend.virid_jadestone_bricks_stairs": "Escaleras de Ladrillos de Piedra Jade Virida", + "block.betterend.virid_jadestone_bricks_wall": "Muro de Ladrillos de Piedra Jade Virida", + "block.betterend.virid_jadestone_button": "Botón de Piedra Jade Virida", + "block.betterend.virid_jadestone_furnace": "Horno de Piedra Jade Virida", + "block.betterend.virid_jadestone_lantern": "Linterna de Piedra Jade Virida", + "block.betterend.virid_jadestone_pedestal": "Pedestal de Piedra Jade Virida", + "block.betterend.virid_jadestone_pillar": "Pilar de Piedra Jade Virida", + "block.betterend.virid_jadestone_plate": "Placa de Presión de Piedra Jade Virida", + "block.betterend.virid_jadestone_polished": "Piedra Jade Virida Pulida", + "block.betterend.virid_jadestone_slab": "Losa de Piedra Jade Virida", + "block.betterend.virid_jadestone_stairs": "Escaleras de Piedra Jade Virida", + "block.betterend.virid_jadestone_tiles": "Casillas de Piedra Jade Virida", + "block.betterend.virid_jadestone_wall": "Muro de Piedra Jade Virida", + "item.betterend.amber_root_raw": "Raíz de Ámbar Cruda", + "item.betterend.chorus_mushroom_cooked": "Seta Coral Cocinada", + "item.betterend.chorus_mushroom_raw": "Seta Coral Cruda", + + "biome.betterend.empty_aurora_cave": "Cuava Aurora Vacía", + "biome.betterend.empty_end_cave": "Cueva del End Vacía", + "biome.betterend.empty_smaragdant_cave": "Cueva de Smagrdant Vacía", + "biome.betterend.lush_aurora_cave": "Cueva Aurora Exhuberante", + "biome.betterend.lush_smaragdant_cave": "Cueva Smagrdant Exhuberante", + + "block.betterend.dragon_bone_block": "Bloque de Hueso de Dragó", + "block.betterend.dragon_bone_slab": "Losa de Hueso de Dragón", + "block.betterend.dragon_bone_stairs": "Escaleras de Hueso de Dragón", + "block.betterend.mossy_dragon_bone": "Hueso de Dragón Musgoso", + + "biome.betterend.lantern_woods": "Bosque Linterna", + "block.betterend.filalux": "Filálux", + "block.betterend.filalux_lantern": "Linterna de Filálux", + "block.betterend.filalux_wings": "Alas de Filálux", + "block.betterend.lucernia_bark": "Corteza de Lucernia", + "block.betterend.lucernia_barrel": "Barril de Lucernia", + "block.betterend.lucernia_bookshelf": "Librería de Lucernia", + "block.betterend.lucernia_button": "Botón de Lucernia", + "block.betterend.lucernia_chest": "Cofre de Lucernia", + "block.betterend.lucernia_composter": "Compostador de Lucernia", + "block.betterend.lucernia_crafting_table": "Mesa de Crafteo e Lucernia", + "block.betterend.lucernia_door": "Puerta de Lucernia", + "block.betterend.lucernia_fence": "Valla de Lucernia", + "block.betterend.lucernia_gate": "Puerta de Valla de Lucernia", + "block.betterend.lucernia_ladder": "Escalera de Lucernia", + "block.betterend.lucernia_leaves": "Hojas de Lucernia", + "block.betterend.lucernia_log": "Tronco de Lucernia", + "block.betterend.lucernia_outer_leaves": "Hojas Exteriores de Lucernia", + "block.betterend.lucernia_planks": "Tablones de Lucernia", + "block.betterend.lucernia_plate": "Placa de Presión de Lucernia", + "block.betterend.lucernia_sapling": "Sapling de Lucernia", + "block.betterend.lucernia_sign": "Cartel de Lucernia", + "block.betterend.lucernia_slab": "Losa de Lucernia", + "block.betterend.lucernia_stairs": "Escaleras de Lucernia", + "block.betterend.lucernia_stripped_bark": "Corteza Despojada de Lucernia", + "block.betterend.lucernia_stripped_log": "Tronco Despojado de Lucernia", + "block.betterend.lucernia_trapdoor": "Trampilla de Lucernia", + + "block.betterend.aurant_polypore": "Políporo Aurante", + "block.betterend.bolux_mushroom": "Seta Bólux", + "block.betterend.flamaea": "Flamaea", + "block.betterend.pond_anemone": "Anémona de Pantano", + "block.betterend.ruscus": "Ruscus", + "item.betterend.bolux_mushroom_cooked": "Seta Bólux Cocinada", + + "block.betterend.silk_moth_hive": "Colmena de Polilla de Seda", + "item.betterend.silk_moth_matrix": "Matrix de Polilla de Seda", + + "biome.betterend.neon_oasis": "Oasis Neón", + "block.betterend.cave_pumpkin": "Calabaza de Cueva", + "block.betterend.cave_pumpkin_seed": "Semilla de Calabaza de Cueva", + "block.betterend.magnula": "Magnula", + "block.betterend.neon_cactus": "Cactus Neón", + "item.betterend.cave_pumpkin_pie": "Tarta de Calabaza de Cueva", + + "item.betterend.music_disc_strange_and_alien": "§bDisco Musical§r", + "item.betterend.music_disc_strange_and_alien.desc": "§5Firel§r - §fStrange And Alien§r", + "item.betterend.music_disc_grasping_at_stars": "§bDisco Musical§r", + "item.betterend.music_disc_grasping_at_stars.desc": "§5Firel§r - §fGrasping At Stars§r", + "item.betterend.music_disc_endseeker": "§bDisco Musical§r", + "item.betterend.music_disc_endseeker.desc": "§5Firel§r - §fEndseeker§r", + "item.betterend.music_disc_eo_dracona": "§bDisco Musical§r", + "item.betterend.music_disc_eo_dracona.desc": "§5Firel§r - §fEo Dracona§r", + + "block.betterend.hydralux_petal_block_amber": "Bloque de Pétalo Ámbar", + "block.betterend.hydralux_petal_block_beige": "Bloque de Pétalo Beige", + "block.betterend.hydralux_petal_block_cream": "Bloque de Pétalo Crema", + "block.betterend.hydralux_petal_block_dark_green": "Bloque de Pétalo Verde Oscuro", + "block.betterend.hydralux_petal_block_forest_green": "Bloque de Pétalo Verde Bosque", + "block.betterend.hydralux_petal_block_hot_pink": "Bloque de Pétalo Rosa Fuerte", + "block.betterend.hydralux_petal_block_indigo": "Bloque de Pétalo Índigo", + "block.betterend.hydralux_petal_block_maroon": "Bloque de Pétalo Granate", + "block.betterend.hydralux_petal_block_navy": "Bloque de Pétalo Azul Marino", + "block.betterend.hydralux_petal_block_olive": "Bloque de Pétalo Oliva", + "block.betterend.hydralux_petal_block_pale_green": "Bloque de Pétalo Verde Pálido", + "block.betterend.hydralux_petal_block_pale_pink": "Bloque de Pétalo Rosa Pálido", + "block.betterend.hydralux_petal_block_pale_yellow": "Bloque de Pétalo Amarillo Pálido", + "block.betterend.hydralux_petal_block_sky_blue": "Bloque de Pétalo Azul Cielo", + "block.betterend.hydralux_petal_block_slate_gray": "Bloque de Pétalo Gris Pizarra", + "block.betterend.hydralux_petal_block_violet": "Bloque de Pétalo Violeta", + + "block.betterend.smaragdant_crystal_bricks": "Ladrillos de Smaragdant", + "block.betterend.smaragdant_crystal_bricks_slab": "Losa de Ladrillos de Smaragdant", + "block.betterend.smaragdant_crystal_bricks_stairs": "Escaleras de Ladrillos de Smaragdant", + "block.betterend.smaragdant_crystal_bricks_wall": "Muro de Ladrillos de Smaragdant", + "block.betterend.smaragdant_crystal_pedestal": "Pedestal de Smaragdant", + "block.betterend.smaragdant_crystal_pillar": "Pilar de Smaragdant", + "block.betterend.smaragdant_crystal_polished": "Smaragdant Pulido", + "block.betterend.smaragdant_crystal_slab": "Losa de Smaragdant", + "block.betterend.smaragdant_crystal_stairs": "Escaleras de Smaragdant", + "block.betterend.smaragdant_crystal_tiles": "Casillas de Smaragdant", + "block.betterend.smaragdant_crystal_wall": "Muro de Smaragdant", + "message.betterend.anvil_damage": "§cDaño", + + "block.betterend.neon_cactus_block": "Bloque de Cactus Neón", + "block.betterend.neon_cactus_slab": "Losa de Cactus Neón", + "block.betterend.neon_cactus_stairs": "Escaleras de Cactus Neón", + "biome.betterend.jade_cave": "Cueva de Jade", + "item.betterend.blossom_berry_jelly": "Gelatina de Balla Floreciente", + "item.betterend.aeternium_forged_plate": "Placa de Aeternio Forjada", + "item.betterend.terminite_forged_plate": "Placa de Terminita Forjada", + "item.betterend.thallasium_forged_plate": "Placa de Talismanio Forjada", + + "attribute.name.generic.blindness_resistance": "Resistencia a la Ceguera", + + "tooltip.armor.crystalite_set": "Dar bonus: Regeneración I", + "tooltip.armor.crystalite_chest": "Efecto: Velocidad de Rapidez I", + "tooltip.armor.crystalite_boots": "Efecto: Velocidad I" +} diff --git a/src/main/resources/assets/betterend/lang/ru_ru.json b/src/main/resources/assets/betterend/lang/ru_ru.json index de2fb5b4..ada69545 100644 --- a/src/main/resources/assets/betterend/lang/ru_ru.json +++ b/src/main/resources/assets/betterend/lang/ru_ru.json @@ -890,5 +890,13 @@ "tooltip.armor.crystalite_set": "Бонус сета: Регенерация I", "tooltip.armor.crystalite_chest": "Эффект: Ускорение I", - "tooltip.armor.crystalite_boots": "Эффект: Стремительность I" + "tooltip.armor.crystalite_boots": "Эффект: Стремительность I", + + "block.betterend.azure_jadestone_flower_pot": "Цветочный горшок из лазурного нефрита", + "block.betterend.endstone_flower_pot": "Цветочный горшок из эндерняка", + "block.betterend.flavolite_flower_pot": "Цветочный горшок из флаволита", + "block.betterend.sandy_jadestone_flower_pot": "Цветочный горшок из песчаного нефрита", + "block.betterend.sulphuric_rock_flower_pot": "Цветочный горшок из серного камня", + "block.betterend.violecite_flower_pot": "Цветочный горшок из виолецита", + "block.betterend.virid_jadestone_flower_pot": "Цветочный горшок из зелёного нефрита" } \ No newline at end of file diff --git a/src/main/resources/assets/betterend/materialmaps/block/smaragdant_crystal_shard.json b/src/main/resources/assets/betterend/materialmaps/block/smaragdant_crystal_shard.json new file mode 100644 index 00000000..c2b812b6 --- /dev/null +++ b/src/main/resources/assets/betterend/materialmaps/block/smaragdant_crystal_shard.json @@ -0,0 +1,3 @@ +{ + "defaultMaterial": "betterend:glow_all" +} diff --git a/src/main/resources/assets/betterend/models/block/amber_grass_potted.json b/src/main/resources/assets/betterend/models/block/amber_grass_potted.json new file mode 100644 index 00000000..9b669549 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/amber_grass_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/amber_grass_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/amber_root_seed_potted.json b/src/main/resources/assets/betterend/models/block/amber_root_seed_potted.json new file mode 100644 index 00000000..3bce217c --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/amber_root_seed_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/amber_root_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/blooming_cooksonia_potted.json b/src/main/resources/assets/betterend/models/block/blooming_cooksonia_potted.json new file mode 100644 index 00000000..b3abaa7d --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/blooming_cooksonia_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/blooming_cooksonia_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/bolux_mushroom_potted.json b/src/main/resources/assets/betterend/models/block/bolux_mushroom_potted.json new file mode 100644 index 00000000..5730313a --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/bolux_mushroom_potted.json @@ -0,0 +1,45 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/bolux_mushroom", + "texture": "betterend:block/bolux_mushroom" + }, + "elements": [ + { + "__comment": "Box1", + "from": [ 4, 3, 4 ], + "to": [ 12, 7, 12 ], + "faces": { + "down": { "uv": [ 0, 8, 8, 16 ], "texture": "#texture" }, + "up": { "uv": [ 8, 0, 16, 8 ], "texture": "#texture" }, + "north": { "uv": [ 8, 12, 16, 16 ], "texture": "#texture" }, + "south": { "uv": [ 8, 12, 16, 16 ], "texture": "#texture" }, + "west": { "uv": [ 8, 12, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 8, 12, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box1", + "from": [ 5, 7, 5 ], + "to": [ 11, 8, 11 ], + "faces": { + "up": { "uv": [ 9, 1, 15, 7 ], "texture": "#texture" }, + "north": { "uv": [ 9, 11, 15, 12 ], "texture": "#texture" }, + "south": { "uv": [ 9, 11, 15, 12 ], "texture": "#texture" }, + "west": { "uv": [ 9, 11, 15, 12 ], "texture": "#texture" }, + "east": { "uv": [ 9, 11, 15, 12 ], "texture": "#texture" } + } + }, + { + "__comment": "Box1", + "from": [ 7, 0, 7 ], + "to": [ 9, 3, 9 ], + "faces": { + "north": { "uv": [ 0, 0, 2, 3 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 2, 3 ], "texture": "#texture" }, + "west": { "uv": [ 2, 0, 0, 3 ], "texture": "#texture" }, + "east": { "uv": [ 2, 0, 0, 3 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/bushy_grass_potted.json b/src/main/resources/assets/betterend/models/block/bushy_grass_potted.json new file mode 100644 index 00000000..e9e9c134 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/bushy_grass_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/bushy_grass_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/cave_grass_potted.json b/src/main/resources/assets/betterend/models/block/cave_grass_potted.json new file mode 100644 index 00000000..618a68dc --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/cave_grass_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/cave_grass_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/chorus_grass_potted.json b/src/main/resources/assets/betterend/models/block/chorus_grass_potted.json new file mode 100644 index 00000000..f7a83d0c --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/chorus_grass_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/chorus_grass_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/chorus_mushroom_seed_potted.json b/src/main/resources/assets/betterend/models/block/chorus_mushroom_seed_potted.json new file mode 100644 index 00000000..58cf9e2d --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/chorus_mushroom_seed_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/chorus_mushroom_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/clawfern_potted.json b/src/main/resources/assets/betterend/models/block/clawfern_potted.json new file mode 100644 index 00000000..9ac28aa5 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/clawfern_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/clawfern_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/crystal_grass_potted.json b/src/main/resources/assets/betterend/models/block/crystal_grass_potted.json new file mode 100644 index 00000000..96fd61d3 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/crystal_grass_potted.json @@ -0,0 +1,95 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/crystal_grass_2", + "texture": "betterend:block/crystal_grass_2" + }, + "elements": [ + { + "__comment": "PlaneX1", + "from": [ 5, 0, 4.5 ], + "to": [ 5.001, 9, 9.5 ], + "rotation": { "origin": [ 5, 0, 4.5 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 6, 7, 11, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 7, 11, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 8.5, 0, 4.5 ], + "to": [ 8.501, 9, 9.5 ], + "rotation": { "origin": [ 8.5, 0, 4.5 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 6, 7, 11, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 7, 11, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY4", + "from": [ 4, 8.5, 4 ], + "to": [ 9, 8.501, 9 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 8.5, -3, 7 ], + "to": [ 8.501, 6, 12 ], + "rotation": { "origin": [ 8.5, -3, 7 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 6, 7, 11, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 7, 11, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 12, -3, 7 ], + "to": [ 12.001, 6, 12 ], + "rotation": { "origin": [ 12, -3, 7 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 6, 7, 11, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 7, 11, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneY4", + "from": [ 8, 5.5, 6 ], + "to": [ 13, 5.501, 11 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" }, + "up": { "uv": [ 0, 0, 5, 5 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 5, -3, 9 ], + "to": [ 5.001, 5, 14 ], + "rotation": { "origin": [ 5, -3, 9 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 6, 8, 11, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 8, 11, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX1", + "from": [ 8, -3, 9.5 ], + "to": [ 8.001, 5, 14.5 ], + "rotation": { "origin": [ 8, -3, 9.5 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 6, 8, 11, 16 ], "texture": "#texture" }, + "east": { "uv": [ 6, 8, 11, 16 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/fracturn_potted.json b/src/main/resources/assets/betterend/models/block/fracturn_potted.json new file mode 100644 index 00000000..a0e565f8 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/fracturn_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/fracturn_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/globulagus_potted.json b/src/main/resources/assets/betterend/models/block/globulagus_potted.json new file mode 100644 index 00000000..c028d9af --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/globulagus_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/globulagus_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/jungle_grass_potted.json b/src/main/resources/assets/betterend/models/block/jungle_grass_potted.json new file mode 100644 index 00000000..ad6ab68f --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/jungle_grass_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/jungle_grass_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/lamellarium_potted.json b/src/main/resources/assets/betterend/models/block/lamellarium_potted.json new file mode 100644 index 00000000..745763a0 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lamellarium_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/lamellarium_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/lit_pedestal_bottom.json b/src/main/resources/assets/betterend/models/block/lit_pedestal_bottom.json new file mode 100644 index 00000000..747e639b --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_pedestal_bottom.json @@ -0,0 +1,47 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#base" + }, + "elements": [ + { + "__comment": "basin_1", + "from": [ 0, 0, 0 ], + "to": [ 16, 3, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom" }, + "north": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "south": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "west": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "east": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" } + } + }, + { + "__comment": "basin_2", + "from": [ 2, 3, 2 ], + "to": [ 14, 4, 14 ], + "shade": false, + "faces": { + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#bottom" }, + "north": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "south": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "west": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "east": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" } + } + }, + { + "__comment": "pillar", + "from": [ 3, 4, 3 ], + "to": [ 13, 16, 13 ], + "shade": false, + "faces": { + "north": { "uv": [ 3, 4, 13, 16 ], "texture": "#pillar" }, + "south": { "uv": [ 3, 4, 13, 16 ], "texture": "#pillar" }, + "west": { "uv": [ 3, 4, 13, 16 ], "texture": "#pillar" }, + "east": { "uv": [ 3, 4, 13, 16 ], "texture": "#pillar" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/lit_pedestal_column.json b/src/main/resources/assets/betterend/models/block/lit_pedestal_column.json new file mode 100644 index 00000000..651265cd --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_pedestal_column.json @@ -0,0 +1,74 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#base" + }, + "elements": [ + { + "__comment": "basin_1", + "from": [ 0, 0, 0 ], + "to": [ 16, 3, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom" }, + "north": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "south": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "west": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "east": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" } + } + }, + { + "__comment": "basin_2", + "from": [ 2, 3, 2 ], + "to": [ 14, 4, 14 ], + "shade": false, + "faces": { + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#bottom" }, + "north": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "south": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "west": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "east": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" } + } + }, + { + "__comment": "pillar", + "from": [ 3, 4, 3 ], + "to": [ 13, 13, 13 ], + "shade": false, + "faces": { + "north": { "uv": [ 3, 4, 13, 14 ], "texture": "#pillar" }, + "south": { "uv": [ 3, 4, 13, 14 ], "texture": "#pillar" }, + "west": { "uv": [ 3, 4, 13, 14 ], "texture": "#pillar" }, + "east": { "uv": [ 3, 4, 13, 14 ], "texture": "#pillar" } + } + }, + { + "__comment": "top", + "from": [ 2, 13, 2 ], + "to": [ 14, 14, 14 ], + "shade": false, + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#base" }, + "north": { "uv": [ 2, 13, 14, 14 ], "texture": "#base" }, + "south": { "uv": [ 2, 13, 14, 14 ], "texture": "#base" }, + "west": { "uv": [ 2, 13, 14, 14 ], "texture": "#base" }, + "east": { "uv": [ 2, 13, 14, 14 ], "texture": "#base" } + } + }, + { + "__comment": "top", + "from": [ 1, 14, 1 ], + "to": [ 15, 16, 15 ], + "shade": false, + "faces": { + "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#base" }, + "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#base", "cullface": "up" }, + "north": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" }, + "south": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" }, + "west": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" }, + "east": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/lit_pedestal_column_top.json b/src/main/resources/assets/betterend/models/block/lit_pedestal_column_top.json new file mode 100644 index 00000000..3a88e975 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_pedestal_column_top.json @@ -0,0 +1,47 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#base" + }, + "elements": [ + { + "__comment": "pillar", + "from": [ 3, 0, 3 ], + "to": [ 13, 13, 13 ], + "shade": false, + "faces": { + "north": { "uv": [ 3, 0, 13, 14 ], "texture": "#pillar" }, + "south": { "uv": [ 3, 0, 13, 14 ], "texture": "#pillar" }, + "west": { "uv": [ 3, 0, 13, 14 ], "texture": "#pillar" }, + "east": { "uv": [ 3, 0, 13, 14 ], "texture": "#pillar" } + } + }, + { + "__comment": "top", + "from": [ 2, 13, 2 ], + "to": [ 14, 14, 14 ], + "shade": false, + "faces": { + "down": { "uv": [ 2, 2, 14, 14 ], "texture": "#base" }, + "north": { "uv": [ 2, 13, 14, 14 ], "texture": "#base" }, + "south": { "uv": [ 2, 13, 14, 14 ], "texture": "#base" }, + "west": { "uv": [ 2, 13, 14, 14 ], "texture": "#base" }, + "east": { "uv": [ 2, 13, 14, 14 ], "texture": "#base" } + } + }, + { + "__comment": "top", + "from": [ 1, 14, 1 ], + "to": [ 15, 16, 15 ], + "shade": false, + "faces": { + "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#base" }, + "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#base", "cullface": "up" }, + "north": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" }, + "south": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" }, + "west": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" }, + "east": { "uv": [ 1, 14, 15, 16 ], "texture": "#base" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/lit_pedestal_default.json b/src/main/resources/assets/betterend/models/block/lit_pedestal_default.json new file mode 100644 index 00000000..b4dfd5e7 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_pedestal_default.json @@ -0,0 +1,61 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#base" + }, + "elements": [ + { + "__comment": "basin_1", + "from": [ 0, 0, 0 ], + "to": [ 16, 3, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom" }, + "north": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "south": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "west": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" }, + "east": { "uv": [ 0, 0, 16, 3 ], "texture": "#bottom" } + } + }, + { + "__comment": "basin_2", + "from": [ 2, 3, 2 ], + "to": [ 14, 4, 14 ], + "shade": false, + "faces": { + "up": { "uv": [ 2, 2, 14, 14 ], "texture": "#bottom" }, + "north": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "south": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "west": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" }, + "east": { "uv": [ 3, 3, 14, 4 ], "texture": "#bottom" } + } + }, + { + "__comment": "pillar", + "from": [ 3, 4, 3 ], + "to": [ 13, 12, 13 ], + "shade": false, + "faces": { + "north": { "uv": [ 3, 4, 13, 12 ], "texture": "#pillar" }, + "south": { "uv": [ 3, 4, 13, 12 ], "texture": "#pillar" }, + "west": { "uv": [ 3, 4, 13, 12 ], "texture": "#pillar" }, + "east": { "uv": [ 3, 4, 13, 12 ], "texture": "#pillar" } + } + }, + { + "__comment": "top", + "from": [ 1, 12, 1 ], + "to": [ 15, 14, 15 ], + "shade": false, + "faces": { + "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#base" }, + "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#top" }, + "north": { "uv": [ 1, 12, 15, 14 ], "texture": "#base" }, + "south": { "uv": [ 1, 12, 15, 14 ], "texture": "#base" }, + "west": { "uv": [ 1, 12, 15, 14 ], "texture": "#base" }, + "east": { "uv": [ 1, 12, 15, 14 ], "texture": "#base" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/lit_pedestal_pillar.json b/src/main/resources/assets/betterend/models/block/lit_pedestal_pillar.json new file mode 100644 index 00000000..797d66ce --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_pedestal_pillar.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#pillar" + }, + "elements": [ + { + "__comment": "pillar", + "from": [ 3, 0, 3 ], + "to": [ 13, 16, 13 ], + "shade": false, + "faces": { + "north": { "uv": [ 3, 0, 13, 16 ], "texture": "#pillar" }, + "south": { "uv": [ 3, 0, 13, 16 ], "texture": "#pillar" }, + "west": { "uv": [ 3, 0, 13, 16 ], "texture": "#pillar" }, + "east": { "uv": [ 3, 0, 13, 16 ], "texture": "#pillar" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/lit_pedestal_top.json b/src/main/resources/assets/betterend/models/block/lit_pedestal_top.json new file mode 100644 index 00000000..5886f233 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_pedestal_top.json @@ -0,0 +1,34 @@ +{ + "parent": "minecraft:block/block", + "textures": { + "particle": "#base" + }, + "elements": [ + { + "__comment": "pillar", + "from": [ 3, 0, 3 ], + "to": [ 13, 8, 13 ], + "shade": false, + "faces": { + "north": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" }, + "south": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" }, + "west": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" }, + "east": { "uv": [ 3, 0, 13, 8 ], "texture": "#pillar" } + } + }, + { + "__comment": "top", + "from": [ 1, 8, 1 ], + "to": [ 15, 10, 15 ], + "shade": false, + "faces": { + "down": { "uv": [ 1, 1, 15, 15 ], "texture": "#base" }, + "up": { "uv": [ 1, 1, 15, 15 ], "texture": "#top" }, + "north": { "uv": [ 1, 8, 15, 10 ], "texture": "#base" }, + "south": { "uv": [ 1, 8, 15, 10 ], "texture": "#base" }, + "west": { "uv": [ 1, 8, 15, 10 ], "texture": "#base" }, + "east": { "uv": [ 1, 8, 15, 10 ], "texture": "#base" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/lit_stairs.json b/src/main/resources/assets/betterend/models/block/lit_stairs.json new file mode 100644 index 00000000..45326109 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_stairs.json @@ -0,0 +1,50 @@ +{ + "parent": "block/block", + "textures": { + "particle": "#side" + }, + "display": { + "gui": { + "rotation": [ 30, 135, 0 ], + "translation": [ 0, 0, 0], + "scale":[ 0.625, 0.625, 0.625 ] + }, + "head": { + "rotation": [ 0, -90, 0 ], + "translation": [ 0, 0, 0 ], + "scale": [ 1, 1, 1 ] + }, + "thirdperson_lefthand": { + "rotation": [ 75, -135, 0 ], + "translation": [ 0, 2.5, 0], + "scale": [ 0.375, 0.375, 0.375 ] + } + }, + "elements": [ + { + "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { + "from": [ 8, 8, 0 ], + "to": [ 16, 16, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 8, 0, 16, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 0, 0, 8, 8 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 8, 0, 16, 8 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/lit_stairs_inner.json b/src/main/resources/assets/betterend/models/block/lit_stairs_inner.json new file mode 100644 index 00000000..d9ee9b90 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_stairs_inner.json @@ -0,0 +1,44 @@ +{ + "parent": "block/block", + "textures": { + "particle": "#side" + }, + "elements": [ + { + "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { + "from": [ 8, 8, 0 ], + "to": [ 16, 16, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 8, 0, 16, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 0, 0, 8, 8 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 8, 0, 16, 8 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "east" } + } + }, + { + "from": [ 0, 8, 8 ], + "to": [ 8, 16, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 0, 8, 8, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 8, 0, 16, 8 ], "texture": "#side" }, + "south": { "uv": [ 0, 0, 8, 8 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 8, 0, 16, 8 ], "texture": "#side", "cullface": "west" } + } + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/lit_stairs_outer.json b/src/main/resources/assets/betterend/models/block/lit_stairs_outer.json new file mode 100644 index 00000000..13725a18 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_stairs_outer.json @@ -0,0 +1,33 @@ +{ + "parent": "block/block", + "textures": { + "particle": "#side" + }, + "elements": [ + { + "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "east" } + } + }, + { + "from": [ 8, 8, 8 ], + "to": [ 16, 16, 16 ], + "shade": false, + "faces": { + "up": { "uv": [ 8, 8, 16, 16 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 0, 0, 8, 8 ], "texture": "#side" }, + "south": { "uv": [ 8, 0, 16, 8 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 8, 0, 16, 8 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 8, 8 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/lit_wall_post.json b/src/main/resources/assets/betterend/models/block/lit_wall_post.json new file mode 100644 index 00000000..48859b0c --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_wall_post.json @@ -0,0 +1,21 @@ +{ + "parent": "block/block", + "textures": { + "particle": "#wall" + }, + "elements": [ + { "from": [ 4, 0, 4 ], + "to": [ 12, 16, 12 ], + "shade": false, + "faces": { + "down": { "texture": "#wall", "cullface": "down" }, + "up": { "texture": "#wall", "cullface": "up" }, + "north": { "texture": "#wall" }, + "south": { "texture": "#wall" }, + "west": { "texture": "#wall" }, + "east": { "texture": "#wall" } + }, + "__comment": "Center post" + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/lit_wall_side.json b/src/main/resources/assets/betterend/models/block/lit_wall_side.json new file mode 100644 index 00000000..27d8698c --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_wall_side.json @@ -0,0 +1,20 @@ +{ + "parent": "block/block", + "textures": { + "particle": "#wall" + }, + "elements": [ + { "from": [ 5, 0, 0 ], + "to": [ 11, 14, 8 ], + "shade": false, + "faces": { + "down": { "texture": "#wall", "cullface": "down" }, + "up": { "texture": "#wall" }, + "north": { "texture": "#wall", "cullface": "north" }, + "west": { "texture": "#wall" }, + "east": { "texture": "#wall" } + }, + "__comment": "wall" + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/lit_wall_side_tall.json b/src/main/resources/assets/betterend/models/block/lit_wall_side_tall.json new file mode 100644 index 00000000..ee0dfab1 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/lit_wall_side_tall.json @@ -0,0 +1,19 @@ +{ + "parent": "block/block", + "textures": { + "particle": "#wall" + }, + "elements": [ + { "from": [ 5, 0, 0 ], + "to": [ 11, 16, 8 ], + "shade": false, + "faces": { + "down": { "texture": "#wall", "cullface": "down" }, + "up": { "texture": "#wall", "cullface": "up"}, + "north": { "texture": "#wall", "cullface": "north" }, + "west": { "texture": "#wall" }, + "east": { "texture": "#wall" } + } + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/murkweed_potted.json b/src/main/resources/assets/betterend/models/block/murkweed_potted.json new file mode 100644 index 00000000..07ec3599 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/murkweed_potted.json @@ -0,0 +1,163 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "parent": "block/block", + "textures": { + "particle": "betterend:block/murkweed", + "texture": "betterend:block/murkweed" + }, + "elements": [ + { + "__comment": "Box1", + "from": [ 5, 11, 3 ], + "to": [ 9, 15, 7 ], + "faces": { + "down": { "uv": [ 4, 12, 8, 16 ], "texture": "#texture" }, + "up": { "uv": [ 0, 8, 4, 12 ], "texture": "#texture" }, + "north": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" }, + "west": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box1", + "from": [ 6, 15, 4 ], + "to": [ 8, 15.5, 6 ], + "faces": { + "north": { "uv": [ 1, 7.5, 3, 8 ], "texture": "#texture" }, + "south": { "uv": [ 1, 7.5, 3, 8 ], "texture": "#texture" }, + "west": { "uv": [ 1, 7.5, 3, 8 ], "texture": "#texture" }, + "east": { "uv": [ 1, 7.5, 3, 8 ], "texture": "#texture" } + } + }, + { + "__comment": "Box1", + "from": [ 5.5, 15.5, 3.5 ], + "to": [ 8.5, 16, 6.5 ], + "faces": { + "down": { "uv": [ 0, 4, 3, 7 ], "texture": "#texture" }, + "up": { "uv": [ 0, 4, 3, 7 ], "texture": "#texture" }, + "north": { "uv": [ 0, 6.5, 3, 7 ], "texture": "#texture" }, + "south": { "uv": [ 0, 6.5, 3, 7 ], "texture": "#texture" }, + "west": { "uv": [ 0, 6.5, 3, 7 ], "texture": "#texture" }, + "east": { "uv": [ 0, 6.5, 3, 7 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX4", + "from": [ 5, 0, 2.5 ], + "to": [ 5.001, 11, 8.5 ], + "rotation": { "origin": [ 5, 0, 2.5 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 10, 0, 16, 16 ], "texture": "#texture" }, + "east": { "uv": [ 10, 0, 16, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX4", + "from": [ 9, 0, 2.5 ], + "to": [ 9.000999, 11, 8.5 ], + "rotation": { "origin": [ 9, 0, 2.5 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 10, 0, 16, 12 ], "texture": "#texture" }, + "east": { "uv": [ 10, 0, 16, 12 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX4", + "from": [ 9, 0, 6.5 ], + "to": [ 9.000999, 9, 12.5 ], + "rotation": { "origin": [ 9, 0, 6.5 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 10, 4, 16, 13 ], "texture": "#texture" }, + "east": { "uv": [ 10, 4, 16, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX4", + "from": [ 13, 0, 6.5 ], + "to": [ 13.001, 9, 12.5 ], + "rotation": { "origin": [ 13, 0, 6.5 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 10, 4, 16, 13 ], "texture": "#texture" }, + "east": { "uv": [ 10, 4, 16, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX4", + "from": [ 4.5, 0, 7.5 ], + "to": [ 4.501, 5, 13.5 ], + "rotation": { "origin": [ 4.5, 0, 7.5 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 10, 8, 16, 13 ], "texture": "#texture" }, + "east": { "uv": [ 10, 8, 16, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "PlaneX4", + "from": [ 8.5, 0, 7.5 ], + "to": [ 8.500999, 5, 13.5 ], + "rotation": { "origin": [ 8.5, 0, 7.5 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 10, 8, 16, 13 ], "texture": "#texture" }, + "east": { "uv": [ 10, 8, 16, 13 ], "texture": "#texture" } + } + }, + { + "__comment": "Box1", + "from": [ 9, 9, 7 ], + "to": [ 13, 13, 11 ], + "faces": { + "down": { "uv": [ 4, 12, 8, 16 ], "texture": "#texture" }, + "up": { "uv": [ 0, 8, 4, 12 ], "texture": "#texture" }, + "north": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" }, + "west": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" } + } + }, + { + "__comment": "Box1", + "from": [ 10, 13, 9 ], + "to": [ 12, 13.5, 11 ], + "faces": { + "north": { "uv": [ 1, 7.5, 3, 8 ], "texture": "#texture" }, + "south": { "uv": [ 1, 7.5, 3, 8 ], "texture": "#texture" }, + "west": { "uv": [ 1, 7.5, 3, 8 ], "texture": "#texture" }, + "east": { "uv": [ 1, 7.5, 3, 8 ], "texture": "#texture" } + } + }, + { + "__comment": "Box1", + "from": [ 9.5, 13.5, 7.5 ], + "to": [ 12.5, 14, 10.5 ], + "faces": { + "down": { "uv": [ 0, 4, 3, 7 ], "texture": "#texture" }, + "up": { "uv": [ 0, 4, 3, 7 ], "texture": "#texture" }, + "north": { "uv": [ 0, 6.5, 3, 7 ], "texture": "#texture" }, + "south": { "uv": [ 0, 6.5, 3, 7 ], "texture": "#texture" }, + "west": { "uv": [ 0, 6.5, 3, 7 ], "texture": "#texture" }, + "east": { "uv": [ 0, 6.5, 3, 7 ], "texture": "#texture" } + } + }, + { + "__comment": "Box1", + "from": [ 5, 5, 8 ], + "to": [ 8, 9, 11 ], + "faces": { + "down": { "uv": [ 4, 12, 7, 15 ], "texture": "#texture" }, + "up": { "uv": [ 0, 8, 3, 11 ], "texture": "#texture" }, + "north": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" }, + "south": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" }, + "west": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" }, + "east": { "uv": [ 0, 12, 4, 16 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/neon_cactus_potted.json b/src/main/resources/assets/betterend/models/block/neon_cactus_potted.json new file mode 100644 index 00000000..b194651f --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/neon_cactus_potted.json @@ -0,0 +1,45 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/neon_cactus_small_side", + "side": "betterend:block/neon_cactus_small_side_moss", + "top": "betterend:block/neon_cactus_small_top" + }, + "elements": [ + { + "__comment": "Box1", + "from": [ 6, 0, 6 ], + "to": [ 10, 8, 10 ], + "shade": false, + "faces": { + "up": { "uv": [ 6, 6, 10, 10 ], "texture": "#top" }, + "north": { "uv": [ 7, 6, 11, 14 ], "texture": "#side" }, + "south": { "uv": [ 7, 6, 11, 14 ], "texture": "#side" }, + "west": { "uv": [ 5, 6, 9, 14 ], "texture": "#side" }, + "east": { "uv": [ 5, 6, 9, 14 ], "texture": "#side" } + } + }, + { + "__comment": "PlaneX2", + "from": [ 4, 0, 4 ], + "to": [ 4.001, 8, 15.5 ], + "rotation": { "origin": [ 4, 0, 4 ], "axis": "y", "angle": 45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" } + } + }, + { + "__comment": "PlaneX2", + "from": [ 12, 0, 4 ], + "to": [ 12.001, 8, 15.5 ], + "rotation": { "origin": [ 12, 0, 4 ], "axis": "y", "angle": -45 }, + "shade": false, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#side" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/neon_cactus_slab.json b/src/main/resources/assets/betterend/models/block/neon_cactus_slab.json index 22fb196b..ccd83a76 100644 --- a/src/main/resources/assets/betterend/models/block/neon_cactus_slab.json +++ b/src/main/resources/assets/betterend/models/block/neon_cactus_slab.json @@ -1,5 +1,5 @@ { - "parent": "block/slab", + "parent": "betterend:block/slab_noshade", "textures": { "bottom": "betterend:block/neon_cactus_block_top", "top": "betterend:block/neon_cactus_block_top", diff --git a/src/main/resources/assets/betterend/models/block/neon_cactus_stairs.json b/src/main/resources/assets/betterend/models/block/neon_cactus_stairs.json index 0a0df2b2..bae5dffd 100644 --- a/src/main/resources/assets/betterend/models/block/neon_cactus_stairs.json +++ b/src/main/resources/assets/betterend/models/block/neon_cactus_stairs.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:block/stairs", + "parent": "betterend:block/lit_stairs", "textures": { "bottom": "betterend:block/neon_cactus_block_top", "top": "betterend:block/neon_cactus_block_top", diff --git a/src/main/resources/assets/betterend/models/block/neon_cactus_stairs_inner.json b/src/main/resources/assets/betterend/models/block/neon_cactus_stairs_inner.json index 78d80cc5..2eecc8e2 100644 --- a/src/main/resources/assets/betterend/models/block/neon_cactus_stairs_inner.json +++ b/src/main/resources/assets/betterend/models/block/neon_cactus_stairs_inner.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:block/inner_stairs", + "parent": "betterend:block/lit_stairs_inner", "textures": { "bottom": "betterend:block/neon_cactus_block_top", "top": "betterend:block/neon_cactus_block_top", diff --git a/src/main/resources/assets/betterend/models/block/neon_cactus_stairs_outer.json b/src/main/resources/assets/betterend/models/block/neon_cactus_stairs_outer.json index 01f12961..ead881f0 100644 --- a/src/main/resources/assets/betterend/models/block/neon_cactus_stairs_outer.json +++ b/src/main/resources/assets/betterend/models/block/neon_cactus_stairs_outer.json @@ -1,5 +1,5 @@ { - "parent": "minecraft:block/outer_stairs", + "parent": "betterend:block/lit_stairs_outer", "textures": { "bottom": "betterend:block/neon_cactus_block_top", "top": "betterend:block/neon_cactus_block_top", diff --git a/src/main/resources/assets/betterend/models/block/pillar_noshade.json b/src/main/resources/assets/betterend/models/block/pillar_noshade.json new file mode 100644 index 00000000..cf1bd8de --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/pillar_noshade.json @@ -0,0 +1,21 @@ +{ + "parent": "block/block", + "textures": { + "particle": "#side" + }, + "elements": [ + { + "from": [ 0, 0, 0 ], + "to": [ 16, 16, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#end", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#end", "cullface": "up" }, + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/shadow_plant_potted.json b/src/main/resources/assets/betterend/models/block/shadow_plant_potted.json new file mode 100644 index 00000000..747d552e --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/shadow_plant_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/shadow_plant_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/block/slab_noshade.json b/src/main/resources/assets/betterend/models/block/slab_noshade.json new file mode 100644 index 00000000..e629ba9e --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/slab_noshade.json @@ -0,0 +1,20 @@ +{ + "parent": "block/block", + "textures": { + "particle": "#side" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 8, 16 ], + "shade": false, + "faces": { + "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, + "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, + "north": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "north" }, + "south": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "south" }, + "west": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "west" }, + "east": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "east" } + } + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_bricks_stairs.json b/src/main/resources/assets/betterend/models/block/smaragdant_bricks_stairs.json new file mode 100644 index 00000000..6200b8c2 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_bricks_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/lit_stairs", + "textures": { + "bottom": "betterend:block/smaragdant_crystal_bricks", + "top": "betterend:block/smaragdant_crystal_bricks", + "side": "betterend:block/smaragdant_crystal_bricks" + } +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_bricks_stairs_inner.json b/src/main/resources/assets/betterend/models/block/smaragdant_bricks_stairs_inner.json new file mode 100644 index 00000000..f0ac1df0 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_bricks_stairs_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/lit_stairs_inner", + "textures": { + "bottom": "betterend:block/smaragdant_crystal_bricks", + "top": "betterend:block/smaragdant_crystal_bricks", + "side": "betterend:block/smaragdant_crystal_bricks" + } +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_bricks_stairs_outer.json b/src/main/resources/assets/betterend/models/block/smaragdant_bricks_stairs_outer.json new file mode 100644 index 00000000..ed02dfcd --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_bricks_stairs_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/lit_stairs_outer", + "textures": { + "bottom": "betterend:block/smaragdant_crystal_bricks", + "top": "betterend:block/smaragdant_crystal_bricks", + "side": "betterend:block/smaragdant_crystal_bricks" + } +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_crystal_bricks_wall_post.json b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_bricks_wall_post.json new file mode 100644 index 00000000..e74131d0 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_bricks_wall_post.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/lit_wall_post", + "textures": { + "wall": "betterend:block/smaragdant_crystal_bricks" + } +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_crystal_bricks_wall_side.json b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_bricks_wall_side.json new file mode 100644 index 00000000..ad9b2c94 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_bricks_wall_side.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/lit_wall_side", + "textures": { + "wall": "betterend:block/smaragdant_crystal_bricks" + } +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_crystal_bricks_wall_side_tall.json b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_bricks_wall_side_tall.json new file mode 100644 index 00000000..c49dacb0 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_bricks_wall_side_tall.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/lit_wall_side_tall", + "textures": { + "wall": "betterend:block/smaragdant_crystal_bricks" + } +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_crystal_wall_post.json b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_wall_post.json new file mode 100644 index 00000000..c5e167df --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_wall_post.json @@ -0,0 +1,23 @@ +{ + "parent": "block/block", + "textures": { + "side": "betterend:block/smaragdant_crystal_side", + "top": "betterend:block/smaragdant_crystal_top", + "particle": "#side" + }, + "elements": [ + { + "from": [ 4, -0.01, 4 ], + "to": [ 12, 16, 12 ], + "shade": false, + "faces": { + "down": { "uv": [ 4, 4, 12, 12 ], "texture": "#top", "cullface": "down" }, + "up": { "uv": [ 4, 4, 12, 12 ], "texture": "#top", "cullface": "up" }, + "north": { "uv": [ 4, 0, 12, 16 ], "texture": "#side" }, + "south": { "uv": [ 4, 0, 12, 16 ], "texture": "#side" }, + "west": { "uv": [ 4, 0, 12, 16 ], "texture": "#side" }, + "east": { "uv": [ 4, 0, 12, 16 ], "texture": "#side" } + } + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_crystal_wall_side.json b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_wall_side.json new file mode 100644 index 00000000..4bba9abf --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_wall_side.json @@ -0,0 +1,21 @@ +{ + "textures": { + "wall": "betterend:block/smaragdant_crystal_side", + "top": "betterend:block/smaragdant_crystal_top", + "particle": "#wall" + }, + "elements": [ + { + "from": [ 5, 0, 0 ], + "to": [ 11, 14, 8 ], + "shade": false, + "faces": { + "down": { "texture": "#top", "cullface": "down" }, + "up": { "texture": "#top" }, + "north": { "texture": "#wall", "cullface": "north" }, + "west": { "texture": "#wall" }, + "east": { "texture": "#wall" } + } + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_crystal_wall_side_tall.json b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_wall_side_tall.json new file mode 100644 index 00000000..dac2fa44 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_crystal_wall_side_tall.json @@ -0,0 +1,21 @@ +{ + "textures": { + "wall": "betterend:block/smaragdant_crystal_side", + "top": "betterend:block/smaragdant_crystal_top", + "particle": "#wall" + }, + "elements": [ + { + "from": [ 5, 0, 0 ], + "to": [ 11, 16, 8 ], + "shade": false, + "faces": { + "down": { "texture": "#top", "cullface": "down" }, + "up": { "texture": "#top", "cullface": "up"}, + "north": { "texture": "#wall", "cullface": "north" }, + "west": { "texture": "#wall" }, + "east": { "texture": "#wall" } + } + } + ] +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_bottom.json b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_bottom.json new file mode 100644 index 00000000..d4f4423b --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_bottom.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/lit_pedestal_bottom", + "textures": { + "base": "betterend:block/smaragdant_crystal_side", + "pillar": "betterend:block/smaragdant_crystal_pillar_side", + "bottom": "betterend:block/smaragdant_crystal_polished" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_column.json b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_column.json new file mode 100644 index 00000000..aba32bf3 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_column.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/lit_pedestal_column", + "textures": { + "base": "betterend:block/smaragdant_crystal_side", + "pillar": "betterend:block/smaragdant_crystal_pillar_side", + "bottom": "betterend:block/smaragdant_crystal_polished" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_column_top.json b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_column_top.json new file mode 100644 index 00000000..2f8a7add --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_column_top.json @@ -0,0 +1,7 @@ +{ + "parent": "betterend:block/lit_pedestal_column_top", + "textures": { + "base": "betterend:block/smaragdant_crystal_side", + "pillar": "betterend:block/smaragdant_crystal_pillar_side" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_default.json b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_default.json new file mode 100644 index 00000000..07e36ccc --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_default.json @@ -0,0 +1,9 @@ +{ + "parent": "betterend:block/lit_pedestal_default", + "textures": { + "top": "betterend:block/smaragdant_crystal_polished", + "base": "betterend:block/smaragdant_crystal_side", + "pillar": "betterend:block/smaragdant_crystal_pillar_side", + "bottom": "betterend:block/smaragdant_crystal_polished" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_pillar.json b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_pillar.json new file mode 100644 index 00000000..2041fe88 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_pillar.json @@ -0,0 +1,6 @@ +{ + "parent": "betterend:block/lit_pedestal_pillar", + "textures": { + "pillar": "betterend:block/smaragdant_crystal_pillar_side" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_top.json b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_top.json new file mode 100644 index 00000000..7f586614 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_pedestal_top.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/lit_pedestal_top", + "textures": { + "top": "betterend:block/smaragdant_crystal_polished", + "base": "betterend:block/smaragdant_crystal_side", + "pillar": "betterend:block/smaragdant_crystal_pillar_side" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_slab.json b/src/main/resources/assets/betterend/models/block/smaragdant_slab.json new file mode 100644 index 00000000..19f5cca8 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_slab.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/slab_noshade", + "textures": { + "bottom": "betterend:block/smaragdant_crystal_top", + "top": "betterend:block/smaragdant_crystal_top", + "side": "betterend:block/smaragdant_crystal_side" + } +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_stairs.json b/src/main/resources/assets/betterend/models/block/smaragdant_stairs.json new file mode 100644 index 00000000..288366da --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/lit_stairs", + "textures": { + "bottom": "betterend:block/smaragdant_crystal_top", + "top": "betterend:block/smaragdant_crystal_top", + "side": "betterend:block/smaragdant_crystal_side" + } +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_stairs_inner.json b/src/main/resources/assets/betterend/models/block/smaragdant_stairs_inner.json new file mode 100644 index 00000000..2339f001 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_stairs_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/lit_stairs_inner", + "textures": { + "bottom": "betterend:block/smaragdant_crystal_top", + "top": "betterend:block/smaragdant_crystal_top", + "side": "betterend:block/smaragdant_crystal_side" + } +} diff --git a/src/main/resources/assets/betterend/models/block/smaragdant_stairs_outer.json b/src/main/resources/assets/betterend/models/block/smaragdant_stairs_outer.json new file mode 100644 index 00000000..380d63db --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/smaragdant_stairs_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "betterend:block/lit_stairs_outer", + "textures": { + "bottom": "betterend:block/smaragdant_crystal_top", + "top": "betterend:block/smaragdant_crystal_top", + "side": "betterend:block/smaragdant_crystal_side" + } +} diff --git a/src/main/resources/assets/betterend/models/block/vaiolush_fern_potted.json b/src/main/resources/assets/betterend/models/block/vaiolush_fern_potted.json new file mode 100644 index 00000000..5a915f54 --- /dev/null +++ b/src/main/resources/assets/betterend/models/block/vaiolush_fern_potted.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "betterend:block/vaiolush_fern_potted" + } +} diff --git a/src/main/resources/assets/betterend/models/item/smaragdant_crystal_bricks_stairs.json b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_bricks_stairs.json new file mode 100644 index 00000000..92b2603b --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_bricks_stairs.json @@ -0,0 +1,3 @@ +{ + "parent": "betterend:block/smaragdant_bricks_stairs" +} diff --git a/src/main/resources/assets/betterend/models/item/smaragdant_crystal_bricks_wall.json b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_bricks_wall.json new file mode 100644 index 00000000..b89dc3ef --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_bricks_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "betterend:block/smaragdant_crystal_bricks" + } +} diff --git a/src/main/resources/assets/betterend/models/item/smaragdant_crystal_pedestal.json b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_pedestal.json new file mode 100644 index 00000000..ca50eb45 --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_pedestal.json @@ -0,0 +1,3 @@ +{ + "parent": "betterend:block/smaragdant_pedestal_default" +} diff --git a/src/main/resources/assets/betterend/models/item/smaragdant_crystal_slab.json b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_slab.json new file mode 100644 index 00000000..1099667b --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_slab.json @@ -0,0 +1,3 @@ +{ + "parent": "betterend:block/smaragdant_slab" +} diff --git a/src/main/resources/assets/betterend/models/item/smaragdant_crystal_stairs.json b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_stairs.json new file mode 100644 index 00000000..7af759c0 --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_stairs.json @@ -0,0 +1,3 @@ +{ + "parent": "betterend:block/smaragdant_stairs" +} diff --git a/src/main/resources/assets/betterend/models/item/smaragdant_crystal_wall.json b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_wall.json new file mode 100644 index 00000000..4391b325 --- /dev/null +++ b/src/main/resources/assets/betterend/models/item/smaragdant_crystal_wall.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/wall_inventory", + "textures": { + "wall": "betterend:block/smaragdant_crystal_side" + } +} diff --git a/src/main/resources/assets/betterend/patterns/block/flower_pot.json b/src/main/resources/assets/betterend/patterns/block/flower_pot.json new file mode 100644 index 00000000..55088bf3 --- /dev/null +++ b/src/main/resources/assets/betterend/patterns/block/flower_pot.json @@ -0,0 +1,71 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "parent": "block/block", + "textures": { + "particle": "betterend:block/%texture%", + "texture": "betterend:block/%texture%" + }, + "elements": [ + { + "__comment": "Box1", + "from": [ 4, 7, 4 ], + "to": [ 12, 8, 12 ], + "faces": { + "down": { "uv": [ 8, 0, 16, 8 ], "texture": "#texture" }, + "up": { "uv": [ 8, 0, 16, 8 ], "texture": "#texture" }, + "north": { "uv": [ 0, 0, 8, 1 ], "texture": "#texture" }, + "south": { "uv": [ 0, 0, 8, 1 ], "texture": "#texture" }, + "west": { "uv": [ 0, 0, 8, 1 ], "texture": "#texture" }, + "east": { "uv": [ 0, 0, 8, 1 ], "texture": "#texture" } + } + }, + { + "__comment": "Box1", + "from": [ 5, 0, 5 ], + "to": [ 11, 1, 11 ], + "faces": { + "down": { "uv": [ 9, 9, 15, 15 ], "texture": "#texture", "cullface": "down" }, + "up": { "uv": [ 9, 9, 15, 15 ], "texture": "#texture" }, + "north": { "uv": [ 1, 7, 7, 8 ], "texture": "#texture" }, + "south": { "uv": [ 1, 7, 7, 8 ], "texture": "#texture" }, + "west": { "uv": [ 1, 7, 7, 8 ], "texture": "#texture" }, + "east": { "uv": [ 1, 7, 7, 8 ], "texture": "#texture" } + } + }, + { + "__comment": "Box1", + "from": [ 4, 1, 4 ], + "to": [ 12, 6, 12 ], + "faces": { + "down": { "uv": [ 8, 8, 16, 16 ], "texture": "#texture" }, + "up": { "uv": [ 8, 0, 16, 8 ], "texture": "#texture" }, + "north": { "uv": [ 0, 2, 8, 7 ], "texture": "#texture" }, + "south": { "uv": [ 0, 2, 8, 7 ], "texture": "#texture" }, + "west": { "uv": [ 0, 2, 8, 7 ], "texture": "#texture" }, + "east": { "uv": [ 0, 2, 8, 7 ], "texture": "#texture" } + } + }, + { + "__comment": "Box1", + "from": [ 4.5, 6, 4.5 ], + "to": [ 11.5, 7, 11.5 ], + "faces": { + "north": { "uv": [ 0.5, 1, 7.5, 2 ], "texture": "#texture" }, + "south": { "uv": [ 0.5, 1, 7.5, 2 ], "texture": "#texture" }, + "west": { "uv": [ 0.5, 1, 7.5, 2 ], "texture": "#texture" }, + "east": { "uv": [ 0.5, 1, 7.5, 2 ], "texture": "#texture" } + } + }, + { + "__comment": "Box14", + "from": [ 11, 8, 11 ], + "to": [ 5, 1, 5 ], + "faces": { + "north": { "uv": [ 1, 0, 7, 7 ], "texture": "#texture" }, + "south": { "uv": [ 1, 0, 7, 7 ], "texture": "#texture" }, + "west": { "uv": [ 1, 0, 7, 7 ], "texture": "#texture" }, + "east": { "uv": [ 1, 0, 7, 7 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/patterns/block/flower_pot_soil.json b/src/main/resources/assets/betterend/patterns/block/flower_pot_soil.json new file mode 100644 index 00000000..224858f1 --- /dev/null +++ b/src/main/resources/assets/betterend/patterns/block/flower_pot_soil.json @@ -0,0 +1,17 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/%texture%", + "texture": "betterend:block/%texture%" + }, + "elements": [ + { + "__comment": "PlaneY1", + "from": [ 5, 7.5, 5 ], + "to": [ 11, 7.501, 11 ], + "faces": { + "up": { "uv": [ 5, 5, 11, 11 ], "texture": "#texture" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/patterns/block/potted_leaves.json b/src/main/resources/assets/betterend/patterns/block/potted_leaves.json new file mode 100644 index 00000000..8e2446f5 --- /dev/null +++ b/src/main/resources/assets/betterend/patterns/block/potted_leaves.json @@ -0,0 +1,35 @@ +{ + "__comment": "Designed by Paulevs with Cubik Studio - https://cubik.studio", + "textures": { + "particle": "betterend:block/%leaves%", + "stem": "betterend:block/%stem%", + "leaves": "betterend:block/%leaves%" + }, + "elements": [ + { + "__comment": "Box1", + "from": [ 3, 2, 3 ], + "to": [ 13, 12, 13 ], + "faces": { + "down": { "uv": [ 3, 3, 13, 13 ], "texture": "#leaves" }, + "up": { "uv": [ 3, 3, 13, 13 ], "texture": "#leaves" }, + "north": { "uv": [ 3, 3, 13, 13 ], "texture": "#leaves" }, + "south": { "uv": [ 3, 3, 13, 13 ], "texture": "#leaves" }, + "west": { "uv": [ 3, 3, 13, 13 ], "texture": "#leaves" }, + "east": { "uv": [ 3, 3, 13, 13 ], "texture": "#leaves" } + } + }, + { + "__comment": "Box1", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "up": { "uv": [ 7, 7, 9, 9 ], "texture": "#stem" }, + "north": { "uv": [ 7, 8, 9, 16 ], "texture": "#stem" }, + "south": { "uv": [ 7, 8, 9, 16 ], "texture": "#stem" }, + "west": { "uv": [ 7, 8, 9, 16 ], "texture": "#stem" }, + "east": { "uv": [ 7, 8, 9, 16 ], "texture": "#stem" } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/betterend/sounds.json b/src/main/resources/assets/betterend/sounds.json index f0abe0dd..d202610d 100644 --- a/src/main/resources/assets/betterend/sounds.json +++ b/src/main/resources/assets/betterend/sounds.json @@ -219,6 +219,15 @@ } ] }, + "betterend.ambient.amber_land": { + "category": "ambient", + "sounds": [ + { + "name": "betterend:ambient/amber_land", + "stream": true + } + ] + }, "betterend.entity.dragonfly": { "category": "entity", diff --git a/src/main/resources/assets/betterend/sounds/ambient/amber_land.ogg b/src/main/resources/assets/betterend/sounds/ambient/amber_land.ogg new file mode 100644 index 00000000..6b830cdb Binary files /dev/null and b/src/main/resources/assets/betterend/sounds/ambient/amber_land.ogg differ diff --git a/src/main/resources/assets/betterend/textures/block/amber_grass_potted.png b/src/main/resources/assets/betterend/textures/block/amber_grass_potted.png new file mode 100644 index 00000000..dcd01469 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/amber_grass_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/amber_root_potted.png b/src/main/resources/assets/betterend/textures/block/amber_root_potted.png new file mode 100644 index 00000000..ae47278a Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/amber_root_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/azure_jadestone_flower_pot.png b/src/main/resources/assets/betterend/textures/block/azure_jadestone_flower_pot.png new file mode 100644 index 00000000..d47ecc24 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/azure_jadestone_flower_pot.png differ diff --git a/src/main/resources/assets/betterend/textures/block/blooming_cooksonia_potted.png b/src/main/resources/assets/betterend/textures/block/blooming_cooksonia_potted.png new file mode 100644 index 00000000..e6715218 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/blooming_cooksonia_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/blooming_cooksonia_potted_e.png b/src/main/resources/assets/betterend/textures/block/blooming_cooksonia_potted_e.png new file mode 100644 index 00000000..59f35452 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/blooming_cooksonia_potted_e.png differ diff --git a/src/main/resources/assets/betterend/textures/block/bushy_grass_potted.png b/src/main/resources/assets/betterend/textures/block/bushy_grass_potted.png new file mode 100644 index 00000000..273665a2 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/bushy_grass_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/cave_grass_potted.png b/src/main/resources/assets/betterend/textures/block/cave_grass_potted.png new file mode 100644 index 00000000..93c16697 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/cave_grass_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/chorus_grass_potted.png b/src/main/resources/assets/betterend/textures/block/chorus_grass_potted.png new file mode 100644 index 00000000..0683b711 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/chorus_grass_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/chorus_mushroom_potted.png b/src/main/resources/assets/betterend/textures/block/chorus_mushroom_potted.png new file mode 100644 index 00000000..e8cae659 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/chorus_mushroom_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/clawfern_potted.png b/src/main/resources/assets/betterend/textures/block/clawfern_potted.png new file mode 100644 index 00000000..d4b566e3 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/clawfern_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/endstone_flower_pot.png b/src/main/resources/assets/betterend/textures/block/endstone_flower_pot.png new file mode 100644 index 00000000..d6d63dc5 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/endstone_flower_pot.png differ diff --git a/src/main/resources/assets/betterend/textures/block/flavolite_flower_pot.png b/src/main/resources/assets/betterend/textures/block/flavolite_flower_pot.png new file mode 100644 index 00000000..e8b2cfd9 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/flavolite_flower_pot.png differ diff --git a/src/main/resources/assets/betterend/textures/block/fracturn_potted.png b/src/main/resources/assets/betterend/textures/block/fracturn_potted.png new file mode 100644 index 00000000..7125e172 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/fracturn_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/fracturn_potted_e.png b/src/main/resources/assets/betterend/textures/block/fracturn_potted_e.png new file mode 100644 index 00000000..1f1dcfd6 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/fracturn_potted_e.png differ diff --git a/src/main/resources/assets/betterend/textures/block/globulagus_potted.png b/src/main/resources/assets/betterend/textures/block/globulagus_potted.png new file mode 100644 index 00000000..ea4d3c83 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/globulagus_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/jungle_grass_potted.png b/src/main/resources/assets/betterend/textures/block/jungle_grass_potted.png new file mode 100644 index 00000000..3439c032 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/jungle_grass_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/lamellarium_potted.png b/src/main/resources/assets/betterend/textures/block/lamellarium_potted.png new file mode 100644 index 00000000..3fb23cec Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/lamellarium_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/sandy_jadestone_flower_pot.png b/src/main/resources/assets/betterend/textures/block/sandy_jadestone_flower_pot.png new file mode 100644 index 00000000..1ed5f5af Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/sandy_jadestone_flower_pot.png differ diff --git a/src/main/resources/assets/betterend/textures/block/shadow_plant_potted.png b/src/main/resources/assets/betterend/textures/block/shadow_plant_potted.png new file mode 100644 index 00000000..bb92507d Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/shadow_plant_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal.png b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal.png deleted file mode 100644 index e2981961..00000000 Binary files a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal.png and /dev/null differ diff --git a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_bricks.png b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_bricks.png index b6b4336b..b14f97d9 100644 Binary files a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_bricks.png and b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_bricks.png differ diff --git a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_pillar_side.png b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_pillar_side.png index 6edbb4a2..448d7de3 100644 Binary files a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_pillar_side.png and b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_pillar_side.png differ diff --git a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_pillar_top.png b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_pillar_top.png index 04973162..b4092bca 100644 Binary files a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_pillar_top.png and b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_pillar_top.png differ diff --git a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_polished.png b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_polished.png index 9b0a4fab..785096b2 100644 Binary files a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_polished.png and b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_polished.png differ diff --git a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_shard.png b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_shard.png index aa1a21fe..cdcfa237 100644 Binary files a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_shard.png and b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_shard.png differ diff --git a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_tiles.png b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_tiles.png index ad66fdd4..7e5ab1f1 100644 Binary files a/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_tiles.png and b/src/main/resources/assets/betterend/textures/block/smaragdant_crystal_tiles.png differ diff --git a/src/main/resources/assets/betterend/textures/block/sulphuric_rock_flower_pot.png b/src/main/resources/assets/betterend/textures/block/sulphuric_rock_flower_pot.png new file mode 100644 index 00000000..93eb5e25 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/sulphuric_rock_flower_pot.png differ diff --git a/src/main/resources/assets/betterend/textures/block/vaiolush_fern_potted.png b/src/main/resources/assets/betterend/textures/block/vaiolush_fern_potted.png new file mode 100644 index 00000000..61404e19 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/vaiolush_fern_potted.png differ diff --git a/src/main/resources/assets/betterend/textures/block/violecite_flower_pot.png b/src/main/resources/assets/betterend/textures/block/violecite_flower_pot.png new file mode 100644 index 00000000..1f788065 Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/violecite_flower_pot.png differ diff --git a/src/main/resources/assets/betterend/textures/block/virid_jadestone_flower_pot.png b/src/main/resources/assets/betterend/textures/block/virid_jadestone_flower_pot.png new file mode 100644 index 00000000..4b633a7a Binary files /dev/null and b/src/main/resources/assets/betterend/textures/block/virid_jadestone_flower_pot.png differ diff --git a/src/main/resources/assets/colored_lights/light_colors.json b/src/main/resources/assets/colored_lights/light_colors.json new file mode 100644 index 00000000..27a890de --- /dev/null +++ b/src/main/resources/assets/colored_lights/light_colors.json @@ -0,0 +1,91 @@ +{ + "replace": false, + "colors": { + "betterend:smaragdant_crystal": "#17cfbd", + "betterend:smaragdant_crystal_shard": "#17cfbd", + "betterend:smaragdant_crystal_shard": "#17cfbd", + "betterend:smaragdant_crystal_bricks": "#17cfbd", + "betterend:smaragdant_crystal_bricks_slab": "#17cfbd", + "betterend:smaragdant_crystal_bricks_stairs": "#17cfbd", + "betterend:smaragdant_crystal_bricks_wall": "#17cfbd", + "betterend:smaragdant_crystal_pedestal": "#17cfbd", + "betterend:smaragdant_crystal_pillar": "#17cfbd", + "betterend:smaragdant_crystal_polished": "#17cfbd", + "betterend:smaragdant_crystal_slab": "#17cfbd", + "betterend:smaragdant_crystal_stairs": "#17cfbd", + "betterend:smaragdant_crystal_tiles": "#17cfbd", + "betterend:smaragdant_crystal_wall": "#17cfbd", + "betterend:aurora_crystal": "#f74da1", + "betterend:mossy_glowshroom_fur": "#8be6ff", + "betterend:mossy_glowshroom_hymenophore": "#8be6ff", + "betterend:umbrella_tree_cluster": "#c054f9", + "betterend:umbrella_tree_cluster": "#c054f9", + "betterend:umbrella_moss": "#ff943e", + "betterend:umbrella_moss_tall": "#ff943e", + "betterend:creeping_moss": "#0de4fc", + "betterend:twisted_umbrella_moss": "#e045d0", + "betterend:twisted_umbrella_moss_tall": "#e045d0", + "betterend:glowing_pillar_luminophor": "#ffd96c", + "betterend:glowing_pillar_leaves": "#ffd96c", + "betterend:bulb_moss": "#ffd96c", + "betterend:blue_vine_lantern": "#a6effb", + "betterend:blue_vine_fur": "#a6effb", + "betterend:purple_polypore": "#c53aec", + "betterend:aurant_polypore": "#a2d9ff", + "betterend:end_lily": "#c27dff", + "betterend:dense_vine": "#f47ffc", + "betterend:pond_anemone": "#f1f0da", + "betterend:amaranita_lantern": "#baecd9", + "betterend:amaranita_fur": "#baecd9", + + "betterend:neon_cactus": "#86f0e7", + "betterend:neon_cactus_block": "#86f0e7", + "betterend:neon_cactus_stairs": "#86f0e7", + "betterend:neon_cactus_slab": "#86f0e7", + + "betterend:iron_bulb_lantern_orange": "#ff963c", + "betterend:iron_bulb_lantern_magenta": "#d25aff", + "betterend:iron_bulb_lantern_light_blue": "#78b5ff", + "betterend:iron_bulb_lantern_yellow": "#ffff39", + "betterend:iron_bulb_lantern_lime": "#9fff1f", + "betterend:iron_bulb_lantern_pink": "#ff86ae", + "betterend:iron_bulb_lantern_cyan": "#7fd4ff", + "betterend:iron_bulb_lantern_purple": "#b65aff", + "betterend:iron_bulb_lantern_blue": "#496dff", + "betterend:iron_bulb_lantern_brown": "#ffbe80", + "betterend:iron_bulb_lantern_green": "#cdff66", + "betterend:iron_bulb_lantern_red": "#ff5555", + + "betterend:thallasium_bulb_lantern_orange": "#ff963c", + "betterend:thallasium_bulb_lantern_magenta": "#d25aff", + "betterend:thallasium_bulb_lantern_light_blue": "#78b5ff", + "betterend:thallasium_bulb_lantern_yellow": "#ffff39", + "betterend:thallasium_bulb_lantern_lime": "#9fff1f", + "betterend:thallasium_bulb_lantern_pink": "#ff86ae", + "betterend:thallasium_bulb_lantern_cyan": "#7fd4ff", + "betterend:thallasium_bulb_lantern_purple": "#b65aff", + "betterend:thallasium_bulb_lantern_blue": "#496dff", + "betterend:thallasium_bulb_lantern_brown": "#ffbe80", + "betterend:thallasium_bulb_lantern_green": "#cdff66", + "betterend:thallasium_bulb_lantern_red": "#ff5555", + + "betterend:terminite_bulb_lantern_orange": "#ff963c", + "betterend:terminite_bulb_lantern_magenta": "#d25aff", + "betterend:terminite_bulb_lantern_light_blue": "#78b5ff", + "betterend:terminite_bulb_lantern_yellow": "#ffff39", + "betterend:terminite_bulb_lantern_lime": "#9fff1f", + "betterend:terminite_bulb_lantern_pink": "#ff86ae", + "betterend:terminite_bulb_lantern_cyan": "#7fd4ff", + "betterend:terminite_bulb_lantern_purple": "#b65aff", + "betterend:terminite_bulb_lantern_blue": "#496dff", + "betterend:terminite_bulb_lantern_brown": "#ffbe80", + "betterend:terminite_bulb_lantern_green": "#cdff66", + "betterend:terminite_bulb_lantern_red": "#ff5555", + + "betterend:thallasium_chandelier": "#e0fceb", + "betterend:terminite_chandelier": "#e0fceb", + "betterend:iron_chandelier": "#e0fceb", + "betterend:gold_chandelier": "#e0fceb", + "betterend:lumecorn": "#e0fceb" + } +} diff --git a/src/main/resources/betterend.mixins.client.json b/src/main/resources/betterend.mixins.client.json index bb8bed5f..8d7acbb2 100644 --- a/src/main/resources/betterend.mixins.client.json +++ b/src/main/resources/betterend.mixins.client.json @@ -7,7 +7,7 @@ "AbstractSoundInstanceAccessor", "ClientPlayNetworkHandlerMixin", "HumanoidMobRendererMixin", - "ArmorStandRendererMixin", + "ArmorStandRendererMixin", "ClientRecipeBookMixin", "MinecraftClientMixin", "PlayerRendererMixin", diff --git a/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/biomes.json b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/biomes.json new file mode 100644 index 00000000..d0d81f6c --- /dev/null +++ b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/biomes.json @@ -0,0 +1,5 @@ +{ + "name": "Biomas", + "description": "En progreso...", + "icon": "betterend:end_mycelium" +} \ No newline at end of file diff --git a/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/crafting.json b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/crafting.json new file mode 100644 index 00000000..6faeb86e --- /dev/null +++ b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/crafting.json @@ -0,0 +1,6 @@ +{ + "name": "Crafteo", + "description": "", + "icon": "betterend:iron_hammer", + "sortnum": 2 +} \ No newline at end of file diff --git a/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/end_veil.json b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/end_veil.json new file mode 100644 index 00000000..0632316e --- /dev/null +++ b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/end_veil.json @@ -0,0 +1,6 @@ +{ + "name": "Velo del End", + "description": "Mira sin temor a los ojos de los Enderman.", + "icon": "betterend:textures/mob_effect/end_veil.png", + "sortnum": 3 +} \ No newline at end of file diff --git a/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/rituals.json b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/rituals.json new file mode 100644 index 00000000..9e5cbe82 --- /dev/null +++ b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/categories/rituals.json @@ -0,0 +1,6 @@ +{ + "name": "Rituales", + "description": "El místico arte del End, ritales secretos que abren nuevos caminos y oportunidades.", + "icon": "betterend:infusion_pedestal", + "sortnum": 1 +} \ No newline at end of file diff --git a/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/entries/rituals/eternal_ritual.json b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/entries/rituals/eternal_ritual.json new file mode 100644 index 00000000..ce0d520e --- /dev/null +++ b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/entries/rituals/eternal_ritual.json @@ -0,0 +1,44 @@ +{ + "name": "Ritual Eterno", + "icon": "betterend:eternal_pedestal", + "read_by_default": true, + "category": "rituals", + "pages": [ + { + "type": "text", + "text": "\"Una manera no tan simple de volver al Overworld.\"$(br2)Mientras viajas por el mundo del End, puedes encontrar ruinas antiguas." + }, + { + "type": "image", + "text": "Hay un marco destruido (o no) de $(bold)Flavolita de Runa$() y 6 pedestales alrededor suya.", + "border": false, + "images": [ + "betterend:textures/images/eternal_ritual/portal_structure.png" + ] + }, + { + "type": "text", + "text": "Estos son los restos de portales majestuosos que en algún momento enlazaban los mundos del End y del Overworld.$(br2)Para activar el portal necesitas reconstruir el marco (si está roto)." + }, + { + "type": "image", + "text": "Y colocar 6 $(bold)Cristales Eternos$() en los pedestales.", + "border": false, + "images": [ + "betterend:textures/images/eternal_ritual/portal_frame_full.png" + ] + }, + { + "type": "image", + "text": "Después de que hayas colocado el último cristal, el portal será activado.", + "border": false, + "images": [ + "betterend:textures/images/eternal_ritual/ritual_finished.png" + ] + }, + { + "type": "text", + "text": "$(bold)Flavolita de Runa$() (para reconstruir el marco) y $(bold)Cristales Eternos$() pueden ser obtenidos por $(l:rituals/infusion_ritual)Ritual de Infusión$(/l)." + } + ] +} diff --git a/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/entries/rituals/infusion_ritual.json b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/entries/rituals/infusion_ritual.json new file mode 100644 index 00000000..5a6cde5c --- /dev/null +++ b/src/main/resources/data/betterend/patchouli_books/guidebook/es_es/entries/rituals/infusion_ritual.json @@ -0,0 +1,64 @@ +{ + "name": "Ritual de Infusión", + "icon": "betterend:infusion_pedestal", + "read_by_default": true, + "category": "rituals", + "pages": [ + { + "type": "text", + "text": "Infunde objetos con el poder de los elementos." + }, + { + "type": "crafting", + "title": "Preparar la estructura", + "text": "Primero, deberás craftear $(bold)Pedestal de Infusión$() y 8 pedestales de $(bold)cualquier$() otro tipo.", + "recipe": "betterend:infusion_pedestal" + }, + { + "type": "image", + "text": "Luego debes de colocar el Pedestal de Infusión en el centro y los otros pedestales alrededor.", + "border": true, + "images": [ + "betterend:textures/images/infusion_ritual/infusion_ritual_start.png", + "betterend:textures/images/infusion_ritual/infusion_ritual_full.png" + ] + }, + { + "type": "image", + "title": "Infusión", + "text": "Cuando la estructura para el ritual esté lista puedes empezar la infusión.", + "border": false, + "images": [ + "betterend:textures/images/infusion_ritual/ritual_structure.png" + ] + }, + { + "type": "image", + "text": "Coloca el ingrediente principal en el $(bold)Pedestal de Infusión$() y cataliza los otros.", + "border": false, + "images": [ + "betterend:textures/images/infusion_ritual/ritual_ready.png" + ] + }, + { + "type": "text", + "text": "Puedes mirar recetas en el $(l:https://www.curseforge.com/minecraft/mc-mods/roughly-enough-items)REI$(/l).$(br2)Para empezar la Infusión coloca el ingrediente principal al final o dale clic derecho al $(bold)Pedestal de Infusión$()." + }, + { + "type": "image", + "text": "Entonces debes de esperar hasta que el ritual termine.", + "border": false, + "images": [ + "betterend:textures/images/infusion_ritual/ritual_started.png" + ] + }, + { + "type": "image", + "text": "Y obtén el resultado.", + "border": false, + "images": [ + "betterend:textures/images/infusion_ritual/ritual_finished.png" + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/c/tags/blocks/bookshelves.json b/src/main/resources/data/c/tags/blocks/bookshelves.json deleted file mode 100644 index 98dee3c8..00000000 --- a/src/main/resources/data/c/tags/blocks/bookshelves.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": "false", - "values": [ - "minecraft:bookshelf" - ] -} \ No newline at end of file diff --git a/src/main/resources/data/fabric/tags/items/hammers.json b/src/main/resources/data/fabric/tags/items/hammers.json deleted file mode 100644 index 847bbc95..00000000 --- a/src/main/resources/data/fabric/tags/items/hammers.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "replace": false, - "values": [ - "betterend:iron_hammer", - "betterend:golden_hammer", - "betterend:diamond_hammer", - "betterend:netherite_hammer", - "betterend:terminite_hammer", - "betterend:aeternium_hammer" - ] -} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json deleted file mode 100644 index 538c9e24..00000000 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/axe.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "replace": "false", - "values": [ - "betterend:amaranita_cap", - "betterend:amaranita_hymenophore", - "betterend:amaranita_lantern", - "betterend:aurant_polypore", - "betterend:blue_vine_lantern", - "betterend:filalux_lantern", - "betterend:hydralux_petal_block", - "betterend:hydralux_petal_block_black", - "betterend:hydralux_petal_block_blue", - "betterend:hydralux_petal_block_brown", - "betterend:hydralux_petal_block_cyan", - "betterend:hydralux_petal_block_gray", - "betterend:hydralux_petal_block_green", - "betterend:hydralux_petal_block_light_blue", - "betterend:hydralux_petal_block_light_gray", - "betterend:hydralux_petal_block_lime", - "betterend:hydralux_petal_block_magenta", - "betterend:hydralux_petal_block_orange", - "betterend:hydralux_petal_block_pink", - "betterend:hydralux_petal_block_purple", - "betterend:hydralux_petal_block_red", - "betterend:hydralux_petal_block_white", - "betterend:hydralux_petal_block_yellow", - "betterend:mossy_glowshroom_cap", - "betterend:mossy_glowshroom_hymenophore", - "betterend:purple_polypore" - ] -} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/hoe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/hoe.json deleted file mode 100644 index b90eeee2..00000000 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/hoe.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "replace": "false", - "values": [ - "betterend:amber_root_seed", - "betterend:blossom_berry_seed", - "betterend:chorus_mushroom_seed", - "betterend:dragon_tree_leaves", - "betterend:lacugrove_leaves", - "betterend:lucernia_leaves", - "betterend:pythadendron_leaves", - "betterend:shadow_berry", - "betterend:tenanea_leaves" - ] -} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json deleted file mode 100644 index a6e13734..00000000 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "replace": "false", - "values": [ - "betterend:aeternium_anvil", - "betterend:aeternium_block", - "betterend:amber_block", - "betterend:amber_moss", - "betterend:amber_moss_path", - "betterend:andesite_lantern", - "betterend:andesite_pedestal", - "betterend:aurora_crystal", - "betterend:azure_jadestone", - "betterend:azure_jadestone_bricks", - "betterend:azure_jadestone_bricks_slab", - "betterend:azure_jadestone_bricks_stairs", - "betterend:azure_jadestone_bricks_wall", - "betterend:azure_jadestone_button", - "betterend:azure_jadestone_furnace", - "betterend:azure_jadestone_lantern", - "betterend:azure_jadestone_pedestal", - "betterend:azure_jadestone_pillar", - "betterend:azure_jadestone_plate", - "betterend:azure_jadestone_polished", - "betterend:azure_jadestone_slab", - "betterend:azure_jadestone_stairs", - "betterend:azure_jadestone_tiles", - "betterend:azure_jadestone_wall", - "betterend:blackstone_lantern", - "betterend:brimstone", - "betterend:cave_moss", - "betterend:cave_moss_path", - "betterend:charcoal_block", - "betterend:chorus_nylium", - "betterend:chorus_nylium_path", - "betterend:crystal_moss", - "betterend:crystal_moss_path", - "betterend:diorite_lantern", - "betterend:diorite_pedestal", - "betterend:dragon_bone_block", - "betterend:dragon_bone_slab", - "betterend:dragon_bone_stairs", - "betterend:end_moss", - "betterend:end_moss_path", - "betterend:end_mycelium", - "betterend:end_mycelium_path", - "betterend:end_stone_furnace", - "betterend:end_stone_lantern", - "betterend:end_stone_smelter", - "betterend:ender_block", - "betterend:eternal_pedestal", - "betterend:flavolite", - "betterend:flavolite_bricks", - "betterend:flavolite_bricks_slab", - "betterend:flavolite_bricks_stairs", - "betterend:flavolite_bricks_wall", - "betterend:flavolite_button", - "betterend:flavolite_furnace", - "betterend:flavolite_lantern", - "betterend:flavolite_pedestal", - "betterend:flavolite_pillar", - "betterend:flavolite_plate", - "betterend:flavolite_polished", - "betterend:flavolite_runed", - "betterend:flavolite_runed_eternal", - "betterend:flavolite_slab", - "betterend:flavolite_stairs", - "betterend:flavolite_tiles", - "betterend:flavolite_wall", - "betterend:gold_chandelier", - "betterend:granite_lantern", - "betterend:granite_pedestal", - "betterend:hydrothermal_vent", - "betterend:infusion_pedestal", - "betterend:iron_bulb_lantern", - "betterend:iron_bulb_lantern_black", - "betterend:iron_bulb_lantern_blue", - "betterend:iron_bulb_lantern_brown", - "betterend:iron_bulb_lantern_cyan", - "betterend:iron_bulb_lantern_gray", - "betterend:iron_bulb_lantern_green", - "betterend:iron_bulb_lantern_light_blue", - "betterend:iron_bulb_lantern_light_gray", - "betterend:iron_bulb_lantern_lime", - "betterend:iron_bulb_lantern_magenta", - "betterend:iron_bulb_lantern_orange", - "betterend:iron_bulb_lantern_pink", - "betterend:iron_bulb_lantern_purple", - "betterend:iron_bulb_lantern_red", - "betterend:iron_bulb_lantern_white", - "betterend:iron_bulb_lantern_yellow", - "betterend:iron_chandelier", - "betterend:jungle_moss", - "betterend:jungle_moss_path", - "betterend:missing_tile", - "betterend:mossy_dragon_bone", - "betterend:mossy_obsidian", - "betterend:pink_moss", - "betterend:pink_moss_path", - "betterend:purpur_lantern", - "betterend:purpur_pedestal", - "betterend:quartz_lantern", - "betterend:quartz_pedestal", - "betterend:respawn_obelisk", - "betterend:rutiscus", - "betterend:rutiscus_path", - "betterend:sandy_jadestone", - "betterend:sandy_jadestone_bricks", - "betterend:sandy_jadestone_bricks_slab", - "betterend:sandy_jadestone_bricks_stairs", - "betterend:sandy_jadestone_bricks_wall", - "betterend:sandy_jadestone_button", - "betterend:sandy_jadestone_furnace", - "betterend:sandy_jadestone_lantern", - "betterend:sandy_jadestone_pedestal", - "betterend:sandy_jadestone_pillar", - "betterend:sandy_jadestone_plate", - "betterend:sandy_jadestone_polished", - "betterend:sandy_jadestone_slab", - "betterend:sandy_jadestone_stairs", - "betterend:sandy_jadestone_tiles", - "betterend:sandy_jadestone_wall", - "betterend:sangnum", - "betterend:sangnum_path", - "betterend:shadow_grass", - "betterend:shadow_grass_path", - "betterend:smaragdant_crystal", - "betterend:smaragdant_crystal_bricks", - "betterend:smaragdant_crystal_bricks_slab", - "betterend:smaragdant_crystal_bricks_stairs", - "betterend:smaragdant_crystal_bricks_wall", - "betterend:smaragdant_crystal_pedestal", - "betterend:smaragdant_crystal_pillar", - "betterend:smaragdant_crystal_polished", - "betterend:smaragdant_crystal_shard", - "betterend:smaragdant_crystal_slab", - "betterend:smaragdant_crystal_stairs", - "betterend:smaragdant_crystal_tiles", - "betterend:smaragdant_crystal_wall", - "betterend:sulphur_crystal", - "betterend:sulphuric_rock", - "betterend:sulphuric_rock_bricks", - "betterend:sulphuric_rock_bricks_slab", - "betterend:sulphuric_rock_bricks_stairs", - "betterend:sulphuric_rock_bricks_wall", - "betterend:sulphuric_rock_button", - "betterend:sulphuric_rock_furnace", - "betterend:sulphuric_rock_lantern", - "betterend:sulphuric_rock_pedestal", - "betterend:sulphuric_rock_pillar", - "betterend:sulphuric_rock_plate", - "betterend:sulphuric_rock_polished", - "betterend:sulphuric_rock_slab", - "betterend:sulphuric_rock_stairs", - "betterend:sulphuric_rock_tiles", - "betterend:sulphuric_rock_wall", - "betterend:terminite_anvil", - "betterend:terminite_bars", - "betterend:terminite_block", - "betterend:terminite_bulb_lantern", - "betterend:terminite_bulb_lantern_black", - "betterend:terminite_bulb_lantern_blue", - "betterend:terminite_bulb_lantern_brown", - "betterend:terminite_bulb_lantern_cyan", - "betterend:terminite_bulb_lantern_gray", - "betterend:terminite_bulb_lantern_green", - "betterend:terminite_bulb_lantern_light_blue", - "betterend:terminite_bulb_lantern_light_gray", - "betterend:terminite_bulb_lantern_lime", - "betterend:terminite_bulb_lantern_magenta", - "betterend:terminite_bulb_lantern_orange", - "betterend:terminite_bulb_lantern_pink", - "betterend:terminite_bulb_lantern_purple", - "betterend:terminite_bulb_lantern_red", - "betterend:terminite_bulb_lantern_white", - "betterend:terminite_bulb_lantern_yellow", - "betterend:terminite_chain", - "betterend:terminite_chandelier", - "betterend:terminite_door", - "betterend:terminite_plate", - "betterend:terminite_slab", - "betterend:terminite_stairs", - "betterend:terminite_tile", - "betterend:terminite_trapdoor", - "betterend:thallasium_anvil", - "betterend:thallasium_bars", - "betterend:thallasium_block", - "betterend:thallasium_bulb_lantern", - "betterend:thallasium_bulb_lantern_black", - "betterend:thallasium_bulb_lantern_blue", - "betterend:thallasium_bulb_lantern_brown", - "betterend:thallasium_bulb_lantern_cyan", - "betterend:thallasium_bulb_lantern_gray", - "betterend:thallasium_bulb_lantern_green", - "betterend:thallasium_bulb_lantern_light_blue", - "betterend:thallasium_bulb_lantern_light_gray", - "betterend:thallasium_bulb_lantern_lime", - "betterend:thallasium_bulb_lantern_magenta", - "betterend:thallasium_bulb_lantern_orange", - "betterend:thallasium_bulb_lantern_pink", - "betterend:thallasium_bulb_lantern_purple", - "betterend:thallasium_bulb_lantern_red", - "betterend:thallasium_bulb_lantern_white", - "betterend:thallasium_bulb_lantern_yellow", - "betterend:thallasium_chain", - "betterend:thallasium_chandelier", - "betterend:thallasium_door", - "betterend:thallasium_ore", - "betterend:thallasium_plate", - "betterend:thallasium_slab", - "betterend:thallasium_stairs", - "betterend:thallasium_tile", - "betterend:thallasium_trapdoor", - "betterend:violecite", - "betterend:violecite_bricks", - "betterend:violecite_bricks_slab", - "betterend:violecite_bricks_stairs", - "betterend:violecite_bricks_wall", - "betterend:violecite_button", - "betterend:violecite_furnace", - "betterend:violecite_lantern", - "betterend:violecite_pedestal", - "betterend:violecite_pillar", - "betterend:violecite_plate", - "betterend:violecite_polished", - "betterend:violecite_slab", - "betterend:violecite_stairs", - "betterend:violecite_tiles", - "betterend:violecite_wall", - "betterend:virid_jadestone", - "betterend:virid_jadestone_bricks", - "betterend:virid_jadestone_bricks_slab", - "betterend:virid_jadestone_bricks_stairs", - "betterend:virid_jadestone_bricks_wall", - "betterend:virid_jadestone_button", - "betterend:virid_jadestone_furnace", - "betterend:virid_jadestone_lantern", - "betterend:virid_jadestone_pedestal", - "betterend:virid_jadestone_pillar", - "betterend:virid_jadestone_plate", - "betterend:virid_jadestone_polished", - "betterend:virid_jadestone_slab", - "betterend:virid_jadestone_stairs", - "betterend:virid_jadestone_tiles", - "betterend:virid_jadestone_wall", - - "betterend:amber_ore", - "betterend:end_stone_stalactite", - "betterend:end_stone_stalactite_cavemoss", - "betterend:ender_ore" - ] -} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/shovel.json b/src/main/resources/data/minecraft/tags/blocks/mineable/shovel.json deleted file mode 100644 index 31f7636d..00000000 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/shovel.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": "false", - "values": [ - "betterend:endstone_dust" - ] -} \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index ff7e882c..0548b3b3 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -45,11 +45,12 @@ "fabricloader": ">=0.11.6", "fabric": ">=0.36.0", "minecraft": ">=1.17", - "bclib": ">=0.2.0" + "bclib": ">=0.2.2" }, "suggests": { "byg": ">=1.1.3", "blockus": ">=2.0.2", - "nourish": ">=1.2.0" + "nourish": ">=1.2.0", + "colored_lights": ">=1.0.3" } }