diff --git a/.gitignore b/.gitignore
index 1fac4d5..625ddc5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,7 @@
-.gradle
build/
-!gradle/wrapper/gradle-wrapper.jar
-!**/src/main/**/build/
-!**/src/test/**/build/
+bin/
.kotlin
+.idea
### IntelliJ IDEA ###
.idea/modules.xml
@@ -17,27 +15,8 @@ out/
!**/src/main/**/out/
!**/src/test/**/out/
-### Eclipse ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-bin/
-!**/src/main/**/bin/
-!**/src/test/**/bin/
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-
-### VS Code ###
-.vscode/
-
-### Mac OS ###
-.DS_Store
\ No newline at end of file
+# Gradle Wrapper
+gradlew
+gradlew.bat
+.gradle
+gradle
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 13566b8..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Editor-based HTTP Client requests
-/httpRequests/
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
diff --git a/.idea/.name b/.idea/.name
deleted file mode 100644
index 4b3d693..0000000
--- a/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-Hytale-Server
\ No newline at end of file
diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml
deleted file mode 100644
index 4a53bee..0000000
--- a/.idea/AndroidProjectSystem.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index 14746e7..0000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 32cf4db..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/_decomp/decomp.ps1 b/_decomp/decomp.ps1
index e69de29..439a98f 100644
--- a/_decomp/decomp.ps1
+++ b/_decomp/decomp.ps1
@@ -0,0 +1,23 @@
+$ErrorActionPreference = "Stop"
+
+# Move to the git root if we arn't already there
+git rev-parse --show-toplevel | Set-Location
+
+# get the server jar from the install directory ( in future support pre-release )
+$server_jar = resolve-path "$env:APPDATA/Hytale/install/release/package/game/latest/Server/HytaleServer.jar"
+
+# clear the source directory
+Get-ChildItem -Path "src" | Remove-Item -Recurse -Force -Confirm:$false
+
+# Decompile hytale
+java -jar "_decomp/vineflower-1.11.2-slim.jar" --only="com/hypixel" $server_jar "./src"
+
+# Extract the version before deleting the meta inf file
+$version = (Get-Content "src/META-INF/MANIFEST.MF" | Select-String "^Implementation-Version:\s*(.+)$").Matches.Groups[1].Value
+
+# delete anything not in com hypixel
+Get-ChildItem "src/" -Exclude @("com", "manifests.json") | Remove-Item -Recurse -Force -Confirm:$false
+Get-ChildItem "src/com/" -Exclude @("hypixel") | Remove-Item -Recurse -Force -Confirm:$false
+
+git add "./src"
+git commit -am "$version"
diff --git a/build.gradle.kts b/build.gradle.kts
index 94004fc..b38a154 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,3 +1,5 @@
+import org.apache.tools.ant.taskdefs.condition.Os
+
plugins {
id("java")
}
@@ -10,9 +12,14 @@ repositories {
}
dependencies {
- testImplementation(platform("org.junit:junit-bom:5.10.0"))
- testImplementation("org.junit.jupiter:junit-jupiter")
- testRuntimeOnly("org.junit.platform:junit-platform-launcher")
+ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
+ implementation(files("${System.getenv("APPDATA")}/Hytale/install/release/package/game/latest/Server/HytaleServer.jar"))
+ }
+}
+
+tasks.wrapper {
+ gradleVersion = "8.14"
+ distributionType = Wrapper.DistributionType.ALL
}
sourceSets {
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 249e583..0000000
Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 887a104..0000000
--- a/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#Sat Jan 24 07:48:30 EST 2026
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
deleted file mode 100644
index 1b6c787..0000000
--- a/gradlew
+++ /dev/null
@@ -1,234 +0,0 @@
-#!/bin/sh
-
-#
-# 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.
-# You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-##############################################################################
-#
-# Gradle start up script for POSIX generated by Gradle.
-#
-# Important for running:
-#
-# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
-# noncompliant, but you have some other compliant shell such as ksh or
-# bash, then to run this script, type that shell name before the whole
-# command line, like:
-#
-# ksh Gradle
-#
-# Busybox and similar reduced shells will NOT work, because this script
-# requires all of these POSIX shell features:
-# * functions;
-# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
-# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
-# * compound commands having a testable exit status, especially «case»;
-# * various built-in commands including «command», «set», and «ulimit».
-#
-# Important for patching:
-#
-# (2) This script targets any POSIX shell, so it avoids extensions provided
-# by Bash, Ksh, etc; in particular arrays are avoided.
-#
-# The "traditional" practice of packing multiple parameters into a
-# space-separated string is a well documented source of bugs and security
-# problems, so this is (mostly) avoided, by progressively accumulating
-# options in "$@", and eventually passing that to Java.
-#
-# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
-# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
-# see the in-line comments for details.
-#
-# There are tweaks for specific operating systems such as AIX, CygWin,
-# Darwin, MinGW, and NonStop.
-#
-# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
-# within the Gradle project.
-#
-# You can find Gradle at https://github.com/gradle/gradle/.
-#
-##############################################################################
-
-# Attempt to set APP_HOME
-
-# Resolve links: $0 may be a link
-app_path=$0
-
-# Need this for daisy-chained symlinks.
-while
- APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
- [ -h "$app_path" ]
-do
- ls=$( ls -ld "$app_path" )
- link=${ls#*' -> '}
- case $link in #(
- /*) app_path=$link ;; #(
- *) app_path=$APP_HOME$link ;;
- esac
-done
-
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-
-APP_NAME="Gradle"
-APP_BASE_NAME=${0##*/}
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD=maximum
-
-warn () {
- echo "$*"
-} >&2
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-} >&2
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "$( uname )" in #(
- CYGWIN* ) cygwin=true ;; #(
- Darwin* ) darwin=true ;; #(
- MSYS* | MINGW* ) msys=true ;; #(
- NONSTOP* ) nonstop=true ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD=$JAVA_HOME/jre/sh/java
- else
- JAVACMD=$JAVA_HOME/bin/java
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD=java
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
- case $MAX_FD in #(
- max*)
- MAX_FD=$( ulimit -H -n ) ||
- warn "Could not query maximum file descriptor limit"
- esac
- case $MAX_FD in #(
- '' | soft) :;; #(
- *)
- ulimit -n "$MAX_FD" ||
- warn "Could not set maximum file descriptor limit to $MAX_FD"
- esac
-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" || "$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
- for arg do
- if
- case $arg in #(
- -*) false ;; # don't mess with options #(
- /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
- [ -e "$t" ] ;; #(
- *) false ;;
- esac
- then
- arg=$( cygpath --path --ignore --mixed "$arg" )
- fi
- # Roll the args list around exactly as many times as the number of
- # args, so each arg winds up back in the position where it started, but
- # possibly modified.
- #
- # NB: a `for` loop captures its iteration list before it begins, so
- # changing the positional parameters here affects neither the number of
- # iterations, nor the values presented in `arg`.
- shift # remove old arg
- set -- "$@" "$arg" # push replacement arg
- done
-fi
-
-# Collect all arguments for the java command;
-# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
-# shell script including quotes and variable substitutions, so put them in
-# double quotes to make sure that they get re-expanded; and
-# * put everything else in single quotes, so that it's not re-expanded.
-
-set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
- "$@"
-
-# Use "xargs" to parse quoted args.
-#
-# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
-#
-# In Bash we could simply go:
-#
-# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
-# set -- "${ARGS[@]}" "$@"
-#
-# but POSIX shell has neither arrays nor command substitution, so instead we
-# post-process each arg (as a line of input to sed) to backslash-escape any
-# character that might be a shell metacharacter, then use eval to reverse
-# that process (while maintaining the separation between arguments), and wrap
-# the whole thing up as a single "set" statement.
-#
-# This will of course break if any of these variables contains a newline or
-# an unmatched quote.
-#
-
-eval "set -- $(
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
- xargs -n1 |
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
- tr '\n' ' '
- )" '"$@"'
-
-exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
deleted file mode 100644
index 107acd3..0000000
--- a/gradlew.bat
+++ /dev/null
@@ -1,89 +0,0 @@
-@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
diff --git a/src/com/hypixel/fastutil/util/SneakyThrow.java b/src/com/hypixel/fastutil/util/SneakyThrow.java
index 8b6743e..c16209b 100644
--- a/src/com/hypixel/fastutil/util/SneakyThrow.java
+++ b/src/com/hypixel/fastutil/util/SneakyThrow.java
@@ -1,9 +1,6 @@
package com.hypixel.fastutil.util;
public class SneakyThrow {
- public SneakyThrow() {
- }
-
public static RuntimeException sneakyThrow(Throwable t) {
if (t == null) {
throw new NullPointerException("t");
diff --git a/src/com/hypixel/fastutil/util/TLRUtil.java b/src/com/hypixel/fastutil/util/TLRUtil.java
index 40f5537..f13a3fb 100644
--- a/src/com/hypixel/fastutil/util/TLRUtil.java
+++ b/src/com/hypixel/fastutil/util/TLRUtil.java
@@ -9,9 +9,6 @@ public class TLRUtil {
private static final Unsafe UNSAFE;
private static final long PROBE;
- public TLRUtil() {
- }
-
public static void localInit() {
ThreadLocalRandom.current();
}
diff --git a/src/com/hypixel/hytale/LateMain.java b/src/com/hypixel/hytale/LateMain.java
index 6303c79..d2e6039 100644
--- a/src/com/hypixel/hytale/LateMain.java
+++ b/src/com/hypixel/hytale/LateMain.java
@@ -12,9 +12,6 @@ import java.util.Map.Entry;
import java.util.logging.Level;
public class LateMain {
- public LateMain() {
- }
-
public static void lateMain(String[] args) {
try {
if (!Options.parse(args)) {
diff --git a/src/com/hypixel/hytale/Main.java b/src/com/hypixel/hytale/Main.java
index c8ef1a2..23decc1 100644
--- a/src/com/hypixel/hytale/Main.java
+++ b/src/com/hypixel/hytale/Main.java
@@ -13,9 +13,6 @@ import java.util.Locale;
import javax.annotation.Nonnull;
public final class Main {
- public Main() {
- }
-
public static void main(String[] args) {
Locale.setDefault(Locale.ENGLISH);
System.setProperty("java.awt.headless", "true");
diff --git a/src/com/hypixel/hytale/assetstore/AssetConstants.java b/src/com/hypixel/hytale/assetstore/AssetConstants.java
index ccd1cac..df29b58 100644
--- a/src/com/hypixel/hytale/assetstore/AssetConstants.java
+++ b/src/com/hypixel/hytale/assetstore/AssetConstants.java
@@ -5,7 +5,4 @@ public class AssetConstants {
public static final int EXPECTED_ASSETS_PER_PATH = 1;
public static final int EXPECTED_VALUES_PER_TAG = 3;
public static final int EXPECTED_ASSETS_PER_TAG = 3;
-
- public AssetConstants() {
- }
}
diff --git a/src/com/hypixel/hytale/assetstore/AssetMap.java b/src/com/hypixel/hytale/assetstore/AssetMap.java
index 226b1ca..a225752 100644
--- a/src/com/hypixel/hytale/assetstore/AssetMap.java
+++ b/src/com/hypixel/hytale/assetstore/AssetMap.java
@@ -11,9 +11,6 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public abstract class AssetMap> {
- public AssetMap() {
- }
-
@Nullable
public abstract T getAsset(K var1);
diff --git a/src/com/hypixel/hytale/assetstore/AssetRegistry.java b/src/com/hypixel/hytale/assetstore/AssetRegistry.java
index 9563a5b..f92558c 100644
--- a/src/com/hypixel/hytale/assetstore/AssetRegistry.java
+++ b/src/com/hypixel/hytale/assetstore/AssetRegistry.java
@@ -26,9 +26,6 @@ public class AssetRegistry {
private static final Object2IntMap TAG_MAP = new Object2IntOpenHashMap<>();
private static final Object2IntMap CLIENT_TAG_MAP = new Object2IntOpenHashMap<>();
- public AssetRegistry() {
- }
-
@Nonnull
public static Map, AssetStore, ?, ?>> getStoreMap() {
return storeMapUnmodifiable;
diff --git a/src/com/hypixel/hytale/assetstore/AssetValidationResults.java b/src/com/hypixel/hytale/assetstore/AssetValidationResults.java
index 36501d1..33f03cc 100644
--- a/src/com/hypixel/hytale/assetstore/AssetValidationResults.java
+++ b/src/com/hypixel/hytale/assetstore/AssetValidationResults.java
@@ -10,7 +10,6 @@ import java.util.HashSet;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.checkerframework.checker.nullness.compatqual.NonNullDecl;
public class AssetValidationResults extends ValidationResults {
private Set> disabledMissingAssetClasses;
@@ -40,11 +39,11 @@ public class AssetValidationResults extends ValidationResults {
}
@Override
- public void logOrThrowValidatorExceptions(@NonNullDecl HytaleLogger logger, @NonNullDecl String msg) {
+ public void logOrThrowValidatorExceptions(@Nonnull HytaleLogger logger, @Nonnull String msg) {
this.logOrThrowValidatorExceptions(logger, msg, null, 0);
}
- public void logOrThrowValidatorExceptions(@NonNullDecl HytaleLogger logger, @NonNullDecl String msg, @Nullable Path path, int lineOffset) {
+ public void logOrThrowValidatorExceptions(@Nonnull HytaleLogger logger, @Nonnull String msg, @Nullable Path path, int lineOffset) {
if (GithubMessageUtil.isGithub() && this.validatorExceptions != null && !this.validatorExceptions.isEmpty()) {
for (ValidationResults.ValidatorResultsHolder holder : this.validatorExceptions) {
String file = "unknown";
diff --git a/src/com/hypixel/hytale/assetstore/codec/ContainedAssetCodec.java b/src/com/hypixel/hytale/assetstore/codec/ContainedAssetCodec.java
index 4408378..6d6257c 100644
--- a/src/com/hypixel/hytale/assetstore/codec/ContainedAssetCodec.java
+++ b/src/com/hypixel/hytale/assetstore/codec/ContainedAssetCodec.java
@@ -227,8 +227,5 @@ public class ContainedAssetCodec, M extends
INHERIT_ID,
INHERIT_ID_AND_PARENT,
INJECT_PARENT;
-
- private Mode() {
- }
}
}
diff --git a/src/com/hypixel/hytale/assetstore/event/AssetsEvent.java b/src/com/hypixel/hytale/assetstore/event/AssetsEvent.java
index e16ad85..8b84c8e 100644
--- a/src/com/hypixel/hytale/assetstore/event/AssetsEvent.java
+++ b/src/com/hypixel/hytale/assetstore/event/AssetsEvent.java
@@ -4,6 +4,4 @@ import com.hypixel.hytale.assetstore.JsonAsset;
import com.hypixel.hytale.event.IEvent;
public abstract class AssetsEvent> implements IEvent> {
- public AssetsEvent() {
- }
}
diff --git a/src/com/hypixel/hytale/assetstore/map/AssetMapWithIndexes.java b/src/com/hypixel/hytale/assetstore/map/AssetMapWithIndexes.java
index 853e43f..75b4669 100644
--- a/src/com/hypixel/hytale/assetstore/map/AssetMapWithIndexes.java
+++ b/src/com/hypixel/hytale/assetstore/map/AssetMapWithIndexes.java
@@ -15,9 +15,6 @@ public abstract class AssetMapWithIndexes> extends Def
protected final Int2ObjectConcurrentHashMap indexedTagStorage = new Int2ObjectConcurrentHashMap<>();
protected final Int2ObjectConcurrentHashMap unmodifiableIndexedTagStorage = new Int2ObjectConcurrentHashMap<>();
- public AssetMapWithIndexes() {
- }
-
@Override
protected void clear() {
super.clear();
diff --git a/src/com/hypixel/hytale/assetstore/map/CaseInsensitiveHashStrategy.java b/src/com/hypixel/hytale/assetstore/map/CaseInsensitiveHashStrategy.java
index 9b9f6aa..d7d9845 100644
--- a/src/com/hypixel/hytale/assetstore/map/CaseInsensitiveHashStrategy.java
+++ b/src/com/hypixel/hytale/assetstore/map/CaseInsensitiveHashStrategy.java
@@ -5,9 +5,6 @@ import it.unimi.dsi.fastutil.Hash.Strategy;
public class CaseInsensitiveHashStrategy implements Strategy {
private static final CaseInsensitiveHashStrategy INSTANCE = new CaseInsensitiveHashStrategy();
- public CaseInsensitiveHashStrategy() {
- }
-
public static CaseInsensitiveHashStrategy getInstance() {
return INSTANCE;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/camera/asset/CameraShakeConfig.java b/src/com/hypixel/hytale/builtin/adventure/camera/asset/CameraShakeConfig.java
index 011d9da..c072403 100644
--- a/src/com/hypixel/hytale/builtin/adventure/camera/asset/CameraShakeConfig.java
+++ b/src/com/hypixel/hytale/builtin/adventure/camera/asset/CameraShakeConfig.java
@@ -45,9 +45,6 @@ public class CameraShakeConfig implements NetworkSerializable> {
- public CameraShakePacketGenerator() {
- }
-
@Nonnull
public Packet generateInitPacket(@Nonnull IndexedAssetMap assetMap, @Nonnull Map assets) {
return toCachedPacket(UpdateType.Init, assetMap, assets);
diff --git a/src/com/hypixel/hytale/builtin/adventure/camera/asset/viewbobbing/ViewBobbing.java b/src/com/hypixel/hytale/builtin/adventure/camera/asset/viewbobbing/ViewBobbing.java
index b2649cf..3ad0358 100644
--- a/src/com/hypixel/hytale/builtin/adventure/camera/asset/viewbobbing/ViewBobbing.java
+++ b/src/com/hypixel/hytale/builtin/adventure/camera/asset/viewbobbing/ViewBobbing.java
@@ -34,9 +34,6 @@ public class ViewBobbing
@Nonnull
protected CameraShakeConfig firstPerson;
- public ViewBobbing() {
- }
-
public MovementType getId() {
return this.id;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/camera/asset/viewbobbing/ViewBobbingPacketGenerator.java b/src/com/hypixel/hytale/builtin/adventure/camera/asset/viewbobbing/ViewBobbingPacketGenerator.java
index 20e2343..dd50293 100644
--- a/src/com/hypixel/hytale/builtin/adventure/camera/asset/viewbobbing/ViewBobbingPacketGenerator.java
+++ b/src/com/hypixel/hytale/builtin/adventure/camera/asset/viewbobbing/ViewBobbingPacketGenerator.java
@@ -14,9 +14,6 @@ import java.util.Map.Entry;
import javax.annotation.Nonnull;
public class ViewBobbingPacketGenerator extends SimpleAssetPacketGenerator> {
- public ViewBobbingPacketGenerator() {
- }
-
@Nonnull
@Override
public Packet generateInitPacket(AssetMap assetMap, @Nonnull Map assets) {
diff --git a/src/com/hypixel/hytale/builtin/adventure/camera/command/CameraEffectCommand.java b/src/com/hypixel/hytale/builtin/adventure/camera/command/CameraEffectCommand.java
index 8fd1bfa..c601e87 100644
--- a/src/com/hypixel/hytale/builtin/adventure/camera/command/CameraEffectCommand.java
+++ b/src/com/hypixel/hytale/builtin/adventure/camera/command/CameraEffectCommand.java
@@ -19,8 +19,7 @@ import com.hypixel.hytale.server.core.universe.PlayerRef;
import com.hypixel.hytale.server.core.universe.world.World;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import javax.annotation.Nonnull;
-import org.checkerframework.checker.nullness.compatqual.NonNullDecl;
-import org.checkerframework.checker.nullness.compatqual.NullableDecl;
+import javax.annotation.Nullable;
public class CameraEffectCommand extends AbstractCommandCollection {
@Nonnull
@@ -52,12 +51,12 @@ public class CameraEffectCommand extends AbstractCommandCollection {
@Override
protected void execute(
- @NonNullDecl CommandContext context,
- @NullableDecl Ref sourceRef,
- @NonNullDecl Ref ref,
- @NonNullDecl PlayerRef playerRef,
- @NonNullDecl World world,
- @NonNullDecl Store store
+ @Nonnull CommandContext context,
+ @Nullable Ref sourceRef,
+ @Nonnull Ref ref,
+ @Nonnull PlayerRef playerRef,
+ @Nonnull World world,
+ @Nonnull Store store
) {
DamageCause damageCause = context.get(this.causeArg);
float damageAmount = context.get(this.damageArg);
@@ -95,12 +94,12 @@ public class CameraEffectCommand extends AbstractCommandCollection {
@Override
protected void execute(
- @NonNullDecl CommandContext context,
- @NullableDecl Ref sourceRef,
- @NonNullDecl Ref ref,
- @NonNullDecl PlayerRef playerRef,
- @NonNullDecl World world,
- @NonNullDecl Store store
+ @Nonnull CommandContext context,
+ @Nullable Ref sourceRef,
+ @Nonnull Ref ref,
+ @Nonnull PlayerRef playerRef,
+ @Nonnull World world,
+ @Nonnull Store store
) {
CameraEffect cameraEffect = context.get(this.effectArg);
float intensity = context.get(this.intensityArg);
diff --git a/src/com/hypixel/hytale/builtin/adventure/camera/interaction/CameraShakeInteraction.java b/src/com/hypixel/hytale/builtin/adventure/camera/interaction/CameraShakeInteraction.java
index 8fb3e36..e8bfdfd 100644
--- a/src/com/hypixel/hytale/builtin/adventure/camera/interaction/CameraShakeInteraction.java
+++ b/src/com/hypixel/hytale/builtin/adventure/camera/interaction/CameraShakeInteraction.java
@@ -40,9 +40,6 @@ public class CameraShakeInteraction extends SimpleInstantInteraction {
protected String effectId;
protected int effectIndex = Integer.MIN_VALUE;
- public CameraShakeInteraction() {
- }
-
@Override
protected void firstRun(@Nonnull InteractionType type, @Nonnull InteractionContext context, @Nonnull CooldownHandler cooldownHandler) {
if (this.effectIndex != Integer.MIN_VALUE) {
diff --git a/src/com/hypixel/hytale/builtin/adventure/camera/system/CameraEffectSystem.java b/src/com/hypixel/hytale/builtin/adventure/camera/system/CameraEffectSystem.java
index d779012..56811f1 100644
--- a/src/com/hypixel/hytale/builtin/adventure/camera/system/CameraEffectSystem.java
+++ b/src/com/hypixel/hytale/builtin/adventure/camera/system/CameraEffectSystem.java
@@ -28,9 +28,6 @@ public class CameraEffectSystem extends DamageEventSystem {
@Nonnull
private static final Query QUERY = Query.and(PLAYER_REF_COMPONENT_TYPE, ENTITY_STAT_MAP_COMPONENT_TYPE);
- public CameraEffectSystem() {
- }
-
@Nullable
@Override
public SystemGroup getGroup() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/FarmingSystems.java b/src/com/hypixel/hytale/builtin/adventure/farming/FarmingSystems.java
index 1162b5c..fea5d54 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/FarmingSystems.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/FarmingSystems.java
@@ -46,11 +46,25 @@ import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.checkerframework.checker.nullness.compatqual.NonNullDecl;
-import org.checkerframework.checker.nullness.compatqual.NullableDecl;
public class FarmingSystems {
- public FarmingSystems() {
+ private static boolean hasCropAbove(BlockChunk blockChunk, int x, int y, int z) {
+ if (y + 1 >= 320) {
+ return false;
+ } else {
+ BlockSection aboveBlockSection = blockChunk.getSectionAtBlockY(y + 1);
+ if (aboveBlockSection == null) {
+ return false;
+ } else {
+ BlockType aboveBlockType = BlockType.getAssetMap().getAsset(aboveBlockSection.get(x, y + 1, z));
+ if (aboveBlockType == null) {
+ return false;
+ } else {
+ FarmingData farmingConfig = aboveBlockType.getFarming();
+ return farmingConfig != null && farmingConfig.getStages() != null;
+ }
+ }
+ }
}
private static boolean updateSoilDecayTime(CommandBuffer commandBuffer, TilledSoilBlock soilBlock, BlockType blockType) {
@@ -79,9 +93,6 @@ public class FarmingSystems {
public static class CoopResidentEntitySystem extends RefSystem {
private static final ComponentType componentType = CoopResidentComponent.getComponentType();
- public CoopResidentEntitySystem() {
- }
-
@Override
public Query getQuery() {
return componentType;
@@ -89,19 +100,13 @@ public class FarmingSystems {
@Override
public void onEntityAdded(
- @NonNullDecl Ref ref,
- @NonNullDecl AddReason reason,
- @NonNullDecl Store store,
- @NonNullDecl CommandBuffer commandBuffer
+ @Nonnull Ref ref, @Nonnull AddReason reason, @Nonnull Store store, @Nonnull CommandBuffer commandBuffer
) {
}
@Override
public void onEntityRemove(
- @NonNullDecl Ref ref,
- @NonNullDecl RemoveReason reason,
- @NonNullDecl Store store,
- @NonNullDecl CommandBuffer commandBuffer
+ @Nonnull Ref ref, @Nonnull RemoveReason reason, @Nonnull Store store, @Nonnull CommandBuffer commandBuffer
) {
if (reason != RemoveReason.UNLOAD) {
UUIDComponent uuidComponent = commandBuffer.getComponent(ref, UUIDComponent.getComponentType());
@@ -148,9 +153,6 @@ public class FarmingSystems {
public static class CoopResidentTicking extends EntityTickingSystem {
private static final ComponentType componentType = CoopResidentComponent.getComponentType();
- public CoopResidentTicking() {
- }
-
@Override
public Query getQuery() {
return componentType;
@@ -160,9 +162,9 @@ public class FarmingSystems {
public void tick(
float dt,
int index,
- @NonNullDecl ArchetypeChunk archetypeChunk,
- @NonNullDecl Store store,
- @NonNullDecl CommandBuffer commandBuffer
+ @Nonnull ArchetypeChunk archetypeChunk,
+ @Nonnull Store store,
+ @Nonnull CommandBuffer commandBuffer
) {
CoopResidentComponent coopResidentComponent = archetypeChunk.getComponent(index, CoopResidentComponent.getComponentType());
if (coopResidentComponent != null) {
@@ -175,9 +177,6 @@ public class FarmingSystems {
@Deprecated(forRemoval = true)
public static class MigrateFarming extends BlockModule.MigrationSystem {
- public MigrateFarming() {
- }
-
@Override
public void onEntityAdd(@Nonnull Holder holder, @Nonnull AddReason reason, @Nonnull Store store) {
FarmingBlockState oldState = holder.getComponent(FarmingPlugin.get().getFarmingBlockStateComponentType());
@@ -203,15 +202,9 @@ public class FarmingSystems {
public static class OnCoopAdded extends RefSystem {
private static final Query QUERY = Query.and(BlockModule.BlockStateInfo.getComponentType(), CoopBlock.getComponentType());
- public OnCoopAdded() {
- }
-
@Override
public void onEntityAdded(
- @NonNullDecl Ref ref,
- @NonNullDecl AddReason reason,
- @NonNullDecl Store store,
- @NonNullDecl CommandBuffer commandBuffer
+ @Nonnull Ref ref, @Nonnull AddReason reason, @Nonnull Store store, @Nonnull CommandBuffer commandBuffer
) {
CoopBlock coopBlock = commandBuffer.getComponent(ref, CoopBlock.getComponentType());
if (coopBlock != null) {
@@ -238,10 +231,7 @@ public class FarmingSystems {
@Override
public void onEntityRemove(
- @NonNullDecl Ref ref,
- @NonNullDecl RemoveReason reason,
- @NonNullDecl Store store,
- @NonNullDecl CommandBuffer commandBuffer
+ @Nonnull Ref ref, @Nonnull RemoveReason reason, @Nonnull Store store, @Nonnull CommandBuffer commandBuffer
) {
if (reason != RemoveReason.UNLOAD) {
CoopBlock coop = commandBuffer.getComponent(ref, CoopBlock.getComponentType());
@@ -284,7 +274,7 @@ public class FarmingSystems {
}
}
- @NullableDecl
+ @Nullable
@Override
public Query getQuery() {
return QUERY;
@@ -294,9 +284,6 @@ public class FarmingSystems {
public static class OnFarmBlockAdded extends RefSystem {
private static final Query QUERY = Query.and(BlockModule.BlockStateInfo.getComponentType(), FarmingBlock.getComponentType());
- public OnFarmBlockAdded() {
- }
-
@Override
public void onEntityAdded(
@Nonnull Ref ref, @Nonnull AddReason reason, @Nonnull Store store, @Nonnull CommandBuffer commandBuffer
@@ -309,8 +296,8 @@ public class FarmingSystems {
assert info != null;
+ BlockChunk blockChunk = commandBuffer.getComponent(info.getChunkRef(), BlockChunk.getComponentType());
if (farmingBlock.getLastTickGameTime() == null) {
- BlockChunk blockChunk = commandBuffer.getComponent(info.getChunkRef(), BlockChunk.getComponentType());
int blockId = blockChunk.getBlock(
ChunkUtil.xFromBlockInColumn(info.getIndex()), ChunkUtil.yFromBlockInColumn(info.getIndex()), ChunkUtil.zFromBlockInColumn(info.getIndex())
);
@@ -323,6 +310,7 @@ public class FarmingSystems {
farmingBlock.setLastTickGameTime(
store.getExternalData().getWorld().getEntityStore().getStore().getResource(WorldTimeResource.getResourceType()).getGameTime()
);
+ blockChunk.markNeedsSaving();
if (blockType.getFarming().getStages() != null) {
FarmingStageData[] stages = blockType.getFarming().getStages().get(blockType.getFarming().getStartingStageSet());
if (stages != null && stages.length > 0) {
@@ -370,6 +358,7 @@ public class FarmingSystems {
farmingBlock.setLastTickGameTime(
store.getExternalData().getWorld().getEntityStore().getStore().getResource(WorldTimeResource.getResourceType()).getGameTime()
);
+ blockChunk.markNeedsSaving();
}
int x = ChunkUtil.xFromBlockInColumn(info.getIndex());
@@ -385,7 +374,7 @@ public class FarmingSystems {
Ref section = column.getSection(ChunkUtil.chunkCoordinate(y));
BlockSection blockSection = commandBuffer.getComponent(section, BlockSection.getComponentType());
- FarmingUtil.tickFarming(commandBuffer, blockSection, section, ref, farmingBlock, x, y, z, true);
+ FarmingUtil.tickFarming(commandBuffer, blockChunk, blockSection, section, ref, farmingBlock, x, y, z, true);
}
@Override
@@ -404,9 +393,6 @@ public class FarmingSystems {
public static class OnSoilAdded extends RefSystem {
private static final Query QUERY = Query.and(BlockModule.BlockStateInfo.getComponentType(), TilledSoilBlock.getComponentType());
- public OnSoilAdded() {
- }
-
@Override
public void onEntityAdded(
@Nonnull Ref ref, @Nonnull AddReason reason, @Nonnull Store store, @Nonnull CommandBuffer commandBuffer
@@ -461,9 +447,6 @@ public class FarmingSystems {
public static class Ticking extends EntityTickingSystem {
private static final Query QUERY = Query.and(BlockSection.getComponentType(), ChunkSection.getComponentType());
- public Ticking() {
- }
-
@Override
public void tick(
float dt,
@@ -481,39 +464,45 @@ public class FarmingSystems {
assert section != null;
- BlockComponentChunk blockComponentChunk = commandBuffer.getComponent(section.getChunkColumnReference(), BlockComponentChunk.getComponentType());
+ if (section.getChunkColumnReference() != null && section.getChunkColumnReference().isValid()) {
+ BlockComponentChunk blockComponentChunk = commandBuffer.getComponent(section.getChunkColumnReference(), BlockComponentChunk.getComponentType());
- assert blockComponentChunk != null;
+ assert blockComponentChunk != null;
- Ref ref = archetypeChunk.getReferenceTo(index);
- blocks.forEachTicking(
- blockComponentChunk, commandBuffer, section.getY(), (blockComponentChunk1, commandBuffer1, localX, localY, localZ, blockId) -> {
- Ref blockRef = blockComponentChunk1.getEntityReference(ChunkUtil.indexBlockInColumn(localX, localY, localZ));
- if (blockRef == null) {
- return BlockTickStrategy.IGNORED;
- } else {
- FarmingBlock farming = commandBuffer1.getComponent(blockRef, FarmingBlock.getComponentType());
- if (farming != null) {
- FarmingUtil.tickFarming(commandBuffer1, blocks, ref, blockRef, farming, localX, localY, localZ, false);
- return BlockTickStrategy.SLEEP;
+ Ref ref = archetypeChunk.getReferenceTo(index);
+ BlockChunk blockChunk = commandBuffer.getComponent(section.getChunkColumnReference(), BlockChunk.getComponentType());
+
+ assert blockChunk != null;
+
+ blocks.forEachTicking(
+ blockComponentChunk, commandBuffer, section.getY(), (blockComponentChunk1, commandBuffer1, localX, localY, localZ, blockId) -> {
+ Ref blockRef = blockComponentChunk1.getEntityReference(ChunkUtil.indexBlockInColumn(localX, localY, localZ));
+ if (blockRef == null) {
+ return BlockTickStrategy.IGNORED;
} else {
- TilledSoilBlock soil = commandBuffer1.getComponent(blockRef, TilledSoilBlock.getComponentType());
- if (soil != null) {
- tickSoil(commandBuffer1, blockComponentChunk1, blockRef, soil);
+ FarmingBlock farming = commandBuffer1.getComponent(blockRef, FarmingBlock.getComponentType());
+ if (farming != null) {
+ FarmingUtil.tickFarming(commandBuffer1, blockChunk, blocks, ref, blockRef, farming, localX, localY, localZ, false);
return BlockTickStrategy.SLEEP;
} else {
- CoopBlock coop = commandBuffer1.getComponent(blockRef, CoopBlock.getComponentType());
- if (coop != null) {
- tickCoop(commandBuffer1, blockComponentChunk1, blockRef, coop);
+ TilledSoilBlock soil = commandBuffer1.getComponent(blockRef, TilledSoilBlock.getComponentType());
+ if (soil != null) {
+ tickSoil(commandBuffer1, blockComponentChunk1, blockRef, soil);
return BlockTickStrategy.SLEEP;
} else {
- return BlockTickStrategy.IGNORED;
+ CoopBlock coop = commandBuffer1.getComponent(blockRef, CoopBlock.getComponentType());
+ if (coop != null) {
+ tickCoop(commandBuffer1, blockComponentChunk1, blockRef, coop);
+ return BlockTickStrategy.SLEEP;
+ } else {
+ return BlockTickStrategy.IGNORED;
+ }
}
}
}
}
- }
- );
+ );
+ }
}
}
@@ -528,14 +517,6 @@ public class FarmingSystems {
int y = ChunkUtil.yFromBlockInColumn(info.getIndex());
int z = ChunkUtil.zFromBlockInColumn(info.getIndex());
if (y < 320) {
- int checkIndex = ChunkUtil.indexBlockInColumn(x, y + 1, z);
- Ref aboveBlockRef = blockComponentChunk.getEntityReference(checkIndex);
- boolean hasCrop = false;
- if (aboveBlockRef != null) {
- FarmingBlock farmingBlock = commandBuffer.getComponent(aboveBlockRef, FarmingBlock.getComponentType());
- hasCrop = farmingBlock != null;
- }
-
assert info.getChunkRef() != null;
BlockChunk blockChunk = commandBuffer.getComponent(info.getChunkRef(), BlockChunk.getComponentType());
@@ -543,6 +524,7 @@ public class FarmingSystems {
assert blockChunk != null;
BlockSection blockSection = blockChunk.getSectionAtBlockY(y);
+ boolean hasCrop = FarmingSystems.hasCropAbove(blockChunk, x, y, z);
BlockType blockType = BlockType.getAssetMap().getAsset(blockSection.get(x, y, z));
Instant currentTime = commandBuffer.getExternalData()
.getWorld()
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/FarmingUtil.java b/src/com/hypixel/hytale/builtin/adventure/farming/FarmingUtil.java
index 1a17501..0b100ea 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/FarmingUtil.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/FarmingUtil.java
@@ -25,6 +25,7 @@ import com.hypixel.hytale.server.core.modules.entity.component.PersistentModel;
import com.hypixel.hytale.server.core.modules.interaction.BlockHarvestUtils;
import com.hypixel.hytale.server.core.modules.time.WorldTimeResource;
import com.hypixel.hytale.server.core.universe.world.World;
+import com.hypixel.hytale.server.core.universe.world.chunk.BlockChunk;
import com.hypixel.hytale.server.core.universe.world.chunk.BlockComponentChunk;
import com.hypixel.hytale.server.core.universe.world.chunk.WorldChunk;
import com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection;
@@ -35,17 +36,15 @@ import com.hypixel.hytale.server.npc.metadata.CapturedNPCMetadata;
import java.time.Instant;
import java.util.Map;
import javax.annotation.Nonnull;
-import org.checkerframework.checker.nullness.compatqual.NullableDecl;
+import javax.annotation.Nullable;
public class FarmingUtil {
private static final int MAX_SECONDS_BETWEEN_TICKS = 15;
private static final int BETWEEN_RANDOM = 10;
- public FarmingUtil() {
- }
-
public static void tickFarming(
CommandBuffer commandBuffer,
+ BlockChunk blockChunk,
BlockSection blockSection,
Ref sectionRef,
Ref blockRef,
@@ -68,7 +67,18 @@ public class FarmingUtil {
float currentProgress = farmingBlock.getGrowthProgress();
int currentStage = (int)currentProgress;
String currentStageSet = farmingBlock.getCurrentStageSet();
- FarmingStageData[] stages = farmingConfig.getStages().get(currentStageSet);
+ FarmingStageData[] stages = currentStageSet != null ? farmingConfig.getStages().get(currentStageSet) : null;
+ if (stages == null) {
+ currentStageSet = farmingConfig.getStartingStageSet();
+ if (currentStageSet == null) {
+ return;
+ }
+
+ farmingBlock.setCurrentStageSet(currentStageSet);
+ stages = farmingConfig.getStages().get(currentStageSet);
+ blockChunk.markNeedsSaving();
+ }
+
if (stages != null) {
if (currentStage < 0) {
currentStage = 0;
@@ -88,6 +98,7 @@ public class FarmingUtil {
while (currentStage < stages.length) {
FarmingStageData stage = stages[currentStage];
if (stage.shouldStop(commandBuffer, sectionRef, blockRef, x, y, z)) {
+ blockChunk.markNeedsSaving();
farmingBlock.setGrowthProgress(stages.length);
commandBuffer.removeEntity(blockRef, RemoveReason.REMOVE);
break;
@@ -95,6 +106,7 @@ public class FarmingUtil {
Rangef range = stage.getDuration();
if (range == null) {
+ blockChunk.markNeedsSaving();
commandBuffer.removeEntity(blockRef, RemoveReason.REMOVE);
break;
}
@@ -131,6 +143,7 @@ public class FarmingUtil {
remainingTimeSeconds -= remainingDurationSeconds;
currentProgress = ++currentStage;
farmingBlock.setGrowthProgress(currentProgress);
+ blockChunk.markNeedsSaving();
farmingBlock.setGeneration(farmingBlock.getGeneration() + 1);
if (currentStage >= stages.length) {
if (stages[currentStage - 1].implementsShouldStop()) {
@@ -168,8 +181,10 @@ public class FarmingUtil {
}
}
- @NullableDecl
- public static CapturedNPCMetadata generateCapturedNPCMetadata(ComponentAccessor componentAccessor, Ref entityRef, int roleIndex) {
+ @Nullable
+ public static CapturedNPCMetadata generateCapturedNPCMetadata(
+ @Nonnull ComponentAccessor componentAccessor, @Nonnull Ref entityRef, int roleIndex
+ ) {
PersistentModel persistentModel = componentAccessor.getComponent(entityRef, PersistentModel.getComponentType());
if (persistentModel == null) {
return null;
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/component/CoopResidentComponent.java b/src/com/hypixel/hytale/builtin/adventure/farming/component/CoopResidentComponent.java
index 772c55b..263afae 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/component/CoopResidentComponent.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/component/CoopResidentComponent.java
@@ -7,7 +7,7 @@ import com.hypixel.hytale.component.Component;
import com.hypixel.hytale.component.ComponentType;
import com.hypixel.hytale.math.vector.Vector3i;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
-import org.checkerframework.checker.nullness.compatqual.NullableDecl;
+import javax.annotation.Nullable;
public class CoopResidentComponent implements Component {
public static final BuilderCodec CODEC = BuilderCodec.builder(CoopResidentComponent.class, CoopResidentComponent::new)
@@ -23,9 +23,6 @@ public class CoopResidentComponent implements Component {
private Vector3i coopLocation = new Vector3i();
private boolean markedForDespawn;
- public CoopResidentComponent() {
- }
-
public static ComponentType getComponentType() {
return FarmingPlugin.get().getCoopResidentComponentType();
}
@@ -46,7 +43,7 @@ public class CoopResidentComponent implements Component {
return this.markedForDespawn;
}
- @NullableDecl
+ @Nullable
@Override
public Component clone() {
CoopResidentComponent component = new CoopResidentComponent();
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/FertilizerGrowthModifierAsset.java b/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/FertilizerGrowthModifierAsset.java
index 2b266b5..c061d2d 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/FertilizerGrowthModifierAsset.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/FertilizerGrowthModifierAsset.java
@@ -16,9 +16,6 @@ public class FertilizerGrowthModifierAsset extends GrowthModifierAsset {
)
.build();
- public FertilizerGrowthModifierAsset() {
- }
-
@Override
public double getCurrentGrowthMultiplier(
CommandBuffer commandBuffer, Ref sectionRef, Ref blockRef, int x, int y, int z, boolean initialTick
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/LightLevelGrowthModifierAsset.java b/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/LightLevelGrowthModifierAsset.java
index c29be91..7a8521d 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/LightLevelGrowthModifierAsset.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/LightLevelGrowthModifierAsset.java
@@ -37,9 +37,6 @@ public class LightLevelGrowthModifierAsset extends GrowthModifierAsset {
protected Rangef sunlight;
protected boolean requireBoth;
- public LightLevelGrowthModifierAsset() {
- }
-
public LightLevelGrowthModifierAsset.ArtificialLight getArtificialLight() {
return this.artificialLight;
}
@@ -131,9 +128,6 @@ public class LightLevelGrowthModifierAsset extends GrowthModifierAsset {
protected Range green;
protected Range blue;
- public ArtificialLight() {
- }
-
public Range getRed() {
return this.red;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/WaterGrowthModifierAsset.java b/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/WaterGrowthModifierAsset.java
index f2134d8..bf7339d 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/WaterGrowthModifierAsset.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/config/modifiers/WaterGrowthModifierAsset.java
@@ -62,9 +62,6 @@ public class WaterGrowthModifierAsset extends GrowthModifierAsset {
protected IntOpenHashSet weatherIds;
protected int rainDuration;
- public WaterGrowthModifierAsset() {
- }
-
public String[] getFluids() {
return this.fluids;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/BlockStateFarmingStageData.java b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/BlockStateFarmingStageData.java
index fb84145..096423c 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/BlockStateFarmingStageData.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/BlockStateFarmingStageData.java
@@ -23,9 +23,6 @@ public class BlockStateFarmingStageData extends FarmingStageData {
.build();
protected String state;
- public BlockStateFarmingStageData() {
- }
-
public String getState() {
return this.state;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/BlockTypeFarmingStageData.java b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/BlockTypeFarmingStageData.java
index dcc0aa3..1e20b21 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/BlockTypeFarmingStageData.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/BlockTypeFarmingStageData.java
@@ -24,9 +24,6 @@ public class BlockTypeFarmingStageData extends FarmingStageData {
.build();
protected String block;
- public BlockTypeFarmingStageData() {
- }
-
public String getBlock() {
return this.block;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/PrefabFarmingStageData.java b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/PrefabFarmingStageData.java
index ca12622..f5785e9 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/PrefabFarmingStageData.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/PrefabFarmingStageData.java
@@ -71,9 +71,6 @@ public class PrefabFarmingStageData extends FarmingStageData {
private String[] replaceMaskTags = EMPTY_REPLACE_MASK;
private int[] replaceMaskTagIndices;
- public PrefabFarmingStageData() {
- }
-
private static double computeParticlesRate(@Nonnull IPrefabBuffer prefab) {
double xLength = prefab.getMaxX() - prefab.getMinX();
double yLength = prefab.getMaxY() - prefab.getMinY();
@@ -350,9 +347,6 @@ public class PrefabFarmingStageData extends FarmingStageData {
protected int weight = 1;
protected String path;
- public PrefabStage() {
- }
-
@Override
public double getWeight() {
return this.weight;
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/DirectionalGrowthBehaviour.java b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/DirectionalGrowthBehaviour.java
index 06623d2..82226cb 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/DirectionalGrowthBehaviour.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/DirectionalGrowthBehaviour.java
@@ -74,9 +74,6 @@ public class DirectionalGrowthBehaviour extends SpreadGrowthBehaviour {
protected IntRange verticalRange;
protected DirectionalGrowthBehaviour.VerticalDirection verticalDirection = DirectionalGrowthBehaviour.VerticalDirection.BOTH;
- public DirectionalGrowthBehaviour() {
- }
-
public IWeightedMap getBlockTypes() {
return this.blockTypes;
}
@@ -236,9 +233,6 @@ public class DirectionalGrowthBehaviour extends SpreadGrowthBehaviour {
protected double weight = 1.0;
protected String blockTypeKey;
- public BlockTypeWeight() {
- }
-
@Override
public double getWeight() {
return this.weight;
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/SpreadFarmingStageData.java b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/SpreadFarmingStageData.java
index 0a1e153..b1cf33e 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/SpreadFarmingStageData.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/SpreadFarmingStageData.java
@@ -66,9 +66,6 @@ public class SpreadFarmingStageData extends FarmingStageData {
protected IntRange spreadDecayPercent;
protected SpreadGrowthBehaviour[] spreadGrowthBehaviours;
- public SpreadFarmingStageData() {
- }
-
public IntRange getExecutions() {
return this.executions;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/SpreadGrowthBehaviour.java b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/SpreadGrowthBehaviour.java
index 6d917fc..60d81e8 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/SpreadGrowthBehaviour.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/config/stages/spread/SpreadGrowthBehaviour.java
@@ -23,9 +23,6 @@ public abstract class SpreadGrowthBehaviour {
.build();
protected WorldLocationCondition[] worldLocationConditions;
- public SpreadGrowthBehaviour() {
- }
-
public abstract void execute(ComponentAccessor var1, Ref var2, Ref var3, int var4, int var5, int var6, float var7);
protected boolean validatePosition(World world, int worldX, int worldY, int worldZ) {
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/ChangeFarmingStageInteraction.java b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/ChangeFarmingStageInteraction.java
index 1d1152b..2f8c5ca 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/ChangeFarmingStageInteraction.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/ChangeFarmingStageInteraction.java
@@ -81,9 +81,6 @@ public class ChangeFarmingStageInteraction extends SimpleBlockInteraction {
@Nullable
protected String targetStageSet = null;
- public ChangeFarmingStageInteraction() {
- }
-
@Nonnull
@Override
public WaitForDataFrom getWaitForDataFrom() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/FertilizeSoilInteraction.java b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/FertilizeSoilInteraction.java
index 3fc0d9b..7774f93 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/FertilizeSoilInteraction.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/FertilizeSoilInteraction.java
@@ -38,9 +38,6 @@ public class FertilizeSoilInteraction extends SimpleBlockInteraction {
.build();
protected String[] refreshModifiers;
- public FertilizeSoilInteraction() {
- }
-
@Nonnull
@Override
public WaitForDataFrom getWaitForDataFrom() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/HarvestCropInteraction.java b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/HarvestCropInteraction.java
index c404cb9..ece6658 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/HarvestCropInteraction.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/HarvestCropInteraction.java
@@ -28,9 +28,6 @@ public class HarvestCropInteraction extends SimpleBlockInteraction {
.documentation("Harvests the resources from the target farmable block.")
.build();
- public HarvestCropInteraction() {
- }
-
@Override
protected void interactWithBlock(
@Nonnull World world,
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseCaptureCrateInteraction.java b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseCaptureCrateInteraction.java
index 401bd8d..8c11f3c 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseCaptureCrateInteraction.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseCaptureCrateInteraction.java
@@ -37,8 +37,8 @@ import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import com.hypixel.hytale.server.npc.NPCPlugin;
import com.hypixel.hytale.server.npc.entities.NPCEntity;
import com.hypixel.hytale.server.npc.metadata.CapturedNPCMetadata;
-import org.checkerframework.checker.nullness.compatqual.NonNullDecl;
-import org.checkerframework.checker.nullness.compatqual.NullableDecl;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
public class UseCaptureCrateInteraction extends SimpleBlockInteraction {
public static final BuilderCodec CODEC = BuilderCodec.builder(
@@ -69,12 +69,9 @@ public class UseCaptureCrateInteraction extends SimpleBlockInteraction {
protected int[] acceptedNpcGroupIndexes;
protected String fullIcon;
- public UseCaptureCrateInteraction() {
- }
-
@Override
protected void tick0(
- boolean firstRun, float time, @NonNullDecl InteractionType type, @NonNullDecl InteractionContext context, @NonNullDecl CooldownHandler cooldownHandler
+ boolean firstRun, float time, @Nonnull InteractionType type, @Nonnull InteractionContext context, @Nonnull CooldownHandler cooldownHandler
) {
CommandBuffer commandBuffer = context.getCommandBuffer();
if (commandBuffer == null) {
@@ -84,59 +81,62 @@ public class UseCaptureCrateInteraction extends SimpleBlockInteraction {
if (item == null) {
context.getState().state = InteractionState.Failed;
} else {
- Ref playerRef = context.getEntity();
- LivingEntity playerEntity = (LivingEntity)EntityUtils.getEntity(playerRef, commandBuffer);
- Inventory playerInventory = playerEntity.getInventory();
- byte activeHotbarSlot = playerInventory.getActiveHotbarSlot();
- ItemStack inHandItemStack = playerInventory.getActiveHotbarItem();
- CapturedNPCMetadata existingMeta = item.getFromMetadataOrNull("CapturedEntity", CapturedNPCMetadata.CODEC);
- if (existingMeta != null) {
- super.tick0(firstRun, time, type, context, cooldownHandler);
+ Ref ref = context.getEntity();
+ if (!(EntityUtils.getEntity(ref, commandBuffer) instanceof LivingEntity livingEntity)) {
+ context.getState().state = InteractionState.Failed;
} else {
- Ref targetEntity = context.getTargetEntity();
- if (targetEntity == null) {
- context.getState().state = InteractionState.Failed;
+ Inventory inventory = livingEntity.getInventory();
+ byte activeHotbarSlot = inventory.getActiveHotbarSlot();
+ ItemStack inHandItemStack = inventory.getActiveHotbarItem();
+ CapturedNPCMetadata existingMeta = item.getFromMetadataOrNull("CapturedEntity", CapturedNPCMetadata.CODEC);
+ if (existingMeta != null) {
+ super.tick0(firstRun, time, type, context, cooldownHandler);
} else {
- NPCEntity npc = commandBuffer.getComponent(targetEntity, NPCEntity.getComponentType());
- if (npc == null) {
+ Ref targetEntity = context.getTargetEntity();
+ if (targetEntity == null) {
context.getState().state = InteractionState.Failed;
} else {
- TagSetPlugin.TagSetLookup tagSetPlugin = TagSetPlugin.get(NPCGroup.class);
- boolean tagFound = false;
-
- for (int group : this.acceptedNpcGroupIndexes) {
- if (tagSetPlugin.tagInSet(group, npc.getRoleIndex())) {
- tagFound = true;
- break;
- }
- }
-
- if (!tagFound) {
+ NPCEntity npcComponent = commandBuffer.getComponent(targetEntity, NPCEntity.getComponentType());
+ if (npcComponent == null) {
context.getState().state = InteractionState.Failed;
} else {
- PersistentModel persistentModel = commandBuffer.getComponent(targetEntity, PersistentModel.getComponentType());
- if (persistentModel == null) {
+ TagSetPlugin.TagSetLookup tagSetPlugin = TagSetPlugin.get(NPCGroup.class);
+ boolean tagFound = false;
+
+ for (int group : this.acceptedNpcGroupIndexes) {
+ if (tagSetPlugin.tagInSet(group, npcComponent.getRoleIndex())) {
+ tagFound = true;
+ break;
+ }
+ }
+
+ if (!tagFound) {
context.getState().state = InteractionState.Failed;
} else {
- ModelAsset modelAsset = ModelAsset.getAssetMap().getAsset(persistentModel.getModelReference().getModelAssetId());
- CapturedNPCMetadata meta = inHandItemStack.getFromMetadataOrDefault("CapturedEntity", CapturedNPCMetadata.CODEC);
- if (modelAsset != null) {
- meta.setIconPath(modelAsset.getIcon());
- }
+ PersistentModel persistentModel = commandBuffer.getComponent(targetEntity, PersistentModel.getComponentType());
+ if (persistentModel == null) {
+ context.getState().state = InteractionState.Failed;
+ } else {
+ ModelAsset modelAsset = ModelAsset.getAssetMap().getAsset(persistentModel.getModelReference().getModelAssetId());
+ CapturedNPCMetadata meta = inHandItemStack.getFromMetadataOrDefault("CapturedEntity", CapturedNPCMetadata.CODEC);
+ if (modelAsset != null) {
+ meta.setIconPath(modelAsset.getIcon());
+ }
- meta.setRoleIndex(npc.getRoleIndex());
- String npcName = NPCPlugin.get().getName(npc.getRoleIndex());
- if (npcName != null) {
- meta.setNpcNameKey(npcName);
- }
+ meta.setRoleIndex(npcComponent.getRoleIndex());
+ String npcName = NPCPlugin.get().getName(npcComponent.getRoleIndex());
+ if (npcName != null) {
+ meta.setNpcNameKey(npcName);
+ }
- if (this.fullIcon != null) {
- meta.setFullItemIcon(this.fullIcon);
- }
+ if (this.fullIcon != null) {
+ meta.setFullItemIcon(this.fullIcon);
+ }
- ItemStack itemWithNPC = inHandItemStack.withMetadata(CapturedNPCMetadata.KEYED_CODEC, meta);
- playerInventory.getHotbar().replaceItemStackInSlot(activeHotbarSlot, item, itemWithNPC);
- commandBuffer.removeEntity(targetEntity, RemoveReason.REMOVE);
+ ItemStack itemWithNPC = inHandItemStack.withMetadata(CapturedNPCMetadata.KEYED_CODEC, meta);
+ inventory.getHotbar().replaceItemStackInSlot(activeHotbarSlot, item, itemWithNPC);
+ commandBuffer.removeEntity(targetEntity, RemoveReason.REMOVE);
+ }
}
}
}
@@ -148,82 +148,81 @@ public class UseCaptureCrateInteraction extends SimpleBlockInteraction {
@Override
protected void interactWithBlock(
- @NonNullDecl World world,
- @NonNullDecl CommandBuffer commandBuffer,
- @NonNullDecl InteractionType type,
- @NonNullDecl InteractionContext context,
- @NullableDecl ItemStack itemInHand,
- @NonNullDecl Vector3i targetBlock,
- @NonNullDecl CooldownHandler cooldownHandler
+ @Nonnull World world,
+ @Nonnull CommandBuffer commandBuffer,
+ @Nonnull InteractionType type,
+ @Nonnull InteractionContext context,
+ @Nullable ItemStack itemInHand,
+ @Nonnull Vector3i targetBlock,
+ @Nonnull CooldownHandler cooldownHandler
) {
ItemStack item = context.getHeldItem();
if (item == null) {
context.getState().state = InteractionState.Failed;
} else {
- Ref playerRef = context.getEntity();
- LivingEntity playerEntity = (LivingEntity)EntityUtils.getEntity(playerRef, commandBuffer);
- Inventory playerInventory = playerEntity.getInventory();
- byte activeHotbarSlot = playerInventory.getActiveHotbarSlot();
- CapturedNPCMetadata existingMeta = item.getFromMetadataOrNull("CapturedEntity", CapturedNPCMetadata.CODEC);
- if (existingMeta == null) {
- context.getState().state = InteractionState.Failed;
- } else {
- BlockPosition pos = context.getTargetBlock();
- if (pos == null) {
+ Ref ref = context.getEntity();
+ if (EntityUtils.getEntity(ref, commandBuffer) instanceof LivingEntity livingEntity) {
+ Inventory inventory = livingEntity.getInventory();
+ byte activeHotbarSlot = inventory.getActiveHotbarSlot();
+ CapturedNPCMetadata existingMeta = item.getFromMetadataOrNull("CapturedEntity", CapturedNPCMetadata.CODEC);
+ if (existingMeta == null) {
context.getState().state = InteractionState.Failed;
} else {
- WorldChunk worldChunk = world.getChunk(ChunkUtil.indexChunkFromBlock(pos.x, pos.z));
- Ref blockRef = worldChunk.getBlockComponentEntity(pos.x, pos.y, pos.z);
- if (blockRef == null) {
- blockRef = BlockModule.ensureBlockEntity(worldChunk, pos.x, pos.y, pos.z);
- }
+ BlockPosition pos = context.getTargetBlock();
+ if (pos == null) {
+ context.getState().state = InteractionState.Failed;
+ } else {
+ WorldChunk worldChunk = world.getChunk(ChunkUtil.indexChunkFromBlock(pos.x, pos.z));
+ Ref blockRef = worldChunk.getBlockComponentEntity(pos.x, pos.y, pos.z);
+ if (blockRef == null) {
+ blockRef = BlockModule.ensureBlockEntity(worldChunk, pos.x, pos.y, pos.z);
+ }
- ItemStack noMetaItemStack = item.withMetadata(null);
- if (blockRef != null) {
- Store chunkStore = world.getChunkStore().getStore();
- CoopBlock coopBlockState = chunkStore.getComponent(blockRef, CoopBlock.getComponentType());
- if (coopBlockState != null) {
- WorldTimeResource worldTimeResource = commandBuffer.getResource(WorldTimeResource.getResourceType());
- if (coopBlockState.tryPutResident(existingMeta, worldTimeResource)) {
- world.execute(
- () -> coopBlockState.ensureSpawnResidentsInWorld(
- world, world.getEntityStore().getStore(), new Vector3d(pos.x, pos.y, pos.z), new Vector3d().assign(Vector3d.FORWARD)
- )
- );
- playerInventory.getHotbar().replaceItemStackInSlot(activeHotbarSlot, item, noMetaItemStack);
- } else {
- context.getState().state = InteractionState.Failed;
+ ItemStack noMetaItemStack = item.withMetadata(null);
+ if (blockRef != null) {
+ Store chunkStore = world.getChunkStore().getStore();
+ CoopBlock coopBlockState = chunkStore.getComponent(blockRef, CoopBlock.getComponentType());
+ if (coopBlockState != null) {
+ WorldTimeResource worldTimeResource = commandBuffer.getResource(WorldTimeResource.getResourceType());
+ if (coopBlockState.tryPutResident(existingMeta, worldTimeResource)) {
+ world.execute(
+ () -> coopBlockState.ensureSpawnResidentsInWorld(
+ world, world.getEntityStore().getStore(), new Vector3d(pos.x, pos.y, pos.z), new Vector3d().assign(Vector3d.FORWARD)
+ )
+ );
+ inventory.getHotbar().replaceItemStackInSlot(activeHotbarSlot, item, noMetaItemStack);
+ } else {
+ context.getState().state = InteractionState.Failed;
+ }
+
+ return;
}
-
- return;
}
- }
- Vector3d spawnPos = new Vector3d(pos.x + 0.5F, pos.y, pos.z + 0.5F);
- if (context.getClientState() != null) {
- BlockFace blockFace = BlockFace.fromProtocolFace(context.getClientState().blockFace);
- if (blockFace != null) {
- spawnPos.add(blockFace.getDirection());
+ Vector3d spawnPos = new Vector3d(pos.x + 0.5F, pos.y, pos.z + 0.5F);
+ if (context.getClientState() != null) {
+ BlockFace blockFace = BlockFace.fromProtocolFace(context.getClientState().blockFace);
+ if (blockFace != null) {
+ spawnPos.add(blockFace.getDirection());
+ }
}
- }
- NPCPlugin npcModule = NPCPlugin.get();
- Store store = context.getCommandBuffer().getStore();
- int roleIndex = existingMeta.getRoleIndex();
- commandBuffer.run(_store -> npcModule.spawnEntity(store, roleIndex, spawnPos, Vector3f.ZERO, null, null));
- playerInventory.getHotbar().replaceItemStackInSlot(activeHotbarSlot, item, noMetaItemStack);
+ NPCPlugin npcModule = NPCPlugin.get();
+ Store store = context.getCommandBuffer().getStore();
+ int roleIndex = existingMeta.getRoleIndex();
+ commandBuffer.run(_store -> npcModule.spawnEntity(store, roleIndex, spawnPos, Vector3f.ZERO, null, null));
+ inventory.getHotbar().replaceItemStackInSlot(activeHotbarSlot, item, noMetaItemStack);
+ }
}
+ } else {
+ context.getState().state = InteractionState.Failed;
}
}
}
@Override
protected void simulateInteractWithBlock(
- @NonNullDecl InteractionType type,
- @NonNullDecl InteractionContext context,
- @NullableDecl ItemStack itemInHand,
- @NonNullDecl World world,
- @NonNullDecl Vector3i targetBlock
+ @Nonnull InteractionType type, @Nonnull InteractionContext context, @Nullable ItemStack itemInHand, @Nonnull World world, @Nonnull Vector3i targetBlock
) {
}
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseCoopInteraction.java b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseCoopInteraction.java
index 5c543a6..532287f 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseCoopInteraction.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseCoopInteraction.java
@@ -22,8 +22,8 @@ import com.hypixel.hytale.server.core.universe.world.World;
import com.hypixel.hytale.server.core.universe.world.chunk.WorldChunk;
import com.hypixel.hytale.server.core.universe.world.storage.ChunkStore;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
-import org.checkerframework.checker.nullness.compatqual.NonNullDecl;
-import org.checkerframework.checker.nullness.compatqual.NullableDecl;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
public class UseCoopInteraction extends SimpleBlockInteraction {
public static final BuilderCodec CODEC = BuilderCodec.builder(
@@ -31,18 +31,15 @@ public class UseCoopInteraction extends SimpleBlockInteraction {
)
.build();
- public UseCoopInteraction() {
- }
-
@Override
protected void interactWithBlock(
- @NonNullDecl World world,
- @NonNullDecl CommandBuffer commandBuffer,
- @NonNullDecl InteractionType type,
- @NonNullDecl InteractionContext context,
- @NullableDecl ItemStack itemInHand,
- @NonNullDecl Vector3i targetBlock,
- @NonNullDecl CooldownHandler cooldownHandler
+ @Nonnull World world,
+ @Nonnull CommandBuffer commandBuffer,
+ @Nonnull InteractionType type,
+ @Nonnull InteractionContext context,
+ @Nullable ItemStack itemInHand,
+ @Nonnull Vector3i targetBlock,
+ @Nonnull CooldownHandler cooldownHandler
) {
int x = targetBlock.getX();
int z = targetBlock.getZ();
@@ -85,11 +82,7 @@ public class UseCoopInteraction extends SimpleBlockInteraction {
@Override
protected void simulateInteractWithBlock(
- @NonNullDecl InteractionType type,
- @NonNullDecl InteractionContext context,
- @NullableDecl ItemStack itemInHand,
- @NonNullDecl World world,
- @NonNullDecl Vector3i targetBlock
+ @Nonnull InteractionType type, @Nonnull InteractionContext context, @Nullable ItemStack itemInHand, @Nonnull World world, @Nonnull Vector3i targetBlock
) {
}
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseWateringCanInteraction.java b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseWateringCanInteraction.java
index b4f37ed..1d339cb 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseWateringCanInteraction.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/interactions/UseWateringCanInteraction.java
@@ -43,9 +43,6 @@ public class UseWateringCanInteraction extends SimpleBlockInteraction {
protected long duration;
protected String[] refreshModifiers;
- public UseWateringCanInteraction() {
- }
-
@Nonnull
@Override
public WaitForDataFrom getWaitForDataFrom() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/states/CoopBlock.java b/src/com/hypixel/hytale/builtin/adventure/farming/states/CoopBlock.java
index b6ab6b8..0cc5209 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/states/CoopBlock.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/states/CoopBlock.java
@@ -45,6 +45,7 @@ import com.hypixel.hytale.server.spawning.ISpawnableWithModel;
import com.hypixel.hytale.server.spawning.SpawnTestResult;
import com.hypixel.hytale.server.spawning.SpawningContext;
import it.unimi.dsi.fastutil.Pair;
+import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
@@ -55,7 +56,7 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
-import org.checkerframework.checker.nullness.compatqual.NullableDecl;
+import javax.annotation.Nullable;
public class CoopBlock implements Component {
public static final String STATE_PRODUCE = "Produce_Ready";
@@ -71,7 +72,6 @@ public class CoopBlock implements Component {
.append(new KeyedCodec<>("Storage", ItemContainer.CODEC), (coop, storage) -> coop.itemContainer = storage, coop -> coop.itemContainer)
.add()
.build();
- HytaleLogger LOGGER = HytaleLogger.forEnclosingClass();
protected String coopAssetId;
protected List residents = new ArrayList<>();
protected ItemContainer itemContainer = EmptyItemContainer.INSTANCE;
@@ -85,7 +85,7 @@ public class CoopBlock implements Component {
this.itemContainer = ItemContainer.ensureContainerCapacity(this.itemContainer, (short)5, SimpleItemContainer::new, remainder);
}
- @NullableDecl
+ @Nullable
public FarmingCoopAsset getCoopAsset() {
return FarmingCoopAsset.getAssetMap().getAsset(this.coopAssetId);
}
@@ -94,7 +94,7 @@ public class CoopBlock implements Component {
this.coopAssetId = farmingCoopId;
this.residents.addAll(residents);
this.itemContainer = itemContainer.clone();
- ArrayList remainder = new ArrayList<>();
+ List remainder = new ObjectArrayList<>();
this.itemContainer = ItemContainer.ensureContainerCapacity(this.itemContainer, (short)5, SimpleItemContainer::new, remainder);
}
@@ -336,7 +336,7 @@ public class CoopBlock implements Component {
}
}
- @NullableDecl
+ @Nullable
public Instant getNextScheduledTick(WorldTimeResource worldTimeResource) {
Instant gameTime = worldTimeResource.getGameTime();
LocalDateTime gameDateTime = worldTimeResource.getGameDateTime();
@@ -431,7 +431,7 @@ public class CoopBlock implements Component {
.add()
.build();
protected CapturedNPCMetadata metadata;
- @NullableDecl
+ @Nullable
protected PersistentRef persistentRef;
protected boolean deployedToWorld;
protected Instant lastProduced;
@@ -449,12 +449,12 @@ public class CoopBlock implements Component {
return this.metadata;
}
- @NullableDecl
+ @Nullable
public PersistentRef getPersistentRef() {
return this.persistentRef;
}
- public void setPersistentRef(@NullableDecl PersistentRef persistentRef) {
+ public void setPersistentRef(@Nullable PersistentRef persistentRef) {
this.persistentRef = persistentRef;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/farming/states/FarmingBlockState.java b/src/com/hypixel/hytale/builtin/adventure/farming/states/FarmingBlockState.java
index b490d86..967bc3f 100644
--- a/src/com/hypixel/hytale/builtin/adventure/farming/states/FarmingBlockState.java
+++ b/src/com/hypixel/hytale/builtin/adventure/farming/states/FarmingBlockState.java
@@ -43,9 +43,6 @@ public class FarmingBlockState implements Component {
public double lastGrowthMultiplier;
public float spreadRate = 1.0F;
- public FarmingBlockState() {
- }
-
public String getCurrentFarmingStageSetName() {
return this.currentFarmingStageSetName;
}
@@ -115,8 +112,5 @@ public class FarmingBlockState implements Component {
protected static final int ON_UNLOADING = 3;
protected static final int ON_LOADING = 5;
protected static final int NONE = 0;
-
- protected RefreshFlags() {
- }
}
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/MemoriesGameplayConfig.java b/src/com/hypixel/hytale/builtin/adventure/memories/MemoriesGameplayConfig.java
index 0dade29..d435c18 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/MemoriesGameplayConfig.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/MemoriesGameplayConfig.java
@@ -6,6 +6,7 @@ import com.hypixel.hytale.codec.builder.BuilderCodec;
import com.hypixel.hytale.codec.validation.Validators;
import com.hypixel.hytale.server.core.asset.type.gameplay.GameplayConfig;
import com.hypixel.hytale.server.core.asset.type.item.config.Item;
+import com.hypixel.hytale.server.core.asset.type.model.config.ModelParticle;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -37,13 +38,28 @@ public class MemoriesGameplayConfig {
.addValidator(Validators.nonNull())
.addValidator(Item.VALIDATOR_CACHE.getValidator())
.add()
+ .appendInherited(
+ new KeyedCodec<>("MemoriesCatchEntityParticle", ModelParticle.CODEC),
+ (activationEffects, s) -> activationEffects.memoriesCatchEntityParticle = s,
+ activationEffects -> activationEffects.memoriesCatchEntityParticle,
+ (activationEffects, parent) -> activationEffects.memoriesCatchEntityParticle = parent.memoriesCatchEntityParticle
+ )
+ .addValidator(Validators.nonNull())
+ .add()
+ .appendInherited(
+ new KeyedCodec<>("MemoriesCatchParticleViewDistance", Codec.INTEGER),
+ (memoriesGameplayConfig, integer) -> memoriesGameplayConfig.memoriesCatchParticleViewDistance = integer,
+ memoriesGameplayConfig -> memoriesGameplayConfig.memoriesCatchParticleViewDistance,
+ (memoriesGameplayConfig, parent) -> memoriesGameplayConfig.memoriesCatchParticleViewDistance = parent.memoriesCatchParticleViewDistance
+ )
+ .addValidator(Validators.greaterThan(16))
+ .add()
.build();
private int[] memoriesAmountPerLevel;
private String memoriesRecordParticles;
private String memoriesCatchItemId;
-
- public MemoriesGameplayConfig() {
- }
+ private ModelParticle memoriesCatchEntityParticle;
+ private int memoriesCatchParticleViewDistance = 64;
@Nullable
public static MemoriesGameplayConfig get(@Nonnull GameplayConfig config) {
@@ -61,4 +77,12 @@ public class MemoriesGameplayConfig {
public String getMemoriesCatchItemId() {
return this.memoriesCatchItemId;
}
+
+ public ModelParticle getMemoriesCatchEntityParticle() {
+ return this.memoriesCatchEntityParticle;
+ }
+
+ public int getMemoriesCatchParticleViewDistance() {
+ return this.memoriesCatchParticleViewDistance;
+ }
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/MemoriesPlugin.java b/src/com/hypixel/hytale/builtin/adventure/memories/MemoriesPlugin.java
index 585e97f..db16993 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/MemoriesPlugin.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/MemoriesPlugin.java
@@ -10,6 +10,8 @@ import com.hypixel.hytale.builtin.adventure.memories.memories.npc.NPCMemory;
import com.hypixel.hytale.builtin.adventure.memories.memories.npc.NPCMemoryProvider;
import com.hypixel.hytale.builtin.adventure.memories.page.MemoriesPage;
import com.hypixel.hytale.builtin.adventure.memories.page.MemoriesPageSupplier;
+import com.hypixel.hytale.builtin.adventure.memories.page.MemoriesUnlockedPage;
+import com.hypixel.hytale.builtin.adventure.memories.page.MemoriesUnlockedPageSuplier;
import com.hypixel.hytale.builtin.adventure.memories.temple.ForgottenTempleConfig;
import com.hypixel.hytale.builtin.adventure.memories.temple.TempleRespawnPlayersSystem;
import com.hypixel.hytale.builtin.adventure.memories.window.MemoriesWindow;
@@ -51,7 +53,7 @@ import com.hypixel.hytale.server.npc.AllNPCsLoadedEvent;
import it.unimi.dsi.fastutil.objects.Object2DoubleMap;
import it.unimi.dsi.fastutil.objects.Object2DoubleMaps;
import it.unimi.dsi.fastutil.objects.Object2DoubleOpenHashMap;
-import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
+import it.unimi.dsi.fastutil.objects.Object2ObjectRBTreeMap;
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import java.io.IOException;
import java.nio.file.Files;
@@ -70,7 +72,7 @@ public class MemoriesPlugin extends JavaPlugin {
private static MemoriesPlugin instance;
private final Config config = this.withConfig(MemoriesPlugin.MemoriesPluginConfig.CODEC);
private final List> providers = new ObjectArrayList<>();
- private final Map> allMemories = new Object2ObjectOpenHashMap<>();
+ private final Map> allMemories = new Object2ObjectRBTreeMap<>();
private ComponentType playerMemoriesComponentType;
@Nullable
private MemoriesPlugin.RecordedMemories recordedMemories;
@@ -90,6 +92,7 @@ public class MemoriesPlugin extends JavaPlugin {
ComponentRegistryProxy entityStoreRegistry = this.getEntityStoreRegistry();
this.getCommandRegistry().registerCommand(new MemoriesCommand());
OpenCustomUIInteraction.registerCustomPageSupplier(this, MemoriesPage.class, "Memories", new MemoriesPageSupplier());
+ OpenCustomUIInteraction.registerCustomPageSupplier(this, MemoriesUnlockedPage.class, "MemoriesUnlocked", new MemoriesUnlockedPageSuplier());
Window.CLIENT_REQUESTABLE_WINDOW_TYPES.put(WindowType.Memories, MemoriesWindow::new);
this.playerMemoriesComponentType = entityStoreRegistry.registerComponent(PlayerMemories.class, "PlayerMemories", PlayerMemories.CODEC);
NPCMemoryProvider npcMemoryProvider = new NPCMemoryProvider();
@@ -129,14 +132,16 @@ public class MemoriesPlugin extends JavaPlugin {
@Override
protected void shutdown() {
- this.recordedMemories.lock.readLock().lock();
+ if (this.hasInitializedMemories) {
+ this.recordedMemories.lock.readLock().lock();
- try {
- BsonUtil.writeSync(Constants.UNIVERSE_PATH.resolve("memories.json"), MemoriesPlugin.RecordedMemories.CODEC, this.recordedMemories, this.getLogger());
- } catch (IOException var5) {
- throw new RuntimeException(var5);
- } finally {
- this.recordedMemories.lock.readLock().unlock();
+ try {
+ BsonUtil.writeSync(Constants.UNIVERSE_PATH.resolve("memories.json"), MemoriesPlugin.RecordedMemories.CODEC, this.recordedMemories, this.getLogger());
+ } catch (IOException var5) {
+ throw new RuntimeException(var5);
+ } finally {
+ this.recordedMemories.lock.readLock().unlock();
+ }
}
}
@@ -177,30 +182,16 @@ public class MemoriesPlugin extends JavaPlugin {
int recordedMemoriesCount = this.getRecordedMemories().size();
int[] memoriesAmountPerLevel = config.getMemoriesAmountPerLevel();
- for (int i = 0; i < memoriesAmountPerLevel.length && recordedMemoriesCount >= memoriesAmountPerLevel[i]; i++) {
- memoriesLevel += i + 1;
+ for (int i = memoriesAmountPerLevel.length - 1; i >= 0; i--) {
+ if (recordedMemoriesCount >= memoriesAmountPerLevel[i]) {
+ return i + 2;
+ }
}
return memoriesLevel;
}
}
- public int getMemoriesForNextLevel(@Nonnull GameplayConfig gameplayConfig) {
- MemoriesGameplayConfig memoriesConfig = MemoriesGameplayConfig.get(gameplayConfig);
- if (memoriesConfig == null) {
- return -1;
- } else {
- int memoriesLevel = this.getMemoriesLevel(gameplayConfig);
- int[] memoriesAmountPerLevel = memoriesConfig.getMemoriesAmountPerLevel();
- if (memoriesLevel >= memoriesAmountPerLevel.length) {
- return -1;
- } else {
- int recordedMemoriesCount = this.getRecordedMemories().size();
- return memoriesAmountPerLevel[memoriesLevel] - recordedMemoriesCount;
- }
- }
- }
-
public boolean hasRecordedMemory(Memory memory) {
this.recordedMemories.lock.readLock().lock();
@@ -274,6 +265,39 @@ public class MemoriesPlugin extends JavaPlugin {
}
}
+ public int setRecordedMemoriesCount(int count) {
+ if (count < 0) {
+ count = 0;
+ }
+
+ this.recordedMemories.lock.writeLock().lock();
+
+ int var12;
+ try {
+ this.recordedMemories.memories.clear();
+ List allAvailableMemories = new ObjectArrayList<>();
+
+ for (Entry> entry : this.allMemories.entrySet()) {
+ allAvailableMemories.addAll(entry.getValue());
+ }
+
+ int actualCount = Math.min(count, allAvailableMemories.size());
+
+ for (int i = 0; i < actualCount; i++) {
+ this.recordedMemories.memories.add(allAvailableMemories.get(i));
+ }
+
+ BsonUtil.writeSync(Constants.UNIVERSE_PATH.resolve("memories.json"), MemoriesPlugin.RecordedMemories.CODEC, this.recordedMemories, this.getLogger());
+ var12 = actualCount;
+ } catch (IOException var8) {
+ throw new RuntimeException(var8);
+ } finally {
+ this.recordedMemories.lock.writeLock().unlock();
+ }
+
+ return var12;
+ }
+
public static class MemoriesPluginConfig {
public static final BuilderCodec CODEC = BuilderCodec.builder(
MemoriesPlugin.MemoriesPluginConfig.class, MemoriesPlugin.MemoriesPluginConfig::new
@@ -287,9 +311,6 @@ public class MemoriesPlugin extends JavaPlugin {
.build();
private Object2DoubleMap collectionRadius;
- public MemoriesPluginConfig() {
- }
-
@Nonnull
public Object2DoubleMap getCollectionRadius() {
return (Object2DoubleMap)(this.collectionRadius != null ? this.collectionRadius : Object2DoubleMaps.EMPTY_MAP);
@@ -302,9 +323,6 @@ public class MemoriesPlugin extends JavaPlugin {
@Nonnull
private final Query query = Query.and(Player.getComponentType(), PlayerRef.getComponentType());
- public PlayerAddedSystem() {
- }
-
@Nonnull
@Override
public Query getQuery() {
@@ -355,8 +373,5 @@ public class MemoriesPlugin extends JavaPlugin {
.build();
private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
private final Set memories = new HashSet<>();
-
- private RecordedMemories() {
- }
}
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/commands/MemoriesCommand.java b/src/com/hypixel/hytale/builtin/adventure/memories/commands/MemoriesCommand.java
index dd661f7..eacb28e 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/commands/MemoriesCommand.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/commands/MemoriesCommand.java
@@ -9,5 +9,6 @@ public class MemoriesCommand extends AbstractCommandCollection {
this.addSubCommand(new MemoriesCapacityCommand());
this.addSubCommand(new MemoriesLevelCommand());
this.addSubCommand(new MemoriesUnlockCommand());
+ this.addSubCommand(new MemoriesSetCountCommand());
}
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/commands/MemoriesSetCountCommand.java b/src/com/hypixel/hytale/builtin/adventure/memories/commands/MemoriesSetCountCommand.java
new file mode 100644
index 0000000..7d60f7e
--- /dev/null
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/commands/MemoriesSetCountCommand.java
@@ -0,0 +1,34 @@
+package com.hypixel.hytale.builtin.adventure.memories.commands;
+
+import com.hypixel.hytale.builtin.adventure.memories.MemoriesPlugin;
+import com.hypixel.hytale.component.Store;
+import com.hypixel.hytale.server.core.Message;
+import com.hypixel.hytale.server.core.command.system.CommandContext;
+import com.hypixel.hytale.server.core.command.system.arguments.system.RequiredArg;
+import com.hypixel.hytale.server.core.command.system.arguments.types.ArgTypes;
+import com.hypixel.hytale.server.core.command.system.basecommands.AbstractWorldCommand;
+import com.hypixel.hytale.server.core.universe.world.World;
+import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
+import javax.annotation.Nonnull;
+
+public class MemoriesSetCountCommand extends AbstractWorldCommand {
+ @Nonnull
+ private static final Message MESSAGE_COMMANDS_MEMORIES_SETCOUNT_INVALID = Message.translation("server.commands.memories.setCount.invalid");
+ @Nonnull
+ private final RequiredArg countArg = this.withRequiredArg("count", "server.commands.memories.setCount.count.desc", ArgTypes.INTEGER);
+
+ public MemoriesSetCountCommand() {
+ super("setCount", "server.commands.memories.setCount.desc");
+ }
+
+ @Override
+ protected void execute(@Nonnull CommandContext context, @Nonnull World world, @Nonnull Store store) {
+ int count = this.countArg.get(context);
+ if (count < 0) {
+ context.sendMessage(MESSAGE_COMMANDS_MEMORIES_SETCOUNT_INVALID);
+ } else {
+ int actualCount = MemoriesPlugin.get().setRecordedMemoriesCount(count);
+ context.sendMessage(Message.translation("server.commands.memories.setCount.success").param("requested", count).param("actual", actualCount));
+ }
+ }
+}
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/component/PlayerMemories.java b/src/com/hypixel/hytale/builtin/adventure/memories/component/PlayerMemories.java
index 04e06da..10580a0 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/component/PlayerMemories.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/component/PlayerMemories.java
@@ -32,9 +32,6 @@ public class PlayerMemories implements Component {
private final Set memories = new LinkedHashSet<>();
private int memoriesCapacity;
- public PlayerMemories() {
- }
-
public static ComponentType getComponentType() {
return MemoriesPlugin.get().getPlayerMemoriesComponentType();
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/interactions/MemoriesConditionInteraction.java b/src/com/hypixel/hytale/builtin/adventure/memories/interactions/MemoriesConditionInteraction.java
index 602952c..3b8f3de 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/interactions/MemoriesConditionInteraction.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/interactions/MemoriesConditionInteraction.java
@@ -28,7 +28,6 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry;
import java.util.Arrays;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.checkerframework.checker.nullness.compatqual.NonNullDecl;
public class MemoriesConditionInteraction extends Interaction {
@Nonnull
@@ -68,12 +67,9 @@ public class MemoriesConditionInteraction extends Interaction {
@Nullable
private String failed;
- public MemoriesConditionInteraction() {
- }
-
@Override
protected void tick0(
- boolean firstRun, float time, @NonNullDecl InteractionType type, @NonNullDecl InteractionContext context, @NonNullDecl CooldownHandler cooldownHandler
+ boolean firstRun, float time, @Nonnull InteractionType type, @Nonnull InteractionContext context, @Nonnull CooldownHandler cooldownHandler
) {
CommandBuffer commandBuffer = context.getCommandBuffer();
@@ -95,7 +91,7 @@ public class MemoriesConditionInteraction extends Interaction {
@Override
protected void simulateTick0(
- boolean firstRun, float time, @NonNullDecl InteractionType type, @NonNullDecl InteractionContext context, @NonNullDecl CooldownHandler cooldownHandler
+ boolean firstRun, float time, @Nonnull InteractionType type, @Nonnull InteractionContext context, @Nonnull CooldownHandler cooldownHandler
) {
int memoriesLevel = context.getServerState().chainingIndex;
int labelIndex = this.levelToLabel.get(memoriesLevel);
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/interactions/SetMemoriesCapacityInteraction.java b/src/com/hypixel/hytale/builtin/adventure/memories/interactions/SetMemoriesCapacityInteraction.java
index c5a9fc3..8692daa 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/interactions/SetMemoriesCapacityInteraction.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/interactions/SetMemoriesCapacityInteraction.java
@@ -33,9 +33,6 @@ public class SetMemoriesCapacityInteraction extends SimpleInstantInteraction {
.build();
private int capacity;
- public SetMemoriesCapacityInteraction() {
- }
-
@Override
protected void firstRun(@Nonnull InteractionType type, @Nonnull InteractionContext context, @Nonnull CooldownHandler cooldownHandler) {
Ref ref = context.getEntity();
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/memories/Memory.java b/src/com/hypixel/hytale/builtin/adventure/memories/memories/Memory.java
index 2b134c6..3710f4d 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/memories/Memory.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/memories/Memory.java
@@ -8,9 +8,6 @@ import javax.annotation.Nullable;
public abstract class Memory {
public static final CodecMapCodec CODEC = new CodecMapCodec<>();
- public Memory() {
- }
-
public abstract String getId();
public abstract String getTitle();
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/memories/npc/NPCMemory.java b/src/com/hypixel/hytale/builtin/adventure/memories/memories/npc/NPCMemory.java
index 3c044e3..72b97a4 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/memories/npc/NPCMemory.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/memories/npc/NPCMemory.java
@@ -18,17 +18,22 @@ import com.hypixel.hytale.component.Ref;
import com.hypixel.hytale.component.Store;
import com.hypixel.hytale.component.query.Query;
import com.hypixel.hytale.component.spatial.SpatialResource;
+import com.hypixel.hytale.component.spatial.SpatialStructure;
import com.hypixel.hytale.component.system.tick.EntityTickingSystem;
import com.hypixel.hytale.math.util.MathUtil;
import com.hypixel.hytale.math.vector.Vector3d;
import com.hypixel.hytale.protocol.GameMode;
+import com.hypixel.hytale.protocol.packets.entities.SpawnModelParticles;
import com.hypixel.hytale.server.core.Message;
+import com.hypixel.hytale.server.core.asset.type.model.config.ModelParticle;
import com.hypixel.hytale.server.core.entity.entities.Player;
import com.hypixel.hytale.server.core.inventory.ItemStack;
+import com.hypixel.hytale.server.core.modules.entity.EntityModule;
import com.hypixel.hytale.server.core.modules.entity.component.BoundingBox;
import com.hypixel.hytale.server.core.modules.entity.component.TransformComponent;
import com.hypixel.hytale.server.core.modules.entity.item.ItemComponent;
import com.hypixel.hytale.server.core.modules.entity.item.PickupItemComponent;
+import com.hypixel.hytale.server.core.modules.entity.tracker.NetworkId;
import com.hypixel.hytale.server.core.modules.i18n.I18nModule;
import com.hypixel.hytale.server.core.universe.PlayerRef;
import com.hypixel.hytale.server.core.universe.world.World;
@@ -229,6 +234,7 @@ public class NPCMemory extends Memory {
assert playerRefComponent != null;
+ Ref ref = archetypeChunk.getReferenceTo(index);
MemoriesPlugin memoriesPlugin = MemoriesPlugin.get();
PlayerMemories playerMemoriesComponent = archetypeChunk.getComponent(index, PlayerMemories.getComponentType());
@@ -269,17 +275,22 @@ public class NPCMemory extends Memory {
if (memoriesGameplayConfig != null) {
ItemStack memoryItemStack = new ItemStack(memoriesGameplayConfig.getMemoriesCatchItemId());
Vector3d memoryItemHolderPosition = npcTransformComponent.getPosition().clone();
- BoundingBox boundingBox = commandBuffer.getComponent(npcRef, BoundingBox.getComponentType());
- if (boundingBox != null) {
- memoryItemHolderPosition.y = memoryItemHolderPosition.y + boundingBox.getBoundingBox().middleY();
+ BoundingBox boundingBoxComponent = commandBuffer.getComponent(npcRef, BoundingBox.getComponentType());
+ if (boundingBoxComponent != null) {
+ memoryItemHolderPosition.y = memoryItemHolderPosition.y + boundingBoxComponent.getBoundingBox().middleY();
}
Holder memoryItemHolder = ItemComponent.generatePickedUpItem(
- memoryItemStack, memoryItemHolderPosition, commandBuffer, playerRefComponent.getReference()
+ memoryItemStack, memoryItemHolderPosition, commandBuffer, ref
);
float memoryCatchItemLifetimeS = 0.62F;
- memoryItemHolder.getComponent(PickupItemComponent.getComponentType()).setInitialLifeTime(memoryCatchItemLifetimeS);
+ PickupItemComponent pickupItemComponent = memoryItemHolder.getComponent(PickupItemComponent.getComponentType());
+
+ assert pickupItemComponent != null;
+
+ pickupItemComponent.setInitialLifeTime(0.62F);
commandBuffer.addEntity(memoryItemHolder, AddReason.SPAWN);
+ displayCatchEntityParticles(memoriesGameplayConfig, memoryItemHolderPosition, npcRef, commandBuffer);
}
}
}
@@ -308,6 +319,31 @@ public class NPCMemory extends Memory {
}
}
+ private static void displayCatchEntityParticles(
+ MemoriesGameplayConfig memoriesGameplayConfig, Vector3d targetPosition, Ref targetRef, @Nonnull CommandBuffer commandBuffer
+ ) {
+ ModelParticle particle = memoriesGameplayConfig.getMemoriesCatchEntityParticle();
+ if (particle != null) {
+ NetworkId networkIdComponent = commandBuffer.getComponent(targetRef, NetworkId.getComponentType());
+ if (networkIdComponent != null) {
+ com.hypixel.hytale.protocol.ModelParticle[] modelParticlesProtocol = new com.hypixel.hytale.protocol.ModelParticle[]{particle.toPacket()};
+ SpawnModelParticles packet = new SpawnModelParticles(networkIdComponent.getId(), modelParticlesProtocol);
+ SpatialResource[, EntityStore> spatialResource = commandBuffer.getResource(EntityModule.get().getPlayerSpatialResourceType());
+ SpatialStructure][> spatialStructure = spatialResource.getSpatialStructure();
+ ObjectList][> results = SpatialResource.getThreadLocalReferenceList();
+ spatialStructure.ordered(targetPosition, memoriesGameplayConfig.getMemoriesCatchParticleViewDistance(), results);
+
+ for (Ref ref : results) {
+ PlayerRef playerRefComponent = commandBuffer.getComponent(ref, PlayerRef.getComponentType());
+
+ assert playerRefComponent != null;
+
+ playerRefComponent.getPacketHandler().write(packet);
+ }
+ }
+ }
+ }
+
@Nonnull
@Override
public Query getQuery() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/memories/npc/NPCMemoryProvider.java b/src/com/hypixel/hytale/builtin/adventure/memories/memories/npc/NPCMemoryProvider.java
index 234ea7c..551e6bf 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/memories/npc/NPCMemoryProvider.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/memories/npc/NPCMemoryProvider.java
@@ -18,7 +18,6 @@ import java.util.Set;
import java.util.logging.Level;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.checkerframework.checker.nullness.compatqual.NullableDecl;
public class NPCMemoryProvider extends MemoryProvider {
public static final double DEFAULT_RADIUS = 10.0;
@@ -82,7 +81,7 @@ public class NPCMemoryProvider extends MemoryProvider {
}
}
- @NullableDecl
+ @Nullable
private static String getMemoriesNameOverride(@Nonnull Builder> builder) {
if (builder instanceof ISpawnableWithModel spawnableWithModel) {
ExecutionContext executionContext = new ExecutionContext();
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/page/MemoriesPage.java b/src/com/hypixel/hytale/builtin/adventure/memories/page/MemoriesPage.java
index b88675e..9ddd995 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/page/MemoriesPage.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/page/MemoriesPage.java
@@ -76,6 +76,9 @@ public class MemoriesPage extends InteractiveCustomUIPage CODEC = new EnumCodec<>(MemoriesPage.PageAction.class);
-
- private PageAction() {
- }
}
public static class PageEventData {
@@ -395,8 +402,5 @@ public class MemoriesPage extends InteractiveCustomUIPage ref, ComponentAccessor componentAccessor, PlayerRef playerRef, InteractionContext context) {
return new MemoriesPage(playerRef, context.getTargetBlock());
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/page/MemoriesUnlockedPage.java b/src/com/hypixel/hytale/builtin/adventure/memories/page/MemoriesUnlockedPage.java
new file mode 100644
index 0000000..012a830
--- /dev/null
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/page/MemoriesUnlockedPage.java
@@ -0,0 +1,71 @@
+package com.hypixel.hytale.builtin.adventure.memories.page;
+
+import com.hypixel.hytale.builtin.adventure.memories.MemoriesPlugin;
+import com.hypixel.hytale.codec.Codec;
+import com.hypixel.hytale.codec.KeyedCodec;
+import com.hypixel.hytale.codec.builder.BuilderCodec;
+import com.hypixel.hytale.codec.codecs.EnumCodec;
+import com.hypixel.hytale.component.Ref;
+import com.hypixel.hytale.component.Store;
+import com.hypixel.hytale.protocol.BlockPosition;
+import com.hypixel.hytale.protocol.packets.interface_.CustomPageLifetime;
+import com.hypixel.hytale.protocol.packets.interface_.CustomUIEventBindingType;
+import com.hypixel.hytale.server.core.entity.entities.Player;
+import com.hypixel.hytale.server.core.entity.entities.player.pages.InteractiveCustomUIPage;
+import com.hypixel.hytale.server.core.ui.builder.EventData;
+import com.hypixel.hytale.server.core.ui.builder.UICommandBuilder;
+import com.hypixel.hytale.server.core.ui.builder.UIEventBuilder;
+import com.hypixel.hytale.server.core.universe.PlayerRef;
+import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
+import javax.annotation.Nonnull;
+
+public class MemoriesUnlockedPage extends InteractiveCustomUIPage {
+ private final BlockPosition blockPosition;
+
+ public MemoriesUnlockedPage(@Nonnull PlayerRef playerRef, BlockPosition blockPosition) {
+ super(playerRef, CustomPageLifetime.CanDismissOrCloseThroughInteraction, MemoriesUnlockedPage.PageEventData.CODEC);
+ this.blockPosition = blockPosition;
+ }
+
+ @Override
+ public void build(
+ @Nonnull Ref ref, @Nonnull UICommandBuilder commandBuilder, @Nonnull UIEventBuilder eventBuilder, @Nonnull Store store
+ ) {
+ MemoriesPlugin memoriesPlugin = MemoriesPlugin.get();
+ commandBuilder.append("Pages/Memories/MemoriesUnlocked.ui");
+ eventBuilder.addEventBinding(
+ CustomUIEventBindingType.Activating, "#DiscoverMemoriesButton", new EventData().append("Action", MemoriesUnlockedPage.PageAction.DiscoverMemories)
+ );
+ }
+
+ public void handleDataEvent(@Nonnull Ref ref, @Nonnull Store store, @Nonnull MemoriesUnlockedPage.PageEventData data) {
+ Player player = store.getComponent(ref, Player.getComponentType());
+
+ assert player != null;
+
+ if (data.action == MemoriesUnlockedPage.PageAction.DiscoverMemories) {
+ player.getPageManager().openCustomPage(ref, store, new MemoriesPage(this.playerRef, this.blockPosition));
+ }
+ }
+
+ public static enum PageAction {
+ DiscoverMemories;
+
+ public static final Codec CODEC = new EnumCodec<>(MemoriesUnlockedPage.PageAction.class);
+ }
+
+ public static class PageEventData {
+ public static final String KEY_ACTION = "Action";
+ public static final BuilderCodec CODEC = BuilderCodec.builder(
+ MemoriesUnlockedPage.PageEventData.class, MemoriesUnlockedPage.PageEventData::new
+ )
+ .append(
+ new KeyedCodec<>("Action", MemoriesUnlockedPage.PageAction.CODEC),
+ (pageEventData, pageAction) -> pageEventData.action = pageAction,
+ pageEventData -> pageEventData.action
+ )
+ .add()
+ .build();
+ public MemoriesUnlockedPage.PageAction action;
+ }
+}
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/page/MemoriesUnlockedPageSuplier.java b/src/com/hypixel/hytale/builtin/adventure/memories/page/MemoriesUnlockedPageSuplier.java
new file mode 100644
index 0000000..801c140
--- /dev/null
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/page/MemoriesUnlockedPageSuplier.java
@@ -0,0 +1,18 @@
+package com.hypixel.hytale.builtin.adventure.memories.page;
+
+import com.hypixel.hytale.component.ComponentAccessor;
+import com.hypixel.hytale.component.Ref;
+import com.hypixel.hytale.server.core.entity.InteractionContext;
+import com.hypixel.hytale.server.core.entity.entities.player.pages.CustomUIPage;
+import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.OpenCustomUIInteraction;
+import com.hypixel.hytale.server.core.universe.PlayerRef;
+import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
+import javax.annotation.Nullable;
+
+public class MemoriesUnlockedPageSuplier implements OpenCustomUIInteraction.CustomPageSupplier {
+ @Nullable
+ @Override
+ public CustomUIPage tryCreate(Ref ref, ComponentAccessor componentAccessor, PlayerRef playerRef, InteractionContext context) {
+ return new MemoriesUnlockedPage(playerRef, context.getTargetBlock());
+ }
+}
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/temple/ForgottenTempleConfig.java b/src/com/hypixel/hytale/builtin/adventure/memories/temple/ForgottenTempleConfig.java
index 8d19bc4..67760a9 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/temple/ForgottenTempleConfig.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/temple/ForgottenTempleConfig.java
@@ -17,9 +17,6 @@ public class ForgottenTempleConfig {
private double minYRespawn = 5.0;
private String respawnSound;
- public ForgottenTempleConfig() {
- }
-
public double getMinYRespawn() {
return this.minYRespawn;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/temple/TempleRespawnPlayersSystem.java b/src/com/hypixel/hytale/builtin/adventure/memories/temple/TempleRespawnPlayersSystem.java
index 7d98f16..16da925 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/temple/TempleRespawnPlayersSystem.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/temple/TempleRespawnPlayersSystem.java
@@ -17,8 +17,8 @@ import com.hypixel.hytale.server.core.universe.world.SoundUtil;
import com.hypixel.hytale.server.core.universe.world.World;
import com.hypixel.hytale.server.core.universe.world.spawn.ISpawnProvider;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
-import org.checkerframework.checker.nullness.compatqual.NonNullDecl;
-import org.checkerframework.checker.nullness.compatqual.NullableDecl;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
public class TempleRespawnPlayersSystem extends DelayedEntitySystem {
public static final Query QUERY = Query.and(PlayerRef.getComponentType(), TransformComponent.getComponentType());
@@ -31,27 +31,32 @@ public class TempleRespawnPlayersSystem extends DelayedEntitySystem
public void tick(
float dt,
int index,
- @NonNullDecl ArchetypeChunk archetypeChunk,
- @NonNullDecl Store store,
- @NonNullDecl CommandBuffer commandBuffer
+ @Nonnull ArchetypeChunk archetypeChunk,
+ @Nonnull Store store,
+ @Nonnull CommandBuffer commandBuffer
) {
World world = store.getExternalData().getWorld();
GameplayConfig gameplayConfig = world.getGameplayConfig();
ForgottenTempleConfig config = gameplayConfig.getPluginConfig().get(ForgottenTempleConfig.class);
if (config != null) {
- Vector3d position = archetypeChunk.getComponent(index, TransformComponent.getComponentType()).getPosition();
+ TransformComponent transformComponent = archetypeChunk.getComponent(index, TransformComponent.getComponentType());
+
+ assert transformComponent != null;
+
+ Vector3d position = transformComponent.getPosition();
if (!(position.getY() > config.getMinYRespawn())) {
Ref ref = archetypeChunk.getReferenceTo(index);
ISpawnProvider spawnProvider = world.getWorldConfig().getSpawnProvider();
- Transform spawnPoint = spawnProvider.getSpawnPoint(ref, commandBuffer);
- commandBuffer.addComponent(ref, Teleport.getComponentType(), new Teleport(null, spawnPoint));
+ Transform spawnTransform = spawnProvider.getSpawnPoint(ref, commandBuffer);
+ Teleport teleportComponent = Teleport.createForPlayer(null, spawnTransform);
+ commandBuffer.addComponent(ref, Teleport.getComponentType(), teleportComponent);
PlayerRef playerRef = archetypeChunk.getComponent(index, PlayerRef.getComponentType());
SoundUtil.playSoundEvent2dToPlayer(playerRef, config.getRespawnSoundIndex(), SoundCategory.SFX);
}
}
}
- @NullableDecl
+ @Nullable
@Override
public Query getQuery() {
return QUERY;
diff --git a/src/com/hypixel/hytale/builtin/adventure/memories/window/MemoriesWindow.java b/src/com/hypixel/hytale/builtin/adventure/memories/window/MemoriesWindow.java
index 6b239ee..c5b8eb0 100644
--- a/src/com/hypixel/hytale/builtin/adventure/memories/window/MemoriesWindow.java
+++ b/src/com/hypixel/hytale/builtin/adventure/memories/window/MemoriesWindow.java
@@ -6,7 +6,9 @@ import com.hypixel.hytale.builtin.adventure.memories.MemoriesPlugin;
import com.hypixel.hytale.builtin.adventure.memories.component.PlayerMemories;
import com.hypixel.hytale.builtin.adventure.memories.memories.Memory;
import com.hypixel.hytale.codec.EmptyExtraInfo;
+import com.hypixel.hytale.component.ComponentAccessor;
import com.hypixel.hytale.component.Ref;
+import com.hypixel.hytale.component.Store;
import com.hypixel.hytale.protocol.packets.window.WindowType;
import com.hypixel.hytale.server.core.Message;
import com.hypixel.hytale.server.core.entity.entities.player.windows.Window;
@@ -32,14 +34,13 @@ public class MemoriesWindow extends Window {
}
@Override
- public boolean onOpen0() {
+ public boolean onOpen0(@Nonnull Ref ref, @Nonnull Store store) {
JsonArray array = new JsonArray();
- Ref ref = this.getPlayerRef().getReference();
- PlayerMemories playerMemories = ref.getStore().getComponent(ref, PlayerMemories.getComponentType());
- if (playerMemories != null) {
- this.windowData.addProperty("capacity", playerMemories.getMemoriesCapacity());
+ PlayerMemories playerMemoriesComponent = store.getComponent(ref, PlayerMemories.getComponentType());
+ if (playerMemoriesComponent != null) {
+ this.windowData.addProperty("capacity", playerMemoriesComponent.getMemoriesCapacity());
- for (Memory memory : playerMemories.getRecordedMemories()) {
+ for (Memory memory : playerMemoriesComponent.getRecordedMemories()) {
JsonObject obj = new JsonObject();
obj.addProperty("title", memory.getTitle());
obj.add("tooltipText", BsonUtil.translateBsonToJson(Message.CODEC.encode(memory.getTooltipText(), EmptyExtraInfo.EMPTY).asDocument()));
@@ -79,6 +80,6 @@ public class MemoriesWindow extends Window {
}
@Override
- public void onClose0() {
+ public void onClose0(@Nonnull Ref ref, @Nonnull ComponentAccessor componentAccessor) {
}
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/assets/KillSpawnBeaconObjectiveTaskAsset.java b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/assets/KillSpawnBeaconObjectiveTaskAsset.java
index e805fbb..4b3247b 100644
--- a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/assets/KillSpawnBeaconObjectiveTaskAsset.java
+++ b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/assets/KillSpawnBeaconObjectiveTaskAsset.java
@@ -97,9 +97,6 @@ public class KillSpawnBeaconObjectiveTaskAsset extends KillObjectiveTaskAsset {
protected Vector3d offset;
protected WorldLocationProvider worldLocationProvider;
- public ObjectiveSpawnBeacon() {
- }
-
public String getSpawnBeaconId() {
return this.spawnBeaconId;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderActionCompleteTask.java b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderActionCompleteTask.java
index 31c67c7..1d1a6a2 100644
--- a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderActionCompleteTask.java
+++ b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderActionCompleteTask.java
@@ -13,9 +13,6 @@ import javax.annotation.Nonnull;
public class BuilderActionCompleteTask extends BuilderActionPlayAnimation {
protected final BooleanHolder playAnimation = new BooleanHolder();
- public BuilderActionCompleteTask() {
- }
-
@Nonnull
@Override
public String getShortDescription() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderActionStartObjective.java b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderActionStartObjective.java
index 93ccc22..a65a07d 100644
--- a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderActionStartObjective.java
+++ b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderActionStartObjective.java
@@ -14,9 +14,6 @@ import javax.annotation.Nonnull;
public class BuilderActionStartObjective extends BuilderActionBase {
protected final AssetHolder objectiveId = new AssetHolder();
- public BuilderActionStartObjective() {
- }
-
@Nonnull
@Override
public String getShortDescription() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderSensorHasTask.java b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderSensorHasTask.java
index 1af9bb2..a55f799 100644
--- a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderSensorHasTask.java
+++ b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/npc/builders/BuilderSensorHasTask.java
@@ -17,9 +17,6 @@ import javax.annotation.Nullable;
public class BuilderSensorHasTask extends BuilderSensorBase {
protected final StringArrayHolder tasksById = new StringArrayHolder();
- public BuilderSensorHasTask() {
- }
-
@Nonnull
@Override
public String getShortDescription() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/resources/KillTrackerResource.java b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/resources/KillTrackerResource.java
index 64dd1f8..53d2d44 100644
--- a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/resources/KillTrackerResource.java
+++ b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/resources/KillTrackerResource.java
@@ -12,9 +12,6 @@ import javax.annotation.Nonnull;
public class KillTrackerResource implements Resource {
private final List killTasks = new ObjectArrayList<>();
- public KillTrackerResource() {
- }
-
public static ResourceType getResourceType() {
return NPCObjectivesPlugin.get().getKillTrackerResourceType();
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/systems/KillTrackerSystem.java b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/systems/KillTrackerSystem.java
index fb7a166..1afcd58 100644
--- a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/systems/KillTrackerSystem.java
+++ b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/systems/KillTrackerSystem.java
@@ -15,9 +15,6 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class KillTrackerSystem extends DeathSystems.OnDeathSystem {
- public KillTrackerSystem() {
- }
-
@Nullable
@Override
public Query getQuery() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/systems/SpawnBeaconCheckRemovalSystem.java b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/systems/SpawnBeaconCheckRemovalSystem.java
index 1505f22..81bec39 100644
--- a/src/com/hypixel/hytale/builtin/adventure/npcobjectives/systems/SpawnBeaconCheckRemovalSystem.java
+++ b/src/com/hypixel/hytale/builtin/adventure/npcobjectives/systems/SpawnBeaconCheckRemovalSystem.java
@@ -14,9 +14,6 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class SpawnBeaconCheckRemovalSystem extends HolderSystem {
- public SpawnBeaconCheckRemovalSystem() {
- }
-
@Nullable
@Override
public Query getQuery() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/npcreputation/ReputationAttitudeSystem.java b/src/com/hypixel/hytale/builtin/adventure/npcreputation/ReputationAttitudeSystem.java
index a3c6736..423ecdb 100644
--- a/src/com/hypixel/hytale/builtin/adventure/npcreputation/ReputationAttitudeSystem.java
+++ b/src/com/hypixel/hytale/builtin/adventure/npcreputation/ReputationAttitudeSystem.java
@@ -13,9 +13,6 @@ import javax.annotation.Nonnull;
public class ReputationAttitudeSystem extends StoreSystem {
private final ResourceType resourceType = Blackboard.getResourceType();
- public ReputationAttitudeSystem() {
- }
-
@Override
public void onSystemAddedToStore(@Nonnull Store store) {
Blackboard blackboard = store.getResource(this.resourceType);
diff --git a/src/com/hypixel/hytale/builtin/adventure/npcshop/npc/builders/BuilderActionOpenBarterShop.java b/src/com/hypixel/hytale/builtin/adventure/npcshop/npc/builders/BuilderActionOpenBarterShop.java
index c95945f..3cccc8c 100644
--- a/src/com/hypixel/hytale/builtin/adventure/npcshop/npc/builders/BuilderActionOpenBarterShop.java
+++ b/src/com/hypixel/hytale/builtin/adventure/npcshop/npc/builders/BuilderActionOpenBarterShop.java
@@ -15,9 +15,6 @@ import javax.annotation.Nonnull;
public class BuilderActionOpenBarterShop extends BuilderActionBase {
protected final AssetHolder shopId = new AssetHolder();
- public BuilderActionOpenBarterShop() {
- }
-
@Nonnull
@Override
public String getShortDescription() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/npcshop/npc/builders/BuilderActionOpenShop.java b/src/com/hypixel/hytale/builtin/adventure/npcshop/npc/builders/BuilderActionOpenShop.java
index c534425..2465143 100644
--- a/src/com/hypixel/hytale/builtin/adventure/npcshop/npc/builders/BuilderActionOpenShop.java
+++ b/src/com/hypixel/hytale/builtin/adventure/npcshop/npc/builders/BuilderActionOpenShop.java
@@ -15,9 +15,6 @@ import javax.annotation.Nonnull;
public class BuilderActionOpenShop extends BuilderActionBase {
protected final AssetHolder shopId = new AssetHolder();
- public BuilderActionOpenShop() {
- }
-
@Nonnull
@Override
public String getShortDescription() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/DialogPage.java b/src/com/hypixel/hytale/builtin/adventure/objectives/DialogPage.java
index d06ad12..65c1705 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/DialogPage.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/DialogPage.java
@@ -45,8 +45,5 @@ public class DialogPage extends InteractiveCustomUIPage ref, @Nonnull ComponentAccessor componentAccessor) {
if (!this.opened) {
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveLocationMarkerCommand.java b/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveLocationMarkerCommand.java
index a6f804a..73404ef 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveLocationMarkerCommand.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveLocationMarkerCommand.java
@@ -31,17 +31,6 @@ import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import javax.annotation.Nonnull;
public class ObjectiveLocationMarkerCommand extends AbstractCommandCollection {
- @Nonnull
- private static final Message MESSAGE_COMMANDS_OBJECTIVE_LOCATION_MARKER_NOT_FOUND = Message.translation("server.commands.objective.locationMarker.notFound");
- @Nonnull
- private static final Message MESSAGE_GENERAL_FAILED_DID_YOU_MEAN = Message.translation("server.general.failed.didYouMean");
- @Nonnull
- private static final Message MESSAGE_COMMANDS_OBJECTIVE_LOCATION_MARKER_ADDED = Message.translation("server.commands.objective.locationMarker.added");
- @Nonnull
- private static final Message MESSAGE_COMMANDS_OBJECTIVE_LOCATION_MARKER_ENABLED = Message.translation("server.commands.objective.locationMarker.enabled");
- @Nonnull
- private static final Message MESSAGE_COMMANDS_OBJECTIVE_LOCATION_MARKER_DISABLED = Message.translation("server.commands.objective.locationMarker.disabled");
-
public ObjectiveLocationMarkerCommand() {
super("locationmarker", "server.commands.objective.locationMarker");
this.addAliases("marker");
@@ -71,9 +60,9 @@ public class ObjectiveLocationMarkerCommand extends AbstractCommandCollection {
String objectiveLocationMarkerId = this.locationMarkerArg.get(context);
if (ObjectiveLocationMarkerAsset.getAssetMap().getAsset(objectiveLocationMarkerId) == null) {
- context.sendMessage(ObjectiveLocationMarkerCommand.MESSAGE_COMMANDS_OBJECTIVE_LOCATION_MARKER_NOT_FOUND.param("id", objectiveLocationMarkerId));
+ context.sendMessage(Message.translation("server.commands.objective.locationMarker.notFound").param("id", objectiveLocationMarkerId));
context.sendMessage(
- ObjectiveLocationMarkerCommand.MESSAGE_GENERAL_FAILED_DID_YOU_MEAN
+ Message.translation("server.general.failed.didYouMean")
.param(
"choices",
StringUtil.sortByFuzzyDistance(
@@ -95,7 +84,7 @@ public class ObjectiveLocationMarkerCommand extends AbstractCommandCollection {
holder.ensureComponent(Intangible.getComponentType());
holder.ensureComponent(HiddenFromAdventurePlayers.getComponentType());
store.addEntity(holder, AddReason.SPAWN);
- context.sendMessage(ObjectiveLocationMarkerCommand.MESSAGE_COMMANDS_OBJECTIVE_LOCATION_MARKER_ADDED.param("id", objectiveLocationMarkerId));
+ context.sendMessage(Message.translation("server.commands.objective.locationMarker.added").param("id", objectiveLocationMarkerId));
}
}
}
@@ -110,7 +99,7 @@ public class ObjectiveLocationMarkerCommand extends AbstractCommandCollection {
WorldConfig worldConfig = world.getWorldConfig();
worldConfig.setObjectiveMarkersEnabled(false);
worldConfig.markChanged();
- context.sendMessage(ObjectiveLocationMarkerCommand.MESSAGE_COMMANDS_OBJECTIVE_LOCATION_MARKER_DISABLED.param("worldName", world.getName()));
+ context.sendMessage(Message.translation("server.commands.objective.locationMarker.disabled").param("worldName", world.getName()));
}
}
@@ -124,7 +113,7 @@ public class ObjectiveLocationMarkerCommand extends AbstractCommandCollection {
WorldConfig worldConfig = world.getWorldConfig();
worldConfig.setObjectiveMarkersEnabled(true);
worldConfig.markChanged();
- context.sendMessage(ObjectiveLocationMarkerCommand.MESSAGE_COMMANDS_OBJECTIVE_LOCATION_MARKER_ENABLED.param("worldName", world.getName()));
+ context.sendMessage(Message.translation("server.commands.objective.locationMarker.enabled").param("worldName", world.getName()));
}
}
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveReachLocationMarkerCommand.java b/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveReachLocationMarkerCommand.java
index b2622d9..88497d5 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveReachLocationMarkerCommand.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveReachLocationMarkerCommand.java
@@ -29,17 +29,6 @@ import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import javax.annotation.Nonnull;
public class ObjectiveReachLocationMarkerCommand extends AbstractCommandCollection {
- @Nonnull
- private static final Message MESSAGE_COMMANDS_OBJECTIVE_REACH_LOCATION_MARKER_NOT_FOUND = Message.translation(
- "server.commands.objective.reachLocationMarker.notFound"
- );
- @Nonnull
- private static final Message MESSAGE_GENERAL_FAILED_DID_YOU_MEAN = Message.translation("server.general.failed.didYouMean");
- @Nonnull
- private static final Message MESSAGE_COMMANDS_OBJECTIVE_REACH_LOCATION_MARKER_ADDED = Message.translation(
- "server.commands.objective.reachLocationMarker.added"
- );
-
public ObjectiveReachLocationMarkerCommand() {
super("reachlocationmarker", "server.commands.objective.reachLocationMarker");
this.addSubCommand(new ObjectiveReachLocationMarkerCommand.AddReachLocationMarkerCommand());
@@ -61,11 +50,9 @@ public class ObjectiveReachLocationMarkerCommand extends AbstractCommandCollecti
) {
String reachLocationMarkerId = this.reachLocationMarkerArg.get(context);
if (ReachLocationMarkerAsset.getAssetMap().getAsset(reachLocationMarkerId) == null) {
+ context.sendMessage(Message.translation("server.commands.objective.reachLocationMarker.notFound").param("id", reachLocationMarkerId));
context.sendMessage(
- ObjectiveReachLocationMarkerCommand.MESSAGE_COMMANDS_OBJECTIVE_REACH_LOCATION_MARKER_NOT_FOUND.param("id", reachLocationMarkerId)
- );
- context.sendMessage(
- ObjectiveReachLocationMarkerCommand.MESSAGE_GENERAL_FAILED_DID_YOU_MEAN
+ Message.translation("server.general.failed.didYouMean")
.param(
"choices",
StringUtil.sortByFuzzyDistance(
@@ -91,7 +78,7 @@ public class ObjectiveReachLocationMarkerCommand extends AbstractCommandCollecti
holder.ensureComponent(Intangible.getComponentType());
holder.ensureComponent(HiddenFromAdventurePlayers.getComponentType());
store.addEntity(holder, AddReason.SPAWN);
- context.sendMessage(ObjectiveReachLocationMarkerCommand.MESSAGE_COMMANDS_OBJECTIVE_REACH_LOCATION_MARKER_ADDED.param("id", reachLocationMarkerId));
+ context.sendMessage(Message.translation("server.commands.objective.reachLocationMarker.added").param("id", reachLocationMarkerId));
}
}
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveStartCommand.java b/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveStartCommand.java
index 372dc99..2cc8206 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveStartCommand.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/commands/ObjectiveStartCommand.java
@@ -29,10 +29,6 @@ public class ObjectiveStartCommand extends AbstractCommandCollection {
}
public static class StartObjectiveCommand extends AbstractPlayerCommand {
- @Nonnull
- private static final Message MESSAGE_COMMANDS_OBJECTIVE_OBJECTIVE_NOT_FOUND = Message.translation("server.commands.objective.objectiveNotFound");
- @Nonnull
- private static final Message MESSAGE_GENERAL_FAILED_DID_YOU_MEAN = Message.translation("server.general.failed.didYouMean");
@Nonnull
private final RequiredArg objectiveArg = this.withRequiredArg(
"objectiveId", "server.commands.objective.start.objective.arg.objectiveId.desc", ArgTypes.STRING
@@ -49,12 +45,13 @@ public class ObjectiveStartCommand extends AbstractCommandCollection {
String objectiveId = this.objectiveArg.get(context);
ObjectiveAsset asset = ObjectiveAsset.getAssetMap().getAsset(objectiveId);
if (asset == null) {
- context.sendMessage(MESSAGE_COMMANDS_OBJECTIVE_OBJECTIVE_NOT_FOUND.param("id", objectiveId));
+ context.sendMessage(Message.translation("server.commands.objective.objectiveNotFound").param("id", objectiveId));
context.sendMessage(
- MESSAGE_GENERAL_FAILED_DID_YOU_MEAN.param(
- "choices",
- StringUtil.sortByFuzzyDistance(objectiveId, ObjectiveAsset.getAssetMap().getAssetMap().keySet(), CommandUtil.RECOMMEND_COUNT).toString()
- )
+ Message.translation("server.general.failed.didYouMean")
+ .param(
+ "choices",
+ StringUtil.sortByFuzzyDistance(objectiveId, ObjectiveAsset.getAssetMap().getAssetMap().keySet(), CommandUtil.RECOMMEND_COUNT).toString()
+ )
);
} else {
HashSet playerSet = new HashSet<>();
@@ -68,10 +65,6 @@ public class ObjectiveStartCommand extends AbstractCommandCollection {
}
public static class StartObjectiveLineCommand extends AbstractPlayerCommand {
- @Nonnull
- private static final Message MESSAGE_COMMANDS_OBJECTIVE_OBJECTIVE_LINE_NOT_FOUND = Message.translation("server.commands.objective.objectiveLineNotFound");
- @Nonnull
- private static final Message MESSAGE_GENERAL_FAILED_DID_YOU_MEAN = Message.translation("server.general.failed.didYouMean");
@Nonnull
private final RequiredArg objectiveLineArg = this.withRequiredArg(
"objectiveLineId", "server.commands.objective.start.objectiveLine.arg.objectiveLineId.desc", ArgTypes.STRING
@@ -87,13 +80,14 @@ public class ObjectiveStartCommand extends AbstractCommandCollection {
) {
String objectiveLineId = this.objectiveLineArg.get(context);
if (ObjectiveLineAsset.getAssetMap().getAsset(objectiveLineId) == null) {
- context.sendMessage(MESSAGE_COMMANDS_OBJECTIVE_OBJECTIVE_LINE_NOT_FOUND.param("id", objectiveLineId));
+ context.sendMessage(Message.translation("server.commands.objective.objectiveLineNotFound").param("id", objectiveLineId));
context.sendMessage(
- MESSAGE_GENERAL_FAILED_DID_YOU_MEAN.param(
- "choices",
- StringUtil.sortByFuzzyDistance(objectiveLineId, ObjectiveLineAsset.getAssetMap().getAssetMap().keySet(), CommandUtil.RECOMMEND_COUNT)
- .toString()
- )
+ Message.translation("server.general.failed.didYouMean")
+ .param(
+ "choices",
+ StringUtil.sortByFuzzyDistance(objectiveLineId, ObjectiveLineAsset.getAssetMap().getAssetMap().keySet(), CommandUtil.RECOMMEND_COUNT)
+ .toString()
+ )
);
} else {
HashSet playerSet = new HashSet<>();
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/completion/ClearObjectiveItemsCompletion.java b/src/com/hypixel/hytale/builtin/adventure/objectives/completion/ClearObjectiveItemsCompletion.java
index 182f383..491264e 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/completion/ClearObjectiveItemsCompletion.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/completion/ClearObjectiveItemsCompletion.java
@@ -5,7 +5,6 @@ import com.hypixel.hytale.builtin.adventure.objectives.config.completion.ClearOb
import com.hypixel.hytale.builtin.adventure.objectives.config.completion.ObjectiveCompletionAsset;
import com.hypixel.hytale.builtin.adventure.objectives.interactions.StartObjectiveInteraction;
import com.hypixel.hytale.component.ComponentAccessor;
-import com.hypixel.hytale.server.core.entity.Entity;
import com.hypixel.hytale.server.core.entity.EntityUtils;
import com.hypixel.hytale.server.core.entity.LivingEntity;
import com.hypixel.hytale.server.core.inventory.ItemStack;
@@ -27,9 +26,8 @@ public class ClearObjectiveItemsCompletion extends ObjectiveCompletion {
@Override
public void handle(@Nonnull Objective objective, @Nonnull ComponentAccessor componentAccessor) {
objective.forEachParticipant((participantReference, objectiveUuid) -> {
- Entity entity = EntityUtils.getEntity(participantReference, componentAccessor);
- if (entity instanceof LivingEntity) {
- CombinedItemContainer inventory = ((LivingEntity)entity).getInventory().getCombinedHotbarFirst();
+ if (EntityUtils.getEntity(participantReference, componentAccessor) instanceof LivingEntity livingEntity) {
+ CombinedItemContainer inventory = livingEntity.getInventory().getCombinedHotbarFirst();
for (short i = 0; i < inventory.getCapacity(); i++) {
ItemStack itemStack = inventory.getItemStack(i);
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/components/ObjectiveHistoryComponent.java b/src/com/hypixel/hytale/builtin/adventure/objectives/components/ObjectiveHistoryComponent.java
index bd365cf..17afea2 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/components/ObjectiveHistoryComponent.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/components/ObjectiveHistoryComponent.java
@@ -29,9 +29,6 @@ public class ObjectiveHistoryComponent implements Component {
private Map objectiveHistoryMap = new Object2ObjectOpenHashMap<>();
private Map objectiveLineHistoryMap = new Object2ObjectOpenHashMap<>();
- public ObjectiveHistoryComponent() {
- }
-
public Map getObjectiveHistoryMap() {
return this.objectiveHistoryMap;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/ObjectiveLocationMarkerAsset.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/ObjectiveLocationMarkerAsset.java
index a5da578..79811ec 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/ObjectiveLocationMarkerAsset.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/ObjectiveLocationMarkerAsset.java
@@ -96,9 +96,6 @@ public class ObjectiveLocationMarkerAsset implements JsonAssetWithMap)getAssetStore().getAssetMap();
}
- public ObjectiveLocationMarkerAsset() {
- }
-
public String getId() {
return this.id;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/gameplayconfig/ObjectiveGameplayConfig.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/gameplayconfig/ObjectiveGameplayConfig.java
index 0e06831..a1e4da0 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/gameplayconfig/ObjectiveGameplayConfig.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/gameplayconfig/ObjectiveGameplayConfig.java
@@ -25,9 +25,6 @@ public class ObjectiveGameplayConfig {
.build();
protected Map starterObjectiveLinePerWorld;
- public ObjectiveGameplayConfig() {
- }
-
@Nullable
public static ObjectiveGameplayConfig get(@Nonnull GameplayConfig config) {
return config.getPluginConfig().get(ObjectiveGameplayConfig.class);
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/markerarea/ObjectiveLocationMarkerArea.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/markerarea/ObjectiveLocationMarkerArea.java
index a7a21d0..f350bf7 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/markerarea/ObjectiveLocationMarkerArea.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/markerarea/ObjectiveLocationMarkerArea.java
@@ -18,9 +18,6 @@ public abstract class ObjectiveLocationMarkerArea {
protected Box entryAreaBox;
protected Box exitAreaBox;
- public ObjectiveLocationMarkerArea() {
- }
-
public abstract void getPlayersInEntryArea(
@Nonnull SpatialResource][, EntityStore> var1, @Nonnull List][> var2, @Nonnull Vector3d var3
);
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/ObjectiveTypeSetup.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/ObjectiveTypeSetup.java
index cb0089a..3687e4e 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/ObjectiveTypeSetup.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/ObjectiveTypeSetup.java
@@ -13,9 +13,6 @@ public abstract class ObjectiveTypeSetup {
@Nonnull
public static final CodecMapCodec CODEC = new CodecMapCodec<>("Type");
- public ObjectiveTypeSetup() {
- }
-
@Nullable
public abstract String getObjectiveIdToStart();
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/SetupObjective.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/SetupObjective.java
index 092c7c8..218cedc 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/SetupObjective.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/SetupObjective.java
@@ -25,9 +25,6 @@ public class SetupObjective extends ObjectiveTypeSetup {
.build();
protected String objectiveId;
- public SetupObjective() {
- }
-
@Override
public String getObjectiveIdToStart() {
return this.objectiveId;
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/SetupObjectiveLine.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/SetupObjectiveLine.java
index 3559594..c1892a8 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/SetupObjectiveLine.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/objectivesetup/SetupObjectiveLine.java
@@ -27,9 +27,6 @@ public class SetupObjectiveLine extends ObjectiveTypeSetup {
.build();
protected String objectiveLineId;
- public SetupObjectiveLine() {
- }
-
@Nullable
@Override
public String getObjectiveIdToStart() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/ObjectiveTaskAsset.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/ObjectiveTaskAsset.java
index 0e059f4..fae15f2 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/ObjectiveTaskAsset.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/ObjectiveTaskAsset.java
@@ -104,9 +104,6 @@ public abstract class ObjectiveTaskAsset {
MARKER,
PLAYER_AND_MARKER;
- private TaskScope() {
- }
-
public boolean isTaskPossibleForMarker() {
return this == MARKER || this == PLAYER_AND_MARKER;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/ReachLocationTaskAsset.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/ReachLocationTaskAsset.java
index 22b190f..439963f 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/ReachLocationTaskAsset.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/ReachLocationTaskAsset.java
@@ -21,9 +21,6 @@ public class ReachLocationTaskAsset extends ObjectiveTaskAsset {
.build();
protected String targetLocationId;
- public ReachLocationTaskAsset() {
- }
-
@Nonnull
@Override
public ObjectiveTaskAsset.TaskScope getTaskScope() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/TreasureMapObjectiveTaskAsset.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/TreasureMapObjectiveTaskAsset.java
index e625099..3d121ac 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/TreasureMapObjectiveTaskAsset.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/task/TreasureMapObjectiveTaskAsset.java
@@ -112,9 +112,6 @@ public class TreasureMapObjectiveTaskAsset extends ObjectiveTaskAsset {
protected WorldLocationProvider worldLocationProvider;
protected String chestBlockTypeKey;
- public ChestConfig() {
- }
-
public float getMinRadius() {
return this.minRadius;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/taskcondition/SoloInventoryCondition.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/taskcondition/SoloInventoryCondition.java
index b1af7ca..08e8004 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/taskcondition/SoloInventoryCondition.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/taskcondition/SoloInventoryCondition.java
@@ -50,9 +50,6 @@ public class SoloInventoryCondition extends TaskConditionAsset {
protected boolean consumeOnCompletion;
protected boolean holdInHand;
- public SoloInventoryCondition() {
- }
-
public BlockTagOrItemIdField getBlockTypeOrTagTask() {
return this.blockTypeOrTagTask;
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/HourRangeTriggerCondition.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/HourRangeTriggerCondition.java
index 0c3e649..4ee8872 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/HourRangeTriggerCondition.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/HourRangeTriggerCondition.java
@@ -30,9 +30,6 @@ public class HourRangeTriggerCondition extends ObjectiveLocationTriggerCondition
protected int minHour;
protected int maxHour;
- public HourRangeTriggerCondition() {
- }
-
@Override
public boolean isConditionMet(
@Nonnull ComponentAccessor componentAccessor, Ref ref, ObjectiveLocationMarker objectiveLocationMarker
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/ObjectiveLocationTriggerCondition.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/ObjectiveLocationTriggerCondition.java
index 5ad2faa..1d18a35 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/ObjectiveLocationTriggerCondition.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/ObjectiveLocationTriggerCondition.java
@@ -10,9 +10,6 @@ import javax.annotation.Nonnull;
public abstract class ObjectiveLocationTriggerCondition {
public static final CodecMapCodec CODEC = new CodecMapCodec<>("Type");
- public ObjectiveLocationTriggerCondition() {
- }
-
@Nonnull
@Override
public String toString() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/WeatherTriggerCondition.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/WeatherTriggerCondition.java
index f6813df..522da92 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/WeatherTriggerCondition.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/triggercondition/WeatherTriggerCondition.java
@@ -56,9 +56,6 @@ public class WeatherTriggerCondition extends ObjectiveLocationTriggerCondition {
protected String[] weatherIds;
protected int[] weatherIndexes;
- public WeatherTriggerCondition() {
- }
-
@Override
public boolean isConditionMet(
@Nonnull ComponentAccessor componentAccessor, @Nonnull Ref ref, ObjectiveLocationMarker objectiveLocationMarker
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/worldlocationproviders/LocationRadiusProvider.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/worldlocationproviders/LocationRadiusProvider.java
index 435696e..6c36387 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/worldlocationproviders/LocationRadiusProvider.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/worldlocationproviders/LocationRadiusProvider.java
@@ -45,9 +45,6 @@ public class LocationRadiusProvider extends WorldLocationProvider {
protected int minRadius = 10;
protected int maxRadius = 50;
- public LocationRadiusProvider() {
- }
-
@Nonnull
@Override
public Vector3i runCondition(@Nonnull World world, @Nonnull Vector3i position) {
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/config/worldlocationproviders/WorldLocationProvider.java b/src/com/hypixel/hytale/builtin/adventure/objectives/config/worldlocationproviders/WorldLocationProvider.java
index 11fc8d7..997cff9 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/config/worldlocationproviders/WorldLocationProvider.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/config/worldlocationproviders/WorldLocationProvider.java
@@ -11,9 +11,6 @@ public abstract class WorldLocationProvider {
public static final CodecMapCodec CODEC = new CodecMapCodec<>("Type");
public static final BuilderCodec BASE_CODEC = BuilderCodec.abstractBuilder(WorldLocationProvider.class).build();
- public WorldLocationProvider() {
- }
-
@Nullable
public abstract Vector3i runCondition(World var1, Vector3i var2);
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/historydata/ObjectiveRewardHistoryData.java b/src/com/hypixel/hytale/builtin/adventure/objectives/historydata/ObjectiveRewardHistoryData.java
index 333ded0..438727e 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/historydata/ObjectiveRewardHistoryData.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/historydata/ObjectiveRewardHistoryData.java
@@ -6,7 +6,4 @@ import com.hypixel.hytale.codec.lookup.CodecMapCodec;
public abstract class ObjectiveRewardHistoryData {
public static final CodecMapCodec CODEC = new CodecMapCodec<>("Type");
public static final BuilderCodec BASE_CODEC = BuilderCodec.abstractBuilder(ObjectiveRewardHistoryData.class).build();
-
- public ObjectiveRewardHistoryData() {
- }
}
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/interactions/CanBreakRespawnPointInteraction.java b/src/com/hypixel/hytale/builtin/adventure/objectives/interactions/CanBreakRespawnPointInteraction.java
index 216df0a..1f5f135 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/interactions/CanBreakRespawnPointInteraction.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/interactions/CanBreakRespawnPointInteraction.java
@@ -28,9 +28,6 @@ public class CanBreakRespawnPointInteraction extends SimpleBlockInteraction {
)
.build();
- public CanBreakRespawnPointInteraction() {
- }
-
@Nonnull
@Override
public WaitForDataFrom getWaitForDataFrom() {
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/interactions/StartObjectiveInteraction.java b/src/com/hypixel/hytale/builtin/adventure/objectives/interactions/StartObjectiveInteraction.java
index d513d3d..a1b1e6e 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/interactions/StartObjectiveInteraction.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/interactions/StartObjectiveInteraction.java
@@ -41,9 +41,6 @@ public class StartObjectiveInteraction extends SimpleInstantInteraction {
public static final KeyedCodec OBJECTIVE_UUID = new KeyedCodec<>("ObjectiveUUID", Codec.UUID_BINARY);
protected ObjectiveTypeSetup objectiveTypeSetup;
- public StartObjectiveInteraction() {
- }
-
@Override
protected void firstRun(@Nonnull InteractionType type, @Nonnull InteractionContext context, @Nonnull CooldownHandler cooldownHandler) {
CommandBuffer commandBuffer = context.getCommandBuffer();
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/markers/ObjectiveMarkerProvider.java b/src/com/hypixel/hytale/builtin/adventure/objectives/markers/ObjectiveMarkerProvider.java
index 440fac2..c368c50 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/markers/ObjectiveMarkerProvider.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/markers/ObjectiveMarkerProvider.java
@@ -5,11 +5,10 @@ import com.hypixel.hytale.builtin.adventure.objectives.ObjectiveDataStore;
import com.hypixel.hytale.builtin.adventure.objectives.ObjectivePlugin;
import com.hypixel.hytale.builtin.adventure.objectives.task.ObjectiveTask;
import com.hypixel.hytale.protocol.packets.worldmap.MapMarker;
-import com.hypixel.hytale.server.core.asset.type.gameplay.GameplayConfig;
import com.hypixel.hytale.server.core.entity.entities.Player;
import com.hypixel.hytale.server.core.universe.world.World;
-import com.hypixel.hytale.server.core.universe.world.WorldMapTracker;
import com.hypixel.hytale.server.core.universe.world.worldmap.WorldMapManager;
+import com.hypixel.hytale.server.core.universe.world.worldmap.markers.MapMarkerTracker;
import java.util.Set;
import java.util.UUID;
import javax.annotation.Nonnull;
@@ -21,9 +20,7 @@ public class ObjectiveMarkerProvider implements WorldMapManager.MarkerProvider {
}
@Override
- public void update(
- @Nonnull World world, @Nonnull GameplayConfig gameplayConfig, @Nonnull WorldMapTracker tracker, int chunkViewRadius, int playerChunkX, int playerChunkZ
- ) {
+ public void update(@Nonnull World world, @Nonnull MapMarkerTracker tracker, int chunkViewRadius, int playerChunkX, int playerChunkZ) {
Player player = tracker.getPlayer();
Set activeObjectiveUUIDs = player.getPlayerConfigData().getActiveObjectiveUUIDs();
if (!activeObjectiveUUIDs.isEmpty()) {
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/markers/objectivelocation/ObjectiveLocationMarkerSystems.java b/src/com/hypixel/hytale/builtin/adventure/objectives/markers/objectivelocation/ObjectiveLocationMarkerSystems.java
index 227282d..9bbd9fe 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/markers/objectivelocation/ObjectiveLocationMarkerSystems.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/markers/objectivelocation/ObjectiveLocationMarkerSystems.java
@@ -55,16 +55,10 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class ObjectiveLocationMarkerSystems {
- public ObjectiveLocationMarkerSystems() {
- }
-
public static class EnsureNetworkSendableSystem extends HolderSystem {
@Nonnull
private final Query query = Query.and(ObjectiveLocationMarker.getComponentType(), Query.not(NetworkId.getComponentType()));
- public EnsureNetworkSendableSystem() {
- }
-
@Override
public void onEntityAdd(@Nonnull Holder holder, @Nonnull AddReason reason, @Nonnull Store store) {
holder.addComponent(NetworkId.getComponentType(), new NetworkId(store.getExternalData().takeNextNetworkId()));
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/markers/reachlocation/ReachLocationMarkerAsset.java b/src/com/hypixel/hytale/builtin/adventure/objectives/markers/reachlocation/ReachLocationMarkerAsset.java
index 3684d07..8f1fb15 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/markers/reachlocation/ReachLocationMarkerAsset.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/markers/reachlocation/ReachLocationMarkerAsset.java
@@ -46,9 +46,6 @@ public class ReachLocationMarkerAsset implements JsonAssetWithMap> getAssetStore() {
if (ASSET_STORE == null) {
ASSET_STORE = AssetRegistry.getAssetStore(ReachLocationMarkerAsset.class);
diff --git a/src/com/hypixel/hytale/builtin/adventure/objectives/markers/reachlocation/ReachLocationMarkerSystems.java b/src/com/hypixel/hytale/builtin/adventure/objectives/markers/reachlocation/ReachLocationMarkerSystems.java
index df251cc..c3c5f9c 100644
--- a/src/com/hypixel/hytale/builtin/adventure/objectives/markers/reachlocation/ReachLocationMarkerSystems.java
+++ b/src/com/hypixel/hytale/builtin/adventure/objectives/markers/reachlocation/ReachLocationMarkerSystems.java
@@ -41,15 +41,9 @@ public class ReachLocationMarkerSystems {
private static final HytaleLogger LOGGER = HytaleLogger.forEnclosingClass();
private static final ThreadLocal> THREAD_LOCAL_TEMP_UUIDS = ThreadLocal.withInitial(HashSet::new);
- public ReachLocationMarkerSystems() {
- }
-
public static class EnsureNetworkSendable extends HolderSystem {
private final Query]