diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32699571..998e4d32 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v1 with: - java-version: 17 + java-version: 21 - name: Grant execute permission for gradlew run: chmod +x gradlew diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a83abe54..1cf1a9a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v1 with: - java-version: 17 + java-version: 21 - name: Grant execute permission for gradlew run: chmod +x gradlew diff --git a/build.gradle b/build.gradle index afbfc8b9..b00e95e0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,10 @@ plugins { - id 'fabric-loom' version '1.4.+' + id 'fabric-loom' version '1.8.+' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 +sourceCompatibility = JavaVersion.VERSION_21 +targetCompatibility = JavaVersion.VERSION_21 archivesBaseName = project.archives_base_name version = project.mod_version @@ -17,6 +17,10 @@ repositories { maven { url = "https://repo.viaversion.com" } } +loom { + accessWidenerPath = file("src/main/resources/extras.accesswidener") +} + fabricApi { configureDataGeneration { createSourceSet = true @@ -31,10 +35,10 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - modImplementation 'xyz.nucleoid:plasmid:0.5.102-SNAPSHOT+1.20.4' + modImplementation 'xyz.nucleoid:plasmid:0.6.0-SNAPSHOT+1.21.3' //modCompileOnly "com.viaversion:viaversion-api:4.7.0-SNAPSHOT" - modCompileOnly "dev.gegy:player-roles-api:1.6.5" + modCompileOnly "dev.gegy:player-roles-api:1.6.13" } processResources { @@ -47,7 +51,7 @@ processResources { tasks.withType(JavaCompile).configureEach { it.options.encoding = "UTF-8" - it.options.release = 17 + it.options.release = 21 } java { diff --git a/gradle.properties b/gradle.properties index af6465c6..0e0fe63b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,12 +2,12 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties -minecraft_version=1.20.4 -yarn_mappings=1.20.4+build.1 -loader_version=0.15.1 +minecraft_version=1.21.3 +yarn_mappings=1.21.3+build.2 +loader_version=0.16.9 # Dependencies -fabric_version=0.91.1+1.20.4 +fabric_version=0.107.3+1.21.3 # Mod Properties mod_version=1.3.2 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c0..a4b76b95 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e411586a..df97d72b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 4f906e0c..f5feea6d 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,69 +15,104 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # 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 +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac 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"' +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +122,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,88 +133,120 @@ 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. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + 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 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 +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac 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 +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For 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 +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # 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\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg 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" +# 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"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 107acd32..9b42019c 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,94 @@ -@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 execute - -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 execute - -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 - -: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 %* - -: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 +@rem SPDX-License-Identifier: Apache-2.0 +@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=. +@rem This is normally unused +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% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +: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 %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 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! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/datagen/java/xyz/nucleoid/extras/data/provider/NEAdvancementProvider.java b/src/datagen/java/xyz/nucleoid/extras/data/provider/NEAdvancementProvider.java index 235a2d60..a9320438 100644 --- a/src/datagen/java/xyz/nucleoid/extras/data/provider/NEAdvancementProvider.java +++ b/src/datagen/java/xyz/nucleoid/extras/data/provider/NEAdvancementProvider.java @@ -1,6 +1,7 @@ package xyz.nucleoid.extras.data.provider; import java.util.Optional; +import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; @@ -12,6 +13,7 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemConvertible; import net.minecraft.registry.Registries; +import net.minecraft.registry.RegistryWrapper; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.text.Text; import net.minecraft.util.Identifier; @@ -25,18 +27,18 @@ import xyz.nucleoid.extras.lobby.criterion.WearTaterCriterion; public class NEAdvancementProvider extends FabricAdvancementProvider { - public NEAdvancementProvider(FabricDataOutput output) { - super(output); + public NEAdvancementProvider(FabricDataOutput output, CompletableFuture registriesFuture) { + super(output, registriesFuture); } @Override - public void generateAdvancement(Consumer consumer) { + public void generateAdvancement(RegistryWrapper.WrapperLookup registries, Consumer consumer) { var root = accept(consumer, "root", null, Advancement.Builder.createUntelemetered() .display( NEItems.NUCLEOID_LOGO, Text.translatable("advancements.nucleoid_extras.root.title"), Text.translatable("advancements.nucleoid_extras.root.description"), - new Identifier("textures/block/lime_concrete.png"), + Identifier.ofVanilla("textures/block/lime_concrete.png"), AdvancementFrame.TASK, false, false, diff --git a/src/main/java/xyz/nucleoid/extras/NucleoidExtras.java b/src/main/java/xyz/nucleoid/extras/NucleoidExtras.java index 6767596e..fcb84395 100644 --- a/src/main/java/xyz/nucleoid/extras/NucleoidExtras.java +++ b/src/main/java/xyz/nucleoid/extras/NucleoidExtras.java @@ -24,6 +24,7 @@ import xyz.nucleoid.extras.integrations.http.NucleoidHttpClient; import xyz.nucleoid.extras.lobby.*; import xyz.nucleoid.extras.lobby.contributor.ContributorData; +import xyz.nucleoid.extras.network.NucleoidExtrasNetworking; import xyz.nucleoid.extras.placeholder.ExtraPlaceholders; import xyz.nucleoid.extras.scheduled_stop.ScheduledStop; import xyz.nucleoid.extras.sidebar.NucleoidSidebar; @@ -59,7 +60,7 @@ public void onInitialize() { ServerTickEvents.END_SERVER_TICK.register(NucleoidExtras::onServerTick); ServerPlayConnectionEvents.JOIN.register(NucleoidExtras::onPlayerJoin); - ServerChangePortalBackend.register(); + NucleoidExtrasNetworking.register(); } private static void onPlayerJoin(ServerPlayNetworkHandler handler, PacketSender sender, MinecraftServer server) { @@ -92,6 +93,6 @@ private static void onServerTick(MinecraftServer server) { } public static Identifier identifier(String path) { - return new Identifier(ID, path); + return Identifier.of(ID, path); } } diff --git a/src/main/java/xyz/nucleoid/extras/RulesConfig.java b/src/main/java/xyz/nucleoid/extras/RulesConfig.java index 9fe7290f..dc4dc54b 100644 --- a/src/main/java/xyz/nucleoid/extras/RulesConfig.java +++ b/src/main/java/xyz/nucleoid/extras/RulesConfig.java @@ -4,7 +4,7 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.text.Text; import xyz.nucleoid.codecs.MoreCodecs; -import xyz.nucleoid.plasmid.util.PlasmidCodecs; +import xyz.nucleoid.plasmid.api.util.PlasmidCodecs; import java.util.List; diff --git a/src/main/java/xyz/nucleoid/extras/chat_filter/ChatFilter.java b/src/main/java/xyz/nucleoid/extras/chat_filter/ChatFilter.java index 75791f3d..e05de2d2 100644 --- a/src/main/java/xyz/nucleoid/extras/chat_filter/ChatFilter.java +++ b/src/main/java/xyz/nucleoid/extras/chat_filter/ChatFilter.java @@ -1,9 +1,8 @@ package xyz.nucleoid.extras.chat_filter; -import net.minecraft.util.ActionResult; - import xyz.nucleoid.extras.NucleoidExtrasConfig; import xyz.nucleoid.stimuli.Stimuli; +import xyz.nucleoid.stimuli.event.EventResult; import xyz.nucleoid.stimuli.event.player.PlayerChatEvent; public final class ChatFilter { @@ -16,9 +15,9 @@ public static void register() { Stimuli.global().listen(PlayerChatEvent.EVENT, (player, message, parameters) -> { if (config.test(message.getContent().getString())) { config.sendFeedbackTo(player); - return ActionResult.FAIL; + return EventResult.DENY; } - return ActionResult.PASS; + return EventResult.PASS; }); } } diff --git a/src/main/java/xyz/nucleoid/extras/chat_filter/ChatFilterConfig.java b/src/main/java/xyz/nucleoid/extras/chat_filter/ChatFilterConfig.java index c6c1ac3a..8db3dee5 100644 --- a/src/main/java/xyz/nucleoid/extras/chat_filter/ChatFilterConfig.java +++ b/src/main/java/xyz/nucleoid/extras/chat_filter/ChatFilterConfig.java @@ -14,8 +14,9 @@ import net.minecraft.text.Text; import net.minecraft.text.Texts; import net.minecraft.util.Formatting; +import xyz.nucleoid.plasmid.api.util.PlasmidCodecs; + import org.jetbrains.annotations.Nullable; -import xyz.nucleoid.plasmid.util.PlasmidCodecs; import java.util.List; import java.util.Locale; @@ -30,7 +31,7 @@ public final class ChatFilterConfig { WORD_SET_CODEC.optionalFieldOf("illegal_words", Set.of()).forGetter(c -> c.illegalWords), WORD_CODEC.listOf().optionalFieldOf("contains_illegal_text", List.of()).forGetter(c -> c.containsIllegalText), PlasmidCodecs.TEXT.optionalFieldOf("feedback_message").forGetter(c -> Optional.ofNullable(c.feedbackMessage)), - Registries.SOUND_EVENT.createEntryCodec().optionalFieldOf("feedback_sound").forGetter(c -> Optional.ofNullable(c.feedbackSound)) + Registries.SOUND_EVENT.getEntryCodec().optionalFieldOf("feedback_sound").forGetter(c -> Optional.ofNullable(c.feedbackSound)) ).apply(i, ChatFilterConfig::new)); private static final Splitter WORD_SPLITTER = Splitter.onPattern("\\W"); diff --git a/src/main/java/xyz/nucleoid/extras/command/StatsCommand.java b/src/main/java/xyz/nucleoid/extras/command/StatsCommand.java index 43dc1432..81a22170 100644 --- a/src/main/java/xyz/nucleoid/extras/command/StatsCommand.java +++ b/src/main/java/xyz/nucleoid/extras/command/StatsCommand.java @@ -18,7 +18,7 @@ import xyz.nucleoid.extras.integrations.http.NucleoidHttpClient; import xyz.nucleoid.extras.util.CommonGuiElements; import xyz.nucleoid.extras.util.PagedGui; -import xyz.nucleoid.plasmid.game.stats.GameStatisticBundle; +import xyz.nucleoid.plasmid.api.game.stats.GameStatisticBundle; import java.util.ArrayList; import java.util.Comparator; @@ -65,7 +65,7 @@ private static void openMain(Map> stats, ServerP var list = new ArrayList(); for (var entry : stats.entrySet()) { var builder = new GuiElementBuilder(Items.PAPER); - builder.setName(Text.translatable(GameStatisticBundle.getTranslationKey(entry.getKey()))); + builder.setItemName(Text.translatable(GameStatisticBundle.getTranslationKey(entry.getKey()))).hideDefaultTooltip(); builder.setCallback((a, b, c, d) -> { PagedGui.playClickSound(player); openTargetStats(entry.getKey(), entry.getValue(), player); @@ -83,7 +83,7 @@ private static void openTargetStats(String key, Map value, S var list = new ArrayList(); for (var entry : value.entrySet()) { var builder = new GuiElementBuilder(Items.NAME_TAG); - builder.setName(Text.empty().append(Util.createTranslationKey("statistic", entry.getKey())).append(": ").append(StatisticsIntegration.convertForDisplay(entry.getKey(), entry.getValue()))); + builder.setItemName(Text.empty().append(Util.createTranslationKey("statistic", entry.getKey())).append(": ").append(StatisticsIntegration.convertForDisplay(entry.getKey(), entry.getValue()))).hideDefaultTooltip(); list.add(builder.build()); } list.sort(Comparator.comparing(x -> x.getItemStack().getName().getString())); diff --git a/src/main/java/xyz/nucleoid/extras/component/GamePortalComponent.java b/src/main/java/xyz/nucleoid/extras/component/GamePortalComponent.java new file mode 100644 index 00000000..c46b31d8 --- /dev/null +++ b/src/main/java/xyz/nucleoid/extras/component/GamePortalComponent.java @@ -0,0 +1,20 @@ +package xyz.nucleoid.extras.component; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import eu.pb4.polymer.core.api.other.PolymerComponent; +import net.minecraft.util.Identifier; +import xyz.nucleoid.plasmid.impl.portal.GamePortal; +import xyz.nucleoid.plasmid.impl.portal.GamePortalManager; + +public record GamePortalComponent(Identifier gamePortalId) implements PolymerComponent { + public static final Codec CODEC = RecordCodecBuilder.create(instance -> + instance.group( + Identifier.CODEC.fieldOf("game_portal_id").forGetter(GamePortalComponent::gamePortalId) + ).apply(instance, GamePortalComponent::new) + ); + + public GamePortal getGamePortal() { + return GamePortalManager.INSTANCE.byId(this.gamePortalId); + } +} diff --git a/src/main/java/xyz/nucleoid/extras/component/LauncherComponent.java b/src/main/java/xyz/nucleoid/extras/component/LauncherComponent.java new file mode 100644 index 00000000..5fe018fe --- /dev/null +++ b/src/main/java/xyz/nucleoid/extras/component/LauncherComponent.java @@ -0,0 +1,16 @@ +package xyz.nucleoid.extras.component; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import eu.pb4.polymer.core.api.other.PolymerComponent; + +public record LauncherComponent(float pitch, float power) implements PolymerComponent { + public static final LauncherComponent DEFAULT = new LauncherComponent(10, 4); + + public static final Codec CODEC = RecordCodecBuilder.create(instance -> + instance.group( + Codec.FLOAT.optionalFieldOf("pitch", DEFAULT.pitch).forGetter(LauncherComponent::pitch), + Codec.FLOAT.optionalFieldOf("power", DEFAULT.power).forGetter(LauncherComponent::power) + ).apply(instance, LauncherComponent::new) + ); +} diff --git a/src/main/java/xyz/nucleoid/extras/component/NEDataComponentTypes.java b/src/main/java/xyz/nucleoid/extras/component/NEDataComponentTypes.java new file mode 100644 index 00000000..944668c4 --- /dev/null +++ b/src/main/java/xyz/nucleoid/extras/component/NEDataComponentTypes.java @@ -0,0 +1,43 @@ +package xyz.nucleoid.extras.component; + +import eu.pb4.polymer.core.api.other.PolymerComponent; +import net.minecraft.component.ComponentType; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import xyz.nucleoid.extras.NucleoidExtras; + +public final class NEDataComponentTypes { + private NEDataComponentTypes() { + } + + public static final ComponentType LAUNCHER = register("launcher", ComponentType.builder() + .codec(LauncherComponent.CODEC) + .cache() + .build()); + + public static final ComponentType GAME_PORTAL = register("game_portal", ComponentType.builder() + .codec(GamePortalComponent.CODEC) + .cache() + .build()); + + public static final ComponentType TATER_POSITIONS = register("tater_positions", ComponentType.builder() + .codec(TaterPositionsComponent.CODEC) + .cache() + .build()); + + public static final ComponentType TATER_SELECTION = register("tater_selection", ComponentType.builder() + .codec(TaterSelectionComponent.CODEC) + .cache() + .build()); + + private static ComponentType register(String path, ComponentType type) { + return Registry.register(Registries.DATA_COMPONENT_TYPE, NucleoidExtras.identifier(path), type); + } + + public static void register() { + PolymerComponent.registerDataComponent(LAUNCHER); + PolymerComponent.registerDataComponent(GAME_PORTAL); + PolymerComponent.registerDataComponent(TATER_POSITIONS); + PolymerComponent.registerDataComponent(TATER_SELECTION); + } +} diff --git a/src/main/java/xyz/nucleoid/extras/component/TaterPositionsComponent.java b/src/main/java/xyz/nucleoid/extras/component/TaterPositionsComponent.java new file mode 100644 index 00000000..3e18b4fd --- /dev/null +++ b/src/main/java/xyz/nucleoid/extras/component/TaterPositionsComponent.java @@ -0,0 +1,48 @@ +package xyz.nucleoid.extras.component; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSetMultimap; +import com.google.common.collect.SetMultimap; +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import eu.pb4.polymer.core.api.other.PolymerComponent; +import net.minecraft.item.Item; +import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.util.math.BlockPos; + +import java.util.List; +import java.util.Map; + +public record TaterPositionsComponent(SetMultimap, BlockPos> positions) implements PolymerComponent { + private static final Codec, List>> MAP_CODEC = Codec.unboundedMap(Registries.ITEM.getEntryCodec(), BlockPos.CODEC.listOf()); + private static final Codec, BlockPos>> MULTIMAP_CODEC = MAP_CODEC.xmap(TaterPositionsComponent::toMultimap, TaterPositionsComponent::toMap); + + public static final TaterPositionsComponent DEFAULT = new TaterPositionsComponent(ImmutableSetMultimap.of()); + + public static final Codec CODEC = RecordCodecBuilder.create(instance -> + instance.group( + MULTIMAP_CODEC.optionalFieldOf("positions", DEFAULT.positions).forGetter(TaterPositionsComponent::positions) + ).apply(instance, TaterPositionsComponent::new) + ); + + private static SetMultimap toMultimap(Map> map) { + var multimap = ImmutableSetMultimap.builder(); + + for (var entry : map.entrySet()) { + multimap.putAll(entry.getKey(), entry.getValue()); + } + + return multimap.build(); + } + + private static Map> toMap(SetMultimap multimap) { + var map = ImmutableMap.>builder(); + + for (var entry : multimap.asMap().entrySet()) { + map.put(entry.getKey(), List.copyOf(entry.getValue())); + } + + return map.build(); + } +} diff --git a/src/main/java/xyz/nucleoid/extras/component/TaterSelectionComponent.java b/src/main/java/xyz/nucleoid/extras/component/TaterSelectionComponent.java new file mode 100644 index 00000000..2b947c00 --- /dev/null +++ b/src/main/java/xyz/nucleoid/extras/component/TaterSelectionComponent.java @@ -0,0 +1,25 @@ +package xyz.nucleoid.extras.component; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import eu.pb4.polymer.core.api.other.PolymerComponent; +import net.minecraft.block.Block; +import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; + +import java.util.Optional; + +public record TaterSelectionComponent(Optional> tater, boolean allowViralCollection) implements PolymerComponent { + public static final TaterSelectionComponent DEFAULT = new TaterSelectionComponent(Optional.empty(), true); + + public static final Codec CODEC = RecordCodecBuilder.create(instance -> + instance.group( + Registries.BLOCK.getEntryCodec().optionalFieldOf("tater").forGetter(TaterSelectionComponent::tater), + Codec.BOOL.optionalFieldOf("allow_viral_collection", DEFAULT.allowViralCollection).forGetter(TaterSelectionComponent::allowViralCollection) + ).apply(instance, TaterSelectionComponent::new) + ); + + public TaterSelectionComponent selected(RegistryEntry tater) { + return new TaterSelectionComponent(Optional.ofNullable(tater), this.allowViralCollection); + } +} diff --git a/src/main/java/xyz/nucleoid/extras/error/DiscordWebhook.java b/src/main/java/xyz/nucleoid/extras/error/DiscordWebhook.java index b0052289..de9c2368 100644 --- a/src/main/java/xyz/nucleoid/extras/error/DiscordWebhook.java +++ b/src/main/java/xyz/nucleoid/extras/error/DiscordWebhook.java @@ -4,7 +4,7 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import xyz.nucleoid.plasmid.Plasmid; +import xyz.nucleoid.plasmid.impl.Plasmid; import javax.net.ssl.HttpsURLConnection; import java.io.IOException; diff --git a/src/main/java/xyz/nucleoid/extras/error/ExtrasErrorReporter.java b/src/main/java/xyz/nucleoid/extras/error/ExtrasErrorReporter.java index ed420a11..f0ed55f4 100644 --- a/src/main/java/xyz/nucleoid/extras/error/ExtrasErrorReporter.java +++ b/src/main/java/xyz/nucleoid/extras/error/ExtrasErrorReporter.java @@ -1,14 +1,16 @@ package xyz.nucleoid.extras.error; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.crash.CrashReport; +import net.minecraft.util.crash.ReportType; import org.jetbrains.annotations.Nullable; import xyz.nucleoid.extras.NucleoidExtrasConfig; -import xyz.nucleoid.plasmid.event.GameEvents; -import xyz.nucleoid.plasmid.game.GameCloseReason; -import xyz.nucleoid.plasmid.game.GameLifecycle; -import xyz.nucleoid.plasmid.game.GameSpace; -import xyz.nucleoid.plasmid.game.config.GameConfig; +import xyz.nucleoid.plasmid.api.event.GameEvents; +import xyz.nucleoid.plasmid.api.game.GameCloseReason; +import xyz.nucleoid.plasmid.api.game.GameLifecycle; +import xyz.nucleoid.plasmid.api.game.GameSpace; +import xyz.nucleoid.plasmid.api.game.config.GameConfig; import java.io.IOException; import java.io.PrintWriter; @@ -49,16 +51,16 @@ public void onClosed(GameSpace gameSpace, List players, Game }); } - private static String sourceName(GameConfig game) { - var name = game.name().getString(); - return name + " (" + game.source() + ")"; + private static String sourceName(RegistryEntry> game) { + var name = game.value().name().getString(); + return name + " (" + GameConfig.sourceName(game) + ")"; } public static void onServerCrash(CrashReport report) { var webhook = openWebhook(); if (webhook != null) { var message = new DiscordWebhook.Message("The server has crashed!"); - message.addFile("report.txt", report.asString()); + message.addFile("report.txt", report.asString(ReportType.MINECRAFT_CRASH_REPORT)); webhook.post(message); } } diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/AdvancedStyledMenuPortalBackend.java b/src/main/java/xyz/nucleoid/extras/game_portal/AdvancedStyledMenuPortalBackend.java index 94ca61b7..6727adeb 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/AdvancedStyledMenuPortalBackend.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/AdvancedStyledMenuPortalBackend.java @@ -2,8 +2,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.text.Text; -import xyz.nucleoid.plasmid.game.portal.menu.MenuEntry; -import xyz.nucleoid.plasmid.game.portal.menu.MenuEntryConfig; +import xyz.nucleoid.plasmid.impl.portal.menu.MenuEntry; +import xyz.nucleoid.plasmid.impl.portal.menu.MenuEntryConfig; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/AdvancedStyledMenuPortalConfig.java b/src/main/java/xyz/nucleoid/extras/game_portal/AdvancedStyledMenuPortalConfig.java index e8e3055c..701ef704 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/AdvancedStyledMenuPortalConfig.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/AdvancedStyledMenuPortalConfig.java @@ -1,6 +1,6 @@ package xyz.nucleoid.extras.game_portal; -import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -9,11 +9,11 @@ import net.minecraft.text.Text; import net.minecraft.util.Identifier; import xyz.nucleoid.codecs.MoreCodecs; -import xyz.nucleoid.plasmid.game.config.CustomValuesConfig; -import xyz.nucleoid.plasmid.game.portal.GamePortalBackend; -import xyz.nucleoid.plasmid.game.portal.GamePortalConfig; -import xyz.nucleoid.plasmid.game.portal.menu.MenuEntryConfig; -import xyz.nucleoid.plasmid.util.PlasmidCodecs; +import xyz.nucleoid.plasmid.api.game.config.CustomValuesConfig; +import xyz.nucleoid.plasmid.api.util.PlasmidCodecs; +import xyz.nucleoid.plasmid.impl.portal.GamePortalBackend; +import xyz.nucleoid.plasmid.impl.portal.GamePortalConfig; +import xyz.nucleoid.plasmid.impl.portal.menu.MenuEntryConfig; import java.util.Collections; import java.util.List; @@ -28,7 +28,7 @@ public record AdvancedStyledMenuPortalConfig( CustomValuesConfig custom ) implements GamePortalConfig { - public static final Codec CODEC = RecordCodecBuilder.create(instance -> { + public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> { return instance.group( PlasmidCodecs.TEXT.optionalFieldOf("name", ScreenTexts.EMPTY).forGetter(AdvancedStyledMenuPortalConfig::name), PlasmidCodecs.TEXT.optionalFieldOf("ui_title").forGetter(AdvancedStyledMenuPortalConfig::uiTitle), @@ -52,7 +52,7 @@ public GamePortalBackend createBackend(MinecraftServer server, Identifier id) { } @Override - public Codec codec() { + public MapCodec codec() { return CODEC; } } diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/ExtrasGamePortals.java b/src/main/java/xyz/nucleoid/extras/game_portal/ExtrasGamePortals.java index 2591979a..5845c085 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/ExtrasGamePortals.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/ExtrasGamePortals.java @@ -2,7 +2,7 @@ import net.fabricmc.loader.api.FabricLoader; import xyz.nucleoid.extras.NucleoidExtras; -import xyz.nucleoid.plasmid.game.portal.GamePortalConfig; +import xyz.nucleoid.plasmid.impl.portal.GamePortalConfig; public class ExtrasGamePortals { public static final boolean SHOW_INVALID = false && FabricLoader.getInstance().isDevelopmentEnvironment(); diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/HandmadeStyledMenuPortalBackend.java b/src/main/java/xyz/nucleoid/extras/game_portal/HandmadeStyledMenuPortalBackend.java index f716e17c..95e94518 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/HandmadeStyledMenuPortalBackend.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/HandmadeStyledMenuPortalBackend.java @@ -5,8 +5,8 @@ import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.Text; import org.apache.commons.lang3.mutable.MutableInt; -import xyz.nucleoid.plasmid.game.portal.menu.MenuEntry; -import xyz.nucleoid.plasmid.game.portal.menu.MenuEntryConfig; +import xyz.nucleoid.plasmid.impl.portal.menu.MenuEntry; +import xyz.nucleoid.plasmid.impl.portal.menu.MenuEntryConfig; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/HandmadeStyledMenuPortalConfig.java b/src/main/java/xyz/nucleoid/extras/game_portal/HandmadeStyledMenuPortalConfig.java index f0359398..02a0052f 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/HandmadeStyledMenuPortalConfig.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/HandmadeStyledMenuPortalConfig.java @@ -1,6 +1,7 @@ package xyz.nucleoid.extras.game_portal; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -9,11 +10,11 @@ import net.minecraft.text.Text; import net.minecraft.util.Identifier; import xyz.nucleoid.codecs.MoreCodecs; -import xyz.nucleoid.plasmid.game.config.CustomValuesConfig; -import xyz.nucleoid.plasmid.game.portal.GamePortalBackend; -import xyz.nucleoid.plasmid.game.portal.GamePortalConfig; -import xyz.nucleoid.plasmid.game.portal.menu.MenuEntryConfig; -import xyz.nucleoid.plasmid.util.PlasmidCodecs; +import xyz.nucleoid.plasmid.api.game.config.CustomValuesConfig; +import xyz.nucleoid.plasmid.api.util.PlasmidCodecs; +import xyz.nucleoid.plasmid.impl.portal.GamePortalBackend; +import xyz.nucleoid.plasmid.impl.portal.GamePortalConfig; +import xyz.nucleoid.plasmid.impl.portal.menu.MenuEntryConfig; import java.util.Collections; import java.util.List; @@ -29,7 +30,7 @@ public record HandmadeStyledMenuPortalConfig( CustomValuesConfig custom ) implements GamePortalConfig { - public static final Codec CODEC = RecordCodecBuilder.create(instance -> { + public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> { return instance.group( PlasmidCodecs.TEXT.optionalFieldOf("name", ScreenTexts.EMPTY).forGetter(HandmadeStyledMenuPortalConfig::name), PlasmidCodecs.TEXT.optionalFieldOf("ui_title").forGetter(HandmadeStyledMenuPortalConfig::uiTitle), @@ -53,7 +54,7 @@ public GamePortalBackend createBackend(MinecraftServer server, Identifier id) { } @Override - public Codec codec() { + public MapCodec codec() { return CODEC; } diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/ServerChangePortalBackend.java b/src/main/java/xyz/nucleoid/extras/game_portal/ServerChangePortalBackend.java index 08ccdb4f..c6cc680d 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/ServerChangePortalBackend.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/ServerChangePortalBackend.java @@ -1,24 +1,21 @@ package xyz.nucleoid.extras.game_portal; import com.google.common.io.ByteStreams; +import io.netty.buffer.ByteBuf; import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; -import net.fabricmc.fabric.api.networking.v1.PacketSender; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import net.minecraft.item.ItemStack; -import net.minecraft.network.PacketByteBuf; import net.minecraft.server.MinecraftServer; -import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; -import net.minecraft.util.Identifier; import net.minecraft.util.math.random.Random; -import xyz.nucleoid.plasmid.game.GameSpace; -import xyz.nucleoid.plasmid.game.portal.GamePortalBackend; -import xyz.nucleoid.plasmid.game.portal.GamePortalDisplay; +import xyz.nucleoid.extras.network.BungeeCordPayload; +import xyz.nucleoid.plasmid.api.game.GameSpace; +import xyz.nucleoid.plasmid.impl.portal.GamePortalBackend; +import xyz.nucleoid.plasmid.impl.portal.GamePortalDisplay; -import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import java.io.InputStream; @@ -29,8 +26,6 @@ import java.util.function.Consumer; public final class ServerChangePortalBackend implements GamePortalBackend { - private static final Identifier PACKET_ID = new Identifier("bungeecord", "main"); - public static final Map> ID_TO_PORTAL = new HashMap<>(); private final ItemStack icon; @@ -73,15 +68,13 @@ public static void tick(MinecraftServer server) { var out = PacketByteBufs.create(); out.writeBytes(buf.toByteArray()); - random.networkHandler.sendPacket(ServerPlayNetworking.createS2CPacket(PACKET_ID, out)); + ServerPlayNetworking.send(random, new BungeeCordPayload(out)); } } - public static void register() { - ServerPlayNetworking.registerGlobalReceiver(PACKET_ID, ServerChangePortalBackend::handlePacket); - } + public static void handlePacket(BungeeCordPayload payload, ServerPlayNetworking.Context context) { + ByteBuf buf = payload.data(); - private static void handlePacket(MinecraftServer server, ServerPlayerEntity player, ServerPlayNetworkHandler handler, PacketByteBuf buf, PacketSender packetSender) { try { var out = new DataInputStream(new InputStream() { @Override @@ -96,7 +89,7 @@ public int read() throws IOException { var serverId = out.readUTF(); var count = out.readInt(); - server.execute(() -> { + context.server().execute(() -> { var x = ID_TO_PORTAL.get(serverId); if (x != null) { @@ -159,7 +152,7 @@ public void populateDisplay(GamePortalDisplay display) { } @Override - public void applyTo(ServerPlayerEntity player) { + public void applyTo(ServerPlayerEntity player, boolean alt) { var buf = ByteStreams.newDataOutput(); buf.writeUTF("Connect"); buf.writeUTF(this.serverId); @@ -167,6 +160,6 @@ public void applyTo(ServerPlayerEntity player) { var out = PacketByteBufs.create(); out.writeBytes(buf.toByteArray()); - player.networkHandler.sendPacket(ServerPlayNetworking.createS2CPacket(PACKET_ID, out)); + ServerPlayNetworking.send(player, new BungeeCordPayload(out)); } } diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/ServerChangePortalConfig.java b/src/main/java/xyz/nucleoid/extras/game_portal/ServerChangePortalConfig.java index 83935c41..509c04fc 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/ServerChangePortalConfig.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/ServerChangePortalConfig.java @@ -1,6 +1,7 @@ package xyz.nucleoid.extras.game_portal; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -9,10 +10,10 @@ import net.minecraft.text.Text; import net.minecraft.util.Identifier; import xyz.nucleoid.codecs.MoreCodecs; -import xyz.nucleoid.plasmid.game.config.CustomValuesConfig; -import xyz.nucleoid.plasmid.game.portal.GamePortalBackend; -import xyz.nucleoid.plasmid.game.portal.GamePortalConfig; -import xyz.nucleoid.plasmid.util.PlasmidCodecs; +import xyz.nucleoid.plasmid.api.game.config.CustomValuesConfig; +import xyz.nucleoid.plasmid.api.util.PlasmidCodecs; +import xyz.nucleoid.plasmid.impl.portal.GamePortalBackend; +import xyz.nucleoid.plasmid.impl.portal.GamePortalConfig; import java.util.Collections; import java.util.List; @@ -25,7 +26,7 @@ public record ServerChangePortalConfig( CustomValuesConfig custom ) implements GamePortalConfig { - public static final Codec CODEC = RecordCodecBuilder.create(instance -> { + public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> { return instance.group( PlasmidCodecs.TEXT.optionalFieldOf("name", ScreenTexts.EMPTY).forGetter(ServerChangePortalConfig::name), MoreCodecs.listOrUnit(PlasmidCodecs.TEXT).optionalFieldOf("description", Collections.emptyList()).forGetter(ServerChangePortalConfig::description), @@ -48,7 +49,7 @@ public GamePortalBackend createBackend(MinecraftServer server, Identifier id) { } @Override - public Codec codec() { + public MapCodec codec() { return CODEC; } } diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/SimpleStyledMenuPortalBackend.java b/src/main/java/xyz/nucleoid/extras/game_portal/SimpleStyledMenuPortalBackend.java index cbf69fab..cb2f2f23 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/SimpleStyledMenuPortalBackend.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/SimpleStyledMenuPortalBackend.java @@ -2,9 +2,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.text.Text; -import xyz.nucleoid.plasmid.game.config.GameConfigs; -import xyz.nucleoid.plasmid.game.portal.game.ConcurrentGamePortalBackend; -import xyz.nucleoid.plasmid.game.portal.menu.*; +import xyz.nucleoid.plasmid.impl.portal.game.ConcurrentGamePortalBackend; +import xyz.nucleoid.plasmid.impl.portal.menu.*; import java.util.ArrayList; import java.util.List; @@ -24,7 +23,7 @@ protected List getEntries() { this.entries = new ArrayList<>(this.configEntries.size()); for (var configEntry : configEntries) { var game = new ConcurrentGamePortalBackend(configEntry.game()); - var gameConfig = GameConfigs.get(configEntry.game()); + var gameConfig = configEntry.game().value(); if (gameConfig != null) { this.entries.add(new GameMenuEntry( diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/SimpleStyledMenuPortalConfig.java b/src/main/java/xyz/nucleoid/extras/game_portal/SimpleStyledMenuPortalConfig.java index acd5c35c..cbc6b760 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/SimpleStyledMenuPortalConfig.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/SimpleStyledMenuPortalConfig.java @@ -1,6 +1,6 @@ package xyz.nucleoid.extras.game_portal; -import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; @@ -9,12 +9,11 @@ import net.minecraft.text.Text; import net.minecraft.util.Identifier; import xyz.nucleoid.codecs.MoreCodecs; -import xyz.nucleoid.plasmid.game.config.CustomValuesConfig; -import xyz.nucleoid.plasmid.game.portal.GamePortalBackend; -import xyz.nucleoid.plasmid.game.portal.GamePortalConfig; -import xyz.nucleoid.plasmid.game.portal.menu.MenuEntryConfig; -import xyz.nucleoid.plasmid.game.portal.menu.MenuPortalConfig; -import xyz.nucleoid.plasmid.util.PlasmidCodecs; +import xyz.nucleoid.plasmid.api.game.config.CustomValuesConfig; +import xyz.nucleoid.plasmid.api.util.PlasmidCodecs; +import xyz.nucleoid.plasmid.impl.portal.GamePortalBackend; +import xyz.nucleoid.plasmid.impl.portal.GamePortalConfig; +import xyz.nucleoid.plasmid.impl.portal.menu.MenuPortalConfig; import java.util.Collections; import java.util.List; @@ -29,7 +28,7 @@ public record SimpleStyledMenuPortalConfig( CustomValuesConfig custom ) implements GamePortalConfig { - public static final Codec CODEC = RecordCodecBuilder.create(instance -> { + public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> { return instance.group( PlasmidCodecs.TEXT.optionalFieldOf("name", ScreenTexts.EMPTY).forGetter(SimpleStyledMenuPortalConfig::name), PlasmidCodecs.TEXT.optionalFieldOf("ui_title").forGetter(SimpleStyledMenuPortalConfig::uiTitle), @@ -53,7 +52,7 @@ public GamePortalBackend createBackend(MinecraftServer server, Identifier id) { } @Override - public Codec codec() { + public MapCodec codec() { return CODEC; } } diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/StyledMenuPortalBackend.java b/src/main/java/xyz/nucleoid/extras/game_portal/StyledMenuPortalBackend.java index b9630e41..618ca1ac 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/StyledMenuPortalBackend.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/StyledMenuPortalBackend.java @@ -4,7 +4,7 @@ import eu.pb4.sgui.api.elements.GuiElement; import eu.pb4.sgui.api.elements.GuiElementBuilder; import eu.pb4.sgui.api.gui.SimpleGui; -import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet; +import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.screen.ScreenHandlerType; @@ -13,18 +13,17 @@ import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; -import net.minecraft.util.Util; import net.minecraft.util.math.MathHelper; import org.apache.commons.lang3.mutable.MutableInt; import xyz.nucleoid.extras.util.CommonGuiElements; import xyz.nucleoid.extras.util.PagedGui; -import xyz.nucleoid.plasmid.game.GameSpace; -import xyz.nucleoid.plasmid.game.player.GamePlayerJoiner; -import xyz.nucleoid.plasmid.game.portal.GamePortalBackend; -import xyz.nucleoid.plasmid.game.portal.GamePortalDisplay; -import xyz.nucleoid.plasmid.game.portal.menu.InvalidMenuEntry; -import xyz.nucleoid.plasmid.game.portal.menu.MenuEntry; -import xyz.nucleoid.plasmid.util.IdentityHashStrategy; +import xyz.nucleoid.plasmid.api.game.GameSpace; +import xyz.nucleoid.plasmid.api.game.player.GamePlayerJoiner; +import xyz.nucleoid.plasmid.api.game.player.JoinIntent; +import xyz.nucleoid.plasmid.impl.portal.GamePortalBackend; +import xyz.nucleoid.plasmid.impl.portal.GamePortalDisplay; +import xyz.nucleoid.plasmid.impl.portal.menu.InvalidMenuEntry; +import xyz.nucleoid.plasmid.impl.portal.menu.MenuEntry; import java.util.ArrayList; import java.util.Comparator; @@ -78,7 +77,7 @@ public ItemStack getIcon() { @Override public int getPlayerCount() { int count = 0; - var list = new ObjectOpenCustomHashSet(IdentityHashStrategy.INSTANCE); + var list = new ReferenceOpenHashSet(); provideGameSpaces(list::add); for (var entry : list) { count += Math.max(0, entry.getPlayers().size()); @@ -102,7 +101,7 @@ public void populateDisplay(GamePortalDisplay display) { } @Override - public void applyTo(ServerPlayerEntity player) { + public void applyTo(ServerPlayerEntity player, boolean alt) { var oldGui = GuiHelpers.getCurrentGui(player); var gui = new SimpleGui(ScreenHandlerType.GENERIC_9X6, player, false); @@ -137,11 +136,11 @@ private void fill(ServerPlayerEntity player, SimpleGui gui, boolean viewOpen) { gui.setTitle(this.uiTitle); this.fillInterface(player, gui, page); } - gui.setSlot(5 * 9 + 4, filter.setName(Text.translatable(viewOpen ? "nucleoid.navigator.open_games" : "nucleoid.navigator.all_games"))); + gui.setSlot(5 * 9 + 4, filter.setItemName(Text.translatable(viewOpen ? "nucleoid.navigator.open_games" : "nucleoid.navigator.all_games")).hideDefaultTooltip()); } private void fillOpen(ServerPlayerEntity player, SimpleGui gui, MutableInt page) { - var gamesTemp = new ObjectOpenCustomHashSet(IdentityHashStrategy.INSTANCE); + var gamesTemp = new ReferenceOpenHashSet(); this.provideGameSpaces(gamesTemp::add); var games = new ArrayList<>(gamesTemp); games.sort(Comparator.comparingInt(space -> -space.getPlayers().size())); @@ -180,10 +179,10 @@ private void fillOpen(ServerPlayerEntity player, SimpleGui gui, MutableInt page) if (games.size() > pIndex) { var portal = games.get(pIndex); - var m = portal.getMetadata().sourceConfig(); + var m = portal.getMetadata().sourceConfig().value(); gui.setSlot(index, createIconFor(m.icon(), m.name(), m.description(), portal.getPlayers().size(), (p) -> { PagedGui.playClickSound(player); - tryJoinGame(p, portal); + tryJoinGame(p, portal, JoinIntent.PLAY); })); } else { gui.clearSlot(index); @@ -192,10 +191,12 @@ private void fillOpen(ServerPlayerEntity player, SimpleGui gui, MutableInt page) } } - private static void tryJoinGame(ServerPlayerEntity player, GameSpace gameSpace) { + private static void tryJoinGame(ServerPlayerEntity player, GameSpace gameSpace, JoinIntent intent) { player.server.submit(() -> { - var results = GamePlayerJoiner.tryJoin(player, gameSpace); - results.sendErrorsTo(player); + var result = GamePlayerJoiner.tryJoin(player, gameSpace, intent); + if (result.isError()) { + player.sendMessage(result.errorCopy().formatted(Formatting.RED)); + } }); } @@ -259,8 +260,9 @@ protected void fillInterface(ServerPlayerEntity player, SimpleGui gui, MutableIn } protected GuiElementBuilder createIconFor(ItemStack icon, Text name, List description, int playerCount, Consumer click) { - var element = GuiElementBuilder.from(icon).hideFlags() - .setName(name); + var element = GuiElementBuilder.from(icon) + .setItemName(name) + .hideDefaultTooltip(); for (var line : description) { var text = line.copy(); diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/entry/ExtraMenuEntries.java b/src/main/java/xyz/nucleoid/extras/game_portal/entry/ExtraMenuEntries.java index c23d7548..f0a80858 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/entry/ExtraMenuEntries.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/entry/ExtraMenuEntries.java @@ -1,7 +1,7 @@ package xyz.nucleoid.extras.game_portal.entry; import xyz.nucleoid.extras.NucleoidExtras; -import xyz.nucleoid.plasmid.game.portal.menu.MenuEntryConfig; +import xyz.nucleoid.plasmid.impl.portal.menu.MenuEntryConfig; public class ExtraMenuEntries { public static void register() { diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/entry/QuickPortalEntry.java b/src/main/java/xyz/nucleoid/extras/game_portal/entry/QuickPortalEntry.java index 5ce16b86..e1b5e523 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/entry/QuickPortalEntry.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/entry/QuickPortalEntry.java @@ -8,10 +8,10 @@ import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.util.Formatting; -import xyz.nucleoid.plasmid.game.GameSpace; -import xyz.nucleoid.plasmid.game.portal.GamePortal; -import xyz.nucleoid.plasmid.game.portal.GamePortalBackend; -import xyz.nucleoid.plasmid.game.portal.menu.MenuEntry; +import xyz.nucleoid.plasmid.api.game.GameSpace; +import xyz.nucleoid.plasmid.impl.portal.GamePortal; +import xyz.nucleoid.plasmid.impl.portal.GamePortalBackend; +import xyz.nucleoid.plasmid.impl.portal.menu.MenuEntry; import java.util.List; import java.util.function.Consumer; @@ -25,12 +25,12 @@ public record QuickPortalEntry( ItemStack icon ) implements MenuEntry { @Override - public void click(ServerPlayerEntity player) { - this.quickPortal.requestJoin(player); + public void click(ServerPlayerEntity player, boolean alt) { + this.quickPortal.requestJoin(player, alt); } public void secondaryClick(ServerPlayerEntity player) { - this.portal.requestJoin(player); + this.portal.requestJoin(player, false); } @Override @@ -49,8 +49,9 @@ public GamePortalBackend.ActionType getActionType() { } public GuiElement createGuiElement() { - var element = GuiElementBuilder.from(this.icon().copy()).hideFlags() - .setName(Text.empty().append(this.name())); + var element = GuiElementBuilder.from(this.icon().copy()) + .setItemName(Text.empty().append(this.name())) + .hideDefaultTooltip(); for (var line : this.description()) { var text = line.copy(); @@ -104,7 +105,7 @@ public GuiElement createGuiElement() { element.setCallback((index, clickType, slotActionType, gui) -> { if (clickType.isRight) this.secondaryClick(gui.getPlayer()); - else this.click(gui.getPlayer()); + else this.click(gui.getPlayer(), false); }); return element.build(); diff --git a/src/main/java/xyz/nucleoid/extras/game_portal/entry/QuickPortalEntryConfig.java b/src/main/java/xyz/nucleoid/extras/game_portal/entry/QuickPortalEntryConfig.java index db0d9cb4..9601aeda 100644 --- a/src/main/java/xyz/nucleoid/extras/game_portal/entry/QuickPortalEntryConfig.java +++ b/src/main/java/xyz/nucleoid/extras/game_portal/entry/QuickPortalEntryConfig.java @@ -1,14 +1,14 @@ package xyz.nucleoid.extras.game_portal.entry; -import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import net.minecraft.item.ItemStack; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import xyz.nucleoid.codecs.MoreCodecs; -import xyz.nucleoid.plasmid.game.portal.GamePortalManager; -import xyz.nucleoid.plasmid.game.portal.menu.*; -import xyz.nucleoid.plasmid.util.PlasmidCodecs; +import xyz.nucleoid.plasmid.api.util.PlasmidCodecs; +import xyz.nucleoid.plasmid.impl.portal.GamePortalManager; +import xyz.nucleoid.plasmid.impl.portal.menu.*; import java.util.List; import java.util.Optional; @@ -21,7 +21,7 @@ public record QuickPortalEntryConfig( Optional> description, Optional icon ) implements MenuEntryConfig { - public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( + public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group( Identifier.CODEC.fieldOf("portal").forGetter(QuickPortalEntryConfig::portal), Identifier.CODEC.fieldOf("quick_portal").forGetter(QuickPortalEntryConfig::quickPortal), PlasmidCodecs.TEXT.fieldOf("message").orElse(Text.translatable("text.nucleoid_extras.ui.action.more")).forGetter(QuickPortalEntryConfig::message), @@ -50,7 +50,7 @@ public MenuEntry createEntry() { } @Override - public Codec codec() { + public MapCodec codec() { return CODEC; } } diff --git a/src/main/java/xyz/nucleoid/extras/integrations/game/GameStatusIntegration.java b/src/main/java/xyz/nucleoid/extras/integrations/game/GameStatusIntegration.java index 745f14ab..b4448709 100644 --- a/src/main/java/xyz/nucleoid/extras/integrations/game/GameStatusIntegration.java +++ b/src/main/java/xyz/nucleoid/extras/integrations/game/GameStatusIntegration.java @@ -3,14 +3,15 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.MinecraftServer; import net.minecraft.util.Identifier; import org.jetbrains.annotations.Nullable; import xyz.nucleoid.extras.integrations.IntegrationSender; import xyz.nucleoid.extras.integrations.IntegrationsConfig; import xyz.nucleoid.extras.integrations.NucleoidIntegrations; -import xyz.nucleoid.plasmid.game.config.GameConfig; -import xyz.nucleoid.plasmid.game.manager.GameSpaceManager; +import xyz.nucleoid.plasmid.api.game.GameSpaceManager; +import xyz.nucleoid.plasmid.api.game.config.GameConfig; import java.util.ArrayList; import java.util.List; @@ -81,8 +82,8 @@ void clear() { this.games.clear(); } - void addGame(GameConfig game, int playerCount) { - this.games.add(new GameEntry(game.name().getString(), game.type().id(), playerCount)); + void addGame(RegistryEntry> game, int playerCount) { + this.games.add(new GameEntry(game.value().name().getString(), game.value().type().id(), playerCount)); } JsonObject serialize() { diff --git a/src/main/java/xyz/nucleoid/extras/integrations/game/StatisticsIntegration.java b/src/main/java/xyz/nucleoid/extras/integrations/game/StatisticsIntegration.java index bb02b616..d6b3bf45 100644 --- a/src/main/java/xyz/nucleoid/extras/integrations/game/StatisticsIntegration.java +++ b/src/main/java/xyz/nucleoid/extras/integrations/game/StatisticsIntegration.java @@ -13,11 +13,10 @@ import xyz.nucleoid.extras.integrations.IntegrationSender; import xyz.nucleoid.extras.integrations.IntegrationsConfig; import xyz.nucleoid.extras.integrations.NucleoidIntegrations; -import xyz.nucleoid.plasmid.event.GameEvents; -import xyz.nucleoid.plasmid.game.GameCloseReason; -import xyz.nucleoid.plasmid.game.GameSpace; -import xyz.nucleoid.plasmid.game.stats.GameStatisticBundle; -import xyz.nucleoid.plasmid.game.stats.StatisticKey; +import xyz.nucleoid.plasmid.api.event.GameEvents; +import xyz.nucleoid.plasmid.api.game.GameCloseReason; +import xyz.nucleoid.plasmid.api.game.GameSpace; +import xyz.nucleoid.plasmid.api.game.stats.GameStatisticBundle; import java.util.ArrayList; import java.util.Iterator; @@ -60,7 +59,7 @@ private void handleStatisticsBundle(GameSpace space, String namespace, GameStati } // Do not send statistics for anonymous games to the backend - if (space.getMetadata().sourceConfig().source() == null) return; + if (!space.getMetadata().sourceConfig().getKey().isPresent()) return; UUID gameId = space.getMetadata().id(); diff --git a/src/main/java/xyz/nucleoid/extras/integrations/status/HasTickPerformanceLog.java b/src/main/java/xyz/nucleoid/extras/integrations/status/HasTickPerformanceLog.java index 6ed1a463..20e0361d 100644 --- a/src/main/java/xyz/nucleoid/extras/integrations/status/HasTickPerformanceLog.java +++ b/src/main/java/xyz/nucleoid/extras/integrations/status/HasTickPerformanceLog.java @@ -1,7 +1,7 @@ package xyz.nucleoid.extras.integrations.status; -import net.minecraft.util.profiler.PerformanceLog; +import net.minecraft.util.profiler.log.MultiValueDebugSampleLog; public interface HasTickPerformanceLog { - public PerformanceLog getTickPerformanceLog(); + public MultiValueDebugSampleLog getTickPerformanceLog(); } diff --git a/src/main/java/xyz/nucleoid/extras/integrations/status/ServerPerformanceIntegration.java b/src/main/java/xyz/nucleoid/extras/integrations/status/ServerPerformanceIntegration.java index ba155011..70098018 100644 --- a/src/main/java/xyz/nucleoid/extras/integrations/status/ServerPerformanceIntegration.java +++ b/src/main/java/xyz/nucleoid/extras/integrations/status/ServerPerformanceIntegration.java @@ -3,7 +3,7 @@ import com.google.gson.JsonObject; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; import net.minecraft.server.MinecraftServer; -import net.minecraft.util.profiler.PerformanceLog; +import net.minecraft.util.profiler.log.MultiValueDebugSampleLog; import xyz.nucleoid.extras.integrations.IntegrationSender; import xyz.nucleoid.extras.integrations.IntegrationsConfig; import xyz.nucleoid.extras.integrations.NucleoidIntegrations; @@ -69,13 +69,13 @@ private void tick(MinecraftServer server) { } } - private static float getAverageTickMs(PerformanceLog log) { + private static float getAverageTickMs(MultiValueDebugSampleLog log) { try { long total = 0; - for (int index = 0; index < log.size(); index++) { + for (int index = 0; index < log.getLength(); index++) { total += log.get(index); } - double averageTickNs = (double) total / log.size(); + double averageTickNs = (double) total / log.getLength(); return (float) (averageTickNs / 1000000.0); } catch (Throwable e) { return 0; diff --git a/src/main/java/xyz/nucleoid/extras/lobby/LobbySpawnConfig.java b/src/main/java/xyz/nucleoid/extras/lobby/LobbySpawnConfig.java index 8aa41c76..1c2d6011 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/LobbySpawnConfig.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/LobbySpawnConfig.java @@ -27,7 +27,7 @@ public record LobbySpawnConfig( ); public void teleport(ServerPlayerEntity player, ServerWorld world) { - player.teleport(world, this.pos.getX(), this.pos.getY(), this.pos.getZ(), Collections.emptySet(), this.yaw, this.pitch); + player.teleport(world, this.pos.getX(), this.pos.getY(), this.pos.getZ(), Collections.emptySet(), this.yaw, this.pitch, true); } public void changeGameMode(ServerPlayerEntity player, GameMode fallback) { diff --git a/src/main/java/xyz/nucleoid/extras/lobby/NEBlocks.java b/src/main/java/xyz/nucleoid/extras/lobby/NEBlocks.java index e59ae748..03beaf60 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/NEBlocks.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/NEBlocks.java @@ -14,416 +14,421 @@ import net.minecraft.item.Items; import net.minecraft.particle.BlockStateParticleEffect; import net.minecraft.particle.DustParticleEffect; +import net.minecraft.particle.EntityEffectParticleEffect; import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleTypes; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; import net.minecraft.util.DyeColor; -import net.minecraft.util.math.Vec3d; -import org.joml.Vector3f; import xyz.nucleoid.extras.NucleoidExtras; import xyz.nucleoid.extras.lobby.block.*; import xyz.nucleoid.extras.lobby.block.tater.*; +import java.util.function.Function; + public class NEBlocks { - public static final Block NUCLEOID_LOGO = createTaterBlock(ParticleTypes.GLOW_SQUID_INK, "bac7400dfcb9a387361a3ad7c296943eb841a9bda13ad89558e2d6efebf167bc"); - - public static final Block END_PORTAL = createSimple(Blocks.END_PORTAL); - public static final Block END_GATEWAY = new VirtualEndGatewayBlock(AbstractBlock.Settings.create().pistonBehavior(PistonBehavior.BLOCK).strength(100).noCollision()); - public static final Block SAFE_TNT = createSimple(Blocks.TNT); - - public static final Block BLACK_CONCRETE_POWDER = createSimple(Blocks.BLACK_CONCRETE_POWDER); - public static final Block BLUE_CONCRETE_POWDER = createSimple(Blocks.BLUE_CONCRETE_POWDER); - public static final Block BROWN_CONCRETE_POWDER = createSimple(Blocks.BROWN_CONCRETE_POWDER); - public static final Block CYAN_CONCRETE_POWDER = createSimple(Blocks.CYAN_CONCRETE_POWDER); - public static final Block GREEN_CONCRETE_POWDER = createSimple(Blocks.GREEN_CONCRETE_POWDER); - public static final Block GRAY_CONCRETE_POWDER = createSimple(Blocks.GRAY_CONCRETE_POWDER); - public static final Block LIGHT_BLUE_CONCRETE_POWDER = createSimple(Blocks.LIGHT_BLUE_CONCRETE_POWDER); - public static final Block LIGHT_GRAY_CONCRETE_POWDER = createSimple(Blocks.LIGHT_GRAY_CONCRETE_POWDER); - public static final Block LIME_CONCRETE_POWDER = createSimple(Blocks.LIME_CONCRETE_POWDER); - public static final Block MAGENTA_CONCRETE_POWDER = createSimple(Blocks.MAGENTA_CONCRETE_POWDER); - public static final Block ORANGE_CONCRETE_POWDER = createSimple(Blocks.ORANGE_CONCRETE_POWDER); - public static final Block PINK_CONCRETE_POWDER = createSimple(Blocks.PINK_CONCRETE_POWDER); - public static final Block PURPLE_CONCRETE_POWDER = createSimple(Blocks.PURPLE_CONCRETE_POWDER); - public static final Block RED_CONCRETE_POWDER = createSimple(Blocks.RED_CONCRETE_POWDER); - public static final Block WHITE_CONCRETE_POWDER = createSimple(Blocks.WHITE_CONCRETE_POWDER); - public static final Block YELLOW_CONCRETE_POWDER = createSimple(Blocks.YELLOW_CONCRETE_POWDER); - - public static final Block GOLD_LAUNCH_PAD = new LaunchPadBlock(AbstractBlock.Settings.copy(Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE).strength(100).noCollision(), Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE); - public static final Block IRON_LAUNCH_PAD = new LaunchPadBlock(AbstractBlock.Settings.copy(Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE).strength(100).noCollision(), Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE); - - public static final Block CONTRIBUTOR_STATUE = new ContributorStatueBlock(AbstractBlock.Settings.copy(Blocks.SMOOTH_STONE).strength(100)); - - public static final Block INFINITE_DISPENSER = new InfiniteDispenserBlock(AbstractBlock.Settings.copy(Blocks.DISPENSER).strength(100)); - public static final Block INFINITE_DROPPER = new InfiniteDropperBlock(AbstractBlock.Settings.copy(Blocks.DROPPER).strength(100)); - - public static final Block SNAKE_BLOCK = new SnakeBlock(AbstractBlock.Settings.copy(Blocks.LIME_CONCRETE).strength(100), Blocks.LIME_CONCRETE, 8, 7); - public static final Block FAST_SNAKE_BLOCK = new SnakeBlock(AbstractBlock.Settings.copy(Blocks.LIGHT_BLUE_CONCRETE).strength(100), Blocks.LIGHT_BLUE_CONCRETE, 4, 7); - - public static final Block TRANSIENT_IRON_DOOR = new TransientDoorBlock(Blocks.IRON_DOOR); - public static final Block TRANSIENT_OAK_DOOR = new TransientDoorBlock(Blocks.OAK_DOOR); - public static final Block TRANSIENT_SPRUCE_DOOR = new TransientDoorBlock(Blocks.SPRUCE_DOOR); - public static final Block TRANSIENT_BIRCH_DOOR = new TransientDoorBlock(Blocks.BIRCH_DOOR); - public static final Block TRANSIENT_JUNGLE_DOOR = new TransientDoorBlock(Blocks.JUNGLE_DOOR); - public static final Block TRANSIENT_ACACIA_DOOR = new TransientDoorBlock(Blocks.ACACIA_DOOR); - public static final Block TRANSIENT_CHERRY_DOOR = new TransientDoorBlock(Blocks.CHERRY_DOOR); - public static final Block TRANSIENT_DARK_OAK_DOOR = new TransientDoorBlock(Blocks.DARK_OAK_DOOR); - public static final Block TRANSIENT_MANGROVE_DOOR = new TransientDoorBlock(Blocks.MANGROVE_DOOR); - public static final Block TRANSIENT_BAMBOO_DOOR = new TransientDoorBlock(Blocks.BAMBOO_DOOR); - public static final Block TRANSIENT_CRIMSON_DOOR = new TransientDoorBlock(Blocks.CRIMSON_DOOR); - public static final Block TRANSIENT_WARPED_DOOR = new TransientDoorBlock(Blocks.WARPED_DOOR); - - public static final Block NUCLE_PAST_LOGO = createTaterBlock(new DustParticleEffect(Vec3d.unpackRgb(0x52C471).toVector3f(), 1), "65ed3e4d6ec42bd84d2b5e452087d454aac141a978540f6d200bd8aa863d4db8"); - - public static final Block TINY_POTATO = createTaterBlock(ParticleTypes.HEART, "573514a23245f15dbad5fb4e622163020864cce4c15d56de3adb90fa5a7137fd"); - public static final Block BOTANICAL_TINY_POTATO = createBotanicTaterBlock(ParticleTypes.HEART, + public static final Block NUCLEOID_LOGO = registerTaterBlock("nucleoid_logo", ParticleTypes.GLOW_SQUID_INK, "bac7400dfcb9a387361a3ad7c296943eb841a9bda13ad89558e2d6efebf167bc"); + + public static final Block END_PORTAL = registerSimple("end_portal", Blocks.END_PORTAL); + public static final Block END_GATEWAY = register("end_gateway", AbstractBlock.Settings.create().pistonBehavior(PistonBehavior.BLOCK).strength(100).noCollision(), settings -> new VirtualEndGatewayBlock(settings)); + public static final Block SAFE_TNT = registerSimple("safe_tnt", Blocks.TNT); + + public static final Block BLACK_CONCRETE_POWDER = registerSimple("black_concrete_powder", Blocks.BLACK_CONCRETE_POWDER); + public static final Block BLUE_CONCRETE_POWDER = registerSimple("blue_concrete_powder", Blocks.BLUE_CONCRETE_POWDER); + public static final Block BROWN_CONCRETE_POWDER = registerSimple("brown_concrete_powder", Blocks.BROWN_CONCRETE_POWDER); + public static final Block CYAN_CONCRETE_POWDER = registerSimple("cyan_concrete_powder", Blocks.CYAN_CONCRETE_POWDER); + public static final Block GREEN_CONCRETE_POWDER = registerSimple("green_concrete_powder", Blocks.GREEN_CONCRETE_POWDER); + public static final Block GRAY_CONCRETE_POWDER = registerSimple("gray_concrete_powder", Blocks.GRAY_CONCRETE_POWDER); + public static final Block LIGHT_BLUE_CONCRETE_POWDER = registerSimple("light_blue_concrete_powder", Blocks.LIGHT_BLUE_CONCRETE_POWDER); + public static final Block LIGHT_GRAY_CONCRETE_POWDER = registerSimple("light_gray_concrete_powder", Blocks.LIGHT_GRAY_CONCRETE_POWDER); + public static final Block LIME_CONCRETE_POWDER = registerSimple("lime_concrete_powder", Blocks.LIME_CONCRETE_POWDER); + public static final Block MAGENTA_CONCRETE_POWDER = registerSimple("magenta_concrete_powder", Blocks.MAGENTA_CONCRETE_POWDER); + public static final Block ORANGE_CONCRETE_POWDER = registerSimple("orange_concrete_powder", Blocks.ORANGE_CONCRETE_POWDER); + public static final Block PINK_CONCRETE_POWDER = registerSimple("pink_concrete_powder", Blocks.PINK_CONCRETE_POWDER); + public static final Block PURPLE_CONCRETE_POWDER = registerSimple("purple_concrete_powder", Blocks.PURPLE_CONCRETE_POWDER); + public static final Block RED_CONCRETE_POWDER = registerSimple("red_concrete_powder", Blocks.RED_CONCRETE_POWDER); + public static final Block WHITE_CONCRETE_POWDER = registerSimple("white_concrete_powder", Blocks.WHITE_CONCRETE_POWDER); + public static final Block YELLOW_CONCRETE_POWDER = registerSimple("yellow_concrete_powder", Blocks.YELLOW_CONCRETE_POWDER); + + public static final Block GOLD_LAUNCH_PAD = register("gold_launch_pad", AbstractBlock.Settings.copy(Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE).strength(100).noCollision(), settings -> new LaunchPadBlock(settings, Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE.getDefaultState())); + public static final Block IRON_LAUNCH_PAD = register("iron_launch_pad", AbstractBlock.Settings.copy(Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE).strength(100).noCollision(), settings -> new LaunchPadBlock(settings, Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE.getDefaultState())); + + public static final Block CONTRIBUTOR_STATUE = register("contributor_statue", AbstractBlock.Settings.copy(Blocks.SMOOTH_STONE).strength(100), settings -> new ContributorStatueBlock(settings)); + + public static final Block INFINITE_DISPENSER = register("infinite_dispenser", AbstractBlock.Settings.copy(Blocks.DISPENSER).strength(100), settings -> new InfiniteDispenserBlock(settings)); + public static final Block INFINITE_DROPPER = register("infinite_dropper", AbstractBlock.Settings.copy(Blocks.DROPPER).strength(100), settings -> new InfiniteDropperBlock(settings)); + + public static final Block SNAKE_BLOCK = register("snake_block", AbstractBlock.Settings.copy(Blocks.LIME_CONCRETE).strength(100), settings -> new SnakeBlock(settings, Blocks.LIME_CONCRETE.getDefaultState(), 8, 7)); + public static final Block FAST_SNAKE_BLOCK = register("fast_snake_block", AbstractBlock.Settings.copy(Blocks.LIGHT_BLUE_CONCRETE).strength(100), settings -> new SnakeBlock(settings, Blocks.LIGHT_BLUE_CONCRETE.getDefaultState(), 4, 7)); + + public static final Block TRANSIENT_IRON_DOOR = register("transient_iron_door", AbstractBlock.Settings.copy(Blocks.IRON_DOOR), settings -> new TransientDoorBlock(Blocks.IRON_DOOR, settings)); + public static final Block TRANSIENT_OAK_DOOR = register("transient_oak_door", AbstractBlock.Settings.copy(Blocks.OAK_DOOR), settings -> new TransientDoorBlock(Blocks.OAK_DOOR, settings)); + public static final Block TRANSIENT_SPRUCE_DOOR = register("transient_spruce_door", AbstractBlock.Settings.copy(Blocks.SPRUCE_DOOR), settings -> new TransientDoorBlock(Blocks.SPRUCE_DOOR, settings)); + public static final Block TRANSIENT_BIRCH_DOOR = register("transient_birch_door", AbstractBlock.Settings.copy(Blocks.BIRCH_DOOR), settings -> new TransientDoorBlock(Blocks.BIRCH_DOOR, settings)); + public static final Block TRANSIENT_JUNGLE_DOOR = register("transient_jungle_door", AbstractBlock.Settings.copy(Blocks.JUNGLE_DOOR), settings -> new TransientDoorBlock(Blocks.JUNGLE_DOOR, settings)); + public static final Block TRANSIENT_ACACIA_DOOR = register("transient_acacia_door", AbstractBlock.Settings.copy(Blocks.ACACIA_DOOR), settings -> new TransientDoorBlock(Blocks.ACACIA_DOOR, settings)); + public static final Block TRANSIENT_CHERRY_DOOR = register("transient_cherry_door", AbstractBlock.Settings.copy(Blocks.CHERRY_DOOR), settings -> new TransientDoorBlock(Blocks.CHERRY_DOOR, settings)); + public static final Block TRANSIENT_DARK_OAK_DOOR = register("transient_dark_oak_door", AbstractBlock.Settings.copy(Blocks.DARK_OAK_DOOR), settings -> new TransientDoorBlock(Blocks.DARK_OAK_DOOR, settings)); + public static final Block TRANSIENT_MANGROVE_DOOR = register("transient_mangrove_door", AbstractBlock.Settings.copy(Blocks.MANGROVE_DOOR), settings -> new TransientDoorBlock(Blocks.MANGROVE_DOOR, settings)); + public static final Block TRANSIENT_PALE_OAK_DOOR = register("transient_pale_oak_door", AbstractBlock.Settings.copy(Blocks.PALE_OAK_DOOR), settings -> new TransientDoorBlock(Blocks.PALE_OAK_DOOR, settings)); + public static final Block TRANSIENT_BAMBOO_DOOR = register("transient_bamboo_door", AbstractBlock.Settings.copy(Blocks.BAMBOO_DOOR), settings -> new TransientDoorBlock(Blocks.BAMBOO_DOOR, settings)); + public static final Block TRANSIENT_CRIMSON_DOOR = register("transient_crimson_door", AbstractBlock.Settings.copy(Blocks.CRIMSON_DOOR), settings -> new TransientDoorBlock(Blocks.CRIMSON_DOOR, settings)); + public static final Block TRANSIENT_WARPED_DOOR = register("transient_warped_door", AbstractBlock.Settings.copy(Blocks.WARPED_DOOR), settings -> new TransientDoorBlock(Blocks.WARPED_DOOR, settings)); + // pale oak + + public static final Block NUCLE_PAST_LOGO = registerTaterBlock("nucle_past_logo", new DustParticleEffect(0x52C471, 1), "65ed3e4d6ec42bd84d2b5e452087d454aac141a978540f6d200bd8aa863d4db8"); + + public static final Block TINY_POTATO = registerTaterBlock("tiny_potato", ParticleTypes.HEART, "573514a23245f15dbad5fb4e622163020864cce4c15d56de3adb90fa5a7137fd"); + public static final Block BOTANICAL_TINY_POTATO = registerBotanicTaterBlock("botanical_potato", ParticleTypes.HEART, "39e878c52870c640b5985c67df70059120b61b26c77a5cf86042c04c13477d7b", "582f367eabffc9ecd8ab870c9f5f5c8b43215d5eb922cfb193aed70fcf694e92" ); - public static final Block IRRITATER = createTaterBlock(ParticleTypes.ANGRY_VILLAGER, "14b2cbfe1fd4d3123461081ad460acb6c0345bed3f3ce96d475b5f58f7b9030b"); - public static final Block SAD_TATER = createTaterBlock(ParticleTypes.FALLING_WATER, "7915f5ab6a3af5fd8e043bc98a5466acfc5d57c30dc9a1d2e4a32f7bfa1d35bf"); - public static final Block FLOWERING_AZALEA_TATER = createTaterBlock(Blocks.FLOWERING_AZALEA_LEAVES, "ab6c05d3be9369c69984513f281932622bca807008def997222a6d4f8cb71d83"); - public static final Block STONE_TATER = createTaterBlock(Blocks.STONE, "62e56013a5f6399b5fb91bb620dc240bb04eb7d1d71e0811853058b6d5ed6291"); - public static final Block CALCITE_TATER = createTaterBlock(Blocks.CALCITE, "ed8d2215b560c6755a1224d33041814c5ede9638ccb480a92baf79390080e687"); - public static final Block TUFF_TATER = createTaterBlock(Blocks.TUFF, "8612a9dfbe1906113c8ff80ba724af1dcf8ad68f95cf15f8a29931b82db5bada"); - public static final Block BASALT_TATER = createTaterBlock(ParticleTypes.WHITE_ASH, "c3038dfba5fc6877891d5a6c904f3e90c5ce8d76b630314a1b851b3d67e79fea"); - public static final Block DRIPSTONE_TATER = createTaterBlock(Blocks.DRIPSTONE_BLOCK, "906ea8dce1162e46353d9369fb9313e8ec2a63e64eaa617b02fe5f39073d06d8"); - public static final Block AMETHYST_TATER = createTaterBlock(Blocks.AMETHYST_BLOCK, "a0972dbf71067c17a01a6130586a8f0af80b267c4c1c7407eee059214a02da58"); - public static final Block PACKED_ICE_TATER = createTaterBlock(Blocks.PACKED_ICE, "5ee41f4bbc38815b497ab0bff1a981a7cd2121b539661662df4f2851500737e3"); - public static final Block BLUE_ICE_TATER = createTaterBlock(Blocks.BLUE_ICE, "fb00ec6cb1928448fd72add4352643a7d04dc1fb54cbb37d8094844a84646830"); - public static final Block FLAME_TATER = createTaterBlock(ParticleTypes.FLAME, "969a0e61b1ebf03a23a6e5885d133c0055f7755c3b63e3fb2ac475aaf4d87467"); - public static final Block PUZZLE_CUBE_TATER = createTaterBlock(ParticleTypes.FIREWORK, "41f8da5c342e799bfae154c16627b6190923eae27735ef7ffbdeb1a121c8811b"); - public static final Block LUCKY_TATER = createLuckyTaterBlock("7417598f8d30dd3582ce723a1303abeeca9ac6a96438967b7f4c043fe3562ebb", "a590c5d7d05cd4ad1747b7b4e265dc97a07b054175e1f25b488c2de021075329"); - public static final Block CRATE_TATER = createTaterBlock(ParticleTypes.WAX_ON, "5b7d34f16ef9a361964ce7405b6b463f60cc214bdb625e089869c50f5332f61e"); - public static final Block TATER_OF_UNDYING = createTaterBlock(ParticleTypes.TOTEM_OF_UNDYING, "b526d93147825e2db444aaf4a9464b61ad4e4defb0adf944a2275543efc9192a"); - public static final Block CRYING_OBSIDIAN_TATER = createTaterBlock(ParticleTypes.DRIPPING_OBSIDIAN_TEAR, "70d151a2da83b4a0ec73be08a42c4bc8964ff1d3ae2106cc29b9b79cfccb8b9f"); - public static final Block FLIPPED_TATER = createTaterBlock(ParticleTypes.DAMAGE_INDICATOR, "9c1e33c4b7e6cb58e699aeb7ae412329f35cb443e50743c8896ed36dfb6a3588"); - public static final Block BACKWARD_TATER = createTaterBlock(ParticleTypes.HEART, "c3d2eefca5fa2e0cc710fe067f4a7114df0f430eeaaa1d9c373e4c91c9ed0ea4"); - public static final Block UPWARD_TATER = createTaterBlock(ParticleTypes.HEART, "60860143fea936066220eae3a31cdfe5aa9b4e525e194aa965c02272a01cb5c8"); - public static final Block SANTA_HAT_TATER = createTaterBlock(ParticleTypes.SNOWFLAKE, "7609f3510b29bfa1504b7d3d53f466e7628a1cebd102573601db33e1ced88c4e"); - - public static final Block SKELETATER = createTaterBlock(Blocks.BONE_BLOCK, "f472e2fc36c7d8ef7cff8cfba71e7e238f89de01e8d44c21703f1ac6d2c47f1"); - public static final Block WITHER_SKELETATER = createTaterBlock(Blocks.SOUL_SAND, "2c739e03aaf98f1e972e23122423f82164bceadce39221fa7f6909d90eb05223"); - public static final Block ZOMBIE_TATER = createTaterBlock(Items.ROTTEN_FLESH, "9495d6aa5ef185062e8d9d1ba1721d5144e24155244f53ea4129038f977a0735"); - public static final Block CREEPER_TATER = createTaterBlock(ParticleTypes.EXPLOSION, "81428b1867a1b25cfce24ae821986653b1eb9dc253630ab82b695c2cbb6d1e52", 10); - public static final Block STEVE_TATER = createTaterBlock(ParticleTypes.HAPPY_VILLAGER, "ce7cc05bee993cd701a742415b09156381a54aaa7ad5971941722e32dd6ef3f2"); - public static final Block ALEX_TATER = createTaterBlock(ParticleTypes.HAPPY_VILLAGER, "e1f7dc909b2d6c679ffb4c69c8d7c8ed39cf47a83330113f8fe45ac4b0a483c8"); - - public static final Block TRANS_TATER = createColorPatternTaterBlock(new Vector3f[]{ - Vec3d.unpackRgb(0xEE90AD).toVector3f(), // pink - Vec3d.unpackRgb(0x3CB0DA).toVector3f(), // blue - Vec3d.unpackRgb(0xCFD5D6).toVector3f(), // white + public static final Block IRRITATER = registerTaterBlock("irritater", ParticleTypes.ANGRY_VILLAGER, "14b2cbfe1fd4d3123461081ad460acb6c0345bed3f3ce96d475b5f58f7b9030b"); + public static final Block SAD_TATER = registerTaterBlock("sad_tater", ParticleTypes.FALLING_WATER, "7915f5ab6a3af5fd8e043bc98a5466acfc5d57c30dc9a1d2e4a32f7bfa1d35bf"); + public static final Block FLOWERING_AZALEA_TATER = registerTaterBlock("flowering_azalea_tater", Blocks.FLOWERING_AZALEA_LEAVES, "ab6c05d3be9369c69984513f281932622bca807008def997222a6d4f8cb71d83"); + public static final Block STONE_TATER = registerTaterBlock("stone_tater", Blocks.STONE, "62e56013a5f6399b5fb91bb620dc240bb04eb7d1d71e0811853058b6d5ed6291"); + public static final Block CALCITE_TATER = registerTaterBlock("calcite_tater", Blocks.CALCITE, "ed8d2215b560c6755a1224d33041814c5ede9638ccb480a92baf79390080e687"); + public static final Block TUFF_TATER = registerTaterBlock("tuff_tater", Blocks.TUFF, "8612a9dfbe1906113c8ff80ba724af1dcf8ad68f95cf15f8a29931b82db5bada"); + public static final Block BASALT_TATER = registerTaterBlock("basalt_tater", ParticleTypes.WHITE_ASH, "c3038dfba5fc6877891d5a6c904f3e90c5ce8d76b630314a1b851b3d67e79fea"); + public static final Block DRIPSTONE_TATER = registerTaterBlock("dripstone_tater", Blocks.DRIPSTONE_BLOCK, "906ea8dce1162e46353d9369fb9313e8ec2a63e64eaa617b02fe5f39073d06d8"); + public static final Block AMETHYST_TATER = registerTaterBlock("amethyst_tater", Blocks.AMETHYST_BLOCK, "a0972dbf71067c17a01a6130586a8f0af80b267c4c1c7407eee059214a02da58"); + public static final Block PACKED_ICE_TATER = registerTaterBlock("packed_ice_tater", Blocks.PACKED_ICE, "5ee41f4bbc38815b497ab0bff1a981a7cd2121b539661662df4f2851500737e3"); + public static final Block BLUE_ICE_TATER = registerTaterBlock("blue_ice_tater", Blocks.BLUE_ICE, "fb00ec6cb1928448fd72add4352643a7d04dc1fb54cbb37d8094844a84646830"); + public static final Block FLAME_TATER = registerTaterBlock("flame_tater", ParticleTypes.FLAME, "969a0e61b1ebf03a23a6e5885d133c0055f7755c3b63e3fb2ac475aaf4d87467"); + public static final Block PUZZLE_CUBE_TATER = registerTaterBlock("puzzle_cube_tater", ParticleTypes.FIREWORK, "41f8da5c342e799bfae154c16627b6190923eae27735ef7ffbdeb1a121c8811b"); + public static final Block LUCKY_TATER = registerLuckyTaterBlock("lucky_tater", "7417598f8d30dd3582ce723a1303abeeca9ac6a96438967b7f4c043fe3562ebb", "a590c5d7d05cd4ad1747b7b4e265dc97a07b054175e1f25b488c2de021075329"); + public static final Block CRATE_TATER = registerTaterBlock("crate_tater", ParticleTypes.WAX_ON, "5b7d34f16ef9a361964ce7405b6b463f60cc214bdb625e089869c50f5332f61e"); + public static final Block TATER_OF_UNDYING = registerTaterBlock("tater_of_undying", ParticleTypes.TOTEM_OF_UNDYING, "b526d93147825e2db444aaf4a9464b61ad4e4defb0adf944a2275543efc9192a"); + public static final Block CRYING_OBSIDIAN_TATER = registerTaterBlock("crying_obsidian_tater", ParticleTypes.DRIPPING_OBSIDIAN_TEAR, "70d151a2da83b4a0ec73be08a42c4bc8964ff1d3ae2106cc29b9b79cfccb8b9f"); + public static final Block FLIPPED_TATER = registerTaterBlock("flipped_tater", ParticleTypes.DAMAGE_INDICATOR, "9c1e33c4b7e6cb58e699aeb7ae412329f35cb443e50743c8896ed36dfb6a3588"); + public static final Block BACKWARD_TATER = registerTaterBlock("backward_tater", ParticleTypes.HEART, "c3d2eefca5fa2e0cc710fe067f4a7114df0f430eeaaa1d9c373e4c91c9ed0ea4"); + public static final Block UPWARD_TATER = registerTaterBlock("upward_tater", ParticleTypes.HEART, "60860143fea936066220eae3a31cdfe5aa9b4e525e194aa965c02272a01cb5c8"); + public static final Block SANTA_HAT_TATER = registerTaterBlock("santa_hat_tater", ParticleTypes.SNOWFLAKE, "7609f3510b29bfa1504b7d3d53f466e7628a1cebd102573601db33e1ced88c4e"); + + public static final Block SKELETATER = registerTaterBlock("skeletater", Blocks.BONE_BLOCK, "f472e2fc36c7d8ef7cff8cfba71e7e238f89de01e8d44c21703f1ac6d2c47f1"); + public static final Block WITHER_SKELETATER = registerTaterBlock("wither_skeletater", Blocks.SOUL_SAND, "2c739e03aaf98f1e972e23122423f82164bceadce39221fa7f6909d90eb05223"); + public static final Block ZOMBIE_TATER = registerTaterBlock("zombie_tater", Items.ROTTEN_FLESH, "9495d6aa5ef185062e8d9d1ba1721d5144e24155244f53ea4129038f977a0735"); + public static final Block CREEPER_TATER = registerTaterBlock("creeper_tater", ParticleTypes.EXPLOSION, "81428b1867a1b25cfce24ae821986653b1eb9dc253630ab82b695c2cbb6d1e52", 10); + public static final Block STEVE_TATER = registerTaterBlock("steve_tater", ParticleTypes.HAPPY_VILLAGER, "ce7cc05bee993cd701a742415b09156381a54aaa7ad5971941722e32dd6ef3f2"); + public static final Block ALEX_TATER = registerTaterBlock("alex_tater", ParticleTypes.HAPPY_VILLAGER, "e1f7dc909b2d6c679ffb4c69c8d7c8ed39cf47a83330113f8fe45ac4b0a483c8"); + + public static final Block TRANS_TATER = registerColorPatternTaterBlock("trans_tater", new int[]{ + 0xEE90AD, // pink + 0x3CB0DA, // blue + 0xCFD5D6, // white }, "f77dbc809b254449023fac0dd4e0d9100b5c4407748be089f0e00c7ef7ab764"); - public static final Block ASEXUAL_TATER = createColorPatternTaterBlock(new Vector3f[]{ - Vec3d.unpackRgb(0x16161B).toVector3f(), // black - Vec3d.unpackRgb(0x3F4548).toVector3f(), // gray - Vec3d.unpackRgb(0xCFD5D6).toVector3f(), // white - Vec3d.unpackRgb(0x7B2BAD).toVector3f(), // purple + public static final Block ASEXUAL_TATER = registerColorPatternTaterBlock("asexual_tater", new int[]{ + 0x16161B, // black + 0x3F4548, // gray + 0xCFD5D6, // white + 0x7B2BAD, // purple }, "3902887dc55d4f736d0b566ad812f256113aaa4a318ffb865623fb5a677aef32"); - public static final Block BI_TATER = createColorPatternTaterBlock(new Vector3f[]{ - Vec3d.unpackRgb(0xBE46B5).toVector3f(), // pink - Vec3d.unpackRgb(0x7B2BAD).toVector3f(), // purple - Vec3d.unpackRgb(0x353A9E).toVector3f(), // blue + public static final Block BI_TATER = registerColorPatternTaterBlock("bi_tater", new int[]{ + 0xBE46B5, // pink + 0x7B2BAD, // purple + 0x353A9E, // blue }, "4526a72ca5be42920cd310280c03e2c9e9a70c55aa9cc1a0c48396d556f1c75d"); - public static final Block GAY_TATER = createColorPatternTaterBlock(new Vector3f[]{ - Vec3d.unpackRgb(0xA12823).toVector3f(), // red - Vec3d.unpackRgb(0xF17716).toVector3f(), // orange - Vec3d.unpackRgb(0xF9C629).toVector3f(), // yellow - Vec3d.unpackRgb(0x556E1C).toVector3f(), // green - Vec3d.unpackRgb(0x353A9E).toVector3f(), // blue - Vec3d.unpackRgb(0x7B2BAD).toVector3f(), // purple + public static final Block GAY_TATER = registerColorPatternTaterBlock("gay_tater", new int[]{ + 0xA12823, // red + 0xF17716, // orange + 0xF9C629, // yellow + 0x556E1C, // green + 0x353A9E, // blue + 0x7B2BAD, // purple }, "f9f446f29396ff444d0ef4f53a70c28afb69e5d1da037c03c277d23917dacded"); - public static final Block LESBIAN_TATER = createColorPatternTaterBlock(new Vector3f[]{ - Vec3d.unpackRgb(0xA12823).toVector3f(), // red - Vec3d.unpackRgb(0xF17716).toVector3f(), // orange - Vec3d.unpackRgb(0xEAEDED).toVector3f(), // white - Vec3d.unpackRgb(0xEE90AD).toVector3f(), // pink - Vec3d.unpackRgb(0xBE46B5).toVector3f(), // magenta + public static final Block LESBIAN_TATER = registerColorPatternTaterBlock("lesbian_tater", new int[]{ + 0xA12823, // red + 0xF17716, // orange + 0xEAEDED, // white + 0xEE90AD, // pink + 0xBE46B5, // magenta }, "44492740f40c19c3e52871cdf6cbd585e980fc7b50cb0fc949bfbe44032a7db7"); - public static final Block NONBINARY_TATER = createColorPatternTaterBlock(new Vector3f[]{ - Vec3d.unpackRgb(0xF9C629).toVector3f(), // yellow - Vec3d.unpackRgb(0x16161B).toVector3f(), // black - Vec3d.unpackRgb(0xCFD5D6).toVector3f(), // white - Vec3d.unpackRgb(0x7B2BAD).toVector3f(), // purple + public static final Block NONBINARY_TATER = registerColorPatternTaterBlock("nonbinary_tater", new int[]{ + 0xF9C629, // yellow + 0x16161B, // black + 0xCFD5D6, // white + 0x7B2BAD, // purple }, "10854e473bc7a0a6956cb12df8026de9fc00fae40c0502a3182908bbb50c9aa5"); - public static final Block PAN_TATER = createColorPatternTaterBlock(new Vector3f[]{ - Vec3d.unpackRgb(0xFA318C).toVector3f(), // pink - Vec3d.unpackRgb(0xFDD73B).toVector3f(), // yellow - Vec3d.unpackRgb(0x2394F9).toVector3f(), // blue + public static final Block PAN_TATER = registerColorPatternTaterBlock("pan_tater", new int[]{ + 0xFA318C, // pink + 0xFDD73B, // yellow + 0x2394F9, // blue }, "3f761be18f070a016e4f61d37ec13b23032a552dcdb70a67f855c3ab2fae54e0"); - public static final Block GENDERFLUID_TATER = createColorPatternTaterBlock(new Vector3f[]{ - Vec3d.unpackRgb(0xBE46B5).toVector3f(), // pink - Vec3d.unpackRgb(0xCFD5D6).toVector3f(), // white - Vec3d.unpackRgb(0x7B2BAD).toVector3f(), // purple - Vec3d.unpackRgb(0x16161B).toVector3f(), // black - Vec3d.unpackRgb(0x2394F9).toVector3f(), // blue + public static final Block GENDERFLUID_TATER = registerColorPatternTaterBlock("genderfluid_tater", new int[]{ + 0xBE46B5, // pink + 0xCFD5D6, // white + 0x7B2BAD, // purple + 0x16161B, // black + 0x2394F9, // blue }, "ba066cdd8d48501eb51eea1e3e417c25ef51a04284714baad5ab5de5cd4221b8"); - public static final Block DEMISEXUAL_TATER = createColorPatternTaterBlock(new Vector3f[]{ - Vec3d.unpackRgb(0x16161B).toVector3f(), // black - Vec3d.unpackRgb(0xCFD5D6).toVector3f(), // white - Vec3d.unpackRgb(0x7B2BAD).toVector3f(), // purple - Vec3d.unpackRgb(0x3F4548).toVector3f(), // gray + public static final Block DEMISEXUAL_TATER = registerColorPatternTaterBlock("demisexual_tater", new int[]{ + 0x16161B, // black + 0xCFD5D6, // white + 0x7B2BAD, // purple + 0x3F4548, // gray }, "32b7cd2c5d70cab476ce951e2c520c9b3579250ad900164d6c2321c7f43d6dc7"); - public static final Block WARDEN_TATER = createWardenTaterBlock("52e411aa1501c72d99d738cb38e250a395c6604b8bccc9f29d7f26e9cacd8d6f"); - public static final Block VIRAL_TATER = createTaterBlock(ParticleTypes.SCRAPE, "b12f770c4542c9f26ba03aaee686e0946698d394a8e745d3eac6013383dcff29"); - public static final Block DICE_TATER = createDiceTaterBlock(); - public static final Block TATEROID = createTateroidBlock(SoundEvents.BLOCK_NOTE_BLOCK_BELL, -1, "8d531d40d09efd3a9a585b55e66a9a6f04c73af84d94d7c565549bf27b8b26bd"); - public static final Block RED_TATEROID = createTateroidBlock(SoundEvents.BLOCK_NOTE_BLOCK_GUITAR, 7 / 24d, "2be51b227360ab65776725a91cded84b56f6920eec0d6fb5a57d5f1ada147aa6"); - public static final Block ORANGE_TATEROID = createTateroidBlock(SoundEvents.BLOCK_NOTE_BLOCK_BASEDRUM, 4 / 24d, "c5362e308822cf1c436a4ba6d0c3976139c98621c7aa2a96be99c73e97708efc"); - public static final Block YELLOW_TATEROID = createTateroidBlock(SoundEvents.BLOCK_NOTE_BLOCK_CHIME, 2.5 / 24d, "fef74a6c7cb45d3c4bae134e6ec41fd7517f7eabe2c74dc76a51b39c63c38bc2"); - public static final Block GREEN_TATEROID = createTateroidBlock(SoundEvents.BLOCK_NOTE_BLOCK_BIT, 21 / 24d, "57bb692499560f0393314a9f1ec11425b360e43c1ddb560de261cd04b8cc8e69"); - public static final Block BLUE_TATEROID = createTateroidBlock(SoundEvents.BLOCK_NOTE_BLOCK_XYLOPHONE, 17 / 24d, "89ad5aecfb9ab6f36261e0c462acecf2078e7e575d9373bacc0503224c44250e"); - public static final Block PURPLE_TATEROID = createTateroidBlock(SoundEvents.BLOCK_NOTE_BLOCK_FLUTE, 11 / 24d, "d16a37512cb7ca372af5f37f9bd95d4603c4fa44be4143fb26aaa324e681c9b0"); - - public static final Block WHITE_TATER = createColorTaterBlock(DyeColor.WHITE, "73dab052d33ee467ba7fac9aa0e316db962e3e7ac6dbbff236667439e340392c"); - public static final Block ORANGE_TATER = createColorTaterBlock(DyeColor.ORANGE, "75b88126dbd4e860608965c044d0060ac03c26ebea1b652643fe03734ea1b12b"); - public static final Block MAGENTA_TATER = createColorTaterBlock(DyeColor.MAGENTA, "bef4cf40f02bc129e34f660ce3923387894b8f0814fc58c09726629fa7b1db64"); - public static final Block LIGHT_BLUE_TATER = createColorTaterBlock(DyeColor.LIGHT_BLUE, "e6f7e4641fa4ee4ba926ebae4669f22f276051b3629f8d89ce015a95c1137fb2"); - public static final Block YELLOW_TATER = createColorTaterBlock(DyeColor.YELLOW, "5956df3e88f01cdd26d1caa07fab723c3a3db319ba167a3bed287d461635f1b9"); - public static final Block LIME_TATER = createColorTaterBlock(DyeColor.LIME, "16671f4c7ce8e46099f367fc05c5b61089c887f4145aff2077a1a7d3631dd063"); - public static final Block PINK_TATER = createColorTaterBlock(DyeColor.PINK, "b3efebba4906f9f260aae83fee73012370521726fadf0101498197d7143a64df"); - public static final Block GRAY_TATER = createColorTaterBlock(DyeColor.GRAY, "7e491b6282eca12c9edcddfb3baf6e5fb0549c89d39088567415616c92dfd5f0"); - public static final Block LIGHT_GRAY_TATER = createColorTaterBlock(DyeColor.LIGHT_GRAY, "b5df73cc026043d09c54cb15d0923e314503e1d513026b59a5317b31da4c5289"); - public static final Block CYAN_TATER = createColorTaterBlock(DyeColor.CYAN, "4eb39032053a3f2e5bd1d19bfacd25b524b19cd0e70a5a92a61ac884904ecb54"); - public static final Block PURPLE_TATER = createColorTaterBlock(DyeColor.PURPLE, "ab69ffa68135001e8714c78617e5a1a0177827cbbd866eb984f524f023f87fe5"); - public static final Block BLUE_TATER = createColorTaterBlock(DyeColor.BLUE, "618be72e94291de1cc3e3d2e2fa8bbd79422cdcb0cb70cedde7dc9c1bbef5fb5"); - public static final Block BROWN_TATER = createColorTaterBlock(DyeColor.BROWN, "df942f7c24f4c10353da974a938ad75f9a7ccdca232a99de870c5691d75fd70c"); - public static final Block GREEN_TATER = createColorTaterBlock(DyeColor.GREEN, "fab98a4c69e817771fec17c08c7e031952c05a52015dcecb09c93576745c71e2"); - public static final Block RED_TATER = createColorTaterBlock(DyeColor.RED, "51e4bf6f7a029567d598fff73c3c76e0cdea956a7fff5ea7279ea4bf40c968c2"); - public static final Block BLACK_TATER = createColorTaterBlock(DyeColor.BLACK, "57a7caa44cedff925d23cd5d3f62bc06e83d3485551dcc4f9db2da7d9f8a9694"); - - public static final Block COAL_TATER = createTaterBlock(Blocks.COAL_BLOCK, "7eb25d3f8fcf48673ad0b171ea37154b43d57f6ab04d8ffb546fc606b8505bf4"); - public static final Block DIAMOND_TATER = createTaterBlock(Blocks.DIAMOND_BLOCK, "a399c9d599e0d9dc6a480e85f4dbecc45b318814026895ac8150fd2e2fa2599e"); - public static final Block EMERALD_TATER = createTaterBlock(ParticleTypes.HAPPY_VILLAGER, "cd76730df726b8ee9d72a3a478457d313626133de1d76c26cfc6af8e80e9c476"); - public static final Block GOLD_TATER = createTaterBlock(Blocks.GOLD_BLOCK, "180a7cc71153b89a536c148d2f1012d6772a7d3ba8321f922a6de46773c35af9"); - public static final Block IRON_TATER = createTaterBlock(Blocks.IRON_BLOCK, "174858c976f0274ebce3f3ffcef653609f29d37e0cc9cad25e586864b806cb23"); - public static final Block LAPIS_TATER = createTaterBlock(Blocks.LAPIS_BLOCK, "58d5cbda5c5046bf0b0f0d447c2fcc5e468707b6a4837c083af8e109aba9ce1c"); - public static final Block NETHERITE_TATER = createTaterBlock(Blocks.NETHERITE_BLOCK, "664dce4fade8e5f352001eff6900d9d4b142935ebed303106539f7ad0193621f"); - public static final Block QUARTZ_TATER = createTaterBlock(Blocks.QUARTZ_BLOCK, "7e7b4561d09d1a726fec3607706c9e3c77e8fc9b8c7e9c3637ca80ea0c86be21"); - public static final Block REDSTONE_TATER = createRedstoneTaterBlock(new DustParticleEffect(DustParticleEffect.RED, 1), "c47dd2536f5a5eb2bdb1ea4389d3af8ca2fd9d5d2c97c660fc5bf4d970c974de"); - - public static final Block COPPER_TATER = createTaterBlock(ParticleTypes.SCRAPE, "18207c7cf4007222691750b0783d6959261ddf72980483f7c9fcf96c2cba85b1"); - public static final Block EXPOSED_COPPER_TATER = createTaterBlock(ParticleTypes.SCRAPE, "bd5020090643edb5ec25d87cb1f408aad4f6018ec4bbe83d25a031ef1e705e4d"); - public static final Block WEATHERED_COPPER_TATER = createTaterBlock(ParticleTypes.SCRAPE, "7d9c61d68241667f8e462d18a84c1413ce3db13f93223912201c21327b4adb25"); - public static final Block OXIDIZED_COPPER_TATER = createTaterBlock(ParticleTypes.SCRAPE, "c7e9172d0ec2d20588bf5596ea79403e3da26975cdc5b6d0624e31857774298c"); - - public static final Block CAKE_TATER = createTaterBlock(Blocks.CAKE, "6d46fd58fd566bc0a90f8bc921daf0d9920591a5b153e64a80bb6d54dfb415b9"); - public static final Block ENDERTATER = createTaterBlock(ParticleTypes.PORTAL, "1f4f68547ec0d04a1a5c52ce8bb84847cd07674d50cf0740bf6f9c505826892d"); - public static final Block FURNACE_TATER = createTaterBlock(ParticleTypes.SMALL_FLAME, "80bdb710ee3d17de73bcf51dfcbc1f61e4dc3fd7a751d517bfd814b202b907bb"); - public static final Block MELON_TATER = createTaterBlock(Items.MELON_SLICE, "a3d21fbdca84efe016f75075ce55cf11382bf03bb691336b1e0f84c727d8c271"); - public static final Block PUMPKIN_TATER = createTaterBlock(Blocks.PUMPKIN, "21004377d30b55fd2f176e50e431ba88bd9eb8f353b103a67098a3fcbc12119d"); - public static final Block JACK_O_TATER = createTaterBlock(Blocks.JACK_O_LANTERN, "16772b77233f9d9035436287861b206ac13112d552a6c8e9754b26486b1e5bd"); - public static final Block SCULK_TATER = createTaterBlock(ParticleTypes.SOUL, "4265450388096aeb3d228c3b99f6ec64ea4a1a846c9903c7d9db1c309e27469b"); - public static final Block SLIME_TATER = createTaterBlock(Blocks.SLIME_BLOCK, "16747a7e1605794debfbb43befda2ce986075b3969e0b247ddd7bc6cdaa56a51"); - public static final Block HEROBRINE_TATER = createElderGuardianParticleTaterBlock("6e9ca544a4561b8cbcdb35820779960497ea748d685e2b17c814a18dc19147fd"); - public static final Block OCHRE_FROGLIGHT_TATER = createTaterBlock(ParticleTypes.SPIT, "92c34818ed06f3d76af6daabe87ab5b9a8c425865eaed0f873470af458b3152e"); - public static final Block PEARLESCENT_FROGLIGHT_TATER = createTaterBlock(ParticleTypes.SPIT, "b7e33a69c99e044b98d0a11b830ef7b764d6de9874f24b4f44610f565b76fab1"); - public static final Block VERDANT_FROGLIGHT_TATER = createTaterBlock(ParticleTypes.SPIT, "96ae96a834b8eee8edadaaef368f4b0c93a34b2a634ef89efc14326d965f0040"); - public static final Block SNOWMAN_TATER = createTaterBlock(ParticleTypes.SNOWFLAKE, "89ceb42efcfc372cbb26f817e1707a16864af16e0e37c793db05b16cd1f82ac"); - - public static final Block ACACIA_TATER = createTaterBlock(Blocks.ACACIA_PLANKS, "807d75cb114e057e5156af324517e87012d11566beb112152be4a94a65273535"); - public static final Block ANDESITE_TATER = createTaterBlock(Blocks.ANDESITE, "5b728494483d695a171affd93730b65271726a5c8840d96a1acbf64b4dbdb555"); - public static final Block BAMBOO_TATER = createTaterBlock(Blocks.BAMBOO, "acecf9447693e769f17469d67251cddb4b93e5b64efe7445d04ea286a50d8a3c"); - public static final Block BARRIER_TATER = createMarkerTaterBlock(Blocks.BARRIER, "d7f155b1a7627408e8f8c670fbd302c8fc0e320e5320b4fc517abfcfe02ab046"); - public static final Block BEDROCK_TATER = createTaterBlock(Blocks.BEDROCK, "c782d793af7aa0ebf5f5c9fdde3f636f93683368bf1daa544a449342b48355b"); - public static final Block BIRCH_TATER = createTaterBlock(Blocks.BIRCH_PLANKS, "c66003fcb840ebcd18f300b9facd1b8b936ef82e1ea6c7ca26b2c5b2bda5f007"); - public static final Block BONE_TATER = createTaterBlock(Blocks.BONE_BLOCK, "72b59c778f6656bb8502810eac82997d3669563f4fdd6d24d5ac008d334e3172"); - public static final Block BRAIN_CORAL_TATER = createTaterBlock(ParticleTypes.BUBBLE, "edf7e38eb4130e94bc59412d480b91529206ada944ed4c698a5ef957917f32f8"); - public static final Block BRICK_TATER = createTaterBlock(Blocks.BRICKS, "98adbfaa40e423ca12560484d26e3a049739a810490fa0b1564a765b1b65137d"); - public static final Block BUBBLE_CORAL_TATER = createTaterBlock(ParticleTypes.BUBBLE, "7dc1f18b5b4ccce2171796002bc434e49c53aeb23829e4d6f1d505d340522248"); - public static final Block CACTUS_TATER = createTaterBlock(ParticleTypes.DAMAGE_INDICATOR, "69ebd5e707f1da0df71ecded8c5a6d853f3c47943bd5f167d029de7ad01f846d"); - public static final Block CHORUS_TATER = createTaterBlock(ParticleTypes.REVERSE_PORTAL, "dc85f3160fecd3659eb4fabb9544c130688ec9219f2031592c1abc5f63b80422"); - public static final Block CLAY_TATER = createTaterBlock(Blocks.CLAY, "f9e2f8d3075e9bb78e237291c0a7f2cc17aff9959c735fba1863d243ae5fe3fc"); - public static final Block CRIMSON_TATER = createTaterBlock(Blocks.CRIMSON_PLANKS, "742731b12a9ffa0b0550b3e41c1f3d347ffb65d840dee2c8d22ec7bd2284050a"); - public static final Block DARK_OAK_TATER = createTaterBlock(Blocks.DARK_OAK_PLANKS, "f9df377e9f8647787a254792ae1fb1a6d03a7515642c26b74562572ffd51517d"); - public static final Block DARK_PRISMARINE_TATER = createTaterBlock(ParticleTypes.BUBBLE_COLUMN_UP, "98ec7227474cff245b820d30e59df47d1bf3b895dc8287e9de08102f6836a407"); - public static final Block DIORITE_TATER = createTaterBlock(Blocks.DIORITE, "162b67a6a24a8f0ed29dd33ba143038cebd346f8c87e0c38e532aa9957134be1"); - public static final Block DIRT_TATER = createTaterBlock(Blocks.DIRT, "15e74c322a4715d9a4c13595eb6cc720a4afef29c4da0892ebf4fc6ddd4cd1ae"); - public static final Block END_STONE_TATER = createTaterBlock(ParticleTypes.END_ROD, "87b4943c4f8f658439899673e91ac15815ab28b5c9eb72c2bd371e08fd1ac0b"); - public static final Block FIRE_CORAL_TATER = createTaterBlock(ParticleTypes.BUBBLE, "beadd606c1c7095851ffa38aa8dff23f22dcd78c4449c0e8ca50089252d907c2"); - public static final Block GRANITE_TATER = createTaterBlock(Blocks.GRANITE, "55cdae99f39b299f65d0a6ec3bd1fde2992689a664668482ab1d8a6d79dfc6e4"); - public static final Block GRASS_TATER = createTaterBlock(Blocks.GRASS_BLOCK, "a999a144cbe51321291ed00b073511a102d1dbbd7e8bff53fa33a2738f105a75"); - public static final Block HAY_TATER = createTaterBlock(ParticleTypes.HEART, "df65853f3ebf7c03e477fea14b19345b284bf591476461ac36d399c0dbb144fb"); - public static final Block HONEY_TATER = createTaterBlock(ParticleTypes.DRIPPING_HONEY, "623f2ad832c27e145076f1267875547444dfb0cef80403921ed4d03a0859fae5"); - public static final Block HONEYCOMB_TATER = createTaterBlock(ParticleTypes.LANDING_HONEY, "e917928e35f2fac59aa1d14d80c478f38d14e2f66ee59d4eb9d025605406481"); - public static final Block HORN_CORAL_TATER = createTaterBlock(ParticleTypes.BUBBLE, "3e17f4d2977dafce018ac06163f2a7c5672855d198da86fa050f27a7c45b2da4"); - public static final Block JUNGLE_TATER = createTaterBlock(Blocks.JUNGLE_PLANKS, "b9105eebf99ec35ac08aaa2ed8ac721590adbdb1eb3a158a82c11e71e76d28aa"); - public static final Block LIGHT_TATER = createLightTaterBlock("640ed4ea72aed9503c0519d3380ac480a20f9155c428d0571ad767eb4e8973b4"); - public static final Block MYCELIUM_TATER = createTaterBlock(ParticleTypes.MYCELIUM, "f3447bbb99321b399b7a1913d9bc4e90e8b0fc9b9520af45a8f59a1540d4b620"); - public static final Block NETHER_WART_TATER = createTaterBlock(ParticleTypes.CRIMSON_SPORE, "81c05e8c91a4ca83120799053270dfd7fdf1376988a1a393645140ae89eb6762"); - public static final Block OAK_TATER = createTaterBlock(Blocks.OAK_PLANKS, "28cfc208966e2f5206b1aba0489e5fdb3f05e6d94befbc618ad80e74eb1016d2"); - public static final Block OBSIDIAN_TATER = createTaterBlock(Blocks.OBSIDIAN, "38adea8f484dba5baf67ace3ee7675758e2318868b2d72542ed3fff0d009f21"); - public static final Block PODZOL_TATER = createTaterBlock(Blocks.PODZOL, "5fe3cfce7c241fdaefe8d0255a545d2c329c1283232d61eaa7324b30a8f478f2"); - public static final Block PRISMARINE_BRICK_TATER = createTaterBlock(ParticleTypes.BUBBLE_COLUMN_UP, "6fdb11b2147b36ed496639bcf8bea8d07e45de610ec08223ca3d56aefb8d81ce"); - public static final Block PRISMARINE_TATER = createTaterBlock(ParticleTypes.NAUTILUS, "abae0abdc506014751e89fa65bb802c81fc2ee3ed0e0a06582abb5bdd088e440"); - public static final Block RED_SAND_TATER = createTaterBlock(new BlockStateParticleEffect(ParticleTypes.FALLING_DUST, Blocks.RED_SAND.getDefaultState()), "7789a0f57334248b602322f57fb2ed708484bb6f7774442c7f2f2bf2ec09064f"); - public static final Block SAND_TATER = createTaterBlock(new BlockStateParticleEffect(ParticleTypes.FALLING_DUST, Blocks.SAND.getDefaultState()), "6d5332076f20d3f1ad766f4bd83649c573d1b3bf67abfa5be26cdf5ca4a948c8"); - public static final Block SEA_LANTERN_TATER = createTaterBlock(ParticleTypes.NAUTILUS, "ccf764156bb262a3d47f4b885716aa7749077c56a31aa41248936255ed38e27"); - public static final Block SHROOMLIGHT_TATER = createTaterBlock(Blocks.SHROOMLIGHT, "c7aae4d5e03d8a758cdce91bd74573abc5306dfca6e44e5d0e14ca6c14085b36"); - public static final Block SHULKER_TATER = createTaterBlock(ParticleTypes.END_ROD, "e5efd875ee5f4a37ad05d392a65886c6dcaf10188c9199673b782b795a29a231"); - public static final Block SMOOTH_STONE_TATER = createTaterBlock(Blocks.SMOOTH_STONE, "8f7c81245a444328cff8a366d5a55a6897df99f89185adb76b9225551bfc6786"); - public static final Block SOUL_SAND_TATER = createTaterBlock(ParticleTypes.SOUL, "5750c407d6205c6d572eddbcc162e2e8dd61f3a26fb0eaa7dff99bcf8d03519a"); - public static final Block SPONGE_TATER = createTaterBlock(ParticleTypes.DRIPPING_WATER, "697a4102627b55490614f475d4fde0df51a8d0c45e9573799d198f4deca33a14"); - public static final Block SPRUCE_TATER = createTaterBlock(Blocks.SPRUCE_PLANKS, "fe400308900536545f886084d9f465f17311a41b7410cfaba323a5ac3b1b9a9c"); - public static final Block STONE_BRICK_TATER = createTaterBlock(Blocks.STONE_BRICKS, "bdf3cdb5266539c34485d439c6a07baa3fbe5556d980ef14483cd6f5271b089b"); - public static final Block STRUCTURE_VOID_TATER = createMarkerTaterBlock(Blocks.STRUCTURE_VOID, "94903af59c0a5529ac3c9135683f7671090a403c641e5cbde8b21abe4a1e114c"); - public static final Block TARGET_TATER = createTargetTaterBlock("386b52ed3d2b2a682b4c6f1d40a9ceabf72e7c5b60b8d92d2dcee97a8799450f"); - public static final Block TERRACOTTA_TATER = createTaterBlock(Blocks.TERRACOTTA, "57f120d92f3f076352b682345fdb82204b920e59d226c4c6d2c64d5abc6860e1"); - public static final Block TNTATER = createTaterBlock(ParticleTypes.EXPLOSION, "440d175ded62ff7b3cf9de979196e7b95da8a25e9e888c4bed06f5c011dc54a8", 10); - public static final Block TUBE_CORAL_TATER = createTaterBlock(ParticleTypes.BUBBLE, "dad0a4ef4c9994ee32a02fcb7960600a295b31a6fef94652998189295fd2ee84"); - public static final Block WARPED_TATER = createTaterBlock(Blocks.WARPED_PLANKS, "eb4db1936577cfcbbace1dbed72483482af32d99ecd090c8f145cac88ae4e8a2"); - public static final Block WARPED_WART_TATER = createTaterBlock(ParticleTypes.WARPED_SPORE, "9748cf1c78cfdea730a7ce05ae973a8afe326dc2f71f82a45232d9c6b08776d9"); - public static final Block WOOL_TATER = createTaterBlock(Blocks.WHITE_WOOL, "ed564fa98b7e8e3abf41779bfe759ca0a3191c8aa70f2eef0af139ba1102e27e"); - - public static final Block ACACIA_LOG_TATER = createTaterBlock(Blocks.ACACIA_LOG, "3b185be7121801b5a956ce462583c55928b31cbea74e4aae82e7330317a1ae60"); - public static final Block ANGRY_BEE_TATER = createTaterBlock(ParticleTypes.ANGRY_VILLAGER, "21004dc20ce74adbcc31f1588f268b4cb431b501679e1db7451869bd04779b4b"); - public static final Block BEACON_TATER = createTaterBlock(ParticleTypes.ENTITY_EFFECT, "6f7fd952ec5da74a25208853161a15d2f6d022835afe881bd271c710ba25935e"); - public static final Block BEE_NEST_TATER = createTaterBlock(ParticleTypes.DRIPPING_HONEY, "37b0b38538fac97d26241bf51212a26667596b1b14f1307432c3dcef033af1d0"); - public static final Block BEE_TATER = createTaterBlock(ParticleTypes.FALLING_HONEY, "80480b902bb32e2b145bb5262629ad7a920d3600365d3101936efc35aad830bd"); - public static final Block BEEHIVE_TATER = createTaterBlock(ParticleTypes.DRIPPING_HONEY, "f508a30a1bbc65fbfc58da5dc15d4e930b23b1b48afe72923c506a27cbe06366"); - public static final Block BIRCH_LOG_TATER = createTaterBlock(Blocks.BIRCH_LOG, "6950c69d92a635cb945f845a1a5c428a8e0a0cc2a8b0c563538ec171c4dcee6"); - public static final Block BLACKSTONE_TATER = createTaterBlock(Blocks.BLACKSTONE, "e67acd12c3dee918cc5f3b1a88ab7367549caf978357d79d19d2d486b7acc298"); - public static final Block BLAZE_TATER = createTaterBlock(ParticleTypes.FLAME, "85e678d6edab035d25841cfb4c90b631a7242e9d4cf6bcf00f168b8bf7cd290d"); - public static final Block BOOKSHELF_TATER = createTaterBlock(ParticleTypes.ENCHANT, "dbe032fa6759ba137e52abda44c099344698d80b64257c9295213af168352cae"); - public static final Block BROWN_MOOSHROOM_TATER = createTaterBlock(ParticleTypes.HEART, "12b92975d95348d7cb94133afcb11b56fc0b4b1c373647dda83876442eee2d41"); - public static final Block BROWN_MUSHROOM_TATER = createTaterBlock(Blocks.BROWN_MUSHROOM_BLOCK, "d5268b990a497d6608f82ba664a8c7c981c28055aac34895f230cbdb284b67b8"); - public static final Block CAVE_SPIDER_TATER = createTaterBlock(ParticleTypes.SPORE_BLOSSOM_AIR, "9499105f458b25a1e85b7312d00b4f1e1d71d5fd08e2165d77693ac2cab2f2a8"); - public static final Block COBBLED_DEEPSLATE_TATER = createTaterBlock(Blocks.COBBLED_DEEPSLATE, "2b378b15b46b469b36da1fb0ac41f2d61df66dd315d5b00714cf7564d6a1eea2"); - public static final Block COBBLESTONE_TATER = createTaterBlock(Blocks.COBBLESTONE, "7effa3c069da9199503f2fecc1db83fe843491200ba5776d6e799cd24a771c44"); - public static final Block COCOA_TATER = createTaterBlock(Blocks.COCOA, "c4f61e517ea2118d00fc68d3d88abd50b59f3c6f36a63b51793c8699c0a52440"); - public static final Block COLD_STRIDER_TATER = createTaterBlock(ParticleTypes.SNOWFLAKE, "a71ba7597744db25f0efa20b87c3e6aa284385dfacf24952c80b87afa7f6cc84"); - public static final Block COW_TATER = createTaterBlock(ParticleTypes.HEART, "945f14291e91f120e9afba2729302cb75e7eab2afd7f3c39129f14dfc8061c55"); - public static final Block CRAFTING_TATER = createTaterBlock(Blocks.CRAFTING_TABLE, "c888ec7f32ee555a29e073600961f90618203e60baf13a077f4821c4b98bd62f"); - public static final Block CRIMSON_NYLIUM_TATER = createTaterBlock(ParticleTypes.CRIMSON_SPORE, "c47f7ef4d21df90eaa2cf876d53a02773b13262f90324b03d94546fa0b52cb5a"); - public static final Block CRIMSON_STEM_TATER = createTaterBlock(Blocks.CRIMSON_STEM, "247fee4d47e209761521a3adc8f79c3f69b9cd6083849a279d375e847fca369d"); - public static final Block DARK_OAK_LOG_TATER = createTaterBlock(Blocks.DARK_OAK_LOG, "623ceb12251eb2e570210a8433213078d3b512b759e2906f6311d2fcc9524886"); - public static final Block DAYLIGHT_DETECTOR_TATER = createDaylightDetectorTaterBlock("3523f4c9e9bccbd42ababb9f8fce50f1a27260efe00d20a425c6b2968a7af227", false); - public static final Block DEAD_BRAIN_CORAL_TATER = createTaterBlock(ParticleTypes.BUBBLE_POP, "5db8256bd78f3e34e2666ae29f29433aa7187525fbf3e539c3bf010a28ca3935"); - public static final Block DEAD_BUBBLE_CORAL_TATER = createTaterBlock(ParticleTypes.BUBBLE_POP, "bc0d41055df5ba2342dedd76fedb0d7f3f2d992ebdb5870e426c61dcf2c67686"); - public static final Block DEAD_FIRE_CORAL_TATER = createTaterBlock(ParticleTypes.BUBBLE_POP, "88cb70f602f9bc3064c34f80f47148a7a6c32ddc6f5580dd09fae47812e95d31"); - public static final Block DEAD_HORN_CORAL_TATER = createTaterBlock(ParticleTypes.BUBBLE_POP, "a5ae31b1dbdd251643835268750699b880d83c2cee7578745ccc6adb2780d192"); - public static final Block DEAD_TUBE_CORAL_TATER = createTaterBlock(ParticleTypes.BUBBLE_POP, "236d9b535fe8fb6f0bca188f5a6feda3c72423d2bf3d226a85983d5805319b72"); - public static final Block DEEPSLATE_BRICK_TATER = createTaterBlock(Blocks.DEEPSLATE_BRICKS, "3853ed89b5e05717e7bd00e9a33d7e65ebde55e81c0ef868fecc7d2158bc6a1f"); - public static final Block DEEPSLATE_TATER = createTaterBlock(Blocks.DEEPSLATE, "b76d7b1d85b8b724930470eb2986b914b85c4983fc5651a55f09571ababc8b42"); - public static final Block DRIED_KELP_TATER = createTaterBlock(Blocks.DRIED_KELP_BLOCK, "bc2abdca594bfb97b2a4b49d88ef7bc01969171a89be411426ce5c0f94fa7a94"); - public static final Block DROWNED_TATER = createTaterBlock(ParticleTypes.NAUTILUS, "5ea6f03c0cab4a968976ad95beaba4c60ab46755aa7ff8400b2d87383df6b885"); - public static final Block EYE_OF_ENDER_TATER = createTaterBlock(ParticleTypes.REVERSE_PORTAL, "36fc9fc2b0ab94a11303e3efb8b2534662e5d11ac8a9b9310b588a512eaab55e"); - public static final Block FOX_TATER = createTaterBlock(ParticleTypes.HEART, "d0d40bc2aa788d6f9d0e3fcde50714f3f47d5db64f3d6a11b2c3fad2b65ba1ea"); - public static final Block GHAST_TATER = createTaterBlock(ParticleTypes.DRIPPING_OBSIDIAN_TEAR, "66585c4fc057e15bfc28db7ae8ac778016504f31d5422dfda2345967ba53c44f"); - public static final Block GILDED_BLACKSTONE_TATER = createTaterBlock(Blocks.GILDED_BLACKSTONE, "987e60212d2d60123e26d1be977de784aa1afc781522645c9a74e492f2295e67"); - public static final Block GLOW_SQUID_TATER = createTaterBlock(ParticleTypes.GLOW_SQUID_INK, "edd69cada8e6095770ffcfc91fd6df851630efd3bad08dfce78bcb30a5702909"); - public static final Block GLOWSTONE_TATER = createTaterBlock(ParticleTypes.GLOW, "58283dd855f99826c8e938d0f162f111b067bad26685e606b35c847946e4f38f"); - public static final Block HUSK_TATER = createTaterBlock(Items.ROTTEN_FLESH, "26a88dfb103e0a938776bb27d464bdbc02d39229869975179f1376808a6744b5"); - public static final Block INVERTED_DAYLIGHT_DETECTOR_TATER = createDaylightDetectorTaterBlock("b721a9503c2c2b25e5dffe5bad1f8bd9f4f620f5ad79a4568322b405973426dd", true); - public static final Block JUNGLE_LOG_TATER = createTaterBlock(Blocks.JUNGLE_LOG, "fd9658650626b1c63fe8fa5f10e5a981a400532de45153cfe481f302d8980818"); - public static final Block MAGMA_CUBE_TATER = createTaterBlock(ParticleTypes.DRIPPING_LAVA, "b34a0d09a2721e18afd3f4c1f2abf630734566e5e04054cc086945dd3af4a1b3"); - public static final Block MOOBLOOM_TATER = createTaterBlock(ParticleTypes.COMPOSTER, "a5a022dae96e419275a0bf5dfabde2d1c4dd073376d52265bee5dd67776ee5a2"); - public static final Block MOOLIP_TATER = createTaterBlock(ParticleTypes.CHERRY_LEAVES, "271e15bc807ccf8ecdd594bac37680c06aeb7ec46ce071f225cf207d718654a2"); - public static final Block MUDDY_PIG_TATER = createTaterBlock(ParticleTypes.HEART, "70137b92b07e1c24c6d3042daa2997a871383c7278d88e3ecf1964e4b75ff993"); - public static final Block MUSHROOM_STEM_TATER = createTaterBlock(Blocks.MUSHROOM_STEM, "104dd3bad53758af4eb92be90e78277a6201e63d63614c463c5156d210a61c11"); - public static final Block NETHER_BRICK_TATER = createTaterBlock(Blocks.NETHER_BRICKS, "751534292b1f5e13c8cea2d4f4f653c9f46cb63f5e2ad480c24fc98f22a027c0"); - public static final Block NETHERRACK_TATER = createTaterBlock(Blocks.NETHERRACK, "787fea3e6c6da9693d74b0607d6c7c8081dd75458a5b52110a4761d30775040f"); - public static final Block OAK_LOG_TATER = createTaterBlock(Blocks.OAK_LOG, "13d4a4903b8374b799549775e0f9d45bbd9b2b219edff4d1ddb268472ca47a29"); - public static final Block PIG_TATER = createTaterBlock(ParticleTypes.HEART, "530a64b89a9a46c58300eae437817789afab264c0be187b6f2733ab24adc8480"); - public static final Block POLAR_BEAR_TATER = createTaterBlock(Blocks.SNOW_BLOCK, "92a9da572909635f119bdaa54162991f44c99812fa3e504fe2305e2c8210ddf2"); - public static final Block PUFFERTATER = createTaterBlock(ParticleTypes.DRIPPING_WATER, "4d777aa416424b7bb713c158117f7392a74ebd1fe49eff6fa2c4b1192720eb48"); - public static final Block RED_MOOSHROOM_TATER = createTaterBlock(ParticleTypes.HEART, "3f41d3f6948a08ca1388b31cde2d629364ccb2a21a4b20bfec618ec37637e803"); - public static final Block RED_MUSHROOM_TATER = createTaterBlock(Blocks.RED_MUSHROOM_BLOCK, "2730185a1933b6e90c1d4ab439aeac51259f428732b4cb38fcfe4988cb0994d1"); - public static final Block RED_NETHER_BRICK_TATER = createTaterBlock(Blocks.RED_NETHER_BRICKS, "70986bf9dba2c063c3afa5643a79a4adf7379e249bbae67861ae3eb89b8bfe91"); - public static final Block RED_SANDSTONE_TATER = createTaterBlock(Blocks.RED_SANDSTONE, "557a2c97c9225ca72cc2507f465a0ff96c949035d8f53a9420d7cdf6f875b805"); - public static final Block RUBY_TATER = createTaterBlock(ParticleTypes.HAPPY_VILLAGER, "becb1ee95fba3f868fc36c126e5962244ac4bf64cd35b117871e62590a1660ed"); - public static final Block SANDSTONE_TATER = createTaterBlock(Blocks.SANDSTONE, "dee6a6e0c3521db9b0279d4d5a11f009e196cfe6e1f5babf1e09d99f5c48ba13"); - public static final Block SEA_PICKLE_TATER = createTaterBlock(ParticleTypes.UNDERWATER, "ec327a8c1dddd36722345cb12f627e99fdd9b56151f34e2d45794628f08f682a"); - public static final Block SHEEP_TATER = createTaterBlock(ParticleTypes.HEART, "2e00da1671dd107fade939288e944bbf02609b13f0d0ff9d4e81448cf37ab26c"); - public static final Block SHIELDED_WITHER_TATER = createTaterBlock(ParticleTypes.SOUL, "7331e65f919d20063df086e2423340fac6d594207b525600d0776aec86fadb30"); - public static final Block SNOW_FOX_TATER = createTaterBlock(ParticleTypes.HEART, "bd1d473e3e82d0afca0f7568748f0ff637334632cfb5f6ac228533fadf9bbbf5"); - public static final Block SPIDER_TATER = createTaterBlock(Items.SPIDER_EYE, "8c711ae226b0e84806e93986ad175e855e07d8b23c2fc369596549f571c739f0"); - public static final Block SPRUCE_LOG_TATER = createTaterBlock(Blocks.SPRUCE_LOG, "87a820cdad664cf54f98e36f70c92592c584c8a586003eb6ebfcff2f93cda0dc"); - public static final Block SQUID_TATER = createTaterBlock(ParticleTypes.SQUID_INK, "9896dd194df00aa0f48474dc75c9bb45fa7813ae50e42c4a69f08c2d1b3c4759"); - public static final Block STRAY_TATER = createTaterBlock(Blocks.BONE_BLOCK, "2d7952ac41e6dafcd3adeaad656728a06599cfa5173085d42ca4fcdf8fb76c44"); - public static final Block STRIDER_TATER = createTaterBlock(ParticleTypes.LAVA, "730c64d1460190f05169a9f6d1292b298c7ff9673083aed0a22a221153a0f519"); - public static final Block TURTLE_EGG_TATER = createTaterBlock(Blocks.TURTLE_EGG, "7e7054403552090e60bb5f4025e06f5bfb513c989a5e87ad88cfe468129ed7f1"); - public static final Block WARPED_NYLIUM_TATER = createTaterBlock(ParticleTypes.WARPED_SPORE, "2c80206143d8e76cee31adf8ae64ba4c67d6335abf123f4eb973cf302f6ca2cf"); - public static final Block WARPED_STEM_TATER = createTaterBlock(Blocks.WARPED_STEM, "2e471eadd1d8195bd5584e1e266ba4c7148c968fb173735c4a6975b590756af"); - public static final Block WITHER_TATER = createTaterBlock(ParticleTypes.SOUL, "71346598ada1df7f8bc27dde4af895db1655f5d3d1b7d5d4831556feb84ddca8"); - - public static final Block AZALEA_TATER = createTaterBlock(Blocks.AZALEA_LEAVES, "dc836641ecb40e775f85f4c71b219120e43080e03b8c84a7f60f1ba8127f2931"); - public static final Block BELL_TATER = createBellTaterBlock("a84b726a75b81393e206c19ca508570a8a8db64f88b90775eb451214ab0d7561"); - public static final Block COLD_FROG_TATER = createTaterBlock(ParticleTypes.SPLASH, "f58f867bb5f570c7ca9afa97a698a3ea22b6218a0445958dc8bacdb53976da2e"); - public static final Block CONDUIT_TATER = createTaterBlock(ParticleTypes.NAUTILUS, "c59d90ffba4debacc7f8cb400c40e36e15902166cd5544baac5fbbb830a1c58c"); - public static final Block ELDER_GUARDIAN_TATER = createElderGuardianParticleTaterBlock("386f90f38959c5652ce3bd2840bdb18036d3153f6284e12af07f000663c536fe"); - public static final Block END_STONE_BRICK_TATER = createTaterBlock(ParticleTypes.END_ROD, "5c0a9483d2b43c284dc8abd6149342dc63136f3bb208476e17f434059ece4582"); - public static final Block FLOWER_POT_TATER = createTaterBlock(ParticleTypes.COMPOSTER, "5378b1804af0875cb00fd350e6116bfd2165db209ed8b8e0c48f984669553f45"); - public static final Block GUARDIAN_TATER = createTaterBlock(Blocks.PRISMARINE, "c152df6875886f29a0f1f110c2a54820248ceef688fe150797dde4e9d4863c0e"); - public static final Block ILLAGER_TATER = createTaterBlock(ParticleTypes.ANGRY_VILLAGER, "522c1190fb561f1dfc994b281eb145955e2e439511c83aaf64fed1ab09ec1316"); - public static final Block ILLUSIONER_TATER = createTaterBlock(ParticleTypes.ENTITY_EFFECT, "6c31b980a02847d5ac948663e95604e754e0b736d4593c7841332833144f2782"); - public static final Block JUKEBOX_TATER = createTaterBlock(ParticleTypes.NOTE, "75f6f61e3a9035a758174979ca664b26e47ca9b273f324f0921b5ad58bdb5835"); - public static final Block LANTERN_TATER = createTaterBlock(ParticleTypes.FLASH, "16c275f657bac1363333abf1db0d18bfabf087fbf3df356ec7f41258bc16b76d", 20); - public static final Block PIGLIN_TATER = createTaterBlock(Blocks.GOLD_BLOCK, "4df6290ac1aff8b179420f2a05baa3c721a5cf49f3bd8f9928a0a57c0cf369e"); - public static final Block PINK_WITHER_TATER = createTaterBlock(ParticleTypes.HEART, "93592323dbce9eec933aa915af71701b77ee478f7e1dd126501a027b1d430bc7"); - public static final Block PISTON_TATER = createTaterBlock(Blocks.PISTON, "84a5081444bb13cf75bc8040020e91f39e056cf273cd8ebe528e09100a183e53"); - public static final Block PURPUR_TATER = createTaterBlock(ParticleTypes.END_ROD, "9c619e55d60579e21126a5c0b88fd8b8baa98d24d1299ed1515fa1452f6ab898"); - public static final Block SOUL_LANTERN_TATER = createTaterBlock(ParticleTypes.SOUL_FIRE_FLAME, "a9419cebd15ebc79fe8eba6984637f3c2892e6d68fcc4caa0f3499cfddec25ce"); - public static final Block SOUL_SOIL_TATER = createTaterBlock(ParticleTypes.SOUL, "c45eb5699f0fafaa6d8e33227e2e626def520545392dffbfa6a071feec239049"); - public static final Block STICKY_PISTON_TATER = createTaterBlock(Blocks.SLIME_BLOCK, "404735be9d3e0dea9cec3d4a035fa4b0668b0a7e79cafecb80decba02ace2451"); - public static final Block TEMPERATE_FROG_TATER = createTaterBlock(ParticleTypes.SPLASH, "e2dd56ee8f70c6bbb0fb43ed875071b1ed4a4a8130cb4f8dd17869e1395beb4e"); - public static final Block UNDERWATER_TNTATER = createTaterBlock(ParticleTypes.EXPLOSION, "fd90716acd4dd643bef71a84e44bc5cb75ec8ab260986dd679452778c80f8496", 10); - public static final Block VEX_TATER = createTaterBlock(ParticleTypes.ENCHANTED_HIT, "9f15dcbe0bde9f613146ba4d51d5448eaf80d260bdb323d2358371e8c3d50829"); - public static final Block VILLAGER_TATER = createTaterBlock(ParticleTypes.HAPPY_VILLAGER, "7c34f81b74855b9c6a2da0a9000039871a17631976c9f9d0850ae30e31b98397"); - public static final Block VINDITATER = createTaterBlock(ParticleTypes.ANGRY_VILLAGER, "5ca5f1069c3399ea3eda014b9dc5aac3827116ed93617bb44ba87717b11ff98a"); - public static final Block WANDERING_TRADER_TATER = createTaterBlock(ParticleTypes.HAPPY_VILLAGER, "860592fc5385f74ffe8c3e3e9f1ad16a5a865bcfa33697483ff7a5da3a784392"); - public static final Block WARM_FROG_TATER = createTaterBlock(ParticleTypes.SPLASH, "7ea9de371ba4a3edfe8260a559c7cc25564d2cdbb7097d0d3575908a8b627f10"); - public static final Block WAX_TATER = createTaterBlock(ParticleTypes.LANDING_HONEY, "acc39045a9f072a3adce91f7dd75ce2385cf6c8c251adb5d7e98ae999ae81777"); - public static final Block WITCH_TATER = createTaterBlock(ParticleTypes.ENTITY_EFFECT, "1a02c42db26bda231513924f916c1a37abe89255ab3cb77d7da95469052917f3"); - public static final Block ZOMBIE_VILLAGER_TATER = createTaterBlock(Items.ROTTEN_FLESH, "7e37fe7abf9ee78de2889993e24d3fc7784269f03ae65da2d8ab7a59e0d1516f"); - public static final Block ZOMBIFIED_PIGLIN_TATER = createTaterBlock(Items.ROTTEN_FLESH, "248b2a6973bbeb1a3e48c8e0b695d733d5a4e25272a639d248d89cf4129cc2e9"); - - public static final Block BONE_SPIDER_TATER = createTaterBlock(Blocks.BONE_BLOCK, "dcde0b254cf7d0e8a170c667de621c414e7475e06dafa8ada868224a2fa7a29b"); - public static final Block BOULDERING_ZOMBIE_TATER = createTaterBlock(Items.ROTTEN_FLESH, "ca552c8f68cd8e46bd493e77a1726d7e03a460fc89ec80d273499521cf9831f0"); - public static final Block CHARGED_CREEPER_TATER = createTaterBlock(ParticleTypes.EXPLOSION, "16134034e6d24f5f723171de2428c92106cd261d329d965195a9065ff5378b00", 10); - public static final Block LOBBER_ZOMBIE_TATER = createTaterBlock(Items.ROTTEN_FLESH, "4178a5a659a245900fbdc468f4d421c34fa0d1c7e0ff1f47be9de580648035fe"); - public static final Block MOSSY_SKELETATER = createTaterBlock(Blocks.MOSS_BLOCK, "9c07242332a0b5c85f69f626b83a28bea93a41c51f7c5c1c9bcadea6ea7f6895"); - public static final Block STRIPPED_ACACIA_LOG_TATER = createTaterBlock(Blocks.STRIPPED_ACACIA_LOG, "1ac99e952e6f5e42066139fa692179f23d33281521d65901079e403a52edd430"); - public static final Block STRIPPED_BIRCH_LOG_TATER = createTaterBlock(Blocks.STRIPPED_BIRCH_LOG, "b67e34704da63d6ba4f3c91fc9aab11b5efc36e0f823d4d9c84ef021149585c4"); - public static final Block STRIPPED_CRIMSON_STEM_TATER = createTaterBlock(Blocks.STRIPPED_CRIMSON_STEM, "ff702bf5fb8a672fd89696a0a09999db06b22cdc4a175fd5366916d84297da82"); - public static final Block STRIPPED_DARK_OAK_LOG_TATER = createTaterBlock(Blocks.STRIPPED_DARK_OAK_LOG, "439b09449076c58a911d464256c29dd5d634852287630c05f1c3c82a4368ce62"); - public static final Block STRIPPED_JUNGLE_LOG_TATER = createTaterBlock(Blocks.STRIPPED_JUNGLE_LOG, "1e811034ee1631e7f560ff35b6bdb5e0b460b559d799740ac59d0e2d2c0bb9e9"); - public static final Block STRIPPED_OAK_LOG_TATER = createTaterBlock(Blocks.STRIPPED_OAK_LOG, "7cf7cfc6763ba87781f1de7f76ec5a26436c14a74b1292f7d2409f399dd72773"); - public static final Block STRIPPED_SPRUCE_LOG_TATER = createTaterBlock(Blocks.STRIPPED_SPRUCE_LOG, "7a1f047b2d61b14e717f6c42f67af5da1d101d0a37340c6e497f3e3af1d62691"); - public static final Block STRIPPED_WARPED_STEM_TATER = createTaterBlock(Blocks.STRIPPED_WARPED_STEM, "54453447dfc628793e1c704509fd24dd3effcaff9ce6aba16efbee3a1001d65f"); - public static final Block TROPICAL_SLIME_TATER = createTaterBlock(ParticleTypes.FISHING, "473d7ffeeb9562e1c0fe59ac45dbec370750793cd6acbd01e26c3a02cea77fea"); - - public static final Block APPLE_TATER = createTaterBlock(Items.APPLE, "379e6c96a907fce60e8c0c55b02b554663e50f6dff9eee113e3742f8779c0304"); - public static final Block GOLDEN_APPLE_TATER = createTaterBlock(Items.GOLDEN_APPLE, "27a47cff605fb936bb826109bb2b5e77dc3210e211f2f53c8470cf8ed2c80476"); - public static final Block ICE_TATER = createTaterBlock(Blocks.ICE, "bc89a947d4fd385418f3352f2137bae390cbdf96d5fb479b59a97029f34e1461"); - public static final Block KING_TATER = createTaterBlock(ParticleTypes.TOTEM_OF_UNDYING, "b8b7fc416de5d8a0f1b6f6a7234e6789fb46fed358522fe90da8f92ceafeea3b"); - public static final Block RAW_COPPER_TATER = createTaterBlock(Blocks.RAW_COPPER_BLOCK, "e02d263510b34498c8814b11c8deefb754d647c4444db61527b600a88b566204"); - public static final Block RAW_GOLD_TATER = createTaterBlock(Blocks.RAW_GOLD_BLOCK, "c9cf35e928c3b94a29a6049414cd411bd223da3dd232b7a6bbb34fbf37e5db53"); - public static final Block RAW_IRON_TATER = createTaterBlock(Blocks.RAW_IRON_BLOCK, "50d19e2e668e4c6329b1491c43a75e8b484fa5ef834ff3bacdb56fcc2d49c235"); - - public static final Block ALLAY_TATER = createTaterBlock(ParticleTypes.HEART, "36911b99859c6627cba710041a7ce4ab17791e5c9278a85c75c1596dd1c789bb"); - public static final Block MANGROVE_LOG_TATER = createTaterBlock(Blocks.SPRUCE_LOG, "2ab0654a238462e8f1746431d05dfd13d95260031afe335b696feaa6bb49d678"); - public static final Block MANGROVE_TATER = createTaterBlock(Blocks.CRIMSON_PLANKS, "42ccd79aabbb47ae9bdb6b00ad9f43e65d098cc27caa3a2cd8d94b283f726464"); - public static final Block MUD_BRICK_TATER = createTaterBlock(Blocks.TERRACOTTA, "e37555d890f905e72083844ca751a661d84ed599ac649dc382174af2180ba12"); - public static final Block MUD_TATER = createTaterBlock(Blocks.STONE, "f83561c253f837c077d9e5394f71167220f9966aafe1d59a87caacbd0a3e4814"); - public static final Block PACKED_MUD_TATER = createTaterBlock(Blocks.DIRT, "67a5911061c9497c1e888aabe97370d4d00f900ca798cb1ac8cf41fe7bb41532"); - public static final Block STRIPPED_MANGROVE_LOG_TATER = createTaterBlock(Blocks.STRIPPED_CRIMSON_STEM, "c03d0e7742fa66506b5739c98d0cf29411463608877fa667ce29c7b85793d18a"); - - public static final Block LUCY_AXOLOTL_TATER = createTaterBlock(ParticleTypes.HEART, "721a824dcfa8d7503f008f59d7e4874a58ba6f6351750720c78a55eb24211fb6"); - public static final Block WILD_AXOLOTL_TATER = createTaterBlock(ParticleTypes.HEART, "861a7607987e0751e10c3d819775b58c45dba2911bd5222ca8111a8401248d56"); - public static final Block GOLD_AXOLOTL_TATER = createTaterBlock(ParticleTypes.HEART, "9e8dff1cf4f1e76c76993ab9316ef7904b229c37b8cbd1876ccb8c9bcbd36502"); - public static final Block CYAN_AXOLOTL_TATER = createTaterBlock(ParticleTypes.HEART, "9d61be444b360184cc39faecfac849359ba56843e1469a3c4687f004b9a7ae65"); - public static final Block BLUE_AXOLOTL_TATER = createTaterBlock(ParticleTypes.HEART, "88bc29626c5311e82f18a692d7b26bec5b841a0533ba633e5887a172c765bf05"); - - public static final Block BRONZE_CAPSULE_TATER = createCapsuleTaterBlock(Vec3d.unpackRgb(0x764D22).toVector3f(), 90, "7391822504d79491186d42b5ab6fdd9615bfc1886324be5f5b613dcb03319677"); - public static final Block SILVER_CAPSULE_TATER = createCapsuleTaterBlock(Vec3d.unpackRgb(0xBFBFBF).toVector3f(), 9, "afdce3ea1399dd0b738faaecf89cc5bdcf179b8dc4f3d7964c8cd45c89257fd1"); - public static final Block GOLD_CAPSULE_TATER = createCapsuleTaterBlock(Vec3d.unpackRgb(0xF1A00E).toVector3f(), 1, "db5388834578ccb906e97d3e54aeb33edcc12d821f081b7eb04830cbd260ad81"); - - public static final Block CORRUPTATER = new CorruptaterBlock(createTaterBlockSettings(), 2); + public static final Block WARDEN_TATER = registerWardenTaterBlock("warden_tater", "52e411aa1501c72d99d738cb38e250a395c6604b8bccc9f29d7f26e9cacd8d6f"); + public static final Block VIRAL_TATER = registerTaterBlock("viral_tater", ParticleTypes.SCRAPE, "b12f770c4542c9f26ba03aaee686e0946698d394a8e745d3eac6013383dcff29"); + public static final Block DICE_TATER = registerDiceTaterBlock("dice_tater"); + public static final Block TATEROID = registerTateroidBlock("tateroid", SoundEvents.BLOCK_NOTE_BLOCK_BELL, -1, "8d531d40d09efd3a9a585b55e66a9a6f04c73af84d94d7c565549bf27b8b26bd"); + public static final Block RED_TATEROID = registerTateroidBlock("red_tateroid", SoundEvents.BLOCK_NOTE_BLOCK_GUITAR, 7 / 24d, "2be51b227360ab65776725a91cded84b56f6920eec0d6fb5a57d5f1ada147aa6"); + public static final Block ORANGE_TATEROID = registerTateroidBlock("orange_tateroid", SoundEvents.BLOCK_NOTE_BLOCK_BASEDRUM, 4 / 24d, "c5362e308822cf1c436a4ba6d0c3976139c98621c7aa2a96be99c73e97708efc"); + public static final Block YELLOW_TATEROID = registerTateroidBlock("yellow_tateroid", SoundEvents.BLOCK_NOTE_BLOCK_CHIME, 2.5 / 24d, "fef74a6c7cb45d3c4bae134e6ec41fd7517f7eabe2c74dc76a51b39c63c38bc2"); + public static final Block GREEN_TATEROID = registerTateroidBlock("green_tateroid", SoundEvents.BLOCK_NOTE_BLOCK_BIT, 21 / 24d, "57bb692499560f0393314a9f1ec11425b360e43c1ddb560de261cd04b8cc8e69"); + public static final Block BLUE_TATEROID = registerTateroidBlock("blue_tateroid", SoundEvents.BLOCK_NOTE_BLOCK_XYLOPHONE, 17 / 24d, "89ad5aecfb9ab6f36261e0c462acecf2078e7e575d9373bacc0503224c44250e"); + public static final Block PURPLE_TATEROID = registerTateroidBlock("purple_tateroid", SoundEvents.BLOCK_NOTE_BLOCK_FLUTE, 11 / 24d, "d16a37512cb7ca372af5f37f9bd95d4603c4fa44be4143fb26aaa324e681c9b0"); + + public static final Block WHITE_TATER = registerColorTaterBlock("white_tater", DyeColor.WHITE, "73dab052d33ee467ba7fac9aa0e316db962e3e7ac6dbbff236667439e340392c"); + public static final Block ORANGE_TATER = registerColorTaterBlock("orange_tater", DyeColor.ORANGE, "75b88126dbd4e860608965c044d0060ac03c26ebea1b652643fe03734ea1b12b"); + public static final Block MAGENTA_TATER = registerColorTaterBlock("magenta_tater", DyeColor.MAGENTA, "bef4cf40f02bc129e34f660ce3923387894b8f0814fc58c09726629fa7b1db64"); + public static final Block LIGHT_BLUE_TATER = registerColorTaterBlock("light_blue_tater", DyeColor.LIGHT_BLUE, "e6f7e4641fa4ee4ba926ebae4669f22f276051b3629f8d89ce015a95c1137fb2"); + public static final Block YELLOW_TATER = registerColorTaterBlock("yellow_tater", DyeColor.YELLOW, "5956df3e88f01cdd26d1caa07fab723c3a3db319ba167a3bed287d461635f1b9"); + public static final Block LIME_TATER = registerColorTaterBlock("lime_tater", DyeColor.LIME, "16671f4c7ce8e46099f367fc05c5b61089c887f4145aff2077a1a7d3631dd063"); + public static final Block PINK_TATER = registerColorTaterBlock("pink_tater", DyeColor.PINK, "b3efebba4906f9f260aae83fee73012370521726fadf0101498197d7143a64df"); + public static final Block GRAY_TATER = registerColorTaterBlock("gray_tater", DyeColor.GRAY, "7e491b6282eca12c9edcddfb3baf6e5fb0549c89d39088567415616c92dfd5f0"); + public static final Block LIGHT_GRAY_TATER = registerColorTaterBlock("light_gray_tater", DyeColor.LIGHT_GRAY, "b5df73cc026043d09c54cb15d0923e314503e1d513026b59a5317b31da4c5289"); + public static final Block CYAN_TATER = registerColorTaterBlock("cyan_tater", DyeColor.CYAN, "4eb39032053a3f2e5bd1d19bfacd25b524b19cd0e70a5a92a61ac884904ecb54"); + public static final Block PURPLE_TATER = registerColorTaterBlock("purple_tater", DyeColor.PURPLE, "ab69ffa68135001e8714c78617e5a1a0177827cbbd866eb984f524f023f87fe5"); + public static final Block BLUE_TATER = registerColorTaterBlock("blue_tater", DyeColor.BLUE, "618be72e94291de1cc3e3d2e2fa8bbd79422cdcb0cb70cedde7dc9c1bbef5fb5"); + public static final Block BROWN_TATER = registerColorTaterBlock("brown_tater", DyeColor.BROWN, "df942f7c24f4c10353da974a938ad75f9a7ccdca232a99de870c5691d75fd70c"); + public static final Block GREEN_TATER = registerColorTaterBlock("green_tater", DyeColor.GREEN, "fab98a4c69e817771fec17c08c7e031952c05a52015dcecb09c93576745c71e2"); + public static final Block RED_TATER = registerColorTaterBlock("red_tater", DyeColor.RED, "51e4bf6f7a029567d598fff73c3c76e0cdea956a7fff5ea7279ea4bf40c968c2"); + public static final Block BLACK_TATER = registerColorTaterBlock("black_tater", DyeColor.BLACK, "57a7caa44cedff925d23cd5d3f62bc06e83d3485551dcc4f9db2da7d9f8a9694"); + + public static final Block COAL_TATER = registerTaterBlock("coal_tater", Blocks.COAL_BLOCK, "7eb25d3f8fcf48673ad0b171ea37154b43d57f6ab04d8ffb546fc606b8505bf4"); + public static final Block DIAMOND_TATER = registerTaterBlock("diamond_tater", Blocks.DIAMOND_BLOCK, "a399c9d599e0d9dc6a480e85f4dbecc45b318814026895ac8150fd2e2fa2599e"); + public static final Block EMERALD_TATER = registerTaterBlock("emerald_tater", ParticleTypes.HAPPY_VILLAGER, "cd76730df726b8ee9d72a3a478457d313626133de1d76c26cfc6af8e80e9c476"); + public static final Block GOLD_TATER = registerTaterBlock("gold_tater", Blocks.GOLD_BLOCK, "180a7cc71153b89a536c148d2f1012d6772a7d3ba8321f922a6de46773c35af9"); + public static final Block IRON_TATER = registerTaterBlock("iron_tater", Blocks.IRON_BLOCK, "174858c976f0274ebce3f3ffcef653609f29d37e0cc9cad25e586864b806cb23"); + public static final Block LAPIS_TATER = registerTaterBlock("lapis_tater", Blocks.LAPIS_BLOCK, "58d5cbda5c5046bf0b0f0d447c2fcc5e468707b6a4837c083af8e109aba9ce1c"); + public static final Block NETHERITE_TATER = registerTaterBlock("netherite_tater", Blocks.NETHERITE_BLOCK, "664dce4fade8e5f352001eff6900d9d4b142935ebed303106539f7ad0193621f"); + public static final Block QUARTZ_TATER = registerTaterBlock("quartz_tater", Blocks.QUARTZ_BLOCK, "7e7b4561d09d1a726fec3607706c9e3c77e8fc9b8c7e9c3637ca80ea0c86be21"); + public static final Block REDSTONE_TATER = registerRedstoneTaterBlock("redstone_tater", new DustParticleEffect(DustParticleEffect.RED, 1), "c47dd2536f5a5eb2bdb1ea4389d3af8ca2fd9d5d2c97c660fc5bf4d970c974de"); + + public static final Block COPPER_TATER = registerTaterBlock("copper_tater", ParticleTypes.SCRAPE, "18207c7cf4007222691750b0783d6959261ddf72980483f7c9fcf96c2cba85b1"); + public static final Block EXPOSED_COPPER_TATER = registerTaterBlock("exposed_copper_tater", ParticleTypes.SCRAPE, "bd5020090643edb5ec25d87cb1f408aad4f6018ec4bbe83d25a031ef1e705e4d"); + public static final Block WEATHERED_COPPER_TATER = registerTaterBlock("weathered_copper_tater", ParticleTypes.SCRAPE, "7d9c61d68241667f8e462d18a84c1413ce3db13f93223912201c21327b4adb25"); + public static final Block OXIDIZED_COPPER_TATER = registerTaterBlock("oxidized_copper_tater", ParticleTypes.SCRAPE, "c7e9172d0ec2d20588bf5596ea79403e3da26975cdc5b6d0624e31857774298c"); + + public static final Block CAKE_TATER = registerTaterBlock("cake_tater", Blocks.CAKE, "6d46fd58fd566bc0a90f8bc921daf0d9920591a5b153e64a80bb6d54dfb415b9"); + public static final Block ENDERTATER = registerTaterBlock("endertater", ParticleTypes.PORTAL, "1f4f68547ec0d04a1a5c52ce8bb84847cd07674d50cf0740bf6f9c505826892d"); + public static final Block FURNACE_TATER = registerTaterBlock("furnace_tater", ParticleTypes.SMALL_FLAME, "80bdb710ee3d17de73bcf51dfcbc1f61e4dc3fd7a751d517bfd814b202b907bb"); + public static final Block MELON_TATER = registerTaterBlock("melon_tater", Items.MELON_SLICE, "a3d21fbdca84efe016f75075ce55cf11382bf03bb691336b1e0f84c727d8c271"); + public static final Block PUMPKIN_TATER = registerTaterBlock("pumpkin_tater", Blocks.PUMPKIN, "21004377d30b55fd2f176e50e431ba88bd9eb8f353b103a67098a3fcbc12119d"); + public static final Block JACK_O_TATER = registerTaterBlock("jack_o_tater", Blocks.JACK_O_LANTERN, "16772b77233f9d9035436287861b206ac13112d552a6c8e9754b26486b1e5bd"); + public static final Block SCULK_TATER = registerTaterBlock("sculk_tater", ParticleTypes.SOUL, "4265450388096aeb3d228c3b99f6ec64ea4a1a846c9903c7d9db1c309e27469b"); + public static final Block SLIME_TATER = registerTaterBlock("slime_tater", Blocks.SLIME_BLOCK, "16747a7e1605794debfbb43befda2ce986075b3969e0b247ddd7bc6cdaa56a51"); + public static final Block HEROBRINE_TATER = registerElderGuardianParticleTaterBlock("herobrine_tater", "6e9ca544a4561b8cbcdb35820779960497ea748d685e2b17c814a18dc19147fd"); + public static final Block OCHRE_FROGLIGHT_TATER = registerTaterBlock("ochre_froglight_tater", ParticleTypes.SPIT, "92c34818ed06f3d76af6daabe87ab5b9a8c425865eaed0f873470af458b3152e"); + public static final Block PEARLESCENT_FROGLIGHT_TATER = registerTaterBlock("pearlescent_froglight_tater", ParticleTypes.SPIT, "b7e33a69c99e044b98d0a11b830ef7b764d6de9874f24b4f44610f565b76fab1"); + public static final Block VERDANT_FROGLIGHT_TATER = registerTaterBlock("verdant_froglight_tater", ParticleTypes.SPIT, "96ae96a834b8eee8edadaaef368f4b0c93a34b2a634ef89efc14326d965f0040"); + public static final Block SNOWMAN_TATER = registerTaterBlock("snowman_tater", ParticleTypes.SNOWFLAKE, "89ceb42efcfc372cbb26f817e1707a16864af16e0e37c793db05b16cd1f82ac"); + + public static final Block ACACIA_TATER = registerTaterBlock("acacia_tater", Blocks.ACACIA_PLANKS, "807d75cb114e057e5156af324517e87012d11566beb112152be4a94a65273535"); + public static final Block ANDESITE_TATER = registerTaterBlock("andesite_tater", Blocks.ANDESITE, "5b728494483d695a171affd93730b65271726a5c8840d96a1acbf64b4dbdb555"); + public static final Block BAMBOO_TATER = registerTaterBlock("bamboo_tater", Blocks.BAMBOO, "acecf9447693e769f17469d67251cddb4b93e5b64efe7445d04ea286a50d8a3c"); + public static final Block BARRIER_TATER = registerMarkerTaterBlock("barrier_tater", Blocks.BARRIER, "d7f155b1a7627408e8f8c670fbd302c8fc0e320e5320b4fc517abfcfe02ab046"); + public static final Block BEDROCK_TATER = registerTaterBlock("bedrock_tater", Blocks.BEDROCK, "c782d793af7aa0ebf5f5c9fdde3f636f93683368bf1daa544a449342b48355b"); + public static final Block BIRCH_TATER = registerTaterBlock("birch_tater", Blocks.BIRCH_PLANKS, "c66003fcb840ebcd18f300b9facd1b8b936ef82e1ea6c7ca26b2c5b2bda5f007"); + public static final Block BONE_TATER = registerTaterBlock("bone_tater", Blocks.BONE_BLOCK, "72b59c778f6656bb8502810eac82997d3669563f4fdd6d24d5ac008d334e3172"); + public static final Block BRAIN_CORAL_TATER = registerTaterBlock("brain_coral_tater", ParticleTypes.BUBBLE, "edf7e38eb4130e94bc59412d480b91529206ada944ed4c698a5ef957917f32f8"); + public static final Block BRICK_TATER = registerTaterBlock("brick_tater", Blocks.BRICKS, "98adbfaa40e423ca12560484d26e3a049739a810490fa0b1564a765b1b65137d"); + public static final Block BUBBLE_CORAL_TATER = registerTaterBlock("bubble_coral_tater", ParticleTypes.BUBBLE, "7dc1f18b5b4ccce2171796002bc434e49c53aeb23829e4d6f1d505d340522248"); + public static final Block CACTUS_TATER = registerTaterBlock("cactus_tater", ParticleTypes.DAMAGE_INDICATOR, "69ebd5e707f1da0df71ecded8c5a6d853f3c47943bd5f167d029de7ad01f846d"); + public static final Block CHORUS_TATER = registerTaterBlock("chorus_tater", ParticleTypes.REVERSE_PORTAL, "dc85f3160fecd3659eb4fabb9544c130688ec9219f2031592c1abc5f63b80422"); + public static final Block CLAY_TATER = registerTaterBlock("clay_tater", Blocks.CLAY, "f9e2f8d3075e9bb78e237291c0a7f2cc17aff9959c735fba1863d243ae5fe3fc"); + public static final Block CRIMSON_TATER = registerTaterBlock("crimson_tater", Blocks.CRIMSON_PLANKS, "742731b12a9ffa0b0550b3e41c1f3d347ffb65d840dee2c8d22ec7bd2284050a"); + public static final Block DARK_OAK_TATER = registerTaterBlock("dark_oak_tater", Blocks.DARK_OAK_PLANKS, "f9df377e9f8647787a254792ae1fb1a6d03a7515642c26b74562572ffd51517d"); + public static final Block DARK_PRISMARINE_TATER = registerTaterBlock("dark_prismarine_tater", ParticleTypes.BUBBLE_COLUMN_UP, "98ec7227474cff245b820d30e59df47d1bf3b895dc8287e9de08102f6836a407"); + public static final Block DIORITE_TATER = registerTaterBlock("diorite_tater", Blocks.DIORITE, "162b67a6a24a8f0ed29dd33ba143038cebd346f8c87e0c38e532aa9957134be1"); + public static final Block DIRT_TATER = registerTaterBlock("dirt_tater", Blocks.DIRT, "15e74c322a4715d9a4c13595eb6cc720a4afef29c4da0892ebf4fc6ddd4cd1ae"); + public static final Block END_STONE_TATER = registerTaterBlock("end_stone_tater", ParticleTypes.END_ROD, "87b4943c4f8f658439899673e91ac15815ab28b5c9eb72c2bd371e08fd1ac0b"); + public static final Block FIRE_CORAL_TATER = registerTaterBlock("fire_coral_tater", ParticleTypes.BUBBLE, "beadd606c1c7095851ffa38aa8dff23f22dcd78c4449c0e8ca50089252d907c2"); + public static final Block GRANITE_TATER = registerTaterBlock("granite_tater", Blocks.GRANITE, "55cdae99f39b299f65d0a6ec3bd1fde2992689a664668482ab1d8a6d79dfc6e4"); + public static final Block GRASS_TATER = registerTaterBlock("grass_tater", Blocks.GRASS_BLOCK, "a999a144cbe51321291ed00b073511a102d1dbbd7e8bff53fa33a2738f105a75"); + public static final Block HAY_TATER = registerTaterBlock("hay_tater", ParticleTypes.HEART, "df65853f3ebf7c03e477fea14b19345b284bf591476461ac36d399c0dbb144fb"); + public static final Block HONEY_TATER = registerTaterBlock("honey_tater", ParticleTypes.DRIPPING_HONEY, "623f2ad832c27e145076f1267875547444dfb0cef80403921ed4d03a0859fae5"); + public static final Block HONEYCOMB_TATER = registerTaterBlock("honeycomb_tater", ParticleTypes.LANDING_HONEY, "e917928e35f2fac59aa1d14d80c478f38d14e2f66ee59d4eb9d025605406481"); + public static final Block HORN_CORAL_TATER = registerTaterBlock("horn_coral_tater", ParticleTypes.BUBBLE, "3e17f4d2977dafce018ac06163f2a7c5672855d198da86fa050f27a7c45b2da4"); + public static final Block JUNGLE_TATER = registerTaterBlock("jungle_tater", Blocks.JUNGLE_PLANKS, "b9105eebf99ec35ac08aaa2ed8ac721590adbdb1eb3a158a82c11e71e76d28aa"); + public static final Block LIGHT_TATER = registerLightTaterBlock("light_tater", "640ed4ea72aed9503c0519d3380ac480a20f9155c428d0571ad767eb4e8973b4"); + public static final Block MYCELIUM_TATER = registerTaterBlock("mycelium_tater", ParticleTypes.MYCELIUM, "f3447bbb99321b399b7a1913d9bc4e90e8b0fc9b9520af45a8f59a1540d4b620"); + public static final Block NETHER_WART_TATER = registerTaterBlock("nether_wart_tater", ParticleTypes.CRIMSON_SPORE, "81c05e8c91a4ca83120799053270dfd7fdf1376988a1a393645140ae89eb6762"); + public static final Block OAK_TATER = registerTaterBlock("oak_tater", Blocks.OAK_PLANKS, "28cfc208966e2f5206b1aba0489e5fdb3f05e6d94befbc618ad80e74eb1016d2"); + public static final Block OBSIDIAN_TATER = registerTaterBlock("obsidian_tater", Blocks.OBSIDIAN, "38adea8f484dba5baf67ace3ee7675758e2318868b2d72542ed3fff0d009f21"); + public static final Block PODZOL_TATER = registerTaterBlock("podzol_tater", Blocks.PODZOL, "5fe3cfce7c241fdaefe8d0255a545d2c329c1283232d61eaa7324b30a8f478f2"); + public static final Block PRISMARINE_BRICK_TATER = registerTaterBlock("prismarine_brick_tater", ParticleTypes.BUBBLE_COLUMN_UP, "6fdb11b2147b36ed496639bcf8bea8d07e45de610ec08223ca3d56aefb8d81ce"); + public static final Block PRISMARINE_TATER = registerTaterBlock("prismarine_tater", ParticleTypes.NAUTILUS, "abae0abdc506014751e89fa65bb802c81fc2ee3ed0e0a06582abb5bdd088e440"); + public static final Block RED_SAND_TATER = registerTaterBlock("red_sand_tater", new BlockStateParticleEffect(ParticleTypes.FALLING_DUST, Blocks.RED_SAND.getDefaultState()), "7789a0f57334248b602322f57fb2ed708484bb6f7774442c7f2f2bf2ec09064f"); + public static final Block SAND_TATER = registerTaterBlock("sand_tater", new BlockStateParticleEffect(ParticleTypes.FALLING_DUST, Blocks.SAND.getDefaultState()), "6d5332076f20d3f1ad766f4bd83649c573d1b3bf67abfa5be26cdf5ca4a948c8"); + public static final Block SEA_LANTERN_TATER = registerTaterBlock("sea_lantern_tater", ParticleTypes.NAUTILUS, "ccf764156bb262a3d47f4b885716aa7749077c56a31aa41248936255ed38e27"); + public static final Block SHROOMLIGHT_TATER = registerTaterBlock("shroomlight_tater", Blocks.SHROOMLIGHT, "c7aae4d5e03d8a758cdce91bd74573abc5306dfca6e44e5d0e14ca6c14085b36"); + public static final Block SHULKER_TATER = registerTaterBlock("shulker_tater", ParticleTypes.END_ROD, "e5efd875ee5f4a37ad05d392a65886c6dcaf10188c9199673b782b795a29a231"); + public static final Block SMOOTH_STONE_TATER = registerTaterBlock("smooth_stone_tater", Blocks.SMOOTH_STONE, "8f7c81245a444328cff8a366d5a55a6897df99f89185adb76b9225551bfc6786"); + public static final Block SOUL_SAND_TATER = registerTaterBlock("soul_sand_tater", ParticleTypes.SOUL, "5750c407d6205c6d572eddbcc162e2e8dd61f3a26fb0eaa7dff99bcf8d03519a"); + public static final Block SPONGE_TATER = registerTaterBlock("sponge_tater", ParticleTypes.DRIPPING_WATER, "697a4102627b55490614f475d4fde0df51a8d0c45e9573799d198f4deca33a14"); + public static final Block SPRUCE_TATER = registerTaterBlock("spruce_tater", Blocks.SPRUCE_PLANKS, "fe400308900536545f886084d9f465f17311a41b7410cfaba323a5ac3b1b9a9c"); + public static final Block STONE_BRICK_TATER = registerTaterBlock("stone_brick_tater", Blocks.STONE_BRICKS, "bdf3cdb5266539c34485d439c6a07baa3fbe5556d980ef14483cd6f5271b089b"); + public static final Block STRUCTURE_VOID_TATER = registerMarkerTaterBlock("structure_void_tater", Blocks.STRUCTURE_VOID, "94903af59c0a5529ac3c9135683f7671090a403c641e5cbde8b21abe4a1e114c"); + public static final Block TARGET_TATER = registerTargetTaterBlock("target_tater", "386b52ed3d2b2a682b4c6f1d40a9ceabf72e7c5b60b8d92d2dcee97a8799450f"); + public static final Block TERRACOTTA_TATER = registerTaterBlock("terracotta_tater", Blocks.TERRACOTTA, "57f120d92f3f076352b682345fdb82204b920e59d226c4c6d2c64d5abc6860e1"); + public static final Block TNTATER = registerTaterBlock("tntater", ParticleTypes.EXPLOSION, "440d175ded62ff7b3cf9de979196e7b95da8a25e9e888c4bed06f5c011dc54a8", 10); + public static final Block TUBE_CORAL_TATER = registerTaterBlock("tube_coral_tater", ParticleTypes.BUBBLE, "dad0a4ef4c9994ee32a02fcb7960600a295b31a6fef94652998189295fd2ee84"); + public static final Block WARPED_TATER = registerTaterBlock("warped_tater", Blocks.WARPED_PLANKS, "eb4db1936577cfcbbace1dbed72483482af32d99ecd090c8f145cac88ae4e8a2"); + public static final Block WARPED_WART_TATER = registerTaterBlock("warped_wart_tater", ParticleTypes.WARPED_SPORE, "9748cf1c78cfdea730a7ce05ae973a8afe326dc2f71f82a45232d9c6b08776d9"); + public static final Block WOOL_TATER = registerTaterBlock("wool_tater", Blocks.WHITE_WOOL, "ed564fa98b7e8e3abf41779bfe759ca0a3191c8aa70f2eef0af139ba1102e27e"); + + public static final Block ACACIA_LOG_TATER = registerTaterBlock("acacia_log_tater", Blocks.ACACIA_LOG, "3b185be7121801b5a956ce462583c55928b31cbea74e4aae82e7330317a1ae60"); + public static final Block ANGRY_BEE_TATER = registerTaterBlock("angry_bee_tater", ParticleTypes.ANGRY_VILLAGER, "21004dc20ce74adbcc31f1588f268b4cb431b501679e1db7451869bd04779b4b"); + public static final Block BEACON_TATER = registerTaterBlock("beacon_tater", EntityEffectParticleEffect.create(ParticleTypes.ENTITY_EFFECT, -1), "6f7fd952ec5da74a25208853161a15d2f6d022835afe881bd271c710ba25935e"); + public static final Block BEE_NEST_TATER = registerTaterBlock("bee_nest_tater", ParticleTypes.DRIPPING_HONEY, "37b0b38538fac97d26241bf51212a26667596b1b14f1307432c3dcef033af1d0"); + public static final Block BEE_TATER = registerTaterBlock("bee_tater", ParticleTypes.FALLING_HONEY, "80480b902bb32e2b145bb5262629ad7a920d3600365d3101936efc35aad830bd"); + public static final Block BEEHIVE_TATER = registerTaterBlock("beehive_tater", ParticleTypes.DRIPPING_HONEY, "f508a30a1bbc65fbfc58da5dc15d4e930b23b1b48afe72923c506a27cbe06366"); + public static final Block BIRCH_LOG_TATER = registerTaterBlock("birch_log_tater", Blocks.BIRCH_LOG, "6950c69d92a635cb945f845a1a5c428a8e0a0cc2a8b0c563538ec171c4dcee6"); + public static final Block BLACKSTONE_TATER = registerTaterBlock("blackstone_tater", Blocks.BLACKSTONE, "e67acd12c3dee918cc5f3b1a88ab7367549caf978357d79d19d2d486b7acc298"); + public static final Block BLAZE_TATER = registerTaterBlock("blaze_tater", ParticleTypes.FLAME, "85e678d6edab035d25841cfb4c90b631a7242e9d4cf6bcf00f168b8bf7cd290d"); + public static final Block BOOKSHELF_TATER = registerTaterBlock("bookshelf_tater", ParticleTypes.ENCHANT, "dbe032fa6759ba137e52abda44c099344698d80b64257c9295213af168352cae"); + public static final Block BROWN_MOOSHROOM_TATER = registerTaterBlock("brown_mooshroom_tater", ParticleTypes.HEART, "12b92975d95348d7cb94133afcb11b56fc0b4b1c373647dda83876442eee2d41"); + public static final Block BROWN_MUSHROOM_TATER = registerTaterBlock("brown_mushroom_tater", Blocks.BROWN_MUSHROOM_BLOCK, "d5268b990a497d6608f82ba664a8c7c981c28055aac34895f230cbdb284b67b8"); + public static final Block CAVE_SPIDER_TATER = registerTaterBlock("cave_spider_tater", ParticleTypes.SPORE_BLOSSOM_AIR, "9499105f458b25a1e85b7312d00b4f1e1d71d5fd08e2165d77693ac2cab2f2a8"); + public static final Block COBBLED_DEEPSLATE_TATER = registerTaterBlock("cobbled_deepslate_tater", Blocks.COBBLED_DEEPSLATE, "2b378b15b46b469b36da1fb0ac41f2d61df66dd315d5b00714cf7564d6a1eea2"); + public static final Block COBBLESTONE_TATER = registerTaterBlock("cobblestone_tater", Blocks.COBBLESTONE, "7effa3c069da9199503f2fecc1db83fe843491200ba5776d6e799cd24a771c44"); + public static final Block COCOA_TATER = registerTaterBlock("cocoa_tater", Blocks.COCOA, "c4f61e517ea2118d00fc68d3d88abd50b59f3c6f36a63b51793c8699c0a52440"); + public static final Block COLD_STRIDER_TATER = registerTaterBlock("cold_strider_tater", ParticleTypes.SNOWFLAKE, "a71ba7597744db25f0efa20b87c3e6aa284385dfacf24952c80b87afa7f6cc84"); + public static final Block COW_TATER = registerTaterBlock("cow_tater", ParticleTypes.HEART, "945f14291e91f120e9afba2729302cb75e7eab2afd7f3c39129f14dfc8061c55"); + public static final Block CRAFTING_TATER = registerTaterBlock("crafting_tater", Blocks.CRAFTING_TABLE, "c888ec7f32ee555a29e073600961f90618203e60baf13a077f4821c4b98bd62f"); + public static final Block CRIMSON_NYLIUM_TATER = registerTaterBlock("crimson_nylium_tater", ParticleTypes.CRIMSON_SPORE, "c47f7ef4d21df90eaa2cf876d53a02773b13262f90324b03d94546fa0b52cb5a"); + public static final Block CRIMSON_STEM_TATER = registerTaterBlock("crimson_stem_tater", Blocks.CRIMSON_STEM, "247fee4d47e209761521a3adc8f79c3f69b9cd6083849a279d375e847fca369d"); + public static final Block DARK_OAK_LOG_TATER = registerTaterBlock("dark_oak_log_tater", Blocks.DARK_OAK_LOG, "623ceb12251eb2e570210a8433213078d3b512b759e2906f6311d2fcc9524886"); + public static final Block DAYLIGHT_DETECTOR_TATER = registerDaylightDetectorTaterBlock("daylight_detector_tater", "3523f4c9e9bccbd42ababb9f8fce50f1a27260efe00d20a425c6b2968a7af227", false); + public static final Block DEAD_BRAIN_CORAL_TATER = registerTaterBlock("dead_brain_coral_tater", ParticleTypes.BUBBLE_POP, "5db8256bd78f3e34e2666ae29f29433aa7187525fbf3e539c3bf010a28ca3935"); + public static final Block DEAD_BUBBLE_CORAL_TATER = registerTaterBlock("dead_bubble_coral_tater", ParticleTypes.BUBBLE_POP, "bc0d41055df5ba2342dedd76fedb0d7f3f2d992ebdb5870e426c61dcf2c67686"); + public static final Block DEAD_FIRE_CORAL_TATER = registerTaterBlock("dead_fire_coral_tater", ParticleTypes.BUBBLE_POP, "88cb70f602f9bc3064c34f80f47148a7a6c32ddc6f5580dd09fae47812e95d31"); + public static final Block DEAD_HORN_CORAL_TATER = registerTaterBlock("dead_horn_coral_tater", ParticleTypes.BUBBLE_POP, "a5ae31b1dbdd251643835268750699b880d83c2cee7578745ccc6adb2780d192"); + public static final Block DEAD_TUBE_CORAL_TATER = registerTaterBlock("dead_tube_coral_tater", ParticleTypes.BUBBLE_POP, "236d9b535fe8fb6f0bca188f5a6feda3c72423d2bf3d226a85983d5805319b72"); + public static final Block DEEPSLATE_BRICK_TATER = registerTaterBlock("deepslate_brick_tater", Blocks.DEEPSLATE_BRICKS, "3853ed89b5e05717e7bd00e9a33d7e65ebde55e81c0ef868fecc7d2158bc6a1f"); + public static final Block DEEPSLATE_TATER = registerTaterBlock("deepslate_tater", Blocks.DEEPSLATE, "b76d7b1d85b8b724930470eb2986b914b85c4983fc5651a55f09571ababc8b42"); + public static final Block DRIED_KELP_TATER = registerTaterBlock("dried_kelp_tater", Blocks.DRIED_KELP_BLOCK, "bc2abdca594bfb97b2a4b49d88ef7bc01969171a89be411426ce5c0f94fa7a94"); + public static final Block DROWNED_TATER = registerTaterBlock("drowned_tater", ParticleTypes.NAUTILUS, "5ea6f03c0cab4a968976ad95beaba4c60ab46755aa7ff8400b2d87383df6b885"); + public static final Block EYE_OF_ENDER_TATER = registerTaterBlock("eye_of_ender_tater", ParticleTypes.REVERSE_PORTAL, "36fc9fc2b0ab94a11303e3efb8b2534662e5d11ac8a9b9310b588a512eaab55e"); + public static final Block FOX_TATER = registerTaterBlock("fox_tater", ParticleTypes.HEART, "d0d40bc2aa788d6f9d0e3fcde50714f3f47d5db64f3d6a11b2c3fad2b65ba1ea"); + public static final Block GHAST_TATER = registerTaterBlock("ghast_tater", ParticleTypes.DRIPPING_OBSIDIAN_TEAR, "66585c4fc057e15bfc28db7ae8ac778016504f31d5422dfda2345967ba53c44f"); + public static final Block GILDED_BLACKSTONE_TATER = registerTaterBlock("gilded_blackstone_tater", Blocks.GILDED_BLACKSTONE, "987e60212d2d60123e26d1be977de784aa1afc781522645c9a74e492f2295e67"); + public static final Block GLOW_SQUID_TATER = registerTaterBlock("glow_squid_tater", ParticleTypes.GLOW_SQUID_INK, "edd69cada8e6095770ffcfc91fd6df851630efd3bad08dfce78bcb30a5702909"); + public static final Block GLOWSTONE_TATER = registerTaterBlock("glowstone_tater", ParticleTypes.GLOW, "58283dd855f99826c8e938d0f162f111b067bad26685e606b35c847946e4f38f"); + public static final Block HUSK_TATER = registerTaterBlock("husk_tater", Items.ROTTEN_FLESH, "26a88dfb103e0a938776bb27d464bdbc02d39229869975179f1376808a6744b5"); + public static final Block INVERTED_DAYLIGHT_DETECTOR_TATER = registerDaylightDetectorTaterBlock("inverted_daylight_detector_tater", "b721a9503c2c2b25e5dffe5bad1f8bd9f4f620f5ad79a4568322b405973426dd", true); + public static final Block JUNGLE_LOG_TATER = registerTaterBlock("jungle_log_tater", Blocks.JUNGLE_LOG, "fd9658650626b1c63fe8fa5f10e5a981a400532de45153cfe481f302d8980818"); + public static final Block MAGMA_CUBE_TATER = registerTaterBlock("magma_cube_tater", ParticleTypes.DRIPPING_LAVA, "b34a0d09a2721e18afd3f4c1f2abf630734566e5e04054cc086945dd3af4a1b3"); + public static final Block MOOBLOOM_TATER = registerTaterBlock("moobloom_tater", ParticleTypes.COMPOSTER, "a5a022dae96e419275a0bf5dfabde2d1c4dd073376d52265bee5dd67776ee5a2"); + public static final Block MOOLIP_TATER = registerTaterBlock("moolip_tater", ParticleTypes.CHERRY_LEAVES, "271e15bc807ccf8ecdd594bac37680c06aeb7ec46ce071f225cf207d718654a2"); + public static final Block MUDDY_PIG_TATER = registerTaterBlock("muddy_pig_tater", ParticleTypes.HEART, "70137b92b07e1c24c6d3042daa2997a871383c7278d88e3ecf1964e4b75ff993"); + public static final Block MUSHROOM_STEM_TATER = registerTaterBlock("mushroom_stem_tater", Blocks.MUSHROOM_STEM, "104dd3bad53758af4eb92be90e78277a6201e63d63614c463c5156d210a61c11"); + public static final Block NETHER_BRICK_TATER = registerTaterBlock("nether_brick_tater", Blocks.NETHER_BRICKS, "751534292b1f5e13c8cea2d4f4f653c9f46cb63f5e2ad480c24fc98f22a027c0"); + public static final Block NETHERRACK_TATER = registerTaterBlock("netherrack_tater", Blocks.NETHERRACK, "787fea3e6c6da9693d74b0607d6c7c8081dd75458a5b52110a4761d30775040f"); + public static final Block OAK_LOG_TATER = registerTaterBlock("oak_log_tater", Blocks.OAK_LOG, "13d4a4903b8374b799549775e0f9d45bbd9b2b219edff4d1ddb268472ca47a29"); + public static final Block PIG_TATER = registerTaterBlock("pig_tater", ParticleTypes.HEART, "530a64b89a9a46c58300eae437817789afab264c0be187b6f2733ab24adc8480"); + public static final Block POLAR_BEAR_TATER = registerTaterBlock("polar_bear_tater", Blocks.SNOW_BLOCK, "92a9da572909635f119bdaa54162991f44c99812fa3e504fe2305e2c8210ddf2"); + public static final Block PUFFERTATER = registerTaterBlock("puffertater", ParticleTypes.DRIPPING_WATER, "4d777aa416424b7bb713c158117f7392a74ebd1fe49eff6fa2c4b1192720eb48"); + public static final Block RED_MOOSHROOM_TATER = registerTaterBlock("red_mooshroom_tater", ParticleTypes.HEART, "3f41d3f6948a08ca1388b31cde2d629364ccb2a21a4b20bfec618ec37637e803"); + public static final Block RED_MUSHROOM_TATER = registerTaterBlock("red_mushroom_tater", Blocks.RED_MUSHROOM_BLOCK, "2730185a1933b6e90c1d4ab439aeac51259f428732b4cb38fcfe4988cb0994d1"); + public static final Block RED_NETHER_BRICK_TATER = registerTaterBlock("red_nether_brick_tater", Blocks.RED_NETHER_BRICKS, "70986bf9dba2c063c3afa5643a79a4adf7379e249bbae67861ae3eb89b8bfe91"); + public static final Block RED_SANDSTONE_TATER = registerTaterBlock("red_sandstone_tater", Blocks.RED_SANDSTONE, "557a2c97c9225ca72cc2507f465a0ff96c949035d8f53a9420d7cdf6f875b805"); + public static final Block RUBY_TATER = registerTaterBlock("ruby_tater", ParticleTypes.HAPPY_VILLAGER, "becb1ee95fba3f868fc36c126e5962244ac4bf64cd35b117871e62590a1660ed"); + public static final Block SANDSTONE_TATER = registerTaterBlock("sandstone_tater", Blocks.SANDSTONE, "dee6a6e0c3521db9b0279d4d5a11f009e196cfe6e1f5babf1e09d99f5c48ba13"); + public static final Block SEA_PICKLE_TATER = registerTaterBlock("sea_pickle_tater", ParticleTypes.UNDERWATER, "ec327a8c1dddd36722345cb12f627e99fdd9b56151f34e2d45794628f08f682a"); + public static final Block SHEEP_TATER = registerTaterBlock("sheep_tater", ParticleTypes.HEART, "2e00da1671dd107fade939288e944bbf02609b13f0d0ff9d4e81448cf37ab26c"); + public static final Block SHIELDED_WITHER_TATER = registerTaterBlock("shielded_wither_tater", ParticleTypes.SOUL, "7331e65f919d20063df086e2423340fac6d594207b525600d0776aec86fadb30"); + public static final Block SNOW_FOX_TATER = registerTaterBlock("snow_fox_tater", ParticleTypes.HEART, "bd1d473e3e82d0afca0f7568748f0ff637334632cfb5f6ac228533fadf9bbbf5"); + public static final Block SPIDER_TATER = registerTaterBlock("spider_tater", Items.SPIDER_EYE, "8c711ae226b0e84806e93986ad175e855e07d8b23c2fc369596549f571c739f0"); + public static final Block SPRUCE_LOG_TATER = registerTaterBlock("spruce_log_tater", Blocks.SPRUCE_LOG, "87a820cdad664cf54f98e36f70c92592c584c8a586003eb6ebfcff2f93cda0dc"); + public static final Block SQUID_TATER = registerTaterBlock("squid_tater", ParticleTypes.SQUID_INK, "9896dd194df00aa0f48474dc75c9bb45fa7813ae50e42c4a69f08c2d1b3c4759"); + public static final Block STRAY_TATER = registerTaterBlock("stray_tater", Blocks.BONE_BLOCK, "2d7952ac41e6dafcd3adeaad656728a06599cfa5173085d42ca4fcdf8fb76c44"); + public static final Block STRIDER_TATER = registerTaterBlock("strider_tater", ParticleTypes.LAVA, "730c64d1460190f05169a9f6d1292b298c7ff9673083aed0a22a221153a0f519"); + public static final Block TURTLE_EGG_TATER = registerTaterBlock("turtle_egg_tater", Blocks.TURTLE_EGG, "7e7054403552090e60bb5f4025e06f5bfb513c989a5e87ad88cfe468129ed7f1"); + public static final Block WARPED_NYLIUM_TATER = registerTaterBlock("warped_nylium_tater", ParticleTypes.WARPED_SPORE, "2c80206143d8e76cee31adf8ae64ba4c67d6335abf123f4eb973cf302f6ca2cf"); + public static final Block WARPED_STEM_TATER = registerTaterBlock("warped_stem_tater", Blocks.WARPED_STEM, "2e471eadd1d8195bd5584e1e266ba4c7148c968fb173735c4a6975b590756af"); + public static final Block WITHER_TATER = registerTaterBlock("wither_tater", ParticleTypes.SOUL, "71346598ada1df7f8bc27dde4af895db1655f5d3d1b7d5d4831556feb84ddca8"); + + public static final Block AZALEA_TATER = registerTaterBlock("azalea_tater", Blocks.AZALEA_LEAVES, "dc836641ecb40e775f85f4c71b219120e43080e03b8c84a7f60f1ba8127f2931"); + public static final Block BELL_TATER = registerBellTaterBlock("bell_tater", "a84b726a75b81393e206c19ca508570a8a8db64f88b90775eb451214ab0d7561"); + public static final Block COLD_FROG_TATER = registerTaterBlock("cold_frog_tater", ParticleTypes.SPLASH, "f58f867bb5f570c7ca9afa97a698a3ea22b6218a0445958dc8bacdb53976da2e"); + public static final Block CONDUIT_TATER = registerTaterBlock("conduit_tater", ParticleTypes.NAUTILUS, "c59d90ffba4debacc7f8cb400c40e36e15902166cd5544baac5fbbb830a1c58c"); + public static final Block ELDER_GUARDIAN_TATER = registerElderGuardianParticleTaterBlock("elder_guardian_tater", "386f90f38959c5652ce3bd2840bdb18036d3153f6284e12af07f000663c536fe"); + public static final Block END_STONE_BRICK_TATER = registerTaterBlock("end_stone_brick_tater", ParticleTypes.END_ROD, "5c0a9483d2b43c284dc8abd6149342dc63136f3bb208476e17f434059ece4582"); + public static final Block FLOWER_POT_TATER = registerTaterBlock("flower_pot_tater", ParticleTypes.COMPOSTER, "5378b1804af0875cb00fd350e6116bfd2165db209ed8b8e0c48f984669553f45"); + public static final Block GUARDIAN_TATER = registerTaterBlock("guardian_tater", Blocks.PRISMARINE, "c152df6875886f29a0f1f110c2a54820248ceef688fe150797dde4e9d4863c0e"); + public static final Block ILLAGER_TATER = registerTaterBlock("illager_tater", ParticleTypes.ANGRY_VILLAGER, "522c1190fb561f1dfc994b281eb145955e2e439511c83aaf64fed1ab09ec1316"); + public static final Block ILLUSIONER_TATER = registerTaterBlock("illusioner_tater", EntityEffectParticleEffect.create(ParticleTypes.ENTITY_EFFECT, -1), "6c31b980a02847d5ac948663e95604e754e0b736d4593c7841332833144f2782"); + public static final Block JUKEBOX_TATER = registerTaterBlock("jukebox_tater", ParticleTypes.NOTE, "75f6f61e3a9035a758174979ca664b26e47ca9b273f324f0921b5ad58bdb5835"); + public static final Block LANTERN_TATER = registerTaterBlock("lantern_tater", ParticleTypes.FLASH, "16c275f657bac1363333abf1db0d18bfabf087fbf3df356ec7f41258bc16b76d", 20); + public static final Block PIGLIN_TATER = registerTaterBlock("piglin_tater", Blocks.GOLD_BLOCK, "4df6290ac1aff8b179420f2a05baa3c721a5cf49f3bd8f9928a0a57c0cf369e"); + public static final Block PINK_WITHER_TATER = registerTaterBlock("pink_wither_tater", ParticleTypes.HEART, "93592323dbce9eec933aa915af71701b77ee478f7e1dd126501a027b1d430bc7"); + public static final Block PISTON_TATER = registerTaterBlock("piston_tater", Blocks.PISTON, "84a5081444bb13cf75bc8040020e91f39e056cf273cd8ebe528e09100a183e53"); + public static final Block PURPUR_TATER = registerTaterBlock("purpur_tater", ParticleTypes.END_ROD, "9c619e55d60579e21126a5c0b88fd8b8baa98d24d1299ed1515fa1452f6ab898"); + public static final Block SOUL_LANTERN_TATER = registerTaterBlock("soul_lantern_tater", ParticleTypes.SOUL_FIRE_FLAME, "a9419cebd15ebc79fe8eba6984637f3c2892e6d68fcc4caa0f3499cfddec25ce"); + public static final Block SOUL_SOIL_TATER = registerTaterBlock("soul_soil_tater", ParticleTypes.SOUL, "c45eb5699f0fafaa6d8e33227e2e626def520545392dffbfa6a071feec239049"); + public static final Block STICKY_PISTON_TATER = registerTaterBlock("sticky_piston_tater", Blocks.SLIME_BLOCK, "404735be9d3e0dea9cec3d4a035fa4b0668b0a7e79cafecb80decba02ace2451"); + public static final Block TEMPERATE_FROG_TATER = registerTaterBlock("temperate_frog_tater", ParticleTypes.SPLASH, "e2dd56ee8f70c6bbb0fb43ed875071b1ed4a4a8130cb4f8dd17869e1395beb4e"); + public static final Block UNDERWATER_TNTATER = registerTaterBlock("underwater_tntater", ParticleTypes.EXPLOSION, "fd90716acd4dd643bef71a84e44bc5cb75ec8ab260986dd679452778c80f8496", 10); + public static final Block VEX_TATER = registerTaterBlock("vex_tater", ParticleTypes.ENCHANTED_HIT, "9f15dcbe0bde9f613146ba4d51d5448eaf80d260bdb323d2358371e8c3d50829"); + public static final Block VILLAGER_TATER = registerTaterBlock("villager_tater", ParticleTypes.HAPPY_VILLAGER, "7c34f81b74855b9c6a2da0a9000039871a17631976c9f9d0850ae30e31b98397"); + public static final Block VINDITATER = registerTaterBlock("vinditater", ParticleTypes.ANGRY_VILLAGER, "5ca5f1069c3399ea3eda014b9dc5aac3827116ed93617bb44ba87717b11ff98a"); + public static final Block WANDERING_TRADER_TATER = registerTaterBlock("wandering_trader_tater", ParticleTypes.HAPPY_VILLAGER, "860592fc5385f74ffe8c3e3e9f1ad16a5a865bcfa33697483ff7a5da3a784392"); + public static final Block WARM_FROG_TATER = registerTaterBlock("warm_frog_tater", ParticleTypes.SPLASH, "7ea9de371ba4a3edfe8260a559c7cc25564d2cdbb7097d0d3575908a8b627f10"); + public static final Block WAX_TATER = registerTaterBlock("wax_tater", ParticleTypes.LANDING_HONEY, "acc39045a9f072a3adce91f7dd75ce2385cf6c8c251adb5d7e98ae999ae81777"); + public static final Block WITCH_TATER = registerTaterBlock("witch_tater", EntityEffectParticleEffect.create(ParticleTypes.ENTITY_EFFECT, 0), "1a02c42db26bda231513924f916c1a37abe89255ab3cb77d7da95469052917f3"); + public static final Block ZOMBIE_VILLAGER_TATER = registerTaterBlock("zombie_villager_tater", Items.ROTTEN_FLESH, "7e37fe7abf9ee78de2889993e24d3fc7784269f03ae65da2d8ab7a59e0d1516f"); + public static final Block ZOMBIFIED_PIGLIN_TATER = registerTaterBlock("zombified_piglin_tater", Items.ROTTEN_FLESH, "248b2a6973bbeb1a3e48c8e0b695d733d5a4e25272a639d248d89cf4129cc2e9"); + + public static final Block BONE_SPIDER_TATER = registerTaterBlock("bone_spider_tater", Blocks.BONE_BLOCK, "dcde0b254cf7d0e8a170c667de621c414e7475e06dafa8ada868224a2fa7a29b"); + public static final Block BOULDERING_ZOMBIE_TATER = registerTaterBlock("bouldering_zombie_tater", Items.ROTTEN_FLESH, "ca552c8f68cd8e46bd493e77a1726d7e03a460fc89ec80d273499521cf9831f0"); + public static final Block CHARGED_CREEPER_TATER = registerTaterBlock("charged_creeper_tater", ParticleTypes.EXPLOSION, "16134034e6d24f5f723171de2428c92106cd261d329d965195a9065ff5378b00", 10); + public static final Block LOBBER_ZOMBIE_TATER = registerTaterBlock("lobber_zombie_tater", Items.ROTTEN_FLESH, "4178a5a659a245900fbdc468f4d421c34fa0d1c7e0ff1f47be9de580648035fe"); + public static final Block MOSSY_SKELETATER = registerTaterBlock("mossy_skeletater", Blocks.MOSS_BLOCK, "9c07242332a0b5c85f69f626b83a28bea93a41c51f7c5c1c9bcadea6ea7f6895"); + public static final Block STRIPPED_ACACIA_LOG_TATER = registerTaterBlock("stripped_acacia_log_tater", Blocks.STRIPPED_ACACIA_LOG, "1ac99e952e6f5e42066139fa692179f23d33281521d65901079e403a52edd430"); + public static final Block STRIPPED_BIRCH_LOG_TATER = registerTaterBlock("stripped_birch_log_tater", Blocks.STRIPPED_BIRCH_LOG, "b67e34704da63d6ba4f3c91fc9aab11b5efc36e0f823d4d9c84ef021149585c4"); + public static final Block STRIPPED_CRIMSON_STEM_TATER = registerTaterBlock("stripped_crimson_stem_tater", Blocks.STRIPPED_CRIMSON_STEM, "ff702bf5fb8a672fd89696a0a09999db06b22cdc4a175fd5366916d84297da82"); + public static final Block STRIPPED_DARK_OAK_LOG_TATER = registerTaterBlock("stripped_dark_oak_log_tater", Blocks.STRIPPED_DARK_OAK_LOG, "439b09449076c58a911d464256c29dd5d634852287630c05f1c3c82a4368ce62"); + public static final Block STRIPPED_JUNGLE_LOG_TATER = registerTaterBlock("stripped_jungle_log_tater", Blocks.STRIPPED_JUNGLE_LOG, "1e811034ee1631e7f560ff35b6bdb5e0b460b559d799740ac59d0e2d2c0bb9e9"); + public static final Block STRIPPED_OAK_LOG_TATER = registerTaterBlock("stripped_oak_log_tater", Blocks.STRIPPED_OAK_LOG, "7cf7cfc6763ba87781f1de7f76ec5a26436c14a74b1292f7d2409f399dd72773"); + public static final Block STRIPPED_SPRUCE_LOG_TATER = registerTaterBlock("stripped_spruce_log_tater", Blocks.STRIPPED_SPRUCE_LOG, "7a1f047b2d61b14e717f6c42f67af5da1d101d0a37340c6e497f3e3af1d62691"); + public static final Block STRIPPED_WARPED_STEM_TATER = registerTaterBlock("stripped_warped_stem_tater", Blocks.STRIPPED_WARPED_STEM, "54453447dfc628793e1c704509fd24dd3effcaff9ce6aba16efbee3a1001d65f"); + public static final Block TROPICAL_SLIME_TATER = registerTaterBlock("tropical_slime_tater", ParticleTypes.FISHING, "473d7ffeeb9562e1c0fe59ac45dbec370750793cd6acbd01e26c3a02cea77fea"); + + public static final Block APPLE_TATER = registerTaterBlock("apple_tater", Items.APPLE, "379e6c96a907fce60e8c0c55b02b554663e50f6dff9eee113e3742f8779c0304"); + public static final Block GOLDEN_APPLE_TATER = registerTaterBlock("golden_apple_tater", Items.GOLDEN_APPLE, "27a47cff605fb936bb826109bb2b5e77dc3210e211f2f53c8470cf8ed2c80476"); + public static final Block ICE_TATER = registerTaterBlock("ice_tater", Blocks.ICE, "bc89a947d4fd385418f3352f2137bae390cbdf96d5fb479b59a97029f34e1461"); + public static final Block KING_TATER = registerTaterBlock("king_tater", ParticleTypes.TOTEM_OF_UNDYING, "b8b7fc416de5d8a0f1b6f6a7234e6789fb46fed358522fe90da8f92ceafeea3b"); + public static final Block RAW_COPPER_TATER = registerTaterBlock("raw_copper_tater", Blocks.RAW_COPPER_BLOCK, "e02d263510b34498c8814b11c8deefb754d647c4444db61527b600a88b566204"); + public static final Block RAW_GOLD_TATER = registerTaterBlock("raw_gold_tater", Blocks.RAW_GOLD_BLOCK, "c9cf35e928c3b94a29a6049414cd411bd223da3dd232b7a6bbb34fbf37e5db53"); + public static final Block RAW_IRON_TATER = registerTaterBlock("raw_iron_tater", Blocks.RAW_IRON_BLOCK, "50d19e2e668e4c6329b1491c43a75e8b484fa5ef834ff3bacdb56fcc2d49c235"); + + public static final Block ALLAY_TATER = registerTaterBlock("allay_tater", ParticleTypes.HEART, "36911b99859c6627cba710041a7ce4ab17791e5c9278a85c75c1596dd1c789bb"); + public static final Block MANGROVE_LOG_TATER = registerTaterBlock("mangrove_log_tater", Blocks.SPRUCE_LOG, "2ab0654a238462e8f1746431d05dfd13d95260031afe335b696feaa6bb49d678"); + public static final Block MANGROVE_TATER = registerTaterBlock("mangrove_tater", Blocks.CRIMSON_PLANKS, "42ccd79aabbb47ae9bdb6b00ad9f43e65d098cc27caa3a2cd8d94b283f726464"); + public static final Block MUD_BRICK_TATER = registerTaterBlock("mud_brick_tater", Blocks.TERRACOTTA, "e37555d890f905e72083844ca751a661d84ed599ac649dc382174af2180ba12"); + public static final Block MUD_TATER = registerTaterBlock("mud_tater", Blocks.STONE, "f83561c253f837c077d9e5394f71167220f9966aafe1d59a87caacbd0a3e4814"); + public static final Block PACKED_MUD_TATER = registerTaterBlock("packed_mud_tater", Blocks.DIRT, "67a5911061c9497c1e888aabe97370d4d00f900ca798cb1ac8cf41fe7bb41532"); + public static final Block STRIPPED_MANGROVE_LOG_TATER = registerTaterBlock("stripped_mangrove_log_tater", Blocks.STRIPPED_CRIMSON_STEM, "c03d0e7742fa66506b5739c98d0cf29411463608877fa667ce29c7b85793d18a"); + + public static final Block LUCY_AXOLOTL_TATER = registerTaterBlock("lucy_axolotl_tater", ParticleTypes.HEART, "721a824dcfa8d7503f008f59d7e4874a58ba6f6351750720c78a55eb24211fb6"); + public static final Block WILD_AXOLOTL_TATER = registerTaterBlock("wild_axolotl_tater", ParticleTypes.HEART, "861a7607987e0751e10c3d819775b58c45dba2911bd5222ca8111a8401248d56"); + public static final Block GOLD_AXOLOTL_TATER = registerTaterBlock("gold_axolotl_tater", ParticleTypes.HEART, "9e8dff1cf4f1e76c76993ab9316ef7904b229c37b8cbd1876ccb8c9bcbd36502"); + public static final Block CYAN_AXOLOTL_TATER = registerTaterBlock("cyan_axolotl_tater", ParticleTypes.HEART, "9d61be444b360184cc39faecfac849359ba56843e1469a3c4687f004b9a7ae65"); + public static final Block BLUE_AXOLOTL_TATER = registerTaterBlock("blue_axolotl_tater", ParticleTypes.HEART, "88bc29626c5311e82f18a692d7b26bec5b841a0533ba633e5887a172c765bf05"); + + public static final Block BRONZE_CAPSULE_TATER = registerCapsuleTaterBlock("bronze_capsule_tater", 0x764D22, 90, "7391822504d79491186d42b5ab6fdd9615bfc1886324be5f5b613dcb03319677"); + public static final Block SILVER_CAPSULE_TATER = registerCapsuleTaterBlock("silver_capsule_tater", 0xBFBFBF, 9, "afdce3ea1399dd0b738faaecf89cc5bdcf179b8dc4f3d7964c8cd45c89257fd1"); + public static final Block GOLD_CAPSULE_TATER = registerCapsuleTaterBlock("gold_capsule_tater", 0xF1A00E, 1, "db5388834578ccb906e97d3e54aeb33edcc12d821f081b7eb04830cbd260ad81"); + + public static final Block CORRUPTATER = register("corruptater", createTaterBlockSettings(), settings -> new CorruptaterBlock(settings, 2)); public static final BlockEntityType LAUNCH_PAD_ENTITY = FabricBlockEntityTypeBuilder.create(LaunchPadBlockEntity::new, GOLD_LAUNCH_PAD, IRON_LAUNCH_PAD).build(); public static final BlockEntityType CONTRIBUTOR_STATUE_ENTITY = FabricBlockEntityTypeBuilder.create(ContributorStatueBlockEntity::new, CONTRIBUTOR_STATUE).build(); @@ -431,432 +436,91 @@ public class NEBlocks { public static final BlockEntityType DAYLIGHT_DETECTOR_TATER_ENTITY = FabricBlockEntityTypeBuilder.create(DaylightDetectorTaterBlockEntity::new, DAYLIGHT_DETECTOR_TATER, INVERTED_DAYLIGHT_DETECTOR_TATER).build(); public static final BlockEntityType BELL_TATER_ENTITY = FabricBlockEntityTypeBuilder.create(BellTaterBlockEntity::new, BELL_TATER).build(); - private static Block createSimple(Block virtual) { - return new SimplePolymerBlock(AbstractBlock.Settings.copy(virtual).strength(100), virtual); + private static Block registerSimple(String id, Block virtual) { + return register(id, AbstractBlock.Settings.copy(virtual).strength(100), settings -> new SimplePolymerBlock(settings, virtual)); } private static AbstractBlock.Settings createTaterBlockSettings() { return AbstractBlock.Settings.create().mapColor(MapColor.PALE_GREEN).strength(100); } - private static Block createBotanicTaterBlock(ParticleEffect effect, String textureUp, String textureDown) { - return new BotanicalPotatoBlock(createTaterBlockSettings(), textureUp, textureDown, effect, 2); + private static Block registerBotanicTaterBlock(String id, ParticleEffect effect, String textureUp, String textureDown) { + return register(id, createTaterBlockSettings(), settings -> new BotanicalPotatoBlock(settings, textureUp, textureDown, effect, 2)); } - private static Block createTaterBlock(ParticleEffect effect, String texture) { - return new CubicPotatoBlock(createTaterBlockSettings(), effect, texture); + private static Block registerTaterBlock(String id, ParticleEffect effect, String texture) { + return register(id, createTaterBlockSettings(), settings -> new CubicPotatoBlock(settings, effect, texture)); } - private static Block createTaterBlock(Block particleBlock, String texture) { - return new CubicPotatoBlock(createTaterBlockSettings(), particleBlock, texture); + private static Block registerTaterBlock(String id, Block particleBlock, String texture) { + return register(id, createTaterBlockSettings(), settings -> new CubicPotatoBlock(settings, particleBlock, texture)); } - private static Block createTaterBlock(Item particleItem, String texture) { - return new CubicPotatoBlock(createTaterBlockSettings(), particleItem, texture); + private static Block registerTaterBlock(String id, Item particleItem, String texture) { + return register(id, createTaterBlockSettings(), settings -> new CubicPotatoBlock(settings, particleItem, texture)); } - private static Block createTaterBlock(ParticleEffect effect, String texture, int particleRate) { - return new CubicPotatoBlock(createTaterBlockSettings(), effect, texture, particleRate); + private static Block registerTaterBlock(String id, ParticleEffect effect, String texture, int particleRate) { + return register(id, createTaterBlockSettings(), settings -> new CubicPotatoBlock(settings, effect, texture, particleRate)); } - private static Block createColorPatternTaterBlock(Vector3f[] pattern, String texture) { - return new ColorPatternTaterBlock(createTaterBlockSettings(), pattern, texture); + private static Block registerColorPatternTaterBlock(String id, int[] pattern, String texture) { + return register(id, createTaterBlockSettings(), settings -> new ColorPatternTaterBlock(settings, pattern, texture)); } - private static Block createLuckyTaterBlock(String texture, String cooldownTexture) { - return new LuckyTaterBlock(createTaterBlockSettings(), texture, cooldownTexture); + private static Block registerLuckyTaterBlock(String id, String texture, String cooldownTexture) { + return register(id, createTaterBlockSettings(), settings -> new LuckyTaterBlock(settings, texture, cooldownTexture)); } - private static Block createWardenTaterBlock(String texture) { - return new WardenTaterBlock(createTaterBlockSettings(), texture); + private static Block registerWardenTaterBlock(String id, String texture) { + return register(id, createTaterBlockSettings(), settings -> new WardenTaterBlock(settings, texture)); } - private static Block createDiceTaterBlock() { - return new DiceTaterBlock(createTaterBlockSettings()); + private static Block registerDiceTaterBlock(String id) { + return register(id, createTaterBlockSettings(), settings -> new DiceTaterBlock(settings)); } - private static Block createTateroidBlock(RegistryEntry defaultSound, double particleColor, String texture) { - return new TateroidBlock(createTaterBlockSettings(), defaultSound, particleColor, texture); + private static Block registerTateroidBlock(String id, RegistryEntry defaultSound, double particleColor, String texture) { + return register(id, createTaterBlockSettings(), settings -> new TateroidBlock(settings, defaultSound, particleColor, texture)); } - private static Block createColorTaterBlock(DyeColor color, String texture) { - return new ColorTaterBlock(createTaterBlockSettings(), color, texture); + private static Block registerColorTaterBlock(String id, DyeColor color, String texture) { + return register(id, createTaterBlockSettings(), settings -> new ColorTaterBlock(settings, color, texture)); } - private static Block createRedstoneTaterBlock(ParticleEffect effect, String texture) { - return new RedstoneTaterBlock(createTaterBlockSettings(), effect, texture); + private static Block registerRedstoneTaterBlock(String id, ParticleEffect effect, String texture) { + return register(id, createTaterBlockSettings(), settings -> new RedstoneTaterBlock(settings, effect, texture)); } - private static Block createDaylightDetectorTaterBlock(String texture, boolean inverted) { - return new DaylightDetectorTaterBlock(createTaterBlockSettings(), texture, inverted); + private static Block registerDaylightDetectorTaterBlock(String id, String texture, boolean inverted) { + return register(id, createTaterBlockSettings(), settings -> new DaylightDetectorTaterBlock(settings, texture, inverted)); } - private static Block createTargetTaterBlock(String texture) { - return new TargetTaterBlock(createTaterBlockSettings(), texture); + private static Block registerTargetTaterBlock(String id, String texture) { + return register(id, createTaterBlockSettings(), settings -> new TargetTaterBlock(settings, texture)); } - private static Block createBellTaterBlock(String texture) { - return new BellTaterBlock(createTaterBlockSettings(), texture); + private static Block registerBellTaterBlock(String id, String texture) { + return register(id, createTaterBlockSettings(), settings -> new BellTaterBlock(settings, texture)); } - private static Block createElderGuardianParticleTaterBlock(String texture) { - return new ElderGuardianParticleTater(createTaterBlockSettings(), texture); + private static Block registerElderGuardianParticleTaterBlock(String id, String texture) { + return register(id, createTaterBlockSettings(), settings -> new ElderGuardianParticleTater(settings, texture)); } - private static Block createCapsuleTaterBlock(Vector3f color, int weight, String texture) { - return new CapsuleTaterBlock(createTaterBlockSettings(), color, weight, texture); + private static Block registerCapsuleTaterBlock(String id, int color, int weight, String texture) { + return register(id, createTaterBlockSettings(), settings -> new CapsuleTaterBlock(settings, color, weight, texture)); } - private static Block createMarkerTaterBlock(Block particleBlock, String texture) { - return new MarkerTaterBlock(createTaterBlockSettings(), particleBlock, texture); + private static Block registerMarkerTaterBlock(String id, Block particleBlock, String texture) { + return register(id, createTaterBlockSettings(), settings -> new MarkerTaterBlock(settings, particleBlock, texture)); } - private static Block createLightTaterBlock(String texture) { - return new LightTaterBlock(createTaterBlockSettings(), texture); + private static Block registerLightTaterBlock(String id, String texture) { + return register(id, createTaterBlockSettings(), settings -> new LightTaterBlock(settings, texture)); } public static void register() { - register("nucleoid_logo", NUCLEOID_LOGO); - register("nucle_past_logo", NUCLE_PAST_LOGO); - - register("end_portal", END_PORTAL); - register("end_gateway", END_GATEWAY); - register("safe_tnt", SAFE_TNT); - register("gold_launch_pad", GOLD_LAUNCH_PAD); - register("iron_launch_pad", IRON_LAUNCH_PAD); - register("contributor_statue", CONTRIBUTOR_STATUE); - register("infinite_dispenser", INFINITE_DISPENSER); - register("infinite_dropper", INFINITE_DROPPER); - register("snake_block", SNAKE_BLOCK); - register("fast_snake_block", FAST_SNAKE_BLOCK); - - register("transient_iron_door", TRANSIENT_IRON_DOOR); - register("transient_oak_door", TRANSIENT_OAK_DOOR); - register("transient_spruce_door", TRANSIENT_SPRUCE_DOOR); - register("transient_birch_door", TRANSIENT_BIRCH_DOOR); - register("transient_jungle_door", TRANSIENT_JUNGLE_DOOR); - register("transient_acacia_door", TRANSIENT_ACACIA_DOOR); - register("transient_cherry_door", TRANSIENT_CHERRY_DOOR); - register("transient_dark_oak_door", TRANSIENT_DARK_OAK_DOOR); - register("transient_mangrove_door", TRANSIENT_MANGROVE_DOOR); - register("transient_bamboo_door", TRANSIENT_BAMBOO_DOOR); - register("transient_crimson_door", TRANSIENT_CRIMSON_DOOR); - register("transient_warped_door", TRANSIENT_WARPED_DOOR); - - register("black_concrete_powder", BLACK_CONCRETE_POWDER); - register("blue_concrete_powder", BLUE_CONCRETE_POWDER); - register("brown_concrete_powder", BROWN_CONCRETE_POWDER); - register("cyan_concrete_powder", CYAN_CONCRETE_POWDER); - register("green_concrete_powder", GREEN_CONCRETE_POWDER); - register("gray_concrete_powder", GRAY_CONCRETE_POWDER); - register("light_blue_concrete_powder", LIGHT_BLUE_CONCRETE_POWDER); - register("light_gray_concrete_powder", LIGHT_GRAY_CONCRETE_POWDER); - register("lime_concrete_powder", LIME_CONCRETE_POWDER); - register("magenta_concrete_powder", MAGENTA_CONCRETE_POWDER); - register("orange_concrete_powder", ORANGE_CONCRETE_POWDER); - register("pink_concrete_powder", PINK_CONCRETE_POWDER); - register("purple_concrete_powder", PURPLE_CONCRETE_POWDER); - register("red_concrete_powder", RED_CONCRETE_POWDER); - register("white_concrete_powder", WHITE_CONCRETE_POWDER); - register("yellow_concrete_powder", YELLOW_CONCRETE_POWDER); - - register("tiny_potato", TINY_POTATO); - register("botanical_potato", BOTANICAL_TINY_POTATO); - register("irritater", IRRITATER); - register("sad_tater", SAD_TATER); - register("flowering_azalea_tater", FLOWERING_AZALEA_TATER); - register("stone_tater", STONE_TATER); - register("calcite_tater", CALCITE_TATER); - register("puzzle_cube_tater", PUZZLE_CUBE_TATER); - register("lucky_tater", LUCKY_TATER); - register("tuff_tater", TUFF_TATER); - register("basalt_tater", BASALT_TATER); - register("dripstone_tater", DRIPSTONE_TATER); - register("amethyst_tater", AMETHYST_TATER); - register("packed_ice_tater", PACKED_ICE_TATER); - register("blue_ice_tater", BLUE_ICE_TATER); - register("flame_tater", FLAME_TATER); - register("crate_tater", CRATE_TATER); - register("tater_of_undying", TATER_OF_UNDYING); - register("crying_obsidian_tater", CRYING_OBSIDIAN_TATER); - register("trans_tater", TRANS_TATER); - register("asexual_tater", ASEXUAL_TATER); - register("bi_tater", BI_TATER); - register("gay_tater", GAY_TATER); - register("lesbian_tater", LESBIAN_TATER); - register("nonbinary_tater", NONBINARY_TATER); - register("pan_tater", PAN_TATER); - register("flipped_tater", FLIPPED_TATER); - register("backward_tater", BACKWARD_TATER); - register("upward_tater", UPWARD_TATER); - register("santa_hat_tater", SANTA_HAT_TATER); - register("genderfluid_tater", GENDERFLUID_TATER); - register("demisexual_tater", DEMISEXUAL_TATER); - - register("warden_tater", WARDEN_TATER); - register("viral_tater", VIRAL_TATER); - register("dice_tater", DICE_TATER); - register("tateroid", TATEROID); - register("red_tateroid", RED_TATEROID); - register("orange_tateroid", ORANGE_TATEROID); - register("yellow_tateroid", YELLOW_TATEROID); - register("green_tateroid", GREEN_TATEROID); - register("blue_tateroid", BLUE_TATEROID); - register("purple_tateroid", PURPLE_TATEROID); - - register("skeletater", SKELETATER); - register("wither_skeletater", WITHER_SKELETATER); - register("zombie_tater", ZOMBIE_TATER); - register("creeper_tater", CREEPER_TATER); - register("steve_tater", STEVE_TATER); - register("alex_tater", ALEX_TATER); - - register("white_tater", WHITE_TATER); - register("orange_tater", ORANGE_TATER); - register("magenta_tater", MAGENTA_TATER); - register("light_blue_tater", LIGHT_BLUE_TATER); - register("yellow_tater", YELLOW_TATER); - register("lime_tater", LIME_TATER); - register("pink_tater", PINK_TATER); - register("gray_tater", GRAY_TATER); - register("light_gray_tater", LIGHT_GRAY_TATER); - register("cyan_tater", CYAN_TATER); - register("purple_tater", PURPLE_TATER); - register("blue_tater", BLUE_TATER); - register("brown_tater", BROWN_TATER); - register("green_tater", GREEN_TATER); - register("red_tater", RED_TATER); - register("black_tater", BLACK_TATER); - - register("coal_tater", COAL_TATER); - register("diamond_tater", DIAMOND_TATER); - register("emerald_tater", EMERALD_TATER); - register("gold_tater", GOLD_TATER); - register("iron_tater", IRON_TATER); - register("lapis_tater", LAPIS_TATER); - register("netherite_tater", NETHERITE_TATER); - register("quartz_tater", QUARTZ_TATER); - register("redstone_tater", REDSTONE_TATER); - - register("copper_tater", COPPER_TATER); - register("exposed_copper_tater", EXPOSED_COPPER_TATER); - register("weathered_copper_tater", WEATHERED_COPPER_TATER); - register("oxidized_copper_tater", OXIDIZED_COPPER_TATER); - - register("cake_tater", CAKE_TATER); - register("endertater", ENDERTATER); - register("furnace_tater", FURNACE_TATER); - register("melon_tater", MELON_TATER); - register("pumpkin_tater", PUMPKIN_TATER); - register("jack_o_tater", JACK_O_TATER); - register("sculk_tater", SCULK_TATER); - register("slime_tater", SLIME_TATER); - register("herobrine_tater", HEROBRINE_TATER); - register("ochre_froglight_tater", OCHRE_FROGLIGHT_TATER); - register("pearlescent_froglight_tater", PEARLESCENT_FROGLIGHT_TATER); - register("verdant_froglight_tater", VERDANT_FROGLIGHT_TATER); - register("snowman_tater", SNOWMAN_TATER); - - register("acacia_tater", ACACIA_TATER); - register("andesite_tater", ANDESITE_TATER); - register("bamboo_tater", BAMBOO_TATER); - register("barrier_tater", BARRIER_TATER); - register("bedrock_tater", BEDROCK_TATER); - register("birch_tater", BIRCH_TATER); - register("bone_tater", BONE_TATER); - register("brain_coral_tater", BRAIN_CORAL_TATER); - register("brick_tater", BRICK_TATER); - register("bubble_coral_tater", BUBBLE_CORAL_TATER); - register("cactus_tater", CACTUS_TATER); - register("chorus_tater", CHORUS_TATER); - register("clay_tater", CLAY_TATER); - register("crimson_tater", CRIMSON_TATER); - register("dark_oak_tater", DARK_OAK_TATER); - register("dark_prismarine_tater", DARK_PRISMARINE_TATER); - register("diorite_tater", DIORITE_TATER); - register("dirt_tater", DIRT_TATER); - register("end_stone_tater", END_STONE_TATER); - register("fire_coral_tater", FIRE_CORAL_TATER); - register("granite_tater", GRANITE_TATER); - register("grass_tater", GRASS_TATER); - register("hay_tater", HAY_TATER); - register("honey_tater", HONEY_TATER); - register("honeycomb_tater", HONEYCOMB_TATER); - register("horn_coral_tater", HORN_CORAL_TATER); - register("jungle_tater", JUNGLE_TATER); - register("light_tater", LIGHT_TATER); - register("mycelium_tater", MYCELIUM_TATER); - register("nether_wart_tater", NETHER_WART_TATER); - register("oak_tater", OAK_TATER); - register("obsidian_tater", OBSIDIAN_TATER); - register("podzol_tater", PODZOL_TATER); - register("prismarine_brick_tater", PRISMARINE_BRICK_TATER); - register("prismarine_tater", PRISMARINE_TATER); - register("red_sand_tater", RED_SAND_TATER); - register("sand_tater", SAND_TATER); - register("sea_lantern_tater", SEA_LANTERN_TATER); - register("shroomlight_tater", SHROOMLIGHT_TATER); - register("shulker_tater", SHULKER_TATER); - register("smooth_stone_tater", SMOOTH_STONE_TATER); - register("soul_sand_tater", SOUL_SAND_TATER); - register("sponge_tater", SPONGE_TATER); - register("spruce_tater", SPRUCE_TATER); - register("stone_brick_tater", STONE_BRICK_TATER); - register("structure_void_tater", STRUCTURE_VOID_TATER); - register("target_tater", TARGET_TATER); - register("terracotta_tater", TERRACOTTA_TATER); - register("tntater", TNTATER); - register("tube_coral_tater", TUBE_CORAL_TATER); - register("warped_tater", WARPED_TATER); - register("warped_wart_tater", WARPED_WART_TATER); - register("wool_tater", WOOL_TATER); - - register("acacia_log_tater", ACACIA_LOG_TATER); - register("angry_bee_tater", ANGRY_BEE_TATER); - register("beacon_tater", BEACON_TATER); - register("bee_nest_tater", BEE_NEST_TATER); - register("bee_tater", BEE_TATER); - register("beehive_tater", BEEHIVE_TATER); - register("birch_log_tater", BIRCH_LOG_TATER); - register("blackstone_tater", BLACKSTONE_TATER); - register("blaze_tater", BLAZE_TATER); - register("bookshelf_tater", BOOKSHELF_TATER); - register("brown_mooshroom_tater", BROWN_MOOSHROOM_TATER); - register("brown_mushroom_tater", BROWN_MUSHROOM_TATER); - register("cave_spider_tater", CAVE_SPIDER_TATER); - register("cobbled_deepslate_tater", COBBLED_DEEPSLATE_TATER); - register("cobblestone_tater", COBBLESTONE_TATER); - register("cocoa_tater", COCOA_TATER); - register("cold_strider_tater", COLD_STRIDER_TATER); - register("cow_tater", COW_TATER); - register("crafting_tater", CRAFTING_TATER); - register("crimson_nylium_tater", CRIMSON_NYLIUM_TATER); - register("crimson_stem_tater", CRIMSON_STEM_TATER); - register("dark_oak_log_tater", DARK_OAK_LOG_TATER); - register("daylight_detector_tater", DAYLIGHT_DETECTOR_TATER); - register("dead_brain_coral_tater", DEAD_BRAIN_CORAL_TATER); - register("dead_bubble_coral_tater", DEAD_BUBBLE_CORAL_TATER); - register("dead_fire_coral_tater", DEAD_FIRE_CORAL_TATER); - register("dead_horn_coral_tater", DEAD_HORN_CORAL_TATER); - register("dead_tube_coral_tater", DEAD_TUBE_CORAL_TATER); - register("deepslate_brick_tater", DEEPSLATE_BRICK_TATER); - register("deepslate_tater", DEEPSLATE_TATER); - register("dried_kelp_tater", DRIED_KELP_TATER); - register("drowned_tater", DROWNED_TATER); - register("eye_of_ender_tater", EYE_OF_ENDER_TATER); - register("fox_tater", FOX_TATER); - register("ghast_tater", GHAST_TATER); - register("gilded_blackstone_tater", GILDED_BLACKSTONE_TATER); - register("glow_squid_tater", GLOW_SQUID_TATER); - register("glowstone_tater", GLOWSTONE_TATER); - register("husk_tater", HUSK_TATER); - register("inverted_daylight_detector_tater", INVERTED_DAYLIGHT_DETECTOR_TATER); - register("jungle_log_tater", JUNGLE_LOG_TATER); - register("magma_cube_tater", MAGMA_CUBE_TATER); - register("moobloom_tater", MOOBLOOM_TATER); - register("moolip_tater", MOOLIP_TATER); - register("muddy_pig_tater", MUDDY_PIG_TATER); - register("mushroom_stem_tater", MUSHROOM_STEM_TATER); - register("nether_brick_tater", NETHER_BRICK_TATER); - register("netherrack_tater", NETHERRACK_TATER); - register("oak_log_tater", OAK_LOG_TATER); - register("pig_tater", PIG_TATER); - register("polar_bear_tater", POLAR_BEAR_TATER); - register("puffertater", PUFFERTATER); - register("red_mooshroom_tater", RED_MOOSHROOM_TATER); - register("red_mushroom_tater", RED_MUSHROOM_TATER); - register("red_nether_brick_tater", RED_NETHER_BRICK_TATER); - register("red_sandstone_tater", RED_SANDSTONE_TATER); - register("ruby_tater", RUBY_TATER); - register("sandstone_tater", SANDSTONE_TATER); - register("sea_pickle_tater", SEA_PICKLE_TATER); - register("sheep_tater", SHEEP_TATER); - register("shielded_wither_tater", SHIELDED_WITHER_TATER); - register("snow_fox_tater", SNOW_FOX_TATER); - register("spider_tater", SPIDER_TATER); - register("spruce_log_tater", SPRUCE_LOG_TATER); - register("squid_tater", SQUID_TATER); - register("stray_tater", STRAY_TATER); - register("strider_tater", STRIDER_TATER); - register("turtle_egg_tater", TURTLE_EGG_TATER); - register("warped_nylium_tater", WARPED_NYLIUM_TATER); - register("warped_stem_tater", WARPED_STEM_TATER); - register("wither_tater", WITHER_TATER); - - register("azalea_tater", AZALEA_TATER); - register("bell_tater", BELL_TATER); - register("cold_frog_tater", COLD_FROG_TATER); - register("conduit_tater", CONDUIT_TATER); - register("elder_guardian_tater", ELDER_GUARDIAN_TATER); - register("end_stone_brick_tater", END_STONE_BRICK_TATER); - register("flower_pot_tater", FLOWER_POT_TATER); - register("guardian_tater", GUARDIAN_TATER); - register("illager_tater", ILLAGER_TATER); - register("illusioner_tater", ILLUSIONER_TATER); - register("jukebox_tater", JUKEBOX_TATER); - register("lantern_tater", LANTERN_TATER); - register("piglin_tater", PIGLIN_TATER); - register("pink_wither_tater", PINK_WITHER_TATER); - register("piston_tater", PISTON_TATER); - register("purpur_tater", PURPUR_TATER); - register("soul_lantern_tater", SOUL_LANTERN_TATER); - register("soul_soil_tater", SOUL_SOIL_TATER); - register("sticky_piston_tater", STICKY_PISTON_TATER); - register("temperate_frog_tater", TEMPERATE_FROG_TATER); - register("underwater_tntater", UNDERWATER_TNTATER); - register("vex_tater", VEX_TATER); - register("villager_tater", VILLAGER_TATER); - register("vinditater", VINDITATER); - register("wandering_trader_tater", WANDERING_TRADER_TATER); - register("warm_frog_tater", WARM_FROG_TATER); - register("wax_tater", WAX_TATER); - register("witch_tater", WITCH_TATER); - register("zombie_villager_tater", ZOMBIE_VILLAGER_TATER); - register("zombified_piglin_tater", ZOMBIFIED_PIGLIN_TATER); - - register("bone_spider_tater", BONE_SPIDER_TATER); - register("bouldering_zombie_tater", BOULDERING_ZOMBIE_TATER); - register("charged_creeper_tater", CHARGED_CREEPER_TATER); - register("lobber_zombie_tater", LOBBER_ZOMBIE_TATER); - register("mossy_skeletater", MOSSY_SKELETATER); - register("stripped_acacia_log_tater", STRIPPED_ACACIA_LOG_TATER); - register("stripped_birch_log_tater", STRIPPED_BIRCH_LOG_TATER); - register("stripped_crimson_stem_tater", STRIPPED_CRIMSON_STEM_TATER); - register("stripped_dark_oak_log_tater", STRIPPED_DARK_OAK_LOG_TATER); - register("stripped_jungle_log_tater", STRIPPED_JUNGLE_LOG_TATER); - register("stripped_oak_log_tater", STRIPPED_OAK_LOG_TATER); - register("stripped_spruce_log_tater", STRIPPED_SPRUCE_LOG_TATER); - register("stripped_warped_stem_tater", STRIPPED_WARPED_STEM_TATER); - register("tropical_slime_tater", TROPICAL_SLIME_TATER); - - register("apple_tater", APPLE_TATER); - register("golden_apple_tater", GOLDEN_APPLE_TATER); - register("ice_tater", ICE_TATER); - register("king_tater", KING_TATER); - register("raw_copper_tater", RAW_COPPER_TATER); - register("raw_gold_tater", RAW_GOLD_TATER); - register("raw_iron_tater", RAW_IRON_TATER); - - register("allay_tater", ALLAY_TATER); - register("mangrove_log_tater", MANGROVE_LOG_TATER); - register("mangrove_tater", MANGROVE_TATER); - register("mud_brick_tater", MUD_BRICK_TATER); - register("mud_tater", MUD_TATER); - register("packed_mud_tater", PACKED_MUD_TATER); - register("stripped_mangrove_log_tater", STRIPPED_MANGROVE_LOG_TATER); - - register("lucy_axolotl_tater", LUCY_AXOLOTL_TATER); - register("wild_axolotl_tater", WILD_AXOLOTL_TATER); - register("gold_axolotl_tater", GOLD_AXOLOTL_TATER); - register("cyan_axolotl_tater", CYAN_AXOLOTL_TATER); - register("blue_axolotl_tater", BLUE_AXOLOTL_TATER); - - register("bronze_capsule_tater", BRONZE_CAPSULE_TATER); - register("silver_capsule_tater", SILVER_CAPSULE_TATER); - register("gold_capsule_tater", GOLD_CAPSULE_TATER); - - register("corruptater", CORRUPTATER); - registerBlockEntity("launch_pad", LAUNCH_PAD_ENTITY); registerBlockEntity("contributor_statue", CONTRIBUTOR_STATUE_ENTITY); registerBlockEntity("tateroid", TATEROID_ENTITY); @@ -864,8 +528,11 @@ public static void register() { registerBlockEntity("bell_tater", BELL_TATER_ENTITY); } - private static T register(String id, T block) { - return Registry.register(Registries.BLOCK, NucleoidExtras.identifier(id), block); + private static T register(String id, Block.Settings settings, Function factory) { + RegistryKey key = RegistryKey.of(RegistryKeys.BLOCK, NucleoidExtras.identifier(id)); + T block = factory.apply(settings.registryKey(key)); + + return Registry.register(Registries.BLOCK, key, block); } private static BlockEntityType registerBlockEntity(String id, BlockEntityType type) { diff --git a/src/main/java/xyz/nucleoid/extras/lobby/NEEntities.java b/src/main/java/xyz/nucleoid/extras/lobby/NEEntities.java index f8eec0a8..68e302a3 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/NEEntities.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/NEEntities.java @@ -2,39 +2,43 @@ import eu.pb4.polymer.core.api.entity.PolymerEntityUtils; import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry; -import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder; -import net.minecraft.entity.EntityDimensions; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.SpawnGroup; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; import xyz.nucleoid.extras.NucleoidExtras; import xyz.nucleoid.extras.lobby.entity.LeaderboardDisplayEntity; import xyz.nucleoid.extras.lobby.entity.QuickArmorStandEntity; public class NEEntities { public static final EntityType QUICK_ARMOR_STAND = - FabricEntityTypeBuilder.create(SpawnGroup.MISC, QuickArmorStandEntity::new) - .dimensions(EntityDimensions.fixed(0.5f, 1.975f)) - .trackRangeChunks(2) - .trackedUpdateRate(10) - .build(); + register("quick_armor_stand", EntityType.Builder + .create(QuickArmorStandEntity::new, SpawnGroup.MISC) + .dimensions(0.5f, 1.975f) + .maxTrackingRange(2) + .trackingTickInterval(10)); + + public static final EntityType LEADERBOARD_DISPLAY = - FabricEntityTypeBuilder.create(SpawnGroup.MISC, LeaderboardDisplayEntity::new) - .dimensions(EntityDimensions.fixed(0f, 0f)) - .trackRangeChunks(2) - .trackedUpdateRate(10) - .build(); + register("leaderboard_display", EntityType.Builder + .create(LeaderboardDisplayEntity::new, SpawnGroup.MISC) + .dimensions(0f, 0f) + .maxTrackingRange(2) + .trackingTickInterval(10)); public static void register() { - register("quick_armor_stand", QUICK_ARMOR_STAND); - register("leaderboard_display", LEADERBOARD_DISPLAY); FabricDefaultAttributeRegistry.register(QUICK_ARMOR_STAND, QuickArmorStandEntity.createLivingAttributes()); } - private static > T register(String id, T item) { - PolymerEntityUtils.registerType(item); - return Registry.register(Registries.ENTITY_TYPE, NucleoidExtras.identifier(id), item); + private static EntityType register(String id, EntityType.Builder builder) { + RegistryKey> key = RegistryKey.of(RegistryKeys.ENTITY_TYPE, NucleoidExtras.identifier(id)); + EntityType type = builder.build(key); + + PolymerEntityUtils.registerType(type); + return Registry.register(Registries.ENTITY_TYPE, key, type); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/NEItems.java b/src/main/java/xyz/nucleoid/extras/lobby/NEItems.java index 1f4ab1b4..f6dd82ec 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/NEItems.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/NEItems.java @@ -8,14 +8,19 @@ import net.fabricmc.fabric.api.networking.v1.PacketSender; import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents; import net.minecraft.block.Block; +import net.minecraft.component.DataComponentTypes; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.resource.featuretoggle.FeatureFlags; import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; @@ -30,6 +35,11 @@ import net.minecraft.world.World; import xyz.nucleoid.extras.NucleoidExtras; import xyz.nucleoid.extras.NucleoidExtrasConfig; +import xyz.nucleoid.extras.component.GamePortalComponent; +import xyz.nucleoid.extras.component.LauncherComponent; +import xyz.nucleoid.extras.component.NEDataComponentTypes; +import xyz.nucleoid.extras.component.TaterPositionsComponent; +import xyz.nucleoid.extras.component.TaterSelectionComponent; import xyz.nucleoid.extras.lobby.block.tater.TinyPotatoBlock; import xyz.nucleoid.extras.lobby.item.GamePortalOpenerItem; import xyz.nucleoid.extras.lobby.item.LaunchFeatherItem; @@ -41,12 +51,13 @@ import xyz.nucleoid.extras.lobby.item.tater.CreativeTaterBoxItem; import xyz.nucleoid.extras.lobby.item.tater.TaterBoxItem; import xyz.nucleoid.extras.lobby.item.tater.TaterGuidebookItem; -import xyz.nucleoid.plasmid.game.manager.GameSpaceManager; +import xyz.nucleoid.plasmid.api.game.GameSpaceManager; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.function.Consumer; +import java.util.function.Function; public class NEItems { private static final List TATERS = new ArrayList<>(); @@ -76,6 +87,7 @@ public class NEItems { entries.add(NEItems.TRANSIENT_CHERRY_DOOR); entries.add(NEItems.TRANSIENT_DARK_OAK_DOOR); entries.add(NEItems.TRANSIENT_MANGROVE_DOOR); + entries.add(NEItems.TRANSIENT_PALE_OAK_DOOR); entries.add(NEItems.TRANSIENT_BAMBOO_DOOR); entries.add(NEItems.TRANSIENT_CRIMSON_DOOR); entries.add(NEItems.TRANSIENT_WARPED_DOOR); @@ -103,724 +115,386 @@ public class NEItems { }) .build(); - public static final Item NUCLEOID_LOGO = createHead(NEBlocks.NUCLEOID_LOGO); - public static final Item NUCLE_PAST_LOGO = createHead(NEBlocks.NUCLE_PAST_LOGO); - - public static final Item END_PORTAL = createSimple(NEBlocks.END_PORTAL, Items.BLACK_CARPET); - public static final Item END_GATEWAY = createSimple(NEBlocks.END_GATEWAY, Items.BLACK_WOOL); - public static final Item SAFE_TNT = createSimple(NEBlocks.SAFE_TNT, Items.TNT); - - public static final Item GOLD_LAUNCH_PAD = createSimple(NEBlocks.GOLD_LAUNCH_PAD, Items.LIGHT_WEIGHTED_PRESSURE_PLATE); - public static final Item IRON_LAUNCH_PAD = createSimple(NEBlocks.IRON_LAUNCH_PAD, Items.HEAVY_WEIGHTED_PRESSURE_PLATE); - - public static final Item CONTRIBUTOR_STATUE = createSimple(NEBlocks.CONTRIBUTOR_STATUE, Items.SMOOTH_STONE); - - public static final Item INFINITE_DISPENSER = createSimple(NEBlocks.INFINITE_DISPENSER, Items.DISPENSER); - public static final Item INFINITE_DROPPER = createSimple(NEBlocks.INFINITE_DROPPER, Items.DROPPER); - public static final Item SNAKE_BLOCK = createSimple(NEBlocks.SNAKE_BLOCK, Items.LIME_CONCRETE); - public static final Item FAST_SNAKE_BLOCK = createSimple(NEBlocks.FAST_SNAKE_BLOCK, Items.LIGHT_BLUE_CONCRETE); - - public static final Item TRANSIENT_IRON_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_IRON_DOOR, new Item.Settings(), Items.IRON_DOOR); - public static final Item TRANSIENT_OAK_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_OAK_DOOR, new Item.Settings(), Items.OAK_DOOR); - public static final Item TRANSIENT_SPRUCE_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_SPRUCE_DOOR, new Item.Settings(), Items.SPRUCE_DOOR); - public static final Item TRANSIENT_BIRCH_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_BIRCH_DOOR, new Item.Settings(), Items.BIRCH_DOOR); - public static final Item TRANSIENT_JUNGLE_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_JUNGLE_DOOR, new Item.Settings(), Items.JUNGLE_DOOR); - public static final Item TRANSIENT_ACACIA_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_ACACIA_DOOR, new Item.Settings(), Items.ACACIA_DOOR); - public static final Item TRANSIENT_CHERRY_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_CHERRY_DOOR, new Item.Settings(), Items.CHERRY_DOOR); - public static final Item TRANSIENT_DARK_OAK_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_DARK_OAK_DOOR, new Item.Settings(), Items.DARK_OAK_DOOR); - public static final Item TRANSIENT_MANGROVE_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_MANGROVE_DOOR, new Item.Settings(), Items.MANGROVE_DOOR); - public static final Item TRANSIENT_BAMBOO_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_BAMBOO_DOOR, new Item.Settings(), Items.BAMBOO_DOOR); - public static final Item TRANSIENT_CRIMSON_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_CRIMSON_DOOR, new Item.Settings(), Items.CRIMSON_DOOR); - public static final Item TRANSIENT_WARPED_DOOR = new LobbyTallBlockItem(NEBlocks.TRANSIENT_WARPED_DOOR, new Item.Settings(), Items.WARPED_DOOR); - - public static final Item BLACK_CONCRETE_POWDER = createSimple(NEBlocks.BLACK_CONCRETE_POWDER, Items.BLACK_CONCRETE_POWDER); - public static final Item BLUE_CONCRETE_POWDER = createSimple(NEBlocks.BLUE_CONCRETE_POWDER, Items.BLUE_CONCRETE_POWDER); - public static final Item BROWN_CONCRETE_POWDER = createSimple(NEBlocks.BROWN_CONCRETE_POWDER, Items.BROWN_CONCRETE_POWDER); - public static final Item CYAN_CONCRETE_POWDER = createSimple(NEBlocks.CYAN_CONCRETE_POWDER, Items.CYAN_CONCRETE_POWDER); - public static final Item GREEN_CONCRETE_POWDER = createSimple(NEBlocks.GREEN_CONCRETE_POWDER, Items.GREEN_CONCRETE_POWDER); - public static final Item GRAY_CONCRETE_POWDER = createSimple(NEBlocks.GRAY_CONCRETE_POWDER, Items.GRAY_CONCRETE_POWDER); - public static final Item LIGHT_BLUE_CONCRETE_POWDER = createSimple(NEBlocks.LIGHT_BLUE_CONCRETE_POWDER, Items.LIGHT_BLUE_CONCRETE_POWDER); - public static final Item LIGHT_GRAY_CONCRETE_POWDER = createSimple(NEBlocks.LIGHT_GRAY_CONCRETE_POWDER, Items.LIGHT_GRAY_CONCRETE_POWDER); - public static final Item LIME_CONCRETE_POWDER = createSimple(NEBlocks.LIME_CONCRETE_POWDER, Items.LIME_CONCRETE_POWDER); - public static final Item MAGENTA_CONCRETE_POWDER = createSimple(NEBlocks.MAGENTA_CONCRETE_POWDER, Items.MAGENTA_CONCRETE_POWDER); - public static final Item ORANGE_CONCRETE_POWDER = createSimple(NEBlocks.ORANGE_CONCRETE_POWDER, Items.ORANGE_CONCRETE_POWDER); - public static final Item PINK_CONCRETE_POWDER = createSimple(NEBlocks.PINK_CONCRETE_POWDER, Items.PINK_CONCRETE_POWDER); - public static final Item PURPLE_CONCRETE_POWDER = createSimple(NEBlocks.PURPLE_CONCRETE_POWDER, Items.PURPLE_CONCRETE_POWDER); - public static final Item RED_CONCRETE_POWDER = createSimple(NEBlocks.RED_CONCRETE_POWDER, Items.RED_CONCRETE_POWDER); - public static final Item WHITE_CONCRETE_POWDER = createSimple(NEBlocks.WHITE_CONCRETE_POWDER, Items.WHITE_CONCRETE_POWDER); - public static final Item YELLOW_CONCRETE_POWDER = createSimple(NEBlocks.YELLOW_CONCRETE_POWDER, Items.YELLOW_CONCRETE_POWDER); - - public static final Item TINY_POTATO = createHead(NEBlocks.TINY_POTATO); - public static final Item BOTANICAL_TINY_POTATO = createHead(NEBlocks.BOTANICAL_TINY_POTATO); - public static final Item IRRITATER = createHead(NEBlocks.IRRITATER); - public static final Item SAD_TATER = createHead(NEBlocks.SAD_TATER); - public static final Item FLOWERING_AZALEA_TATER = createHead(NEBlocks.FLOWERING_AZALEA_TATER); - public static final Item STONE_TATER = createHead(NEBlocks.STONE_TATER); - public static final Item CALCITE_TATER = createHead(NEBlocks.CALCITE_TATER); - public static final Item TUFF_TATER = createHead(NEBlocks.TUFF_TATER); - public static final Item BASALT_TATER = createHead(NEBlocks.BASALT_TATER); - public static final Item DRIPSTONE_TATER = createHead(NEBlocks.DRIPSTONE_TATER); - public static final Item AMETHYST_TATER = createHead(NEBlocks.AMETHYST_TATER); - public static final Item PACKED_ICE_TATER = createHead(NEBlocks.PACKED_ICE_TATER); - public static final Item BLUE_ICE_TATER = createHead(NEBlocks.BLUE_ICE_TATER); - public static final Item FLAME_TATER = createHead(NEBlocks.FLAME_TATER); - public static final Item PUZZLE_CUBE_TATER = createHead(NEBlocks.PUZZLE_CUBE_TATER); - public static final Item LUCKY_TATER = createHead(NEBlocks.LUCKY_TATER); - public static final Item CRATE_TATER = createHead(NEBlocks.CRATE_TATER); - public static final Item TATER_OF_UNDYING = createHead(NEBlocks.TATER_OF_UNDYING); - public static final Item CRYING_OBSIDIAN_TATER = createHead(NEBlocks.CRYING_OBSIDIAN_TATER); - public static final Item DICE_TATER = createHead(NEBlocks.DICE_TATER); - public static final Item TRANS_TATER = createHead(NEBlocks.TRANS_TATER); - public static final Item ASEXUAL_TATER = createHead(NEBlocks.ASEXUAL_TATER); - public static final Item BI_TATER = createHead(NEBlocks.BI_TATER); - public static final Item GAY_TATER = createHead(NEBlocks.GAY_TATER); - public static final Item LESBIAN_TATER = createHead(NEBlocks.LESBIAN_TATER); - public static final Item NONBINARY_TATER = createHead(NEBlocks.NONBINARY_TATER); - public static final Item PAN_TATER = createHead(NEBlocks.PAN_TATER); - public static final Item WARDEN_TATER = createHead(NEBlocks.WARDEN_TATER); - public static final Item VIRAL_TATER = createHead(NEBlocks.VIRAL_TATER); - public static final Item TATEROID = createHead(NEBlocks.TATEROID); - public static final Item RED_TATEROID = createHead(NEBlocks.RED_TATEROID); - public static final Item ORANGE_TATEROID = createHead(NEBlocks.ORANGE_TATEROID); - public static final Item YELLOW_TATEROID = createHead(NEBlocks.YELLOW_TATEROID); - public static final Item GREEN_TATEROID = createHead(NEBlocks.GREEN_TATEROID); - public static final Item BLUE_TATEROID = createHead(NEBlocks.BLUE_TATEROID); - public static final Item PURPLE_TATEROID = createHead(NEBlocks.PURPLE_TATEROID); - public static final Item FLIPPED_TATER = createHead(NEBlocks.FLIPPED_TATER); - public static final Item BACKWARD_TATER = createHead(NEBlocks.BACKWARD_TATER); - public static final Item UPWARD_TATER = createHead(NEBlocks.UPWARD_TATER); - public static final Item SANTA_HAT_TATER = createHead(NEBlocks.SANTA_HAT_TATER); - public static final Item GENDERFLUID_TATER = createHead(NEBlocks.GENDERFLUID_TATER); - public static final Item DEMISEXUAL_TATER = createHead(NEBlocks.DEMISEXUAL_TATER); - - public static final Item SKELETATER = createHead(NEBlocks.SKELETATER); - public static final Item WITHER_SKELETATER = createHead(NEBlocks.WITHER_SKELETATER); - public static final Item ZOMBIE_TATER = createHead(NEBlocks.ZOMBIE_TATER); - public static final Item CREEPER_TATER = createHead(NEBlocks.CREEPER_TATER); - public static final Item STEVE_TATER = createHead(NEBlocks.STEVE_TATER); - public static final Item ALEX_TATER = createHead(NEBlocks.ALEX_TATER); - - public static final Item WHITE_TATER = createHead(NEBlocks.WHITE_TATER); - public static final Item ORANGE_TATER = createHead(NEBlocks.ORANGE_TATER); - public static final Item MAGENTA_TATER = createHead(NEBlocks.MAGENTA_TATER); - public static final Item LIGHT_BLUE_TATER = createHead(NEBlocks.LIGHT_BLUE_TATER); - public static final Item YELLOW_TATER = createHead(NEBlocks.YELLOW_TATER); - public static final Item LIME_TATER = createHead(NEBlocks.LIME_TATER); - public static final Item PINK_TATER = createHead(NEBlocks.PINK_TATER); - public static final Item GRAY_TATER = createHead(NEBlocks.GRAY_TATER); - public static final Item LIGHT_GRAY_TATER = createHead(NEBlocks.LIGHT_GRAY_TATER); - public static final Item CYAN_TATER = createHead(NEBlocks.CYAN_TATER); - public static final Item PURPLE_TATER = createHead(NEBlocks.PURPLE_TATER); - public static final Item BLUE_TATER = createHead(NEBlocks.BLUE_TATER); - public static final Item BROWN_TATER = createHead(NEBlocks.BROWN_TATER); - public static final Item GREEN_TATER = createHead(NEBlocks.GREEN_TATER); - public static final Item RED_TATER = createHead(NEBlocks.RED_TATER); - public static final Item BLACK_TATER = createHead(NEBlocks.BLACK_TATER); - - public static final Item COAL_TATER = createHead(NEBlocks.COAL_TATER); - public static final Item DIAMOND_TATER = createHead(NEBlocks.DIAMOND_TATER); - public static final Item EMERALD_TATER = createHead(NEBlocks.EMERALD_TATER); - public static final Item GOLD_TATER = createHead(NEBlocks.GOLD_TATER); - public static final Item IRON_TATER = createHead(NEBlocks.IRON_TATER); - public static final Item LAPIS_TATER = createHead(NEBlocks.LAPIS_TATER); - public static final Item NETHERITE_TATER = createHead(NEBlocks.NETHERITE_TATER); - public static final Item QUARTZ_TATER = createHead(NEBlocks.QUARTZ_TATER); - public static final Item REDSTONE_TATER = createHead(NEBlocks.REDSTONE_TATER); - - public static final Item COPPER_TATER = createHead(NEBlocks.COPPER_TATER); - public static final Item EXPOSED_COPPER_TATER = createHead(NEBlocks.EXPOSED_COPPER_TATER); - public static final Item WEATHERED_COPPER_TATER = createHead(NEBlocks.WEATHERED_COPPER_TATER); - public static final Item OXIDIZED_COPPER_TATER = createHead(NEBlocks.OXIDIZED_COPPER_TATER); - - public static final Item CAKE_TATER = createHead(NEBlocks.CAKE_TATER); - public static final Item ENDERTATER = createHead(NEBlocks.ENDERTATER); - public static final Item FURNACE_TATER = createHead(NEBlocks.FURNACE_TATER); - public static final Item MELON_TATER = createHead(NEBlocks.MELON_TATER); - public static final Item PUMPKIN_TATER = createHead(NEBlocks.PUMPKIN_TATER); - public static final Item JACK_O_TATER = createHead(NEBlocks.JACK_O_TATER); - public static final Item SCULK_TATER = createHead(NEBlocks.SCULK_TATER); - public static final Item SLIME_TATER = createHead(NEBlocks.SLIME_TATER); - public static final Item HEROBRINE_TATER = createHead(NEBlocks.HEROBRINE_TATER); - public static final Item OCHRE_FROGLIGHT_TATER = createHead(NEBlocks.OCHRE_FROGLIGHT_TATER); - public static final Item PEARLESCENT_FROGLIGHT_TATER = createHead(NEBlocks.PEARLESCENT_FROGLIGHT_TATER); - public static final Item VERDANT_FROGLIGHT_TATER = createHead(NEBlocks.VERDANT_FROGLIGHT_TATER); - public static final Item SNOWMAN_TATER = createHead(NEBlocks.SNOWMAN_TATER); - - public static final Item ACACIA_TATER = createHead(NEBlocks.ACACIA_TATER); - public static final Item ANDESITE_TATER = createHead(NEBlocks.ANDESITE_TATER); - public static final Item BAMBOO_TATER = createHead(NEBlocks.BAMBOO_TATER); - public static final Item BARRIER_TATER = createHead(NEBlocks.BARRIER_TATER); - public static final Item BEDROCK_TATER = createHead(NEBlocks.BEDROCK_TATER); - public static final Item BIRCH_TATER = createHead(NEBlocks.BIRCH_TATER); - public static final Item BONE_TATER = createHead(NEBlocks.BONE_TATER); - public static final Item BRAIN_CORAL_TATER = createHead(NEBlocks.BRAIN_CORAL_TATER); - public static final Item BRICK_TATER = createHead(NEBlocks.BRICK_TATER); - public static final Item BUBBLE_CORAL_TATER = createHead(NEBlocks.BUBBLE_CORAL_TATER); - public static final Item CACTUS_TATER = createHead(NEBlocks.CACTUS_TATER); - public static final Item CHORUS_TATER = createHead(NEBlocks.CHORUS_TATER); - public static final Item CLAY_TATER = createHead(NEBlocks.CLAY_TATER); - public static final Item CRIMSON_TATER = createHead(NEBlocks.CRIMSON_TATER); - public static final Item DARK_OAK_TATER = createHead(NEBlocks.DARK_OAK_TATER); - public static final Item DARK_PRISMARINE_TATER = createHead(NEBlocks.DARK_PRISMARINE_TATER); - public static final Item DIORITE_TATER = createHead(NEBlocks.DIORITE_TATER); - public static final Item DIRT_TATER = createHead(NEBlocks.DIRT_TATER); - public static final Item END_STONE_TATER = createHead(NEBlocks.END_STONE_TATER); - public static final Item FIRE_CORAL_TATER = createHead(NEBlocks.FIRE_CORAL_TATER); - public static final Item GRANITE_TATER = createHead(NEBlocks.GRANITE_TATER); - public static final Item GRASS_TATER = createHead(NEBlocks.GRASS_TATER); - public static final Item HAY_TATER = createHead(NEBlocks.HAY_TATER); - public static final Item HONEY_TATER = createHead(NEBlocks.HONEY_TATER); - public static final Item HONEYCOMB_TATER = createHead(NEBlocks.HONEYCOMB_TATER); - public static final Item HORN_CORAL_TATER = createHead(NEBlocks.HORN_CORAL_TATER); - public static final Item JUNGLE_TATER = createHead(NEBlocks.JUNGLE_TATER); - public static final Item LIGHT_TATER = createHead(NEBlocks.LIGHT_TATER); - public static final Item MYCELIUM_TATER = createHead(NEBlocks.MYCELIUM_TATER); - public static final Item NETHER_WART_TATER = createHead(NEBlocks.NETHER_WART_TATER); - public static final Item OAK_TATER = createHead(NEBlocks.OAK_TATER); - public static final Item OBSIDIAN_TATER = createHead(NEBlocks.OBSIDIAN_TATER); - public static final Item PODZOL_TATER = createHead(NEBlocks.PODZOL_TATER); - public static final Item PRISMARINE_BRICK_TATER = createHead(NEBlocks.PRISMARINE_BRICK_TATER); - public static final Item PRISMARINE_TATER = createHead(NEBlocks.PRISMARINE_TATER); - public static final Item RED_SAND_TATER = createHead(NEBlocks.RED_SAND_TATER); - public static final Item SAND_TATER = createHead(NEBlocks.SAND_TATER); - public static final Item SEA_LANTERN_TATER = createHead(NEBlocks.SEA_LANTERN_TATER); - public static final Item SHROOMLIGHT_TATER = createHead(NEBlocks.SHROOMLIGHT_TATER); - public static final Item SHULKER_TATER = createHead(NEBlocks.SHULKER_TATER); - public static final Item SMOOTH_STONE_TATER = createHead(NEBlocks.SMOOTH_STONE_TATER); - public static final Item SOUL_SAND_TATER = createHead(NEBlocks.SOUL_SAND_TATER); - public static final Item SPONGE_TATER = createHead(NEBlocks.SPONGE_TATER); - public static final Item SPRUCE_TATER = createHead(NEBlocks.SPRUCE_TATER); - public static final Item STONE_BRICK_TATER = createHead(NEBlocks.STONE_BRICK_TATER); - public static final Item STRUCTURE_VOID_TATER = createHead(NEBlocks.STRUCTURE_VOID_TATER); - public static final Item TARGET_TATER = createHead(NEBlocks.TARGET_TATER); - public static final Item TERRACOTTA_TATER = createHead(NEBlocks.TERRACOTTA_TATER); - public static final Item TNTATER = createHead(NEBlocks.TNTATER); - public static final Item TUBE_CORAL_TATER = createHead(NEBlocks.TUBE_CORAL_TATER); - public static final Item WARPED_TATER = createHead(NEBlocks.WARPED_TATER); - public static final Item WARPED_WART_TATER = createHead(NEBlocks.WARPED_WART_TATER); - public static final Item WOOL_TATER = createHead(NEBlocks.WOOL_TATER); - - public static final Item ACACIA_LOG_TATER = createHead(NEBlocks.ACACIA_LOG_TATER); - public static final Item ANGRY_BEE_TATER = createHead(NEBlocks.ANGRY_BEE_TATER); - public static final Item BEACON_TATER = createHead(NEBlocks.BEACON_TATER); - public static final Item BEE_NEST_TATER = createHead(NEBlocks.BEE_NEST_TATER); - public static final Item BEE_TATER = createHead(NEBlocks.BEE_TATER); - public static final Item BEEHIVE_TATER = createHead(NEBlocks.BEEHIVE_TATER); - public static final Item BIRCH_LOG_TATER = createHead(NEBlocks.BIRCH_LOG_TATER); - public static final Item BLACKSTONE_TATER = createHead(NEBlocks.BLACKSTONE_TATER); - public static final Item BLAZE_TATER = createHead(NEBlocks.BLAZE_TATER); - public static final Item BOOKSHELF_TATER = createHead(NEBlocks.BOOKSHELF_TATER); - public static final Item BROWN_MOOSHROOM_TATER = createHead(NEBlocks.BROWN_MOOSHROOM_TATER); - public static final Item BROWN_MUSHROOM_TATER = createHead(NEBlocks.BROWN_MUSHROOM_TATER); - public static final Item CAVE_SPIDER_TATER = createHead(NEBlocks.CAVE_SPIDER_TATER); - public static final Item COBBLED_DEEPSLATE_TATER = createHead(NEBlocks.COBBLED_DEEPSLATE_TATER); - public static final Item COBBLESTONE_TATER = createHead(NEBlocks.COBBLESTONE_TATER); - public static final Item COCOA_TATER = createHead(NEBlocks.COCOA_TATER); - public static final Item COLD_STRIDER_TATER = createHead(NEBlocks.COLD_STRIDER_TATER); - public static final Item COW_TATER = createHead(NEBlocks.COW_TATER); - public static final Item CRAFTING_TATER = createHead(NEBlocks.CRAFTING_TATER); - public static final Item CRIMSON_NYLIUM_TATER = createHead(NEBlocks.CRIMSON_NYLIUM_TATER); - public static final Item CRIMSON_STEM_TATER = createHead(NEBlocks.CRIMSON_STEM_TATER); - public static final Item DARK_OAK_LOG_TATER = createHead(NEBlocks.DARK_OAK_LOG_TATER); - public static final Item DAYLIGHT_DETECTOR_TATER = createHead(NEBlocks.DAYLIGHT_DETECTOR_TATER); - public static final Item DEAD_BRAIN_CORAL_TATER = createHead(NEBlocks.DEAD_BRAIN_CORAL_TATER); - public static final Item DEAD_BUBBLE_CORAL_TATER = createHead(NEBlocks.DEAD_BUBBLE_CORAL_TATER); - public static final Item DEAD_FIRE_CORAL_TATER = createHead(NEBlocks.DEAD_FIRE_CORAL_TATER); - public static final Item DEAD_HORN_CORAL_TATER = createHead(NEBlocks.DEAD_HORN_CORAL_TATER); - public static final Item DEAD_TUBE_CORAL_TATER = createHead(NEBlocks.DEAD_TUBE_CORAL_TATER); - public static final Item DEEPSLATE_BRICK_TATER = createHead(NEBlocks.DEEPSLATE_BRICK_TATER); - public static final Item DEEPSLATE_TATER = createHead(NEBlocks.DEEPSLATE_TATER); - public static final Item DRIED_KELP_TATER = createHead(NEBlocks.DRIED_KELP_TATER); - public static final Item DROWNED_TATER = createHead(NEBlocks.DROWNED_TATER); - public static final Item EYE_OF_ENDER_TATER = createHead(NEBlocks.EYE_OF_ENDER_TATER); - public static final Item FOX_TATER = createHead(NEBlocks.FOX_TATER); - public static final Item GHAST_TATER = createHead(NEBlocks.GHAST_TATER); - public static final Item GILDED_BLACKSTONE_TATER = createHead(NEBlocks.GILDED_BLACKSTONE_TATER); - public static final Item GLOW_SQUID_TATER = createHead(NEBlocks.GLOW_SQUID_TATER); - public static final Item GLOWSTONE_TATER = createHead(NEBlocks.GLOWSTONE_TATER); - public static final Item HUSK_TATER = createHead(NEBlocks.HUSK_TATER); - public static final Item INVERTED_DAYLIGHT_DETECTOR_TATER = createHead(NEBlocks.INVERTED_DAYLIGHT_DETECTOR_TATER); - public static final Item JUNGLE_LOG_TATER = createHead(NEBlocks.JUNGLE_LOG_TATER); - public static final Item MAGMA_CUBE_TATER = createHead(NEBlocks.MAGMA_CUBE_TATER); - public static final Item MOOBLOOM_TATER = createHead(NEBlocks.MOOBLOOM_TATER); - public static final Item MOOLIP_TATER = createHead(NEBlocks.MOOLIP_TATER); - public static final Item MUDDY_PIG_TATER = createHead(NEBlocks.MUDDY_PIG_TATER); - public static final Item MUSHROOM_STEM_TATER = createHead(NEBlocks.MUSHROOM_STEM_TATER); - public static final Item NETHER_BRICK_TATER = createHead(NEBlocks.NETHER_BRICK_TATER); - public static final Item NETHERRACK_TATER = createHead(NEBlocks.NETHERRACK_TATER); - public static final Item OAK_LOG_TATER = createHead(NEBlocks.OAK_LOG_TATER); - public static final Item PIG_TATER = createHead(NEBlocks.PIG_TATER); - public static final Item POLAR_BEAR_TATER = createHead(NEBlocks.POLAR_BEAR_TATER); - public static final Item PUFFERTATER = createHead(NEBlocks.PUFFERTATER); - public static final Item RED_MOOSHROOM_TATER = createHead(NEBlocks.RED_MOOSHROOM_TATER); - public static final Item RED_MUSHROOM_TATER = createHead(NEBlocks.RED_MUSHROOM_TATER); - public static final Item RED_NETHER_BRICK_TATER = createHead(NEBlocks.RED_NETHER_BRICK_TATER); - public static final Item RED_SANDSTONE_TATER = createHead(NEBlocks.RED_SANDSTONE_TATER); - public static final Item RUBY_TATER = createHead(NEBlocks.RUBY_TATER); - public static final Item SANDSTONE_TATER = createHead(NEBlocks.SANDSTONE_TATER); - public static final Item SEA_PICKLE_TATER = createHead(NEBlocks.SEA_PICKLE_TATER); - public static final Item SHEEP_TATER = createHead(NEBlocks.SHEEP_TATER); - public static final Item SHIELDED_WITHER_TATER = createHead(NEBlocks.SHIELDED_WITHER_TATER); - public static final Item SNOW_FOX_TATER = createHead(NEBlocks.SNOW_FOX_TATER); - public static final Item SPIDER_TATER = createHead(NEBlocks.SPIDER_TATER); - public static final Item SPRUCE_LOG_TATER = createHead(NEBlocks.SPRUCE_LOG_TATER); - public static final Item SQUID_TATER = createHead(NEBlocks.SQUID_TATER); - public static final Item STRAY_TATER = createHead(NEBlocks.STRAY_TATER); - public static final Item STRIDER_TATER = createHead(NEBlocks.STRIDER_TATER); - public static final Item TURTLE_EGG_TATER = createHead(NEBlocks.TURTLE_EGG_TATER); - public static final Item WARPED_NYLIUM_TATER = createHead(NEBlocks.WARPED_NYLIUM_TATER); - public static final Item WARPED_STEM_TATER = createHead(NEBlocks.WARPED_STEM_TATER); - public static final Item WITHER_TATER = createHead(NEBlocks.WITHER_TATER); - - public static final Item AZALEA_TATER = createHead(NEBlocks.AZALEA_TATER); - public static final Item BELL_TATER = createHead(NEBlocks.BELL_TATER); - public static final Item COLD_FROG_TATER = createHead(NEBlocks.COLD_FROG_TATER); - public static final Item CONDUIT_TATER = createHead(NEBlocks.CONDUIT_TATER); - public static final Item ELDER_GUARDIAN_TATER = createHead(NEBlocks.ELDER_GUARDIAN_TATER); - public static final Item END_STONE_BRICK_TATER = createHead(NEBlocks.END_STONE_BRICK_TATER); - public static final Item FLOWER_POT_TATER = createHead(NEBlocks.FLOWER_POT_TATER); - public static final Item GUARDIAN_TATER = createHead(NEBlocks.GUARDIAN_TATER); - public static final Item ILLAGER_TATER = createHead(NEBlocks.ILLAGER_TATER); - public static final Item ILLUSIONER_TATER = createHead(NEBlocks.ILLUSIONER_TATER); - public static final Item JUKEBOX_TATER = createHead(NEBlocks.JUKEBOX_TATER); - public static final Item LANTERN_TATER = createHead(NEBlocks.LANTERN_TATER); - public static final Item PIGLIN_TATER = createHead(NEBlocks.PIGLIN_TATER); - public static final Item PINK_WITHER_TATER = createHead(NEBlocks.PINK_WITHER_TATER); - public static final Item PISTON_TATER = createHead(NEBlocks.PISTON_TATER); - public static final Item PURPUR_TATER = createHead(NEBlocks.PURPUR_TATER); - public static final Item SOUL_LANTERN_TATER = createHead(NEBlocks.SOUL_LANTERN_TATER); - public static final Item SOUL_SOIL_TATER = createHead(NEBlocks.SOUL_SOIL_TATER); - public static final Item STICKY_PISTON_TATER = createHead(NEBlocks.STICKY_PISTON_TATER); - public static final Item TEMPERATE_FROG_TATER = createHead(NEBlocks.TEMPERATE_FROG_TATER); - public static final Item UNDERWATER_TNTATER = createHead(NEBlocks.UNDERWATER_TNTATER); - public static final Item VEX_TATER = createHead(NEBlocks.VEX_TATER); - public static final Item VILLAGER_TATER = createHead(NEBlocks.VILLAGER_TATER); - public static final Item VINDITATER = createHead(NEBlocks.VINDITATER); - public static final Item WANDERING_TRADER_TATER = createHead(NEBlocks.WANDERING_TRADER_TATER); - public static final Item WARM_FROG_TATER = createHead(NEBlocks.WARM_FROG_TATER); - public static final Item WAX_TATER = createHead(NEBlocks.WAX_TATER); - public static final Item WITCH_TATER = createHead(NEBlocks.WITCH_TATER); - public static final Item ZOMBIE_VILLAGER_TATER = createHead(NEBlocks.ZOMBIE_VILLAGER_TATER); - public static final Item ZOMBIFIED_PIGLIN_TATER = createHead(NEBlocks.ZOMBIFIED_PIGLIN_TATER); - - public static final Item BONE_SPIDER_TATER = createHead(NEBlocks.BONE_SPIDER_TATER); - public static final Item BOULDERING_ZOMBIE_TATER = createHead(NEBlocks.BOULDERING_ZOMBIE_TATER); - public static final Item CHARGED_CREEPER_TATER = createHead(NEBlocks.CHARGED_CREEPER_TATER); - public static final Item LOBBER_ZOMBIE_TATER = createHead(NEBlocks.LOBBER_ZOMBIE_TATER); - public static final Item MOSSY_SKELETATER = createHead(NEBlocks.MOSSY_SKELETATER); - public static final Item STRIPPED_ACACIA_LOG_TATER = createHead(NEBlocks.STRIPPED_ACACIA_LOG_TATER); - public static final Item STRIPPED_BIRCH_LOG_TATER = createHead(NEBlocks.STRIPPED_BIRCH_LOG_TATER); - public static final Item STRIPPED_CRIMSON_STEM_TATER = createHead(NEBlocks.STRIPPED_CRIMSON_STEM_TATER); - public static final Item STRIPPED_DARK_OAK_LOG_TATER = createHead(NEBlocks.STRIPPED_DARK_OAK_LOG_TATER); - public static final Item STRIPPED_JUNGLE_LOG_TATER = createHead(NEBlocks.STRIPPED_JUNGLE_LOG_TATER); - public static final Item STRIPPED_OAK_LOG_TATER = createHead(NEBlocks.STRIPPED_OAK_LOG_TATER); - public static final Item STRIPPED_SPRUCE_LOG_TATER = createHead(NEBlocks.STRIPPED_SPRUCE_LOG_TATER); - public static final Item STRIPPED_WARPED_STEM_TATER = createHead(NEBlocks.STRIPPED_WARPED_STEM_TATER); - public static final Item TROPICAL_SLIME_TATER = createHead(NEBlocks.TROPICAL_SLIME_TATER); - - public static final Item APPLE_TATER = createHead(NEBlocks.APPLE_TATER); - public static final Item GOLDEN_APPLE_TATER = createHead(NEBlocks.GOLDEN_APPLE_TATER); - public static final Item ICE_TATER = createHead(NEBlocks.ICE_TATER); - public static final Item KING_TATER = createHead(NEBlocks.KING_TATER); - public static final Item RAW_COPPER_TATER = createHead(NEBlocks.RAW_COPPER_TATER); - public static final Item RAW_GOLD_TATER = createHead(NEBlocks.RAW_GOLD_TATER); - public static final Item RAW_IRON_TATER = createHead(NEBlocks.RAW_IRON_TATER); - - public static final Item ALLAY_TATER = createHead(NEBlocks.ALLAY_TATER); - public static final Item MANGROVE_LOG_TATER = createHead(NEBlocks.MANGROVE_LOG_TATER); - public static final Item MANGROVE_TATER = createHead(NEBlocks.MANGROVE_TATER); - public static final Item MUD_BRICK_TATER = createHead(NEBlocks.MUD_BRICK_TATER); - public static final Item MUD_TATER = createHead(NEBlocks.MUD_TATER); - public static final Item PACKED_MUD_TATER = createHead(NEBlocks.PACKED_MUD_TATER); - public static final Item STRIPPED_MANGROVE_LOG_TATER = createHead(NEBlocks.STRIPPED_MANGROVE_LOG_TATER); - - public static final Item LUCY_AXOLOTL_TATER = createHead(NEBlocks.LUCY_AXOLOTL_TATER); - public static final Item WILD_AXOLOTL_TATER = createHead(NEBlocks.WILD_AXOLOTL_TATER); - public static final Item GOLD_AXOLOTL_TATER = createHead(NEBlocks.GOLD_AXOLOTL_TATER); - public static final Item CYAN_AXOLOTL_TATER = createHead(NEBlocks.CYAN_AXOLOTL_TATER); - public static final Item BLUE_AXOLOTL_TATER = createHead(NEBlocks.BLUE_AXOLOTL_TATER); - - public static final Item BRONZE_CAPSULE_TATER = createHead(NEBlocks.BRONZE_CAPSULE_TATER); - public static final Item SILVER_CAPSULE_TATER = createHead(NEBlocks.SILVER_CAPSULE_TATER); - public static final Item GOLD_CAPSULE_TATER = createHead(NEBlocks.GOLD_CAPSULE_TATER); - - public static final Item CORRUPTATER = createHead(NEBlocks.CORRUPTATER); - - public static final Item TATER_BOX = new TaterBoxItem(new Item.Settings().maxDamage(0)); - public static final Item CREATIVE_TATER_BOX = new CreativeTaterBoxItem(new Item.Settings().maxDamage(0)); - - public static final Item TATER_GUIDEBOOK = new TaterGuidebookItem(new Item.Settings().maxCount(1)); - public static final Item QUICK_ARMOR_STAND = new QuickArmorStandItem(new Item.Settings()); - public static final Item GAME_PORTAL_OPENER = new GamePortalOpenerItem(new Item.Settings().maxCount(1)); - public static final Item LAUNCH_FEATHER = new LaunchFeatherItem(new Item.Settings().maxCount(1)); - - public static final Item RULE_BOOK = new RuleBookItem(new Item.Settings().rarity(Rarity.EPIC)); - - private static Item createHead(Block head) { + public static final Item NUCLEOID_LOGO = registerHead("nucleoid_logo", NEBlocks.NUCLEOID_LOGO); + public static final Item NUCLE_PAST_LOGO = registerHead("nucle_past_logo", NEBlocks.NUCLE_PAST_LOGO); + + public static final Item END_PORTAL = registerSimple("end_portal", NEBlocks.END_PORTAL, Items.BLACK_CARPET); + public static final Item END_GATEWAY = registerSimple("end_gateway", NEBlocks.END_GATEWAY, Items.BLACK_WOOL); + public static final Item SAFE_TNT = registerSimple("safe_tnt", NEBlocks.SAFE_TNT, Items.TNT); + + public static final Item GOLD_LAUNCH_PAD = registerSimple("gold_launch_pad", NEBlocks.GOLD_LAUNCH_PAD, Items.LIGHT_WEIGHTED_PRESSURE_PLATE); + public static final Item IRON_LAUNCH_PAD = registerSimple("iron_launch_pad", NEBlocks.IRON_LAUNCH_PAD, Items.HEAVY_WEIGHTED_PRESSURE_PLATE); + + public static final Item CONTRIBUTOR_STATUE = registerSimple("contributor_statue", NEBlocks.CONTRIBUTOR_STATUE, Items.SMOOTH_STONE); + + public static final Item INFINITE_DISPENSER = registerSimple("infinite_dispenser", NEBlocks.INFINITE_DISPENSER, Items.DISPENSER); + public static final Item INFINITE_DROPPER = registerSimple("infinite_dropper", NEBlocks.INFINITE_DROPPER, Items.DROPPER); + public static final Item SNAKE_BLOCK = registerSimple("snake_block", NEBlocks.SNAKE_BLOCK, Items.LIME_CONCRETE); + public static final Item FAST_SNAKE_BLOCK = registerSimple("fast_snake_block", NEBlocks.FAST_SNAKE_BLOCK, Items.LIGHT_BLUE_CONCRETE); + + public static final Item TRANSIENT_IRON_DOOR = register("transient_iron_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_IRON_DOOR, settings, Items.IRON_DOOR)); + public static final Item TRANSIENT_OAK_DOOR = register("transient_oak_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_OAK_DOOR, settings, Items.OAK_DOOR)); + public static final Item TRANSIENT_SPRUCE_DOOR = register("transient_spruce_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_SPRUCE_DOOR, settings, Items.SPRUCE_DOOR)); + public static final Item TRANSIENT_BIRCH_DOOR = register("transient_birch_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_BIRCH_DOOR, settings, Items.BIRCH_DOOR)); + public static final Item TRANSIENT_JUNGLE_DOOR = register("transient_jungle_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_JUNGLE_DOOR, settings, Items.JUNGLE_DOOR)); + public static final Item TRANSIENT_ACACIA_DOOR = register("transient_acacia_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_ACACIA_DOOR, settings, Items.ACACIA_DOOR)); + public static final Item TRANSIENT_CHERRY_DOOR = register("transient_cherry_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_CHERRY_DOOR, settings, Items.CHERRY_DOOR)); + public static final Item TRANSIENT_DARK_OAK_DOOR = register("transient_dark_oak_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_DARK_OAK_DOOR, settings, Items.DARK_OAK_DOOR)); + public static final Item TRANSIENT_MANGROVE_DOOR = register("transient_mangrove_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_MANGROVE_DOOR, settings, Items.MANGROVE_DOOR)); + public static final Item TRANSIENT_PALE_OAK_DOOR = register("transient_pale_oak_door", new Item.Settings().requires(FeatureFlags.WINTER_DROP), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_PALE_OAK_DOOR, settings, Items.PALE_OAK_DOOR)); + public static final Item TRANSIENT_BAMBOO_DOOR = register("transient_bamboo_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_BAMBOO_DOOR, settings, Items.BAMBOO_DOOR)); + public static final Item TRANSIENT_CRIMSON_DOOR = register("transient_crimson_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_CRIMSON_DOOR, settings, Items.CRIMSON_DOOR)); + public static final Item TRANSIENT_WARPED_DOOR = register("transient_warped_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_WARPED_DOOR, settings, Items.WARPED_DOOR)); + + public static final Item BLACK_CONCRETE_POWDER = registerSimple("black_concrete_powder", NEBlocks.BLACK_CONCRETE_POWDER, Items.BLACK_CONCRETE_POWDER); + public static final Item BLUE_CONCRETE_POWDER = registerSimple("blue_concrete_powder", NEBlocks.BLUE_CONCRETE_POWDER, Items.BLUE_CONCRETE_POWDER); + public static final Item BROWN_CONCRETE_POWDER = registerSimple("brown_concrete_powder", NEBlocks.BROWN_CONCRETE_POWDER, Items.BROWN_CONCRETE_POWDER); + public static final Item CYAN_CONCRETE_POWDER = registerSimple("cyan_concrete_powder", NEBlocks.CYAN_CONCRETE_POWDER, Items.CYAN_CONCRETE_POWDER); + public static final Item GREEN_CONCRETE_POWDER = registerSimple("green_concrete_powder", NEBlocks.GREEN_CONCRETE_POWDER, Items.GREEN_CONCRETE_POWDER); + public static final Item GRAY_CONCRETE_POWDER = registerSimple("gray_concrete_powder", NEBlocks.GRAY_CONCRETE_POWDER, Items.GRAY_CONCRETE_POWDER); + public static final Item LIGHT_BLUE_CONCRETE_POWDER = registerSimple("light_blue_concrete_powder", NEBlocks.LIGHT_BLUE_CONCRETE_POWDER, Items.LIGHT_BLUE_CONCRETE_POWDER); + public static final Item LIGHT_GRAY_CONCRETE_POWDER = registerSimple("light_gray_concrete_powder", NEBlocks.LIGHT_GRAY_CONCRETE_POWDER, Items.LIGHT_GRAY_CONCRETE_POWDER); + public static final Item LIME_CONCRETE_POWDER = registerSimple("lime_concrete_powder", NEBlocks.LIME_CONCRETE_POWDER, Items.LIME_CONCRETE_POWDER); + public static final Item MAGENTA_CONCRETE_POWDER = registerSimple("magenta_concrete_powder", NEBlocks.MAGENTA_CONCRETE_POWDER, Items.MAGENTA_CONCRETE_POWDER); + public static final Item ORANGE_CONCRETE_POWDER = registerSimple("orange_concrete_powder", NEBlocks.ORANGE_CONCRETE_POWDER, Items.ORANGE_CONCRETE_POWDER); + public static final Item PINK_CONCRETE_POWDER = registerSimple("pink_concrete_powder", NEBlocks.PINK_CONCRETE_POWDER, Items.PINK_CONCRETE_POWDER); + public static final Item PURPLE_CONCRETE_POWDER = registerSimple("purple_concrete_powder", NEBlocks.PURPLE_CONCRETE_POWDER, Items.PURPLE_CONCRETE_POWDER); + public static final Item RED_CONCRETE_POWDER = registerSimple("red_concrete_powder", NEBlocks.RED_CONCRETE_POWDER, Items.RED_CONCRETE_POWDER); + public static final Item WHITE_CONCRETE_POWDER = registerSimple("white_concrete_powder", NEBlocks.WHITE_CONCRETE_POWDER, Items.WHITE_CONCRETE_POWDER); + public static final Item YELLOW_CONCRETE_POWDER = registerSimple("yellow_concrete_powder", NEBlocks.YELLOW_CONCRETE_POWDER, Items.YELLOW_CONCRETE_POWDER); + + public static final Item TINY_POTATO = registerHead("tiny_potato", NEBlocks.TINY_POTATO); + public static final Item BOTANICAL_TINY_POTATO = registerHead("botanical_potato", NEBlocks.BOTANICAL_TINY_POTATO); + public static final Item IRRITATER = registerHead("irritater", NEBlocks.IRRITATER); + public static final Item SAD_TATER = registerHead("sad_tater", NEBlocks.SAD_TATER); + public static final Item FLOWERING_AZALEA_TATER = registerHead("flowering_azalea_tater", NEBlocks.FLOWERING_AZALEA_TATER); + public static final Item STONE_TATER = registerHead("stone_tater", NEBlocks.STONE_TATER); + public static final Item CALCITE_TATER = registerHead("calcite_tater", NEBlocks.CALCITE_TATER); + public static final Item TUFF_TATER = registerHead("tuff_tater", NEBlocks.TUFF_TATER); + public static final Item BASALT_TATER = registerHead("basalt_tater", NEBlocks.BASALT_TATER); + public static final Item DRIPSTONE_TATER = registerHead("dripstone_tater", NEBlocks.DRIPSTONE_TATER); + public static final Item AMETHYST_TATER = registerHead("amethyst_tater", NEBlocks.AMETHYST_TATER); + public static final Item PACKED_ICE_TATER = registerHead("packed_ice_tater", NEBlocks.PACKED_ICE_TATER); + public static final Item BLUE_ICE_TATER = registerHead("blue_ice_tater", NEBlocks.BLUE_ICE_TATER); + public static final Item FLAME_TATER = registerHead("flame_tater", NEBlocks.FLAME_TATER); + public static final Item PUZZLE_CUBE_TATER = registerHead("puzzle_cube_tater", NEBlocks.PUZZLE_CUBE_TATER); + public static final Item LUCKY_TATER = registerHead("lucky_tater", NEBlocks.LUCKY_TATER); + public static final Item CRATE_TATER = registerHead("crate_tater", NEBlocks.CRATE_TATER); + public static final Item TATER_OF_UNDYING = registerHead("tater_of_undying", NEBlocks.TATER_OF_UNDYING); + public static final Item CRYING_OBSIDIAN_TATER = registerHead("crying_obsidian_tater", NEBlocks.CRYING_OBSIDIAN_TATER); + public static final Item DICE_TATER = registerHead("dice_tater", NEBlocks.DICE_TATER); + public static final Item TRANS_TATER = registerHead("trans_tater", NEBlocks.TRANS_TATER); + public static final Item ASEXUAL_TATER = registerHead("asexual_tater", NEBlocks.ASEXUAL_TATER); + public static final Item BI_TATER = registerHead("bi_tater", NEBlocks.BI_TATER); + public static final Item GAY_TATER = registerHead("gay_tater", NEBlocks.GAY_TATER); + public static final Item LESBIAN_TATER = registerHead("lesbian_tater", NEBlocks.LESBIAN_TATER); + public static final Item NONBINARY_TATER = registerHead("nonbinary_tater", NEBlocks.NONBINARY_TATER); + public static final Item PAN_TATER = registerHead("pan_tater", NEBlocks.PAN_TATER); + public static final Item WARDEN_TATER = registerHead("warden_tater", NEBlocks.WARDEN_TATER); + public static final Item VIRAL_TATER = registerHead("viral_tater", NEBlocks.VIRAL_TATER); + public static final Item TATEROID = registerHead("tateroid", NEBlocks.TATEROID); + public static final Item RED_TATEROID = registerHead("red_tateroid", NEBlocks.RED_TATEROID); + public static final Item ORANGE_TATEROID = registerHead("orange_tateroid", NEBlocks.ORANGE_TATEROID); + public static final Item YELLOW_TATEROID = registerHead("yellow_tateroid", NEBlocks.YELLOW_TATEROID); + public static final Item GREEN_TATEROID = registerHead("green_tateroid", NEBlocks.GREEN_TATEROID); + public static final Item BLUE_TATEROID = registerHead("blue_tateroid", NEBlocks.BLUE_TATEROID); + public static final Item PURPLE_TATEROID = registerHead("purple_tateroid", NEBlocks.PURPLE_TATEROID); + public static final Item FLIPPED_TATER = registerHead("flipped_tater", NEBlocks.FLIPPED_TATER); + public static final Item BACKWARD_TATER = registerHead("backward_tater", NEBlocks.BACKWARD_TATER); + public static final Item UPWARD_TATER = registerHead("upward_tater", NEBlocks.UPWARD_TATER); + public static final Item SANTA_HAT_TATER = registerHead("santa_hat_tater", NEBlocks.SANTA_HAT_TATER); + public static final Item GENDERFLUID_TATER = registerHead("genderfluid_tater", NEBlocks.GENDERFLUID_TATER); + public static final Item DEMISEXUAL_TATER = registerHead("demisexual_tater", NEBlocks.DEMISEXUAL_TATER); + + public static final Item SKELETATER = registerHead("skeletater", NEBlocks.SKELETATER); + public static final Item WITHER_SKELETATER = registerHead("wither_skeletater", NEBlocks.WITHER_SKELETATER); + public static final Item ZOMBIE_TATER = registerHead("zombie_tater", NEBlocks.ZOMBIE_TATER); + public static final Item CREEPER_TATER = registerHead("creeper_tater", NEBlocks.CREEPER_TATER); + public static final Item STEVE_TATER = registerHead("steve_tater", NEBlocks.STEVE_TATER); + public static final Item ALEX_TATER = registerHead("alex_tater", NEBlocks.ALEX_TATER); + + public static final Item WHITE_TATER = registerHead("white_tater", NEBlocks.WHITE_TATER); + public static final Item ORANGE_TATER = registerHead("orange_tater", NEBlocks.ORANGE_TATER); + public static final Item MAGENTA_TATER = registerHead("magenta_tater", NEBlocks.MAGENTA_TATER); + public static final Item LIGHT_BLUE_TATER = registerHead("light_blue_tater", NEBlocks.LIGHT_BLUE_TATER); + public static final Item YELLOW_TATER = registerHead("yellow_tater", NEBlocks.YELLOW_TATER); + public static final Item LIME_TATER = registerHead("lime_tater", NEBlocks.LIME_TATER); + public static final Item PINK_TATER = registerHead("pink_tater", NEBlocks.PINK_TATER); + public static final Item GRAY_TATER = registerHead("gray_tater", NEBlocks.GRAY_TATER); + public static final Item LIGHT_GRAY_TATER = registerHead("light_gray_tater", NEBlocks.LIGHT_GRAY_TATER); + public static final Item CYAN_TATER = registerHead("cyan_tater", NEBlocks.CYAN_TATER); + public static final Item PURPLE_TATER = registerHead("purple_tater", NEBlocks.PURPLE_TATER); + public static final Item BLUE_TATER = registerHead("blue_tater", NEBlocks.BLUE_TATER); + public static final Item BROWN_TATER = registerHead("brown_tater", NEBlocks.BROWN_TATER); + public static final Item GREEN_TATER = registerHead("green_tater", NEBlocks.GREEN_TATER); + public static final Item RED_TATER = registerHead("red_tater", NEBlocks.RED_TATER); + public static final Item BLACK_TATER = registerHead("black_tater", NEBlocks.BLACK_TATER); + + public static final Item COAL_TATER = registerHead("coal_tater", NEBlocks.COAL_TATER); + public static final Item DIAMOND_TATER = registerHead("diamond_tater", NEBlocks.DIAMOND_TATER); + public static final Item EMERALD_TATER = registerHead("emerald_tater", NEBlocks.EMERALD_TATER); + public static final Item GOLD_TATER = registerHead("gold_tater", NEBlocks.GOLD_TATER); + public static final Item IRON_TATER = registerHead("iron_tater", NEBlocks.IRON_TATER); + public static final Item LAPIS_TATER = registerHead("lapis_tater", NEBlocks.LAPIS_TATER); + public static final Item NETHERITE_TATER = registerHead("netherite_tater", NEBlocks.NETHERITE_TATER); + public static final Item QUARTZ_TATER = registerHead("quartz_tater", NEBlocks.QUARTZ_TATER); + public static final Item REDSTONE_TATER = registerHead("redstone_tater", NEBlocks.REDSTONE_TATER); + + public static final Item COPPER_TATER = registerHead("copper_tater", NEBlocks.COPPER_TATER); + public static final Item EXPOSED_COPPER_TATER = registerHead("exposed_copper_tater", NEBlocks.EXPOSED_COPPER_TATER); + public static final Item WEATHERED_COPPER_TATER = registerHead("weathered_copper_tater", NEBlocks.WEATHERED_COPPER_TATER); + public static final Item OXIDIZED_COPPER_TATER = registerHead("oxidized_copper_tater", NEBlocks.OXIDIZED_COPPER_TATER); + + public static final Item CAKE_TATER = registerHead("cake_tater", NEBlocks.CAKE_TATER); + public static final Item ENDERTATER = registerHead("endertater", NEBlocks.ENDERTATER); + public static final Item FURNACE_TATER = registerHead("furnace_tater", NEBlocks.FURNACE_TATER); + public static final Item MELON_TATER = registerHead("melon_tater", NEBlocks.MELON_TATER); + public static final Item PUMPKIN_TATER = registerHead("pumpkin_tater", NEBlocks.PUMPKIN_TATER); + public static final Item JACK_O_TATER = registerHead("jack_o_tater", NEBlocks.JACK_O_TATER); + public static final Item SCULK_TATER = registerHead("sculk_tater", NEBlocks.SCULK_TATER); + public static final Item SLIME_TATER = registerHead("slime_tater", NEBlocks.SLIME_TATER); + public static final Item HEROBRINE_TATER = registerHead("herobrine_tater", NEBlocks.HEROBRINE_TATER); + public static final Item OCHRE_FROGLIGHT_TATER = registerHead("ochre_froglight_tater", NEBlocks.OCHRE_FROGLIGHT_TATER); + public static final Item PEARLESCENT_FROGLIGHT_TATER = registerHead("pearlescent_froglight_tater", NEBlocks.PEARLESCENT_FROGLIGHT_TATER); + public static final Item VERDANT_FROGLIGHT_TATER = registerHead("verdant_froglight_tater", NEBlocks.VERDANT_FROGLIGHT_TATER); + public static final Item SNOWMAN_TATER = registerHead("snowman_tater", NEBlocks.SNOWMAN_TATER); + + public static final Item ACACIA_TATER = registerHead("acacia_tater", NEBlocks.ACACIA_TATER); + public static final Item ANDESITE_TATER = registerHead("andesite_tater", NEBlocks.ANDESITE_TATER); + public static final Item BAMBOO_TATER = registerHead("bamboo_tater", NEBlocks.BAMBOO_TATER); + public static final Item BARRIER_TATER = registerHead("barrier_tater", NEBlocks.BARRIER_TATER); + public static final Item BEDROCK_TATER = registerHead("bedrock_tater", NEBlocks.BEDROCK_TATER); + public static final Item BIRCH_TATER = registerHead("birch_tater", NEBlocks.BIRCH_TATER); + public static final Item BONE_TATER = registerHead("bone_tater", NEBlocks.BONE_TATER); + public static final Item BRAIN_CORAL_TATER = registerHead("brain_coral_tater", NEBlocks.BRAIN_CORAL_TATER); + public static final Item BRICK_TATER = registerHead("brick_tater", NEBlocks.BRICK_TATER); + public static final Item BUBBLE_CORAL_TATER = registerHead("bubble_coral_tater", NEBlocks.BUBBLE_CORAL_TATER); + public static final Item CACTUS_TATER = registerHead("cactus_tater", NEBlocks.CACTUS_TATER); + public static final Item CHORUS_TATER = registerHead("chorus_tater", NEBlocks.CHORUS_TATER); + public static final Item CLAY_TATER = registerHead("clay_tater", NEBlocks.CLAY_TATER); + public static final Item CRIMSON_TATER = registerHead("crimson_tater", NEBlocks.CRIMSON_TATER); + public static final Item DARK_OAK_TATER = registerHead("dark_oak_tater", NEBlocks.DARK_OAK_TATER); + public static final Item DARK_PRISMARINE_TATER = registerHead("dark_prismarine_tater", NEBlocks.DARK_PRISMARINE_TATER); + public static final Item DIORITE_TATER = registerHead("diorite_tater", NEBlocks.DIORITE_TATER); + public static final Item DIRT_TATER = registerHead("dirt_tater", NEBlocks.DIRT_TATER); + public static final Item END_STONE_TATER = registerHead("end_stone_tater", NEBlocks.END_STONE_TATER); + public static final Item FIRE_CORAL_TATER = registerHead("fire_coral_tater", NEBlocks.FIRE_CORAL_TATER); + public static final Item GRANITE_TATER = registerHead("granite_tater", NEBlocks.GRANITE_TATER); + public static final Item GRASS_TATER = registerHead("grass_tater", NEBlocks.GRASS_TATER); + public static final Item HAY_TATER = registerHead("hay_tater", NEBlocks.HAY_TATER); + public static final Item HONEY_TATER = registerHead("honey_tater", NEBlocks.HONEY_TATER); + public static final Item HONEYCOMB_TATER = registerHead("honeycomb_tater", NEBlocks.HONEYCOMB_TATER); + public static final Item HORN_CORAL_TATER = registerHead("horn_coral_tater", NEBlocks.HORN_CORAL_TATER); + public static final Item JUNGLE_TATER = registerHead("jungle_tater", NEBlocks.JUNGLE_TATER); + public static final Item LIGHT_TATER = registerHead("light_tater", NEBlocks.LIGHT_TATER); + public static final Item MYCELIUM_TATER = registerHead("mycelium_tater", NEBlocks.MYCELIUM_TATER); + public static final Item NETHER_WART_TATER = registerHead("nether_wart_tater", NEBlocks.NETHER_WART_TATER); + public static final Item OAK_TATER = registerHead("oak_tater", NEBlocks.OAK_TATER); + public static final Item OBSIDIAN_TATER = registerHead("obsidian_tater", NEBlocks.OBSIDIAN_TATER); + public static final Item PODZOL_TATER = registerHead("podzol_tater", NEBlocks.PODZOL_TATER); + public static final Item PRISMARINE_BRICK_TATER = registerHead("prismarine_brick_tater", NEBlocks.PRISMARINE_BRICK_TATER); + public static final Item PRISMARINE_TATER = registerHead("prismarine_tater", NEBlocks.PRISMARINE_TATER); + public static final Item RED_SAND_TATER = registerHead("red_sand_tater", NEBlocks.RED_SAND_TATER); + public static final Item SAND_TATER = registerHead("sand_tater", NEBlocks.SAND_TATER); + public static final Item SEA_LANTERN_TATER = registerHead("sea_lantern_tater", NEBlocks.SEA_LANTERN_TATER); + public static final Item SHROOMLIGHT_TATER = registerHead("shroomlight_tater", NEBlocks.SHROOMLIGHT_TATER); + public static final Item SHULKER_TATER = registerHead("shulker_tater", NEBlocks.SHULKER_TATER); + public static final Item SMOOTH_STONE_TATER = registerHead("smooth_stone_tater", NEBlocks.SMOOTH_STONE_TATER); + public static final Item SOUL_SAND_TATER = registerHead("soul_sand_tater", NEBlocks.SOUL_SAND_TATER); + public static final Item SPONGE_TATER = registerHead("sponge_tater", NEBlocks.SPONGE_TATER); + public static final Item SPRUCE_TATER = registerHead("spruce_tater", NEBlocks.SPRUCE_TATER); + public static final Item STONE_BRICK_TATER = registerHead("stone_brick_tater", NEBlocks.STONE_BRICK_TATER); + public static final Item STRUCTURE_VOID_TATER = registerHead("structure_void_tater", NEBlocks.STRUCTURE_VOID_TATER); + public static final Item TARGET_TATER = registerHead("target_tater", NEBlocks.TARGET_TATER); + public static final Item TERRACOTTA_TATER = registerHead("terracotta_tater", NEBlocks.TERRACOTTA_TATER); + public static final Item TNTATER = registerHead("tntater", NEBlocks.TNTATER); + public static final Item TUBE_CORAL_TATER = registerHead("tube_coral_tater", NEBlocks.TUBE_CORAL_TATER); + public static final Item WARPED_TATER = registerHead("warped_tater", NEBlocks.WARPED_TATER); + public static final Item WARPED_WART_TATER = registerHead("warped_wart_tater", NEBlocks.WARPED_WART_TATER); + public static final Item WOOL_TATER = registerHead("wool_tater", NEBlocks.WOOL_TATER); + + public static final Item ACACIA_LOG_TATER = registerHead("acacia_log_tater", NEBlocks.ACACIA_LOG_TATER); + public static final Item ANGRY_BEE_TATER = registerHead("angry_bee_tater", NEBlocks.ANGRY_BEE_TATER); + public static final Item BEACON_TATER = registerHead("beacon_tater", NEBlocks.BEACON_TATER); + public static final Item BEE_NEST_TATER = registerHead("bee_nest_tater", NEBlocks.BEE_NEST_TATER); + public static final Item BEE_TATER = registerHead("bee_tater", NEBlocks.BEE_TATER); + public static final Item BEEHIVE_TATER = registerHead("beehive_tater", NEBlocks.BEEHIVE_TATER); + public static final Item BIRCH_LOG_TATER = registerHead("birch_log_tater", NEBlocks.BIRCH_LOG_TATER); + public static final Item BLACKSTONE_TATER = registerHead("blackstone_tater", NEBlocks.BLACKSTONE_TATER); + public static final Item BLAZE_TATER = registerHead("blaze_tater", NEBlocks.BLAZE_TATER); + public static final Item BOOKSHELF_TATER = registerHead("bookshelf_tater", NEBlocks.BOOKSHELF_TATER); + public static final Item BROWN_MOOSHROOM_TATER = registerHead("brown_mooshroom_tater", NEBlocks.BROWN_MOOSHROOM_TATER); + public static final Item BROWN_MUSHROOM_TATER = registerHead("brown_mushroom_tater", NEBlocks.BROWN_MUSHROOM_TATER); + public static final Item CAVE_SPIDER_TATER = registerHead("cave_spider_tater", NEBlocks.CAVE_SPIDER_TATER); + public static final Item COBBLED_DEEPSLATE_TATER = registerHead("cobbled_deepslate_tater", NEBlocks.COBBLED_DEEPSLATE_TATER); + public static final Item COBBLESTONE_TATER = registerHead("cobblestone_tater", NEBlocks.COBBLESTONE_TATER); + public static final Item COCOA_TATER = registerHead("cocoa_tater", NEBlocks.COCOA_TATER); + public static final Item COLD_STRIDER_TATER = registerHead("cold_strider_tater", NEBlocks.COLD_STRIDER_TATER); + public static final Item COW_TATER = registerHead("cow_tater", NEBlocks.COW_TATER); + public static final Item CRAFTING_TATER = registerHead("crafting_tater", NEBlocks.CRAFTING_TATER); + public static final Item CRIMSON_NYLIUM_TATER = registerHead("crimson_nylium_tater", NEBlocks.CRIMSON_NYLIUM_TATER); + public static final Item CRIMSON_STEM_TATER = registerHead("crimson_stem_tater", NEBlocks.CRIMSON_STEM_TATER); + public static final Item DARK_OAK_LOG_TATER = registerHead("dark_oak_log_tater", NEBlocks.DARK_OAK_LOG_TATER); + public static final Item DAYLIGHT_DETECTOR_TATER = registerHead("daylight_detector_tater", NEBlocks.DAYLIGHT_DETECTOR_TATER); + public static final Item DEAD_BRAIN_CORAL_TATER = registerHead("dead_brain_coral_tater", NEBlocks.DEAD_BRAIN_CORAL_TATER); + public static final Item DEAD_BUBBLE_CORAL_TATER = registerHead("dead_bubble_coral_tater", NEBlocks.DEAD_BUBBLE_CORAL_TATER); + public static final Item DEAD_FIRE_CORAL_TATER = registerHead("dead_fire_coral_tater", NEBlocks.DEAD_FIRE_CORAL_TATER); + public static final Item DEAD_HORN_CORAL_TATER = registerHead("dead_horn_coral_tater", NEBlocks.DEAD_HORN_CORAL_TATER); + public static final Item DEAD_TUBE_CORAL_TATER = registerHead("dead_tube_coral_tater", NEBlocks.DEAD_TUBE_CORAL_TATER); + public static final Item DEEPSLATE_BRICK_TATER = registerHead("deepslate_brick_tater", NEBlocks.DEEPSLATE_BRICK_TATER); + public static final Item DEEPSLATE_TATER = registerHead("deepslate_tater", NEBlocks.DEEPSLATE_TATER); + public static final Item DRIED_KELP_TATER = registerHead("dried_kelp_tater", NEBlocks.DRIED_KELP_TATER); + public static final Item DROWNED_TATER = registerHead("drowned_tater", NEBlocks.DROWNED_TATER); + public static final Item EYE_OF_ENDER_TATER = registerHead("eye_of_ender_tater", NEBlocks.EYE_OF_ENDER_TATER); + public static final Item FOX_TATER = registerHead("fox_tater", NEBlocks.FOX_TATER); + public static final Item GHAST_TATER = registerHead("ghast_tater", NEBlocks.GHAST_TATER); + public static final Item GILDED_BLACKSTONE_TATER = registerHead("gilded_blackstone_tater", NEBlocks.GILDED_BLACKSTONE_TATER); + public static final Item GLOW_SQUID_TATER = registerHead("glow_squid_tater", NEBlocks.GLOW_SQUID_TATER); + public static final Item GLOWSTONE_TATER = registerHead("glowstone_tater", NEBlocks.GLOWSTONE_TATER); + public static final Item HUSK_TATER = registerHead("husk_tater", NEBlocks.HUSK_TATER); + public static final Item INVERTED_DAYLIGHT_DETECTOR_TATER = registerHead("inverted_daylight_detector_tater", NEBlocks.INVERTED_DAYLIGHT_DETECTOR_TATER); + public static final Item JUNGLE_LOG_TATER = registerHead("jungle_log_tater", NEBlocks.JUNGLE_LOG_TATER); + public static final Item MAGMA_CUBE_TATER = registerHead("magma_cube_tater", NEBlocks.MAGMA_CUBE_TATER); + public static final Item MOOBLOOM_TATER = registerHead("moobloom_tater", NEBlocks.MOOBLOOM_TATER); + public static final Item MOOLIP_TATER = registerHead("moolip_tater", NEBlocks.MOOLIP_TATER); + public static final Item MUDDY_PIG_TATER = registerHead("muddy_pig_tater", NEBlocks.MUDDY_PIG_TATER); + public static final Item MUSHROOM_STEM_TATER = registerHead("mushroom_stem_tater", NEBlocks.MUSHROOM_STEM_TATER); + public static final Item NETHER_BRICK_TATER = registerHead("nether_brick_tater", NEBlocks.NETHER_BRICK_TATER); + public static final Item NETHERRACK_TATER = registerHead("netherrack_tater", NEBlocks.NETHERRACK_TATER); + public static final Item OAK_LOG_TATER = registerHead("oak_log_tater", NEBlocks.OAK_LOG_TATER); + public static final Item PIG_TATER = registerHead("pig_tater", NEBlocks.PIG_TATER); + public static final Item POLAR_BEAR_TATER = registerHead("polar_bear_tater", NEBlocks.POLAR_BEAR_TATER); + public static final Item PUFFERTATER = registerHead("puffertater", NEBlocks.PUFFERTATER); + public static final Item RED_MOOSHROOM_TATER = registerHead("red_mooshroom_tater", NEBlocks.RED_MOOSHROOM_TATER); + public static final Item RED_MUSHROOM_TATER = registerHead("red_mushroom_tater", NEBlocks.RED_MUSHROOM_TATER); + public static final Item RED_NETHER_BRICK_TATER = registerHead("red_nether_brick_tater", NEBlocks.RED_NETHER_BRICK_TATER); + public static final Item RED_SANDSTONE_TATER = registerHead("red_sandstone_tater", NEBlocks.RED_SANDSTONE_TATER); + public static final Item RUBY_TATER = registerHead("ruby_tater", NEBlocks.RUBY_TATER); + public static final Item SANDSTONE_TATER = registerHead("sandstone_tater", NEBlocks.SANDSTONE_TATER); + public static final Item SEA_PICKLE_TATER = registerHead("sea_pickle_tater", NEBlocks.SEA_PICKLE_TATER); + public static final Item SHEEP_TATER = registerHead("sheep_tater", NEBlocks.SHEEP_TATER); + public static final Item SHIELDED_WITHER_TATER = registerHead("shielded_wither_tater", NEBlocks.SHIELDED_WITHER_TATER); + public static final Item SNOW_FOX_TATER = registerHead("snow_fox_tater", NEBlocks.SNOW_FOX_TATER); + public static final Item SPIDER_TATER = registerHead("spider_tater", NEBlocks.SPIDER_TATER); + public static final Item SPRUCE_LOG_TATER = registerHead("spruce_log_tater", NEBlocks.SPRUCE_LOG_TATER); + public static final Item SQUID_TATER = registerHead("squid_tater", NEBlocks.SQUID_TATER); + public static final Item STRAY_TATER = registerHead("stray_tater", NEBlocks.STRAY_TATER); + public static final Item STRIDER_TATER = registerHead("strider_tater", NEBlocks.STRIDER_TATER); + public static final Item TURTLE_EGG_TATER = registerHead("turtle_egg_tater", NEBlocks.TURTLE_EGG_TATER); + public static final Item WARPED_NYLIUM_TATER = registerHead("warped_nylium_tater", NEBlocks.WARPED_NYLIUM_TATER); + public static final Item WARPED_STEM_TATER = registerHead("warped_stem_tater", NEBlocks.WARPED_STEM_TATER); + public static final Item WITHER_TATER = registerHead("wither_tater", NEBlocks.WITHER_TATER); + + public static final Item AZALEA_TATER = registerHead("azalea_tater", NEBlocks.AZALEA_TATER); + public static final Item BELL_TATER = registerHead("bell_tater", NEBlocks.BELL_TATER); + public static final Item COLD_FROG_TATER = registerHead("cold_frog_tater", NEBlocks.COLD_FROG_TATER); + public static final Item CONDUIT_TATER = registerHead("conduit_tater", NEBlocks.CONDUIT_TATER); + public static final Item ELDER_GUARDIAN_TATER = registerHead("elder_guardian_tater", NEBlocks.ELDER_GUARDIAN_TATER); + public static final Item END_STONE_BRICK_TATER = registerHead("end_stone_brick_tater", NEBlocks.END_STONE_BRICK_TATER); + public static final Item FLOWER_POT_TATER = registerHead("flower_pot_tater", NEBlocks.FLOWER_POT_TATER); + public static final Item GUARDIAN_TATER = registerHead("guardian_tater", NEBlocks.GUARDIAN_TATER); + public static final Item ILLAGER_TATER = registerHead("illager_tater", NEBlocks.ILLAGER_TATER); + public static final Item ILLUSIONER_TATER = registerHead("illusioner_tater", NEBlocks.ILLUSIONER_TATER); + public static final Item JUKEBOX_TATER = registerHead("jukebox_tater", NEBlocks.JUKEBOX_TATER); + public static final Item LANTERN_TATER = registerHead("lantern_tater", NEBlocks.LANTERN_TATER); + public static final Item PIGLIN_TATER = registerHead("piglin_tater", NEBlocks.PIGLIN_TATER); + public static final Item PINK_WITHER_TATER = registerHead("pink_wither_tater", NEBlocks.PINK_WITHER_TATER); + public static final Item PISTON_TATER = registerHead("piston_tater", NEBlocks.PISTON_TATER); + public static final Item PURPUR_TATER = registerHead("purpur_tater", NEBlocks.PURPUR_TATER); + public static final Item SOUL_LANTERN_TATER = registerHead("soul_lantern_tater", NEBlocks.SOUL_LANTERN_TATER); + public static final Item SOUL_SOIL_TATER = registerHead("soul_soil_tater", NEBlocks.SOUL_SOIL_TATER); + public static final Item STICKY_PISTON_TATER = registerHead("sticky_piston_tater", NEBlocks.STICKY_PISTON_TATER); + public static final Item TEMPERATE_FROG_TATER = registerHead("temperate_frog_tater", NEBlocks.TEMPERATE_FROG_TATER); + public static final Item UNDERWATER_TNTATER = registerHead("underwater_tntater", NEBlocks.UNDERWATER_TNTATER); + public static final Item VEX_TATER = registerHead("vex_tater", NEBlocks.VEX_TATER); + public static final Item VILLAGER_TATER = registerHead("villager_tater", NEBlocks.VILLAGER_TATER); + public static final Item VINDITATER = registerHead("vinditater", NEBlocks.VINDITATER); + public static final Item WANDERING_TRADER_TATER = registerHead("wandering_trader_tater", NEBlocks.WANDERING_TRADER_TATER); + public static final Item WARM_FROG_TATER = registerHead("warm_frog_tater", NEBlocks.WARM_FROG_TATER); + public static final Item WAX_TATER = registerHead("wax_tater", NEBlocks.WAX_TATER); + public static final Item WITCH_TATER = registerHead("witch_tater", NEBlocks.WITCH_TATER); + public static final Item ZOMBIE_VILLAGER_TATER = registerHead("zombie_villager_tater", NEBlocks.ZOMBIE_VILLAGER_TATER); + public static final Item ZOMBIFIED_PIGLIN_TATER = registerHead("zombified_piglin_tater", NEBlocks.ZOMBIFIED_PIGLIN_TATER); + + public static final Item BONE_SPIDER_TATER = registerHead("bone_spider_tater", NEBlocks.BONE_SPIDER_TATER); + public static final Item BOULDERING_ZOMBIE_TATER = registerHead("bouldering_zombie_tater", NEBlocks.BOULDERING_ZOMBIE_TATER); + public static final Item CHARGED_CREEPER_TATER = registerHead("charged_creeper_tater", NEBlocks.CHARGED_CREEPER_TATER); + public static final Item LOBBER_ZOMBIE_TATER = registerHead("lobber_zombie_tater", NEBlocks.LOBBER_ZOMBIE_TATER); + public static final Item MOSSY_SKELETATER = registerHead("mossy_skeletater", NEBlocks.MOSSY_SKELETATER); + public static final Item STRIPPED_ACACIA_LOG_TATER = registerHead("stripped_acacia_log_tater", NEBlocks.STRIPPED_ACACIA_LOG_TATER); + public static final Item STRIPPED_BIRCH_LOG_TATER = registerHead("stripped_birch_log_tater", NEBlocks.STRIPPED_BIRCH_LOG_TATER); + public static final Item STRIPPED_CRIMSON_STEM_TATER = registerHead("stripped_crimson_stem_tater", NEBlocks.STRIPPED_CRIMSON_STEM_TATER); + public static final Item STRIPPED_DARK_OAK_LOG_TATER = registerHead("stripped_dark_oak_log_tater", NEBlocks.STRIPPED_DARK_OAK_LOG_TATER); + public static final Item STRIPPED_JUNGLE_LOG_TATER = registerHead("stripped_jungle_log_tater", NEBlocks.STRIPPED_JUNGLE_LOG_TATER); + public static final Item STRIPPED_OAK_LOG_TATER = registerHead("stripped_oak_log_tater", NEBlocks.STRIPPED_OAK_LOG_TATER); + public static final Item STRIPPED_SPRUCE_LOG_TATER = registerHead("stripped_spruce_log_tater", NEBlocks.STRIPPED_SPRUCE_LOG_TATER); + public static final Item STRIPPED_WARPED_STEM_TATER = registerHead("stripped_warped_stem_tater", NEBlocks.STRIPPED_WARPED_STEM_TATER); + public static final Item TROPICAL_SLIME_TATER = registerHead("tropical_slime_tater", NEBlocks.TROPICAL_SLIME_TATER); + + public static final Item APPLE_TATER = registerHead("apple_tater", NEBlocks.APPLE_TATER); + public static final Item GOLDEN_APPLE_TATER = registerHead("golden_apple_tater", NEBlocks.GOLDEN_APPLE_TATER); + public static final Item ICE_TATER = registerHead("ice_tater", NEBlocks.ICE_TATER); + public static final Item KING_TATER = registerHead("king_tater", NEBlocks.KING_TATER); + public static final Item RAW_COPPER_TATER = registerHead("raw_copper_tater", NEBlocks.RAW_COPPER_TATER); + public static final Item RAW_GOLD_TATER = registerHead("raw_gold_tater", NEBlocks.RAW_GOLD_TATER); + public static final Item RAW_IRON_TATER = registerHead("raw_iron_tater", NEBlocks.RAW_IRON_TATER); + + public static final Item ALLAY_TATER = registerHead("allay_tater", NEBlocks.ALLAY_TATER); + public static final Item MANGROVE_LOG_TATER = registerHead("mangrove_log_tater", NEBlocks.MANGROVE_LOG_TATER); + public static final Item MANGROVE_TATER = registerHead("mangrove_tater", NEBlocks.MANGROVE_TATER); + public static final Item MUD_BRICK_TATER = registerHead("mud_brick_tater", NEBlocks.MUD_BRICK_TATER); + public static final Item MUD_TATER = registerHead("mud_tater", NEBlocks.MUD_TATER); + public static final Item PACKED_MUD_TATER = registerHead("packed_mud_tater", NEBlocks.PACKED_MUD_TATER); + public static final Item STRIPPED_MANGROVE_LOG_TATER = registerHead("stripped_mangrove_log_tater", NEBlocks.STRIPPED_MANGROVE_LOG_TATER); + + public static final Item LUCY_AXOLOTL_TATER = registerHead("lucy_axolotl_tater", NEBlocks.LUCY_AXOLOTL_TATER); + public static final Item WILD_AXOLOTL_TATER = registerHead("wild_axolotl_tater", NEBlocks.WILD_AXOLOTL_TATER); + public static final Item GOLD_AXOLOTL_TATER = registerHead("gold_axolotl_tater", NEBlocks.GOLD_AXOLOTL_TATER); + public static final Item CYAN_AXOLOTL_TATER = registerHead("cyan_axolotl_tater", NEBlocks.CYAN_AXOLOTL_TATER); + public static final Item BLUE_AXOLOTL_TATER = registerHead("blue_axolotl_tater", NEBlocks.BLUE_AXOLOTL_TATER); + + public static final Item BRONZE_CAPSULE_TATER = registerHead("bronze_capsule_tater", NEBlocks.BRONZE_CAPSULE_TATER); + public static final Item SILVER_CAPSULE_TATER = registerHead("silver_capsule_tater", NEBlocks.SILVER_CAPSULE_TATER); + public static final Item GOLD_CAPSULE_TATER = registerHead("gold_capsule_tater", NEBlocks.GOLD_CAPSULE_TATER); + + public static final Item CORRUPTATER = registerHead("corruptater", NEBlocks.CORRUPTATER); + + public static final Item TATER_BOX = register("tater_box", new Item.Settings() + .component(NEDataComponentTypes.TATER_SELECTION, TaterSelectionComponent.DEFAULT) + .maxCount(1), settings -> new TaterBoxItem(settings)); + public static final Item CREATIVE_TATER_BOX = register("creative_tater_box", new Item.Settings() + .component(NEDataComponentTypes.TATER_SELECTION, TaterSelectionComponent.DEFAULT) + .maxCount(1), settings -> new CreativeTaterBoxItem(settings)); + + public static final Item TATER_GUIDEBOOK = register("tater_guidebook", new Item.Settings() + .component(NEDataComponentTypes.TATER_POSITIONS, TaterPositionsComponent.DEFAULT) + .component(DataComponentTypes.ENCHANTMENT_GLINT_OVERRIDE, true) + .maxCount(1), settings -> new TaterGuidebookItem(settings)); + public static final Item QUICK_ARMOR_STAND = register("quick_armor_stand", new Item.Settings(), settings -> new QuickArmorStandItem(settings)); + public static final Item GAME_PORTAL_OPENER = register("game_portal_opener", new Item.Settings().maxCount(1), settings -> new GamePortalOpenerItem(settings)); + public static final Item LAUNCH_FEATHER = register("launch_feather", new Item.Settings() + .component(NEDataComponentTypes.LAUNCHER, LauncherComponent.DEFAULT) + .maxCount(1), settings -> new LaunchFeatherItem(settings)); + + public static final Item RULE_BOOK = register("rule_book", new Item.Settings() + .rarity(Rarity.EPIC) + .component(DataComponentTypes.ENCHANTMENT_GLINT_OVERRIDE, true), settings -> new RuleBookItem(settings)); + + private static Item registerHead(String id, Block head) { if (head instanceof TinyPotatoBlock tinyPotatoBlock) { - return new LobbyHeadItem(head, new Item.Settings(), tinyPotatoBlock.getItemTexture()); + return register(id, new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyHeadItem(head, settings, tinyPotatoBlock.getItemTexture())); } else if (head instanceof PolymerHeadBlock headBlock) { - return new LobbyHeadItem(head, new Item.Settings(), headBlock.getPolymerSkinValue(head.getDefaultState(), BlockPos.ORIGIN, null)); + return register(id, new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyHeadItem(head, settings, headBlock.getPolymerSkinValue(head.getDefaultState(), BlockPos.ORIGIN, null))); } - return createSimple(head, Items.STONE); + return registerSimple(id, head, Items.STONE); } - private static Item createSimple(Block block, Item virtual) { - return new LobbyBlockItem(block, new Item.Settings(), virtual); + private static Item registerSimple(String id, Block block, Item virtual) { + return register(id, new Item.Settings().component(DataComponentTypes.ENCHANTMENT_GLINT_OVERRIDE, true).useBlockPrefixedTranslationKey(), settings -> new LobbyBlockItem(block, settings, virtual)); } public static void register() { - register("end_portal", END_PORTAL); - register("end_gateway", END_GATEWAY); - register("safe_tnt", SAFE_TNT); - register("gold_launch_pad", GOLD_LAUNCH_PAD); - register("iron_launch_pad", IRON_LAUNCH_PAD); - register("contributor_statue", CONTRIBUTOR_STATUE); - register("infinite_dispenser", INFINITE_DISPENSER); - register("infinite_dropper", INFINITE_DROPPER); - register("snake_block", SNAKE_BLOCK); - register("fast_snake_block", FAST_SNAKE_BLOCK); - - register("transient_iron_door", TRANSIENT_IRON_DOOR); - register("transient_oak_door", TRANSIENT_OAK_DOOR); - register("transient_spruce_door", TRANSIENT_SPRUCE_DOOR); - register("transient_birch_door", TRANSIENT_BIRCH_DOOR); - register("transient_jungle_door", TRANSIENT_JUNGLE_DOOR); - register("transient_acacia_door", TRANSIENT_ACACIA_DOOR); - register("transient_cherry_door", TRANSIENT_CHERRY_DOOR); - register("transient_dark_oak_door", TRANSIENT_DARK_OAK_DOOR); - register("transient_mangrove_door", TRANSIENT_MANGROVE_DOOR); - register("transient_bamboo_door", TRANSIENT_BAMBOO_DOOR); - register("transient_crimson_door", TRANSIENT_CRIMSON_DOOR); - register("transient_warped_door", TRANSIENT_WARPED_DOOR); - - register("black_concrete_powder", BLACK_CONCRETE_POWDER); - register("blue_concrete_powder", BLUE_CONCRETE_POWDER); - register("brown_concrete_powder", BROWN_CONCRETE_POWDER); - register("cyan_concrete_powder", CYAN_CONCRETE_POWDER); - register("green_concrete_powder", GREEN_CONCRETE_POWDER); - register("gray_concrete_powder", GRAY_CONCRETE_POWDER); - register("light_blue_concrete_powder", LIGHT_BLUE_CONCRETE_POWDER); - register("light_gray_concrete_powder", LIGHT_GRAY_CONCRETE_POWDER); - register("lime_concrete_powder", LIME_CONCRETE_POWDER); - register("magenta_concrete_powder", MAGENTA_CONCRETE_POWDER); - register("orange_concrete_powder", ORANGE_CONCRETE_POWDER); - register("pink_concrete_powder", PINK_CONCRETE_POWDER); - register("purple_concrete_powder", PURPLE_CONCRETE_POWDER); - register("red_concrete_powder", RED_CONCRETE_POWDER); - register("white_concrete_powder", WHITE_CONCRETE_POWDER); - register("yellow_concrete_powder", YELLOW_CONCRETE_POWDER); - registerTater("nucleoid_logo", NUCLEOID_LOGO); - registerTater("nucle_past_logo", NUCLE_PAST_LOGO); - - registerTater("tiny_potato", TINY_POTATO); - registerTater("botanical_potato", BOTANICAL_TINY_POTATO); - registerTater("irritater", IRRITATER); - registerTater("sad_tater", SAD_TATER); - registerTater("flowering_azalea_tater", FLOWERING_AZALEA_TATER); - registerTater("stone_tater", STONE_TATER); - registerTater("calcite_tater", CALCITE_TATER); - registerTater("tuff_tater", TUFF_TATER); - registerTater("basalt_tater", BASALT_TATER); - registerTater("dripstone_tater", DRIPSTONE_TATER); - registerTater("amethyst_tater", AMETHYST_TATER); - registerTater("packed_ice_tater", PACKED_ICE_TATER); - registerTater("blue_ice_tater", BLUE_ICE_TATER); - registerTater("flame_tater", FLAME_TATER); - - registerTater("puzzle_cube_tater", PUZZLE_CUBE_TATER); - registerTater("lucky_tater", LUCKY_TATER); - registerTater("crate_tater", CRATE_TATER); - registerTater("tater_of_undying", TATER_OF_UNDYING); - registerTater("crying_obsidian_tater", CRYING_OBSIDIAN_TATER); - - registerTater("dice_tater", DICE_TATER); - registerTater("trans_tater", TRANS_TATER); - registerTater("asexual_tater", ASEXUAL_TATER); - registerTater("bi_tater", BI_TATER); - registerTater("gay_tater", GAY_TATER); - registerTater("lesbian_tater", LESBIAN_TATER); - registerTater("nonbinary_tater", NONBINARY_TATER); - registerTater("pan_tater", PAN_TATER); - registerTater("warden_tater", WARDEN_TATER); - registerTater("viral_tater", VIRAL_TATER); - registerTater("tateroid", TATEROID); - registerTater("red_tateroid", RED_TATEROID); - registerTater("orange_tateroid", ORANGE_TATEROID); - registerTater("yellow_tateroid", YELLOW_TATEROID); - registerTater("green_tateroid", GREEN_TATEROID); - registerTater("blue_tateroid", BLUE_TATEROID); - registerTater("purple_tateroid", PURPLE_TATEROID); - registerTater("flipped_tater", FLIPPED_TATER); - registerTater("backward_tater", BACKWARD_TATER); - registerTater("upward_tater", UPWARD_TATER); - registerTater("santa_hat_tater", SANTA_HAT_TATER); - registerTater("genderfluid_tater", GENDERFLUID_TATER); - registerTater("demisexual_tater", DEMISEXUAL_TATER); - - registerTater("skeletater", SKELETATER); - registerTater("wither_skeletater", WITHER_SKELETATER); - registerTater("zombie_tater", ZOMBIE_TATER); - registerTater("creeper_tater", CREEPER_TATER); - registerTater("steve_tater", STEVE_TATER); - registerTater("alex_tater", ALEX_TATER); - - registerTater("white_tater", WHITE_TATER); - registerTater("orange_tater", ORANGE_TATER); - registerTater("magenta_tater", MAGENTA_TATER); - registerTater("light_blue_tater", LIGHT_BLUE_TATER); - registerTater("yellow_tater", YELLOW_TATER); - registerTater("lime_tater", LIME_TATER); - registerTater("pink_tater", PINK_TATER); - registerTater("gray_tater", GRAY_TATER); - registerTater("light_gray_tater", LIGHT_GRAY_TATER); - registerTater("cyan_tater", CYAN_TATER); - registerTater("purple_tater", PURPLE_TATER); - registerTater("blue_tater", BLUE_TATER); - registerTater("brown_tater", BROWN_TATER); - registerTater("green_tater", GREEN_TATER); - registerTater("red_tater", RED_TATER); - registerTater("black_tater", BLACK_TATER); - - registerTater("coal_tater", COAL_TATER); - registerTater("diamond_tater", DIAMOND_TATER); - registerTater("emerald_tater", EMERALD_TATER); - registerTater("gold_tater", GOLD_TATER); - registerTater("iron_tater", IRON_TATER); - registerTater("lapis_tater", LAPIS_TATER); - registerTater("netherite_tater", NETHERITE_TATER); - registerTater("quartz_tater", QUARTZ_TATER); - registerTater("redstone_tater", REDSTONE_TATER); - - registerTater("copper_tater", COPPER_TATER); - registerTater("exposed_copper_tater", EXPOSED_COPPER_TATER); - registerTater("weathered_copper_tater", WEATHERED_COPPER_TATER); - registerTater("oxidized_copper_tater", OXIDIZED_COPPER_TATER); - - registerTater("cake_tater", CAKE_TATER); - registerTater("endertater", ENDERTATER); - registerTater("furnace_tater", FURNACE_TATER); - registerTater("melon_tater", MELON_TATER); - registerTater("pumpkin_tater", PUMPKIN_TATER); - registerTater("jack_o_tater", JACK_O_TATER); - registerTater("sculk_tater", SCULK_TATER); - registerTater("slime_tater", SLIME_TATER); - registerTater("herobrine_tater", HEROBRINE_TATER); - registerTater("ochre_froglight_tater", OCHRE_FROGLIGHT_TATER); - registerTater("pearlescent_froglight_tater", PEARLESCENT_FROGLIGHT_TATER); - registerTater("verdant_froglight_tater", VERDANT_FROGLIGHT_TATER); - registerTater("snowman_tater", SNOWMAN_TATER); - - registerTater("acacia_tater", ACACIA_TATER); - registerTater("andesite_tater", ANDESITE_TATER); - registerTater("bamboo_tater", BAMBOO_TATER); - registerTater("barrier_tater", BARRIER_TATER); - registerTater("bedrock_tater", BEDROCK_TATER); - registerTater("birch_tater", BIRCH_TATER); - registerTater("bone_tater", BONE_TATER); - registerTater("brain_coral_tater", BRAIN_CORAL_TATER); - registerTater("brick_tater", BRICK_TATER); - registerTater("bubble_coral_tater", BUBBLE_CORAL_TATER); - registerTater("cactus_tater", CACTUS_TATER); - registerTater("chorus_tater", CHORUS_TATER); - registerTater("clay_tater", CLAY_TATER); - registerTater("crimson_tater", CRIMSON_TATER); - registerTater("dark_oak_tater", DARK_OAK_TATER); - registerTater("dark_prismarine_tater", DARK_PRISMARINE_TATER); - registerTater("diorite_tater", DIORITE_TATER); - registerTater("dirt_tater", DIRT_TATER); - registerTater("end_stone_tater", END_STONE_TATER); - registerTater("fire_coral_tater", FIRE_CORAL_TATER); - registerTater("granite_tater", GRANITE_TATER); - registerTater("grass_tater", GRASS_TATER); - registerTater("hay_tater", HAY_TATER); - registerTater("honey_tater", HONEY_TATER); - registerTater("honeycomb_tater", HONEYCOMB_TATER); - registerTater("horn_coral_tater", HORN_CORAL_TATER); - registerTater("jungle_tater", JUNGLE_TATER); - registerTater("light_tater", LIGHT_TATER); - registerTater("mycelium_tater", MYCELIUM_TATER); - registerTater("nether_wart_tater", NETHER_WART_TATER); - registerTater("oak_tater", OAK_TATER); - registerTater("obsidian_tater", OBSIDIAN_TATER); - registerTater("podzol_tater", PODZOL_TATER); - registerTater("prismarine_brick_tater", PRISMARINE_BRICK_TATER); - registerTater("prismarine_tater", PRISMARINE_TATER); - registerTater("red_sand_tater", RED_SAND_TATER); - registerTater("sand_tater", SAND_TATER); - registerTater("sea_lantern_tater", SEA_LANTERN_TATER); - registerTater("shroomlight_tater", SHROOMLIGHT_TATER); - registerTater("shulker_tater", SHULKER_TATER); - registerTater("smooth_stone_tater", SMOOTH_STONE_TATER); - registerTater("soul_sand_tater", SOUL_SAND_TATER); - registerTater("sponge_tater", SPONGE_TATER); - registerTater("spruce_tater", SPRUCE_TATER); - registerTater("stone_brick_tater", STONE_BRICK_TATER); - registerTater("structure_void_tater", STRUCTURE_VOID_TATER); - registerTater("target_tater", TARGET_TATER); - registerTater("terracotta_tater", TERRACOTTA_TATER); - registerTater("tntater", TNTATER); - registerTater("tube_coral_tater", TUBE_CORAL_TATER); - registerTater("warped_tater", WARPED_TATER); - registerTater("warped_wart_tater", WARPED_WART_TATER); - registerTater("wool_tater", WOOL_TATER); - - registerTater("acacia_log_tater", ACACIA_LOG_TATER); - registerTater("angry_bee_tater", ANGRY_BEE_TATER); - registerTater("beacon_tater", BEACON_TATER); - registerTater("bee_nest_tater", BEE_NEST_TATER); - registerTater("bee_tater", BEE_TATER); - registerTater("beehive_tater", BEEHIVE_TATER); - registerTater("birch_log_tater", BIRCH_LOG_TATER); - registerTater("blackstone_tater", BLACKSTONE_TATER); - registerTater("blaze_tater", BLAZE_TATER); - registerTater("bookshelf_tater", BOOKSHELF_TATER); - registerTater("brown_mooshroom_tater", BROWN_MOOSHROOM_TATER); - registerTater("brown_mushroom_tater", BROWN_MUSHROOM_TATER); - registerTater("cave_spider_tater", CAVE_SPIDER_TATER); - registerTater("cobbled_deepslate_tater", COBBLED_DEEPSLATE_TATER); - registerTater("cobblestone_tater", COBBLESTONE_TATER); - registerTater("cocoa_tater", COCOA_TATER); - registerTater("cold_strider_tater", COLD_STRIDER_TATER); - registerTater("cow_tater", COW_TATER); - registerTater("crafting_tater", CRAFTING_TATER); - registerTater("crimson_nylium_tater", CRIMSON_NYLIUM_TATER); - registerTater("crimson_stem_tater", CRIMSON_STEM_TATER); - registerTater("dark_oak_log_tater", DARK_OAK_LOG_TATER); - registerTater("daylight_detector_tater", DAYLIGHT_DETECTOR_TATER); - registerTater("dead_brain_coral_tater", DEAD_BRAIN_CORAL_TATER); - registerTater("dead_bubble_coral_tater", DEAD_BUBBLE_CORAL_TATER); - registerTater("dead_fire_coral_tater", DEAD_FIRE_CORAL_TATER); - registerTater("dead_horn_coral_tater", DEAD_HORN_CORAL_TATER); - registerTater("dead_tube_coral_tater", DEAD_TUBE_CORAL_TATER); - registerTater("deepslate_brick_tater", DEEPSLATE_BRICK_TATER); - registerTater("deepslate_tater", DEEPSLATE_TATER); - registerTater("dried_kelp_tater", DRIED_KELP_TATER); - registerTater("drowned_tater", DROWNED_TATER); - registerTater("eye_of_ender_tater", EYE_OF_ENDER_TATER); - registerTater("fox_tater", FOX_TATER); - registerTater("ghast_tater", GHAST_TATER); - registerTater("gilded_blackstone_tater", GILDED_BLACKSTONE_TATER); - registerTater("glow_squid_tater", GLOW_SQUID_TATER); - registerTater("glowstone_tater", GLOWSTONE_TATER); - registerTater("husk_tater", HUSK_TATER); - registerTater("inverted_daylight_detector_tater", INVERTED_DAYLIGHT_DETECTOR_TATER); - registerTater("jungle_log_tater", JUNGLE_LOG_TATER); - registerTater("magma_cube_tater", MAGMA_CUBE_TATER); - registerTater("moobloom_tater", MOOBLOOM_TATER); - registerTater("moolip_tater", MOOLIP_TATER); - registerTater("muddy_pig_tater", MUDDY_PIG_TATER); - registerTater("mushroom_stem_tater", MUSHROOM_STEM_TATER); - registerTater("nether_brick_tater", NETHER_BRICK_TATER); - registerTater("netherrack_tater", NETHERRACK_TATER); - registerTater("oak_log_tater", OAK_LOG_TATER); - registerTater("pig_tater", PIG_TATER); - registerTater("polar_bear_tater", POLAR_BEAR_TATER); - registerTater("puffertater", PUFFERTATER); - registerTater("red_mooshroom_tater", RED_MOOSHROOM_TATER); - registerTater("red_mushroom_tater", RED_MUSHROOM_TATER); - registerTater("red_nether_brick_tater", RED_NETHER_BRICK_TATER); - registerTater("red_sandstone_tater", RED_SANDSTONE_TATER); - registerTater("ruby_tater", RUBY_TATER); - registerTater("sandstone_tater", SANDSTONE_TATER); - registerTater("sea_pickle_tater", SEA_PICKLE_TATER); - registerTater("sheep_tater", SHEEP_TATER); - registerTater("shielded_wither_tater", SHIELDED_WITHER_TATER); - registerTater("snow_fox_tater", SNOW_FOX_TATER); - registerTater("spider_tater", SPIDER_TATER); - registerTater("spruce_log_tater", SPRUCE_LOG_TATER); - registerTater("squid_tater", SQUID_TATER); - registerTater("stray_tater", STRAY_TATER); - registerTater("strider_tater", STRIDER_TATER); - registerTater("turtle_egg_tater", TURTLE_EGG_TATER); - registerTater("warped_nylium_tater", WARPED_NYLIUM_TATER); - registerTater("warped_stem_tater", WARPED_STEM_TATER); - registerTater("wither_tater", WITHER_TATER); - - registerTater("azalea_tater", AZALEA_TATER); - registerTater("bell_tater", BELL_TATER); - registerTater("cold_frog_tater", COLD_FROG_TATER); - registerTater("conduit_tater", CONDUIT_TATER); - registerTater("elder_guardian_tater", ELDER_GUARDIAN_TATER); - registerTater("end_stone_brick_tater", END_STONE_BRICK_TATER); - registerTater("flower_pot_tater", FLOWER_POT_TATER); - registerTater("guardian_tater", GUARDIAN_TATER); - registerTater("illager_tater", ILLAGER_TATER); - registerTater("illusioner_tater", ILLUSIONER_TATER); - registerTater("jukebox_tater", JUKEBOX_TATER); - registerTater("lantern_tater", LANTERN_TATER); - registerTater("piglin_tater", PIGLIN_TATER); - registerTater("pink_wither_tater", PINK_WITHER_TATER); - registerTater("piston_tater", PISTON_TATER); - registerTater("purpur_tater", PURPUR_TATER); - registerTater("soul_lantern_tater", SOUL_LANTERN_TATER); - registerTater("soul_soil_tater", SOUL_SOIL_TATER); - registerTater("sticky_piston_tater", STICKY_PISTON_TATER); - registerTater("temperate_frog_tater", TEMPERATE_FROG_TATER); - registerTater("underwater_tntater", UNDERWATER_TNTATER); - registerTater("vex_tater", VEX_TATER); - registerTater("villager_tater", VILLAGER_TATER); - registerTater("vinditater", VINDITATER); - registerTater("wandering_trader_tater", WANDERING_TRADER_TATER); - registerTater("warm_frog_tater", WARM_FROG_TATER); - registerTater("wax_tater", WAX_TATER); - registerTater("witch_tater", WITCH_TATER); - registerTater("zombie_villager_tater", ZOMBIE_VILLAGER_TATER); - registerTater("zombified_piglin_tater", ZOMBIFIED_PIGLIN_TATER); - - registerTater("bone_spider_tater", BONE_SPIDER_TATER); - registerTater("bouldering_zombie_tater", BOULDERING_ZOMBIE_TATER); - registerTater("charged_creeper_tater", CHARGED_CREEPER_TATER); - registerTater("lobber_zombie_tater", LOBBER_ZOMBIE_TATER); - registerTater("mossy_skeletater", MOSSY_SKELETATER); - registerTater("stripped_acacia_log_tater", STRIPPED_ACACIA_LOG_TATER); - registerTater("stripped_birch_log_tater", STRIPPED_BIRCH_LOG_TATER); - registerTater("stripped_crimson_stem_tater", STRIPPED_CRIMSON_STEM_TATER); - registerTater("stripped_dark_oak_log_tater", STRIPPED_DARK_OAK_LOG_TATER); - registerTater("stripped_jungle_log_tater", STRIPPED_JUNGLE_LOG_TATER); - registerTater("stripped_oak_log_tater", STRIPPED_OAK_LOG_TATER); - registerTater("stripped_spruce_log_tater", STRIPPED_SPRUCE_LOG_TATER); - registerTater("stripped_warped_stem_tater", STRIPPED_WARPED_STEM_TATER); - registerTater("tropical_slime_tater", TROPICAL_SLIME_TATER); - - registerTater("apple_tater", APPLE_TATER); - registerTater("golden_apple_tater", GOLDEN_APPLE_TATER); - registerTater("ice_tater", ICE_TATER); - registerTater("king_tater", KING_TATER); - registerTater("raw_copper_tater", RAW_COPPER_TATER); - registerTater("raw_gold_tater", RAW_GOLD_TATER); - registerTater("raw_iron_tater", RAW_IRON_TATER); - - registerTater("allay_tater", ALLAY_TATER); - registerTater("mangrove_log_tater", MANGROVE_LOG_TATER); - registerTater("mangrove_tater", MANGROVE_TATER); - registerTater("mud_brick_tater", MUD_BRICK_TATER); - registerTater("mud_tater", MUD_TATER); - registerTater("packed_mud_tater", PACKED_MUD_TATER); - registerTater("stripped_mangrove_log_tater", STRIPPED_MANGROVE_LOG_TATER); - - registerTater("lucy_axolotl_tater", LUCY_AXOLOTL_TATER); - registerTater("wild_axolotl_tater", WILD_AXOLOTL_TATER); - registerTater("gold_axolotl_tater", GOLD_AXOLOTL_TATER); - registerTater("cyan_axolotl_tater", CYAN_AXOLOTL_TATER); - registerTater("blue_axolotl_tater", BLUE_AXOLOTL_TATER); - - registerTater("bronze_capsule_tater", BRONZE_CAPSULE_TATER); - registerTater("silver_capsule_tater", SILVER_CAPSULE_TATER); - registerTater("gold_capsule_tater", GOLD_CAPSULE_TATER); - - registerTater("corruptater", CORRUPTATER); - - register("tater_box", TATER_BOX); - register("creative_tater_box", CREATIVE_TATER_BOX); - - register("tater_guidebook", TATER_GUIDEBOOK); - register("quick_armor_stand", QUICK_ARMOR_STAND); - register("game_portal_opener", GAME_PORTAL_OPENER); - register("launch_feather", LAUNCH_FEATHER); - register("rule_book", RULE_BOOK); - PolymerItemGroupUtils.registerPolymerItemGroup(NucleoidExtras.identifier("general"), ITEM_GROUP); ServerPlayConnectionEvents.JOIN.register(NEItems::onPlayerJoin); @@ -862,7 +536,7 @@ public static void giveLobbyItems(ServerPlayerEntity player) { config.gamePortalOpener().ifPresent(gamePortal -> { tryOfferStack(player, GAME_PORTAL_OPENER, stack -> { - GamePortalOpenerItem.setGamePortalId(stack, gamePortal); + stack.set(NEDataComponentTypes.GAME_PORTAL, new GamePortalComponent(gamePortal)); }); }); } @@ -895,13 +569,14 @@ private static ActionResult onUseEntity(PlayerEntity player, World world, Hand h return ActionResult.PASS; } - private static T registerTater(String id, T item) { - register(id, item); - TATERS.add(item); - return item; - } + private static T register(String id, Item.Settings settings, Function factory) { + RegistryKey key = RegistryKey.of(RegistryKeys.ITEM, NucleoidExtras.identifier(id)); + T item = factory.apply(settings.registryKey(key)); + + if (item instanceof BlockItem blockItem && blockItem.getBlock() instanceof TinyPotatoBlock) { + TATERS.add(item); + } - private static T register(String id, T item) { - return Registry.register(Registries.ITEM, NucleoidExtras.identifier(id), item); + return Registry.register(Registries.ITEM, key, item); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/PlayerLobbyState.java b/src/main/java/xyz/nucleoid/extras/lobby/PlayerLobbyState.java index 9fdb7906..b7212067 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/PlayerLobbyState.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/PlayerLobbyState.java @@ -12,17 +12,16 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItem; import net.minecraft.item.ItemStack; -import net.minecraft.registry.Registries; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Formatting; -import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import xyz.nucleoid.extras.component.NEDataComponentTypes; +import xyz.nucleoid.extras.component.TaterSelectionComponent; import xyz.nucleoid.extras.lobby.block.tater.TinyPotatoBlock; -import xyz.nucleoid.extras.lobby.item.tater.TaterBoxItem; import xyz.nucleoid.extras.mixin.lobby.ArmorStandEntityAccessor; import xyz.nucleoid.extras.tag.NEBlockTags; @@ -53,11 +52,12 @@ public ActionResult collectTaterFromEntity(Entity entity, Vec3d hitPos, ItemStac return this.collectTaterFromSlot(armorStand.getEquippedStack(slot), stack, player); } else if (entity instanceof PlayerEntity targetPlayer) { ItemStack targetStack = targetPlayer.getEquippedStack(EquipmentSlot.HEAD); + TaterSelectionComponent taterSelection = targetStack.get(NEDataComponentTypes.TATER_SELECTION); - if (targetStack.getItem() instanceof TaterBoxItem) { - Block targetTater = TaterBoxItem.getSelectedTater(targetStack); + if (taterSelection != null && taterSelection.allowViralCollection() && taterSelection.tater().isPresent()) { + Block targetTater = taterSelection.tater().get().value(); - if (targetTater != null && targetTater.getDefaultState().isIn(NEBlockTags.VIRAL_TATERS)) { + if (targetTater.getDefaultState().isIn(NEBlockTags.VIRAL_TATERS)) { return this.collectTater(targetTater, stack, player); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/ContributorStatueBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/ContributorStatueBlock.java index 0af756f1..eab38e11 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/ContributorStatueBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/ContributorStatueBlock.java @@ -4,34 +4,38 @@ import com.mojang.serialization.MapCodec; import eu.pb4.polymer.core.api.block.PolymerBlock; +import eu.pb4.polymer.virtualentity.api.BlockWithElementHolder; +import eu.pb4.polymer.virtualentity.api.ElementHolder; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.BlockWithEntity; import net.minecraft.block.Blocks; import net.minecraft.block.entity.BlockEntity; -import net.minecraft.client.item.TooltipContext; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.NbtComponent; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.BlockItem; import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemStack; +import net.minecraft.item.Item.TooltipContext; +import net.minecraft.item.tooltip.TooltipType; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; import net.minecraft.state.StateManager.Builder; -import net.minecraft.state.property.DirectionProperty; +import net.minecraft.state.property.EnumProperty; import net.minecraft.state.property.Properties; import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Formatting; -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 xyz.nucleoid.extras.lobby.NEBlocks; import xyz.nucleoid.extras.lobby.contributor.ContributorData; +import xyz.nucleoid.packettweaker.PacketContext; -public class ContributorStatueBlock extends BlockWithEntity implements PolymerBlock { - protected static final DirectionProperty FACING = Properties.HORIZONTAL_FACING; +public class ContributorStatueBlock extends BlockWithEntity implements PolymerBlock, BlockWithElementHolder { + protected static final EnumProperty FACING = Properties.HORIZONTAL_FACING; public ContributorStatueBlock(Settings settings) { super(settings); @@ -45,7 +49,7 @@ protected MapCodec getCodec() { } @Override - public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { if (!world.isClient() && player.isCreativeLevelTwoOp()) { var blockEntity = world.getBlockEntity(pos, NEBlocks.CONTRIBUTOR_STATUE_ENTITY); @@ -59,13 +63,13 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt } @Override - public Block getPolymerBlock(BlockState state) { - return Blocks.SMOOTH_STONE; + public BlockState getPolymerBlockState(BlockState state, PacketContext context) { + return Blocks.SMOOTH_STONE.getDefaultState(); } @Override - public void onPolymerBlockSend(BlockState state, BlockPos.Mutable pos, ServerPlayerEntity player) { - player.getWorld().getBlockEntity(pos, NEBlocks.CONTRIBUTOR_STATUE_ENTITY).ifPresent(ContributorStatueBlockEntity::spawnHolograms); + public ElementHolder createElementHolder(ServerWorld world, BlockPos pos, BlockState initialBlockState) { + return new ContributorStatueModel(); } @Override @@ -79,11 +83,12 @@ protected void appendProperties(Builder builder) { builder.add(FACING); } + @SuppressWarnings("deprecation") @Override - public void appendTooltip(ItemStack stack, BlockView world, List tooltip, TooltipContext options) { - super.appendTooltip(stack, world, tooltip, options); + public void appendTooltip(ItemStack stack, TooltipContext context, List tooltip, TooltipType type) { + super.appendTooltip(stack, context, tooltip, type); - var nbt = BlockItem.getBlockEntityNbt(stack); + var nbt = stack.getOrDefault(DataComponentTypes.BLOCK_ENTITY_DATA, NbtComponent.DEFAULT).getNbt(); if (nbt != null) { var contributorId = nbt.getString(ContributorStatueBlockEntity.CONTRIBUTOR_ID_KEY); @@ -93,7 +98,7 @@ public void appendTooltip(ItemStack stack, BlockView world, List tooltip, tooltip.add(Text.translatable("block.nucleoid_extras.contributor_statue.contributor", contributor.getName()).formatted(Formatting.GRAY)); } - if (options.isAdvanced()) { + if (type.isAdvanced()) { tooltip.add(Text.translatable("block.nucleoid_extras.contributor_statue.contributor_id", contributorId).formatted(Formatting.GRAY)); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/ContributorStatueBlockEntity.java b/src/main/java/xyz/nucleoid/extras/lobby/block/ContributorStatueBlockEntity.java index af92f49f..6c8685f9 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/ContributorStatueBlockEntity.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/ContributorStatueBlockEntity.java @@ -1,51 +1,27 @@ package xyz.nucleoid.extras.lobby.block; -import java.time.LocalDate; -import java.time.temporal.ChronoField; -import java.util.ArrayList; import java.util.List; -import java.util.function.Function; import java.util.stream.Collectors; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Lists; -import com.mojang.datafixers.util.Pair; - -import eu.pb4.holograms.api.elements.clickable.EntityHologramElement; -import eu.pb4.holograms.api.holograms.AbstractHologram; -import eu.pb4.holograms.api.holograms.WorldHologram; +import eu.pb4.polymer.virtualentity.api.attachment.BlockAwareAttachment; import eu.pb4.sgui.api.elements.GuiElementBuilder; import eu.pb4.sgui.api.elements.GuiElementInterface; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.EquipmentSlot; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.decoration.ArmorStandEntity; -import net.minecraft.entity.mob.DrownedEntity; -import net.minecraft.entity.mob.HuskEntity; -import net.minecraft.entity.mob.SkeletonEntity; -import net.minecraft.entity.mob.StrayEntity; -import net.minecraft.entity.mob.ZombieEntity; -import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.NbtCompound; -import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.s2c.play.EntityEquipmentUpdateS2CPacket; +import net.minecraft.registry.RegistryWrapper; 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.text.Text; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.world.World; +import net.minecraft.world.chunk.WorldChunk; import xyz.nucleoid.extras.lobby.NEBlocks; import xyz.nucleoid.extras.lobby.contributor.Contributor; import xyz.nucleoid.extras.lobby.contributor.ContributorData; import xyz.nucleoid.extras.lobby.item.tater.TaterBoxItem; -import xyz.nucleoid.extras.mixin.lobby.LivingEntityAccessor; import xyz.nucleoid.extras.util.PagedGui; public class ContributorStatueBlockEntity extends BlockEntity { @@ -53,64 +29,28 @@ public class ContributorStatueBlockEntity extends BlockEntity { private static final Text GUI_TITLE = Text.translatable("text.nucleoid_extras.contributor_statue.title"); - private static final List> SPOOKY_ENTITIES = ImmutableList.of( - ZombieEntity::new, - world -> new DrownedEntity(EntityType.DROWNED, world), - world -> new HuskEntity(EntityType.HUSK, world), - world -> new SkeletonEntity(EntityType.SKELETON, world), - world -> new StrayEntity(EntityType.STRAY, world) - ); - private String contributorId = ""; - private WorldHologram hologram; + private ContributorStatueModel model; public ContributorStatueBlockEntity(BlockPos pos, BlockState state) { super(NEBlocks.CONTRIBUTOR_STATUE_ENTITY, pos, state); } - private Entity getHologramEntity() { - LocalDate date = LocalDate.now(); - - int month = date.get(ChronoField.MONTH_OF_YEAR); - int day = date.get(ChronoField.DAY_OF_MONTH); + public void attachElementHolder(WorldChunk chunk) { + var attachment = BlockAwareAttachment.get(chunk, this.getPos()); - if (month == 10 && day == 31) { - int index = Math.floorMod(this.contributorId.hashCode(), SPOOKY_ENTITIES.size()); - return SPOOKY_ENTITIES.get(index).apply(world); + if (attachment != null && attachment.holder() instanceof ContributorStatueModel model) { + this.model = model; + this.updateModel(); + } else { + this.model = null; } - - return new ArmorStandEntity(world, 0, 0, 0); } - public void spawnHolograms() { - if (this.hologram != null) return; - - var contributor = ContributorData.getContributor(this.contributorId); - if (contributor == null) return; - - double x = this.pos.getX() + 0.5; - double y = this.pos.getY() + 1; - double z = this.pos.getZ() + 0.5; - - var world = (ServerWorld) this.world; - this.hologram = new WorldHologram(world, new Vec3d(x, y, z)); - - var entity = this.getHologramEntity(); - contributor.fillEntity(world.getServer(), entity); - - entity.setYaw(entity.getYaw() + this.getCachedState().get(ContributorStatueBlock.FACING).asRotation()); - entity.setHeadYaw(entity.getYaw()); - entity.setBodyYaw(entity.getYaw()); - - this.hologram.addElement(new EquipmentEntityHologramElement(entity)); - this.hologram.show(); - } - - public void removeHolograms() { - if (this.hologram != null) { - this.hologram.hide(); - this.hologram = null; + public void updateModel() { + if (this.model != null) { + this.model.update(this.contributorId, (ServerWorld) this.world, this.getCachedState()); } } @@ -118,11 +58,9 @@ private void selectContributor(ServerPlayerEntity player, String id) { if (this.contributorId.equals(id)) return; this.contributorId = id; - player.playSound(SoundEvents.UI_BUTTON_CLICK.value(), SoundCategory.MASTER, 1, 1); - - this.removeHolograms(); - this.spawnHolograms(); + player.playSoundToPlayer(SoundEvents.UI_BUTTON_CLICK.value(), SoundCategory.MASTER, 1, 1); + this.updateModel(); this.markDirty(); } @@ -141,7 +79,8 @@ protected void openEditScreen(ServerPlayerEntity player) { var profile = contributor.createGameProfile(server); var builder = GuiElementBuilder.from(contributor.createPlayerHead(profile)) - .setName(contributor.getName()) + .setItemName(contributor.getName()) + .hideDefaultTooltip() .setCallback(() -> { this.selectContributor(player, id); }); @@ -157,7 +96,8 @@ protected void openEditScreen(ServerPlayerEntity player) { .collect(Collectors.toList()); elements.add(0, new GuiElementBuilder(Items.BARRIER) - .setName(TaterBoxItem.NONE_TEXT) + .setItemName(TaterBoxItem.NONE_TEXT) + .hideDefaultTooltip() .setCallback(() -> { this.selectContributor(player, ""); }) @@ -170,86 +110,14 @@ protected void openEditScreen(ServerPlayerEntity player) { } @Override - @SuppressWarnings("deprecation") - public void setCachedState(BlockState state) { - super.setCachedState(state); - - this.removeHolograms(); - this.spawnHolograms(); - } - - @Override - public void markRemoved() { - super.markRemoved(); - this.removeHolograms(); - } - - @Override - public void readNbt(NbtCompound nbt) { - super.readNbt(nbt); + public void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) { + super.readNbt(nbt, registries); this.contributorId = nbt.getString(CONTRIBUTOR_ID_KEY); } @Override - protected void writeNbt(NbtCompound nbt) { - super.writeNbt(nbt); + protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) { + super.writeNbt(nbt, registries); nbt.putString(CONTRIBUTOR_ID_KEY, this.contributorId); } - - private static class EquipmentEntityHologramElement extends EntityHologramElement { - public EquipmentEntityHologramElement(Entity entity) { - super(entity); - } - - @Override - public void createSpawnPackets(ServerPlayerEntity player, AbstractHologram hologram) { - super.createSpawnPackets(player, hologram); - - if (this.entity instanceof LivingEntity livingEntity) { - ArrayList> equipmentList = Lists.newArrayList(); - - for (EquipmentSlot slot : EquipmentSlot.values()) { - ItemStack stack = livingEntity.getEquippedStack(slot); - - if (!stack.isEmpty()) { - equipmentList.add(Pair.of(slot, stack.copy())); - } - } - - if (!equipmentList.isEmpty()) { - Packet packet = new EntityEquipmentUpdateS2CPacket(this.entity.getId(), equipmentList); - player.networkHandler.sendPacket(packet); - } - } - } - - @Override - public void onTick(AbstractHologram hologram) { - super.onTick(hologram); - - if (this.entity instanceof LivingEntityAccessor accessor) { - var equipmentChanges = accessor.callGetEquipmentChanges(); - - if (equipmentChanges != null && !equipmentChanges.isEmpty()) { - var list = new ArrayList>(equipmentChanges.size()); - - equipmentChanges.forEach((slot, stack) -> { - var stackCopy = stack.copy(); - list.add(Pair.of(slot, stackCopy)); - - switch (slot.getType()) { - case HAND -> accessor.callSetSyncedHandStack(slot, stackCopy); - case ARMOR -> accessor.callSetSyncedArmorStack(slot, stackCopy); - } - }); - - var packet = new EntityEquipmentUpdateS2CPacket(this.entity.getId(), list); - - for (ServerPlayerEntity player : hologram.getPlayerSet()) { - player.networkHandler.sendPacket(packet); - } - } - } - } - } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/ContributorStatueModel.java b/src/main/java/xyz/nucleoid/extras/lobby/block/ContributorStatueModel.java new file mode 100644 index 00000000..82f4bde4 --- /dev/null +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/ContributorStatueModel.java @@ -0,0 +1,62 @@ +package xyz.nucleoid.extras.lobby.block; + +import com.google.common.collect.ImmutableList; +import eu.pb4.polymer.virtualentity.api.ElementHolder; +import eu.pb4.polymer.virtualentity.api.elements.EntityElement; +import net.minecraft.block.BlockState; +import net.minecraft.entity.EntityType; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.math.Vec3d; +import xyz.nucleoid.extras.lobby.contributor.ContributorData; + +import java.time.LocalDate; +import java.time.temporal.ChronoField; +import java.util.List; + +public class ContributorStatueModel extends ElementHolder { + private static final List> SPOOKY_ENTITIES = ImmutableList.of( + EntityType.ZOMBIE, + EntityType.DROWNED, + EntityType.HUSK, + EntityType.SKELETON, + EntityType.STRAY, + EntityType.BOGGED + ); + + private EntityElement entityElement; + + private EntityType getEntityType(String contributorId) { + LocalDate date = LocalDate.now(); + + int month = date.get(ChronoField.MONTH_OF_YEAR); + int day = date.get(ChronoField.DAY_OF_MONTH); + + if (month == 10 && day == 31) { + int index = Math.floorMod(contributorId.hashCode(), SPOOKY_ENTITIES.size()); + return SPOOKY_ENTITIES.get(index); + } + + return EntityType.ARMOR_STAND; + } + + public void update(String contributorId, ServerWorld world, BlockState state) { + this.removeElement(this.entityElement); + + var contributor = ContributorData.getContributor(contributorId); + if (contributor == null) return; + + var entityType = this.getEntityType(contributorId); + + this.entityElement = new EntityElement<>(entityType, world); + this.entityElement.setOffset(new Vec3d(0, 1, 0)); + + var entity = this.entityElement.entity(); + contributor.fillEntity(world.getServer(), entity); + + entity.setYaw(entity.getYaw() + state.get(ContributorStatueBlock.FACING).asRotation()); + entity.setHeadYaw(entity.getYaw()); + entity.setBodyYaw(entity.getYaw()); + + this.addElement(this.entityElement); + } +} diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/InfiniteDispenserBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/InfiniteDispenserBlock.java index 79c19ece..a1be3bf3 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/InfiniteDispenserBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/InfiniteDispenserBlock.java @@ -1,7 +1,6 @@ package xyz.nucleoid.extras.lobby.block; import eu.pb4.polymer.core.api.block.PolymerBlock; -import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.DispenserBlock; @@ -14,6 +13,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.WorldEvents; import net.minecraft.world.event.GameEvent; +import xyz.nucleoid.packettweaker.PacketContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -40,7 +40,7 @@ protected void dispense(ServerWorld world, BlockState state, BlockPos pos) { world.emitGameEvent(GameEvent.BLOCK_ACTIVATE, pos, GameEvent.Emitter.of(blockEntity.getCachedState())); } else { ItemStack stack = blockEntity.getStack(slot); - DispenserBehavior behavior = this.getBehaviorForItem(stack); + DispenserBehavior behavior = this.getBehaviorForItem(world, stack); if (behavior != DispenserBehavior.NOOP) { behavior.dispense(pointer, stack.copy()); @@ -50,13 +50,8 @@ protected void dispense(ServerWorld world, BlockState state, BlockPos pos) { } @Override - public Block getPolymerBlock(BlockState state) { - return Blocks.DISPENSER; - } - - @Override - public BlockState getPolymerBlockState(BlockState state) { - return PolymerBlock.super.getPolymerBlockState(state) + public BlockState getPolymerBlockState(BlockState state, PacketContext context) { + return Blocks.DISPENSER.getDefaultState() .with(FACING, state.get(FACING)) .with(TRIGGERED, state.get(TRIGGERED)); } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/InfiniteDropperBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/InfiniteDropperBlock.java index 1b2103a0..f9da3015 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/InfiniteDropperBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/InfiniteDropperBlock.java @@ -1,6 +1,5 @@ package xyz.nucleoid.extras.lobby.block; -import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.dispenser.DispenserBehavior; @@ -9,6 +8,8 @@ import net.minecraft.block.entity.DropperBlockEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import xyz.nucleoid.packettweaker.PacketContext; public class InfiniteDropperBlock extends InfiniteDispenserBlock { private static final DispenserBehavior BEHAVIOR = new ItemDispenserBehavior(); @@ -18,7 +19,7 @@ public InfiniteDropperBlock(Settings settings) { } @Override - protected DispenserBehavior getBehaviorForItem(ItemStack stack) { + protected DispenserBehavior getBehaviorForItem(World world, ItemStack stack) { return BEHAVIOR; } @@ -28,7 +29,7 @@ public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { } @Override - public Block getPolymerBlock(BlockState state) { - return Blocks.DROPPER; + public BlockState getPolymerBlockState(BlockState state, PacketContext context) { + return Blocks.DROPPER.getDefaultState(); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/LaunchPadBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/LaunchPadBlock.java index 746e1258..0a87d4c3 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/LaunchPadBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/LaunchPadBlock.java @@ -15,19 +15,21 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import xyz.nucleoid.extras.component.LauncherComponent; +import xyz.nucleoid.packettweaker.PacketContext; import org.jetbrains.annotations.Nullable; public class LaunchPadBlock extends Block implements BlockEntityProvider, PolymerBlock { - private final Block virtualBlock; + private final BlockState virtualBlockState; - public LaunchPadBlock(Settings settings, Block virtualBlock) { + public LaunchPadBlock(Settings settings, BlockState virtualBlockState) { super(settings); - this.virtualBlock = virtualBlock; + this.virtualBlockState = virtualBlockState; } @Override - public Block getPolymerBlock(BlockState state) { - return this.virtualBlock; + public BlockState getPolymerBlockState(BlockState state, PacketContext context) { + return this.virtualBlockState; } @Override @@ -35,15 +37,15 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit var blockEntity = world.getBlockEntity(pos); if (blockEntity instanceof LaunchPadBlockEntity launchPad) { - tryLaunch(entity, entity, SoundEvents.BLOCK_PISTON_EXTEND, SoundCategory.BLOCKS, launchPad.getPitch(), launchPad.getPower()); + tryLaunch(entity, entity, SoundEvents.BLOCK_PISTON_EXTEND, SoundCategory.BLOCKS, new LauncherComponent(launchPad.getPitch(), launchPad.getPower())); } super.onEntityCollision(state, world, pos, entity); } - public static boolean tryLaunch(Entity entity, Entity source, SoundEvent sound, SoundCategory category, float pitch, float power) { - if (entity.isOnGround() && !(entity instanceof ArmorStandEntity)) { - entity.setVelocity(getVector(pitch, source.getYaw(0)).multiply(power)); + public static boolean tryLaunch(Entity entity, Entity source, SoundEvent sound, SoundCategory category, LauncherComponent launcher) { + if (launcher != null && entity.isOnGround() && !(entity instanceof ArmorStandEntity)) { + entity.setVelocity(getVector(launcher.pitch(), source.getYaw(0)).multiply(launcher.power())); if (entity instanceof ServerPlayerEntity player) { player.networkHandler.sendPacket(new EntityVelocityUpdateS2CPacket(entity)); playLaunchSound(player, sound, category); @@ -59,7 +61,7 @@ public static boolean tryLaunch(Entity entity, Entity source, SoundEvent sound, } public static void playLaunchSound(ServerPlayerEntity player, SoundEvent sound, SoundCategory category) { - player.playSound(sound, category, 0.5f, 1); + player.playSoundToPlayer(sound, category, 0.5f, 1); } private static Vec3d getVector(float pitch, float yaw) { diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/LaunchPadBlockEntity.java b/src/main/java/xyz/nucleoid/extras/lobby/block/LaunchPadBlockEntity.java index 567fe245..c1656c10 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/LaunchPadBlockEntity.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/LaunchPadBlockEntity.java @@ -3,18 +3,17 @@ import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.nbt.NbtCompound; +import net.minecraft.registry.RegistryWrapper; import net.minecraft.util.math.BlockPos; +import xyz.nucleoid.extras.component.LauncherComponent; import xyz.nucleoid.extras.lobby.NEBlocks; public class LaunchPadBlockEntity extends BlockEntity { public static final String PITCH_KEY = "Pitch"; public static final String POWER_KEY = "Power"; - public static final float DEFAULT_PITCH = 10; - public static final float DEFAULT_POWER = 4; - - private float pitch = DEFAULT_PITCH; - private float power = DEFAULT_POWER; + private float pitch = LauncherComponent.DEFAULT.pitch(); + private float power = LauncherComponent.DEFAULT.power(); public LaunchPadBlockEntity(BlockPos pos, BlockState state) { super(NEBlocks.LAUNCH_PAD_ENTITY, pos, state); @@ -29,15 +28,15 @@ public float getPower() { } @Override - protected void writeNbt(NbtCompound nbt) { - super.writeNbt(nbt); + protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) { + super.writeNbt(nbt, registries); nbt.putFloat(PITCH_KEY, this.pitch); nbt.putFloat(POWER_KEY, this.power); } @Override - public void readNbt(NbtCompound nbt) { - super.readNbt(nbt); + public void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) { + super.readNbt(nbt, registries); this.pitch = nbt.getFloat(PITCH_KEY); this.power = nbt.getFloat(POWER_KEY); } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/SnakeBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/SnakeBlock.java index aebfcc30..981546ef 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/SnakeBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/SnakeBlock.java @@ -16,18 +16,20 @@ import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; import net.minecraft.world.World; +import net.minecraft.world.block.WireOrientation; +import xyz.nucleoid.packettweaker.PacketContext; public class SnakeBlock extends FacingBlock implements PolymerBlock { public static final BooleanProperty ACTIVE = BooleanProperty.of("active"); - private final Block virtualBlock; + private final BlockState virtualBlockState; private final int delay; private final int length; - public SnakeBlock(Settings settings, Block virtualBlock, int delay, int length) { + public SnakeBlock(Settings settings, BlockState virtualBlockState, int delay, int length) { super(settings); - this.virtualBlock = virtualBlock; + this.virtualBlockState = virtualBlockState; this.delay = delay; this.length = length; @@ -41,8 +43,8 @@ private boolean isActive(BlockState state) { } @Override - public Block getPolymerBlock(BlockState state) { - return this.isActive(state) ? this.virtualBlock : Blocks.BROWN_MUSHROOM; + public BlockState getPolymerBlockState(BlockState state, PacketContext context) { + return this.isActive(state) ? this.virtualBlockState : Blocks.BROWN_MUSHROOM.getDefaultState(); } @Override @@ -66,7 +68,7 @@ public BlockState getPlacementState(ItemPlacementContext ctx) { } @Override - public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify) { + public void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, WireOrientation wireOrientation, boolean notify) { boolean powered = world.isReceivingRedstonePower(pos); boolean active = this.isActive(state); if (powered && !active) { diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/TransientDoorBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/TransientDoorBlock.java index 69f43c00..2a33b80d 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/TransientDoorBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/TransientDoorBlock.java @@ -2,7 +2,6 @@ import eu.pb4.polymer.core.api.block.PolymerBlock; import net.minecraft.SharedConstants; -import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockSetType; import net.minecraft.block.BlockState; @@ -14,6 +13,7 @@ import net.minecraft.util.math.Box; import net.minecraft.util.math.random.Random; import net.minecraft.world.World; +import xyz.nucleoid.packettweaker.PacketContext; public class TransientDoorBlock extends DoorBlock implements PolymerBlock { private static final int CLOSE_DELAY = SharedConstants.TICKS_PER_SECOND * 10; @@ -23,8 +23,8 @@ public class TransientDoorBlock extends DoorBlock implements PolymerBlock { private final Block polymerBlock; - public TransientDoorBlock(Block block) { - super(block instanceof DoorBlock door ? door.getBlockSetType() : BlockSetType.OAK, AbstractBlock.Settings.copy(block)); + public TransientDoorBlock(Block block, Block.Settings settings) { + super(block instanceof DoorBlock door ? door.getBlockSetType() : BlockSetType.OAK, settings); this.polymerBlock = block; } @@ -52,12 +52,7 @@ public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Ran } @Override - public Block getPolymerBlock(BlockState state) { - return this.polymerBlock; - } - - @Override - public BlockState getPolymerBlockState(BlockState state) { + public BlockState getPolymerBlockState(BlockState state, PacketContext context) { return this.polymerBlock.getStateWithProperties(state); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/VirtualEndGatewayBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/VirtualEndGatewayBlock.java index 2222f33d..a85413d7 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/VirtualEndGatewayBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/VirtualEndGatewayBlock.java @@ -7,8 +7,8 @@ import net.minecraft.block.Blocks; import net.minecraft.block.entity.BlockEntityType; import net.minecraft.nbt.NbtCompound; -import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.math.BlockPos; +import xyz.nucleoid.packettweaker.PacketContext; public class VirtualEndGatewayBlock extends Block implements PolymerBlock { public VirtualEndGatewayBlock(Settings settings) { @@ -16,12 +16,12 @@ public VirtualEndGatewayBlock(Settings settings) { } @Override - public Block getPolymerBlock(BlockState state) { - return Blocks.END_GATEWAY; + public BlockState getPolymerBlockState(BlockState state, PacketContext context) { + return Blocks.END_GATEWAY.getDefaultState(); } @Override - public void onPolymerBlockSend(BlockState blockState, BlockPos.Mutable pos, ServerPlayerEntity player) { + public void onPolymerBlockSend(BlockState blockState, BlockPos.Mutable pos, PacketContext.NotNullWithPlayer contexts) { var main = new NbtCompound(); main.putString("id", "minecraft:end_gateway"); main.putInt("x", pos.getX()); @@ -29,6 +29,6 @@ public void onPolymerBlockSend(BlockState blockState, BlockPos.Mutable pos, Serv main.putInt("z", pos.getZ()); main.putLong("Age", Long.MIN_VALUE); - player.networkHandler.sendPacket(PolymerBlockUtils.createBlockEntityPacket(pos, BlockEntityType.END_GATEWAY, main)); + contexts.getPlayer().networkHandler.sendPacket(PolymerBlockUtils.createBlockEntityPacket(pos, BlockEntityType.END_GATEWAY, main)); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BellTaterBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BellTaterBlock.java index 6f34b557..4fe02f87 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BellTaterBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BellTaterBlock.java @@ -21,11 +21,11 @@ import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.Properties; 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.World; +import net.minecraft.world.block.WireOrientation; import net.minecraft.world.event.GameEvent; public class BellTaterBlock extends CubicPotatoBlock implements BlockEntityProvider { @@ -37,7 +37,7 @@ public BellTaterBlock(Settings settings, String texture) { } @Override - public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify) { + public void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, WireOrientation wireOrientation, boolean notify) { boolean bl = world.isReceivingRedstonePower(pos); if (bl != state.get(POWERED)) { if (bl) { @@ -55,9 +55,9 @@ public void onProjectileHit(World world, BlockState state, BlockHitResult hit, P } @Override - public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - super.onUse(state, world, pos, player, hand, hit); - return this.ring(world, hit, player) ? ActionResult.success(world.isClient) : ActionResult.PASS; + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { + super.onUse(state, world, pos, player, hit); + return this.ring(world, hit, player) ? ActionResult.SUCCESS : ActionResult.PASS; } public boolean ring(World world, BlockHitResult hitResult, @Nullable PlayerEntity player) { diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BellTaterBlockEntity.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BellTaterBlockEntity.java index 45d0d120..b8393ca4 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BellTaterBlockEntity.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BellTaterBlockEntity.java @@ -6,6 +6,7 @@ import net.minecraft.entity.ai.brain.MemoryModuleType; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; +import net.minecraft.particle.EntityEffectParticleEffect; import net.minecraft.particle.ParticleTypes; import net.minecraft.registry.tag.EntityTypeTags; import net.minecraft.sound.SoundCategory; @@ -133,7 +134,7 @@ private static void applyParticlesToRaiders(World world, BlockPos pos, List> 16 & 0xFF) / 255.0; double m = (double)(l >> 8 & 0xFF) / 255.0; double n = (double)(l & 0xFF) / 255.0; - world.addParticle(ParticleTypes.ENTITY_EFFECT, e, (float)pos.getY() + 0.5f, g, h, m, n); + world.addParticle(EntityEffectParticleEffect.create(ParticleTypes.ENTITY_EFFECT, -1), e, (float)pos.getY() + 0.5f, g, h, m, n); } }); } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BotanicalPotatoBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BotanicalPotatoBlock.java index ed7cb19f..2a6a87ea 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BotanicalPotatoBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/BotanicalPotatoBlock.java @@ -9,16 +9,15 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; -import net.minecraft.client.render.model.json.ModelTransformationMode; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemStack; +import net.minecraft.item.ModelTransformationMode; import net.minecraft.particle.ParticleEffect; import net.minecraft.server.world.ServerWorld; import net.minecraft.state.StateManager; import net.minecraft.state.property.Properties; 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.MathHelper; @@ -28,6 +27,7 @@ import org.joml.Matrix4f; import org.joml.Vector3f; import xyz.nucleoid.extras.util.SkinEncoder; +import xyz.nucleoid.packettweaker.PacketContext; public class BotanicalPotatoBlock extends TinyPotatoBlock implements BlockWithElementHolder { private final ItemStack upStack; @@ -50,8 +50,8 @@ public BlockState getPlacementState(ItemPlacementContext ctx) { } @Override - public Block getPolymerBlock(BlockState state) { - return Blocks.BARRIER; + public BlockState getPolymerBlockState(BlockState state, PacketContext context) { + return Blocks.BARRIER.getDefaultState(); } @Override @@ -65,16 +65,14 @@ public boolean tickElementHolder(ServerWorld world, BlockPos pos, BlockState ini } @Override - public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - if (hand == Hand.MAIN_HAND) { - var model = (Model) BlockBoundAttachment.get(world, pos).holder(); + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { + var model = (Model) BlockBoundAttachment.get(world, pos).holder(); - if (model.jumpTime < 0) { - model.jumpTime = 20; - } + if (model.jumpTime < 0) { + model.jumpTime = 20; } - return super.onUse(state, world, pos, player, hand, hit); + return ActionResult.SUCCESS; } private class Model extends ElementHolder { diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CapsuleTaterBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CapsuleTaterBlock.java index 2dc2fbd5..a83c43f4 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CapsuleTaterBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CapsuleTaterBlock.java @@ -5,7 +5,6 @@ import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; -import org.joml.Vector3f; public class CapsuleTaterBlock extends ColorTaterBlock implements LuckyTaterDrop { private static final int PARTICLE_COUNT = 8; @@ -15,7 +14,7 @@ public class CapsuleTaterBlock extends ColorTaterBlock implements LuckyTaterDrop private final int weight; - public CapsuleTaterBlock(AbstractBlock.Settings settings, Vector3f color, int weight, String texture) { + public CapsuleTaterBlock(AbstractBlock.Settings settings, int color, int weight, String texture) { super(settings, color, texture); this.weight = weight; diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/ColorPatternTaterBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/ColorPatternTaterBlock.java index 26db0f3b..dda3ca24 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/ColorPatternTaterBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/ColorPatternTaterBlock.java @@ -2,17 +2,16 @@ import net.minecraft.particle.DustParticleEffect; import net.minecraft.particle.ParticleEffect; -import org.joml.Vector3f; -import java.util.stream.Stream; +import java.util.Arrays; public class ColorPatternTaterBlock extends CubicPotatoBlock { private final ParticleEffect[] particleEffects; - public ColorPatternTaterBlock(Settings settings, Vector3f[] pattern, String texture) { + public ColorPatternTaterBlock(Settings settings, int[] pattern, String texture) { super(settings, (ParticleEffect) null, texture); - this.particleEffects = Stream.of(pattern).map(color -> + this.particleEffects = Arrays.stream(pattern).mapToObj(color -> new DustParticleEffect(color, 1) ).toArray(ParticleEffect[]::new); } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/ColorTaterBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/ColorTaterBlock.java index d0b5ec64..79de1df5 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/ColorTaterBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/ColorTaterBlock.java @@ -2,15 +2,13 @@ import net.minecraft.particle.DustParticleEffect; import net.minecraft.util.DyeColor; -import net.minecraft.util.math.Vec3d; -import org.joml.Vector3f; public class ColorTaterBlock extends CubicPotatoBlock { - public ColorTaterBlock(Settings settings, Vector3f color, String texture) { + public ColorTaterBlock(Settings settings, int color, String texture) { super(settings, new DustParticleEffect(color, 1), texture); } public ColorTaterBlock(Settings settings, DyeColor color, String texture) { - this(settings, Vec3d.unpackRgb(color.getSignColor()).toVector3f(), texture); + this(settings, color.getSignColor(), texture); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CorruptaterBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CorruptaterBlock.java index 9a407351..8a62c935 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CorruptaterBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CorruptaterBlock.java @@ -3,17 +3,18 @@ import eu.pb4.polymer.core.api.utils.PolymerUtils; import net.minecraft.block.AbstractBlock; import net.minecraft.block.BlockState; +import net.minecraft.particle.EntityEffectParticleEffect; import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleTypes; -import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.math.BlockPos; +import xyz.nucleoid.packettweaker.PacketContext; import java.util.Random; public final class CorruptaterBlock extends CubicPotatoBlock { private final Random random = new Random(); public CorruptaterBlock(AbstractBlock.Settings settings, int particleRate) { - super(settings, ParticleTypes.ENTITY_EFFECT, PolymerUtils.NO_TEXTURE_HEAD_VALUE, particleRate); + super(settings, EntityEffectParticleEffect.create(ParticleTypes.ENTITY_EFFECT, 0), PolymerUtils.NO_TEXTURE_HEAD_VALUE, particleRate); } @Override @@ -22,9 +23,9 @@ public ParticleEffect getParticleEffect(int time) { } @Override - public String getPolymerSkinValue(BlockState state, BlockPos pos, ServerPlayerEntity player) { + public String getPolymerSkinValue(BlockState state, BlockPos pos, PacketContext context) { var tater = getTater(); - return tater.getPolymerSkinValue(tater.getDefaultState(), pos, player); + return tater.getPolymerSkinValue(tater.getDefaultState(), pos, context); } private CubicPotatoBlock getTater() { diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CubicPotatoBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CubicPotatoBlock.java index 2af2d4d2..db7f2f52 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CubicPotatoBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/CubicPotatoBlock.java @@ -11,13 +11,13 @@ import net.minecraft.particle.ItemStackParticleEffect; import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleTypes; -import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.state.StateManager; import net.minecraft.state.property.Properties; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RotationPropertyHelper; import xyz.nucleoid.extras.util.SkinEncoder; +import xyz.nucleoid.packettweaker.PacketContext; import java.util.ArrayList; import java.util.List; @@ -51,7 +51,7 @@ public CubicPotatoBlock(Settings settings, Item particleItem, String texture) { } @Override - public String getPolymerSkinValue(BlockState state, BlockPos pos, ServerPlayerEntity player) { + public String getPolymerSkinValue(BlockState state, BlockPos pos, PacketContext context) { return this.getItemTexture(); } @@ -66,12 +66,7 @@ public BlockState getPlacementState(ItemPlacementContext ctx) { } @Override - public Block getPolymerBlock(BlockState state) { - return Blocks.PLAYER_HEAD; - } - - @Override - public BlockState getPolymerBlockState(BlockState state) { + public BlockState getPolymerBlockState(BlockState state, PacketContext context) { return Blocks.PLAYER_HEAD.getDefaultState().with(Properties.ROTATION, state.get(Properties.ROTATION)); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/DiceTaterBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/DiceTaterBlock.java index fec084dd..34cb4de7 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/DiceTaterBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/DiceTaterBlock.java @@ -4,20 +4,19 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.ParticleTypes; -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.state.StateManager.Builder; import net.minecraft.state.property.IntProperty; 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.MathHelper; import net.minecraft.util.math.random.Random; import net.minecraft.world.World; import xyz.nucleoid.extras.util.SkinEncoder; +import xyz.nucleoid.packettweaker.PacketContext; public class DiceTaterBlock extends CubicPotatoBlock { private static final int ROLLING_FACE = 0; @@ -45,8 +44,8 @@ private boolean isRolling(BlockState state) { } @Override - public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - if (hand == Hand.OFF_HAND || this.isRolling(state)) { + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { + if (this.isRolling(state)) { return ActionResult.FAIL; } @@ -87,7 +86,7 @@ protected void appendProperties(Builder builder) { } @Override - public String getPolymerSkinValue(BlockState state, BlockPos pos, ServerPlayerEntity player) { + public String getPolymerSkinValue(BlockState state, BlockPos pos, PacketContext context) { int face = state.get(FACE); return TEXTURES[face]; } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/LightTaterBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/LightTaterBlock.java index 4599f862..7df616eb 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/LightTaterBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/LightTaterBlock.java @@ -9,7 +9,6 @@ import net.minecraft.particle.ParticleTypes; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; @@ -19,7 +18,7 @@ public LightTaterBlock(Settings settings, String texture) { } @Override - public ParticleEffect getBlockParticleEffect(BlockState state, ServerWorld world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + public ParticleEffect getBlockParticleEffect(BlockState state, ServerWorld world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { return getLightParticle(world.getLightLevel(pos)); } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/LuckyTaterBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/LuckyTaterBlock.java index 8f593278..4fa2649f 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/LuckyTaterBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/LuckyTaterBlock.java @@ -6,7 +6,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.particle.DustColorTransitionParticleEffect; import net.minecraft.particle.ParticleEffect; -import net.minecraft.registry.Registries; +import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; @@ -16,16 +16,15 @@ import net.minecraft.state.property.EnumProperty; import net.minecraft.state.property.Properties; import net.minecraft.util.ActionResult; -import net.minecraft.util.Hand; import net.minecraft.util.collection.DataPool; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.random.Random; import net.minecraft.world.World; import xyz.nucleoid.extras.tag.NEBlockTags; import xyz.nucleoid.extras.util.SkinEncoder; +import xyz.nucleoid.packettweaker.PacketContext; public class LuckyTaterBlock extends CubicPotatoBlock { private static final EnumProperty PHASE = EnumProperty.of("phase", LuckyTaterPhase.class); @@ -48,14 +47,14 @@ public ParticleEffect getPlayerParticleEffect(ServerPlayerEntity player) { int toColor = LuckyTaterBlock.getRandomColor(player.getRandom()); int scale = player.getRandom().nextInt(3); - return new DustColorTransitionParticleEffect(Vec3d.unpackRgb(fromColor).toVector3f(), Vec3d.unpackRgb(toColor).toVector3f(), scale); + return new DustColorTransitionParticleEffect(fromColor, toColor, scale); } @Override - public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { LuckyTaterPhase phase = state.get(PHASE); - if (hand == Hand.OFF_HAND || phase != LuckyTaterPhase.READY) { + if (phase != LuckyTaterPhase.READY) { return ActionResult.FAIL; } @@ -77,7 +76,7 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt world.setBlockState(allowed.pos(), dropState); // Spawn particles - ParticleEffect particleEffect = taterDrop.getBlockParticleEffect(taterDrop.getDefaultState(), serverWorld, pos, player, hand, hit); + ParticleEffect particleEffect = taterDrop.getBlockParticleEffect(taterDrop.getDefaultState(), serverWorld, pos, player, hit); this.spawnBlockParticles(serverWorld, pos, particleEffect); // Play sound @@ -95,7 +94,9 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt } private Block getDrop(ServerWorld world) { - var drops = Registries.BLOCK.getEntryList(NEBlockTags.LUCKY_TATER_DROPS); + var drops = world.getRegistryManager() + .getOrThrow(RegistryKeys.BLOCK) + .getOptional(NEBlockTags.LUCKY_TATER_DROPS); if (drops.isEmpty()) { return null; @@ -171,8 +172,8 @@ protected void appendProperties(Builder builder) { } @Override - public String getPolymerSkinValue(BlockState state, BlockPos pos, ServerPlayerEntity player) { - return state.get(PHASE) == LuckyTaterPhase.COOLDOWN ? this.cooldownTexture : super.getPolymerSkinValue(state, pos, player); + public String getPolymerSkinValue(BlockState state, BlockPos pos, PacketContext context) { + return state.get(PHASE) == LuckyTaterPhase.COOLDOWN ? this.cooldownTexture : super.getPolymerSkinValue(state, pos, context); } private static int getRandomColor(Random random) { diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TateroidBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TateroidBlock.java index 9e64a390..f051eb83 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TateroidBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TateroidBlock.java @@ -18,12 +18,12 @@ import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.Properties; 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.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; +import net.minecraft.world.block.WireOrientation; import xyz.nucleoid.extras.lobby.NEBlocks; import xyz.nucleoid.extras.mixin.BlockWithEntityAccessor; @@ -96,8 +96,8 @@ public void spawnPlayerParticles(ServerPlayerEntity player) { } @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); + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { + ActionResult result = super.onUse(state, world, pos, player, hit); if (result.isAccepted() && !world.isClient()) { this.activate(world, pos, FULL_DURATION); } @@ -106,7 +106,7 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt } @Override - public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify) { + public void neighborUpdate(BlockState state, World world, BlockPos pos, Block sourceBlock, WireOrientation wireOrientation, boolean notify) { if (!world.isClient()) { int power = world.getReceivedRedstonePower(pos); boolean powered = power > 0; diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TateroidBlockEntity.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TateroidBlockEntity.java index db31be45..f74d306e 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TateroidBlockEntity.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TateroidBlockEntity.java @@ -8,6 +8,7 @@ import net.minecraft.nbt.NbtOps; import net.minecraft.particle.ParticleTypes; import net.minecraft.registry.Registries; +import net.minecraft.registry.RegistryWrapper; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; @@ -92,28 +93,28 @@ public void playSound(long time) { } @Override - protected void writeNbt(NbtCompound nbt) { - super.writeNbt(nbt); + protected void writeNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) { + super.writeNbt(nbt, registries); nbt.putInt(DURATION_KEY, this.duration); nbt.putInt(TEMPO_KEY, this.tempo); nbt.putInt(PITCH_KEY, this.pitch); if (sound != null) { - Registries.SOUND_EVENT.createEntryCodec().encodeStart(NbtOps.INSTANCE, sound).result() + Registries.SOUND_EVENT.getEntryCodec().encodeStart(NbtOps.INSTANCE, sound).result() .ifPresent(sound -> nbt.put(SOUND_KEY, sound)); } } @Override - public void readNbt(NbtCompound nbt) { - super.readNbt(nbt); + public void readNbt(NbtCompound nbt, RegistryWrapper.WrapperLookup registries) { + super.readNbt(nbt, registries); this.duration = nbt.getInt(DURATION_KEY); this.tempo = nbt.getInt(TEMPO_KEY); this.pitch = nbt.getInt(PITCH_KEY); - Registries.SOUND_EVENT.createEntryCodec().parse(NbtOps.INSTANCE, nbt.get(SOUND_KEY)).result() + Registries.SOUND_EVENT.getEntryCodec().parse(NbtOps.INSTANCE, nbt.get(SOUND_KEY)).result() .ifPresent(entry -> this.sound = entry); } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TinyPotatoBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TinyPotatoBlock.java index 1e73b1b4..39646483 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TinyPotatoBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/TinyPotatoBlock.java @@ -12,8 +12,6 @@ import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.ActionResult; -import net.minecraft.util.Hand; -import net.minecraft.util.dynamic.Codecs; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; @@ -24,7 +22,7 @@ import java.util.List; public abstract class TinyPotatoBlock extends Block implements PolymerBlock { - public static final Codec> ENTRY_CODEC = Codecs.validate(Registries.BLOCK.createEntryCodec(), block -> { + public static final Codec> ENTRY_CODEC = Registries.BLOCK.getEntryCodec().validate(block -> { if (block.value() instanceof TinyPotatoBlock) { return DataResult.success(block); } @@ -50,7 +48,7 @@ public ParticleEffect getParticleEffect(int time) { return this.particleEffect; } - public ParticleEffect getBlockParticleEffect(BlockState state, ServerWorld world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + public ParticleEffect getBlockParticleEffect(BlockState state, ServerWorld world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { return this.getParticleEffect(world.getServer().getTicks()); } @@ -103,13 +101,9 @@ public final String getItemTexture() { } @Override - public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - if (hand == Hand.OFF_HAND) { - return ActionResult.FAIL; - } - + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { if (world instanceof ServerWorld serverWorld) { - ParticleEffect particleEffect = this.getBlockParticleEffect(state, serverWorld, pos, player, hand, hit); + ParticleEffect particleEffect = this.getBlockParticleEffect(state, serverWorld, pos, player, hit); this.spawnBlockParticles(serverWorld, pos, particleEffect); } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/WardenTaterBlock.java b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/WardenTaterBlock.java index 66f9cd3e..cdac0502 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/block/tater/WardenTaterBlock.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/block/tater/WardenTaterBlock.java @@ -9,7 +9,6 @@ import net.minecraft.particle.VibrationParticleEffect; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.world.event.BlockPositionSource; @@ -24,7 +23,7 @@ public WardenTaterBlock(Settings settings, String texture) { } @Override - public ParticleEffect getBlockParticleEffect(BlockState state, ServerWorld world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + public ParticleEffect getBlockParticleEffect(BlockState state, ServerWorld world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { return getTaterVibrationParticleEffect(pos, world); } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/contributor/Contributor.java b/src/main/java/xyz/nucleoid/extras/lobby/contributor/Contributor.java index fed25aa4..582a1758 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/contributor/Contributor.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/contributor/Contributor.java @@ -7,18 +7,18 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import net.minecraft.block.entity.SkullBlockEntity; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.ProfileComponent; import net.minecraft.entity.Entity; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.decoration.ArmorStandEntity; +import net.minecraft.entity.mob.MobEntity; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtHelper; import net.minecraft.server.MinecraftServer; import net.minecraft.text.Text; import xyz.nucleoid.extras.mixin.lobby.ArmorStandEntityAccessor; -import xyz.nucleoid.extras.mixin.lobby.SkullBlockEntityAccessor; public record Contributor(String name, ContributorSocials socials, Optional statueNbt) implements Comparable { protected static final Codec CODEC = RecordCodecBuilder.create(instance -> @@ -53,7 +53,11 @@ public void fillEntity(MinecraftServer server, Entity entity) { var profile = this.createGameProfile(server); var playerHead = this.createPlayerHead(profile); - entity.equipStack(EquipmentSlot.HEAD, playerHead); + if (entity instanceof MobEntity mob) { + mob.equipStack(EquipmentSlot.HEAD, playerHead); + } else if (entity instanceof ArmorStandEntity armorStand) { + armorStand.equipStack(EquipmentSlot.HEAD, playerHead); + } this.loadGameProfileProperties(server, profile, fullProfile -> { writeSkullOwner(playerHead, fullProfile); @@ -89,7 +93,6 @@ public int compareTo(Contributor o) { } public static void writeSkullOwner(ItemStack stack, GameProfile profile) { - var nbt = stack.getOrCreateNbt(); - nbt.put(SkullBlockEntity.SKULL_OWNER_KEY, NbtHelper.writeGameProfile(new NbtCompound(), profile)); + stack.set(DataComponentTypes.PROFILE, new ProfileComponent(profile)); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/contributor/ContributorData.java b/src/main/java/xyz/nucleoid/extras/lobby/contributor/ContributorData.java index 1ee896d5..70c64489 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/contributor/ContributorData.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/contributor/ContributorData.java @@ -24,7 +24,7 @@ import net.minecraft.util.JsonHelper; import xyz.nucleoid.extras.NucleoidExtrasConfig; import xyz.nucleoid.extras.lobby.block.ContributorStatueBlockEntity; -import xyz.nucleoid.extras.mixin.lobby.ThreadedAnvilChunkStorageAccessor; +import xyz.nucleoid.extras.mixin.lobby.ServerChunkLoadingManagerAccessor; public final class ContributorData { private static final Logger LOGGER = LogManager.getLogger(ContributorData.class); @@ -94,8 +94,8 @@ private static void refreshHolograms(MinecraftServer server) { for (var world : server.getWorlds()) { var chunkManager = world.getChunkManager(); - var chunkStorage = chunkManager.threadedAnvilChunkStorage; - var accessor = (ThreadedAnvilChunkStorageAccessor) (Object) chunkStorage; + var chunkStorage = chunkManager.chunkLoadingManager; + var accessor = (ServerChunkLoadingManagerAccessor) (Object) chunkStorage; for (var holder : accessor.callEntryIterator()) { var chunk = holder.getWorldChunk(); @@ -103,8 +103,7 @@ private static void refreshHolograms(MinecraftServer server) { if (chunk != null) { for (var entity : chunk.getBlockEntities().values()) { if (entity instanceof ContributorStatueBlockEntity statue) { - statue.removeHolograms(); - statue.spawnHolograms(); + statue.updateModel(); } } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/criterion/TaterCollectedCriterion.java b/src/main/java/xyz/nucleoid/extras/lobby/criterion/TaterCollectedCriterion.java index 5b837e0b..9e422ca8 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/criterion/TaterCollectedCriterion.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/criterion/TaterCollectedCriterion.java @@ -7,7 +7,6 @@ import net.minecraft.predicate.entity.LootContextPredicate; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.util.dynamic.Codecs; import xyz.nucleoid.extras.lobby.block.tater.TinyPotatoBlock; import java.util.Optional; @@ -25,8 +24,8 @@ public Codec getConditionsCodec() { @SuppressWarnings("OptionalUsedAsFieldOrParameterType") public static class Conditions implements AbstractCriterion.Conditions { public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( - Codecs.createStrictOptionalFieldCodec(TinyPotatoBlock.ENTRY_CODEC, "tater").forGetter(i -> i.tater), - Codecs.createStrictOptionalFieldCodec(TaterCount.CODEC, "count").forGetter(i -> i.count) + TinyPotatoBlock.ENTRY_CODEC.optionalFieldOf("tater").forGetter(i -> i.tater), + TaterCount.CODEC.optionalFieldOf("count").forGetter(i -> i.count) ).apply(instance, Conditions::new)); private final Optional> tater; diff --git a/src/main/java/xyz/nucleoid/extras/lobby/criterion/TaterCount.java b/src/main/java/xyz/nucleoid/extras/lobby/criterion/TaterCount.java index 5de9fc40..335441a4 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/criterion/TaterCount.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/criterion/TaterCount.java @@ -9,7 +9,7 @@ import java.util.function.Function; public sealed interface TaterCount { - static final Codec CODEC = Codecs.either(Value.CODEC, All.CODEC).xmap(either -> { + static final Codec CODEC = Codec.either(Value.CODEC, All.CODEC).xmap(either -> { return either.map(Function.identity(), Function.identity()); }, count -> { return count instanceof Value ? Either.left((Value) count) : Either.right((All) count); @@ -22,7 +22,7 @@ default boolean matches(int count) { } record Value(int count) implements TaterCount { - private static final Codec CODEC = Codecs.NONNEGATIVE_INT.xmap(Value::new, Value::count); + private static final Codec CODEC = Codecs.NON_NEGATIVE_INT.xmap(Value::new, Value::count); public Value { if (count < 0) { diff --git a/src/main/java/xyz/nucleoid/extras/lobby/criterion/WearTaterCriterion.java b/src/main/java/xyz/nucleoid/extras/lobby/criterion/WearTaterCriterion.java index 17a891a0..4dea57d0 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/criterion/WearTaterCriterion.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/criterion/WearTaterCriterion.java @@ -7,7 +7,6 @@ import net.minecraft.predicate.entity.LootContextPredicate; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.util.dynamic.Codecs; import xyz.nucleoid.extras.lobby.block.tater.TinyPotatoBlock; import java.util.Calendar; @@ -58,8 +57,8 @@ public record Conditions(Optional> tater, Optional private static final Codec DAY_OF_WEEK_CODEC = Codec.STRING.xmap(WearTaterCriterion::dayOfWeekToInt, WearTaterCriterion::dayOfWeekToString); public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( - Codecs.createStrictOptionalFieldCodec(TinyPotatoBlock.ENTRY_CODEC, "tater").forGetter(Conditions::tater), - Codecs.createStrictOptionalFieldCodec(DAY_OF_WEEK_CODEC, "day_of_week").forGetter(Conditions::dayOfWeek) + TinyPotatoBlock.ENTRY_CODEC.optionalFieldOf("tater").forGetter(Conditions::tater), + DAY_OF_WEEK_CODEC.optionalFieldOf("day_of_week").forGetter(Conditions::dayOfWeek) ).apply(instance, Conditions::new)); public boolean matches(TinyPotatoBlock tater, int dayOfWeek) { diff --git a/src/main/java/xyz/nucleoid/extras/lobby/entity/LeaderboardDisplayEntity.java b/src/main/java/xyz/nucleoid/extras/lobby/entity/LeaderboardDisplayEntity.java index 7bb4bd78..b6a1d6e6 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/entity/LeaderboardDisplayEntity.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/entity/LeaderboardDisplayEntity.java @@ -9,13 +9,13 @@ import net.minecraft.nbt.NbtElement; import net.minecraft.nbt.NbtList; import net.minecraft.nbt.NbtString; -import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; import net.minecraft.world.World; import xyz.nucleoid.extras.integrations.http.NucleoidHttpClient; +import xyz.nucleoid.packettweaker.PacketContext; import java.util.ArrayList; import java.util.List; @@ -29,7 +29,7 @@ public class LeaderboardDisplayEntity extends DisplayEntity.TextDisplayEntity im private static final int REGULAR_UPDATE_WAIT_TIME = 20 * 60; private static final int FORCED_UPDATE_WAIT_TIME = 20 * 10; private static final int CHANGE_DISPLAYED_TIME_TIME = 20 * 10; - private List leaderboardIds = List.of(new Identifier("nucleoid:games_played")); + private List leaderboardIds = List.of(Identifier.of("nucleoid", "games_played")); private final List leaderboards = new ArrayList<>(); private int updateTimer = -1; private int displayTimer = CHANGE_DISPLAYED_TIME_TIME; @@ -120,7 +120,7 @@ public void writeCustomDataToNbt(NbtCompound nbt) { } @Override - public EntityType getPolymerEntityType(ServerPlayerEntity player) { + public EntityType getPolymerEntityType(PacketContext context) { return EntityType.TEXT_DISPLAY; } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/entity/QuickArmorStandEntity.java b/src/main/java/xyz/nucleoid/extras/lobby/entity/QuickArmorStandEntity.java index 47fb1996..d2437fcd 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/entity/QuickArmorStandEntity.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/entity/QuickArmorStandEntity.java @@ -5,8 +5,10 @@ import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.decoration.ArmorStandEntity; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; import net.minecraft.world.World; import xyz.nucleoid.extras.lobby.NEEntities; +import xyz.nucleoid.packettweaker.PacketContext; public class QuickArmorStandEntity extends ArmorStandEntity implements PolymerEntity { public QuickArmorStandEntity(EntityType entityType, World world) { @@ -18,17 +20,17 @@ public QuickArmorStandEntity(World world) { } @Override - public EntityType getPolymerEntityType(ServerPlayerEntity player) { + public EntityType getPolymerEntityType(PacketContext context) { return EntityType.ARMOR_STAND; } @Override - public boolean isInvulnerableTo(DamageSource damageSource) { + public boolean isInvulnerableTo(ServerWorld world, DamageSource damageSource) { var attacker = damageSource.getAttacker(); if (attacker instanceof ServerPlayerEntity player && player.interactionManager.isSurvivalLike()) { return true; } - return super.isInvulnerableTo(damageSource); + return super.isInvulnerableTo(world, damageSource); } @Override diff --git a/src/main/java/xyz/nucleoid/extras/lobby/gui/TaterBoxGui.java b/src/main/java/xyz/nucleoid/extras/lobby/gui/TaterBoxGui.java index 33132e6e..3795cf3d 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/gui/TaterBoxGui.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/gui/TaterBoxGui.java @@ -18,14 +18,14 @@ import java.util.List; public class TaterBoxGui extends PagedGui.FromList { - protected static final Text SHOW_UNFOUND_TEXT = Text.translatable("text.nucleoid_extras.tater_box.show_unfound").formatted(Formatting.WHITE); - protected static final Text HIDE_UNFOUND_TEXT = Text.translatable("text.nucleoid_extras.tater_box.hide_unfound").formatted(Formatting.WHITE); + protected static final Text SHOW_UNFOUND_TEXT = Text.translatable("text.nucleoid_extras.tater_box.show_unfound"); + protected static final Text HIDE_UNFOUND_TEXT = Text.translatable("text.nucleoid_extras.tater_box.hide_unfound"); protected static final Item UNFOUND_BUTTON_ICON = Items.POISONOUS_POTATO; - protected static final Text COLLECT_ALL_TEXT = Text.translatable("text.nucleoid_extras.creative_tater_box.collect_all").formatted(Formatting.WHITE); + protected static final Text COLLECT_ALL_TEXT = Text.translatable("text.nucleoid_extras.creative_tater_box.collect_all"); protected static final Item COLLECT_ALL_ICON = Items.EMERALD; - protected static final Text RESET_TEXT = Text.translatable("text.nucleoid_extras.creative_tater_box.reset").formatted(Formatting.WHITE); + protected static final Text RESET_TEXT = Text.translatable("text.nucleoid_extras.creative_tater_box.reset"); protected static final Item RESET_ICON = Items.CAMPFIRE; private final boolean creative; @@ -86,8 +86,8 @@ public static DisplayElement hideUnfoundButton(TaterBoxGui gui) { boolean hideUnfound = gui.shouldHideUnfound(); GuiElementBuilder builder = new GuiElementBuilder(UNFOUND_BUTTON_ICON) - .setName(hideUnfound ? SHOW_UNFOUND_TEXT : HIDE_UNFOUND_TEXT) - .hideFlags() + .setItemName(hideUnfound ? SHOW_UNFOUND_TEXT : HIDE_UNFOUND_TEXT) + .hideDefaultTooltip() .setCallback((x, y, z) -> { playClickSound(gui.player); gui.toggleHideUnfound(); @@ -99,8 +99,8 @@ public static DisplayElement hideUnfoundButton(TaterBoxGui gui) { public static DisplayElement collectAllButton(TaterBoxGui gui) { GuiElementBuilder builder = new GuiElementBuilder(COLLECT_ALL_ICON) - .setName(COLLECT_ALL_TEXT) - .hideFlags() + .setItemName(COLLECT_ALL_TEXT) + .hideDefaultTooltip() .setCallback(() -> { var state = PlayerLobbyState.get(gui.getPlayer()); state.collectedTaters.addAll(TinyPotatoBlock.TATERS); @@ -114,8 +114,8 @@ public static DisplayElement collectAllButton(TaterBoxGui gui) { public static DisplayElement resetButton(TaterBoxGui gui) { GuiElementBuilder builder = new GuiElementBuilder(RESET_ICON) - .setName(RESET_TEXT) - .hideFlags() + .setItemName(RESET_TEXT) + .hideDefaultTooltip() .setCallback(() -> { var state = PlayerLobbyState.get(gui.getPlayer()); state.collectedTaters.clear(); @@ -153,7 +153,7 @@ public TaterGuiElementBuilder(Item item) { public TaterGuiElementBuilder setFound(boolean found) { this.found = found; if(!found) { - setName(NOT_FOUND_TEXT); + setItemName(NOT_FOUND_TEXT); setItem(UNFOUND_ICON); } return this; diff --git a/src/main/java/xyz/nucleoid/extras/lobby/item/GamePortalOpenerItem.java b/src/main/java/xyz/nucleoid/extras/lobby/item/GamePortalOpenerItem.java index 552be721..75e9e35e 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/item/GamePortalOpenerItem.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/item/GamePortalOpenerItem.java @@ -1,50 +1,53 @@ package xyz.nucleoid.extras.lobby.item; import eu.pb4.polymer.core.api.item.PolymerItem; -import net.fabricmc.fabric.api.util.NbtType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.nbt.NbtCompound; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.Text; +import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.Identifier; -import net.minecraft.util.TypedActionResult; import net.minecraft.world.World; -import xyz.nucleoid.plasmid.game.portal.GamePortal; -import xyz.nucleoid.plasmid.game.portal.GamePortalManager; +import xyz.nucleoid.extras.component.GamePortalComponent; +import xyz.nucleoid.extras.component.NEDataComponentTypes; +import xyz.nucleoid.packettweaker.PacketContext; +import xyz.nucleoid.plasmid.impl.portal.GamePortal; public class GamePortalOpenerItem extends Item implements PolymerItem { - private static final String GAME_PORTAL_KEY = "GamePortal"; - public GamePortalOpenerItem(Settings settings) { super(settings); } @Override - public TypedActionResult use(World world, PlayerEntity user, Hand hand) { + public ActionResult use(World world, PlayerEntity user, Hand hand) { ItemStack stack = user.getStackInHand(hand); if (!world.isClient()) { GamePortal portal = getGamePortal(stack); if (portal == null) { - return TypedActionResult.fail(stack); + return ActionResult.FAIL; } - portal.requestJoin((ServerPlayerEntity) user); + portal.requestJoin((ServerPlayerEntity) user, false); } - return TypedActionResult.success(stack, world.isClient()); + return ActionResult.SUCCESS; } @Override - public Item getPolymerItem(ItemStack stack, ServerPlayerEntity player) { + public Item getPolymerItem(ItemStack stack, PacketContext context) { GamePortal portal = getGamePortal(stack); return portal == null ? Items.CLOCK : portal.getIcon().getItem(); } + @Override + public Identifier getPolymerItemModel(ItemStack stack, PacketContext context) { + return null; + } + @Override public Text getName(ItemStack stack) { GamePortal portal = getGamePortal(stack); @@ -52,23 +55,7 @@ public Text getName(ItemStack stack) { } private static GamePortal getGamePortal(ItemStack stack) { - return GamePortalManager.INSTANCE.byId(getGamePortalId(stack)); - } - - private static Identifier getGamePortalId(ItemStack stack) { - if (stack.hasNbt()) { - NbtCompound nbt = stack.getNbt(); - - if (nbt.contains(GAME_PORTAL_KEY, NbtType.STRING)) { - String string = nbt.getString(GAME_PORTAL_KEY); - return Identifier.tryParse(string); - } - } - - return null; - } - - public static void setGamePortalId(ItemStack stack, Identifier id) { - stack.getOrCreateNbt().putString(GAME_PORTAL_KEY, id.toString()); + GamePortalComponent component = stack.get(NEDataComponentTypes.GAME_PORTAL); + return component == null ? null : component.getGamePortal(); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/item/LaunchFeatherItem.java b/src/main/java/xyz/nucleoid/extras/lobby/item/LaunchFeatherItem.java index 8325aca5..156debdf 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/item/LaunchFeatherItem.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/item/LaunchFeatherItem.java @@ -6,14 +6,15 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; +import net.minecraft.util.Identifier; +import xyz.nucleoid.extras.component.LauncherComponent; +import xyz.nucleoid.extras.component.NEDataComponentTypes; import xyz.nucleoid.extras.lobby.block.LaunchPadBlock; -import xyz.nucleoid.extras.lobby.block.LaunchPadBlockEntity; +import xyz.nucleoid.packettweaker.PacketContext; public class LaunchFeatherItem extends Item implements PolymerItem { public LaunchFeatherItem(Settings settings) { @@ -22,17 +23,9 @@ public LaunchFeatherItem(Settings settings) { @Override public ActionResult useOnEntity(ItemStack stack, PlayerEntity user, LivingEntity entity, Hand hand) { - float pitch = LaunchPadBlockEntity.DEFAULT_PITCH; - float power = LaunchPadBlockEntity.DEFAULT_POWER; + LauncherComponent launcher = stack.get(NEDataComponentTypes.LAUNCHER); - NbtCompound nbt = stack.getNbt(); - - if (nbt != null) { - pitch = nbt.getFloat(LaunchPadBlockEntity.PITCH_KEY); - power = nbt.getFloat(LaunchPadBlockEntity.POWER_KEY); - } - - if (!user.getWorld().isClient() && LaunchPadBlock.tryLaunch(entity, user, SoundEvents.ENTITY_ENDER_DRAGON_FLAP, SoundCategory.PLAYERS, pitch, power)) { + if (!user.getWorld().isClient() && LaunchPadBlock.tryLaunch(entity, user, SoundEvents.ENTITY_ENDER_DRAGON_FLAP, SoundCategory.PLAYERS, launcher)) { return ActionResult.SUCCESS; } @@ -40,12 +33,12 @@ public ActionResult useOnEntity(ItemStack stack, PlayerEntity user, LivingEntity } @Override - public boolean hasGlint(ItemStack stack) { - return true; + public Item getPolymerItem(ItemStack itemStack, PacketContext context) { + return Items.FEATHER; } @Override - public Item getPolymerItem(ItemStack stack, ServerPlayerEntity player) { - return Items.FEATHER; + public Identifier getPolymerItemModel(ItemStack stack, PacketContext context) { + return null; } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/item/LobbyBlockItem.java b/src/main/java/xyz/nucleoid/extras/lobby/item/LobbyBlockItem.java index 5f81cd54..77047a95 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/item/LobbyBlockItem.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/item/LobbyBlockItem.java @@ -2,16 +2,12 @@ import eu.pb4.polymer.core.api.item.PolymerBlockItem; import net.minecraft.block.Block; -import net.minecraft.client.item.TooltipContext; -import net.minecraft.enchantment.Enchantments; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.item.tooltip.TooltipType; import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.util.Formatting; -import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; import java.util.List; @@ -21,15 +17,8 @@ public LobbyBlockItem(Block block, Settings settings, Item virtualItem) { } @Override - public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { - super.appendTooltip(stack, world, tooltip, context); + public void appendTooltip(ItemStack stack, TooltipContext context, List tooltip, TooltipType type) { + super.appendTooltip(stack, context, tooltip, type); tooltip.add(Text.translatable("text.nucleoid_extras.lobby_items").setStyle(Style.EMPTY.withColor(Formatting.RED).withItalic(false))); } - - @Override - public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipContext context, @Nullable ServerPlayerEntity player) { - var out = super.getPolymerItemStack(itemStack, context, player); - out.addEnchantment(Enchantments.INFINITY, 1); - return out; - } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/item/LobbyHeadItem.java b/src/main/java/xyz/nucleoid/extras/lobby/item/LobbyHeadItem.java index 43943572..49e76bdb 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/item/LobbyHeadItem.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/item/LobbyHeadItem.java @@ -5,19 +5,18 @@ import eu.pb4.polymer.core.api.item.PolymerItem; import eu.pb4.polymer.core.api.utils.PolymerUtils; import net.minecraft.block.Block; -import net.minecraft.client.item.TooltipContext; +import net.minecraft.component.DataComponentTypes; import net.minecraft.item.BlockItem; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; +import net.minecraft.item.tooltip.TooltipType; import net.minecraft.screen.ScreenTexts; -import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.util.Formatting; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; +import net.minecraft.util.Identifier; +import xyz.nucleoid.packettweaker.PacketContext; import java.util.List; @@ -31,31 +30,32 @@ public LobbyHeadItem(Block block, Settings settings, String texture) { } @Override - public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity player) { + public Item getPolymerItem(ItemStack itemStack, PacketContext context) { return Items.PLAYER_HEAD; } - public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipContext tooltipContext, ServerPlayerEntity player) { - ItemStack out = PolymerItem.super.getPolymerItemStack(itemStack, tooltipContext, player); + @Override + public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipType tooltipType, PacketContext context) { + ItemStack out = PolymerItem.super.getPolymerItemStack(itemStack, tooltipType, context); if (this.texture != null) { - out.getOrCreateNbt().put("SkullOwner", PolymerUtils.createSkullOwner(this.texture)); + out.set(DataComponentTypes.PROFILE, PolymerUtils.createProfileComponent(this.texture)); } return out; } @Override - public Text getName() { - return Text.empty().append(super.getName()).append(ScreenTexts.SPACE).append(Text.translatable("text.nucleoid_extras.lobby_only")); + public Identifier getPolymerItemModel(ItemStack stack, PacketContext context) { + return null; } @Override public Text getName(ItemStack stack) { - return this.getName(); + return Text.empty().append(super.getName()).append(ScreenTexts.SPACE).append(Text.translatable("text.nucleoid_extras.lobby_only")); } @Override - public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { - super.appendTooltip(stack, world, tooltip, context); + public void appendTooltip(ItemStack stack, TooltipContext context, List tooltip, TooltipType type) { + super.appendTooltip(stack, context, tooltip, type); tooltip.add(Text.translatable("text.nucleoid_extras.lobby_items").setStyle(Style.EMPTY.withColor(Formatting.RED).withItalic(false))); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/item/QuickArmorStandItem.java b/src/main/java/xyz/nucleoid/extras/lobby/item/QuickArmorStandItem.java index 4b1b6e35..1445a640 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/item/QuickArmorStandItem.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/item/QuickArmorStandItem.java @@ -1,14 +1,13 @@ package xyz.nucleoid.extras.lobby.item; import eu.pb4.polymer.core.api.item.PolymerItem; -import net.minecraft.client.item.TooltipContext; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.SpawnReason; import net.minecraft.entity.decoration.ArmorStandEntity; import net.minecraft.item.*; +import net.minecraft.item.tooltip.TooltipType; import net.minecraft.nbt.NbtCompound; -import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; @@ -16,13 +15,14 @@ import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Formatting; +import net.minecraft.util.Identifier; import net.minecraft.util.math.*; import net.minecraft.util.math.random.Random; import net.minecraft.world.World; import net.minecraft.world.event.GameEvent; -import org.jetbrains.annotations.Nullable; import xyz.nucleoid.extras.lobby.NEEntities; import xyz.nucleoid.extras.lobby.entity.QuickArmorStandEntity; +import xyz.nucleoid.packettweaker.PacketContext; import java.util.List; @@ -57,7 +57,7 @@ public ActionResult useOnBlock(ItemUsageContext context) { Box box = NEEntities.QUICK_ARMOR_STAND.getDimensions().getBoxAt(vec3d.getX(), vec3d.getY(), vec3d.getZ()); if (world.isSpaceEmpty(box) && world.getOtherEntities(null, box).isEmpty()) { if (world instanceof ServerWorld serverWorld) { - var armorStandEntity = NEEntities.QUICK_ARMOR_STAND.spawnFromItemStack(serverWorld, itemStack, context.getPlayer(), blockPos, SpawnReason.SPAWN_EGG, true, true); + var armorStandEntity = NEEntities.QUICK_ARMOR_STAND.spawnFromItemStack(serverWorld, itemStack, context.getPlayer(), blockPos, SpawnReason.SPAWN_ITEM_USE, true, true); if (armorStandEntity == null) { return ActionResult.FAIL; } @@ -70,7 +70,7 @@ public ActionResult useOnBlock(ItemUsageContext context) { } itemStack.decrement(1); - return ActionResult.success(world.isClient); + return ActionResult.SUCCESS; } else { return ActionResult.FAIL; } @@ -90,13 +90,18 @@ private void setRotations(ArmorStandEntity stand, Random random) { } @Override - public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity player) { + public Item getPolymerItem(ItemStack itemStack, PacketContext context) { return Items.ARMOR_STAND; } @Override - public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { - super.appendTooltip(stack, world, tooltip, context); + public Identifier getPolymerItemModel(ItemStack stack, PacketContext context) { + return null; + } + + @Override + public void appendTooltip(ItemStack stack, TooltipContext context, List tooltip, TooltipType type) { + super.appendTooltip(stack, context, tooltip, type); tooltip.add(Text.translatable("text.nucleoid_extras.lobby_items").setStyle(Style.EMPTY.withColor(Formatting.RED).withItalic(false))); } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/item/RuleBookItem.java b/src/main/java/xyz/nucleoid/extras/lobby/item/RuleBookItem.java index c864f87d..1840d187 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/item/RuleBookItem.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/item/RuleBookItem.java @@ -1,39 +1,41 @@ package xyz.nucleoid.extras.lobby.item; import eu.pb4.polymer.core.api.item.PolymerItem; -import net.minecraft.client.item.TooltipContext; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.WrittenBookContentComponent; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtList; -import net.minecraft.nbt.NbtString; +import net.minecraft.item.tooltip.TooltipType; import net.minecraft.network.packet.s2c.play.OpenWrittenBookS2CPacket; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.stat.Stats; +import net.minecraft.text.RawFilteredPair; import net.minecraft.text.Text; import net.minecraft.text.Texts; +import net.minecraft.util.ActionResult; import net.minecraft.util.CachedMapper; import net.minecraft.util.Hand; -import net.minecraft.util.TypedActionResult; +import net.minecraft.util.Identifier; import net.minecraft.util.Util; import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; import xyz.nucleoid.extras.NucleoidExtrasConfig; import xyz.nucleoid.extras.RulesConfig; +import xyz.nucleoid.packettweaker.PacketContext; import xyz.nucleoid.server.translations.api.LocalizationTarget; import xyz.nucleoid.server.translations.api.language.ServerLanguage; import xyz.nucleoid.server.translations.impl.ServerTranslations; +import java.util.ArrayList; import java.util.List; public class RuleBookItem extends Item implements PolymerItem { - private static final CachedMapper ENCODED_PAGES = Util.cachedMapper(rules -> { - NbtList pages = new NbtList(); + private static final CachedMapper>> ENCODED_PAGES = Util.cachedMapper(rules -> { + List> pages = new ArrayList<>(); for (List page : rules.pages()) { Text combinedPage = Texts.join(page, Text.literal("\n")); - pages.add(NbtString.of(Text.Serialization.toJsonString(combinedPage))); + pages.add(RawFilteredPair.of(combinedPage)); } return pages; }); @@ -43,37 +45,49 @@ public RuleBookItem(Settings settings) { } @Override - public TypedActionResult use(World world, PlayerEntity user, Hand hand) { - ItemStack itemStack = user.getStackInHand(hand); + public ActionResult use(World world, PlayerEntity user, Hand hand) { if (user instanceof ServerPlayerEntity serverPlayer) { serverPlayer.networkHandler.sendPacket(new OpenWrittenBookS2CPacket(hand)); } user.incrementStat(Stats.USED.getOrCreateStat(this)); - return TypedActionResult.success(itemStack, world.isClient()); + return ActionResult.SUCCESS; } @Override - public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity player) { + public Item getPolymerItem(ItemStack itemStack, PacketContext context) { return Items.WRITTEN_BOOK; } @Override - public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipContext context, @Nullable ServerPlayerEntity player) { - LocalizationTarget localizationTarget = player != null ? LocalizationTarget.of(player) : LocalizationTarget.ofSystem(); + public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipType tooltipType, PacketContext context) { + LocalizationTarget localizationTarget = LocalizationTarget.forPacket(); ServerLanguage targetLanguage = ServerTranslations.INSTANCE.getLanguage(localizationTarget); String translationKey = getTranslationKey(); - ItemStack book = PolymerItem.super.getPolymerItemStack(itemStack, context, player); - NbtCompound nbt = book.getOrCreateNbt(); - nbt.putInt("HideFlags", nbt.getInt("HideFlags") & ~ItemStack.TooltipSection.ADDITIONAL.getFlag()); - nbt.putString("title", targetLanguage.serverTranslations().get(translationKey)); - nbt.putString("author", targetLanguage.serverTranslations().get(translationKey + ".author")); + + String title = targetLanguage.serverTranslations().get(translationKey); + String author = targetLanguage.serverTranslations().get(translationKey + ".author"); RulesConfig rules = NucleoidExtrasConfig.get().rules(); - if (rules != null) { - nbt.put("pages", ENCODED_PAGES.map(rules)); - } + + WrittenBookContentComponent component = new WrittenBookContentComponent( + RawFilteredPair.of(title), + author, + 0, + rules == null ? List.of() : ENCODED_PAGES.map(rules), + true + ); + + ItemStack book = PolymerItem.super.getPolymerItemStack(itemStack, tooltipType, context); + book.set(DataComponentTypes.WRITTEN_BOOK_CONTENT, component); + + //nbt.putInt("HideFlags", nbt.getInt("HideFlags") & ~ItemStack.TooltipSection.ADDITIONAL.getFlag()); return book; } + + @Override + public Identifier getPolymerItemModel(ItemStack stack, PacketContext context) { + return null; + } } diff --git a/src/main/java/xyz/nucleoid/extras/lobby/item/tater/TaterBoxItem.java b/src/main/java/xyz/nucleoid/extras/lobby/item/tater/TaterBoxItem.java index 84fae97b..77e9d4b0 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/item/tater/TaterBoxItem.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/item/tater/TaterBoxItem.java @@ -4,43 +4,54 @@ import eu.pb4.polymer.core.api.utils.PolymerUtils; import eu.pb4.sgui.api.elements.GuiElementInterface; import net.minecraft.block.Block; -import net.minecraft.client.item.TooltipContext; +import net.minecraft.component.DataComponentTypes; +import net.minecraft.component.type.DyedColorComponent; +import net.minecraft.component.type.EquippableComponent; +import net.minecraft.component.type.NbtComponent; +import net.minecraft.component.type.ProfileComponent; +import net.minecraft.component.type.UnbreakableComponent; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.StackReference; import net.minecraft.item.*; -import net.minecraft.nbt.NbtCompound; +import net.minecraft.item.tooltip.TooltipType; import net.minecraft.nbt.NbtElement; +import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket; import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.screen.slot.Slot; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.sound.SoundCategory; +import net.minecraft.sound.SoundEvents; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.*; import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; +import xyz.nucleoid.extras.component.NEDataComponentTypes; +import xyz.nucleoid.extras.component.TaterSelectionComponent; import xyz.nucleoid.extras.lobby.NEItems; import xyz.nucleoid.extras.lobby.PlayerLobbyState; import xyz.nucleoid.extras.lobby.block.tater.CorruptaterBlock; import xyz.nucleoid.extras.lobby.block.tater.CubicPotatoBlock; import xyz.nucleoid.extras.lobby.block.tater.TinyPotatoBlock; import xyz.nucleoid.extras.lobby.gui.TaterBoxGui; +import xyz.nucleoid.packettweaker.PacketContext; import xyz.nucleoid.server.translations.api.Localization; import java.util.*; import java.util.stream.Stream; -public class TaterBoxItem extends Item implements PolymerItem, Equipment { +public class TaterBoxItem extends Item implements PolymerItem { private static final Text NOT_OWNER_MESSAGE = Text.translatable("text.nucleoid_extras.tater_box.not_owner").formatted(Formatting.RED); public static final Text NONE_TEXT = Text.translatable("text.nucleoid_extras.tater_box.none"); private static final String LEGACY_TATERS_KEY = "Taters"; - private static final String SELECTED_TATER_KEY = "SelectedTater"; private static final int COLOR = 0xCEADAA; public TaterBoxItem(Settings settings) { - super(settings); + super(settings.component(DataComponentTypes.EQUIPPABLE, EquippableComponent.builder(EquipmentSlot.HEAD) + .equipSound(SoundEvents.ITEM_ARMOR_EQUIP_LEATHER) + .build())); } private MutableText getTitle(ServerPlayerEntity player) { @@ -52,14 +63,14 @@ private MutableText getTitle(ServerPlayerEntity player) { } @Override - public TypedActionResult use(World world, PlayerEntity user, Hand hand) { + public ActionResult use(World world, PlayerEntity user, Hand hand) { ItemStack stack = user.getStackInHand(hand); if (!user.getWorld().isClient()) { this.openTaterBox(world, (ServerPlayerEntity) user, stack, hand); } - return TypedActionResult.success(stack, world.isClient()); + return ActionResult.SUCCESS; } @Override @@ -73,20 +84,27 @@ public boolean onClicked(ItemStack stack, ItemStack otherStack, Slot slot, Click } private void openTaterBox(World world, ServerPlayerEntity user, ItemStack stack, Hand hand) { - if (NEItems.canUseTaters(user)) { - if (stack.hasNbt() && stack.getNbt().contains(LEGACY_TATERS_KEY)) { - var data = PlayerLobbyState.get(user); + if (NEItems.canUseTaters(user) && stack.contains(NEDataComponentTypes.TATER_SELECTION)) { + stack.apply(DataComponentTypes.CUSTOM_DATA, NbtComponent.DEFAULT, customData -> { + if (!customData.contains(LEGACY_TATERS_KEY)) { + return customData; + } + + return customData.apply(nbt -> { + var data = PlayerLobbyState.get(user); - for (var nbt : stack.getNbt().getList(LEGACY_TATERS_KEY, NbtElement.STRING_TYPE)) { - var block = Registries.BLOCK.get(Identifier.tryParse(nbt.asString())); + for (var entry : nbt.getList(LEGACY_TATERS_KEY, NbtElement.STRING_TYPE)) { + var block = Registries.BLOCK.get(Identifier.tryParse(entry.asString())); - if (block instanceof TinyPotatoBlock tinyPotatoBlock) { - data.collectedTaters.add(tinyPotatoBlock); + if (block instanceof TinyPotatoBlock tinyPotatoBlock) { + data.collectedTaters.add(tinyPotatoBlock); + } } - } - stack.getNbt().remove(LEGACY_TATERS_KEY); - user.sendMessage(Text.translatable("text.nucleoid_extras.tater_box.updated")); - } + + nbt.remove(LEGACY_TATERS_KEY); + user.sendMessage(Text.translatable("text.nucleoid_extras.tater_box.updated")); + }); + }); var state = PlayerLobbyState.get(user); List taters = new ArrayList<>(); @@ -97,7 +115,7 @@ private void openTaterBox(World world, ServerPlayerEntity user, ItemStack stack, .map(tater -> { boolean found = state.collectedTaters.contains(tater); - return createGuiElement(stack, user, hand, tater, tater.getName(), Registries.BLOCK.getId(tater), found); + return createGuiElement(stack, user, hand, tater, tater.getName(), tater.getRegistryEntry(), found); }) .forEachOrdered(taters::add); @@ -106,23 +124,34 @@ private void openTaterBox(World world, ServerPlayerEntity user, ItemStack stack, ui.setTitle(this.getTitle(user)); ui.open(); - user.playSound(this.getEquipSound(), SoundCategory.PLAYERS, 0.8f, 1); + EquippableComponent equippable = stack.get(DataComponentTypes.EQUIPPABLE); + + if (equippable != null) { + user.networkHandler.sendPacket(new PlaySoundS2CPacket(equippable.equipSound(), SoundCategory.PLAYERS, user.getX(), user.getY(), user.getZ(), 0.8f, 1, user.getRandom().nextLong())); + } } } - private TaterBoxGui.TaterGuiElement createGuiElement(ItemStack stack, PlayerEntity user, Hand hand, ItemConvertible icon, Text text, Identifier taterId, boolean found) { + private TaterBoxGui.TaterGuiElement createGuiElement(ItemStack stack, PlayerEntity user, Hand hand, ItemConvertible icon, Text text, RegistryEntry tater, boolean found) { var guiElementBuilder = new TaterBoxGui.TaterGuiElementBuilder(icon.asItem()); guiElementBuilder.setName(text); + guiElementBuilder.setRarity(Rarity.COMMON); guiElementBuilder.setFound(found); - guiElementBuilder.hideFlags(); + guiElementBuilder.hideDefaultTooltip(); guiElementBuilder.setCallback((index, type, action, gui) -> { ItemStack newStack = hand == null ? stack : user.getStackInHand(hand); if (found && this == newStack.getItem()) { - TaterBoxItem.setSelectedTater(newStack, taterId); + newStack.apply(NEDataComponentTypes.TATER_SELECTION, TaterSelectionComponent.DEFAULT, taterSelection -> taterSelection.selected(tater)); gui.close(); } }); - if(Objects.equals(getSelectedTaterId(stack), taterId)) guiElementBuilder.glow(); + + TaterSelectionComponent taterSelection = stack.getOrDefault(NEDataComponentTypes.TATER_SELECTION, TaterSelectionComponent.DEFAULT); + + if (Optional.ofNullable(tater).equals(taterSelection.tater())) { + guiElementBuilder.glow(); + } + return guiElementBuilder.build(); } @@ -138,8 +167,8 @@ protected boolean isCreative() { } @Override - public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity player) { - if (TaterBoxItem.getSelectedTater(itemStack) != null) { + public Item getPolymerItem(ItemStack itemStack, PacketContext context) { + if (itemStack.getOrDefault(NEDataComponentTypes.TATER_SELECTION, TaterSelectionComponent.DEFAULT).tater().isPresent()) { return Items.PLAYER_HEAD; } else { return Items.LEATHER_HELMET; @@ -147,75 +176,51 @@ public Item getPolymerItem(ItemStack itemStack, @Nullable ServerPlayerEntity pla } @Override - public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipContext context, @Nullable ServerPlayerEntity player) { - ItemStack out = PolymerItem.super.getPolymerItemStack(itemStack, context, player); + public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipType tooltipType, PacketContext context) { + ItemStack out = PolymerItem.super.getPolymerItemStack(itemStack, tooltipType, context); - Block selectedTater = TaterBoxItem.getSelectedTater(itemStack); - if (selectedTater instanceof TinyPotatoBlock potatoBlock) { - NbtCompound skullOwner = PolymerUtils.createSkullOwner(potatoBlock.getItemTexture()); - out.getOrCreateNbt().put(PlayerHeadItem.SKULL_OWNER_KEY, skullOwner); + Optional> selectedTater = itemStack.getOrDefault(NEDataComponentTypes.TATER_SELECTION, TaterSelectionComponent.DEFAULT).tater(); + if (selectedTater.isPresent() && selectedTater.get().value() instanceof TinyPotatoBlock potatoBlock) { + ProfileComponent profile = PolymerUtils.createProfileComponent(potatoBlock.getItemTexture()); + out.set(DataComponentTypes.PROFILE, profile); } else { - out.getOrCreateSubNbt(DyeableItem.DISPLAY_KEY).putInt(DyeableItem.COLOR_KEY, this.getEmptyColor()); - out.getOrCreateNbt().putBoolean("Unbreakable", true); + out.set(DataComponentTypes.DYED_COLOR, new DyedColorComponent(this.getEmptyColor(), false)); + out.set(DataComponentTypes.UNBREAKABLE, new UnbreakableComponent(false)); + out.set(DataComponentTypes.EQUIPPABLE, Items.LEATHER_HELMET.getComponents().get(DataComponentTypes.EQUIPPABLE)); } return out; } @Override - public EquipmentSlot getSlotType() { - return EquipmentSlot.HEAD; + public Identifier getPolymerItemModel(ItemStack stack, PacketContext context) { + return null; } @Override - public void appendTooltip(ItemStack stack, World world, List tooltip, TooltipContext context) { - super.appendTooltip(stack, world, tooltip, context); + public void appendTooltip(ItemStack stack, TooltipContext context, List tooltip, TooltipType type) { + super.appendTooltip(stack, context, tooltip, type); - var owner = PolymerUtils.getPlayerContext(); + var owner = PacketContext.get(); - Block selectedBlock = getSelectedTater(stack); + Optional> selectedBlock = stack.getOrDefault(NEDataComponentTypes.TATER_SELECTION, TaterSelectionComponent.DEFAULT).tater(); Text selectedName; - if (selectedBlock != null) { - selectedName = selectedBlock.getName(); + if (selectedBlock.isPresent()) { + selectedName = selectedBlock.get().value().getName(); } else { selectedName = NONE_TEXT; } tooltip.add(Text.translatable("text.nucleoid_extras.tater_box.selected", selectedName).formatted(Formatting.GRAY)); - int count = owner != null ? PlayerLobbyState.get(owner).collectedTaters.size() : 0; + int count = owner != null && owner.getPlayer() != null ? PlayerLobbyState.get(owner.getPlayer()).collectedTaters.size() : 0; int max = CubicPotatoBlock.TATERS.size(); String percent = String.format("%.2f", count / (double) max * 100); tooltip.add(Text.translatable("text.nucleoid_extras.tater_box.completion", count, max, percent).formatted(Formatting.GRAY)); } - @Nullable - public static Identifier getSelectedTaterId(ItemStack stack) { - NbtCompound tag = stack.getNbt(); - if (tag == null || !tag.contains(SELECTED_TATER_KEY)) return null; - - return Identifier.tryParse(tag.getString(SELECTED_TATER_KEY)); - } - - @Nullable - public static Block getSelectedTater(ItemStack stack) { - Identifier id = getSelectedTaterId(stack); - if(id == null) return null; - - return Registries.BLOCK.get(id); - } - - public static void setSelectedTater(ItemStack stack, @Nullable Identifier selectedTaterId) { - NbtCompound tag = stack.getOrCreateNbt(); - if(selectedTaterId == null) { - tag.remove(SELECTED_TATER_KEY); - } else { - tag.putString(SELECTED_TATER_KEY, selectedTaterId.toString()); - } - } - public static Stream getSortedTaterStream(ServerPlayerEntity player) { return TinyPotatoBlock.TATERS.stream() .sorted(Comparator.comparing(tater -> { diff --git a/src/main/java/xyz/nucleoid/extras/lobby/item/tater/TaterGuidebookItem.java b/src/main/java/xyz/nucleoid/extras/lobby/item/tater/TaterGuidebookItem.java index 48a35e37..ff08fecd 100644 --- a/src/main/java/xyz/nucleoid/extras/lobby/item/tater/TaterGuidebookItem.java +++ b/src/main/java/xyz/nucleoid/extras/lobby/item/tater/TaterGuidebookItem.java @@ -13,10 +13,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.nbt.NbtElement; -import net.minecraft.nbt.NbtHelper; -import net.minecraft.nbt.NbtList; -import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.screen.ScreenTexts; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.ClickEvent; @@ -24,15 +21,18 @@ import net.minecraft.text.Style; import net.minecraft.text.Text; import net.minecraft.text.Texts; +import net.minecraft.util.ActionResult; import net.minecraft.util.Formatting; import net.minecraft.util.Hand; import net.minecraft.util.Identifier; -import net.minecraft.util.TypedActionResult; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; +import xyz.nucleoid.extras.component.NEDataComponentTypes; +import xyz.nucleoid.extras.component.TaterPositionsComponent; import xyz.nucleoid.extras.lobby.block.tater.TinyPotatoBlock; -import xyz.nucleoid.extras.mixin.lobby.ThreadedAnvilChunkStorageAccessor; +import xyz.nucleoid.extras.mixin.lobby.ServerChunkLoadingManagerAccessor; +import xyz.nucleoid.packettweaker.PacketContext; public class TaterGuidebookItem extends Item implements PolymerItem { private static final Text MISSING_SYMBOL = Text.literal("❌").formatted(Formatting.RED); @@ -41,44 +41,49 @@ public class TaterGuidebookItem extends Item implements PolymerItem { private static final int RECORD_COOLDOWN = 2 * SharedConstants.TICKS_PER_SECOND; - private static final String TATER_POSITIONS_KEY = "tater_positions"; - public TaterGuidebookItem(Settings settings) { super(settings); } @Override - public TypedActionResult use(World world, PlayerEntity user, Hand hand) { + public ActionResult use(World world, PlayerEntity user, Hand hand) { var stack = user.getStackInHand(hand); if (!world.isClient() && user.isCreativeLevelTwoOp()) { var player = (ServerPlayerEntity) user; - var taterPositionMap = getTaterPositions(stack); + var taterPositionMap = stack.get(NEDataComponentTypes.TATER_POSITIONS); - if (user.isSneaking()) { - recordToGuidebook(player, taterPositionMap, stack); - } else { - showGuidebook(player, taterPositionMap, stack); - } + if (taterPositionMap != null) { + if (user.isSneaking()) { + recordToGuidebook(player, HashMultimap.create(taterPositionMap.positions()), stack); + } else { + showGuidebook(player, taterPositionMap.positions(), stack); + } - return TypedActionResult.success(stack, world.isClient()); + return ActionResult.SUCCESS; + } } - return TypedActionResult.pass(stack); + return ActionResult.PASS; } @Override - public Item getPolymerItem(ItemStack stack, ServerPlayerEntity player) { + public Item getPolymerItem(ItemStack stack, PacketContext context) { return Items.WRITTEN_BOOK; } - private static void recordToGuidebook(ServerPlayerEntity player, SetMultimap taterPositions, ItemStack stack) { + @Override + public Identifier getPolymerItemModel(ItemStack stack, PacketContext context) { + return null; + } + + private static void recordToGuidebook(ServerPlayerEntity player, SetMultimap, BlockPos> taterPositions, ItemStack stack) { int initialCount = taterPositions.size(); var chunkManager = player.getServerWorld().getChunkManager(); - var chunkStorage = chunkManager.threadedAnvilChunkStorage; - var accessor = (ThreadedAnvilChunkStorageAccessor) (Object) chunkStorage; + var chunkStorage = chunkManager.chunkLoadingManager; + var accessor = (ServerChunkLoadingManagerAccessor) (Object) chunkStorage; for (var holder : accessor.callEntryIterator()) { var chunk = holder.getWorldChunk(); @@ -88,23 +93,23 @@ private static void recordToGuidebook(ServerPlayerEntity player, SetMultimap taterPositions) { + private static void recordChunk(Chunk chunk, SetMultimap, BlockPos> taterPositions) { chunk.forEachBlockMatchingPredicate(state -> { return state.getBlock() instanceof TinyPotatoBlock; }, (pos, state) -> { - taterPositions.put(state.getBlock().asItem(), pos.toImmutable()); + taterPositions.put(state.getBlock().asItem().getRegistryEntry(), pos.toImmutable()); }); } - private static void showGuidebook(ServerPlayerEntity player, SetMultimap taterPositionMap, ItemStack stack) { + private static void showGuidebook(ServerPlayerEntity player, SetMultimap, BlockPos> taterPositionMap, ItemStack stack) { var builder = new BookElementBuilder(); var taters = TaterBoxItem.getSortedTaterStream(player).iterator(); @@ -127,7 +132,7 @@ private static void showGuidebook(ServerPlayerEntity player, SetMultimap positions) { }; } - private static HoverEvent getHoverEvent(Item tater, Set positions) { - var hoverText = tater.getName().copy(); + private static HoverEvent getHoverEvent(RegistryEntry tater, Set positions) { + var hoverText = tater.value().getName().copy(); for (var pos : positions) { hoverText.append(ScreenTexts.LINE_BREAK); @@ -172,49 +177,11 @@ private static HoverEvent getHoverEvent(Item tater, Set positions) { return new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverText); } - private static ClickEvent getClickEvent(Item tater, Set positions) { + private static ClickEvent getClickEvent(RegistryEntry tater, Set positions) { if (positions.isEmpty()) return null; var pos = positions.iterator().next(); var command = "/tp @s " + pos.getX() + " " + pos.getY() + " " + pos.getZ(); return new ClickEvent(ClickEvent.Action.RUN_COMMAND, command); } - - private static SetMultimap getTaterPositions(ItemStack stack) { - var map = HashMultimap.create(); - var nbt = stack.getSubNbt(TATER_POSITIONS_KEY); - - if (nbt != null) { - for (var key : nbt.getKeys()) { - var id = Identifier.tryParse(key); - if (id == null) continue; - - var item = Registries.ITEM.get(id); - if (item == null) continue; - - var list = nbt.getList(key, NbtElement.COMPOUND_TYPE); - - for (int index = 0; index < list.size(); index++) { - var pos = list.getCompound(index); - map.put(item, NbtHelper.toBlockPos(pos)); - } - } - } - - return map; - } - - private static void setTaterPositions(ItemStack stack, SetMultimap taterPositions) { - var nbt = stack.getOrCreateSubNbt(TATER_POSITIONS_KEY); - - taterPositions.asMap().forEach((item, positions) -> { - var list = new NbtList(); - - for (var pos : positions) { - list.add(NbtHelper.fromBlockPos(pos)); - } - - nbt.put(Registries.ITEM.getId(item).toString(), list); - }); - } } diff --git a/src/main/java/xyz/nucleoid/extras/mixin/MinecraftServerMixin.java b/src/main/java/xyz/nucleoid/extras/mixin/MinecraftServerMixin.java index cf3d456e..be382251 100644 --- a/src/main/java/xyz/nucleoid/extras/mixin/MinecraftServerMixin.java +++ b/src/main/java/xyz/nucleoid/extras/mixin/MinecraftServerMixin.java @@ -3,8 +3,10 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import net.minecraft.server.MinecraftServer; +import net.minecraft.util.Util; import net.minecraft.util.crash.CrashReport; -import net.minecraft.util.profiler.PerformanceLog; +import net.minecraft.util.profiler.MultiValueDebugSampleLogImpl; +import net.minecraft.util.profiler.log.MultiValueDebugSampleLog; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; @@ -18,7 +20,7 @@ @Mixin(MinecraftServer.class) public class MinecraftServerMixin implements HasTickPerformanceLog { @Unique - private final PerformanceLog extras$tickPerformanceLog = new PerformanceLog(); + private final MultiValueDebugSampleLogImpl extras$tickPerformanceLog = new MultiValueDebugSampleLogImpl(1); @ModifyArg( method = "runServer", @@ -33,15 +35,15 @@ public class MinecraftServerMixin implements HasTickPerformanceLog { } @Inject( - method = "tickTickLog", + method = "pushTickLog", at = @At(value = "HEAD") ) - public void pushTickPerformanceLog(long nanos, CallbackInfo ci) { - this.extras$tickPerformanceLog.push(nanos); + public void pushTickPerformanceLog(long tickStartTime, CallbackInfo ci) { + this.extras$tickPerformanceLog.push(Util.getMeasuringTimeNano() - tickStartTime); } @Override - public PerformanceLog getTickPerformanceLog() { + public MultiValueDebugSampleLog getTickPerformanceLog() { return this.extras$tickPerformanceLog; } } diff --git a/src/main/java/xyz/nucleoid/extras/mixin/lobby/ThreadedAnvilChunkStorageAccessor.java b/src/main/java/xyz/nucleoid/extras/mixin/lobby/ServerChunkLoadingManagerAccessor.java similarity index 62% rename from src/main/java/xyz/nucleoid/extras/mixin/lobby/ThreadedAnvilChunkStorageAccessor.java rename to src/main/java/xyz/nucleoid/extras/mixin/lobby/ServerChunkLoadingManagerAccessor.java index a1633039..00076d66 100644 --- a/src/main/java/xyz/nucleoid/extras/mixin/lobby/ThreadedAnvilChunkStorageAccessor.java +++ b/src/main/java/xyz/nucleoid/extras/mixin/lobby/ServerChunkLoadingManagerAccessor.java @@ -4,10 +4,10 @@ import org.spongepowered.asm.mixin.gen.Invoker; import net.minecraft.server.world.ChunkHolder; -import net.minecraft.server.world.ThreadedAnvilChunkStorage; +import net.minecraft.server.world.ServerChunkLoadingManager; -@Mixin(ThreadedAnvilChunkStorage.class) -public interface ThreadedAnvilChunkStorageAccessor { +@Mixin(ServerChunkLoadingManager.class) +public interface ServerChunkLoadingManagerAccessor { @Invoker("entryIterator") Iterable callEntryIterator(); } diff --git a/src/main/java/xyz/nucleoid/extras/mixin/lobby/ServerPlayerEntityMixin.java b/src/main/java/xyz/nucleoid/extras/mixin/lobby/ServerPlayerEntityMixin.java index 1c7546ec..20cdc984 100644 --- a/src/main/java/xyz/nucleoid/extras/mixin/lobby/ServerPlayerEntityMixin.java +++ b/src/main/java/xyz/nucleoid/extras/mixin/lobby/ServerPlayerEntityMixin.java @@ -11,10 +11,11 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import xyz.nucleoid.extras.component.NEDataComponentTypes; +import xyz.nucleoid.extras.component.TaterSelectionComponent; import xyz.nucleoid.extras.lobby.NECriteria; import xyz.nucleoid.extras.lobby.PlayerLobbyState; import xyz.nucleoid.extras.lobby.block.tater.CubicPotatoBlock; -import xyz.nucleoid.extras.lobby.item.tater.TaterBoxItem; @Mixin(ServerPlayerEntity.class) public abstract class ServerPlayerEntityMixin extends PlayerEntity { @@ -25,14 +26,14 @@ public ServerPlayerEntityMixin(World world, BlockPos pos, float yaw, GameProfile @Inject(method = "playerTick", at = @At("TAIL")) private void extras$playerTick(CallbackInfo ci) { ItemStack helmet = this.getEquippedStack(EquipmentSlot.HEAD); - if (helmet.getItem() instanceof TaterBoxItem) { - if (TaterBoxItem.getSelectedTater(helmet) instanceof CubicPotatoBlock tinyPotatoBlock) { - ServerPlayerEntity player = (ServerPlayerEntity) (Object) this; - NECriteria.WEAR_TATER.trigger(player, tinyPotatoBlock); - NECriteria.TATER_COLLECTED.trigger(player, tinyPotatoBlock, PlayerLobbyState.get(this).collectedTaters.size()); - if (this.age % tinyPotatoBlock.getPlayerParticleRate(player) == 0) { - tinyPotatoBlock.spawnPlayerParticles(player); - } + TaterSelectionComponent taterSelection = helmet.getOrDefault(NEDataComponentTypes.TATER_SELECTION, TaterSelectionComponent.DEFAULT); + + if (taterSelection.tater().isPresent() && taterSelection.tater().get().value() instanceof CubicPotatoBlock tinyPotatoBlock) { + ServerPlayerEntity player = (ServerPlayerEntity) (Object) this; + NECriteria.WEAR_TATER.trigger(player, tinyPotatoBlock); + NECriteria.TATER_COLLECTED.trigger(player, tinyPotatoBlock, PlayerLobbyState.get(this).collectedTaters.size()); + if (this.age % tinyPotatoBlock.getPlayerParticleRate(player) == 0) { + tinyPotatoBlock.spawnPlayerParticles(player); } } } diff --git a/src/main/java/xyz/nucleoid/extras/mixin/lobby/WorldChunkMixin.java b/src/main/java/xyz/nucleoid/extras/mixin/lobby/WorldChunkMixin.java new file mode 100644 index 00000000..95ddae51 --- /dev/null +++ b/src/main/java/xyz/nucleoid/extras/mixin/lobby/WorldChunkMixin.java @@ -0,0 +1,21 @@ +package xyz.nucleoid.extras.mixin.lobby; + +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.block.entity.BlockEntity; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.world.chunk.WorldChunk; +import xyz.nucleoid.extras.lobby.block.ContributorStatueBlockEntity; + +@Mixin(WorldChunk.class) +public class WorldChunkMixin { + @Inject(method = "updateGameEventListener", at = @At("TAIL")) + private void callMethod(BlockEntity blockEntity, ServerWorld world, CallbackInfo ci) { + if (blockEntity instanceof ContributorStatueBlockEntity contributorStatue) { + contributorStatue.attachElementHolder((WorldChunk) (Object) this); + } + } +} diff --git a/src/main/java/xyz/nucleoid/extras/mixin/patches/EntityMixin.java b/src/main/java/xyz/nucleoid/extras/mixin/patches/EntityMixin.java index 3e821ba0..02b688d9 100644 --- a/src/main/java/xyz/nucleoid/extras/mixin/patches/EntityMixin.java +++ b/src/main/java/xyz/nucleoid/extras/mixin/patches/EntityMixin.java @@ -17,7 +17,7 @@ public class EntityMixin { /* * This fixes fireworks shoot by creative players breaking invulnerable entities */ - @Inject(method = "isInvulnerableTo", at = @At("HEAD"), cancellable = true) + @Inject(method = "isAlwaysInvulnerableTo", at = @At("HEAD"), cancellable = true) private void extras$makeExceptionForExplosions(DamageSource damageSource, CallbackInfoReturnable cir) { if (this.invulnerable && damageSource.isIn(DamageTypeTags.IS_EXPLOSION)) { cir.setReturnValue(true); diff --git a/src/main/java/xyz/nucleoid/extras/mixin/player_list/ServerWorldMixin.java b/src/main/java/xyz/nucleoid/extras/mixin/player_list/ServerWorldMixin.java index f2257221..904a532d 100644 --- a/src/main/java/xyz/nucleoid/extras/mixin/player_list/ServerWorldMixin.java +++ b/src/main/java/xyz/nucleoid/extras/mixin/player_list/ServerWorldMixin.java @@ -6,7 +6,6 @@ import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.profiler.Profiler; import net.minecraft.world.MutableWorldProperties; import net.minecraft.world.World; import net.minecraft.world.dimension.DimensionType; @@ -16,12 +15,10 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import xyz.nucleoid.extras.player_list.PlayerListHelper; -import java.util.function.Supplier; - @Mixin(ServerWorld.class) public abstract class ServerWorldMixin extends World { - protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey registryRef, DynamicRegistryManager registryManager, RegistryEntry dimension, Supplier profiler, boolean isClient, boolean debugWorld, long seed, int maxChainedNeighborUpdates) { - super(properties, registryRef, registryManager, dimension, profiler, isClient, debugWorld, seed, maxChainedNeighborUpdates); + protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey registryRef, DynamicRegistryManager registryManager, RegistryEntry dimension, boolean isClient, boolean debugWorld, long seed, int maxChainedNeighborUpdates) { + super(properties, registryRef, registryManager, dimension, isClient, debugWorld, seed, maxChainedNeighborUpdates); } @Inject(method = "addPlayer", at = @At("RETURN")) diff --git a/src/main/java/xyz/nucleoid/extras/mixin/sidebar/ServerWorldMixin.java b/src/main/java/xyz/nucleoid/extras/mixin/sidebar/ServerWorldMixin.java index c06452f2..55b82bed 100644 --- a/src/main/java/xyz/nucleoid/extras/mixin/sidebar/ServerWorldMixin.java +++ b/src/main/java/xyz/nucleoid/extras/mixin/sidebar/ServerWorldMixin.java @@ -6,7 +6,6 @@ import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.profiler.Profiler; import net.minecraft.world.MutableWorldProperties; import net.minecraft.world.World; import net.minecraft.world.dimension.DimensionType; @@ -16,12 +15,10 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import xyz.nucleoid.extras.sidebar.NucleoidSidebar; -import java.util.function.Supplier; - @Mixin(ServerWorld.class) public abstract class ServerWorldMixin extends World { - protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey registryRef, DynamicRegistryManager registryManager, RegistryEntry dimension, Supplier profiler, boolean isClient, boolean debugWorld, long seed, int maxChainedNeighborUpdates) { - super(properties, registryRef, registryManager, dimension, profiler, isClient, debugWorld, seed, maxChainedNeighborUpdates); + protected ServerWorldMixin(MutableWorldProperties properties, RegistryKey registryRef, DynamicRegistryManager registryManager, RegistryEntry dimension, boolean isClient, boolean debugWorld, long seed, int maxChainedNeighborUpdates) { + super(properties, registryRef, registryManager, dimension, isClient, debugWorld, seed, maxChainedNeighborUpdates); } @Inject(method = "addPlayer", at = @At("RETURN")) diff --git a/src/main/java/xyz/nucleoid/extras/network/BungeeCordPayload.java b/src/main/java/xyz/nucleoid/extras/network/BungeeCordPayload.java new file mode 100644 index 00000000..58fb8a53 --- /dev/null +++ b/src/main/java/xyz/nucleoid/extras/network/BungeeCordPayload.java @@ -0,0 +1,26 @@ +package xyz.nucleoid.extras.network; + +import io.netty.buffer.ByteBuf; +import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; +import net.minecraft.network.codec.PacketCodec; +import net.minecraft.network.packet.CustomPayload; +import net.minecraft.util.Identifier; + +public record BungeeCordPayload(ByteBuf data) implements CustomPayload { + public static final CustomPayload.Id ID = new CustomPayload.Id<>(Identifier.of("bungeecord", "main")); + + public static final PacketCodec PACKET_CODEC = PacketCodec.of(BungeeCordPayload::write, BungeeCordPayload::read); + + private void write(ByteBuf buf) { + return; + } + + @Override + public CustomPayload.Id getId() { + return ID; + } + + private static BungeeCordPayload read(ByteBuf buf) { + return new BungeeCordPayload(PacketByteBufs.create()); + } +} diff --git a/src/main/java/xyz/nucleoid/extras/network/NucleoidExtrasNetworking.java b/src/main/java/xyz/nucleoid/extras/network/NucleoidExtrasNetworking.java new file mode 100644 index 00000000..4a09f6fa --- /dev/null +++ b/src/main/java/xyz/nucleoid/extras/network/NucleoidExtrasNetworking.java @@ -0,0 +1,17 @@ +package xyz.nucleoid.extras.network; + +import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry; +import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; +import xyz.nucleoid.extras.game_portal.ServerChangePortalBackend; + +public final class NucleoidExtrasNetworking { + private NucleoidExtrasNetworking() { + } + + public static void register() { + PayloadTypeRegistry.playC2S().register(BungeeCordPayload.ID, BungeeCordPayload.PACKET_CODEC); + PayloadTypeRegistry.playS2C().register(BungeeCordPayload.ID, BungeeCordPayload.PACKET_CODEC); + + ServerPlayNetworking.registerGlobalReceiver(BungeeCordPayload.ID, ServerChangePortalBackend::handlePacket); + } +} diff --git a/src/main/java/xyz/nucleoid/extras/placeholder/ExtraPlaceholders.java b/src/main/java/xyz/nucleoid/extras/placeholder/ExtraPlaceholders.java index 652c132d..f807f7e8 100644 --- a/src/main/java/xyz/nucleoid/extras/placeholder/ExtraPlaceholders.java +++ b/src/main/java/xyz/nucleoid/extras/placeholder/ExtraPlaceholders.java @@ -7,7 +7,7 @@ import net.minecraft.text.Text; import org.jetbrains.annotations.Nullable; import xyz.nucleoid.extras.NucleoidExtras; -import xyz.nucleoid.plasmid.game.manager.GameSpaceManager; +import xyz.nucleoid.plasmid.api.game.GameSpaceManager; public class ExtraPlaceholders { public static void register() { diff --git a/src/main/java/xyz/nucleoid/extras/placeholder/GameTextContent.java b/src/main/java/xyz/nucleoid/extras/placeholder/GameTextContent.java index fb3b3fbf..3892cf5f 100644 --- a/src/main/java/xyz/nucleoid/extras/placeholder/GameTextContent.java +++ b/src/main/java/xyz/nucleoid/extras/placeholder/GameTextContent.java @@ -4,9 +4,9 @@ import net.minecraft.screen.ScreenTexts; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.*; +import xyz.nucleoid.plasmid.api.game.GameSpace; +import xyz.nucleoid.plasmid.api.game.GameSpaceManager; import org.jetbrains.annotations.Nullable; -import xyz.nucleoid.plasmid.game.GameSpace; -import xyz.nucleoid.plasmid.game.manager.GameSpaceManager; import java.util.stream.Stream; @@ -32,7 +32,7 @@ public Text toVanilla(@Nullable ServerPlayerEntity player, Text text) { .withColor( TextColor.fromRgb(gameSpace == null ? 0x800080 : (int) (gameSpace.getMetadata().id().getLeastSignificantBits() & 0xFFFFFF))) .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, - gameSpace == null ? Text.literal("Lobby") : gameSpace.getMetadata().sourceConfig().name()))) + gameSpace == null ? Text.literal("Lobby") : gameSpace.getMetadata().sourceConfig().value().name()))) ).append(ScreenTexts.SPACE); out.getSiblings().addAll(text.getSiblings()); diff --git a/src/main/java/xyz/nucleoid/extras/player_list/PlayerListHelper.java b/src/main/java/xyz/nucleoid/extras/player_list/PlayerListHelper.java index 6a1ef3cf..5cfbc989 100644 --- a/src/main/java/xyz/nucleoid/extras/player_list/PlayerListHelper.java +++ b/src/main/java/xyz/nucleoid/extras/player_list/PlayerListHelper.java @@ -9,7 +9,7 @@ import net.minecraft.util.Nullables; import net.minecraft.world.GameMode; import org.jetbrains.annotations.Nullable; -import xyz.nucleoid.plasmid.game.manager.GameSpaceManager; +import xyz.nucleoid.plasmid.api.game.GameSpaceManager; import java.util.ArrayList; import java.util.EnumSet; @@ -37,6 +37,7 @@ public static PlayerListS2CPacket.Entry createEntry(ServerPlayerEntity player, player.networkHandler.getLatency(), getGameMode(player, gray), getDisplayName(player, gray), + player.getPlayerListOrder(), getSession(player) ); } diff --git a/src/main/java/xyz/nucleoid/extras/scheduled_stop/ScheduledStop.java b/src/main/java/xyz/nucleoid/extras/scheduled_stop/ScheduledStop.java index 6e5bc12d..29a3e173 100644 --- a/src/main/java/xyz/nucleoid/extras/scheduled_stop/ScheduledStop.java +++ b/src/main/java/xyz/nucleoid/extras/scheduled_stop/ScheduledStop.java @@ -5,16 +5,17 @@ import com.mojang.brigadier.context.CommandContext; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.MinecraftServer; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.text.Text; import net.minecraft.util.Formatting; -import xyz.nucleoid.plasmid.event.GameEvents; -import xyz.nucleoid.plasmid.game.GameCloseReason; -import xyz.nucleoid.plasmid.game.GameOpenException; -import xyz.nucleoid.plasmid.game.GameSpace; -import xyz.nucleoid.plasmid.game.config.GameConfig; -import xyz.nucleoid.plasmid.game.manager.GameSpaceManager; +import xyz.nucleoid.plasmid.api.event.GameEvents; +import xyz.nucleoid.plasmid.api.game.GameCloseReason; +import xyz.nucleoid.plasmid.api.game.GameOpenException; +import xyz.nucleoid.plasmid.api.game.GameSpace; +import xyz.nucleoid.plasmid.api.game.GameSpaceManager; +import xyz.nucleoid.plasmid.api.game.config.GameConfig; import java.util.ArrayList; @@ -103,7 +104,7 @@ private static boolean isReadyToStop(MinecraftServer server) { return true; } - private static void openGame(GameConfig config, GameSpace gameSpace) { + private static void openGame(RegistryEntry> game, GameSpace gameSpace) { if (stopScheduled) { throw new GameOpenException(Text.translatable("nucleoid.stop.game.open")); } diff --git a/src/main/java/xyz/nucleoid/extras/sidebar/NucleoidSidebar.java b/src/main/java/xyz/nucleoid/extras/sidebar/NucleoidSidebar.java index 6a0853cb..48045fa4 100644 --- a/src/main/java/xyz/nucleoid/extras/sidebar/NucleoidSidebar.java +++ b/src/main/java/xyz/nucleoid/extras/sidebar/NucleoidSidebar.java @@ -11,8 +11,8 @@ import net.minecraft.util.Formatting; import net.minecraft.world.World; import xyz.nucleoid.extras.NucleoidExtrasConfig; -import xyz.nucleoid.plasmid.game.manager.GameSpaceManager; -import xyz.nucleoid.plasmid.game.manager.ManagedGameSpace; +import xyz.nucleoid.plasmid.api.game.GameSpaceManager; +import xyz.nucleoid.plasmid.impl.game.manager.ManagedGameSpace; import java.util.ArrayList; import java.util.Collection; @@ -150,7 +150,7 @@ private void writeGamesToSidebar(LineBuilder builder, Collection { - var name = game.getMetadata().sourceConfig().shortName(); + var name = game.getMetadata().sourceConfig().value().shortName(); int players = game.getPlayers().size(); var playersText = Text.translatable("nucleoid.sidebar.game.player." + (players < 2 ? "1" : "more"), players).setStyle(GAME_COUNT_STYLE); diff --git a/src/main/java/xyz/nucleoid/extras/util/CommonGuiElements.java b/src/main/java/xyz/nucleoid/extras/util/CommonGuiElements.java index 47d07580..d828529f 100644 --- a/src/main/java/xyz/nucleoid/extras/util/CommonGuiElements.java +++ b/src/main/java/xyz/nucleoid/extras/util/CommonGuiElements.java @@ -5,30 +5,32 @@ import net.minecraft.item.Items; import net.minecraft.screen.ScreenTexts; import net.minecraft.text.Text; -import net.minecraft.util.Formatting; public class CommonGuiElements { - private static final GuiElement PURPLE_PLATE = new GuiElementBuilder(Items.PURPLE_STAINED_GLASS_PANE).setName(Text.empty()).build(); - private static final GuiElement WHITE_PLATE = new GuiElementBuilder(Items.WHITE_STAINED_GLASS_PANE).setName(Text.empty()).build(); + private static final GuiElement PURPLE_PLATE = new GuiElementBuilder(Items.PURPLE_STAINED_GLASS_PANE).hideTooltip().build(); + private static final GuiElement WHITE_PLATE = new GuiElementBuilder(Items.WHITE_STAINED_GLASS_PANE).hideTooltip().build(); public static GuiElementBuilder nextPage() { return new GuiElementBuilder(Items.PLAYER_HEAD) - .setName(Text.translatable("spectatorMenu.next_page").formatted(Formatting.WHITE)) - .hideFlags() + .setItemName(Text.translatable("spectatorMenu.next_page")) + .hideDefaultTooltip() .setSkullOwner("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzg2MTg1YjFkNTE5YWRlNTg1ZjE4NGMzNGYzZjNlMjBiYjY0MWRlYjg3OWU4MTM3OGU0ZWFmMjA5Mjg3In19fQ"); } public static GuiElementBuilder previousPage() { return new GuiElementBuilder(Items.PLAYER_HEAD) - .setName(Text.translatable("spectatorMenu.previous_page").formatted(Formatting.WHITE)) - .hideFlags() + .setItemName(Text.translatable("spectatorMenu.previous_page")) + .hideDefaultTooltip() .setSkullOwner("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzEwODI5OGZmMmIyNjk1MWQ2ODNlNWFkZTQ2YTQyZTkwYzJmN2M3ZGQ0MWJhYTkwOGJjNTg1MmY4YzMyZTU4MyJ9fX0"); } public static GuiElementBuilder back(Runnable runnable) { - return new GuiElementBuilder(Items.STRUCTURE_VOID).setName(ScreenTexts.BACK).setCallback((a, b, c, gui) -> { - PagedGui.playClickSound(gui.getPlayer()); - runnable.run(); - }); + return new GuiElementBuilder(Items.STRUCTURE_VOID) + .setItemName(ScreenTexts.BACK) + .hideDefaultTooltip() + .setCallback((a, b, c, gui) -> { + PagedGui.playClickSound(gui.getPlayer()); + runnable.run(); + }); } public static GuiElement purple() { diff --git a/src/main/java/xyz/nucleoid/extras/util/PagedGui.java b/src/main/java/xyz/nucleoid/extras/util/PagedGui.java index b8247bd3..fd7851e7 100644 --- a/src/main/java/xyz/nucleoid/extras/util/PagedGui.java +++ b/src/main/java/xyz/nucleoid/extras/util/PagedGui.java @@ -114,11 +114,7 @@ protected DisplayElement getNavElement(int id) { public record DisplayElement(@Nullable GuiElementInterface element, @Nullable Slot slot) { private static final DisplayElement EMPTY = DisplayElement.of(new GuiElement(ItemStack.EMPTY, GuiElementInterface.EMPTY_CALLBACK)); - private static final DisplayElement FILLER = DisplayElement.of( - new GuiElementBuilder(Items.WHITE_STAINED_GLASS_PANE) - .setName(Text.empty()) - .hideFlags() - ); + private static final DisplayElement FILLER = DisplayElement.of(CommonGuiElements.white()); public static DisplayElement of(GuiElementInterface element) { return new DisplayElement(element, null); @@ -143,8 +139,8 @@ public static DisplayElement nextPage(PagedGui gui) { } else { return DisplayElement.of( new GuiElementBuilder(Items.PLAYER_HEAD) - .setName(Text.translatable("spectatorMenu.next_page").formatted(Formatting.DARK_GRAY)) - .hideFlags() + .setItemName(Text.translatable("spectatorMenu.next_page").formatted(Formatting.DARK_GRAY)) + .hideDefaultTooltip() .setSkullOwner(SkinEncoder.encode("7e57720a4878c8bcab0e9c9c47d9e55128ccd77ba3445a54a91e3e1e1a27356e")) ); } @@ -162,8 +158,8 @@ public static DisplayElement previousPage(PagedGui gui) { } else { return DisplayElement.of( new GuiElementBuilder(Items.PLAYER_HEAD) - .setName(Text.translatable("spectatorMenu.previous_page").formatted(Formatting.DARK_GRAY)) - .hideFlags() + .setItemName(Text.translatable("spectatorMenu.previous_page").formatted(Formatting.DARK_GRAY)) + .hideDefaultTooltip() .setSkullOwner(SkinEncoder.encode("50820f76e3e041c75f76d0f301232bdf48321b534fe6a859ccb873d2981a9623")) ); } @@ -179,7 +175,7 @@ public static DisplayElement empty() { } public static void playSound(ServerPlayerEntity player, SoundEvent sound) { - player.playSound(sound, SoundCategory.MASTER, 1, 1); + player.playSoundToPlayer(sound, SoundCategory.MASTER, 1, 1); } public static void playClickSound(ServerPlayerEntity player) { diff --git a/src/main/resources/data/nucleoid_extras/lang/en_us.json b/src/main/resources/data/nucleoid_extras/lang/en_us.json index 7ef50eea..79a71557 100644 --- a/src/main/resources/data/nucleoid_extras/lang/en_us.json +++ b/src/main/resources/data/nucleoid_extras/lang/en_us.json @@ -44,6 +44,7 @@ "block.nucleoid_extras.transient_cherry_door": "Transient Cherry Door (Lobby only!)", "block.nucleoid_extras.transient_dark_oak_door": "Transient Dark Oak Door (Lobby only!)", "block.nucleoid_extras.transient_mangrove_door": "Transient Mangrove Door (Lobby only!)", + "block.nucleoid_extras.transient_pale_oak_door": "Transient Pale Oak Door (Lobby only!)", "block.nucleoid_extras.transient_bamboo_door": "Transient Bamboo Door (Lobby only!)", "block.nucleoid_extras.transient_crimson_door": "Transient Crimson Door (Lobby only!)", "block.nucleoid_extras.transient_warped_door": "Transient Warped Door (Lobby only!)", diff --git a/src/main/resources/extras.accesswidener b/src/main/resources/extras.accesswidener new file mode 100644 index 00000000..378b68f5 --- /dev/null +++ b/src/main/resources/extras.accesswidener @@ -0,0 +1,3 @@ +accessWidener v2 named + +extendable method net/minecraft/block/AbstractBlock getTranslationKey ()Ljava/lang/String; diff --git a/src/main/resources/extras.mixins.json b/src/main/resources/extras.mixins.json index ea2eaf5b..76f9cb0b 100644 --- a/src/main/resources/extras.mixins.json +++ b/src/main/resources/extras.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "xyz.nucleoid.extras.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ "BlockWithEntityAccessor", "MinecraftServerMixin", @@ -12,9 +12,10 @@ "debug.EntityMixin", "lobby.ArmorStandEntityAccessor", "lobby.LivingEntityAccessor", + "lobby.ServerChunkLoadingManagerAccessor", "lobby.ServerPlayerEntityMixin", "lobby.SkullBlockEntityAccessor", - "lobby.ThreadedAnvilChunkStorageAccessor", + "lobby.WorldChunkMixin", "patches.EntityMixin", "patches.StatusEffectMixin", "player_list.PlayerInteractionManagerMixin", diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 3a56524b..f6ad8ca3 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -12,11 +12,12 @@ "fabric-datagen": ["xyz.nucleoid.extras.data.NEDatagen"] }, "mixins": ["extras.mixins.json"], + "accessWidener": "extras.accesswidener", "depends": { "fabricloader": ">=0.9.1", "fabric": "*", - "minecraft": ">=1.20", - "plasmid": "0.5.x", + "minecraft": ">=1.21.2-", + "plasmid": "0.6.x", "java": ">=17" } }