diff --git a/.gitignore b/.gitignore
index 6019df58..514dd716 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,31 +1,31 @@
-# gradle
-
-.gradle/
-build/
-out/
-classes/
-
-# eclipse
-
-*.launch
-
-# idea
-
-.idea/
-*.iml
-*.ipr
-*.iws
-
-# vscode
-
-.settings/
-.vscode/
-bin/
-.classpath
-.project
-
-# fabric
-
-run/
-output/
-*.log
+# gradle
+
+.gradle/
+build/
+out/
+classes/
+
+# eclipse
+
+*.launch
+
+# idea
+
+.idea/
+*.iml
+*.ipr
+*.iws
+
+# vscode
+
+.settings/
+.vscode/
+bin/
+.classpath
+.project
+
+# fabric
+
+run/
+output/
+*.log
diff --git a/README.md b/README.md
index a8b33f9d..50b3ec8e 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,17 @@
-[](https://jitpack.io/#paulevsGitch/BetterEnd)
-# Better End
-Better End Mod for Fabric, MC 1.16.3
-
-Importing:
-* Clone repo
-* Edit gradle.properties if necessary
-* Run command line in folder: gradlew genSources eclipse (or Another-IDE-Name)
-* Import project to IDE
-
-Building:
-* Clone repo
-* Run command line in folder: gradlew build
-* Mod .jar will be in ./build/libs
-
-Mappings:
-* https://modmuss50.me/fabric.html?&version=1.16.3
+[](https://jitpack.io/#paulevsGitch/BetterEnd)
+# Better End
+Better End Mod for Fabric, MC 1.16.3
+
+Importing:
+* Clone repo
+* Edit gradle.properties if necessary
+* Run command line in folder: gradlew genSources eclipse (or Another-IDE-Name)
+* Import project to IDE
+
+Building:
+* Clone repo
+* Run command line in folder: gradlew build
+* Mod .jar will be in ./build/libs
+
+Mappings:
+* https://modmuss50.me/fabric.html?&version=1.16.3
diff --git a/build.gradle b/build.gradle
index df28b960..c6649214 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,93 +1,93 @@
-plugins {
- id 'fabric-loom' version '0.5-SNAPSHOT'
- id 'maven-publish'
-}
-
-sourceCompatibility = JavaVersion.VERSION_1_8
-targetCompatibility = JavaVersion.VERSION_1_8
-
-archivesBaseName = project.archives_base_name
-version = project.mod_version
-group = project.maven_group
-
-repositories {
- maven { url "https://maven.dblsaiko.net/" }
- maven { url "http://server.bbkr.space:8081/artifactory/libs-release/" }
- maven { url "https://maven.fabricmc.net/" }
- maven { url 'https://jitpack.io' }
- jcenter()
-}
-
-dependencies {
- minecraft "com.mojang:minecraft:${project.minecraft_version}"
- mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_mappings}:v2"
- modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
- modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
-
- optional "me.shedaniel:RoughlyEnoughItems:${project.rei_version}"
- optional "me.shedaniel:RoughlyEnoughItems-api:${project.rei_version}"
- optional "grondag:canvas-mc116:${project.canvas_version}"
-}
-
-def optional(String dep) {
- dependencies.modRuntime (dep) {
- exclude group: "net.fabricmc.fabric-api"
- exclude module: "fabric-loader"
- }
- dependencies.modCompileOnly (dep) {
- exclude group: "net.fabricmc.fabric-api"
- exclude module: "fabric-loader"
- }
-}
-
-processResources {
- inputs.property "version", project.version
-
- from(sourceSets.main.resources.srcDirs) {
- include "fabric.mod.json"
- expand "version": project.version
- }
-
- from(sourceSets.main.resources.srcDirs) {
- exclude "fabric.mod.json"
- }
-}
-
-// 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"
-}
-
-// 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
-}
-
-jar {
- from "LICENSE"
-}
-
-// 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()
- }
-}
+plugins {
+ id 'fabric-loom' version '0.5-SNAPSHOT'
+ id 'maven-publish'
+}
+
+sourceCompatibility = JavaVersion.VERSION_1_8
+targetCompatibility = JavaVersion.VERSION_1_8
+
+archivesBaseName = project.archives_base_name
+version = project.mod_version
+group = project.maven_group
+
+repositories {
+ maven { url "https://maven.dblsaiko.net/" }
+ maven { url "http://server.bbkr.space:8081/artifactory/libs-release/" }
+ maven { url "https://maven.fabricmc.net/" }
+ maven { url 'https://jitpack.io' }
+ jcenter()
+}
+
+dependencies {
+ minecraft "com.mojang:minecraft:${project.minecraft_version}"
+ mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_mappings}:v2"
+ modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
+ modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
+
+ optional "me.shedaniel:RoughlyEnoughItems:${project.rei_version}"
+ optional "me.shedaniel:RoughlyEnoughItems-api:${project.rei_version}"
+ optional "grondag:canvas-mc116:${project.canvas_version}"
+}
+
+def optional(String dep) {
+ dependencies.modRuntime (dep) {
+ exclude group: "net.fabricmc.fabric-api"
+ exclude module: "fabric-loader"
+ }
+ dependencies.modCompileOnly (dep) {
+ exclude group: "net.fabricmc.fabric-api"
+ exclude module: "fabric-loader"
+ }
+}
+
+processResources {
+ inputs.property "version", project.version
+
+ from(sourceSets.main.resources.srcDirs) {
+ include "fabric.mod.json"
+ expand "version": project.version
+ }
+
+ from(sourceSets.main.resources.srcDirs) {
+ exclude "fabric.mod.json"
+ }
+}
+
+// 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"
+}
+
+// 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
+}
+
+jar {
+ from "LICENSE"
+}
+
+// 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()
+ }
+}
diff --git a/gradle.properties b/gradle.properties
index d72bf12a..05790c36 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,21 +1,21 @@
-# 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.4
- yarn_mappings = 1
- loader_version = 0.10.6+build.214
-
-# Mod Properties
- mod_version = 0.6.0-beta
- 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
- fabric_version = 0.25.1+build.416-1.16
- cloth_config_version = 4.8.2
- cloth_events_version = 1.4.8
- canvas_version = 1.0.+
+# 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.4
+ yarn_mappings = 1
+ loader_version = 0.10.6+build.214
+
+# Mod Properties
+ mod_version = 0.6.0-beta
+ 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
+ fabric_version = 0.25.1+build.416-1.16
+ cloth_config_version = 4.8.2
+ cloth_events_version = 1.4.8
+ canvas_version = 1.0.+
rei_version = 5.6.2
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 622ab64a..99c200fc 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index 2fe81a7d..accc54f8 100644
--- a/gradlew
+++ b/gradlew
@@ -1,183 +1,183 @@
-#!/usr/bin/env sh
-
-#
-# 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.
-# You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-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
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-APP_NAME="Gradle"
-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"
-
-warn () {
- echo "$*"
-}
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# 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
- ;;
- 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"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- 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
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-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
-
-# 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" = "true" -o "$msys" = "true" ] ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # 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
-
-# Escape application args
-save () {
- for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
- echo " "
-}
-APP_ARGS=`save "$@"`
-
-# 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" "$@"
+#!/usr/bin/env sh
+
+#
+# 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.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+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
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+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"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# 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
+ ;;
+ 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"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ 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
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+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
+
+# 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" = "true" -o "$msys" = "true" ] ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # 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
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=`save "$@"`
+
+# 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" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index 62bd9b9c..9109989e 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,103 +1,103 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-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 %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+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 %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/json/block/%name%.json b/json/block/%name%.json
index 15906496..10f7880a 100644
--- a/json/block/%name%.json
+++ b/json/block/%name%.json
@@ -1,6 +1,6 @@
-{
- "parent": "block/cube_all",
- "textures": {
- "all": "betterend:block/%name%"
- }
+{
+ "parent": "block/cube_all",
+ "textures": {
+ "all": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_brick_half_slab.json b/json/block/%name%_brick_half_slab.json
index 7a4235f3..4a5be990 100644
--- a/json/block/%name%_brick_half_slab.json
+++ b/json/block/%name%_brick_half_slab.json
@@ -1,8 +1,8 @@
-{
- "parent": "block/slab",
- "textures": {
- "bottom": "betterend:block/%name%_bricks",
- "side": "betterend:block/%name%_bricks",
- "top": "betterend:block/%name%_bricks"
- }
+{
+ "parent": "block/slab",
+ "textures": {
+ "bottom": "betterend:block/%name%_bricks",
+ "side": "betterend:block/%name%_bricks",
+ "top": "betterend:block/%name%_bricks"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_brick_inner_stairs.json b/json/block/%name%_brick_inner_stairs.json
index cb848187..98c27d1f 100644
--- a/json/block/%name%_brick_inner_stairs.json
+++ b/json/block/%name%_brick_inner_stairs.json
@@ -1,8 +1,8 @@
-{
- "parent": "block/inner_stairs",
- "textures": {
- "bottom": "betterend:block/%name%_bricks",
- "side": "betterend:block/%name%_bricks",
- "top": "betterend:block/%name%_bricks"
- }
+{
+ "parent": "block/inner_stairs",
+ "textures": {
+ "bottom": "betterend:block/%name%_bricks",
+ "side": "betterend:block/%name%_bricks",
+ "top": "betterend:block/%name%_bricks"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_brick_outer_stairs.json b/json/block/%name%_brick_outer_stairs.json
index f24d5f40..5fe881ad 100644
--- a/json/block/%name%_brick_outer_stairs.json
+++ b/json/block/%name%_brick_outer_stairs.json
@@ -1,8 +1,8 @@
-{
- "parent": "block/outer_stairs",
- "textures": {
- "bottom": "betterend:block/%name%_bricks",
- "side": "betterend:block/%name%_bricks",
- "top": "betterend:block/%name%_bricks"
- }
+{
+ "parent": "block/outer_stairs",
+ "textures": {
+ "bottom": "betterend:block/%name%_bricks",
+ "side": "betterend:block/%name%_bricks",
+ "top": "betterend:block/%name%_bricks"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_brick_stairs.json b/json/block/%name%_brick_stairs.json
index 938c1cb5..ee695265 100644
--- a/json/block/%name%_brick_stairs.json
+++ b/json/block/%name%_brick_stairs.json
@@ -1,8 +1,8 @@
-{
- "parent": "block/stairs",
- "textures": {
- "bottom": "betterend:block/%name%_bricks",
- "side": "betterend:block/%name%_bricks",
- "top": "betterend:block/%name%_bricks"
- }
+{
+ "parent": "block/stairs",
+ "textures": {
+ "bottom": "betterend:block/%name%_bricks",
+ "side": "betterend:block/%name%_bricks",
+ "top": "betterend:block/%name%_bricks"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_brick_wall_inventory.json b/json/block/%name%_brick_wall_inventory.json
index 2bd3956f..f5616dc9 100644
--- a/json/block/%name%_brick_wall_inventory.json
+++ b/json/block/%name%_brick_wall_inventory.json
@@ -1,6 +1,6 @@
-{
- "parent": "minecraft:block/wall_inventory",
- "textures": {
- "wall": "betterend:block/%name%_bricks"
- }
+{
+ "parent": "minecraft:block/wall_inventory",
+ "textures": {
+ "wall": "betterend:block/%name%_bricks"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_brick_wall_post.json b/json/block/%name%_brick_wall_post.json
index 5816f7ae..3e23f8a3 100644
--- a/json/block/%name%_brick_wall_post.json
+++ b/json/block/%name%_brick_wall_post.json
@@ -1,6 +1,6 @@
-{
- "parent": "minecraft:block/template_wall_post",
- "textures": {
- "wall": "betterend:block/%name%_bricks"
- }
+{
+ "parent": "minecraft:block/template_wall_post",
+ "textures": {
+ "wall": "betterend:block/%name%_bricks"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_brick_wall_side.json b/json/block/%name%_brick_wall_side.json
index f9da149c..e95d0502 100644
--- a/json/block/%name%_brick_wall_side.json
+++ b/json/block/%name%_brick_wall_side.json
@@ -1,6 +1,6 @@
-{
- "parent": "minecraft:block/template_wall_side",
- "textures": {
- "wall": "betterend:block/%name%_bricks"
- }
+{
+ "parent": "minecraft:block/template_wall_side",
+ "textures": {
+ "wall": "betterend:block/%name%_bricks"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_brick_wall_side_tall.json b/json/block/%name%_brick_wall_side_tall.json
index dc1b0743..7323cbfb 100644
--- a/json/block/%name%_brick_wall_side_tall.json
+++ b/json/block/%name%_brick_wall_side_tall.json
@@ -1,6 +1,6 @@
-{
- "parent": "minecraft:block/template_wall_side_tall",
- "textures": {
- "wall": "betterend:block/%name%_bricks"
- }
+{
+ "parent": "minecraft:block/template_wall_side_tall",
+ "textures": {
+ "wall": "betterend:block/%name%_bricks"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_bricks.json b/json/block/%name%_bricks.json
index f218c0fe..5f68cf77 100644
--- a/json/block/%name%_bricks.json
+++ b/json/block/%name%_bricks.json
@@ -1,6 +1,6 @@
-{
- "parent": "block/cube_all",
- "textures": {
- "all": "betterend:block/%name%_bricks"
- }
+{
+ "parent": "block/cube_all",
+ "textures": {
+ "all": "betterend:block/%name%_bricks"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_button.json b/json/block/%name%_button.json
index a2e8c3ce..4a465cf5 100644
--- a/json/block/%name%_button.json
+++ b/json/block/%name%_button.json
@@ -1,6 +1,6 @@
-{
- "parent": "block/button",
- "textures": {
- "texture": "betterend:block/%name%"
- }
+{
+ "parent": "block/button",
+ "textures": {
+ "texture": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_button_inventory.json b/json/block/%name%_button_inventory.json
index 42b61783..e04a286b 100644
--- a/json/block/%name%_button_inventory.json
+++ b/json/block/%name%_button_inventory.json
@@ -1,6 +1,6 @@
-{
- "parent": "block/button_inventory",
- "textures": {
- "texture": "betterend:block/%name%"
- }
+{
+ "parent": "block/button_inventory",
+ "textures": {
+ "texture": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_button_pressed.json b/json/block/%name%_button_pressed.json
index d0094062..5afc1c34 100644
--- a/json/block/%name%_button_pressed.json
+++ b/json/block/%name%_button_pressed.json
@@ -1,6 +1,6 @@
-{
- "parent": "block/button_pressed",
- "textures": {
- "texture": "betterend:block/%name%"
- }
+{
+ "parent": "block/button_pressed",
+ "textures": {
+ "texture": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_half_slab.json b/json/block/%name%_half_slab.json
index 9d5489c1..afe17edd 100644
--- a/json/block/%name%_half_slab.json
+++ b/json/block/%name%_half_slab.json
@@ -1,8 +1,8 @@
-{
- "parent": "block/slab",
- "textures": {
- "bottom": "betterend:block/%name%",
- "side": "betterend:block/%name%",
- "top": "betterend:block/%name%"
- }
+{
+ "parent": "block/slab",
+ "textures": {
+ "bottom": "betterend:block/%name%",
+ "side": "betterend:block/%name%",
+ "top": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_inner_stairs.json b/json/block/%name%_inner_stairs.json
index e95454c6..f7f22430 100644
--- a/json/block/%name%_inner_stairs.json
+++ b/json/block/%name%_inner_stairs.json
@@ -1,8 +1,8 @@
-{
- "parent": "block/inner_stairs",
- "textures": {
- "bottom": "betterend:block/%name%",
- "side": "betterend:block/%name%",
- "top": "betterend:block/%name%"
- }
+{
+ "parent": "block/inner_stairs",
+ "textures": {
+ "bottom": "betterend:block/%name%",
+ "side": "betterend:block/%name%",
+ "top": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_outer_stairs.json b/json/block/%name%_outer_stairs.json
index 670e267d..2c6740d1 100644
--- a/json/block/%name%_outer_stairs.json
+++ b/json/block/%name%_outer_stairs.json
@@ -1,8 +1,8 @@
-{
- "parent": "block/outer_stairs",
- "textures": {
- "bottom": "betterend:block/%name%",
- "side": "betterend:block/%name%",
- "top": "betterend:block/%name%"
- }
+{
+ "parent": "block/outer_stairs",
+ "textures": {
+ "bottom": "betterend:block/%name%",
+ "side": "betterend:block/%name%",
+ "top": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_pillar.json b/json/block/%name%_pillar.json
index 837248a3..abb46a9d 100644
--- a/json/block/%name%_pillar.json
+++ b/json/block/%name%_pillar.json
@@ -1,7 +1,7 @@
-{
- "parent": "minecraft:block/cube_column",
- "textures": {
- "end": "betterend:block/%name%_pillar_top",
- "side": "betterend:block/%name%_pillar_side"
- }
+{
+ "parent": "minecraft:block/cube_column",
+ "textures": {
+ "end": "betterend:block/%name%_pillar_top",
+ "side": "betterend:block/%name%_pillar_side"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_pressure_plate_down.json b/json/block/%name%_pressure_plate_down.json
index ef2fec3b..0836b6f5 100644
--- a/json/block/%name%_pressure_plate_down.json
+++ b/json/block/%name%_pressure_plate_down.json
@@ -1,6 +1,6 @@
-{
- "parent": "block/pressure_plate_down",
- "textures": {
- "texture": "betterend:block/%name%"
- }
+{
+ "parent": "block/pressure_plate_down",
+ "textures": {
+ "texture": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_pressure_plate_up.json b/json/block/%name%_pressure_plate_up.json
index 9fe8a247..655f909b 100644
--- a/json/block/%name%_pressure_plate_up.json
+++ b/json/block/%name%_pressure_plate_up.json
@@ -1,6 +1,6 @@
-{
- "parent": "block/pressure_plate_up",
- "textures": {
- "texture": "betterend:block/%name%"
- }
+{
+ "parent": "block/pressure_plate_up",
+ "textures": {
+ "texture": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_small_tiles.json b/json/block/%name%_small_tiles.json
index a0c1a8eb..b81bf3b0 100644
--- a/json/block/%name%_small_tiles.json
+++ b/json/block/%name%_small_tiles.json
@@ -1,6 +1,6 @@
-{
- "parent": "block/cube_all",
- "textures": {
- "all": "betterend:block/%name%_small_tiles"
- }
+{
+ "parent": "block/cube_all",
+ "textures": {
+ "all": "betterend:block/%name%_small_tiles"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_stairs.json b/json/block/%name%_stairs.json
index 61115016..1aee442b 100644
--- a/json/block/%name%_stairs.json
+++ b/json/block/%name%_stairs.json
@@ -1,8 +1,8 @@
-{
- "parent": "block/stairs",
- "textures": {
- "bottom": "betterend:block/%name%",
- "side": "betterend:block/%name%",
- "top": "betterend:block/%name%"
- }
+{
+ "parent": "block/stairs",
+ "textures": {
+ "bottom": "betterend:block/%name%",
+ "side": "betterend:block/%name%",
+ "top": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_tile.json b/json/block/%name%_tile.json
index 632959b1..211afd9d 100644
--- a/json/block/%name%_tile.json
+++ b/json/block/%name%_tile.json
@@ -1,6 +1,6 @@
-{
- "parent": "block/cube_all",
- "textures": {
- "all": "betterend:block/%name%_tile"
- }
+{
+ "parent": "block/cube_all",
+ "textures": {
+ "all": "betterend:block/%name%_tile"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_wall_inventory.json b/json/block/%name%_wall_inventory.json
index fdb5d169..35d05c72 100644
--- a/json/block/%name%_wall_inventory.json
+++ b/json/block/%name%_wall_inventory.json
@@ -1,6 +1,6 @@
-{
- "parent": "minecraft:block/wall_inventory",
- "textures": {
- "wall": "betterend:block/%name%"
- }
+{
+ "parent": "minecraft:block/wall_inventory",
+ "textures": {
+ "wall": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_wall_post.json b/json/block/%name%_wall_post.json
index 2c3195b1..f668ca4b 100644
--- a/json/block/%name%_wall_post.json
+++ b/json/block/%name%_wall_post.json
@@ -1,6 +1,6 @@
-{
- "parent": "minecraft:block/template_wall_post",
- "textures": {
- "wall": "betterend:block/%name%"
- }
+{
+ "parent": "minecraft:block/template_wall_post",
+ "textures": {
+ "wall": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_wall_side.json b/json/block/%name%_wall_side.json
index 2c228e96..6fc8de4b 100644
--- a/json/block/%name%_wall_side.json
+++ b/json/block/%name%_wall_side.json
@@ -1,6 +1,6 @@
-{
- "parent": "minecraft:block/template_wall_side",
- "textures": {
- "wall": "betterend:block/%name%"
- }
+{
+ "parent": "minecraft:block/template_wall_side",
+ "textures": {
+ "wall": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/block/%name%_wall_side_tall.json b/json/block/%name%_wall_side_tall.json
index 4eeefe22..9570ac1a 100644
--- a/json/block/%name%_wall_side_tall.json
+++ b/json/block/%name%_wall_side_tall.json
@@ -1,6 +1,6 @@
-{
- "parent": "minecraft:block/template_wall_side_tall",
- "textures": {
- "wall": "betterend:block/%name%"
- }
+{
+ "parent": "minecraft:block/template_wall_side_tall",
+ "textures": {
+ "wall": "betterend:block/%name%"
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%.json b/json/blockstates/%name%.json
index 79dd6729..ef978798 100644
--- a/json/blockstates/%name%.json
+++ b/json/blockstates/%name%.json
@@ -1,7 +1,7 @@
-{
- "variants": {
- "": {
- "model": "betterend:block/%name%"
- }
- }
+{
+ "variants": {
+ "": {
+ "model": "betterend:block/%name%"
+ }
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_brick_slab.json b/json/blockstates/%name%_brick_slab.json
index 582099a0..d5a6bf3e 100644
--- a/json/blockstates/%name%_brick_slab.json
+++ b/json/blockstates/%name%_brick_slab.json
@@ -1,15 +1,15 @@
-{
- "variants": {
- "type=bottom": {
- "model": "betterend:block/%name%_brick_half_slab"
- },
- "type=double": {
- "model": "betterend:block/%name%_bricks"
- },
- "type=top": {
- "model": "betterend:block/%name%_brick_half_slab",
- "uvlock": true,
- "x": 180
- }
- }
+{
+ "variants": {
+ "type=bottom": {
+ "model": "betterend:block/%name%_brick_half_slab"
+ },
+ "type=double": {
+ "model": "betterend:block/%name%_bricks"
+ },
+ "type=top": {
+ "model": "betterend:block/%name%_brick_half_slab",
+ "uvlock": true,
+ "x": 180
+ }
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_brick_stairs.json b/json/blockstates/%name%_brick_stairs.json
index 85e24d01..97fbabb4 100644
--- a/json/blockstates/%name%_brick_stairs.json
+++ b/json/blockstates/%name%_brick_stairs.json
@@ -1,209 +1,209 @@
-{
- "variants": {
- "facing=east,half=bottom,shape=inner_left": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "y": 270
- },
- "facing=east,half=bottom,shape=inner_right": {
- "model": "betterend:block/%name%_brick_inner_stairs"
- },
- "facing=east,half=bottom,shape=outer_left": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "y": 270
- },
- "facing=east,half=bottom,shape=outer_right": {
- "model": "betterend:block/%name%_brick_outer_stairs"
- },
- "facing=east,half=bottom,shape=straight": {
- "model": "betterend:block/%name%_brick_stairs"
- },
- "facing=east,half=top,shape=inner_left": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "x": 180
- },
- "facing=east,half=top,shape=inner_right": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 90
- },
- "facing=east,half=top,shape=outer_left": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "x": 180
- },
- "facing=east,half=top,shape=outer_right": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 90
- },
- "facing=east,half=top,shape=straight": {
- "model": "betterend:block/%name%_brick_stairs",
- "uvlock": true,
- "x": 180
- },
- "facing=north,half=bottom,shape=inner_left": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "y": 180
- },
- "facing=north,half=bottom,shape=inner_right": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "y": 270
- },
- "facing=north,half=bottom,shape=outer_left": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "y": 180
- },
- "facing=north,half=bottom,shape=outer_right": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "y": 270
- },
- "facing=north,half=bottom,shape=straight": {
- "model": "betterend:block/%name%_brick_stairs",
- "uvlock": true,
- "y": 270
- },
- "facing=north,half=top,shape=inner_left": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 270
- },
- "facing=north,half=top,shape=inner_right": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "x": 180
- },
- "facing=north,half=top,shape=outer_left": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 270
- },
- "facing=north,half=top,shape=outer_right": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "x": 180
- },
- "facing=north,half=top,shape=straight": {
- "model": "betterend:block/%name%_brick_stairs",
- "uvlock": true,
- "x": 180,
- "y": 270
- },
- "facing=south,half=bottom,shape=inner_left": {
- "model": "betterend:block/%name%_brick_inner_stairs"
- },
- "facing=south,half=bottom,shape=inner_right": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "y": 90
- },
- "facing=south,half=bottom,shape=outer_left": {
- "model": "betterend:block/%name%_brick_outer_stairs"
- },
- "facing=south,half=bottom,shape=outer_right": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "y": 90
- },
- "facing=south,half=bottom,shape=straight": {
- "model": "betterend:block/%name%_brick_stairs",
- "uvlock": true,
- "y": 90
- },
- "facing=south,half=top,shape=inner_left": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 90
- },
- "facing=south,half=top,shape=inner_right": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 180
- },
- "facing=south,half=top,shape=outer_left": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 90
- },
- "facing=south,half=top,shape=outer_right": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 180
- },
- "facing=south,half=top,shape=straight": {
- "model": "betterend:block/%name%_brick_stairs",
- "uvlock": true,
- "x": 180,
- "y": 90
- },
- "facing=west,half=bottom,shape=inner_left": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "y": 90
- },
- "facing=west,half=bottom,shape=inner_right": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "y": 180
- },
- "facing=west,half=bottom,shape=outer_left": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "y": 90
- },
- "facing=west,half=bottom,shape=outer_right": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "y": 180
- },
- "facing=west,half=bottom,shape=straight": {
- "model": "betterend:block/%name%_brick_stairs",
- "uvlock": true,
- "y": 180
- },
- "facing=west,half=top,shape=inner_left": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 180
- },
- "facing=west,half=top,shape=inner_right": {
- "model": "betterend:block/%name%_brick_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 270
- },
- "facing=west,half=top,shape=outer_left": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 180
- },
- "facing=west,half=top,shape=outer_right": {
- "model": "betterend:block/%name%_brick_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 270
- },
- "facing=west,half=top,shape=straight": {
- "model": "betterend:block/%name%_brick_stairs",
- "uvlock": true,
- "x": 180,
- "y": 180
- }
- }
+{
+ "variants": {
+ "facing=east,half=bottom,shape=inner_left": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "y": 270
+ },
+ "facing=east,half=bottom,shape=inner_right": {
+ "model": "betterend:block/%name%_brick_inner_stairs"
+ },
+ "facing=east,half=bottom,shape=outer_left": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "y": 270
+ },
+ "facing=east,half=bottom,shape=outer_right": {
+ "model": "betterend:block/%name%_brick_outer_stairs"
+ },
+ "facing=east,half=bottom,shape=straight": {
+ "model": "betterend:block/%name%_brick_stairs"
+ },
+ "facing=east,half=top,shape=inner_left": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "x": 180
+ },
+ "facing=east,half=top,shape=inner_right": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 90
+ },
+ "facing=east,half=top,shape=outer_left": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "x": 180
+ },
+ "facing=east,half=top,shape=outer_right": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 90
+ },
+ "facing=east,half=top,shape=straight": {
+ "model": "betterend:block/%name%_brick_stairs",
+ "uvlock": true,
+ "x": 180
+ },
+ "facing=north,half=bottom,shape=inner_left": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "y": 180
+ },
+ "facing=north,half=bottom,shape=inner_right": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "y": 270
+ },
+ "facing=north,half=bottom,shape=outer_left": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "y": 180
+ },
+ "facing=north,half=bottom,shape=outer_right": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "y": 270
+ },
+ "facing=north,half=bottom,shape=straight": {
+ "model": "betterend:block/%name%_brick_stairs",
+ "uvlock": true,
+ "y": 270
+ },
+ "facing=north,half=top,shape=inner_left": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 270
+ },
+ "facing=north,half=top,shape=inner_right": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "x": 180
+ },
+ "facing=north,half=top,shape=outer_left": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 270
+ },
+ "facing=north,half=top,shape=outer_right": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "x": 180
+ },
+ "facing=north,half=top,shape=straight": {
+ "model": "betterend:block/%name%_brick_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 270
+ },
+ "facing=south,half=bottom,shape=inner_left": {
+ "model": "betterend:block/%name%_brick_inner_stairs"
+ },
+ "facing=south,half=bottom,shape=inner_right": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "y": 90
+ },
+ "facing=south,half=bottom,shape=outer_left": {
+ "model": "betterend:block/%name%_brick_outer_stairs"
+ },
+ "facing=south,half=bottom,shape=outer_right": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "y": 90
+ },
+ "facing=south,half=bottom,shape=straight": {
+ "model": "betterend:block/%name%_brick_stairs",
+ "uvlock": true,
+ "y": 90
+ },
+ "facing=south,half=top,shape=inner_left": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 90
+ },
+ "facing=south,half=top,shape=inner_right": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 180
+ },
+ "facing=south,half=top,shape=outer_left": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 90
+ },
+ "facing=south,half=top,shape=outer_right": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 180
+ },
+ "facing=south,half=top,shape=straight": {
+ "model": "betterend:block/%name%_brick_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 90
+ },
+ "facing=west,half=bottom,shape=inner_left": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "y": 90
+ },
+ "facing=west,half=bottom,shape=inner_right": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "y": 180
+ },
+ "facing=west,half=bottom,shape=outer_left": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "y": 90
+ },
+ "facing=west,half=bottom,shape=outer_right": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "y": 180
+ },
+ "facing=west,half=bottom,shape=straight": {
+ "model": "betterend:block/%name%_brick_stairs",
+ "uvlock": true,
+ "y": 180
+ },
+ "facing=west,half=top,shape=inner_left": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 180
+ },
+ "facing=west,half=top,shape=inner_right": {
+ "model": "betterend:block/%name%_brick_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 270
+ },
+ "facing=west,half=top,shape=outer_left": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 180
+ },
+ "facing=west,half=top,shape=outer_right": {
+ "model": "betterend:block/%name%_brick_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 270
+ },
+ "facing=west,half=top,shape=straight": {
+ "model": "betterend:block/%name%_brick_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 180
+ }
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_brick_wall.json b/json/blockstates/%name%_brick_wall.json
index a3e02377..17f3910d 100644
--- a/json/blockstates/%name%_brick_wall.json
+++ b/json/blockstates/%name%_brick_wall.json
@@ -1,90 +1,90 @@
-{
- "multipart": [
- {
- "when": {
- "up": "true"
- },
- "apply": {
- "model": "betterend:block/%name%_brick_wall_post"
- }
- },
- {
- "when": {
- "north": "low"
- },
- "apply": {
- "model": "betterend:block/%name%_brick_wall_side",
- "uvlock": true
- }
- },
- {
- "when": {
- "east": "low"
- },
- "apply": {
- "model": "betterend:block/%name%_brick_wall_side",
- "y": 90,
- "uvlock": true
- }
- },
- {
- "when": {
- "south": "low"
- },
- "apply": {
- "model": "betterend:block/%name%_brick_wall_side",
- "y": 180,
- "uvlock": true
- }
- },
- {
- "when": {
- "west": "low"
- },
- "apply": {
- "model": "betterend:block/%name%_brick_wall_side",
- "y": 270,
- "uvlock": true
- }
- },
- {
- "when": {
- "north": "tall"
- },
- "apply": {
- "model": "betterend:block/%name%_brick_wall_side_tall",
- "uvlock": true
- }
- },
- {
- "when": {
- "east": "tall"
- },
- "apply": {
- "model": "betterend:block/%name%_brick_wall_side_tall",
- "y": 90,
- "uvlock": true
- }
- },
- {
- "when": {
- "south": "tall"
- },
- "apply": {
- "model": "betterend:block/%name%_brick_wall_side_tall",
- "y": 180,
- "uvlock": true
- }
- },
- {
- "when": {
- "west": "tall"
- },
- "apply": {
- "model": "betterend:block/%name%_brick_wall_side_tall",
- "y": 270,
- "uvlock": true
- }
- }
- ]
+{
+ "multipart": [
+ {
+ "when": {
+ "up": "true"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_brick_wall_post"
+ }
+ },
+ {
+ "when": {
+ "north": "low"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_brick_wall_side",
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "east": "low"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_brick_wall_side",
+ "y": 90,
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "south": "low"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_brick_wall_side",
+ "y": 180,
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "west": "low"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_brick_wall_side",
+ "y": 270,
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "north": "tall"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_brick_wall_side_tall",
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "east": "tall"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_brick_wall_side_tall",
+ "y": 90,
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "south": "tall"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_brick_wall_side_tall",
+ "y": 180,
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "west": "tall"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_brick_wall_side_tall",
+ "y": 270,
+ "uvlock": true
+ }
+ }
+ ]
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_bricks.json b/json/blockstates/%name%_bricks.json
index 59171c16..d55de86c 100644
--- a/json/blockstates/%name%_bricks.json
+++ b/json/blockstates/%name%_bricks.json
@@ -1,7 +1,7 @@
-{
- "variants": {
- "": {
- "model": "betterend:block/%name%_bricks"
- }
- }
+{
+ "variants": {
+ "": {
+ "model": "betterend:block/%name%_bricks"
+ }
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_button.json b/json/blockstates/%name%_button.json
index a65801cf..f0a946f9 100644
--- a/json/blockstates/%name%_button.json
+++ b/json/blockstates/%name%_button.json
@@ -1,118 +1,118 @@
-{
- "variants": {
- "face=ceiling,facing=east,powered=false": {
- "model": "betterend:block/%name%_button",
- "x": 180,
- "y": 270
- },
- "face=ceiling,facing=east,powered=true": {
- "model": "betterend:block/%name%_button_pressed",
- "x": 180,
- "y": 270
- },
- "face=ceiling,facing=north,powered=false": {
- "model": "betterend:block/%name%_button",
- "x": 180,
- "y": 180
- },
- "face=ceiling,facing=north,powered=true": {
- "model": "betterend:block/%name%_button_pressed",
- "x": 180,
- "y": 180
- },
- "face=ceiling,facing=south,powered=false": {
- "model": "betterend:block/%name%_button",
- "x": 180
- },
- "face=ceiling,facing=south,powered=true": {
- "model": "betterend:block/%name%_button_pressed",
- "x": 180
- },
- "face=ceiling,facing=west,powered=false": {
- "model": "betterend:block/%name%_button",
- "x": 180,
- "y": 90
- },
- "face=ceiling,facing=west,powered=true": {
- "model": "betterend:block/%name%_button_pressed",
- "x": 180,
- "y": 90
- },
- "face=floor,facing=east,powered=false": {
- "model": "betterend:block/%name%_button",
- "y": 90
- },
- "face=floor,facing=east,powered=true": {
- "model": "betterend:block/%name%_button_pressed",
- "y": 90
- },
- "face=floor,facing=north,powered=false": {
- "model": "betterend:block/%name%_button"
- },
- "face=floor,facing=north,powered=true": {
- "model": "betterend:block/%name%_button_pressed"
- },
- "face=floor,facing=south,powered=false": {
- "model": "betterend:block/%name%_button",
- "y": 180
- },
- "face=floor,facing=south,powered=true": {
- "model": "betterend:block/%name%_button_pressed",
- "y": 180
- },
- "face=floor,facing=west,powered=false": {
- "model": "betterend:block/%name%_button",
- "y": 270
- },
- "face=floor,facing=west,powered=true": {
- "model": "betterend:block/%name%_button_pressed",
- "y": 270
- },
- "face=wall,facing=east,powered=false": {
- "model": "betterend:block/%name%_button",
- "uvlock": true,
- "x": 90,
- "y": 90
- },
- "face=wall,facing=east,powered=true": {
- "model": "betterend:block/%name%_button_pressed",
- "uvlock": true,
- "x": 90,
- "y": 90
- },
- "face=wall,facing=north,powered=false": {
- "model": "betterend:block/%name%_button",
- "uvlock": true,
- "x": 90
- },
- "face=wall,facing=north,powered=true": {
- "model": "betterend:block/%name%_button_pressed",
- "uvlock": true,
- "x": 90
- },
- "face=wall,facing=south,powered=false": {
- "model": "betterend:block/%name%_button",
- "uvlock": true,
- "x": 90,
- "y": 180
- },
- "face=wall,facing=south,powered=true": {
- "model": "betterend:block/%name%_button_pressed",
- "uvlock": true,
- "x": 90,
- "y": 180
- },
- "face=wall,facing=west,powered=false": {
- "model": "betterend:block/%name%_button",
- "uvlock": true,
- "x": 90,
- "y": 270
- },
- "face=wall,facing=west,powered=true": {
- "model": "betterend:block/%name%_button_pressed",
- "uvlock": true,
- "x": 90,
- "y": 270
- }
- }
+{
+ "variants": {
+ "face=ceiling,facing=east,powered=false": {
+ "model": "betterend:block/%name%_button",
+ "x": 180,
+ "y": 270
+ },
+ "face=ceiling,facing=east,powered=true": {
+ "model": "betterend:block/%name%_button_pressed",
+ "x": 180,
+ "y": 270
+ },
+ "face=ceiling,facing=north,powered=false": {
+ "model": "betterend:block/%name%_button",
+ "x": 180,
+ "y": 180
+ },
+ "face=ceiling,facing=north,powered=true": {
+ "model": "betterend:block/%name%_button_pressed",
+ "x": 180,
+ "y": 180
+ },
+ "face=ceiling,facing=south,powered=false": {
+ "model": "betterend:block/%name%_button",
+ "x": 180
+ },
+ "face=ceiling,facing=south,powered=true": {
+ "model": "betterend:block/%name%_button_pressed",
+ "x": 180
+ },
+ "face=ceiling,facing=west,powered=false": {
+ "model": "betterend:block/%name%_button",
+ "x": 180,
+ "y": 90
+ },
+ "face=ceiling,facing=west,powered=true": {
+ "model": "betterend:block/%name%_button_pressed",
+ "x": 180,
+ "y": 90
+ },
+ "face=floor,facing=east,powered=false": {
+ "model": "betterend:block/%name%_button",
+ "y": 90
+ },
+ "face=floor,facing=east,powered=true": {
+ "model": "betterend:block/%name%_button_pressed",
+ "y": 90
+ },
+ "face=floor,facing=north,powered=false": {
+ "model": "betterend:block/%name%_button"
+ },
+ "face=floor,facing=north,powered=true": {
+ "model": "betterend:block/%name%_button_pressed"
+ },
+ "face=floor,facing=south,powered=false": {
+ "model": "betterend:block/%name%_button",
+ "y": 180
+ },
+ "face=floor,facing=south,powered=true": {
+ "model": "betterend:block/%name%_button_pressed",
+ "y": 180
+ },
+ "face=floor,facing=west,powered=false": {
+ "model": "betterend:block/%name%_button",
+ "y": 270
+ },
+ "face=floor,facing=west,powered=true": {
+ "model": "betterend:block/%name%_button_pressed",
+ "y": 270
+ },
+ "face=wall,facing=east,powered=false": {
+ "model": "betterend:block/%name%_button",
+ "uvlock": true,
+ "x": 90,
+ "y": 90
+ },
+ "face=wall,facing=east,powered=true": {
+ "model": "betterend:block/%name%_button_pressed",
+ "uvlock": true,
+ "x": 90,
+ "y": 90
+ },
+ "face=wall,facing=north,powered=false": {
+ "model": "betterend:block/%name%_button",
+ "uvlock": true,
+ "x": 90
+ },
+ "face=wall,facing=north,powered=true": {
+ "model": "betterend:block/%name%_button_pressed",
+ "uvlock": true,
+ "x": 90
+ },
+ "face=wall,facing=south,powered=false": {
+ "model": "betterend:block/%name%_button",
+ "uvlock": true,
+ "x": 90,
+ "y": 180
+ },
+ "face=wall,facing=south,powered=true": {
+ "model": "betterend:block/%name%_button_pressed",
+ "uvlock": true,
+ "x": 90,
+ "y": 180
+ },
+ "face=wall,facing=west,powered=false": {
+ "model": "betterend:block/%name%_button",
+ "uvlock": true,
+ "x": 90,
+ "y": 270
+ },
+ "face=wall,facing=west,powered=true": {
+ "model": "betterend:block/%name%_button_pressed",
+ "uvlock": true,
+ "x": 90,
+ "y": 270
+ }
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_pillar.json b/json/blockstates/%name%_pillar.json
index fddcfc6c..27ec0347 100644
--- a/json/blockstates/%name%_pillar.json
+++ b/json/blockstates/%name%_pillar.json
@@ -1,7 +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 }
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_plate.json b/json/blockstates/%name%_plate.json
index f8ad4900..4060f8da 100644
--- a/json/blockstates/%name%_plate.json
+++ b/json/blockstates/%name%_plate.json
@@ -1,10 +1,10 @@
-{
- "variants": {
- "powered=false": {
- "model": "betterend:block/%name%_pressure_plate_up"
- },
- "powered=true": {
- "model": "betterend:block/%name%_pressure_plate_down"
- }
- }
+{
+ "variants": {
+ "powered=false": {
+ "model": "betterend:block/%name%_pressure_plate_up"
+ },
+ "powered=true": {
+ "model": "betterend:block/%name%_pressure_plate_down"
+ }
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_slab.json b/json/blockstates/%name%_slab.json
index 5eafe1bc..17875e4c 100644
--- a/json/blockstates/%name%_slab.json
+++ b/json/blockstates/%name%_slab.json
@@ -1,15 +1,15 @@
-{
- "variants": {
- "type=bottom": {
- "model": "betterend:block/%name%_half_slab"
- },
- "type=double": {
- "model": "betterend:block/%name%"
- },
- "type=top": {
- "model": "betterend:block/%name%_half_slab",
- "uvlock": true,
- "x": 180
- }
- }
+{
+ "variants": {
+ "type=bottom": {
+ "model": "betterend:block/%name%_half_slab"
+ },
+ "type=double": {
+ "model": "betterend:block/%name%"
+ },
+ "type=top": {
+ "model": "betterend:block/%name%_half_slab",
+ "uvlock": true,
+ "x": 180
+ }
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_small_tiles.json b/json/blockstates/%name%_small_tiles.json
index 5913e0d4..5a84411b 100644
--- a/json/blockstates/%name%_small_tiles.json
+++ b/json/blockstates/%name%_small_tiles.json
@@ -1,7 +1,7 @@
-{
- "variants": {
- "": {
- "model": "betterend:block/%name%_small_tiles"
- }
- }
+{
+ "variants": {
+ "": {
+ "model": "betterend:block/%name%_small_tiles"
+ }
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_stairs.json b/json/blockstates/%name%_stairs.json
index e0a17faf..685e1861 100644
--- a/json/blockstates/%name%_stairs.json
+++ b/json/blockstates/%name%_stairs.json
@@ -1,209 +1,209 @@
-{
- "variants": {
- "facing=east,half=bottom,shape=inner_left": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "y": 270
- },
- "facing=east,half=bottom,shape=inner_right": {
- "model": "betterend:block/%name%_inner_stairs"
- },
- "facing=east,half=bottom,shape=outer_left": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "y": 270
- },
- "facing=east,half=bottom,shape=outer_right": {
- "model": "betterend:block/%name%_outer_stairs"
- },
- "facing=east,half=bottom,shape=straight": {
- "model": "betterend:block/%name%_stairs"
- },
- "facing=east,half=top,shape=inner_left": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "x": 180
- },
- "facing=east,half=top,shape=inner_right": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 90
- },
- "facing=east,half=top,shape=outer_left": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "x": 180
- },
- "facing=east,half=top,shape=outer_right": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 90
- },
- "facing=east,half=top,shape=straight": {
- "model": "betterend:block/%name%_stairs",
- "uvlock": true,
- "x": 180
- },
- "facing=north,half=bottom,shape=inner_left": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "y": 180
- },
- "facing=north,half=bottom,shape=inner_right": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "y": 270
- },
- "facing=north,half=bottom,shape=outer_left": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "y": 180
- },
- "facing=north,half=bottom,shape=outer_right": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "y": 270
- },
- "facing=north,half=bottom,shape=straight": {
- "model": "betterend:block/%name%_stairs",
- "uvlock": true,
- "y": 270
- },
- "facing=north,half=top,shape=inner_left": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 270
- },
- "facing=north,half=top,shape=inner_right": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "x": 180
- },
- "facing=north,half=top,shape=outer_left": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 270
- },
- "facing=north,half=top,shape=outer_right": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "x": 180
- },
- "facing=north,half=top,shape=straight": {
- "model": "betterend:block/%name%_stairs",
- "uvlock": true,
- "x": 180,
- "y": 270
- },
- "facing=south,half=bottom,shape=inner_left": {
- "model": "betterend:block/%name%_inner_stairs"
- },
- "facing=south,half=bottom,shape=inner_right": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "y": 90
- },
- "facing=south,half=bottom,shape=outer_left": {
- "model": "betterend:block/%name%_outer_stairs"
- },
- "facing=south,half=bottom,shape=outer_right": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "y": 90
- },
- "facing=south,half=bottom,shape=straight": {
- "model": "betterend:block/%name%_stairs",
- "uvlock": true,
- "y": 90
- },
- "facing=south,half=top,shape=inner_left": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 90
- },
- "facing=south,half=top,shape=inner_right": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 180
- },
- "facing=south,half=top,shape=outer_left": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 90
- },
- "facing=south,half=top,shape=outer_right": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 180
- },
- "facing=south,half=top,shape=straight": {
- "model": "betterend:block/%name%_stairs",
- "uvlock": true,
- "x": 180,
- "y": 90
- },
- "facing=west,half=bottom,shape=inner_left": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "y": 90
- },
- "facing=west,half=bottom,shape=inner_right": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "y": 180
- },
- "facing=west,half=bottom,shape=outer_left": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "y": 90
- },
- "facing=west,half=bottom,shape=outer_right": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "y": 180
- },
- "facing=west,half=bottom,shape=straight": {
- "model": "betterend:block/%name%_stairs",
- "uvlock": true,
- "y": 180
- },
- "facing=west,half=top,shape=inner_left": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 180
- },
- "facing=west,half=top,shape=inner_right": {
- "model": "betterend:block/%name%_inner_stairs",
- "uvlock": true,
- "x": 180,
- "y": 270
- },
- "facing=west,half=top,shape=outer_left": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 180
- },
- "facing=west,half=top,shape=outer_right": {
- "model": "betterend:block/%name%_outer_stairs",
- "uvlock": true,
- "x": 180,
- "y": 270
- },
- "facing=west,half=top,shape=straight": {
- "model": "betterend:block/%name%_stairs",
- "uvlock": true,
- "x": 180,
- "y": 180
- }
- }
+{
+ "variants": {
+ "facing=east,half=bottom,shape=inner_left": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "y": 270
+ },
+ "facing=east,half=bottom,shape=inner_right": {
+ "model": "betterend:block/%name%_inner_stairs"
+ },
+ "facing=east,half=bottom,shape=outer_left": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "y": 270
+ },
+ "facing=east,half=bottom,shape=outer_right": {
+ "model": "betterend:block/%name%_outer_stairs"
+ },
+ "facing=east,half=bottom,shape=straight": {
+ "model": "betterend:block/%name%_stairs"
+ },
+ "facing=east,half=top,shape=inner_left": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "x": 180
+ },
+ "facing=east,half=top,shape=inner_right": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 90
+ },
+ "facing=east,half=top,shape=outer_left": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "x": 180
+ },
+ "facing=east,half=top,shape=outer_right": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 90
+ },
+ "facing=east,half=top,shape=straight": {
+ "model": "betterend:block/%name%_stairs",
+ "uvlock": true,
+ "x": 180
+ },
+ "facing=north,half=bottom,shape=inner_left": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "y": 180
+ },
+ "facing=north,half=bottom,shape=inner_right": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "y": 270
+ },
+ "facing=north,half=bottom,shape=outer_left": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "y": 180
+ },
+ "facing=north,half=bottom,shape=outer_right": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "y": 270
+ },
+ "facing=north,half=bottom,shape=straight": {
+ "model": "betterend:block/%name%_stairs",
+ "uvlock": true,
+ "y": 270
+ },
+ "facing=north,half=top,shape=inner_left": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 270
+ },
+ "facing=north,half=top,shape=inner_right": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "x": 180
+ },
+ "facing=north,half=top,shape=outer_left": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 270
+ },
+ "facing=north,half=top,shape=outer_right": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "x": 180
+ },
+ "facing=north,half=top,shape=straight": {
+ "model": "betterend:block/%name%_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 270
+ },
+ "facing=south,half=bottom,shape=inner_left": {
+ "model": "betterend:block/%name%_inner_stairs"
+ },
+ "facing=south,half=bottom,shape=inner_right": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "y": 90
+ },
+ "facing=south,half=bottom,shape=outer_left": {
+ "model": "betterend:block/%name%_outer_stairs"
+ },
+ "facing=south,half=bottom,shape=outer_right": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "y": 90
+ },
+ "facing=south,half=bottom,shape=straight": {
+ "model": "betterend:block/%name%_stairs",
+ "uvlock": true,
+ "y": 90
+ },
+ "facing=south,half=top,shape=inner_left": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 90
+ },
+ "facing=south,half=top,shape=inner_right": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 180
+ },
+ "facing=south,half=top,shape=outer_left": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 90
+ },
+ "facing=south,half=top,shape=outer_right": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 180
+ },
+ "facing=south,half=top,shape=straight": {
+ "model": "betterend:block/%name%_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 90
+ },
+ "facing=west,half=bottom,shape=inner_left": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "y": 90
+ },
+ "facing=west,half=bottom,shape=inner_right": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "y": 180
+ },
+ "facing=west,half=bottom,shape=outer_left": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "y": 90
+ },
+ "facing=west,half=bottom,shape=outer_right": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "y": 180
+ },
+ "facing=west,half=bottom,shape=straight": {
+ "model": "betterend:block/%name%_stairs",
+ "uvlock": true,
+ "y": 180
+ },
+ "facing=west,half=top,shape=inner_left": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 180
+ },
+ "facing=west,half=top,shape=inner_right": {
+ "model": "betterend:block/%name%_inner_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 270
+ },
+ "facing=west,half=top,shape=outer_left": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 180
+ },
+ "facing=west,half=top,shape=outer_right": {
+ "model": "betterend:block/%name%_outer_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 270
+ },
+ "facing=west,half=top,shape=straight": {
+ "model": "betterend:block/%name%_stairs",
+ "uvlock": true,
+ "x": 180,
+ "y": 180
+ }
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_tile.json b/json/blockstates/%name%_tile.json
index 4dc91e5e..b9f56911 100644
--- a/json/blockstates/%name%_tile.json
+++ b/json/blockstates/%name%_tile.json
@@ -1,7 +1,7 @@
-{
- "variants": {
- "": {
- "model": "betterend:block/%name%_tile"
- }
- }
+{
+ "variants": {
+ "": {
+ "model": "betterend:block/%name%_tile"
+ }
+ }
}
\ No newline at end of file
diff --git a/json/blockstates/%name%_wall.json b/json/blockstates/%name%_wall.json
index 115da727..3d81eb45 100644
--- a/json/blockstates/%name%_wall.json
+++ b/json/blockstates/%name%_wall.json
@@ -1,90 +1,90 @@
-{
- "multipart": [
- {
- "when": {
- "up": "true"
- },
- "apply": {
- "model": "betterend:block/%name%_wall_post"
- }
- },
- {
- "when": {
- "north": "low"
- },
- "apply": {
- "model": "betterend:block/%name%_wall_side",
- "uvlock": true
- }
- },
- {
- "when": {
- "east": "low"
- },
- "apply": {
- "model": "betterend:block/%name%_wall_side",
- "y": 90,
- "uvlock": true
- }
- },
- {
- "when": {
- "south": "low"
- },
- "apply": {
- "model": "betterend:block/%name%_wall_side",
- "y": 180,
- "uvlock": true
- }
- },
- {
- "when": {
- "west": "low"
- },
- "apply": {
- "model": "betterend:block/%name%_wall_side",
- "y": 270,
- "uvlock": true
- }
- },
- {
- "when": {
- "north": "tall"
- },
- "apply": {
- "model": "betterend:block/%name%_wall_side_tall",
- "uvlock": true
- }
- },
- {
- "when": {
- "east": "tall"
- },
- "apply": {
- "model": "betterend:block/%name%_wall_side_tall",
- "y": 90,
- "uvlock": true
- }
- },
- {
- "when": {
- "south": "tall"
- },
- "apply": {
- "model": "betterend:block/%name%_wall_side_tall",
- "y": 180,
- "uvlock": true
- }
- },
- {
- "when": {
- "west": "tall"
- },
- "apply": {
- "model": "betterend:block/%name%_wall_side_tall",
- "y": 270,
- "uvlock": true
- }
- }
- ]
+{
+ "multipart": [
+ {
+ "when": {
+ "up": "true"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_wall_post"
+ }
+ },
+ {
+ "when": {
+ "north": "low"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_wall_side",
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "east": "low"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_wall_side",
+ "y": 90,
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "south": "low"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_wall_side",
+ "y": 180,
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "west": "low"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_wall_side",
+ "y": 270,
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "north": "tall"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_wall_side_tall",
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "east": "tall"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_wall_side_tall",
+ "y": 90,
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "south": "tall"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_wall_side_tall",
+ "y": 180,
+ "uvlock": true
+ }
+ },
+ {
+ "when": {
+ "west": "tall"
+ },
+ "apply": {
+ "model": "betterend:block/%name%_wall_side_tall",
+ "y": 270,
+ "uvlock": true
+ }
+ }
+ ]
}
\ No newline at end of file
diff --git a/json/blockstates/a.txt b/json/blockstates/a.txt
index 1a56d0c8..a21008f5 100644
--- a/json/blockstates/a.txt
+++ b/json/blockstates/a.txt
@@ -1,23 +1,23 @@
- ’®¬ ¢ ãáâனá⢥ D ¨¬¥¥â ¬¥âªã Data
- ‘¥à¨©ë© ®¬¥à ⮬ : C7B5-F673
-
- ‘®¤¥à¦¨¬®¥ ¯ ¯ª¨ D:\BetterEnd\Utilities\src\data\stone\blockstates
-
-11.10.2020 15:54
.
-11.10.2020 15:54 ..
-11.10.2020 15:50 103 %name%.json
-11.10.2020 15:51 110 %name%_bricks.json
-11.10.2020 15:54 382 %name%_brick_slab.json
-11.10.2020 15:53 7ÿ540 %name%_brick_stairs.json
-11.10.2020 15:52 1ÿ635 %name%_brick_wall.json
-26.09.2020 20:35 4ÿ006 %name%_button.json
-11.10.2020 15:50 253 %name%_pillar.json
-26.09.2020 20:35 241 %name%_plate.json
-26.09.2020 20:35 364 %name%_slab.json
-11.10.2020 15:50 115 %name%_small_tiles.json
-26.09.2020 20:35 7ÿ300 %name%_stairs.json
-11.10.2020 15:50 108 %name%_tile.json
-11.10.2020 15:52 1ÿ581 %name%_wall.json
-11.10.2020 15:58 0 a.txt
- 14 ä ©«®¢ 23ÿ738 ¡ ©â
- 2 ¯ ¯®ª 785ÿ301ÿ614ÿ592 ¡ ©â ᢮¡®¤®
+ ’®¬ ¢ ãáâனá⢥ D ¨¬¥¥â ¬¥âªã Data
+ ‘¥à¨©ë© ®¬¥à ⮬ : C7B5-F673
+
+ ‘®¤¥à¦¨¬®¥ ¯ ¯ª¨ D:\BetterEnd\Utilities\src\data\stone\blockstates
+
+11.10.2020 15:54 .
+11.10.2020 15:54 ..
+11.10.2020 15:50 103 %name%.json
+11.10.2020 15:51 110 %name%_bricks.json
+11.10.2020 15:54 382 %name%_brick_slab.json
+11.10.2020 15:53 7ÿ540 %name%_brick_stairs.json
+11.10.2020 15:52 1ÿ635 %name%_brick_wall.json
+26.09.2020 20:35 4ÿ006 %name%_button.json
+11.10.2020 15:50 253 %name%_pillar.json
+26.09.2020 20:35 241 %name%_plate.json
+26.09.2020 20:35 364 %name%_slab.json
+11.10.2020 15:50 115 %name%_small_tiles.json
+26.09.2020 20:35 7ÿ300 %name%_stairs.json
+11.10.2020 15:50 108 %name%_tile.json
+11.10.2020 15:52 1ÿ581 %name%_wall.json
+11.10.2020 15:58 0 a.txt
+ 14 ä ©«®¢ 23ÿ738 ¡ ©â
+ 2 ¯ ¯®ª 785ÿ301ÿ614ÿ592 ¡ ©â ᢮¡®¤®
diff --git a/json/item/%name%.json b/json/item/%name%.json
index 92b1fef5..82508cd3 100644
--- a/json/item/%name%.json
+++ b/json/item/%name%.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%"
+{
+ "parent": "betterend:block/%name%"
}
\ No newline at end of file
diff --git a/json/item/%name%_brick_slab.json b/json/item/%name%_brick_slab.json
index 32c1d293..c148cf65 100644
--- a/json/item/%name%_brick_slab.json
+++ b/json/item/%name%_brick_slab.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_brick_half_slab"
+{
+ "parent": "betterend:block/%name%_brick_half_slab"
}
\ No newline at end of file
diff --git a/json/item/%name%_brick_stairs.json b/json/item/%name%_brick_stairs.json
index 89ecaa54..24b61896 100644
--- a/json/item/%name%_brick_stairs.json
+++ b/json/item/%name%_brick_stairs.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_brick_stairs"
+{
+ "parent": "betterend:block/%name%_brick_stairs"
}
\ No newline at end of file
diff --git a/json/item/%name%_brick_wall.json b/json/item/%name%_brick_wall.json
index 8719d7c1..1e902ec4 100644
--- a/json/item/%name%_brick_wall.json
+++ b/json/item/%name%_brick_wall.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_brick_wall_inventory"
+{
+ "parent": "betterend:block/%name%_brick_wall_inventory"
}
\ No newline at end of file
diff --git a/json/item/%name%_bricks.json b/json/item/%name%_bricks.json
index 14d8a30b..56ce6003 100644
--- a/json/item/%name%_bricks.json
+++ b/json/item/%name%_bricks.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_bricks"
+{
+ "parent": "betterend:block/%name%_bricks"
}
\ No newline at end of file
diff --git a/json/item/%name%_button.json b/json/item/%name%_button.json
index 3dc32368..240fb2d7 100644
--- a/json/item/%name%_button.json
+++ b/json/item/%name%_button.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_button_inventory"
+{
+ "parent": "betterend:block/%name%_button_inventory"
}
\ No newline at end of file
diff --git a/json/item/%name%_pillar.json b/json/item/%name%_pillar.json
index 0f7de019..a6257b38 100644
--- a/json/item/%name%_pillar.json
+++ b/json/item/%name%_pillar.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_pillar"
+{
+ "parent": "betterend:block/%name%_pillar"
}
\ No newline at end of file
diff --git a/json/item/%name%_plate.json b/json/item/%name%_plate.json
index 484a02f9..d774f9bc 100644
--- a/json/item/%name%_plate.json
+++ b/json/item/%name%_plate.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_pressure_plate_up"
+{
+ "parent": "betterend:block/%name%_pressure_plate_up"
}
\ No newline at end of file
diff --git a/json/item/%name%_slab.json b/json/item/%name%_slab.json
index f6853e03..1c83dcd9 100644
--- a/json/item/%name%_slab.json
+++ b/json/item/%name%_slab.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_half_slab"
+{
+ "parent": "betterend:block/%name%_half_slab"
}
\ No newline at end of file
diff --git a/json/item/%name%_small_tiles.json b/json/item/%name%_small_tiles.json
index 2d8006df..46e284e5 100644
--- a/json/item/%name%_small_tiles.json
+++ b/json/item/%name%_small_tiles.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_small_tiles"
+{
+ "parent": "betterend:block/%name%_small_tiles"
}
\ No newline at end of file
diff --git a/json/item/%name%_stairs.json b/json/item/%name%_stairs.json
index 0f51c6ec..c4871532 100644
--- a/json/item/%name%_stairs.json
+++ b/json/item/%name%_stairs.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_stairs"
+{
+ "parent": "betterend:block/%name%_stairs"
}
\ No newline at end of file
diff --git a/json/item/%name%_tile.json b/json/item/%name%_tile.json
index 4b981468..ad863533 100644
--- a/json/item/%name%_tile.json
+++ b/json/item/%name%_tile.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_tile"
+{
+ "parent": "betterend:block/%name%_tile"
}
\ No newline at end of file
diff --git a/json/item/%name%_wall.json b/json/item/%name%_wall.json
index eee0e6ae..59b31173 100644
--- a/json/item/%name%_wall.json
+++ b/json/item/%name%_wall.json
@@ -1,3 +1,3 @@
-{
- "parent": "betterend:block/%name%_wall_inventory"
+{
+ "parent": "betterend:block/%name%_wall_inventory"
}
\ No newline at end of file
diff --git a/json/item/a.txt b/json/item/a.txt
index 3a43dcf5..2cbe5c81 100644
--- a/json/item/a.txt
+++ b/json/item/a.txt
@@ -1,23 +1,23 @@
- ’®¬ ¢ ãáâனá⢥ D ¨¬¥¥â ¬¥âªã Data
- ‘¥à¨©ë© ®¬¥à ⮬ : C7B5-F673
-
- ‘®¤¥à¦¨¬®¥ ¯ ¯ª¨ D:\BetterEnd\Utilities\src\data\stone\item
-
-11.10.2020 15:55 .
-11.10.2020 15:55 ..
-11.10.2020 15:42 44 %name%.json
-11.10.2020 15:46 51 %name%_bricks.json
-11.10.2020 15:47 55 %name%_brick_slab.json
-11.10.2020 15:46 57 %name%_brick_stairs.json
-11.10.2020 15:47 65 %name%_brick_wall.json
-11.10.2020 15:48 61 %name%_button.json
-11.10.2020 15:43 51 %name%_pillar.json
-26.09.2020 20:36 62 %name%_plate.json
-11.10.2020 15:43 49 %name%_slab.json
-11.10.2020 15:43 56 %name%_small_tiles.json
-11.10.2020 15:43 51 %name%_stairs.json
-11.10.2020 15:43 49 %name%_tile.json
-11.10.2020 15:47 59 %name%_wall.json
-11.10.2020 15:55 0 a.txt
- 14 ä ©«®¢ 710 ¡ ©â
- 2 ¯ ¯®ª 785ÿ301ÿ659ÿ648 ¡ ©â ᢮¡®¤®
+ ’®¬ ¢ ãáâனá⢥ D ¨¬¥¥â ¬¥âªã Data
+ ‘¥à¨©ë© ®¬¥à ⮬ : C7B5-F673
+
+ ‘®¤¥à¦¨¬®¥ ¯ ¯ª¨ D:\BetterEnd\Utilities\src\data\stone\item
+
+11.10.2020 15:55 .
+11.10.2020 15:55 ..
+11.10.2020 15:42 44 %name%.json
+11.10.2020 15:46 51 %name%_bricks.json
+11.10.2020 15:47 55 %name%_brick_slab.json
+11.10.2020 15:46 57 %name%_brick_stairs.json
+11.10.2020 15:47 65 %name%_brick_wall.json
+11.10.2020 15:48 61 %name%_button.json
+11.10.2020 15:43 51 %name%_pillar.json
+26.09.2020 20:36 62 %name%_plate.json
+11.10.2020 15:43 49 %name%_slab.json
+11.10.2020 15:43 56 %name%_small_tiles.json
+11.10.2020 15:43 51 %name%_stairs.json
+11.10.2020 15:43 49 %name%_tile.json
+11.10.2020 15:47 59 %name%_wall.json
+11.10.2020 15:55 0 a.txt
+ 14 ä ©«®¢ 710 ¡ ©â
+ 2 ¯ ¯®ª 785ÿ301ÿ659ÿ648 ¡ ©â ᢮¡®¤®
diff --git a/settings.gradle b/settings.gradle
index 5b60df3d..c1d85e97 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,10 +1,10 @@
-pluginManagement {
- repositories {
- jcenter()
- maven {
- name = 'Fabric'
- url = 'https://maven.fabricmc.net/'
- }
- gradlePluginPortal()
- }
-}
+pluginManagement {
+ repositories {
+ jcenter()
+ maven {
+ name = 'Fabric'
+ url = 'https://maven.fabricmc.net/'
+ }
+ gradlePluginPortal()
+ }
+}
diff --git a/src/main/java/ru/betterend/BetterEnd.java b/src/main/java/ru/betterend/BetterEnd.java
index 5cc7ef8c..bb2f54e9 100644
--- a/src/main/java/ru/betterend/BetterEnd.java
+++ b/src/main/java/ru/betterend/BetterEnd.java
@@ -1,64 +1,64 @@
-package ru.betterend;
-
-import net.fabricmc.api.ModInitializer;
-import net.fabricmc.loader.api.FabricLoader;
-import net.minecraft.util.Identifier;
-import ru.betterend.api.BetterEndPlugin;
-import ru.betterend.config.MainConfig;
-import ru.betterend.effects.EndEnchantments;
-import ru.betterend.effects.EndPotions;
-import ru.betterend.recipe.AlloyingRecipes;
-import ru.betterend.recipe.CraftingRecipes;
-import ru.betterend.recipe.FurnaceRecipes;
-import ru.betterend.recipe.SmithingRecipes;
-import ru.betterend.registry.EndBiomes;
-import ru.betterend.registry.EndBlockEntities;
-import ru.betterend.registry.EndBlocks;
-import ru.betterend.registry.EndEntities;
-import ru.betterend.registry.EndFeatures;
-import ru.betterend.registry.EndItems;
-import ru.betterend.registry.EndSounds;
-import ru.betterend.registry.EndStructures;
-import ru.betterend.registry.EndTags;
-import ru.betterend.util.Logger;
-import ru.betterend.world.generator.BetterEndBiomeSource;
-
-public class BetterEnd implements ModInitializer {
- public static final String MOD_ID = "betterend";
- public static final Logger LOGGER = Logger.get();
- public static final MainConfig CONFIG = MainConfig.getInstance();
-
- @Override
- public void onInitialize() {
- EndSounds.register();
- EndItems.register();
- EndBlocks.register();
- EndBlockEntities.register();
- EndFeatures.register();
- EndEntities.register();
- EndBiomes.register();
- BetterEndBiomeSource.register();
- EndTags.register();
- EndEnchantments.register();
- EndPotions.register();
- CraftingRecipes.register();
- FurnaceRecipes.register();
- AlloyingRecipes.register();
- SmithingRecipes.register();
- EndStructures.register();
-
- FabricLoader.getInstance().getEntrypoints("betterend", BetterEndPlugin.class).forEach(BetterEndPlugin::register);
- }
-
- public static Identifier makeID(String path) {
- return new Identifier(MOD_ID, path);
- }
-
- public static String getStringId(String id) {
- return String.format("%s:%s", MOD_ID, id);
- }
-
- public static boolean isDevEnvironment() {
- return FabricLoader.getInstance().isDevelopmentEnvironment();
- }
-}
+package ru.betterend;
+
+import net.fabricmc.api.ModInitializer;
+import net.fabricmc.loader.api.FabricLoader;
+import net.minecraft.util.Identifier;
+import ru.betterend.api.BetterEndPlugin;
+import ru.betterend.config.MainConfig;
+import ru.betterend.effects.EndEnchantments;
+import ru.betterend.effects.EndPotions;
+import ru.betterend.recipe.AlloyingRecipes;
+import ru.betterend.recipe.CraftingRecipes;
+import ru.betterend.recipe.FurnaceRecipes;
+import ru.betterend.recipe.SmithingRecipes;
+import ru.betterend.registry.EndBiomes;
+import ru.betterend.registry.EndBlockEntities;
+import ru.betterend.registry.EndBlocks;
+import ru.betterend.registry.EndEntities;
+import ru.betterend.registry.EndFeatures;
+import ru.betterend.registry.EndItems;
+import ru.betterend.registry.EndSounds;
+import ru.betterend.registry.EndStructures;
+import ru.betterend.registry.EndTags;
+import ru.betterend.util.Logger;
+import ru.betterend.world.generator.BetterEndBiomeSource;
+
+public class BetterEnd implements ModInitializer {
+ public static final String MOD_ID = "betterend";
+ public static final Logger LOGGER = Logger.get();
+ public static final MainConfig CONFIG = MainConfig.getInstance();
+
+ @Override
+ public void onInitialize() {
+ EndSounds.register();
+ EndItems.register();
+ EndBlocks.register();
+ EndBlockEntities.register();
+ EndFeatures.register();
+ EndEntities.register();
+ EndBiomes.register();
+ BetterEndBiomeSource.register();
+ EndTags.register();
+ EndEnchantments.register();
+ EndPotions.register();
+ CraftingRecipes.register();
+ FurnaceRecipes.register();
+ AlloyingRecipes.register();
+ SmithingRecipes.register();
+ EndStructures.register();
+
+ FabricLoader.getInstance().getEntrypoints("betterend", BetterEndPlugin.class).forEach(BetterEndPlugin::register);
+ }
+
+ public static Identifier makeID(String path) {
+ return new Identifier(MOD_ID, path);
+ }
+
+ public static String getStringId(String id) {
+ return String.format("%s:%s", MOD_ID, id);
+ }
+
+ public static boolean isDevEnvironment() {
+ return FabricLoader.getInstance().isDevelopmentEnvironment();
+ }
+}
diff --git a/src/main/java/ru/betterend/api/BetterEndPlugin.java b/src/main/java/ru/betterend/api/BetterEndPlugin.java
index b1817141..4b278aec 100644
--- a/src/main/java/ru/betterend/api/BetterEndPlugin.java
+++ b/src/main/java/ru/betterend/api/BetterEndPlugin.java
@@ -1,34 +1,34 @@
-package ru.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, EndHammers.
- */
- default void registerOthers() {}
-
-
- public static void register(BetterEndPlugin plugin) {
- plugin.registerAlloyingRecipes();
- plugin.registerSmithingRecipes();
- plugin.registerEndBiomes();
- plugin.registerOthers();
- }
-}
+package ru.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, EndHammers.
+ */
+ default void registerOthers() {}
+
+
+ public static void register(BetterEndPlugin plugin) {
+ plugin.registerAlloyingRecipes();
+ plugin.registerSmithingRecipes();
+ plugin.registerEndBiomes();
+ plugin.registerOthers();
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/AeterniumBlock.java b/src/main/java/ru/betterend/blocks/AeterniumBlock.java
index 11711a35..e5e11578 100644
--- a/src/main/java/ru/betterend/blocks/AeterniumBlock.java
+++ b/src/main/java/ru/betterend/blocks/AeterniumBlock.java
@@ -1,28 +1,28 @@
-package ru.betterend.blocks;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
-import net.minecraft.block.BlockState;
-import net.minecraft.block.Material;
-import net.minecraft.block.MaterialColor;
-import net.minecraft.sound.BlockSoundGroup;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.BlockView;
-import ru.betterend.blocks.basis.BlockBase;
-
-public class AeterniumBlock extends BlockBase {
-
- public AeterniumBlock() {
- super(FabricBlockSettings.of(Material.METAL, MaterialColor.GRAY)
- .hardness(65F)
- .resistance(1200F)
- .requiresTool()
- .sounds(BlockSoundGroup.NETHERITE));
- }
-
- @Environment(EnvType.CLIENT)
- public int getColor(BlockState state, BlockView world, BlockPos pos) {
- return 0xFF657A7A;
- }
-}
+package ru.betterend.blocks;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Material;
+import net.minecraft.block.MaterialColor;
+import net.minecraft.sound.BlockSoundGroup;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.world.BlockView;
+import ru.betterend.blocks.basis.BlockBase;
+
+public class AeterniumBlock extends BlockBase {
+
+ public AeterniumBlock() {
+ super(FabricBlockSettings.of(Material.METAL, MaterialColor.GRAY)
+ .hardness(65F)
+ .resistance(1200F)
+ .requiresTool()
+ .sounds(BlockSoundGroup.NETHERITE));
+ }
+
+ @Environment(EnvType.CLIENT)
+ public int getColor(BlockState state, BlockView world, BlockPos pos) {
+ return 0xFF657A7A;
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/BlockStone.java b/src/main/java/ru/betterend/blocks/BlockStone.java
index 305cf219..d8b9dd53 100644
--- a/src/main/java/ru/betterend/blocks/BlockStone.java
+++ b/src/main/java/ru/betterend/blocks/BlockStone.java
@@ -1,14 +1,14 @@
-package ru.betterend.blocks;
-
-import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
-import net.minecraft.block.Blocks;
-import net.minecraft.block.MaterialColor;
-import net.minecraft.sound.BlockSoundGroup;
-import ru.betterend.blocks.basis.BlockBase;
-
-public class BlockStone extends BlockBase {
-
- public BlockStone(MaterialColor color) {
- super(FabricBlockSettings.copyOf(Blocks.END_STONE).materialColor(color).sounds(BlockSoundGroup.STONE));
- }
-}
+package ru.betterend.blocks;
+
+import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
+import net.minecraft.block.Blocks;
+import net.minecraft.block.MaterialColor;
+import net.minecraft.sound.BlockSoundGroup;
+import ru.betterend.blocks.basis.BlockBase;
+
+public class BlockStone extends BlockBase {
+
+ public BlockStone(MaterialColor color) {
+ super(FabricBlockSettings.copyOf(Blocks.END_STONE).materialColor(color).sounds(BlockSoundGroup.STONE));
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/EndPortalBlock.java b/src/main/java/ru/betterend/blocks/EndPortalBlock.java
index 1e48fd9e..cd894741 100644
--- a/src/main/java/ru/betterend/blocks/EndPortalBlock.java
+++ b/src/main/java/ru/betterend/blocks/EndPortalBlock.java
@@ -1,119 +1,119 @@
-package ru.betterend.blocks;
-
-import java.util.Random;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
-import net.minecraft.block.BlockState;
-import net.minecraft.block.Blocks;
-import net.minecraft.block.NetherPortalBlock;
-import net.minecraft.entity.Entity;
-import net.minecraft.server.network.ServerPlayerEntity;
-import net.minecraft.server.world.ServerWorld;
-import net.minecraft.sound.SoundCategory;
-import net.minecraft.sound.SoundEvents;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.Direction;
-import net.minecraft.util.registry.Registry;
-import net.minecraft.world.World;
-import net.minecraft.world.WorldAccess;
-import net.minecraft.world.dimension.DimensionType;
-import ru.betterend.client.render.ERenderLayer;
-import ru.betterend.interfaces.IRenderTypeable;
-import ru.betterend.interfaces.TeleportingEntity;
-import ru.betterend.registry.EndParticles;
-
-public class EndPortalBlock extends NetherPortalBlock implements IRenderTypeable {
- public EndPortalBlock() {
- super(FabricBlockSettings.copyOf(Blocks.NETHER_PORTAL).resistance(Blocks.BEDROCK.getBlastResistance()).luminance(state -> {
- return 12;
- }));
- }
-
- @Override
- @Environment(EnvType.CLIENT)
- public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
- if (random.nextInt(100) == 0) {
- world.playSound(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, SoundEvents.BLOCK_PORTAL_AMBIENT, SoundCategory.BLOCKS, 0.5F, random.nextFloat() * 0.4F + 0.8F, false);
- }
-
- double x = pos.getX() + random.nextDouble();
- double y = pos.getY() + random.nextDouble();
- double z = pos.getZ() + random.nextDouble();
- int k = random.nextInt(2) * 2 - 1;
- if (!world.getBlockState(pos.west()).isOf(this) && !world.getBlockState(pos.east()).isOf(this)) {
- x = pos.getX() + 0.5D + 0.25D * k;
- } else {
- z = pos.getZ() + 0.5D + 0.25D * k;
- }
-
- world.addParticle(EndParticles.PORTAL_SPHERE, x, y, z, 0, 0, 0);
- }
-
- @Override
- public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {}
-
- @Override
- public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) {
- return state;
- }
-
- @Override
- public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
- if (world instanceof ServerWorld && !entity.hasVehicle() && !entity.hasPassengers() && entity.canUsePortals()) {
- TeleportingEntity teleEntity = TeleportingEntity.class.cast(entity);
- if (teleEntity.hasCooldown()) return;
- boolean isOverworld = world.getRegistryKey().equals(World.OVERWORLD);
- ServerWorld destination = ((ServerWorld) world).getServer().getWorld(isOverworld ? World.END : World.OVERWORLD);
- BlockPos exitPos = this.findExitPos(destination, pos, entity);
- if (exitPos == null) return;
- if (entity instanceof ServerPlayerEntity) {
- ServerPlayerEntity player = (ServerPlayerEntity) entity;
- player.teleport(destination, exitPos.getX(), exitPos.getY(), exitPos.getZ(), entity.yaw, entity.pitch);
- teleEntity.beSetCooldown(player.isCreative() ? 50 : 300);
- } else {
- teleEntity.beSetExitPos(exitPos);
- entity.moveToWorld(destination);
- teleEntity.beSetCooldown(300);
- }
- }
- }
-
- @Override
- public ERenderLayer getRenderLayer() {
- return ERenderLayer.TRANSLUCENT;
- }
-
- private BlockPos findExitPos(ServerWorld world, BlockPos pos, Entity entity) {
- Registry registry = world.getRegistryManager().getDimensionTypes();
- double mult = registry.get(DimensionType.THE_END_ID).getCoordinateScale();
- BlockPos.Mutable basePos;
- if (world.getRegistryKey().equals(World.OVERWORLD)) {
- basePos = pos.mutableCopy().set(pos.getX() / mult, pos.getY(), pos.getZ() / mult);
- } else {
- basePos = pos.mutableCopy().set(pos.getX() * mult, pos.getY(), pos.getZ() * mult);
- }
- Direction direction = Direction.EAST;
- BlockPos.Mutable checkPos = basePos.mutableCopy();
- for (int step = 1; step < 64; step++) {
- for (int i = 0; i < step; i++) {
- checkPos.setY(5);
- while(checkPos.getY() < world.getHeight()) {
- BlockState state = world.getBlockState(checkPos);
- if(state.isOf(this)) {
- if (state.get(AXIS).equals(Direction.Axis.X)) {
- return checkPos.add(0, 0, 1);
- } else {
- return checkPos.add(1, 0, 0);
- }
- }
- checkPos.move(Direction.UP);
- }
- checkPos.move(direction);
- }
- direction = direction.rotateYClockwise();
- }
- return null;
- }
-}
+package ru.betterend.blocks;
+
+import java.util.Random;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.block.NetherPortalBlock;
+import net.minecraft.entity.Entity;
+import net.minecraft.server.network.ServerPlayerEntity;
+import net.minecraft.server.world.ServerWorld;
+import net.minecraft.sound.SoundCategory;
+import net.minecraft.sound.SoundEvents;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.Direction;
+import net.minecraft.util.registry.Registry;
+import net.minecraft.world.World;
+import net.minecraft.world.WorldAccess;
+import net.minecraft.world.dimension.DimensionType;
+import ru.betterend.client.render.ERenderLayer;
+import ru.betterend.interfaces.IRenderTypeable;
+import ru.betterend.interfaces.TeleportingEntity;
+import ru.betterend.registry.EndParticles;
+
+public class EndPortalBlock extends NetherPortalBlock implements IRenderTypeable {
+ public EndPortalBlock() {
+ super(FabricBlockSettings.copyOf(Blocks.NETHER_PORTAL).resistance(Blocks.BEDROCK.getBlastResistance()).luminance(state -> {
+ return 12;
+ }));
+ }
+
+ @Override
+ @Environment(EnvType.CLIENT)
+ public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
+ if (random.nextInt(100) == 0) {
+ world.playSound(pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, SoundEvents.BLOCK_PORTAL_AMBIENT, SoundCategory.BLOCKS, 0.5F, random.nextFloat() * 0.4F + 0.8F, false);
+ }
+
+ double x = pos.getX() + random.nextDouble();
+ double y = pos.getY() + random.nextDouble();
+ double z = pos.getZ() + random.nextDouble();
+ int k = random.nextInt(2) * 2 - 1;
+ if (!world.getBlockState(pos.west()).isOf(this) && !world.getBlockState(pos.east()).isOf(this)) {
+ x = pos.getX() + 0.5D + 0.25D * k;
+ } else {
+ z = pos.getZ() + 0.5D + 0.25D * k;
+ }
+
+ world.addParticle(EndParticles.PORTAL_SPHERE, x, y, z, 0, 0, 0);
+ }
+
+ @Override
+ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) {}
+
+ @Override
+ public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) {
+ return state;
+ }
+
+ @Override
+ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
+ if (world instanceof ServerWorld && !entity.hasVehicle() && !entity.hasPassengers() && entity.canUsePortals()) {
+ TeleportingEntity teleEntity = TeleportingEntity.class.cast(entity);
+ if (teleEntity.hasCooldown()) return;
+ boolean isOverworld = world.getRegistryKey().equals(World.OVERWORLD);
+ ServerWorld destination = ((ServerWorld) world).getServer().getWorld(isOverworld ? World.END : World.OVERWORLD);
+ BlockPos exitPos = this.findExitPos(destination, pos, entity);
+ if (exitPos == null) return;
+ if (entity instanceof ServerPlayerEntity) {
+ ServerPlayerEntity player = (ServerPlayerEntity) entity;
+ player.teleport(destination, exitPos.getX(), exitPos.getY(), exitPos.getZ(), entity.yaw, entity.pitch);
+ teleEntity.beSetCooldown(player.isCreative() ? 50 : 300);
+ } else {
+ teleEntity.beSetExitPos(exitPos);
+ entity.moveToWorld(destination);
+ teleEntity.beSetCooldown(300);
+ }
+ }
+ }
+
+ @Override
+ public ERenderLayer getRenderLayer() {
+ return ERenderLayer.TRANSLUCENT;
+ }
+
+ private BlockPos findExitPos(ServerWorld world, BlockPos pos, Entity entity) {
+ Registry registry = world.getRegistryManager().getDimensionTypes();
+ double mult = registry.get(DimensionType.THE_END_ID).getCoordinateScale();
+ BlockPos.Mutable basePos;
+ if (world.getRegistryKey().equals(World.OVERWORLD)) {
+ basePos = pos.mutableCopy().set(pos.getX() / mult, pos.getY(), pos.getZ() / mult);
+ } else {
+ basePos = pos.mutableCopy().set(pos.getX() * mult, pos.getY(), pos.getZ() * mult);
+ }
+ Direction direction = Direction.EAST;
+ BlockPos.Mutable checkPos = basePos.mutableCopy();
+ for (int step = 1; step < 64; step++) {
+ for (int i = 0; i < step; i++) {
+ checkPos.setY(5);
+ while(checkPos.getY() < world.getHeight()) {
+ BlockState state = world.getBlockState(checkPos);
+ if(state.isOf(this)) {
+ if (state.get(AXIS).equals(Direction.Axis.X)) {
+ return checkPos.add(0, 0, 1);
+ } else {
+ return checkPos.add(1, 0, 0);
+ }
+ }
+ checkPos.move(Direction.UP);
+ }
+ checkPos.move(direction);
+ }
+ direction = direction.rotateYClockwise();
+ }
+ return null;
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/EndStoneSmelter.java b/src/main/java/ru/betterend/blocks/EndStoneSmelter.java
index 27315e60..99251885 100644
--- a/src/main/java/ru/betterend/blocks/EndStoneSmelter.java
+++ b/src/main/java/ru/betterend/blocks/EndStoneSmelter.java
@@ -1,140 +1,140 @@
-package ru.betterend.blocks;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Random;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockRenderType;
-import net.minecraft.block.BlockState;
-import net.minecraft.block.HorizontalFacingBlock;
-import net.minecraft.block.Material;
-import net.minecraft.block.MaterialColor;
-import net.minecraft.block.entity.BlockEntity;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.item.ItemPlacementContext;
-import net.minecraft.item.ItemStack;
-import net.minecraft.loot.context.LootContext;
-import net.minecraft.particle.ParticleTypes;
-import net.minecraft.screen.NamedScreenHandlerFactory;
-import net.minecraft.screen.ScreenHandler;
-import net.minecraft.sound.BlockSoundGroup;
-import net.minecraft.sound.SoundCategory;
-import net.minecraft.sound.SoundEvents;
-import net.minecraft.state.StateManager;
-import net.minecraft.state.property.BooleanProperty;
-import net.minecraft.state.property.DirectionProperty;
-import net.minecraft.state.property.Properties;
-import net.minecraft.util.ActionResult;
-import net.minecraft.util.BlockMirror;
-import net.minecraft.util.BlockRotation;
-import net.minecraft.util.Hand;
-import net.minecraft.util.hit.BlockHitResult;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.Direction;
-import net.minecraft.world.BlockView;
-import net.minecraft.world.World;
-import ru.betterend.blocks.basis.BaseBlockWithEntity;
-import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
-
-public class EndStoneSmelter extends BaseBlockWithEntity {
- public static final DirectionProperty FACING = HorizontalFacingBlock.FACING;
- public static final BooleanProperty LIT = Properties.LIT;
- public static final String ID = "end_stone_smelter";
-
- public EndStoneSmelter() {
- super(FabricBlockSettings.of(Material.STONE, MaterialColor.GRAY)
- .hardness(4F)
- .resistance(100F)
- .requiresTool()
- .sounds(BlockSoundGroup.STONE));
- this.setDefaultState(this.stateManager.getDefaultState()
- .with(FACING, Direction.NORTH)
- .with(LIT, false));
- }
-
- public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
- if (world.isClient) {
- return ActionResult.SUCCESS;
- } else {
- this.openScreen(world, pos, player);
- return ActionResult.CONSUME;
- }
- }
-
- private void openScreen(World world, BlockPos pos, PlayerEntity player) {
- BlockEntity blockEntity = world.getBlockEntity(pos);
- if (blockEntity instanceof EndStoneSmelterBlockEntity) {
- player.openHandledScreen((NamedScreenHandlerFactory) blockEntity);
- }
- }
-
- @Override
- public BlockState getPlacementState(ItemPlacementContext ctx) {
- return this.getDefaultState().with(FACING, ctx.getPlayerFacing().getOpposite());
- }
-
- @Override
- public BlockEntity createBlockEntity(BlockView world) {
- return new EndStoneSmelterBlockEntity();
- }
-
- @Override
- public List getDroppedStacks(BlockState state, LootContext.Builder builder) {
- return Collections.singletonList(new ItemStack(this));
- }
-
- @Override
- public boolean hasComparatorOutput(BlockState state) {
- return true;
- }
-
- @Override
- public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
- //TODO
- return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
- }
-
- @Override
- public BlockRenderType getRenderType(BlockState state) {
- return BlockRenderType.MODEL;
- }
-
- @Override
- public BlockState rotate(BlockState state, BlockRotation rotation) {
- return (BlockState)state.with(FACING, rotation.rotate((Direction)state.get(FACING)));
- }
-
- @Override
- public BlockState mirror(BlockState state, BlockMirror mirror) {
- return state.rotate(mirror.getRotation((Direction)state.get(FACING)));
- }
-
- @Override
- protected void appendProperties(StateManager.Builder builder) {
- builder.add(FACING, LIT);
- }
-
- @Environment(EnvType.CLIENT)
- public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
- if (state.get(LIT)) {
- double x = pos.getX() + 0.5D;
- double y = pos.getY();
- double z = pos.getZ() + 0.5D;
- if (random.nextDouble() < 0.1D) {
- world.playSound(x, y, z, SoundEvents.BLOCK_BLASTFURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
- }
-
- Direction direction = (Direction)state.get(FACING);
- Direction.Axis axis = direction.getAxis();
- double defOffset = random.nextDouble() * 0.6D - 0.3D;
- double offX = axis == Direction.Axis.X ? direction.getOffsetX() * 0.52D : defOffset;
- double offY = random.nextDouble() * 9.0D / 16.0D;
- double offZ = axis == Direction.Axis.Z ? direction.getOffsetZ() * 0.52D : defOffset;
- world.addParticle(ParticleTypes.SMOKE, x + offX, y + offY, z + offZ, 0.0D, 0.0D, 0.0D);
- }
- }
-}
+package ru.betterend.blocks;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockRenderType;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.HorizontalFacingBlock;
+import net.minecraft.block.Material;
+import net.minecraft.block.MaterialColor;
+import net.minecraft.block.entity.BlockEntity;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.item.ItemPlacementContext;
+import net.minecraft.item.ItemStack;
+import net.minecraft.loot.context.LootContext;
+import net.minecraft.particle.ParticleTypes;
+import net.minecraft.screen.NamedScreenHandlerFactory;
+import net.minecraft.screen.ScreenHandler;
+import net.minecraft.sound.BlockSoundGroup;
+import net.minecraft.sound.SoundCategory;
+import net.minecraft.sound.SoundEvents;
+import net.minecraft.state.StateManager;
+import net.minecraft.state.property.BooleanProperty;
+import net.minecraft.state.property.DirectionProperty;
+import net.minecraft.state.property.Properties;
+import net.minecraft.util.ActionResult;
+import net.minecraft.util.BlockMirror;
+import net.minecraft.util.BlockRotation;
+import net.minecraft.util.Hand;
+import net.minecraft.util.hit.BlockHitResult;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.Direction;
+import net.minecraft.world.BlockView;
+import net.minecraft.world.World;
+import ru.betterend.blocks.basis.BaseBlockWithEntity;
+import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
+
+public class EndStoneSmelter extends BaseBlockWithEntity {
+ public static final DirectionProperty FACING = HorizontalFacingBlock.FACING;
+ public static final BooleanProperty LIT = Properties.LIT;
+ public static final String ID = "end_stone_smelter";
+
+ public EndStoneSmelter() {
+ super(FabricBlockSettings.of(Material.STONE, MaterialColor.GRAY)
+ .hardness(4F)
+ .resistance(100F)
+ .requiresTool()
+ .sounds(BlockSoundGroup.STONE));
+ this.setDefaultState(this.stateManager.getDefaultState()
+ .with(FACING, Direction.NORTH)
+ .with(LIT, false));
+ }
+
+ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
+ if (world.isClient) {
+ return ActionResult.SUCCESS;
+ } else {
+ this.openScreen(world, pos, player);
+ return ActionResult.CONSUME;
+ }
+ }
+
+ private void openScreen(World world, BlockPos pos, PlayerEntity player) {
+ BlockEntity blockEntity = world.getBlockEntity(pos);
+ if (blockEntity instanceof EndStoneSmelterBlockEntity) {
+ player.openHandledScreen((NamedScreenHandlerFactory) blockEntity);
+ }
+ }
+
+ @Override
+ public BlockState getPlacementState(ItemPlacementContext ctx) {
+ return this.getDefaultState().with(FACING, ctx.getPlayerFacing().getOpposite());
+ }
+
+ @Override
+ public BlockEntity createBlockEntity(BlockView world) {
+ return new EndStoneSmelterBlockEntity();
+ }
+
+ @Override
+ public List getDroppedStacks(BlockState state, LootContext.Builder builder) {
+ return Collections.singletonList(new ItemStack(this));
+ }
+
+ @Override
+ public boolean hasComparatorOutput(BlockState state) {
+ return true;
+ }
+
+ @Override
+ public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
+ //TODO
+ return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
+ }
+
+ @Override
+ public BlockRenderType getRenderType(BlockState state) {
+ return BlockRenderType.MODEL;
+ }
+
+ @Override
+ public BlockState rotate(BlockState state, BlockRotation rotation) {
+ return (BlockState)state.with(FACING, rotation.rotate((Direction)state.get(FACING)));
+ }
+
+ @Override
+ public BlockState mirror(BlockState state, BlockMirror mirror) {
+ return state.rotate(mirror.getRotation((Direction)state.get(FACING)));
+ }
+
+ @Override
+ protected void appendProperties(StateManager.Builder builder) {
+ builder.add(FACING, LIT);
+ }
+
+ @Environment(EnvType.CLIENT)
+ public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
+ if (state.get(LIT)) {
+ double x = pos.getX() + 0.5D;
+ double y = pos.getY();
+ double z = pos.getZ() + 0.5D;
+ if (random.nextDouble() < 0.1D) {
+ world.playSound(x, y, z, SoundEvents.BLOCK_BLASTFURNACE_FIRE_CRACKLE, SoundCategory.BLOCKS, 1.0F, 1.0F, false);
+ }
+
+ Direction direction = (Direction)state.get(FACING);
+ Direction.Axis axis = direction.getAxis();
+ double defOffset = random.nextDouble() * 0.6D - 0.3D;
+ double offX = axis == Direction.Axis.X ? direction.getOffsetX() * 0.52D : defOffset;
+ double offY = random.nextDouble() * 9.0D / 16.0D;
+ double offZ = axis == Direction.Axis.Z ? direction.getOffsetZ() * 0.52D : defOffset;
+ world.addParticle(ParticleTypes.SMOKE, x + offX, y + offY, z + offZ, 0.0D, 0.0D, 0.0D);
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/EnderBlock.java b/src/main/java/ru/betterend/blocks/EnderBlock.java
index 57516d94..1b80fabd 100644
--- a/src/main/java/ru/betterend/blocks/EnderBlock.java
+++ b/src/main/java/ru/betterend/blocks/EnderBlock.java
@@ -1,28 +1,28 @@
-package ru.betterend.blocks;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
-import net.minecraft.block.BlockState;
-import net.minecraft.block.Material;
-import net.minecraft.block.MaterialColor;
-import net.minecraft.sound.BlockSoundGroup;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.BlockView;
-import ru.betterend.blocks.basis.BlockBase;
-
-public class EnderBlock extends BlockBase {
-
- public EnderBlock() {
- super(FabricBlockSettings.of(Material.STONE, MaterialColor.field_25708)
- .hardness(5F)
- .resistance(6F)
- .requiresTool()
- .sounds(BlockSoundGroup.STONE));
- }
-
- @Environment(EnvType.CLIENT)
- public int getColor(BlockState state, BlockView world, BlockPos pos) {
- return 0xFF005548;
- }
-}
+package ru.betterend.blocks;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Material;
+import net.minecraft.block.MaterialColor;
+import net.minecraft.sound.BlockSoundGroup;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.world.BlockView;
+import ru.betterend.blocks.basis.BlockBase;
+
+public class EnderBlock extends BlockBase {
+
+ public EnderBlock() {
+ super(FabricBlockSettings.of(Material.STONE, MaterialColor.field_25708)
+ .hardness(5F)
+ .resistance(6F)
+ .requiresTool()
+ .sounds(BlockSoundGroup.STONE));
+ }
+
+ @Environment(EnvType.CLIENT)
+ public int getColor(BlockState state, BlockView world, BlockPos pos) {
+ return 0xFF005548;
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/EternalPedestal.java b/src/main/java/ru/betterend/blocks/EternalPedestal.java
index b03bdcae..72818195 100644
--- a/src/main/java/ru/betterend/blocks/EternalPedestal.java
+++ b/src/main/java/ru/betterend/blocks/EternalPedestal.java
@@ -1,125 +1,125 @@
-package ru.betterend.blocks;
-
-import java.util.List;
-
-import com.google.common.collect.Lists;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockState;
-import net.minecraft.block.Blocks;
-import net.minecraft.block.entity.BlockEntity;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.item.ItemStack;
-import net.minecraft.loot.context.LootContext;
-import net.minecraft.loot.context.LootContextParameters;
-import net.minecraft.state.StateManager;
-import net.minecraft.state.property.BooleanProperty;
-import net.minecraft.util.ActionResult;
-import net.minecraft.util.Hand;
-import net.minecraft.util.hit.BlockHitResult;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.Direction;
-import net.minecraft.world.BlockView;
-import net.minecraft.world.World;
-import net.minecraft.world.WorldAccess;
-import net.minecraft.world.explosion.Explosion;
-import ru.betterend.blocks.basis.BlockPedestal;
-import ru.betterend.blocks.entities.EternalPedestalEntity;
-import ru.betterend.registry.EndBlocks;
-import ru.betterend.registry.EndItems;
-import ru.betterend.rituals.EternalRitual;
-
-public class EternalPedestal extends BlockPedestal {
- public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVATED;
-
- public EternalPedestal() {
- super(EndBlocks.FLAVOLITE_RUNED_ETERNAL);
- this.setDefaultState(this.getDefaultState().with(ACTIVATED, false));
- }
-
- @Override
- public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
- ActionResult result = super.onUse(state, world, pos, player, hand, hit);
- if (result.equals(ActionResult.SUCCESS)) {
- BlockEntity blockEntity = world.getBlockEntity(pos);
- if (blockEntity instanceof EternalPedestalEntity) {
- EternalPedestalEntity pedestal = (EternalPedestalEntity) blockEntity;
- BlockState updatedState = world.getBlockState(pos);
- if (pedestal.isEmpty() && updatedState.get(ACTIVATED)) {
- if (pedestal.hasRitual()) {
- EternalRitual ritual = pedestal.getRitual();
- ritual.removePortal();
- }
- world.setBlockState(pos, updatedState.with(ACTIVATED, false));
- } else {
- ItemStack itemStack = pedestal.getStack(0);
- if (itemStack.getItem() == EndItems.ETERNAL_CRYSTAL) {
- world.setBlockState(pos, updatedState.with(ACTIVATED, true));
- if (pedestal.hasRitual()) {
- pedestal.getRitual().checkStructure();
- } else {
- EternalRitual ritual = new EternalRitual(world, pos);
- ritual.checkStructure();
- }
- }
- }
- }
- }
- return result;
- }
-
- @Override
- public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) {
- BlockState updated = super.getStateForNeighborUpdate(state, direction, newState, world, pos, posFrom);
- if (!updated.isOf(this)) return updated;
- if (!this.isPlaceable(updated)) {
- return updated.with(ACTIVATED, false);
- }
- return updated;
- }
-
- @Override
- public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) {
- return 0.0F;
- }
-
- @Override
- public float getBlastResistance() {
- return Blocks.BEDROCK.getBlastResistance();
- }
-
- @Override
- public boolean shouldDropItemsOnExplosion(Explosion explosion) {
- return false;
- }
-
- @Override
- public List getDroppedStacks(BlockState state, LootContext.Builder builder) {
- if (state.isOf(this)) {
- BlockProperties.PedestalState currentState = state.get(BlockProperties.PEDESTAL_STATE);
- if (currentState.equals(BlockProperties.PedestalState.BOTTOM) || currentState.equals(BlockProperties.PedestalState.PILLAR)) {
- return Lists.newArrayList();
- }
- }
- List drop = Lists.newArrayList();
- BlockEntity blockEntity = builder.getNullable(LootContextParameters.BLOCK_ENTITY);
- if (blockEntity != null && blockEntity instanceof EternalPedestalEntity) {
- EternalPedestalEntity pedestal = (EternalPedestalEntity) blockEntity;
- if (!pedestal.isEmpty()) {
- drop.add(pedestal.getStack(0));
- }
- }
- return drop;
- }
-
- @Override
- protected void appendProperties(StateManager.Builder stateManager) {
- super.appendProperties(stateManager);
- stateManager.add(ACTIVATED);
- }
-
- @Override
- public BlockEntity createBlockEntity(BlockView world) {
- return new EternalPedestalEntity();
- }
-}
+package ru.betterend.blocks;
+
+import java.util.List;
+
+import com.google.common.collect.Lists;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.block.entity.BlockEntity;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.item.ItemStack;
+import net.minecraft.loot.context.LootContext;
+import net.minecraft.loot.context.LootContextParameters;
+import net.minecraft.state.StateManager;
+import net.minecraft.state.property.BooleanProperty;
+import net.minecraft.util.ActionResult;
+import net.minecraft.util.Hand;
+import net.minecraft.util.hit.BlockHitResult;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.Direction;
+import net.minecraft.world.BlockView;
+import net.minecraft.world.World;
+import net.minecraft.world.WorldAccess;
+import net.minecraft.world.explosion.Explosion;
+import ru.betterend.blocks.basis.BlockPedestal;
+import ru.betterend.blocks.entities.EternalPedestalEntity;
+import ru.betterend.registry.EndBlocks;
+import ru.betterend.registry.EndItems;
+import ru.betterend.rituals.EternalRitual;
+
+public class EternalPedestal extends BlockPedestal {
+ public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVATED;
+
+ public EternalPedestal() {
+ super(EndBlocks.FLAVOLITE_RUNED_ETERNAL);
+ this.setDefaultState(this.getDefaultState().with(ACTIVATED, false));
+ }
+
+ @Override
+ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
+ ActionResult result = super.onUse(state, world, pos, player, hand, hit);
+ if (result.equals(ActionResult.SUCCESS)) {
+ BlockEntity blockEntity = world.getBlockEntity(pos);
+ if (blockEntity instanceof EternalPedestalEntity) {
+ EternalPedestalEntity pedestal = (EternalPedestalEntity) blockEntity;
+ BlockState updatedState = world.getBlockState(pos);
+ if (pedestal.isEmpty() && updatedState.get(ACTIVATED)) {
+ if (pedestal.hasRitual()) {
+ EternalRitual ritual = pedestal.getRitual();
+ ritual.removePortal();
+ }
+ world.setBlockState(pos, updatedState.with(ACTIVATED, false));
+ } else {
+ ItemStack itemStack = pedestal.getStack(0);
+ if (itemStack.getItem() == EndItems.ETERNAL_CRYSTAL) {
+ world.setBlockState(pos, updatedState.with(ACTIVATED, true));
+ if (pedestal.hasRitual()) {
+ pedestal.getRitual().checkStructure();
+ } else {
+ EternalRitual ritual = new EternalRitual(world, pos);
+ ritual.checkStructure();
+ }
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom) {
+ BlockState updated = super.getStateForNeighborUpdate(state, direction, newState, world, pos, posFrom);
+ if (!updated.isOf(this)) return updated;
+ if (!this.isPlaceable(updated)) {
+ return updated.with(ACTIVATED, false);
+ }
+ return updated;
+ }
+
+ @Override
+ public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) {
+ return 0.0F;
+ }
+
+ @Override
+ public float getBlastResistance() {
+ return Blocks.BEDROCK.getBlastResistance();
+ }
+
+ @Override
+ public boolean shouldDropItemsOnExplosion(Explosion explosion) {
+ return false;
+ }
+
+ @Override
+ public List getDroppedStacks(BlockState state, LootContext.Builder builder) {
+ if (state.isOf(this)) {
+ BlockProperties.PedestalState currentState = state.get(BlockProperties.PEDESTAL_STATE);
+ if (currentState.equals(BlockProperties.PedestalState.BOTTOM) || currentState.equals(BlockProperties.PedestalState.PILLAR)) {
+ return Lists.newArrayList();
+ }
+ }
+ List drop = Lists.newArrayList();
+ BlockEntity blockEntity = builder.getNullable(LootContextParameters.BLOCK_ENTITY);
+ if (blockEntity != null && blockEntity instanceof EternalPedestalEntity) {
+ EternalPedestalEntity pedestal = (EternalPedestalEntity) blockEntity;
+ if (!pedestal.isEmpty()) {
+ drop.add(pedestal.getStack(0));
+ }
+ }
+ return drop;
+ }
+
+ @Override
+ protected void appendProperties(StateManager.Builder stateManager) {
+ super.appendProperties(stateManager);
+ stateManager.add(ACTIVATED);
+ }
+
+ @Override
+ public BlockEntity createBlockEntity(BlockView world) {
+ return new EternalPedestalEntity();
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/EternalRunedFlavolite.java b/src/main/java/ru/betterend/blocks/EternalRunedFlavolite.java
index 69be444f..e8fd7644 100644
--- a/src/main/java/ru/betterend/blocks/EternalRunedFlavolite.java
+++ b/src/main/java/ru/betterend/blocks/EternalRunedFlavolite.java
@@ -1,37 +1,37 @@
-package ru.betterend.blocks;
-
-import java.util.List;
-
-import com.google.common.collect.Lists;
-
-import net.minecraft.block.BlockState;
-import net.minecraft.block.Blocks;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.item.ItemStack;
-import net.minecraft.loot.context.LootContext;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.BlockView;
-import net.minecraft.world.explosion.Explosion;
-
-public class EternalRunedFlavolite extends RunedFlavolite {
-
- @Override
- public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) {
- return 0.0F;
- }
-
- @Override
- public float getBlastResistance() {
- return Blocks.BEDROCK.getBlastResistance();
- }
-
- @Override
- public boolean shouldDropItemsOnExplosion(Explosion explosion) {
- return false;
- }
-
- @Override
- public List getDroppedStacks(BlockState state, LootContext.Builder builder) {
- return Lists.newArrayList();
- }
-}
+package ru.betterend.blocks;
+
+import java.util.List;
+
+import com.google.common.collect.Lists;
+
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.item.ItemStack;
+import net.minecraft.loot.context.LootContext;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.world.BlockView;
+import net.minecraft.world.explosion.Explosion;
+
+public class EternalRunedFlavolite extends RunedFlavolite {
+
+ @Override
+ public float calcBlockBreakingDelta(BlockState state, PlayerEntity player, BlockView world, BlockPos pos) {
+ return 0.0F;
+ }
+
+ @Override
+ public float getBlastResistance() {
+ return Blocks.BEDROCK.getBlastResistance();
+ }
+
+ @Override
+ public boolean shouldDropItemsOnExplosion(Explosion explosion) {
+ return false;
+ }
+
+ @Override
+ public List getDroppedStacks(BlockState state, LootContext.Builder builder) {
+ return Lists.newArrayList();
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/InfusionPedestal.java b/src/main/java/ru/betterend/blocks/InfusionPedestal.java
index fa510931..53add7e6 100644
--- a/src/main/java/ru/betterend/blocks/InfusionPedestal.java
+++ b/src/main/java/ru/betterend/blocks/InfusionPedestal.java
@@ -1,71 +1,71 @@
-package ru.betterend.blocks;
-
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockState;
-import net.minecraft.block.Blocks;
-import net.minecraft.block.ShapeContext;
-import net.minecraft.block.entity.BlockEntity;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.util.ActionResult;
-import net.minecraft.util.Hand;
-import net.minecraft.util.hit.BlockHitResult;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.shape.VoxelShape;
-import net.minecraft.util.shape.VoxelShapes;
-import net.minecraft.world.BlockView;
-import net.minecraft.world.World;
-import ru.betterend.blocks.basis.BlockPedestal;
-import ru.betterend.blocks.entities.InfusionPedestalEntity;
-
-public class InfusionPedestal extends BlockPedestal {
- private static final VoxelShape SHAPE_DEFAULT;
- private static final VoxelShape SHAPE_PEDESTAL_TOP;
-
- public InfusionPedestal() {
- super(Blocks.OBSIDIAN);
- this.height = 1.08F;
- }
-
- @Override
- public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
- ActionResult result = super.onUse(state, world, pos, player, hand, hit);
- return result;
- }
-
- @Override
- public BlockEntity createBlockEntity(BlockView world) {
- return new InfusionPedestalEntity();
- }
-
- @Override
- public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
- if (state.isOf(this)) {
- switch(state.get(STATE)) {
- case PEDESTAL_TOP: {
- return SHAPE_PEDESTAL_TOP;
- }
- case DEFAULT: {
- return SHAPE_DEFAULT;
- }
- default: {
- return super.getOutlineShape(state, world, pos, context);
- }
- }
- }
- return super.getOutlineShape(state, world, pos, context);
- }
-
- static {
- VoxelShape basinUp = Block.createCuboidShape(2, 3, 2, 14, 4, 14);
- VoxelShape basinDown = Block.createCuboidShape(0, 0, 0, 16, 3, 16);
- VoxelShape pedestalTop = Block.createCuboidShape(1, 9, 1, 15, 11, 15);
- VoxelShape pedestalDefault = Block.createCuboidShape(1, 13, 1, 15, 15, 15);
- VoxelShape pillar = Block.createCuboidShape(3, 0, 3, 13, 9, 13);
- VoxelShape pillarDefault = Block.createCuboidShape(3, 4, 3, 13, 13, 13);
- VoxelShape eyeDefault = Block.createCuboidShape(4, 15, 4, 12, 16, 12);
- VoxelShape eyeTop = Block.createCuboidShape(4, 11, 4, 12, 12, 12);
- VoxelShape basin = VoxelShapes.union(basinDown, basinUp);
- SHAPE_DEFAULT = VoxelShapes.union(basin, pillarDefault, pedestalDefault, eyeDefault);
- SHAPE_PEDESTAL_TOP = VoxelShapes.union(pillar, pedestalTop, eyeTop);
- }
-}
+package ru.betterend.blocks;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.block.ShapeContext;
+import net.minecraft.block.entity.BlockEntity;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.util.ActionResult;
+import net.minecraft.util.Hand;
+import net.minecraft.util.hit.BlockHitResult;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.shape.VoxelShape;
+import net.minecraft.util.shape.VoxelShapes;
+import net.minecraft.world.BlockView;
+import net.minecraft.world.World;
+import ru.betterend.blocks.basis.BlockPedestal;
+import ru.betterend.blocks.entities.InfusionPedestalEntity;
+
+public class InfusionPedestal extends BlockPedestal {
+ private static final VoxelShape SHAPE_DEFAULT;
+ private static final VoxelShape SHAPE_PEDESTAL_TOP;
+
+ public InfusionPedestal() {
+ super(Blocks.OBSIDIAN);
+ this.height = 1.08F;
+ }
+
+ @Override
+ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
+ ActionResult result = super.onUse(state, world, pos, player, hand, hit);
+ return result;
+ }
+
+ @Override
+ public BlockEntity createBlockEntity(BlockView world) {
+ return new InfusionPedestalEntity();
+ }
+
+ @Override
+ public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
+ if (state.isOf(this)) {
+ switch(state.get(STATE)) {
+ case PEDESTAL_TOP: {
+ return SHAPE_PEDESTAL_TOP;
+ }
+ case DEFAULT: {
+ return SHAPE_DEFAULT;
+ }
+ default: {
+ return super.getOutlineShape(state, world, pos, context);
+ }
+ }
+ }
+ return super.getOutlineShape(state, world, pos, context);
+ }
+
+ static {
+ VoxelShape basinUp = Block.createCuboidShape(2, 3, 2, 14, 4, 14);
+ VoxelShape basinDown = Block.createCuboidShape(0, 0, 0, 16, 3, 16);
+ VoxelShape pedestalTop = Block.createCuboidShape(1, 9, 1, 15, 11, 15);
+ VoxelShape pedestalDefault = Block.createCuboidShape(1, 13, 1, 15, 15, 15);
+ VoxelShape pillar = Block.createCuboidShape(3, 0, 3, 13, 9, 13);
+ VoxelShape pillarDefault = Block.createCuboidShape(3, 4, 3, 13, 13, 13);
+ VoxelShape eyeDefault = Block.createCuboidShape(4, 15, 4, 12, 16, 12);
+ VoxelShape eyeTop = Block.createCuboidShape(4, 11, 4, 12, 12, 12);
+ VoxelShape basin = VoxelShapes.union(basinDown, basinUp);
+ SHAPE_DEFAULT = VoxelShapes.union(basin, pillarDefault, pedestalDefault, eyeDefault);
+ SHAPE_PEDESTAL_TOP = VoxelShapes.union(pillar, pedestalTop, eyeTop);
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/RunedFlavolite.java b/src/main/java/ru/betterend/blocks/RunedFlavolite.java
index e49d9e21..47e207a8 100644
--- a/src/main/java/ru/betterend/blocks/RunedFlavolite.java
+++ b/src/main/java/ru/betterend/blocks/RunedFlavolite.java
@@ -1,26 +1,26 @@
-package ru.betterend.blocks;
-
-import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockState;
-import net.minecraft.block.Blocks;
-import net.minecraft.state.StateManager;
-import net.minecraft.state.property.BooleanProperty;
-import ru.betterend.blocks.basis.BlockBase;
-import ru.betterend.registry.EndBlocks;
-
-public class RunedFlavolite extends BlockBase {
- public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVATED;
-
- public RunedFlavolite() {
- super(FabricBlockSettings.copyOf(EndBlocks.FLAVOLITE.polished).resistance(Blocks.OBSIDIAN.getBlastResistance()).luminance(state -> {
- return state.get(ACTIVATED) ? 8 : 0;
- }));
- this.setDefaultState(stateManager.getDefaultState().with(ACTIVATED, false));
- }
-
- @Override
- protected void appendProperties(StateManager.Builder stateManager) {
- stateManager.add(ACTIVATED);
- }
-}
+package ru.betterend.blocks;
+
+import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.state.StateManager;
+import net.minecraft.state.property.BooleanProperty;
+import ru.betterend.blocks.basis.BlockBase;
+import ru.betterend.registry.EndBlocks;
+
+public class RunedFlavolite extends BlockBase {
+ public static final BooleanProperty ACTIVATED = BlockProperties.ACTIVATED;
+
+ public RunedFlavolite() {
+ super(FabricBlockSettings.copyOf(EndBlocks.FLAVOLITE.polished).resistance(Blocks.OBSIDIAN.getBlastResistance()).luminance(state -> {
+ return state.get(ACTIVATED) ? 8 : 0;
+ }));
+ this.setDefaultState(stateManager.getDefaultState().with(ACTIVATED, false));
+ }
+
+ @Override
+ protected void appendProperties(StateManager.Builder stateManager) {
+ stateManager.add(ACTIVATED);
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/TerminiteBlock.java b/src/main/java/ru/betterend/blocks/TerminiteBlock.java
index 4270e3a8..204a2e55 100644
--- a/src/main/java/ru/betterend/blocks/TerminiteBlock.java
+++ b/src/main/java/ru/betterend/blocks/TerminiteBlock.java
@@ -1,17 +1,17 @@
-package ru.betterend.blocks;
-
-import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
-import net.minecraft.block.Material;
-import net.minecraft.block.MaterialColor;
-import net.minecraft.sound.BlockSoundGroup;
-import ru.betterend.blocks.basis.BlockBase;
-
-public class TerminiteBlock extends BlockBase {
- public TerminiteBlock() {
- super(FabricBlockSettings.of(Material.METAL, MaterialColor.field_25708)
- .hardness(7F)
- .resistance(9F)
- .requiresTool()
- .sounds(BlockSoundGroup.METAL));
- }
-}
+package ru.betterend.blocks;
+
+import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
+import net.minecraft.block.Material;
+import net.minecraft.block.MaterialColor;
+import net.minecraft.sound.BlockSoundGroup;
+import ru.betterend.blocks.basis.BlockBase;
+
+public class TerminiteBlock extends BlockBase {
+ public TerminiteBlock() {
+ super(FabricBlockSettings.of(Material.METAL, MaterialColor.field_25708)
+ .hardness(7F)
+ .resistance(9F)
+ .requiresTool()
+ .sounds(BlockSoundGroup.METAL));
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/basis/BaseBlockWithEntity.java b/src/main/java/ru/betterend/blocks/basis/BaseBlockWithEntity.java
index 05bbad65..4442e05d 100644
--- a/src/main/java/ru/betterend/blocks/basis/BaseBlockWithEntity.java
+++ b/src/main/java/ru/betterend/blocks/basis/BaseBlockWithEntity.java
@@ -1,28 +1,28 @@
-package ru.betterend.blocks.basis;
-
-import java.util.Collections;
-import java.util.List;
-
-import net.minecraft.block.BlockState;
-import net.minecraft.block.BlockWithEntity;
-import net.minecraft.block.entity.BlockEntity;
-import net.minecraft.item.ItemStack;
-import net.minecraft.loot.context.LootContext;
-import net.minecraft.world.BlockView;
-
-public class BaseBlockWithEntity extends BlockWithEntity {
-
- public BaseBlockWithEntity(Settings settings) {
- super(settings);
- }
-
- @Override
- public BlockEntity createBlockEntity(BlockView world) {
- return null;
- }
-
- @Override
- public List getDroppedStacks(BlockState state, LootContext.Builder builder) {
- return Collections.singletonList(new ItemStack(this));
- }
-}
+package ru.betterend.blocks.basis;
+
+import java.util.Collections;
+import java.util.List;
+
+import net.minecraft.block.BlockState;
+import net.minecraft.block.BlockWithEntity;
+import net.minecraft.block.entity.BlockEntity;
+import net.minecraft.item.ItemStack;
+import net.minecraft.loot.context.LootContext;
+import net.minecraft.world.BlockView;
+
+public class BaseBlockWithEntity extends BlockWithEntity {
+
+ public BaseBlockWithEntity(Settings settings) {
+ super(settings);
+ }
+
+ @Override
+ public BlockEntity createBlockEntity(BlockView world) {
+ return null;
+ }
+
+ @Override
+ public List getDroppedStacks(BlockState state, LootContext.Builder builder) {
+ return Collections.singletonList(new ItemStack(this));
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/basis/BlockStoneLantern.java b/src/main/java/ru/betterend/blocks/basis/BlockStoneLantern.java
new file mode 100644
index 00000000..be5a6b9b
--- /dev/null
+++ b/src/main/java/ru/betterend/blocks/basis/BlockStoneLantern.java
@@ -0,0 +1,146 @@
+package ru.betterend.blocks.basis;
+
+import java.io.Reader;
+
+import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.block.ShapeContext;
+import net.minecraft.block.Waterloggable;
+import net.minecraft.client.color.block.BlockColorProvider;
+import net.minecraft.client.color.item.ItemColorProvider;
+import net.minecraft.fluid.Fluids;
+import net.minecraft.item.ItemPlacementContext;
+import net.minecraft.state.StateManager;
+import net.minecraft.state.property.BooleanProperty;
+import net.minecraft.state.property.Properties;
+import net.minecraft.util.Identifier;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.Direction;
+import net.minecraft.util.math.MathHelper;
+import net.minecraft.util.math.Vec3i;
+import net.minecraft.util.registry.Registry;
+import net.minecraft.util.shape.VoxelShape;
+import net.minecraft.world.BlockView;
+import net.minecraft.world.WorldAccess;
+import net.minecraft.world.WorldView;
+import ru.betterend.blocks.AuroraCrystalBlock;
+import ru.betterend.interfaces.IColorProvider;
+import ru.betterend.interfaces.Patterned;
+import ru.betterend.util.MHelper;
+
+public class BlockStoneLantern extends BlockBaseNotFull implements IColorProvider, Waterloggable {
+ public static final BooleanProperty IS_FLOOR = BooleanProperty.of("is_floor");
+ public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED;
+
+ private static final VoxelShape SHAPE_CEIL = Block.createCuboidShape(3, 1, 3, 13, 16, 13);
+ private static final VoxelShape SHAPE_FLOOR = Block.createCuboidShape(3, 0, 3, 13, 15, 13);
+ private static final Vec3i[] COLORS = AuroraCrystalBlock.COLORS;
+
+ public BlockStoneLantern(Block source) {
+ super(FabricBlockSettings.copyOf(source).luminance(15));
+ }
+
+ @Override
+ protected void appendProperties(StateManager.Builder stateManager) {
+ stateManager.add(IS_FLOOR, WATERLOGGED);
+ }
+
+ @Override
+ public BlockState getPlacementState(ItemPlacementContext ctx) {
+ WorldView worldView = ctx.getWorld();
+ BlockPos blockPos = ctx.getBlockPos();
+ Direction dir = ctx.getSide();
+ if (dir == Direction.DOWN) {
+ if (sideCoversSmallSquare(worldView, blockPos.up(), Direction.DOWN)) {
+ boolean water = worldView.getFluidState(blockPos).getFluid() == Fluids.WATER;
+ return getDefaultState().with(IS_FLOOR, false).with(WATERLOGGED, water);
+ }
+ }
+ else {
+ if (sideCoversSmallSquare(worldView, blockPos.down(), Direction.UP)) {
+ boolean water = worldView.getFluidState(blockPos).getFluid() == Fluids.WATER;
+ return getDefaultState().with(IS_FLOOR, true).with(WATERLOGGED, water);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public BlockColorProvider getProvider() {
+ return (state, world, pos, tintIndex) -> {
+ 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(MathHelper.lerp(delta, color1.getX(), color2.getX()));
+ int g = MHelper.floor(MathHelper.lerp(delta, color1.getY(), color2.getY()));
+ int b = MHelper.floor(MathHelper.lerp(delta, color1.getZ(), color2.getZ()));
+
+ return MHelper.color(r, g, b);
+ };
+ }
+
+ @Override
+ public ItemColorProvider getItemProvider() {
+ return (stack, tintIndex) -> {
+ return MHelper.color(COLORS[3].getX(), COLORS[3].getY(), COLORS[3].getZ());
+ };
+ }
+
+ @Override
+ public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ePos) {
+ return state.get(IS_FLOOR) ? SHAPE_FLOOR : SHAPE_CEIL;
+ }
+
+ @Override
+ public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
+ if (state.get(IS_FLOOR)) {
+ return sideCoversSmallSquare(world, pos.down(), Direction.UP);
+ }
+ else {
+ return sideCoversSmallSquare(world, pos.up(), Direction.DOWN);
+ }
+ }
+
+ @Override
+ public BlockState getStateForNeighborUpdate(BlockState state, Direction facing, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) {
+ Boolean water = state.get(WATERLOGGED);
+ if (water) {
+ world.getFluidTickScheduler().schedule(pos, Fluids.WATER, Fluids.WATER.getTickRate(world));
+ }
+ if (!canPlaceAt(state, world, pos)) {
+ return water ? Blocks.WATER.getDefaultState() : Blocks.AIR.getDefaultState();
+ }
+ else {
+ return state;
+ }
+ }
+
+ @Override
+ public Identifier statePatternId() {
+ return Patterned.STATE_STONE_LANTERN;
+ }
+
+ @Override
+ public String getModelPattern(String block) {
+ Identifier blockId = Registry.BLOCK.getId(this);
+ if (block.contains("ceil")) {
+ return Patterned.createJson(Patterned.BLOCK_STONE_LANTERN_CEIL, blockId, blockId.getPath());
+ }
+ return Patterned.createJson(Patterned.BLOCK_STONE_LANTERN_FLOOR, blockId, blockId.getPath());
+ }
+
+ @Override
+ public String getStatesPattern(Reader data) {
+ Identifier blockId = Registry.BLOCK.getId(this);
+ return Patterned.createJson(data, blockId, blockId.getPath());
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/entities/EternalPedestalEntity.java b/src/main/java/ru/betterend/blocks/entities/EternalPedestalEntity.java
index 0d15041f..27f1132a 100644
--- a/src/main/java/ru/betterend/blocks/entities/EternalPedestalEntity.java
+++ b/src/main/java/ru/betterend/blocks/entities/EternalPedestalEntity.java
@@ -1,48 +1,48 @@
-package ru.betterend.blocks.entities;
-
-import net.minecraft.block.BlockState;
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import ru.betterend.rituals.EternalRitual;
-
-public class EternalPedestalEntity extends PedestalBlockEntity {
- private EternalRitual linkedRitual;
-
- public boolean hasRitual() {
- return this.linkedRitual != null;
- }
-
- public void linkRitual(EternalRitual ritual) {
- this.linkedRitual = ritual;
- }
-
- public EternalRitual getRitual() {
- return this.linkedRitual;
- }
-
- @Override
- public void setLocation(World world, BlockPos pos) {
- super.setLocation(world, pos);
- if (hasRitual()) {
- this.linkedRitual.setWorld(world);
- }
- }
-
- @Override
- public void fromTag(BlockState state, CompoundTag tag) {
- super.fromTag(state, tag);
- if (tag.contains("ritual")) {
- this.linkedRitual = new EternalRitual(world);
- this.linkedRitual.fromTag(tag.getCompound("ritual"));
- }
- }
-
- @Override
- public CompoundTag toTag(CompoundTag tag) {
- if (this.hasRitual()) {
- tag.put("ritual", linkedRitual.toTag(new CompoundTag()));
- }
- return super.toTag(tag);
- }
-}
+package ru.betterend.blocks.entities;
+
+import net.minecraft.block.BlockState;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.world.World;
+import ru.betterend.rituals.EternalRitual;
+
+public class EternalPedestalEntity extends PedestalBlockEntity {
+ private EternalRitual linkedRitual;
+
+ public boolean hasRitual() {
+ return this.linkedRitual != null;
+ }
+
+ public void linkRitual(EternalRitual ritual) {
+ this.linkedRitual = ritual;
+ }
+
+ public EternalRitual getRitual() {
+ return this.linkedRitual;
+ }
+
+ @Override
+ public void setLocation(World world, BlockPos pos) {
+ super.setLocation(world, pos);
+ if (hasRitual()) {
+ this.linkedRitual.setWorld(world);
+ }
+ }
+
+ @Override
+ public void fromTag(BlockState state, CompoundTag tag) {
+ super.fromTag(state, tag);
+ if (tag.contains("ritual")) {
+ this.linkedRitual = new EternalRitual(world);
+ this.linkedRitual.fromTag(tag.getCompound("ritual"));
+ }
+ }
+
+ @Override
+ public CompoundTag toTag(CompoundTag tag) {
+ if (this.hasRitual()) {
+ tag.put("ritual", linkedRitual.toTag(new CompoundTag()));
+ }
+ return super.toTag(tag);
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java b/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java
index a0447214..cb22b342 100644
--- a/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java
+++ b/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java
@@ -1,24 +1,24 @@
-package ru.betterend.blocks.entities;
-
-import net.minecraft.block.BlockState;
-import net.minecraft.nbt.CompoundTag;
-import ru.betterend.rituals.InfusionRitual;
-
-public class InfusionPedestalEntity extends PedestalBlockEntity {
-
- private InfusionRitual activeRitual;
-
- public boolean hasRitual() {
- return this.activeRitual != null;
- }
-
- @Override
- public void fromTag(BlockState state, CompoundTag tag) {
- super.fromTag(state, tag);
- }
-
- @Override
- public CompoundTag toTag(CompoundTag tag) {
- return super.toTag(tag);
- }
-}
+package ru.betterend.blocks.entities;
+
+import net.minecraft.block.BlockState;
+import net.minecraft.nbt.CompoundTag;
+import ru.betterend.rituals.InfusionRitual;
+
+public class InfusionPedestalEntity extends PedestalBlockEntity {
+
+ private InfusionRitual activeRitual;
+
+ public boolean hasRitual() {
+ return this.activeRitual != null;
+ }
+
+ @Override
+ public void fromTag(BlockState state, CompoundTag tag) {
+ super.fromTag(state, tag);
+ }
+
+ @Override
+ public CompoundTag toTag(CompoundTag tag) {
+ return super.toTag(tag);
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java b/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java
index c21e3a42..423f29c6 100644
--- a/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java
+++ b/src/main/java/ru/betterend/blocks/entities/PedestalBlockEntity.java
@@ -1,105 +1,105 @@
-package ru.betterend.blocks.entities;
-
-import net.minecraft.block.BlockState;
-import net.minecraft.block.entity.BlockEntity;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.inventory.Inventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket;
-import net.minecraft.util.Tickable;
-import ru.betterend.registry.EndBlockEntities;
-
-public class PedestalBlockEntity extends BlockEntity implements Inventory, Tickable {
- private ItemStack activeItem = ItemStack.EMPTY;
-
- private final int maxAge = 314;
- private int age;
-
- public PedestalBlockEntity() {
- super(EndBlockEntities.PEDESTAL);
- }
-
- public int getAge() {
- return this.age;
- }
-
- public int getMaxAge() {
- return this.maxAge;
- }
-
- @Override
- public void clear() {
- this.activeItem = ItemStack.EMPTY;
- }
-
- @Override
- public int size() {
- return 1;
- }
-
- @Override
- public boolean isEmpty() {
- return this.activeItem.isEmpty();
- }
-
- @Override
- public ItemStack getStack(int slot) {
- return this.activeItem;
- }
-
- @Override
- public ItemStack removeStack(int slot, int amount) {
- return this.removeStack(slot);
- }
-
- @Override
- public ItemStack removeStack(int slot) {
- return this.activeItem = ItemStack.EMPTY;
- }
-
- @Override
- public void setStack(int slot, ItemStack stack) {
- this.activeItem = stack;
- }
-
- @Override
- public boolean canPlayerUse(PlayerEntity player) {
- return true;
- }
-
- @Override
- public BlockEntityUpdateS2CPacket toUpdatePacket() {
- return new BlockEntityUpdateS2CPacket(pos, 32, this.toInitialChunkDataTag());
- }
-
- @Override
- public CompoundTag toInitialChunkDataTag() {
- return this.toTag(new CompoundTag());
- }
-
- @Override
- public void fromTag(BlockState state, CompoundTag tag) {
- super.fromTag(state, tag);
- if (tag.contains("active_item")) {
- CompoundTag itemTag = tag.getCompound("active_item");
- this.activeItem = ItemStack.fromTag(itemTag);
- }
- }
-
- @Override
- public CompoundTag toTag(CompoundTag tag) {
- tag.put("active_item", activeItem.toTag(new CompoundTag()));
- return super.toTag(tag);
- }
-
- @Override
- public void tick() {
- if (!isEmpty()) {
- this.age++;
- if (age > maxAge) {
- this.age = 0;
- }
- }
- }
-}
+package ru.betterend.blocks.entities;
+
+import net.minecraft.block.BlockState;
+import net.minecraft.block.entity.BlockEntity;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.inventory.Inventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket;
+import net.minecraft.util.Tickable;
+import ru.betterend.registry.EndBlockEntities;
+
+public class PedestalBlockEntity extends BlockEntity implements Inventory, Tickable {
+ private ItemStack activeItem = ItemStack.EMPTY;
+
+ private final int maxAge = 314;
+ private int age;
+
+ public PedestalBlockEntity() {
+ super(EndBlockEntities.PEDESTAL);
+ }
+
+ public int getAge() {
+ return this.age;
+ }
+
+ public int getMaxAge() {
+ return this.maxAge;
+ }
+
+ @Override
+ public void clear() {
+ this.activeItem = ItemStack.EMPTY;
+ }
+
+ @Override
+ public int size() {
+ return 1;
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return this.activeItem.isEmpty();
+ }
+
+ @Override
+ public ItemStack getStack(int slot) {
+ return this.activeItem;
+ }
+
+ @Override
+ public ItemStack removeStack(int slot, int amount) {
+ return this.removeStack(slot);
+ }
+
+ @Override
+ public ItemStack removeStack(int slot) {
+ return this.activeItem = ItemStack.EMPTY;
+ }
+
+ @Override
+ public void setStack(int slot, ItemStack stack) {
+ this.activeItem = stack;
+ }
+
+ @Override
+ public boolean canPlayerUse(PlayerEntity player) {
+ return true;
+ }
+
+ @Override
+ public BlockEntityUpdateS2CPacket toUpdatePacket() {
+ return new BlockEntityUpdateS2CPacket(pos, 32, this.toInitialChunkDataTag());
+ }
+
+ @Override
+ public CompoundTag toInitialChunkDataTag() {
+ return this.toTag(new CompoundTag());
+ }
+
+ @Override
+ public void fromTag(BlockState state, CompoundTag tag) {
+ super.fromTag(state, tag);
+ if (tag.contains("active_item")) {
+ CompoundTag itemTag = tag.getCompound("active_item");
+ this.activeItem = ItemStack.fromTag(itemTag);
+ }
+ }
+
+ @Override
+ public CompoundTag toTag(CompoundTag tag) {
+ tag.put("active_item", activeItem.toTag(new CompoundTag()));
+ return super.toTag(tag);
+ }
+
+ @Override
+ public void tick() {
+ if (!isEmpty()) {
+ this.age++;
+ if (age > maxAge) {
+ this.age = 0;
+ }
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/entities/render/EndCrystalRenderer.java b/src/main/java/ru/betterend/blocks/entities/render/EndCrystalRenderer.java
index 7179aa88..2ff24d70 100644
--- a/src/main/java/ru/betterend/blocks/entities/render/EndCrystalRenderer.java
+++ b/src/main/java/ru/betterend/blocks/entities/render/EndCrystalRenderer.java
@@ -1,94 +1,94 @@
-package ru.betterend.blocks.entities.render;
-
-import net.minecraft.client.model.ModelPart;
-import net.minecraft.client.render.OverlayTexture;
-import net.minecraft.client.render.RenderLayer;
-import net.minecraft.client.render.VertexConsumer;
-import net.minecraft.client.render.VertexConsumerProvider;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.client.util.math.Vector3f;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.MathHelper;
-import net.minecraft.util.math.Matrix3f;
-import net.minecraft.util.math.Matrix4f;
-import net.minecraft.util.math.Quaternion;
-
-public class EndCrystalRenderer {
- private static final Identifier CRYSTAL_TEXTURE = new Identifier("textures/entity/end_crystal/end_crystal.png");
- private static final Identifier CRYSTAL_BEAM_TEXTURE = new Identifier("textures/entity/end_crystal/end_crystal_beam.png");
- private static final RenderLayer CRYSTAL_BEAM_LAYER;
- private static final RenderLayer END_CRYSTAL;
- private static final ModelPart CORE;
- private static final ModelPart FRAME;
- private static final int AGE_CYCLE = 240;
- private static final float SINE_45_DEGREES;
-
- public static void render(int age, int maxAge, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumerProvider, int light) {
- float k = (float) AGE_CYCLE / maxAge;
- float rotation = (age * k + tickDelta) * 3.0F;
- VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(END_CRYSTAL);
- matrices.push();
- matrices.scale(0.8F, 0.8F, 0.8F);
- matrices.translate(0.0D, -0.5D, 0.0D);
- matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(rotation));
- matrices.translate(0.0D, 0.8F, 0.0D);
- matrices.multiply(new Quaternion(new Vector3f(SINE_45_DEGREES, 0.0F, SINE_45_DEGREES), 60.0F, true));
- FRAME.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV);
- matrices.scale(0.875F, 0.875F, 0.875F);
- matrices.multiply(new Quaternion(new Vector3f(SINE_45_DEGREES, 0.0F, SINE_45_DEGREES), 60.0F, true));
- matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(rotation));
- FRAME.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV);
- matrices.scale(0.875F, 0.875F, 0.875F);
- matrices.multiply(new Quaternion(new Vector3f(SINE_45_DEGREES, 0.0F, SINE_45_DEGREES), 60.0F, true));
- matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(rotation));
- CORE.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV);
- matrices.pop();
- }
-
- public static void renderBeam(BlockPos start, BlockPos end, float tickDelta, int age, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) {
- float dx = start.getX() - end.getX() + 1.0F;
- float dy = start.getY() - end.getY() + 1.0F;
- float dz = start.getZ() - end.getZ() + 1.0F;
- float f = MathHelper.sqrt(dx * dx + dz * dz);
- float g = MathHelper.sqrt(dx * dx + dy * dy + dz * dz);
- matrices.push();
- matrices.translate(0.0D, 2.0D, 0.0D);
- matrices.multiply(Vector3f.POSITIVE_Y.getRadialQuaternion((float)(-Math.atan2((double)dz, (double)dx)) - 1.5707964F));
- matrices.multiply(Vector3f.POSITIVE_X.getRadialQuaternion((float)(-Math.atan2((double)f, (double)dy)) - 1.5707964F));
- VertexConsumer vertexConsumer = vertexConsumers.getBuffer(CRYSTAL_BEAM_LAYER);
- float h = 0.0F - ((float)age + tickDelta) * 0.01F;
- float i = MathHelper.sqrt(dx * dx + dy * dy + dz * dz) / 32.0F - ((float)age + tickDelta) * 0.01F;
- float k = 0.0F;
- float l = 0.75F;
- float m = 0.0F;
- MatrixStack.Entry entry = matrices.peek();
- Matrix4f matrix4f = entry.getModel();
- Matrix3f matrix3f = entry.getNormal();
-
- for(int n = 1; n <= 8; ++n) {
- float o = MathHelper.sin((float)n * 6.2831855F / 8.0F) * 0.75F;
- float p = MathHelper.cos((float)n * 6.2831855F / 8.0F) * 0.75F;
- float q = (float)n / 8.0F;
- vertexConsumer.vertex(matrix4f, k * 0.2F, l * 0.2F, 0.0F).color(0, 0, 0, 255).texture(m, h).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(matrix3f, 0.0F, -1.0F, 0.0F).next();
- vertexConsumer.vertex(matrix4f, k, l, g).color(255, 255, 255, 255).texture(m, i).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(matrix3f, 0.0F, -1.0F, 0.0F).next();
- vertexConsumer.vertex(matrix4f, o, p, g).color(255, 255, 255, 255).texture(q, i).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(matrix3f, 0.0F, -1.0F, 0.0F).next();
- vertexConsumer.vertex(matrix4f, o * 0.2F, p * 0.2F, 0.0F).color(0, 0, 0, 255).texture(q, h).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(matrix3f, 0.0F, -1.0F, 0.0F).next();
- k = o;
- l = p;
- m = q;
- }
-
- matrices.pop();
- }
-
- static {
- END_CRYSTAL = RenderLayer.getEntityCutoutNoCull(CRYSTAL_TEXTURE);
- CRYSTAL_BEAM_LAYER = RenderLayer.getEntitySmoothCutout(CRYSTAL_BEAM_TEXTURE);
- SINE_45_DEGREES = (float) Math.sin(0.7853981633974483D);
- FRAME = new ModelPart(64, 32, 0, 0);
- FRAME.addCuboid(-4.0F, -4.0F, -4.0F, 8.0F, 8.0F, 8.0F);
- CORE = new ModelPart(64, 32, 32, 0);
- CORE.addCuboid(-4.0F, -4.0F, -4.0F, 8.0F, 8.0F, 8.0F);
- }
-}
+package ru.betterend.blocks.entities.render;
+
+import net.minecraft.client.model.ModelPart;
+import net.minecraft.client.render.OverlayTexture;
+import net.minecraft.client.render.RenderLayer;
+import net.minecraft.client.render.VertexConsumer;
+import net.minecraft.client.render.VertexConsumerProvider;
+import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.client.util.math.Vector3f;
+import net.minecraft.util.Identifier;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.MathHelper;
+import net.minecraft.util.math.Matrix3f;
+import net.minecraft.util.math.Matrix4f;
+import net.minecraft.util.math.Quaternion;
+
+public class EndCrystalRenderer {
+ private static final Identifier CRYSTAL_TEXTURE = new Identifier("textures/entity/end_crystal/end_crystal.png");
+ private static final Identifier CRYSTAL_BEAM_TEXTURE = new Identifier("textures/entity/end_crystal/end_crystal_beam.png");
+ private static final RenderLayer CRYSTAL_BEAM_LAYER;
+ private static final RenderLayer END_CRYSTAL;
+ private static final ModelPart CORE;
+ private static final ModelPart FRAME;
+ private static final int AGE_CYCLE = 240;
+ private static final float SINE_45_DEGREES;
+
+ public static void render(int age, int maxAge, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumerProvider, int light) {
+ float k = (float) AGE_CYCLE / maxAge;
+ float rotation = (age * k + tickDelta) * 3.0F;
+ VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(END_CRYSTAL);
+ matrices.push();
+ matrices.scale(0.8F, 0.8F, 0.8F);
+ matrices.translate(0.0D, -0.5D, 0.0D);
+ matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(rotation));
+ matrices.translate(0.0D, 0.8F, 0.0D);
+ matrices.multiply(new Quaternion(new Vector3f(SINE_45_DEGREES, 0.0F, SINE_45_DEGREES), 60.0F, true));
+ FRAME.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV);
+ matrices.scale(0.875F, 0.875F, 0.875F);
+ matrices.multiply(new Quaternion(new Vector3f(SINE_45_DEGREES, 0.0F, SINE_45_DEGREES), 60.0F, true));
+ matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(rotation));
+ FRAME.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV);
+ matrices.scale(0.875F, 0.875F, 0.875F);
+ matrices.multiply(new Quaternion(new Vector3f(SINE_45_DEGREES, 0.0F, SINE_45_DEGREES), 60.0F, true));
+ matrices.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(rotation));
+ CORE.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV);
+ matrices.pop();
+ }
+
+ public static void renderBeam(BlockPos start, BlockPos end, float tickDelta, int age, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light) {
+ float dx = start.getX() - end.getX() + 1.0F;
+ float dy = start.getY() - end.getY() + 1.0F;
+ float dz = start.getZ() - end.getZ() + 1.0F;
+ float f = MathHelper.sqrt(dx * dx + dz * dz);
+ float g = MathHelper.sqrt(dx * dx + dy * dy + dz * dz);
+ matrices.push();
+ matrices.translate(0.0D, 2.0D, 0.0D);
+ matrices.multiply(Vector3f.POSITIVE_Y.getRadialQuaternion((float)(-Math.atan2((double)dz, (double)dx)) - 1.5707964F));
+ matrices.multiply(Vector3f.POSITIVE_X.getRadialQuaternion((float)(-Math.atan2((double)f, (double)dy)) - 1.5707964F));
+ VertexConsumer vertexConsumer = vertexConsumers.getBuffer(CRYSTAL_BEAM_LAYER);
+ float h = 0.0F - ((float)age + tickDelta) * 0.01F;
+ float i = MathHelper.sqrt(dx * dx + dy * dy + dz * dz) / 32.0F - ((float)age + tickDelta) * 0.01F;
+ float k = 0.0F;
+ float l = 0.75F;
+ float m = 0.0F;
+ MatrixStack.Entry entry = matrices.peek();
+ Matrix4f matrix4f = entry.getModel();
+ Matrix3f matrix3f = entry.getNormal();
+
+ for(int n = 1; n <= 8; ++n) {
+ float o = MathHelper.sin((float)n * 6.2831855F / 8.0F) * 0.75F;
+ float p = MathHelper.cos((float)n * 6.2831855F / 8.0F) * 0.75F;
+ float q = (float)n / 8.0F;
+ vertexConsumer.vertex(matrix4f, k * 0.2F, l * 0.2F, 0.0F).color(0, 0, 0, 255).texture(m, h).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(matrix3f, 0.0F, -1.0F, 0.0F).next();
+ vertexConsumer.vertex(matrix4f, k, l, g).color(255, 255, 255, 255).texture(m, i).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(matrix3f, 0.0F, -1.0F, 0.0F).next();
+ vertexConsumer.vertex(matrix4f, o, p, g).color(255, 255, 255, 255).texture(q, i).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(matrix3f, 0.0F, -1.0F, 0.0F).next();
+ vertexConsumer.vertex(matrix4f, o * 0.2F, p * 0.2F, 0.0F).color(0, 0, 0, 255).texture(q, h).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(matrix3f, 0.0F, -1.0F, 0.0F).next();
+ k = o;
+ l = p;
+ m = q;
+ }
+
+ matrices.pop();
+ }
+
+ static {
+ END_CRYSTAL = RenderLayer.getEntityCutoutNoCull(CRYSTAL_TEXTURE);
+ CRYSTAL_BEAM_LAYER = RenderLayer.getEntitySmoothCutout(CRYSTAL_BEAM_TEXTURE);
+ SINE_45_DEGREES = (float) Math.sin(0.7853981633974483D);
+ FRAME = new ModelPart(64, 32, 0, 0);
+ FRAME.addCuboid(-4.0F, -4.0F, -4.0F, 8.0F, 8.0F, 8.0F);
+ CORE = new ModelPart(64, 32, 32, 0);
+ CORE.addCuboid(-4.0F, -4.0F, -4.0F, 8.0F, 8.0F, 8.0F);
+ }
+}
diff --git a/src/main/java/ru/betterend/blocks/entities/render/PedestalItemRenderer.java b/src/main/java/ru/betterend/blocks/entities/render/PedestalItemRenderer.java
index 67f78c17..e3dc9a03 100644
--- a/src/main/java/ru/betterend/blocks/entities/render/PedestalItemRenderer.java
+++ b/src/main/java/ru/betterend/blocks/entities/render/PedestalItemRenderer.java
@@ -1,75 +1,75 @@
-package ru.betterend.blocks.entities.render;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.minecraft.block.BlockState;
-import net.minecraft.client.MinecraftClient;
-import net.minecraft.client.render.RenderLayer;
-import net.minecraft.client.render.VertexConsumer;
-import net.minecraft.client.render.VertexConsumerProvider;
-import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
-import net.minecraft.client.render.block.entity.BlockEntityRenderer;
-import net.minecraft.client.render.model.BakedModel;
-import net.minecraft.client.render.model.json.ModelTransformation;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.client.util.math.Vector3f;
-import net.minecraft.item.BlockItem;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.Items;
-import net.minecraft.util.DyeColor;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.math.MathHelper;
-import ru.betterend.blocks.EternalPedestal;
-import ru.betterend.blocks.basis.BlockPedestal;
-import ru.betterend.blocks.entities.PedestalBlockEntity;
-import ru.betterend.client.render.BeamRenderer;
-import ru.betterend.registry.EndBlocks;
-
-@Environment(EnvType.CLIENT)
-public class PedestalItemRenderer extends BlockEntityRenderer {
- private static final Identifier BEAM_TEXTURE = new Identifier("textures/entity/end_gateway_beam.png");
-
- public PedestalItemRenderer(BlockEntityRenderDispatcher dispatcher) {
- super(dispatcher);
- }
-
- @Override
- public void render(PedestalBlockEntity blockEntity, float tickDelta, MatrixStack matrices,
- VertexConsumerProvider vertexConsumers, int light, int overlay) {
-
- if (blockEntity.isEmpty()) return;
-
- BlockState state = blockEntity.getWorld().getBlockState(blockEntity.getPos());
- ItemStack activeItem = blockEntity.getStack(0);
- matrices.push();
- MinecraftClient minecraft = MinecraftClient.getInstance();
- BakedModel model = minecraft.getItemRenderer().getHeldItemModel(activeItem, blockEntity.getWorld(), null);
- Vector3f translate = model.getTransformation().ground.translation;
- BlockPedestal pedestal = (BlockPedestal) state.getBlock();
- matrices.translate(translate.getX(), translate.getY(), translate.getZ());
- matrices.translate(0.5, pedestal.getHeight(state), 0.5);
- if (activeItem.getItem() instanceof BlockItem) {
- matrices.scale(1.5F, 1.5F, 1.5F);
- } else {
- matrices.scale(1.25F, 1.25F, 1.25F);
- }
-
- float rotation = (blockEntity.getAge() + tickDelta) / 25.0F + 6.0F;
- matrices.multiply(Vector3f.POSITIVE_Y.getRadialQuaternion(rotation));
- if (state.isOf(EndBlocks.ETERNAL_PEDESTAL) && state.get(EternalPedestal.ACTIVATED)) {
- float altitude = MathHelper.sin((blockEntity.getAge() + tickDelta) / 10.0F) * 0.1F + 0.1F;
- matrices.translate(0.0D, altitude, 0.0D);
- float[] colors = DyeColor.MAGENTA.getColorComponents();
- int y = blockEntity.getPos().getY();
- VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getBeaconBeam(BEAM_TEXTURE, true));
- BeamRenderer.renderLightBeam(matrices, vertexConsumer, tickDelta, -y, 1024 - y, colors, 0.25F, 0.15F, 0.2F);
- }
-
- if (activeItem.getItem() == Items.END_CRYSTAL) {
- EndCrystalRenderer.render(blockEntity.getAge(), blockEntity.getMaxAge(), tickDelta, matrices, vertexConsumers, light);
- } else {
- minecraft.getItemRenderer().renderItem(activeItem, ModelTransformation.Mode.GROUND, false, matrices, vertexConsumers, light, overlay, model);
- }
- matrices.pop();
- }
-}
+package ru.betterend.blocks.entities.render;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.minecraft.block.BlockState;
+import net.minecraft.client.MinecraftClient;
+import net.minecraft.client.render.RenderLayer;
+import net.minecraft.client.render.VertexConsumer;
+import net.minecraft.client.render.VertexConsumerProvider;
+import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
+import net.minecraft.client.render.block.entity.BlockEntityRenderer;
+import net.minecraft.client.render.model.BakedModel;
+import net.minecraft.client.render.model.json.ModelTransformation;
+import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.client.util.math.Vector3f;
+import net.minecraft.item.BlockItem;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.Items;
+import net.minecraft.util.DyeColor;
+import net.minecraft.util.Identifier;
+import net.minecraft.util.math.MathHelper;
+import ru.betterend.blocks.EternalPedestal;
+import ru.betterend.blocks.basis.BlockPedestal;
+import ru.betterend.blocks.entities.PedestalBlockEntity;
+import ru.betterend.client.render.BeamRenderer;
+import ru.betterend.registry.EndBlocks;
+
+@Environment(EnvType.CLIENT)
+public class PedestalItemRenderer extends BlockEntityRenderer {
+ private static final Identifier BEAM_TEXTURE = new Identifier("textures/entity/end_gateway_beam.png");
+
+ public PedestalItemRenderer(BlockEntityRenderDispatcher dispatcher) {
+ super(dispatcher);
+ }
+
+ @Override
+ public void render(PedestalBlockEntity blockEntity, float tickDelta, MatrixStack matrices,
+ VertexConsumerProvider vertexConsumers, int light, int overlay) {
+
+ if (blockEntity.isEmpty()) return;
+
+ BlockState state = blockEntity.getWorld().getBlockState(blockEntity.getPos());
+ ItemStack activeItem = blockEntity.getStack(0);
+ matrices.push();
+ MinecraftClient minecraft = MinecraftClient.getInstance();
+ BakedModel model = minecraft.getItemRenderer().getHeldItemModel(activeItem, blockEntity.getWorld(), null);
+ Vector3f translate = model.getTransformation().ground.translation;
+ BlockPedestal pedestal = (BlockPedestal) state.getBlock();
+ matrices.translate(translate.getX(), translate.getY(), translate.getZ());
+ matrices.translate(0.5, pedestal.getHeight(state), 0.5);
+ if (activeItem.getItem() instanceof BlockItem) {
+ matrices.scale(1.5F, 1.5F, 1.5F);
+ } else {
+ matrices.scale(1.25F, 1.25F, 1.25F);
+ }
+
+ float rotation = (blockEntity.getAge() + tickDelta) / 25.0F + 6.0F;
+ matrices.multiply(Vector3f.POSITIVE_Y.getRadialQuaternion(rotation));
+ if (state.isOf(EndBlocks.ETERNAL_PEDESTAL) && state.get(EternalPedestal.ACTIVATED)) {
+ float altitude = MathHelper.sin((blockEntity.getAge() + tickDelta) / 10.0F) * 0.1F + 0.1F;
+ matrices.translate(0.0D, altitude, 0.0D);
+ float[] colors = DyeColor.MAGENTA.getColorComponents();
+ int y = blockEntity.getPos().getY();
+ VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getBeaconBeam(BEAM_TEXTURE, true));
+ BeamRenderer.renderLightBeam(matrices, vertexConsumer, tickDelta, -y, 1024 - y, colors, 0.25F, 0.15F, 0.2F);
+ }
+
+ if (activeItem.getItem() == Items.END_CRYSTAL) {
+ EndCrystalRenderer.render(blockEntity.getAge(), blockEntity.getMaxAge(), tickDelta, matrices, vertexConsumers, light);
+ } else {
+ minecraft.getItemRenderer().renderItem(activeItem, ModelTransformation.Mode.GROUND, false, matrices, vertexConsumers, light, overlay, model);
+ }
+ matrices.pop();
+ }
+}
diff --git a/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java b/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java
index 5f17e7a7..3339920f 100644
--- a/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java
+++ b/src/main/java/ru/betterend/client/gui/EndStoneSmelterRecipeBookScreen.java
@@ -1,102 +1,102 @@
-package ru.betterend.client.gui;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import com.mojang.blaze3d.systems.RenderSystem;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.minecraft.client.gui.DrawableHelper;
-import net.minecraft.client.gui.screen.Screen;
-import net.minecraft.client.gui.screen.recipebook.BlastFurnaceRecipeBookScreen;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.recipe.Ingredient;
-import net.minecraft.recipe.Recipe;
-import net.minecraft.screen.slot.Slot;
-import net.minecraft.util.collection.DefaultedList;
-import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
-
-@Environment(EnvType.CLIENT)
-public class EndStoneSmelterRecipeBookScreen extends BlastFurnaceRecipeBookScreen {
- private Iterator- fuelIterator;
- private Set
- fuels;
- private Slot fuelSlot;
- private Item currentItem;
- private float frameTime;
-
- @Override
- protected Set
- getAllowedFuels() {
- return EndStoneSmelterBlockEntity.availableFuels().keySet();
- }
-
- @Override
- public void slotClicked(Slot slot) {
- super.slotClicked(slot);
- if (slot != null && slot.id < this.craftingScreenHandler.getCraftingSlotCount()) {
- this.fuelSlot = null;
- }
- }
-
- @Override
- public void showGhostRecipe(Recipe> recipe, List slots) {
- this.ghostSlots.reset();
- ItemStack result = recipe.getOutput();
- this.ghostSlots.setRecipe(recipe);
- this.ghostSlots.addSlot(Ingredient.ofStacks(result), (slots.get(3)).x, (slots.get(3)).y);
- DefaultedList inputs = recipe.getPreviewInputs();
- Iterator iterator = inputs.iterator();
- for(int i = 0; i < 2; i++) {
- if (!iterator.hasNext()) {
- return;
- }
- Ingredient ingredient = iterator.next();
- if (!ingredient.isEmpty()) {
- Slot slot = slots.get(i);
- this.ghostSlots.addSlot(ingredient, slot.x, slot.y);
- }
- }
- this.fuelSlot = slots.get(2);
- if (this.fuels == null) {
- this.fuels = this.getAllowedFuels();
- }
-
- this.fuelIterator = this.fuels.iterator();
- this.currentItem = null;
- }
-
- @Override
- public void drawGhostSlots(MatrixStack matrices, int x, int y, boolean bl, float f) {
- this.ghostSlots.draw(matrices, client, x, y, bl, f);
- if (fuelSlot != null) {
- if (!Screen.hasControlDown()) {
- this.frameTime += f;
- }
-
- int slotX = this.fuelSlot.x + x;
- int slotY = this.fuelSlot.y + y;
- DrawableHelper.fill(matrices, slotX, slotY, slotX + 16, slotY + 16, 822018048);
- this.client.getItemRenderer().renderInGuiWithOverrides(client.player, this.getItem().getDefaultStack(), slotX, slotY);
- RenderSystem.depthFunc(516);
- DrawableHelper.fill(matrices, slotX, slotY, slotX + 16, slotY + 16, 822083583);
- RenderSystem.depthFunc(515);
- }
- }
-
- private Item getItem() {
- if (this.currentItem == null || this.frameTime > 30.0F) {
- this.frameTime = 0.0F;
- if (this.fuelIterator == null || !this.fuelIterator.hasNext()) {
- if (this.fuels == null) {
- this.fuels = this.getAllowedFuels();
- }
- this.fuelIterator = this.fuels.iterator();
- }
- this.currentItem = this.fuelIterator.next();
- }
- return this.currentItem;
- }
-}
+package ru.betterend.client.gui;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import com.mojang.blaze3d.systems.RenderSystem;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.minecraft.client.gui.DrawableHelper;
+import net.minecraft.client.gui.screen.Screen;
+import net.minecraft.client.gui.screen.recipebook.BlastFurnaceRecipeBookScreen;
+import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.recipe.Ingredient;
+import net.minecraft.recipe.Recipe;
+import net.minecraft.screen.slot.Slot;
+import net.minecraft.util.collection.DefaultedList;
+import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
+
+@Environment(EnvType.CLIENT)
+public class EndStoneSmelterRecipeBookScreen extends BlastFurnaceRecipeBookScreen {
+ private Iterator
- fuelIterator;
+ private Set
- fuels;
+ private Slot fuelSlot;
+ private Item currentItem;
+ private float frameTime;
+
+ @Override
+ protected Set
- getAllowedFuels() {
+ return EndStoneSmelterBlockEntity.availableFuels().keySet();
+ }
+
+ @Override
+ public void slotClicked(Slot slot) {
+ super.slotClicked(slot);
+ if (slot != null && slot.id < this.craftingScreenHandler.getCraftingSlotCount()) {
+ this.fuelSlot = null;
+ }
+ }
+
+ @Override
+ public void showGhostRecipe(Recipe> recipe, List slots) {
+ this.ghostSlots.reset();
+ ItemStack result = recipe.getOutput();
+ this.ghostSlots.setRecipe(recipe);
+ this.ghostSlots.addSlot(Ingredient.ofStacks(result), (slots.get(3)).x, (slots.get(3)).y);
+ DefaultedList inputs = recipe.getPreviewInputs();
+ Iterator iterator = inputs.iterator();
+ for(int i = 0; i < 2; i++) {
+ if (!iterator.hasNext()) {
+ return;
+ }
+ Ingredient ingredient = iterator.next();
+ if (!ingredient.isEmpty()) {
+ Slot slot = slots.get(i);
+ this.ghostSlots.addSlot(ingredient, slot.x, slot.y);
+ }
+ }
+ this.fuelSlot = slots.get(2);
+ if (this.fuels == null) {
+ this.fuels = this.getAllowedFuels();
+ }
+
+ this.fuelIterator = this.fuels.iterator();
+ this.currentItem = null;
+ }
+
+ @Override
+ public void drawGhostSlots(MatrixStack matrices, int x, int y, boolean bl, float f) {
+ this.ghostSlots.draw(matrices, client, x, y, bl, f);
+ if (fuelSlot != null) {
+ if (!Screen.hasControlDown()) {
+ this.frameTime += f;
+ }
+
+ int slotX = this.fuelSlot.x + x;
+ int slotY = this.fuelSlot.y + y;
+ DrawableHelper.fill(matrices, slotX, slotY, slotX + 16, slotY + 16, 822018048);
+ this.client.getItemRenderer().renderInGuiWithOverrides(client.player, this.getItem().getDefaultStack(), slotX, slotY);
+ RenderSystem.depthFunc(516);
+ DrawableHelper.fill(matrices, slotX, slotY, slotX + 16, slotY + 16, 822083583);
+ RenderSystem.depthFunc(515);
+ }
+ }
+
+ private Item getItem() {
+ if (this.currentItem == null || this.frameTime > 30.0F) {
+ this.frameTime = 0.0F;
+ if (this.fuelIterator == null || !this.fuelIterator.hasNext()) {
+ if (this.fuels == null) {
+ this.fuels = this.getAllowedFuels();
+ }
+ this.fuelIterator = this.fuels.iterator();
+ }
+ this.currentItem = this.fuelIterator.next();
+ }
+ return this.currentItem;
+ }
+}
diff --git a/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java b/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java
index 1bd7e27d..8c81c7ff 100644
--- a/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java
+++ b/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreen.java
@@ -1,130 +1,130 @@
-package ru.betterend.client.gui;
-
-import com.mojang.blaze3d.systems.RenderSystem;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.minecraft.client.gui.screen.ingame.HandledScreen;
-import net.minecraft.client.gui.screen.recipebook.RecipeBookProvider;
-import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget;
-import net.minecraft.client.gui.widget.TexturedButtonWidget;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.entity.player.PlayerInventory;
-import net.minecraft.screen.slot.Slot;
-import net.minecraft.screen.slot.SlotActionType;
-import net.minecraft.text.StringVisitable;
-import net.minecraft.text.Text;
-import net.minecraft.util.Identifier;
-import ru.betterend.BetterEnd;
-
-@Environment(EnvType.CLIENT)
-public class EndStoneSmelterScreen extends HandledScreen implements RecipeBookProvider {
-
- private final static Identifier RECIPE_BUTTON_TEXTURE = new Identifier("textures/gui/recipe_button.png");
- private final static Identifier BACKGROUND_TEXTURE = BetterEnd.makeID("textures/gui/smelter_gui.png");
-
- public final EndStoneSmelterRecipeBookScreen recipeBook;
- private boolean narrow;
-
- public EndStoneSmelterScreen(EndStoneSmelterScreenHandler handler, PlayerInventory inventory, Text title) {
- super(handler, inventory, title);
- this.recipeBook = new EndStoneSmelterRecipeBookScreen();
- }
-
- public void init() {
- super.init();
- this.narrow = this.width < 379;
- this.recipeBook.initialize(width, height, client, narrow, handler);
- this.x = this.recipeBook.findLeftEdge(narrow, width, backgroundWidth);
- this.addButton(new TexturedButtonWidget(x + 20, height / 2 - 49, 20, 18, 0, 0, 19, RECIPE_BUTTON_TEXTURE, (buttonWidget) -> {
- this.recipeBook.reset(narrow);
- this.recipeBook.toggleOpen();
- this.x = this.recipeBook.findLeftEdge(narrow, width, backgroundWidth);
- ((TexturedButtonWidget) buttonWidget).setPos(this.x + 20, height / 2 - 49);
- }));
- this.titleX = (this.backgroundWidth - this.textRenderer.getWidth((StringVisitable)this.title)) / 2;
- }
-
- @Override
- public void tick() {
- super.tick();
- this.recipeBook.update();
- }
-
- @Override
- public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
- this.renderBackground(matrices);
- if (this.recipeBook.isOpen() && this.narrow) {
- this.drawBackground(matrices, delta, mouseX, mouseY);
- this.recipeBook.render(matrices, mouseX, mouseY, delta);
- } else {
- this.recipeBook.render(matrices, mouseX, mouseY, delta);
- super.render(matrices, mouseX, mouseY, delta);
- this.recipeBook.drawGhostSlots(matrices, x, y, true, delta);
- }
-
- this.drawMouseoverTooltip(matrices, mouseX, mouseY);
- this.recipeBook.drawTooltip(matrices, x, y, mouseX, mouseY);
- }
-
- @Override
- public boolean mouseClicked(double mouseX, double mouseY, int button) {
- if (this.recipeBook.mouseClicked(mouseX, mouseY, button)) {
- return true;
- } else {
- return this.narrow && this.recipeBook.isOpen() ? true : super.mouseClicked(mouseX, mouseY, button);
- }
- }
-
- @Override
- protected void onMouseClick(Slot slot, int invSlot, int clickData, SlotActionType actionType) {
- super.onMouseClick(slot, invSlot, clickData, actionType);
- this.recipeBook.slotClicked(slot);
- }
-
- @Override
- public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
- return this.recipeBook.keyPressed(keyCode, scanCode, modifiers) ? false : super.keyPressed(keyCode, scanCode, modifiers);
- }
-
- @Override
- protected boolean isClickOutsideBounds(double mouseX, double mouseY, int left, int top, int button) {
- boolean isMouseOut = mouseX < left || mouseY < top || mouseX >= (left + backgroundWidth) || mouseY >= (top + backgroundHeight);
- return this.recipeBook.isClickOutsideBounds(mouseX, mouseY, x, y, backgroundWidth, backgroundHeight, button) && isMouseOut;
- }
-
- @Override
- public boolean charTyped(char chr, int keyCode) {
- return this.recipeBook.charTyped(chr, keyCode) ? true : super.charTyped(chr, keyCode);
- }
-
- @Override
- public void refreshRecipeBook() {
- this.recipeBook.refresh();
- }
-
- @Override
- public RecipeBookWidget getRecipeBookWidget() {
- return this.recipeBook;
- }
-
- @Override
- protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) {
- RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
- this.client.getTextureManager().bindTexture(BACKGROUND_TEXTURE);
- this.drawTexture(matrices, x, y, 0, 0, backgroundWidth, backgroundHeight);
- int p;
- if (handler.isBurning()) {
- p = handler.getFuelProgress();
- this.drawTexture(matrices, x + 56, y + 36 + 12 - p, 176, 12 - p, 14, p + 1);
- }
- p = handler.getSmeltProgress();
- this.drawTexture(matrices, x + 92, y + 34, 176, 14, p + 1, 16);
- }
-
- @Override
- public void removed() {
- this.recipeBook.close();
- super.removed();
- }
-}
+package ru.betterend.client.gui;
+
+import com.mojang.blaze3d.systems.RenderSystem;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.minecraft.client.gui.screen.ingame.HandledScreen;
+import net.minecraft.client.gui.screen.recipebook.RecipeBookProvider;
+import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget;
+import net.minecraft.client.gui.widget.TexturedButtonWidget;
+import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.entity.player.PlayerInventory;
+import net.minecraft.screen.slot.Slot;
+import net.minecraft.screen.slot.SlotActionType;
+import net.minecraft.text.StringVisitable;
+import net.minecraft.text.Text;
+import net.minecraft.util.Identifier;
+import ru.betterend.BetterEnd;
+
+@Environment(EnvType.CLIENT)
+public class EndStoneSmelterScreen extends HandledScreen implements RecipeBookProvider {
+
+ private final static Identifier RECIPE_BUTTON_TEXTURE = new Identifier("textures/gui/recipe_button.png");
+ private final static Identifier BACKGROUND_TEXTURE = BetterEnd.makeID("textures/gui/smelter_gui.png");
+
+ public final EndStoneSmelterRecipeBookScreen recipeBook;
+ private boolean narrow;
+
+ public EndStoneSmelterScreen(EndStoneSmelterScreenHandler handler, PlayerInventory inventory, Text title) {
+ super(handler, inventory, title);
+ this.recipeBook = new EndStoneSmelterRecipeBookScreen();
+ }
+
+ public void init() {
+ super.init();
+ this.narrow = this.width < 379;
+ this.recipeBook.initialize(width, height, client, narrow, handler);
+ this.x = this.recipeBook.findLeftEdge(narrow, width, backgroundWidth);
+ this.addButton(new TexturedButtonWidget(x + 20, height / 2 - 49, 20, 18, 0, 0, 19, RECIPE_BUTTON_TEXTURE, (buttonWidget) -> {
+ this.recipeBook.reset(narrow);
+ this.recipeBook.toggleOpen();
+ this.x = this.recipeBook.findLeftEdge(narrow, width, backgroundWidth);
+ ((TexturedButtonWidget) buttonWidget).setPos(this.x + 20, height / 2 - 49);
+ }));
+ this.titleX = (this.backgroundWidth - this.textRenderer.getWidth((StringVisitable)this.title)) / 2;
+ }
+
+ @Override
+ public void tick() {
+ super.tick();
+ this.recipeBook.update();
+ }
+
+ @Override
+ public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
+ this.renderBackground(matrices);
+ if (this.recipeBook.isOpen() && this.narrow) {
+ this.drawBackground(matrices, delta, mouseX, mouseY);
+ this.recipeBook.render(matrices, mouseX, mouseY, delta);
+ } else {
+ this.recipeBook.render(matrices, mouseX, mouseY, delta);
+ super.render(matrices, mouseX, mouseY, delta);
+ this.recipeBook.drawGhostSlots(matrices, x, y, true, delta);
+ }
+
+ this.drawMouseoverTooltip(matrices, mouseX, mouseY);
+ this.recipeBook.drawTooltip(matrices, x, y, mouseX, mouseY);
+ }
+
+ @Override
+ public boolean mouseClicked(double mouseX, double mouseY, int button) {
+ if (this.recipeBook.mouseClicked(mouseX, mouseY, button)) {
+ return true;
+ } else {
+ return this.narrow && this.recipeBook.isOpen() ? true : super.mouseClicked(mouseX, mouseY, button);
+ }
+ }
+
+ @Override
+ protected void onMouseClick(Slot slot, int invSlot, int clickData, SlotActionType actionType) {
+ super.onMouseClick(slot, invSlot, clickData, actionType);
+ this.recipeBook.slotClicked(slot);
+ }
+
+ @Override
+ public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
+ return this.recipeBook.keyPressed(keyCode, scanCode, modifiers) ? false : super.keyPressed(keyCode, scanCode, modifiers);
+ }
+
+ @Override
+ protected boolean isClickOutsideBounds(double mouseX, double mouseY, int left, int top, int button) {
+ boolean isMouseOut = mouseX < left || mouseY < top || mouseX >= (left + backgroundWidth) || mouseY >= (top + backgroundHeight);
+ return this.recipeBook.isClickOutsideBounds(mouseX, mouseY, x, y, backgroundWidth, backgroundHeight, button) && isMouseOut;
+ }
+
+ @Override
+ public boolean charTyped(char chr, int keyCode) {
+ return this.recipeBook.charTyped(chr, keyCode) ? true : super.charTyped(chr, keyCode);
+ }
+
+ @Override
+ public void refreshRecipeBook() {
+ this.recipeBook.refresh();
+ }
+
+ @Override
+ public RecipeBookWidget getRecipeBookWidget() {
+ return this.recipeBook;
+ }
+
+ @Override
+ protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) {
+ RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.client.getTextureManager().bindTexture(BACKGROUND_TEXTURE);
+ this.drawTexture(matrices, x, y, 0, 0, backgroundWidth, backgroundHeight);
+ int p;
+ if (handler.isBurning()) {
+ p = handler.getFuelProgress();
+ this.drawTexture(matrices, x + 56, y + 36 + 12 - p, 176, 12 - p, 14, p + 1);
+ }
+ p = handler.getSmeltProgress();
+ this.drawTexture(matrices, x + 92, y + 34, 176, 14, p + 1, 16);
+ }
+
+ @Override
+ public void removed() {
+ this.recipeBook.close();
+ super.removed();
+ }
+}
diff --git a/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreenHandler.java b/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreenHandler.java
index 69aaa0f8..3bb71d6f 100644
--- a/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreenHandler.java
+++ b/src/main/java/ru/betterend/client/gui/EndStoneSmelterScreenHandler.java
@@ -1,186 +1,186 @@
-package ru.betterend.client.gui;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.entity.player.PlayerInventory;
-import net.minecraft.inventory.Inventory;
-import net.minecraft.inventory.SimpleInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.recipe.Recipe;
-import net.minecraft.recipe.RecipeFinder;
-import net.minecraft.recipe.RecipeInputProvider;
-import net.minecraft.recipe.book.RecipeBookCategory;
-import net.minecraft.screen.AbstractRecipeScreenHandler;
-import net.minecraft.screen.ArrayPropertyDelegate;
-import net.minecraft.screen.PropertyDelegate;
-import net.minecraft.screen.ScreenHandlerType;
-import net.minecraft.screen.slot.Slot;
-import net.minecraft.world.World;
-import ru.betterend.BetterEnd;
-import ru.betterend.blocks.EndStoneSmelter;
-import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
-import ru.betterend.client.gui.slot.SmelterFuelSlot;
-import ru.betterend.client.gui.slot.SmelterOutputSlot;
-import ru.betterend.recipe.builders.AlloyingRecipe;
-
-public class EndStoneSmelterScreenHandler extends AbstractRecipeScreenHandler {
-
- public final static ScreenHandlerType HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(
- BetterEnd.makeID(EndStoneSmelter.ID), EndStoneSmelterScreenHandler::new);
-
- private final Inventory inventory;
- private final PropertyDelegate propertyDelegate;
- protected final World world;
-
- public EndStoneSmelterScreenHandler(int syncId, PlayerInventory playerInventory) {
- this(syncId, playerInventory, new SimpleInventory(4), new ArrayPropertyDelegate(4));
- }
-
- public EndStoneSmelterScreenHandler(int syncId, PlayerInventory playerInventory, Inventory inventory, PropertyDelegate propertyDelegate) {
- super(HANDLER_TYPE, syncId);
- this.inventory = inventory;
- this.propertyDelegate = propertyDelegate;
- this.world = playerInventory.player.world;
-
- this.addProperties(propertyDelegate);
- this.addSlot(new Slot(inventory, 0, 45, 17));
- this.addSlot(new Slot(inventory, 1, 67, 17));
- this.addSlot(new SmelterFuelSlot(this, inventory, 2, 56, 53));
- this.addSlot(new SmelterOutputSlot(playerInventory.player, inventory, 3, 129, 35));
-
- for(int i = 0; i < 3; ++i) {
- for(int j = 0; j < 9; ++j) {
- this.addSlot(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
- }
- }
- for(int i = 0; i < 9; ++i) {
- this.addSlot(new Slot(playerInventory, i, 8 + i * 18, 142));
- }
- }
-
- @Override
- public void populateRecipeFinder(RecipeFinder finder) {
- if (inventory instanceof RecipeInputProvider) {
- ((RecipeInputProvider) inventory).provideRecipeInputs(finder);
- }
- }
-
- @Override
- public void clearCraftingSlots() {
- this.inventory.clear();
- }
-
- @Override
- public boolean matches(Recipe super Inventory> recipe) {
- return recipe.matches(this.inventory, this.world);
- }
-
- @Override
- public int getCraftingResultSlotIndex() {
- return 3;
- }
-
- @Override
- public int getCraftingWidth() {
- return 2;
- }
-
- @Override
- public int getCraftingHeight() {
- return 1;
- }
-
- @Override
- public int getCraftingSlotCount() {
- return 4;
- }
-
- @Override
- public RecipeBookCategory getCategory() {
- return RecipeBookCategory.BLAST_FURNACE;
- }
-
- @Override
- public boolean canUse(PlayerEntity player) {
- return this.inventory.canPlayerUse(player);
- }
-
- protected boolean isSmeltable(ItemStack itemStack) {
- return this.world.getRecipeManager().getFirstMatch(AlloyingRecipe.TYPE, new SimpleInventory(new ItemStack[]{itemStack}), this.world).isPresent();
- }
-
- public boolean isFuel(ItemStack itemStack) {
- return EndStoneSmelterBlockEntity.canUseAsFuel(itemStack);
- }
-
- @Override
- public ItemStack transferSlot(PlayerEntity player, int index) {
- ItemStack itemStack = ItemStack.EMPTY;
- Slot slot = this.slots.get(index);
- if (slot != null && slot.hasStack()) {
- ItemStack itemStack2 = slot.getStack();
- itemStack = itemStack2.copy();
- if (index == 3) {
- if (insertItem(itemStack2, 4, 40, true)) {
- return ItemStack.EMPTY;
- }
- slot.onStackChanged(itemStack2, itemStack);
- } else if (index != 2 && index != 1 && index != 0) {
- if (isSmeltable(itemStack2)) {
- if (!insertItem(itemStack2, 0, 2, false)) {
- return ItemStack.EMPTY;
- }
- } else if (isFuel(itemStack2)) {
- if (!this.insertItem(itemStack2, 2, 3, false)) {
- return ItemStack.EMPTY;
- }
- } else if (index >= 4 && index < 31) {
- if (!insertItem(itemStack2, 31, 40, false)) {
- return ItemStack.EMPTY;
- }
- } else if (index >= 31 && index < 40 && !insertItem(itemStack2, 4, 31, false)) {
- return ItemStack.EMPTY;
- }
- } else if (!insertItem(itemStack2, 4, 40, false)) {
- return ItemStack.EMPTY;
- }
-
- if (itemStack2.isEmpty()) {
- slot.setStack(ItemStack.EMPTY);
- } else {
- slot.markDirty();
- }
-
- if (itemStack2.getCount() == itemStack.getCount()) {
- return ItemStack.EMPTY;
- }
-
- slot.onTakeItem(player, itemStack2);
- }
-
- return itemStack;
- }
-
- @Environment(EnvType.CLIENT)
- public int getSmeltProgress() {
- int time = this.propertyDelegate.get(2);
- int timeTotal = this.propertyDelegate.get(3);
- return timeTotal != 0 && time != 0 ? time * 24 / timeTotal : 0;
- }
-
- @Environment(EnvType.CLIENT)
- public int getFuelProgress() {
- int fuelTime = this.propertyDelegate.get(1);
- if (fuelTime == 0) {
- fuelTime = 200;
- }
- return this.propertyDelegate.get(0) * 13 / fuelTime;
- }
-
- @Environment(EnvType.CLIENT)
- public boolean isBurning() {
- return this.propertyDelegate.get(0) > 0;
- }
-}
+package ru.betterend.client.gui;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.entity.player.PlayerInventory;
+import net.minecraft.inventory.Inventory;
+import net.minecraft.inventory.SimpleInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.recipe.Recipe;
+import net.minecraft.recipe.RecipeFinder;
+import net.minecraft.recipe.RecipeInputProvider;
+import net.minecraft.recipe.book.RecipeBookCategory;
+import net.minecraft.screen.AbstractRecipeScreenHandler;
+import net.minecraft.screen.ArrayPropertyDelegate;
+import net.minecraft.screen.PropertyDelegate;
+import net.minecraft.screen.ScreenHandlerType;
+import net.minecraft.screen.slot.Slot;
+import net.minecraft.world.World;
+import ru.betterend.BetterEnd;
+import ru.betterend.blocks.EndStoneSmelter;
+import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
+import ru.betterend.client.gui.slot.SmelterFuelSlot;
+import ru.betterend.client.gui.slot.SmelterOutputSlot;
+import ru.betterend.recipe.builders.AlloyingRecipe;
+
+public class EndStoneSmelterScreenHandler extends AbstractRecipeScreenHandler {
+
+ public final static ScreenHandlerType HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(
+ BetterEnd.makeID(EndStoneSmelter.ID), EndStoneSmelterScreenHandler::new);
+
+ private final Inventory inventory;
+ private final PropertyDelegate propertyDelegate;
+ protected final World world;
+
+ public EndStoneSmelterScreenHandler(int syncId, PlayerInventory playerInventory) {
+ this(syncId, playerInventory, new SimpleInventory(4), new ArrayPropertyDelegate(4));
+ }
+
+ public EndStoneSmelterScreenHandler(int syncId, PlayerInventory playerInventory, Inventory inventory, PropertyDelegate propertyDelegate) {
+ super(HANDLER_TYPE, syncId);
+ this.inventory = inventory;
+ this.propertyDelegate = propertyDelegate;
+ this.world = playerInventory.player.world;
+
+ this.addProperties(propertyDelegate);
+ this.addSlot(new Slot(inventory, 0, 45, 17));
+ this.addSlot(new Slot(inventory, 1, 67, 17));
+ this.addSlot(new SmelterFuelSlot(this, inventory, 2, 56, 53));
+ this.addSlot(new SmelterOutputSlot(playerInventory.player, inventory, 3, 129, 35));
+
+ for(int i = 0; i < 3; ++i) {
+ for(int j = 0; j < 9; ++j) {
+ this.addSlot(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
+ }
+ }
+ for(int i = 0; i < 9; ++i) {
+ this.addSlot(new Slot(playerInventory, i, 8 + i * 18, 142));
+ }
+ }
+
+ @Override
+ public void populateRecipeFinder(RecipeFinder finder) {
+ if (inventory instanceof RecipeInputProvider) {
+ ((RecipeInputProvider) inventory).provideRecipeInputs(finder);
+ }
+ }
+
+ @Override
+ public void clearCraftingSlots() {
+ this.inventory.clear();
+ }
+
+ @Override
+ public boolean matches(Recipe super Inventory> recipe) {
+ return recipe.matches(this.inventory, this.world);
+ }
+
+ @Override
+ public int getCraftingResultSlotIndex() {
+ return 3;
+ }
+
+ @Override
+ public int getCraftingWidth() {
+ return 2;
+ }
+
+ @Override
+ public int getCraftingHeight() {
+ return 1;
+ }
+
+ @Override
+ public int getCraftingSlotCount() {
+ return 4;
+ }
+
+ @Override
+ public RecipeBookCategory getCategory() {
+ return RecipeBookCategory.BLAST_FURNACE;
+ }
+
+ @Override
+ public boolean canUse(PlayerEntity player) {
+ return this.inventory.canPlayerUse(player);
+ }
+
+ protected boolean isSmeltable(ItemStack itemStack) {
+ return this.world.getRecipeManager().getFirstMatch(AlloyingRecipe.TYPE, new SimpleInventory(new ItemStack[]{itemStack}), this.world).isPresent();
+ }
+
+ public boolean isFuel(ItemStack itemStack) {
+ return EndStoneSmelterBlockEntity.canUseAsFuel(itemStack);
+ }
+
+ @Override
+ public ItemStack transferSlot(PlayerEntity player, int index) {
+ ItemStack itemStack = ItemStack.EMPTY;
+ Slot slot = this.slots.get(index);
+ if (slot != null && slot.hasStack()) {
+ ItemStack itemStack2 = slot.getStack();
+ itemStack = itemStack2.copy();
+ if (index == 3) {
+ if (insertItem(itemStack2, 4, 40, true)) {
+ return ItemStack.EMPTY;
+ }
+ slot.onStackChanged(itemStack2, itemStack);
+ } else if (index != 2 && index != 1 && index != 0) {
+ if (isSmeltable(itemStack2)) {
+ if (!insertItem(itemStack2, 0, 2, false)) {
+ return ItemStack.EMPTY;
+ }
+ } else if (isFuel(itemStack2)) {
+ if (!this.insertItem(itemStack2, 2, 3, false)) {
+ return ItemStack.EMPTY;
+ }
+ } else if (index >= 4 && index < 31) {
+ if (!insertItem(itemStack2, 31, 40, false)) {
+ return ItemStack.EMPTY;
+ }
+ } else if (index >= 31 && index < 40 && !insertItem(itemStack2, 4, 31, false)) {
+ return ItemStack.EMPTY;
+ }
+ } else if (!insertItem(itemStack2, 4, 40, false)) {
+ return ItemStack.EMPTY;
+ }
+
+ if (itemStack2.isEmpty()) {
+ slot.setStack(ItemStack.EMPTY);
+ } else {
+ slot.markDirty();
+ }
+
+ if (itemStack2.getCount() == itemStack.getCount()) {
+ return ItemStack.EMPTY;
+ }
+
+ slot.onTakeItem(player, itemStack2);
+ }
+
+ return itemStack;
+ }
+
+ @Environment(EnvType.CLIENT)
+ public int getSmeltProgress() {
+ int time = this.propertyDelegate.get(2);
+ int timeTotal = this.propertyDelegate.get(3);
+ return timeTotal != 0 && time != 0 ? time * 24 / timeTotal : 0;
+ }
+
+ @Environment(EnvType.CLIENT)
+ public int getFuelProgress() {
+ int fuelTime = this.propertyDelegate.get(1);
+ if (fuelTime == 0) {
+ fuelTime = 200;
+ }
+ return this.propertyDelegate.get(0) * 13 / fuelTime;
+ }
+
+ @Environment(EnvType.CLIENT)
+ public boolean isBurning() {
+ return this.propertyDelegate.get(0) > 0;
+ }
+}
diff --git a/src/main/java/ru/betterend/client/gui/slot/SmelterFuelSlot.java b/src/main/java/ru/betterend/client/gui/slot/SmelterFuelSlot.java
index 3dcd9956..e0381d87 100644
--- a/src/main/java/ru/betterend/client/gui/slot/SmelterFuelSlot.java
+++ b/src/main/java/ru/betterend/client/gui/slot/SmelterFuelSlot.java
@@ -1,25 +1,25 @@
-package ru.betterend.client.gui.slot;
-
-import net.minecraft.inventory.Inventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.screen.slot.FurnaceFuelSlot;
-import net.minecraft.screen.slot.Slot;
-import ru.betterend.client.gui.EndStoneSmelterScreenHandler;
-
-public class SmelterFuelSlot extends Slot {
-
- private final EndStoneSmelterScreenHandler handler;
-
- public SmelterFuelSlot(EndStoneSmelterScreenHandler handler, Inventory inventory, int index, int x, int y) {
- super(inventory, index, x, y);
- this.handler = handler;
- }
-
- public boolean canInsert(ItemStack stack) {
- return this.handler.isFuel(stack) || FurnaceFuelSlot.isBucket(stack);
- }
-
- public int getMaxItemCount(ItemStack stack) {
- return FurnaceFuelSlot.isBucket(stack) ? 1 : super.getMaxItemCount(stack);
- }
-}
+package ru.betterend.client.gui.slot;
+
+import net.minecraft.inventory.Inventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.screen.slot.FurnaceFuelSlot;
+import net.minecraft.screen.slot.Slot;
+import ru.betterend.client.gui.EndStoneSmelterScreenHandler;
+
+public class SmelterFuelSlot extends Slot {
+
+ private final EndStoneSmelterScreenHandler handler;
+
+ public SmelterFuelSlot(EndStoneSmelterScreenHandler handler, Inventory inventory, int index, int x, int y) {
+ super(inventory, index, x, y);
+ this.handler = handler;
+ }
+
+ public boolean canInsert(ItemStack stack) {
+ return this.handler.isFuel(stack) || FurnaceFuelSlot.isBucket(stack);
+ }
+
+ public int getMaxItemCount(ItemStack stack) {
+ return FurnaceFuelSlot.isBucket(stack) ? 1 : super.getMaxItemCount(stack);
+ }
+}
diff --git a/src/main/java/ru/betterend/client/gui/slot/SmelterOutputSlot.java b/src/main/java/ru/betterend/client/gui/slot/SmelterOutputSlot.java
index 163960c7..dfe85893 100644
--- a/src/main/java/ru/betterend/client/gui/slot/SmelterOutputSlot.java
+++ b/src/main/java/ru/betterend/client/gui/slot/SmelterOutputSlot.java
@@ -1,49 +1,49 @@
-package ru.betterend.client.gui.slot;
-
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.inventory.Inventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.screen.slot.Slot;
-import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
-
-public class SmelterOutputSlot extends Slot {
-
- private PlayerEntity player;
- private int amount;
-
- public SmelterOutputSlot(PlayerEntity player, Inventory inventory, int index, int x, int y) {
- super(inventory, index, x, y);
- this.player = player;
- }
-
- public boolean canInsert(ItemStack stack) {
- return false;
- }
-
- public ItemStack takeStack(int amount) {
- if (this.hasStack()) {
- this.amount += Math.min(amount, this.getStack().getCount());
- }
-
- return super.takeStack(amount);
- }
-
- public ItemStack onTakeItem(PlayerEntity player, ItemStack stack) {
- this.onCrafted(stack);
- super.onTakeItem(player, stack);
- return stack;
- }
-
- protected void onCrafted(ItemStack stack, int amount) {
- this.amount += amount;
- this.onCrafted(stack);
- }
-
- protected void onCrafted(ItemStack stack) {
- stack.onCraft(this.player.world, this.player, this.amount);
- if (!this.player.world.isClient && this.inventory instanceof EndStoneSmelterBlockEntity) {
- ((EndStoneSmelterBlockEntity) this.inventory).dropExperience(player);
- }
- this.amount = 0;
- }
-}
+package ru.betterend.client.gui.slot;
+
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.inventory.Inventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.screen.slot.Slot;
+import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
+
+public class SmelterOutputSlot extends Slot {
+
+ private PlayerEntity player;
+ private int amount;
+
+ public SmelterOutputSlot(PlayerEntity player, Inventory inventory, int index, int x, int y) {
+ super(inventory, index, x, y);
+ this.player = player;
+ }
+
+ public boolean canInsert(ItemStack stack) {
+ return false;
+ }
+
+ public ItemStack takeStack(int amount) {
+ if (this.hasStack()) {
+ this.amount += Math.min(amount, this.getStack().getCount());
+ }
+
+ return super.takeStack(amount);
+ }
+
+ public ItemStack onTakeItem(PlayerEntity player, ItemStack stack) {
+ this.onCrafted(stack);
+ super.onTakeItem(player, stack);
+ return stack;
+ }
+
+ protected void onCrafted(ItemStack stack, int amount) {
+ this.amount += amount;
+ this.onCrafted(stack);
+ }
+
+ protected void onCrafted(ItemStack stack) {
+ stack.onCraft(this.player.world, this.player, this.amount);
+ if (!this.player.world.isClient && this.inventory instanceof EndStoneSmelterBlockEntity) {
+ ((EndStoneSmelterBlockEntity) this.inventory).dropExperience(player);
+ }
+ this.amount = 0;
+ }
+}
diff --git a/src/main/java/ru/betterend/client/render/BeamRenderer.java b/src/main/java/ru/betterend/client/render/BeamRenderer.java
index edb0b181..894462a7 100644
--- a/src/main/java/ru/betterend/client/render/BeamRenderer.java
+++ b/src/main/java/ru/betterend/client/render/BeamRenderer.java
@@ -1,62 +1,62 @@
-package ru.betterend.client.render;
-
-import net.minecraft.client.render.OverlayTexture;
-import net.minecraft.client.render.VertexConsumer;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.client.util.math.Vector3f;
-import net.minecraft.util.math.MathHelper;
-import net.minecraft.util.math.Matrix3f;
-import net.minecraft.util.math.Matrix4f;
-
-public class BeamRenderer {
- public static void renderLightBeam(MatrixStack matrixStack, VertexConsumer vertexConsumer, float tick, int minY, int maxY, float[] colors, float alpha, float h, float k) {
- int m = minY + maxY;
-
- float o = maxY < 0 ? tick : -tick;
- float p = MathHelper.fractionalPart(o * 0.2F - (float) MathHelper.floor(o * 0.1F));
- float red = colors[0];
- float green = colors[1];
- float blue = colors[2];
-
- matrixStack.push();
- matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(tick * 2.25F - 45.0F));
- float af = 0.0F;
- float ai = 0.0F;
- float aj = -h;
- float aa = -h;
- float ap = -1.0F + p;
- float aq = (float) maxY * (0.5F / h) + ap;
-
- renderBeam(matrixStack, vertexConsumer, red, green, blue, alpha, minY, m, 0.0F, h, h, 0.0F, aj, 0.0F, 0.0F, aa, 0.0F, 1.0F, aq, ap);
- matrixStack.pop();
-
- af = -k;
- float ag = -k;
- ai = -k;
- aj = -k;
- ap = -1.0F + p;
- aq = (float) maxY + ap;
- renderBeam(matrixStack, vertexConsumer, red, green, blue, alpha, minY, m, af, ag, k, ai, aj, k, k, k, 0.0F, 1.0F, aq, ap);
- }
-
- private static void renderBeam(MatrixStack matrixStack, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, int j, int k, float l, float m, float n, float o, float p, float q, float r, float s, float t, float u, float v, float w) {
- MatrixStack.Entry entry = matrixStack.peek();
- Matrix4f matrix4f = entry.getModel();
- Matrix3f matrix3f = entry.getNormal();
- renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, k, l, m, n, o, t, u, v, w);
- renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, k, r, s, p, q, t, u, v, w);
- renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, k, n, o, r, s, t, u, v, w);
- renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, k, p, q, l, m, t, u, v, w);
- }
-
- private static void renderBeam(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, int j, int k, float l, float m, float n, float o, float p, float q, float r, float s) {
- addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, k, l, m, q, r);
- addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, l, m, q, s);
- addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, n, o, p, s);
- addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, k, n, o, p, r);
- }
-
- private static void addVertex(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, float y, float x, float l, float m, float n) {
- vertexConsumer.vertex(matrix4f, x, y, l).color(red, green, blue, alpha).texture(m, n).overlay(OverlayTexture.DEFAULT_UV).light(15728880).normal(matrix3f, 0.0F, 1.0F, 0.0F).next();
- }
-}
+package ru.betterend.client.render;
+
+import net.minecraft.client.render.OverlayTexture;
+import net.minecraft.client.render.VertexConsumer;
+import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.client.util.math.Vector3f;
+import net.minecraft.util.math.MathHelper;
+import net.minecraft.util.math.Matrix3f;
+import net.minecraft.util.math.Matrix4f;
+
+public class BeamRenderer {
+ public static void renderLightBeam(MatrixStack matrixStack, VertexConsumer vertexConsumer, float tick, int minY, int maxY, float[] colors, float alpha, float h, float k) {
+ int m = minY + maxY;
+
+ float o = maxY < 0 ? tick : -tick;
+ float p = MathHelper.fractionalPart(o * 0.2F - (float) MathHelper.floor(o * 0.1F));
+ float red = colors[0];
+ float green = colors[1];
+ float blue = colors[2];
+
+ matrixStack.push();
+ matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(tick * 2.25F - 45.0F));
+ float af = 0.0F;
+ float ai = 0.0F;
+ float aj = -h;
+ float aa = -h;
+ float ap = -1.0F + p;
+ float aq = (float) maxY * (0.5F / h) + ap;
+
+ renderBeam(matrixStack, vertexConsumer, red, green, blue, alpha, minY, m, 0.0F, h, h, 0.0F, aj, 0.0F, 0.0F, aa, 0.0F, 1.0F, aq, ap);
+ matrixStack.pop();
+
+ af = -k;
+ float ag = -k;
+ ai = -k;
+ aj = -k;
+ ap = -1.0F + p;
+ aq = (float) maxY + ap;
+ renderBeam(matrixStack, vertexConsumer, red, green, blue, alpha, minY, m, af, ag, k, ai, aj, k, k, k, 0.0F, 1.0F, aq, ap);
+ }
+
+ private static void renderBeam(MatrixStack matrixStack, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, int j, int k, float l, float m, float n, float o, float p, float q, float r, float s, float t, float u, float v, float w) {
+ MatrixStack.Entry entry = matrixStack.peek();
+ Matrix4f matrix4f = entry.getModel();
+ Matrix3f matrix3f = entry.getNormal();
+ renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, k, l, m, n, o, t, u, v, w);
+ renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, k, r, s, p, q, t, u, v, w);
+ renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, k, n, o, r, s, t, u, v, w);
+ renderBeam(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, k, p, q, l, m, t, u, v, w);
+ }
+
+ private static void renderBeam(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, int j, int k, float l, float m, float n, float o, float p, float q, float r, float s) {
+ addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, k, l, m, q, r);
+ addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, l, m, q, s);
+ addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, j, n, o, p, s);
+ addVertex(matrix4f, matrix3f, vertexConsumer, red, green, blue, alpha, k, n, o, p, r);
+ }
+
+ private static void addVertex(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float red, float green, float blue, float alpha, float y, float x, float l, float m, float n) {
+ vertexConsumer.vertex(matrix4f, x, y, l).color(red, green, blue, alpha).texture(m, n).overlay(OverlayTexture.DEFAULT_UV).light(15728880).normal(matrix3f, 0.0F, 1.0F, 0.0F).next();
+ }
+}
diff --git a/src/main/java/ru/betterend/client/render/ERenderLayer.java b/src/main/java/ru/betterend/client/render/ERenderLayer.java
index 0bbf2358..3d18d635 100644
--- a/src/main/java/ru/betterend/client/render/ERenderLayer.java
+++ b/src/main/java/ru/betterend/client/render/ERenderLayer.java
@@ -1,6 +1,6 @@
-package ru.betterend.client.render;
-
-public enum ERenderLayer {
- CUTOUT,
- TRANSLUCENT;
-}
+package ru.betterend.client.render;
+
+public enum ERenderLayer {
+ CUTOUT,
+ TRANSLUCENT;
+}
diff --git a/src/main/java/ru/betterend/compat/REIAlloyingDisplay.java b/src/main/java/ru/betterend/compat/REIAlloyingDisplay.java
index 3b8e4d6d..09ebbb5f 100644
--- a/src/main/java/ru/betterend/compat/REIAlloyingDisplay.java
+++ b/src/main/java/ru/betterend/compat/REIAlloyingDisplay.java
@@ -1,111 +1,111 @@
-package ru.betterend.compat;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-import org.jetbrains.annotations.NotNull;
-
-import me.shedaniel.rei.api.EntryStack;
-import me.shedaniel.rei.api.TransferRecipeDisplay;
-import me.shedaniel.rei.server.ContainerInfo;
-import net.minecraft.item.Item;
-import net.minecraft.recipe.BlastingRecipe;
-import net.minecraft.recipe.Recipe;
-import net.minecraft.screen.ScreenHandler;
-import net.minecraft.text.TranslatableText;
-import net.minecraft.util.Formatting;
-import net.minecraft.util.Identifier;
-import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
-import ru.betterend.recipe.builders.AlloyingRecipe;
-
-public class REIAlloyingDisplay implements TransferRecipeDisplay {
-
- private static List fuel;
-
- private Recipe> recipe;
- private List
> input;
- private List output;
- private float xp;
- private double smeltTime;
-
- public REIAlloyingDisplay(AlloyingRecipe recipe) {
- this.recipe = recipe;
- this.input = EntryStack.ofIngredients(recipe.getPreviewInputs());
- this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
- this.xp = recipe.getExperience();
- this.smeltTime = recipe.getSmeltTime();
- }
-
- public REIAlloyingDisplay(BlastingRecipe recipe) {
- this.recipe = recipe;
- this.input = EntryStack.ofIngredients(recipe.getPreviewInputs());
- this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
- this.xp = recipe.getExperience();
- this.smeltTime = recipe.getCookTime();
- }
-
- public static List getFuel() {
- return fuel;
- }
-
- @Override
- public @NotNull Optional getRecipeLocation() {
- return Optional.ofNullable(recipe).map(Recipe::getId);
- }
-
- @Override
- public @NotNull List> getInputEntries() {
- return this.input;
- }
-
- @Override
- public @NotNull List> getResultingEntries() {
- return Collections.singletonList(output);
- }
-
- @Override
- public @NotNull Identifier getRecipeCategory() {
- return AlloyingRecipe.ID;
- }
-
- @Override
- public @NotNull List> getRequiredEntries() {
- return this.input;
- }
-
- public float getXp() {
- return this.xp;
- }
-
- public double getSmeltTime() {
- return this.smeltTime;
- }
-
- public Optional> getOptionalRecipe() {
- return Optional.ofNullable(recipe);
- }
-
- @Override
- public int getWidth() {
- return 2;
- }
-
- @Override
- public int getHeight() {
- return 1;
- }
-
- @Override
- public List> getOrganisedInputEntries(ContainerInfo containerInfo, ScreenHandler container) {
- return this.input;
- }
-
- static {
- fuel = EndStoneSmelterBlockEntity.availableFuels().keySet().stream()
- .map(Item::getDefaultStack).map(EntryStack::create)
- .map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableText("category.rei.smelting.fuel")
- .formatted(Formatting.YELLOW)))).collect(Collectors.toList());
- }
-}
+package ru.betterend.compat;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import org.jetbrains.annotations.NotNull;
+
+import me.shedaniel.rei.api.EntryStack;
+import me.shedaniel.rei.api.TransferRecipeDisplay;
+import me.shedaniel.rei.server.ContainerInfo;
+import net.minecraft.item.Item;
+import net.minecraft.recipe.BlastingRecipe;
+import net.minecraft.recipe.Recipe;
+import net.minecraft.screen.ScreenHandler;
+import net.minecraft.text.TranslatableText;
+import net.minecraft.util.Formatting;
+import net.minecraft.util.Identifier;
+import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
+import ru.betterend.recipe.builders.AlloyingRecipe;
+
+public class REIAlloyingDisplay implements TransferRecipeDisplay {
+
+ private static List fuel;
+
+ private Recipe> recipe;
+ private List> input;
+ private List output;
+ private float xp;
+ private double smeltTime;
+
+ public REIAlloyingDisplay(AlloyingRecipe recipe) {
+ this.recipe = recipe;
+ this.input = EntryStack.ofIngredients(recipe.getPreviewInputs());
+ this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
+ this.xp = recipe.getExperience();
+ this.smeltTime = recipe.getSmeltTime();
+ }
+
+ public REIAlloyingDisplay(BlastingRecipe recipe) {
+ this.recipe = recipe;
+ this.input = EntryStack.ofIngredients(recipe.getPreviewInputs());
+ this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
+ this.xp = recipe.getExperience();
+ this.smeltTime = recipe.getCookTime();
+ }
+
+ public static List getFuel() {
+ return fuel;
+ }
+
+ @Override
+ public @NotNull Optional getRecipeLocation() {
+ return Optional.ofNullable(recipe).map(Recipe::getId);
+ }
+
+ @Override
+ public @NotNull List> getInputEntries() {
+ return this.input;
+ }
+
+ @Override
+ public @NotNull List> getResultingEntries() {
+ return Collections.singletonList(output);
+ }
+
+ @Override
+ public @NotNull Identifier getRecipeCategory() {
+ return AlloyingRecipe.ID;
+ }
+
+ @Override
+ public @NotNull List> getRequiredEntries() {
+ return this.input;
+ }
+
+ public float getXp() {
+ return this.xp;
+ }
+
+ public double getSmeltTime() {
+ return this.smeltTime;
+ }
+
+ public Optional> getOptionalRecipe() {
+ return Optional.ofNullable(recipe);
+ }
+
+ @Override
+ public int getWidth() {
+ return 2;
+ }
+
+ @Override
+ public int getHeight() {
+ return 1;
+ }
+
+ @Override
+ public List> getOrganisedInputEntries(ContainerInfo containerInfo, ScreenHandler container) {
+ return this.input;
+ }
+
+ static {
+ fuel = EndStoneSmelterBlockEntity.availableFuels().keySet().stream()
+ .map(Item::getDefaultStack).map(EntryStack::create)
+ .map(e -> e.setting(EntryStack.Settings.TOOLTIP_APPEND_EXTRA, stack -> Collections.singletonList(new TranslatableText("category.rei.smelting.fuel")
+ .formatted(Formatting.YELLOW)))).collect(Collectors.toList());
+ }
+}
diff --git a/src/main/java/ru/betterend/compat/REIAnvilCategory.java b/src/main/java/ru/betterend/compat/REIAnvilCategory.java
index 65175ebb..87f12de9 100644
--- a/src/main/java/ru/betterend/compat/REIAnvilCategory.java
+++ b/src/main/java/ru/betterend/compat/REIAnvilCategory.java
@@ -1,84 +1,84 @@
-package ru.betterend.compat;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.jetbrains.annotations.NotNull;
-
-import com.google.common.collect.Lists;
-
-import it.unimi.dsi.fastutil.ints.IntList;
-import me.shedaniel.math.Point;
-import me.shedaniel.math.Rectangle;
-import me.shedaniel.rei.api.EntryStack;
-import me.shedaniel.rei.api.TransferRecipeCategory;
-import me.shedaniel.rei.api.widgets.Widgets;
-import me.shedaniel.rei.gui.entries.RecipeEntry;
-import me.shedaniel.rei.gui.entries.SimpleRecipeEntry;
-import me.shedaniel.rei.gui.widget.Widget;
-import net.minecraft.block.Blocks;
-import net.minecraft.client.gui.DrawableHelper;
-import net.minecraft.client.util.math.MatrixStack;
-import net.minecraft.text.TranslatableText;
-import net.minecraft.util.Identifier;
-import ru.betterend.util.LangUtil;
-
-public class REIAnvilCategory implements TransferRecipeCategory {
-
- @Override
- public @NotNull Identifier getIdentifier() {
- return REIPlugin.SMITHING;
- }
-
- @Override
- public @NotNull String getCategoryName() {
- return LangUtil.translate(Blocks.ANVIL.getTranslationKey());
- }
-
- @Override
- public @NotNull EntryStack getLogo() {
- return REIPlugin.ANVIL;
- }
-
- @Override
- public @NotNull List setupDisplay(REIAnvilDisplay display, Rectangle bounds) {
- Point startPoint = new Point(bounds.getCenterX() - 41, bounds.y + 10);
- List widgets = Lists.newArrayList();
- widgets.add(Widgets.createRecipeBase(bounds));
- int x = startPoint.x + 10;
- int y = startPoint.y;
- widgets.add(Widgets.createResultSlotBackground(new Point(x + 61, y + 4)));
- List> inputEntries = display.getInputEntries();
- widgets.add(Widgets.createArrow(new Point(x + 24, y + 3)));
- widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 5, bounds.y + bounds.height - 12),
- new TranslatableText("category.rei.damage.amount&dmg", display.getDamage())).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
- widgets.add(Widgets.createSlot(new Point(x - 20, y + 3)).entries(inputEntries.get(0)).markInput());
- widgets.add(Widgets.createSlot(new Point(x + 1, y + 3)).entries(inputEntries.get(1)).markInput());
- widgets.add(Widgets.createSlot(new Point(x + 61, y + 4)).entries(display.getResultingEntries().get(0)).disableBackground().markOutput());
- return widgets;
- }
-
- @Override
- public void renderRedSlots(MatrixStack matrices, List widgets, Rectangle bounds, REIAnvilDisplay display,
- IntList redSlots) {
- Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
- matrices.push();
- matrices.translate(0, 0, 400);
- if (redSlots.contains(0)) {
- DrawableHelper.fill(matrices, startPoint.x - 20, startPoint.y + 3, startPoint.x - 20 + 16, startPoint.y + 3 + 16, 1090453504);
- DrawableHelper.fill(matrices, startPoint.x + 1, startPoint.y + 3, startPoint.x + 1 + 16, startPoint.y + 3 + 16, 1090453504);
- }
- matrices.pop();
- }
-
- @Override
- public @NotNull RecipeEntry getSimpleRenderer(REIAnvilDisplay recipe) {
- return SimpleRecipeEntry.from(Collections.singletonList(recipe.getInputEntries().get(0)), recipe.getResultingEntries());
- }
-
- @Override
- public int getDisplayHeight() {
- return 49;
- }
-
-}
+package ru.betterend.compat;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.jetbrains.annotations.NotNull;
+
+import com.google.common.collect.Lists;
+
+import it.unimi.dsi.fastutil.ints.IntList;
+import me.shedaniel.math.Point;
+import me.shedaniel.math.Rectangle;
+import me.shedaniel.rei.api.EntryStack;
+import me.shedaniel.rei.api.TransferRecipeCategory;
+import me.shedaniel.rei.api.widgets.Widgets;
+import me.shedaniel.rei.gui.entries.RecipeEntry;
+import me.shedaniel.rei.gui.entries.SimpleRecipeEntry;
+import me.shedaniel.rei.gui.widget.Widget;
+import net.minecraft.block.Blocks;
+import net.minecraft.client.gui.DrawableHelper;
+import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.text.TranslatableText;
+import net.minecraft.util.Identifier;
+import ru.betterend.util.LangUtil;
+
+public class REIAnvilCategory implements TransferRecipeCategory {
+
+ @Override
+ public @NotNull Identifier getIdentifier() {
+ return REIPlugin.SMITHING;
+ }
+
+ @Override
+ public @NotNull String getCategoryName() {
+ return LangUtil.translate(Blocks.ANVIL.getTranslationKey());
+ }
+
+ @Override
+ public @NotNull EntryStack getLogo() {
+ return REIPlugin.ANVIL;
+ }
+
+ @Override
+ public @NotNull List setupDisplay(REIAnvilDisplay display, Rectangle bounds) {
+ Point startPoint = new Point(bounds.getCenterX() - 41, bounds.y + 10);
+ List widgets = Lists.newArrayList();
+ widgets.add(Widgets.createRecipeBase(bounds));
+ int x = startPoint.x + 10;
+ int y = startPoint.y;
+ widgets.add(Widgets.createResultSlotBackground(new Point(x + 61, y + 4)));
+ List> inputEntries = display.getInputEntries();
+ widgets.add(Widgets.createArrow(new Point(x + 24, y + 3)));
+ widgets.add(Widgets.createLabel(new Point(bounds.x + bounds.width - 5, bounds.y + bounds.height - 12),
+ new TranslatableText("category.rei.damage.amount&dmg", display.getDamage())).noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
+ widgets.add(Widgets.createSlot(new Point(x - 20, y + 3)).entries(inputEntries.get(0)).markInput());
+ widgets.add(Widgets.createSlot(new Point(x + 1, y + 3)).entries(inputEntries.get(1)).markInput());
+ widgets.add(Widgets.createSlot(new Point(x + 61, y + 4)).entries(display.getResultingEntries().get(0)).disableBackground().markOutput());
+ return widgets;
+ }
+
+ @Override
+ public void renderRedSlots(MatrixStack matrices, List widgets, Rectangle bounds, REIAnvilDisplay display,
+ IntList redSlots) {
+ Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
+ matrices.push();
+ matrices.translate(0, 0, 400);
+ if (redSlots.contains(0)) {
+ DrawableHelper.fill(matrices, startPoint.x - 20, startPoint.y + 3, startPoint.x - 20 + 16, startPoint.y + 3 + 16, 1090453504);
+ DrawableHelper.fill(matrices, startPoint.x + 1, startPoint.y + 3, startPoint.x + 1 + 16, startPoint.y + 3 + 16, 1090453504);
+ }
+ matrices.pop();
+ }
+
+ @Override
+ public @NotNull RecipeEntry getSimpleRenderer(REIAnvilDisplay recipe) {
+ return SimpleRecipeEntry.from(Collections.singletonList(recipe.getInputEntries().get(0)), recipe.getResultingEntries());
+ }
+
+ @Override
+ public int getDisplayHeight() {
+ return 49;
+ }
+
+}
diff --git a/src/main/java/ru/betterend/compat/REIAnvilDisplay.java b/src/main/java/ru/betterend/compat/REIAnvilDisplay.java
index f554b8d9..ddca40b1 100644
--- a/src/main/java/ru/betterend/compat/REIAnvilDisplay.java
+++ b/src/main/java/ru/betterend/compat/REIAnvilDisplay.java
@@ -1,73 +1,73 @@
-package ru.betterend.compat;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-
-import org.jetbrains.annotations.NotNull;
-
-import me.shedaniel.rei.api.EntryStack;
-import me.shedaniel.rei.api.TransferRecipeDisplay;
-import me.shedaniel.rei.server.ContainerInfo;
-import net.minecraft.recipe.Recipe;
-import net.minecraft.screen.ScreenHandler;
-import net.minecraft.util.Identifier;
-import ru.betterend.recipe.builders.AnvilSmithingRecipe;
-
-public class REIAnvilDisplay implements TransferRecipeDisplay {
-
- private AnvilSmithingRecipe recipe;
- private List> input;
- private List output;
-
- public REIAnvilDisplay(AnvilSmithingRecipe recipe) {
- this.recipe = recipe;
- this.input = EntryStack.ofIngredients(recipe.getPreviewInputs());
- this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
- }
-
- public int getDamage() {
- return this.recipe.getDamage();
- }
-
- @Override
- public @NotNull Optional getRecipeLocation() {
- return Optional.ofNullable(recipe).map(Recipe::getId);
- }
-
- @Override
- public @NotNull List> getInputEntries() {
- return this.input;
- }
-
- @Override
- public @NotNull List> getResultingEntries() {
- return Collections.singletonList(output);
- }
-
- @Override
- public @NotNull Identifier getRecipeCategory() {
- return REIPlugin.SMITHING;
- }
-
- @Override
- public @NotNull List> getRequiredEntries() {
- return this.input;
- }
-
- @Override
- public int getWidth() {
- return 2;
- }
-
- @Override
- public int getHeight() {
- return 1;
- }
-
- @Override
- public List> getOrganisedInputEntries(ContainerInfo containerInfo,
- ScreenHandler container) {
- return this.input;
- }
-}
+package ru.betterend.compat;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Optional;
+
+import org.jetbrains.annotations.NotNull;
+
+import me.shedaniel.rei.api.EntryStack;
+import me.shedaniel.rei.api.TransferRecipeDisplay;
+import me.shedaniel.rei.server.ContainerInfo;
+import net.minecraft.recipe.Recipe;
+import net.minecraft.screen.ScreenHandler;
+import net.minecraft.util.Identifier;
+import ru.betterend.recipe.builders.AnvilSmithingRecipe;
+
+public class REIAnvilDisplay implements TransferRecipeDisplay {
+
+ private AnvilSmithingRecipe recipe;
+ private List> input;
+ private List output;
+
+ public REIAnvilDisplay(AnvilSmithingRecipe recipe) {
+ this.recipe = recipe;
+ this.input = EntryStack.ofIngredients(recipe.getPreviewInputs());
+ this.output = Collections.singletonList(EntryStack.create(recipe.getOutput()));
+ }
+
+ public int getDamage() {
+ return this.recipe.getDamage();
+ }
+
+ @Override
+ public @NotNull Optional getRecipeLocation() {
+ return Optional.ofNullable(recipe).map(Recipe::getId);
+ }
+
+ @Override
+ public @NotNull List> getInputEntries() {
+ return this.input;
+ }
+
+ @Override
+ public @NotNull List> getResultingEntries() {
+ return Collections.singletonList(output);
+ }
+
+ @Override
+ public @NotNull Identifier getRecipeCategory() {
+ return REIPlugin.SMITHING;
+ }
+
+ @Override
+ public @NotNull List> getRequiredEntries() {
+ return this.input;
+ }
+
+ @Override
+ public int getWidth() {
+ return 2;
+ }
+
+ @Override
+ public int getHeight() {
+ return 1;
+ }
+
+ @Override
+ public List> getOrganisedInputEntries(ContainerInfo containerInfo,
+ ScreenHandler container) {
+ return this.input;
+ }
+}
diff --git a/src/main/java/ru/betterend/compat/REIContainer.java b/src/main/java/ru/betterend/compat/REIContainer.java
index ec5f4946..9c6f242e 100644
--- a/src/main/java/ru/betterend/compat/REIContainer.java
+++ b/src/main/java/ru/betterend/compat/REIContainer.java
@@ -1,14 +1,14 @@
-package ru.betterend.compat;
-
-import me.shedaniel.rei.plugin.containers.CraftingContainerInfoWrapper;
-import me.shedaniel.rei.server.ContainerInfoHandler;
-import ru.betterend.client.gui.EndStoneSmelterScreenHandler;
-import ru.betterend.recipe.builders.AlloyingRecipe;
-
-public class REIContainer implements Runnable {
-
- @Override
- public void run() {
- ContainerInfoHandler.registerContainerInfo(AlloyingRecipe.ID, CraftingContainerInfoWrapper.create(EndStoneSmelterScreenHandler.class));
- }
-}
+package ru.betterend.compat;
+
+import me.shedaniel.rei.plugin.containers.CraftingContainerInfoWrapper;
+import me.shedaniel.rei.server.ContainerInfoHandler;
+import ru.betterend.client.gui.EndStoneSmelterScreenHandler;
+import ru.betterend.recipe.builders.AlloyingRecipe;
+
+public class REIContainer implements Runnable {
+
+ @Override
+ public void run() {
+ ContainerInfoHandler.registerContainerInfo(AlloyingRecipe.ID, CraftingContainerInfoWrapper.create(EndStoneSmelterScreenHandler.class));
+ }
+}
diff --git a/src/main/java/ru/betterend/config/Config.java b/src/main/java/ru/betterend/config/Config.java
index c30533c1..52354aed 100644
--- a/src/main/java/ru/betterend/config/Config.java
+++ b/src/main/java/ru/betterend/config/Config.java
@@ -1,115 +1,115 @@
-package ru.betterend.config;
-
-import ru.betterend.BetterEnd;
-import ru.betterend.config.ConfigKeeper.BooleanEntry;
-import ru.betterend.config.ConfigKeeper.Entry;
-import ru.betterend.config.ConfigKeeper.FloatEntry;
-import ru.betterend.config.ConfigKeeper.IntegerEntry;
-import ru.betterend.config.ConfigKeeper.RangeEntry;
-import ru.betterend.config.ConfigKeeper.StringEntry;
-
-public abstract class Config {
-
- protected final ConfigKeeper configKeeper = new ConfigKeeper();
-
- public abstract void saveChanges();
-
- public > E getEntry(String key) {
- return this.configKeeper.getEntry(key);
- }
-
- public T getDefault(String key) {
- Entry entry = configKeeper.getEntry(key);
- return entry != null ? entry.getDefault() : null;
- }
-
- public String getString(String key) {
- String str = configKeeper.getValue(key);
- return str != null ? str : "";
- }
-
- public boolean setString(String key, String value) {
- try {
- StringEntry entry = configKeeper.getEntry(key);
- entry.setValue(value);
- this.configKeeper.set(key, entry);
-
- return true;
- } catch (NullPointerException ex) {
- BetterEnd.LOGGER.catching(ex);
- }
-
- return false;
- }
-
- public int getInt(String key) {
- Integer val = configKeeper.getValue(key);
- return val != null ? val : 0;
- }
-
- public boolean setInt(String key, int value) {
- try {
- IntegerEntry entry = configKeeper.getEntry(key);
- entry.setValue(value);
- this.configKeeper.set(key, entry);
-
- return true;
- } catch (NullPointerException ex) {
- BetterEnd.LOGGER.catching(ex);
- }
-
- return false;
- }
-
- public > boolean setRanged(String key, T value) {
- try {
- RangeEntry entry = configKeeper.getEntry(key);
- entry.setValue(value);
- this.configKeeper.set(key, entry);
-
- return true;
- } catch (NullPointerException | ClassCastException ex) {
- BetterEnd.LOGGER.catching(ex);
- }
-
- return false;
- }
-
- public float getFloat(String key) {
- Float val = configKeeper.getValue(key);
- return val != null ? val : 0.0F;
- }
-
- public boolean setFloat(String key, float value) {
- try {
- FloatEntry entry = configKeeper.getEntry(key);
- entry.setValue(value);
- this.configKeeper.set(key, entry);
-
- return true;
- } catch (NullPointerException ex) {
- BetterEnd.LOGGER.catching(ex);
- }
-
- return false;
- }
-
- public boolean getBoolean(String key) {
- Boolean val = configKeeper.getValue(key);
- return val != null ? val : false;
- }
-
- public boolean setBoolean(String key, boolean value) {
- try {
- BooleanEntry entry = configKeeper.getEntry(key);
- entry.setValue(value);
- this.configKeeper.set(key, entry);
-
- return true;
- } catch (NullPointerException ex) {
- BetterEnd.LOGGER.catching(ex);
- }
-
- return false;
- }
-}
+package ru.betterend.config;
+
+import ru.betterend.BetterEnd;
+import ru.betterend.config.ConfigKeeper.BooleanEntry;
+import ru.betterend.config.ConfigKeeper.Entry;
+import ru.betterend.config.ConfigKeeper.FloatEntry;
+import ru.betterend.config.ConfigKeeper.IntegerEntry;
+import ru.betterend.config.ConfigKeeper.RangeEntry;
+import ru.betterend.config.ConfigKeeper.StringEntry;
+
+public abstract class Config {
+
+ protected final ConfigKeeper configKeeper = new ConfigKeeper();
+
+ public abstract void saveChanges();
+
+ public > E getEntry(String key) {
+ return this.configKeeper.getEntry(key);
+ }
+
+ public T getDefault(String key) {
+ Entry entry = configKeeper.getEntry(key);
+ return entry != null ? entry.getDefault() : null;
+ }
+
+ public String getString(String key) {
+ String str = configKeeper.getValue(key);
+ return str != null ? str : "";
+ }
+
+ public boolean setString(String key, String value) {
+ try {
+ StringEntry entry = configKeeper.getEntry(key);
+ entry.setValue(value);
+ this.configKeeper.set(key, entry);
+
+ return true;
+ } catch (NullPointerException ex) {
+ BetterEnd.LOGGER.catching(ex);
+ }
+
+ return false;
+ }
+
+ public int getInt(String key) {
+ Integer val = configKeeper.getValue(key);
+ return val != null ? val : 0;
+ }
+
+ public boolean setInt(String key, int value) {
+ try {
+ IntegerEntry entry = configKeeper.getEntry(key);
+ entry.setValue(value);
+ this.configKeeper.set(key, entry);
+
+ return true;
+ } catch (NullPointerException ex) {
+ BetterEnd.LOGGER.catching(ex);
+ }
+
+ return false;
+ }
+
+ public > boolean setRanged(String key, T value) {
+ try {
+ RangeEntry entry = configKeeper.getEntry(key);
+ entry.setValue(value);
+ this.configKeeper.set(key, entry);
+
+ return true;
+ } catch (NullPointerException | ClassCastException ex) {
+ BetterEnd.LOGGER.catching(ex);
+ }
+
+ return false;
+ }
+
+ public float getFloat(String key) {
+ Float val = configKeeper.getValue(key);
+ return val != null ? val : 0.0F;
+ }
+
+ public boolean setFloat(String key, float value) {
+ try {
+ FloatEntry entry = configKeeper.getEntry(key);
+ entry.setValue(value);
+ this.configKeeper.set(key, entry);
+
+ return true;
+ } catch (NullPointerException ex) {
+ BetterEnd.LOGGER.catching(ex);
+ }
+
+ return false;
+ }
+
+ public boolean getBoolean(String key) {
+ Boolean val = configKeeper.getValue(key);
+ return val != null ? val : false;
+ }
+
+ public boolean setBoolean(String key, boolean value) {
+ try {
+ BooleanEntry entry = configKeeper.getEntry(key);
+ entry.setValue(value);
+ this.configKeeper.set(key, entry);
+
+ return true;
+ } catch (NullPointerException ex) {
+ BetterEnd.LOGGER.catching(ex);
+ }
+
+ return false;
+ }
+}
diff --git a/src/main/java/ru/betterend/config/ConfigKeeper.java b/src/main/java/ru/betterend/config/ConfigKeeper.java
index 0ad9043b..df05b8c7 100644
--- a/src/main/java/ru/betterend/config/ConfigKeeper.java
+++ b/src/main/java/ru/betterend/config/ConfigKeeper.java
@@ -1,342 +1,342 @@
-package ru.betterend.config;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-
-import net.minecraft.util.JsonHelper;
-import ru.betterend.BetterEnd;
-
-public final class ConfigKeeper {
-
- private Map> configEntries = new HashMap<>();
-
- public JsonElement toJson(JsonObject jsonObject) {
- for (String param : configEntries.keySet()) {
- jsonObject.addProperty(param, configEntries.get(param).asString());
- }
-
- return jsonObject;
- }
-
- public void fromJson(JsonObject jsonObject) {
- for (String param : configEntries.keySet()) {
- if (jsonObject.has(param)) {
- Entry> entry = configEntries.get(param);
- entry.fromString(JsonHelper.getString(jsonObject, param));
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- public > E getEntry(String key) {
- Entry> entry = this.configEntries.get(key);
- if (entry == null) {
- BetterEnd.LOGGER.warning(String.format("Entry '%s' doesn't exists.", key));
- return null;
- }
- return (E) entry;
- }
-
- public T getValue(String key) {
- Entry entry = this.getEntry(key);
- if (entry == null) {
- BetterEnd.LOGGER.warning("Empty value will be returned.");
- return null;
- }
- return entry.getValue();
- }
-
- public void set(String key, Entry> entry) {
- configEntries.put(key, entry);
- }
-
- public > void registerEntry(String key, T entry) {
- configEntries.put(key, entry);
- }
-
- public static class BooleanEntry extends Entry {
-
- public BooleanEntry(Boolean defaultValue, Consumer consumer, Supplier supplier) {
- super(defaultValue, consumer, supplier);
- }
-
- @Override
- public Boolean getValue() {
- return this.getter.get();
- }
-
- @Override
- public void setValue(Boolean value) {
- this.setter.accept(value);
- }
-
- @Override
- public Boolean getDefault() {
- return this.defaultValue;
- }
-
- @Override
- public String asString() {
- return this.getValue() ? "true" : "false";
- }
-
- @Override
- public void fromString(String value) {
- this.setValue(value.equals("true") ? true : false);
- }
-
- }
-
- public static class FloatEntry extends Entry {
-
- public FloatEntry(Float defaultValue, Consumer consumer, Supplier supplier) {
- super(defaultValue, consumer, supplier);
- }
-
- @Override
- public Float getValue() {
- return this.getter.get();
- }
-
- @Override
- public void setValue(Float value) {
- this.setter.accept(value);
- }
-
- @Override
- public Float getDefault() {
- return this.defaultValue;
- }
-
- @Override
- public String asString() {
- return Float.toString(getValue());
- }
-
- @Override
- public void fromString(String value) {
- this.setValue(Float.valueOf(value));
- }
-
- }
-
- public static class FloatRange extends RangeEntry {
-
- public FloatRange(Float defaultValue, Consumer consumer, Supplier supplier, Float minVal, Float maxVal) {
- super(defaultValue, consumer, supplier, minVal, maxVal);
- }
-
- @Override
- public Float getValue() {
- return this.getter.get();
- }
-
- @Override
- public Float getDefault() {
- return this.defaultValue;
- }
-
- @Override
- public void fromString(String value) {
- this.setValue(Float.valueOf(value));
- }
-
- @Override
- public String asString() {
- return Float.toString(getValue());
- }
-
- }
-
- public static class IntegerEntry extends Entry {
-
- public IntegerEntry(Integer defaultValue, Consumer consumer, Supplier supplier) {
- super(defaultValue, consumer, supplier);
- }
-
- @Override
- public Integer getValue() {
- return this.getter.get();
- }
-
- @Override
- public void setValue(Integer value) {
- this.setter.accept(value);
- }
-
- @Override
- public Integer getDefault() {
- return this.defaultValue;
- }
-
- @Override
- public String asString() {
- return Integer.toString(getValue());
- }
-
- @Override
- public void fromString(String value) {
- this.setValue(Integer.valueOf(value));
- }
-
- }
-
- public static class IntegerRange extends RangeEntry {
-
- public IntegerRange(Integer defaultValue, Consumer consumer, Supplier supplier, Integer minVal, Integer maxVal) {
- super(defaultValue, consumer, supplier, minVal, maxVal);
- }
-
- @Override
- public Integer getValue() {
- return this.getter.get();
- }
-
- @Override
- public Integer getDefault() {
- return this.defaultValue;
- }
-
- @Override
- public void fromString(String value) {
- this.setValue(Integer.valueOf(value));
- }
-
- @Override
- public String asString() {
- return Integer.toString(getValue());
- }
-
- }
-
- public static class StringEntry extends Entry {
-
- public StringEntry(String defaultValue, Consumer consumer, Supplier supplier) {
- super(defaultValue, consumer, supplier);
- }
-
- @Override
- public String getValue() {
- return this.getter.get();
- }
-
- @Override
- public void setValue(String value) {
- this.setter.accept(value);
- }
-
- @Override
- public String getDefault() {
- return this.defaultValue;
- }
-
- @Override
- public String asString() {
- return getValue();
- }
-
- @Override
- public void fromString(String value) {
- this.setValue(value);
- }
-
- }
-
- public static class EnumEntry> extends Entry {
-
- public EnumEntry(T defaultValue, Consumer consumer, Supplier supplier) {
- super(defaultValue, consumer, supplier);
- }
-
- @Override
- public T getValue() {
- return this.getter.get();
- }
-
- @Override
- public void setValue(T value) {
- this.setter.accept(value);
- }
-
- @SuppressWarnings("unchecked")
- public boolean setValue(String name) {
- try {
- this.setter.accept((T) Enum.valueOf(this.defaultValue.getClass(), name));
- return true;
- } catch(IllegalArgumentException ex) {
- BetterEnd.LOGGER.catching(ex);
- }
-
- return false;
- }
-
- @Override
- public T getDefault() {
- return this.defaultValue;
- }
-
- @Override
- public String asString() {
- return getValue().name();
- }
-
- @Override
- public void fromString(String value) {
- this.setValue(value);
- }
- }
-
- public static abstract class RangeEntry> extends Entry {
-
- private final T min, max;
-
- public RangeEntry(T defaultValue, Consumer consumer, Supplier supplier, T minVal, T maxVal) {
- super(defaultValue, consumer, supplier);
-
- this.min = minVal;
- this.max = maxVal;
- }
-
- @Override
- public void setValue(T value) {
- this.setter.accept(value.compareTo(min) < 0 ? min : value.compareTo(max) > 0 ? max : value);
- }
-
- public T minValue() {
- return this.min;
- }
-
- public T maxValue() {
- return this.max;
- }
- }
-
- public static abstract class Entry {
-
- protected final T defaultValue;
-
- protected final Consumer setter;
- protected final Supplier getter;
-
- public Entry (T defaultValue, Consumer consumer, Supplier supplier) {
- this.defaultValue = defaultValue;
- this.setter = consumer;
- this.getter = supplier;
- }
-
- public abstract T getValue();
- public abstract void setValue(T value);
- public abstract T getDefault();
- public abstract void fromString(String value);
- public abstract String asString();
-
- public void setDefault() {
- this.setter.accept(defaultValue);
- }
- }
-}
+package ru.betterend.config;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.Consumer;
+import java.util.function.Supplier;
+
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+
+import net.minecraft.util.JsonHelper;
+import ru.betterend.BetterEnd;
+
+public final class ConfigKeeper {
+
+ private Map> configEntries = new HashMap<>();
+
+ public JsonElement toJson(JsonObject jsonObject) {
+ for (String param : configEntries.keySet()) {
+ jsonObject.addProperty(param, configEntries.get(param).asString());
+ }
+
+ return jsonObject;
+ }
+
+ public void fromJson(JsonObject jsonObject) {
+ for (String param : configEntries.keySet()) {
+ if (jsonObject.has(param)) {
+ Entry> entry = configEntries.get(param);
+ entry.fromString(JsonHelper.getString(jsonObject, param));
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public > E getEntry(String key) {
+ Entry> entry = this.configEntries.get(key);
+ if (entry == null) {
+ BetterEnd.LOGGER.warning(String.format("Entry '%s' doesn't exists.", key));
+ return null;
+ }
+ return (E) entry;
+ }
+
+ public T getValue(String key) {
+ Entry entry = this.getEntry(key);
+ if (entry == null) {
+ BetterEnd.LOGGER.warning("Empty value will be returned.");
+ return null;
+ }
+ return entry.getValue();
+ }
+
+ public void set(String key, Entry> entry) {
+ configEntries.put(key, entry);
+ }
+
+ public > void registerEntry(String key, T entry) {
+ configEntries.put(key, entry);
+ }
+
+ public static class BooleanEntry extends Entry {
+
+ public BooleanEntry(Boolean defaultValue, Consumer consumer, Supplier supplier) {
+ super(defaultValue, consumer, supplier);
+ }
+
+ @Override
+ public Boolean getValue() {
+ return this.getter.get();
+ }
+
+ @Override
+ public void setValue(Boolean value) {
+ this.setter.accept(value);
+ }
+
+ @Override
+ public Boolean getDefault() {
+ return this.defaultValue;
+ }
+
+ @Override
+ public String asString() {
+ return this.getValue() ? "true" : "false";
+ }
+
+ @Override
+ public void fromString(String value) {
+ this.setValue(value.equals("true") ? true : false);
+ }
+
+ }
+
+ public static class FloatEntry extends Entry {
+
+ public FloatEntry(Float defaultValue, Consumer consumer, Supplier supplier) {
+ super(defaultValue, consumer, supplier);
+ }
+
+ @Override
+ public Float getValue() {
+ return this.getter.get();
+ }
+
+ @Override
+ public void setValue(Float value) {
+ this.setter.accept(value);
+ }
+
+ @Override
+ public Float getDefault() {
+ return this.defaultValue;
+ }
+
+ @Override
+ public String asString() {
+ return Float.toString(getValue());
+ }
+
+ @Override
+ public void fromString(String value) {
+ this.setValue(Float.valueOf(value));
+ }
+
+ }
+
+ public static class FloatRange extends RangeEntry {
+
+ public FloatRange(Float defaultValue, Consumer consumer, Supplier supplier, Float minVal, Float maxVal) {
+ super(defaultValue, consumer, supplier, minVal, maxVal);
+ }
+
+ @Override
+ public Float getValue() {
+ return this.getter.get();
+ }
+
+ @Override
+ public Float getDefault() {
+ return this.defaultValue;
+ }
+
+ @Override
+ public void fromString(String value) {
+ this.setValue(Float.valueOf(value));
+ }
+
+ @Override
+ public String asString() {
+ return Float.toString(getValue());
+ }
+
+ }
+
+ public static class IntegerEntry extends Entry {
+
+ public IntegerEntry(Integer defaultValue, Consumer consumer, Supplier supplier) {
+ super(defaultValue, consumer, supplier);
+ }
+
+ @Override
+ public Integer getValue() {
+ return this.getter.get();
+ }
+
+ @Override
+ public void setValue(Integer value) {
+ this.setter.accept(value);
+ }
+
+ @Override
+ public Integer getDefault() {
+ return this.defaultValue;
+ }
+
+ @Override
+ public String asString() {
+ return Integer.toString(getValue());
+ }
+
+ @Override
+ public void fromString(String value) {
+ this.setValue(Integer.valueOf(value));
+ }
+
+ }
+
+ public static class IntegerRange extends RangeEntry {
+
+ public IntegerRange(Integer defaultValue, Consumer consumer, Supplier supplier, Integer minVal, Integer maxVal) {
+ super(defaultValue, consumer, supplier, minVal, maxVal);
+ }
+
+ @Override
+ public Integer getValue() {
+ return this.getter.get();
+ }
+
+ @Override
+ public Integer getDefault() {
+ return this.defaultValue;
+ }
+
+ @Override
+ public void fromString(String value) {
+ this.setValue(Integer.valueOf(value));
+ }
+
+ @Override
+ public String asString() {
+ return Integer.toString(getValue());
+ }
+
+ }
+
+ public static class StringEntry extends Entry {
+
+ public StringEntry(String defaultValue, Consumer consumer, Supplier supplier) {
+ super(defaultValue, consumer, supplier);
+ }
+
+ @Override
+ public String getValue() {
+ return this.getter.get();
+ }
+
+ @Override
+ public void setValue(String value) {
+ this.setter.accept(value);
+ }
+
+ @Override
+ public String getDefault() {
+ return this.defaultValue;
+ }
+
+ @Override
+ public String asString() {
+ return getValue();
+ }
+
+ @Override
+ public void fromString(String value) {
+ this.setValue(value);
+ }
+
+ }
+
+ public static class EnumEntry> extends Entry {
+
+ public EnumEntry(T defaultValue, Consumer consumer, Supplier supplier) {
+ super(defaultValue, consumer, supplier);
+ }
+
+ @Override
+ public T getValue() {
+ return this.getter.get();
+ }
+
+ @Override
+ public void setValue(T value) {
+ this.setter.accept(value);
+ }
+
+ @SuppressWarnings("unchecked")
+ public boolean setValue(String name) {
+ try {
+ this.setter.accept((T) Enum.valueOf(this.defaultValue.getClass(), name));
+ return true;
+ } catch(IllegalArgumentException ex) {
+ BetterEnd.LOGGER.catching(ex);
+ }
+
+ return false;
+ }
+
+ @Override
+ public T getDefault() {
+ return this.defaultValue;
+ }
+
+ @Override
+ public String asString() {
+ return getValue().name();
+ }
+
+ @Override
+ public void fromString(String value) {
+ this.setValue(value);
+ }
+ }
+
+ public static abstract class RangeEntry> extends Entry {
+
+ private final T min, max;
+
+ public RangeEntry(T defaultValue, Consumer consumer, Supplier supplier, T minVal, T maxVal) {
+ super(defaultValue, consumer, supplier);
+
+ this.min = minVal;
+ this.max = maxVal;
+ }
+
+ @Override
+ public void setValue(T value) {
+ this.setter.accept(value.compareTo(min) < 0 ? min : value.compareTo(max) > 0 ? max : value);
+ }
+
+ public T minValue() {
+ return this.min;
+ }
+
+ public T maxValue() {
+ return this.max;
+ }
+ }
+
+ public static abstract class Entry {
+
+ protected final T defaultValue;
+
+ protected final Consumer setter;
+ protected final Supplier getter;
+
+ public Entry (T defaultValue, Consumer consumer, Supplier supplier) {
+ this.defaultValue = defaultValue;
+ this.setter = consumer;
+ this.getter = supplier;
+ }
+
+ public abstract T getValue();
+ public abstract void setValue(T value);
+ public abstract T getDefault();
+ public abstract void fromString(String value);
+ public abstract String asString();
+
+ public void setDefault() {
+ this.setter.accept(defaultValue);
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/config/ConfigWriter.java b/src/main/java/ru/betterend/config/ConfigWriter.java
index 30f9f32c..77ba15f9 100644
--- a/src/main/java/ru/betterend/config/ConfigWriter.java
+++ b/src/main/java/ru/betterend/config/ConfigWriter.java
@@ -1,79 +1,79 @@
-package ru.betterend.config;
-
-import java.io.File;
-import java.nio.file.Path;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-
-import net.fabricmc.loader.api.FabricLoader;
-import ru.betterend.BetterEnd;
-import ru.betterend.util.JsonFactory;
-
-public class ConfigWriter {
-
- private final static Path GAME_CONFIG_DIR = FabricLoader.getInstance().getConfigDir();
- public final static File MOD_CONFIG_DIR = new File(GAME_CONFIG_DIR.toFile(), BetterEnd.MOD_ID);
- private final static File MAIN_CONFIG_FILE = new File(MOD_CONFIG_DIR, "settings.json");
-
- private static JsonObject mainConfig;
-
- private JsonObject configObject;
- private File configFile;
-
- public JsonObject getConfig() {
- return configObject;
- }
-
- public JsonObject loadConfig(File configFile) {
- this.configFile = configFile;
- if (configObject == null) {
- configObject = load(configFile);
- }
-
- return configObject;
- }
-
- public void saveConfig() {
- if (configFile == null || configObject == null) {
- return;
- }
- save(configFile, configObject);
- }
-
- public static JsonObject load() {
- if (mainConfig == null) {
- mainConfig = load(MAIN_CONFIG_FILE);
- }
- return mainConfig;
- }
-
- public static JsonObject load(File configFile) {
- return JsonFactory.getJsonObject(configFile);
- }
-
- public static void save() {
- save(MAIN_CONFIG_FILE, mainConfig);
- }
-
- public static void save(JsonElement config) {
- save(MAIN_CONFIG_FILE, config);
- }
-
- public static void save(File configFile, JsonElement config) {
- JsonFactory.storeJson(configFile, config);
- }
-
- public static String scrubFileName(String input) {
- input = input.replaceAll("[/\\ ]+", "_");
- input = input.replaceAll("[,:&\"\\|\\<\\>\\?\\*]", "_");
-
- return input;
- }
-
- static {
- if (!MOD_CONFIG_DIR.exists()) {
- MOD_CONFIG_DIR.mkdirs();
- }
- }
-}
+package ru.betterend.config;
+
+import java.io.File;
+import java.nio.file.Path;
+
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+
+import net.fabricmc.loader.api.FabricLoader;
+import ru.betterend.BetterEnd;
+import ru.betterend.util.JsonFactory;
+
+public class ConfigWriter {
+
+ private final static Path GAME_CONFIG_DIR = FabricLoader.getInstance().getConfigDir();
+ public final static File MOD_CONFIG_DIR = new File(GAME_CONFIG_DIR.toFile(), BetterEnd.MOD_ID);
+ private final static File MAIN_CONFIG_FILE = new File(MOD_CONFIG_DIR, "settings.json");
+
+ private static JsonObject mainConfig;
+
+ private JsonObject configObject;
+ private File configFile;
+
+ public JsonObject getConfig() {
+ return configObject;
+ }
+
+ public JsonObject loadConfig(File configFile) {
+ this.configFile = configFile;
+ if (configObject == null) {
+ configObject = load(configFile);
+ }
+
+ return configObject;
+ }
+
+ public void saveConfig() {
+ if (configFile == null || configObject == null) {
+ return;
+ }
+ save(configFile, configObject);
+ }
+
+ public static JsonObject load() {
+ if (mainConfig == null) {
+ mainConfig = load(MAIN_CONFIG_FILE);
+ }
+ return mainConfig;
+ }
+
+ public static JsonObject load(File configFile) {
+ return JsonFactory.getJsonObject(configFile);
+ }
+
+ public static void save() {
+ save(MAIN_CONFIG_FILE, mainConfig);
+ }
+
+ public static void save(JsonElement config) {
+ save(MAIN_CONFIG_FILE, config);
+ }
+
+ public static void save(File configFile, JsonElement config) {
+ JsonFactory.storeJson(configFile, config);
+ }
+
+ public static String scrubFileName(String input) {
+ input = input.replaceAll("[/\\ ]+", "_");
+ input = input.replaceAll("[,:&\"\\|\\<\\>\\?\\*]", "_");
+
+ return input;
+ }
+
+ static {
+ if (!MOD_CONFIG_DIR.exists()) {
+ MOD_CONFIG_DIR.mkdirs();
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/config/MainConfig.java b/src/main/java/ru/betterend/config/MainConfig.java
index 9f8b8e8a..ab8c9260 100644
--- a/src/main/java/ru/betterend/config/MainConfig.java
+++ b/src/main/java/ru/betterend/config/MainConfig.java
@@ -1,34 +1,34 @@
-package ru.betterend.config;
-
-import com.google.gson.JsonObject;
-
-public class MainConfig extends Config {
-
- private static MainConfig instance;
-
- public static MainConfig getInstance() {
- if (instance == null) {
- instance = new MainConfig();
- }
-
- return instance;
- }
-
- private MainConfig() {
- //TODO: Need to register config params in the Keeper
-
- JsonObject config = ConfigWriter.load();
- if (config.size() > 0) {
- this.configKeeper.fromJson(config);
- } else {
- this.configKeeper.toJson(config);
- ConfigWriter.save();
- }
- }
-
- @Override
- public void saveChanges() {
- this.configKeeper.toJson(ConfigWriter.load());
- ConfigWriter.save();
- }
-}
+package ru.betterend.config;
+
+import com.google.gson.JsonObject;
+
+public class MainConfig extends Config {
+
+ private static MainConfig instance;
+
+ public static MainConfig getInstance() {
+ if (instance == null) {
+ instance = new MainConfig();
+ }
+
+ return instance;
+ }
+
+ private MainConfig() {
+ //TODO: Need to register config params in the Keeper
+
+ JsonObject config = ConfigWriter.load();
+ if (config.size() > 0) {
+ this.configKeeper.fromJson(config);
+ } else {
+ this.configKeeper.toJson(config);
+ ConfigWriter.save();
+ }
+ }
+
+ @Override
+ public void saveChanges() {
+ this.configKeeper.toJson(ConfigWriter.load());
+ ConfigWriter.save();
+ }
+}
diff --git a/src/main/java/ru/betterend/effects/EndEnchantments.java b/src/main/java/ru/betterend/effects/EndEnchantments.java
index f59e545d..08474c88 100644
--- a/src/main/java/ru/betterend/effects/EndEnchantments.java
+++ b/src/main/java/ru/betterend/effects/EndEnchantments.java
@@ -1,16 +1,16 @@
-package ru.betterend.effects;
-
-import net.minecraft.enchantment.Enchantment;
-import net.minecraft.util.registry.Registry;
-import ru.betterend.BetterEnd;
-import ru.betterend.effects.enchantment.EndVeilEnchantment;
-
-public class EndEnchantments {
- public final static Enchantment END_VEIL = registerEnchantment("end_veil", new EndVeilEnchantment());
-
- public static Enchantment registerEnchantment(String name, Enchantment enchantment) {
- return Registry.register(Registry.ENCHANTMENT, BetterEnd.makeID(name), enchantment);
- }
-
- public static void register() {}
-}
+package ru.betterend.effects;
+
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.util.registry.Registry;
+import ru.betterend.BetterEnd;
+import ru.betterend.effects.enchantment.EndVeilEnchantment;
+
+public class EndEnchantments {
+ public final static Enchantment END_VEIL = registerEnchantment("end_veil", new EndVeilEnchantment());
+
+ public static Enchantment registerEnchantment(String name, Enchantment enchantment) {
+ return Registry.register(Registry.ENCHANTMENT, BetterEnd.makeID(name), enchantment);
+ }
+
+ public static void register() {}
+}
diff --git a/src/main/java/ru/betterend/effects/EndStatusEffects.java b/src/main/java/ru/betterend/effects/EndStatusEffects.java
index db3e701d..50e049ff 100644
--- a/src/main/java/ru/betterend/effects/EndStatusEffects.java
+++ b/src/main/java/ru/betterend/effects/EndStatusEffects.java
@@ -1,15 +1,15 @@
-package ru.betterend.effects;
-
-import net.minecraft.entity.effect.StatusEffect;
-import net.minecraft.util.registry.Registry;
-import ru.betterend.BetterEnd;
-import ru.betterend.effects.status.EndVeilEffect;
-
-public class EndStatusEffects {
-
- public final static StatusEffect END_VEIL = registerEffect("end_veil", new EndVeilEffect());
-
- public static StatusEffect registerEffect(String name, E effect) {
- return Registry.register(Registry.STATUS_EFFECT, BetterEnd.makeID(name), effect);
- }
-}
+package ru.betterend.effects;
+
+import net.minecraft.entity.effect.StatusEffect;
+import net.minecraft.util.registry.Registry;
+import ru.betterend.BetterEnd;
+import ru.betterend.effects.status.EndVeilEffect;
+
+public class EndStatusEffects {
+
+ public final static StatusEffect END_VEIL = registerEffect("end_veil", new EndVeilEffect());
+
+ public static StatusEffect registerEffect(String name, E effect) {
+ return Registry.register(Registry.STATUS_EFFECT, BetterEnd.makeID(name), effect);
+ }
+}
diff --git a/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java b/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java
index ecda6750..bdf29bb4 100644
--- a/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java
+++ b/src/main/java/ru/betterend/effects/enchantment/EndVeilEnchantment.java
@@ -1,17 +1,17 @@
-package ru.betterend.effects.enchantment;
-
-import net.minecraft.enchantment.Enchantment;
-import net.minecraft.enchantment.EnchantmentTarget;
-import net.minecraft.entity.EquipmentSlot;
-
-public class EndVeilEnchantment extends Enchantment {
-
- public EndVeilEnchantment() {
- super(Enchantment.Rarity.VERY_RARE, EnchantmentTarget.ARMOR_HEAD, new EquipmentSlot[] { EquipmentSlot.HEAD });
- }
-
- @Override
- public boolean isAvailableForRandomSelection() {
- return false;
- }
-}
+package ru.betterend.effects.enchantment;
+
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.enchantment.EnchantmentTarget;
+import net.minecraft.entity.EquipmentSlot;
+
+public class EndVeilEnchantment extends Enchantment {
+
+ public EndVeilEnchantment() {
+ super(Enchantment.Rarity.VERY_RARE, EnchantmentTarget.ARMOR_HEAD, new EquipmentSlot[] { EquipmentSlot.HEAD });
+ }
+
+ @Override
+ public boolean isAvailableForRandomSelection() {
+ return false;
+ }
+}
diff --git a/src/main/java/ru/betterend/effects/status/EndVeilEffect.java b/src/main/java/ru/betterend/effects/status/EndVeilEffect.java
index b4e1489d..98e2d8ee 100644
--- a/src/main/java/ru/betterend/effects/status/EndVeilEffect.java
+++ b/src/main/java/ru/betterend/effects/status/EndVeilEffect.java
@@ -1,16 +1,16 @@
-package ru.betterend.effects.status;
-
-import net.minecraft.entity.effect.StatusEffect;
-import net.minecraft.entity.effect.StatusEffectType;
-
-public class EndVeilEffect extends StatusEffect {
-
- public EndVeilEffect() {
- super(StatusEffectType.BENEFICIAL, 0x0D554A);
- }
-
- @Override
- public boolean canApplyUpdateEffect(int duration, int amplifier) {
- return false;
- }
-}
+package ru.betterend.effects.status;
+
+import net.minecraft.entity.effect.StatusEffect;
+import net.minecraft.entity.effect.StatusEffectType;
+
+public class EndVeilEffect extends StatusEffect {
+
+ public EndVeilEffect() {
+ super(StatusEffectType.BENEFICIAL, 0x0D554A);
+ }
+
+ @Override
+ public boolean canApplyUpdateEffect(int duration, int amplifier) {
+ return false;
+ }
+}
diff --git a/src/main/java/ru/betterend/entity/EntityShadowWalker.java b/src/main/java/ru/betterend/entity/EntityShadowWalker.java
new file mode 100644
index 00000000..38a41e50
--- /dev/null
+++ b/src/main/java/ru/betterend/entity/EntityShadowWalker.java
@@ -0,0 +1,139 @@
+package ru.betterend.entity;
+
+import net.minecraft.block.BlockState;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityType;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.entity.ai.goal.FollowTargetGoal;
+import net.minecraft.entity.ai.goal.LookAroundGoal;
+import net.minecraft.entity.ai.goal.LookAtEntityGoal;
+import net.minecraft.entity.ai.goal.MeleeAttackGoal;
+import net.minecraft.entity.ai.goal.WanderAroundFarGoal;
+import net.minecraft.entity.attribute.DefaultAttributeContainer;
+import net.minecraft.entity.attribute.EntityAttributes;
+import net.minecraft.entity.damage.DamageSource;
+import net.minecraft.entity.effect.StatusEffectInstance;
+import net.minecraft.entity.effect.StatusEffects;
+import net.minecraft.entity.mob.HostileEntity;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.particle.ParticleTypes;
+import net.minecraft.sound.SoundEvent;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.world.World;
+import ru.betterend.registry.EndSounds;
+import ru.betterend.util.MHelper;
+
+public class EntityShadowWalker extends HostileEntity {
+ public EntityShadowWalker(EntityType entityType, World world) {
+ super(entityType, world);
+ }
+
+ @Override
+ protected void initGoals() {
+ this.goalSelector.add(2, new AttackGoal(this, 1.0D, false));
+ this.goalSelector.add(7, new WanderAroundFarGoal(this, 1.0D));
+ this.goalSelector.add(8, new LookAtEntityGoal(this, PlayerEntity.class, 8.0F));
+ this.goalSelector.add(8, new LookAroundGoal(this));
+ this.targetSelector.add(2, new FollowTargetGoal(this, PlayerEntity.class, true));
+ }
+
+ public static DefaultAttributeContainer.Builder createMobAttributes() {
+ return HostileEntity.createHostileAttributes()
+ .add(EntityAttributes.GENERIC_FOLLOW_RANGE, 35.0)
+ .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.15)
+ .add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 4.5)
+ .add(EntityAttributes.GENERIC_ARMOR, 2.0)
+ .add(EntityAttributes.ZOMBIE_SPAWN_REINFORCEMENTS);
+ }
+
+ @Override
+ public void tick() {
+ super.tick();
+ world.addParticle(ParticleTypes.ASH,
+ getX() + random.nextGaussian() * 0.2,
+ getY() + random.nextGaussian() * 0.5 + 1,
+ getZ() + random.nextGaussian() * 0.2,
+ 0, 0, 0);
+ world.addParticle(ParticleTypes.SMOKE,
+ getX() + random.nextGaussian() * 0.2,
+ getY() + random.nextGaussian() * 0.5 + 1,
+ getZ() + random.nextGaussian() * 0.2,
+ 0, 0, 0);
+ world.addParticle(ParticleTypes.ENTITY_EFFECT,
+ getX() + random.nextGaussian() * 0.2,
+ getY() + random.nextGaussian() * 0.5 + 1,
+ getZ() + random.nextGaussian() * 0.2,
+ 0, 0, 0);
+ }
+
+ @Override
+ protected SoundEvent getAmbientSound() {
+ return EndSounds.ENTITY_SHADOW_WALKER;
+ }
+
+ @Override
+ protected SoundEvent getHurtSound(DamageSource source) {
+ return EndSounds.ENTITY_SHADOW_WALKER_DAMAGE;
+ }
+
+ @Override
+ protected SoundEvent getDeathSound() {
+ return EndSounds.ENTITY_SHADOW_WALKER_DEATH;
+ }
+
+ @Override
+ protected void playStepSound(BlockPos pos, BlockState state) {}
+
+ @Override
+ protected float getSoundVolume() {
+ return MHelper.randRange(0.4F, 0.6F, random);
+ }
+
+ @Override
+ protected float getSoundPitch() {
+ return MHelper.randRange(0.75F, 1.25F, random);
+ }
+
+ @Override
+ public boolean tryAttack(Entity target) {
+ boolean attack = super.tryAttack(target);
+ if (attack && target instanceof LivingEntity) {
+ LivingEntity living = (LivingEntity) target;
+ if (!(living.hasStatusEffect(StatusEffects.BLINDNESS))) {
+ living.addStatusEffect(new StatusEffectInstance(StatusEffects.BLINDNESS, 60));
+ }
+ }
+ return attack;
+ }
+
+ private final class AttackGoal extends MeleeAttackGoal {
+ private final EntityShadowWalker walker;
+ private int ticks;
+
+ public AttackGoal(EntityShadowWalker walker, double speed, boolean pauseWhenMobIdle) {
+ super(walker, speed, pauseWhenMobIdle);
+ this.walker = walker;
+ }
+
+ public void start() {
+ super.start();
+ this.ticks = 0;
+ }
+
+ public void stop() {
+ super.stop();
+ this.walker.setAttacking(false);
+ }
+
+ public void tick() {
+ super.tick();
+ ++this.ticks;
+ if (this.ticks >= 5 && this.method_28348() < this.method_28349() / 2) {
+ this.walker.setAttacking(true);
+ }
+ else {
+ this.walker.setAttacking(false);
+ }
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/entity/render/RendererEntityShadowWalker.java b/src/main/java/ru/betterend/entity/render/RendererEntityShadowWalker.java
new file mode 100644
index 00000000..6e3b8291
--- /dev/null
+++ b/src/main/java/ru/betterend/entity/render/RendererEntityShadowWalker.java
@@ -0,0 +1,21 @@
+package ru.betterend.entity.render;
+
+import net.minecraft.client.render.entity.BipedEntityRenderer;
+import net.minecraft.client.render.entity.EntityRenderDispatcher;
+import net.minecraft.client.render.entity.model.PlayerEntityModel;
+import net.minecraft.util.Identifier;
+import ru.betterend.BetterEnd;
+import ru.betterend.entity.EntityShadowWalker;
+
+public class RendererEntityShadowWalker extends BipedEntityRenderer> {
+ private static final Identifier TEXTURE = BetterEnd.makeID("textures/entity/shadow_walker.png");
+
+ public RendererEntityShadowWalker(EntityRenderDispatcher entityRenderDispatcher) {
+ super(entityRenderDispatcher, new PlayerEntityModel(0.0F, false), 0.5F);
+ }
+
+ @Override
+ public Identifier getTexture(EntityShadowWalker zombieEntity) {
+ return TEXTURE;
+ }
+}
diff --git a/src/main/java/ru/betterend/interfaces/CompoundSerializer.java b/src/main/java/ru/betterend/interfaces/CompoundSerializer.java
index a441ddc1..8fd82c18 100644
--- a/src/main/java/ru/betterend/interfaces/CompoundSerializer.java
+++ b/src/main/java/ru/betterend/interfaces/CompoundSerializer.java
@@ -1,8 +1,8 @@
-package ru.betterend.interfaces;
-
-import net.minecraft.nbt.CompoundTag;
-
-public interface CompoundSerializer {
- public abstract CompoundTag toTag(CompoundTag tag);
- public abstract T fromTag(CompoundTag tag);
-}
+package ru.betterend.interfaces;
+
+import net.minecraft.nbt.CompoundTag;
+
+public interface CompoundSerializer {
+ public abstract CompoundTag toTag(CompoundTag tag);
+ public abstract T fromTag(CompoundTag tag);
+}
diff --git a/src/main/java/ru/betterend/interfaces/IColorProvider.java b/src/main/java/ru/betterend/interfaces/IColorProvider.java
index fb0a2101..ae6d0db5 100644
--- a/src/main/java/ru/betterend/interfaces/IColorProvider.java
+++ b/src/main/java/ru/betterend/interfaces/IColorProvider.java
@@ -1,10 +1,10 @@
-package ru.betterend.interfaces;
-
-import net.minecraft.client.color.block.BlockColorProvider;
-import net.minecraft.client.color.item.ItemColorProvider;
-
-public interface IColorProvider {
- BlockColorProvider getProvider();
-
- ItemColorProvider getItemProvider();
-}
+package ru.betterend.interfaces;
+
+import net.minecraft.client.color.block.BlockColorProvider;
+import net.minecraft.client.color.item.ItemColorProvider;
+
+public interface IColorProvider {
+ BlockColorProvider getProvider();
+
+ ItemColorProvider getItemProvider();
+}
diff --git a/src/main/java/ru/betterend/interfaces/IRenderTypeable.java b/src/main/java/ru/betterend/interfaces/IRenderTypeable.java
index fb81963c..1a5c029c 100644
--- a/src/main/java/ru/betterend/interfaces/IRenderTypeable.java
+++ b/src/main/java/ru/betterend/interfaces/IRenderTypeable.java
@@ -1,8 +1,8 @@
-package ru.betterend.interfaces;
-
-import ru.betterend.client.render.ERenderLayer;
-
-public interface IRenderTypeable
-{
- public ERenderLayer getRenderLayer();
-}
+package ru.betterend.interfaces;
+
+import ru.betterend.client.render.ERenderLayer;
+
+public interface IRenderTypeable
+{
+ public ERenderLayer getRenderLayer();
+}
diff --git a/src/main/java/ru/betterend/interfaces/ISlime.java b/src/main/java/ru/betterend/interfaces/ISlime.java
index 1ecacda2..646490c8 100644
--- a/src/main/java/ru/betterend/interfaces/ISlime.java
+++ b/src/main/java/ru/betterend/interfaces/ISlime.java
@@ -1,5 +1,5 @@
-package ru.betterend.interfaces;
-
-public interface ISlime {
- public void setSlimeSize(int size, boolean heal);
-}
+package ru.betterend.interfaces;
+
+public interface ISlime {
+ public void setSlimeSize(int size, boolean heal);
+}
diff --git a/src/main/java/ru/betterend/interfaces/IdentifiedContext.java b/src/main/java/ru/betterend/interfaces/IdentifiedContext.java
index bc2ce453..e03bfbb6 100644
--- a/src/main/java/ru/betterend/interfaces/IdentifiedContext.java
+++ b/src/main/java/ru/betterend/interfaces/IdentifiedContext.java
@@ -1,12 +1,12 @@
-package ru.betterend.interfaces;
-
-import net.minecraft.util.Identifier;
-
-public interface IdentifiedContext {
- public Identifier getContextId();
- public void setContextId(Identifier id);
-
- default void removeId() {
- this.setContextId(null);
- }
-}
+package ru.betterend.interfaces;
+
+import net.minecraft.util.Identifier;
+
+public interface IdentifiedContext {
+ public Identifier getContextId();
+ public void setContextId(Identifier id);
+
+ default void removeId() {
+ this.setContextId(null);
+ }
+}
diff --git a/src/main/java/ru/betterend/interfaces/TeleportingEntity.java b/src/main/java/ru/betterend/interfaces/TeleportingEntity.java
index c46a2c6a..f91957b6 100644
--- a/src/main/java/ru/betterend/interfaces/TeleportingEntity.java
+++ b/src/main/java/ru/betterend/interfaces/TeleportingEntity.java
@@ -1,14 +1,14 @@
-package ru.betterend.interfaces;
-
-import net.minecraft.util.math.BlockPos;
-
-public interface TeleportingEntity {
- public abstract long beGetCooldown();
- public abstract void beSetCooldown(long time);
- public abstract void beSetExitPos(BlockPos pos);
- public abstract BlockPos beGetExitPos();
-
- default boolean hasCooldown() {
- return this.beGetCooldown() > 0;
- }
-}
+package ru.betterend.interfaces;
+
+import net.minecraft.util.math.BlockPos;
+
+public interface TeleportingEntity {
+ public abstract long beGetCooldown();
+ public abstract void beSetCooldown(long time);
+ public abstract void beSetExitPos(BlockPos pos);
+ public abstract BlockPos beGetExitPos();
+
+ default boolean hasCooldown() {
+ return this.beGetCooldown() > 0;
+ }
+}
diff --git a/src/main/java/ru/betterend/item/EndAxe.java b/src/main/java/ru/betterend/item/EndAxe.java
index 3379eea2..cfc36b61 100644
--- a/src/main/java/ru/betterend/item/EndAxe.java
+++ b/src/main/java/ru/betterend/item/EndAxe.java
@@ -1,26 +1,26 @@
-package ru.betterend.item;
-
-import net.fabricmc.fabric.api.tool.attribute.v1.DynamicAttributeTool;
-import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
-import net.minecraft.block.BlockState;
-import net.minecraft.entity.LivingEntity;
-import net.minecraft.item.AxeItem;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.ToolMaterial;
-import net.minecraft.tag.Tag;
-
-public class EndAxe extends AxeItem implements DynamicAttributeTool {
-
- public EndAxe(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) {
- super(material, attackDamage, attackSpeed, settings);
- }
-
- @Override
- public int getMiningLevel(Tag- tag, BlockState state, ItemStack stack, LivingEntity user) {
- if (tag.equals(FabricToolTags.AXES)) {
- return this.getMaterial().getMiningLevel();
- }
- return 0;
- }
-}
+package ru.betterend.item;
+
+import net.fabricmc.fabric.api.tool.attribute.v1.DynamicAttributeTool;
+import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
+import net.minecraft.block.BlockState;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.item.AxeItem;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.ToolMaterial;
+import net.minecraft.tag.Tag;
+
+public class EndAxe extends AxeItem implements DynamicAttributeTool {
+
+ public EndAxe(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) {
+ super(material, attackDamage, attackSpeed, settings);
+ }
+
+ @Override
+ public int getMiningLevel(Tag
- tag, BlockState state, ItemStack stack, LivingEntity user) {
+ if (tag.equals(FabricToolTags.AXES)) {
+ return this.getMaterial().getMiningLevel();
+ }
+ return 0;
+ }
+}
diff --git a/src/main/java/ru/betterend/item/EndHammer.java b/src/main/java/ru/betterend/item/EndHammer.java
index 1cb71c5f..077ff219 100644
--- a/src/main/java/ru/betterend/item/EndHammer.java
+++ b/src/main/java/ru/betterend/item/EndHammer.java
@@ -1,135 +1,135 @@
-package ru.betterend.item;
-
-import java.util.UUID;
-
-import com.google.common.collect.ImmutableMultimap;
-import com.google.common.collect.ImmutableMultimap.Builder;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;
-
-import io.netty.util.internal.ThreadLocalRandom;
-import net.fabricmc.fabric.api.tool.attribute.v1.DynamicAttributeTool;
-import net.minecraft.block.BlockState;
-import net.minecraft.block.Blocks;
-import net.minecraft.block.Material;
-import net.minecraft.entity.EquipmentSlot;
-import net.minecraft.entity.LivingEntity;
-import net.minecraft.entity.attribute.EntityAttribute;
-import net.minecraft.entity.attribute.EntityAttributeModifier;
-import net.minecraft.entity.attribute.EntityAttributes;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.MiningToolItem;
-import net.minecraft.item.ToolMaterial;
-import net.minecraft.tag.Tag;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.MathHelper;
-import net.minecraft.world.World;
-import ru.betterend.registry.EndTags;
-
-public class EndHammer extends MiningToolItem implements DynamicAttributeTool {
-
- public final static UUID ATTACK_KNOCKBACK_MODIFIER_ID = MathHelper.randomUuid(ThreadLocalRandom.current());
-
- private final Multimap attributeModifiers;
-
- public EndHammer(ToolMaterial material, float attackDamage, float attackSpeed, double knockback, Settings settings) {
- super(attackDamage, attackSpeed, material, Sets.newHashSet(), settings);
-
- Builder builder = ImmutableMultimap.builder();
- builder.put(EntityAttributes.GENERIC_ATTACK_DAMAGE, new EntityAttributeModifier(ATTACK_DAMAGE_MODIFIER_ID, "Weapon modifier", attackDamage + material.getAttackDamage(), EntityAttributeModifier.Operation.ADDITION));
- builder.put(EntityAttributes.GENERIC_ATTACK_SPEED, new EntityAttributeModifier(ATTACK_SPEED_MODIFIER_ID, "Weapon modifier", attackSpeed, EntityAttributeModifier.Operation.ADDITION));
- builder.put(EntityAttributes.GENERIC_ATTACK_KNOCKBACK, new EntityAttributeModifier(ATTACK_KNOCKBACK_MODIFIER_ID, "Weapon modifier", knockback, EntityAttributeModifier.Operation.ADDITION));
- this.attributeModifiers = builder.build();
- }
-
- @Override
- public boolean canMine(BlockState state, World world, BlockPos pos, PlayerEntity miner) {
- return state.getMaterial().equals(Material.STONE) ||
- state.getMaterial().equals(Material.GLASS) ||
- state.isOf(Blocks.DIAMOND_BLOCK) ||
- state.isOf(Blocks.EMERALD_BLOCK) ||
- state.isOf(Blocks.LAPIS_BLOCK) ||
- state.isOf(Blocks.REDSTONE_BLOCK);
- }
-
- @Override
- public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) {
- stack.damage(1, attacker, ((entity) -> {
- entity.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND);
- }));
-
- return true;
- }
-
- @Override
- public boolean postMine(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner) {
- if (state.getHardness(world, pos) != 0.0F) {
- stack.damage(1, miner, ((entity) -> {
- entity.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND);
- }));
- }
-
- return true;
- }
-
- @Override
- public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
- if (state.getMaterial().equals(Material.GLASS)) {
- return this.getMaterial().getMiningSpeedMultiplier() * 2.0F;
- }
- if (isEffectiveOn(state)) {
- float mult = 1.0F;
- if (state.isOf(Blocks.DIAMOND_BLOCK) || state.isOf(Blocks.EMERALD_BLOCK) || state.isOf(Blocks.LAPIS_BLOCK) || state.isOf(Blocks.REDSTONE_BLOCK)) {
- mult = this.getMaterial().getMiningSpeedMultiplier();
- } else {
- mult = this.getMaterial().getMiningSpeedMultiplier() / 2.0F;
- }
- return mult > 1.0F ? mult : 1.0F;
- }
- return 1.0F;
- }
-
- @Override
- public float getMiningSpeedMultiplier(Tag
- tag, BlockState state, ItemStack stack, LivingEntity user) {
- if (tag.equals(EndTags.HAMMERS)) {
- return this.getMiningSpeedMultiplier(stack, state);
- }
- return 1.0F;
- }
-
- @Override
- public int getMiningLevel(Tag
- tag, BlockState state, ItemStack stack, LivingEntity user) {
- if (tag.equals(EndTags.HAMMERS)) {
- return this.getMaterial().getMiningLevel();
- }
- return 0;
- }
-
- @Override
- public boolean isEffectiveOn(BlockState state) {
- if (state.getMaterial().equals(Material.GLASS)) {
- return true;
- }
- if (!state.isOf(Blocks.REDSTONE_BLOCK) && !state.isOf(Blocks.DIAMOND_BLOCK) && !state.isOf(Blocks.EMERALD_BLOCK) && !state.isOf(Blocks.LAPIS_BLOCK) && !state.getMaterial().equals(Material.STONE)) {
- return false;
- }
- int level = this.getMaterial().getMiningLevel();
- if (state.isOf(Blocks.IRON_ORE) || state.isOf(Blocks.LAPIS_BLOCK) || state.isOf(Blocks.LAPIS_ORE)) {
- return level >= 1;
- }
- if (state.isOf(Blocks.DIAMOND_BLOCK) && !state.isOf(Blocks.DIAMOND_ORE) || state.isOf(Blocks.EMERALD_ORE) || state.isOf(Blocks.EMERALD_BLOCK) || state.isOf(Blocks.GOLD_ORE) || state.isOf(Blocks.REDSTONE_ORE)) {
- return level >= 2;
- }
- if (state.isOf(Blocks.OBSIDIAN) || state.isOf(Blocks.CRYING_OBSIDIAN) || state.isOf(Blocks.RESPAWN_ANCHOR) || state.isOf(Blocks.ANCIENT_DEBRIS)) {
- return level >= 3;
- }
- return true;
- }
-
- @Override
- public Multimap getAttributeModifiers(EquipmentSlot slot) {
- return slot == EquipmentSlot.MAINHAND ? this.attributeModifiers : super.getAttributeModifiers(slot);
- }
-}
+package ru.betterend.item;
+
+import java.util.UUID;
+
+import com.google.common.collect.ImmutableMultimap;
+import com.google.common.collect.ImmutableMultimap.Builder;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Sets;
+
+import io.netty.util.internal.ThreadLocalRandom;
+import net.fabricmc.fabric.api.tool.attribute.v1.DynamicAttributeTool;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.block.Material;
+import net.minecraft.entity.EquipmentSlot;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.entity.attribute.EntityAttribute;
+import net.minecraft.entity.attribute.EntityAttributeModifier;
+import net.minecraft.entity.attribute.EntityAttributes;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.MiningToolItem;
+import net.minecraft.item.ToolMaterial;
+import net.minecraft.tag.Tag;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.MathHelper;
+import net.minecraft.world.World;
+import ru.betterend.registry.EndTags;
+
+public class EndHammer extends MiningToolItem implements DynamicAttributeTool {
+
+ public final static UUID ATTACK_KNOCKBACK_MODIFIER_ID = MathHelper.randomUuid(ThreadLocalRandom.current());
+
+ private final Multimap attributeModifiers;
+
+ public EndHammer(ToolMaterial material, float attackDamage, float attackSpeed, double knockback, Settings settings) {
+ super(attackDamage, attackSpeed, material, Sets.newHashSet(), settings);
+
+ Builder builder = ImmutableMultimap.builder();
+ builder.put(EntityAttributes.GENERIC_ATTACK_DAMAGE, new EntityAttributeModifier(ATTACK_DAMAGE_MODIFIER_ID, "Weapon modifier", attackDamage + material.getAttackDamage(), EntityAttributeModifier.Operation.ADDITION));
+ builder.put(EntityAttributes.GENERIC_ATTACK_SPEED, new EntityAttributeModifier(ATTACK_SPEED_MODIFIER_ID, "Weapon modifier", attackSpeed, EntityAttributeModifier.Operation.ADDITION));
+ builder.put(EntityAttributes.GENERIC_ATTACK_KNOCKBACK, new EntityAttributeModifier(ATTACK_KNOCKBACK_MODIFIER_ID, "Weapon modifier", knockback, EntityAttributeModifier.Operation.ADDITION));
+ this.attributeModifiers = builder.build();
+ }
+
+ @Override
+ public boolean canMine(BlockState state, World world, BlockPos pos, PlayerEntity miner) {
+ return state.getMaterial().equals(Material.STONE) ||
+ state.getMaterial().equals(Material.GLASS) ||
+ state.isOf(Blocks.DIAMOND_BLOCK) ||
+ state.isOf(Blocks.EMERALD_BLOCK) ||
+ state.isOf(Blocks.LAPIS_BLOCK) ||
+ state.isOf(Blocks.REDSTONE_BLOCK);
+ }
+
+ @Override
+ public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) {
+ stack.damage(1, attacker, ((entity) -> {
+ entity.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND);
+ }));
+
+ return true;
+ }
+
+ @Override
+ public boolean postMine(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner) {
+ if (state.getHardness(world, pos) != 0.0F) {
+ stack.damage(1, miner, ((entity) -> {
+ entity.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND);
+ }));
+ }
+
+ return true;
+ }
+
+ @Override
+ public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) {
+ if (state.getMaterial().equals(Material.GLASS)) {
+ return this.getMaterial().getMiningSpeedMultiplier() * 2.0F;
+ }
+ if (isEffectiveOn(state)) {
+ float mult = 1.0F;
+ if (state.isOf(Blocks.DIAMOND_BLOCK) || state.isOf(Blocks.EMERALD_BLOCK) || state.isOf(Blocks.LAPIS_BLOCK) || state.isOf(Blocks.REDSTONE_BLOCK)) {
+ mult = this.getMaterial().getMiningSpeedMultiplier();
+ } else {
+ mult = this.getMaterial().getMiningSpeedMultiplier() / 2.0F;
+ }
+ return mult > 1.0F ? mult : 1.0F;
+ }
+ return 1.0F;
+ }
+
+ @Override
+ public float getMiningSpeedMultiplier(Tag
- tag, BlockState state, ItemStack stack, LivingEntity user) {
+ if (tag.equals(EndTags.HAMMERS)) {
+ return this.getMiningSpeedMultiplier(stack, state);
+ }
+ return 1.0F;
+ }
+
+ @Override
+ public int getMiningLevel(Tag
- tag, BlockState state, ItemStack stack, LivingEntity user) {
+ if (tag.equals(EndTags.HAMMERS)) {
+ return this.getMaterial().getMiningLevel();
+ }
+ return 0;
+ }
+
+ @Override
+ public boolean isEffectiveOn(BlockState state) {
+ if (state.getMaterial().equals(Material.GLASS)) {
+ return true;
+ }
+ if (!state.isOf(Blocks.REDSTONE_BLOCK) && !state.isOf(Blocks.DIAMOND_BLOCK) && !state.isOf(Blocks.EMERALD_BLOCK) && !state.isOf(Blocks.LAPIS_BLOCK) && !state.getMaterial().equals(Material.STONE)) {
+ return false;
+ }
+ int level = this.getMaterial().getMiningLevel();
+ if (state.isOf(Blocks.IRON_ORE) || state.isOf(Blocks.LAPIS_BLOCK) || state.isOf(Blocks.LAPIS_ORE)) {
+ return level >= 1;
+ }
+ if (state.isOf(Blocks.DIAMOND_BLOCK) && !state.isOf(Blocks.DIAMOND_ORE) || state.isOf(Blocks.EMERALD_ORE) || state.isOf(Blocks.EMERALD_BLOCK) || state.isOf(Blocks.GOLD_ORE) || state.isOf(Blocks.REDSTONE_ORE)) {
+ return level >= 2;
+ }
+ if (state.isOf(Blocks.OBSIDIAN) || state.isOf(Blocks.CRYING_OBSIDIAN) || state.isOf(Blocks.RESPAWN_ANCHOR) || state.isOf(Blocks.ANCIENT_DEBRIS)) {
+ return level >= 3;
+ }
+ return true;
+ }
+
+ @Override
+ public Multimap getAttributeModifiers(EquipmentSlot slot) {
+ return slot == EquipmentSlot.MAINHAND ? this.attributeModifiers : super.getAttributeModifiers(slot);
+ }
+}
diff --git a/src/main/java/ru/betterend/item/EndHoe.java b/src/main/java/ru/betterend/item/EndHoe.java
index 78bc3993..6497503f 100644
--- a/src/main/java/ru/betterend/item/EndHoe.java
+++ b/src/main/java/ru/betterend/item/EndHoe.java
@@ -1,11 +1,11 @@
-package ru.betterend.item;
-
-import net.minecraft.item.HoeItem;
-import net.minecraft.item.ToolMaterial;
-
-public class EndHoe extends HoeItem {
-
- public EndHoe(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) {
- super(material, attackDamage, attackSpeed, settings);
- }
-}
+package ru.betterend.item;
+
+import net.minecraft.item.HoeItem;
+import net.minecraft.item.ToolMaterial;
+
+public class EndHoe extends HoeItem {
+
+ public EndHoe(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) {
+ super(material, attackDamage, attackSpeed, settings);
+ }
+}
diff --git a/src/main/java/ru/betterend/item/EndPickaxe.java b/src/main/java/ru/betterend/item/EndPickaxe.java
index 0d3db593..27cebcd7 100644
--- a/src/main/java/ru/betterend/item/EndPickaxe.java
+++ b/src/main/java/ru/betterend/item/EndPickaxe.java
@@ -1,26 +1,26 @@
-package ru.betterend.item;
-
-import net.fabricmc.fabric.api.tool.attribute.v1.DynamicAttributeTool;
-import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
-import net.minecraft.block.BlockState;
-import net.minecraft.entity.LivingEntity;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.PickaxeItem;
-import net.minecraft.item.ToolMaterial;
-import net.minecraft.tag.Tag;
-
-public class EndPickaxe extends PickaxeItem implements DynamicAttributeTool {
-
- public EndPickaxe(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) {
- super(material, attackDamage, attackSpeed, settings);
- }
-
- @Override
- public int getMiningLevel(Tag
- tag, BlockState state, ItemStack stack, LivingEntity user) {
- if (tag.equals(FabricToolTags.PICKAXES)) {
- return this.getMaterial().getMiningLevel();
- }
- return 0;
- }
-}
+package ru.betterend.item;
+
+import net.fabricmc.fabric.api.tool.attribute.v1.DynamicAttributeTool;
+import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
+import net.minecraft.block.BlockState;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.PickaxeItem;
+import net.minecraft.item.ToolMaterial;
+import net.minecraft.tag.Tag;
+
+public class EndPickaxe extends PickaxeItem implements DynamicAttributeTool {
+
+ public EndPickaxe(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) {
+ super(material, attackDamage, attackSpeed, settings);
+ }
+
+ @Override
+ public int getMiningLevel(Tag
- tag, BlockState state, ItemStack stack, LivingEntity user) {
+ if (tag.equals(FabricToolTags.PICKAXES)) {
+ return this.getMaterial().getMiningLevel();
+ }
+ return 0;
+ }
+}
diff --git a/src/main/java/ru/betterend/item/EternalCrystal.java b/src/main/java/ru/betterend/item/EternalCrystal.java
index 29e2974e..acf3b7ff 100644
--- a/src/main/java/ru/betterend/item/EternalCrystal.java
+++ b/src/main/java/ru/betterend/item/EternalCrystal.java
@@ -1,11 +1,11 @@
-package ru.betterend.item;
-
-import net.minecraft.item.Item;
-import ru.betterend.registry.EndItems;
-
-public class EternalCrystal extends Item {
-
- public EternalCrystal() {
- super(EndItems.makeSettings());
- }
+package ru.betterend.item;
+
+import net.minecraft.item.Item;
+import ru.betterend.registry.EndItems;
+
+public class EternalCrystal extends Item {
+
+ public EternalCrystal() {
+ super(EndItems.makeSettings());
+ }
}
\ No newline at end of file
diff --git a/src/main/java/ru/betterend/mixin/client/ClientRecipeBookMixin.java b/src/main/java/ru/betterend/mixin/client/ClientRecipeBookMixin.java
index 1bae0e59..1ef0fa79 100644
--- a/src/main/java/ru/betterend/mixin/client/ClientRecipeBookMixin.java
+++ b/src/main/java/ru/betterend/mixin/client/ClientRecipeBookMixin.java
@@ -1,22 +1,22 @@
-package ru.betterend.mixin.client;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-import net.minecraft.client.recipebook.ClientRecipeBook;
-import net.minecraft.client.recipebook.RecipeBookGroup;
-import net.minecraft.recipe.Recipe;
-import ru.betterend.recipe.builders.AlloyingRecipe;
-
-@Mixin(ClientRecipeBook.class)
-public abstract class ClientRecipeBookMixin {
- @Inject(method = "getGroupForRecipe", at = @At("HEAD"), cancellable = true)
- private static void getGroupForRecipe(Recipe> recipe, CallbackInfoReturnable cinfo) {
- if (recipe instanceof AlloyingRecipe) {
- cinfo.setReturnValue(RecipeBookGroup.BLAST_FURNACE_MISC);
- cinfo.cancel();
- }
- }
-}
+package ru.betterend.mixin.client;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+
+import net.minecraft.client.recipebook.ClientRecipeBook;
+import net.minecraft.client.recipebook.RecipeBookGroup;
+import net.minecraft.recipe.Recipe;
+import ru.betterend.recipe.builders.AlloyingRecipe;
+
+@Mixin(ClientRecipeBook.class)
+public abstract class ClientRecipeBookMixin {
+ @Inject(method = "getGroupForRecipe", at = @At("HEAD"), cancellable = true)
+ private static void getGroupForRecipe(Recipe> recipe, CallbackInfoReturnable cinfo) {
+ if (recipe instanceof AlloyingRecipe) {
+ cinfo.setReturnValue(RecipeBookGroup.BLAST_FURNACE_MISC);
+ cinfo.cancel();
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/mixin/client/DeserializationContextMixin.java b/src/main/java/ru/betterend/mixin/client/DeserializationContextMixin.java
index 35adb265..0852e1e2 100644
--- a/src/main/java/ru/betterend/mixin/client/DeserializationContextMixin.java
+++ b/src/main/java/ru/betterend/mixin/client/DeserializationContextMixin.java
@@ -1,23 +1,23 @@
-package ru.betterend.mixin.client;
-
-import org.spongepowered.asm.mixin.Mixin;
-
-import net.minecraft.client.render.model.json.ModelVariantMap.DeserializationContext;
-import net.minecraft.util.Identifier;
-import ru.betterend.interfaces.IdentifiedContext;
-
-@Mixin(DeserializationContext.class)
-public class DeserializationContextMixin implements IdentifiedContext {
-
- private Identifier contextId;
-
- @Override
- public Identifier getContextId() {
- return this.contextId;
- }
-
- @Override
- public void setContextId(Identifier id) {
- this.contextId = id;
- }
-}
+package ru.betterend.mixin.client;
+
+import org.spongepowered.asm.mixin.Mixin;
+
+import net.minecraft.client.render.model.json.ModelVariantMap.DeserializationContext;
+import net.minecraft.util.Identifier;
+import ru.betterend.interfaces.IdentifiedContext;
+
+@Mixin(DeserializationContext.class)
+public class DeserializationContextMixin implements IdentifiedContext {
+
+ private Identifier contextId;
+
+ @Override
+ public Identifier getContextId() {
+ return this.contextId;
+ }
+
+ @Override
+ public void setContextId(Identifier id) {
+ this.contextId = id;
+ }
+}
diff --git a/src/main/java/ru/betterend/mixin/client/NamespaceResourceManagerMixin.java b/src/main/java/ru/betterend/mixin/client/NamespaceResourceManagerMixin.java
index 214f6ffa..bdafb3bd 100644
--- a/src/main/java/ru/betterend/mixin/client/NamespaceResourceManagerMixin.java
+++ b/src/main/java/ru/betterend/mixin/client/NamespaceResourceManagerMixin.java
@@ -1,47 +1,47 @@
-package ru.betterend.mixin.client;
-
-import java.util.List;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.At.Shift;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-import com.google.common.collect.Lists;
-
-import net.minecraft.block.Block;
-import net.minecraft.resource.NamespaceResourceManager;
-import net.minecraft.resource.Resource;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.registry.Registry;
-import ru.betterend.BetterEnd;
-import ru.betterend.interfaces.Patterned;
-
-@Mixin(NamespaceResourceManager.class)
-public abstract class NamespaceResourceManagerMixin {
-
- @Shadow
- public abstract Resource getResource(Identifier id);
-
- @Inject(method = "getAllResources", cancellable = true, at = @At(
- value = "NEW",
- target = "java/io/FileNotFoundException",
- shift = Shift.BEFORE))
- public void getStatesPattern(Identifier id, CallbackInfoReturnable
> info) {
- if (id.getNamespace().contains(BetterEnd.MOD_ID)) {
- String[] data = id.getPath().split("/");
- if (data.length > 1) {
- Identifier blockId = BetterEnd.makeID(data[1].replace(".json", ""));
- Block block = Registry.BLOCK.get(blockId);
- if (block instanceof Patterned) {
- List resources = Lists.newArrayList();
- resources.add(this.getResource(((Patterned) block).statePatternId()));
- info.setReturnValue(resources);
- info.cancel();
- }
- }
- }
- }
-}
+package ru.betterend.mixin.client;
+
+import java.util.List;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Shadow;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.At.Shift;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+
+import com.google.common.collect.Lists;
+
+import net.minecraft.block.Block;
+import net.minecraft.resource.NamespaceResourceManager;
+import net.minecraft.resource.Resource;
+import net.minecraft.util.Identifier;
+import net.minecraft.util.registry.Registry;
+import ru.betterend.BetterEnd;
+import ru.betterend.interfaces.Patterned;
+
+@Mixin(NamespaceResourceManager.class)
+public abstract class NamespaceResourceManagerMixin {
+
+ @Shadow
+ public abstract Resource getResource(Identifier id);
+
+ @Inject(method = "getAllResources", cancellable = true, at = @At(
+ value = "NEW",
+ target = "java/io/FileNotFoundException",
+ shift = Shift.BEFORE))
+ public void getStatesPattern(Identifier id, CallbackInfoReturnable> info) {
+ if (id.getNamespace().contains(BetterEnd.MOD_ID)) {
+ String[] data = id.getPath().split("/");
+ if (data.length > 1) {
+ Identifier blockId = BetterEnd.makeID(data[1].replace(".json", ""));
+ Block block = Registry.BLOCK.get(blockId);
+ if (block instanceof Patterned) {
+ List resources = Lists.newArrayList();
+ resources.add(this.getResource(((Patterned) block).statePatternId()));
+ info.setReturnValue(resources);
+ info.cancel();
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/mixin/common/AbstractBlockMixin.java b/src/main/java/ru/betterend/mixin/common/AbstractBlockMixin.java
index 8c0b3358..68df0c6b 100644
--- a/src/main/java/ru/betterend/mixin/common/AbstractBlockMixin.java
+++ b/src/main/java/ru/betterend/mixin/common/AbstractBlockMixin.java
@@ -1,51 +1,51 @@
-package ru.betterend.mixin.common;
-
-import java.util.List;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-import com.google.common.collect.Lists;
-
-import net.minecraft.block.AbstractBlock;
-import net.minecraft.block.BlockState;
-import net.minecraft.block.Blocks;
-import net.minecraft.enchantment.EnchantmentHelper;
-import net.minecraft.enchantment.Enchantments;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.Items;
-import net.minecraft.loot.context.LootContext;
-import net.minecraft.loot.context.LootContextParameters;
-import net.minecraft.util.math.MathHelper;
-import ru.betterend.item.EndHammer;
-import ru.betterend.util.MHelper;
-
-@Mixin(AbstractBlock.class)
-public abstract class AbstractBlockMixin {
-
- @Inject(method = "getDroppedStacks", at = @At("HEAD"), cancellable = true)
- public void getDroppedStacks(BlockState state, LootContext.Builder builder, CallbackInfoReturnable> info) {
- if (state.isOf(Blocks.GLOWSTONE)) {
- ItemStack tool = builder.get(LootContextParameters.TOOL);
- if (tool != null && tool.getItem() instanceof EndHammer) {
- int min = 3;
- int max = 4;
- int count = 0;
- int fortune = EnchantmentHelper.getLevel(Enchantments.FORTUNE, tool);
- if (fortune > 0) {
- fortune /= Enchantments.FORTUNE.getMaxLevel();
- min = MathHelper.clamp(min + fortune, min, max);
- if (min == max) {
- info.setReturnValue(Lists.newArrayList(new ItemStack(Items.GLOWSTONE_DUST, max)));
- info.cancel();
- }
- }
- count = MHelper.randRange(min, max, MHelper.RANDOM);
- info.setReturnValue(Lists.newArrayList(new ItemStack(Items.GLOWSTONE_DUST, count)));
- info.cancel();
- }
- }
- }
-}
+package ru.betterend.mixin.common;
+
+import java.util.List;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+
+import com.google.common.collect.Lists;
+
+import net.minecraft.block.AbstractBlock;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.enchantment.EnchantmentHelper;
+import net.minecraft.enchantment.Enchantments;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.Items;
+import net.minecraft.loot.context.LootContext;
+import net.minecraft.loot.context.LootContextParameters;
+import net.minecraft.util.math.MathHelper;
+import ru.betterend.item.EndHammer;
+import ru.betterend.util.MHelper;
+
+@Mixin(AbstractBlock.class)
+public abstract class AbstractBlockMixin {
+
+ @Inject(method = "getDroppedStacks", at = @At("HEAD"), cancellable = true)
+ public void getDroppedStacks(BlockState state, LootContext.Builder builder, CallbackInfoReturnable> info) {
+ if (state.isOf(Blocks.GLOWSTONE)) {
+ ItemStack tool = builder.get(LootContextParameters.TOOL);
+ if (tool != null && tool.getItem() instanceof EndHammer) {
+ int min = 3;
+ int max = 4;
+ int count = 0;
+ int fortune = EnchantmentHelper.getLevel(Enchantments.FORTUNE, tool);
+ if (fortune > 0) {
+ fortune /= Enchantments.FORTUNE.getMaxLevel();
+ min = MathHelper.clamp(min + fortune, min, max);
+ if (min == max) {
+ info.setReturnValue(Lists.newArrayList(new ItemStack(Items.GLOWSTONE_DUST, max)));
+ info.cancel();
+ }
+ }
+ count = MHelper.randRange(min, max, MHelper.RANDOM);
+ info.setReturnValue(Lists.newArrayList(new ItemStack(Items.GLOWSTONE_DUST, count)));
+ info.cancel();
+ }
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/mixin/common/AnvilScreenHandlerMixin.java b/src/main/java/ru/betterend/mixin/common/AnvilScreenHandlerMixin.java
index d2292b3d..c8a4aa23 100644
--- a/src/main/java/ru/betterend/mixin/common/AnvilScreenHandlerMixin.java
+++ b/src/main/java/ru/betterend/mixin/common/AnvilScreenHandlerMixin.java
@@ -1,92 +1,92 @@
-package ru.betterend.mixin.common;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-import net.minecraft.block.AnvilBlock;
-import net.minecraft.block.BlockState;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.entity.player.PlayerInventory;
-import net.minecraft.item.ItemStack;
-import net.minecraft.recipe.RecipeManager;
-import net.minecraft.screen.AnvilScreenHandler;
-import net.minecraft.screen.ForgingScreenHandler;
-import net.minecraft.screen.ScreenHandlerContext;
-import net.minecraft.screen.ScreenHandlerType;
-import net.minecraft.tag.BlockTags;
-import net.minecraft.world.World;
-import ru.betterend.recipe.builders.AnvilSmithingRecipe;
-
-@Mixin(AnvilScreenHandler.class)
-public abstract class AnvilScreenHandlerMixin extends ForgingScreenHandler {
-
- private final World world = this.player.world;
- private final RecipeManager recipeManager = this.world.getRecipeManager();
- private AnvilSmithingRecipe currentRecipe;
-
- public AnvilScreenHandlerMixin(ScreenHandlerType> type, int syncId, PlayerInventory playerInventory,
- ScreenHandlerContext context) {
- super(type, syncId, playerInventory, context);
- }
-
- @Shadow
- public abstract void updateResult();
-
- @Inject(method = "canTakeOutput", at = @At("HEAD"), cancellable = true)
- protected void canTakeOutput(PlayerEntity player, boolean present, CallbackInfoReturnable info) {
- if (currentRecipe != null) {
- ItemStack output = this.currentRecipe.craft(input, player);
- if (!output.isEmpty()) {
- info.setReturnValue(true);
- info.cancel();
- }
- }
- }
-
- @Inject(method = "onTakeOutput", at = @At("HEAD"), cancellable = true)
- protected void onTakeOutput(PlayerEntity player, ItemStack stack, CallbackInfoReturnable info) {
- if (currentRecipe != null) {
- this.input.getStack(1).decrement(1);
- this.updateResult();
- this.context.run((world, blockPos) -> {
- BlockState anvilState = world.getBlockState(blockPos);
- if (!player.abilities.creativeMode && anvilState.isIn(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) {
- BlockState landingState = AnvilBlock.getLandingState(anvilState);
- if (landingState == null) {
- world.removeBlock(blockPos, false);
- world.syncWorldEvent(1029, blockPos, 0);
- } else {
- world.setBlockState(blockPos, landingState, 2);
- world.syncWorldEvent(1030, blockPos, 0);
- }
- } else {
- world.syncWorldEvent(1030, blockPos, 0);
- }
-
- });
- info.setReturnValue(stack);
- info.cancel();
- }
- }
-
- @Inject(method = "updateResult", at = @At("HEAD"), cancellable = true)
- public void updateOutput(CallbackInfo info) {
- this.currentRecipe = this.recipeManager.getFirstMatch(AnvilSmithingRecipe.TYPE, input, world).orElse(null);
- if (currentRecipe != null) {
- this.output.setStack(0, currentRecipe.craft(input));
- this.sendContentUpdates();
- info.cancel();
- }
- }
-
- @Inject(method = "setNewItemName", at = @At("HEAD"), cancellable = true)
- public void setNewItemName(String string, CallbackInfo info) {
- if (currentRecipe != null) {
- info.cancel();
- }
- }
-}
+package ru.betterend.mixin.common;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Shadow;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+
+import net.minecraft.block.AnvilBlock;
+import net.minecraft.block.BlockState;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.entity.player.PlayerInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.recipe.RecipeManager;
+import net.minecraft.screen.AnvilScreenHandler;
+import net.minecraft.screen.ForgingScreenHandler;
+import net.minecraft.screen.ScreenHandlerContext;
+import net.minecraft.screen.ScreenHandlerType;
+import net.minecraft.tag.BlockTags;
+import net.minecraft.world.World;
+import ru.betterend.recipe.builders.AnvilSmithingRecipe;
+
+@Mixin(AnvilScreenHandler.class)
+public abstract class AnvilScreenHandlerMixin extends ForgingScreenHandler {
+
+ private final World world = this.player.world;
+ private final RecipeManager recipeManager = this.world.getRecipeManager();
+ private AnvilSmithingRecipe currentRecipe;
+
+ public AnvilScreenHandlerMixin(ScreenHandlerType> type, int syncId, PlayerInventory playerInventory,
+ ScreenHandlerContext context) {
+ super(type, syncId, playerInventory, context);
+ }
+
+ @Shadow
+ public abstract void updateResult();
+
+ @Inject(method = "canTakeOutput", at = @At("HEAD"), cancellable = true)
+ protected void canTakeOutput(PlayerEntity player, boolean present, CallbackInfoReturnable info) {
+ if (currentRecipe != null) {
+ ItemStack output = this.currentRecipe.craft(input, player);
+ if (!output.isEmpty()) {
+ info.setReturnValue(true);
+ info.cancel();
+ }
+ }
+ }
+
+ @Inject(method = "onTakeOutput", at = @At("HEAD"), cancellable = true)
+ protected void onTakeOutput(PlayerEntity player, ItemStack stack, CallbackInfoReturnable info) {
+ if (currentRecipe != null) {
+ this.input.getStack(1).decrement(1);
+ this.updateResult();
+ this.context.run((world, blockPos) -> {
+ BlockState anvilState = world.getBlockState(blockPos);
+ if (!player.abilities.creativeMode && anvilState.isIn(BlockTags.ANVIL) && player.getRandom().nextFloat() < 0.12F) {
+ BlockState landingState = AnvilBlock.getLandingState(anvilState);
+ if (landingState == null) {
+ world.removeBlock(blockPos, false);
+ world.syncWorldEvent(1029, blockPos, 0);
+ } else {
+ world.setBlockState(blockPos, landingState, 2);
+ world.syncWorldEvent(1030, blockPos, 0);
+ }
+ } else {
+ world.syncWorldEvent(1030, blockPos, 0);
+ }
+
+ });
+ info.setReturnValue(stack);
+ info.cancel();
+ }
+ }
+
+ @Inject(method = "updateResult", at = @At("HEAD"), cancellable = true)
+ public void updateOutput(CallbackInfo info) {
+ this.currentRecipe = this.recipeManager.getFirstMatch(AnvilSmithingRecipe.TYPE, input, world).orElse(null);
+ if (currentRecipe != null) {
+ this.output.setStack(0, currentRecipe.craft(input));
+ this.sendContentUpdates();
+ info.cancel();
+ }
+ }
+
+ @Inject(method = "setNewItemName", at = @At("HEAD"), cancellable = true)
+ public void setNewItemName(String string, CallbackInfo info) {
+ if (currentRecipe != null) {
+ info.cancel();
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/mixin/common/BrewingAccessor.java b/src/main/java/ru/betterend/mixin/common/BrewingAccessor.java
index 751ee040..17129e52 100644
--- a/src/main/java/ru/betterend/mixin/common/BrewingAccessor.java
+++ b/src/main/java/ru/betterend/mixin/common/BrewingAccessor.java
@@ -1,16 +1,16 @@
-package ru.betterend.mixin.common;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.gen.Invoker;
-
-import net.minecraft.item.Item;
-import net.minecraft.potion.Potion;
-import net.minecraft.recipe.BrewingRecipeRegistry;
-
-@Mixin(BrewingRecipeRegistry.class)
-public interface BrewingAccessor {
- @Invoker
- static void callRegisterPotionRecipe(Potion input, Item item, Potion output) {
- throw new AssertionError("@Invoker dummy body called");
- }
-}
+package ru.betterend.mixin.common;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.gen.Invoker;
+
+import net.minecraft.item.Item;
+import net.minecraft.potion.Potion;
+import net.minecraft.recipe.BrewingRecipeRegistry;
+
+@Mixin(BrewingRecipeRegistry.class)
+public interface BrewingAccessor {
+ @Invoker
+ static void callRegisterPotionRecipe(Potion input, Item item, Potion output) {
+ throw new AssertionError("@Invoker dummy body called");
+ }
+}
diff --git a/src/main/java/ru/betterend/mixin/common/EndermanEntityMixin.java b/src/main/java/ru/betterend/mixin/common/EndermanEntityMixin.java
index c815399d..5bd9b493 100644
--- a/src/main/java/ru/betterend/mixin/common/EndermanEntityMixin.java
+++ b/src/main/java/ru/betterend/mixin/common/EndermanEntityMixin.java
@@ -1,26 +1,26 @@
-package ru.betterend.mixin.common;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-import net.minecraft.enchantment.EnchantmentHelper;
-import net.minecraft.entity.EquipmentSlot;
-import net.minecraft.entity.mob.EndermanEntity;
-import net.minecraft.entity.player.PlayerEntity;
-import ru.betterend.effects.EndEnchantments;
-import ru.betterend.effects.EndStatusEffects;
-
-@Mixin(EndermanEntity.class)
-public abstract class EndermanEntityMixin {
-
- @Inject(method = "isPlayerStaring", at = @At("HEAD"), cancellable = true)
- private void isPlayerStaring(PlayerEntity player, CallbackInfoReturnable info) {
- if (player.isCreative() || player.hasStatusEffect(EndStatusEffects.END_VEIL) ||
- EnchantmentHelper.getLevel(EndEnchantments.END_VEIL, player.getEquippedStack(EquipmentSlot.HEAD)) > 0) {
- info.setReturnValue(false);
- info.cancel();
- }
- }
-}
+package ru.betterend.mixin.common;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+
+import net.minecraft.enchantment.EnchantmentHelper;
+import net.minecraft.entity.EquipmentSlot;
+import net.minecraft.entity.mob.EndermanEntity;
+import net.minecraft.entity.player.PlayerEntity;
+import ru.betterend.effects.EndEnchantments;
+import ru.betterend.effects.EndStatusEffects;
+
+@Mixin(EndermanEntity.class)
+public abstract class EndermanEntityMixin {
+
+ @Inject(method = "isPlayerStaring", at = @At("HEAD"), cancellable = true)
+ private void isPlayerStaring(PlayerEntity player, CallbackInfoReturnable info) {
+ if (player.isCreative() || player.hasStatusEffect(EndStatusEffects.END_VEIL) ||
+ EnchantmentHelper.getLevel(EndEnchantments.END_VEIL, player.getEquippedStack(EquipmentSlot.HEAD)) > 0) {
+ info.setReturnValue(false);
+ info.cancel();
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/mixin/common/EntityMixin.java b/src/main/java/ru/betterend/mixin/common/EntityMixin.java
index 023a58fa..3710312a 100644
--- a/src/main/java/ru/betterend/mixin/common/EntityMixin.java
+++ b/src/main/java/ru/betterend/mixin/common/EntityMixin.java
@@ -1,116 +1,116 @@
-package ru.betterend.mixin.common;
-
-import org.spongepowered.asm.mixin.Final;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityType;
-import net.minecraft.server.world.ServerWorld;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.math.Vec3d;
-import net.minecraft.world.TeleportTarget;
-import net.minecraft.world.World;
-import ru.betterend.interfaces.TeleportingEntity;
-
-@Mixin(Entity.class)
-public abstract class EntityMixin implements TeleportingEntity {
-
- private BlockPos beExitPos;
- private long beCooldown;
-
- @Shadow
- public float yaw;
- @Shadow
- public float pitch;
- @Shadow
- public boolean removed;
- @Shadow
- public World world;
-
- @Final
- @Shadow
- public abstract void detach();
-
- @Shadow
- public abstract Vec3d getVelocity();
-
- @Shadow
- public abstract EntityType> getType();
-
- @Shadow
- public abstract void copyFrom(Entity original);
-
- @Shadow
- public abstract Entity moveToWorld(ServerWorld destination);
-
- @Shadow
- protected abstract TeleportTarget getTeleportTarget(ServerWorld destination);
-
- @Inject(method = "moveToWorld", at = @At("HEAD"), cancellable = true)
- public void moveToWorld(ServerWorld destination, CallbackInfoReturnable info) {
- if (!removed && beExitPos != null && world instanceof ServerWorld) {
- this.detach();
- this.world.getProfiler().push("changeDimension");
- this.world.getProfiler().push("reposition");
- TeleportTarget teleportTarget = this.getTeleportTarget(destination);
- if (teleportTarget != null) {
- this.world.getProfiler().swap("reloading");
- Entity entity = this.getType().create(destination);
- if (entity != null) {
- entity.copyFrom(Entity.class.cast(this));
- entity.refreshPositionAndAngles(teleportTarget.position.x, teleportTarget.position.y, teleportTarget.position.z, teleportTarget.yaw, entity.pitch);
- entity.setVelocity(teleportTarget.velocity);
- destination.onDimensionChanged(entity);
- }
- this.removed = true;
- this.world.getProfiler().pop();
- ((ServerWorld) this.world).resetIdleTimeout();
- destination.resetIdleTimeout();
- this.world.getProfiler().pop();
- this.beExitPos = null;
- info.setReturnValue(entity);
- info.cancel();
- }
- }
- }
-
- @Inject(method = "getTeleportTarget", at = @At("HEAD"), cancellable = true)
- protected void getTeleportTarget(ServerWorld destination, CallbackInfoReturnable info) {
- if (beExitPos != null) {
- info.setReturnValue(new TeleportTarget(new Vec3d(beExitPos.getX() + 0.5D, beExitPos.getY(), beExitPos.getZ() + 0.5D), getVelocity(), yaw, pitch));
- info.cancel();
- }
- }
-
- @Inject(method = "baseTick", at = @At("TAIL"))
- public void baseTick(CallbackInfo info) {
- if (hasCooldown()) {
- this.beCooldown--;
- }
- }
-
- @Override
- public long beGetCooldown() {
- return this.beCooldown;
- }
-
- @Override
- public void beSetCooldown(long time) {
- this.beCooldown = time;
- }
-
- @Override
- public void beSetExitPos(BlockPos pos) {
- this.beExitPos = pos;
- }
-
- @Override
- public BlockPos beGetExitPos() {
- return this.beExitPos;
- }
-}
+package ru.betterend.mixin.common;
+
+import org.spongepowered.asm.mixin.Final;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Shadow;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityType;
+import net.minecraft.server.world.ServerWorld;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.Vec3d;
+import net.minecraft.world.TeleportTarget;
+import net.minecraft.world.World;
+import ru.betterend.interfaces.TeleportingEntity;
+
+@Mixin(Entity.class)
+public abstract class EntityMixin implements TeleportingEntity {
+
+ private BlockPos beExitPos;
+ private long beCooldown;
+
+ @Shadow
+ public float yaw;
+ @Shadow
+ public float pitch;
+ @Shadow
+ public boolean removed;
+ @Shadow
+ public World world;
+
+ @Final
+ @Shadow
+ public abstract void detach();
+
+ @Shadow
+ public abstract Vec3d getVelocity();
+
+ @Shadow
+ public abstract EntityType> getType();
+
+ @Shadow
+ public abstract void copyFrom(Entity original);
+
+ @Shadow
+ public abstract Entity moveToWorld(ServerWorld destination);
+
+ @Shadow
+ protected abstract TeleportTarget getTeleportTarget(ServerWorld destination);
+
+ @Inject(method = "moveToWorld", at = @At("HEAD"), cancellable = true)
+ public void moveToWorld(ServerWorld destination, CallbackInfoReturnable info) {
+ if (!removed && beExitPos != null && world instanceof ServerWorld) {
+ this.detach();
+ this.world.getProfiler().push("changeDimension");
+ this.world.getProfiler().push("reposition");
+ TeleportTarget teleportTarget = this.getTeleportTarget(destination);
+ if (teleportTarget != null) {
+ this.world.getProfiler().swap("reloading");
+ Entity entity = this.getType().create(destination);
+ if (entity != null) {
+ entity.copyFrom(Entity.class.cast(this));
+ entity.refreshPositionAndAngles(teleportTarget.position.x, teleportTarget.position.y, teleportTarget.position.z, teleportTarget.yaw, entity.pitch);
+ entity.setVelocity(teleportTarget.velocity);
+ destination.onDimensionChanged(entity);
+ }
+ this.removed = true;
+ this.world.getProfiler().pop();
+ ((ServerWorld) this.world).resetIdleTimeout();
+ destination.resetIdleTimeout();
+ this.world.getProfiler().pop();
+ this.beExitPos = null;
+ info.setReturnValue(entity);
+ info.cancel();
+ }
+ }
+ }
+
+ @Inject(method = "getTeleportTarget", at = @At("HEAD"), cancellable = true)
+ protected void getTeleportTarget(ServerWorld destination, CallbackInfoReturnable info) {
+ if (beExitPos != null) {
+ info.setReturnValue(new TeleportTarget(new Vec3d(beExitPos.getX() + 0.5D, beExitPos.getY(), beExitPos.getZ() + 0.5D), getVelocity(), yaw, pitch));
+ info.cancel();
+ }
+ }
+
+ @Inject(method = "baseTick", at = @At("TAIL"))
+ public void baseTick(CallbackInfo info) {
+ if (hasCooldown()) {
+ this.beCooldown--;
+ }
+ }
+
+ @Override
+ public long beGetCooldown() {
+ return this.beCooldown;
+ }
+
+ @Override
+ public void beSetCooldown(long time) {
+ this.beCooldown = time;
+ }
+
+ @Override
+ public void beSetExitPos(BlockPos pos) {
+ this.beExitPos = pos;
+ }
+
+ @Override
+ public BlockPos beGetExitPos() {
+ return this.beExitPos;
+ }
+}
diff --git a/src/main/java/ru/betterend/mixin/common/IngredientMixin.java b/src/main/java/ru/betterend/mixin/common/IngredientMixin.java
index 53466da3..5144e268 100644
--- a/src/main/java/ru/betterend/mixin/common/IngredientMixin.java
+++ b/src/main/java/ru/betterend/mixin/common/IngredientMixin.java
@@ -1,46 +1,46 @@
-package ru.betterend.mixin.common;
-
-import java.util.Arrays;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
-
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.recipe.Ingredient;
-
-import ru.betterend.interfaces.CompoundSerializer;
-
-@Mixin(Ingredient.class)
-public abstract class IngredientMixin implements CompoundSerializer {
-
- @Shadow
- private ItemStack[] matchingStacks;
-
- @Shadow
- protected abstract void cacheMatchingStacks();
-
- @Override
- public CompoundTag toTag(CompoundTag tag) {
- this.cacheMatchingStacks();
- int i = 0;
- tag.putInt("length", matchingStacks.length);
- for (ItemStack stack : matchingStacks) {
- String key = Integer.toString(i);
- tag.put(key, stack.toTag(new CompoundTag()));
- i++;
- }
- return tag;
- }
-
- @Override
- public Ingredient fromTag(CompoundTag tag) {
- int length = tag.getInt("length");
- ItemStack[] stacks = new ItemStack[length];
- for (int i = 0; i < length; i++) {
- String key = Integer.toString(i);
- stacks[i] = ItemStack.fromTag(tag.getCompound(key));
- }
- return Ingredient.ofStacks(Arrays.stream(stacks));
- }
-}
+package ru.betterend.mixin.common;
+
+import java.util.Arrays;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Shadow;
+
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.CompoundTag;
+import net.minecraft.recipe.Ingredient;
+
+import ru.betterend.interfaces.CompoundSerializer;
+
+@Mixin(Ingredient.class)
+public abstract class IngredientMixin implements CompoundSerializer {
+
+ @Shadow
+ private ItemStack[] matchingStacks;
+
+ @Shadow
+ protected abstract void cacheMatchingStacks();
+
+ @Override
+ public CompoundTag toTag(CompoundTag tag) {
+ this.cacheMatchingStacks();
+ int i = 0;
+ tag.putInt("length", matchingStacks.length);
+ for (ItemStack stack : matchingStacks) {
+ String key = Integer.toString(i);
+ tag.put(key, stack.toTag(new CompoundTag()));
+ i++;
+ }
+ return tag;
+ }
+
+ @Override
+ public Ingredient fromTag(CompoundTag tag) {
+ int length = tag.getInt("length");
+ ItemStack[] stacks = new ItemStack[length];
+ for (int i = 0; i < length; i++) {
+ String key = Integer.toString(i);
+ stacks[i] = ItemStack.fromTag(tag.getCompound(key));
+ }
+ return Ingredient.ofStacks(Arrays.stream(stacks));
+ }
+}
diff --git a/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java b/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java
index 61c9e8ba..954e0276 100644
--- a/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java
+++ b/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java
@@ -1,47 +1,47 @@
-package ru.betterend.mixin.common;
-
-import java.util.Collection;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.ModifyArg;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
-
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EquipmentSlot;
-import net.minecraft.entity.LivingEntity;
-import net.minecraft.entity.attribute.EntityAttributeModifier;
-import net.minecraft.entity.attribute.EntityAttributes;
-import net.minecraft.entity.damage.DamageSource;
-import net.minecraft.item.Item;
-
-@Mixin(LivingEntity.class)
-public abstract class LivingEntityMixin {
-
- private Entity lastAttacker;
-
- @Inject(method = "damage", at = @At("HEAD"))
- public void damage(DamageSource source, float amount, CallbackInfoReturnable info) {
- this.lastAttacker = source.getAttacker();
- }
-
- @ModifyArg(method = "damage", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;takeKnockback(FDD)V"))
- private float increaseKnockback(float value, double x, double z) {
- if (lastAttacker != null && lastAttacker instanceof LivingEntity) {
- LivingEntity attacker = (LivingEntity) lastAttacker;
- value += this.getKnockback(attacker.getMainHandStack().getItem());
- }
- return value;
- }
-
- private double getKnockback(Item tool) {
- if (tool == null) return 0.0D;
- Collection modifiers = tool.getAttributeModifiers(EquipmentSlot.MAINHAND)
- .get(EntityAttributes.GENERIC_ATTACK_KNOCKBACK);
- if (modifiers.size() > 0) {
- return modifiers.iterator().next().getValue();
- }
- return 0.0D;
- }
-}
+package ru.betterend.mixin.common;
+
+import java.util.Collection;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.ModifyArg;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EquipmentSlot;
+import net.minecraft.entity.LivingEntity;
+import net.minecraft.entity.attribute.EntityAttributeModifier;
+import net.minecraft.entity.attribute.EntityAttributes;
+import net.minecraft.entity.damage.DamageSource;
+import net.minecraft.item.Item;
+
+@Mixin(LivingEntity.class)
+public abstract class LivingEntityMixin {
+
+ private Entity lastAttacker;
+
+ @Inject(method = "damage", at = @At("HEAD"))
+ public void damage(DamageSource source, float amount, CallbackInfoReturnable info) {
+ this.lastAttacker = source.getAttacker();
+ }
+
+ @ModifyArg(method = "damage", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;takeKnockback(FDD)V"))
+ private float increaseKnockback(float value, double x, double z) {
+ if (lastAttacker != null && lastAttacker instanceof LivingEntity) {
+ LivingEntity attacker = (LivingEntity) lastAttacker;
+ value += this.getKnockback(attacker.getMainHandStack().getItem());
+ }
+ return value;
+ }
+
+ private double getKnockback(Item tool) {
+ if (tool == null) return 0.0D;
+ Collection modifiers = tool.getAttributeModifiers(EquipmentSlot.MAINHAND)
+ .get(EntityAttributes.GENERIC_ATTACK_KNOCKBACK);
+ if (modifiers.size() > 0) {
+ return modifiers.iterator().next().getValue();
+ }
+ return 0.0D;
+ }
+}
diff --git a/src/main/java/ru/betterend/mixin/common/ServerPlayerEntityMixin.java b/src/main/java/ru/betterend/mixin/common/ServerPlayerEntityMixin.java
index 102cb8ea..4128a8c4 100644
--- a/src/main/java/ru/betterend/mixin/common/ServerPlayerEntityMixin.java
+++ b/src/main/java/ru/betterend/mixin/common/ServerPlayerEntityMixin.java
@@ -1,41 +1,41 @@
-package ru.betterend.mixin.common;
-
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Inject;
-import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
-
-import net.minecraft.server.network.ServerPlayerEntity;
-import net.minecraft.util.math.BlockPos;
-import ru.betterend.interfaces.TeleportingEntity;
-
-@Mixin(ServerPlayerEntity.class)
-public abstract class ServerPlayerEntityMixin implements TeleportingEntity {
-
- private long beCooldown;
-
- @Inject(method = "tick", at = @At("TAIL"))
- public void baseTick(CallbackInfo info) {
- if (hasCooldown()) {
- this.beCooldown--;
- }
- }
-
- @Override
- public long beGetCooldown() {
- return this.beCooldown;
- }
-
- @Override
- public void beSetCooldown(long time) {
- this.beCooldown = time;
- }
-
- @Override
- public void beSetExitPos(BlockPos pos) {}
-
- @Override
- public BlockPos beGetExitPos() {
- return null;
- }
-}
+package ru.betterend.mixin.common;
+
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Inject;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+
+import net.minecraft.server.network.ServerPlayerEntity;
+import net.minecraft.util.math.BlockPos;
+import ru.betterend.interfaces.TeleportingEntity;
+
+@Mixin(ServerPlayerEntity.class)
+public abstract class ServerPlayerEntityMixin implements TeleportingEntity {
+
+ private long beCooldown;
+
+ @Inject(method = "tick", at = @At("TAIL"))
+ public void baseTick(CallbackInfo info) {
+ if (hasCooldown()) {
+ this.beCooldown--;
+ }
+ }
+
+ @Override
+ public long beGetCooldown() {
+ return this.beCooldown;
+ }
+
+ @Override
+ public void beSetCooldown(long time) {
+ this.beCooldown = time;
+ }
+
+ @Override
+ public void beSetExitPos(BlockPos pos) {}
+
+ @Override
+ public BlockPos beGetExitPos() {
+ return null;
+ }
+}
diff --git a/src/main/java/ru/betterend/particle/PaticlePortalSphere.java b/src/main/java/ru/betterend/particle/PaticlePortalSphere.java
index c80fd158..7268fcf5 100644
--- a/src/main/java/ru/betterend/particle/PaticlePortalSphere.java
+++ b/src/main/java/ru/betterend/particle/PaticlePortalSphere.java
@@ -1,76 +1,76 @@
-package ru.betterend.particle;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.minecraft.client.particle.AnimatedParticle;
-import net.minecraft.client.particle.Particle;
-import net.minecraft.client.particle.ParticleFactory;
-import net.minecraft.client.particle.SpriteProvider;
-import net.minecraft.client.world.ClientWorld;
-import net.minecraft.particle.DefaultParticleType;
-import net.minecraft.util.math.MathHelper;
-import ru.betterend.util.MHelper;
-
-public class PaticlePortalSphere extends AnimatedParticle {
- private int ticks;
- private double preVX;
- private double preVY;
- private double preVZ;
- private double nextVX;
- private double nextVY;
- private double nextVZ;
-
- public PaticlePortalSphere(ClientWorld world, double x, double y, double z, SpriteProvider spriteProvider) {
- super(world, x, y, z, spriteProvider, 0);
- setSprite(spriteProvider.getSprite(random));
- this.maxAge = MHelper.randRange(20, 80, random);
- this.scale = MHelper.randRange(0.05F, 0.15F, random);
- this.setColor(0xFEBBD5);
- this.setTargetColor(0xBBFEE4);
- this.setSpriteForAge(spriteProvider);
-
- preVX = random.nextGaussian() * 0.02;
- preVY = random.nextGaussian() * 0.02;
- preVZ = random.nextGaussian() * 0.02;
-
- nextVX = random.nextGaussian() * 0.02;
- nextVY = random.nextGaussian() * 0.02;
- nextVZ = random.nextGaussian() * 0.02;
- }
-
- @Override
- public void tick() {
- ticks++;
- if (ticks > 30) {
- preVX = nextVX;
- preVY = nextVY;
- preVZ = nextVZ;
- nextVX = random.nextGaussian() * 0.02;
- nextVY = random.nextGaussian() * 0.02;
- nextVZ = random.nextGaussian() * 0.02;
- ticks = 0;
- }
- double delta = (double) ticks / 30.0;
-
- this.velocityX = MathHelper.lerp(delta, preVX, nextVX);
- this.velocityY = MathHelper.lerp(delta, preVY, nextVY);
- this.velocityZ = MathHelper.lerp(delta, preVZ, nextVZ);
-
- super.tick();
- }
-
- @Environment(EnvType.CLIENT)
- public static class FactoryPortalSphere implements ParticleFactory {
-
- private final SpriteProvider sprites;
-
- public FactoryPortalSphere(SpriteProvider sprites) {
- this.sprites = sprites;
- }
-
- @Override
- public Particle createParticle(DefaultParticleType type, ClientWorld world, double x, double y, double z, double vX, double vY, double vZ) {
- return new PaticlePortalSphere(world, x, y, z, sprites);
- }
- }
-}
+package ru.betterend.particle;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.minecraft.client.particle.AnimatedParticle;
+import net.minecraft.client.particle.Particle;
+import net.minecraft.client.particle.ParticleFactory;
+import net.minecraft.client.particle.SpriteProvider;
+import net.minecraft.client.world.ClientWorld;
+import net.minecraft.particle.DefaultParticleType;
+import net.minecraft.util.math.MathHelper;
+import ru.betterend.util.MHelper;
+
+public class PaticlePortalSphere extends AnimatedParticle {
+ private int ticks;
+ private double preVX;
+ private double preVY;
+ private double preVZ;
+ private double nextVX;
+ private double nextVY;
+ private double nextVZ;
+
+ public PaticlePortalSphere(ClientWorld world, double x, double y, double z, SpriteProvider spriteProvider) {
+ super(world, x, y, z, spriteProvider, 0);
+ setSprite(spriteProvider.getSprite(random));
+ this.maxAge = MHelper.randRange(20, 80, random);
+ this.scale = MHelper.randRange(0.05F, 0.15F, random);
+ this.setColor(0xFEBBD5);
+ this.setTargetColor(0xBBFEE4);
+ this.setSpriteForAge(spriteProvider);
+
+ preVX = random.nextGaussian() * 0.02;
+ preVY = random.nextGaussian() * 0.02;
+ preVZ = random.nextGaussian() * 0.02;
+
+ nextVX = random.nextGaussian() * 0.02;
+ nextVY = random.nextGaussian() * 0.02;
+ nextVZ = random.nextGaussian() * 0.02;
+ }
+
+ @Override
+ public void tick() {
+ ticks++;
+ if (ticks > 30) {
+ preVX = nextVX;
+ preVY = nextVY;
+ preVZ = nextVZ;
+ nextVX = random.nextGaussian() * 0.02;
+ nextVY = random.nextGaussian() * 0.02;
+ nextVZ = random.nextGaussian() * 0.02;
+ ticks = 0;
+ }
+ double delta = (double) ticks / 30.0;
+
+ this.velocityX = MathHelper.lerp(delta, preVX, nextVX);
+ this.velocityY = MathHelper.lerp(delta, preVY, nextVY);
+ this.velocityZ = MathHelper.lerp(delta, preVZ, nextVZ);
+
+ super.tick();
+ }
+
+ @Environment(EnvType.CLIENT)
+ public static class FactoryPortalSphere implements ParticleFactory {
+
+ private final SpriteProvider sprites;
+
+ public FactoryPortalSphere(SpriteProvider sprites) {
+ this.sprites = sprites;
+ }
+
+ @Override
+ public Particle createParticle(DefaultParticleType type, ClientWorld world, double x, double y, double z, double vX, double vY, double vZ) {
+ return new PaticlePortalSphere(world, x, y, z, sprites);
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java b/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java
index 9b590cc4..4441c93f 100644
--- a/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java
+++ b/src/main/java/ru/betterend/recipe/builders/AlloyingRecipe.java
@@ -1,273 +1,273 @@
-package ru.betterend.recipe.builders;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.minecraft.inventory.Inventory;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemConvertible;
-import net.minecraft.item.ItemStack;
-import net.minecraft.network.PacketByteBuf;
-import net.minecraft.recipe.Ingredient;
-import net.minecraft.recipe.Recipe;
-import net.minecraft.recipe.RecipeSerializer;
-import net.minecraft.recipe.RecipeType;
-import net.minecraft.tag.Tag;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.JsonHelper;
-import net.minecraft.util.collection.DefaultedList;
-import net.minecraft.util.registry.Registry;
-import net.minecraft.world.World;
-import ru.betterend.BetterEnd;
-import ru.betterend.recipe.EndRecipeManager;
-import ru.betterend.registry.EndBlocks;
-import ru.betterend.util.RecipeHelper;
-
-public class AlloyingRecipe implements Recipe {
-
- public final static String GROUP = "alloying";
- public final static RecipeType TYPE = EndRecipeManager.registerType(GROUP);
- public final static Serializer SERIALIZER = EndRecipeManager.registerSerializer(GROUP, new Serializer());
- public final static Identifier ID = BetterEnd.makeID(GROUP);
-
- protected final RecipeType> type;
- protected final Identifier id;
- protected final Ingredient primaryInput;
- protected final Ingredient secondaryInput;
- protected final ItemStack output;
- protected final String group;
- protected final float experience;
- protected final int smeltTime;
-
- public AlloyingRecipe(Identifier id, String group, Ingredient primaryInput, Ingredient secondaryInput, ItemStack output, float experience, int smeltTime) {
- this.group = group;
- this.id = id;
- this.primaryInput = primaryInput;
- this.secondaryInput = secondaryInput;
- this.output = output;
- this.experience = experience;
- this.smeltTime = smeltTime;
- this.type = TYPE;
- }
-
- public float getExperience() {
- return this.experience;
- }
-
- public int getSmeltTime() {
- return this.smeltTime;
- }
-
- @Override
- public DefaultedList getPreviewInputs() {
- DefaultedList defaultedList = DefaultedList.of();
- defaultedList.add(primaryInput);
- defaultedList.add(secondaryInput);
-
- return defaultedList;
- }
-
- @Override
- public boolean matches(Inventory inv, World world) {
- return this.primaryInput.test(inv.getStack(0)) && this.secondaryInput.test(inv.getStack(1)) ||
- this.primaryInput.test(inv.getStack(1)) && this.secondaryInput.test(inv.getStack(0));
- }
-
- @Override
- public ItemStack craft(Inventory inv) {
- return this.output.copy();
- }
-
- @Override
- public boolean fits(int width, int height) {
- return true;
- }
-
- @Override
- public ItemStack getOutput() {
- return this.output;
- }
-
- @Override
- public Identifier getId() {
- return this.id;
- }
-
- @Override
- public RecipeSerializer> getSerializer() {
- return SERIALIZER;
- }
-
- @Override
- public RecipeType> getType() {
- return this.type;
- }
-
- @Override
- @Environment(EnvType.CLIENT)
- public String getGroup() {
- return this.group;
- }
-
- @Environment(EnvType.CLIENT)
- public ItemStack getRecipeKindIcon() {
- return new ItemStack(EndBlocks.END_STONE_SMELTER);
- }
-
- public static class Builder {
- private final static Builder INSTANCE = new Builder();
-
- public static Builder create(Identifier id) {
- INSTANCE.id = id;
- INSTANCE.group = String.format("%s_%s", GROUP, id);
- INSTANCE.primaryInput = null;
- INSTANCE.secondaryInput = null;
- INSTANCE.output = null;
- INSTANCE.experience = 0.0F;
- INSTANCE.smeltTime = 350;
-
- return INSTANCE;
- }
-
- public static Builder create(String id) {
- return create(BetterEnd.makeID(id));
- }
-
- private Identifier id;
- private Ingredient primaryInput;
- private Ingredient secondaryInput;
- private ItemStack output;
- private String group;
- private float experience;
- private int smeltTime;
- private boolean alright = true;
-
- private Builder() {}
-
- public Builder setGroup(String group) {
- this.group = group;
- return this;
- }
-
- public Builder setPrimaryInput(ItemConvertible... inputs) {
- for (ItemConvertible item : inputs) {
- this.alright &= RecipeHelper.exists(item);
- }
- this.primaryInput = Ingredient.ofItems(inputs);
- return this;
- }
-
- public Builder setSecondaryInput(ItemConvertible... inputs) {
- for (ItemConvertible item : inputs) {
- this.alright &= RecipeHelper.exists(item);
- }
- this.secondaryInput = Ingredient.ofItems(inputs);
- return this;
- }
-
- public Builder setPrimaryInput(Tag- input) {
- this.primaryInput = Ingredient.fromTag(input);
- return this;
- }
-
- public Builder setSecondaryInput(Tag
- input) {
- this.secondaryInput = Ingredient.fromTag(input);
- return this;
- }
-
- public Builder setInput(ItemConvertible primaryInput, ItemConvertible secondaryInput) {
- this.setPrimaryInput(primaryInput);
- this.setSecondaryInput(secondaryInput);
- return this;
- }
-
- public Builder setInput(Tag
- primaryInput, Tag
- secondaryInput) {
- this.setPrimaryInput(primaryInput);
- this.setSecondaryInput(secondaryInput);
- return this;
- }
-
- public Builder setOutput(ItemConvertible output, int amount) {
- this.alright &= RecipeHelper.exists(output);
- this.output = new ItemStack(output, amount);
- return this;
- }
-
- public Builder setExpiriense(float amount) {
- this.experience = amount;
- return this;
- }
-
- public Builder setSmeltTime(int time) {
- this.smeltTime = time;
- return this;
- }
-
- public void build() {
- if (primaryInput == null) {
- BetterEnd.LOGGER.warning("Primary input for Alloying recipe can't be 'null', recipe {} will be ignored!", id);
- return;
- }
- if(secondaryInput == null) {
- BetterEnd.LOGGER.warning("Secondary input for Alloying can't be 'null', recipe {} will be ignored!", id);
- return;
- }
- if(output == null) {
- BetterEnd.LOGGER.warning("Output for Alloying can't be 'null', recipe {} will be ignored!", id);
- return;
- }
- if (EndRecipeManager.getRecipe(TYPE, id) != null) {
- BetterEnd.LOGGER.warning("Can't add Alloying recipe! Id {} already exists!", id);
- return;
- }
- if (!alright) {
- BetterEnd.LOGGER.debug("Can't add Alloying recipe {}! Ingeredient or output not exists.", id);
- return;
- }
- EndRecipeManager.addRecipe(TYPE, new AlloyingRecipe(id, group, primaryInput, secondaryInput, output, experience, smeltTime));
- }
- }
-
- public static class Serializer implements RecipeSerializer {
- @Override
- public AlloyingRecipe read(Identifier id, JsonObject json) {
- JsonArray ingredients = JsonHelper.getArray(json, "ingredients");
- Ingredient primaryInput = Ingredient.fromJson(ingredients.get(0));
- Ingredient secondaryInput = Ingredient.fromJson(ingredients.get(1));
- String resultStr = JsonHelper.getString(json, "result");
- String group = JsonHelper.getString(json, "group", "");
- Identifier resultId = new Identifier(resultStr);
- ItemStack output = new ItemStack(Registry.ITEM.getOrEmpty(resultId).orElseThrow(() -> {
- return new IllegalStateException("Item: " + resultStr + " does not exists!");
- }));
- float experience = JsonHelper.getFloat(json, "experience", 0.0F);
- int smeltTime = JsonHelper.getInt(json, "smelttime", 350);
-
- return new AlloyingRecipe(id, group, primaryInput, secondaryInput, output, experience, smeltTime);
- }
-
- @Override
- public AlloyingRecipe read(Identifier id, PacketByteBuf packetBuffer) {
- String group = packetBuffer.readString(32767);
- Ingredient primary = Ingredient.fromPacket(packetBuffer);
- Ingredient secondary = Ingredient.fromPacket(packetBuffer);
- ItemStack output = packetBuffer.readItemStack();
- float experience = packetBuffer.readFloat();
- int smeltTime = packetBuffer.readVarInt();
-
- return new AlloyingRecipe(id, group, primary, secondary, output, experience, smeltTime);
- }
-
- @Override
- public void write(PacketByteBuf packetBuffer, AlloyingRecipe recipe) {
- packetBuffer.writeString(recipe.group);
- recipe.primaryInput.write(packetBuffer);
- recipe.secondaryInput.write(packetBuffer);
- packetBuffer.writeItemStack(recipe.output);
- packetBuffer.writeFloat(recipe.experience);
- packetBuffer.writeVarInt(recipe.smeltTime);
- }
- }
-}
+package ru.betterend.recipe.builders;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.minecraft.inventory.Inventory;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemConvertible;
+import net.minecraft.item.ItemStack;
+import net.minecraft.network.PacketByteBuf;
+import net.minecraft.recipe.Ingredient;
+import net.minecraft.recipe.Recipe;
+import net.minecraft.recipe.RecipeSerializer;
+import net.minecraft.recipe.RecipeType;
+import net.minecraft.tag.Tag;
+import net.minecraft.util.Identifier;
+import net.minecraft.util.JsonHelper;
+import net.minecraft.util.collection.DefaultedList;
+import net.minecraft.util.registry.Registry;
+import net.minecraft.world.World;
+import ru.betterend.BetterEnd;
+import ru.betterend.recipe.EndRecipeManager;
+import ru.betterend.registry.EndBlocks;
+import ru.betterend.util.RecipeHelper;
+
+public class AlloyingRecipe implements Recipe {
+
+ public final static String GROUP = "alloying";
+ public final static RecipeType TYPE = EndRecipeManager.registerType(GROUP);
+ public final static Serializer SERIALIZER = EndRecipeManager.registerSerializer(GROUP, new Serializer());
+ public final static Identifier ID = BetterEnd.makeID(GROUP);
+
+ protected final RecipeType> type;
+ protected final Identifier id;
+ protected final Ingredient primaryInput;
+ protected final Ingredient secondaryInput;
+ protected final ItemStack output;
+ protected final String group;
+ protected final float experience;
+ protected final int smeltTime;
+
+ public AlloyingRecipe(Identifier id, String group, Ingredient primaryInput, Ingredient secondaryInput, ItemStack output, float experience, int smeltTime) {
+ this.group = group;
+ this.id = id;
+ this.primaryInput = primaryInput;
+ this.secondaryInput = secondaryInput;
+ this.output = output;
+ this.experience = experience;
+ this.smeltTime = smeltTime;
+ this.type = TYPE;
+ }
+
+ public float getExperience() {
+ return this.experience;
+ }
+
+ public int getSmeltTime() {
+ return this.smeltTime;
+ }
+
+ @Override
+ public DefaultedList getPreviewInputs() {
+ DefaultedList defaultedList = DefaultedList.of();
+ defaultedList.add(primaryInput);
+ defaultedList.add(secondaryInput);
+
+ return defaultedList;
+ }
+
+ @Override
+ public boolean matches(Inventory inv, World world) {
+ return this.primaryInput.test(inv.getStack(0)) && this.secondaryInput.test(inv.getStack(1)) ||
+ this.primaryInput.test(inv.getStack(1)) && this.secondaryInput.test(inv.getStack(0));
+ }
+
+ @Override
+ public ItemStack craft(Inventory inv) {
+ return this.output.copy();
+ }
+
+ @Override
+ public boolean fits(int width, int height) {
+ return true;
+ }
+
+ @Override
+ public ItemStack getOutput() {
+ return this.output;
+ }
+
+ @Override
+ public Identifier getId() {
+ return this.id;
+ }
+
+ @Override
+ public RecipeSerializer> getSerializer() {
+ return SERIALIZER;
+ }
+
+ @Override
+ public RecipeType> getType() {
+ return this.type;
+ }
+
+ @Override
+ @Environment(EnvType.CLIENT)
+ public String getGroup() {
+ return this.group;
+ }
+
+ @Environment(EnvType.CLIENT)
+ public ItemStack getRecipeKindIcon() {
+ return new ItemStack(EndBlocks.END_STONE_SMELTER);
+ }
+
+ public static class Builder {
+ private final static Builder INSTANCE = new Builder();
+
+ public static Builder create(Identifier id) {
+ INSTANCE.id = id;
+ INSTANCE.group = String.format("%s_%s", GROUP, id);
+ INSTANCE.primaryInput = null;
+ INSTANCE.secondaryInput = null;
+ INSTANCE.output = null;
+ INSTANCE.experience = 0.0F;
+ INSTANCE.smeltTime = 350;
+
+ return INSTANCE;
+ }
+
+ public static Builder create(String id) {
+ return create(BetterEnd.makeID(id));
+ }
+
+ private Identifier id;
+ private Ingredient primaryInput;
+ private Ingredient secondaryInput;
+ private ItemStack output;
+ private String group;
+ private float experience;
+ private int smeltTime;
+ private boolean alright = true;
+
+ private Builder() {}
+
+ public Builder setGroup(String group) {
+ this.group = group;
+ return this;
+ }
+
+ public Builder setPrimaryInput(ItemConvertible... inputs) {
+ for (ItemConvertible item : inputs) {
+ this.alright &= RecipeHelper.exists(item);
+ }
+ this.primaryInput = Ingredient.ofItems(inputs);
+ return this;
+ }
+
+ public Builder setSecondaryInput(ItemConvertible... inputs) {
+ for (ItemConvertible item : inputs) {
+ this.alright &= RecipeHelper.exists(item);
+ }
+ this.secondaryInput = Ingredient.ofItems(inputs);
+ return this;
+ }
+
+ public Builder setPrimaryInput(Tag
- input) {
+ this.primaryInput = Ingredient.fromTag(input);
+ return this;
+ }
+
+ public Builder setSecondaryInput(Tag
- input) {
+ this.secondaryInput = Ingredient.fromTag(input);
+ return this;
+ }
+
+ public Builder setInput(ItemConvertible primaryInput, ItemConvertible secondaryInput) {
+ this.setPrimaryInput(primaryInput);
+ this.setSecondaryInput(secondaryInput);
+ return this;
+ }
+
+ public Builder setInput(Tag
- primaryInput, Tag
- secondaryInput) {
+ this.setPrimaryInput(primaryInput);
+ this.setSecondaryInput(secondaryInput);
+ return this;
+ }
+
+ public Builder setOutput(ItemConvertible output, int amount) {
+ this.alright &= RecipeHelper.exists(output);
+ this.output = new ItemStack(output, amount);
+ return this;
+ }
+
+ public Builder setExpiriense(float amount) {
+ this.experience = amount;
+ return this;
+ }
+
+ public Builder setSmeltTime(int time) {
+ this.smeltTime = time;
+ return this;
+ }
+
+ public void build() {
+ if (primaryInput == null) {
+ BetterEnd.LOGGER.warning("Primary input for Alloying recipe can't be 'null', recipe {} will be ignored!", id);
+ return;
+ }
+ if(secondaryInput == null) {
+ BetterEnd.LOGGER.warning("Secondary input for Alloying can't be 'null', recipe {} will be ignored!", id);
+ return;
+ }
+ if(output == null) {
+ BetterEnd.LOGGER.warning("Output for Alloying can't be 'null', recipe {} will be ignored!", id);
+ return;
+ }
+ if (EndRecipeManager.getRecipe(TYPE, id) != null) {
+ BetterEnd.LOGGER.warning("Can't add Alloying recipe! Id {} already exists!", id);
+ return;
+ }
+ if (!alright) {
+ BetterEnd.LOGGER.debug("Can't add Alloying recipe {}! Ingeredient or output not exists.", id);
+ return;
+ }
+ EndRecipeManager.addRecipe(TYPE, new AlloyingRecipe(id, group, primaryInput, secondaryInput, output, experience, smeltTime));
+ }
+ }
+
+ public static class Serializer implements RecipeSerializer {
+ @Override
+ public AlloyingRecipe read(Identifier id, JsonObject json) {
+ JsonArray ingredients = JsonHelper.getArray(json, "ingredients");
+ Ingredient primaryInput = Ingredient.fromJson(ingredients.get(0));
+ Ingredient secondaryInput = Ingredient.fromJson(ingredients.get(1));
+ String resultStr = JsonHelper.getString(json, "result");
+ String group = JsonHelper.getString(json, "group", "");
+ Identifier resultId = new Identifier(resultStr);
+ ItemStack output = new ItemStack(Registry.ITEM.getOrEmpty(resultId).orElseThrow(() -> {
+ return new IllegalStateException("Item: " + resultStr + " does not exists!");
+ }));
+ float experience = JsonHelper.getFloat(json, "experience", 0.0F);
+ int smeltTime = JsonHelper.getInt(json, "smelttime", 350);
+
+ return new AlloyingRecipe(id, group, primaryInput, secondaryInput, output, experience, smeltTime);
+ }
+
+ @Override
+ public AlloyingRecipe read(Identifier id, PacketByteBuf packetBuffer) {
+ String group = packetBuffer.readString(32767);
+ Ingredient primary = Ingredient.fromPacket(packetBuffer);
+ Ingredient secondary = Ingredient.fromPacket(packetBuffer);
+ ItemStack output = packetBuffer.readItemStack();
+ float experience = packetBuffer.readFloat();
+ int smeltTime = packetBuffer.readVarInt();
+
+ return new AlloyingRecipe(id, group, primary, secondary, output, experience, smeltTime);
+ }
+
+ @Override
+ public void write(PacketByteBuf packetBuffer, AlloyingRecipe recipe) {
+ packetBuffer.writeString(recipe.group);
+ recipe.primaryInput.write(packetBuffer);
+ recipe.secondaryInput.write(packetBuffer);
+ packetBuffer.writeItemStack(recipe.output);
+ packetBuffer.writeFloat(recipe.experience);
+ packetBuffer.writeVarInt(recipe.smeltTime);
+ }
+ }
+}
diff --git a/src/main/java/ru/betterend/recipe/builders/AnvilSmithingRecipe.java b/src/main/java/ru/betterend/recipe/builders/AnvilSmithingRecipe.java
index cafe68c4..6620d5bd 100644
--- a/src/main/java/ru/betterend/recipe/builders/AnvilSmithingRecipe.java
+++ b/src/main/java/ru/betterend/recipe/builders/AnvilSmithingRecipe.java
@@ -1,241 +1,241 @@
-package ru.betterend.recipe.builders;
-
-import com.google.gson.JsonObject;
-
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import net.minecraft.entity.player.PlayerEntity;
-import net.minecraft.inventory.Inventory;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemConvertible;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.ToolItem;
-import net.minecraft.network.PacketByteBuf;
-import net.minecraft.recipe.Ingredient;
-import net.minecraft.recipe.Recipe;
-import net.minecraft.recipe.RecipeSerializer;
-import net.minecraft.recipe.RecipeType;
-import net.minecraft.tag.Tag;
-import net.minecraft.util.Identifier;
-import net.minecraft.util.JsonHelper;
-import net.minecraft.util.collection.DefaultedList;
-import net.minecraft.util.registry.Registry;
-import net.minecraft.world.World;
-import ru.betterend.BetterEnd;
-import ru.betterend.recipe.EndRecipeManager;
-import ru.betterend.registry.EndTags;
-import ru.betterend.util.RecipeHelper;
-
-public class AnvilSmithingRecipe implements Recipe {
-
- public final static String GROUP = "smithing";
- public final static RecipeType TYPE = EndRecipeManager.registerType(GROUP);
- public final static Serializer SERIALIZER = EndRecipeManager.registerSerializer(GROUP, new Serializer());
- public final static Identifier ID = BetterEnd.makeID(GROUP);
-
- private final Identifier id;
- private final Ingredient input;
- private final ItemStack output;
- private final int damage;
- private final int level;
-
- public AnvilSmithingRecipe(Identifier identifier, Ingredient input, ItemStack output, int level, int damage) {
- this.id = identifier;
- this.input = input;
- this.output = output;
- this.level = level;
- this.damage = damage;
- }
-
- @Override
- public RecipeSerializer> getSerializer() {
- return SERIALIZER;
- }
-
- @Override
- public ItemStack getOutput() {
- return this.output;
- }
-
- @Override
- public boolean matches(Inventory craftingInventory, World world) {
- return this.matches(craftingInventory);
- }
-
- @Override
- public ItemStack craft(Inventory craftingInventory) {
- return this.output.copy();
- }
-
- public ItemStack craft(Inventory craftingInventory, PlayerEntity player) {
- if (!player.isCreative()) {
- ItemStack hammer = craftingInventory.getStack(0);
- int damage = hammer.getDamage() + this.damage;
- if (damage >= hammer.getMaxDamage()) return ItemStack.EMPTY;
- hammer.damage(this.damage, player, entity -> {
- entity.sendEquipmentBreakStatus(null);
- });
- }
- return this.craft(craftingInventory);
- }
-
- public boolean matches(Inventory craftingInventory) {
- ItemStack hammer = craftingInventory.getStack(0);
- if (hammer.isEmpty() || !EndTags.HAMMERS.contains(hammer.getItem())) {
- return false;
- }
- int level = ((ToolItem) hammer.getItem()).getMaterial().getMiningLevel();
- return level >= this.level && this.input.test(craftingInventory.getStack(1));
- }
-
- public int getDamage() {
- return this.damage;
- }
-
- @Override
- public DefaultedList getPreviewInputs() {
- DefaultedList defaultedList = DefaultedList.of();
- defaultedList.add(Ingredient.ofStacks(EndTags.HAMMERS.values().stream().filter(hammer -> {
- return ((ToolItem) hammer).getMaterial().getMiningLevel() >= level;
- }).map(ItemStack::new)));
- defaultedList.add(input);
-
- return defaultedList;
- }
-
- @Override
- @Environment(EnvType.CLIENT)
- public boolean fits(int width, int height) {
- return true;
- }
-
- @Override
- public Identifier getId() {
- return this.id;
- }
-
- @Override
- public RecipeType> getType() {
- return TYPE;
- }
-
- @Override
- public boolean isIgnoredInRecipeBook() {
- return true;
- }
-
- public static class Builder {
- private final static Builder INSTANCE = new Builder();
-
- public static Builder create(String id) {
- return create(BetterEnd.makeID(id));
- }
-
- public static Builder create(Identifier id) {
- INSTANCE.id = id;
- INSTANCE.input = null;
- INSTANCE.output = null;
- INSTANCE.level = 1;
- INSTANCE.damage = 1;
-
- return INSTANCE;
- }
-
- private Identifier id;
- private Ingredient input;
- private ItemStack output;
- private int level = 1;
- private int damage = 1;
- private boolean alright = true;
-
- private Builder() {}
-
- public Builder setInput(ItemConvertible... inputItems) {
- for (ItemConvertible item : inputItems) {
- this.alright &= RecipeHelper.exists(item);
- }
- this.setInput(Ingredient.ofItems(inputItems));
- return this;
- }
-
- public Builder setInput(Tag
- inputTag) {
- this.setInput(Ingredient.fromTag(inputTag));
- return this;
- }
-
- public Builder setInput(Ingredient ingredient) {
- this.input = ingredient;
- return this;
- }
-
- public Builder setOutput(ItemConvertible output, int amount) {
- this.alright &= RecipeHelper.exists(output);
- this.output = new ItemStack(output, amount);
- return this;
- }
-
- public Builder setLevel(int level) {
- this.level = level;
- return this;
- }
-
- public Builder setDamage(int damage) {
- this.damage = damage;
- return this;
- }
-
- public void build() {
- if (input == null) {
- BetterEnd.LOGGER.warning("Input for Smithing recipe can't be 'null', recipe {} will be ignored!", id);
- return;
- }
- if(output == null) {
- BetterEnd.LOGGER.warning("Output for Smithing recipe can't be 'null', recipe {} will be ignored!", id);
- return;
- }
- if (EndRecipeManager.getRecipe(TYPE, id) != null) {
- BetterEnd.LOGGER.warning("Can't add Smithing recipe! Id {} already exists!", id);
- return;
- }
- if (!alright) {
- BetterEnd.LOGGER.debug("Can't add Smithing recipe {}! Ingeredient or output not exists.", id);
- return;
- }
- EndRecipeManager.addRecipe(TYPE, new AnvilSmithingRecipe(id, input, output, level, damage));
- }
- }
-
- public static class Serializer implements RecipeSerializer {
- @Override
- public AnvilSmithingRecipe read(Identifier id, JsonObject json) {
- Ingredient input = Ingredient.fromJson(JsonHelper.getObject(json, "input"));
- String resultStr = JsonHelper.getString(json, "result");
- Identifier resultId = new Identifier(resultStr);
- ItemStack output = new ItemStack(Registry.ITEM.getOrEmpty(resultId).orElseThrow(() -> {
- return new IllegalStateException("Item: " + resultStr + " does not exists!");
- }));
- int level = JsonHelper.getInt(json, "level", 1);
- int damage = JsonHelper.getInt(json, "damage", 1);
-
- return new AnvilSmithingRecipe(id, input, output, level, damage);
- }
-
- @Override
- public AnvilSmithingRecipe read(Identifier id, PacketByteBuf packetBuffer) {
- Ingredient input = Ingredient.fromPacket(packetBuffer);
- ItemStack output = packetBuffer.readItemStack();
- int level = packetBuffer.readVarInt();
- int damage = packetBuffer.readVarInt();
-
- return new AnvilSmithingRecipe(id, input, output, level, damage);
- }
-
- @Override
- public void write(PacketByteBuf packetBuffer, AnvilSmithingRecipe recipe) {
- recipe.input.write(packetBuffer);
- packetBuffer.writeItemStack(recipe.output);
- packetBuffer.writeVarInt(recipe.level);
- packetBuffer.writeVarInt(recipe.damage);
- }
- }
-}
+package ru.betterend.recipe.builders;
+
+import com.google.gson.JsonObject;
+
+import net.fabricmc.api.EnvType;
+import net.fabricmc.api.Environment;
+import net.minecraft.entity.player.PlayerEntity;
+import net.minecraft.inventory.Inventory;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemConvertible;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.ToolItem;
+import net.minecraft.network.PacketByteBuf;
+import net.minecraft.recipe.Ingredient;
+import net.minecraft.recipe.Recipe;
+import net.minecraft.recipe.RecipeSerializer;
+import net.minecraft.recipe.RecipeType;
+import net.minecraft.tag.Tag;
+import net.minecraft.util.Identifier;
+import net.minecraft.util.JsonHelper;
+import net.minecraft.util.collection.DefaultedList;
+import net.minecraft.util.registry.Registry;
+import net.minecraft.world.World;
+import ru.betterend.BetterEnd;
+import ru.betterend.recipe.EndRecipeManager;
+import ru.betterend.registry.EndTags;
+import ru.betterend.util.RecipeHelper;
+
+public class AnvilSmithingRecipe implements Recipe {
+
+ public final static String GROUP = "smithing";
+ public final static RecipeType TYPE = EndRecipeManager.registerType(GROUP);
+ public final static Serializer SERIALIZER = EndRecipeManager.registerSerializer(GROUP, new Serializer());
+ public final static Identifier ID = BetterEnd.makeID(GROUP);
+
+ private final Identifier id;
+ private final Ingredient input;
+ private final ItemStack output;
+ private final int damage;
+ private final int level;
+
+ public AnvilSmithingRecipe(Identifier identifier, Ingredient input, ItemStack output, int level, int damage) {
+ this.id = identifier;
+ this.input = input;
+ this.output = output;
+ this.level = level;
+ this.damage = damage;
+ }
+
+ @Override
+ public RecipeSerializer> getSerializer() {
+ return SERIALIZER;
+ }
+
+ @Override
+ public ItemStack getOutput() {
+ return this.output;
+ }
+
+ @Override
+ public boolean matches(Inventory craftingInventory, World world) {
+ return this.matches(craftingInventory);
+ }
+
+ @Override
+ public ItemStack craft(Inventory craftingInventory) {
+ return this.output.copy();
+ }
+
+ public ItemStack craft(Inventory craftingInventory, PlayerEntity player) {
+ if (!player.isCreative()) {
+ ItemStack hammer = craftingInventory.getStack(0);
+ int damage = hammer.getDamage() + this.damage;
+ if (damage >= hammer.getMaxDamage()) return ItemStack.EMPTY;
+ hammer.damage(this.damage, player, entity -> {
+ entity.sendEquipmentBreakStatus(null);
+ });
+ }
+ return this.craft(craftingInventory);
+ }
+
+ public boolean matches(Inventory craftingInventory) {
+ ItemStack hammer = craftingInventory.getStack(0);
+ if (hammer.isEmpty() || !EndTags.HAMMERS.contains(hammer.getItem())) {
+ return false;
+ }
+ int level = ((ToolItem) hammer.getItem()).getMaterial().getMiningLevel();
+ return level >= this.level && this.input.test(craftingInventory.getStack(1));
+ }
+
+ public int getDamage() {
+ return this.damage;
+ }
+
+ @Override
+ public DefaultedList getPreviewInputs() {
+ DefaultedList defaultedList = DefaultedList.of();
+ defaultedList.add(Ingredient.ofStacks(EndTags.HAMMERS.values().stream().filter(hammer -> {
+ return ((ToolItem) hammer).getMaterial().getMiningLevel() >= level;
+ }).map(ItemStack::new)));
+ defaultedList.add(input);
+
+ return defaultedList;
+ }
+
+ @Override
+ @Environment(EnvType.CLIENT)
+ public boolean fits(int width, int height) {
+ return true;
+ }
+
+ @Override
+ public Identifier getId() {
+ return this.id;
+ }
+
+ @Override
+ public RecipeType> getType() {
+ return TYPE;
+ }
+
+ @Override
+ public boolean isIgnoredInRecipeBook() {
+ return true;
+ }
+
+ public static class Builder {
+ private final static Builder INSTANCE = new Builder();
+
+ public static Builder create(String id) {
+ return create(BetterEnd.makeID(id));
+ }
+
+ public static Builder create(Identifier id) {
+ INSTANCE.id = id;
+ INSTANCE.input = null;
+ INSTANCE.output = null;
+ INSTANCE.level = 1;
+ INSTANCE.damage = 1;
+
+ return INSTANCE;
+ }
+
+ private Identifier id;
+ private Ingredient input;
+ private ItemStack output;
+ private int level = 1;
+ private int damage = 1;
+ private boolean alright = true;
+
+ private Builder() {}
+
+ public Builder setInput(ItemConvertible... inputItems) {
+ for (ItemConvertible item : inputItems) {
+ this.alright &= RecipeHelper.exists(item);
+ }
+ this.setInput(Ingredient.ofItems(inputItems));
+ return this;
+ }
+
+ public Builder setInput(Tag