commit
f6d4684427
533 changed files with 7457 additions and 7570 deletions
309
Convert.java
309
Convert.java
|
@ -1,157 +1,164 @@
|
||||||
|
|
||||||
class ModelPart {
|
class ModelPart {
|
||||||
static java.util.ArrayList<ModelPart> parts = new java.util.ArrayList<>(20);
|
static java.util.ArrayList<ModelPart> parts = new java.util.ArrayList<>(20);
|
||||||
final String name;
|
final String name;
|
||||||
ModelPart parent = null;
|
ModelPart parent = null;
|
||||||
boolean mirror = false;
|
boolean mirror = false;
|
||||||
|
|
||||||
float x=0, y=0, z=0, rx=0, ry=0, rz=0;
|
float x = 0, y = 0, z = 0, rx = 0, ry = 0, rz = 0;
|
||||||
int u=0, v=0;
|
int u = 0, v = 0;
|
||||||
float bx=0,by=0,bz=0,ba=0,bb=0,bc=0;
|
float bx = 0, by = 0, bz = 0, ba = 0, bb = 0, bc = 0;
|
||||||
float scale = 1;
|
float scale = 1;
|
||||||
static int wd = 64;
|
static int wd = 64;
|
||||||
static int hg = 32;
|
static int hg = 32;
|
||||||
|
|
||||||
|
|
||||||
boolean hadBox = false;
|
boolean hadBox = false;
|
||||||
ModelPart(Convert c, String name){
|
|
||||||
this(c, 0, 0, name);
|
ModelPart(Convert c, String name) {
|
||||||
|
this(c, 0, 0, name);
|
||||||
}
|
|
||||||
|
}
|
||||||
ModelPart(Convert c, int u, int v, String name){
|
|
||||||
this.name = name;
|
ModelPart(Convert c, int u, int v, String name) {
|
||||||
this.u = u;
|
this.name = name;
|
||||||
this.v = v;
|
this.u = u;
|
||||||
parts.add(this);
|
this.v = v;
|
||||||
}
|
parts.add(this);
|
||||||
|
}
|
||||||
ModelPart(int wd, int hg, int u, int v, String name){
|
|
||||||
this.name = name;
|
ModelPart(int wd, int hg, int u, int v, String name) {
|
||||||
this.u = u;
|
this.name = name;
|
||||||
this.v = v;
|
this.u = u;
|
||||||
ModelPart.wd = wd;
|
this.v = v;
|
||||||
ModelPart.hg = hg;
|
ModelPart.wd = wd;
|
||||||
parts.add(this);
|
ModelPart.hg = hg;
|
||||||
}
|
parts.add(this);
|
||||||
|
}
|
||||||
ModelPart setPos(float x, float y, float z){
|
|
||||||
this.x=x;
|
ModelPart setPos(float x, float y, float z) {
|
||||||
this.y=y;
|
this.x = x;
|
||||||
this.z=z;
|
this.y = y;
|
||||||
return this;
|
this.z = z;
|
||||||
}
|
return this;
|
||||||
|
}
|
||||||
ModelPart setRotationAngle(float x, float y, float z){
|
|
||||||
this.rx=x;
|
ModelPart setRotationAngle(float x, float y, float z) {
|
||||||
this.ry=y;
|
this.rx = x;
|
||||||
this.rz=z;
|
this.ry = y;
|
||||||
return this;
|
this.rz = z;
|
||||||
}
|
return this;
|
||||||
|
}
|
||||||
ModelPart addChild(ModelPart p){
|
|
||||||
p.parent = this;
|
ModelPart addChild(ModelPart p) {
|
||||||
return this;
|
p.parent = this;
|
||||||
}
|
return this;
|
||||||
|
}
|
||||||
ModelPart texOffs(int u, int v){
|
|
||||||
this.u=u;
|
ModelPart texOffs(int u, int v) {
|
||||||
this.v=v;
|
this.u = u;
|
||||||
return this;
|
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) {
|
||||||
|
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;
|
ModelPart addBox(float x, float y, float z, float a, float b, float c, float _d) {
|
||||||
bz=z;
|
bx = x;
|
||||||
ba=a;
|
by = y;
|
||||||
bb=b;
|
bz = z;
|
||||||
bc=c;
|
ba = a;
|
||||||
scale = _d;
|
bb = b;
|
||||||
hadBox = true;
|
bc = c;
|
||||||
return this;
|
scale = _d;
|
||||||
}
|
hadBox = true;
|
||||||
ModelPart addBox(float x, float y, float z, float a, float b, float c, float _d, boolean mirror){
|
return this;
|
||||||
this.mirror = mirror;
|
}
|
||||||
bx=x;
|
|
||||||
by=y;
|
ModelPart addBox(float x, float y, float z, float a, float b, float c, float _d, boolean mirror) {
|
||||||
bz=z;
|
this.mirror = mirror;
|
||||||
ba=a;
|
bx = x;
|
||||||
bb=b;
|
by = y;
|
||||||
bc=c;
|
bz = z;
|
||||||
hadBox = true;
|
ba = a;
|
||||||
return this;
|
bb = b;
|
||||||
}
|
bc = c;
|
||||||
|
hadBox = true;
|
||||||
public String toString(){
|
return this;
|
||||||
String s = "";
|
}
|
||||||
String pName = parent==null?"modelPartData":parent.name;
|
|
||||||
if (scale!=1){
|
public String toString() {
|
||||||
s += "CubeDeformation deformation_"+name+" = new CubeDeformation("+scale+"f);\n";
|
String s = "";
|
||||||
}
|
String pName = parent == null ? "modelPartData" : parent.name;
|
||||||
s += "PartDefinition " + name + " = ";
|
if (scale != 1) {
|
||||||
s += pName+".addOrReplaceChild(\""+name+"\", CubeListBuilder.create()\n";
|
s += "CubeDeformation deformation_" + name + " = new CubeDeformation(" + scale + "f);\n";
|
||||||
if (this.mirror) s+= ".mirror()\n";
|
}
|
||||||
s+= ".texOffs("+u+", "+v+")";
|
s += "PartDefinition " + name + " = ";
|
||||||
if (this.hadBox) {
|
s += pName + ".addOrReplaceChild(\"" + name + "\", CubeListBuilder.create()\n";
|
||||||
s+= "\n";
|
if (this.mirror) s += ".mirror()\n";
|
||||||
if (scale!=1)
|
s += ".texOffs(" + u + ", " + v + ")";
|
||||||
s+= ".addBox("+bx+"f, "+by+"f, "+bz+"f, "+ba+"f, "+bb+"f, "+bc+"f, deformation_"+name+"),\n";
|
if (this.hadBox) {
|
||||||
else
|
s += "\n";
|
||||||
s+= ".addBox("+bx+"f, "+by+"f, "+bz+"f, "+ba+"f, "+bb+"f, "+bc+"f),\n";
|
if (scale != 1)
|
||||||
} else {
|
s += ".addBox(" + bx + "f, " + by + "f, " + bz + "f, " + ba + "f, " + bb + "f, " + bc + "f, deformation_" + name + "),\n";
|
||||||
s+= ",\n";
|
else s += ".addBox(" + bx + "f, " + by + "f, " + bz + "f, " + ba + "f, " + bb + "f, " + bc + "f),\n";
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
if (x==0 && y==0 && z==0 && rx==0 && ry==0 && rz==0){
|
s += ",\n";
|
||||||
s+= "PartPose.ZERO";
|
}
|
||||||
} else if (rx==0 && ry==0 && rz==0){
|
|
||||||
s+= "PartPose.offset("+x+"f, "+y+"f, "+z+"f)";
|
if (x == 0 && y == 0 && z == 0 && rx == 0 && ry == 0 && rz == 0) {
|
||||||
} else {
|
s += "PartPose.ZERO";
|
||||||
s+= "PartPose.offsetAndRotation("+x+"f, "+y+"f, "+z+"f, \n"+rx+"f, "+ry+"f, "+rz+"f)";
|
}
|
||||||
}
|
else if (rx == 0 && ry == 0 && rz == 0) {
|
||||||
s +=");";
|
s += "PartPose.offset(" + x + "f, " + y + "f, " + z + "f)";
|
||||||
|
}
|
||||||
return s;
|
else {
|
||||||
}
|
s += "PartPose.offsetAndRotation(" + x + "f, " + y + "f, " + z + "f, \n" + rx + "f, " + ry + "f, " + rz + "f)";
|
||||||
|
}
|
||||||
public static void print(){
|
s += ");";
|
||||||
System.out.println("public static LayerDefinition getTexturedModelData() {");
|
|
||||||
System.out.println(" MeshDefinition modelData = new MeshDefinition();");
|
return s;
|
||||||
System.out.println(" PartDefinition modelPartData = modelData.getRoot();");
|
}
|
||||||
for(ModelPart p : parts){
|
|
||||||
System.out.println(p);
|
public static void print() {
|
||||||
System.out.println();
|
System.out.println("public static LayerDefinition getTexturedModelData() {");
|
||||||
}
|
System.out.println(" MeshDefinition modelData = new MeshDefinition();");
|
||||||
System.out.println("return LayerDefinition.create(modelData, "+wd+", "+hg+");");
|
System.out.println(" PartDefinition modelPartData = modelData.getRoot();");
|
||||||
System.out.println("}");
|
for (ModelPart p : parts) {
|
||||||
|
System.out.println(p);
|
||||||
System.out.println();
|
System.out.println();
|
||||||
System.out.println();
|
}
|
||||||
|
System.out.println("return LayerDefinition.create(modelData, " + wd + ", " + hg + ");");
|
||||||
for(ModelPart p : parts){
|
System.out.println("}");
|
||||||
String pName = p.parent==null?"modelPart":p.parent.name;
|
|
||||||
System.out.println(p.name +" = "+pName+".getChild(\""+p.name+"\");");
|
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();
|
public class Convert {
|
||||||
}
|
public static void main(String[] args) {
|
||||||
void setRotationAngle(ModelPart p, float x, float y, float z){
|
new Convert().c();
|
||||||
p.setRotationAngle(x, y, z);
|
|
||||||
}
|
ModelPart.print();
|
||||||
public void c (){
|
}
|
||||||
float scale = 1;
|
|
||||||
ModelPart partC = new ModelPart(64, 64, 0, 19, "partC");
|
void setRotationAngle(ModelPart p, float x, float y, float z) {
|
||||||
|
p.setRotationAngle(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void c() {
|
||||||
|
float scale = 1;
|
||||||
|
ModelPart partC = new ModelPart(64, 64, 0, 19, "partC");
|
||||||
partC.addBox(1.0F, 0.0F, 1.0F, 14.0F, 9.0F, 14.0F, 0.0F);
|
partC.addBox(1.0F, 0.0F, 1.0F, 14.0F, 9.0F, 14.0F, 0.0F);
|
||||||
ModelPart partA = new ModelPart(64, 64, 0, 0,"partA");
|
ModelPart partA = new ModelPart(64, 64, 0, 0, "partA");
|
||||||
partA.addBox(1.0F, 0.0F, 0.0F, 14.0F, 5.0F, 14.0F, 0.0F);
|
partA.addBox(1.0F, 0.0F, 0.0F, 14.0F, 5.0F, 14.0F, 0.0F);
|
||||||
partA.y = 9.0F;
|
partA.y = 9.0F;
|
||||||
partA.z = 1.0F;
|
partA.z = 1.0F;
|
||||||
|
@ -176,5 +183,5 @@ public class Convert {
|
||||||
ModelPart partLeftB = new ModelPart(64, 64, 0, 0, "partLeftB");
|
ModelPart partLeftB = new ModelPart(64, 64, 0, 0, "partLeftB");
|
||||||
partLeftB.addBox(0.0F, -1.0F, 15.0F, 1.0F, 4.0F, 1.0F, 0.0F);
|
partLeftB.addBox(0.0F, -1.0F, 15.0F, 1.0F, 4.0F, 1.0F, 0.0F);
|
||||||
partLeftB.y = 8.0F;
|
partLeftB.y = 8.0F;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
[](https://jitpack.io/#paulevsGitch/BetterEnd)
|
[](https://jitpack.io/#paulevsGitch/BetterEnd)
|
||||||
|
|
||||||
# Better End
|
# Better End
|
||||||
|
|
||||||
Better End Mod for Fabric, MC 1.17.1
|
Better End Mod for Fabric, MC 1.17.1
|
||||||
|
|
||||||
Importing:
|
Importing:
|
||||||
|
|
||||||
* Clone repo
|
* Clone repo
|
||||||
* Edit gradle.properties if necessary
|
* Edit gradle.properties if necessary
|
||||||
* Run command line in folder: gradlew genSources eclipse (or Another-IDE-Name)
|
* Run command line in folder: gradlew genSources eclipse (or Another-IDE-Name)
|
||||||
* Import project to IDE
|
* Import project to IDE
|
||||||
|
|
||||||
Building:
|
Building:
|
||||||
|
|
||||||
* Clone repo
|
* Clone repo
|
||||||
* Run command line in folder: gradlew build
|
* Run command line in folder: gradlew build
|
||||||
* Mod .jar will be in ./build/libs
|
* Mod .jar will be in ./build/libs
|
||||||
|
|
158
build.gradle
158
build.gradle
|
@ -1,14 +1,14 @@
|
||||||
buildscript {
|
buildscript {
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'org.kohsuke:github-api:1.114'
|
classpath 'org.kohsuke:github-api:1.114'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'idea'
|
id 'idea'
|
||||||
id 'eclipse'
|
id 'eclipse'
|
||||||
id 'fabric-loom' version '0.8-SNAPSHOT'
|
id 'fabric-loom' version '0.8-SNAPSHOT'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_16
|
sourceCompatibility = JavaVersion.VERSION_16
|
||||||
|
@ -19,102 +19,102 @@ version = project.mod_version
|
||||||
group = project.maven_group
|
group = project.maven_group
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://maven.dblsaiko.net/" }
|
maven { url "https://maven.dblsaiko.net/" }
|
||||||
maven { url "https://maven.fabricmc.net/" }
|
maven { url "https://maven.fabricmc.net/" }
|
||||||
maven { url 'https://maven.blamejared.com' }
|
maven { url 'https://maven.blamejared.com' }
|
||||||
maven { url "https://maven.shedaniel.me/" }
|
maven { url "https://maven.shedaniel.me/" }
|
||||||
maven { url 'https://jitpack.io' }
|
maven { url 'https://jitpack.io' }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||||
mappings minecraft.officialMojangMappings()
|
mappings minecraft.officialMojangMappings()
|
||||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_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}"
|
|
||||||
|
|
||||||
useOptional "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
|
useApi "vazkii.patchouli:Patchouli:1.17-${project.patchouli_version}"
|
||||||
useOptional "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}"
|
useApi "com.github.paulevsGitch:BCLib:${project.bclib_version}"
|
||||||
//useOptional "grondag:canvas-mc116:${project.canvas_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) {
|
def useOptional(String dep) {
|
||||||
dependencies.modRuntime (dep) {
|
dependencies.modRuntime(dep) {
|
||||||
exclude group: 'net.fabricmc.fabric-api'
|
exclude group: 'net.fabricmc.fabric-api'
|
||||||
exclude group: 'net.fabricmc'
|
exclude group: 'net.fabricmc'
|
||||||
if (!dep.contains("me.shedaniel")) {
|
if (!dep.contains("me.shedaniel")) {
|
||||||
exclude group: 'me.shedaniel.cloth'
|
exclude group: 'me.shedaniel.cloth'
|
||||||
exclude group: 'me.shedaniel'
|
exclude group: 'me.shedaniel'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies.modCompileOnly (dep) {
|
dependencies.modCompileOnly(dep) {
|
||||||
exclude group: 'net.fabricmc.fabric-api'
|
exclude group: 'net.fabricmc.fabric-api'
|
||||||
exclude group: 'net.fabricmc'
|
exclude group: 'net.fabricmc'
|
||||||
if (!dep.contains("me.shedaniel")) {
|
if (!dep.contains("me.shedaniel")) {
|
||||||
exclude group: 'me.shedaniel.cloth'
|
exclude group: 'me.shedaniel.cloth'
|
||||||
exclude group: 'me.shedaniel'
|
exclude group: 'me.shedaniel'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def useApi(String dep) {
|
def useApi(String dep) {
|
||||||
dependencies.modApi (dep) {
|
dependencies.modApi(dep) {
|
||||||
exclude group: 'net.fabricmc.fabric-api'
|
exclude group: 'net.fabricmc.fabric-api'
|
||||||
exclude group: 'net.fabricmc'
|
exclude group: 'net.fabricmc'
|
||||||
if (!dep.contains("me.shedaniel")) {
|
if (!dep.contains("me.shedaniel")) {
|
||||||
exclude group: 'me.shedaniel.cloth'
|
exclude group: 'me.shedaniel.cloth'
|
||||||
exclude group: 'me.shedaniel'
|
exclude group: 'me.shedaniel'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
inputs.property "version", project.version
|
inputs.property "version", project.version
|
||||||
duplicatesStrategy = 'WARN'
|
duplicatesStrategy = 'WARN'
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
include "fabric.mod.json"
|
include "fabric.mod.json"
|
||||||
expand "version": project.version
|
expand "version": project.version
|
||||||
}
|
}
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
exclude "fabric.mod.json"
|
exclude "fabric.mod.json"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
// 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
|
// 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
|
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
}
|
}
|
||||||
|
|
||||||
javadoc {
|
javadoc {
|
||||||
options.tags = ["reason"]
|
options.tags = ["reason"]
|
||||||
}
|
}
|
||||||
|
|
||||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||||
classifier = 'javadoc'
|
classifier = 'javadoc'
|
||||||
from javadoc.destinationDir
|
from javadoc.destinationDir
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
||||||
// if it is present.
|
// if it is present.
|
||||||
// If you remove this task, sources will not be generated.
|
// If you remove this task, sources will not be generated.
|
||||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||||
classifier = 'sources'
|
classifier = 'sources'
|
||||||
from sourceSets.main.allSource
|
from sourceSets.main.allSource
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
from "LICENSE"
|
from "LICENSE"
|
||||||
}
|
}
|
||||||
|
|
||||||
artifacts {
|
artifacts {
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
archives javadocJar
|
archives javadocJar
|
||||||
}
|
}
|
||||||
|
|
||||||
def env = System.getenv()
|
def env = System.getenv()
|
||||||
|
@ -123,24 +123,24 @@ import org.kohsuke.github.GHReleaseBuilder
|
||||||
import org.kohsuke.github.GitHub
|
import org.kohsuke.github.GitHub
|
||||||
|
|
||||||
task release(dependsOn: [remapJar, sourcesJar, javadocJar]) {
|
task release(dependsOn: [remapJar, sourcesJar, javadocJar]) {
|
||||||
onlyIf {
|
onlyIf {
|
||||||
env.GITHUB_TOKEN
|
env.GITHUB_TOKEN
|
||||||
}
|
}
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
def github = GitHub.connectUsingOAuth(env.GITHUB_TOKEN as String)
|
def github = GitHub.connectUsingOAuth(env.GITHUB_TOKEN as String)
|
||||||
def repository = github.getRepository("paulevsGitch/BetterEnd")
|
def repository = github.getRepository("paulevsGitch/BetterEnd")
|
||||||
|
|
||||||
def releaseBuilder = new GHReleaseBuilder(repository, version as String)
|
def releaseBuilder = new GHReleaseBuilder(repository, version as String)
|
||||||
releaseBuilder.name("${archivesBaseName}-${version}")
|
releaseBuilder.name("${archivesBaseName}-${version}")
|
||||||
releaseBuilder.body("A changelog can be found at https://github.com/paulevsGitch/BetterEnd/commits")
|
releaseBuilder.body("A changelog can be found at https://github.com/paulevsGitch/BetterEnd/commits")
|
||||||
releaseBuilder.commitish("master")
|
releaseBuilder.commitish("master")
|
||||||
|
|
||||||
def ghRelease = releaseBuilder.create()
|
def ghRelease = releaseBuilder.create()
|
||||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"), "application/java-archive");
|
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}-sources.jar"), "application/java-archive");
|
||||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-javadoc.jar"), "application/java-archive");
|
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-javadoc.jar"), "application/java-archive");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// configure the maven publication
|
// configure the maven publication
|
||||||
|
|
|
@ -1,21 +1,18 @@
|
||||||
# Done to increase the memory available to gradle.
|
# Done to increase the memory available to gradle.
|
||||||
org.gradle.jvmargs=-Xmx2G
|
org.gradle.jvmargs=-Xmx2G
|
||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/use
|
# check these on https://fabricmc.net/use
|
||||||
minecraft_version= 1.17.1
|
minecraft_version=1.17.1
|
||||||
yarn_mappings= 6
|
yarn_mappings=6
|
||||||
loader_version= 0.11.6
|
loader_version=0.11.6
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 0.10.2-pre
|
mod_version=0.10.3-pre
|
||||||
maven_group = ru.betterend
|
maven_group=ru.betterend
|
||||||
archives_base_name = better-end
|
archives_base_name=better-end
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
# 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
|
patchouli_version=55-FABRIC-SNAPSHOT
|
||||||
fabric_version = 0.36.1+1.17
|
fabric_version=0.36.1+1.17
|
||||||
bclib_version = 0.2.0
|
bclib_version=0.2.1
|
||||||
rei_version = 6.0.262-alpha
|
rei_version=6.0.262-alpha
|
||||||
canvas_version = 1.0.+
|
canvas_version=1.0.+
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "block/cube_all",
|
"parent": "block/cube_all",
|
||||||
"textures": {
|
"textures": {
|
||||||
"all": "betterend:block/%name%"
|
"all": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"parent": "block/slab",
|
"parent": "block/slab",
|
||||||
"textures": {
|
"textures": {
|
||||||
"bottom": "betterend:block/%name%_bricks",
|
"bottom": "betterend:block/%name%_bricks",
|
||||||
"side": "betterend:block/%name%_bricks",
|
"side": "betterend:block/%name%_bricks",
|
||||||
"top": "betterend:block/%name%_bricks"
|
"top": "betterend:block/%name%_bricks"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"parent": "block/inner_stairs",
|
"parent": "block/inner_stairs",
|
||||||
"textures": {
|
"textures": {
|
||||||
"bottom": "betterend:block/%name%_bricks",
|
"bottom": "betterend:block/%name%_bricks",
|
||||||
"side": "betterend:block/%name%_bricks",
|
"side": "betterend:block/%name%_bricks",
|
||||||
"top": "betterend:block/%name%_bricks"
|
"top": "betterend:block/%name%_bricks"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"parent": "block/outer_stairs",
|
"parent": "block/outer_stairs",
|
||||||
"textures": {
|
"textures": {
|
||||||
"bottom": "betterend:block/%name%_bricks",
|
"bottom": "betterend:block/%name%_bricks",
|
||||||
"side": "betterend:block/%name%_bricks",
|
"side": "betterend:block/%name%_bricks",
|
||||||
"top": "betterend:block/%name%_bricks"
|
"top": "betterend:block/%name%_bricks"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"parent": "block/stairs",
|
"parent": "block/stairs",
|
||||||
"textures": {
|
"textures": {
|
||||||
"bottom": "betterend:block/%name%_bricks",
|
"bottom": "betterend:block/%name%_bricks",
|
||||||
"side": "betterend:block/%name%_bricks",
|
"side": "betterend:block/%name%_bricks",
|
||||||
"top": "betterend:block/%name%_bricks"
|
"top": "betterend:block/%name%_bricks"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "minecraft:block/wall_inventory",
|
"parent": "minecraft:block/wall_inventory",
|
||||||
"textures": {
|
"textures": {
|
||||||
"wall": "betterend:block/%name%_bricks"
|
"wall": "betterend:block/%name%_bricks"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "minecraft:block/template_wall_post",
|
"parent": "minecraft:block/template_wall_post",
|
||||||
"textures": {
|
"textures": {
|
||||||
"wall": "betterend:block/%name%_bricks"
|
"wall": "betterend:block/%name%_bricks"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "minecraft:block/template_wall_side",
|
"parent": "minecraft:block/template_wall_side",
|
||||||
"textures": {
|
"textures": {
|
||||||
"wall": "betterend:block/%name%_bricks"
|
"wall": "betterend:block/%name%_bricks"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "minecraft:block/template_wall_side_tall",
|
"parent": "minecraft:block/template_wall_side_tall",
|
||||||
"textures": {
|
"textures": {
|
||||||
"wall": "betterend:block/%name%_bricks"
|
"wall": "betterend:block/%name%_bricks"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "block/cube_all",
|
"parent": "block/cube_all",
|
||||||
"textures": {
|
"textures": {
|
||||||
"all": "betterend:block/%name%_bricks"
|
"all": "betterend:block/%name%_bricks"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "block/button",
|
"parent": "block/button",
|
||||||
"textures": {
|
"textures": {
|
||||||
"texture": "betterend:block/%name%"
|
"texture": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "block/button_inventory",
|
"parent": "block/button_inventory",
|
||||||
"textures": {
|
"textures": {
|
||||||
"texture": "betterend:block/%name%"
|
"texture": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "block/button_pressed",
|
"parent": "block/button_pressed",
|
||||||
"textures": {
|
"textures": {
|
||||||
"texture": "betterend:block/%name%"
|
"texture": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"parent": "block/slab",
|
"parent": "block/slab",
|
||||||
"textures": {
|
"textures": {
|
||||||
"bottom": "betterend:block/%name%",
|
"bottom": "betterend:block/%name%",
|
||||||
"side": "betterend:block/%name%",
|
"side": "betterend:block/%name%",
|
||||||
"top": "betterend:block/%name%"
|
"top": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"parent": "block/inner_stairs",
|
"parent": "block/inner_stairs",
|
||||||
"textures": {
|
"textures": {
|
||||||
"bottom": "betterend:block/%name%",
|
"bottom": "betterend:block/%name%",
|
||||||
"side": "betterend:block/%name%",
|
"side": "betterend:block/%name%",
|
||||||
"top": "betterend:block/%name%"
|
"top": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"parent": "block/outer_stairs",
|
"parent": "block/outer_stairs",
|
||||||
"textures": {
|
"textures": {
|
||||||
"bottom": "betterend:block/%name%",
|
"bottom": "betterend:block/%name%",
|
||||||
"side": "betterend:block/%name%",
|
"side": "betterend:block/%name%",
|
||||||
"top": "betterend:block/%name%"
|
"top": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "block/pressure_plate_down",
|
"parent": "block/pressure_plate_down",
|
||||||
"textures": {
|
"textures": {
|
||||||
"texture": "betterend:block/%name%"
|
"texture": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "block/pressure_plate_up",
|
"parent": "block/pressure_plate_up",
|
||||||
"textures": {
|
"textures": {
|
||||||
"texture": "betterend:block/%name%"
|
"texture": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "block/cube_all",
|
"parent": "block/cube_all",
|
||||||
"textures": {
|
"textures": {
|
||||||
"all": "betterend:block/%name%_small_tiles"
|
"all": "betterend:block/%name%_small_tiles"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"parent": "block/stairs",
|
"parent": "block/stairs",
|
||||||
"textures": {
|
"textures": {
|
||||||
"bottom": "betterend:block/%name%",
|
"bottom": "betterend:block/%name%",
|
||||||
"side": "betterend:block/%name%",
|
"side": "betterend:block/%name%",
|
||||||
"top": "betterend:block/%name%"
|
"top": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "block/cube_all",
|
"parent": "block/cube_all",
|
||||||
"textures": {
|
"textures": {
|
||||||
"all": "betterend:block/%name%_tile"
|
"all": "betterend:block/%name%_tile"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "minecraft:block/wall_inventory",
|
"parent": "minecraft:block/wall_inventory",
|
||||||
"textures": {
|
"textures": {
|
||||||
"wall": "betterend:block/%name%"
|
"wall": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "minecraft:block/template_wall_post",
|
"parent": "minecraft:block/template_wall_post",
|
||||||
"textures": {
|
"textures": {
|
||||||
"wall": "betterend:block/%name%"
|
"wall": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "minecraft:block/template_wall_side",
|
"parent": "minecraft:block/template_wall_side",
|
||||||
"textures": {
|
"textures": {
|
||||||
"wall": "betterend:block/%name%"
|
"wall": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "minecraft:block/template_wall_side_tall",
|
"parent": "minecraft:block/template_wall_side_tall",
|
||||||
"textures": {
|
"textures": {
|
||||||
"wall": "betterend:block/%name%"
|
"wall": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"": {
|
"": {
|
||||||
"model": "betterend:block/%name%"
|
"model": "betterend:block/%name%"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,15 +1,15 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"type=bottom": {
|
"type=bottom": {
|
||||||
"model": "betterend:block/%name%_brick_half_slab"
|
"model": "betterend:block/%name%_brick_half_slab"
|
||||||
},
|
},
|
||||||
"type=double": {
|
"type=double": {
|
||||||
"model": "betterend:block/%name%_bricks"
|
"model": "betterend:block/%name%_bricks"
|
||||||
},
|
},
|
||||||
"type=top": {
|
"type=top": {
|
||||||
"model": "betterend:block/%name%_brick_half_slab",
|
"model": "betterend:block/%name%_brick_half_slab",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,209 +1,209 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"facing=east,half=bottom,shape=inner_left": {
|
"facing=east,half=bottom,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=east,half=bottom,shape=inner_right": {
|
"facing=east,half=bottom,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs"
|
"model": "betterend:block/%name%_brick_inner_stairs"
|
||||||
},
|
},
|
||||||
"facing=east,half=bottom,shape=outer_left": {
|
"facing=east,half=bottom,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=east,half=bottom,shape=outer_right": {
|
"facing=east,half=bottom,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs"
|
"model": "betterend:block/%name%_brick_outer_stairs"
|
||||||
},
|
},
|
||||||
"facing=east,half=bottom,shape=straight": {
|
"facing=east,half=bottom,shape=straight": {
|
||||||
"model": "betterend:block/%name%_brick_stairs"
|
"model": "betterend:block/%name%_brick_stairs"
|
||||||
},
|
},
|
||||||
"facing=east,half=top,shape=inner_left": {
|
"facing=east,half=top,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"facing=east,half=top,shape=inner_right": {
|
"facing=east,half=top,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=east,half=top,shape=outer_left": {
|
"facing=east,half=top,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"facing=east,half=top,shape=outer_right": {
|
"facing=east,half=top,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=east,half=top,shape=straight": {
|
"facing=east,half=top,shape=straight": {
|
||||||
"model": "betterend:block/%name%_brick_stairs",
|
"model": "betterend:block/%name%_brick_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"facing=north,half=bottom,shape=inner_left": {
|
"facing=north,half=bottom,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=north,half=bottom,shape=inner_right": {
|
"facing=north,half=bottom,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=north,half=bottom,shape=outer_left": {
|
"facing=north,half=bottom,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=north,half=bottom,shape=outer_right": {
|
"facing=north,half=bottom,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=north,half=bottom,shape=straight": {
|
"facing=north,half=bottom,shape=straight": {
|
||||||
"model": "betterend:block/%name%_brick_stairs",
|
"model": "betterend:block/%name%_brick_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=north,half=top,shape=inner_left": {
|
"facing=north,half=top,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=north,half=top,shape=inner_right": {
|
"facing=north,half=top,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"facing=north,half=top,shape=outer_left": {
|
"facing=north,half=top,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=north,half=top,shape=outer_right": {
|
"facing=north,half=top,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"facing=north,half=top,shape=straight": {
|
"facing=north,half=top,shape=straight": {
|
||||||
"model": "betterend:block/%name%_brick_stairs",
|
"model": "betterend:block/%name%_brick_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=south,half=bottom,shape=inner_left": {
|
"facing=south,half=bottom,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs"
|
"model": "betterend:block/%name%_brick_inner_stairs"
|
||||||
},
|
},
|
||||||
"facing=south,half=bottom,shape=inner_right": {
|
"facing=south,half=bottom,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=south,half=bottom,shape=outer_left": {
|
"facing=south,half=bottom,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs"
|
"model": "betterend:block/%name%_brick_outer_stairs"
|
||||||
},
|
},
|
||||||
"facing=south,half=bottom,shape=outer_right": {
|
"facing=south,half=bottom,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=south,half=bottom,shape=straight": {
|
"facing=south,half=bottom,shape=straight": {
|
||||||
"model": "betterend:block/%name%_brick_stairs",
|
"model": "betterend:block/%name%_brick_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=south,half=top,shape=inner_left": {
|
"facing=south,half=top,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=south,half=top,shape=inner_right": {
|
"facing=south,half=top,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=south,half=top,shape=outer_left": {
|
"facing=south,half=top,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=south,half=top,shape=outer_right": {
|
"facing=south,half=top,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=south,half=top,shape=straight": {
|
"facing=south,half=top,shape=straight": {
|
||||||
"model": "betterend:block/%name%_brick_stairs",
|
"model": "betterend:block/%name%_brick_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=west,half=bottom,shape=inner_left": {
|
"facing=west,half=bottom,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=west,half=bottom,shape=inner_right": {
|
"facing=west,half=bottom,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=west,half=bottom,shape=outer_left": {
|
"facing=west,half=bottom,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=west,half=bottom,shape=outer_right": {
|
"facing=west,half=bottom,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=west,half=bottom,shape=straight": {
|
"facing=west,half=bottom,shape=straight": {
|
||||||
"model": "betterend:block/%name%_brick_stairs",
|
"model": "betterend:block/%name%_brick_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=west,half=top,shape=inner_left": {
|
"facing=west,half=top,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=west,half=top,shape=inner_right": {
|
"facing=west,half=top,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=west,half=top,shape=outer_left": {
|
"facing=west,half=top,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=west,half=top,shape=outer_right": {
|
"facing=west,half=top,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=west,half=top,shape=straight": {
|
"facing=west,half=top,shape=straight": {
|
||||||
"model": "betterend:block/%name%_brick_stairs",
|
"model": "betterend:block/%name%_brick_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,90 +1,90 @@
|
||||||
{
|
{
|
||||||
"multipart": [
|
"multipart": [
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"up": "true"
|
"up": "true"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_brick_wall_post"
|
"model": "betterend:block/%name%_brick_wall_post"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"north": "low"
|
"north": "low"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_brick_wall_side",
|
"model": "betterend:block/%name%_brick_wall_side",
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"east": "low"
|
"east": "low"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_brick_wall_side",
|
"model": "betterend:block/%name%_brick_wall_side",
|
||||||
"y": 90,
|
"y": 90,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"south": "low"
|
"south": "low"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_brick_wall_side",
|
"model": "betterend:block/%name%_brick_wall_side",
|
||||||
"y": 180,
|
"y": 180,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"west": "low"
|
"west": "low"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_brick_wall_side",
|
"model": "betterend:block/%name%_brick_wall_side",
|
||||||
"y": 270,
|
"y": 270,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"north": "tall"
|
"north": "tall"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"east": "tall"
|
"east": "tall"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||||
"y": 90,
|
"y": 90,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"south": "tall"
|
"south": "tall"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||||
"y": 180,
|
"y": 180,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"west": "tall"
|
"west": "tall"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||||
"y": 270,
|
"y": 270,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"": {
|
"": {
|
||||||
"model": "betterend:block/%name%_bricks"
|
"model": "betterend:block/%name%_bricks"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,118 +1,118 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"face=ceiling,facing=east,powered=false": {
|
"face=ceiling,facing=east,powered=false": {
|
||||||
"model": "betterend:block/%name%_button",
|
"model": "betterend:block/%name%_button",
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"face=ceiling,facing=east,powered=true": {
|
"face=ceiling,facing=east,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed",
|
"model": "betterend:block/%name%_button_pressed",
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"face=ceiling,facing=north,powered=false": {
|
"face=ceiling,facing=north,powered=false": {
|
||||||
"model": "betterend:block/%name%_button",
|
"model": "betterend:block/%name%_button",
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"face=ceiling,facing=north,powered=true": {
|
"face=ceiling,facing=north,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed",
|
"model": "betterend:block/%name%_button_pressed",
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"face=ceiling,facing=south,powered=false": {
|
"face=ceiling,facing=south,powered=false": {
|
||||||
"model": "betterend:block/%name%_button",
|
"model": "betterend:block/%name%_button",
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"face=ceiling,facing=south,powered=true": {
|
"face=ceiling,facing=south,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed",
|
"model": "betterend:block/%name%_button_pressed",
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"face=ceiling,facing=west,powered=false": {
|
"face=ceiling,facing=west,powered=false": {
|
||||||
"model": "betterend:block/%name%_button",
|
"model": "betterend:block/%name%_button",
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"face=ceiling,facing=west,powered=true": {
|
"face=ceiling,facing=west,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed",
|
"model": "betterend:block/%name%_button_pressed",
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"face=floor,facing=east,powered=false": {
|
"face=floor,facing=east,powered=false": {
|
||||||
"model": "betterend:block/%name%_button",
|
"model": "betterend:block/%name%_button",
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"face=floor,facing=east,powered=true": {
|
"face=floor,facing=east,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed",
|
"model": "betterend:block/%name%_button_pressed",
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"face=floor,facing=north,powered=false": {
|
"face=floor,facing=north,powered=false": {
|
||||||
"model": "betterend:block/%name%_button"
|
"model": "betterend:block/%name%_button"
|
||||||
},
|
},
|
||||||
"face=floor,facing=north,powered=true": {
|
"face=floor,facing=north,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed"
|
"model": "betterend:block/%name%_button_pressed"
|
||||||
},
|
},
|
||||||
"face=floor,facing=south,powered=false": {
|
"face=floor,facing=south,powered=false": {
|
||||||
"model": "betterend:block/%name%_button",
|
"model": "betterend:block/%name%_button",
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"face=floor,facing=south,powered=true": {
|
"face=floor,facing=south,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed",
|
"model": "betterend:block/%name%_button_pressed",
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"face=floor,facing=west,powered=false": {
|
"face=floor,facing=west,powered=false": {
|
||||||
"model": "betterend:block/%name%_button",
|
"model": "betterend:block/%name%_button",
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"face=floor,facing=west,powered=true": {
|
"face=floor,facing=west,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed",
|
"model": "betterend:block/%name%_button_pressed",
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"face=wall,facing=east,powered=false": {
|
"face=wall,facing=east,powered=false": {
|
||||||
"model": "betterend:block/%name%_button",
|
"model": "betterend:block/%name%_button",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 90,
|
"x": 90,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"face=wall,facing=east,powered=true": {
|
"face=wall,facing=east,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed",
|
"model": "betterend:block/%name%_button_pressed",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 90,
|
"x": 90,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"face=wall,facing=north,powered=false": {
|
"face=wall,facing=north,powered=false": {
|
||||||
"model": "betterend:block/%name%_button",
|
"model": "betterend:block/%name%_button",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 90
|
"x": 90
|
||||||
},
|
},
|
||||||
"face=wall,facing=north,powered=true": {
|
"face=wall,facing=north,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed",
|
"model": "betterend:block/%name%_button_pressed",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 90
|
"x": 90
|
||||||
},
|
},
|
||||||
"face=wall,facing=south,powered=false": {
|
"face=wall,facing=south,powered=false": {
|
||||||
"model": "betterend:block/%name%_button",
|
"model": "betterend:block/%name%_button",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 90,
|
"x": 90,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"face=wall,facing=south,powered=true": {
|
"face=wall,facing=south,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed",
|
"model": "betterend:block/%name%_button_pressed",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 90,
|
"x": 90,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"face=wall,facing=west,powered=false": {
|
"face=wall,facing=west,powered=false": {
|
||||||
"model": "betterend:block/%name%_button",
|
"model": "betterend:block/%name%_button",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 90,
|
"x": 90,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"face=wall,facing=west,powered=true": {
|
"face=wall,facing=west,powered=true": {
|
||||||
"model": "betterend:block/%name%_button_pressed",
|
"model": "betterend:block/%name%_button_pressed",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 90,
|
"x": 90,
|
||||||
"y": 270
|
"y": 270
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,16 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"axis=x": { "model": "betterend:block/%name%_pillar", "x": 90, "y": 90 },
|
"axis=x": {
|
||||||
"axis=y": { "model": "betterend:block/%name%_pillar" },
|
"model": "betterend:block/%name%_pillar",
|
||||||
"axis=z": { "model": "betterend:block/%name%_pillar", "x": 90 }
|
"x": 90,
|
||||||
}
|
"y": 90
|
||||||
|
},
|
||||||
|
"axis=y": {
|
||||||
|
"model": "betterend:block/%name%_pillar"
|
||||||
|
},
|
||||||
|
"axis=z": {
|
||||||
|
"model": "betterend:block/%name%_pillar",
|
||||||
|
"x": 90
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"powered=false": {
|
"powered=false": {
|
||||||
"model": "betterend:block/%name%_pressure_plate_up"
|
"model": "betterend:block/%name%_pressure_plate_up"
|
||||||
},
|
},
|
||||||
"powered=true": {
|
"powered=true": {
|
||||||
"model": "betterend:block/%name%_pressure_plate_down"
|
"model": "betterend:block/%name%_pressure_plate_down"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,15 +1,15 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"type=bottom": {
|
"type=bottom": {
|
||||||
"model": "betterend:block/%name%_half_slab"
|
"model": "betterend:block/%name%_half_slab"
|
||||||
},
|
},
|
||||||
"type=double": {
|
"type=double": {
|
||||||
"model": "betterend:block/%name%"
|
"model": "betterend:block/%name%"
|
||||||
},
|
},
|
||||||
"type=top": {
|
"type=top": {
|
||||||
"model": "betterend:block/%name%_half_slab",
|
"model": "betterend:block/%name%_half_slab",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"": {
|
"": {
|
||||||
"model": "betterend:block/%name%_small_tiles"
|
"model": "betterend:block/%name%_small_tiles"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,209 +1,209 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"facing=east,half=bottom,shape=inner_left": {
|
"facing=east,half=bottom,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=east,half=bottom,shape=inner_right": {
|
"facing=east,half=bottom,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_inner_stairs"
|
"model": "betterend:block/%name%_inner_stairs"
|
||||||
},
|
},
|
||||||
"facing=east,half=bottom,shape=outer_left": {
|
"facing=east,half=bottom,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=east,half=bottom,shape=outer_right": {
|
"facing=east,half=bottom,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_outer_stairs"
|
"model": "betterend:block/%name%_outer_stairs"
|
||||||
},
|
},
|
||||||
"facing=east,half=bottom,shape=straight": {
|
"facing=east,half=bottom,shape=straight": {
|
||||||
"model": "betterend:block/%name%_stairs"
|
"model": "betterend:block/%name%_stairs"
|
||||||
},
|
},
|
||||||
"facing=east,half=top,shape=inner_left": {
|
"facing=east,half=top,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"facing=east,half=top,shape=inner_right": {
|
"facing=east,half=top,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=east,half=top,shape=outer_left": {
|
"facing=east,half=top,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"facing=east,half=top,shape=outer_right": {
|
"facing=east,half=top,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=east,half=top,shape=straight": {
|
"facing=east,half=top,shape=straight": {
|
||||||
"model": "betterend:block/%name%_stairs",
|
"model": "betterend:block/%name%_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"facing=north,half=bottom,shape=inner_left": {
|
"facing=north,half=bottom,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=north,half=bottom,shape=inner_right": {
|
"facing=north,half=bottom,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=north,half=bottom,shape=outer_left": {
|
"facing=north,half=bottom,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=north,half=bottom,shape=outer_right": {
|
"facing=north,half=bottom,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=north,half=bottom,shape=straight": {
|
"facing=north,half=bottom,shape=straight": {
|
||||||
"model": "betterend:block/%name%_stairs",
|
"model": "betterend:block/%name%_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=north,half=top,shape=inner_left": {
|
"facing=north,half=top,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=north,half=top,shape=inner_right": {
|
"facing=north,half=top,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"facing=north,half=top,shape=outer_left": {
|
"facing=north,half=top,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=north,half=top,shape=outer_right": {
|
"facing=north,half=top,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180
|
"x": 180
|
||||||
},
|
},
|
||||||
"facing=north,half=top,shape=straight": {
|
"facing=north,half=top,shape=straight": {
|
||||||
"model": "betterend:block/%name%_stairs",
|
"model": "betterend:block/%name%_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=south,half=bottom,shape=inner_left": {
|
"facing=south,half=bottom,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_inner_stairs"
|
"model": "betterend:block/%name%_inner_stairs"
|
||||||
},
|
},
|
||||||
"facing=south,half=bottom,shape=inner_right": {
|
"facing=south,half=bottom,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=south,half=bottom,shape=outer_left": {
|
"facing=south,half=bottom,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_outer_stairs"
|
"model": "betterend:block/%name%_outer_stairs"
|
||||||
},
|
},
|
||||||
"facing=south,half=bottom,shape=outer_right": {
|
"facing=south,half=bottom,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=south,half=bottom,shape=straight": {
|
"facing=south,half=bottom,shape=straight": {
|
||||||
"model": "betterend:block/%name%_stairs",
|
"model": "betterend:block/%name%_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=south,half=top,shape=inner_left": {
|
"facing=south,half=top,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=south,half=top,shape=inner_right": {
|
"facing=south,half=top,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=south,half=top,shape=outer_left": {
|
"facing=south,half=top,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=south,half=top,shape=outer_right": {
|
"facing=south,half=top,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=south,half=top,shape=straight": {
|
"facing=south,half=top,shape=straight": {
|
||||||
"model": "betterend:block/%name%_stairs",
|
"model": "betterend:block/%name%_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=west,half=bottom,shape=inner_left": {
|
"facing=west,half=bottom,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=west,half=bottom,shape=inner_right": {
|
"facing=west,half=bottom,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=west,half=bottom,shape=outer_left": {
|
"facing=west,half=bottom,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 90
|
"y": 90
|
||||||
},
|
},
|
||||||
"facing=west,half=bottom,shape=outer_right": {
|
"facing=west,half=bottom,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=west,half=bottom,shape=straight": {
|
"facing=west,half=bottom,shape=straight": {
|
||||||
"model": "betterend:block/%name%_stairs",
|
"model": "betterend:block/%name%_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=west,half=top,shape=inner_left": {
|
"facing=west,half=top,shape=inner_left": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=west,half=top,shape=inner_right": {
|
"facing=west,half=top,shape=inner_right": {
|
||||||
"model": "betterend:block/%name%_inner_stairs",
|
"model": "betterend:block/%name%_inner_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=west,half=top,shape=outer_left": {
|
"facing=west,half=top,shape=outer_left": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
},
|
},
|
||||||
"facing=west,half=top,shape=outer_right": {
|
"facing=west,half=top,shape=outer_right": {
|
||||||
"model": "betterend:block/%name%_outer_stairs",
|
"model": "betterend:block/%name%_outer_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 270
|
"y": 270
|
||||||
},
|
},
|
||||||
"facing=west,half=top,shape=straight": {
|
"facing=west,half=top,shape=straight": {
|
||||||
"model": "betterend:block/%name%_stairs",
|
"model": "betterend:block/%name%_stairs",
|
||||||
"uvlock": true,
|
"uvlock": true,
|
||||||
"x": 180,
|
"x": 180,
|
||||||
"y": 180
|
"y": 180
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"variants": {
|
"variants": {
|
||||||
"": {
|
"": {
|
||||||
"model": "betterend:block/%name%_tile"
|
"model": "betterend:block/%name%_tile"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,90 +1,90 @@
|
||||||
{
|
{
|
||||||
"multipart": [
|
"multipart": [
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"up": "true"
|
"up": "true"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_wall_post"
|
"model": "betterend:block/%name%_wall_post"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"north": "low"
|
"north": "low"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_wall_side",
|
"model": "betterend:block/%name%_wall_side",
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"east": "low"
|
"east": "low"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_wall_side",
|
"model": "betterend:block/%name%_wall_side",
|
||||||
"y": 90,
|
"y": 90,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"south": "low"
|
"south": "low"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_wall_side",
|
"model": "betterend:block/%name%_wall_side",
|
||||||
"y": 180,
|
"y": 180,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"west": "low"
|
"west": "low"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_wall_side",
|
"model": "betterend:block/%name%_wall_side",
|
||||||
"y": 270,
|
"y": 270,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"north": "tall"
|
"north": "tall"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_wall_side_tall",
|
"model": "betterend:block/%name%_wall_side_tall",
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"east": "tall"
|
"east": "tall"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_wall_side_tall",
|
"model": "betterend:block/%name%_wall_side_tall",
|
||||||
"y": 90,
|
"y": 90,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"south": "tall"
|
"south": "tall"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_wall_side_tall",
|
"model": "betterend:block/%name%_wall_side_tall",
|
||||||
"y": 180,
|
"y": 180,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"when": {
|
"when": {
|
||||||
"west": "tall"
|
"west": "tall"
|
||||||
},
|
},
|
||||||
"apply": {
|
"apply": {
|
||||||
"model": "betterend:block/%name%_wall_side_tall",
|
"model": "betterend:block/%name%_wall_side_tall",
|
||||||
"y": 270,
|
"y": 270,
|
||||||
"uvlock": true
|
"uvlock": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%"
|
"parent": "betterend:block/%name%"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_brick_half_slab"
|
"parent": "betterend:block/%name%_brick_half_slab"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_brick_stairs"
|
"parent": "betterend:block/%name%_brick_stairs"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_brick_wall_inventory"
|
"parent": "betterend:block/%name%_brick_wall_inventory"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_bricks"
|
"parent": "betterend:block/%name%_bricks"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_button_inventory"
|
"parent": "betterend:block/%name%_button_inventory"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_pillar"
|
"parent": "betterend:block/%name%_pillar"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_pressure_plate_up"
|
"parent": "betterend:block/%name%_pressure_plate_up"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_half_slab"
|
"parent": "betterend:block/%name%_half_slab"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_small_tiles"
|
"parent": "betterend:block/%name%_small_tiles"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_stairs"
|
"parent": "betterend:block/%name%_stairs"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_tile"
|
"parent": "betterend:block/%name%_tile"
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"parent": "betterend:block/%name%_wall_inventory"
|
"parent": "betterend:block/%name%_wall_inventory"
|
||||||
}
|
}
|
|
@ -33,7 +33,7 @@ import ru.betterend.world.surface.SurfaceBuilders;
|
||||||
public class BetterEnd implements ModInitializer {
|
public class BetterEnd implements ModInitializer {
|
||||||
public static final String MOD_ID = "betterend";
|
public static final String MOD_ID = "betterend";
|
||||||
public static final Logger LOGGER = new Logger(MOD_ID);
|
public static final Logger LOGGER = new Logger(MOD_ID);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
WorldDataAPI.registerModCache(MOD_ID);
|
WorldDataAPI.registerModCache(MOD_ID);
|
||||||
|
@ -62,15 +62,15 @@ public class BetterEnd implements ModInitializer {
|
||||||
Integrations.init();
|
Integrations.init();
|
||||||
Configs.saveConfigs();
|
Configs.saveConfigs();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResourceLocation makeID(String path) {
|
public static ResourceLocation makeID(String path) {
|
||||||
return new ResourceLocation(MOD_ID, path);
|
return new ResourceLocation(MOD_ID, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getStringId(String id) {
|
public static String getStringId(String id) {
|
||||||
return String.format("%s:%s", MOD_ID, id);
|
return String.format("%s:%s", MOD_ID, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isModId(ResourceLocation id) {
|
public static boolean isModId(ResourceLocation id) {
|
||||||
return id.getNamespace().equals(MOD_ID);
|
return id.getNamespace().equals(MOD_ID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,28 +7,28 @@ public interface BetterEndPlugin {
|
||||||
*/
|
*/
|
||||||
default void registerAlloyingRecipes() {
|
default void registerAlloyingRecipes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Smithing recipes registration.
|
* Smithing recipes registration.
|
||||||
* See AnvilSmithingRecipe.Builder for details.
|
* See AnvilSmithingRecipe.Builder for details.
|
||||||
*/
|
*/
|
||||||
default void registerSmithingRecipes() {
|
default void registerSmithingRecipes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Additional biomes registration.
|
* Additional biomes registration.
|
||||||
* See BiomeRegistry.registerBiome for details.
|
* See BiomeRegistry.registerBiome for details.
|
||||||
*/
|
*/
|
||||||
default void registerEndBiomes() {
|
default void registerEndBiomes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register other mod stuff, for example, EndHammers.
|
* Register other mod stuff, for example, EndHammers.
|
||||||
*/
|
*/
|
||||||
default void registerOthers() {
|
default void registerOthers() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void register(BetterEndPlugin plugin) {
|
public static void register(BetterEndPlugin plugin) {
|
||||||
plugin.registerAlloyingRecipes();
|
plugin.registerAlloyingRecipes();
|
||||||
plugin.registerSmithingRecipes();
|
plugin.registerSmithingRecipes();
|
||||||
|
|
|
@ -9,14 +9,14 @@ import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndItems;
|
import ru.betterend.registry.EndItems;
|
||||||
|
|
||||||
public class AeterniumAnvil extends EndAnvilBlock {
|
public class AeterniumAnvil extends EndAnvilBlock {
|
||||||
|
|
||||||
protected final Item anvilItem;
|
protected final Item anvilItem;
|
||||||
|
|
||||||
public AeterniumAnvil() {
|
public AeterniumAnvil() {
|
||||||
super(EndBlocks.AETERNIUM_BLOCK.defaultMaterialColor(), EndToolMaterial.AETERNIUM.getLevel());
|
super(EndBlocks.AETERNIUM_BLOCK.defaultMaterialColor(), EndToolMaterial.AETERNIUM.getLevel());
|
||||||
this.anvilItem = EndItems.registerEndItem("aeternuim_anvil_item", new EndAnvilItem(this));
|
this.anvilItem = EndItems.registerEndItem("aeternuim_anvil_item", new EndAnvilItem(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IntegerProperty getDurability() {
|
public IntegerProperty getDurability() {
|
||||||
if (durability == null) {
|
if (durability == null) {
|
||||||
|
@ -25,7 +25,7 @@ public class AeterniumAnvil extends EndAnvilBlock {
|
||||||
}
|
}
|
||||||
return durability;
|
return durability;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item asItem() {
|
public Item asItem() {
|
||||||
return anvilItem;
|
return anvilItem;
|
||||||
|
|
|
@ -12,15 +12,11 @@ import net.minecraft.world.level.material.MaterialColor;
|
||||||
import ru.bclib.blocks.BaseBlock;
|
import ru.bclib.blocks.BaseBlock;
|
||||||
|
|
||||||
public class AeterniumBlock extends BaseBlock {
|
public class AeterniumBlock extends BaseBlock {
|
||||||
|
|
||||||
public AeterniumBlock() {
|
public AeterniumBlock() {
|
||||||
super(FabricBlockSettings.of(Material.METAL, MaterialColor.COLOR_GRAY)
|
super(FabricBlockSettings.of(Material.METAL, MaterialColor.COLOR_GRAY).hardness(65F).resistance(1200F).requiresCorrectToolForDrops().sound(SoundType.NETHERITE_BLOCK));
|
||||||
.hardness(65F)
|
|
||||||
.resistance(1200F)
|
|
||||||
.requiresCorrectToolForDrops()
|
|
||||||
.sound(SoundType.NETHERITE_BLOCK));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public int getColor(BlockState state, BlockGetter world, BlockPos pos) {
|
public int getColor(BlockState state, BlockGetter world, BlockPos pos) {
|
||||||
return 0xFF657A7A;
|
return 0xFF657A7A;
|
||||||
|
|
|
@ -12,7 +12,7 @@ public class AmaranitaHymenophoreBlock extends BaseBlock implements IRenderTyped
|
||||||
public AmaranitaHymenophoreBlock() {
|
public AmaranitaHymenophoreBlock() {
|
||||||
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sound(SoundType.WOOD));
|
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).sound(SoundType.WOOD));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BCLRenderLayer getRenderLayer() {
|
public BCLRenderLayer getRenderLayer() {
|
||||||
return BCLRenderLayer.CUTOUT;
|
return BCLRenderLayer.CUTOUT;
|
||||||
|
|
|
@ -25,11 +25,11 @@ public class AncientEmeraldIceBlock extends BaseBlock {
|
||||||
public AncientEmeraldIceBlock() {
|
public AncientEmeraldIceBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.BLUE_ICE).randomTicks());
|
super(FabricBlockSettings.copyOf(Blocks.BLUE_ICE).randomTicks());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
||||||
Direction dir = BlocksHelper.randomDirection(random);
|
Direction dir = BlocksHelper.randomDirection(random);
|
||||||
|
|
||||||
if (random.nextBoolean()) {
|
if (random.nextBoolean()) {
|
||||||
int x = MHelper.randRange(-2, 2, random);
|
int x = MHelper.randRange(-2, 2, random);
|
||||||
int y = 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);
|
makeParticles(world, p, random);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pos = pos.relative(dir);
|
pos = pos.relative(dir);
|
||||||
state = world.getBlockState(pos);
|
state = world.getBlockState(pos);
|
||||||
if (state.is(Blocks.WATER)) {
|
if (state.is(Blocks.WATER)) {
|
||||||
|
@ -52,11 +52,11 @@ public class AncientEmeraldIceBlock extends BaseBlock {
|
||||||
makeParticles(world, pos, random);
|
makeParticles(world, pos, random);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void makeParticles(ServerLevel world, BlockPos pos, Random 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);
|
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
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
||||||
|
|
|
@ -31,19 +31,11 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp
|
||||||
public static final Vec3i[] COLORS;
|
public static final Vec3i[] COLORS;
|
||||||
private static final int MIN_DROP = 1;
|
private static final int MIN_DROP = 1;
|
||||||
private static final int MAX_DROP = 4;
|
private static final int MAX_DROP = 4;
|
||||||
|
|
||||||
public AuroraCrystalBlock() {
|
public AuroraCrystalBlock() {
|
||||||
super(FabricBlockSettings.of(Material.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));
|
||||||
.breakByTool(FabricToolTags.PICKAXES)
|
|
||||||
.breakByTool(TagAPI.HAMMERS)
|
|
||||||
.hardness(1F)
|
|
||||||
.resistance(1F)
|
|
||||||
.luminance(15)
|
|
||||||
.noOcclusion()
|
|
||||||
.isSuffocating((state, world, pos) -> false)
|
|
||||||
.sound(SoundType.GLASS));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockColor getProvider() {
|
public BlockColor getProvider() {
|
||||||
return (state, world, pos, tintIndex) -> {
|
return (state, world, pos, tintIndex) -> {
|
||||||
|
@ -51,37 +43,37 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp
|
||||||
pos = BlockPos.ZERO;
|
pos = BlockPos.ZERO;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
long i = (long) pos.getX() + (long) pos.getY() + (long) pos.getZ();
|
long i = (long) pos.getX() + (long) pos.getY() + (long) pos.getZ();
|
||||||
double delta = i * 0.1;
|
double delta = i * 0.1;
|
||||||
int index = MHelper.floor(delta);
|
int index = MHelper.floor(delta);
|
||||||
int index2 = (index + 1) & 3;
|
int index2 = (index + 1) & 3;
|
||||||
delta -= index;
|
delta -= index;
|
||||||
index &= 3;
|
index &= 3;
|
||||||
|
|
||||||
Vec3i color1 = COLORS[index];
|
Vec3i color1 = COLORS[index];
|
||||||
Vec3i color2 = COLORS[index2];
|
Vec3i color2 = COLORS[index2];
|
||||||
|
|
||||||
int r = MHelper.floor(Mth.lerp(delta, color1.getX(), color2.getX()));
|
int r = MHelper.floor(Mth.lerp(delta, color1.getX(), color2.getX()));
|
||||||
int g = MHelper.floor(Mth.lerp(delta, color1.getY(), color2.getY()));
|
int g = MHelper.floor(Mth.lerp(delta, color1.getY(), color2.getY()));
|
||||||
int b = MHelper.floor(Mth.lerp(delta, color1.getZ(), color2.getZ()));
|
int b = MHelper.floor(Mth.lerp(delta, color1.getZ(), color2.getZ()));
|
||||||
|
|
||||||
return ColorUtil.color(r, g, b);
|
return ColorUtil.color(r, g, b);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemColor getItemProvider() {
|
public ItemColor getItemProvider() {
|
||||||
return (stack, tintIndex) -> {
|
return (stack, tintIndex) -> {
|
||||||
return ColorUtil.color(COLORS[3].getX(), COLORS[3].getY(), COLORS[3].getZ());
|
return ColorUtil.color(COLORS[3].getX(), COLORS[3].getY(), COLORS[3].getZ());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BCLRenderLayer getRenderLayer() {
|
public BCLRenderLayer getRenderLayer() {
|
||||||
return BCLRenderLayer.TRANSLUCENT;
|
return BCLRenderLayer.TRANSLUCENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
ItemStack tool = builder.getParameter(LootContextParams.TOOL);
|
ItemStack tool = builder.getParameter(LootContextParams.TOOL);
|
||||||
|
@ -107,13 +99,8 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp
|
||||||
}
|
}
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
COLORS = new Vec3i[]{
|
COLORS = new Vec3i[]{new Vec3i(247, 77, 161), new Vec3i(120, 184, 255), new Vec3i(120, 255, 168), new Vec3i(243, 58, 255)};
|
||||||
new Vec3i(247, 77, 161),
|
|
||||||
new Vec3i(120, 184, 255),
|
|
||||||
new Vec3i(120, 255, 168),
|
|
||||||
new Vec3i(243, 58, 255)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,12 +10,12 @@ import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
public class BlueVineBlock extends UpDownPlantBlock {
|
public class BlueVineBlock extends UpDownPlantBlock {
|
||||||
public static final EnumProperty<BlockProperties.TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
public static final EnumProperty<BlockProperties.TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||||
stateManager.add(SHAPE);
|
stateManager.add(SHAPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
|
return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
|
||||||
|
|
|
@ -19,17 +19,17 @@ import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
public class BlueVineLanternBlock extends BaseBlock {
|
public class BlueVineLanternBlock extends BaseBlock {
|
||||||
public static final BooleanProperty NATURAL = BlockProperties.NATURAL;
|
public static final BooleanProperty NATURAL = BlockProperties.NATURAL;
|
||||||
|
|
||||||
public BlueVineLanternBlock() {
|
public BlueVineLanternBlock() {
|
||||||
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).luminance(15).sound(SoundType.WART_BLOCK));
|
super(FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES).luminance(15).sound(SoundType.WART_BLOCK));
|
||||||
this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false));
|
this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||||
return !state.getValue(NATURAL) || world.getBlockState(pos.below()).getBlock() == EndBlocks.BLUE_VINE;
|
return !state.getValue(NATURAL) || world.getBlockState(pos.below()).getBlock() == EndBlocks.BLUE_VINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||||
if (!canSurvive(state, world, pos)) {
|
if (!canSurvive(state, world, pos)) {
|
||||||
|
@ -39,7 +39,7 @@ public class BlueVineLanternBlock extends BaseBlock {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||||
stateManager.add(NATURAL);
|
stateManager.add(NATURAL);
|
||||||
|
|
|
@ -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));
|
BlocksHelper.setWithoutUpdate(world, pos.above(height), EndBlocks.BLUE_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP));
|
||||||
placeLantern(world, pos.above(height + 1));
|
placeLantern(world, pos.above(height + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void placeLantern(WorldGenLevel world, BlockPos pos) {
|
private void placeLantern(WorldGenLevel world, BlockPos pos) {
|
||||||
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true));
|
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true));
|
||||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
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));
|
BlocksHelper.setWithoutUpdate(world, pos.above(), EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.UP));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
return state.is(EndBlocks.END_MOSS) || state.is(EndBlocks.END_MYCELIUM);
|
return state.is(EndBlocks.END_MOSS) || state.is(EndBlocks.END_MYCELIUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockBehaviour.OffsetType getOffsetType() {
|
public BlockBehaviour.OffsetType getOffsetType() {
|
||||||
return BlockBehaviour.OffsetType.NONE;
|
return BlockBehaviour.OffsetType.NONE;
|
||||||
|
|
|
@ -19,36 +19,36 @@ import java.util.Random;
|
||||||
|
|
||||||
public class BoluxMushroomBlock extends EndPlantBlock {
|
public class BoluxMushroomBlock extends EndPlantBlock {
|
||||||
private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 9, 15);
|
private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 9, 15);
|
||||||
|
|
||||||
public BoluxMushroomBlock() {
|
public BoluxMushroomBlock() {
|
||||||
super(10);
|
super(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
return state.is(EndBlocks.RUTISCUS);
|
return state.is(EndBlocks.RUTISCUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||||
return SHAPE;
|
return SHAPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockBehaviour.OffsetType getOffsetType() {
|
public BlockBehaviour.OffsetType getOffsetType() {
|
||||||
return BlockBehaviour.OffsetType.NONE;
|
return BlockBehaviour.OffsetType.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) {
|
public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
return Lists.newArrayList(new ItemStack(this));
|
return Lists.newArrayList(new ItemStack(this));
|
||||||
|
|
|
@ -26,30 +26,30 @@ import java.util.Random;
|
||||||
|
|
||||||
public class BrimstoneBlock extends BaseBlock {
|
public class BrimstoneBlock extends BaseBlock {
|
||||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
||||||
|
|
||||||
public BrimstoneBlock() {
|
public BrimstoneBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.END_STONE).materialColor(MaterialColor.COLOR_BROWN).randomTicks());
|
super(FabricBlockSettings.copyOf(Blocks.END_STONE).materialColor(MaterialColor.COLOR_BROWN).randomTicks());
|
||||||
registerDefaultState(stateDefinition.any().setValue(ACTIVATED, false));
|
registerDefaultState(stateDefinition.any().setValue(ACTIVATED, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||||
stateManager.add(ACTIVATED);
|
stateManager.add(ACTIVATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {
|
public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {
|
||||||
if (world.isClientSide()) {
|
if (world.isClientSide()) {
|
||||||
updateChunks((ClientLevel) world, pos);
|
updateChunks((ClientLevel) world, pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy(LevelAccessor world, BlockPos pos, BlockState state) {
|
public void destroy(LevelAccessor world, BlockPos pos, BlockState state) {
|
||||||
if (world.isClientSide()) {
|
if (world.isClientSide()) {
|
||||||
updateChunks((ClientLevel) world, pos);
|
updateChunks((ClientLevel) world, pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateChunks(ClientLevel world, BlockPos pos) {
|
private void updateChunks(ClientLevel world, BlockPos pos) {
|
||||||
int y = pos.getY() >> 4;
|
int y = pos.getY() >> 4;
|
||||||
int x1 = (pos.getX() - 2) >> 4;
|
int x1 = (pos.getX() - 2) >> 4;
|
||||||
|
@ -62,7 +62,7 @@ public class BrimstoneBlock extends BaseBlock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
public void tick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
||||||
boolean deactivate = true;
|
boolean deactivate = true;
|
||||||
|
@ -87,10 +87,7 @@ public class BrimstoneBlock extends BaseBlock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sideState.getFluidState().getType() == Fluids.WATER) {
|
else if (sideState.getFluidState().getType() == Fluids.WATER) {
|
||||||
BlockState crystal = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState()
|
BlockState crystal = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState().setValue(SulphurCrystalBlock.FACING, dir).setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.AGE, 0);
|
||||||
.setValue(SulphurCrystalBlock.FACING, dir)
|
|
||||||
.setValue(SulphurCrystalBlock.WATERLOGGED, true)
|
|
||||||
.setValue(SulphurCrystalBlock.AGE, 0);
|
|
||||||
world.setBlockAndUpdate(side, crystal);
|
world.setBlockAndUpdate(side, crystal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,22 +20,18 @@ import ru.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class BubbleCoralBlock extends EndUnderwaterPlantBlock {
|
public class BubbleCoralBlock extends EndUnderwaterPlantBlock {
|
||||||
|
|
||||||
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16);
|
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16);
|
||||||
|
|
||||||
public BubbleCoralBlock() {
|
public BubbleCoralBlock() {
|
||||||
super(FabricBlockSettings.of(Material.WATER_PLANT)
|
super(FabricBlockSettings.of(Material.WATER_PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.CORAL_BLOCK).noCollission());
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.sound(SoundType.CORAL_BLOCK)
|
|
||||||
.noCollission());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockBehaviour.OffsetType getOffsetType() {
|
public BlockBehaviour.OffsetType getOffsetType() {
|
||||||
return BlockBehaviour.OffsetType.NONE;
|
return BlockBehaviour.OffsetType.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public void animateTick(BlockState state, Level world, BlockPos pos, Random random) {
|
public void animateTick(BlockState state, Level world, BlockPos pos, Random random) {
|
||||||
double x = pos.getX() + random.nextDouble();
|
double x = pos.getX() + random.nextDouble();
|
||||||
|
@ -43,17 +39,17 @@ public class BubbleCoralBlock extends EndUnderwaterPlantBlock {
|
||||||
double z = pos.getZ() + random.nextDouble();
|
double z = pos.getZ() + random.nextDouble();
|
||||||
world.addParticle(ParticleTypes.BUBBLE, x, y, z, 0.0D, 0.0D, 0.0D);
|
world.addParticle(ParticleTypes.BUBBLE, x, y, z, 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||||
return SHAPE;
|
return SHAPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) {
|
public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class BulbVineBlock extends BaseVineBlock {
|
||||||
public BulbVineBlock() {
|
public BulbVineBlock() {
|
||||||
super(15, true);
|
super(15, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
if (state.getValue(SHAPE) == TripleShape.BOTTOM) {
|
if (state.getValue(SHAPE) == TripleShape.BOTTOM) {
|
||||||
|
@ -32,12 +32,12 @@ public class BulbVineBlock extends BaseVineBlock {
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||||
boolean canPlace = super.canSurvive(state, world, pos);
|
boolean canPlace = super.canSurvive(state, world, pos);
|
||||||
|
|
|
@ -30,52 +30,43 @@ import java.util.Optional;
|
||||||
public class BulbVineLanternBlock extends EndLanternBlock implements IRenderTyped, BlockModelProvider {
|
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_CEIL = Block.box(4, 4, 4, 12, 16, 12);
|
||||||
private static final VoxelShape SHAPE_FLOOR = Block.box(4, 0, 4, 12, 12, 12);
|
private static final VoxelShape SHAPE_FLOOR = Block.box(4, 0, 4, 12, 12, 12);
|
||||||
|
|
||||||
public BulbVineLanternBlock() {
|
public BulbVineLanternBlock() {
|
||||||
this(FabricBlockSettings.of(Material.METAL)
|
this(FabricBlockSettings.of(Material.METAL).hardness(1).resistance(1).breakByTool(FabricToolTags.PICKAXES).materialColor(MaterialColor.COLOR_LIGHT_GRAY).luminance(15).requiresCorrectToolForDrops().sound(SoundType.LANTERN));
|
||||||
.hardness(1)
|
|
||||||
.resistance(1)
|
|
||||||
.breakByTool(FabricToolTags.PICKAXES)
|
|
||||||
.materialColor(MaterialColor.COLOR_LIGHT_GRAY)
|
|
||||||
.luminance(15)
|
|
||||||
.requiresCorrectToolForDrops()
|
|
||||||
.sound(SoundType.LANTERN));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BulbVineLanternBlock(Properties settings) {
|
public BulbVineLanternBlock(Properties settings) {
|
||||||
super(settings);
|
super(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||||
return state.getValue(IS_FLOOR) ? SHAPE_FLOOR : SHAPE_CEIL;
|
return state.getValue(IS_FLOOR) ? SHAPE_FLOOR : SHAPE_CEIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BCLRenderLayer getRenderLayer() {
|
public BCLRenderLayer getRenderLayer() {
|
||||||
return BCLRenderLayer.CUTOUT;
|
return BCLRenderLayer.CUTOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
|
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
|
||||||
Map<String, String> textures = Maps.newHashMap();
|
Map<String, String> textures = Maps.newHashMap();
|
||||||
textures.put("%glow%", getGlowTexture());
|
textures.put("%glow%", getGlowTexture());
|
||||||
textures.put("%metal%", getMetalTexture(resourceLocation));
|
textures.put("%metal%", getMetalTexture(resourceLocation));
|
||||||
Optional<String> pattern = blockState.getValue(IS_FLOOR) ?
|
Optional<String> pattern = blockState.getValue(IS_FLOOR) ? Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_FLOOR, textures) : Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures);
|
||||||
Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_FLOOR, textures) :
|
|
||||||
Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures);
|
|
||||||
return ModelsHelper.fromPattern(pattern);
|
return ModelsHelper.fromPattern(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getMetalTexture(ResourceLocation blockId) {
|
protected String getMetalTexture(ResourceLocation blockId) {
|
||||||
String name = blockId.getPath();
|
String name = blockId.getPath();
|
||||||
name = name.substring(0, name.indexOf('_'));
|
name = name.substring(0, name.indexOf('_'));
|
||||||
return name + "_bulb_vine_lantern_metal";
|
return name + "_bulb_vine_lantern_metal";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getGlowTexture() {
|
protected String getGlowTexture() {
|
||||||
return "bulb_vine_lantern_bulb";
|
return "bulb_vine_lantern_bulb";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,17 +11,17 @@ public class BulbVineLanternColoredBlock extends BulbVineLanternBlock implements
|
||||||
public BulbVineLanternColoredBlock(FabricBlockSettings settings) {
|
public BulbVineLanternColoredBlock(FabricBlockSettings settings) {
|
||||||
super(settings);
|
super(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockColor getProvider() {
|
public BlockColor getProvider() {
|
||||||
return (state, world, pos, tintIndex) -> getColor();
|
return (state, world, pos, tintIndex) -> getColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemColor getItemProvider() {
|
public ItemColor getItemProvider() {
|
||||||
return (stack, tintIndex) -> getColor();
|
return (stack, tintIndex) -> getColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getColor() {
|
private int getColor() {
|
||||||
int color = BlocksHelper.getBlockColor(this);
|
int color = BlocksHelper.getBlockColor(this);
|
||||||
int b = (color & 255);
|
int b = (color & 255);
|
||||||
|
@ -30,7 +30,7 @@ public class BulbVineLanternColoredBlock extends BulbVineLanternBlock implements
|
||||||
float[] hsv = ColorUtil.RGBtoHSB(r, g, b, new float[3]);
|
float[] hsv = ColorUtil.RGBtoHSB(r, g, b, new float[3]);
|
||||||
return ColorUtil.HSBtoRGB(hsv[0], hsv[1], hsv[1] > 0.2 ? 1 : hsv[2]);
|
return ColorUtil.HSBtoRGB(hsv[0], hsv[1], hsv[1] > 0.2 ? 1 : hsv[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getGlowTexture() {
|
protected String getGlowTexture() {
|
||||||
return "bulb_vine_lantern_overlay";
|
return "bulb_vine_lantern_overlay";
|
||||||
|
|
|
@ -15,13 +15,13 @@ import ru.betterend.registry.EndBlocks;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
|
public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||||
BlockState up = world.getBlockState(pos.above());
|
BlockState up = world.getBlockState(pos.above());
|
||||||
return up.is(TagAPI.GEN_TERRAIN) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES);
|
return up.is(TagAPI.GEN_TERRAIN) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||||
int h = BlocksHelper.downRay(world, pos, random.nextInt(24)) - 1;
|
int h = BlocksHelper.downRay(world, pos, random.nextInt(24)) - 1;
|
||||||
|
|
|
@ -26,38 +26,38 @@ public class CavePumpkinBlock extends BaseBlockNotFull implements IRenderTyped {
|
||||||
public static final BooleanProperty SMALL = BlockProperties.SMALL;
|
public static final BooleanProperty SMALL = BlockProperties.SMALL;
|
||||||
private static final VoxelShape SHAPE_SMALL;
|
private static final VoxelShape SHAPE_SMALL;
|
||||||
private static final VoxelShape SHAPE_BIG;
|
private static final VoxelShape SHAPE_BIG;
|
||||||
|
|
||||||
public CavePumpkinBlock() {
|
public CavePumpkinBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.PUMPKIN).luminance((state) -> state.getValue(SMALL) ? 10 : 15));
|
super(FabricBlockSettings.copyOf(Blocks.PUMPKIN).luminance((state) -> state.getValue(SMALL) ? 10 : 15));
|
||||||
registerDefaultState(defaultBlockState().setValue(SMALL, false));
|
registerDefaultState(defaultBlockState().setValue(SMALL, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||||
stateManager.add(SMALL);
|
stateManager.add(SMALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BCLRenderLayer getRenderLayer() {
|
public BCLRenderLayer getRenderLayer() {
|
||||||
return BCLRenderLayer.CUTOUT;
|
return BCLRenderLayer.CUTOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||||
return state.getValue(SMALL) ? SHAPE_SMALL : SHAPE_BIG;
|
return state.getValue(SMALL) ? SHAPE_SMALL : SHAPE_BIG;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
return state.getValue(SMALL) ? Collections.singletonList(new ItemStack(EndBlocks.CAVE_PUMPKIN_SEED)) : Collections.singletonList(new ItemStack(this));
|
return state.getValue(SMALL) ? Collections.singletonList(new ItemStack(EndBlocks.CAVE_PUMPKIN_SEED)) : Collections.singletonList(new ItemStack(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
VoxelShape lantern = Block.box(1, 0, 1, 15, 13, 15);
|
VoxelShape lantern = Block.box(1, 0, 1, 15, 13, 15);
|
||||||
VoxelShape cap = Block.box(0, 12, 0, 16, 15, 16);
|
VoxelShape cap = Block.box(0, 12, 0, 16, 15, 16);
|
||||||
VoxelShape top = Block.box(5, 15, 5, 11, 16, 11);
|
VoxelShape top = Block.box(5, 15, 5, 11, 16, 11);
|
||||||
SHAPE_BIG = Shapes.or(lantern, cap, top);
|
SHAPE_BIG = Shapes.or(lantern, cap, top);
|
||||||
|
|
||||||
lantern = Block.box(5, 7, 5, 11, 13, 11);
|
lantern = Block.box(5, 7, 5, 11, 13, 11);
|
||||||
cap = Block.box(4, 12, 4, 12, 15, 12);
|
cap = Block.box(4, 12, 4, 12, 15, 12);
|
||||||
top = Block.box(6, 15, 6, 10, 16, 10);
|
top = Block.box(6, 15, 6, 10, 16, 10);
|
||||||
|
|
|
@ -20,13 +20,13 @@ import java.util.Random;
|
||||||
|
|
||||||
public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
||||||
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12);
|
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||||
BlockState down = world.getBlockState(pos.above());
|
BlockState down = world.getBlockState(pos.above());
|
||||||
return isTerrain(down);
|
return isTerrain(down);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) {
|
public void performBonemeal(ServerLevel world, Random random, BlockPos pos, BlockState state) {
|
||||||
int age = state.getValue(AGE);
|
int age = state.getValue(AGE);
|
||||||
|
@ -43,11 +43,11 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
public void growAdult(WorldGenLevel world, Random random, BlockPos pos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||||
state = super.updateShape(state, facing, neighborState, world, pos, neighborPos);
|
state = super.updateShape(state, facing, neighborState, world, pos, neighborPos);
|
||||||
|
@ -59,12 +59,12 @@ public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||||
return SHAPE;
|
return SHAPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockBehaviour.OffsetType getOffsetType() {
|
public BlockBehaviour.OffsetType getOffsetType() {
|
||||||
return BlockBehaviour.OffsetType.NONE;
|
return BlockBehaviour.OffsetType.NONE;
|
||||||
|
|
|
@ -30,27 +30,27 @@ import java.util.Optional;
|
||||||
|
|
||||||
public class ChandelierBlock extends BaseAttachedBlock implements IRenderTyped, BlockModelProvider {
|
public class ChandelierBlock extends BaseAttachedBlock implements IRenderTyped, BlockModelProvider {
|
||||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||||
|
|
||||||
public ChandelierBlock(Block source) {
|
public ChandelierBlock(Block source) {
|
||||||
super(FabricBlockSettings.copyOf(source).luminance(15).noCollission().noOcclusion().requiresCorrectToolForDrops());
|
super(FabricBlockSettings.copyOf(source).luminance(15).noCollission().noOcclusion().requiresCorrectToolForDrops());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BCLRenderLayer getRenderLayer() {
|
public BCLRenderLayer getRenderLayer() {
|
||||||
return BCLRenderLayer.CUTOUT;
|
return BCLRenderLayer.CUTOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||||
return BOUNDING_SHAPES.get(state.getValue(FACING));
|
return BOUNDING_SHAPES.get(state.getValue(FACING));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public BlockModel getItemModel(ResourceLocation blockId) {
|
public BlockModel getItemModel(ResourceLocation blockId) {
|
||||||
return ModelsHelper.createItemModel(blockId);
|
return ModelsHelper.createItemModel(blockId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
|
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
|
||||||
|
@ -67,7 +67,7 @@ public class ChandelierBlock extends BaseAttachedBlock implements IRenderTyped,
|
||||||
}
|
}
|
||||||
return ModelsHelper.fromPattern(pattern);
|
return ModelsHelper.fromPattern(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> modelCache) {
|
||||||
|
@ -96,7 +96,7 @@ public class ChandelierBlock extends BaseAttachedBlock implements IRenderTyped,
|
||||||
registerBlockModel(stateId, modelId, blockState, modelCache);
|
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||||
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
|
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
BOUNDING_SHAPES.put(Direction.UP, Block.box(5, 0, 5, 11, 13, 11));
|
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));
|
BOUNDING_SHAPES.put(Direction.DOWN, Block.box(5, 3, 5, 11, 16, 11));
|
||||||
|
|
|
@ -8,7 +8,7 @@ import net.minecraft.world.level.material.Fluids;
|
||||||
import ru.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
import ru.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||||
|
|
||||||
public class CharniaBlock extends EndUnderwaterPlantBlock {
|
public class CharniaBlock extends EndUnderwaterPlantBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||||
return canSupportCenter(world, pos.below(), Direction.UP) && world.getFluidState(pos).getType() == Fluids.WATER;
|
return canSupportCenter(world, pos.below(), Direction.UP) && world.getFluidState(pos).getType() == Fluids.WATER;
|
||||||
|
|
|
@ -8,7 +8,7 @@ public class ChorusGrassBlock extends EndPlantBlock {
|
||||||
public ChorusGrassBlock() {
|
public ChorusGrassBlock() {
|
||||||
super(true);
|
super(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
return state.getBlock() == EndBlocks.CHORUS_NYLIUM;
|
return state.getBlock() == EndBlocks.CHORUS_NYLIUM;
|
||||||
|
|
|
@ -19,12 +19,12 @@ public class DenseEmeraldIceBlock extends BaseBlock implements IRenderTyped {
|
||||||
public DenseEmeraldIceBlock() {
|
public DenseEmeraldIceBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.PACKED_ICE));
|
super(FabricBlockSettings.copyOf(Blocks.PACKED_ICE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BCLRenderLayer getRenderLayer() {
|
public BCLRenderLayer getRenderLayer() {
|
||||||
return BCLRenderLayer.TRANSLUCENT;
|
return BCLRenderLayer.TRANSLUCENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
||||||
|
|
|
@ -2,24 +2,31 @@ package ru.betterend.blocks;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.LevelReader;
|
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.block.state.BlockState;
|
||||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||||
import ru.bclib.blocks.FeatureSaplingBlock;
|
import ru.bclib.blocks.FeatureSaplingBlock;
|
||||||
|
import ru.betterend.blocks.basis.PottableFeatureSapling;
|
||||||
import ru.betterend.registry.EndBlocks;
|
import ru.betterend.registry.EndBlocks;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
|
|
||||||
public class DragonTreeSaplingBlock extends FeatureSaplingBlock {
|
public class DragonTreeSaplingBlock extends PottableFeatureSapling {
|
||||||
public DragonTreeSaplingBlock() {
|
public DragonTreeSaplingBlock() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Feature<?> getFeature() {
|
protected Feature<?> getFeature() {
|
||||||
return EndFeatures.DRAGON_TREE.getFeature();
|
return EndFeatures.DRAGON_TREE.getFeature();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||||
return world.getBlockState(pos.below()).is(EndBlocks.SHADOW_GRASS);
|
return world.getBlockState(pos.below()).is(EndBlocks.SHADOW_GRASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlantOn(Block block) {
|
||||||
|
return block == EndBlocks.SHADOW_GRASS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,12 +33,12 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderType
|
||||||
public EmeraldIceBlock() {
|
public EmeraldIceBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.ICE));
|
super(FabricBlockSettings.copyOf(Blocks.ICE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BCLRenderLayer getRenderLayer() {
|
public BCLRenderLayer getRenderLayer() {
|
||||||
return BCLRenderLayer.TRANSLUCENT;
|
return BCLRenderLayer.TRANSLUCENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) {
|
public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) {
|
||||||
super.playerDestroy(world, player, pos, state, blockEntity, stack);
|
super.playerDestroy(world, player, pos, state, blockEntity, stack);
|
||||||
|
@ -47,23 +47,23 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderType
|
||||||
world.removeBlock(pos, false);
|
world.removeBlock(pos, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Material material = world.getBlockState(pos.below()).getMaterial();
|
Material material = world.getBlockState(pos.below()).getMaterial();
|
||||||
if (material.blocksMotion() || material.isLiquid()) {
|
if (material.blocksMotion() || material.isLiquid()) {
|
||||||
world.setBlockAndUpdate(pos, Blocks.WATER.defaultBlockState());
|
world.setBlockAndUpdate(pos, Blocks.WATER.defaultBlockState());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
||||||
if (world.getBrightness(LightLayer.BLOCK, pos) > 11 - state.getLightBlock(world, pos)) {
|
if (world.getBrightness(LightLayer.BLOCK, pos) > 11 - state.getLightBlock(world, pos)) {
|
||||||
this.melt(state, world, pos);
|
this.melt(state, world, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void melt(BlockState state, Level world, BlockPos pos) {
|
protected void melt(BlockState state, Level world, BlockPos pos) {
|
||||||
if (world.dimensionType().ultraWarm()) {
|
if (world.dimensionType().ultraWarm()) {
|
||||||
world.removeBlock(pos, false);
|
world.removeBlock(pos, false);
|
||||||
|
@ -73,7 +73,7 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderType
|
||||||
world.neighborChanged(pos, Blocks.WATER, pos);
|
world.neighborChanged(pos, Blocks.WATER, pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
||||||
|
@ -84,7 +84,7 @@ public class EmeraldIceBlock extends HalfTransparentBlock implements IRenderType
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public BlockModel getItemModel(ResourceLocation resourceLocation) {
|
public BlockModel getItemModel(ResourceLocation resourceLocation) {
|
||||||
|
|
|
@ -11,114 +11,98 @@ public class EndBlockProperties extends BlockProperties {
|
||||||
public static final EnumProperty<HydraluxShape> HYDRALUX_SHAPE = EnumProperty.create("shape", HydraluxShape.class);
|
public static final EnumProperty<HydraluxShape> HYDRALUX_SHAPE = EnumProperty.create("shape", HydraluxShape.class);
|
||||||
public static final EnumProperty<PedestalState> PEDESTAL_STATE = EnumProperty.create("state", PedestalState.class);
|
public static final EnumProperty<PedestalState> PEDESTAL_STATE = EnumProperty.create("state", PedestalState.class);
|
||||||
public static final EnumProperty<CactusBottom> CACTUS_BOTTOM = EnumProperty.create("bottom", CactusBottom.class);
|
public static final EnumProperty<CactusBottom> 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 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 BooleanProperty HAS_ITEM = BooleanProperty.create("has_item");
|
||||||
|
|
||||||
public enum PedestalState implements StringRepresentable {
|
public enum PedestalState implements StringRepresentable {
|
||||||
PEDESTAL_TOP("pedestal_top"),
|
PEDESTAL_TOP("pedestal_top"), COLUMN_TOP("column_top"), BOTTOM("bottom"), PILLAR("pillar"), COLUMN("column"), DEFAULT("default");
|
||||||
COLUMN_TOP("column_top"),
|
|
||||||
BOTTOM("bottom"),
|
|
||||||
PILLAR("pillar"),
|
|
||||||
COLUMN("column"),
|
|
||||||
DEFAULT("default");
|
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
PedestalState(String name) {
|
PedestalState(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSerializedName() {
|
public String getSerializedName() {
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum HydraluxShape implements StringRepresentable {
|
public enum HydraluxShape implements StringRepresentable {
|
||||||
FLOWER_BIG_BOTTOM("flower_big_bottom", true),
|
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_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 String name;
|
||||||
private final boolean glow;
|
private final boolean glow;
|
||||||
|
|
||||||
HydraluxShape(String name, boolean glow) {
|
HydraluxShape(String name, boolean glow) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.glow = glow;
|
this.glow = glow;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSerializedName() {
|
public String getSerializedName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasGlow() {
|
public boolean hasGlow() {
|
||||||
return glow;
|
return glow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum LumecornShape implements StringRepresentable {
|
public enum LumecornShape implements StringRepresentable {
|
||||||
LIGHT_TOP("light_top", 15),
|
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_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 String name;
|
||||||
private final int light;
|
private final int light;
|
||||||
|
|
||||||
LumecornShape(String name, int light) {
|
LumecornShape(String name, int light) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.light = light;
|
this.light = light;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSerializedName() {
|
public String getSerializedName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLight() {
|
public int getLight() {
|
||||||
return light;
|
return light;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CactusBottom implements StringRepresentable {
|
public enum CactusBottom implements StringRepresentable {
|
||||||
EMPTY("empty"),
|
EMPTY("empty"), SAND("sand"), MOSS("moss");
|
||||||
SAND("sand"),
|
|
||||||
MOSS("moss");
|
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
CactusBottom(String name) {
|
CactusBottom(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSerializedName() {
|
public String getSerializedName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name;
|
return name;
|
||||||
|
|
|
@ -40,16 +40,11 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock {
|
||||||
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||||
private static final VoxelShape SHAPE_BOTTOM = Block.box(4, 0, 4, 12, 16, 12);
|
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);
|
private static final VoxelShape SHAPE_TOP = Block.box(2, 0, 2, 14, 6, 14);
|
||||||
|
|
||||||
public EndLilyBlock() {
|
public EndLilyBlock() {
|
||||||
super(FabricBlockSettings.of(Material.WATER_PLANT)
|
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());
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.sound(SoundType.WET_GRASS)
|
|
||||||
.lightLevel((state) -> state.getValue(SHAPE) == TripleShape.TOP ? 13 : 0)
|
|
||||||
.noCollission());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||||
if (!canSurvive(state, world, pos)) {
|
if (!canSurvive(state, world, pos)) {
|
||||||
|
@ -59,24 +54,24 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||||
Vec3 vec3d = state.getOffset(view, pos);
|
Vec3 vec3d = state.getOffset(view, pos);
|
||||||
VoxelShape shape = state.getValue(SHAPE) == TripleShape.TOP ? SHAPE_TOP : SHAPE_BOTTOM;
|
VoxelShape shape = state.getValue(SHAPE) == TripleShape.TOP ? SHAPE_TOP : SHAPE_BOTTOM;
|
||||||
return shape.move(vec3d.x, vec3d.y, vec3d.z);
|
return shape.move(vec3d.x, vec3d.y, vec3d.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||||
stateManager.add(SHAPE);
|
stateManager.add(SHAPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidState getFluidState(BlockState state) {
|
public FluidState getFluidState(BlockState state) {
|
||||||
return state.getValue(SHAPE) == TripleShape.TOP ? Fluids.EMPTY.defaultFluidState() : Fluids.WATER.getSource(false);
|
return state.getValue(SHAPE) == TripleShape.TOP ? Fluids.EMPTY.defaultFluidState() : Fluids.WATER.getSource(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||||
if (state.getValue(SHAPE) == TripleShape.TOP) {
|
if (state.getValue(SHAPE) == TripleShape.TOP) {
|
||||||
|
@ -91,7 +86,7 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock {
|
||||||
return up.getBlock() == this && down.getBlock() == this;
|
return up.getBlock() == this && down.getBlock() == this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
if (state.getValue(SHAPE) == TripleShape.TOP) {
|
if (state.getValue(SHAPE) == TripleShape.TOP) {
|
||||||
|
@ -99,18 +94,18 @@ public class EndLilyBlock extends EndUnderwaterPlantBlock {
|
||||||
}
|
}
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
|
public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
|
||||||
return new ItemStack(EndBlocks.END_LILY_SEED);
|
return new ItemStack(EndBlocks.END_LILY_SEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) {
|
public boolean isBonemealSuccess(Level world, Random random, BlockPos pos, BlockState state) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
BlocksHelper.setWithoutUpdate(world, up, EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.TOP));
|
BlocksHelper.setWithoutUpdate(world, up, EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.TOP));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean canGrow(WorldGenLevel world, BlockPos pos) {
|
private boolean canGrow(WorldGenLevel world, BlockPos pos) {
|
||||||
BlockPos up = pos.above();
|
BlockPos up = pos.above();
|
||||||
while (world.getBlockState(up).getFluidState().getType().equals(Fluids.WATER.getSource())) {
|
while (world.getBlockState(up).getFluidState().getType().equals(Fluids.WATER.getSource())) {
|
||||||
|
@ -33,7 +33,7 @@ public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
}
|
}
|
||||||
return world.isEmptyBlock(up);
|
return world.isEmptyBlock(up);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
return state.is(TagAPI.END_GROUND);
|
return state.is(TagAPI.END_GROUND);
|
||||||
|
|
|
@ -23,37 +23,37 @@ import java.util.List;
|
||||||
public class EndLotusFlowerBlock extends EndPlantBlock {
|
public class EndLotusFlowerBlock extends EndPlantBlock {
|
||||||
private static final VoxelShape SHAPE_OUTLINE = Block.box(2, 0, 2, 14, 14, 14);
|
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);
|
private static final VoxelShape SHAPE_COLLISION = Block.box(0, 0, 0, 16, 2, 16);
|
||||||
|
|
||||||
public EndLotusFlowerBlock() {
|
public EndLotusFlowerBlock() {
|
||||||
super(FabricBlockSettings.of(Material.PLANT).luminance(15).noOcclusion());
|
super(FabricBlockSettings.of(Material.PLANT).luminance(15).noOcclusion());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
return state.is(EndBlocks.END_LOTUS_STEM);
|
return state.is(EndBlocks.END_LOTUS_STEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockBehaviour.OffsetType getOffsetType() {
|
public BlockBehaviour.OffsetType getOffsetType() {
|
||||||
return BlockBehaviour.OffsetType.NONE;
|
return BlockBehaviour.OffsetType.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||||
return SHAPE_OUTLINE;
|
return SHAPE_OUTLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getCollisionShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
public VoxelShape getCollisionShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||||
return SHAPE_COLLISION;
|
return SHAPE_COLLISION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
int count = MHelper.randRange(1, 2, MHelper.RANDOM);
|
int count = MHelper.randRange(1, 2, MHelper.RANDOM);
|
||||||
return Lists.newArrayList(new ItemStack(EndBlocks.END_LOTUS_SEED, count));
|
return Lists.newArrayList(new ItemStack(EndBlocks.END_LOTUS_SEED, count));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
|
public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
|
||||||
|
|
|
@ -32,42 +32,42 @@ public class EndLotusLeafBlock extends BaseBlockNotFull implements IRenderTyped
|
||||||
public static final EnumProperty<Direction> HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING;
|
public static final EnumProperty<Direction> HORIZONTAL_FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||||
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||||
private static final VoxelShape VSHAPE = Block.box(0, 0, 0, 16, 1, 16);
|
private static final VoxelShape VSHAPE = Block.box(0, 0, 0, 16, 1, 16);
|
||||||
|
|
||||||
public EndLotusLeafBlock() {
|
public EndLotusLeafBlock() {
|
||||||
super(FabricBlockSettings.of(Material.PLANT).noOcclusion().sound(SoundType.WET_GRASS));
|
super(FabricBlockSettings.of(Material.PLANT).noOcclusion().sound(SoundType.WET_GRASS));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||||
BlockState down = world.getBlockState(pos.below());
|
BlockState down = world.getBlockState(pos.below());
|
||||||
return !down.getFluidState().isEmpty() && down.getFluidState().getType() instanceof WaterFluid;
|
return !down.getFluidState().isEmpty() && down.getFluidState().getType() instanceof WaterFluid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||||
builder.add(SHAPE, HORIZONTAL_FACING);
|
builder.add(SHAPE, HORIZONTAL_FACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||||
return VSHAPE;
|
return VSHAPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState rotate(BlockState state, Rotation rotation) {
|
public BlockState rotate(BlockState state, Rotation rotation) {
|
||||||
return BlocksHelper.rotateHorizontal(state, rotation, HORIZONTAL_FACING);
|
return BlocksHelper.rotateHorizontal(state, rotation, HORIZONTAL_FACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState mirror(BlockState state, Mirror mirror) {
|
public BlockState mirror(BlockState state, Mirror mirror) {
|
||||||
return BlocksHelper.mirrorHorizontal(state, mirror, HORIZONTAL_FACING);
|
return BlocksHelper.mirrorHorizontal(state, mirror, HORIZONTAL_FACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BCLRenderLayer getRenderLayer() {
|
public BCLRenderLayer getRenderLayer() {
|
||||||
return BCLRenderLayer.CUTOUT;
|
return BCLRenderLayer.CUTOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
|
public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
|
||||||
|
|
|
@ -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 roots = EndBlocks.END_LOTUS_STEM.defaultBlockState().setValue(EndLotusStemBlock.SHAPE, TripleShape.BOTTOM).setValue(EndLotusStemBlock.WATERLOGGED, true);
|
||||||
BlockState stem = EndBlocks.END_LOTUS_STEM.defaultBlockState();
|
BlockState stem = EndBlocks.END_LOTUS_STEM.defaultBlockState();
|
||||||
BlockState flower = EndBlocks.END_LOTUS_FLOWER.defaultBlockState();
|
BlockState flower = EndBlocks.END_LOTUS_FLOWER.defaultBlockState();
|
||||||
|
|
||||||
BlocksHelper.setWithoutUpdate(world, pos, roots);
|
BlocksHelper.setWithoutUpdate(world, pos, roots);
|
||||||
MutableBlockPos bpos = new MutableBlockPos().set(pos);
|
MutableBlockPos bpos = new MutableBlockPos().set(pos);
|
||||||
bpos.setY(bpos.getY() + 1);
|
bpos.setY(bpos.getY() + 1);
|
||||||
|
@ -30,7 +30,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.WATERLOGGED, true));
|
BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.WATERLOGGED, true));
|
||||||
bpos.setY(bpos.getY() + 1);
|
bpos.setY(bpos.getY() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int height = random.nextBoolean() ? 0 : random.nextBoolean() ? 1 : random.nextBoolean() ? 1 : -1;
|
int height = random.nextBoolean() ? 0 : random.nextBoolean() ? 1 : random.nextBoolean() ? 1 : -1;
|
||||||
TripleShape shape = (height == 0) ? TripleShape.TOP : TripleShape.MIDDLE;
|
TripleShape shape = (height == 0) ? TripleShape.TOP : TripleShape.MIDDLE;
|
||||||
Direction dir = BlocksHelper.randomHorizontal(random);
|
Direction dir = BlocksHelper.randomHorizontal(random);
|
||||||
|
@ -42,7 +42,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
else {
|
else {
|
||||||
BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.SHAPE, shape));
|
BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.SHAPE, shape));
|
||||||
}
|
}
|
||||||
|
|
||||||
bpos.setY(bpos.getY() + 1);
|
bpos.setY(bpos.getY() + 1);
|
||||||
for (int i = 1; i <= height; i++) {
|
for (int i = 1; i <= height; i++) {
|
||||||
if (!world.isEmptyBlock(bpos)) {
|
if (!world.isEmptyBlock(bpos)) {
|
||||||
|
@ -56,11 +56,11 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
BlocksHelper.setWithoutUpdate(world, bpos, stem);
|
BlocksHelper.setWithoutUpdate(world, bpos, stem);
|
||||||
bpos.setY(bpos.getY() + 1);
|
bpos.setY(bpos.getY() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!world.isEmptyBlock(bpos) || height < 0) {
|
if (!world.isEmptyBlock(bpos) || height < 0) {
|
||||||
bpos.setY(bpos.getY() - 1);
|
bpos.setY(bpos.getY() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
BlocksHelper.setWithoutUpdate(world, bpos, flower);
|
BlocksHelper.setWithoutUpdate(world, bpos, flower);
|
||||||
bpos.setY(bpos.getY() - 1);
|
bpos.setY(bpos.getY() - 1);
|
||||||
stem = world.getBlockState(bpos);
|
stem = world.getBlockState(bpos);
|
||||||
|
@ -70,15 +70,15 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
stem = stem.setValue(EndLotusStemBlock.WATERLOGGED, true);
|
stem = stem.setValue(EndLotusStemBlock.WATERLOGGED, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world.getBlockState(bpos.relative(dir)).is(EndBlocks.END_LOTUS_LEAF)) {
|
if (world.getBlockState(bpos.relative(dir)).is(EndBlocks.END_LOTUS_LEAF)) {
|
||||||
stem = stem.setValue(EndLotusStemBlock.LEAF, true).setValue(EndLotusStemBlock.FACING, dir);
|
stem = stem.setValue(EndLotusStemBlock.LEAF, true).setValue(EndLotusStemBlock.FACING, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.SHAPE, TripleShape.TOP));
|
BlocksHelper.setWithoutUpdate(world, bpos, stem.setValue(EndLotusStemBlock.SHAPE, TripleShape.TOP));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean canGrow(WorldGenLevel world, BlockPos pos) {
|
private boolean canGrow(WorldGenLevel world, BlockPos pos) {
|
||||||
MutableBlockPos bpos = new MutableBlockPos();
|
MutableBlockPos bpos = new MutableBlockPos();
|
||||||
bpos.set(pos);
|
bpos.set(pos);
|
||||||
|
@ -87,7 +87,7 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
}
|
}
|
||||||
return world.isEmptyBlock(bpos) && world.isEmptyBlock(bpos.above());
|
return world.isEmptyBlock(bpos) && world.isEmptyBlock(bpos.above());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateLeaf(WorldGenLevel world, BlockPos pos) {
|
private void generateLeaf(WorldGenLevel world, BlockPos pos) {
|
||||||
MutableBlockPos p = new MutableBlockPos();
|
MutableBlockPos p = new MutableBlockPos();
|
||||||
BlockState leaf = EndBlocks.END_LOTUS_LEAF.defaultBlockState();
|
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));
|
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) {
|
private boolean hasLeaf(WorldGenLevel world, BlockPos pos) {
|
||||||
MutableBlockPos p = new MutableBlockPos();
|
MutableBlockPos p = new MutableBlockPos();
|
||||||
p.setY(pos.getY());
|
p.setY(pos.getY());
|
||||||
|
@ -110,13 +110,12 @@ public class EndLotusSeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||||
p.setX(pos.getX() + x);
|
p.setX(pos.getX() + x);
|
||||||
for (int z = -1; z < 2; z++) {
|
for (int z = -1; z < 2; z++) {
|
||||||
p.setZ(pos.getZ() + z);
|
p.setZ(pos.getZ() + z);
|
||||||
if (world.isEmptyBlock(p) && !world.getFluidState(p.below()).isEmpty())
|
if (world.isEmptyBlock(p) && !world.getFluidState(p.below()).isEmpty()) count++;
|
||||||
count++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return count == 9;
|
return count == 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
return state.is(TagAPI.END_GROUND);
|
return state.is(TagAPI.END_GROUND);
|
||||||
|
|
|
@ -37,44 +37,44 @@ public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlo
|
||||||
public static final BooleanProperty LEAF = BooleanProperty.create("leaf");
|
public static final BooleanProperty LEAF = BooleanProperty.create("leaf");
|
||||||
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||||
private static final Map<Axis, VoxelShape> SHAPES = Maps.newEnumMap(Axis.class);
|
private static final Map<Axis, VoxelShape> SHAPES = Maps.newEnumMap(Axis.class);
|
||||||
|
|
||||||
public EndLotusStemBlock() {
|
public EndLotusStemBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS));
|
super(FabricBlockSettings.copyOf(Blocks.OAK_PLANKS));
|
||||||
this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false).setValue(SHAPE, TripleShape.MIDDLE).setValue(LEAF, false).setValue(FACING, Direction.UP));
|
this.registerDefaultState(defaultBlockState().setValue(WATERLOGGED, false).setValue(SHAPE, TripleShape.MIDDLE).setValue(LEAF, false).setValue(FACING, Direction.UP));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
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());
|
return state.getValue(LEAF) ? SHAPES.get(Axis.Y) : SHAPES.get(state.getValue(FACING).getAxis());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||||
builder.add(FACING, WATERLOGGED, SHAPE, LEAF);
|
builder.add(FACING, WATERLOGGED, SHAPE, LEAF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidState getFluidState(BlockState state) {
|
public FluidState getFluidState(BlockState state) {
|
||||||
return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state);
|
return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||||
LevelAccessor worldAccess = ctx.getLevel();
|
LevelAccessor worldAccess = ctx.getLevel();
|
||||||
BlockPos blockPos = ctx.getClickedPos();
|
BlockPos blockPos = ctx.getClickedPos();
|
||||||
return this.defaultBlockState().setValue(WATERLOGGED, worldAccess.getFluidState(blockPos).getType() == Fluids.WATER).setValue(FACING, ctx.getClickedFace());
|
return this.defaultBlockState().setValue(WATERLOGGED, worldAccess.getFluidState(blockPos).getType() == Fluids.WATER).setValue(FACING, ctx.getClickedFace());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState rotate(BlockState state, Rotation rotation) {
|
public BlockState rotate(BlockState state, Rotation rotation) {
|
||||||
return BlocksHelper.rotateHorizontal(state, rotation, FACING);
|
return BlocksHelper.rotateHorizontal(state, rotation, FACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState mirror(BlockState state, Mirror mirror) {
|
public BlockState mirror(BlockState state, Mirror mirror) {
|
||||||
return BlocksHelper.mirrorHorizontal(state, mirror, FACING);
|
return BlocksHelper.mirrorHorizontal(state, mirror, FACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
||||||
if (state.getValue(WATERLOGGED)) {
|
if (state.getValue(WATERLOGGED)) {
|
||||||
|
@ -82,12 +82,12 @@ public class EndLotusStemBlock extends BaseBlock implements SimpleWaterloggedBlo
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BCLRenderLayer getRenderLayer() {
|
public BCLRenderLayer getRenderLayer() {
|
||||||
return BCLRenderLayer.CUTOUT;
|
return BCLRenderLayer.CUTOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
SHAPES.put(Axis.X, Block.box(0, 6, 6, 16, 10, 10));
|
SHAPES.put(Axis.X, Block.box(0, 6, 6, 16, 10, 10));
|
||||||
SHAPES.put(Axis.Y, Block.box(6, 0, 6, 10, 16, 10));
|
SHAPES.put(Axis.Y, Block.box(6, 0, 6, 10, 16, 10));
|
||||||
|
|
|
@ -10,18 +10,18 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class EndPedestal extends PedestalBlock {
|
public class EndPedestal extends PedestalBlock {
|
||||||
|
|
||||||
public EndPedestal(Block parent) {
|
public EndPedestal(Block parent) {
|
||||||
super(parent);
|
super(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Map<String, String> createTexturesMap() {
|
protected Map<String, String> createTexturesMap() {
|
||||||
ResourceLocation blockId = Registry.BLOCK.getKey(parent);
|
ResourceLocation blockId = Registry.BLOCK.getKey(parent);
|
||||||
String name = blockId.getPath();
|
String name = blockId.getPath();
|
||||||
return new HashMap<String, String>() {
|
return new HashMap<String, String>() {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
{
|
{
|
||||||
put("%mod%", BetterEnd.MOD_ID);
|
put("%mod%", BetterEnd.MOD_ID);
|
||||||
put("%top%", name + "_polished");
|
put("%top%", name + "_polished");
|
||||||
|
|
|
@ -42,24 +42,24 @@ import java.util.Random;
|
||||||
|
|
||||||
public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, IColorProvider {
|
public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, IColorProvider {
|
||||||
public static final IntegerProperty PORTAL = EndBlockProperties.PORTAL;
|
public static final IntegerProperty PORTAL = EndBlockProperties.PORTAL;
|
||||||
|
|
||||||
public EndPortalBlock() {
|
public EndPortalBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.NETHER_PORTAL).resistance(Blocks.BEDROCK.getExplosionResistance()).luminance(15));
|
super(FabricBlockSettings.copyOf(Blocks.NETHER_PORTAL).resistance(Blocks.BEDROCK.getExplosionResistance()).luminance(15));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||||
super.createBlockStateDefinition(builder);
|
super.createBlockStateDefinition(builder);
|
||||||
builder.add(PORTAL);
|
builder.add(PORTAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public void animateTick(BlockState state, Level world, BlockPos pos, Random random) {
|
public void animateTick(BlockState state, Level world, BlockPos pos, Random random) {
|
||||||
if (random.nextInt(100) == 0) {
|
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);
|
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 x = pos.getX() + random.nextDouble();
|
||||||
double y = pos.getY() + random.nextDouble();
|
double y = pos.getY() + random.nextDouble();
|
||||||
double z = pos.getZ() + random.nextDouble();
|
double z = pos.getZ() + random.nextDouble();
|
||||||
|
@ -70,19 +70,19 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
else {
|
else {
|
||||||
z = pos.getZ() + 0.5D + 0.25D * k;
|
z = pos.getZ() + 0.5D + 0.25D * k;
|
||||||
}
|
}
|
||||||
|
|
||||||
world.addParticle(EndParticles.PORTAL_SPHERE, x, y, z, 0, 0, 0);
|
world.addParticle(EndParticles.PORTAL_SPHERE, x, y, z, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, Random random) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
public void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
||||||
if (world.isClientSide || !validate(entity)) return;
|
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);
|
BlockPos exitPos = findExitPos(currentWorld, destination, pos, entity);
|
||||||
if (exitPos == null) return;
|
if (exitPos == null) return;
|
||||||
if (entity instanceof ServerPlayer && ((ServerPlayer) entity).isCreative()) {
|
if (entity instanceof ServerPlayer && ((ServerPlayer) entity).isCreative()) {
|
||||||
((ServerPlayer) entity).teleportTo(destination, exitPos.getX() + 0.5, exitPos.getY(),
|
((ServerPlayer) entity).teleportTo(destination, exitPos.getX() + 0.5, exitPos.getY(), exitPos.getZ() + 0.5, entity.getYRot(), entity.getXRot());
|
||||||
exitPos.getZ() + 0.5, entity.getYRot(), entity.getXRot());
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
((TeleportingEntity) entity).be_setExitPos(exitPos);
|
((TeleportingEntity) entity).be_setExitPos(exitPos);
|
||||||
|
@ -104,17 +103,16 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
teleported.ifPresent(Entity::setPortalCooldown);
|
teleported.ifPresent(Entity::setPortalCooldown);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean validate(Entity entity) {
|
private boolean validate(Entity entity) {
|
||||||
return !entity.isPassenger() && !entity.isVehicle() &&
|
return !entity.isPassenger() && !entity.isVehicle() && entity.canChangeDimensions() && !entity.isOnPortalCooldown();
|
||||||
entity.canChangeDimensions() && !entity.isOnPortalCooldown();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BCLRenderLayer getRenderLayer() {
|
public BCLRenderLayer getRenderLayer() {
|
||||||
return BCLRenderLayer.TRANSLUCENT;
|
return BCLRenderLayer.TRANSLUCENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
private BlockPos findExitPos(ServerLevel currentWorld, ServerLevel targetWorld, BlockPos currentPos, Entity entity) {
|
private BlockPos findExitPos(ServerLevel currentWorld, ServerLevel targetWorld, BlockPos currentPos, Entity entity) {
|
||||||
if (targetWorld == null) return null;
|
if (targetWorld == null) return null;
|
||||||
Registry<DimensionType> registry = targetWorld.registryAccess().registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY);
|
Registry<DimensionType> registry = targetWorld.registryAccess().registryOrThrow(Registry.DIMENSION_TYPE_REGISTRY);
|
||||||
|
@ -127,8 +125,7 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
MutableBlockPos checkPos = basePos.mutable();
|
MutableBlockPos checkPos = basePos.mutable();
|
||||||
BlockState currentState = currentWorld.getBlockState(currentPos);
|
BlockState currentState = currentWorld.getBlockState(currentPos);
|
||||||
int radius = (EternalRitual.SEARCH_RADIUS >> 4) + 1;
|
int radius = (EternalRitual.SEARCH_RADIUS >> 4) + 1;
|
||||||
checkPos = EternalRitual.findBlockPos(targetWorld, checkPos, radius, this, state -> state.is(this) &&
|
checkPos = EternalRitual.findBlockPos(targetWorld, checkPos, radius, this, state -> state.is(this) && state.getValue(PORTAL).equals(currentState.getValue(PORTAL)));
|
||||||
state.getValue(PORTAL).equals(currentState.getValue(PORTAL)));
|
|
||||||
if (checkPos != null) {
|
if (checkPos != null) {
|
||||||
BlockState checkState = targetWorld.getBlockState(checkPos);
|
BlockState checkState = targetWorld.getBlockState(checkPos);
|
||||||
Axis axis = checkState.getValue(AXIS);
|
Axis axis = checkState.getValue(AXIS);
|
||||||
|
@ -146,11 +143,11 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private MutableBlockPos findCenter(Level world, MutableBlockPos pos, Direction.Axis axis) {
|
private MutableBlockPos findCenter(Level world, MutableBlockPos pos, Direction.Axis axis) {
|
||||||
return findCenter(world, pos, axis, 1);
|
return findCenter(world, pos, axis, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private MutableBlockPos findCenter(Level world, MutableBlockPos pos, Direction.Axis axis, int step) {
|
private MutableBlockPos findCenter(Level world, MutableBlockPos pos, Direction.Axis axis, int step) {
|
||||||
if (step > 8) return pos;
|
if (step > 8) return pos;
|
||||||
BlockState right, left;
|
BlockState right, left;
|
||||||
|
@ -174,12 +171,12 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTyped, I
|
||||||
}
|
}
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockColor getProvider() {
|
public BlockColor getProvider() {
|
||||||
return (state, world, pos, tintIndex) -> EndPortals.getColor(state.getValue(PORTAL));
|
return (state, world, pos, tintIndex) -> EndPortals.getColor(state.getValue(PORTAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemColor getItemProvider() {
|
public ItemColor getItemProvider() {
|
||||||
return (stack, tintIndex) -> EndPortals.getColor(0);
|
return (stack, tintIndex) -> EndPortals.getColor(0);
|
||||||
|
|
|
@ -47,17 +47,12 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
||||||
public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
|
public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
|
||||||
public static final BooleanProperty LIT = BlockStateProperties.LIT;
|
public static final BooleanProperty LIT = BlockStateProperties.LIT;
|
||||||
public static final String ID = "end_stone_smelter";
|
public static final String ID = "end_stone_smelter";
|
||||||
|
|
||||||
public EndStoneSmelter() {
|
public EndStoneSmelter() {
|
||||||
super(FabricBlockSettings.of(Material.STONE, MaterialColor.COLOR_GRAY)
|
super(FabricBlockSettings.of(Material.STONE, MaterialColor.COLOR_GRAY).luminance(state -> state.getValue(LIT) ? 15 : 0).hardness(4F).resistance(100F).requiresCorrectToolForDrops().sound(SoundType.STONE));
|
||||||
.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));
|
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) {
|
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||||
if (world.isClientSide) {
|
if (world.isClientSide) {
|
||||||
return InteractionResult.SUCCESS;
|
return InteractionResult.SUCCESS;
|
||||||
|
@ -67,24 +62,24 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
||||||
return InteractionResult.CONSUME;
|
return InteractionResult.CONSUME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openScreen(Level world, BlockPos pos, Player player) {
|
private void openScreen(Level world, BlockPos pos, Player player) {
|
||||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||||
if (blockEntity instanceof EndStoneSmelterBlockEntity) {
|
if (blockEntity instanceof EndStoneSmelterBlockEntity) {
|
||||||
player.openMenu((EndStoneSmelterBlockEntity) blockEntity);
|
player.openMenu((EndStoneSmelterBlockEntity) blockEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||||
return defaultBlockState().setValue(FACING, ctx.getHorizontalDirection().getOpposite());
|
return defaultBlockState().setValue(FACING, ctx.getHorizontalDirection().getOpposite());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
|
public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||||
return new EndStoneSmelterBlockEntity(blockPos, blockState);
|
return new EndStoneSmelterBlockEntity(blockPos, blockState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
List<ItemStack> drop = Lists.newArrayList(new ItemStack(this));
|
List<ItemStack> drop = Lists.newArrayList(new ItemStack(this));
|
||||||
|
@ -100,38 +95,38 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
||||||
}
|
}
|
||||||
return drop;
|
return drop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasAnalogOutputSignal(BlockState state) {
|
public boolean hasAnalogOutputSignal(BlockState state) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) {
|
public int getAnalogOutputSignal(BlockState state, Level world, BlockPos pos) {
|
||||||
//TODO
|
//TODO
|
||||||
return AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos));
|
return AbstractContainerMenu.getRedstoneSignalFromBlockEntity(world.getBlockEntity(pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RenderShape getRenderShape(BlockState state) {
|
public RenderShape getRenderShape(BlockState state) {
|
||||||
return RenderShape.MODEL;
|
return RenderShape.MODEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState rotate(BlockState state, Rotation rotation) {
|
public BlockState rotate(BlockState state, Rotation rotation) {
|
||||||
return state.setValue(FACING, rotation.rotate(state.getValue(FACING)));
|
return state.setValue(FACING, rotation.rotate(state.getValue(FACING)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState mirror(BlockState state, Mirror mirror) {
|
public BlockState mirror(BlockState state, Mirror mirror) {
|
||||||
return state.rotate(mirror.getRotation(state.getValue(FACING)));
|
return state.rotate(mirror.getRotation(state.getValue(FACING)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||||
builder.add(FACING, LIT);
|
builder.add(FACING, LIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public void animateTick(BlockState state, Level world, BlockPos pos, Random random) {
|
public void animateTick(BlockState state, Level world, BlockPos pos, Random random) {
|
||||||
if (state.getValue(LIT)) {
|
if (state.getValue(LIT)) {
|
||||||
|
@ -141,7 +136,7 @@ public class EndStoneSmelter extends BaseBlockWithEntity {
|
||||||
if (random.nextDouble() < 0.1D) {
|
if (random.nextDouble() < 0.1D) {
|
||||||
world.playLocalSound(x, y, z, SoundEvents.BLASTFURNACE_FIRE_CRACKLE, SoundSource.BLOCKS, 1.0F, 1.0F, false);
|
world.playLocalSound(x, y, z, SoundEvents.BLASTFURNACE_FIRE_CRACKLE, SoundSource.BLOCKS, 1.0F, 1.0F, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Direction direction = state.getValue(FACING);
|
Direction direction = state.getValue(FACING);
|
||||||
Direction.Axis axis = direction.getAxis();
|
Direction.Axis axis = direction.getAxis();
|
||||||
double defOffset = random.nextDouble() * 0.6D - 0.3D;
|
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);
|
world.addParticle(ParticleTypes.SMOKE, x + offX, y + offY, z + offZ, 0.0D, 0.0D, 0.0D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> blockEntityType) {
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState blockState, BlockEntityType<T> blockEntityType) {
|
||||||
|
|
|
@ -12,15 +12,11 @@ import net.minecraft.world.level.material.MaterialColor;
|
||||||
import ru.bclib.blocks.BaseBlock;
|
import ru.bclib.blocks.BaseBlock;
|
||||||
|
|
||||||
public class EnderBlock extends BaseBlock {
|
public class EnderBlock extends BaseBlock {
|
||||||
|
|
||||||
public EnderBlock() {
|
public EnderBlock() {
|
||||||
super(FabricBlockSettings.of(Material.STONE, MaterialColor.WARPED_WART_BLOCK)
|
super(FabricBlockSettings.of(Material.STONE, MaterialColor.WARPED_WART_BLOCK).hardness(5F).resistance(6F).requiresCorrectToolForDrops().sound(SoundType.STONE));
|
||||||
.hardness(5F)
|
|
||||||
.resistance(6F)
|
|
||||||
.requiresCorrectToolForDrops()
|
|
||||||
.sound(SoundType.STONE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public int getColor(BlockState state, BlockGetter world, BlockPos pos) {
|
public int getColor(BlockState state, BlockGetter world, BlockPos pos) {
|
||||||
return 0xFF005548;
|
return 0xFF005548;
|
||||||
|
|
|
@ -19,18 +19,16 @@ import java.util.List;
|
||||||
public class EndstoneDustBlock extends FallingBlock {
|
public class EndstoneDustBlock extends FallingBlock {
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
private static final int COLOR = ColorUtil.color(226, 239, 168);
|
private static final int COLOR = ColorUtil.color(226, 239, 168);
|
||||||
|
|
||||||
public EndstoneDustBlock() {
|
public EndstoneDustBlock() {
|
||||||
super(FabricBlockSettings.copyOf(Blocks.SAND)
|
super(FabricBlockSettings.copyOf(Blocks.SAND).breakByTool(FabricToolTags.SHOVELS).materialColor(Blocks.END_STONE.defaultMaterialColor()));
|
||||||
.breakByTool(FabricToolTags.SHOVELS)
|
|
||||||
.materialColor(Blocks.END_STONE.defaultMaterialColor()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
return Collections.singletonList(new ItemStack(this));
|
return Collections.singletonList(new ItemStack(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public int getDustColor(BlockState state, BlockGetter world, BlockPos pos) {
|
public int getDustColor(BlockState state, BlockGetter world, BlockPos pos) {
|
||||||
return COLOR;
|
return COLOR;
|
||||||
|
|
|
@ -29,12 +29,12 @@ import java.util.List;
|
||||||
|
|
||||||
public class EternalPedestal extends PedestalBlock {
|
public class EternalPedestal extends PedestalBlock {
|
||||||
public static final BooleanProperty ACTIVATED = EndBlockProperties.ACTIVE;
|
public static final BooleanProperty ACTIVATED = EndBlockProperties.ACTIVE;
|
||||||
|
|
||||||
public EternalPedestal() {
|
public EternalPedestal() {
|
||||||
super(EndBlocks.FLAVOLITE_RUNED_ETERNAL);
|
super(EndBlocks.FLAVOLITE_RUNED_ETERNAL);
|
||||||
this.registerDefaultState(defaultBlockState().setValue(ACTIVATED, false));
|
this.registerDefaultState(defaultBlockState().setValue(ACTIVATED, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkRitual(Level world, BlockPos pos) {
|
public void checkRitual(Level world, BlockPos pos) {
|
||||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||||
|
@ -74,7 +74,7 @@ public class EternalPedestal extends PedestalBlock {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public BlockState updateShape(BlockState state, Direction direction, BlockState newState, LevelAccessor world, BlockPos pos, BlockPos posFrom) {
|
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;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public float getDestroyProgress(BlockState state, Player player, BlockGetter world, BlockPos pos) {
|
public float getDestroyProgress(BlockState state, Player player, BlockGetter world, BlockPos pos) {
|
||||||
return 0.0F;
|
return 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getExplosionResistance() {
|
public float getExplosionResistance() {
|
||||||
return Blocks.BEDROCK.getExplosionResistance();
|
return Blocks.BEDROCK.getExplosionResistance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dropFromExplosion(Explosion explosion) {
|
public boolean dropFromExplosion(Explosion explosion) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
if (state.is(this)) {
|
if (state.is(this)) {
|
||||||
|
@ -120,18 +120,18 @@ public class EternalPedestal extends PedestalBlock {
|
||||||
}
|
}
|
||||||
return drop;
|
return drop;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||||
super.createBlockStateDefinition(stateManager);
|
super.createBlockStateDefinition(stateManager);
|
||||||
stateManager.add(ACTIVATED);
|
stateManager.add(ACTIVATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
|
public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||||
return new EternalPedestalEntity(blockPos, blockState);
|
return new EternalPedestalEntity(blockPos, blockState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasUniqueEntity() {
|
public boolean hasUniqueEntity() {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -7,7 +7,7 @@ public class FilaluxBlock extends BaseVineBlock {
|
||||||
public FilaluxBlock() {
|
public FilaluxBlock() {
|
||||||
super(15, true);
|
super(15, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockBehaviour.OffsetType getOffsetType() {
|
public BlockBehaviour.OffsetType getOffsetType() {
|
||||||
return BlockBehaviour.OffsetType.NONE;
|
return BlockBehaviour.OffsetType.NONE;
|
||||||
|
|
|
@ -20,21 +20,21 @@ import java.util.EnumMap;
|
||||||
|
|
||||||
public class FilaluxWingsBlock extends BaseAttachedBlock implements IRenderTyped {
|
public class FilaluxWingsBlock extends BaseAttachedBlock implements IRenderTyped {
|
||||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||||
|
|
||||||
public FilaluxWingsBlock() {
|
public FilaluxWingsBlock() {
|
||||||
super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).sound(SoundType.WET_GRASS).noCollission());
|
super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).sound(SoundType.WET_GRASS).noCollission());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BCLRenderLayer getRenderLayer() {
|
public BCLRenderLayer getRenderLayer() {
|
||||||
return BCLRenderLayer.CUTOUT;
|
return BCLRenderLayer.CUTOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||||
return BOUNDING_SHAPES.get(state.getValue(FACING));
|
return BOUNDING_SHAPES.get(state.getValue(FACING));
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
BOUNDING_SHAPES.put(Direction.UP, Shapes.box(0.0, 0.0, 0.0, 1.0, 0.5, 1.0));
|
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));
|
BOUNDING_SHAPES.put(Direction.DOWN, Shapes.box(0.0, 0.5, 0.0, 1.0, 1.0, 1.0));
|
||||||
|
|
|
@ -22,41 +22,43 @@ import java.util.List;
|
||||||
|
|
||||||
public class FlamaeaBlock extends EndPlantBlock implements ISpetialItem {
|
public class FlamaeaBlock extends EndPlantBlock implements ISpetialItem {
|
||||||
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16);
|
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 1, 16);
|
||||||
|
|
||||||
public FlamaeaBlock() {
|
public FlamaeaBlock() {
|
||||||
super(FabricBlockSettings.of(Material.PLANT)
|
super(FabricBlockSettings.of(Material.PLANT).breakByTool(FabricToolTags.SHEARS).breakByHand(true).sound(SoundType.WET_GRASS));
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.breakByHand(true)
|
|
||||||
.sound(SoundType.WET_GRASS));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
return state.is(Blocks.WATER);
|
return state.is(Blocks.WATER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||||
return SHAPE;
|
return SHAPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockBehaviour.OffsetType getOffsetType() {
|
public BlockBehaviour.OffsetType getOffsetType() {
|
||||||
return BlockBehaviour.OffsetType.NONE;
|
return BlockBehaviour.OffsetType.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||||
return Lists.newArrayList(new ItemStack(this));
|
return Lists.newArrayList(new ItemStack(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getStackSize() {
|
public int getStackSize() {
|
||||||
return 64;
|
return 64;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceOnWater() {
|
public boolean canPlaceOnWater() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean addToPot() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
355
src/main/java/ru/betterend/blocks/FlowerPotBlock.java
Normal file
355
src/main/java/ru/betterend/blocks/FlowerPotBlock.java
Normal file
|
@ -0,0 +1,355 @@
|
||||||
|
package ru.betterend.blocks;
|
||||||
|
|
||||||
|
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.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.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.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.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.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 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));
|
||||||
|
this.registerDefaultState(this.defaultBlockState().setValue(PLANT_ID, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||||
|
super.createBlockStateDefinition(builder);
|
||||||
|
builder.add(PLANT_ID, SOIL_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postInit() {
|
||||||
|
if (FlowerPotBlock.plants != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Block[] plants = new Block[128];
|
||||||
|
Block[] soils = new Block[16];
|
||||||
|
|
||||||
|
Map<String, Integer> reservedPlantsIDs = Maps.newHashMap();
|
||||||
|
Map<String, Integer> 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<String, Integer> 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));
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
BlocksHelper.setWithUpdate(level, pos, state.setValue(PLANT_ID, i + 1));
|
||||||
|
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<String> pattern = PatternsHelper.createJson(Patterns.BLOCK_FLOWER_POT, blockId);
|
||||||
|
return ModelsHelper.fromPattern(pattern);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Environment(EnvType.CLIENT)
|
||||||
|
public UnbakedModel getModelVariant(ResourceLocation stateId, BlockState blockState, Map<ResourceLocation, UnbakedModel> 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<String, String> textures = Maps.newHashMap();
|
||||||
|
textures.put("%modid%", loc.getNamespace());
|
||||||
|
textures.put("%texture%", loc.getPath());
|
||||||
|
Optional<String> 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<String, String> 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<String> 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<String> 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));
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,17 +12,17 @@ public class GlowingMossBlock extends EndPlantBlock {
|
||||||
public GlowingMossBlock(int light) {
|
public GlowingMossBlock(int light) {
|
||||||
super(light);
|
super(light);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
|
return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public boolean hasEmissiveLighting(BlockGetter world, BlockPos pos) {
|
public boolean hasEmissiveLighting(BlockGetter world, BlockPos pos) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public float getAmbientOcclusionLightLevel(BlockGetter world, BlockPos pos) {
|
public float getAmbientOcclusionLightLevel(BlockGetter world, BlockPos pos) {
|
||||||
return 1F;
|
return 1F;
|
||||||
|
|
|
@ -19,22 +19,17 @@ import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
public class GlowingPillarLuminophorBlock extends BaseBlock {
|
public class GlowingPillarLuminophorBlock extends BaseBlock {
|
||||||
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
|
public static final BooleanProperty NATURAL = EndBlockProperties.NATURAL;
|
||||||
|
|
||||||
public GlowingPillarLuminophorBlock() {
|
public GlowingPillarLuminophorBlock() {
|
||||||
super(FabricBlockSettings.of(Material.LEAVES)
|
super(FabricBlockSettings.of(Material.LEAVES).materialColor(MaterialColor.COLOR_ORANGE).breakByTool(FabricToolTags.SHEARS).strength(0.2F).luminance(15).sound(SoundType.GRASS));
|
||||||
.materialColor(MaterialColor.COLOR_ORANGE)
|
|
||||||
.breakByTool(FabricToolTags.SHEARS)
|
|
||||||
.strength(0.2F)
|
|
||||||
.luminance(15)
|
|
||||||
.sound(SoundType.GRASS));
|
|
||||||
this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false));
|
this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||||
return !state.getValue(NATURAL) || world.getBlockState(pos.below()).is(EndBlocks.GLOWING_PILLAR_ROOTS);
|
return !state.getValue(NATURAL) || world.getBlockState(pos.below()).is(EndBlocks.GLOWING_PILLAR_ROOTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
public BlockState updateShape(BlockState state, Direction facing, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||||
if (!canSurvive(state, world, pos)) {
|
if (!canSurvive(state, world, pos)) {
|
||||||
|
@ -44,7 +39,7 @@ public class GlowingPillarLuminophorBlock extends BaseBlock {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||||
stateManager.add(NATURAL);
|
stateManager.add(NATURAL);
|
||||||
|
|
|
@ -16,17 +16,17 @@ import ru.betterend.registry.EndBlocks;
|
||||||
|
|
||||||
public class GlowingPillarRootsBlock extends UpDownPlantBlock {
|
public class GlowingPillarRootsBlock extends UpDownPlantBlock {
|
||||||
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||||
stateManager.add(SHAPE);
|
stateManager.add(SHAPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isTerrain(BlockState state) {
|
protected boolean isTerrain(BlockState state) {
|
||||||
return state.is(EndBlocks.AMBER_MOSS);
|
return state.is(EndBlocks.AMBER_MOSS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
|
public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue