Compare commits
No commits in common. "1.19" and "1.16.5" have entirely different histories.
2304 changed files with 40699 additions and 58168 deletions
87
.github/ISSUE_TEMPLATE/BUG_REPORT.yml
vendored
87
.github/ISSUE_TEMPLATE/BUG_REPORT.yml
vendored
|
@ -1,87 +0,0 @@
|
|||
name: Report a Bug
|
||||
description: File a bug report
|
||||
title: "[Bug] "
|
||||
labels: [ "bug" ]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to report a Bug in BetterEnd!
|
||||
- type: textarea
|
||||
id: what-happened
|
||||
attributes:
|
||||
label: What happened?
|
||||
description: Also tell us, what did you expect to happen?
|
||||
placeholder: Tell us what you see!
|
||||
value: "A bug happened!"
|
||||
validations:
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
## Versions
|
||||
- type: input
|
||||
id: bn_version
|
||||
attributes:
|
||||
label: BetterEnd
|
||||
description: What version of BetterEnd are you running?
|
||||
placeholder: 2.0.x
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: bclib_version
|
||||
attributes:
|
||||
label: BCLib
|
||||
description: What version of BCLib are you running?
|
||||
placeholder: 2.0.x
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: fabric_api_version
|
||||
attributes:
|
||||
label: Fabric API
|
||||
description: What version of Fabric API is installed
|
||||
placeholder: 0.5x.x
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
id: fabric_loader_version
|
||||
attributes:
|
||||
label: Fabric Loader
|
||||
description: What version of Fabric Loader do you use
|
||||
placeholder: 0.14.x
|
||||
validations:
|
||||
required: false
|
||||
- type: dropdown
|
||||
id: mc_version
|
||||
attributes:
|
||||
label: Minecraft
|
||||
description: What version of Minecraft is installed?
|
||||
options:
|
||||
- 1.19.4
|
||||
- 1.19.3
|
||||
- 1.19.2
|
||||
- 1.19.1
|
||||
- 1.19
|
||||
- 1.18.2
|
||||
- 1.18.1
|
||||
- 1.18
|
||||
- Older
|
||||
validations:
|
||||
required: true
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
## Additional Information
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Relevant log output
|
||||
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
|
||||
render: shell
|
||||
- type: textarea
|
||||
id: other_mods
|
||||
attributes:
|
||||
label: Other Mods
|
||||
description: If you can, please supply a list of installed Mods (besides BetterEnd and BCLib). This information may already be included in the log above.
|
||||
render: shell
|
18
.github/ISSUE_TEMPLATE/SUGGEST_FROM.yml
vendored
18
.github/ISSUE_TEMPLATE/SUGGEST_FROM.yml
vendored
|
@ -1,18 +0,0 @@
|
|||
name: Suggest a Feature or Change
|
||||
description: Have a new Idea, then suggest a Feature here.
|
||||
title: "[Suggestion] "
|
||||
labels: ["suggestion"]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to suggest a new Feature for BCLib. We appreciate your time!
|
||||
- type: textarea
|
||||
id: describe
|
||||
attributes:
|
||||
label: Description
|
||||
description: Tell us your idea
|
||||
placeholder:
|
||||
value:
|
||||
validations:
|
||||
required: true
|
1
.github/ISSUE_TEMPLATE/config.yml
vendored
1
.github/ISSUE_TEMPLATE/config.yml
vendored
|
@ -1 +0,0 @@
|
|||
blank_issues_enabled: true
|
10
.gitignore
vendored
10
.gitignore
vendored
|
@ -27,13 +27,5 @@ bin/
|
|||
# fabric
|
||||
|
||||
run/
|
||||
run-client/
|
||||
run-server/
|
||||
output/
|
||||
*.getBlock("log")
|
||||
Convert.class
|
||||
ModelPart.class
|
||||
libs/
|
||||
/src/main/generated/.cache/
|
||||
/CHANGES.md
|
||||
/modrinth.json
|
||||
*.log
|
||||
|
|
161
Convert.java
161
Convert.java
|
@ -1,161 +0,0 @@
|
|||
class ModelPart {
|
||||
static java.util.ArrayList<ModelPart> parts = new java.util.ArrayList<>(20);
|
||||
final String name;
|
||||
ModelPart parent = null;
|
||||
boolean mirror = false;
|
||||
|
||||
float x = 0, y = 0, z = 0, rx = 0, ry = 0, rz = 0;
|
||||
int u = 0, v = 0;
|
||||
float bx = 0, by = 0, bz = 0, ba = 0, bb = 0, bc = 0;
|
||||
float scale = 1;
|
||||
static int wd = 64;
|
||||
static int hg = 32;
|
||||
|
||||
|
||||
boolean hadBox = false;
|
||||
|
||||
ModelPart(Convert c, String name) {
|
||||
this(c, 0, 0, name);
|
||||
|
||||
}
|
||||
|
||||
ModelPart(Convert c, int u, int v, String name) {
|
||||
this.name = name;
|
||||
this.u = u;
|
||||
this.v = v;
|
||||
parts.add(this);
|
||||
}
|
||||
|
||||
ModelPart(int wd, int hg, int u, int v, String name) {
|
||||
this.name = name;
|
||||
this.u = u;
|
||||
this.v = v;
|
||||
ModelPart.wd = wd;
|
||||
ModelPart.hg = hg;
|
||||
parts.add(this);
|
||||
}
|
||||
|
||||
ModelPart setPos(float x, float y, float z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
return this;
|
||||
}
|
||||
|
||||
ModelPart setRotationAngle(float x, float y, float z) {
|
||||
this.rx = x;
|
||||
this.ry = y;
|
||||
this.rz = z;
|
||||
return this;
|
||||
}
|
||||
|
||||
ModelPart addChild(ModelPart p) {
|
||||
p.parent = this;
|
||||
return this;
|
||||
}
|
||||
|
||||
ModelPart texOffs(int u, int v) {
|
||||
this.u = u;
|
||||
this.v = v;
|
||||
return this;
|
||||
}
|
||||
|
||||
ModelPart addBox(float x, float y, float z, float a, float b, float c) {
|
||||
return addBox(x, y, z, a, b, c, 1);
|
||||
}
|
||||
|
||||
ModelPart addBox(float x, float y, float z, float a, float b, float c, float _d) {
|
||||
bx = x;
|
||||
by = y;
|
||||
bz = z;
|
||||
ba = a;
|
||||
bb = b;
|
||||
bc = c;
|
||||
scale = _d;
|
||||
hadBox = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
ModelPart addBox(float x, float y, float z, float a, float b, float c, float _d, boolean mirror) {
|
||||
this.mirror = mirror;
|
||||
bx = x;
|
||||
by = y;
|
||||
bz = z;
|
||||
ba = a;
|
||||
bb = b;
|
||||
bc = c;
|
||||
hadBox = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
String s = "";
|
||||
String pName = parent == null ? "modelPartData" : parent.name;
|
||||
if (scale != 1) {
|
||||
s += "CubeDeformation deformation_" + name + " = new CubeDeformation(" + scale + "f);\n";
|
||||
}
|
||||
s += "PartDefinition " + name + " = ";
|
||||
s += pName + ".addOrReplaceChild(\"" + name + "\", CubeListBuilder.create()\n";
|
||||
if (this.mirror) s += ".mirror()\n";
|
||||
s += ".texOffs(" + u + ", " + v + ")";
|
||||
if (this.hadBox) {
|
||||
s += "\n";
|
||||
if (scale != 1)
|
||||
s += ".addBox(" + bx + "f, " + by + "f, " + bz + "f, " + ba + "f, " + bb + "f, " + bc + "f, deformation_" + name + "),\n";
|
||||
else s += ".addBox(" + bx + "f, " + by + "f, " + bz + "f, " + ba + "f, " + bb + "f, " + bc + "f),\n";
|
||||
}
|
||||
else {
|
||||
s += ",\n";
|
||||
}
|
||||
|
||||
if (x == 0 && y == 0 && z == 0 && rx == 0 && ry == 0 && rz == 0) {
|
||||
s += "PartPose.ZERO";
|
||||
}
|
||||
else if (rx == 0 && ry == 0 && rz == 0) {
|
||||
s += "PartPose.offset(" + x + "f, " + y + "f, " + z + "f)";
|
||||
}
|
||||
else {
|
||||
s += "PartPose.offsetAndRotation(" + x + "f, " + y + "f, " + z + "f, \n" + rx + "f, " + ry + "f, " + rz + "f)";
|
||||
}
|
||||
s += ");";
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
public static void print() {
|
||||
System.out.println("public static LayerDefinition getTexturedModelData() {");
|
||||
System.out.println(" MeshDefinition modelData = new MeshDefinition();");
|
||||
System.out.println(" PartDefinition modelPartData = modelData.getRoot();");
|
||||
for (ModelPart p : parts) {
|
||||
System.out.println(p);
|
||||
System.out.println();
|
||||
}
|
||||
System.out.println("return LayerDefinition.create(modelData, " + wd + ", " + hg + ");");
|
||||
System.out.println("}");
|
||||
|
||||
System.out.println();
|
||||
System.out.println();
|
||||
|
||||
for (ModelPart p : parts) {
|
||||
String pName = p.parent == null ? "modelPart" : p.parent.name;
|
||||
System.out.println(p.name + " = " + pName + ".getChild(\"" + p.name + "\");");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ModelPart.print();
|
||||
}
|
||||
void setRotationAngle(ModelPart p, float x, float y, float z){
|
||||
p.setRotationAngle(x, y, z);
|
||||
}
|
||||
public void c (){
|
||||
float scale = 1;
|
||||
ModelPart[] SHARDS = new ModelPart[4];
|
||||
SHARDS[0] = new ModelPart(16, 16, 2, 4, "SHARDS[0]").addBox(-5.0F, 1.0F, -3.0F, 2.0F, 8.0F, 2.0F);
|
||||
SHARDS[1] = new ModelPart(16, 16, 2, 4, "SHARDS[1]").addBox(3.0F, -1.0F, -1.0F, 2.0F, 8.0F, 2.0F);
|
||||
SHARDS[2] = new ModelPart(16, 16, 2, 4, "SHARDS[2]").addBox(-1.0F, 0.0F, -5.0F, 2.0F, 4.0F, 2.0F);
|
||||
SHARDS[3] = new ModelPart(16, 16, 2, 4, "SHARDS[3]").addBox(0.0F, 3.0F, 4.0F, 2.0F, 6.0F, 2.0F);
|
||||
ModelPart CORE = new ModelPart(16, 16, 0, 0, "CORE");
|
||||
CORE.addBox(-2.0F, -2.0F, -2.0F, 4.0F, 12.0F, 4.0F);
|
||||
}
|
||||
}
|
4
LICENSE
4
LICENSE
|
@ -19,7 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
___________________________
|
||||
Some of our Assets (see LICENSE.ASSETS for a Listing) is licensed under CC BY-NC-SA 4.0
|
||||
See https://creativecommons.org/licenses/by-nc-sa/4.0/ for Details.
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
Some of our Assets (see List below) is licensed under CC BY-NC-SA 4.0
|
||||
See https://creativecommons.org/licenses/by-nc-sa/4.0/ for Details.
|
||||
|
||||
Please use the Attribution "Team BetterX".
|
||||
|
||||
The following Files are distributed under this License:
|
||||
* src/main/resources/assets/betterend/textures/gui/infusion.png
|
||||
* src/main/resources/assets/betterend/icon_updater.png
|
||||
* src/main/resources/assets/betterend/lang/de_de.json
|
12
README.md
12
README.md
|
@ -1,19 +1,17 @@
|
|||
[](https://jitpack.io/#quiqueck/BetterEnd)
|
||||
|
||||
[](https://jitpack.io/#paulevsGitch/BetterEnd)
|
||||
# Better End
|
||||
|
||||
Better End Mod for Fabric, MC 1.19
|
||||
Better End Mod for Fabric, MC 1.16.4
|
||||
|
||||
Importing:
|
||||
|
||||
* Clone repo
|
||||
* Edit gradle.properties if necessary
|
||||
* Run command line in folder: gradlew genSources idea (or eclipse)
|
||||
* Run command line in folder: gradlew genSources eclipse (or Another-IDE-Name)
|
||||
* Import project to IDE
|
||||
|
||||
Building:
|
||||
|
||||
* Clone repo
|
||||
* Run command line in folder: gradlew build
|
||||
* Mod .jar will be in ./build/libs
|
||||
|
||||
Mappings:
|
||||
* https://modmuss50.me/fabric.html?&version=1.16.4
|
||||
|
|
401
build.gradle
401
build.gradle
|
@ -1,136 +1,114 @@
|
|||
buildscript {
|
||||
dependencies {
|
||||
classpath 'org.kohsuke:github-api:1.114'
|
||||
}
|
||||
dependencies {
|
||||
classpath 'org.kohsuke:github-api:1.114'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'fabric-loom' version "${loom_version}"
|
||||
id 'maven-publish'
|
||||
id "com.modrinth.minotaur" version "2.+"
|
||||
id "com.matthewprenger.cursegradle" version "1.4.0"
|
||||
id 'idea'
|
||||
id 'eclipse'
|
||||
id 'fabric-loom' version '0.7-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
archivesBaseName = project.archives_base_name
|
||||
version = project.mod_version
|
||||
group = project.maven_group
|
||||
def local_bclib = findProject(':BCLib') != null
|
||||
|
||||
repositories {
|
||||
maven { url "https://maven.dblsaiko.net/" }
|
||||
maven { url "https://maven.fabricmc.net/" }
|
||||
maven { url 'https://maven.blamejared.com' }
|
||||
maven { url "https://maven.shedaniel.me/" }
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url 'https://maven.terraformersmc.com/releases' }
|
||||
maven { url = "https://maven.terraformersmc.com/" }
|
||||
maven { url "https://maven.ladysnake.org/releases" }
|
||||
maven { url = "https://dvs1.progwml6.com/files/maven/" }
|
||||
maven { url = "https://modmaven.dev" }
|
||||
exclusiveContent {
|
||||
forRepository {
|
||||
maven {
|
||||
name = "Modrinth"
|
||||
url = "https://api.modrinth.com/maven"
|
||||
}
|
||||
}
|
||||
filter {
|
||||
includeGroup "maven.modrinth"
|
||||
}
|
||||
}
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/betterend.accesswidener")
|
||||
interfaceInjection {
|
||||
// When enabled injected interfaces from dependecies will be applied.
|
||||
enableDependencyInterfaceInjection = true
|
||||
}
|
||||
maven { url "https://server.bbkr.space:8081/artifactory/libs-release/" }
|
||||
maven { url "https://maven.fabricmc.net/" }
|
||||
maven { url 'https://maven.blamejared.com' }
|
||||
maven { url "https://maven.shedaniel.me/" }
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
mappings loom.officialMojangMappings()
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||
minecraft "com.mojang:minecraft:${project.minecraft_version}"
|
||||
mappings minecraft.officialMojangMappings()
|
||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||
|
||||
useApi "vazkii.patchouli:Patchouli:1.16.4-${project.patchouli_version}"
|
||||
useApi "com.github.paulevsGitch:BCLib:${project.bclib_version}"
|
||||
|
||||
modApi "vazkii.patchouli:Patchouli:${project.patchouli_version}"
|
||||
println "Using local BCLib: ${local_bclib}"
|
||||
if (local_bclib) {
|
||||
implementation(project(path: ":BCLib", configuration: 'dev'))
|
||||
} else {
|
||||
modImplementation "maven.modrinth:BCLib:${project.bclib_version}"
|
||||
}
|
||||
modCompileOnly "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
|
||||
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}"
|
||||
useOptional "me.shedaniel:RoughlyEnoughItems:${project.rei_version}"
|
||||
useOptional "me.shedaniel:RoughlyEnoughItems-api:${project.rei_version}"
|
||||
//useOptional "grondag:canvas-mc116:${project.canvas_version}"
|
||||
}
|
||||
|
||||
// compile against the JEI API but do not include it at runtime
|
||||
modCompileOnlyApi "mezz.jei:jei-1.19-common-api:${project.jei_version}"
|
||||
modCompileOnlyApi "mezz.jei:jei-1.19-fabric-api:${project.jei_version}"
|
||||
// at runtime, use the full JEI jar for Fabric
|
||||
//modRuntimeOnly "mezz.jei:jei-${project.minecraft_version}-fabric:${project.jei_version}"
|
||||
def useOptional(String dep) {
|
||||
dependencies.modRuntime (dep) {
|
||||
exclude group: "net.fabricmc.fabric-api"
|
||||
exclude group: "net.fabricmc"
|
||||
if (!dep.contains("me.shedaniel")) {
|
||||
exclude group: "me.shedaniel"
|
||||
}
|
||||
}
|
||||
dependencies.modCompileOnly (dep) {
|
||||
exclude group: "net.fabricmc.fabric-api"
|
||||
exclude group: "net.fabricmc"
|
||||
if (!dep.contains("me.shedaniel")) {
|
||||
exclude group: "me.shedaniel"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//needed for trinkets, otherwise BetterEnd would require users to install trinkets
|
||||
modApi "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}"
|
||||
modCompileOnly "dev.emi:trinkets:${project.trinkets_version}"
|
||||
modCompileOnly "dev.emi:emi-fabric:${emi_version}:api"
|
||||
modLocalRuntime "dev.emi:emi-fabric:${emi_version}"
|
||||
def useApi(String dep) {
|
||||
dependencies.modApi (dep) {
|
||||
exclude group: "net.fabricmc.fabric-api"
|
||||
exclude group: "net.fabricmc"
|
||||
if (!dep.contains("me.shedaniel")) {
|
||||
exclude group: "me.shedaniel"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
processResources {
|
||||
println "Version: ${project.version}"
|
||||
inputs.property "version", project.version
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": project.version
|
||||
}
|
||||
inputs.property "version", project.version
|
||||
duplicatesStrategy = 'WARN'
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include "fabric.mod.json"
|
||||
expand "version": project.version
|
||||
}
|
||||
}
|
||||
|
||||
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
||||
// this fixes some edge cases with special characters not displaying correctly
|
||||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = "UTF-8"
|
||||
it.options.release = 17
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
javadoc {
|
||||
options.tags = ["reason"]
|
||||
options.tags = ["reason"]
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
||||
// if it is present.
|
||||
// If you remove this task, sources will not be generated.
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
java {
|
||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
||||
// if it is present.
|
||||
// If you remove this line, sources will not be generated.
|
||||
withSourcesJar()
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
jar {
|
||||
from "LICENSE"
|
||||
from "LICENSE.ASSETS"
|
||||
from "LICENSE"
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
archives sourcesJar
|
||||
archives javadocJar
|
||||
}
|
||||
|
||||
def env = System.getenv()
|
||||
|
@ -139,225 +117,42 @@ import org.kohsuke.github.GHReleaseBuilder
|
|||
import org.kohsuke.github.GitHub
|
||||
|
||||
task release(dependsOn: [remapJar, sourcesJar, javadocJar]) {
|
||||
onlyIf {
|
||||
env.GITHUB_TOKEN
|
||||
}
|
||||
onlyIf {
|
||||
env.GITHUB_TOKEN
|
||||
}
|
||||
|
||||
doLast {
|
||||
def github = GitHub.connectUsingOAuth(env.GITHUB_TOKEN as String)
|
||||
def repository = github.getRepository("quiqueck/BetterEnd")
|
||||
doLast {
|
||||
def github = GitHub.connectUsingOAuth(env.GITHUB_TOKEN as String)
|
||||
def repository = github.getRepository("paulevsGitch/BetterEnd")
|
||||
|
||||
def releaseBuilder = new GHReleaseBuilder(repository, version as String)
|
||||
releaseBuilder.name("${archivesBaseName}-${version}")
|
||||
releaseBuilder.body("A changelog can be found at https://github.com/quiqueck/BetterEnd/commits")
|
||||
releaseBuilder.commitish("master")
|
||||
def releaseBuilder = new GHReleaseBuilder(repository, version as String)
|
||||
releaseBuilder.name("${archivesBaseName}-${version}")
|
||||
releaseBuilder.body("A changelog can be found at https://github.com/paulevsGitch/BetterEnd/commits")
|
||||
releaseBuilder.commitish("master")
|
||||
|
||||
def ghRelease = releaseBuilder.create()
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"), "application/java-archive");
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources.jar"), "application/java-archive");
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-javadoc.jar"), "application/java-archive");
|
||||
}
|
||||
def ghRelease = releaseBuilder.create()
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"), "application/java-archive");
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-sources.jar"), "application/java-archive");
|
||||
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}-javadoc.jar"), "application/java-archive");
|
||||
}
|
||||
}
|
||||
|
||||
// configure the maven publication
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact(remapJar) {
|
||||
builtBy remapJar
|
||||
}
|
||||
artifact(sourcesJar) {
|
||||
builtBy remapSourcesJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// select the repositories you want to publish to
|
||||
repositories {
|
||||
// uncomment to publish to the local maven
|
||||
// mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
//from https://lowcarbrob.medium.com/android-pro-tip-generating-your-apps-changelog-from-git-inside-build-gradle-19a07533eec4
|
||||
String generateChangelog() {
|
||||
println "Assembeling Changelog ..."
|
||||
def lastTag = "git describe --tags --abbrev=0".execute().text.trim()
|
||||
//def gitLogCmd = "git log $lastTag..HEAD --oneline --no-merges --pretty=format:\"%s\"".execute().text.trim()
|
||||
def gitLogCmd = "git log $lastTag..HEAD --oneline --pretty=format:\"%s\"".execute().text.trim()
|
||||
|
||||
def features = ""
|
||||
def fixes = ""
|
||||
def changes = ""
|
||||
gitLogCmd.eachLine { gitLine ->
|
||||
def line = gitLine.substring(1, gitLine.length() - 1)
|
||||
if (line.trim().startsWith("[")) {
|
||||
def sline = line.split("]", 2)
|
||||
if (sline.length == 2) {
|
||||
def type = sline[0].trim().toLowerCase().substring(1)
|
||||
def comment = sline[1].trim()
|
||||
|
||||
//filter issue links
|
||||
if (comment.contains("(")) {
|
||||
def cline = comment.split("\\(", 2)
|
||||
if (cline.length == 2 && cline[1].contains("#")) {
|
||||
comment = cline[0].trim()
|
||||
}
|
||||
}
|
||||
|
||||
if (type == "fix" || type == "fixes" || type == "fixed") {
|
||||
fixes += "- $comment \n"
|
||||
} else if (type == "feature" || type == "features") {
|
||||
features += "- $comment \n"
|
||||
} else if (type == "change" || type == "changes" || type == "changed") {
|
||||
changes += "- $comment \n"
|
||||
} else {
|
||||
println "Unknown Type: $type ($line)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
def changelog = ""
|
||||
if (!features.isEmpty()) {
|
||||
changelog += "#### Features\n"
|
||||
changelog += features.trim()
|
||||
changelog += "\n\n"
|
||||
}
|
||||
if (!changes.isEmpty()) {
|
||||
changelog += "#### Changes\n"
|
||||
changelog += changes.trim()
|
||||
changelog += "\n\n"
|
||||
}
|
||||
if (!fixes.isEmpty()) {
|
||||
changelog += "#### Fixes\n"
|
||||
changelog += fixes.trim()
|
||||
changelog += "\n\n"
|
||||
}
|
||||
|
||||
println "Changelog since $lastTag:\n$changelog"
|
||||
return changelog
|
||||
}
|
||||
|
||||
task changelog() {
|
||||
doLast {
|
||||
new File(projectDir, "CHANGES.md").text = generateChangelog()
|
||||
}
|
||||
}
|
||||
|
||||
modrinth {
|
||||
def changes = new File(projectDir, "CHANGES.md")
|
||||
if (changes.exists()) {
|
||||
changes = changes.getText('UTF-8')
|
||||
} else {
|
||||
changes = ""
|
||||
}
|
||||
def modrinth_token = new File(projectDir, "../MODRINTH_TOKEN")
|
||||
if (modrinth_token.exists()) {
|
||||
modrinth_token = modrinth_token.text
|
||||
} else {
|
||||
modrinth_token = ""
|
||||
}
|
||||
def slurper = new groovy.json.JsonSlurper()
|
||||
token = modrinth_token
|
||||
projectId = project.modrinth_id
|
||||
versionNumber = project.mod_version
|
||||
versionType = project.release_channel
|
||||
uploadFile = remapJar
|
||||
gameVersions = slurper.parseText(project.modrinth_versions)
|
||||
loaders = ["fabric"]
|
||||
changelog = changes
|
||||
dependencies {
|
||||
required.project "fabric-api"
|
||||
required.project "bclib"
|
||||
optional.project "emi"
|
||||
optional.project "rei"
|
||||
optional.project "trinkets"
|
||||
optional.project "patchouli"
|
||||
}
|
||||
debugMode = false
|
||||
}
|
||||
|
||||
curseforge {
|
||||
def slurper = new groovy.json.JsonSlurper()
|
||||
apiKey = new File(projectDir, "../CURSEFORGE_TOKEN")
|
||||
if (apiKey.exists()) {
|
||||
apiKey = apiKey.text
|
||||
} else {
|
||||
apiKey = ""
|
||||
}
|
||||
|
||||
def changes = new File(projectDir, "CHANGES.md")
|
||||
if (changes.exists()) {
|
||||
changes = changes.getText('UTF-8')
|
||||
} else {
|
||||
changes = ""
|
||||
}
|
||||
|
||||
project {
|
||||
id = '413596'
|
||||
changelogType = 'markdown'
|
||||
changelog = changes
|
||||
releaseType = project.release_channel
|
||||
def versions = slurper.parseText(project.modrinth_versions);
|
||||
def latestVersion = ''
|
||||
for (v in versions) {
|
||||
addGameVersion v
|
||||
latestVersion = "[$v]"
|
||||
}
|
||||
addGameVersion 'Fabric'
|
||||
addGameVersion 'Java 17'
|
||||
relations {
|
||||
requiredDependency 'fabric-api'
|
||||
requiredDependency 'bclib'
|
||||
optionalDependency 'emi'
|
||||
optionalDependency 'roughly-enough-items'
|
||||
optionalDependency 'patchouli'
|
||||
optionalDependency 'trinkets'
|
||||
}
|
||||
mainArtifact(remapJar) {
|
||||
displayName = "$project.modrinth_id-$project.version $latestVersion"
|
||||
}
|
||||
afterEvaluate {
|
||||
mainArtifact(remapJar.outputs)
|
||||
}
|
||||
}
|
||||
|
||||
options {
|
||||
debug = false
|
||||
forgeGradleIntegration = false
|
||||
}
|
||||
}
|
||||
|
||||
task nextVersion() {
|
||||
doLast {
|
||||
def inputFile = new File('modrinth.json')
|
||||
def gameVersions = java.net.URLEncoder.encode(project.modrinth_versions, "UTF-8")
|
||||
new URL("https://api.modrinth.com/v2/project/${project.modrinth_id}/version?&game_versions=${gameVersions}").withInputStream { i -> inputFile.withOutputStream { it << i } }
|
||||
|
||||
def json = new groovy.json.JsonSlurper().parseText(inputFile.text)
|
||||
def version = json[0].version_number
|
||||
|
||||
//increment patch version
|
||||
def indexedVersionList = version.split(/\./).toList().withIndex()
|
||||
indexedVersionList = indexedVersionList.collect { num, idx -> num.toInteger() }
|
||||
indexedVersionList[2] = indexedVersionList[2].value + 1
|
||||
def updatedVersion = indexedVersionList.join(".")
|
||||
|
||||
println "\n\n"
|
||||
println "------------- CURRENT VERSION -------------"
|
||||
println "Last Published Version: " + version
|
||||
println " Game Versions: " + json[0].game_versions
|
||||
println " Status: " + json[0].status
|
||||
println " Featured: " + json[0].featured
|
||||
println " Downloaded: " + json[0].downloads
|
||||
println "\n"
|
||||
println "-------------- NEXT VERSION ---------------"
|
||||
println "Next Version: " + updatedVersion
|
||||
println "\n\n"
|
||||
|
||||
def propertiesFile = new File("gradle.properties")
|
||||
def newContents = propertiesFile.text.replaceFirst("mod_version=\\d+.\\d+.\\d+", "mod_version=${updatedVersion}")
|
||||
propertiesFile.text = newContents
|
||||
}
|
||||
}
|
||||
//publishing {
|
||||
// publications {
|
||||
// mavenJava(MavenPublication) {
|
||||
// artifact(remapJar) {
|
||||
// builtBy remapJar
|
||||
// }
|
||||
// artifact(sourcesJar) {
|
||||
// builtBy remapSourcesJar
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // select the repositories you want to publish to
|
||||
// repositories {
|
||||
// // uncomment to publish to the local maven
|
||||
// // mavenLocal()
|
||||
// }
|
||||
//}
|
||||
|
|
|
@ -1,27 +1,21 @@
|
|||
# Done to increase the memory available to gradle.
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/versions.html
|
||||
minecraft_version=1.19.2
|
||||
loader_version=0.15.3
|
||||
fabric_version=0.77.0+1.19.2
|
||||
#Loom
|
||||
loom_version=0.12-SNAPSHOT
|
||||
#Modrinth
|
||||
modrinth_versions=["1.19", "1.19.1", "1.19.2"]
|
||||
#`release`, `beta` or `alpha`
|
||||
release_channel=release
|
||||
modrinth_id=betterend
|
||||
# Mod Properties
|
||||
mod_version=2.1.7
|
||||
maven_group=org.betterx.betterend
|
||||
archives_base_name=better-end
|
||||
# Dependencies
|
||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||
patchouli_version=1.19-73-FABRIC
|
||||
bclib_version=2.1.8
|
||||
rei_version=9.1.500
|
||||
jei_version=11.1.0.235
|
||||
emi_version=1.0.29+1.19.2
|
||||
trinkets_version=3.4.0
|
||||
cca_version=5.0.0-beta.1
|
||||
# Done to increase the memory available to gradle.
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
minecraft_version=1.16.5
|
||||
yarn_mappings=6
|
||||
loader_version=0.11.3
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 0.9.8-pre
|
||||
maven_group = ru.betterend
|
||||
archives_base_name = better-end
|
||||
|
||||
# Dependencies
|
||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||
patchouli_version = 50-FABRIC
|
||||
fabric_version = 0.32.9+1.16
|
||||
canvas_version = 1.0.+
|
||||
bclib_version = 0.1.38
|
||||
rei_version = 5.8.10
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
259
gradlew
vendored
259
gradlew
vendored
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
@ -17,113 +17,78 @@
|
|||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
@ -132,7 +97,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
|||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
|
@ -140,95 +105,79 @@ location of your Java installation."
|
|||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
|
22
gradlew.bat
vendored
22
gradlew.bat
vendored
|
@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
|
|||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
@ -54,7 +54,7 @@ goto fail
|
|||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
|
@ -64,14 +64,28 @@ echo location of your Java installation.
|
|||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
# From https://github.com/jitpack/jitpack.io/issues/4506#issuecomment-864562270
|
||||
before_install:
|
||||
- source "$HOME/.sdkman/bin/sdkman-init.sh"
|
||||
- sdk update
|
||||
- sdk install java 17.0.1-tem
|
||||
- sdk use java 17.0.1-tem
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"parent": "block/slab",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%_bricks",
|
||||
"side": "betterend:block/%name%_bricks",
|
||||
"top": "betterend:block/%name%_bricks"
|
||||
}
|
||||
"parent": "block/slab",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%_bricks",
|
||||
"side": "betterend:block/%name%_bricks",
|
||||
"top": "betterend:block/%name%_bricks"
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"parent": "block/inner_stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%_bricks",
|
||||
"side": "betterend:block/%name%_bricks",
|
||||
"top": "betterend:block/%name%_bricks"
|
||||
}
|
||||
"parent": "block/inner_stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%_bricks",
|
||||
"side": "betterend:block/%name%_bricks",
|
||||
"top": "betterend:block/%name%_bricks"
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"parent": "block/outer_stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%_bricks",
|
||||
"side": "betterend:block/%name%_bricks",
|
||||
"top": "betterend:block/%name%_bricks"
|
||||
}
|
||||
"parent": "block/outer_stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%_bricks",
|
||||
"side": "betterend:block/%name%_bricks",
|
||||
"top": "betterend:block/%name%_bricks"
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"parent": "block/stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%_bricks",
|
||||
"side": "betterend:block/%name%_bricks",
|
||||
"top": "betterend:block/%name%_bricks"
|
||||
}
|
||||
"parent": "block/stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%_bricks",
|
||||
"side": "betterend:block/%name%_bricks",
|
||||
"top": "betterend:block/%name%_bricks"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/wall_inventory",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%_bricks"
|
||||
}
|
||||
"parent": "minecraft:block/wall_inventory",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%_bricks"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/template_wall_post",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%_bricks"
|
||||
}
|
||||
"parent": "minecraft:block/template_wall_post",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%_bricks"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/template_wall_side",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%_bricks"
|
||||
}
|
||||
"parent": "minecraft:block/template_wall_side",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%_bricks"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/template_wall_side_tall",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%_bricks"
|
||||
}
|
||||
"parent": "minecraft:block/template_wall_side_tall",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%_bricks"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "betterend:block/%name%_bricks"
|
||||
}
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "betterend:block/%name%_bricks"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "block/button",
|
||||
"textures": {
|
||||
"texture": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "block/button",
|
||||
"textures": {
|
||||
"texture": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "block/button_inventory",
|
||||
"textures": {
|
||||
"texture": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "block/button_inventory",
|
||||
"textures": {
|
||||
"texture": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "block/button_pressed",
|
||||
"textures": {
|
||||
"texture": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "block/button_pressed",
|
||||
"textures": {
|
||||
"texture": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"parent": "block/slab",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%",
|
||||
"side": "betterend:block/%name%",
|
||||
"top": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "block/slab",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%",
|
||||
"side": "betterend:block/%name%",
|
||||
"top": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"parent": "block/inner_stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%",
|
||||
"side": "betterend:block/%name%",
|
||||
"top": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "block/inner_stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%",
|
||||
"side": "betterend:block/%name%",
|
||||
"top": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"parent": "block/outer_stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%",
|
||||
"side": "betterend:block/%name%",
|
||||
"top": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "block/outer_stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%",
|
||||
"side": "betterend:block/%name%",
|
||||
"top": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "block/pressure_plate_down",
|
||||
"textures": {
|
||||
"texture": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "block/pressure_plate_down",
|
||||
"textures": {
|
||||
"texture": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "block/pressure_plate_up",
|
||||
"textures": {
|
||||
"texture": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "block/pressure_plate_up",
|
||||
"textures": {
|
||||
"texture": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "betterend:block/%name%_small_tiles"
|
||||
}
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "betterend:block/%name%_small_tiles"
|
||||
}
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"parent": "block/stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%",
|
||||
"side": "betterend:block/%name%",
|
||||
"top": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "block/stairs",
|
||||
"textures": {
|
||||
"bottom": "betterend:block/%name%",
|
||||
"side": "betterend:block/%name%",
|
||||
"top": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "betterend:block/%name%_tile"
|
||||
}
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "betterend:block/%name%_tile"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/wall_inventory",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "minecraft:block/wall_inventory",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/template_wall_post",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "minecraft:block/template_wall_post",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/template_wall_side",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "minecraft:block/template_wall_side",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"parent": "minecraft:block/template_wall_side_tall",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%"
|
||||
}
|
||||
"parent": "minecraft:block/template_wall_side_tall",
|
||||
"textures": {
|
||||
"wall": "betterend:block/%name%"
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "betterend:block/%name%"
|
||||
}
|
||||
}
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "betterend:block/%name%"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +1,15 @@
|
|||
{
|
||||
"variants": {
|
||||
"type=bottom": {
|
||||
"model": "betterend:block/%name%_brick_half_slab"
|
||||
},
|
||||
"type=double": {
|
||||
"model": "betterend:block/%name%_bricks"
|
||||
},
|
||||
"type=top": {
|
||||
"model": "betterend:block/%name%_brick_half_slab",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
}
|
||||
}
|
||||
"variants": {
|
||||
"type=bottom": {
|
||||
"model": "betterend:block/%name%_brick_half_slab"
|
||||
},
|
||||
"type=double": {
|
||||
"model": "betterend:block/%name%_bricks"
|
||||
},
|
||||
"type=top": {
|
||||
"model": "betterend:block/%name%_brick_half_slab",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,209 +1,209 @@
|
|||
{
|
||||
"variants": {
|
||||
"facing=east,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=east,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs"
|
||||
},
|
||||
"facing=east,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=east,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs"
|
||||
},
|
||||
"facing=east,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs"
|
||||
},
|
||||
"facing=east,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=east,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=east,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=east,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=east,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=south,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs"
|
||||
},
|
||||
"facing=south,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs"
|
||||
},
|
||||
"facing=south,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=south,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=south,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=west,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=west,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
}
|
||||
}
|
||||
"variants": {
|
||||
"facing=east,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=east,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs"
|
||||
},
|
||||
"facing=east,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=east,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs"
|
||||
},
|
||||
"facing=east,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs"
|
||||
},
|
||||
"facing=east,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=east,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=east,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=east,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=east,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=south,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs"
|
||||
},
|
||||
"facing=south,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs"
|
||||
},
|
||||
"facing=south,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=south,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=south,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_brick_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=west,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_brick_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=west,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_brick_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,90 +1,90 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"when": {
|
||||
"up": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_post"
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"north": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side",
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"east": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"south": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"west": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"north": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"east": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"south": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"west": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
}
|
||||
}
|
||||
]
|
||||
"multipart": [
|
||||
{
|
||||
"when": {
|
||||
"up": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_post"
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"north": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side",
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"east": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"south": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"west": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"north": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"east": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"south": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"west": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_brick_wall_side_tall",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "betterend:block/%name%_bricks"
|
||||
}
|
||||
}
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "betterend:block/%name%_bricks"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,118 +1,118 @@
|
|||
{
|
||||
"variants": {
|
||||
"face=ceiling,facing=east,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"face=ceiling,facing=east,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"face=ceiling,facing=north,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"face=ceiling,facing=north,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"face=ceiling,facing=south,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"x": 180
|
||||
},
|
||||
"face=ceiling,facing=south,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"x": 180
|
||||
},
|
||||
"face=ceiling,facing=west,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"face=ceiling,facing=west,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"face=floor,facing=east,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"y": 90
|
||||
},
|
||||
"face=floor,facing=east,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"y": 90
|
||||
},
|
||||
"face=floor,facing=north,powered=false": {
|
||||
"model": "betterend:block/%name%_button"
|
||||
},
|
||||
"face=floor,facing=north,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed"
|
||||
},
|
||||
"face=floor,facing=south,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"y": 180
|
||||
},
|
||||
"face=floor,facing=south,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"y": 180
|
||||
},
|
||||
"face=floor,facing=west,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"y": 270
|
||||
},
|
||||
"face=floor,facing=west,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"y": 270
|
||||
},
|
||||
"face=wall,facing=east,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 90
|
||||
},
|
||||
"face=wall,facing=east,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 90
|
||||
},
|
||||
"face=wall,facing=north,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"uvlock": true,
|
||||
"x": 90
|
||||
},
|
||||
"face=wall,facing=north,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"uvlock": true,
|
||||
"x": 90
|
||||
},
|
||||
"face=wall,facing=south,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 180
|
||||
},
|
||||
"face=wall,facing=south,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 180
|
||||
},
|
||||
"face=wall,facing=west,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 270
|
||||
},
|
||||
"face=wall,facing=west,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 270
|
||||
}
|
||||
}
|
||||
"variants": {
|
||||
"face=ceiling,facing=east,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"face=ceiling,facing=east,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"face=ceiling,facing=north,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"face=ceiling,facing=north,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"face=ceiling,facing=south,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"x": 180
|
||||
},
|
||||
"face=ceiling,facing=south,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"x": 180
|
||||
},
|
||||
"face=ceiling,facing=west,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"face=ceiling,facing=west,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"face=floor,facing=east,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"y": 90
|
||||
},
|
||||
"face=floor,facing=east,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"y": 90
|
||||
},
|
||||
"face=floor,facing=north,powered=false": {
|
||||
"model": "betterend:block/%name%_button"
|
||||
},
|
||||
"face=floor,facing=north,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed"
|
||||
},
|
||||
"face=floor,facing=south,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"y": 180
|
||||
},
|
||||
"face=floor,facing=south,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"y": 180
|
||||
},
|
||||
"face=floor,facing=west,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"y": 270
|
||||
},
|
||||
"face=floor,facing=west,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"y": 270
|
||||
},
|
||||
"face=wall,facing=east,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 90
|
||||
},
|
||||
"face=wall,facing=east,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 90
|
||||
},
|
||||
"face=wall,facing=north,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"uvlock": true,
|
||||
"x": 90
|
||||
},
|
||||
"face=wall,facing=north,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"uvlock": true,
|
||||
"x": 90
|
||||
},
|
||||
"face=wall,facing=south,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 180
|
||||
},
|
||||
"face=wall,facing=south,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 180
|
||||
},
|
||||
"face=wall,facing=west,powered=false": {
|
||||
"model": "betterend:block/%name%_button",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 270
|
||||
},
|
||||
"face=wall,facing=west,powered=true": {
|
||||
"model": "betterend:block/%name%_button_pressed",
|
||||
"uvlock": true,
|
||||
"x": 90,
|
||||
"y": 270
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"axis=x": {
|
||||
"model": "betterend:block/%name%_pillar",
|
||||
"x": 90,
|
||||
"y": 90
|
||||
},
|
||||
"axis=y": {
|
||||
"model": "betterend:block/%name%_pillar"
|
||||
},
|
||||
"axis=z": {
|
||||
"model": "betterend:block/%name%_pillar",
|
||||
"x": 90
|
||||
}
|
||||
}
|
||||
"variants": {
|
||||
"axis=x": { "model": "betterend:block/%name%_pillar", "x": 90, "y": 90 },
|
||||
"axis=y": { "model": "betterend:block/%name%_pillar" },
|
||||
"axis=z": { "model": "betterend:block/%name%_pillar", "x": 90 }
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"variants": {
|
||||
"powered=false": {
|
||||
"model": "betterend:block/%name%_pressure_plate_up"
|
||||
},
|
||||
"powered=true": {
|
||||
"model": "betterend:block/%name%_pressure_plate_down"
|
||||
}
|
||||
}
|
||||
"variants": {
|
||||
"powered=false": {
|
||||
"model": "betterend:block/%name%_pressure_plate_up"
|
||||
},
|
||||
"powered=true": {
|
||||
"model": "betterend:block/%name%_pressure_plate_down"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,15 +1,15 @@
|
|||
{
|
||||
"variants": {
|
||||
"type=bottom": {
|
||||
"model": "betterend:block/%name%_half_slab"
|
||||
},
|
||||
"type=double": {
|
||||
"model": "betterend:block/%name%"
|
||||
},
|
||||
"type=top": {
|
||||
"model": "betterend:block/%name%_half_slab",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
}
|
||||
}
|
||||
"variants": {
|
||||
"type=bottom": {
|
||||
"model": "betterend:block/%name%_half_slab"
|
||||
},
|
||||
"type=double": {
|
||||
"model": "betterend:block/%name%"
|
||||
},
|
||||
"type=top": {
|
||||
"model": "betterend:block/%name%_half_slab",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "betterend:block/%name%_small_tiles"
|
||||
}
|
||||
}
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "betterend:block/%name%_small_tiles"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,209 +1,209 @@
|
|||
{
|
||||
"variants": {
|
||||
"facing=east,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=east,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs"
|
||||
},
|
||||
"facing=east,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=east,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs"
|
||||
},
|
||||
"facing=east,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs"
|
||||
},
|
||||
"facing=east,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=east,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=east,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=east,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=east,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=south,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs"
|
||||
},
|
||||
"facing=south,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs"
|
||||
},
|
||||
"facing=south,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=south,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=south,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=west,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=west,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
}
|
||||
}
|
||||
"variants": {
|
||||
"facing=east,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=east,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs"
|
||||
},
|
||||
"facing=east,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=east,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs"
|
||||
},
|
||||
"facing=east,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs"
|
||||
},
|
||||
"facing=east,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=east,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=east,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=east,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=east,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=north,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=north,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180
|
||||
},
|
||||
"facing=north,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=south,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs"
|
||||
},
|
||||
"facing=south,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs"
|
||||
},
|
||||
"facing=south,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=south,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=south,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=south,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=bottom,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 90
|
||||
},
|
||||
"facing=west,half=bottom,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=bottom,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=inner_left": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=inner_right": {
|
||||
"model": "betterend:block/%name%_inner_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=west,half=top,shape=outer_left": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
},
|
||||
"facing=west,half=top,shape=outer_right": {
|
||||
"model": "betterend:block/%name%_outer_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 270
|
||||
},
|
||||
"facing=west,half=top,shape=straight": {
|
||||
"model": "betterend:block/%name%_stairs",
|
||||
"uvlock": true,
|
||||
"x": 180,
|
||||
"y": 180
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "betterend:block/%name%_tile"
|
||||
}
|
||||
}
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "betterend:block/%name%_tile"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,90 +1,90 @@
|
|||
{
|
||||
"multipart": [
|
||||
{
|
||||
"when": {
|
||||
"up": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_post"
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"north": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side",
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"east": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"south": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"west": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"north": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side_tall",
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"east": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side_tall",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"south": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side_tall",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"west": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side_tall",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
}
|
||||
}
|
||||
]
|
||||
"multipart": [
|
||||
{
|
||||
"when": {
|
||||
"up": "true"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_post"
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"north": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side",
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"east": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"south": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"west": "low"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"north": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side_tall",
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"east": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side_tall",
|
||||
"y": 90,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"south": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side_tall",
|
||||
"y": 180,
|
||||
"uvlock": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"when": {
|
||||
"west": "tall"
|
||||
},
|
||||
"apply": {
|
||||
"model": "betterend:block/%name%_wall_side_tall",
|
||||
"y": 270,
|
||||
"uvlock": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
pluginManagement {
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
name = 'Fabric'
|
||||
url = 'https://maven.fabricmc.net/'
|
||||
|
@ -8,39 +7,3 @@ pluginManagement {
|
|||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
// #### Custom Settings ####
|
||||
|
||||
//Change the next line to disable local BCLib loading
|
||||
def allowLocalLibUse = true
|
||||
|
||||
//When true, the local BCLib is also used in commandline builds
|
||||
def allowLocalLibInConsoleMode = false
|
||||
|
||||
//The path were to look for the local BCLib
|
||||
def BCLibPath = '../BCLib'
|
||||
|
||||
|
||||
// #### Logic ####
|
||||
def isIDE = properties.containsKey('android.injected.invoked.from.ide')
|
||||
|| (System.getenv("XPC_SERVICE_NAME") ?: "").contains("intellij")
|
||||
|| (System.getenv("XPC_SERVICE_NAME") ?: "").contains(".idea")
|
||||
|| System.getenv("IDEA_INITIAL_DIRECTORY") != null
|
||||
|
||||
println "IntelliJ: ${isIDE}"
|
||||
|
||||
def BCLibFolder = new File( BCLibPath )
|
||||
if( allowLocalLibUse && (isIDE || allowLocalLibInConsoleMode) && BCLibFolder.exists() ) {
|
||||
println "Using local BCLib from '${BCLibFolder}' in IntelliJ"
|
||||
println "If you do not want to load the local version of BClib"
|
||||
println "either rename the Folder containing BCLib to something"
|
||||
println "else, or set 'allowLocalLibUse' in settings.gradle"
|
||||
println "to false."
|
||||
println ""
|
||||
println "If you receive version-errors when launching minecraft"
|
||||
println "in IntelliJ, make sure you have set up gradle instead"
|
||||
println "of IntelliJ to compile and run."
|
||||
|
||||
include ':BCLib'
|
||||
project(":BCLib").projectDir = BCLibFolder
|
||||
project(':BCLib').buildFileName = './bclib-composit.gradle'
|
||||
}
|
||||
|
|
|
@ -1,91 +0,0 @@
|
|||
package org.betterx.betterend;
|
||||
|
||||
import org.betterx.bclib.api.v2.generator.BiomeDecider;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BiomeAPI;
|
||||
import org.betterx.betterend.advancements.BECriteria;
|
||||
import org.betterx.betterend.api.BetterEndPlugin;
|
||||
import org.betterx.betterend.commands.CommandRegistry;
|
||||
import org.betterx.betterend.config.Configs;
|
||||
import org.betterx.betterend.effects.EndPotions;
|
||||
import org.betterx.betterend.integration.Integrations;
|
||||
import org.betterx.betterend.recipe.*;
|
||||
import org.betterx.betterend.registry.*;
|
||||
import org.betterx.betterend.util.BonemealPlants;
|
||||
import org.betterx.betterend.util.LootTableUtil;
|
||||
import org.betterx.betterend.world.generator.EndLandBiomeDecider;
|
||||
import org.betterx.betterend.world.generator.GeneratorOptions;
|
||||
import org.betterx.worlds.together.util.Logger;
|
||||
import org.betterx.worlds.together.world.WorldConfig;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biomes;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
||||
public class BetterEnd implements ModInitializer {
|
||||
public static final String MOD_ID = "betterend";
|
||||
public static final Logger LOGGER = new Logger(MOD_ID);
|
||||
public static final boolean RUNS_TRINKETS = FabricLoader.getInstance()
|
||||
.getModContainer("trinkets")
|
||||
.isPresent();
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
WorldConfig.registerModCache(MOD_ID);
|
||||
EndPortals.loadPortals();
|
||||
EndSounds.register();
|
||||
EndMenuTypes.ensureStaticallyLoaded();
|
||||
EndBlockEntities.register();
|
||||
EndPoiTypes.register();
|
||||
EndFeatures.register();
|
||||
EndEntities.register();
|
||||
EndBiomes.register();
|
||||
EndTags.register();
|
||||
EndBlocks.ensureStaticallyLoaded();
|
||||
EndItems.ensureStaticallyLoaded();
|
||||
EndEnchantments.register();
|
||||
EndPotions.register();
|
||||
CraftingRecipes.register();
|
||||
FurnaceRecipes.register();
|
||||
AlloyingRecipes.register();
|
||||
AnvilRecipes.register();
|
||||
SmithingRecipes.register();
|
||||
InfusionRecipes.register();
|
||||
EndStructures.register();
|
||||
BonemealPlants.init();
|
||||
GeneratorOptions.init();
|
||||
LootTableUtil.init();
|
||||
CommandRegistry.register();
|
||||
BECriteria.register();
|
||||
EndAdvancements.register();
|
||||
FabricLoader.getInstance()
|
||||
.getEntrypoints("betterend", BetterEndPlugin.class)
|
||||
.forEach(BetterEndPlugin::register);
|
||||
Integrations.init();
|
||||
Configs.saveConfigs();
|
||||
|
||||
if (GeneratorOptions.useNewGenerator()) {
|
||||
BiomeDecider.registerHighPriorityDecider(makeID("end_land"), new EndLandBiomeDecider());
|
||||
}
|
||||
|
||||
BiomeAPI.registerEndBiomeModification((biomeID, biome) -> {
|
||||
if (!biomeID.equals(Biomes.THE_VOID.location())) {
|
||||
EndFeatures.addBiomeFeatures(biomeID, biome);
|
||||
}
|
||||
});
|
||||
|
||||
BiomeAPI.onFinishingEndBiomeTags((biomeID, biome) -> {
|
||||
if (!biomeID.equals(Biomes.THE_VOID.location())) {
|
||||
EndStructures.addBiomeStructures(biomeID, biome);
|
||||
}
|
||||
});
|
||||
if (RUNS_TRINKETS) {
|
||||
org.betterx.betterend.integration.trinkets.Elytra.register();
|
||||
}
|
||||
}
|
||||
|
||||
public static ResourceLocation makeID(String path) {
|
||||
return new ResourceLocation(MOD_ID, path);
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package org.betterx.betterend.advancements;
|
||||
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.advancements.critereon.EntityPredicate;
|
||||
import net.minecraft.advancements.critereon.PlayerTrigger;
|
||||
|
||||
public class BECriteria {
|
||||
public static PlayerTrigger PORTAL_ON;
|
||||
public static PlayerTrigger PORTAL_TRAVEL;
|
||||
public static PlayerTrigger INFUSION_FINISHED;
|
||||
|
||||
public static PlayerTrigger.TriggerInstance PORTAL_ON_TRIGGER;
|
||||
public static PlayerTrigger.TriggerInstance PORTAL_TRAVEL_TRIGGER;
|
||||
public static PlayerTrigger.TriggerInstance INFUSION_FINISHED_TRIGGER;
|
||||
|
||||
|
||||
public static void register() {
|
||||
PORTAL_ON = CriteriaTriggers.register(new PlayerTrigger(BetterEnd.makeID("portal_on")));
|
||||
PORTAL_TRAVEL = CriteriaTriggers.register(new PlayerTrigger(BetterEnd.makeID("portal_travel")));
|
||||
INFUSION_FINISHED = CriteriaTriggers.register(new PlayerTrigger(BetterEnd.makeID("infusion_finished")));
|
||||
|
||||
PORTAL_ON_TRIGGER = new PlayerTrigger.TriggerInstance(
|
||||
PORTAL_ON.getId(),
|
||||
EntityPredicate.Composite.ANY
|
||||
);
|
||||
PORTAL_TRAVEL_TRIGGER = new PlayerTrigger.TriggerInstance(
|
||||
PORTAL_TRAVEL.getId(),
|
||||
EntityPredicate.Composite.ANY
|
||||
);
|
||||
INFUSION_FINISHED_TRIGGER = new PlayerTrigger.TriggerInstance(
|
||||
INFUSION_FINISHED.getId(),
|
||||
EntityPredicate.Composite.ANY
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package org.betterx.betterend.api;
|
||||
|
||||
public interface BetterEndPlugin {
|
||||
/**
|
||||
* Alloying recipes registration.
|
||||
* See AlloyingRecipe.Builder for details.
|
||||
*/
|
||||
default void registerAlloyingRecipes() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Smithing recipes registration.
|
||||
* See AnvilSmithingRecipe.Builder for details.
|
||||
*/
|
||||
default void registerSmithingRecipes() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional biomes registration.
|
||||
* See BiomeRegistry.registerBiome for details.
|
||||
*/
|
||||
default void registerEndBiomes() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Register other mod stuff, for example, EndITEM_HAMMERS.
|
||||
*/
|
||||
default void registerOthers() {
|
||||
}
|
||||
|
||||
|
||||
static void register(BetterEndPlugin plugin) {
|
||||
plugin.registerAlloyingRecipes();
|
||||
plugin.registerSmithingRecipes();
|
||||
plugin.registerEndBiomes();
|
||||
plugin.registerOthers();
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.items.BaseAnvilItem;
|
||||
import org.betterx.betterend.blocks.basis.EndAnvilBlock;
|
||||
import org.betterx.betterend.item.material.EndToolMaterial;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
|
||||
public class AeterniumAnvil extends EndAnvilBlock {
|
||||
public AeterniumAnvil() {
|
||||
super(EndBlocks.AETERNIUM_BLOCK.defaultMaterialColor(), EndToolMaterial.AETERNIUM.getLevel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxDurability() {
|
||||
return 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockItem getCustomItem(ResourceLocation blockID, Item.Properties settings) {
|
||||
return new BaseAnvilItem(this, settings.fireResistant());
|
||||
}
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
import org.betterx.bclib.interfaces.CustomItemProvider;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
public class AeterniumBlock extends BaseBlock implements CustomItemProvider {
|
||||
public AeterniumBlock() {
|
||||
super(FabricBlockSettings
|
||||
.of(Material.METAL, MaterialColor.COLOR_GRAY)
|
||||
.hardness(65F)
|
||||
.resistance(1200F)
|
||||
.requiresCorrectToolForDrops()
|
||||
.sound(SoundType.NETHERITE_BLOCK)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockItem getCustomItem(ResourceLocation blockID, Item.Properties settings) {
|
||||
return new BlockItem(this, settings.fireResistant());
|
||||
}
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
|
||||
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
public class AmaranitaCapBlock extends BaseBlock implements AddMineableAxe {
|
||||
public AmaranitaCapBlock() {
|
||||
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD));
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
import org.betterx.bclib.client.render.BCLRenderLayer;
|
||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
|
||||
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
public class AmaranitaHymenophoreBlock extends BaseBlock implements RenderLayerProvider, AddMineableAxe {
|
||||
public AmaranitaHymenophoreBlock() {
|
||||
super(FabricBlockSettings.of(Material.WOOD).sound(SoundType.WOOD));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BCLRenderLayer getRenderLayer() {
|
||||
return BCLRenderLayer.CUTOUT;
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndParticles;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class AncientEmeraldIceBlock extends BaseBlock {
|
||||
public AncientEmeraldIceBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.BLUE_ICE).randomTicks());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
Direction dir = BlocksHelper.randomDirection(random);
|
||||
|
||||
if (random.nextBoolean()) {
|
||||
int x = MHelper.randRange(-2, 2, random);
|
||||
int y = MHelper.randRange(-2, 2, random);
|
||||
int z = MHelper.randRange(-2, 2, random);
|
||||
BlockPos p = pos.offset(x, y, z);
|
||||
if (world.getBlockState(p).is(Blocks.WATER)) {
|
||||
world.setBlockAndUpdate(p, EndBlocks.EMERALD_ICE.defaultBlockState());
|
||||
makeParticles(world, p, random);
|
||||
}
|
||||
}
|
||||
|
||||
pos = pos.relative(dir);
|
||||
state = world.getBlockState(pos);
|
||||
if (state.is(Blocks.WATER)) {
|
||||
world.setBlockAndUpdate(pos, EndBlocks.EMERALD_ICE.defaultBlockState());
|
||||
makeParticles(world, pos, random);
|
||||
} else if (state.is(EndBlocks.EMERALD_ICE)) {
|
||||
world.setBlockAndUpdate(pos, EndBlocks.DENSE_EMERALD_ICE.defaultBlockState());
|
||||
makeParticles(world, pos, random);
|
||||
}
|
||||
}
|
||||
|
||||
private void makeParticles(ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
world.sendParticles(
|
||||
EndParticles.SNOWFLAKE,
|
||||
pos.getX() + 0.5,
|
||||
pos.getY() + 0.5,
|
||||
pos.getZ() + 0.5,
|
||||
20,
|
||||
0.5,
|
||||
0.5,
|
||||
0.5,
|
||||
0
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
||||
if (tool != null && EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) != 0) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stepOn(Level level, BlockPos blockPos, BlockState blockState, Entity entity) {
|
||||
super.stepOn(level, blockPos, blockState, entity);
|
||||
entity.setIsInPowderSnow(true);
|
||||
}
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.client.render.BCLRenderLayer;
|
||||
import org.betterx.bclib.interfaces.CustomColorProvider;
|
||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableHammer;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.betterend.registry.EndItems;
|
||||
import org.betterx.ui.ColorUtil;
|
||||
|
||||
import net.minecraft.client.color.block.BlockColor;
|
||||
import net.minecraft.client.color.item.ItemColor;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Vec3i;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.AbstractGlassBlock;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class AuroraCrystalBlock extends AbstractGlassBlock implements RenderLayerProvider, CustomColorProvider, AddMineablePickaxe, AddMineableHammer {
|
||||
public static final Vec3i[] COLORS;
|
||||
private static final int MIN_DROP = 1;
|
||||
private static final int MAX_DROP = 4;
|
||||
|
||||
public AuroraCrystalBlock() {
|
||||
super(FabricBlockSettings
|
||||
.of(Material.GLASS)
|
||||
.hardness(1F)
|
||||
.resistance(1F)
|
||||
.luminance(15)
|
||||
.noOcclusion()
|
||||
.isSuffocating((state, world, pos) -> false)
|
||||
.sound(SoundType.GLASS));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public VoxelShape getVisualShape(
|
||||
BlockState blockState,
|
||||
BlockGetter blockGetter,
|
||||
BlockPos blockPos,
|
||||
CollisionContext collisionContext
|
||||
) {
|
||||
return this.getCollisionShape(blockState, blockGetter, blockPos, collisionContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockColor getProvider() {
|
||||
return (state, world, pos, tintIndex) -> {
|
||||
if (pos == null) {
|
||||
pos = BlockPos.ZERO;
|
||||
}
|
||||
|
||||
long i = (long) pos.getX() + (long) pos.getY() + (long) pos.getZ();
|
||||
double delta = i * 0.1;
|
||||
int index = MHelper.floor(delta);
|
||||
int index2 = (index + 1) & 3;
|
||||
delta -= index;
|
||||
index &= 3;
|
||||
|
||||
Vec3i color1 = COLORS[index];
|
||||
Vec3i color2 = COLORS[index2];
|
||||
|
||||
int r = MHelper.floor(Mth.lerp(delta, color1.getX(), color2.getX()));
|
||||
int g = MHelper.floor(Mth.lerp(delta, color1.getY(), color2.getY()));
|
||||
int b = MHelper.floor(Mth.lerp(delta, color1.getZ(), color2.getZ()));
|
||||
|
||||
return ColorUtil.color(r, g, b);
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemColor getItemProvider() {
|
||||
return (stack, tintIndex) -> {
|
||||
return ColorUtil.color(COLORS[3].getX(), COLORS[3].getY(), COLORS[3].getZ());
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public BCLRenderLayer getRenderLayer() {
|
||||
return BCLRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
ItemStack tool = builder.getParameter(LootContextParams.TOOL);
|
||||
if (tool != null && tool.isCorrectToolForDrops(state)) {
|
||||
int count = 0;
|
||||
int enchant = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool);
|
||||
if (enchant > 0) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
}
|
||||
enchant = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.BLOCK_FORTUNE, tool);
|
||||
if (enchant > 0) {
|
||||
int min = Mth.clamp(MIN_DROP + enchant, MIN_DROP, MAX_DROP);
|
||||
int max = MAX_DROP + (enchant / Enchantments.BLOCK_FORTUNE.getMaxLevel());
|
||||
if (min == max) {
|
||||
return Lists.newArrayList(new ItemStack(EndItems.CRYSTAL_SHARDS, max));
|
||||
}
|
||||
count = MHelper.randRange(min, max, MHelper.RANDOM_SOURCE);
|
||||
} else {
|
||||
count = MHelper.randRange(MIN_DROP, MAX_DROP, MHelper.RANDOM_SOURCE);
|
||||
}
|
||||
return Lists.newArrayList(new ItemStack(EndItems.CRYSTAL_SHARDS, count));
|
||||
}
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
|
||||
static {
|
||||
COLORS = new Vec3i[]{
|
||||
new Vec3i(247, 77, 161),
|
||||
new Vec3i(120, 184, 255),
|
||||
new Vec3i(120, 255, 168),
|
||||
new Vec3i(243, 58, 255)
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.blocks.UpDownPlantBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
|
||||
public class BlueVineBlock extends UpDownPlantBlock {
|
||||
public static final EnumProperty<BlockProperties.TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||
stateManager.add(SHAPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
|
||||
}
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableAxe;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
public class BlueVineLanternBlock extends BaseBlock implements AddMineableAxe {
|
||||
public static final BooleanProperty NATURAL = BlockProperties.NATURAL;
|
||||
|
||||
public BlueVineLanternBlock() {
|
||||
super(FabricBlockSettings.of(Material.WOOD)
|
||||
.luminance(15)
|
||||
.sound(SoundType.WART_BLOCK));
|
||||
this.registerDefaultState(this.stateDefinition.any().setValue(NATURAL, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
return !state.getValue(NATURAL) || world.getBlockState(pos.below()).getBlock() == EndBlocks.BLUE_VINE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
if (!canSurvive(state, world, pos)) {
|
||||
return Blocks.AIR.defaultBlockState();
|
||||
} else {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||
stateManager.add(NATURAL);
|
||||
}
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
import org.betterx.betterend.blocks.basis.FurBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class BlueVineSeedBlock extends EndPlantWithAgeBlock {
|
||||
public BlueVineSeedBlock() {
|
||||
super(basePlantSettings().offsetType(BlockBehaviour.OffsetType.NONE).randomTicks());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void growAdult(WorldGenLevel world, RandomSource random, BlockPos pos) {
|
||||
int height = MHelper.randRange(2, 5, random);
|
||||
int h = BlocksHelper.upRay(world, pos, height + 2);
|
||||
if (h < height + 1) {
|
||||
return;
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos,
|
||||
EndBlocks.BLUE_VINE.defaultBlockState()
|
||||
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.BOTTOM)
|
||||
);
|
||||
for (int i = 1; i < height; i++) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos.above(i),
|
||||
EndBlocks.BLUE_VINE.defaultBlockState()
|
||||
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.MIDDLE)
|
||||
);
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos.above(height),
|
||||
EndBlocks.BLUE_VINE.defaultBlockState()
|
||||
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP)
|
||||
);
|
||||
placeLantern(world, pos.above(height + 1));
|
||||
}
|
||||
|
||||
private void placeLantern(WorldGenLevel world, BlockPos pos) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos,
|
||||
EndBlocks.BLUE_VINE_LANTERN.defaultBlockState().setValue(BlueVineLanternBlock.NATURAL, true)
|
||||
);
|
||||
for (Direction dir : BlocksHelper.HORIZONTAL) {
|
||||
BlockPos p = pos.relative(dir);
|
||||
if (world.isEmptyBlock(p)) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
p,
|
||||
EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, dir)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (world.isEmptyBlock(pos.above())) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos.above(),
|
||||
EndBlocks.BLUE_VINE_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.UP)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(EndBlocks.END_MOSS) || state.is(EndBlocks.END_MYCELIUM);
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.EndPlantBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.util.RandomSource;
|
||||
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.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BoluxMushroomBlock extends EndPlantBlock {
|
||||
private static final VoxelShape SHAPE = Block.box(1, 0, 1, 15, 9, 15);
|
||||
|
||||
public BoluxMushroomBlock() {
|
||||
super(basePlantSettings(10).offsetType(BlockBehaviour.OffsetType.NONE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(EndBlocks.RUTISCUS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
return Lists.newArrayList(new ItemStack(this));
|
||||
}
|
||||
}
|
|
@ -1,108 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class BrimstoneBlock extends BaseBlock {
|
||||
public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVE;
|
||||
|
||||
public BrimstoneBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.END_STONE).mapColor(MaterialColor.COLOR_BROWN).randomTicks());
|
||||
registerDefaultState(stateDefinition.any().setValue(ACTIVATED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||
stateManager.add(ACTIVATED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlacedBy(
|
||||
Level world,
|
||||
BlockPos pos,
|
||||
BlockState state,
|
||||
@Nullable LivingEntity placer,
|
||||
ItemStack itemStack
|
||||
) {
|
||||
if (world.isClientSide()) {
|
||||
updateChunks((ClientLevel) world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
public void destroy(LevelAccessor world, BlockPos pos, BlockState state) {
|
||||
if (world.isClientSide()) {
|
||||
updateChunks((ClientLevel) world, pos);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateChunks(ClientLevel world, BlockPos pos) {
|
||||
int y = pos.getY() >> 4;
|
||||
int x1 = (pos.getX() - 2) >> 4;
|
||||
int z1 = (pos.getZ() - 2) >> 4;
|
||||
int x2 = (pos.getX() + 2) >> 4;
|
||||
int z2 = (pos.getZ() + 2) >> 4;
|
||||
for (int x = x1; x <= x2; x++) {
|
||||
for (int z = z1; z <= z2; z++) {
|
||||
world.setSectionDirtyWithNeighbors(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
boolean deactivate = true;
|
||||
for (Direction dir : BlocksHelper.DIRECTIONS) {
|
||||
if (world.getFluidState(pos.relative(dir)).getType().equals(Fluids.WATER)) {
|
||||
deactivate = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (state.getValue(ACTIVATED)) {
|
||||
if (deactivate) {
|
||||
world.setBlockAndUpdate(pos, defaultBlockState().setValue(ACTIVATED, false));
|
||||
} else if (state.getValue(ACTIVATED) && random.nextInt(16) == 0) {
|
||||
Direction dir = BlocksHelper.randomDirection(random);
|
||||
BlockPos side = pos.relative(dir);
|
||||
BlockState sideState = world.getBlockState(side);
|
||||
if (sideState.getBlock() instanceof SulphurCrystalBlock) {
|
||||
if (sideState.getValue(SulphurCrystalBlock.AGE) < 2 && sideState.getValue(SulphurCrystalBlock.WATERLOGGED)) {
|
||||
int age = sideState.getValue(SulphurCrystalBlock.AGE) + 1;
|
||||
world.setBlockAndUpdate(side, sideState.setValue(SulphurCrystalBlock.AGE, age));
|
||||
}
|
||||
} else if (sideState.getFluidState().getType() == Fluids.WATER) {
|
||||
BlockState crystal = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState()
|
||||
.setValue(SulphurCrystalBlock.FACING, dir)
|
||||
.setValue(SulphurCrystalBlock.WATERLOGGED, true)
|
||||
.setValue(SulphurCrystalBlock.AGE, 0);
|
||||
world.setBlockAndUpdate(side, crystal);
|
||||
}
|
||||
}
|
||||
} else if (!deactivate && !state.getValue(ACTIVATED)) {
|
||||
world.setBlockAndUpdate(pos, defaultBlockState().setValue(ACTIVATED, true));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.util.RandomSource;
|
||||
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.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
public class BubbleCoralBlock extends EndUnderwaterPlantBlock implements AddMineableShears {
|
||||
|
||||
private static final VoxelShape SHAPE = Block.box(0, 0, 0, 16, 14, 16);
|
||||
|
||||
public BubbleCoralBlock() {
|
||||
super(baseUnderwaterPlantSettings()
|
||||
.sound(SoundType.CORAL_BLOCK)
|
||||
.offsetType(BlockBehaviour.OffsetType.NONE)
|
||||
);
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public void animateTick(BlockState state, Level world, BlockPos pos, RandomSource random) {
|
||||
double x = pos.getX() + random.nextDouble();
|
||||
double y = pos.getY() + random.nextDouble() * 0.5F + 0.5F;
|
||||
double z = pos.getZ() + random.nextDouble();
|
||||
world.addParticle(ParticleTypes.BUBBLE, x, y, z, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||
return SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.betterend.blocks.basis.LitPillarBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.PushReaction;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class BuddingSmaragdantCrystalBlock extends LitPillarBlock implements AddMineablePickaxe {
|
||||
public BuddingSmaragdantCrystalBlock() {
|
||||
super(FabricBlockSettings.of(Material.GLASS)
|
||||
.luminance(15)
|
||||
.hardness(1F)
|
||||
.resistance(1F)
|
||||
.noOcclusion()
|
||||
.sound(SoundType.AMETHYST)
|
||||
.randomTicks());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PushReaction getPistonPushReaction(BlockState blockState) {
|
||||
return PushReaction.DESTROY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void randomTick(BlockState blockState, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
Direction dir = BlocksHelper.randomDirection(random);
|
||||
BlockPos side = pos.relative(dir);
|
||||
BlockState sideState = world.getBlockState(side);
|
||||
if (random.nextInt(20) == 0) {
|
||||
if (canShardGrowAtState(sideState)) {
|
||||
BlockState shard = EndBlocks.SMARAGDANT_CRYSTAL_SHARD.defaultBlockState()
|
||||
.setValue(SmaragdantCrystalShardBlock.WATERLOGGED, sideState.getFluidState().getType() == Fluids.WATER)
|
||||
.setValue(SmaragdantCrystalShardBlock.FACING, dir);
|
||||
world.setBlockAndUpdate(side, shard);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean canShardGrowAtState(BlockState blockState) {
|
||||
return blockState.isAir() || blockState.is(Blocks.WATER) && blockState.getFluidState().getAmount() == 8;
|
||||
}
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseVineBlock;
|
||||
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndItems;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BulbVineBlock extends BaseVineBlock {
|
||||
public BulbVineBlock() {
|
||||
super(15, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
if (state.getValue(SHAPE) == TripleShape.BOTTOM) {
|
||||
return Lists.newArrayList(new ItemStack(EndItems.GLOWING_BULB));
|
||||
} else if (MHelper.RANDOM.nextInt(8) == 0) {
|
||||
return Lists.newArrayList(new ItemStack(EndBlocks.BULB_VINE_SEED));
|
||||
} else {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
boolean canPlace = super.canSurvive(state, world, pos);
|
||||
return (state.is(this) && state.getValue(SHAPE) == TripleShape.BOTTOM)
|
||||
? canPlace
|
||||
: canPlace && world.getBlockState(
|
||||
pos.below()).is(this);
|
||||
}
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.client.models.ModelsHelper;
|
||||
import org.betterx.bclib.client.render.BCLRenderLayer;
|
||||
import org.betterx.bclib.interfaces.BlockModelProvider;
|
||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineablePickaxe;
|
||||
import org.betterx.betterend.blocks.basis.EndLanternBlock;
|
||||
import org.betterx.betterend.client.models.Patterns;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class BulbVineLanternBlock extends EndLanternBlock implements RenderLayerProvider, BlockModelProvider, AddMineablePickaxe {
|
||||
private static final VoxelShape SHAPE_CEIL = Block.box(4, 4, 4, 12, 16, 12);
|
||||
private static final VoxelShape SHAPE_FLOOR = Block.box(4, 0, 4, 12, 12, 12);
|
||||
|
||||
public BulbVineLanternBlock() {
|
||||
this(FabricBlockSettings.of(Material.METAL)
|
||||
.hardness(1)
|
||||
.resistance(1)
|
||||
.mapColor(MaterialColor.COLOR_LIGHT_GRAY)
|
||||
.luminance(15)
|
||||
.requiresCorrectToolForDrops()
|
||||
.sound(SoundType.LANTERN));
|
||||
}
|
||||
|
||||
public BulbVineLanternBlock(Properties settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||
return state.getValue(IS_FLOOR) ? SHAPE_FLOOR : SHAPE_CEIL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BCLRenderLayer getRenderLayer() {
|
||||
return BCLRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
|
||||
Map<String, String> textures = Maps.newHashMap();
|
||||
textures.put("%glow%", getGlowTexture());
|
||||
textures.put("%metal%", getMetalTexture(resourceLocation));
|
||||
Optional<String> pattern = blockState.getValue(IS_FLOOR)
|
||||
? Patterns.createJson(
|
||||
Patterns.BLOCK_BULB_LANTERN_FLOOR,
|
||||
textures
|
||||
)
|
||||
: Patterns.createJson(Patterns.BLOCK_BULB_LANTERN_CEIL, textures);
|
||||
return ModelsHelper.fromPattern(pattern);
|
||||
}
|
||||
|
||||
protected String getMetalTexture(ResourceLocation blockId) {
|
||||
String name = blockId.getPath();
|
||||
name = name.substring(0, name.indexOf('_'));
|
||||
return name + "_bulb_vine_lantern_metal";
|
||||
}
|
||||
|
||||
protected String getGlowTexture() {
|
||||
return "bulb_vine_lantern_bulb";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.interfaces.CustomColorProvider;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.ui.ColorUtil;
|
||||
|
||||
import net.minecraft.client.color.block.BlockColor;
|
||||
import net.minecraft.client.color.item.ItemColor;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
public class BulbVineLanternColoredBlock extends BulbVineLanternBlock implements CustomColorProvider {
|
||||
public BulbVineLanternColoredBlock(FabricBlockSettings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockColor getProvider() {
|
||||
return (state, world, pos, tintIndex) -> getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemColor getItemProvider() {
|
||||
return (stack, tintIndex) -> getColor();
|
||||
}
|
||||
|
||||
private int getColor() {
|
||||
int color = BlocksHelper.getBlockColor(this);
|
||||
int b = (color & 255);
|
||||
int g = ((color >> 8) & 255);
|
||||
int r = ((color >> 16) & 255);
|
||||
float[] hsv = ColorUtil.RGBtoHSB(r, g, b, new float[3]);
|
||||
return ColorUtil.HSBtoRGB(hsv[0], hsv[1], hsv[1] > 0.2 ? 1 : hsv[2]);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getGlowTexture() {
|
||||
return "bulb_vine_lantern_overlay";
|
||||
}
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class BulbVineSeedBlock extends EndPlantWithAgeBlock {
|
||||
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
BlockState up = world.getBlockState(pos.above());
|
||||
return up.is(CommonBlockTags.GEN_END_STONES) || up.is(BlockTags.LOGS) || up.is(BlockTags.LEAVES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void growAdult(WorldGenLevel world, RandomSource random, BlockPos pos) {
|
||||
int h = BlocksHelper.downRay(world, pos, random.nextInt(24)) - 1;
|
||||
if (h > 2) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos,
|
||||
EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP)
|
||||
);
|
||||
for (int i = 1; i < h; i++) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos.below(i),
|
||||
EndBlocks.BULB_VINE.defaultBlockState()
|
||||
.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE)
|
||||
);
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos.below(h),
|
||||
EndBlocks.BULB_VINE.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlockNotFull;
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.client.render.BCLRenderLayer;
|
||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class CavePumpkinBlock extends BaseBlockNotFull implements RenderLayerProvider {
|
||||
public static final BooleanProperty SMALL = BlockProperties.SMALL;
|
||||
private static final VoxelShape SHAPE_SMALL;
|
||||
private static final VoxelShape SHAPE_BIG;
|
||||
|
||||
public CavePumpkinBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.PUMPKIN).luminance((state) -> state.getValue(SMALL) ? 10 : 15));
|
||||
registerDefaultState(defaultBlockState().setValue(SMALL, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||
stateManager.add(SMALL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BCLRenderLayer getRenderLayer() {
|
||||
return BCLRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) {
|
||||
return state.getValue(SMALL) ? SHAPE_SMALL : SHAPE_BIG;
|
||||
}
|
||||
|
||||
@Override
|
||||
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));
|
||||
}
|
||||
|
||||
static {
|
||||
VoxelShape lantern = Block.box(1, 0, 1, 15, 13, 15);
|
||||
VoxelShape cap = Block.box(0, 12, 0, 16, 15, 16);
|
||||
VoxelShape top = Block.box(5, 15, 5, 11, 16, 11);
|
||||
SHAPE_BIG = Shapes.or(lantern, cap, top);
|
||||
|
||||
lantern = Block.box(5, 7, 5, 11, 13, 11);
|
||||
cap = Block.box(4, 12, 4, 12, 15, 12);
|
||||
top = Block.box(6, 15, 6, 10, 16, 10);
|
||||
SHAPE_SMALL = Shapes.or(lantern, cap, top);
|
||||
}
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.betterend.blocks.basis.EndPlantWithAgeBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
public class CavePumpkinVineBlock extends EndPlantWithAgeBlock {
|
||||
public CavePumpkinVineBlock() {
|
||||
super(basePlantSettings().offsetType(BlockBehaviour.OffsetType.NONE));
|
||||
}
|
||||
|
||||
private static final VoxelShape SHAPE = Block.box(4, 0, 4, 12, 16, 12);
|
||||
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
BlockState down = world.getBlockState(pos.above());
|
||||
return isTerrain(down);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
int age = state.getValue(AGE);
|
||||
BlockState down = world.getBlockState(pos.below());
|
||||
if (down.getMaterial()
|
||||
.isReplaceable() || (down.is(EndBlocks.CAVE_PUMPKIN) && down.getValue(BlockProperties.SMALL))) {
|
||||
if (age < 3) {
|
||||
world.setBlockAndUpdate(pos, state.setValue(AGE, age + 1));
|
||||
}
|
||||
if (age == 2) {
|
||||
world.setBlockAndUpdate(
|
||||
pos.below(),
|
||||
EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(BlockProperties.SMALL, true)
|
||||
);
|
||||
} else if (age == 3) {
|
||||
world.setBlockAndUpdate(pos.below(), EndBlocks.CAVE_PUMPKIN.defaultBlockState());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void growAdult(WorldGenLevel world, RandomSource random, BlockPos pos) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
state = super.updateShape(state, facing, neighborState, world, pos, neighborPos);
|
||||
if (state.is(this) && state.getValue(BlockProperties.AGE) > 1) {
|
||||
BlockState down = world.getBlockState(pos.below());
|
||||
if (!down.is(EndBlocks.CAVE_PUMPKIN)) {
|
||||
state = state.setValue(BlockProperties.AGE, 1);
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||
return SHAPE;
|
||||
}
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseAttachedBlock;
|
||||
import org.betterx.bclib.client.models.ModelsHelper;
|
||||
import org.betterx.bclib.client.render.BCLRenderLayer;
|
||||
import org.betterx.bclib.interfaces.BlockModelProvider;
|
||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
import org.betterx.betterend.client.models.Patterns;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||
import net.minecraft.client.resources.model.BlockModelRotation;
|
||||
import net.minecraft.client.resources.model.UnbakedModel;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.Shapes;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import java.util.EnumMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class ChandelierBlock extends BaseAttachedBlock implements RenderLayerProvider, BlockModelProvider {
|
||||
private static final EnumMap<Direction, VoxelShape> BOUNDING_SHAPES = Maps.newEnumMap(Direction.class);
|
||||
|
||||
public ChandelierBlock(Block source) {
|
||||
super(FabricBlockSettings.copyOf(source)
|
||||
.luminance(15)
|
||||
.noCollission()
|
||||
.noOcclusion()
|
||||
.requiresCorrectToolForDrops());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BCLRenderLayer getRenderLayer() {
|
||||
return BCLRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||
return BOUNDING_SHAPES.get(state.getValue(FACING));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public BlockModel getItemModel(ResourceLocation blockId) {
|
||||
return ModelsHelper.createItemModel(blockId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public @Nullable BlockModel getBlockModel(ResourceLocation resourceLocation, BlockState blockState) {
|
||||
Optional<String> pattern;
|
||||
switch (blockState.getValue(FACING)) {
|
||||
case UP:
|
||||
pattern = Patterns.createJson(Patterns.BLOCK_CHANDELIER_FLOOR, resourceLocation.getPath());
|
||||
break;
|
||||
case DOWN:
|
||||
pattern = Patterns.createJson(Patterns.BLOCK_CHANDELIER_CEIL, resourceLocation.getPath());
|
||||
break;
|
||||
default:
|
||||
pattern = Patterns.createJson(Patterns.BLOCK_CHANDELIER_WALL, resourceLocation.getPath());
|
||||
}
|
||||
return ModelsHelper.fromPattern(pattern);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public UnbakedModel getModelVariant(
|
||||
ResourceLocation stateId,
|
||||
BlockState blockState,
|
||||
Map<ResourceLocation, UnbakedModel> modelCache
|
||||
) {
|
||||
String state = "_wall";
|
||||
BlockModelRotation rotation = BlockModelRotation.X0_Y0;
|
||||
switch (blockState.getValue(FACING)) {
|
||||
case UP:
|
||||
state = "_floor";
|
||||
break;
|
||||
case DOWN:
|
||||
state = "_ceil";
|
||||
break;
|
||||
case EAST:
|
||||
rotation = BlockModelRotation.X0_Y270;
|
||||
break;
|
||||
case NORTH:
|
||||
rotation = BlockModelRotation.X0_Y180;
|
||||
break;
|
||||
case WEST:
|
||||
rotation = BlockModelRotation.X0_Y90;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ResourceLocation modelId = new ResourceLocation(stateId.getNamespace(), "block/" + stateId.getPath() + state);
|
||||
registerBlockModel(stateId, modelId, blockState, modelCache);
|
||||
return ModelsHelper.createMultiVariant(modelId, rotation.getRotation(), false);
|
||||
}
|
||||
|
||||
static {
|
||||
BOUNDING_SHAPES.put(Direction.UP, Block.box(5, 0, 5, 11, 13, 11));
|
||||
BOUNDING_SHAPES.put(Direction.DOWN, Block.box(5, 3, 5, 11, 16, 11));
|
||||
BOUNDING_SHAPES.put(Direction.NORTH, Shapes.box(0.0, 0.0, 0.5, 1.0, 1.0, 1.0));
|
||||
BOUNDING_SHAPES.put(Direction.SOUTH, Shapes.box(0.0, 0.0, 0.0, 1.0, 1.0, 0.5));
|
||||
BOUNDING_SHAPES.put(Direction.WEST, Shapes.box(0.5, 0.0, 0.0, 1.0, 1.0, 1.0));
|
||||
BOUNDING_SHAPES.put(Direction.EAST, Shapes.box(0.0, 0.0, 0.0, 0.5, 1.0, 1.0));
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
import org.betterx.bclib.interfaces.Fuel;
|
||||
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
public class CharcoalBlock extends BaseBlock implements Fuel {
|
||||
public CharcoalBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.COAL_BLOCK));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFuelTime() {
|
||||
return 16000;
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
|
||||
public class CharniaBlock extends EndUnderwaterPlantBlock {
|
||||
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
return canSupportCenter(world, pos.below(), Direction.UP) && world.getFluidState(pos).getType() == Fluids.WATER;
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.EndPlantBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public class ChorusGrassBlock extends EndPlantBlock {
|
||||
public ChorusGrassBlock() {
|
||||
super(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.getBlock() == EndBlocks.CHORUS_NYLIUM;
|
||||
}
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.client.render.BCLRenderLayer;
|
||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.block.*;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
public class CrystalMossCoverBlock extends MultifaceBlock implements BonemealableBlock, SimpleWaterloggedBlock, RenderLayerProvider {
|
||||
private static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
||||
private final MultifaceSpreader spreader = new MultifaceSpreader(this);
|
||||
|
||||
public CrystalMossCoverBlock(MaterialColor color) {
|
||||
super(FabricBlockSettings.of(Material.REPLACEABLE_PLANT, color)
|
||||
.noCollission()
|
||||
.strength(0.2f)
|
||||
.sound(SoundType.GLOW_LICHEN)
|
||||
.lightLevel(GlowLichenBlock.emission(7)));
|
||||
this.registerDefaultState(this.defaultBlockState().setValue(WATERLOGGED, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||
super.createBlockStateDefinition(builder);
|
||||
builder.add(WATERLOGGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(
|
||||
BlockState blockState,
|
||||
Direction direction,
|
||||
BlockState blockState2,
|
||||
LevelAccessor levelAccessor,
|
||||
BlockPos blockPos,
|
||||
BlockPos blockPos2
|
||||
) {
|
||||
if (blockState.getValue(WATERLOGGED).booleanValue()) {
|
||||
levelAccessor.scheduleTick(blockPos, Fluids.WATER, Fluids.WATER.getTickDelay(levelAccessor));
|
||||
}
|
||||
return super.updateShape(blockState, direction, blockState2, levelAccessor, blockPos, blockPos2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeReplaced(BlockState blockState, BlockPlaceContext blockPlaceContext) {
|
||||
return !blockPlaceContext.getItemInHand().is(EndBlocks.CRYSTAL_MOSS_COVER.asItem()) || super.canBeReplaced(
|
||||
blockState,
|
||||
blockPlaceContext
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidBonemealTarget(
|
||||
BlockGetter blockGetter,
|
||||
BlockPos blockPos,
|
||||
BlockState blockState,
|
||||
boolean bl
|
||||
) {
|
||||
return Direction.stream()
|
||||
.anyMatch(direction -> this.spreader.canSpreadInAnyDirection(
|
||||
blockState,
|
||||
blockGetter,
|
||||
blockPos,
|
||||
direction.getOpposite()
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBonemealSuccess(Level level, RandomSource randomSource, BlockPos blockPos, BlockState blockState) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performBonemeal(
|
||||
ServerLevel serverLevel,
|
||||
RandomSource randomSource,
|
||||
BlockPos blockPos,
|
||||
BlockState blockState
|
||||
) {
|
||||
this.spreader.spreadFromRandomFaceTowardRandomDirection(blockState, serverLevel, blockPos, randomSource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidState getFluidState(BlockState blockState) {
|
||||
if (blockState.getValue(WATERLOGGED).booleanValue()) {
|
||||
return Fluids.WATER.getSource(false);
|
||||
}
|
||||
return super.getFluidState(blockState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean propagatesSkylightDown(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos) {
|
||||
return blockState.getFluidState().isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultifaceSpreader getSpreader() {
|
||||
return this.spreader;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BCLRenderLayer getRenderLayer() {
|
||||
return BCLRenderLayer.CUTOUT;
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BaseBlock;
|
||||
import org.betterx.bclib.client.render.BCLRenderLayer;
|
||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class DenseEmeraldIceBlock extends BaseBlock implements RenderLayerProvider {
|
||||
public DenseEmeraldIceBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.PACKED_ICE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BCLRenderLayer getRenderLayer() {
|
||||
return BCLRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
||||
if (tool != null && EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) != 0) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndFeatures;
|
||||
import org.betterx.betterend.world.features.trees.DragonTreeFeature;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
public class DragonTreeSaplingBlock extends PottableFeatureSapling<DragonTreeFeature, NoneFeatureConfiguration> {
|
||||
public DragonTreeSaplingBlock() {
|
||||
super((state) -> EndFeatures.DRAGON_TREE.configuredFeature);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
return world.getBlockState(pos.below()).is(EndBlocks.SHADOW_GRASS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlantOn(Block block) {
|
||||
return block == EndBlocks.SHADOW_GRASS;
|
||||
}
|
||||
}
|
|
@ -1,102 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.client.render.BCLRenderLayer;
|
||||
import org.betterx.bclib.interfaces.BlockModelProvider;
|
||||
import org.betterx.bclib.interfaces.RenderLayerProvider;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.item.enchantment.Enchantments;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LightLayer;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.HalfTransparentBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class EmeraldIceBlock extends HalfTransparentBlock implements RenderLayerProvider, BlockModelProvider {
|
||||
public EmeraldIceBlock() {
|
||||
super(FabricBlockSettings.copyOf(Blocks.ICE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BCLRenderLayer getRenderLayer() {
|
||||
return BCLRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playerDestroy(
|
||||
Level world,
|
||||
Player player,
|
||||
BlockPos pos,
|
||||
BlockState state,
|
||||
@Nullable BlockEntity blockEntity,
|
||||
ItemStack stack
|
||||
) {
|
||||
super.playerDestroy(world, player, pos, state, blockEntity, stack);
|
||||
if (EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, stack) == 0) {
|
||||
if (world.dimensionType().ultraWarm()) {
|
||||
world.removeBlock(pos, false);
|
||||
return;
|
||||
}
|
||||
|
||||
Material material = world.getBlockState(pos.below()).getMaterial();
|
||||
if (material.blocksMotion() || material.isLiquid()) {
|
||||
world.setBlockAndUpdate(pos, Blocks.WATER.defaultBlockState());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
if (world.getBrightness(LightLayer.BLOCK, pos) > 11 - state.getLightBlock(world, pos)) {
|
||||
this.melt(state, world, pos);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void melt(BlockState state, Level world, BlockPos pos) {
|
||||
if (world.dimensionType().ultraWarm()) {
|
||||
world.removeBlock(pos, false);
|
||||
} else {
|
||||
world.setBlockAndUpdate(pos, Blocks.WATER.defaultBlockState());
|
||||
world.neighborChanged(pos, Blocks.WATER, pos);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
ItemStack tool = builder.getOptionalParameter(LootContextParams.TOOL);
|
||||
if (tool != null && EnchantmentHelper.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, tool) != 0) {
|
||||
return Collections.singletonList(new ItemStack(this));
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public BlockModel getItemModel(ResourceLocation resourceLocation) {
|
||||
return getBlockModel(resourceLocation, defaultBlockState());
|
||||
}
|
||||
}
|
|
@ -1,131 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.betterend.registry.EndPortals;
|
||||
|
||||
import net.minecraft.util.StringRepresentable;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
|
||||
public class EndBlockProperties extends BlockProperties {
|
||||
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<CactusBottom> CACTUS_BOTTOM = EnumProperty.create("bottom", CactusBottom.class);
|
||||
|
||||
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, 16);
|
||||
public static final IntegerProperty POT_LIGHT = IntegerProperty.create("pot_light", 0, 3);
|
||||
public static final BooleanProperty HAS_ITEM = BooleanProperty.create("has_item");
|
||||
|
||||
public enum PedestalState implements StringRepresentable {
|
||||
PEDESTAL_TOP("pedestal_top"),
|
||||
COLUMN_TOP("column_top"),
|
||||
BOTTOM("bottom"),
|
||||
PILLAR("pillar"),
|
||||
COLUMN("column"),
|
||||
DEFAULT("default");
|
||||
|
||||
private final String name;
|
||||
|
||||
PedestalState(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSerializedName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
}
|
||||
|
||||
public enum HydraluxShape implements StringRepresentable {
|
||||
FLOWER_BIG_BOTTOM("flower_big_bottom", true),
|
||||
FLOWER_BIG_TOP("flower_big_top", true),
|
||||
FLOWER_SMALL_BOTTOM("flower_small_bottom", true),
|
||||
FLOWER_SMALL_TOP("flower_small_top", true),
|
||||
VINE("vine", false),
|
||||
ROOTS("roots", false);
|
||||
|
||||
private final String name;
|
||||
private final boolean glow;
|
||||
|
||||
HydraluxShape(String name, boolean glow) {
|
||||
this.name = name;
|
||||
this.glow = glow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSerializedName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public boolean hasGlow() {
|
||||
return glow;
|
||||
}
|
||||
}
|
||||
|
||||
public enum LumecornShape implements StringRepresentable {
|
||||
LIGHT_TOP("light_top", 15),
|
||||
LIGHT_TOP_MIDDLE("light_top_middle", 15),
|
||||
LIGHT_MIDDLE("light_middle", 15),
|
||||
LIGHT_BOTTOM("light_bottom", 15),
|
||||
MIDDLE("middle", 0),
|
||||
BOTTOM_BIG("bottom_big", 0),
|
||||
BOTTOM_SMALL("bottom_small", 0);
|
||||
|
||||
private final String name;
|
||||
private final int light;
|
||||
|
||||
LumecornShape(String name, int light) {
|
||||
this.name = name;
|
||||
this.light = light;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSerializedName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getLight() {
|
||||
return light;
|
||||
}
|
||||
}
|
||||
|
||||
public enum CactusBottom implements StringRepresentable {
|
||||
EMPTY("empty"),
|
||||
SAND("sand"),
|
||||
MOSS("moss");
|
||||
|
||||
private final String name;
|
||||
|
||||
CactusBottom(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSerializedName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,125 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BlockProperties;
|
||||
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
|
||||
import org.betterx.bclib.interfaces.tools.AddMineableShears;
|
||||
import org.betterx.bclib.util.MHelper;
|
||||
import org.betterx.betterend.blocks.basis.EndUnderwaterPlantBlock;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndItems;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class EndLilyBlock extends EndUnderwaterPlantBlock implements AddMineableShears {
|
||||
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_TOP = Block.box(2, 0, 2, 14, 6, 14);
|
||||
|
||||
public EndLilyBlock() {
|
||||
super(baseUnderwaterPlantSettings()
|
||||
.lightLevel((state) -> state.getValue(SHAPE) == TripleShape.TOP ? 13 : 0)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(
|
||||
BlockState state,
|
||||
Direction facing,
|
||||
BlockState neighborState,
|
||||
LevelAccessor world,
|
||||
BlockPos pos,
|
||||
BlockPos neighborPos
|
||||
) {
|
||||
if (!canSurvive(state, world, pos)) {
|
||||
return state.getValue(SHAPE) == TripleShape.TOP
|
||||
? Blocks.AIR.defaultBlockState()
|
||||
: Blocks.WATER.defaultBlockState();
|
||||
} else {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public VoxelShape getShape(BlockState state, BlockGetter view, BlockPos pos, CollisionContext ePos) {
|
||||
Vec3 vec3d = state.getOffset(view, pos);
|
||||
VoxelShape shape = state.getValue(SHAPE) == TripleShape.TOP ? SHAPE_TOP : SHAPE_BOTTOM;
|
||||
return shape.move(vec3d.x, vec3d.y, vec3d.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> stateManager) {
|
||||
stateManager.add(SHAPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidState getFluidState(BlockState state) {
|
||||
return state.getValue(SHAPE) == TripleShape.TOP ? Fluids.EMPTY.defaultFluidState() : Fluids.WATER.getSource(
|
||||
false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) {
|
||||
if (state.getValue(SHAPE) == TripleShape.TOP) {
|
||||
return world.getBlockState(pos.below()).getBlock() == this;
|
||||
} else if (state.getValue(SHAPE) == TripleShape.BOTTOM) {
|
||||
return isTerrain(world.getBlockState(pos.below()));
|
||||
} else {
|
||||
BlockState up = world.getBlockState(pos.above());
|
||||
BlockState down = world.getBlockState(pos.below());
|
||||
return up.getBlock() == this && down.getBlock() == this;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
|
||||
if (state.getValue(SHAPE) == TripleShape.TOP) {
|
||||
return Lists.newArrayList(
|
||||
new ItemStack(EndItems.END_LILY_LEAF, MHelper.randRange(1, 2, MHelper.RANDOM_SOURCE)),
|
||||
new ItemStack(EndBlocks.END_LILY_SEED, MHelper.randRange(1, 2, MHelper.RANDOM_SOURCE))
|
||||
);
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Environment(EnvType.CLIENT)
|
||||
public ItemStack getCloneItemStack(BlockGetter world, BlockPos pos, BlockState state) {
|
||||
return new ItemStack(EndBlocks.END_LILY_SEED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidBonemealTarget(BlockGetter world, BlockPos pos, BlockState state, boolean isClient) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
package org.betterx.betterend.blocks;
|
||||
|
||||
import org.betterx.bclib.blocks.BlockProperties.TripleShape;
|
||||
import org.betterx.bclib.blocks.UnderwaterPlantWithAgeBlock;
|
||||
import org.betterx.bclib.util.BlocksHelper;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
|
||||
public class EndLilySeedBlock extends UnderwaterPlantWithAgeBlock {
|
||||
@Override
|
||||
public void grow(WorldGenLevel world, RandomSource random, BlockPos pos) {
|
||||
if (canGrow(world, pos)) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
pos,
|
||||
EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.BOTTOM)
|
||||
);
|
||||
BlockPos up = pos.above();
|
||||
while (world.getFluidState(up).isSource()) {
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
up,
|
||||
EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.MIDDLE)
|
||||
);
|
||||
up = up.above();
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(
|
||||
world,
|
||||
up,
|
||||
EndBlocks.END_LILY.defaultBlockState().setValue(EndLilyBlock.SHAPE, TripleShape.TOP)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canGrow(WorldGenLevel world, BlockPos pos) {
|
||||
BlockPos up = pos.above();
|
||||
while (world.getBlockState(up).getFluidState().getType().equals(Fluids.WATER.getSource())) {
|
||||
up = up.above();
|
||||
}
|
||||
return world.isEmptyBlock(up);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isTerrain(BlockState state) {
|
||||
return state.is(CommonBlockTags.END_STONES);
|
||||
}
|
||||
}
|
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