Compare commits
16 Commits
1.19.2
...
upstream/p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d547242824 | ||
|
|
3edba7dac4 | ||
|
|
402652c29d | ||
|
|
7a0b6cc24f | ||
|
|
3397936ab4 | ||
|
|
8f27eca2e3 | ||
|
|
0bbed6029c | ||
|
|
883620f828 | ||
|
|
61a11d791c | ||
|
|
f8028c508e | ||
|
|
7646770baa | ||
|
|
d3a3626a73 | ||
|
|
85a2184a1c | ||
|
|
f3b4987f33 | ||
|
|
89bda77d56 | ||
|
|
94524aebdb |
@@ -3,8 +3,8 @@ import io.papermc.paperweight.util.constants.*
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2" apply false
|
||||
id("io.papermc.paperweight.patcher") version "1.3.11"
|
||||
id("com.github.johnrengelman.shadow") version "8.1.0" apply false
|
||||
id("io.papermc.paperweight.patcher") version "1.5.3"
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -16,7 +16,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
|
||||
decompiler("net.minecraftforge:forgeflower:1.5.605.7")
|
||||
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
|
||||
paperclip("io.papermc:paperclip:3.0.2")
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
group = gg.projecteden.parchment
|
||||
version = 1.19.2-R0.1-SNAPSHOT
|
||||
version = 1.19.4-R0.1-SNAPSHOT
|
||||
|
||||
mcVersion = 1.19.2
|
||||
paperRef = 476ef25d053c523aea416487a38f72011d72a9cf
|
||||
mcVersion = 1.19.4
|
||||
paperRef = 67ca7ca471ee339c9cde858683e281fa46673a68
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.vfs.watch=false
|
||||
org.gradle.warning.mode=none
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
269
gradlew
vendored
269
gradlew
vendored
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env sh
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -17,67 +17,101 @@
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
@@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
@@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
@@ -106,80 +140,95 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
# Collect all arguments for the java command, 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.
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
||||
@@ -128,7 +128,7 @@ index 9be64a95c2345433b6142d611077dedadcef9f5d..e3cea810881868fb5869de72f331733e
|
||||
@NotNull private final String buffer;
|
||||
private final boolean isCommand;
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
|
||||
index 89e132525cfae0ce979e37b3e2793df781e47227..f14635ae3112862c1337398bf5f5f56a7f87d90f 100644
|
||||
index 2faef4cb358ec65e32a6aba6426f0dd7ddf90d2a..640a01478be687b089aeddad422e4bba2bea19b6 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
|
||||
@@ -8,7 +8,7 @@ import static com.google.common.base.Preconditions.*;
|
||||
@@ -427,19 +427,19 @@ index 12163a7b0591a7d022dc7eb9ee6608a1b6c39d9b..d81c7307127b135417e06a3b244416be
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private final Player player;
|
||||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
|
||||
index ef0cb00ca4cb7d2f5e4ec1c950cce036566d1ae4..df53183beb4c438ea3c821e1ffd8e2719c08f269 100644
|
||||
index 6bbf8468bc47e82b0aeb164e49cdb73d93bae87b..1d7077f3a1be8068747aaf0665a1dee797bb4088 100644
|
||||
--- a/src/main/java/org/bukkit/Location.java
|
||||
+++ b/src/main/java/org/bukkit/Location.java
|
||||
@@ -30,7 +30,7 @@ import org.bukkit.entity.Player;
|
||||
* magnitude than 360 are valid, but may be normalized to any other equivalent
|
||||
* representation by the implementation.
|
||||
*/
|
||||
-public class Location implements Cloneable, ConfigurationSerializable {
|
||||
+public class Location implements Cloneable, ConfigurationSerializable, gg.projecteden.parchment.HasLocation { // Parchment
|
||||
-public class Location implements Cloneable, ConfigurationSerializable, io.papermc.paper.math.FinePosition { // Paper
|
||||
+public class Location implements Cloneable, ConfigurationSerializable , io.papermc.paper.math.FinePosition, gg.projecteden.parchment.HasLocation { // Parchment
|
||||
private Reference<World> world;
|
||||
private double x;
|
||||
private double y;
|
||||
@@ -72,6 +72,13 @@ public class Location implements Cloneable, ConfigurationSerializable {
|
||||
@@ -72,6 +72,13 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
|
||||
this.yaw = yaw;
|
||||
}
|
||||
|
||||
@@ -454,7 +454,7 @@ index ef0cb00ca4cb7d2f5e4ec1c950cce036566d1ae4..df53183beb4c438ea3c821e1ffd8e271
|
||||
* Sets the world that this location resides in
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
index a7d1f1e701f23e851f735584a30bedadb0d8b9bd..7b37b6f596b4ac6b8049c7bd195139ac03ba63bc 100644
|
||||
index 69b50eee42e8c52063033705bd23a5ef5231ed83..f61ddf47ce33a4a1708e7000bb43b303e3b1a503 100644
|
||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
@@ -10,7 +10,7 @@ import org.bukkit.profile.PlayerProfile;
|
||||
@@ -520,15 +520,15 @@ index d124768378d6f0c5573f28ee815ea3886fe74868..11a00998b1cb5ee582e225553f15b1b7
|
||||
private final UUID uuid;
|
||||
private final String name;
|
||||
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
|
||||
index 9930ebe7a23d306c602840fd43652fbdaba481b3..531b8090a224c448c7316d77663d2cc2787ee621 100644
|
||||
index 390a2a2611df35a9ea6f1eb996b47e2aa4597ff0..e7dcaf75283dd222891e4f20971716934291a672 100644
|
||||
--- a/src/main/java/org/bukkit/block/Block.java
|
||||
+++ b/src/main/java/org/bukkit/block/Block.java
|
||||
@@ -31,7 +31,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -32,7 +32,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* (i.e. lighting and power) may not be able to be safely accessed during world
|
||||
* generation when used in cases like BlockPhysicsEvent!!!!
|
||||
*/
|
||||
-public interface Block extends Metadatable, net.kyori.adventure.translation.Translatable { // Paper - translatable
|
||||
+public interface Block extends Metadatable, net.kyori.adventure.translation.Translatable, gg.projecteden.parchment.HasLocation { // Paper - translatable
|
||||
-public interface Block extends Metadatable, Translatable, net.kyori.adventure.translation.Translatable { // Paper - translatable
|
||||
+public interface Block extends Metadatable, Translatable, net.kyori.adventure.translation.Translatable, gg.projecteden.parchment.HasLocation { // Paper - translatable
|
||||
|
||||
/**
|
||||
* Gets the metadata for this block
|
||||
@@ -572,7 +572,7 @@ index 2e17b2d4f759531fbe9ee8e9b00c839186af09ca..8f4a293c131cb8b63c31b410ffa211bd
|
||||
/**
|
||||
* This is the name of the specified AnimalTamer.
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 33a6b7a27dc91552799c07a7aad9b3df31ad13f7..04626febc2f141c2774de98694761f010a0b0c6a 100644
|
||||
index 8c58018b155c52a7b2a139f784abceb6aa00a268..dfa0366e3f46ef974f9d3397f057a6abc5c0e08c 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -585,7 +585,7 @@ index 33a6b7a27dc91552799c07a7aad9b3df31ad13f7..04626febc2f141c2774de98694761f01
|
||||
/**
|
||||
* Gets the entity's current position
|
||||
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
index 3b204144e2d245098b3dc23b8779f9ed817bb6d1..2d5a09bb8f31d6234ca8a3f343d45eee81cc1dd4 100644
|
||||
index f17ef44bc02e97ff084e5abfde8d6c6822f00d62..aae9eaa7a0e42cd9bc0a4ccf56bf056441d47c90 100644
|
||||
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
|
||||
@@ -20,7 +20,15 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -606,10 +606,10 @@ index 3b204144e2d245098b3dc23b8779f9ed817bb6d1..2d5a09bb8f31d6234ca8a3f343d45eee
|
||||
// Paper start
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 1e27b9de47f111b9c000243214e22890e323f7fc..56e979e2083199cc68b0381ed51733397cb230be 100644
|
||||
index 8fe11fce80c3b29164b79ece8dc9ed8da6fc1790..b494ea7863a06fd9c52fba124a66d83da6432ed9 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -42,7 +42,17 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -39,7 +39,17 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* Represents a player, connected or not
|
||||
*/
|
||||
@@ -707,7 +707,7 @@ index 6dcd9f828c6c40e48593b0bad5a44a656eb01645..0651bdd983e90e0e1e8a3565dcb5d97c
|
||||
private final IgniteCause cause;
|
||||
private final Entity ignitingEntity;
|
||||
diff --git a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
|
||||
index be0a2d1f234d8265d98e54e518a994957b1f3ab7..54cd6735fbcad009330927d760f8bd93ea9c51ec 100644
|
||||
index 4e3c406ba883aae553e8d69b6b719b872cd6096c..d0a92dc9eba0f61b596e9a388f3aa4076ef2bc65 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -720,7 +720,7 @@ index be0a2d1f234d8265d98e54e518a994957b1f3ab7..54cd6735fbcad009330927d760f8bd93
|
||||
protected boolean cancel;
|
||||
protected boolean canBuild;
|
||||
diff --git a/src/main/java/org/bukkit/event/block/SignChangeEvent.java b/src/main/java/org/bukkit/event/block/SignChangeEvent.java
|
||||
index 1268066e30ddb0cd3792ea4b3de894eb04196669..1e20629da438651d3987258b93cf9caf9eff9452 100644
|
||||
index c40536f781393cb39e6a1a4ba6e780713d5dc126..e4455679b37ac38bd505982ef12d323c9ff466c3 100644
|
||||
--- a/src/main/java/org/bukkit/event/block/SignChangeEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/block/SignChangeEvent.java
|
||||
@@ -12,7 +12,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -775,12 +775,12 @@ index 59aab10c2d27247eb77bd71d75b5f9126aa0fb12..b42465617e83d3413ab647cd9c78212b
|
||||
/**
|
||||
* Gets the amount of ticks that the animal will fall in love for.
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
|
||||
index 10d0e18dfd423b108fe381e8142867eb10399359..7f9f266057de42261fa06e4874d7bec5388c90c7 100644
|
||||
index 099efafa14c10910e4ed04abb1823f0c1a96b6a6..382602ca4a9a33cf238f982f77865053d38bd285 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
|
||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
* Called when an entity explodes
|
||||
@@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
* event isn't called if the {@link org.bukkit.GameRule#MOB_GRIEFING}
|
||||
* is disabled as no block interaction will occur.
|
||||
*/
|
||||
-public class EntityExplodeEvent extends EntityEvent implements Cancellable {
|
||||
+public class EntityExplodeEvent extends EntityEvent implements Cancellable, gg.projecteden.parchment.HasLocation { // Parchment
|
||||
@@ -788,7 +788,7 @@ index 10d0e18dfd423b108fe381e8142867eb10399359..7f9f266057de42261fa06e4874d7bec5
|
||||
private boolean cancel;
|
||||
private final Location location;
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java b/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java
|
||||
index 327876e0ad7dcfeb71d9d22afe1c04bcd71c3bf9..466a54c4e30a7886e7383f43f9b6c389a5bdba7c 100644
|
||||
index 71d664dd89995f088c47d17b38547d530319470c..d931ece8f35c8f01748c59d01617fd59b287030e 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java
|
||||
@@ -17,7 +17,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -892,12 +892,12 @@ index 21ad8888c0e403bfc63518502577d651c02dda05..1c59335a8f0a40162190f6fb73ffbfef
|
||||
// Paper start
|
||||
private final Reason reason;
|
||||
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java
|
||||
index 9013d043503d175004ad276799e5935b7fa59dc4..4095ca19e6ceff2432e0cbd372e9475f748278a7 100644
|
||||
index ceae092eb782698803c6c3df41267dde20ba62b2..23e35e7e65bdf2e758dc8dc980b9427b7e4163a9 100644
|
||||
--- a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java
|
||||
@@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
* Represents a player related inventory event
|
||||
* Called when a player opens an inventory
|
||||
*/
|
||||
-public class InventoryOpenEvent extends InventoryEvent implements Cancellable {
|
||||
+public class InventoryOpenEvent extends InventoryEvent implements Cancellable, gg.projecteden.parchment.HasHumanEntity { // Parchment
|
||||
@@ -905,7 +905,7 @@ index 9013d043503d175004ad276799e5935b7fa59dc4..4095ca19e6ceff2432e0cbd372e9475f
|
||||
private boolean cancelled;
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
index 635b8787fc235b61c0d5677def034656e4ec4cef..6f15f4adfa552e2f5960464663ee126282086bb1 100644
|
||||
index fc2d9e85b65347b90bde3b0b13ccae759e33d466..6b2e64fa9c0f3c0af88797d63557c333edf69a5d 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -1010,7 +1010,7 @@ index 7af8d6e51c824cf0592b722b834f1d4986e3cc08..c28d62fc3dc359f9ebcf926094198ee3
|
||||
private boolean cancelled = false;
|
||||
private final Location location;
|
||||
diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java
|
||||
index c574bb94b21eb27974b40c839fce52c6ac4b54b4..0172bed7917ea1199c34438385be4bceac9cfaa4 100644
|
||||
index 0d519813c12d98b28d62e6d01d7ec6e8c2dba3c3..469b9cc0c4b77844ba0317af51bd9ad873915967 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/Inventory.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/Inventory.java
|
||||
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -1023,7 +1023,7 @@ index c574bb94b21eb27974b40c839fce52c6ac4b54b4..0172bed7917ea1199c34438385be4bce
|
||||
/**
|
||||
* Returns the size of the inventory
|
||||
diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java
|
||||
index 2448e70d75ae7a678c6befac4506c103edb78875..65ca144618f74bc8e317a4b9c2732ad5ed13a208 100644
|
||||
index daca40b63e95ea33178bcb54ad45911da591ca54..e9b5206851db890d7638ce94d793fb909be20307 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/InventoryView.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/InventoryView.java
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -6,19 +6,20 @@ Subject: [PATCH] Expanded Adventure support
|
||||
Adds support for Adventure in a few places where it was previously missing.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
|
||||
index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489642245c2 100644
|
||||
index ea4ceb643239c26851bacbf45fc3f2efef3bb4be..eea8e60c363b6dc14383fb7758cbf41469f76425 100644
|
||||
--- a/src/main/java/org/bukkit/ChatColor.java
|
||||
+++ b/src/main/java/org/bukkit/ChatColor.java
|
||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
@@ -11,8 +11,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
/**
|
||||
* All supported color values for chat
|
||||
*/
|
||||
-@Deprecated // Paper
|
||||
-public enum ChatColor {
|
||||
+public enum ChatColor implements net.kyori.adventure.text.format.StyleBuilderApplicable, net.kyori.adventure.text.format.TextFormat { // Parchment
|
||||
/**
|
||||
* Represents black
|
||||
*/
|
||||
@@ -181,6 +181,13 @@ public enum ChatColor {
|
||||
@@ -182,6 +181,13 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.MAGIC;
|
||||
}
|
||||
@@ -32,7 +33,7 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489
|
||||
},
|
||||
/**
|
||||
* Makes the text bold.
|
||||
@@ -191,6 +198,13 @@ public enum ChatColor {
|
||||
@@ -192,6 +198,13 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.BOLD;
|
||||
}
|
||||
@@ -46,7 +47,7 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489
|
||||
},
|
||||
/**
|
||||
* Makes a line appear through the text.
|
||||
@@ -201,6 +215,13 @@ public enum ChatColor {
|
||||
@@ -202,6 +215,13 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.STRIKETHROUGH;
|
||||
}
|
||||
@@ -60,7 +61,7 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489
|
||||
},
|
||||
/**
|
||||
* Makes the text appear underlined.
|
||||
@@ -211,6 +232,13 @@ public enum ChatColor {
|
||||
@@ -212,6 +232,13 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.UNDERLINE;
|
||||
}
|
||||
@@ -74,7 +75,7 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489
|
||||
},
|
||||
/**
|
||||
* Makes the text italic.
|
||||
@@ -221,6 +249,13 @@ public enum ChatColor {
|
||||
@@ -222,6 +249,13 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.ITALIC;
|
||||
}
|
||||
@@ -88,7 +89,7 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489
|
||||
},
|
||||
/**
|
||||
* Resets all previous chat colors or formats.
|
||||
@@ -231,6 +266,16 @@ public enum ChatColor {
|
||||
@@ -232,6 +266,16 @@ public enum ChatColor {
|
||||
public net.md_5.bungee.api.ChatColor asBungee() {
|
||||
return net.md_5.bungee.api.ChatColor.RESET;
|
||||
}
|
||||
@@ -105,7 +106,7 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -263,6 +308,13 @@ public enum ChatColor {
|
||||
@@ -264,6 +308,13 @@ public enum ChatColor {
|
||||
return net.md_5.bungee.api.ChatColor.RESET;
|
||||
};
|
||||
|
||||
@@ -120,20 +121,20 @@ index f6eb30f53dad684f156102cf7147b2f00c82c71e..1b4e9840f0e829be533ad0bd1c918489
|
||||
* Gets the char value associated with this color
|
||||
*
|
||||
diff --git a/src/main/java/org/bukkit/Color.java b/src/main/java/org/bukkit/Color.java
|
||||
index d2f8f5a8e49f60422b6a41e51248a6710251d61b..40b09a861ba365b126c2b28bb7f18c8fb8b3e5b5 100644
|
||||
index e088390ec3fb87eeabc73dfe90e3544980c02e5b..5d4fbb08832fd0490a9375580f909beaf941e8fa 100644
|
||||
--- a/src/main/java/org/bukkit/Color.java
|
||||
+++ b/src/main/java/org/bukkit/Color.java
|
||||
@@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
@@ -16,7 +16,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* but subject to change.
|
||||
*/
|
||||
@SerializableAs("Color")
|
||||
-public final class Color implements ConfigurationSerializable {
|
||||
+public final class Color implements ConfigurationSerializable, net.kyori.adventure.text.format.TextColor { // Parchment
|
||||
private static final int BIT_MASK = 0xff;
|
||||
private static final int DEFAULT_ALPHA = 255;
|
||||
|
||||
/**
|
||||
@@ -244,6 +244,13 @@ public final class Color implements ConfigurationSerializable {
|
||||
return getRed() << 16 | getGreen() << 8 | getBlue() << 0;
|
||||
@@ -309,6 +309,13 @@ public final class Color implements ConfigurationSerializable {
|
||||
return getAlpha() << 24 | getRed() << 16 | getGreen() << 8 | getBlue();
|
||||
}
|
||||
|
||||
+ // Parchment start
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add UnsafeValues#canPlaceItemOn
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index 854be548e5a645e7312e6e9390d5255f8b1d61e6..9fdcb933788cb78306dc066b3bf6ed01a6316cd3 100644
|
||||
index b92255a9c87620f46adb140689b1cd328a476d61..3ed52d016314c01293530fa760fa5faaf59586ed 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -271,4 +271,17 @@ public interface UnsafeValues {
|
||||
@@ -245,4 +245,17 @@ public interface UnsafeValues {
|
||||
*/
|
||||
void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey);
|
||||
// Paper end
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose MCUtil Executors
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
||||
index e43fef0152468944d8a33036344a43e95fe58476..3e46e1c329eb19851ae78025237e70083d815879 100644
|
||||
index 8621dba7f10ab822b5b99ce0d05da58823605cb6..5603db21993429e974b037894400caf429ceba38 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -2137,4 +2137,20 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
@@ -2136,4 +2136,20 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
@NotNull org.bukkit.potion.PotionBrewer getPotionBrewer();
|
||||
// Paper end
|
||||
@@ -64,10 +64,10 @@ index 0000000000000000000000000000000000000000..28c01caa9d6379046f6af6612719b404
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index e8c0c853eb52d1473c20231660355f77b1f7e016..60172dd594e51351c8253446f6d8c1347920b2a0 100644
|
||||
index 6716a1185e733f3ddf56b295f3153938f57d4229..ccf72e766e34129fc5dd874c83d966b3fff4d2bd 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -3985,6 +3985,36 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -4007,6 +4007,36 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@Nullable
|
||||
public DragonBattle getEnderDragonBattle();
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Player#getHiddenEntities API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index cea29fd3c3ea6b3f2e6d2f89022cc4f4fdab93b2..7f4827819fc241866edb571f05e9b14d0955c0c4 100644
|
||||
index 64734c0ca89859294bde01da3dcaee6dc1840894..205cd1d53bef3a8d18315561543f815ede791570 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -1476,6 +1476,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -1597,6 +1597,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@org.jetbrains.annotations.ApiStatus.Experimental // Paper
|
||||
public boolean canSee(@NotNull Entity entity);
|
||||
|
||||
@@ -20,7 +20,7 @@ index cea29fd3c3ea6b3f2e6d2f89022cc4f4fdab93b2..7f4827819fc241866edb571f05e9b14d
|
||||
+ * @return a view of hidden entity UUIDs
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ public java.util.@NotNull Set<UUID> getHiddenEntities(@NotNull Plugin plugin);
|
||||
+ public java.util.@NotNull Set<java.util.UUID> getHiddenEntities(@NotNull Plugin plugin);
|
||||
+ // Parchment end
|
||||
+
|
||||
/**
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Add Timings Events
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
|
||||
index dd72a34eaa4bedd9ea0b92eaa79091b00eb4dd09..90f8f7a0996cf1a6f6b3e9eef0243b2d629a1214 100644
|
||||
index 9812d668ad945aba486fbf6d5bf83c4292cb5d03..91429282ed8f30abbb969b426b34826c6e28b75d 100644
|
||||
--- a/src/main/java/co/aikar/timings/Timings.java
|
||||
+++ b/src/main/java/co/aikar/timings/Timings.java
|
||||
@@ -23,6 +23,8 @@
|
||||
@@ -17,7 +17,7 @@ index dd72a34eaa4bedd9ea0b92eaa79091b00eb4dd09..90f8f7a0996cf1a6f6b3e9eef0243b2d
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.EvictingQueue;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -135,7 +137,24 @@ public final class Timings {
|
||||
@@ -145,8 +147,25 @@ public final class Timings {
|
||||
* @param enabled Should timings be reported
|
||||
*/
|
||||
public static void setTimingsEnabled(boolean enabled) {
|
||||
@@ -34,6 +34,7 @@ index dd72a34eaa4bedd9ea0b92eaa79091b00eb4dd09..90f8f7a0996cf1a6f6b3e9eef0243b2d
|
||||
+ */
|
||||
+ public static void setTimingsEnabled(boolean enabled, CommandSender sender) {
|
||||
timingsEnabled = enabled;
|
||||
warnAboutDeprecationOnEnable();
|
||||
+ if (sender != null) {
|
||||
+ if (!new co.aikar.timings.event.TimingsModifyEvent(sender, Action.RESET).callEvent()) {
|
||||
+ return;
|
||||
@@ -43,10 +44,10 @@ index dd72a34eaa4bedd9ea0b92eaa79091b00eb4dd09..90f8f7a0996cf1a6f6b3e9eef0243b2d
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
index 3132dc98d26c54c5e46162e53aaed195d7335c8d..f44ec5789bc98d5558eee6cff39770b4192c3e3c 100644
|
||||
index e801e79fa57c44b2e5d359647c920f88064826f1..0cbb970c42c3a71602ccd311a13e1f874067e2ae 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
|
||||
@@ -59,12 +59,14 @@ public class TimingsCommand extends BukkitCommand {
|
||||
@@ -63,12 +63,14 @@ public class TimingsCommand extends BukkitCommand {
|
||||
}
|
||||
final String arg = args[0];
|
||||
if ("on".equalsIgnoreCase(arg)) {
|
||||
@@ -65,7 +66,7 @@ index 3132dc98d26c54c5e46162e53aaed195d7335c8d..f44ec5789bc98d5558eee6cff39770b4
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -75,20 +77,22 @@ public class TimingsCommand extends BukkitCommand {
|
||||
@@ -79,20 +81,22 @@ public class TimingsCommand extends BukkitCommand {
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
if ("verbon".equalsIgnoreCase(arg)) {
|
||||
@@ -96,10 +97,10 @@ index 3132dc98d26c54c5e46162e53aaed195d7335c8d..f44ec5789bc98d5558eee6cff39770b4
|
||||
} else if (
|
||||
"paste".equalsIgnoreCase(arg) ||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
index 34f4c02c3bdbe571a7efb1f8c61d8924b0c81268..093c1bc755061dc6f54e5dce1ef68fd027fc43a6 100644
|
||||
index 3af5b8ea795311582044c712de50d29412024b77..b509aa8d2b05e913277713308e2eea46e631a5df 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
|
||||
@@ -58,7 +58,9 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
||||
@@ -59,7 +59,9 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
||||
|
||||
@Override
|
||||
public void sendMessage(final @NotNull net.kyori.adventure.identity.Identity source, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
|
||||
@@ -110,7 +111,7 @@ index 34f4c02c3bdbe571a7efb1f8c61d8924b0c81268..093c1bc755061dc6f54e5dce1ef68fd0
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -69,7 +71,9 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
||||
@@ -70,7 +72,9 @@ public class TimingsReportListener implements net.kyori.adventure.audience.Forwa
|
||||
|
||||
@Override
|
||||
public void sendMessage(@NotNull String message) {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expanded Insomnia API methods
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 7f4827819fc241866edb571f05e9b14d0955c0c4..1e7c5b991939e984d3448a5f9e0859857d04ce63 100644
|
||||
index 205cd1d53bef3a8d18315561543f815ede791570..bb67075d04e31865b48e8436876ecf6f342d4d8b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -52,6 +52,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -49,6 +49,45 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*/
|
||||
@Override
|
||||
@NotNull Player getPlayer();
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add NPC to EntityType
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java
|
||||
index 4aa2d483b706fbf6ba0dc5126de74ee532e12382..8b17088739b126a1ecb86370d23cf49e499d30ea 100644
|
||||
index ee3a3bda9a5b9cf3bcabf80ee3c653a2959fab0c..3e9bf06682373686d0c6f40defc56f23e785cd4b 100644
|
||||
--- a/src/main/java/org/bukkit/entity/EntityType.java
|
||||
+++ b/src/main/java/org/bukkit/entity/EntityType.java
|
||||
@@ -287,6 +287,7 @@ public enum EntityType implements Keyed, net.kyori.adventure.translation.Transla
|
||||
@@ -297,6 +297,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
|
||||
*/
|
||||
LIGHTNING("lightning_bolt", LightningStrike.class, -1, false),
|
||||
PLAYER("player", Player.class, -1, false),
|
||||
28
patches/api/0015-Revert-BungeeChat-Deprecation.patch
Normal file
28
patches/api/0015-Revert-BungeeChat-Deprecation.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Blast-MC <cjblanton2@gmail.com>
|
||||
Date: Wed, 15 Mar 2023 01:05:09 -0400
|
||||
Subject: [PATCH] Revert BungeeChat Deprecation
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index cad12a2632b9ebb569280441c42869685db1f31a..50014fbac3aa4f8c7c930405ca89f9cdb83b771c 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -25,7 +25,7 @@ dependencies {
|
||||
// api dependencies are listed transitively to API consumers
|
||||
api("com.google.guava:guava:31.1-jre")
|
||||
api("com.google.code.gson:gson:2.10")
|
||||
- api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.9") // Paper
|
||||
+ api("net.md-5:bungeecord-chat:1.16-R0.4") // Parchment - revert
|
||||
api("org.yaml:snakeyaml:1.33")
|
||||
api("org.joml:joml:1.10.5")
|
||||
// Paper start
|
||||
@@ -106,7 +106,7 @@ tasks.withType<Javadoc> {
|
||||
"https://javadoc.io/doc/org.yaml/snakeyaml/1.33/",
|
||||
"https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
|
||||
// Paper start
|
||||
- //"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", // don't link to bungee chat
|
||||
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", // don't link to bungee chat // Parchment - revert
|
||||
"https://jd.advntr.dev/api/$adventureVersion/",
|
||||
"https://jd.advntr.dev/text-minimessage/$adventureVersion/",
|
||||
"https://jd.advntr.dev/text-serializer-gson/$adventureVersion/",
|
||||
73
patches/api/0016-Add-PreEntityShootBowEvent.patch
Normal file
73
patches/api/0016-Add-PreEntityShootBowEvent.patch
Normal file
@@ -0,0 +1,73 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Blast-MC <cjblanton2@gmail.com>
|
||||
Date: Thu, 16 Mar 2023 23:10:47 -0400
|
||||
Subject: [PATCH] Add PreEntityShootBowEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/gg/projecteden/parchment/event/entity/PreEntityShootBowEvent.java b/src/main/java/gg/projecteden/parchment/event/entity/PreEntityShootBowEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..7368e7b039882dd629d187502c5c90d74471590e
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/gg/projecteden/parchment/event/entity/PreEntityShootBowEvent.java
|
||||
@@ -0,0 +1,61 @@
|
||||
+package gg.projecteden.parchment.event.entity;
|
||||
+
|
||||
+import org.bukkit.entity.Entity;
|
||||
+import org.bukkit.event.Cancellable;
|
||||
+import org.bukkit.event.Event;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+public class PreEntityShootBowEvent extends EntityEvent implements Cancellable {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+
|
||||
+ private final ItemStack bow;
|
||||
+ private final ItemStack arrow;
|
||||
+ boolean relative = true;
|
||||
+ boolean cancelled = false;
|
||||
+
|
||||
+ public PreEntityShootBowEvent(Entity entity, ItemStack bow, ItemStack arrow) {
|
||||
+ super(entity);
|
||||
+ this.bow = bow;
|
||||
+ this.arrow = arrow;
|
||||
+ }
|
||||
+
|
||||
+ public ItemStack getBow() {
|
||||
+ return this.bow;
|
||||
+ }
|
||||
+
|
||||
+ public ItemStack getArrow() {
|
||||
+ return this.arrow;
|
||||
+ }
|
||||
+
|
||||
+ public boolean isRelative() {
|
||||
+ return this.relative;
|
||||
+ }
|
||||
+
|
||||
+ public void setRelative(boolean relative) {
|
||||
+ this.relative = relative;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return this.cancelled;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public @NotNull HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose NMS ordinals
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
index 9fdcb933788cb78306dc066b3bf6ed01a6316cd3..606ae769ea443853c0d236f5bac5429467190778 100644
|
||||
index 3ed52d016314c01293530fa760fa5faaf59586ed..f93672ebb76664c5a71030b72966c6b13e107246 100644
|
||||
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
||||
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
||||
@@ -283,5 +283,12 @@ public interface UnsafeValues {
|
||||
@@ -257,5 +257,12 @@ public interface UnsafeValues {
|
||||
* @return if the item can be placed
|
||||
*/
|
||||
java.util.concurrent.CompletableFuture<Boolean> canPlaceItemOn(@org.jetbrains.annotations.NotNull ItemStack item, @org.jetbrains.annotations.Nullable gg.projecteden.parchment.OptionalHumanEntity player, @org.jetbrains.annotations.NotNull org.bukkit.block.Block block, @org.jetbrains.annotations.NotNull org.bukkit.block.BlockFace face);
|
||||
@@ -5,28 +5,29 @@ Subject: [PATCH] Expose EntityType Ordinals
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index 72516335570d7137a62ec8667a6e8f06f024692f..30c79796359c8f2fd4f04afdb863047ba95112a9 100644
|
||||
index ceacc0d383e2ee674783d3c0a7df0a951595faca..72b5ce4c93c021ca2f3f1d65b45fdd8cd50d71f4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -154,6 +154,8 @@ import org.slf4j.Logger;
|
||||
@@ -162,6 +162,8 @@ import org.slf4j.Logger;
|
||||
|
||||
public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
||||
public class EntityType<T extends Entity> implements FeatureElement, EntityTypeTest<Entity, T> {
|
||||
|
||||
+ private static int ordinal = 0; // Parchment
|
||||
+ private static final java.util.Map<EntityType, Integer> ordinals = new java.util.HashMap<>(); // Parchment
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
public static final String ENTITY_TAG = "EntityTag";
|
||||
private final Holder.Reference<EntityType<?>> builtInRegistryHolder;
|
||||
@@ -294,9 +296,31 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
||||
private final EntityDimensions dimensions;
|
||||
@@ -310,9 +312,32 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
private final FeatureFlagSet requiredFeatures;
|
||||
|
||||
private static <T extends Entity> EntityType<T> register(String id, EntityType.Builder type) { // CraftBukkit - decompile error
|
||||
- return (EntityType) Registry.register(Registry.ENTITY_TYPE, id, (EntityType<T>) type.build(id)); // CraftBukkit - decompile error
|
||||
- return (EntityType) Registry.register(BuiltInRegistries.ENTITY_TYPE, id, (EntityType<T>) type.build(id)); // CraftBukkit - decompile error
|
||||
+ // return (EntityType) Registry.register(BuiltInRegistries.ENTITY_TYPE, id, (EntityType<T>) type.build(id)); // CraftBukkit - decompile error
|
||||
+ // Parchment start
|
||||
+ EntityType build = type.build(id);
|
||||
+ ordinals.put(build, ordinal);
|
||||
+ ordinal += 1;
|
||||
+ return (EntityType) Registry.register(Registry.ENTITY_TYPE, id, (EntityType<T>) build);
|
||||
+ return (EntityType) Registry.register(BuiltInRegistries.ENTITY_TYPE, id, (EntityType<T>) build);
|
||||
}
|
||||
|
||||
+ public int ordinal() {
|
||||
@@ -38,23 +39,23 @@ index 72516335570d7137a62ec8667a6e8f06f024692f..30c79796359c8f2fd4f04afdb863047b
|
||||
+ if (this == o) return true;
|
||||
+ if (o == null || getClass() != o.getClass()) return false;
|
||||
+ EntityType<?> that = (EntityType<?>) o;
|
||||
+ return id.equals(that.id);
|
||||
+ return this.builtInRegistryHolder.key().toString().equals(that.builtInRegistryHolder.key().toString());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int hashCode() {
|
||||
+ return java.util.Objects.hash(id);
|
||||
+ return java.util.Objects.hash(this.builtInRegistryHolder.key().toString());
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+
|
||||
public static ResourceLocation getKey(EntityType<?> type) {
|
||||
return Registry.ENTITY_TYPE.getKey(type);
|
||||
return BuiltInRegistries.ENTITY_TYPE.getKey(type);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 4743d462ce712e312decdb40fdfdfe6b71468b94..776911b43156bf297b96fb3cc334383197559ae2 100644
|
||||
index be2739875ba1ba1a973c4a45c7e6a6996f0daf31..a6eab579c0f4cc6039bdd9914dd770c796b75d3c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -671,6 +671,18 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -665,6 +665,18 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
final net.minecraft.world.item.context.BlockPlaceContext ctx = context;
|
||||
return future.completeAsync(() -> blockItem.canPlace(ctx, blockState), io.papermc.paper.util.MCUtil.MAIN_EXECUTOR);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Blast-MC <cjblanton2@gmail.com>
|
||||
Date: Sun, 19 Mar 2023 17:32:26 -0400
|
||||
Subject: [PATCH] Lookup plugin dependencies during runtime
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/DependencyUtil.java b/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/DependencyUtil.java
|
||||
index bfa258faf17ca6118aeddfa4e95bbd082bcd1390..c106c26ccd673e46c5ae9415096923b66efd8af2 100644
|
||||
--- a/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/DependencyUtil.java
|
||||
+++ b/src/main/java/io/papermc/paper/plugin/entrypoint/dependency/DependencyUtil.java
|
||||
@@ -2,6 +2,7 @@ package io.papermc.paper.plugin.entrypoint.dependency;
|
||||
|
||||
import com.google.common.graph.MutableGraph;
|
||||
import io.papermc.paper.plugin.configuration.PluginMeta;
|
||||
+import io.papermc.paper.plugin.manager.PaperPluginManagerImpl;
|
||||
import io.papermc.paper.plugin.provider.PluginProvider;
|
||||
import io.papermc.paper.plugin.provider.configuration.LoadOrderConfiguration;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
@@ -65,7 +66,7 @@ public class DependencyUtil {
|
||||
public static List<String> validateSimple(PluginMeta meta, Map<String, PluginProvider<?>> toLoad) {
|
||||
List<String> missingDependencies = new ArrayList<>();
|
||||
for (String hardDependency : meta.getPluginDependencies()) {
|
||||
- if (!toLoad.containsKey(hardDependency)) {
|
||||
+ if (!toLoad.containsKey(hardDependency) && !PaperPluginManagerImpl.getInstance().isPluginEnabled(hardDependency)) {
|
||||
missingDependencies.add(hardDependency);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index b0e4f11e8af4b909a56bb5576d05ef0537fb25f7..aeea1d8c2cb49b2a79577ad7eef88bcb207b6d07 100644
|
||||
index 9cf389defdaeb887e9cad4f0fed3f3b95667b238..3bd719aace9df13f5d82a6206fb46913efbc4f9f 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -7,8 +7,8 @@ plugins {
|
||||
@@ -67,7 +67,7 @@ index b0e4f11e8af4b909a56bb5576d05ef0537fb25f7..aeea1d8c2cb49b2a79577ad7eef88bcb
|
||||
standardInput = System.`in`
|
||||
workingDir = rootProject.layout.projectDirectory
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
index 7b1843e16745ca8db2244e17490d291401f22679..c340575e9c2a114f2165b74feb4481975821811c 100644
|
||||
index 4b002e8b75d117b726b0de274a76d3596fce015b..bf6d9879810359216a60d1efe1d1bd9e23e55b1e 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
|
||||
@@ -73,7 +73,7 @@ public class Metrics {
|
||||
@@ -104,10 +104,10 @@ index bf42969859545a8a520923ef1836ffa4a5cc24a0..2532e265c5dade55f71c34fcab6d1e74
|
||||
org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 6dc6c3bccb4ba34268a87b0754c87eb1e0df4135..9a19e3e77eb44d443ba6576fe19cb7511d521923 100644
|
||||
index 9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c..ec1a0f01c116c0a34807e1903b8142509d456b0e 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1654,7 +1654,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1682,7 +1682,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
@@ -117,10 +117,10 @@ index 6dc6c3bccb4ba34268a87b0754c87eb1e0df4135..9a19e3e77eb44d443ba6576fe19cb751
|
||||
|
||||
public SystemReport fillSystemReport(SystemReport details) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 07eac5439164a7345476c55277538a152359630a..53e4a8db9ff5619982dfb059de9e431dbe2edc57 100644
|
||||
index f9a9d2bb7b6d1bf4a0931438de4d8c7ee0757479..2a8ad9afaa53d80d3926d9f1e1181c54aa8a849e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -248,7 +248,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -256,7 +256,7 @@ import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
public final class CraftServer implements Server {
|
||||
@@ -130,10 +130,10 @@ index 07eac5439164a7345476c55277538a152359630a..53e4a8db9ff5619982dfb059de9e431d
|
||||
private final String bukkitVersion = Versioning.getBukkitVersion();
|
||||
private final Logger logger = Logger.getLogger("Minecraft");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index f30621be24c6c3a4f173436fce1ad1c13507c84f..f448ca4a3d789e301063888655ccb4275e3c32ed 100644
|
||||
index 4966a1e3dd35357a8ea6a7d2944c84c9c3e9058e..d9e66c74b41da9125ca153963397dfa4fa5df40f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -278,7 +278,7 @@ public class Main {
|
||||
@@ -285,7 +285,7 @@ public class Main {
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
// Paper start - This is some stupid bullshit
|
||||
System.err.println("*** Warning, you've not updated in a while! ***");
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Temporary Access Transformers
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
index 8f3b9b8784f0d7b137a1ad87655ee8bad801b59d..5153ae98bd80697a0e8bc71e5484c1f4f2817fe2 100644
|
||||
index b0204af850ee182773ad458208cccd946ad148d5..92980f04bc1bac9924907007eb63fd04eba3875c 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
@@ -205,7 +205,7 @@ public class BlockItem extends Item {
|
||||
@@ -207,7 +207,7 @@ public class BlockItem extends Item {
|
||||
}).orElse(state);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ index 0000000000000000000000000000000000000000..44245b61f64e4e2eb21ac4f5e540aa9a
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
index 01e424792f68bac73ec41726031ebbb53df13da7..7fa767185dcc73daa4500b6c66761ea4a19c34b5 100644
|
||||
index ecddb6fe55e8ee1ca3b163503dd62200ce2d7d04..7d613f50cd0c6469a74529a834f30490defdaa00 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
@@ -325,6 +325,32 @@ public final class PaperAdventure {
|
||||
@@ -63,7 +63,7 @@ index 01e424792f68bac73ec41726031ebbb53df13da7..7fa767185dcc73daa4500b6c66761ea4
|
||||
+ }
|
||||
+
|
||||
+ public static java.util.Optional<net.minecraft.sounds.SoundEvent> asVanillaSound(final Key key) {
|
||||
+ return net.minecraft.core.Registry.SOUND_EVENT.getOptional(asVanilla(key));
|
||||
+ return net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.getOptional(asVanilla(key));
|
||||
+ }
|
||||
+
|
||||
+ @SuppressWarnings("PatternValidation")
|
||||
@@ -76,14 +76,14 @@ index 01e424792f68bac73ec41726031ebbb53df13da7..7fa767185dcc73daa4500b6c66761ea4
|
||||
|
||||
public static @Nullable BinaryTagHolder asBinaryTagHolder(final @Nullable CompoundTag tag) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 79aa3374fd47cd57d2e0810bb5afebbdb38a1892..f4c9ff697bc86e1410e916df19c4eccf05c8af71 100644
|
||||
index 5a5ff40df37db9cbd53c584ed26a3ce4888b29c0..30c05db4ad0fcd5aa83cb3168ed32c7b0d205972 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1575,12 +1575,40 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1718,6 +1718,43 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
this.neighborUpdater.neighborChanged(state, pos, sourceBlock, sourcePos, notify);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSeededSound(@Nullable Player except, double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, long seed) {
|
||||
- this.server.getPlayerList().broadcast(except, x, y, z, (double) sound.getRange(volume), this.dimension(), new ClientboundSoundPacket(sound, category, x, y, z, volume, pitch, seed));
|
||||
+ public void playSeededSound(@org.jetbrains.annotations.Nullable Player except, double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch, long seed) {
|
||||
+ // Parchment start - sound event
|
||||
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
||||
+ except == null ? null : except.getBukkitEntity(),
|
||||
@@ -99,11 +99,10 @@ index 79aa3374fd47cd57d2e0810bb5afebbdb38a1892..f4c9ff697bc86e1410e916df19c4eccf
|
||||
+ null
|
||||
+ ));
|
||||
+ // Parchment end
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playSeededSound(@Nullable Player except, Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch, long seed) {
|
||||
- this.server.getPlayerList().broadcast(except, entity.getX(), entity.getY(), entity.getZ(), (double) sound.getRange(volume), this.dimension(), new ClientboundSoundEntityPacket(sound, category, entity, volume, pitch, seed));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void playSeededSound(@org.jetbrains.annotations.Nullable Player except, Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch, long seed) {
|
||||
+ // Parchment start - sound event
|
||||
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
||||
+ except == null ? null : except.getBukkitEntity(),
|
||||
@@ -119,18 +118,20 @@ index 79aa3374fd47cd57d2e0810bb5afebbdb38a1892..f4c9ff697bc86e1410e916df19c4eccf
|
||||
+ null
|
||||
+ ));
|
||||
+ // Parchment end
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
@Override
|
||||
public void broadcastEntityEvent(Entity entity, byte status) {
|
||||
this.getChunkSource().broadcastAndSend(entity, new ClientboundEntityEventPacket(entity, status));
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 9c9b4d7e0637348a94befce9377fdb69c1239694..69b3524ebb197430e90a3519b8165e472e1cf823 100644
|
||||
index 1d4d02f26391ac55c7631817f09d05e2769b0d29..cbcc4141c904360127780d6441a960842e661ef0 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2250,7 +2250,19 @@ public class ServerPlayer extends Player {
|
||||
@@ -2270,7 +2270,19 @@ public class ServerPlayer extends Player {
|
||||
|
||||
@Override
|
||||
public void playNotifySound(SoundEvent event, SoundSource category, float volume, float pitch) {
|
||||
- this.connection.send(new ClientboundSoundPacket(event, category, this.getX(), this.getY(), this.getZ(), volume, pitch, this.random.nextLong()));
|
||||
- this.connection.send(new ClientboundSoundPacket(BuiltInRegistries.SOUND_EVENT.wrapAsHolder(event), category, this.getX(), this.getY(), this.getZ(), volume, pitch, this.random.nextLong()));
|
||||
+ // Parchment start - sound event
|
||||
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
||||
+ null,
|
||||
@@ -148,27 +149,27 @@ index 9c9b4d7e0637348a94befce9377fdb69c1239694..69b3524ebb197430e90a3519b8165e47
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 3be9352ae9b0b84acf07064b45562ceffd30391b..b0dd96bb3af3ec7157c62c515ac09d8364eef9f5 100644
|
||||
index c0c14766adaac855112f85a203a6163b8adfdded..d59d36c8a77524d5ac0c25a4ef1cf57f339eeda2 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -984,7 +984,7 @@ public abstract class PlayerList {
|
||||
if (flag2 && !isLocAltered) {
|
||||
BlockState data = worldserver1.getBlockState(blockposition);
|
||||
worldserver1.setBlock(blockposition, data.setValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE, data.getValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE) - 1), 3);
|
||||
@@ -932,7 +932,7 @@ public abstract class PlayerList {
|
||||
BlockState data = worldserver1.getBlockState(blockposition);
|
||||
worldserver1.setBlock(blockposition, data.setValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE, data.getValue(net.minecraft.world.level.block.RespawnAnchorBlock.CHARGE) - 1), 3);
|
||||
}
|
||||
- entityplayer1.connection.send(new ClientboundSoundPacket(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, (double) location.getX(), (double) location.getY(), (double) location.getZ(), 1.0F, 1.0F, worldserver1.getRandom().nextLong()));
|
||||
+ entityplayer1.playNotifySound(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, 1.0F, 1.0F); // Parchment - use existing play sound method
|
||||
+ entityplayer1.playNotifySound(SoundEvents.RESPAWN_ANCHOR_DEPLETE.value(), SoundSource.BLOCKS, 1.0F, 1.0F); // Parchment - use existing play sound method
|
||||
// Paper end
|
||||
}
|
||||
// Added from changeDimension
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 0ea101f155936f7c340d9e1d1077c58b72551027..baa4aa10f40de237d44aa1e692657d2a36eb7a66 100644
|
||||
index 0629c471d38a77c44fc1c86ccdfcb0690f61ca17..791e9f43afae265f7f32588db2d6f2092c5f32c7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1917,7 +1917,21 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1891,7 +1891,21 @@ public abstract class Player extends LivingEntity {
|
||||
private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) {
|
||||
fromEntity.level.playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself
|
||||
if (fromEntity instanceof ServerPlayer) {
|
||||
- ((ServerPlayer) fromEntity).connection.send(new net.minecraft.network.protocol.game.ClientboundSoundPacket(soundEffect, soundCategory, x, y, z, volume, pitch, fromEntity.random.nextLong()));
|
||||
- ((ServerPlayer) fromEntity).connection.send(new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.wrapAsHolder(soundEffect), soundCategory, x, y, z, volume, pitch, fromEntity.random.nextLong()));
|
||||
+ // Parchment start - sound event
|
||||
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
||||
+ null,
|
||||
@@ -188,40 +189,23 @@ index 0ea101f155936f7c340d9e1d1077c58b72551027..baa4aa10f40de237d44aa1e692657d2a
|
||||
}
|
||||
// Paper end
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
index 6a0a1731fd6804eb69d3641213712d31bce085b2..81819d12e0becde85b6d66f3b3ffedde847a72f6 100644
|
||||
index 879c3bb661e24b9682b654def57c2800f4f8ca92..78c2067b9683611ea31cfe1c95755aa9e23e5982 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -526,7 +526,7 @@ public class Raid {
|
||||
float f = 13.0F;
|
||||
boolean flag = true;
|
||||
Collection<ServerPlayer> collection = this.raidEvent.getPlayers();
|
||||
- long i = this.random.nextLong();
|
||||
+ //long i = this.random.nextLong(); // Parchment - remove redundant variable
|
||||
Iterator iterator = this.level.players().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -538,7 +538,7 @@ public class Raid {
|
||||
double d2 = vec3d.z + 13.0D / d0 * (vec3d1.z - vec3d.z);
|
||||
|
||||
if (d0 <= 64.0D || collection.contains(entityplayer)) {
|
||||
- entityplayer.connection.send(new ClientboundSoundPacket(SoundEvents.RAID_HORN, SoundSource.NEUTRAL, d1, entityplayer.getY(), d2, 64.0F, 1.0F, i));
|
||||
+ entityplayer.playNotifySound(SoundEvents.RAID_HORN, SoundSource.NEUTRAL, 64.0F, 1.0F); // Parchment - use existing play sound method
|
||||
+ entityplayer.playNotifySound(SoundEvents.RAID_HORN.value(), SoundSource.NEUTRAL, 64.0F, 1.0F); // Parchment - use existing play sound method
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 03b3f29bde2bf6cb4e7b08a775bcc380a9404543..a37bc950d24acee9889aded042ed2bc3a0d76929 100644
|
||||
index cdb8ec04f4a19ec3dbedbd5b17a7d1f3afaa238e..42b9f8d0b038a26fb3689bc0e974ceeed4de4254 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2,7 +2,6 @@ package org.bukkit.craftbukkit.event;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Functions;
|
||||
-import com.google.common.collect.Lists;
|
||||
import com.mojang.datafixers.util.Either;
|
||||
import java.net.InetAddress;
|
||||
import java.util.ArrayList;
|
||||
@@ -1921,4 +1920,52 @@ public class CraftEventFactory {
|
||||
@@ -1945,4 +1945,53 @@ public class CraftEventFactory {
|
||||
return event.callEvent();
|
||||
}
|
||||
// Paper end
|
||||
@@ -239,21 +223,22 @@ index 03b3f29bde2bf6cb4e7b08a775bcc380a9404543..a37bc950d24acee9889aded042ed2bc3
|
||||
+ // handle vanilla sounds
|
||||
+ if (soundEvent.isPresent()) {
|
||||
+ if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.EntityEmitter entityEmitter)
|
||||
+ return new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(soundEvent.get(), source, ((CraftEntity) entityEmitter.entity()).getHandle(), volume, pitch, seed);
|
||||
+ return new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(net.minecraft.core.Holder.direct(soundEvent.get()), source, ((CraftEntity) entityEmitter.entity()).getHandle(), volume, pitch, seed);
|
||||
+ else if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.LocationEmitter locationEmitter) {
|
||||
+ Location loc = locationEmitter.location();
|
||||
+ return new net.minecraft.network.protocol.game.ClientboundSoundPacket(soundEvent.get(), source, loc.getX(), loc.getY(), loc.getZ(), volume, pitch, seed);
|
||||
+ return new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.Holder.direct(soundEvent.get()), source, loc.getX(), loc.getY(), loc.getZ(), volume, pitch, seed);
|
||||
+ }
|
||||
+ else
|
||||
+ throw new IllegalArgumentException("Unknown emitter type: " + emitter.getClass().getName());
|
||||
+ }
|
||||
+ // handle custom sounds
|
||||
+ else {
|
||||
+ // warn if trying to use EntityEmitter with custom sound
|
||||
+ if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.EntityEmitter)
|
||||
+ org.slf4j.LoggerFactory.getLogger("SoundEvent").warn("Sound event is using a custom sound ({}) which cannot be used with EntityEmitter. Falling back to playing at the entity's location.", sound.name().asString());
|
||||
+ Vec3 pos = org.bukkit.craftbukkit.util.CraftVector.toNMS(emitter.location().toVector());
|
||||
+ return new net.minecraft.network.protocol.game.ClientboundCustomSoundPacket(io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.name()), source, pos, volume, pitch, seed);
|
||||
+ return null; // ClientboundCustomSoundPacket was removed and the standard packet now supports custom sounds
|
||||
+// // warn if trying to use EntityEmitter with custom sound
|
||||
+// if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.EntityEmitter)
|
||||
+// org.slf4j.LoggerFactory.getLogger("SoundEvent").warn("Sound event is using a custom sound ({}) which cannot be used with EntityEmitter. Falling back to playing at the entity's location.", sound.name().asString());
|
||||
+// Vec3 pos = org.bukkit.craftbukkit.util.CraftVector.toNMS(emitter.location().toVector());
|
||||
+// return new net.minecraft.network.protocol.game.ClientboundCustomSoundPacket(io.papermc.paper.adventure.PaperAdventure.asVanilla(sound.name()), source, pos, volume, pitch, seed);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerUseRespawnAnchorEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
index 491ad2098e982f3c947fcae6f258f0b1aa44a562..7d33dae2617991bce244ad906df7053c22e3f515 100644
|
||||
index bcea8af63b9911c36873290e5c34567b1eeaacf4..a630bba5d7b8e5e18346cd2b8cc5d6dbc66c8a53 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
@@ -51,23 +51,48 @@ public class RespawnAnchorBlock extends Block {
|
||||
@@ -52,23 +52,46 @@ public class RespawnAnchorBlock extends Block {
|
||||
@Override
|
||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
ItemStack itemStack = player.getItemInHand(hand);
|
||||
@@ -32,18 +32,16 @@ index 491ad2098e982f3c947fcae6f258f0b1aa44a562..7d33dae2617991bce244ad906df7053c
|
||||
+ } else {
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ }
|
||||
+
|
||||
+ if (bukkitPlayer != null) {
|
||||
+ gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent event = new gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent(bukkitPlayer, block, result);
|
||||
+ event.callEvent();
|
||||
+ result = event.getResult();
|
||||
+ }
|
||||
+
|
||||
+ if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.NOTHING) {
|
||||
+ return InteractionResult.PASS;
|
||||
+ } else if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.CHARGE) {
|
||||
+ // Parchment end
|
||||
charge(world, pos, state);
|
||||
charge(player, world, pos, state);
|
||||
if (!player.getAbilities().instabuild) {
|
||||
itemStack.shrink(1);
|
||||
}
|
||||
@@ -57,7 +55,7 @@ index 491ad2098e982f3c947fcae6f258f0b1aa44a562..7d33dae2617991bce244ad906df7053c
|
||||
- }
|
||||
-
|
||||
- return InteractionResult.sidedSuccess(world.isClientSide);
|
||||
+ // Parchment start -- PlayerUseRespawnAnchorEvent
|
||||
+ // Parchment start -- PlayerUseRespawnAnchorEvent
|
||||
+ } else if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.EXPLODE) {
|
||||
+ this.explode(state, world, pos);
|
||||
+ return InteractionResult.CONSUME;
|
||||
@@ -65,11 +63,3 @@ index 491ad2098e982f3c947fcae6f258f0b1aa44a562..7d33dae2617991bce244ad906df7053c
|
||||
} else {
|
||||
if (!world.isClientSide) {
|
||||
ServerPlayer serverPlayer = (ServerPlayer)player;
|
||||
@@ -82,7 +107,6 @@ public class RespawnAnchorBlock extends Block {
|
||||
// Paper end
|
||||
}
|
||||
}
|
||||
-
|
||||
return InteractionResult.CONSUME;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,180 +4,34 @@ Date: Fri, 18 Jun 2021 14:04:39 -0400
|
||||
Subject: [PATCH] Add origin location to EntityDamageByBlockEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/damagesource/BadRespawnPointDamage.java b/src/main/java/net/minecraft/world/damagesource/BadRespawnPointDamage.java
|
||||
index 968c915cc494bb3c57169b7b3640002c3a4a8810..0c2b2cb4be57b11d748d13a0ec24b7470619267f 100644
|
||||
--- a/src/main/java/net/minecraft/world/damagesource/BadRespawnPointDamage.java
|
||||
+++ b/src/main/java/net/minecraft/world/damagesource/BadRespawnPointDamage.java
|
||||
@@ -7,12 +7,20 @@ import net.minecraft.network.chat.HoverEvent;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
|
||||
public class BadRespawnPointDamage extends DamageSource {
|
||||
+ @Deprecated // Parchment
|
||||
protected BadRespawnPointDamage() {
|
||||
super("badRespawnPoint");
|
||||
this.setScalesWithDifficulty();
|
||||
this.setExplosion();
|
||||
}
|
||||
|
||||
+ // Parchment start
|
||||
+ protected BadRespawnPointDamage(org.bukkit.Location location) {
|
||||
+ this();
|
||||
+ location(location);
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+
|
||||
@Override
|
||||
public Component getLocalizedDeathMessage(LivingEntity entity) {
|
||||
Component component = ComponentUtils.wrapInSquareBrackets(Component.translatable("death.attack.badRespawnPoint.link")).withStyle((style) -> {
|
||||
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
index 67bce77093dcc126098731047447da2031e3388d..051cf78fe9f7700e1f639c804f35903c8079eae9 100644
|
||||
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
|
||||
@@ -77,6 +77,18 @@ public class DamageSource {
|
||||
return this;
|
||||
}
|
||||
// Paper end
|
||||
+ // Parchment start
|
||||
+ private @Nullable org.bukkit.Location location;
|
||||
+
|
||||
+ public @Nullable org.bukkit.Location getLocation() {
|
||||
+ return location;
|
||||
+ }
|
||||
+
|
||||
+ public DamageSource location(@Nullable org.bukkit.Location location) {
|
||||
+ this.location = location;
|
||||
+ return this;
|
||||
+ }
|
||||
+ // Parchment end
|
||||
|
||||
public static DamageSource sting(LivingEntity attacker) {
|
||||
return new EntityDamageSource("sting", attacker);
|
||||
@@ -127,7 +139,7 @@ public class DamageSource {
|
||||
}
|
||||
|
||||
public static DamageSource explosion(@Nullable Explosion explosion) {
|
||||
- return DamageSource.explosion(explosion != null ? explosion.getSourceMob() : null);
|
||||
+ return DamageSource.explosion(explosion != null ? explosion.getSourceMob() : null).location(explosion != null ? explosion.getBukkitLocation() : null); // Parchment
|
||||
}
|
||||
|
||||
public static DamageSource explosion(@Nullable LivingEntity attacker) {
|
||||
@@ -138,10 +150,17 @@ public class DamageSource {
|
||||
return (new EntityDamageSource("sonic_boom", attacker)).bypassArmor().bypassEnchantments().setMagic();
|
||||
}
|
||||
|
||||
+ @Deprecated // Parchment
|
||||
public static DamageSource badRespawnPointExplosion() {
|
||||
return new BadRespawnPointDamage();
|
||||
}
|
||||
|
||||
+ // Parchment start
|
||||
+ public static DamageSource badRespawnPointExplosion(org.bukkit.Location location) {
|
||||
+ return new BadRespawnPointDamage(location);
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+
|
||||
public String toString() {
|
||||
return "DamageSource (" + this.msgId + ")";
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
index b786bd5178a605a5dfb7682b7cb809646895aea3..d986103d2d20be4514ce91fe27e42d0f7f1ca72b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
@@ -98,7 +98,7 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
private final Node[] nodes = new Node[24];
|
||||
private final int[] nodeAdjacency = new int[24];
|
||||
private final BinaryHeap openSet = new BinaryHeap();
|
||||
- private Explosion explosionSource = new Explosion(null, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
|
||||
+ private Explosion explosionSource;// = new Explosion(null, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // CraftBukkit - reusable source for CraftTNTPrimed.getSource() // Parchment - moved into constructor to fix null world
|
||||
// Paper start - add var for save custom podium
|
||||
@Nullable
|
||||
private BlockPos podium;
|
||||
@@ -106,6 +106,7 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
|
||||
public EnderDragon(EntityType<? extends EnderDragon> entitytypes, Level world) {
|
||||
super(EntityType.ENDER_DRAGON, world);
|
||||
+ explosionSource = new Explosion(world, this, null, null, Double.NaN, Double.NaN, Double.NaN, Float.NaN, true, Explosion.BlockInteraction.DESTROY); // Parchment - fix null world
|
||||
this.subEntities = new EnderDragonPart[]{this.head, this.neck, this.body, this.tail1, this.tail2, this.tail3, this.wing1, this.wing2};
|
||||
this.setHealth(this.getMaxHealth());
|
||||
this.noPhysics = true;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
index 31708d1e94b557896d42199aa0bc6ed26a4c6d8a..786d43a991b94a355d8f52e81f5aa41cc11cfcb1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
@@ -477,6 +477,13 @@ public class Explosion {
|
||||
return this.toBlow;
|
||||
}
|
||||
|
||||
+ // Parchment start
|
||||
+ public @Nullable Location getBukkitLocation() {
|
||||
+ if (this.level == null) return null;
|
||||
+ return new Location(level.getWorld(), x, y, z);
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+
|
||||
public static enum BlockInteraction {
|
||||
|
||||
NONE, BREAK, DESTROY;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
index 654a859a37bf991c7a7fa8a44a3d20f8feb223db..52e6c9ea22273759ea9a827125bf561a62272ad9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
@@ -145,7 +145,10 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock
|
||||
world.removeBlock(blockposition1, false);
|
||||
}
|
||||
|
||||
- world.explode((Entity) null, DamageSource.badRespawnPointExplosion(), (ExplosionDamageCalculator) null, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0F, true, Explosion.BlockInteraction.DESTROY);
|
||||
+ // Parchment start
|
||||
+ org.bukkit.Location location = new org.bukkit.Location(world.getWorld(), blockposition.getX() + 0.5D, blockposition.getY() + 0.5D, blockposition.getZ() + 0.5D);
|
||||
+ world.explode((Entity) null, DamageSource.badRespawnPointExplosion(location), (ExplosionDamageCalculator) null, location.getX(), location.getY(), location.getZ(), 5.0F, true, Explosion.BlockInteraction.DESTROY);
|
||||
+ // Parchment end
|
||||
return InteractionResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
index 6be6adf73dc48ebbac22fe2a9be635f675f18cb1..e814c791137da2a10f4d4dd65f201fc220399975 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
@@ -148,7 +148,10 @@ public class RespawnAnchorBlock extends Block {
|
||||
return pos.equals(explodedPos) && bl2 ? Optional.of(Blocks.WATER.getExplosionResistance()) : super.getBlockExplosionResistance(explosion, world, pos, blockState, fluidState);
|
||||
}
|
||||
};
|
||||
- world.explode((Entity)null, DamageSource.badRespawnPointExplosion(), explosionDamageCalculator, (double)explodedPos.getX() + 0.5D, (double)explodedPos.getY() + 0.5D, (double)explodedPos.getZ() + 0.5D, 5.0F, true, Explosion.BlockInteraction.DESTROY);
|
||||
+ // Parchment start
|
||||
+ org.bukkit.Location location = new org.bukkit.Location(world.getWorld(), explodedPos.getX() + 0.5D, explodedPos.getY() + 0.5D, explodedPos.getZ() + 0.5D);
|
||||
+ world.explode((Entity)null, DamageSource.badRespawnPointExplosion(location), explosionDamageCalculator, location.getX(), location.getY(), location.getZ(), 5.0F, true, Explosion.BlockInteraction.DESTROY);
|
||||
+ // Parchment end
|
||||
}
|
||||
|
||||
public static boolean canSetSpawn(Level world) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index a37bc950d24acee9889aded042ed2bc3a0d76929..e9847ba8dde5b9efb5214973f1399460ddcf930f 100644
|
||||
index 42b9f8d0b038a26fb3689bc0e974ceeed4de4254..7f6266a0b4703a580571928fa4aa1a5b0caf0a39 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -970,7 +970,7 @@ public class CraftEventFactory {
|
||||
@@ -971,7 +971,7 @@ public class CraftEventFactory {
|
||||
CraftEventFactory.entityDamage = null;
|
||||
EntityDamageEvent event;
|
||||
if (damager == null) {
|
||||
- event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, modifiers, modifierFunctions);
|
||||
+ event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, source.getLocation(), modifiers, modifierFunctions); // Parchment - add location
|
||||
+ event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.BLOCK_EXPLOSION, source.getEntity().getBukkitEntity().getLocation(), modifiers, modifierFunctions);
|
||||
} else if (entity instanceof EnderDragon && /*PAIL FIXME ((EntityEnderDragon) entity).target == damager*/ false) {
|
||||
event = new EntityDamageEvent(entity.getBukkitEntity(), DamageCause.ENTITY_EXPLOSION, modifiers, modifierFunctions);
|
||||
} else {
|
||||
@@ -1010,7 +1010,7 @@ public class CraftEventFactory {
|
||||
@@ -1014,7 +1014,7 @@ public class CraftEventFactory {
|
||||
|
||||
return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API
|
||||
} else if (source == DamageSource.OUT_OF_WORLD) {
|
||||
} else if (source.is(DamageTypes.OUT_OF_WORLD)) {
|
||||
- EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, modifiers, modifierFunctions);
|
||||
+ EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, entity.getBukkitEntity().getLocation(), modifiers, modifierFunctions); // Parchment - add location
|
||||
+ EntityDamageEvent event = new EntityDamageByBlockEvent(null, entity.getBukkitEntity(), DamageCause.VOID, entity.getBukkitEntity().getLocation(), modifiers, modifierFunctions);
|
||||
event.setCancelled(cancelled);
|
||||
CraftEventFactory.callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
@@ -1020,7 +1020,7 @@ public class CraftEventFactory {
|
||||
@@ -1024,7 +1024,7 @@ public class CraftEventFactory {
|
||||
}
|
||||
return event;
|
||||
} else if (source == DamageSource.LAVA) {
|
||||
} else if (source.is(DamageTypes.LAVA)) {
|
||||
- EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, modifiers, modifierFunctions));
|
||||
+ EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, entity.getBukkitEntity().getLocation().toBlockLocation(), modifiers, modifierFunctions)); // Parchment - add location
|
||||
+ EntityDamageEvent event = (new EntityDamageByBlockEvent(CraftEventFactory.blockDamage, entity.getBukkitEntity(), DamageCause.LAVA, blockDamage.getLocation(), modifiers, modifierFunctions));
|
||||
event.setCancelled(cancelled);
|
||||
|
||||
Block damager = CraftEventFactory.blockDamage;
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add UnsafeValues#canPlaceItemOn
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 103ab25119bfcdd21eac7e1deeac025108e3c138..4743d462ce712e312decdb40fdfdfe6b71468b94 100644
|
||||
index 64c50c52c11214740de7903e5592b8b6b2c170b3..be2739875ba1ba1a973c4a45c7e6a6996f0daf31 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -624,6 +624,55 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -618,6 +618,55 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
|
||||
@@ -5,19 +5,19 @@ Subject: [PATCH] Add Player#setGameProfile
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index baa4aa10f40de237d44aa1e692657d2a36eb7a66..ce0b0a1fd49afcb3c88b26bd6b361c735cab0b09 100644
|
||||
index 791e9f43afae265f7f32588db2d6f2092c5f32c7..460edabad8327acd4ba86924a220605181a97cd8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1521,6 +1521,12 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1509,6 +1509,12 @@ public abstract class Player extends LivingEntity {
|
||||
return this.gameProfile;
|
||||
}
|
||||
|
||||
+ // Parchment start | TODO: rename to match getter
|
||||
+ // Parchment start
|
||||
+ public void setProfile(GameProfile gameProfile) {
|
||||
+ this.gameProfile = gameProfile;
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+
|
||||
@Nullable
|
||||
public ProfilePublicKey getProfilePublicKey() {
|
||||
return this.profilePublicKey;
|
||||
public Inventory getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose MCUtil Executors
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 53e4a8db9ff5619982dfb059de9e431dbe2edc57..e8da5c60be1aabfb4047177db0a15952af59325e 100644
|
||||
index 2a8ad9afaa53d80d3926d9f1e1181c54aa8a849e..bc70b8d1e0954196a82e8673bc49b9438a4d838f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2911,4 +2911,16 @@ public final class CraftServer implements Server {
|
||||
@@ -2919,4 +2919,16 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
// Paper end
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix missing CraftMetaSkull serializedProfile
|
||||
Plugins (ab)using NMS may change the "profile" field using reflections instead of the "setProfile" method, especially if they are targeted towards old Minecraft versions. This fixes the potential discrepancies and NPEs.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
index 92b56f16b4d8107ccf206be6b81a98dc58986c10..0882d7271c51d79c4d089ec643d633bb0a81ef07 100644
|
||||
index deed77a3d44bc55681483d7f47f148b5220135f2..5b4100f0fcd29660b4738d908d2bda677f206cc4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
@@ -96,6 +96,11 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
@@ -131,6 +131,11 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
|
||||
private void setProfile(GameProfile profile) {
|
||||
this.profile = profile;
|
||||
@@ -21,7 +21,7 @@ index 92b56f16b4d8107ccf206be6b81a98dc58986c10..0882d7271c51d79c4d089ec643d633bb
|
||||
this.serializedProfile = (profile == null) ? null : NbtUtils.writeGameProfile(new CompoundTag(), profile);
|
||||
}
|
||||
|
||||
@@ -104,6 +109,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
@@ -139,6 +144,7 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
super.applyToItem(tag);
|
||||
|
||||
if (this.profile != null) {
|
||||
@@ -29,12 +29,12 @@ index 92b56f16b4d8107ccf206be6b81a98dc58986c10..0882d7271c51d79c4d089ec643d633bb
|
||||
// SPIGOT-6558: Set initial textures
|
||||
tag.put(SKULL_OWNER.NBT, serializedProfile);
|
||||
// Fill in textures
|
||||
@@ -243,6 +249,8 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
@@ -301,6 +307,8 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
if (meta instanceof CraftMetaSkull) {
|
||||
CraftMetaSkull that = (CraftMetaSkull) meta;
|
||||
|
||||
+ refreshSerializedProfile(); // Parchment -- fix NPEs from plugins abusing NMS
|
||||
+ that.refreshSerializedProfile(); // Parchment -- fix NPEs from plugins abusing NMS
|
||||
// SPIGOT-5403: equals does not check properties
|
||||
return (this.profile != null ? that.profile != null && this.serializedProfile.equals(that.serializedProfile) : that.profile == null);
|
||||
return (this.profile != null ? that.profile != null && this.serializedProfile.equals(that.serializedProfile) : that.profile == null) && Objects.equals(this.noteBlockSound, that.noteBlockSound);
|
||||
}
|
||||
@@ -8,19 +8,19 @@ to easily get the items being dropped by any
|
||||
block instead of only blocks broken by players.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index 2e65b44f10aeb44fd524a58e7eb815a566c1ad61..cdeecf0032db60385db19d6a6607da792f532a79 100644
|
||||
index 4f91e4832a94c3facbc711fcae4cb5ad540a5ca0..c357e09705c5405dc8fac666fc39c993febdee50 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -308,7 +308,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -306,7 +306,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
ServerLevel worldserver = lootContext.getLevel();
|
||||
BlockPos blockposition = new BlockPos((Vec3) lootContext.getParameter(LootContextParams.ORIGIN));
|
||||
BlockPos blockposition = BlockPos.containing((Position) lootContext.getParameter(LootContextParams.ORIGIN));
|
||||
|
||||
- state.getDrops(lootContext).forEach((itemstack) -> {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(worldserver, blockposition, state.getDrops(lootContext)).forEach((itemstack) -> { // Parchment
|
||||
Block.popResource(worldserver, blockposition, itemstack);
|
||||
});
|
||||
state.spawnAfterBreak(worldserver, blockposition, ItemStack.EMPTY, true);
|
||||
@@ -316,7 +316,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -314,7 +314,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
|
||||
public static void dropResources(BlockState state, Level world, BlockPos pos) {
|
||||
if (world instanceof ServerLevel) {
|
||||
@@ -29,7 +29,7 @@ index 2e65b44f10aeb44fd524a58e7eb815a566c1ad61..cdeecf0032db60385db19d6a6607da79
|
||||
Block.popResource(world, pos, itemstack);
|
||||
});
|
||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
||||
@@ -326,7 +326,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -324,7 +324,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
|
||||
public static void dropResources(BlockState state, LevelAccessor world, BlockPos pos, @Nullable BlockEntity blockEntity) {
|
||||
if (world instanceof ServerLevel) {
|
||||
@@ -38,20 +38,21 @@ index 2e65b44f10aeb44fd524a58e7eb815a566c1ad61..cdeecf0032db60385db19d6a6607da79
|
||||
Block.popResource((ServerLevel) world, pos, itemstack);
|
||||
});
|
||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
||||
@@ -353,7 +353,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -351,7 +351,8 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
|
||||
public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, Entity entity, ItemStack stack) {
|
||||
public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, Entity entity, ItemStack tool) {
|
||||
if (world instanceof ServerLevel) {
|
||||
- Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, stack).forEach((itemstack1) -> {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(world, pos, Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, stack)).forEach((itemstack1) -> { // Parchment
|
||||
- Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool).forEach((itemstack1) -> {
|
||||
+
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callBlockDropResourcesEvent(world, pos, Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool)).forEach((itemstack1) -> { // Parchment
|
||||
Block.popResource(world, pos, itemstack1);
|
||||
});
|
||||
state.spawnAfterBreak((ServerLevel) world, pos, stack, true);
|
||||
state.spawnAfterBreak((ServerLevel) world, pos, tool, true);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index e9847ba8dde5b9efb5214973f1399460ddcf930f..13e30a3ad79df17c180ba95ab9f41eb39f93e726 100644
|
||||
index 7f6266a0b4703a580571928fa4aa1a5b0caf0a39..7681fc8163f6ac17a7d26fd6f5c5113eb634640e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1967,5 +1967,19 @@ public class CraftEventFactory {
|
||||
@@ -1993,5 +1993,19 @@ public class CraftEventFactory {
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -215,10 +215,10 @@ index 0000000000000000000000000000000000000000..e7114e456f818d7bdd4081620f4b9b93
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 72ed25022d5ea1074304be3c72b23882b8f0f88a..22457dfb3c4a2489f79e2f977f415d2938db0d27 100644
|
||||
index 5e9055fdf411029ea2fed91acd6b981f79156418..9f719150a0369ddb76da88635e05ff701759a1ed 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2376,4 +2376,11 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -2395,4 +2395,11 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
return this.adventure$pointers;
|
||||
}
|
||||
// Paper end
|
||||
@@ -226,7 +226,7 @@ index 72ed25022d5ea1074304be3c72b23882b8f0f88a..22457dfb3c4a2489f79e2f977f415d29
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
+ public ItemStack smeltItem(ItemStack toSmelt, gg.projecteden.parchment.inventory.RecipeType recipeType) {
|
||||
+ return world.getRecipeManager().getRecipeFor(gg.projecteden.parchment.inventory.CraftRecipeType.asCookingRecipe(recipeType), new gg.projecteden.parchment.inventory.SingletonContainer(toSmelt), world).map(recipe -> recipe.getResultItem().getBukkitStack()).orElse(null);
|
||||
+ return world.getRecipeManager().getRecipeFor(gg.projecteden.parchment.inventory.CraftRecipeType.asCookingRecipe(recipeType), new gg.projecteden.parchment.inventory.SingletonContainer(toSmelt), world).map(recipe -> recipe.getResultItem(world.registryAccess()).getBukkitStack()).orElse(null);
|
||||
+ }
|
||||
+ // Parchment end
|
||||
}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable sleep status announcements
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index f4c9ff697bc86e1410e916df19c4eccf05c8af71..4102e9345df8e1413a4efb13ac022dc4a092a715 100644
|
||||
index 30c05db4ad0fcd5aa83cb3168ed32c7b0d205972..206bc729f24f679bed3b945b640778873699676a 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -957,7 +957,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -974,7 +974,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
private void announceSleepStatus() {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add config for ticking TIME_SINCE_REST
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
index 5982dda61e07f1661b0a68d0ba1fcc1122e8d428..0008c021d17b3333a5d4cc6fa954b24ede487e3e 100644
|
||||
index 4532f3a0d74feae0a1249b53e1bfbc18a8808b32..c66db0468a9ab09cc89805e7bf7be09e7a7a1746 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
@@ -255,6 +255,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -259,6 +259,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
}
|
||||
|
||||
public boolean disablePlayerCrits = false;
|
||||
@@ -17,10 +17,10 @@ index 5982dda61e07f1661b0a68d0ba1fcc1122e8d428..0008c021d17b3333a5d4cc6fa954b24e
|
||||
public PillagerPatrols pillagerPatrols;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index ce0b0a1fd49afcb3c88b26bd6b361c735cab0b09..cf41ff3be41b576123457bcb1e613378b6cce4de 100644
|
||||
index e428299aff0a75b8a9a82cac13429a6dc7ea7002..defe3bdf04b274f16e99c7d25e5f167480465c09 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -294,7 +294,7 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -291,7 +291,7 @@ public abstract class Player extends LivingEntity {
|
||||
this.awardStat(Stats.CROUCH_TIME);
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add HangingFrame Tick API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
index 334a47b5e0d205c57dfcbb17168cbd3f21d15606..1ffc318c12cde935aea58d6d1efff53818893bf9 100644
|
||||
index f7d031e9a5aa533d78a49ed6147dd47dd0f27f01..a22139bd4202237eb6977b95786b9a3647821874 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
@@ -41,6 +41,7 @@ public abstract class HangingEntity extends Entity {
|
||||
@@ -42,6 +42,7 @@ public abstract class HangingEntity extends Entity {
|
||||
private int checkInterval; { this.checkInterval = this.getId() % this.level.spigotConfig.hangingTickFrequency; } // Paper
|
||||
public BlockPos pos;
|
||||
protected Direction direction;
|
||||
@@ -16,7 +16,7 @@ index 334a47b5e0d205c57dfcbb17168cbd3f21d15606..1ffc318c12cde935aea58d6d1efff538
|
||||
|
||||
protected HangingEntity(EntityType<? extends HangingEntity> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -116,7 +117,7 @@ public abstract class HangingEntity extends Entity {
|
||||
@@ -117,7 +118,7 @@ public abstract class HangingEntity extends Entity {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
@@ -5,24 +5,24 @@ Subject: [PATCH] Add Player#getHiddenEntities API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index a5220a4e514865c70700527bcd2f941d852564c0..0950b5f97b3382d1e41da9837e1e0b7cce6ba1b4 100644
|
||||
index 0ae1fce0c1a2e3bfbbab756a088fc76545e263fa..4d768316f40fe6f239a8b75820d16ab8018f28f6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1838,6 +1838,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
registerEntity(player);
|
||||
}
|
||||
@@ -1903,6 +1903,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); // Paper
|
||||
}
|
||||
// Paper start
|
||||
+
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
+ public Set<UUID> getHiddenEntities(Plugin plugin) {
|
||||
+ return hiddenEntities.entrySet().stream()
|
||||
+ return invertedVisibilityEntities.entrySet().stream()
|
||||
+ .filter(entry -> entry.getValue().contains(CraftPlayer.getPluginWeakReference(plugin)))
|
||||
+ .map(Map.Entry::getKey)
|
||||
+ .collect(java.util.stream.Collectors.toSet());
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+ // Parchment end
|
||||
+
|
||||
@Override
|
||||
public void setPlayerProfile(com.destroystokyo.paper.profile.PlayerProfile profile) {
|
||||
ServerPlayer self = getHandle();
|
||||
self.gameProfile = com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile);
|
||||
ServerPlayer self = this.getHandle();
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Big Barrels
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
index f52487e1cfcfab1bf22ab2cb52f998283a86e340..9f8394d0348b068623b3acafe18b40a3ed0503d0 100644
|
||||
index 416aa989ebb18a8741cc9d605a1180ab830f6643..c48466a4d2115f4fa6121b6bcba87b838743af34 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
|
||||
@@ -67,7 +67,7 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Timings Events
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index 06bff37e4c1fddd3be6343049a66787c63fb420c..b6567f558cd25698208a06513c241646e0b28341 100644
|
||||
index c07eb451a576811a39021f6f97103c77488fd001..58fd2d024a9de3a9a31cde948bb9fc8b68f461bc 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -349,6 +349,8 @@ public class TimingsExport extends Thread {
|
||||
@@ -350,6 +350,8 @@ public class TimingsExport extends Thread {
|
||||
timingsURL = con.getHeaderField("Location");
|
||||
listeners.sendMessage(text("View Timings Report: ", NamedTextColor.GREEN).append(text(timingsURL).clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, timingsURL))));
|
||||
|
||||
@@ -4,57 +4,27 @@ Date: Sun, 24 Jul 2022 19:37:33 -0400
|
||||
Subject: [PATCH] Expanded Insomnia API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
||||
index 72abebff2018cde2922e97ad6478f93da9aed3ec..c541e80f7ab6772bdd4074f5df7075502b144a31 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
||||
@@ -36,6 +36,12 @@ public final class EntitySelector {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ // Parchment start
|
||||
+ if (((org.bukkit.entity.Player) player.getBukkitEntity()).doesBypassInsomnia()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+
|
||||
return net.minecraft.util.Mth.clamp(serverPlayer.getStats().getValue(net.minecraft.stats.Stats.CUSTOM.get(net.minecraft.stats.Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= playerInsomniaTicks;
|
||||
};
|
||||
// Paper end
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index cf41ff3be41b576123457bcb1e613378b6cce4de..853deb219785787f78c6eecad6237893eba9f03f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -294,7 +294,7 @@ public abstract class Player extends LivingEntity {
|
||||
this.awardStat(Stats.CROUCH_TIME);
|
||||
}
|
||||
|
||||
- if (!this.isSleeping() && this.level.paperConfig().entities.behavior.tickTimeSinceSleep) { // Parchment
|
||||
+ if (!this.isSleeping() && this.level.paperConfig().entities.behavior.tickTimeSinceSleep && !((org.bukkit.entity.Player) this.getBukkitEntity()).doesBypassInsomnia()) { // Parchment
|
||||
this.awardStat(Stats.TIME_SINCE_REST);
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 0950b5f97b3382d1e41da9837e1e0b7cce6ba1b4..b209c1b2e9a877af830c022756fd60c8c65ea8dd 100644
|
||||
index 4d768316f40fe6f239a8b75820d16ab8018f28f6..a3d3051b82b512c855fd87681a54817c32727b95 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -73,6 +73,7 @@ import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
@@ -76,6 +76,7 @@ import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
import net.minecraft.server.players.UserWhiteListEntry;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
+import net.minecraft.world.entity.EntitySelector;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeInstance;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeMap;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
@@ -176,6 +177,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -179,6 +180,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit
|
||||
private long lastSaveTime;
|
||||
// Paper end
|
||||
+ private boolean bypassesInsomnia = false;
|
||||
+ private boolean bypassesInsomnia = false; // Parchment - Insomnia api
|
||||
|
||||
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
||||
super(server, entity);
|
||||
@@ -1915,6 +1917,33 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2017,6 +2019,33 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add spam bypass permission
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index d31a345edfffe39f127073fc3aec8b3489bae79c..65e3378860a20ebbbd7765ce7b83c97d01437d4b 100644
|
||||
index 2d8488b9aa088b6d5f0c7e557b8ad0b29bc4cd88..64848434496e4897b696f975c330756befa1e9b4 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -875,16 +875,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -865,16 +865,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
|
||||
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async
|
||||
// CraftBukkit start
|
||||
@@ -29,7 +29,7 @@ index d31a345edfffe39f127073fc3aec8b3489bae79c..65e3378860a20ebbbd7765ce7b83c97d
|
||||
// Paper end
|
||||
// CraftBukkit end
|
||||
// Paper start - Don't suggest if tab-complete is disabled
|
||||
@@ -2617,6 +2620,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -2547,6 +2550,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
|
||||
// Spigot start - spam exclusions
|
||||
private void detectRateSpam(String s) {
|
||||
@@ -37,7 +37,7 @@ index d31a345edfffe39f127073fc3aec8b3489bae79c..65e3378860a20ebbbd7765ce7b83c97d
|
||||
// CraftBukkit start - replaced with thread safe throttle
|
||||
boolean counted = true;
|
||||
for ( String exclude : org.spigotmc.SpigotConfig.spamExclusions )
|
||||
@@ -3396,10 +3400,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
@@ -3268,10 +3272,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
|
||||
// Paper start
|
||||
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable set respawn message
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 69b3524ebb197430e90a3519b8165e472e1cf823..1f6e7d43885c65d2b083190a2c088d71f2b78617 100644
|
||||
index cbcc4141c904360127780d6441a960842e661ef0..0abb7d69f534089b06d7221327a9be282bb6006c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2200,10 +2200,10 @@ public class ServerPlayer extends Player {
|
||||
@@ -2220,10 +2220,10 @@ public class ServerPlayer extends Player {
|
||||
angle = (float) event.getLocation().getYaw();
|
||||
forced = event.isForced();
|
||||
// Paper end
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Make FixLight use action bar
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java b/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java
|
||||
index 450bd95218852174cfbc88d4517e17daee5ffd5f..794842cb3dfa0732ccecf625b97dbc6c311a8a18 100644
|
||||
index 7784d72ddd6db00c674e22759c00c430222c4b85..b336789b74d6d6819b38e78cb2014f61de3f004b 100644
|
||||
--- a/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java
|
||||
+++ b/src/main/java/io/papermc/paper/command/subcommands/FixLightCommand.java
|
||||
@@ -24,6 +24,7 @@ import static net.kyori.adventure.text.format.NamedTextColor.BLUE;
|
||||
18
patches/server/0022-Remove-Unneeded-Override.patch
Normal file
18
patches/server/0022-Remove-Unneeded-Override.patch
Normal file
@@ -0,0 +1,18 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Blast-Mc <cjblanton2@gmail.com>
|
||||
Date: Mon, 9 Jan 2023 19:21:16 -0500
|
||||
Subject: [PATCH] Remove Unneeded Override
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 206bc729f24f679bed3b945b640778873699676a..e035ee2e499c6322c08ce6aa14fdebe134777fa2 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1736,7 +1736,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// Parchment end
|
||||
}
|
||||
|
||||
- @Override
|
||||
public void playSeededSound(@org.jetbrains.annotations.Nullable Player except, Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch, long seed) {
|
||||
// Parchment start - sound event
|
||||
CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
||||
19
patches/server/0023-Remove-Hanging-Entity-Debug.patch
Normal file
19
patches/server/0023-Remove-Hanging-Entity-Debug.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Blast-MC <cjblanton2@gmail.com>
|
||||
Date: Wed, 1 Mar 2023 22:02:23 -0500
|
||||
Subject: [PATCH] Remove Hanging Entity Debug
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
index a22139bd4202237eb6977b95786b9a3647821874..47e93f5a3e9f8a71a121be0309e1307b1241bcf7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
@@ -273,7 +273,7 @@ public abstract class HangingEntity extends Entity {
|
||||
BlockPos blockposition = new BlockPos(nbt.getInt("TileX"), nbt.getInt("TileY"), nbt.getInt("TileZ"));
|
||||
|
||||
if (!blockposition.closerThan(this.blockPosition(), 16.0D)) {
|
||||
- HangingEntity.LOGGER.error("Hanging entity at invalid position: {}", blockposition);
|
||||
+ //HangingEntity.LOGGER.error("Hanging entity at invalid position: {}", blockposition);
|
||||
} else {
|
||||
this.pos = blockposition;
|
||||
}
|
||||
149
patches/server/0024-Add-PreEntityShootBowEvent.patch
Normal file
149
patches/server/0024-Add-PreEntityShootBowEvent.patch
Normal file
@@ -0,0 +1,149 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Blast-MC <cjblanton2@gmail.com>
|
||||
Date: Thu, 16 Mar 2023 23:11:05 -0400
|
||||
Subject: [PATCH] Add PreEntityShootBowEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
index f2094c52196b45adfd51d8aebcc4c46b779b0925..0498d3d0cee58e10351bd8c4ce7b9a3dbc862d09 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
@@ -199,13 +199,19 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
@Override
|
||||
public void performRangedAttack(LivingEntity target, float pullProgress) {
|
||||
ItemStack itemstack = this.getProjectile(this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW)));
|
||||
+
|
||||
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(this.getBukkitEntity(), this.getMainHandItem().asBukkitCopy(), itemstack.asBukkitCopy());
|
||||
+ if (!preEvent.callEvent()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
AbstractArrow entityarrow = this.getArrow(itemstack, pullProgress);
|
||||
double d0 = target.getX() - this.getX();
|
||||
double d1 = target.getY(0.3333333333333333D) - entityarrow.getY();
|
||||
double d2 = target.getZ() - this.getZ();
|
||||
double d3 = Math.sqrt(d0 * d0 + d2 * d2);
|
||||
|
||||
- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level.getDifficulty().getId() * 4));
|
||||
+ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level.getDifficulty().getId() * 4), preEvent.isRelative());
|
||||
// CraftBukkit start
|
||||
org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, net.minecraft.world.InteractionHand.MAIN_HAND, 0.8F, true); // Paper
|
||||
if (event.isCancelled()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||
index 10573602c9bc73713cbd6989762d3dbb6f6fcf8c..b65c31bc257e362247855faabf49aec6347cec86 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||
@@ -189,13 +189,19 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
||||
@Override
|
||||
public void performRangedAttack(LivingEntity target, float pullProgress) {
|
||||
ItemStack itemstack = this.getProjectile(this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW)));
|
||||
+
|
||||
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(this.getBukkitEntity(), this.getMainHandItem().asBukkitCopy(), itemstack.asBukkitCopy());
|
||||
+ if (!preEvent.callEvent()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
AbstractArrow entityarrow = ProjectileUtil.getMobArrow(this, itemstack, pullProgress);
|
||||
double d0 = target.getX() - this.getX();
|
||||
double d1 = target.getY(0.3333333333333333D) - entityarrow.getY();
|
||||
double d2 = target.getZ() - this.getZ();
|
||||
double d3 = Math.sqrt(d0 * d0 + d2 * d2);
|
||||
|
||||
- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level.getDifficulty().getId() * 4));
|
||||
+ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level.getDifficulty().getId() * 4), preEvent.isRelative());
|
||||
// Paper start
|
||||
org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, target.getUsedItemHand(), 0.8F, true);
|
||||
if (event.isCancelled()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
index 5d6d26cfe8f0ab68a3145214b3fc126ca7a71a66..e43357fd32866c340bf8a8cfe415529941512f22 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
@@ -129,8 +129,8 @@ public abstract class AbstractArrow extends Projectile {
|
||||
}
|
||||
|
||||
@Override
|
||||
- public void shoot(double x, double y, double z, float speed, float divergence) {
|
||||
- super.shoot(x, y, z, speed, divergence);
|
||||
+ public void shoot(double x, double y, double z, float speed, float divergence, boolean relative) {
|
||||
+ super.shoot(x, y, z, speed, divergence, relative);
|
||||
this.life = 0;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index 8b2a3a8482018b7db7de81bc295862f783e17ce5..bab146d88cf52e44087868a06ccdfcee67adf2b9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -145,9 +145,15 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
}
|
||||
|
||||
public void shoot(double x, double y, double z, float speed, float divergence) {
|
||||
+ shoot(x, y, z, speed, divergence, true);
|
||||
+ }
|
||||
+
|
||||
+ public void shoot(double x, double y, double z, float speed, float divergence, boolean relative) {
|
||||
Vec3 vec3d = (new Vec3(x, y, z)).normalize().add(this.random.triangle(0.0D, 0.0172275D * (double) divergence), this.random.triangle(0.0D, 0.0172275D * (double) divergence), this.random.triangle(0.0D, 0.0172275D * (double) divergence)).scale((double) speed);
|
||||
|
||||
- this.setDeltaMovement(vec3d);
|
||||
+ if (relative) {
|
||||
+ this.setDeltaMovement(vec3d);
|
||||
+ }
|
||||
double d3 = vec3d.horizontalDistance();
|
||||
|
||||
this.setYRot((float) (Mth.atan2(vec3d.x, vec3d.z) * 57.2957763671875D));
|
||||
@@ -157,6 +163,10 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
}
|
||||
|
||||
public void shootFromRotation(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence) {
|
||||
+ this.shootFromRotation(shooter, pitch, yaw, roll, speed, divergence, true);
|
||||
+ }
|
||||
+
|
||||
+ public void shootFromRotation(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence, boolean relative) {
|
||||
float f5 = -Mth.sin(yaw * 0.017453292F) * Mth.cos(pitch * 0.017453292F);
|
||||
float f6 = -Mth.sin((pitch + roll) * 0.017453292F);
|
||||
float f7 = Mth.cos(yaw * 0.017453292F) * Mth.cos(pitch * 0.017453292F);
|
||||
@@ -164,7 +174,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
this.shoot((double) f5, (double) f6, (double) f7, speed, divergence);
|
||||
Vec3 vec3d = shooter.getDeltaMovement();
|
||||
|
||||
- if (!shooter.level.paperConfig().misc.disableRelativeProjectileVelocity) this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.isOnGround() ? 0.0D : vec3d.y, vec3d.z)); // Paper - allow disabling relative velocity
|
||||
+ if (!shooter.level.paperConfig().misc.disableRelativeProjectileVelocity && relative) this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.isOnGround() ? 0.0D : vec3d.y, vec3d.z)); // Paper - allow disabling relative velocity
|
||||
}
|
||||
|
||||
// CraftBukkit start - call projectile hit event
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BowItem.java b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
index 08d597db1a5345a343777a01427655e6bf2c926b..c047a2cf20a3f02b2d4a2fb71306234ccfa84429 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
@@ -42,9 +42,15 @@ public class BowItem extends ProjectileWeaponItem implements Vanishable {
|
||||
|
||||
if (!world.isClientSide) {
|
||||
ArrowItem itemarrow = (ArrowItem) (itemstack1.getItem() instanceof ArrowItem ? itemstack1.getItem() : Items.ARROW);
|
||||
+
|
||||
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(entityhuman.getBukkitEntity(), stack.asBukkitCopy(), itemstack1.asBukkitCopy());
|
||||
+ if (!preEvent.callEvent()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
AbstractArrow entityarrow = itemarrow.createArrow(world, itemstack1, entityhuman);
|
||||
|
||||
- entityarrow.shootFromRotation(entityhuman, entityhuman.getXRot(), entityhuman.getYRot(), 0.0F, f * 3.0F, 1.0F);
|
||||
+ entityarrow.shootFromRotation(entityhuman, entityhuman.getXRot(), entityhuman.getYRot(), 0.0F, f * 3.0F, 1.0F, preEvent.isRelative());
|
||||
if (f == 1.0F) {
|
||||
entityarrow.setCritArrow(true);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
index bc4f04c2512191da3c9e1c49f0716bb9128fc754..27276ee045cb0475dcbd47130d943fcaf597d119 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
@@ -228,6 +228,11 @@ public class CrossbowItem extends ProjectileWeaponItem implements Vanishable {
|
||||
|
||||
private static void shootProjectile(Level world, LivingEntity shooter, InteractionHand hand, ItemStack crossbow, ItemStack projectile, float soundPitch, boolean creative, float speed, float divergence, float simulated) {
|
||||
if (!world.isClientSide) {
|
||||
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(shooter.getBukkitEntity(), crossbow.asBukkitCopy(), projectile.asBukkitCopy());
|
||||
+ if (!preEvent.callEvent()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
boolean flag1 = projectile.is(Items.FIREWORK_ROCKET);
|
||||
Object object;
|
||||
|
||||
19
patches/server/0025-Return-Displays-in-getTargetEntity.patch
Normal file
19
patches/server/0025-Return-Displays-in-getTargetEntity.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Blast-MC <cjblanton2@gmail.com>
|
||||
Date: Sun, 19 Mar 2023 20:02:00 -0400
|
||||
Subject: [PATCH] Return Displays in getTargetEntity
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index dcfb71b5a53df789e366fea2080921d677549a2e..755ae62d64c15358b2f88ab6471c9046ced74a66 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3988,7 +3988,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
Vec3 direction = this.getLookAngle();
|
||||
Vec3 end = start.add(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance);
|
||||
|
||||
- List<Entity> entityList = level.getEntities(this, getBoundingBox().expandTowards(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).inflate(1.0D, 1.0D, 1.0D), EntitySelector.NO_SPECTATORS.and(Entity::isPickable));
|
||||
+ List<Entity> entityList = level.getEntities(this, getBoundingBox().expandTowards(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).inflate(1.0D, 1.0D, 1.0D), EntitySelector.NO_SPECTATORS.and(entity -> entity.isPickable() || entity instanceof Display));
|
||||
|
||||
double distance = 0.0D;
|
||||
EntityHitResult result = null;
|
||||
@@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Blast-MC <cjblanton2@gmail.com>
|
||||
Date: Thu, 23 Mar 2023 18:18:43 -0400
|
||||
Subject: [PATCH] Make SynchedEntityData#packAll Public
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
||||
index ff7ba7a161cfed7521354bc6e3f21ba0f17f3760..8d17e503894858b9e195d70a74513dee60aa3ec3 100644
|
||||
--- a/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
||||
+++ b/src/main/java/net/minecraft/network/syncher/SynchedEntityData.java
|
||||
@@ -263,7 +263,7 @@ public class SynchedEntityData {
|
||||
// We need to pack all as we cannot rely on "non default values" or "dirty" ones.
|
||||
// Because these values can possibly be desynced on the client.
|
||||
@Nullable
|
||||
- private List<SynchedEntityData.DataValue<?>> packAll() {
|
||||
+ public List<SynchedEntityData.DataValue<?>> packAll() {
|
||||
if (this.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user