upload
This commit is contained in:
commit
4f1f016517
2761 files changed
+355912
No files matched your search
@@ -0,0 +1,65 @@
|
||||
<p align="center">
|
||||
<img src="assets/ss.png" alt="Skid Solutions Banner" width="350" />
|
||||
<br>
|
||||
<font size="6"><b>OpenItemsAdder</b></font>
|
||||
<br>
|
||||
<font size="3">by Skid Solutions</font>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://discord.gg/AEwatvnvSf">Discord</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="assets/jak.jpg" alt="jak" height="150" />
|
||||
<img src="assets/hack.jpg" alt="hack" height="150" />
|
||||
<img src="assets/deobf2.png" alt="deobf2" height="150" />
|
||||
<img src="assets/deobf.jpg" alt="deobf" height="150" />
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- **JDK 21**
|
||||
- Internet access during the build (Maven Central, `libraries.minecraft.net`, `repo.citizensnpcs.co`, `repo.skriptlang.org`, `repo.jeff-media.com`, `repo.extendedclip.com`, `repo.papermc.io`, `maven.enginehub.org`, `mvn.lumine.io`)
|
||||
|
||||
### Local jars (`libs/`)
|
||||
|
||||
Some dependencies are not published to Maven. Place these files in `libs/` before building:
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `spigot-server-1.21.11.jar` | Mojang-named Spigot server with CraftBukkit `v1_21_R7` classes |
|
||||
| `NativePackets-0.1.15.jar` | NativePackets API |
|
||||
| `Denizen-1.3.4-b7314-DEV.jar` | Denizen API |
|
||||
| `Mimic-v0.10.0.jar` | Mimic API |
|
||||
|
||||
The server jar can be produced with Spigot BuildTools (`--rev 1.21.11 --compile SPIGOT`), using the `original-spigot-1.21.11-R0.2-SNAPSHOT.jar` output.
|
||||
|
||||
---
|
||||
|
||||
## How to build
|
||||
|
||||
Run from this folder:
|
||||
|
||||
```powershell
|
||||
$env:JAVA_HOME = "C:\Program Files\Java\jdk-21"
|
||||
|
||||
.\gradlew.bat clean build
|
||||
```
|
||||
|
||||
Output in `build/libs/`:
|
||||
- `Itemsadder-5.0.0-beta-8.jar`
|
||||
|
||||
Drop the jar into your server's `plugins/` folder and start the server.
|
||||
|
||||
---
|
||||
|
||||
## Known limitations
|
||||
|
||||
- **Reduced build.** Files that do not compile against 1.21.11 are listed in [`compile-exclusions.txt`](compile-exclusions.txt) and are excluded from compilation. Their sources remain in `src/`. The current jar contains only the compiled subset plus `SimplifiedMain`, so most features are not included yet.
|
||||
- **Other server versions.** Adapters for `v1_20_R4` and `v1_21_R1`–`R6` are excluded by the build script. Only 1.21.11 (`v1_21_R7`) is targeted.
|
||||
- **Runtime libraries.** Libraries declared with `implementation` (for example fastjson2, commons, fastutil) are not bundled into the jar yet. Shading is not configured.
|
||||
|
||||
---
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 76 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 135 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 323 KiB |
@@ -0,0 +1,109 @@
|
||||
plugins {
|
||||
id("java-library")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
||||
maven("https://libraries.minecraft.net/")
|
||||
maven("https://maven.enginehub.org/repo/")
|
||||
maven("https://mvn.lumine.io/repository/maven-public/")
|
||||
maven("https://repo.skriptlang.org/releases/")
|
||||
maven("https://repo.jeff-media.com/public/")
|
||||
maven("https://repo.citizensnpcs.co/")
|
||||
maven("https://repo.extendedclip.com/releases/")
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot-api:1.21.11-R0.1-SNAPSHOT")
|
||||
// Local jars that are not on Maven (e.g. NativePackets API). Drop them in libs/.
|
||||
compileOnly(fileTree("libs") { include("*.jar") })
|
||||
compileOnly("com.mojang:datafixerupper:9.0.19")
|
||||
compileOnly("com.mojang:authlib:7.0.61")
|
||||
compileOnly("com.mojang:logging:1.6.11")
|
||||
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
|
||||
compileOnly("io.netty:netty-transport:4.2.7.Final")
|
||||
compileOnly("io.netty:netty-buffer:4.2.7.Final")
|
||||
compileOnly("io.netty:netty-codec-http:4.2.7.Final")
|
||||
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.4.2")
|
||||
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.17")
|
||||
compileOnly("io.lumine:Mythic-Dist:5.14.0")
|
||||
compileOnly("com.github.SkriptLang:Skript:2.17.1")
|
||||
compileOnly("com.jeff_media:ArmorEquipEvent:1.0.1")
|
||||
compileOnly("net.citizensnpcs:citizensapi:2.0.44-SNAPSHOT")
|
||||
compileOnly("com.jayway.jsonpath:json-path:3.0.0")
|
||||
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core:2.16.2")
|
||||
compileOnly("me.clip:placeholderapi:2.12.3")
|
||||
compileOnly("org.apache.httpcomponents:httpclient:4.5.14")
|
||||
compileOnly("org.lwjgl:lwjgl-shaderc:3.4.3")
|
||||
compileOnly("net.kyori:adventure-platform-bukkit:4.4.1")
|
||||
compileOnly("io.papermc.paper:paper-api:1.21.11-R0.1-SNAPSHOT")
|
||||
implementation("org.jctools:jctools-core:4.0.7")
|
||||
compileOnly("org.apache.logging.log4j:log4j-api:2.25.2")
|
||||
compileOnly("org.apache.logging.log4j:log4j-core:2.25.2")
|
||||
compileOnly("net.kyori:adventure-api:4.17.0")
|
||||
compileOnly("net.kyori:adventure-text-minimessage:4.17.0")
|
||||
compileOnly("net.kyori:adventure-text-serializer-gson:4.17.0")
|
||||
compileOnly("net.kyori:adventure-text-serializer-legacy:4.17.0")
|
||||
compileOnly("org.projectlombok:lombok:1.18.34")
|
||||
annotationProcessor("org.projectlombok:lombok:1.18.34")
|
||||
implementation("com.alibaba.fastjson2:fastjson2:2.0.66")
|
||||
implementation("it.unimi.dsi:fastutil:8.5.6")
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
implementation("commons-io:commons-io:2.20.0")
|
||||
implementation("org.apache.commons:commons-math3:3.6.1")
|
||||
implementation("beer.devs:FastNbt-core:1.4.8")
|
||||
implementation("com.github.stephengold:jolt-jni-Windows64:7.0.0")
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain.languageVersion = JavaLanguageVersion.of(21)
|
||||
}
|
||||
|
||||
// spigot-api and paper-api provide the same capability; Paper's API is the superset, so it wins.
|
||||
configurations.all {
|
||||
resolutionStrategy.capabilitiesResolution.withCapability("org.spigotmc:spigot-api") {
|
||||
select("io.papermc.paper:paper-api:1.21.11-R0.1-SNAPSHOT")
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
// Target: Minecraft 1.21.11 (CraftBukkit/NMS v1_21_R7).
|
||||
// Adapters for other server versions (v1_20_R4, v1_21_R1..R6) are not compiled.
|
||||
exclude { element ->
|
||||
val f = element.file
|
||||
f.isFile && (
|
||||
f.name.matches(Regex(".*V1_(20_R4|21_R[1-6]).*\\.java")) ||
|
||||
f.readText().contains(Regex("""craftbukkit\.v1_(20_R4|21_R[1-6])\b""")))
|
||||
}
|
||||
|
||||
// Simplified build: sources that do not compile against the 1.21.11 server yet.
|
||||
// Files are kept in src/, only removed from compilation. One path per line, relative to src/main/java.
|
||||
val listed = file("compile-exclusions.txt")
|
||||
if (listed.exists()) {
|
||||
val excludedPaths = listed.readLines().map { it.trim() }.filter { it.isNotEmpty() }.toSet()
|
||||
exclude { element -> excludedPaths.contains(element.relativePath.pathString) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
withType<Javadoc>().configureEach {
|
||||
(options as StandardJavadocDocletOptions).encoding = "UTF-8"
|
||||
}
|
||||
|
||||
processResources {
|
||||
val props = mapOf("version" to version)
|
||||
filesMatching("plugin.yml") {
|
||||
expand(props)
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,5 @@
|
||||
group=dev.lone
|
||||
version=5.0.0-beta-8
|
||||
org.gradle.configuration-cache=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.caching=true
|
||||
Vendored
BIN
Binary file not shown.
+7
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.9.2-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -0,0 +1,248 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015 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.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
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
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
|
||||
# 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
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# 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" )
|
||||
|
||||
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
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+93
@@ -0,0 +1,93 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
rootProject.name = "Itemsadder"
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,14 @@
|
||||
package dev.lone.itemsadder;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
/**
|
||||
* Entry point for the simplified build. The full plugin entry point ({@code Main}) and the
|
||||
* classes that depend on it are excluded from compilation; see compile-exclusions.txt.
|
||||
*/
|
||||
public final class SimplifiedMain extends JavaPlugin {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
getLogger().warning("Simplified build: most ItemsAdder features are not compiled in this build.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.entity.CustomEntityImpl;
|
||||
import dev.lone.itemsadder.entity.CustomEntityManager;
|
||||
import dev.lone.itemsadder.entity.MobGoalSettings;
|
||||
import dev.lone.itemsadder.entity.MobPersistentKeys;
|
||||
import dev.lone.itemsadder.entity.ModelDefinitionData;
|
||||
import dev.lone.itemsadder.util.Log;
|
||||
import java.util.EnumSet;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Mob;
|
||||
|
||||
public abstract class AbstractMobGoal implements CustomGoal {
|
||||
protected final Mob aam;
|
||||
protected final MobGoalSettings aan;
|
||||
protected final NavigatorAdapter aao;
|
||||
protected int ms;
|
||||
protected boolean aap;
|
||||
private int aaq;
|
||||
private boolean aar;
|
||||
private String aas;
|
||||
|
||||
protected AbstractMobGoal(Mob var1, MobGoalSettings var2, NavigatorAdapter var3) {
|
||||
this.aam = var1;
|
||||
this.aan = var2;
|
||||
this.aao = var3;
|
||||
}
|
||||
|
||||
public static CustomGoal method4568(Mob var0, MobGoalSettings var1, NavigatorAdapter var2) {
|
||||
return switch (var1.zq()) {
|
||||
case "gather_items", "transport_items" -> new MobGoalItemCollect(var0, var1, var2);
|
||||
case "seek_land", "seek_shelter", "avoid_blocks", "rest_at_block", "investigate_disturbance" -> new MobGoalBlockSearch(var0, var1, var2);
|
||||
case "charge_attack", "projectile_attack", "beam_attack", "area_attack", "summon_attack", "periodic_effect" -> new MobGoalTargetFilter(
|
||||
var0, var1, var2
|
||||
);
|
||||
case "defensive_state", "timed_despawn" -> new MobGoalTimer(var0, var1, var2);
|
||||
case "follow_group", "share_target", "orbit_target" -> new MobGoalFollowEntity(var0, var1, var2);
|
||||
case "work_block", "harvest_crop" -> new MobGoalBlockInteract(var0, var1, var2);
|
||||
default -> throw new IllegalArgumentException("Unknown behaviour " + var1.zq());
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet yW() {
|
||||
return EnumSet.of(GoalFlag.MOVE, GoalFlag.LOOK);
|
||||
}
|
||||
|
||||
protected int zh() {
|
||||
return this.aam.getTicksLived();
|
||||
}
|
||||
|
||||
protected abstract boolean yX();
|
||||
|
||||
protected abstract void zb();
|
||||
|
||||
protected void za() {
|
||||
this.bL("active");
|
||||
}
|
||||
|
||||
protected void es() {
|
||||
}
|
||||
|
||||
protected boolean yZ() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean zi() {
|
||||
if (!this.aar && MobPersistentKeys.method9612(this.aam) && this.zh() >= this.aaq) {
|
||||
this.aaq = this.zh() + this.aan.getInt("interval");
|
||||
|
||||
try {
|
||||
return this.yX();
|
||||
} catch (RuntimeException var2) {
|
||||
this.method4569(var2);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean zj() {
|
||||
if (!this.aar && !this.aap && MobPersistentKeys.method9612(this.aam) && (this.ms < this.aan.getInt("duration") || this.aan.zq().equals("timed_despawn"))) {
|
||||
try {
|
||||
return this.yZ();
|
||||
} catch (RuntimeException var2) {
|
||||
this.method4569(var2);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void start() {
|
||||
this.ms = 0;
|
||||
this.aap = false;
|
||||
|
||||
try {
|
||||
this.za();
|
||||
} catch (RuntimeException var2) {
|
||||
this.method4569(var2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void tick() {
|
||||
if (!this.aar && !this.aap) {
|
||||
try {
|
||||
this.zb();
|
||||
this.ms++;
|
||||
} catch (RuntimeException var2) {
|
||||
this.method4569(var2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void stop() {
|
||||
try {
|
||||
this.es();
|
||||
this.stopAnimation();
|
||||
} catch (RuntimeException var5) {
|
||||
this.method4569(var5);
|
||||
} finally {
|
||||
if (this.yW().contains(GoalFlag.MOVE)) {
|
||||
this.aao.stop();
|
||||
}
|
||||
|
||||
this.aaq = this.zh() + this.aan.getInt("cooldown");
|
||||
}
|
||||
}
|
||||
|
||||
private void method4569(RuntimeException var1) {
|
||||
if (!this.aar) {
|
||||
Log.warn("Disabled behaviour '" + this.aan.zq() + "' on " + this.aam.getUniqueId() + ": " + var1);
|
||||
}
|
||||
|
||||
this.aar = true;
|
||||
this.aap = true;
|
||||
}
|
||||
|
||||
protected boolean method4570(Location var1) {
|
||||
return var1.getWorld() == this.aam.getWorld()
|
||||
&& var1.distanceSquared(this.aam.getLocation()) <= this.aan.getDouble("arrival_distance") * this.aan.getDouble("arrival_distance");
|
||||
}
|
||||
|
||||
protected boolean method4571(Location var1) {
|
||||
this.aao.method4592(var1);
|
||||
if (this.ms % this.aan.getInt("repath_interval") != 0) {
|
||||
return true;
|
||||
} else if (!this.aao.method4591(var1, this.aan.getDouble("speed_modifier"))) {
|
||||
this.aap = true;
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
protected void bL(String var1) {
|
||||
if (this.aan.zm().get(var1) instanceof String var3) {
|
||||
CustomEntityImpl var4 = CustomEntityManager.getInstance().getByEntity(this.aam);
|
||||
if (var4 != null && var4.getModelDefinition(var3) != null && var4.getModelInstance() != null) {
|
||||
this.aas = var3;
|
||||
var4.getModelInstance().method8913(var4.getModelDefinition(var3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void stopAnimation() {
|
||||
if (this.aas != null) {
|
||||
CustomEntityImpl var1 = CustomEntityManager.getInstance().getByEntity(this.aam);
|
||||
if (var1 != null && var1.getModelInstance() != null && var1.getModelInstance().bl(this.aas)) {
|
||||
ModelDefinitionData var2 = var1.getModelDefinition(this.aas);
|
||||
if (var2 != null) {
|
||||
if (!"base".equals(var2.getLayer())) {
|
||||
var1.getModelInstance().bo(var2.getLayer());
|
||||
} else if (var1.getIdleAnimation() != null) {
|
||||
var1.getModelInstance().method8913(var1.getIdleAnimation());
|
||||
}
|
||||
|
||||
this.aas = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGeneric;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R7.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R7.event.CraftEventFactory;
|
||||
|
||||
public class BlockInteractionGoalGeneric extends Goal {
|
||||
private static final int biQ = 40;
|
||||
private static Predicate beh;
|
||||
private final Mob biR;
|
||||
private final Level biS;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalGeneric(MobGoalFactoryImplGeneric var1, org.bukkit.entity.Mob var2, Predicate var3) {
|
||||
this.biT = var2;
|
||||
this.biU = var3;
|
||||
this.biR = ((CraftMob)this.biT).getHandle();
|
||||
this.biS = this.biR.level();
|
||||
if (this.biU == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.asBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
if (!((ServerLevel)this.biS).chunkSource.chunkMap.anyPlayerCloseEnoughForSpawning(this.biR.chunkPosition())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.biR.getRandom().nextInt(this.biR.isBaby() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPos var1 = this.biR.blockPosition();
|
||||
return beh.test(this.biS.getBlockState(var1));
|
||||
}
|
||||
|
||||
public void start() {
|
||||
this.bek = this.adjustedTickDelay(40);
|
||||
this.biS.broadcastEntityEvent(this.biR, (byte)10);
|
||||
this.biR.getNavigation().stop();
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.adjustedTickDelay(4)) {
|
||||
BlockPos var1 = this.biR.blockPosition();
|
||||
net.minecraft.world.level.block.state.BlockState var2 = this.biS.getBlockState(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(
|
||||
this.biR, var1, var2.getFluidState().createLegacyBlock(), !(Boolean)getServerLevel(this.biS).getGameRules().get(GameRules.MOB_GRIEFING)
|
||||
)) {
|
||||
this.biS.destroyBlock(var1, false);
|
||||
}
|
||||
|
||||
this.biR.ate();
|
||||
} else {
|
||||
BlockPos var3 = var1.below();
|
||||
if (this.biS.getBlockState(var3).is(Blocks.GRASS_BLOCK)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(
|
||||
this.biR, var3, Blocks.DIRT.defaultBlockState(), !(Boolean)getServerLevel(this.biS).getGameRules().get(GameRules.MOB_GRIEFING)
|
||||
)) {
|
||||
this.biS.levelEvent(2001, var3, Block.getId(Blocks.GRASS_BLOCK.defaultBlockState()));
|
||||
this.biS.setBlock(var3, Blocks.DIRT.defaultBlockState(), 2);
|
||||
}
|
||||
|
||||
this.biR.ate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup2;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R7.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R7.event.CraftEventFactory;
|
||||
|
||||
public class BlockInteractionGoalGenericDup2 extends Goal {
|
||||
private static final int bjo = 40;
|
||||
private static Predicate beh;
|
||||
private final Mob bjp;
|
||||
private final Level bjq;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalGenericDup2(MobGoalFactoryImplGenericDup2 var1, org.bukkit.entity.Mob var2, Predicate var3) {
|
||||
this.bjr = var2;
|
||||
this.bjs = var3;
|
||||
this.bjp = ((CraftMob)this.bjr).getHandle();
|
||||
this.bjq = this.bjp.level();
|
||||
if (this.bjs == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.asBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
if (!((ServerLevel)this.bjq).chunkSource.chunkMap.anyPlayerCloseEnoughForSpawning(this.bjp.chunkPosition())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bjp.getRandom().nextInt(this.bjp.isBaby() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPos var1 = this.bjp.blockPosition();
|
||||
return beh.test(this.bjq.getBlockState(var1));
|
||||
}
|
||||
|
||||
public void start() {
|
||||
this.bek = this.adjustedTickDelay(40);
|
||||
this.bjq.broadcastEntityEvent(this.bjp, (byte)10);
|
||||
this.bjp.getNavigation().stop();
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.adjustedTickDelay(4)) {
|
||||
BlockPos var1 = this.bjp.blockPosition();
|
||||
net.minecraft.world.level.block.state.BlockState var2 = this.bjq.getBlockState(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(
|
||||
this.bjp, var1, var2.getFluidState().createLegacyBlock(), !(Boolean)getServerLevel(this.bjq).getGameRules().get(GameRules.MOB_GRIEFING)
|
||||
)) {
|
||||
this.bjq.destroyBlock(var1, false);
|
||||
}
|
||||
|
||||
this.bjp.ate();
|
||||
} else {
|
||||
BlockPos var3 = var1.below();
|
||||
if (this.bjq.getBlockState(var3).is(Blocks.GRASS_BLOCK)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(
|
||||
this.bjp, var3, Blocks.DIRT.defaultBlockState(), !(Boolean)getServerLevel(this.bjq).getGameRules().get(GameRules.MOB_GRIEFING)
|
||||
)) {
|
||||
this.bjq.levelEvent(2001, var3, Block.getId(Blocks.GRASS_BLOCK.defaultBlockState()));
|
||||
this.bjq.setBlock(var3, Blocks.DIRT.defaultBlockState(), 2);
|
||||
}
|
||||
|
||||
this.bjp.ate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup3;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R7.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R7.event.CraftEventFactory;
|
||||
|
||||
public class BlockInteractionGoalGenericDup3 extends Goal {
|
||||
private static final int bjM = 40;
|
||||
private static Predicate beh;
|
||||
private final Mob bjN;
|
||||
private final Level bjO;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalGenericDup3(MobGoalFactoryImplGenericDup3 var1, org.bukkit.entity.Mob var2, Predicate var3) {
|
||||
this.bjP = var2;
|
||||
this.bjQ = var3;
|
||||
this.bjN = ((CraftMob)this.bjP).getHandle();
|
||||
this.bjO = this.bjN.level();
|
||||
if (this.bjQ == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.asBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
if (!((ServerLevel)this.bjO).getChunkSource().chunkMap.anyPlayerCloseEnoughForSpawning(this.bjN.chunkPosition())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bjN.getRandom().nextInt(this.bjN.isBaby() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPos var1 = this.bjN.blockPosition();
|
||||
return beh.test(this.bjO.getBlockState(var1));
|
||||
}
|
||||
|
||||
public void start() {
|
||||
this.bek = this.adjustedTickDelay(40);
|
||||
this.bjO.broadcastEntityEvent(this.bjN, (byte)10);
|
||||
this.bjN.getNavigation().stop();
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.adjustedTickDelay(4)) {
|
||||
BlockPos var1 = this.bjN.blockPosition();
|
||||
net.minecraft.world.level.block.state.BlockState var2 = this.bjO.getBlockState(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(
|
||||
this.bjN, var1, var2.getFluidState().createLegacyBlock(), !(Boolean)getServerLevel(this.bjO).getGameRules().get(GameRules.MOB_GRIEFING)
|
||||
)) {
|
||||
this.bjO.destroyBlock(var1, false);
|
||||
}
|
||||
|
||||
this.bjN.ate();
|
||||
} else {
|
||||
BlockPos var3 = var1.below();
|
||||
if (this.bjO.getBlockState(var3).is(Blocks.GRASS_BLOCK)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(
|
||||
this.bjN, var3, Blocks.DIRT.defaultBlockState(), !(Boolean)getServerLevel(this.bjO).getGameRules().get(GameRules.MOB_GRIEFING)
|
||||
)) {
|
||||
this.bjO.levelEvent(2001, var3, Block.getId(Blocks.GRASS_BLOCK.defaultBlockState()));
|
||||
this.bjO.setBlock(var3, Blocks.DIRT.defaultBlockState(), 2);
|
||||
}
|
||||
|
||||
this.bjN.ate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup4;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R7.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R7.event.CraftEventFactory;
|
||||
|
||||
public class BlockInteractionGoalGenericDup4 extends Goal {
|
||||
private static final int bkk = 40;
|
||||
private static Predicate beh;
|
||||
private final Mob bkl;
|
||||
private final Level bkm;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalGenericDup4(MobGoalFactoryImplGenericDup4 var1, org.bukkit.entity.Mob var2, Predicate var3) {
|
||||
this.bkn = var2;
|
||||
this.bko = var3;
|
||||
this.bkl = ((CraftMob)this.bkn).getHandle();
|
||||
this.bkm = this.bkl.level();
|
||||
if (this.bko == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.asBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
if (!((ServerLevel)this.bkm).getChunkSource().chunkMap.anyPlayerCloseEnoughForSpawning(this.bkl.chunkPosition())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bkl.getRandom().nextInt(this.bkl.isBaby() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPos var1 = this.bkl.blockPosition();
|
||||
return beh.test(this.bkm.getBlockState(var1));
|
||||
}
|
||||
|
||||
public void start() {
|
||||
this.bek = this.adjustedTickDelay(40);
|
||||
this.bkm.broadcastEntityEvent(this.bkl, (byte)10);
|
||||
this.bkl.getNavigation().stop();
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.adjustedTickDelay(4)) {
|
||||
BlockPos var1 = this.bkl.blockPosition();
|
||||
net.minecraft.world.level.block.state.BlockState var2 = this.bkm.getBlockState(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(
|
||||
this.bkl, var1, var2.getFluidState().createLegacyBlock(), !(Boolean)getServerLevel(this.bkm).getGameRules().get(GameRules.MOB_GRIEFING)
|
||||
)) {
|
||||
this.bkm.destroyBlock(var1, false);
|
||||
}
|
||||
|
||||
this.bkl.ate();
|
||||
} else {
|
||||
BlockPos var3 = var1.below();
|
||||
if (this.bkm.getBlockState(var3).is(Blocks.GRASS_BLOCK)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(
|
||||
this.bkl, var3, Blocks.DIRT.defaultBlockState(), !(Boolean)getServerLevel(this.bkm).getGameRules().get(GameRules.MOB_GRIEFING)
|
||||
)) {
|
||||
this.bkm.levelEvent(2014, var3, Block.getId(Blocks.GRASS_BLOCK.defaultBlockState()));
|
||||
this.bkm.setBlock(var3, Blocks.DIRT.defaultBlockState(), 2);
|
||||
}
|
||||
|
||||
this.bkl.ate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R1;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.event.CraftEventFactory;
|
||||
import org.bukkit.entity.Mob;
|
||||
|
||||
class BlockInteractionGoalV1_21_R1 extends PathfinderGoal {
|
||||
private static final int beI = 40;
|
||||
private static Predicate beh;
|
||||
private final EntityInsentient beJ;
|
||||
private final World beK;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalV1_21_R1(MobGoalFactoryImplV1_21_R1 var1, Mob var2, Predicate var3) {
|
||||
this.beL = var2;
|
||||
this.beM = var3;
|
||||
this.beJ = ((CraftMob)this.beL).getHandle();
|
||||
this.beK = this.beJ.dO();
|
||||
if (this.beM == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.createCraftBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method4887() {
|
||||
if (!((WorldServer)this.beK).I.a.b(this.beJ.dq())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.beJ.dR().a(this.beJ.o_() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPosition var1 = this.beJ.do_();
|
||||
return beh.test(this.beK.a_(var1));
|
||||
}
|
||||
|
||||
public void method4888() {
|
||||
this.bek = this.a(40);
|
||||
this.beK.a(this.beJ, (byte)10);
|
||||
this.beJ.N().n();
|
||||
}
|
||||
|
||||
public void method4889() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean method4890() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public int OX() {
|
||||
return this.bek;
|
||||
}
|
||||
|
||||
public void method4891() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.a(4)) {
|
||||
BlockPosition var1 = this.beJ.do_();
|
||||
IBlockData var2 = this.beK.a_(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.beJ, var1, var2.u().g(), !this.beK.ab().b(GameRules.c))) {
|
||||
this.beK.b(var1, false);
|
||||
}
|
||||
|
||||
this.beJ.Q();
|
||||
} else {
|
||||
BlockPosition var3 = var1.e();
|
||||
if (this.beK.a_(var3).a(Blocks.i)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.beJ, var3, Blocks.j.o(), !this.beK.ab().b(GameRules.c))) {
|
||||
this.beK.c(2001, var3, Block.i(Blocks.i.o()));
|
||||
this.beK.a(var3, Blocks.j.o(), 2);
|
||||
}
|
||||
|
||||
this.beJ.Q();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R2;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R2.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R2.event.CraftEventFactory;
|
||||
import org.bukkit.entity.Mob;
|
||||
|
||||
class BlockInteractionGoalV1_21_R2 extends PathfinderGoal {
|
||||
private static final int bgc = 40;
|
||||
private static Predicate beh;
|
||||
private final EntityInsentient bgd;
|
||||
private final World bge;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalV1_21_R2(MobGoalFactoryImplV1_21_R2 var1, Mob var2, Predicate var3) {
|
||||
this.bgf = var2;
|
||||
this.bgg = var3;
|
||||
this.bgd = ((CraftMob)this.bgf).getHandle();
|
||||
this.bge = this.bgd.dW();
|
||||
if (this.bgg == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.createCraftBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method4978() {
|
||||
if (!((WorldServer)this.bge).J.a.b(this.bgd.dy())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bgd.dZ().a(this.bgd.e_() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPosition var1 = this.bgd.dw();
|
||||
return beh.test(this.bge.a_(var1));
|
||||
}
|
||||
|
||||
public void method4979() {
|
||||
this.bek = this.a(40);
|
||||
this.bge.a(this.bgd, (byte)10);
|
||||
this.bgd.L().o();
|
||||
}
|
||||
|
||||
public void method4980() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean method4981() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public int OX() {
|
||||
return this.bek;
|
||||
}
|
||||
|
||||
public void method4982() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.a(4)) {
|
||||
BlockPosition var1 = this.bgd.dw();
|
||||
IBlockData var2 = this.bge.a_(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bgd, var1, var2.y().g(), !a(this.bge).N().b(GameRules.c))) {
|
||||
this.bge.b(var1, false);
|
||||
}
|
||||
|
||||
this.bgd.P();
|
||||
} else {
|
||||
BlockPosition var3 = var1.e();
|
||||
if (this.bge.a_(var3).a(Blocks.i)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bgd, var3, Blocks.j.m(), !a(this.bge).N().b(GameRules.c))) {
|
||||
this.bge.c(2001, var3, Block.j(Blocks.i.m()));
|
||||
this.bge.a(var3, Blocks.j.m(), 2);
|
||||
}
|
||||
|
||||
this.bgd.P();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R3;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.event.CraftEventFactory;
|
||||
import org.bukkit.entity.Mob;
|
||||
|
||||
class BlockInteractionGoalV1_21_R3 extends PathfinderGoal {
|
||||
private static final int bgA = 40;
|
||||
private static Predicate beh;
|
||||
private final EntityInsentient bgB;
|
||||
private final World bgC;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalV1_21_R3(MobGoalFactoryImplV1_21_R3 var1, Mob var2, Predicate var3) {
|
||||
this.bgD = var2;
|
||||
this.bgE = var3;
|
||||
this.bgB = ((CraftMob)this.bgD).getHandle();
|
||||
this.bgC = this.bgB.dV();
|
||||
if (this.bgE == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.createCraftBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method5001() {
|
||||
if (!((WorldServer)this.bgC).J.a.b(this.bgB.dx())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bgB.dY().a(this.bgB.e_() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPosition var1 = this.bgB.dv();
|
||||
return beh.test(this.bgC.a_(var1));
|
||||
}
|
||||
|
||||
public void method5002() {
|
||||
this.bek = this.a(40);
|
||||
this.bgC.a(this.bgB, (byte)10);
|
||||
this.bgB.P().m();
|
||||
}
|
||||
|
||||
public void method5003() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean method5004() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public int OX() {
|
||||
return this.bek;
|
||||
}
|
||||
|
||||
public void method5005() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.a(4)) {
|
||||
BlockPosition var1 = this.bgB.dv();
|
||||
IBlockData var2 = this.bgC.a_(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bgB, var1, var2.y().g(), !a(this.bgC).O().b(GameRules.c))) {
|
||||
this.bgC.b(var1, false);
|
||||
}
|
||||
|
||||
this.bgB.S();
|
||||
} else {
|
||||
BlockPosition var3 = var1.e();
|
||||
if (this.bgC.a_(var3).a(Blocks.i)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bgB, var3, Blocks.j.m(), !a(this.bgC).O().b(GameRules.c))) {
|
||||
this.bgC.c(2001, var3, Block.j(Blocks.i.m()));
|
||||
this.bgC.a(var3, Blocks.j.m(), 2);
|
||||
}
|
||||
|
||||
this.bgB.S();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R4;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R4.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R4.event.CraftEventFactory;
|
||||
import org.bukkit.entity.Mob;
|
||||
|
||||
class BlockInteractionGoalV1_21_R4 extends PathfinderGoal {
|
||||
private static final int bgY = 40;
|
||||
private static Predicate beh;
|
||||
private final EntityInsentient bgZ;
|
||||
private final World bha;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalV1_21_R4(MobGoalFactoryImplV1_21_R4 var1, Mob var2, Predicate var3) {
|
||||
this.bhb = var2;
|
||||
this.bhc = var3;
|
||||
this.bgZ = ((CraftMob)this.bhb).getHandle();
|
||||
this.bha = this.bgZ.dV();
|
||||
if (this.bhc == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.createCraftBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method5032() {
|
||||
if (!((WorldServer)this.bha).J.a.b(this.bgZ.dx())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bgZ.dY().a(this.bgZ.e_() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPosition var1 = this.bgZ.dv();
|
||||
return beh.test(this.bha.a_(var1));
|
||||
}
|
||||
|
||||
public void method5033() {
|
||||
this.bek = this.a(40);
|
||||
this.bha.a(this.bgZ, (byte)10);
|
||||
this.bgZ.N().m();
|
||||
}
|
||||
|
||||
public void method5034() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean method5035() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public int OX() {
|
||||
return this.bek;
|
||||
}
|
||||
|
||||
public void method5036() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.a(4)) {
|
||||
BlockPosition var1 = this.bgZ.dv();
|
||||
IBlockData var2 = this.bha.a_(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bgZ, var1, var2.y().g(), !a(this.bha).O().c(GameRules.d))) {
|
||||
this.bha.b(var1, false);
|
||||
}
|
||||
|
||||
this.bgZ.Q();
|
||||
} else {
|
||||
BlockPosition var3 = var1.e();
|
||||
if (this.bha.a_(var3).a(Blocks.i)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bgZ, var3, Blocks.j.m(), !a(this.bha).O().c(GameRules.d))) {
|
||||
this.bha.c(2001, var3, Block.j(Blocks.i.m()));
|
||||
this.bha.a(var3, Blocks.j.m(), 2);
|
||||
}
|
||||
|
||||
this.bgZ.Q();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R5;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R5.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R5.event.CraftEventFactory;
|
||||
import org.bukkit.entity.Mob;
|
||||
|
||||
class BlockInteractionGoalV1_21_R5 extends PathfinderGoal {
|
||||
private static final int bhw = 40;
|
||||
private static Predicate beh;
|
||||
private final EntityInsentient bhx;
|
||||
private final World bhy;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalV1_21_R5(MobGoalFactoryImplV1_21_R5 var1, Mob var2, Predicate var3) {
|
||||
this.bhz = var2;
|
||||
this.bhA = var3;
|
||||
this.bhx = ((CraftMob)this.bhz).getHandle();
|
||||
this.bhy = this.bhx.ai();
|
||||
if (this.bhA == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.createCraftBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method5055() {
|
||||
if (!((WorldServer)this.bhy).J.a.b(this.bhx.dz())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bhx.ec().a(this.bhx.g_() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPosition var1 = this.bhx.dx();
|
||||
return beh.test(this.bhy.a_(var1));
|
||||
}
|
||||
|
||||
public void method5056() {
|
||||
this.bek = this.a(40);
|
||||
this.bhy.a(this.bhx, (byte)10);
|
||||
this.bhx.S().n();
|
||||
}
|
||||
|
||||
public void method5057() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean method5058() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public void method5059() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.a(4)) {
|
||||
BlockPosition var1 = this.bhx.dx();
|
||||
IBlockData var2 = this.bhy.a_(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bhx, var1, var2.y().g(), !a(this.bhy).P().c(GameRules.d))) {
|
||||
this.bhy.b(var1, false);
|
||||
}
|
||||
|
||||
this.bhx.V();
|
||||
} else {
|
||||
BlockPosition var3 = var1.e();
|
||||
if (this.bhy.a_(var3).a(Blocks.i)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bhx, var3, Blocks.j.m(), !a(this.bhy).P().c(GameRules.d))) {
|
||||
this.bhy.c(2001, var3, Block.j(Blocks.i.m()));
|
||||
this.bhy.a(var3, Blocks.j.m(), 2);
|
||||
}
|
||||
|
||||
this.bhx.V();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R5Dup2;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R5.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R5.event.CraftEventFactory;
|
||||
import org.bukkit.entity.Mob;
|
||||
|
||||
class BlockInteractionGoalV1_21_R5Dup2 extends PathfinderGoal {
|
||||
private static final int bhU = 40;
|
||||
private static Predicate beh;
|
||||
private final EntityInsentient bhV;
|
||||
private final World bhW;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalV1_21_R5Dup2(MobGoalFactoryImplV1_21_R5Dup2 var1, Mob var2, Predicate var3) {
|
||||
this.bhX = var2;
|
||||
this.bhY = var3;
|
||||
this.bhV = ((CraftMob)this.bhX).getHandle();
|
||||
this.bhW = this.bhV.ai();
|
||||
if (this.bhY == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.createCraftBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method5078() {
|
||||
if (!((WorldServer)this.bhW).J.a.b(this.bhV.dz())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bhV.ec().a(this.bhV.g_() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPosition var1 = this.bhV.dx();
|
||||
return beh.test(this.bhW.a_(var1));
|
||||
}
|
||||
|
||||
public void method5079() {
|
||||
this.bek = this.a(40);
|
||||
this.bhW.a(this.bhV, (byte)10);
|
||||
this.bhV.S().n();
|
||||
}
|
||||
|
||||
public void method5080() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean method5081() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public void method5082() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.a(4)) {
|
||||
BlockPosition var1 = this.bhV.dx();
|
||||
IBlockData var2 = this.bhW.a_(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bhV, var1, var2.y().g(), !a(this.bhW).P().c(GameRules.d))) {
|
||||
this.bhW.b(var1, false);
|
||||
}
|
||||
|
||||
this.bhV.V();
|
||||
} else {
|
||||
BlockPosition var3 = var1.e();
|
||||
if (this.bhW.a_(var3).a(Blocks.i)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bhV, var3, Blocks.j.m(), !a(this.bhW).P().c(GameRules.d))) {
|
||||
this.bhW.c(2001, var3, Block.j(Blocks.i.m()));
|
||||
this.bhW.a(var3, Blocks.j.m(), 2);
|
||||
}
|
||||
|
||||
this.bhV.V();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R5Dup3;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R5.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R5.event.CraftEventFactory;
|
||||
import org.bukkit.entity.Mob;
|
||||
|
||||
class BlockInteractionGoalV1_21_R5Dup3 extends PathfinderGoal {
|
||||
private static final int bis = 40;
|
||||
private static Predicate beh;
|
||||
private final EntityInsentient bit;
|
||||
private final World biu;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalV1_21_R5Dup3(MobGoalFactoryImplV1_21_R5Dup3 var1, Mob var2, Predicate var3) {
|
||||
this.biv = var2;
|
||||
this.biw = var3;
|
||||
this.bit = ((CraftMob)this.biv).getHandle();
|
||||
this.biu = this.bit.ai();
|
||||
if (this.biw == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.createCraftBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method5101() {
|
||||
if (!((WorldServer)this.biu).J.a.b(this.bit.dz())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bit.ec().a(this.bit.g_() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPosition var1 = this.bit.dx();
|
||||
return beh.test(this.biu.a_(var1));
|
||||
}
|
||||
|
||||
public void method5102() {
|
||||
this.bek = this.a(40);
|
||||
this.biu.a(this.bit, (byte)10);
|
||||
this.bit.S().n();
|
||||
}
|
||||
|
||||
public void method5103() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean method5104() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public void method5105() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.a(4)) {
|
||||
BlockPosition var1 = this.bit.dx();
|
||||
IBlockData var2 = this.biu.a_(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bit, var1, var2.y().g(), !a(this.biu).P().c(GameRules.d))) {
|
||||
this.biu.b(var1, false);
|
||||
}
|
||||
|
||||
this.bit.V();
|
||||
} else {
|
||||
BlockPosition var3 = var1.e();
|
||||
if (this.biu.a_(var3).a(Blocks.i)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bit, var3, Blocks.j.m(), !a(this.biu).P().c(GameRules.d))) {
|
||||
this.biu.c(2001, var3, Block.j(Blocks.i.m()));
|
||||
this.biu.a(var3, Blocks.j.m(), 2);
|
||||
}
|
||||
|
||||
this.bit.V();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R6;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R6.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R6.event.CraftEventFactory;
|
||||
import org.bukkit.entity.Mob;
|
||||
|
||||
class BlockInteractionGoalV1_21_R6 extends PathfinderGoal {
|
||||
private static final int bfg = 40;
|
||||
private static Predicate beh;
|
||||
private final EntityInsentient bfh;
|
||||
private final World bfi;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalV1_21_R6(MobGoalFactoryImplV1_21_R6 var1, Mob var2, Predicate var3) {
|
||||
this.bfj = var2;
|
||||
this.bfk = var3;
|
||||
this.bfh = ((CraftMob)this.bfj).getHandle();
|
||||
this.bfi = this.bfh.an();
|
||||
if (this.bfk == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.createCraftBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method4910() {
|
||||
if (!((WorldServer)this.bfi).H.a.b(this.bfh.dH())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bfh.ek().a(this.bfh.g_() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPosition var1 = this.bfh.dF();
|
||||
return beh.test(this.bfi.a_(var1));
|
||||
}
|
||||
|
||||
public void method4911() {
|
||||
this.bek = this.a(40);
|
||||
this.bfi.a(this.bfh, (byte)10);
|
||||
this.bfh.S().n();
|
||||
}
|
||||
|
||||
public void method4912() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean method4913() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public void method4914() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.a(4)) {
|
||||
BlockPosition var1 = this.bfh.dF();
|
||||
IBlockData var2 = this.bfi.a_(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bfh, var1, var2.y().g(), !a(this.bfi).S().c(GameRules.d))) {
|
||||
this.bfi.b(var1, false);
|
||||
}
|
||||
|
||||
this.bfh.V();
|
||||
} else {
|
||||
BlockPosition var3 = var1.e();
|
||||
if (this.bfi.a_(var3).a(Blocks.i)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bfh, var3, Blocks.j.m(), !a(this.bfi).S().c(GameRules.d))) {
|
||||
this.bfi.c(2001, var3, Block.j(Blocks.i.m()));
|
||||
this.bfi.a(var3, Blocks.j.m(), 2);
|
||||
}
|
||||
|
||||
this.bfh.V();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R7;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.craftbukkit.v1_21_R7.entity.CraftMob;
|
||||
import org.bukkit.craftbukkit.v1_21_R7.event.CraftEventFactory;
|
||||
import org.bukkit.entity.Mob;
|
||||
|
||||
public class BlockInteractionGoalV1_21_R7 extends PathfinderGoal {
|
||||
private static final int bfE = 40;
|
||||
private static Predicate beh;
|
||||
private final EntityInsentient bfF;
|
||||
private final World bfG;
|
||||
private int bek;
|
||||
|
||||
BlockInteractionGoalV1_21_R7(MobGoalFactoryImplV1_21_R7 var1, Mob var2, Predicate var3) {
|
||||
this.bfH = var2;
|
||||
this.bfI = var3;
|
||||
this.bfF = ((CraftMob)this.bfH).getHandle();
|
||||
this.bfG = this.bfF.ao();
|
||||
if (this.bfI == null) {
|
||||
beh = var0 -> false;
|
||||
} else {
|
||||
beh = var1x -> {
|
||||
BlockState var2x = var1x.createCraftBlockData().createBlockState();
|
||||
return var0.test(var2x);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method4955() {
|
||||
if (!((WorldServer)this.bfG).G.a.b(this.bfF.dM())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bfF.ep().a(this.bfF.e_() ? 50 : 1000) != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockPosition var1 = this.bfF.dK();
|
||||
return beh.test(this.bfG.a_(var1));
|
||||
}
|
||||
|
||||
public void method4956() {
|
||||
this.bek = this.a(40);
|
||||
this.bfG.a(this.bfF, (byte)10);
|
||||
this.bfF.N().n();
|
||||
}
|
||||
|
||||
public void method4957() {
|
||||
this.bek = 0;
|
||||
}
|
||||
|
||||
public boolean method4958() {
|
||||
return this.bek > 0;
|
||||
}
|
||||
|
||||
public void method4959() {
|
||||
this.bek = Math.max(0, this.bek - 1);
|
||||
if (this.bek == this.a(4)) {
|
||||
BlockPosition var1 = this.bfF.dK();
|
||||
IBlockData var2 = this.bfG.a_(var1);
|
||||
if (beh.test(var2)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bfF, var1, var2.y().g(), !(Boolean)a(this.bfG).U().a(GameRules.MOB_GRIEFING))) {
|
||||
this.bfG.b(var1, false);
|
||||
}
|
||||
|
||||
this.bfF.R();
|
||||
} else {
|
||||
BlockPosition var3 = var1.e();
|
||||
if (this.bfG.a_(var3).a(Blocks.GRASS_BLOCK)) {
|
||||
if (CraftEventFactory.callEntityChangeBlockEvent(this.bfF, var3, Blocks.DIRT.m(), !(Boolean)a(this.bfG).U().a(GameRules.MOB_GRIEFING))) {
|
||||
this.bfG.c(2001, var3, Block.j(Blocks.GRASS_BLOCK.m()));
|
||||
this.bfG.a(var3, Blocks.DIRT.m(), 2);
|
||||
}
|
||||
|
||||
this.bfF.R();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Predicate;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Mob;
|
||||
|
||||
public final class BlockSearchScanner {
|
||||
private static final Map aaO = new ConcurrentHashMap();
|
||||
private final List aaP;
|
||||
private final int aaQ;
|
||||
private Location Sd;
|
||||
private int aaR;
|
||||
|
||||
public BlockSearchScanner(int var1, int var2, int var3) {
|
||||
int var4 = Math.min(16, var1);
|
||||
this.aaQ = var3;
|
||||
this.aaP = aaO.computeIfAbsent(var4 * 32 + var2, var2x -> {
|
||||
ArrayList var3x = new ArrayList();
|
||||
|
||||
for (int var4x = -var4; var4x <= var4; var4x++) {
|
||||
for (int var5 = -var2; var5 <= var2; var5++) {
|
||||
for (int var6 = -var4; var6 <= var4; var6++) {
|
||||
if (var4x * var4x + var6 * var6 <= var4 * var4) {
|
||||
var3x.add(new int[]{var4x, var5, var6});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var3x.sort(Comparator.comparingInt(var0x -> var0x[0] * var0x[0] + var0x[1] * var0x[1] + var0x[2] * var0x[2]));
|
||||
return List.copyOf(var3x);
|
||||
});
|
||||
}
|
||||
|
||||
public Block method9629(Mob var1, Predicate var2) {
|
||||
if (this.Sd == null || this.Sd.getWorld() != var1.getWorld() || this.Sd.distanceSquared(var1.getLocation()) > 9.0) {
|
||||
this.Sd = var1.getLocation();
|
||||
this.aaR = 0;
|
||||
}
|
||||
|
||||
for (int var3 = 0; var3 < this.aaQ && var3 < this.aaP.size(); var3++) {
|
||||
int[] var4 = (int[])this.aaP.get(this.aaR++);
|
||||
if (this.aaR == this.aaP.size()) {
|
||||
this.aaR = 0;
|
||||
}
|
||||
|
||||
int var5 = this.Sd.getBlockX() + var4[0];
|
||||
int var6 = this.Sd.getBlockY() + var4[1];
|
||||
int var7 = this.Sd.getBlockZ() + var4[2];
|
||||
if (var6 >= var1.getWorld().getMinHeight() && var6 < var1.getWorld().getMaxHeight() && var1.getWorld().isChunkLoaded(var5 >> 4, var7 >> 4)) {
|
||||
Block var8 = var1.getWorld().getBlockAt(var5, var6, var7);
|
||||
if (var2.test(var8)) {
|
||||
return var8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalWrapped;
|
||||
|
||||
final class ConditionalWrappedGoal extends PathfinderGoalWrapped {
|
||||
private final BooleanSupplier beu;
|
||||
|
||||
ConditionalWrappedGoal(int var1, PathfinderGoal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.beu = var3;
|
||||
}
|
||||
|
||||
public boolean method4876() {
|
||||
return this.beu.getAsBoolean() && super.a();
|
||||
}
|
||||
|
||||
public boolean method4877() {
|
||||
return this.beu.getAsBoolean() && super.b();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalWrapped;
|
||||
|
||||
final class ConditionalWrappedGoalB extends PathfinderGoalWrapped {
|
||||
private final BooleanSupplier beS;
|
||||
|
||||
ConditionalWrappedGoalB(int var1, PathfinderGoal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.beS = var3;
|
||||
}
|
||||
|
||||
public boolean method4899() {
|
||||
return this.beS.getAsBoolean() && super.b();
|
||||
}
|
||||
|
||||
public boolean method4900() {
|
||||
return this.beS.getAsBoolean() && super.c();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalWrapped;
|
||||
|
||||
final class ConditionalWrappedGoalC extends PathfinderGoalWrapped {
|
||||
private final BooleanSupplier bfq;
|
||||
|
||||
ConditionalWrappedGoalC(int var1, PathfinderGoal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.bfq = var3;
|
||||
}
|
||||
|
||||
public boolean method4922() {
|
||||
return this.bfq.getAsBoolean() && super.b();
|
||||
}
|
||||
|
||||
public boolean method4923() {
|
||||
return this.bfq.getAsBoolean() && super.c();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalWrapped;
|
||||
|
||||
public final class ConditionalWrappedGoalD extends PathfinderGoalWrapped {
|
||||
private final BooleanSupplier bfO;
|
||||
|
||||
ConditionalWrappedGoalD(int var1, PathfinderGoal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.bfO = var3;
|
||||
}
|
||||
|
||||
public boolean method4967() {
|
||||
return this.bfO.getAsBoolean() && super.b();
|
||||
}
|
||||
|
||||
public boolean method4968() {
|
||||
return this.bfO.getAsBoolean() && super.c();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalWrapped;
|
||||
|
||||
final class ConditionalWrappedGoalE extends PathfinderGoalWrapped {
|
||||
private final BooleanSupplier bgm;
|
||||
|
||||
ConditionalWrappedGoalE(int var1, PathfinderGoal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.bgm = var3;
|
||||
}
|
||||
|
||||
public boolean method4990() {
|
||||
return this.bgm.getAsBoolean() && super.b();
|
||||
}
|
||||
|
||||
public boolean method4991() {
|
||||
return this.bgm.getAsBoolean() && super.c();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalWrapped;
|
||||
|
||||
final class ConditionalWrappedGoalF extends PathfinderGoalWrapped {
|
||||
private final BooleanSupplier bgK;
|
||||
|
||||
ConditionalWrappedGoalF(int var1, PathfinderGoal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.bgK = var3;
|
||||
}
|
||||
|
||||
public boolean method5013() {
|
||||
return this.bgK.getAsBoolean() && super.b();
|
||||
}
|
||||
|
||||
public boolean method5014() {
|
||||
return this.bgK.getAsBoolean() && super.c();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalWrapped;
|
||||
|
||||
final class ConditionalWrappedGoalG extends PathfinderGoalWrapped {
|
||||
private final BooleanSupplier bhi;
|
||||
|
||||
ConditionalWrappedGoalG(int var1, PathfinderGoal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.bhi = var3;
|
||||
}
|
||||
|
||||
public boolean method5044() {
|
||||
return this.bhi.getAsBoolean() && super.b();
|
||||
}
|
||||
|
||||
public boolean method5045() {
|
||||
return this.bhi.getAsBoolean() && super.c();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalWrapped;
|
||||
|
||||
final class ConditionalWrappedGoalH extends PathfinderGoalWrapped {
|
||||
private final BooleanSupplier bhG;
|
||||
|
||||
ConditionalWrappedGoalH(int var1, PathfinderGoal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.bhG = var3;
|
||||
}
|
||||
|
||||
public boolean method5067() {
|
||||
return this.bhG.getAsBoolean() && super.b();
|
||||
}
|
||||
|
||||
public boolean method5068() {
|
||||
return this.bhG.getAsBoolean() && super.c();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalWrapped;
|
||||
|
||||
final class ConditionalWrappedGoalI extends PathfinderGoalWrapped {
|
||||
private final BooleanSupplier bie;
|
||||
|
||||
ConditionalWrappedGoalI(int var1, PathfinderGoal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.bie = var3;
|
||||
}
|
||||
|
||||
public boolean method5090() {
|
||||
return this.bie.getAsBoolean() && super.b();
|
||||
}
|
||||
|
||||
public boolean method5091() {
|
||||
return this.bie.getAsBoolean() && super.c();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalWrapped;
|
||||
|
||||
final class ConditionalWrappedGoalJ extends PathfinderGoalWrapped {
|
||||
private final BooleanSupplier biC;
|
||||
|
||||
ConditionalWrappedGoalJ(int var1, PathfinderGoal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.biC = var3;
|
||||
}
|
||||
|
||||
public boolean method5113() {
|
||||
return this.biC.getAsBoolean() && super.b();
|
||||
}
|
||||
|
||||
public boolean method5114() {
|
||||
return this.biC.getAsBoolean() && super.c();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.entity.ai.goal.WrappedGoal;
|
||||
|
||||
public final class ConditionalWrappedGoalK extends WrappedGoal {
|
||||
private final BooleanSupplier bja;
|
||||
|
||||
ConditionalWrappedGoalK(int var1, Goal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.bja = var3;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
return this.bja.getAsBoolean() && super.canUse();
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bja.getAsBoolean() && super.canContinueToUse();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.entity.ai.goal.WrappedGoal;
|
||||
|
||||
public final class ConditionalWrappedGoalL extends WrappedGoal {
|
||||
private final BooleanSupplier bjy;
|
||||
|
||||
ConditionalWrappedGoalL(int var1, Goal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.bjy = var3;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
return this.bjy.getAsBoolean() && super.canUse();
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bjy.getAsBoolean() && super.canContinueToUse();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.entity.ai.goal.WrappedGoal;
|
||||
|
||||
public final class ConditionalWrappedGoalM extends WrappedGoal {
|
||||
private final BooleanSupplier bjW;
|
||||
|
||||
ConditionalWrappedGoalM(int var1, Goal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.bjW = var3;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
return this.bjW.getAsBoolean() && super.canUse();
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bjW.getAsBoolean() && super.canContinueToUse();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.entity.ai.goal.WrappedGoal;
|
||||
|
||||
public final class ConditionalWrappedGoalN extends WrappedGoal {
|
||||
private final BooleanSupplier bku;
|
||||
|
||||
ConditionalWrappedGoalN(int var1, Goal var2, BooleanSupplier var3) {
|
||||
super(var1, var2);
|
||||
this.bku = var3;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
return this.bku.getAsBoolean() && super.canUse();
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bku.getAsBoolean() && super.canContinueToUse();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
public interface CustomGoal {
|
||||
EnumSet yW();
|
||||
|
||||
boolean zi();
|
||||
|
||||
boolean zj();
|
||||
|
||||
void start();
|
||||
|
||||
void stop();
|
||||
|
||||
void tick();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal.Type;
|
||||
|
||||
final class CustomGoalAdapter extends PathfinderGoal {
|
||||
final String beT;
|
||||
final CustomGoal beU;
|
||||
|
||||
CustomGoalAdapter(String var1, CustomGoal var2) {
|
||||
this.beT = var1;
|
||||
this.beU = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Type.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Type.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
}
|
||||
|
||||
public boolean method4901() {
|
||||
return this.beU.zi();
|
||||
}
|
||||
|
||||
public boolean method4902() {
|
||||
return this.beU.zj();
|
||||
}
|
||||
|
||||
public void method4903() {
|
||||
this.beU.start();
|
||||
}
|
||||
|
||||
public void method4904() {
|
||||
this.beU.stop();
|
||||
}
|
||||
|
||||
public void method4905() {
|
||||
this.beU.tick();
|
||||
}
|
||||
|
||||
public boolean V_() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal.Type;
|
||||
|
||||
final class CustomGoalAdapterB extends PathfinderGoal {
|
||||
final String bfr;
|
||||
final CustomGoal bfs;
|
||||
|
||||
CustomGoalAdapterB(String var1, CustomGoal var2) {
|
||||
this.bfr = var1;
|
||||
this.bfs = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Type.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Type.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
}
|
||||
|
||||
public boolean method4924() {
|
||||
return this.bfs.zi();
|
||||
}
|
||||
|
||||
public boolean method4925() {
|
||||
return this.bfs.zj();
|
||||
}
|
||||
|
||||
public void method4926() {
|
||||
this.bfs.start();
|
||||
}
|
||||
|
||||
public void method4927() {
|
||||
this.bfs.stop();
|
||||
}
|
||||
|
||||
public void method4928() {
|
||||
this.bfs.tick();
|
||||
}
|
||||
|
||||
public boolean Y_() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal.Type;
|
||||
|
||||
public final class CustomGoalAdapterC extends PathfinderGoal {
|
||||
final String bfP;
|
||||
final CustomGoal bfQ;
|
||||
|
||||
CustomGoalAdapterC(String var1, CustomGoal var2) {
|
||||
this.bfP = var1;
|
||||
this.bfQ = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Type.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Type.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
}
|
||||
|
||||
public boolean method4969() {
|
||||
return this.bfQ.zi();
|
||||
}
|
||||
|
||||
public boolean method4970() {
|
||||
return this.bfQ.zj();
|
||||
}
|
||||
|
||||
public void method4971() {
|
||||
this.bfQ.start();
|
||||
}
|
||||
|
||||
public void method4972() {
|
||||
this.bfQ.stop();
|
||||
}
|
||||
|
||||
public void method4973() {
|
||||
this.bfQ.tick();
|
||||
}
|
||||
|
||||
public boolean X_() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal.Type;
|
||||
|
||||
final class CustomGoalAdapterD extends PathfinderGoal {
|
||||
final String bgn;
|
||||
final CustomGoal bgo;
|
||||
|
||||
CustomGoalAdapterD(String var1, CustomGoal var2) {
|
||||
this.bgn = var1;
|
||||
this.bgo = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Type.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Type.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
}
|
||||
|
||||
public boolean method4992() {
|
||||
return this.bgo.zi();
|
||||
}
|
||||
|
||||
public boolean method4993() {
|
||||
return this.bgo.zj();
|
||||
}
|
||||
|
||||
public void method4994() {
|
||||
this.bgo.start();
|
||||
}
|
||||
|
||||
public void method4995() {
|
||||
this.bgo.stop();
|
||||
}
|
||||
|
||||
public void method4996() {
|
||||
this.bgo.tick();
|
||||
}
|
||||
|
||||
public boolean V_() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal.Type;
|
||||
|
||||
final class CustomGoalAdapterE extends PathfinderGoal {
|
||||
final String bgL;
|
||||
final CustomGoal bgM;
|
||||
|
||||
CustomGoalAdapterE(String var1, CustomGoal var2) {
|
||||
this.bgL = var1;
|
||||
this.bgM = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Type.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Type.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
}
|
||||
|
||||
public boolean method5023() {
|
||||
return this.bgM.zi();
|
||||
}
|
||||
|
||||
public boolean method5024() {
|
||||
return this.bgM.zj();
|
||||
}
|
||||
|
||||
public void method5025() {
|
||||
this.bgM.start();
|
||||
}
|
||||
|
||||
public void method5026() {
|
||||
this.bgM.stop();
|
||||
}
|
||||
|
||||
public void method5027() {
|
||||
this.bgM.tick();
|
||||
}
|
||||
|
||||
public boolean V_() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal.Type;
|
||||
|
||||
final class CustomGoalAdapterF extends PathfinderGoal {
|
||||
final String bhj;
|
||||
final CustomGoal bhk;
|
||||
|
||||
CustomGoalAdapterF(String var1, CustomGoal var2) {
|
||||
this.bhj = var1;
|
||||
this.bhk = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Type.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Type.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
}
|
||||
|
||||
public boolean method5046() {
|
||||
return this.bhk.zi();
|
||||
}
|
||||
|
||||
public boolean method5047() {
|
||||
return this.bhk.zj();
|
||||
}
|
||||
|
||||
public void method5048() {
|
||||
this.bhk.start();
|
||||
}
|
||||
|
||||
public void method5049() {
|
||||
this.bhk.stop();
|
||||
}
|
||||
|
||||
public void method5050() {
|
||||
this.bhk.tick();
|
||||
}
|
||||
|
||||
public boolean W_() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal.Type;
|
||||
|
||||
final class CustomGoalAdapterG extends PathfinderGoal {
|
||||
final String bhH;
|
||||
final CustomGoal bhI;
|
||||
|
||||
CustomGoalAdapterG(String var1, CustomGoal var2) {
|
||||
this.bhH = var1;
|
||||
this.bhI = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Type.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Type.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
}
|
||||
|
||||
public boolean method5069() {
|
||||
return this.bhI.zi();
|
||||
}
|
||||
|
||||
public boolean method5070() {
|
||||
return this.bhI.zj();
|
||||
}
|
||||
|
||||
public void method5071() {
|
||||
this.bhI.start();
|
||||
}
|
||||
|
||||
public void method5072() {
|
||||
this.bhI.stop();
|
||||
}
|
||||
|
||||
public void method5073() {
|
||||
this.bhI.tick();
|
||||
}
|
||||
|
||||
public boolean X_() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal.Type;
|
||||
|
||||
final class CustomGoalAdapterH extends PathfinderGoal {
|
||||
final String bif;
|
||||
final CustomGoal big;
|
||||
|
||||
CustomGoalAdapterH(String var1, CustomGoal var2) {
|
||||
this.bif = var1;
|
||||
this.big = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Type.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Type.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
}
|
||||
|
||||
public boolean method5092() {
|
||||
return this.big.zi();
|
||||
}
|
||||
|
||||
public boolean method5093() {
|
||||
return this.big.zj();
|
||||
}
|
||||
|
||||
public void method5094() {
|
||||
this.big.start();
|
||||
}
|
||||
|
||||
public void method5095() {
|
||||
this.big.stop();
|
||||
}
|
||||
|
||||
public void method5096() {
|
||||
this.big.tick();
|
||||
}
|
||||
|
||||
public boolean X_() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoal.Type;
|
||||
|
||||
final class CustomGoalAdapterI extends PathfinderGoal {
|
||||
final String biD;
|
||||
final CustomGoal biE;
|
||||
|
||||
CustomGoalAdapterI(String var1, CustomGoal var2) {
|
||||
this.biD = var1;
|
||||
this.biE = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Type.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Type.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.a(var3);
|
||||
}
|
||||
|
||||
public boolean method5115() {
|
||||
return this.biE.zi();
|
||||
}
|
||||
|
||||
public boolean method5116() {
|
||||
return this.biE.zj();
|
||||
}
|
||||
|
||||
public void method5117() {
|
||||
this.biE.start();
|
||||
}
|
||||
|
||||
public void method5118() {
|
||||
this.biE.stop();
|
||||
}
|
||||
|
||||
public void method5119() {
|
||||
this.biE.tick();
|
||||
}
|
||||
|
||||
public boolean X_() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.entity.ai.goal.Goal.Flag;
|
||||
|
||||
public final class CustomGoalAdapterJ extends Goal {
|
||||
final String bjb;
|
||||
final CustomGoal bjc;
|
||||
|
||||
CustomGoalAdapterJ(String var1, CustomGoal var2) {
|
||||
this.bjb = var1;
|
||||
this.bjc = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Flag.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Flag.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.setFlags(var3);
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
return this.bjc.zi();
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bjc.zj();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
this.bjc.start();
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.bjc.stop();
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
this.bjc.tick();
|
||||
}
|
||||
|
||||
public boolean requiresUpdateEveryTick() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.entity.ai.goal.Goal.Flag;
|
||||
|
||||
public final class CustomGoalAdapterK extends Goal {
|
||||
final String bjz;
|
||||
final CustomGoal bjA;
|
||||
|
||||
CustomGoalAdapterK(String var1, CustomGoal var2) {
|
||||
this.bjz = var1;
|
||||
this.bjA = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Flag.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Flag.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.setFlags(var3);
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
return this.bjA.zi();
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bjA.zj();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
this.bjA.start();
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.bjA.stop();
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
this.bjA.tick();
|
||||
}
|
||||
|
||||
public boolean requiresUpdateEveryTick() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.entity.ai.goal.Goal.Flag;
|
||||
|
||||
public final class CustomGoalAdapterL extends Goal {
|
||||
final String bjX;
|
||||
final CustomGoal bjY;
|
||||
|
||||
CustomGoalAdapterL(String var1, CustomGoal var2) {
|
||||
this.bjX = var1;
|
||||
this.bjY = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Flag.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Flag.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.setFlags(var3);
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
return this.bjY.zi();
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bjY.zj();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
this.bjY.start();
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.bjY.stop();
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
this.bjY.tick();
|
||||
}
|
||||
|
||||
public boolean requiresUpdateEveryTick() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.world.entity.ai.goal.Goal;
|
||||
import net.minecraft.world.entity.ai.goal.Goal.Flag;
|
||||
|
||||
public final class CustomGoalAdapterM extends Goal {
|
||||
final String bkv;
|
||||
final CustomGoal bkw;
|
||||
|
||||
CustomGoalAdapterM(String var1, CustomGoal var2) {
|
||||
this.bkv = var1;
|
||||
this.bkw = var2;
|
||||
EnumSet var3 = EnumSet.noneOf(Flag.class);
|
||||
|
||||
for (GoalFlag var5 : var2.yW()) {
|
||||
var3.add(Flag.valueOf(var5.name()));
|
||||
}
|
||||
|
||||
this.setFlags(var3);
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
return this.bkw.zi();
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return this.bkw.zj();
|
||||
}
|
||||
|
||||
public void start() {
|
||||
this.bkw.start();
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
this.bkw.stop();
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
this.bkw.tick();
|
||||
}
|
||||
|
||||
public boolean requiresUpdateEveryTick() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
public enum GoalFlag {
|
||||
MOVE,
|
||||
LOOK,
|
||||
JUMP,
|
||||
TARGET;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGeneric;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.entity.PathfinderMob;
|
||||
import net.minecraft.world.entity.ai.goal.MoveToBlockGoal;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class GotoTargetGoalGeneric extends MoveToBlockGoal {
|
||||
GotoTargetGoalGeneric(MobGoalFactoryImplGeneric var1, PathfinderMob var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.biP = var6;
|
||||
}
|
||||
|
||||
protected boolean isValidTarget(@NotNull LevelReader levelReader, @NotNull BlockPos blockPos) {
|
||||
BlockState var3 = levelReader.getBlockState(blockPos);
|
||||
if (var3.isAir()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
org.bukkit.block.BlockState var4 = var3.asBlockData().createBlockState();
|
||||
return this.biP == null || this.biP.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup2;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.entity.PathfinderMob;
|
||||
import net.minecraft.world.entity.ai.goal.MoveToBlockGoal;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class GotoTargetGoalGenericDup2 extends MoveToBlockGoal {
|
||||
GotoTargetGoalGenericDup2(MobGoalFactoryImplGenericDup2 var1, PathfinderMob var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.bjn = var6;
|
||||
}
|
||||
|
||||
protected boolean isValidTarget(@NotNull LevelReader levelReader, @NotNull BlockPos blockPos) {
|
||||
BlockState var3 = levelReader.getBlockState(blockPos);
|
||||
if (var3.isAir()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
org.bukkit.block.BlockState var4 = var3.asBlockData().createBlockState();
|
||||
return this.bjn == null || this.bjn.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup3;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.entity.PathfinderMob;
|
||||
import net.minecraft.world.entity.ai.goal.MoveToBlockGoal;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class GotoTargetGoalGenericDup3 extends MoveToBlockGoal {
|
||||
GotoTargetGoalGenericDup3(MobGoalFactoryImplGenericDup3 var1, PathfinderMob var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.bjL = var6;
|
||||
}
|
||||
|
||||
protected boolean isValidTarget(@NotNull LevelReader levelReader, @NotNull BlockPos blockPos) {
|
||||
BlockState var3 = levelReader.getBlockState(blockPos);
|
||||
if (var3.isAir()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
org.bukkit.block.BlockState var4 = var3.asBlockData().createBlockState();
|
||||
return this.bjL == null || this.bjL.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup4;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.entity.PathfinderMob;
|
||||
import net.minecraft.world.entity.ai.goal.MoveToBlockGoal;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class GotoTargetGoalGenericDup4 extends MoveToBlockGoal {
|
||||
GotoTargetGoalGenericDup4(MobGoalFactoryImplGenericDup4 var1, PathfinderMob var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.bkj = var6;
|
||||
}
|
||||
|
||||
protected boolean isValidTarget(@NotNull LevelReader levelReader, @NotNull BlockPos blockPos) {
|
||||
BlockState var3 = levelReader.getBlockState(blockPos);
|
||||
if (var3.isAir()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
org.bukkit.block.BlockState var4 = var3.asBlockData().createBlockState();
|
||||
return this.bkj == null || this.bkj.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R1;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.world.entity.EntityCreature;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalGotoTarget;
|
||||
import net.minecraft.world.level.IWorldReader;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class GotoTargetGoalV1_21_R1 extends PathfinderGoalGotoTarget {
|
||||
GotoTargetGoalV1_21_R1(MobGoalFactoryImplV1_21_R1 var1, EntityCreature var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.beH = var6;
|
||||
}
|
||||
|
||||
protected boolean method4886(@NotNull IWorldReader levelReader, @NotNull BlockPosition blockPos) {
|
||||
IBlockData var3 = levelReader.a_(blockPos);
|
||||
if (var3.i()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockState var4 = var3.createCraftBlockData().createBlockState();
|
||||
return this.beH == null || this.beH.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R2;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.world.entity.EntityCreature;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalGotoTarget;
|
||||
import net.minecraft.world.level.IWorldReader;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class GotoTargetGoalV1_21_R2 extends PathfinderGoalGotoTarget {
|
||||
GotoTargetGoalV1_21_R2(MobGoalFactoryImplV1_21_R2 var1, EntityCreature var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.bgb = var6;
|
||||
}
|
||||
|
||||
protected boolean method4977(@NotNull IWorldReader levelReader, @NotNull BlockPosition blockPos) {
|
||||
IBlockData var3 = levelReader.a_(blockPos);
|
||||
if (var3.l()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockState var4 = var3.createCraftBlockData().createBlockState();
|
||||
return this.bgb == null || this.bgb.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R3;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.world.entity.EntityCreature;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalGotoTarget;
|
||||
import net.minecraft.world.level.IWorldReader;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class GotoTargetGoalV1_21_R3 extends PathfinderGoalGotoTarget {
|
||||
GotoTargetGoalV1_21_R3(MobGoalFactoryImplV1_21_R3 var1, EntityCreature var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.bgz = var6;
|
||||
}
|
||||
|
||||
protected boolean method5000(@NotNull IWorldReader levelReader, @NotNull BlockPosition blockPos) {
|
||||
IBlockData var3 = levelReader.a_(blockPos);
|
||||
if (var3.l()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockState var4 = var3.createCraftBlockData().createBlockState();
|
||||
return this.bgz == null || this.bgz.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R4;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.world.entity.EntityCreature;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalGotoTarget;
|
||||
import net.minecraft.world.level.IWorldReader;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class GotoTargetGoalV1_21_R4 extends PathfinderGoalGotoTarget {
|
||||
GotoTargetGoalV1_21_R4(MobGoalFactoryImplV1_21_R4 var1, EntityCreature var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.bgX = var6;
|
||||
}
|
||||
|
||||
protected boolean method5031(@NotNull IWorldReader levelReader, @NotNull BlockPosition blockPos) {
|
||||
IBlockData var3 = levelReader.a_(blockPos);
|
||||
if (var3.l()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockState var4 = var3.createCraftBlockData().createBlockState();
|
||||
return this.bgX == null || this.bgX.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R5;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.world.entity.EntityCreature;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalGotoTarget;
|
||||
import net.minecraft.world.level.IWorldReader;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class GotoTargetGoalV1_21_R5 extends PathfinderGoalGotoTarget {
|
||||
GotoTargetGoalV1_21_R5(MobGoalFactoryImplV1_21_R5 var1, EntityCreature var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.bhv = var6;
|
||||
}
|
||||
|
||||
protected boolean method5054(@NotNull IWorldReader levelReader, @NotNull BlockPosition blockPos) {
|
||||
IBlockData var3 = levelReader.a_(blockPos);
|
||||
if (var3.l()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockState var4 = var3.createCraftBlockData().createBlockState();
|
||||
return this.bhv == null || this.bhv.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R5Dup2;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.world.entity.EntityCreature;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalGotoTarget;
|
||||
import net.minecraft.world.level.IWorldReader;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class GotoTargetGoalV1_21_R5Dup2 extends PathfinderGoalGotoTarget {
|
||||
GotoTargetGoalV1_21_R5Dup2(MobGoalFactoryImplV1_21_R5Dup2 var1, EntityCreature var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.bhT = var6;
|
||||
}
|
||||
|
||||
protected boolean method5077(@NotNull IWorldReader levelReader, @NotNull BlockPosition blockPos) {
|
||||
IBlockData var3 = levelReader.a_(blockPos);
|
||||
if (var3.l()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockState var4 = var3.createCraftBlockData().createBlockState();
|
||||
return this.bhT == null || this.bhT.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R5Dup3;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.world.entity.EntityCreature;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalGotoTarget;
|
||||
import net.minecraft.world.level.IWorldReader;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class GotoTargetGoalV1_21_R5Dup3 extends PathfinderGoalGotoTarget {
|
||||
GotoTargetGoalV1_21_R5Dup3(MobGoalFactoryImplV1_21_R5Dup3 var1, EntityCreature var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.bir = var6;
|
||||
}
|
||||
|
||||
protected boolean method5100(@NotNull IWorldReader levelReader, @NotNull BlockPosition blockPos) {
|
||||
IBlockData var3 = levelReader.a_(blockPos);
|
||||
if (var3.l()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockState var4 = var3.createCraftBlockData().createBlockState();
|
||||
return this.bir == null || this.bir.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R6;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.world.entity.EntityCreature;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalGotoTarget;
|
||||
import net.minecraft.world.level.IWorldReader;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class GotoTargetGoalV1_21_R6 extends PathfinderGoalGotoTarget {
|
||||
GotoTargetGoalV1_21_R6(MobGoalFactoryImplV1_21_R6 var1, EntityCreature var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.bff = var6;
|
||||
}
|
||||
|
||||
protected boolean method4909(@NotNull IWorldReader levelReader, @NotNull BlockPosition blockPos) {
|
||||
IBlockData var3 = levelReader.a_(blockPos);
|
||||
if (var3.l()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockState var4 = var3.createCraftBlockData().createBlockState();
|
||||
return this.bff == null || this.bff.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R7;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.world.entity.EntityCreature;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalGotoTarget;
|
||||
import net.minecraft.world.level.IWorldReader;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class GotoTargetGoalV1_21_R7 extends PathfinderGoalGotoTarget {
|
||||
GotoTargetGoalV1_21_R7(MobGoalFactoryImplV1_21_R7 var1, EntityCreature var2, double var3, int var5, Predicate var6) {
|
||||
super(var2, var3, var5);
|
||||
this.bfD = var6;
|
||||
}
|
||||
|
||||
protected boolean method4954(@NotNull IWorldReader levelReader, @NotNull BlockPosition blockPos) {
|
||||
IBlockData var3 = levelReader.a_(blockPos);
|
||||
if (var3.l()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
BlockState var4 = var3.createCraftBlockData().createBlockState();
|
||||
return this.bfD == null || this.bfD.test(var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.entity.EntityTypePairRule;
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGeneric;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntitySelector;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.TamableAnimal;
|
||||
import net.minecraft.world.entity.ai.goal.target.TargetGoal;
|
||||
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class HurtByTargetGoalGeneric extends TargetGoal {
|
||||
private int bdZ;
|
||||
private final boolean biK;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] biL;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] biM;
|
||||
|
||||
HurtByTargetGoalGeneric(MobGoalFactoryImplGeneric var1, Mob var2, boolean var3, EntityTypePairRule[] var4, EntityTypePairRule[] var5) {
|
||||
super(var2, var3);
|
||||
this.biN = var4;
|
||||
this.biO = var5;
|
||||
this.biK = this.biN != null;
|
||||
this.biL = this.biO;
|
||||
this.biM = this.biN;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
int var1 = this.mob.getLastHurtByMobTimestamp();
|
||||
LivingEntity var2 = this.mob.getLastHurtByMob();
|
||||
if (var1 != this.bdZ && var2 != null) {
|
||||
if (var2.getType() == EntityType.PLAYER && (Boolean)getServerLevel(this.mob).getGameRules().get(GameRules.UNIVERSAL_ANGER)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.biL != null) {
|
||||
for (EntityTypePairRule var6 : this.biL) {
|
||||
if (var6 != null
|
||||
&& var6.test((org.bukkit.entity.LivingEntity)this.mob.getBukkitEntity(), (org.bukkit.entity.LivingEntity)var2.getBukkitEntity())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.canAttack(var2, TargetingConditions.forCombat().ignoreLineOfSight().ignoreInvisibilityTesting());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void start() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGeneric.biF, this.mob, this.mob.getLastHurtByMob(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.targetMob = this.mob.getTarget();
|
||||
this.bdZ = this.mob.getLastHurtByMobTimestamp();
|
||||
this.unseenMemoryTicks = 300;
|
||||
if (this.biK) {
|
||||
this.OW();
|
||||
}
|
||||
|
||||
super.start();
|
||||
}
|
||||
|
||||
private void OW() {
|
||||
double var1 = this.getFollowDistance();
|
||||
AABB var3 = AABB.unitCubeFromLowerCorner(this.mob.position()).inflate(var1, 10.0, var1);
|
||||
|
||||
for (Mob var6 : this.mob.level().getEntitiesOfClass(this.mob.getClass(), var3, EntitySelector.NO_SPECTATORS)) {
|
||||
if (this.mob != var6
|
||||
&& var6.getTarget() == null
|
||||
&& (!(this.mob instanceof TamableAnimal) || ((TamableAnimal)this.mob).getOwner() == ((TamableAnimal)var6).getOwner())
|
||||
&& !var6.isAlliedTo(this.mob.getLastHurtByMob())) {
|
||||
boolean var7 = false;
|
||||
if (this.biM != null) {
|
||||
for (EntityTypePairRule var11 : this.biM) {
|
||||
if (var11 != null
|
||||
&& var11.test((org.bukkit.entity.LivingEntity)this.mob.getBukkitEntity(), (org.bukkit.entity.LivingEntity)var6.getBukkitEntity())) {
|
||||
var7 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!var7) {
|
||||
this.method5120(var6, this.mob.getLastHurtByMob());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void method5120(Mob var1, LivingEntity var2) {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGeneric.biF, var1, var2, TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.entity.EntityTypePairRule;
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup2;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntitySelector;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.TamableAnimal;
|
||||
import net.minecraft.world.entity.ai.goal.target.TargetGoal;
|
||||
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class HurtByTargetGoalGenericDup2 extends TargetGoal {
|
||||
private int bdZ;
|
||||
private final boolean bji;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bjj;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bjk;
|
||||
|
||||
HurtByTargetGoalGenericDup2(MobGoalFactoryImplGenericDup2 var1, Mob var2, boolean var3, EntityTypePairRule[] var4, EntityTypePairRule[] var5) {
|
||||
super(var2, var3);
|
||||
this.bjl = var4;
|
||||
this.bjm = var5;
|
||||
this.bji = this.bjl != null;
|
||||
this.bjj = this.bjm;
|
||||
this.bjk = this.bjl;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
int var1 = this.mob.getLastHurtByMobTimestamp();
|
||||
LivingEntity var2 = this.mob.getLastHurtByMob();
|
||||
if (var1 != this.bdZ && var2 != null) {
|
||||
if (var2.getType() == EntityType.PLAYER && (Boolean)getServerLevel(this.mob).getGameRules().get(GameRules.UNIVERSAL_ANGER)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bjj != null) {
|
||||
for (EntityTypePairRule var6 : this.bjj) {
|
||||
if (var6 != null
|
||||
&& var6.test((org.bukkit.entity.LivingEntity)this.mob.getBukkitEntity(), (org.bukkit.entity.LivingEntity)var2.getBukkitEntity())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.canAttack(var2, TargetingConditions.forCombat().ignoreLineOfSight().ignoreInvisibilityTesting());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void start() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGenericDup2.bjd, this.mob, this.mob.getLastHurtByMob(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.targetMob = this.mob.getTarget();
|
||||
this.bdZ = this.mob.getLastHurtByMobTimestamp();
|
||||
this.unseenMemoryTicks = 300;
|
||||
if (this.bji) {
|
||||
this.OW();
|
||||
}
|
||||
|
||||
super.start();
|
||||
}
|
||||
|
||||
private void OW() {
|
||||
double var1 = this.getFollowDistance();
|
||||
AABB var3 = AABB.unitCubeFromLowerCorner(this.mob.position()).inflate(var1, 10.0, var1);
|
||||
|
||||
for (Mob var6 : this.mob.level().getEntitiesOfClass(this.mob.getClass(), var3, EntitySelector.NO_SPECTATORS)) {
|
||||
if (this.mob != var6
|
||||
&& var6.getTarget() == null
|
||||
&& (!(this.mob instanceof TamableAnimal) || ((TamableAnimal)this.mob).getOwner() == ((TamableAnimal)var6).getOwner())
|
||||
&& !var6.isAlliedTo(this.mob.getLastHurtByMob())) {
|
||||
boolean var7 = false;
|
||||
if (this.bjk != null) {
|
||||
for (EntityTypePairRule var11 : this.bjk) {
|
||||
if (var11 != null
|
||||
&& var11.test((org.bukkit.entity.LivingEntity)this.mob.getBukkitEntity(), (org.bukkit.entity.LivingEntity)var6.getBukkitEntity())) {
|
||||
var7 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!var7) {
|
||||
this.method5123(var6, this.mob.getLastHurtByMob());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void method5123(Mob var1, LivingEntity var2) {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGenericDup2.bjd, var1, var2, TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.entity.EntityTypePairRule;
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup3;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntitySelector;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.TamableAnimal;
|
||||
import net.minecraft.world.entity.ai.goal.target.TargetGoal;
|
||||
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class HurtByTargetGoalGenericDup3 extends TargetGoal {
|
||||
private int bdZ;
|
||||
private final boolean bjG;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bjH;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bjI;
|
||||
|
||||
HurtByTargetGoalGenericDup3(MobGoalFactoryImplGenericDup3 var1, Mob var2, boolean var3, EntityTypePairRule[] var4, EntityTypePairRule[] var5) {
|
||||
super(var2, var3);
|
||||
this.bjJ = var4;
|
||||
this.bjK = var5;
|
||||
this.bjG = this.bjJ != null;
|
||||
this.bjH = this.bjK;
|
||||
this.bjI = this.bjJ;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
int var1 = this.mob.getLastHurtByMobTimestamp();
|
||||
LivingEntity var2 = this.mob.getLastHurtByMob();
|
||||
if (var1 != this.bdZ && var2 != null) {
|
||||
if (var2.getType() == EntityTypes.PLAYER && (Boolean)getServerLevel(this.mob).getGameRules().get(GameRules.UNIVERSAL_ANGER)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bjH != null) {
|
||||
for (EntityTypePairRule var6 : this.bjH) {
|
||||
if (var6 != null
|
||||
&& var6.test((org.bukkit.entity.LivingEntity)this.mob.getBukkitEntity(), (org.bukkit.entity.LivingEntity)var2.getBukkitEntity())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.canAttack(var2, TargetingConditions.forCombat().ignoreLineOfSight().ignoreInvisibilityTesting());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void start() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGenericDup3.bjB, this.mob, this.mob.getLastHurtByMob(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.targetMob = this.mob.getTarget();
|
||||
this.bdZ = this.mob.getLastHurtByMobTimestamp();
|
||||
this.unseenMemoryTicks = 300;
|
||||
if (this.bjG) {
|
||||
this.OW();
|
||||
}
|
||||
|
||||
super.start();
|
||||
}
|
||||
|
||||
private void OW() {
|
||||
double var1 = this.getFollowDistance();
|
||||
AABB var3 = AABB.unitCubeFromLowerCorner(this.mob.position()).inflate(var1, 10.0, var1);
|
||||
|
||||
for (Mob var6 : this.mob.level().getEntitiesOfClass(this.mob.getClass(), var3, EntitySelector.NO_SPECTATORS)) {
|
||||
if (this.mob != var6
|
||||
&& var6.getTarget() == null
|
||||
&& (!(this.mob instanceof TamableAnimal) || ((TamableAnimal)this.mob).getOwner() == ((TamableAnimal)var6).getOwner())
|
||||
&& !var6.isAlliedTo(this.mob.getLastHurtByMob())) {
|
||||
boolean var7 = false;
|
||||
if (this.bjI != null) {
|
||||
for (EntityTypePairRule var11 : this.bjI) {
|
||||
if (var11 != null
|
||||
&& var11.test((org.bukkit.entity.LivingEntity)this.mob.getBukkitEntity(), (org.bukkit.entity.LivingEntity)var6.getBukkitEntity())) {
|
||||
var7 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!var7) {
|
||||
this.method5126(var6, this.mob.getLastHurtByMob());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void method5126(Mob var1, LivingEntity var2) {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGenericDup3.bjB, var1, var2, TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.entity.EntityTypePairRule;
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup4;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntitySelector;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.TamableAnimal;
|
||||
import net.minecraft.world.entity.ai.goal.target.TargetGoal;
|
||||
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class HurtByTargetGoalGenericDup4 extends TargetGoal {
|
||||
private int bdZ;
|
||||
private final boolean bke;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bkf;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bkg;
|
||||
|
||||
HurtByTargetGoalGenericDup4(MobGoalFactoryImplGenericDup4 var1, Mob var2, boolean var3, EntityTypePairRule[] var4, EntityTypePairRule[] var5) {
|
||||
super(var2, var3);
|
||||
this.bkh = var4;
|
||||
this.bki = var5;
|
||||
this.bke = this.bkh != null;
|
||||
this.bkf = this.bki;
|
||||
this.bkg = this.bkh;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
int var1 = this.mob.getLastHurtByMobTimestamp();
|
||||
LivingEntity var2 = this.mob.getLastHurtByMob();
|
||||
if (var1 != this.bdZ && var2 != null) {
|
||||
if (var2.getType() == EntityTypes.PLAYER && (Boolean)getServerLevel(this.mob).getGameRules().get(GameRules.UNIVERSAL_ANGER)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bkf != null) {
|
||||
for (EntityTypePairRule var6 : this.bkf) {
|
||||
if (var6 != null
|
||||
&& var6.test((org.bukkit.entity.LivingEntity)this.mob.getBukkitEntity(), (org.bukkit.entity.LivingEntity)var2.getBukkitEntity())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.canAttack(var2, TargetingConditions.forCombat().ignoreLineOfSight().ignoreInvisibilityTesting());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void start() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGenericDup4.bjZ, this.mob, this.mob.getLastHurtByMob(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.targetMob = this.mob.getTarget();
|
||||
this.bdZ = this.mob.getLastHurtByMobTimestamp();
|
||||
this.unseenMemoryTicks = 300;
|
||||
if (this.bke) {
|
||||
this.OW();
|
||||
}
|
||||
|
||||
super.start();
|
||||
}
|
||||
|
||||
private void OW() {
|
||||
double var1 = this.getFollowDistance();
|
||||
AABB var3 = AABB.unitCubeFromLowerCorner(this.mob.position()).inflate(var1, 10.0, var1);
|
||||
|
||||
for (Mob var6 : this.mob.level().getEntitiesOfClass(this.mob.getClass(), var3, EntitySelector.NO_SPECTATORS)) {
|
||||
if (this.mob != var6
|
||||
&& var6.getTarget() == null
|
||||
&& (!(this.mob instanceof TamableAnimal) || ((TamableAnimal)this.mob).getOwner() == ((TamableAnimal)var6).getOwner())
|
||||
&& !var6.isAlliedTo(this.mob.getLastHurtByMob())) {
|
||||
boolean var7 = false;
|
||||
if (this.bkg != null) {
|
||||
for (EntityTypePairRule var11 : this.bkg) {
|
||||
if (var11 != null
|
||||
&& var11.test((org.bukkit.entity.LivingEntity)this.mob.getBukkitEntity(), (org.bukkit.entity.LivingEntity)var6.getBukkitEntity())) {
|
||||
var7 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!var7) {
|
||||
this.method5129(var6, this.mob.getLastHurtByMob());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void method5129(Mob var1, LivingEntity var2) {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGenericDup4.bjZ, var1, var2, TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R1;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalTarget;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
class HurtByTargetGoalV1_21_R1 extends PathfinderGoalTarget {
|
||||
private int bes;
|
||||
|
||||
HurtByTargetGoalV1_21_R1(MobGoalFactoryImplV1_21_R1 var1, EntityInsentient var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.beR = var4;
|
||||
}
|
||||
|
||||
public boolean method4896() {
|
||||
int var1 = this.e.ej();
|
||||
EntityLiving var2 = this.e.ei();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.am() == EntityTypes.by && this.e.dO().ab().b(GameRules.O)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.e.dR().i() < this.beR ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method4897() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void method4898() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R1.bex, this.e, this.e.ei(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.g = this.e.p();
|
||||
this.h = 300;
|
||||
super.d();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.e.dt() + (this.e.dR().j() - 0.5) * 32.0;
|
||||
double var3 = this.e.dv() + (this.e.dR().a(16) - 8);
|
||||
double var5 = this.e.dz() + (this.e.dR().j() - 0.5) * 32.0;
|
||||
return this.e.b(var1, var3, var5, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R2;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalTarget;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
class HurtByTargetGoalV1_21_R2 extends PathfinderGoalTarget {
|
||||
private int bes;
|
||||
|
||||
HurtByTargetGoalV1_21_R2(MobGoalFactoryImplV1_21_R2 var1, EntityInsentient var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.bgl = var4;
|
||||
}
|
||||
|
||||
public boolean method4987() {
|
||||
int var1 = this.e.er();
|
||||
EntityLiving var2 = this.e.eq();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.aq() == EntityTypes.bS && a(this.e).N().b(GameRules.P)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.e.dZ().i() < this.bgl ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method4988() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void method4989() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R2.bfR, this.e, this.e.eq(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.g = this.e.O_();
|
||||
this.h = 300;
|
||||
super.d();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.e.dB() + (this.e.dZ().j() - 0.5) * 32.0;
|
||||
double var3 = this.e.dD() + (this.e.dZ().a(16) - 8);
|
||||
double var5 = this.e.dH() + (this.e.dZ().j() - 0.5) * 32.0;
|
||||
return this.e.b(var1, var3, var5, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R3;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalTarget;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
class HurtByTargetGoalV1_21_R3 extends PathfinderGoalTarget {
|
||||
private int bes;
|
||||
|
||||
HurtByTargetGoalV1_21_R3(MobGoalFactoryImplV1_21_R3 var1, EntityInsentient var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.bgJ = var4;
|
||||
}
|
||||
|
||||
public boolean method5010() {
|
||||
int var1 = this.e.eq();
|
||||
EntityLiving var2 = this.e.ep();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.aq() == EntityTypes.bR && a(this.e).O().b(GameRules.P)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.e.dY().i() < this.bgJ ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method5011() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void method5012() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R3.bgp, this.e, this.e.ep(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.g = this.e.O_();
|
||||
this.h = 300;
|
||||
super.d();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.e.dA() + (this.e.dY().j() - 0.5) * 32.0;
|
||||
double var3 = this.e.dC() + (this.e.dY().a(16) - 8);
|
||||
double var5 = this.e.dG() + (this.e.dY().j() - 0.5) * 32.0;
|
||||
return this.e.b(var1, var3, var5, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R4;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalTarget;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
class HurtByTargetGoalV1_21_R4 extends PathfinderGoalTarget {
|
||||
private int bes;
|
||||
|
||||
HurtByTargetGoalV1_21_R4(MobGoalFactoryImplV1_21_R4 var1, EntityInsentient var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.bhh = var4;
|
||||
}
|
||||
|
||||
public boolean method5041() {
|
||||
int var1 = this.e.et();
|
||||
EntityLiving var2 = this.e.er();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.an() == EntityTypes.bT && a(this.e).O().c(GameRules.Q)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.e.dY().i() < this.bhh ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method5042() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void method5043() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R4.bgN, this.e, this.e.er(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.g = this.e.e();
|
||||
this.h = 300;
|
||||
super.d();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.e.dA() + (this.e.dY().j() - 0.5) * 32.0;
|
||||
double var3 = this.e.dC() + (this.e.dY().a(16) - 8);
|
||||
double var5 = this.e.dG() + (this.e.dY().j() - 0.5) * 32.0;
|
||||
return this.e.b(var1, var3, var5, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.entity.EntityTypePairRule;
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R5;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.EntityTameableAnimal;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.IEntitySelector;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalTarget;
|
||||
import net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class HurtByTargetGoalV1_21_R5 extends PathfinderGoalTarget {
|
||||
private int bdZ;
|
||||
private final boolean bhq;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bhr;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bhs;
|
||||
|
||||
HurtByTargetGoalV1_21_R5(MobGoalFactoryImplV1_21_R5 var1, EntityInsentient var2, boolean var3, EntityTypePairRule[] var4, EntityTypePairRule[] var5) {
|
||||
super(var2, var3);
|
||||
this.bht = var4;
|
||||
this.bhu = var5;
|
||||
this.bhq = this.bht != null;
|
||||
this.bhr = this.bhu;
|
||||
this.bhs = this.bht;
|
||||
}
|
||||
|
||||
public boolean method5051() {
|
||||
int var1 = this.e.ey();
|
||||
EntityLiving var2 = this.e.ew();
|
||||
if (var1 != this.bdZ && var2 != null) {
|
||||
if (var2.ap() == EntityTypes.bU && a(this.e).P().c(GameRules.Q)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bhr != null) {
|
||||
for (EntityTypePairRule var6 : this.bhr) {
|
||||
if (var6 != null && var6.test((LivingEntity)this.e.getBukkitEntity(), (LivingEntity)var2.getBukkitEntity())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.a(var2, PathfinderTargetCondition.a().d().e());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void method5052() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R5.bhl, this.e, this.e.ew(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.g = this.e.e();
|
||||
this.bdZ = this.e.ey();
|
||||
this.h = 300;
|
||||
if (this.bhq) {
|
||||
this.OW();
|
||||
}
|
||||
|
||||
super.d();
|
||||
}
|
||||
|
||||
private void OW() {
|
||||
double var1 = this.l();
|
||||
AxisAlignedBB var3 = AxisAlignedBB.a(this.e.dv()).c(var1, 10.0, var1);
|
||||
|
||||
for (EntityInsentient var6 : this.e.ai().a(this.e.getClass(), var3, IEntitySelector.f)) {
|
||||
if (this.e != var6
|
||||
&& var6.e() == null
|
||||
&& (!(this.e instanceof EntityTameableAnimal) || ((EntityTameableAnimal)this.e).U_() == ((EntityTameableAnimal)var6).U_())
|
||||
&& !var6.t(this.e.ew())) {
|
||||
boolean var7 = false;
|
||||
if (this.bhs != null) {
|
||||
for (EntityTypePairRule var11 : this.bhs) {
|
||||
if (var11 != null && var11.test((LivingEntity)this.e.getBukkitEntity(), (LivingEntity)var6.getBukkitEntity())) {
|
||||
var7 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!var7) {
|
||||
this.method5053(var6, this.e.ew());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void method5053(EntityInsentient var1, EntityLiving var2) {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R5.bhl, var1, var2, TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.entity.EntityTypePairRule;
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R5Dup2;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.EntityTameableAnimal;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.IEntitySelector;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalTarget;
|
||||
import net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class HurtByTargetGoalV1_21_R5Dup2 extends PathfinderGoalTarget {
|
||||
private int bdZ;
|
||||
private final boolean bhO;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bhP;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bhQ;
|
||||
|
||||
HurtByTargetGoalV1_21_R5Dup2(MobGoalFactoryImplV1_21_R5Dup2 var1, EntityInsentient var2, boolean var3, EntityTypePairRule[] var4, EntityTypePairRule[] var5) {
|
||||
super(var2, var3);
|
||||
this.bhR = var4;
|
||||
this.bhS = var5;
|
||||
this.bhO = this.bhR != null;
|
||||
this.bhP = this.bhS;
|
||||
this.bhQ = this.bhR;
|
||||
}
|
||||
|
||||
public boolean method5074() {
|
||||
int var1 = this.e.ey();
|
||||
EntityLiving var2 = this.e.ew();
|
||||
if (var1 != this.bdZ && var2 != null) {
|
||||
if (var2.ap() == EntityTypes.bU && a(this.e).P().c(GameRules.Q)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bhP != null) {
|
||||
for (EntityTypePairRule var6 : this.bhP) {
|
||||
if (var6 != null && var6.test((LivingEntity)this.e.getBukkitEntity(), (LivingEntity)var2.getBukkitEntity())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.a(var2, PathfinderTargetCondition.a().d().e());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void method5075() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R5Dup2.bhJ, this.e, this.e.ew(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.g = this.e.e();
|
||||
this.bdZ = this.e.ey();
|
||||
this.h = 300;
|
||||
if (this.bhO) {
|
||||
this.OW();
|
||||
}
|
||||
|
||||
super.d();
|
||||
}
|
||||
|
||||
private void OW() {
|
||||
double var1 = this.l();
|
||||
AxisAlignedBB var3 = AxisAlignedBB.a(this.e.dv()).c(var1, 10.0, var1);
|
||||
|
||||
for (EntityInsentient var6 : this.e.ai().a(this.e.getClass(), var3, IEntitySelector.f)) {
|
||||
if (this.e != var6
|
||||
&& var6.e() == null
|
||||
&& (!(this.e instanceof EntityTameableAnimal) || ((EntityTameableAnimal)this.e).U_() == ((EntityTameableAnimal)var6).U_())
|
||||
&& !var6.t(this.e.ew())) {
|
||||
boolean var7 = false;
|
||||
if (this.bhQ != null) {
|
||||
for (EntityTypePairRule var11 : this.bhQ) {
|
||||
if (var11 != null && var11.test((LivingEntity)this.e.getBukkitEntity(), (LivingEntity)var6.getBukkitEntity())) {
|
||||
var7 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!var7) {
|
||||
this.method5076(var6, this.e.ew());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void method5076(EntityInsentient var1, EntityLiving var2) {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R5Dup2.bhJ, var1, var2, TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.entity.EntityTypePairRule;
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R5Dup3;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.EntityTameableAnimal;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.IEntitySelector;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalTarget;
|
||||
import net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class HurtByTargetGoalV1_21_R5Dup3 extends PathfinderGoalTarget {
|
||||
private int bdZ;
|
||||
private final boolean bim;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bin;
|
||||
@Nullable
|
||||
private final EntityTypePairRule[] bio;
|
||||
|
||||
HurtByTargetGoalV1_21_R5Dup3(MobGoalFactoryImplV1_21_R5Dup3 var1, EntityInsentient var2, boolean var3, EntityTypePairRule[] var4, EntityTypePairRule[] var5) {
|
||||
super(var2, var3);
|
||||
this.bip = var4;
|
||||
this.biq = var5;
|
||||
this.bim = this.bip != null;
|
||||
this.bin = this.biq;
|
||||
this.bio = this.bip;
|
||||
}
|
||||
|
||||
public boolean method5097() {
|
||||
int var1 = this.e.ey();
|
||||
EntityLiving var2 = this.e.ew();
|
||||
if (var1 != this.bdZ && var2 != null) {
|
||||
if (var2.ap() == EntityTypes.bU && a(this.e).P().c(GameRules.Q)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.bin != null) {
|
||||
for (EntityTypePairRule var6 : this.bin) {
|
||||
if (var6 != null && var6.test((LivingEntity)this.e.getBukkitEntity(), (LivingEntity)var2.getBukkitEntity())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.a(var2, PathfinderTargetCondition.a().d().e());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void method5098() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R5Dup3.bih, this.e, this.e.ew(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.g = this.e.e();
|
||||
this.bdZ = this.e.ey();
|
||||
this.h = 300;
|
||||
if (this.bim) {
|
||||
this.OW();
|
||||
}
|
||||
|
||||
super.d();
|
||||
}
|
||||
|
||||
private void OW() {
|
||||
double var1 = this.l();
|
||||
AxisAlignedBB var3 = AxisAlignedBB.a(this.e.dv()).c(var1, 10.0, var1);
|
||||
|
||||
for (EntityInsentient var6 : this.e.ai().a(this.e.getClass(), var3, IEntitySelector.f)) {
|
||||
if (this.e != var6
|
||||
&& var6.e() == null
|
||||
&& (!(this.e instanceof EntityTameableAnimal) || ((EntityTameableAnimal)this.e).U_() == ((EntityTameableAnimal)var6).U_())
|
||||
&& !var6.t(this.e.ew())) {
|
||||
boolean var7 = false;
|
||||
if (this.bio != null) {
|
||||
for (EntityTypePairRule var11 : this.bio) {
|
||||
if (var11 != null && var11.test((LivingEntity)this.e.getBukkitEntity(), (LivingEntity)var6.getBukkitEntity())) {
|
||||
var7 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!var7) {
|
||||
this.method5099(var6, this.e.ew());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void method5099(EntityInsentient var1, EntityLiving var2) {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R5Dup3.bih, var1, var2, TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R6;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalTarget;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
class HurtByTargetGoalV1_21_R6 extends PathfinderGoalTarget {
|
||||
private int bes;
|
||||
|
||||
HurtByTargetGoalV1_21_R6(MobGoalFactoryImplV1_21_R6 var1, EntityInsentient var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.bfp = var4;
|
||||
}
|
||||
|
||||
public boolean method4919() {
|
||||
int var1 = this.e.eH();
|
||||
EntityLiving var2 = this.e.eF();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.ax() == EntityTypes.bX && a(this.e).S().c(GameRules.Q)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.e.ek().i() < this.bfp ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method4920() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void method4921() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R6.beV, this.e, this.e.eF(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.g = this.e.e();
|
||||
this.h = 300;
|
||||
super.d();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.e.dK() + (this.e.ek().j() - 0.5) * 32.0;
|
||||
double var3 = this.e.dM() + (this.e.ek().a(16) - 8);
|
||||
double var5 = this.e.dQ() + (this.e.ek().j() - 0.5) * 32.0;
|
||||
return this.e.b(var1, var3, var5, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R7;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalTarget;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
public class HurtByTargetGoalV1_21_R7 extends PathfinderGoalTarget {
|
||||
private int bes;
|
||||
|
||||
HurtByTargetGoalV1_21_R7(MobGoalFactoryImplV1_21_R7 var1, EntityInsentient var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.bfN = var4;
|
||||
}
|
||||
|
||||
public boolean method4964() {
|
||||
int var1 = this.e.eM();
|
||||
EntityLiving var2 = this.e.eK();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.ay() == EntityTypes.cb && (Boolean)a(this.e).U().a(GameRules.UNIVERSAL_ANGER)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.e.ep().i() < this.bfN ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method4965() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void method4966() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R7.bft, this.e, this.e.eK(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.g = this.e.ag_();
|
||||
this.h = 300;
|
||||
super.d();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.e.dP() + (this.e.ep().j() - 0.5) * 32.0;
|
||||
double var3 = this.e.dR() + (this.e.ep().a(16) - 8);
|
||||
double var5 = this.e.dV() + (this.e.ep().j() - 0.5) * 32.0;
|
||||
return this.e.b(var1, var3, var5, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGeneric;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.ai.goal.target.TargetGoal;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
public class LookAtPlayerGoalGeneric extends TargetGoal {
|
||||
private int bes;
|
||||
|
||||
LookAtPlayerGoalGeneric(MobGoalFactoryImplGeneric var1, Mob var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.biZ = var4;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
int var1 = this.mob.getLastHurtByMobTimestamp();
|
||||
LivingEntity var2 = this.mob.getLastHurtByMob();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.getType() == EntityType.PLAYER && (Boolean)getServerLevel(this.mob).getGameRules().get(GameRules.UNIVERSAL_ANGER)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.mob.getRandom().nextFloat() < this.biZ ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGeneric.biF, this.mob, this.mob.getLastHurtByMob(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.targetMob = this.mob.getTarget();
|
||||
this.unseenMemoryTicks = 300;
|
||||
super.start();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.mob.getX() + (this.mob.getRandom().nextDouble() - 0.5) * 32.0;
|
||||
double var3 = this.mob.getY() + (this.mob.getRandom().nextInt(16) - 8);
|
||||
double var5 = this.mob.getZ() + (this.mob.getRandom().nextDouble() - 0.5) * 32.0;
|
||||
return this.mob.randomTeleport(var1, var3, var5, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup2;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.ai.goal.target.TargetGoal;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
public class LookAtPlayerGoalGenericDup2 extends TargetGoal {
|
||||
private int bes;
|
||||
|
||||
LookAtPlayerGoalGenericDup2(MobGoalFactoryImplGenericDup2 var1, Mob var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.bjx = var4;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
int var1 = this.mob.getLastHurtByMobTimestamp();
|
||||
LivingEntity var2 = this.mob.getLastHurtByMob();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.getType() == EntityType.PLAYER && (Boolean)getServerLevel(this.mob).getGameRules().get(GameRules.UNIVERSAL_ANGER)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.mob.getRandom().nextFloat() < this.bjx ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGenericDup2.bjd, this.mob, this.mob.getLastHurtByMob(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.targetMob = this.mob.getTarget();
|
||||
this.unseenMemoryTicks = 300;
|
||||
super.start();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.mob.getX() + (this.mob.getRandom().nextDouble() - 0.5) * 32.0;
|
||||
double var3 = this.mob.getY() + (this.mob.getRandom().nextInt(16) - 8);
|
||||
double var5 = this.mob.getZ() + (this.mob.getRandom().nextDouble() - 0.5) * 32.0;
|
||||
return this.mob.randomTeleport(var1, var3, var5, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup3;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.ai.goal.target.TargetGoal;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
public class LookAtPlayerGoalGenericDup3 extends TargetGoal {
|
||||
private int bes;
|
||||
|
||||
LookAtPlayerGoalGenericDup3(MobGoalFactoryImplGenericDup3 var1, Mob var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.bjV = var4;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
int var1 = this.mob.getLastHurtByMobTimestamp();
|
||||
LivingEntity var2 = this.mob.getLastHurtByMob();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.getType() == EntityTypes.PLAYER && (Boolean)getServerLevel(this.mob).getGameRules().get(GameRules.UNIVERSAL_ANGER)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.mob.getRandom().nextFloat() < this.bjV ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGenericDup3.bjB, this.mob, this.mob.getLastHurtByMob(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.targetMob = this.mob.getTarget();
|
||||
this.unseenMemoryTicks = 300;
|
||||
super.start();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.mob.getX() + (this.mob.getRandom().nextDouble() - 0.5) * 32.0;
|
||||
double var3 = this.mob.getY() + (this.mob.getRandom().nextInt(16) - 8);
|
||||
double var5 = this.mob.getZ() + (this.mob.getRandom().nextDouble() - 0.5) * 32.0;
|
||||
return this.mob.randomTeleport(var1, var3, var5, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplGenericDup4;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.Mob;
|
||||
import net.minecraft.world.entity.ai.goal.target.TargetGoal;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
public class LookAtPlayerGoalGenericDup4 extends TargetGoal {
|
||||
private int bes;
|
||||
|
||||
LookAtPlayerGoalGenericDup4(MobGoalFactoryImplGenericDup4 var1, Mob var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.bkt = var4;
|
||||
}
|
||||
|
||||
public boolean canUse() {
|
||||
int var1 = this.mob.getLastHurtByMobTimestamp();
|
||||
LivingEntity var2 = this.mob.getLastHurtByMob();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.getType() == EntityTypes.PLAYER && (Boolean)getServerLevel(this.mob).getGameRules().get(GameRules.UNIVERSAL_ANGER)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.mob.getRandom().nextFloat() < this.bkt ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canContinueToUse() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplGenericDup4.bjZ, this.mob, this.mob.getLastHurtByMob(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.targetMob = this.mob.getTarget();
|
||||
this.unseenMemoryTicks = 300;
|
||||
super.start();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.mob.getX() + (this.mob.getRandom().nextDouble() - 0.5) * 32.0;
|
||||
double var3 = this.mob.getY() + (this.mob.getRandom().nextInt(16) - 8);
|
||||
double var5 = this.mob.getZ() + (this.mob.getRandom().nextDouble() - 0.5) * 32.0;
|
||||
return this.mob.randomTeleport(var1, var3, var5, true, BlockTags.DANGEROUS_FOR_TELEPORTATION);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R1;
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer;
|
||||
|
||||
class LookAtPlayerGoalV1_21_R1 extends PathfinderGoalLookAtPlayer {
|
||||
LookAtPlayerGoalV1_21_R1(MobGoalFactoryImplV1_21_R1 var1, EntityInsentient var2, Class var3, float var4, float var5, boolean var6, Predicate var7) {
|
||||
super(var2, var3, var4, var5, var6);
|
||||
this.beB = var7;
|
||||
this.g.a(this.beB);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R2;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer;
|
||||
import net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition.a;
|
||||
|
||||
class LookAtPlayerGoalV1_21_R2 extends PathfinderGoalLookAtPlayer {
|
||||
LookAtPlayerGoalV1_21_R2(MobGoalFactoryImplV1_21_R2 var1, EntityInsentient var2, Class var3, float var4, float var5, boolean var6, a var7) {
|
||||
super(var2, var3, var4, var5, var6);
|
||||
this.bfV = var7;
|
||||
this.g.a(this.bfV);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R3;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer;
|
||||
import net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition.a;
|
||||
|
||||
class LookAtPlayerGoalV1_21_R3 extends PathfinderGoalLookAtPlayer {
|
||||
LookAtPlayerGoalV1_21_R3(MobGoalFactoryImplV1_21_R3 var1, EntityInsentient var2, Class var3, float var4, float var5, boolean var6, a var7) {
|
||||
super(var2, var3, var4, var5, var6);
|
||||
this.bgt = var7;
|
||||
this.g.a(this.bgt);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R4;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer;
|
||||
import net.minecraft.world.entity.ai.targeting.PathfinderTargetCondition.a;
|
||||
|
||||
class LookAtPlayerGoalV1_21_R4 extends PathfinderGoalLookAtPlayer {
|
||||
LookAtPlayerGoalV1_21_R4(MobGoalFactoryImplV1_21_R4 var1, EntityInsentient var2, Class var3, float var4, float var5, boolean var6, a var7) {
|
||||
super(var2, var3, var4, var5, var6);
|
||||
this.bgR = var7;
|
||||
this.g.a(this.bgR);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R5;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalTarget;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
class LookAtPlayerGoalV1_21_R5 extends PathfinderGoalTarget {
|
||||
private int bes;
|
||||
|
||||
LookAtPlayerGoalV1_21_R5(MobGoalFactoryImplV1_21_R5 var1, EntityInsentient var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.bhF = var4;
|
||||
}
|
||||
|
||||
public boolean method5064() {
|
||||
int var1 = this.e.ey();
|
||||
EntityLiving var2 = this.e.ew();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.ap() == EntityTypes.bU && a(this.e).P().c(GameRules.Q)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.e.ec().i() < this.bhF ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method5065() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void method5066() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R5.bhl, this.e, this.e.ew(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.g = this.e.e();
|
||||
this.h = 300;
|
||||
super.d();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.e.dC() + (this.e.ec().j() - 0.5) * 32.0;
|
||||
double var3 = this.e.dE() + (this.e.ec().a(16) - 8);
|
||||
double var5 = this.e.dI() + (this.e.ec().j() - 0.5) * 32.0;
|
||||
return this.e.b(var1, var3, var5, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.lone.itemsadder.ai;
|
||||
|
||||
import dev.lone.itemsadder.nms.MobGoalFactoryImplV1_21_R5Dup2;
|
||||
import dev.lone.itemsadder.nms.MobGoalService;
|
||||
import net.minecraft.world.entity.EntityInsentient;
|
||||
import net.minecraft.world.entity.EntityLiving;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
import net.minecraft.world.entity.ai.goal.target.PathfinderGoalTarget;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import org.bukkit.event.entity.EntityTargetEvent.TargetReason;
|
||||
|
||||
class LookAtPlayerGoalV1_21_R5Dup2 extends PathfinderGoalTarget {
|
||||
private int bes;
|
||||
|
||||
LookAtPlayerGoalV1_21_R5Dup2(MobGoalFactoryImplV1_21_R5Dup2 var1, EntityInsentient var2, boolean var3, float var4) {
|
||||
super(var2, var3);
|
||||
this.bid = var4;
|
||||
}
|
||||
|
||||
public boolean method5087() {
|
||||
int var1 = this.e.ey();
|
||||
EntityLiving var2 = this.e.ew();
|
||||
if (var1 != this.bes && var2 != null) {
|
||||
if (var2.ap() == EntityTypes.bU && a(this.e).P().c(GameRules.Q)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.bes = var1;
|
||||
return this.e.ec().i() < this.bid ? this.Pa() : true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean method5088() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void method5089() {
|
||||
MobGoalService.method4852(MobGoalFactoryImplV1_21_R5Dup2.bhJ, this.e, this.e.ew(), TargetReason.TARGET_ATTACKED_ENTITY);
|
||||
this.g = this.e.e();
|
||||
this.h = 300;
|
||||
super.d();
|
||||
}
|
||||
|
||||
private boolean Pa() {
|
||||
double var1 = this.e.dC() + (this.e.ec().j() - 0.5) * 32.0;
|
||||
double var3 = this.e.dE() + (this.e.ec().a(16) - 8);
|
||||
double var5 = this.e.dI() + (this.e.ec().j() - 0.5) * 32.0;
|
||||
return this.e.b(var1, var3, var5, true);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 2761 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user